Repository navigation
feat: add a sankey chart - #232
Merged
Merged
Conversation
Composable SankeyChart with Plot, Tooltip and useSankeyChart: weighted flows laid out in columns, gradient bands that draw in and morph on new data, node and flow highlighting, keyboard navigation and an exact-flow table.
Clean data once per change: keep the first of repeated nodes, sum unnamed duplicate links, drop invalid and loop-closing links with a development warning. Keep column order stable, fit labels to the column gap, re-lay instantly on resize, widen hover targets for thin flows and small nodes, keep tapped tooltips open until an outside tap, clear highlight on blur, hand focus on when a focused node is removed, and list a node's flows in its tooltip. Expanded previews leave Escape to a demo that used it.
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
Adds Sankey Chart (
@beui/sankey-chart) to the charts category: weighted flows between stages, laid out in columns from sources to outcomes.Component (
components/charts/sankey-chart.tsx+sankey-chart/)SankeyChartwithSankeyChartPlot,SankeyChartTooltipanduseSankeyChart; omit children for the complete chart.activeId(node id or link id,source:targetby default),formatValue,colors,nodeWidth,nodePadding,label.Edge cases
Accessibility
Also
tests/sankey-chart.a11y.test.tsx.Testing
bun run checkandbun test(176 accessibility tests) pass.