Repository navigation
fix(plugin-charts): a two-dimension sankey draws every flow, not only the first group's - #27560
Merged
Merged
Conversation
…d dimension) flow Claude-Session: https://claude.ai/code/session_01L6bhgWJECm7uQEkPAHKqat Co-authored-by: Claude <noreply@anthropic.com>
…ot laid-out nodes Claude-Session: https://claude.ai/code/session_01L6bhgWJECm7uQEkPAHKqat Co-authored-by: Claude <noreply@anthropic.com>
…er and dashboard widget Claude-Session: https://claude.ai/code/session_01L6bhgWJECm7uQEkPAHKqat Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#1 · os-sales · session_01L6bhgXU26UBEjd1KKHgNEx 席位核对 · ACCEPT · 2026-10-29T13:09ZHead-sha:
|
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.
Requested by Sales · project thread
Fixes #27460
Clause-②: no
Metadata-protocol: none
维护者速读
ui/packages/plugin-charts/src/AdvancedChartImpl.tsx的buildSankeyCellFlows与 sankey 分支开头;ui/packages/plugin-dashboard/src/DatasetWidget.tsx的chartSeries。pnpm --dir ui exec vitest run packages/plugin-charts/src/AdvancedChartImpl.sankeyTwoDimensions-27460.test.tsx,预期 8 条全绿,其中一条逐条断言 6 条流向及数值。What changes
variant: 'comparison'overlay) reaching the sankey are the groups of a pivoted second dimension: the spec refuses a second measure on a sankey (SINGLE_SERIES_CHART_TYPES), andbuildChartSeriespivots the second dimension into series exactly when the chart carries one measure.buildSankeyCellFlowsmakes each row's category a source node, each series a target node, and each cell the row carries a flow valued by the cell. One flow series keeps the one-level arm byte for byte.chart.sankeyOmittedRows, no new strings) is printed once per target column that lost a cell. No carried cell above zero is the existingno-positive-flowrefusal, naming every column.(category, series)pair, the pairfindChartSeriesRowresolves to one dataset row; the event carriescategory,categoryId,series,seriesLabelandvalue. A node spans several cells, so a node click does not drill (as the one-level root does not).DatasetWidgethands a sankey only the measure it renders. A stored sankey that declares several measures (refused at publish) would otherwise have its later measures drawn as groups, and the dropped-measure warning would be false. A pivot carries one measure, so nothing is filtered from it. TheSINGLE_SERIES_CHART_FAMILIESdocblock says so.Tests
AdvancedChartImpl.sankeyTwoDimensions-27460.test.tsx(8): the pivot is built withbuildChartSeriesfrom the card's shape (3 statuses × 3 categories, 6 answered pairs); it asserts the six flowssource → target: value, the six links and six named nodes, no note for unanswered pairs, the note for a carried negative cell, the refusal for all-zero cells, the flow click and no node click; controls: one series and a comparison overlay stay one-level.DatasetWidget.sankeyTwoDimensions-27460.test.tsx(1): the card's widget through the real chain draws all six nodes and six links.pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-charts/ packages/plugin-dashboard/: Test Files 294 passed (294), Tests 3175 passed, 15 skipped, at13e084eb.Acceptance notes
if (flowSeries.length >= 2)→if (false && …)throughscripts/ablation-replace.mjs(anchor 1 → 0, blob restored to HEAD,git diff HEADempty): 5 of 9 red, the first readingexpected [ 'Alpha → Open: 3', …(2) ], the card's 3/2/2; the two one-series controls stayed green.chartType === 'sankey'→'ablated'inchartSeries:DatasetWidget.singleSeriesMeasures-11417.test.tsxgoes red onsankey: fires iff the second measure's values leave the drawn chart unchanged(1 of 22), so the existing tie pins the filter.series[0]too (their arms readseries[0]?.dataKeyand nothing else; read on13e084eb, not rendered), so a two-dimension pivot on them draws only the first second-dimension group. The two-level fix does not cover them (a pie has no second column of nodes); they are reported to the seat, not fixed here.object-chartsankey with two measures (no publish-time arity refusal on that node) now draws category → measure flows instead of silently dropping the second measure.buildChartSeriespivots only the second dimension, a cross-family question outside this card.Verification
Local gates from
node scripts/dispatch-gates.mjs --commandsat13e084eb, each exit captured before any pipe and reconciled with--ran; type-check of both packages; every other family is CI's and is cited from the PR's check runs in the report.Generated by Claude Code