Interaction
Viewport behavior
Wheel and pinch zoom keep the point under the cursor or pinch midpoint
fixed. Zoom is clamped to 10%–500%. Movement of at most five pixels between
pointer down and up is a click; larger movement is a drag. One
AbortController-managed listener set attaches to the canvas and
window; destroy() aborts it when the scene is replaced.
Expansion
Clicking a compound toggle changes the expanded-node set, computes child layouts when needed, recomputes the layout chain and all routing, clears the cached graph-wide adjacency, and renders the scene again.
A collapsed compound uses its full bounds as the toggle target. An expanded
compound uses its full bounds below 40 px screen width and a
28 × 18 px top-left target at full detail. The compact marker remains
visible between 2 px and 40 px; below
2 px, a queried node can still have a hit region.
Hit testing
- Toggle regions are checked first.
- Leaf-node regions are checked next.
- Edge regions use an 8-pixel screen-distance tolerance.
- Expanded-node regions are checked after child nodes and edges.
- Empty space clears the selection.
Hit regions are rebuilt from visible geometry on each render. Expanded containers are checked after edges so routes and child nodes remain clickable.
Causal selection
Node selection runs breadth-first searches over cached global successor and predecessor adjacency. The highlighted nodes are the selected nodes, their reachable descendants, and their reachable ancestors. Edges are highlighted when both endpoints are reachable. An explicitly selected edge highlights the edge and both endpoints.
When a selection exists, geometry outside the highlighted sets uses 15% alpha. Expansion invalidates the adjacency cache because it changes the active scope structure.
Worker loading
The worker reports validating, layout, and
routing phases, then sends graph data and a serialized snapshot.
A cancellation changes the active request identity. The worker checks that identity
after validation and layout; the main thread ignores stale results.