@object-ui/plugin-charts 17.6.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3254 -0
- package/README.md +32 -17
- package/dist/AdvancedChartImpl.d.ts +29 -11
- package/dist/ChartRenderer.d.ts +19 -2
- package/dist/ObjectChart.d.ts +136 -4
- package/dist/index.d.ts +67 -7
- package/dist/index.js +1753 -1066
- package/dist/index.umd.cjs +2 -2
- package/dist/normalizeChartSchema.d.ts +242 -14
- package/dist/types.d.ts +31 -28
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -20,11 +20,14 @@ pnpm add @object-ui/plugin-charts
|
|
|
20
20
|
### Automatic Registration (Side-Effect Import)
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
|
-
// In your app entry point (e.g., App.tsx or main.tsx)
|
|
23
|
+
// In your app entry point (e.g., App.tsx or main.tsx). This side-effect import
|
|
24
|
+
// is the one that registers the components; the type import below is erased at
|
|
25
|
+
// build time and registers nothing.
|
|
24
26
|
import '@object-ui/plugin-charts';
|
|
27
|
+
import type { BarChartSchema } from '@object-ui/plugin-charts';
|
|
25
28
|
|
|
26
|
-
// Now you can use chart
|
|
27
|
-
const schema = {
|
|
29
|
+
// Now you can use the bar-chart type in your schemas
|
|
30
|
+
const schema: BarChartSchema = {
|
|
28
31
|
type: 'bar-chart',
|
|
29
32
|
data: [
|
|
30
33
|
{ name: 'Jan', value: 400 },
|
|
@@ -43,9 +46,11 @@ const schema = {
|
|
|
43
46
|
import { chartComponents } from '@object-ui/plugin-charts';
|
|
44
47
|
import { ComponentRegistry } from '@object-ui/core';
|
|
45
48
|
|
|
46
|
-
// Manually register if needed
|
|
49
|
+
// Manually register if needed. The third argument is not optional in practice:
|
|
50
|
+
// `register()` without a namespace is the deprecated form and warns at runtime.
|
|
51
|
+
// `plugin-charts` is the namespace this package registers under itself.
|
|
47
52
|
Object.entries(chartComponents).forEach(([type, component]) => {
|
|
48
|
-
ComponentRegistry.register(type, component);
|
|
53
|
+
ComponentRegistry.register(type, component, { namespace: 'plugin-charts' });
|
|
49
54
|
});
|
|
50
55
|
```
|
|
51
56
|
|
|
@@ -70,17 +75,27 @@ const schema: BarChartSchema = {
|
|
|
70
75
|
|
|
71
76
|
## Schema API
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
`BarChartSchema` is the published contract — import it (see **TypeScript Support**
|
|
79
|
+
above) rather than re-declaring this shape in your own code. It is re-exported
|
|
80
|
+
from `@object-ui/types`, so the type you annotate with and the schema that
|
|
81
|
+
validates your document are the same declaration.
|
|
82
|
+
|
|
83
|
+
| Member | Type | Required | Default | Notes |
|
|
84
|
+
| --- | --- | --- | --- | --- |
|
|
85
|
+
| `type` | `'bar-chart'` | yes | — | The registry keyword this schema renders under. |
|
|
86
|
+
| `data` | `Array<Record<string, any>>` | no | `[]` | Rows to plot — one bar per row. |
|
|
87
|
+
| `dataKey` | `string` | no | `'value'` | Row key holding the bar's value (the y axis). |
|
|
88
|
+
| `xAxisKey` | `string` | no | `'name'` | Row key holding the bar's category label (the x axis). |
|
|
89
|
+
| `height` | `number` | no | `400` | Chart height in pixels — a number, not a CSS length. |
|
|
90
|
+
| `color` | `string` | no | `hsl(var(--primary))` | Bar fill colour, forwarded to Recharts verbatim. |
|
|
91
|
+
| `className` | `string` | no | `''` | Tailwind classes. Inherited from `BaseSchema`. |
|
|
92
|
+
|
|
93
|
+
Every default above is the renderer's own — the parameter defaults of
|
|
94
|
+
`ChartBarRenderer`'s implementation in `src/ChartImpl.tsx`, which is what an
|
|
95
|
+
omitted member actually resolves to at render time. Note `color`: the type's
|
|
96
|
+
JSDoc and the registration's `defaultProps` both still record `'#8884d8'`, but
|
|
97
|
+
neither is read on the render path, so an omitted `color` renders as the theme
|
|
98
|
+
token above.
|
|
84
99
|
|
|
85
100
|
## Lazy Loading Architecture
|
|
86
101
|
|
|
@@ -93,7 +108,7 @@ When bundled, Vite automatically creates separate chunks:
|
|
|
93
108
|
- `index.js` (~200 bytes) - The entry point
|
|
94
109
|
- `ChartImpl-xxx.js` (~541 KB minified, ~136 KB gzipped) - The lazy-loaded implementation
|
|
95
110
|
|
|
96
|
-
The Recharts library is only downloaded when a `chart
|
|
111
|
+
The Recharts library is only downloaded when a `bar-chart` component is actually rendered, not on initial page load.
|
|
97
112
|
|
|
98
113
|
## Build Output Example
|
|
99
114
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChartContainerConfig } from './ChartContainerImpl';
|
|
2
|
-
import { NormalizedAxis, NormalizedSeries } from './normalizeChartSchema';
|
|
1
|
+
import { ChartContainerConfig } from './ChartContainerImpl.js';
|
|
2
|
+
import { DeclaredChartFamily, NormalizedAxis, NormalizedSeries } from './normalizeChartSchema.js';
|
|
3
3
|
import { ChartSegmentClickEvent } from '@object-ui/core';
|
|
4
4
|
/**
|
|
5
5
|
* ObjectUI
|
|
@@ -11,11 +11,22 @@ import { ChartSegmentClickEvent } from '@object-ui/core';
|
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
export interface AdvancedChartImplProps {
|
|
13
13
|
/**
|
|
14
|
-
* Chart family. `combo` is renderer-local and rarely
|
|
15
|
-
* series declaring different families derive it
|
|
16
|
-
* which is how `@objectstack/spec` expresses a
|
|
14
|
+
* Chart family, as the schema names it. `combo` is renderer-local and rarely
|
|
15
|
+
* needs to be passed: series declaring different families derive it
|
|
16
|
+
* (`effectiveChartFamily`), which is how `@objectstack/spec` expresses a
|
|
17
|
+
* combo chart.
|
|
18
|
+
*
|
|
19
|
+
* Typed as the declared chart families ({@link DeclaredChartFamily}: the
|
|
20
|
+
* spec's `ChartType` and the `object-chart` node's own union, by reference),
|
|
21
|
+
* so a misspelled family does not compile. The family dispatch below is the
|
|
22
|
+
* one place a family becomes a form: a chart for `RENDERABLE`, the number
|
|
23
|
+
* card for the single-value families, the tabular notice for the tabular
|
|
24
|
+
* ones, and a notice for anything else, which is how a value from unvalidated
|
|
25
|
+
* JSON outside the type is answered at runtime. ⛔ There is no default family
|
|
26
|
+
* (objectui#11520): an absent family is that notice too, never a bar. A
|
|
27
|
+
* caller that means a bar passes `'bar'`.
|
|
17
28
|
*/
|
|
18
|
-
chartType?:
|
|
29
|
+
chartType?: DeclaredChartFamily;
|
|
19
30
|
data?: Array<Record<string, any>>;
|
|
20
31
|
config?: ChartContainerConfig;
|
|
21
32
|
xAxisKey?: string;
|
|
@@ -83,17 +94,24 @@ export interface AdvancedChartImplProps {
|
|
|
83
94
|
onChartClick?: (event: ChartSegmentClickEvent) => void;
|
|
84
95
|
/**
|
|
85
96
|
* Spec `ChartAxis` presentation for the category axis — `format` (tick
|
|
86
|
-
* formatter), `title`, `showGridLines
|
|
97
|
+
* formatter), `title`, `showGridLines`, `position` (the side it is drawn
|
|
98
|
+
* on — see `placeXAxis`), and on scatter's measure x axis `min` / `max` /
|
|
99
|
+
* `stepSize` / `logarithmic` as well. Its `field` already arrived as
|
|
87
100
|
* {@link AdvancedChartImplProps.xAxisKey}. Resolved by
|
|
88
101
|
* `normalizeChartSchema`, so the renderer never parses the author shape.
|
|
89
102
|
*/
|
|
90
103
|
xAxis?: NormalizedAxis;
|
|
91
104
|
/**
|
|
92
105
|
* Spec `ChartConfig.yAxis` — one entry per value axis, in declaration order.
|
|
93
|
-
* Index 0 is the primary axis
|
|
94
|
-
*
|
|
95
|
-
* binds to
|
|
96
|
-
*
|
|
106
|
+
* Index 0 is the primary axis. A second entry turns on the second value
|
|
107
|
+
* axis; each entry's `position` picks the slot it is drawn in, and
|
|
108
|
+
* `series[].yAxis` binds a series to a slot (`placeYAxes` in
|
|
109
|
+
* `normalizeChartSchema`). A lone entry is the chart's only value axis,
|
|
110
|
+
* drawn on the side it names. Carries `min`/`max` (domain), `format`
|
|
111
|
+
* (ticks), `logarithmic` (scale) and `title`. An entry after the second
|
|
112
|
+
* (after the first on `scatter`, which draws one y axis) is drawn on no
|
|
113
|
+
* axis, and the chart carries a note naming it (`yAxisUndrawnNotes`,
|
|
114
|
+
* objectui#10691, objectui#10721).
|
|
97
115
|
*/
|
|
98
116
|
yAxes?: NormalizedAxis[];
|
|
99
117
|
/** Spec `ChartConfig.showLegend`. Omitted → shown (the schema default). */
|
package/dist/ChartRenderer.d.ts
CHANGED
|
@@ -34,12 +34,28 @@ export interface ChartRendererProps {
|
|
|
34
34
|
* the same key, so declaring only the internal shape here made
|
|
35
35
|
* `series: [{ name: 'total' }]` a type error on an author who was writing
|
|
36
36
|
* the protocol correctly — and, until #2945, one whose chart also rendered
|
|
37
|
-
* blank. `normalizeChartSchema` translates
|
|
38
|
-
*
|
|
37
|
+
* blank. `normalizeChartSchema` translates every entry, of either shape,
|
|
38
|
+
* uniformly — see the normalization comment in the component body.
|
|
39
|
+
*
|
|
40
|
+
* Both arms carry the per-series family override `type`, with the same
|
|
41
|
+
* member type (objectui#8086): the renderer honours it on either shape,
|
|
42
|
+
* because every entry goes through `normalizeSeries` (`01c27c431`), and
|
|
43
|
+
* `ChartDataSeriesSchema` declares `dataKey` and `name` independently
|
|
44
|
+
* optional beside it — so a `dataKey` entry carrying `type` is what the
|
|
45
|
+
* contract and the renderer both accept, and this union says so.
|
|
46
|
+
* `chartType` stays on the `dataKey` arm alone: it is the renderer's
|
|
47
|
+
* INTERNAL spelling of `type`, and it wins when an entry writes both.
|
|
48
|
+
* Pinned at compile time in `ChartRenderer.seriesTypeArm-8086.test.ts`.
|
|
49
|
+
*
|
|
50
|
+
* `aggregate` is internal too, on the `dataKey` arm alone (objectui#11681):
|
|
51
|
+
* the measure's aggregate, carried by `buildChartSeries` from the dataset
|
|
52
|
+
* answer, so a value axis over counts draws whole-number ticks. The
|
|
53
|
+
* authoring face refuses it by name (`ChartDataSeriesSchema.aggregate`).
|
|
39
54
|
*/
|
|
40
55
|
series?: Array<{
|
|
41
56
|
dataKey: string;
|
|
42
57
|
label?: string;
|
|
58
|
+
type?: string;
|
|
43
59
|
variant?: 'current' | 'comparison';
|
|
44
60
|
opacity?: number;
|
|
45
61
|
dashArray?: string;
|
|
@@ -47,6 +63,7 @@ export interface ChartRendererProps {
|
|
|
47
63
|
stack?: string;
|
|
48
64
|
yAxis?: 'left' | 'right';
|
|
49
65
|
color?: string;
|
|
66
|
+
aggregate?: string;
|
|
50
67
|
} | {
|
|
51
68
|
name: string;
|
|
52
69
|
label?: unknown;
|
package/dist/ObjectChart.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { humanizeLabel } from '@object-ui/core';
|
|
2
|
+
import { humanizeLabel, ChartSegmentClickEvent } from '@object-ui/core';
|
|
3
|
+
import { BaseSchema, ObjectChartSchema } from '@object-ui/types';
|
|
3
4
|
/**
|
|
4
5
|
* Humanize a snake_case or kebab-case string into Title Case.
|
|
5
6
|
*
|
|
@@ -28,16 +29,84 @@ export declare function aggregateValueKey(aggregate: {
|
|
|
28
29
|
field?: string;
|
|
29
30
|
function?: string;
|
|
30
31
|
}): string;
|
|
32
|
+
/**
|
|
33
|
+
* The category axis this chart plots BY — resolved ONCE, for every reader.
|
|
34
|
+
*
|
|
35
|
+
* ## Why this is a function and not three inline reads
|
|
36
|
+
*
|
|
37
|
+
* "Which column is the category?" was spelled three times in this file, at
|
|
38
|
+
* three fidelities, and the refusal below would have been a fourth. That is the
|
|
39
|
+
* objectui#5042 / objectui#7544 drift shape — a second opinion of one question
|
|
40
|
+
* that nothing keeps in agreement — and objectui#7544's fix
|
|
41
|
+
* (`resolveListChartBinding` in `plugin-list/src/ListView.tsx`) is the same move
|
|
42
|
+
* one layer up, on the AUTHORED list-view chart block.
|
|
43
|
+
*
|
|
44
|
+
* ⚠️ It is one layer up, not this layer. `resolveListChartBinding` reads
|
|
45
|
+
* `{ chart, options.chart }` — the block an author writes on a LIST VIEW, whose
|
|
46
|
+
* only binding since objectui#6152 round 15 is an ADR-0021 `dataset` (its
|
|
47
|
+
* pre-ADR-0021 `xAxisField` / `categoryField` / `yAxisFields` leg retired). By
|
|
48
|
+
* the time a schema reaches this component the relays have already translated
|
|
49
|
+
* that block into `{ dataset, dimensions, values }`, or, for a block naming no
|
|
50
|
+
* dataset, into an object-bound node naming no category, and the producers that never
|
|
51
|
+
* had such a block at all (the two dashboard surfaces, and directly authored
|
|
52
|
+
* `object-chart` metadata) compose the translated shape straight away. So the
|
|
53
|
+
* upstream resolver cannot be CALLED here — asked for `schema.chart` it would
|
|
54
|
+
* read `undefined` off every chart this component renders and answer
|
|
55
|
+
* "unresolvable" for all of them. What is shared is the QUESTION and the rule
|
|
56
|
+
* for answering it; the vocabulary is necessarily this layer's.
|
|
57
|
+
*
|
|
58
|
+
* ## The three legs, in the order the render pipeline applies them
|
|
59
|
+
*
|
|
60
|
+
* 1. A structured `GroupBy` node (`{ field, dateGranularity }`) — its `field`
|
|
61
|
+
* IS the category, and nothing substitutes for it: `runAggregate` sends the
|
|
62
|
+
* node itself as the server's `groupBy`, so a node naming no field has no
|
|
63
|
+
* other spelling that could rescue it.
|
|
64
|
+
* 2. A legacy string `aggregate.groupBy`.
|
|
65
|
+
* 3. Otherwise the chart plots rows as fetched, and the category is whatever
|
|
66
|
+
* `normalizeChartSchema` — this package's ONE translation of the spec's
|
|
67
|
+
* author-facing chart shape into the renderer's internal contract — resolves
|
|
68
|
+
* for the x axis: `xAxisKey`, else spec `xAxis.field`, else a bare string
|
|
69
|
+
* `xAxis`. Reading `schema.xAxisKey` alone here would have refused a chart
|
|
70
|
+
* that authored the spec spelling and renders correctly today, because
|
|
71
|
+
* `ChartRenderer` normalizes DOWNSTREAM of this component.
|
|
72
|
+
*
|
|
73
|
+
* Returns `undefined` only when the schema names no category by any declared
|
|
74
|
+
* spelling — a real answer, and what {@link ObjectChart}'s refusal keys on.
|
|
75
|
+
*
|
|
76
|
+
* ⚠️ LEDGERED, on purpose: this is the one `normalizeChartSchema` call in the
|
|
77
|
+
* package that passes NO language (objectui#8943). It is safe here and only
|
|
78
|
+
* here — the call reads `.xAxisKey`, a COLUMN NAME, and nothing else. No
|
|
79
|
+
* `I18nLabel` slot on the result is ever read through this path, so there is no
|
|
80
|
+
* label for a language to resolve. Keeping the function pure (it is called from
|
|
81
|
+
* plain module scope, outside any component) is worth more than a language
|
|
82
|
+
* argument that would change no byte of its answer. ⛔ If this ever starts
|
|
83
|
+
* reading `title` / `subtitle` / `description` / an axis `title` / a series
|
|
84
|
+
* `label`, it needs the viewer's language and can no longer be called from
|
|
85
|
+
* outside a component.
|
|
86
|
+
*/
|
|
87
|
+
export declare function resolveChartCategoryField(schema: {
|
|
88
|
+
aggregate?: {
|
|
89
|
+
groupBy?: unknown;
|
|
90
|
+
} | undefined;
|
|
91
|
+
xAxisKey?: unknown;
|
|
92
|
+
xAxis?: unknown;
|
|
93
|
+
} | undefined | null): string | undefined;
|
|
31
94
|
/** Suffix the previous-window value carries under a compareTo overlay. */
|
|
32
95
|
export declare const COMPARISON_SUFFIX = "__comparison";
|
|
33
96
|
/**
|
|
34
97
|
* Client-side aggregation for fetched records.
|
|
35
98
|
* Groups records by `groupBy` field and applies the aggregation function
|
|
36
99
|
* to the `field` values in each group.
|
|
100
|
+
*
|
|
101
|
+
* `function` is optional because the `switch` below already implements that:
|
|
102
|
+
* an absent (or unknown) function falls through to `sum`. The parameter used to
|
|
103
|
+
* say `function: string`, which was a claim about the CALLER rather than about
|
|
104
|
+
* this body — and no caller could satisfy it once `ObjectChartSchema.aggregate`
|
|
105
|
+
* was declared with the requiredness its own reads have (objectui#7946).
|
|
37
106
|
*/
|
|
38
107
|
export declare function aggregateRecords(records: any[], aggregate: {
|
|
39
108
|
field?: string;
|
|
40
|
-
function
|
|
109
|
+
function?: string;
|
|
41
110
|
groupBy: string;
|
|
42
111
|
}): any[];
|
|
43
112
|
/**
|
|
@@ -55,7 +124,52 @@ export declare function aggregateRecords(records: any[], aggregate: {
|
|
|
55
124
|
*/
|
|
56
125
|
export declare function resolveGroupByLabels(data: any[], groupByField: string, objectSchema: any, dataSource?: any, translateOption?: (value: string, fallbackLabel: string) => string): Promise<any[]>;
|
|
57
126
|
export { extractRecords } from '@object-ui/core';
|
|
58
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Props of {@link ObjectChart} — anchored to the published `ObjectChartSchema`
|
|
129
|
+
* (objectui#7946, maintainer ruling 2026-09-09 option A), as objectui#6576 did
|
|
130
|
+
* for `ObjectGalleryProps.schema`.
|
|
131
|
+
*
|
|
132
|
+
* ## What this replaces, and what it buys
|
|
133
|
+
*
|
|
134
|
+
* This component was published as `(props: any)`, so every `schema={{ … }}`
|
|
135
|
+
* literal handed to it — including the two in `app-shell`'s `ObjectView` — was
|
|
136
|
+
* type-checked against NOTHING. That is the mechanism that let objectui#7891's
|
|
137
|
+
* undeclared `config` rung live from the day it was written until someone read
|
|
138
|
+
* the spec by hand, and it is why the two `as any` casts on those literals
|
|
139
|
+
* measured INERT: an `any` consumer accepts a cast and its absence alike.
|
|
140
|
+
*
|
|
141
|
+
* With the anchor, a wrong VALUE TYPE on a declared key is a compile error at
|
|
142
|
+
* the producer (`xAxisKey: 42`, `series: 'x'`, `type: 'chart'`, and every
|
|
143
|
+
* `BaseSchema` member — `visible: 42`). ⚠️ A MISSPELLED key was still accepted
|
|
144
|
+
* while `BaseSchema` carried `[key: string]: any` (objectui#5155), the same
|
|
145
|
+
* ceiling objectui#6576 accepted knowingly; objectui#8347 removed it, so a
|
|
146
|
+
* misspelled key in a fresh literal is refused now.
|
|
147
|
+
* `__tests__/ObjectChart.schemaAnchor-7946.test.ts` pins both halves, the
|
|
148
|
+
* flipped ceiling row included, so the anchor is not read as more than it is.
|
|
149
|
+
*/
|
|
150
|
+
export interface ObjectChartProps {
|
|
151
|
+
/**
|
|
152
|
+
* The `object-chart` node — anchored to the exported schema type. Every
|
|
153
|
+
* `BaseSchema` member is writable, `bind` / `className` / `data` included;
|
|
154
|
+
* the widget's own keys are declared there.
|
|
155
|
+
*/
|
|
156
|
+
schema: ObjectChartSchema;
|
|
157
|
+
/**
|
|
158
|
+
* Host data source. `any` deliberately, and it is NOT a residue of the shape
|
|
159
|
+
* this card removed: it is the type `SchemaRendererContext.dataSource`
|
|
160
|
+
* itself carries, and this component falls back to that context value, so a
|
|
161
|
+
* narrower declaration here would claim a guarantee the fallback cannot
|
|
162
|
+
* keep. Narrowing it is a repo-wide `dataSource` interface, not this card.
|
|
163
|
+
*/
|
|
164
|
+
dataSource?: any;
|
|
165
|
+
/**
|
|
166
|
+
* Optional host-owned segment click. When provided (e.g. a dataset widget
|
|
167
|
+
* that owns precise drill-through), it takes over the chart click and the
|
|
168
|
+
* widget's own object-drill drawer is suppressed.
|
|
169
|
+
*/
|
|
170
|
+
onSegmentClick?: (ev: ChartSegmentClickEvent) => void;
|
|
171
|
+
}
|
|
172
|
+
export declare const ObjectChart: (props: ObjectChartProps) => React.JSX.Element;
|
|
59
173
|
/**
|
|
60
174
|
* Registry shell for `object-chart` — maps the spec's
|
|
61
175
|
* `PageComponentSchema.dataSource` binding onto the keys {@link ObjectChart}
|
|
@@ -67,5 +181,23 @@ export declare const ObjectChart: (props: any) => React.JSX.Element;
|
|
|
67
181
|
* spec documents rendered an empty frame with no error and no request. Lives
|
|
68
182
|
* here, beside the registration, rather than in `ChartContainerImpl` — the
|
|
69
183
|
* binding is a registry-boundary concern, not a rendering one.
|
|
184
|
+
*
|
|
185
|
+
* ## Its props type — the node BEFORE the gate (objectui#8885)
|
|
186
|
+
*
|
|
187
|
+
* This shell used to be published as `(props: any)`. `schema` is now
|
|
188
|
+
* `BaseSchema`, the node `SchemaRenderer` hands every registered renderer, and
|
|
189
|
+
* ⛔ NOT `ObjectChartSchema`. The node arrives here before the gate has mapped
|
|
190
|
+
* its `dataSource` binding, and nothing has validated it as a chart. Typing it
|
|
191
|
+
* post-gate would claim a validation that has not happened, and that type's
|
|
192
|
+
* `type: 'object-chart'` literal is also false for the `chart` alias that
|
|
193
|
+
* `index.tsx` registers this same shell under.
|
|
194
|
+
*
|
|
195
|
+
* Every other prop is `ObjectChart`'s own, taken from `ObjectChartProps`, so
|
|
196
|
+
* the type is CLOSED: a misspelled prop name is an excess-property error, not
|
|
197
|
+
* an `any` passed straight through. Both halves are existing exported names;
|
|
198
|
+
* no new type is minted. Pinned by
|
|
199
|
+
* `__tests__/ObjectChartBlock.props-8885.test.tsx`.
|
|
70
200
|
*/
|
|
71
|
-
export declare const ObjectChartBlock: (props:
|
|
201
|
+
export declare const ObjectChartBlock: (props: Omit<ObjectChartProps, "schema"> & {
|
|
202
|
+
schema: BaseSchema;
|
|
203
|
+
}) => React.JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,70 @@
|
|
|
1
|
-
import { ChartBarRenderer, ChartRenderer } from './ChartRenderer';
|
|
2
|
-
export type { BarChartSchema } from './types';
|
|
1
|
+
import { ChartBarRenderer, ChartRenderer } from './ChartRenderer.js';
|
|
2
|
+
export type { BarChartSchema } from './types.js';
|
|
3
3
|
export { ChartBarRenderer, ChartRenderer };
|
|
4
|
-
export { ObjectChart, ObjectChartBlock } from './ObjectChart';
|
|
5
|
-
export {
|
|
6
|
-
export
|
|
4
|
+
export { ObjectChart, ObjectChartBlock } from './ObjectChart.js';
|
|
5
|
+
export type { ObjectChartProps } from './ObjectChart.js';
|
|
6
|
+
export { normalizeChartSchema } from './normalizeChartSchema.js';
|
|
7
|
+
export type { NormalizedChartSchema } from './normalizeChartSchema.js';
|
|
7
8
|
export declare const chartComponents: {
|
|
8
|
-
'bar-chart': import('react').FC<import('./ChartRenderer').ChartBarRendererProps>;
|
|
9
|
-
chart: import('react').FC<import('./ChartRenderer').ChartRendererProps>;
|
|
9
|
+
'bar-chart': import('react').FC<import('./ChartRenderer.js').ChartBarRendererProps>;
|
|
10
|
+
chart: import('react').FC<import('./ChartRenderer.js').ChartRendererProps>;
|
|
10
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* ⛔ The `pie-chart`, `donut-chart` and `radar-chart` node type keys are
|
|
14
|
+
* RETIRED (objectui#10859 batch 8, phase 2c, the seat's fork ruling on that
|
|
15
|
+
* card, by the objectui#10393 / objectui#8760 route). Each family is reached as
|
|
16
|
+
* `{ type: 'chart', chartType: 'pie' | 'donut' | 'radar' }`, the spelling that
|
|
17
|
+
* draws ("chartType is the spelling that draws", objectui#8760).
|
|
18
|
+
*
|
|
19
|
+
* ## What was here, and why it went
|
|
20
|
+
*
|
|
21
|
+
* Three registrations of the generic `ChartRenderer`, one per key, each in the
|
|
22
|
+
* `plugin-charts` namespace, so each stored `plugin-charts:KEY` and the bare
|
|
23
|
+
* `KEY` fallback; their families came from `CHART_TYPE_KEYWORD_FAMILIES` rows
|
|
24
|
+
* (objectui#7401), which went in the same change. No `@object-ui/types` arm
|
|
25
|
+
* claims any of the three, so `objectui validate` refused such a node at
|
|
26
|
+
* `type` while the registry mounted it.
|
|
27
|
+
*
|
|
28
|
+
* ## Why unregistering is the whole retirement
|
|
29
|
+
*
|
|
30
|
+
* Phase 2b found one producer and reported the three as a fork:
|
|
31
|
+
* `examples/chart-examples.ts` in this package authored all three, pinned by
|
|
32
|
+
* objectui#7401's "the in-repo examples draw what they say". The fork ruling
|
|
33
|
+
* moved those examples to `chart` + `chartType` first; the 7401 pin still
|
|
34
|
+
* asserts each draws its family and no bar. Re-measured for phase 2c after that
|
|
35
|
+
* move: 0 producers in source, docs, examples, the catalog or objectstack, and
|
|
36
|
+
* 0 runtime emission. The console's lazy stubs went in the same change, so no
|
|
37
|
+
* table or host keeps a key alive. The pie, donut and radar FAMILIES are
|
|
38
|
+
* untouched.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* ⛔ The `scatter-chart` node type key is RETIRED (objectui#10859 batch 8,
|
|
42
|
+
* phase 2b, the seat's ruling on that card, by the objectui#10393 /
|
|
43
|
+
* objectui#8760 route). The scatter family is reached the way every other
|
|
44
|
+
* family is: `{ type: 'chart', chartType: 'scatter' }`, the spelling that
|
|
45
|
+
* draws ("chartType is the spelling that draws", objectui#8760).
|
|
46
|
+
*
|
|
47
|
+
* ## What was here, and why it went
|
|
48
|
+
*
|
|
49
|
+
* A registration of the generic `ChartRenderer` under `scatter-chart` in the
|
|
50
|
+
* `plugin-charts` namespace (described, not quoted: source readers such as
|
|
51
|
+
* `@object-ui/types`' node-slot test take a quoted call in a comment for a live
|
|
52
|
+
* one) — a second key on the generic renderer, which stored
|
|
53
|
+
* both `plugin-charts:scatter-chart` and the bare `scatter-chart` fallback, and
|
|
54
|
+
* whose family came from its `CHART_TYPE_KEYWORD_FAMILIES` row (objectui#7401).
|
|
55
|
+
* No `@object-ui/types` arm claims it, so `objectui validate` refused a node
|
|
56
|
+
* authored `type: 'scatter-chart'` at `type` while the registry mounted it.
|
|
57
|
+
*
|
|
58
|
+
* ## Why unregistering is the whole retirement
|
|
59
|
+
*
|
|
60
|
+
* Nothing wrote the node: 0 producers in source, docs, examples, the catalog
|
|
61
|
+
* or objectstack, and 0 runtime emission, re-measured for phase 2b. Its
|
|
62
|
+
* `CHART_TYPE_KEYWORD_FAMILIES` row and the console's lazy stub
|
|
63
|
+
* (`apps/console/src/register-plugins.ts`) went in the same change, so no table
|
|
64
|
+
* or host keeps the key alive. The `scatter` FAMILY is untouched.
|
|
65
|
+
*
|
|
66
|
+
* `pie-chart`, `donut-chart` and `radar-chart` were ruled the same way. Phase
|
|
67
|
+
* 2b kept them registered as a fork, because `examples/chart-examples.ts` still
|
|
68
|
+
* authored them; phase 2c retired them once those examples had moved (the note
|
|
69
|
+
* above).
|
|
70
|
+
*/
|