How do I force subgraphs to be top-down
See original GitHub issueIf I have this graph
graph TD
subgraph Backend
B
C
D
end
subgraph Front
A
end
If I link A–>B then it looks right. http://knsv.github.io/mermaid/live_editor/#/view/Z3JhcGggVEQKc3ViZ3JhcGggQmFja2VuZApCCkMKRAplbmQKCnN1YmdyYXBoIEZyb250CkEKZW5kCgpBLS0-Qg
However if I also link C–>D then subgraphs are no longer top down. http://knsv.github.io/mermaid/live_editor/#/view/Z3JhcGggVEQKc3ViZ3JhcGggQmFja2VuZApCCkMKRAplbmQKCnN1YmdyYXBoIEZyb250CkEKZW5kCgpBLS0-QgpDLS0-RA
If there any way to keep the subgraph top down?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:23
- Comments:13 (1 by maintainers)
Top Results From Across the Web
graphviz - top-down subgraphs, left-right inside subgraphs
The (invisible) top nodes are forced to the same rank and are linked by invisible edges - this will ensure that the clusters...
Read more >Attributes - Graphviz
Instructions to customise the layout of Graphviz nodes, edges, graphs, subgraphs, and clusters. The table below describes the attributes used by ...
Read more >Faster algorithms for counting subgraphs in sparse graphs
Given a k-node pattern graph H and an n-node host graph G, the subgraph counting problem asks to compute the number of copies...
Read more >Using layouts - Cytoscape.js
The problem of large graphs; Metrics for subgraph selection ... it is less traditional than a typical top-down hierarchical layout.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I would also like to keep this issue alive. If have a couple of nodes that simply follow one another, I would like to be able to change direction, so I can start LR, than change to TB for one node, and then to RL.
Thanks for reviewing this issue. I’ve read about people hacking this in different ways http://stackoverflow.com/questions/7777722/top-down-subragpraphs-left-right-inside-subgraphs e.g. create invisible nodes and links to force the top down layout.
Perhaps a less “hacky” way would be to add links to subgraphs. So in my example I can add Frontend–>Backend
And this link would cause layout to follow the graph direction, e.g. TD.