Describes how snapshots from the timeline are rendered. All components consume immutable EGraphState objects; no component mutates engine data.
- Root Layout: Uses
paneforgefor resizable split panes:- Left Pane: Graph Pane (Visual Topology).
- Right Pane: Vertical stack of Header, Controller, and State Pane.
- Persistence: Split position is saved to
localStorage.
- Header: Contains project title, implementation toggle (Naive/Deferred), and summary badges.
- Controller: Pinned below the header on the right.
Shared visual primitives used across both Graph and State panes to ensure consistency.
A unified, context-aware component that renders an E-Node or E-Class ID.
id:ENodeId(Required)mode:'id' | 'symbol'(Default: 'id')variant:'default' | 'ghost' | 'active'(Optional)
- Base: White/Light background.
- Active (Stage-Dependent Colors):
- Read (Match): Yellow (
#eab308) border/text, light yellow bg. - Write (Add/Merge): Red (
#ef4444) border/text, light red bg. - Rebuild (Worklist): Blue (
#3b82f6) border/text, light blue bg.
- Read (Match): Yellow (
- Hovered: Light Blue highlight/glow.
- Selected: Solid Blue border, Blue background tint.
- Ghost: Greyed out, dashed border.
Backed by Svelte Flow (@xyflow/svelte) and ELK Layout.
- Algorithm:
elk.layeredwithelk.direction: 'DOWN'andelk.hierarchyHandling: 'INCLUDE_CHILDREN'. - Deferred Mode:
- Outer Nodes:
UnionFind Set(canonical ID). - Inner Nodes:
E-Classgroups containingE-Nodes.
- Outer Nodes:
- Naive Mode:
- Nodes:
E-Classgroups directly containingE-Nodes.
- Nodes:
- Fixed Size: Nodes have a fixed dimension (e.g., 60x40px) to ensure stable layout.
- Operator: Displayed as a scaled SVG text to fit within the box without overflow.
- Arguments:
- Represented as Ports along the bottom edge of the node.
- Edges: Drawn from the specific argument port to the target E-Class/Set.
- Interaction: Hovering a port highlights the specific argument edge.
Single scrollable column visualizing internal structures.
- Hashcons: List of
ENode(Symbol) ->Diamond(ID). - E-Classes: Vertical list of E-Class Cards.
- Worklist: Chips for pending E-Class IDs.
- Controls: Play/Pause, Step Prev/Next, Jump to Phase.
- Scrub Bar: Range input.
- Phase Badges: Colored to match Active State (Yellow/Red/Blue).
Managed via timelineStore.transitionMode.
- Smooth (Play/Step):
- CSS transitions for color/opacity.
- Svelte
animate:flipfor list reordering. - Svelte Flow nodes interpolate positions (
transition: transform 0.3s).
- Instant (Scrub/Jump):
- Disable all transitions. Immediate DOM updates.
- Essential for responsive scrubbing.
For "exact tweening" during scrubbing:
- Controller: Exposes
scrubFraction(e.g.,4.5). - Graph Pane:
- Calculates
t = fraction % 1. - Interpolates node positions
(x, y)between Stepfloor(fraction)andceil(fraction). - Updates Svelte Flow positions directly, bypassing ELK for intermediate frames.
- Calculates
- Accessibility:
- High-contrast theme toggle.
- Keyboard navigation (Tab order: Header -> Controller -> Panes).
aria-liveregions for playback status.
- Performance:
- Culling: Hide off-screen graph nodes using
IntersectionObserver. - Limits: Warn/Simplify view if node count > 500.
- Memoization: State Pane views memoize derived data on
state.id.
- Culling: Hide off-screen graph nodes using