Measured while implementing #6121 (PR #6895), filed unassigned and not fixed there — that
card's ruled scope is the report authoring face, and this is a different question about a
different node. Recorded here so it is not lost.
Measured on origin/main 5d36766fb.
The two keys
@object-ui/types declares the inline-static-data chart node
(packages/types/src/data-display.ts):
ChartSchema.categories?: string[] // commented "X-axis labels/categories"
ChartSchema.series: ChartDataSeries[]
ChartDataSeries = { name: string; data: number[]; color?: string } // `data` REQUIRED
ChartDataSeries' own header states the model: "a display name plus the literal numbers to
plot, positionally aligned with the chart's categories".
The renderer these nodes reach is normalizeChartSchema in @object-ui/plugin-charts
(packages/plugin-charts/src/normalizeChartSchema.ts), via ChartRenderer. Read it and the
model is not implemented:
1. series[].data is read by nothing. normalizeSeries (:232-258) reads exactly
dataKey/name, label, chartType/type, variant, opacity, dashArray, stack,
yAxis, color. data is not among them, and a repo-wide grep for a read of a series' own
data array finds no non-test call site. Rows come from the chart-level data — a key
ChartSchema does not declare at all, which survives only because BaseSchema carries
[key: string]: any, so excess-property checking never engages on a ChartSchema literal.
⇒ data: number[] is required on every authored series, and dropped.
2. categories is read as an alternative SERIES list, not as axis labels (:302-306):
const rawSeries = Array.isArray(schema.series)
? schema.series
: Array.isArray(schema.categories)
? schema.categories
: undefined;
Each entry then goes through normalizeSeries, whose bare-string branch treats it as
{ dataKey }. The category axis instead comes from xAxisKey / xAxis (:290-292). So an
author following the declared comment — writing month names into categories expecting an
x-axis — gets them interpreted as series bindings when series is absent, and ignored when
it is present. The .d.ts comment and the read disagree about what the key means.
Why it matters, and why it is not #6121's to fix
This is ADR-0049's declared-but-unenforced shape on a published type, in the direction
that costs an author the most: the type demands data (so it cannot be omitted) and then
nothing consumes it, while categories documents one meaning and performs another. Both are
invisible to every gate — ChartSchema literals are not excess-checked (index signature),
and the zod twin ChartDataSeriesSchema mirrors the same unread requirement.
#6121 (PR #6895) touched ChartDataSeries only to add the per-series type override the
ruling named, and only because normalizeChartSchema demonstrably reads it. Removing or
relaxing data, or re-pointing categories, changes the accept set of a published type in
the narrowing direction — the manual floor — and is a separate judgement about what the
static SDUI chart node is for.
What a fix would have to decide
- Is the inline-static-data chart node (
categories + series[].data) a live authoring
model the renderer should implement, or a retired one whose keys should go under
ADR-0049 enforce-or-remove? Nothing in packages/, apps/ or examples/ authors a
populated series[].data outside tests.
- If it stays:
normalizeChartSchema gains a real inline-data branch, and categories
feeds xAxisKey as the comment promises.
- If it goes:
data becomes optional or is retired, categories' comment is corrected to
the series-list meaning it actually has, and the zod twin follows.
⛔ Not the same defect family as #4466 / #4497 / #4507 / #4673 / #4683 / #4695, which are all
about buildChartSeries on the dataset-bound path. This is the static SDUI node, which
never calls buildChartSeries. Deduped against those before filing.
Measured while implementing #6121 (PR #6895), filed unassigned and not fixed there — that
card's ruled scope is the report authoring face, and this is a different question about a
different node. Recorded here so it is not lost.
Measured on
origin/main5d36766fb.The two keys
@object-ui/typesdeclares the inline-static-data chart node(
packages/types/src/data-display.ts):ChartDataSeries' own header states the model: "a display name plus the literal numbers toplot, positionally aligned with the chart's
categories".The renderer these nodes reach is
normalizeChartSchemain@object-ui/plugin-charts(
packages/plugin-charts/src/normalizeChartSchema.ts), viaChartRenderer. Read it and themodel is not implemented:
1.
series[].datais read by nothing.normalizeSeries(:232-258) reads exactlydataKey/name,label,chartType/type,variant,opacity,dashArray,stack,yAxis,color.datais not among them, and a repo-wide grep for a read of a series' owndataarray finds no non-test call site. Rows come from the chart-leveldata— a keyChartSchemadoes not declare at all, which survives only becauseBaseSchemacarries[key: string]: any, so excess-property checking never engages on aChartSchemaliteral.⇒
data: number[]is required on every authored series, and dropped.2.
categoriesis read as an alternative SERIES list, not as axis labels (:302-306):Each entry then goes through
normalizeSeries, whose bare-string branch treats it as{ dataKey }. The category axis instead comes fromxAxisKey/xAxis(:290-292). So anauthor following the declared comment — writing month names into
categoriesexpecting anx-axis — gets them interpreted as series bindings when
seriesis absent, and ignored whenit is present. The
.d.tscomment and the read disagree about what the key means.Why it matters, and why it is not #6121's to fix
This is ADR-0049's declared-but-unenforced shape on a published type, in the direction
that costs an author the most: the type demands
data(so it cannot be omitted) and thennothing consumes it, while
categoriesdocuments one meaning and performs another. Both areinvisible to every gate —
ChartSchemaliterals are not excess-checked (index signature),and the zod twin
ChartDataSeriesSchemamirrors the same unread requirement.#6121 (PR #6895) touched
ChartDataSeriesonly to add the per-seriestypeoverride theruling named, and only because
normalizeChartSchemademonstrably reads it. Removing orrelaxing
data, or re-pointingcategories, changes the accept set of a published type inthe narrowing direction — the manual floor — and is a separate judgement about what the
static SDUI chart node is for.
What a fix would have to decide
categories+series[].data) a live authoringmodel the renderer should implement, or a retired one whose keys should go under
ADR-0049 enforce-or-remove? Nothing in
packages/,apps/orexamples/authors apopulated
series[].dataoutside tests.normalizeChartSchemagains a real inline-data branch, andcategoriesfeeds
xAxisKeyas the comment promises.databecomes optional or is retired,categories' comment is corrected tothe series-list meaning it actually has, and the zod twin follows.
⛔ Not the same defect family as #4466 / #4497 / #4507 / #4673 / #4683 / #4695, which are all
about
buildChartSerieson the dataset-bound path. This is the static SDUI node, whichnever calls
buildChartSeries. Deduped against those before filing.