Repository navigation
fix(plugin-charts): a two-dimension pie, donut, funnel or treemap draws every group or refuses, never the first group alone - #27736
Merged
Conversation
…ery group or refuses (WIP) Claude-Session: https://claude.ai/code/session_01Utp6CanXq6PY9nH1pZ5E5m Co-authored-by: Claude <noreply@anthropic.com>
…set (WIP) Claude-Session: https://claude.ai/code/session_01Utp6CanXq6PY9nH1pZ5E5m Co-authored-by: Claude <noreply@anthropic.com>
…lick as unknown, not any Claude-Session: https://claude.ai/code/session_01Utp6CanXq6PY9nH1pZ5E5m Co-authored-by: Claude <noreply@anthropic.com>
…ontrol settles on the one-series refusal Claude-Session: https://claude.ai/code/session_01Utp6CanXq6PY9nH1pZ5E5m Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CanXq6PY9nH1pZ5E5m Co-authored-by: Claude <noreply@anthropic.com>
…at now refuse or nest Claude-Session: https://claude.ai/code/session_01Utp6CanXq6PY9nH1pZ5E5m Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CanXq6PY9nH1pZ5E5m Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC 席位核对ACCEPT · head
Generated by Claude Code |
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.
domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC
Requested by Bill · project thread
Fixes #27563
Clause-②: no
Metadata-protocol: none
维护者速读
ui/packages/plugin-charts/src/AdvancedChartImpl.tsx的buildTreemapGroups、OneSeriesFamilyRefusal和 pie/funnel/treemap 分支开头;ui/packages/plugin-dashboard/src/DatasetWidget.tsx的chartSeries。pnpm --dir ui exec vitest run packages/plugin-charts/src/AdvancedChartImpl.twoDimensionSingleSeries-27563.test.tsx packages/plugin-dashboard/src/__tests__/DatasetWidget.twoDimensionSingleSeries-27563.test.tsx,预期 32 条全绿。What changes
A dashboard widget (or dataset-bound chart) of type
pie,donut,funnelortreemapwithdimensions: ['stage', 'owner']and one measure reaches the renderer pivoted bybuildChartSeries: one row per stage, one series per owner. These four arms readseries[0]alone, so they drew the first owner's amounts as if they were the whole chart. Triage's rule (the same as #27460): draw every group, or refuse a shape the chart cannot draw; never a partial chart. Per family:Treemap, so two or more groups are drawn as two levels (buildTreemapGroups, the treemap counterpart of fix(plugin-charts): a two-dimension sankey draws every flow, not only the first group's #27560'sbuildSankeyCellFlows): each stage is a parent, each owner it has records for a leaf inside it, sized by the measure. A leaf is namedstage / owner(the title the dashboard's drill gives the same cell; a parent's own name is painted over by its leaves) and takes its stage's colour. A combination the dataset did not answer is no leaf and no omission. A carried cell that cannot be sized is left out and the existingunsized-rowsnote is printed once per owner that lost one; no sizable cell at all is the existingno-positive-magnituderefusal, now naming every owner it tested. Clicking a leaf drills to its cell ({ category, series }, as the two-level sankey's flow click does).OneSeriesFamilyRefusalin the existingChartRefusalshell (role="status",data-chart-error="one-series-family"): "A pie draws one series, and this chart carries 3:Ann,Bo,Cy. Drawing only the first would hide the others, so none is drawn." Every group is named, and the sentence stays true if the series are measures rather than groups.groupSeries(the sankey'ssankeyFlowSeries, renamed and shared) drops a comparison overlay, so acompareTotreemap stays one level.DatasetWidgetalready handed a sankey only the measure it renders (fix(plugin-charts): a two-dimension sankey draws every flow, not only the first group's #27560); the same filter now covers everySINGLE_SERIES_CHART_FAMILIESfamily. A stored widget of these types that declares several measures with one dimension (refused at publish by the spec's single-series arm since 17.7.0) therefore still draws its first measure, and the dropped-measure console warning stays true, instead of its second measure being read as a group. A pivot carries one measure, so nothing is dropped from it.Unchanged: every one-dimension chart of the four types (regression pins below), the empty-rows path, the sankey.
Tests
ui/packages/plugin-charts/src/AdvancedChartImpl.twoDimensionSingleSeries-27563.test.tsx(20): the fixture is a realbuildChartSeriespivot (stage × owner, sum amount). Treemap: one leaf per answered cell with its size, shared stage colour, the per-owner note for a cell at -5, the magnitude refusal naming every owner, the leaf click's drill event; pie/donut/funnel: noPie/Funnelelement rendered and the refusal names every owner; regression pins per family for one dimension, the compared treemap, and no rows. Marks are read from the props each Recharts element was rendered with, not jsdom pixels.ui/packages/plugin-charts/src/ChartRenderer.yAxisUndrawn-10691.test.tsx:drawsettles on the plot or the renderer's refusal, and the pie control asserts the one-series refusal (see Acceptance notes).ui/packages/plugin-dashboard/src/__tests__/DatasetWidget.twoDimensionSingleSeries-27563.test.tsx(12): the card's widgets throughDatasetWidget→SchemaRenderer→AdvancedChartImpl: the treemap draws 5 depth-2 leaves, pie/donut/funnel refuse naming every owner, a one-dimension widget of each type draws, and a stored one-dimension widget with two measures still draws (no group refusal, no nested treemap).Acceptance notes
origin/main(525ea3632) the renderer file swapped in: the treemap drew 3 one-level leaves with no children, and pie, donut and funnel each rendered onePie/Funnelelement bound to the first owner's column (15 of the 32 new tests red, every control green).packages/spec, outside this card); the tile refusal meets "never a partial chart" today and names every group. Whether the spec should also refuse the shape at publish is the seat's call.AdvancedChartImplcannot tell a pivoted group from a second measure; it reads two or more non-comparison series as groups, as fix(plugin-charts): a two-dimension sankey draws every flow, not only the first group's #27560 made the sankey do. The dashboard hands these families one measure (above). Two other shapes reach the arms with several measures and change too: a chart block that authors ayAxislist on a pie, donut or funnel, and a page chart bound to a dataset with ONE dimension and TWO measures (checkDashboardWidgetChartMeasureArityis attached to the dashboard widget schema only, so no spec door refuses either there). Both used to draw their first measure silently, a partial chart; a pie, donut or funnel now shows the one-series refusal naming every measure, and a treemap nests the measures under each category. Measured:ChartRenderer.yAxisUndrawn-10691.test.tsx's control "(control) pie, three entries: no note" settled on a drawnsvg, which the pie no longer draws; its subject (no y-axis note on a pie) still holds, so the helper now settles on the plot or the refusal and the control also asserts the refusal. If the seat wants those multi-measure charts kept drawing their first measure, the alternative is to mark pivot series inbuildChartSeries(@object-ui/core, a published type:Clause-②: yes (widening)) and refuse only on that marker.no-positive-magnitude,no-positive-flow,missing-series-key); no locale keys added.DatasetWidget.tsxis touched for the measure filter (the line fix(plugin-charts): a two-dimension sankey draws every flow, not only the first group's #27560 added for the sankey, widened) and two comments, not for a refusal note; the Claim lists the file conditionally.Verification
Local subset at head
4fb5e46c(after mergingorigin/main); the two commits after it touch only the changeset, and the changeset-reading gates were re-run atd12c72c8. CI runs the full farm.Premise and ablation (base `525ea3632`)
Each leg swapped files from the base into the tree with
git restore --source=525ea3632, checked the blob hash, ran, and restored fromHEADunder a trap (restore proven bygit hash-objectequal to theHEADblob andgit diff HEADempty).Prospect,Proposal,Won) with no children; pie, donut and funnel each rendered onePie/Funnelelement (bound to the first owner's column).fires iff the second measure's values leave the drawn chart unchangedrows ofDatasetWidget.singleSeriesMeasures-11417.test.tsxfor pie, donut, funnel and treemap.Tests
pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-charts/ packages/plugin-dashboard/(under the verify lock, at5d26a453): Test Files 297 passed, 1 failed (298); the failure was theChartRenderer.yAxisUndrawn-10691pie control described in Acceptance notes, updated in the next commit.unfulfilled-chart-stubs-8760, app-shelllistViewLegacyChartRetired-6152andObjectView.chartRelay-7823, plugin-chatbotChatbotEnhanced.chartOrder-13492anduseObjectChat.chartOrderRehydrate-13492, plugin-listListView.chart-capability-7544, the wholeplugin-report/src/__tests__/): Test Files 38 passed (38), Tests 390 passed, 7 skipped.4fb5e46c: the two 27563 files, the 10691 file,DatasetWidget.singleSeriesMeasures-11417, and both 27460 sankey files: Test Files 6 passed (6), Tests 81 passed.pnpm --filter @object-ui/plugin-charts run type-check && pnpm --filter @object-ui/plugin-dashboard run type-check: exit 0 (both programs include the new tests viatsconfig.test.json).no-explicit-anyin the renderer test's recharts mocks, the shape the 27460 test uses.Derived gates (dispatch-gates --commands --repo objectstack-ai/objectstack: 35; all run; reconciled with --ran)
dispatch-gates --ran: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN.Human Minimum
packages/specholds no runtime logic. (packages/specuntouched.)pnpm lintpasses. (eslint on the touched files: 0 errors; the repo-wide run is CI's.)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code