question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I force subgraphs to be top-down

See original GitHub issue

If 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:closed
  • Created 8 years ago
  • Reactions:23
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
michuczcommented, Aug 27, 2020

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.

5reactions
mingfangcommented, Feb 1, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >
Mermaid Cheat Sheet @ https://jojozhuang.github.io
Cheat Sheet for Mermaid.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found