Skip to content

[Bug]: auto layout drops edges between nodes nested in different containers #45

Closed

Description

@Malcolmnixon

Description

When a LayoutGraph uses the auto algorithm at the root and contains an edge whose endpoints are nodes nested inside different child containers, AutoLayoutAlgorithm drops the edge. Component detection only looks at direct top-level endpoints, so the two containers are treated as disconnected components. The edge is then lost when each component is copied (AutoLayoutAlgorithm.cs ~411-420, as of 0.3.0-beta.1 / 4fe52e7).

Steps to Reproduce

  1. Build a root LayoutGraph with algorithm auto and two container nodes, P1 and P2, each with a child graph containing one leaf (A in P1, B in P2).
  2. Add an edge B -> A to the root graph. This follows the lowest-common-ancestor convention for cross-hierarchy edges.
  3. Run the layout and render.

Expected Behavior

The edge is kept and routed. For component and connectivity purposes, an edge whose endpoints are nested should count as connecting the endpoints' top-level ancestors in the graph being laid out.

Actual Behavior

The edge is silently dropped. Setting the root algorithm to hierarchical keeps it, but see the companion issue about where such edges are anchored.

Code Sample

Found by SysML2Tools (demaconsulting/SysML2Tools), whose general view puts SysML packages in container frames. Every relationship between elements in different packages disappears.

Tool Version

0.3.0-beta.1

.NET Version

.NET 10

Operating System

Windows 11

Additional Context

The SysML2Tools work that depends on this: demaconsulting/SysML2Tools#87 and the cross-package edges in the general view.

Activity

  1. added
    bug
    on Nov 13, 2026
  2. added a commit that references this issue on Nov 13, 2026
    6f95f25
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions