Skip to content

explore: the graph layout has no overlap detection, it has three special cases #9

Open

Description

@junixlabs

Three collisions were found by rendering the page and looking at it, and each was
fixed by adding a rule:

  • chips overlapped the outgoing next arrow → chips moved under the node box
  • parallel edges between the same pair drew their condition labels on top of each
    other → edges bow apart by index
  • an edge skipping a column passed behind the node in between → those edges route
    under

tests/run_tests.py::tool_explore asserts the first one directly: no chip may fall
inside a node rectangle. The other two have no geometric assertion, and nothing
detects a collision that has not been anticipated.

Cases likely still broken, none of which the reference models exercise:

  • a long condition label overlapping the node it points at
  • three or more parallel edges — the bow formula is (index - (index % 2) * 2) * 14,
    which repeats offsets past the fourth edge
  • a flow wide enough that a skip edge routes under a node in a lower row

Shape of the fix

Either a general check, or an honest boundary.

The general version: collect every drawn element as a rectangle and assert no two
overlap, then let the layout satisfy that rather than accumulating special cases. The
test already extracts rects and text positions from the SVG, so the machinery is
mostly there.

The honest version: declare the layout good for graphs up to some width and branch
count, detect when a flow exceeds it, and fall back to a list rather than drawing a
picture that misleads.

Either is fine. What is not fine is a fourth special case.

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

    enginetools/traceos.py and friends

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions