Repository navigation
Two layouts beside Layout Diagram: Untangled, and Free Ports - #76
Merged
Merged
Conversation
On a dense workflow the edges tangle because every node's ports sit on their rows in the order the source declares them, which ELK may not change, and an input declared first whose producer is laid out last crosses every edge between. Two layouts in the diagram's menu: - Untangled Layout: the layered layout with ELK's hierarchical two-sided greedy switch and Brandes-Koepf placement. The ports keep the declared order. - Free Ports Layout: the same, and each node's ports in the order a probe layout found best against crossings. The engine runs the probe with FIXED_SIDE when the graph option dialogram.portOrder is free, reads the order ELK chose per side, and puts the ports back on their own rows in that order before the real layout. By default, and after a drag, the pass does not run and the declared order stands. Both run the boundary-flow layout with the graph's options set for the run and restored after it, so Layout Diagram is unchanged. Measured on the speculation flow of chips/workflow (40 nodes, 106 edges), exported by wfpy plan --format graph as a fixture: 278 crossings today, 228 untangled, 127 with free ports. The test holds the declared order under the default and the untangled options, the rows under free ports, and the three counts in that order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a dense workflow the edges tangle because every node's ports sit on their rows in the order the source declares them, which ELK may not change (
FIXED_POS), and an input declared first whose producer is laid out last crosses every edge between. This adds two layouts to the diagram's context menu, beside Layout Diagram, Compact Layout and Serpentine Mesh Layout:FIXED_SIDEwhen the graph optiondialogram.portOrderisfree, reads the order ELK chose per side, and puts the ports back on their own rows in that order before the real layout. By default, and after a drag, the pass does not run and the declared order stands.Both run the boundary-flow layout with the graph's options set for the run and restored after it, so Layout Diagram itself is unchanged. The boundary-flow handler is bound to itself in the server module for that, as the reroute handler already is.
Measured on the speculation flow of
chips/workflow(40 nodes, 106 edges), exported bywfpy plan --format graphas a test fixture:The test holds the declared order under the default and the untangled options, the rows under free ports (a permutation of the same rows, every edge routed), and the three counts in that order. 325 tests pass,
tsc --noEmitis clean.Known limit of Free Ports: a reopen re-places the ports from the declaration, so a persisted Free Ports layout re-anchors its routes onto the declared rows. Persisting the chosen order would be a follow-up.