Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The live editor cannot display elk rendered graphs containing subgraphs #1305

Closed
bmitc opened this issue Sep 18, 2023 · 11 comments · Fixed by #1328
Closed

The live editor cannot display elk rendered graphs containing subgraphs #1305

bmitc opened this issue Sep 18, 2023 · 11 comments · Fixed by #1328
Labels
bug Something isn't working

Comments

@bmitc
Copy link

bmitc commented Sep 18, 2023

Describe the bug
When the renderer is set to elk, both the Mermaid Live Editor and the Mermaid CLI cannot display and process the graph if subgraphs are present.

To Reproduce
Link to Live Editor: Link for the below code

This:

%%{
init: {
    "flowchart": {
        "defaultRenderer": "elk"
    }
}}%%

flowchart TB

subgraph node
    A --> B
    A --> C
end

yields no rendered content and an error (displayed very low on the screen after scrolling):

image

Whereas the following renders just fine:

%%{
init: {
    "flowchart": {
        "defaultRenderer": "elk"
    }
}}%%

flowchart TB

    A --> B
    A --> C

Expected behavior
The diagram should render as expected.

Screenshots

See the above Mermaid.live links.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Edge
  • Version: I don't know. Version of what?

Additional context

Also, see mermaid-js/mermaid-cli#594 where the Mermaid CLI cannot process these graphs either. This is a major issue for me right now, as the elk renderer is needed for large, automatically generated graphs. For now, I have to remove any use of subgraphs to use the elk renderer.

@bmitc bmitc added the bug Something isn't working label Sep 18, 2023
@hd-deman
Copy link

same for me

@Penagwin
Copy link

Penagwin commented Nov 2, 2023

This is reportedly fixed in Mermaid-Chart/issue-tracker#17

Merging #1323 or even better #1328 should hopefully fix it.

@bmitc
Copy link
Author

bmitc commented Nov 2, 2023

The Mermaid Live Editor still shows the same error, so it's possible the fix doesn't work or it hasn't been deployed yet. This can be verified by clicking the link in the description.

@Penagwin
Copy link

Penagwin commented Nov 2, 2023

@bmitc Mermaid and it's editor are separate and the editor needs to use the newer version of mermaid.

The mermaid live editor is still on mermaid v10.5.0
I think the fix was merged into mermaid in v10.5.1

Which is why we need either PR #1323 or #1328 merged to fix this issue.

@huynhicode
Copy link
Member

Elk rendering for flowcharts with subgraphs is working in Mermaid Chart (official integration for Mermaid).

If you do not have an account, you can sign up for a free one.

Screenshot 2023-11-03 at 11 39 10 AM

@Penagwin
Copy link

Penagwin commented Nov 3, 2023

@bmitc

It's working in the #1328 PR preview for this repo if you want to use that
https://deploy-preview-1328--mermaidjs.netlify.app/edit

@Penagwin
Copy link

Penagwin commented Nov 7, 2023

Elk rendering for flowcharts with subgraphs is working in Mermaid Chart (official integration for Mermaid).

If you do not have an account, you can sign up for a free one.
@huynhicode

I am confused, is mermaid-live-editor no longer being maintained?

@huynhicode
Copy link
Member

huynhicode commented Nov 7, 2023

The Mermaid team is actively maintaining Mermaid Live and Mermaid JS.

Mermaid Chart is built on top of Mermaid and is the official integration of the open-source project. The Mermaid Chart Editor includes the same functionality as Mermaid Live with additional features (i.e. AI Chatbot, Code Snippets, etc).

@sidharthv96
Copy link
Member

I am confused, is mermaid-live-editor no longer being maintained?

Yes, it's being maintained. I was on vacation recently, so we have few PRs pending. Catching up with everything.
#1328 is merged and will be released soon.

@sidharthv96 sidharthv96 linked a pull request Nov 9, 2023 that will close this issue
1 task
@sidharthv96
Copy link
Member

Working now.

@Penagwin
Copy link

Penagwin commented Nov 9, 2023

@sidharthv96 Ah okay, I was confused by whether the referral to the paid product was the intended solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants