Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .changeset/report-chart-authored-chrome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
'@object-ui/plugin-report': patch
'@object-ui/plugin-dashboard': patch
'@object-ui/core': patch
---

fix(plugin-report): forward the chart chrome and series presentation `ReportChartSchema` declares (objectui#4877)

A report's embedded chart forwarded exactly six keys to the registered chart
component — `chartType`, `data`, `height`, `isAnimationActive`, `series`,
`xAxisKey`. Everything else `ReportChartSchema` declares as authorable never
left the report renderer, so it was inert metadata: the author writes it, the
schema accepts it, nothing reads it.

`showLegend` was the sharpest case because dropping it does not merely ignore
the author, it INVERTS them: `AdvancedChartImpl` computes
`legendVisible = showLegend !== false`, so an absent value means the legend is
on and an explicit `showLegend: false` still drew one.

Now lowered, under objectui#4229's ruled data/presentation split:

- chrome — `showLegend`, `showDataLabels`, `colors` (both the positional-palette
array and the per-category record), `subtitle`, `description`, `annotations`,
`interaction`, `height`;
- per-series presentation — `color`, `stack`, `type`, `yAxis`, `dashArray`,
`opacity`, `variant`, matched by `series[].name` so series MEMBERSHIP stays
with the dataset.

`title` is deliberately not forwarded: the report renderer paints it as its own
heading above the plot, and forwarding it would draw a second one inside the
chart's frame. `aria` is not lowered either — nothing on this path reads it
(`AdvancedChartImpl` has no `aria` prop, and this renderer hands the component a
schema directly rather than through `SchemaRenderer`'s flat ARIA injection), so
forwarding it would move declared-but-unread one layer down.

The two helpers (`chartConfigPresentation`, `mergeAuthoredPresentation`) moved
from `plugin-dashboard`'s `DatasetWidget` to `@object-ui/core` beside
`buildChartSeries`, the derivation they merge onto, so both surfaces lower one
vocabulary once instead of keeping a second copy (the duplication objectui#4389
filed as a defect). `@object-ui/core` additionally exports `mergeAuthoredSeries`
— the series merge alone — for a surface whose axes are bare dimension/measure
NAME strings rather than spec `ChartAxis` objects, which is what a report chart
declares. `DatasetWidget` re-exports both names, so its public surface and its
rendering are unchanged.
31 changes: 31 additions & 0 deletions .changeset/report-chart-null-category-bucket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
'@object-ui/plugin-report': patch
---

fix(plugin-report): route a report's embedded chart through `buildChartSeries` so a NULL category is bucketed (objectui#4878)

`DatasetReportChart` built its rows as `relabelDimensions(state.rows, …)` and
handed them to the registered chart component verbatim. Nothing on that path
bucketed a null dimension value, so a report chart passed the renderer a null
category — the exact input objectui#4466 measured as drawing **no mark at all**.
The cost is not an empty chart but a quietly wrong one: the null group vanishes
while the y-axis scale still accommodates it, so the chart reads as valid data.

The dashboard and chart-view surfaces never had the defect because they route
through `buildChartSeries` (`@object-ui/core`), where the whole null-category
family was fixed. The report chart now routes through it too, so those
properties are INHERITED rather than re-derived on a third surface:

- the null bucket itself (objectui#4466);
- its label read from the locale bundle at the call site — `@object-ui/core` is
React-free, so a zh console would otherwise draw the bar and label it `(None)`
(objectui#4500);
- bucket IDENTITY separate from the bucket label, so a stored value that
literally spells `(None)` stays a different group (objectui#4508).

objectui#4020's three-level measure display name still outranks the label the
derivation assigns, including for an `{ en, 'zh-CN' }` label record: core holds
no i18n provider and picks first-string-wins, which is exactly the defect class
#4020 closed.

A report whose chart has no null group is unchanged, byte for byte.
4 changes: 4 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export * from './utils/dashboard-filters.js';
export * from './utils/merge-filters.js';
export * from './utils/compare-to.js';
export * from './utils/chart-series.js';
// The AUTHORED half of a dataset-bound chart (objectui#4229's data/presentation
// split), shared by the dashboard widget and the report's embedded chart so the
// same spec keys are lowered identically on both (objectui#4877).
export * from './utils/chart-presentation.js';
// The ONE number-display formatter (objectui#4033) — grouping policy, display
// locale and the percent convention. It lived in `@object-ui/i18n` until
// objectui#4576; it is pure, and living above `core` was what kept
Expand Down
Loading
Loading