Skip to content

layout: new cloud flows can overlap chains that are not left to right #445

Open

Description

@bpowers

When layout adds a flow to or from a cloud on a stock that is part of a chain, it assumes the chain runs left to right: the chain's outflow on the right face and its inflow on the left.
In a diagram where the chain runs vertically or right to left, the new cloud flow can land on the face the chain already uses, and the two pipes overlap.

Example

An imported diagram with two stocks stacked vertically, a above b, joined by a flow leaving a's bottom face.
Adding an outflow from a to a cloud: layout treats right and left as taken by the chain, so it picks the bottom face, which is where the chain's pipe already is.

Why it matters

Affects diagrams imported from Vensim or Stella, or hand-arranged, whose chains are not left to right.
Not yet seen in a real model; the default generated layout always draws chains left to right.

Fix

In incremental layout, measure which face each chain flow actually attaches to, the same way side flows' faces are already measured from the drawn geometry, and pass those faces in instead of assuming right and left.
A new chain flow on such a stock has the same assumption and could take the measured direction too.

Pointers

  • src/simlin-engine/src/layout/mod.rs (classify_flow_sides: chain outflows go right, inflows go left)
  • src/simlin-engine/src/layout/incremental.rs (existing_side_flow_faces, which measures only cloud flows)
  • src/simlin-engine/src/layout/layout_flow_side_tests.rs

Activity

  1. added
    engine
    layout
    on Jun 8, 2026
  2. added
    bug
    on Oct 12, 2026
  3. changed the title [-]layout: classify_flow_sides assumes left-to-right chain direction[/-] [+]layout: new cloud flows can overlap chains that are not left to right[/+] on Oct 12, 2026
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

    bugenginelayout

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions