-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Flowchart node spacing doesn't apply when using subgraph #3258
Comments
Bump! This is also the case for rankSpacing within subgraphs — subgraph spacing just seems to revert back to the default. |
I have also encountered this error. |
RankSpacing and NodeSpacing are not passed to subgraphs. Confirmed |
I hit this and noticed something in the behavior I thought should be recorded here. First, I'm taking your exact example above and I get this on mermaid.live: mermaid link Here is an imgur link of the result. I found that if you do a link from an internal node to an internal node in another subgraph, the spacing is acknowledged. I took your code and just added a link from B to A:
And I get this in mermaid: mermaid link now. Here is an imgur link with the result. I don't know what that implies, but it may help indicate what the root of the issue is. Editing to add: You'll note that link reverses the subgraphs. But if you point B to A after the subgraphs, it maintains the order. Here is a hacky workaround for your contrived example that puts the spacing right by using an invisible link:
But of course, for that workaround to apply, you have to have more than one subgraph and you have to hope the invisible link doesn't mess up the layout of your nodes. |
any good news? |
My apologies, I meant to close the issue #5178 as duplicate and instead accidentally closed it implying solved. This comment is to clarify that the issue with flowchart spacing has not been solved yet |
I didn't find the documentation, but have you guys noticed that in the example nodeSpacing is a number and rankSpacing is a string? Don't know if it is relevant.. but thought it was worth pointing it out. |
I want to render some flowchart diagrams in a compact way to be readable on mobile, and found out that you can specify some distances between nodes using nodeSpacing (and rankSpacing), but it seems that when you start defining the nodes in a subgraph, it won't apply anymore.
a) node spacing 10:
b) node spacing 50:
Renders well, the nodes are properly spaced.
a) node spacing 10:
b) node spacing 50:
Node spacing doesn't apply anymore when these nodes are inside subgraph, the vertical distance between them remains the same.
Expected: To be able to apply node spacing inside a subgraph as well.
Environment: Latest Mermaid Live Editor (9.1.3), Obsidian 0.5.18 (don't know what Mermaid version they're using, but mentioning it here since there I found it first).
The text was updated successfully, but these errors were encountered: