You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
explore: the graph layout has no overlap detection, it has three special cases #9
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.
Activity
Make the explorer lead with the diagrams, and plate the edge labels (#31