Skip to content

Commit 32ff033

Browse files
os-zhuangclaude
andauthored
docs(spec): correct ReportChart xAxis/yAxis semantics; mark dead report surface (#1890) (#3441)
Closes the report residual of the ADR-0021 analytics migration. The dataset-bound report chart already renders (objectui DatasetReportRenderer plots chart.xAxis/yAxis as the bound dataset's dimension/measure via useDatasetRows; Studio ReportDefaultInspector picks them from the dataset catalogs), but the spec describe() still called them raw fields. - ReportChart.xAxis/yAxis describe now states dataset dimension/measure names. - ReportChart.groupBy marked [EXPERIMENTAL — not enforced] (dataset renderer never reads it; only the legacy ReportViewer fallback did). - ReportColumnSchema/ReportGroupingSchema marked @deprecated — unreferenced by the single-form report shape; kept only as public type exports pending a governed prune. Docs regenerated. No shape/parse-behavior change; no export removed. Claude-Session: https://claude.ai/code/session_01CMaDBhnZEUu1fcw8Rvo6Yq Co-authored-by: Claude <noreply@anthropic.com>
1 parent d60968c commit 32ff033

3 files changed

Lines changed: 57 additions & 8 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
docs(spec): correct ReportChart `xAxis`/`yAxis` semantics; mark dead report surface (#1890)
6+
7+
Closes the report residual of the ADR-0021 analytics migration (#1890). The
8+
dataset-bound report chart already renders — objectui's `DatasetReportRenderer`
9+
plots `chart.xAxis`/`yAxis` as the bound dataset's **dimension**/**measure** via
10+
`useDatasetRows`, and the Studio `ReportDefaultInspector` picks them from the
11+
dataset's dimension/measure catalogs — but the spec `.describe()` still called
12+
them raw "Grouping field" / "Summary field", misleading an author (or AI) into
13+
naming object fields instead of dataset dimension/measure names.
14+
15+
- `ReportChart.xAxis`/`yAxis` describe now states they are dataset
16+
dimension/measure names (matching the live renderer + inspector).
17+
- `ReportChart.groupBy` marked `[EXPERIMENTAL — not enforced]` — the
18+
dataset-bound renderer plots a single `xAxis`×`yAxis` series and never reads
19+
it; only the legacy `ReportViewer` fallback did.
20+
- `ReportColumnSchema` / `ReportGroupingSchema` marked `@deprecated` — the
21+
single-form report shape expresses columns/grouping as dataset
22+
measure/dimension name arrays, so these objects are unreferenced; they remain
23+
only as public type exports (objectui re-exports them) pending a governed
24+
prune.
25+
26+
Docs regenerated (`ui/report.mdx`). No shape or parse-behavior change; no
27+
export removed.

content/docs/references/ui/report.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ const result = JoinedReportBlock.parse(data);
8585
| **title** | `string` | optional | Chart title |
8686
| **subtitle** | `string` | optional | Chart subtitle |
8787
| **description** | `string` | optional | Accessibility description |
88-
| **xAxis** | `string` || Grouping field for X-Axis |
89-
| **yAxis** | `string` || Summary field for Y-Axis |
88+
| **xAxis** | `string` || Dataset dimension name for the X-axis (bound-dataset dimension, not a raw field) |
89+
| **yAxis** | `string` || Dataset measure name for the Y-axis (bound-dataset measure, not a raw field) |
9090
| **series** | `{ name: string; label?: string; type?: Enum<'bar' \| 'horizontal-bar' \| 'column' \| 'line' \| 'area' \| 'pie' \| 'donut' \| 'funnel' \| 'scatter' \| 'treemap' \| 'sankey' \| 'gauge' \| 'solid-gauge' \| 'metric' \| 'kpi' \| 'bullet' \| 'radar' \| 'table' \| 'pivot'>; color?: string; … }[]` | optional | Defined series configuration |
9191
| **colors** | `string[] \| Record<string, string>` | optional | Color palette (string[]) or value→color map (`{ value: color }`) |
9292
| **height** | `number` | optional | Fixed height in pixels |
@@ -95,7 +95,7 @@ const result = JoinedReportBlock.parse(data);
9595
| **annotations** | `{ type: Enum<'line' \| 'region'>; axis: Enum<'x' \| 'y'>; value: number \| string; endValue?: number \| string; … }[]` | optional | |
9696
| **interaction** | `{ tooltips: boolean; zoom: boolean; brush: boolean; clickAction?: string }` | optional | |
9797
| **aria** | `{ ariaLabel?: string; ariaDescribedBy?: string; role?: string }` | optional | ARIA accessibility attributes |
98-
| **groupBy** | `string` | optional | Additional grouping field |
98+
| **groupBy** | `string` | optional | [EXPERIMENTAL — not enforced] Additional series-split grouping; not read by the dataset-bound report renderer (liveness #1878/#1890) |
9999

100100

101101
---

packages/spec/src/ui/report.zod.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ export const ReportType = z.enum([
2222

2323
/**
2424
* Report Column Schema
25+
*
26+
* @deprecated Unreferenced by the single-form (ADR-0021) report shape — a
27+
* dataset-bound report selects `values` (measure names) and `rows`/`columns`
28+
* (dimension names) as `z.array(z.string())`, not `ReportColumn` objects. Kept
29+
* only as a public type export (objectui re-exports it as `SpecReportColumn`);
30+
* slated for removal in a future governed prune (liveness #1878/#1890).
2531
*/
2632
export const ReportColumnSchema = lazySchema(() => z.object({
2733
field: z.string().describe('Field name'),
@@ -33,6 +39,11 @@ export const ReportColumnSchema = lazySchema(() => z.object({
3339

3440
/**
3541
* Report Grouping Schema
42+
*
43+
* @deprecated Unreferenced by the single-form (ADR-0021) report shape —
44+
* grouping is expressed by dataset dimension names in `rows`/`columns`. Kept
45+
* only as a public type export (objectui re-exports it as `SpecReportGrouping`);
46+
* slated for removal in a future governed prune (liveness #1878/#1890).
3647
*/
3748
export const ReportGroupingSchema = lazySchema(() => z.object({
3849
field: z.string().describe('Field to group by'),
@@ -42,13 +53,24 @@ export const ReportGroupingSchema = lazySchema(() => z.object({
4253

4354
/**
4455
* Report Chart Schema
45-
* Embedded visualization configuration using unified chart taxonomy.
56+
*
57+
* A dataset-bound report chart (ADR-0021): `xAxis`/`yAxis` name the report's
58+
* bound-dataset **dimension** and **measure** (NOT raw object fields) — the
59+
* Studio inspector picks them from the dataset's dimension/measure catalogs
60+
* and objectui's `DatasetReportRenderer` plots them via `useDatasetRows`.
4661
*/
4762
export const ReportChartSchema = lazySchema(() => ChartConfigSchema.extend({
48-
/** Report-specific chart configuration */
49-
xAxis: z.string().describe('Grouping field for X-Axis'),
50-
yAxis: z.string().describe('Summary field for Y-Axis'),
51-
groupBy: z.string().optional().describe('Additional grouping field'),
63+
/** Dataset **dimension** name for the X-axis (from the report's bound dataset). */
64+
xAxis: z.string().describe('Dataset dimension name for the X-axis (bound-dataset dimension, not a raw field)'),
65+
/** Dataset **measure** name for the Y-axis (from the report's bound dataset). */
66+
yAxis: z.string().describe('Dataset measure name for the Y-axis (bound-dataset measure, not a raw field)'),
67+
/**
68+
* ⚠️ EXPERIMENTAL — NOT ENFORCED (liveness #1878/#1890). An additional
69+
* series-split grouping. The dataset-bound `DatasetReportRenderer` plots a
70+
* single `xAxis`×`yAxis` series and does not read this; only the legacy
71+
* `ReportViewer` fallback consumed a top-level `groupBy`.
72+
*/
73+
groupBy: z.string().optional().describe('[EXPERIMENTAL — not enforced] Additional series-split grouping; not read by the dataset-bound report renderer (liveness #1878/#1890)'),
5274
}));
5375

5476
/**

0 commit comments

Comments
 (0)