Best way to layout / size subgraph without two layout passes? Attempting with Dagre, thinking of swapping to Elk. #5222
Unanswered
lucasgelfond
asked this question in
Layouting
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! Have a bit of a complex layout case that I'm struggling with. Essentially, we have a graph of about 10 nodes, and one of those 10 nodes has a "child" graph of about 5 nodes itself. Bundle size is a bit of a concern, so I started by doing this with Dagre, using the algorithm I've seen a bunch on here, of adding the nodes, measuring them, and then laying them out. However, because of the child graph, I had to do two passes:
The problem is I can't figure out a way to do this first pass invisibly, so there's a really jerky movement in the viewport.
I started thinking of redoing this in Elk, in spite of the giant bundle, because it seemed like Elk was designed to handle subgraphs. However, while I could do some of this layout, I couldn't figure out how to size the child node in Elk such that it would encapsulate all of the child nodes. Is there a good way to do this? I also couldn't figure out a nice way to get them centered.
Basically: has this been done in one pass before / is such a thing possible? This flicker really sucks / is pretty bad UX, and because we make changes to the graph every once and awhile, it's not necessarily just a first load thing. Would love tips!
Beta Was this translation helpful? Give feedback.
All reactions