Skip to content

Navigation Menu

Sign in
Sign up

wrap: true folds by layer, so the main chain stops reading in order #22

Open

Description

Split out of #18, whose "neighbouring problem" section this is. #21 fixes that issue's stranded arrowhead; this half is untouched by it.

What happens

wrap: true gives the best aspect ratio of anything we produce, but it folds on ELK's layer index, not on the chain. The main chain therefore stops being contiguous: a reader following it is sent backwards up the page.

Measured over the bundled examples and the agent-run diagrams, all forced to wrap: true — reading rank of each node on the longest forward chain, in reading order (row band, then x):

examples/enterprise.yaml rank=[6,3,4,5,8,19,10,11,12,13,14,15] 2 inversions
examples/growth.yaml rank=[5,1,2,3,6,9,21,12,13] 2 inversions
codex round 2 rank=[5,7,8,2,1,3,4,6] 2 inversions
agy round 2 rank=[2,3,6,7,8,0] 1 inversion — the chain ends at rank 0
examples/startup.yaml rank=[0,1,2,3] reads in order
examples/web-app.yaml rank=[0,1,4,5,6] reads in order

The last node of the agy round-2 diagram lands top-left. In an earlier round the pipeline's first node ended up bottom-right.

Why it cannot be done through ELK

Investigated while fixing #18:

  • ELK cuts by layer index. Reordering nodes before handing them over does not move a cut.
  • elk.layered.wrapping.cutting.strategy: MANUAL with cutting.cuts is the only option that places the folds explicitly, and it cannot be set from elkjs: the list type is not registered with ElkReflect, so the call throws Couldn't create new instance of property 'org.eclipse.elk.layered.wrapping.cutting.cuts'.
  • elk.layered.considerModelOrder.strategy in all three modes (NODES_AND_EDGES, NODES, PREFER_EDGES) changed the output by not one pixel.

So the fold has to become ours: lay out once to get the chain order, partition it into rows, and emit each row for ELK to place — which is the "wrap becomes generated groups" shape.

Open question before starting

How a generated row interacts with a group the user wrote, when a group spans a row boundary. That has no answer yet, and it is the reason this is not a small change.

The detour warning added in 0.7.5 already names the fold as the cause, which is honest but does not make the picture readable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /