This diff adds some post-layout logic that adjusts the output provided by the graph
visualization library Dagre. Dagre does not support specifying max width/height on
it's output, so if we detect that the graph contains a row of more than 25 nodes, we
manually "split" it into multiple rows, shifting the rest of the graph down to make
This normally works great, but it has a few caveats I've found:
- If the really long line of nodes are connected to a lot of subsequent nodes, reflowing the row essentially breaks the "shortest path" logic that Dagre used. Eg: "A1 : A2, B1 : B2" x 50 may become "A1 : [A-Z]?2", which doesn't look as nice.
- If the long line is two chunks of nodes with horizontal whitespace in between, we still apply our logic and also reflow the nodes together into a single block. We could turn this off, but in the interest of bounding the graph width it seemed OK.
After: Note this is 25 nodes per row, but we can choose any max. I'd suggest keeping it high enough it's 100% better than the alternative.
EDIT: Here's what this looks like on Nick's other pipeline: