Skip to content

fix(charts): keep dense Sankey nodes and ribbons within their ports - #1069

Merged
dovvnloading merged 5 commits into
mainfrom
fix/1046-sankey-bounded-layout
Nov 25, 2026
Merged

dovvnloading merged 5 commits into
mainfrom
fix/1046-sankey-bounded-layout

Conversation

@dovvnloading

Copy link
Copy Markdown
Owner

Closes #1046.

Changes

  • Cap column spacing according to the densest column, reserving at least half the available height for nodes.
  • Normalize flow weights before accumulating totals and use one proportional scale for node heights and ribbon thicknesses; remove artificial minimum filled thickness/height and export node padding that distort geometry.
  • Keep the live SVG and Matplotlib geometry rules aligned.
  • Add matching regression cases for 30, 150, and 300 independent flows, skewed fan-out/fan-in with disconnected fractional flow, fractional weights, and overflowing raw totals. Assert node bounds, non-overlap, proportionality, and port containment in both renderers.

Validation

  • Isolated JavaScript execution of the fetched TypeScript layout after stripping type syntax: all six regression cases passed.
  • Isolated pytest run of the transcribed renderer and matching regression assertions using real Matplotlib patches and stubbed cosmetic theme helpers: 6 passed.
  • Full repository Vitest/pytest, typecheck, browser and publication-export suites were not run locally because this environment cannot resolve github.com for cloning/installing dependencies. CI should run the checked-in tests before merging.

Dense labels can still overlap at small display sizes; this change addresses node/ribbon geometry, not label collision or virtualization.

@dovvnloading dovvnloading left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the five changed files against #1046. The adaptive column gap keeps dense columns within the 0.82 layout region, normalized weights avoid finite-value sum overflow, and the shared proportional scale keeps node heights and ribbon ports consistent across the SVG and Matplotlib renderers.

Regression cases cover 30/150/300 independent flows, skewed fan-out/fan-in, fractional values, overflow-size values, column non-overlap, proportionality, and port containment.

CI at head 9b5fe8a is green: frontend checks (including Vitest), Windows Python tests, POSIX checks and package build. Playwright E2E is intentionally excluded from pull-request runs by the workflow. Dense label collisions remain an acknowledged separate concern, not addressed by this geometry fix.

No blocking findings in this review. Proceeding with the repository's supported squash merge method.

@dovvnloading
dovvnloading merged commit f75a22c into main Nov 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(charts): dense Sankey columns are clipped and minimum-width ribbons overflow node ports

1 participant