feat(flow): remove dagre — SGCR is the only layout engine - #301
Draft
ivanmkc wants to merge 2 commits into
Draft
Conversation
Replace all dagre calls with SGCR equivalents across the flow layout pipeline: inter-zone packing, swimlane global rank, ungrouped flat layout, and the measured re-pass. SGCR guarantees zero node overlaps (P1) and zero edge-over-node (P2) by construction — invariants dagre never provided. - Add grouped SGCR pipeline: two-level layout (per-zone → zone-packing → orthogonal edge routing) with container boxes for zone rendering - Remove @dagrejs/dagre dependency (~14KB gzip bundle savings) - Remove bestLayout direction search (SGCR is deterministic, no search needed) - Remove analyzeFlowGeometry heuristic lint (replaced by checkInvariants) - Geometry lint now uses sgcrReport for ALL flows (grouped and ungrouped) - engine:"dagre" accepted for backward compat, silently ignored - 703 tests pass, tsc clean
…floor Grouped flows (tiers/lanes/zones) were skipped by the measured re-pass, relying entirely on estSize estimates which under-predicted ChangeNode's rendered width (estSize minW=120 vs CSS minWidth=140 + cell fill). This caused node overlaps in the architecture-zones tiered layout. Two fixes: - Raise estSize minW from 120 to 172 (matches the ChangeNode's rendered floor when it fills its SGCR cell via width:100%) - Enable the measured re-pass for grouped flows: re-run layoutFlow with DOM-measured node sizes, updating both member positions and container styles. Previously skipped because "dagre would ignore zones" — now layoutFlow handles groups natively via SGCR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@dagrejs/dagredependency entirely (~14KB gzip bundle savings)bestLayoutdirection search (SGCR is deterministic)analyzeFlowGeometryheuristic lint (replaced bycheckInvariantsexact arithmetic)sgcrReportfor ALL flows (grouped and ungrouped)engine:"dagre"accepted for backward compat but silently ignoredSGCR guarantees zero node overlaps (P1) and zero edge-over-node (P2) by construction — invariants dagre never provided. Verified on the 30K-graph fuzz corpus + all shipped examples.
Test plan