@open-tomato/charts 0.0.0-stage → 0.1.1

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.
Files changed (75) hide show
  1. package/README.md +286 -2
  2. package/dist/engine/BarChart/BarChart.d.ts +4 -0
  3. package/dist/engine/BarChart/BarChart.option.d.ts +4 -0
  4. package/dist/engine/BarChart/index.d.ts +2 -0
  5. package/dist/engine/BoxPlot/BoxPlot.d.ts +4 -0
  6. package/dist/engine/BoxPlot/BoxPlot.option.d.ts +4 -0
  7. package/dist/engine/BoxPlot/index.d.ts +2 -0
  8. package/dist/engine/Bullet/Bullet.d.ts +4 -0
  9. package/dist/engine/Bullet/Bullet.option.d.ts +4 -0
  10. package/dist/engine/Bullet/index.d.ts +2 -0
  11. package/dist/engine/Donut/Donut.d.ts +4 -0
  12. package/dist/engine/Donut/Donut.option.d.ts +4 -0
  13. package/dist/engine/Donut/index.d.ts +2 -0
  14. package/dist/engine/Gauge/Gauge.d.ts +4 -0
  15. package/dist/engine/Gauge/Gauge.option.d.ts +4 -0
  16. package/dist/engine/Gauge/index.d.ts +2 -0
  17. package/dist/engine/HeatmapGrid/HeatmapGrid.d.ts +4 -0
  18. package/dist/engine/HeatmapGrid/HeatmapGrid.option.d.ts +4 -0
  19. package/dist/engine/HeatmapGrid/index.d.ts +2 -0
  20. package/dist/engine/Histogram/Histogram.d.ts +4 -0
  21. package/dist/engine/Histogram/Histogram.option.d.ts +4 -0
  22. package/dist/engine/Histogram/index.d.ts +2 -0
  23. package/dist/engine/LineChart/LineChart.d.ts +19 -0
  24. package/dist/engine/LineChart/LineChart.option.d.ts +4 -0
  25. package/dist/engine/LineChart/index.d.ts +2 -0
  26. package/dist/engine/NetworkGraph/NetworkGraph.d.ts +4 -0
  27. package/dist/engine/NetworkGraph/NetworkGraph.option.d.ts +8 -0
  28. package/dist/engine/NetworkGraph/index.d.ts +2 -0
  29. package/dist/engine/Nightingale/Nightingale.d.ts +4 -0
  30. package/dist/engine/Nightingale/Nightingale.option.d.ts +4 -0
  31. package/dist/engine/Nightingale/index.d.ts +2 -0
  32. package/dist/engine/Radar/Radar.d.ts +4 -0
  33. package/dist/engine/Radar/Radar.option.d.ts +4 -0
  34. package/dist/engine/Radar/index.d.ts +2 -0
  35. package/dist/engine/Sankey/Sankey.d.ts +4 -0
  36. package/dist/engine/Sankey/Sankey.option.d.ts +6 -0
  37. package/dist/engine/Sankey/index.d.ts +2 -0
  38. package/dist/engine/ScatterChart/ScatterChart.d.ts +4 -0
  39. package/dist/engine/ScatterChart/ScatterChart.option.d.ts +6 -0
  40. package/dist/engine/ScatterChart/index.d.ts +2 -0
  41. package/dist/engine/Sunburst/Sunburst.d.ts +4 -0
  42. package/dist/engine/Sunburst/Sunburst.option.d.ts +19 -0
  43. package/dist/engine/Sunburst/index.d.ts +2 -0
  44. package/dist/engine/Treemap/Treemap.d.ts +4 -0
  45. package/dist/engine/Treemap/Treemap.option.d.ts +4 -0
  46. package/dist/engine/Treemap/index.d.ts +2 -0
  47. package/dist/engine/chrome.d.ts +90 -0
  48. package/dist/engine/core.d.ts +58 -0
  49. package/dist/engine/echartsEngine.d.ts +3 -0
  50. package/dist/engine/fixtures.d.ts +61 -0
  51. package/dist/engine/headless/headless.d.ts +86 -0
  52. package/dist/engine/headless/index.d.ts +10 -0
  53. package/dist/engine/headless/index.js +142 -0
  54. package/dist/engine/index.d.ts +1 -0
  55. package/dist/engine/shared.d.ts +59 -0
  56. package/dist/engine/shared.variants.d.ts +40 -0
  57. package/dist/index-4bxmxw89.js +1786 -0
  58. package/dist/index-85mb21rn.js +69 -0
  59. package/dist/index.d.ts +11 -0
  60. package/dist/index.js +618 -0
  61. package/dist/lib/cn.d.ts +7 -0
  62. package/dist/lib/index.d.ts +2 -0
  63. package/dist/seam/ChartEngineProvider.d.ts +12 -0
  64. package/dist/seam/FormatProvider.d.ts +25 -0
  65. package/dist/seam/format.d.ts +171 -0
  66. package/dist/seam/format.schema.d.ts +14 -0
  67. package/dist/seam/height.d.ts +15 -0
  68. package/dist/seam/index.d.ts +12 -0
  69. package/dist/seam/tones.d.ts +49 -0
  70. package/dist/seam/types.d.ts +322 -0
  71. package/dist/seam/useResolvedTokens.d.ts +7 -0
  72. package/dist/theme/index.d.ts +3 -0
  73. package/dist/theme/index.js +30 -0
  74. package/dist/theme/tokens.d.ts +40 -0
  75. package/package.json +82 -4
package/README.md CHANGED
@@ -1,3 +1,287 @@
1
- # Temporary Holding Version
1
+ # @open-tomato/charts
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React 19 charting for the `@open-tomato` scope: a chart-engine seam with
4
+ ECharts 6 behind it, the names of the theme tokens it reads, formatters,
5
+ and a headless engine subpath that draws a chart to SVG with no React and
6
+ no DOM. Other projects consume it on its own; `@open-tomato/atlas-ui`
7
+ builds Atlas's cards on it. The consuming app brings the token values;
8
+ the Atlas demo in the open-tomato/rafa repository is the reference
9
+ consumer.
10
+
11
+ ## Layout
12
+
13
+ Each layer is a folder under `src/` with a barrel `index.ts`, and
14
+ `src/index.ts` is the root barrel.
15
+
16
+ | Folder | Holds |
17
+ |---|---|
18
+ | `seam/` | the `ChartPrimitives` types, tones, formatters and the format spec, the engine and format providers |
19
+ | `engine/` | ECharts 6 over `echarts/core`; the only folder importing `echarts` |
20
+ | `engine/headless/` | the `./engine` subpath: option builders and `renderToSvg` |
21
+ | `theme/` | the token names; no values |
22
+ | `lib/` | `cn` |
23
+
24
+ The engine splits along React. `engine/core.ts` holds the `echarts/core`
25
+ registration of every series and component, the `ChartOption` type and
26
+ the colour bridge, and imports no React. `engine/shared.tsx` is the React
27
+ adapter: it adds the canvas renderer, `useBuiltOption` and the `EChart`
28
+ root. Each primitive gets its own folder, named after it:
29
+
30
+ ```text
31
+ src/engine/LineChart/
32
+ index.ts the primitive's barrel
33
+ LineChart.tsx the React component: the option over the live tokens, drawn by EChart
34
+ LineChart.option.ts buildOption(props, tokens): pure, no React, no DOM
35
+ LineChart.stories.tsx one story per variant value
36
+ LineChart.test.ts tests of buildOption
37
+ ```
38
+
39
+ The primitives draw with the shared chart-root and tooltip variants in
40
+ `engine/shared.variants.ts`, so a primitive folder has no variants file of
41
+ its own.
42
+
43
+ ## The headless engine
44
+
45
+ `@open-tomato/charts/engine` (`src/engine/headless/`) draws with no React
46
+ and no DOM, for a CLI, a server or a report. It exports every primitive's
47
+ `buildOption` as `build<Primitive>Option(props, tokens)`, `OPTION_BUILDERS`
48
+ by primitive name, the `ResolvedTokens` type, `tokensFrom`,
49
+ `renderToSvg`, and the format spec with its schemas (`formatterFor`,
50
+ `valueFormatSchema` and the rest of `seam/format.ts` and
51
+ `seam/format.schema.ts`), so a report writes values as a chart does:
52
+
53
+ ```ts
54
+ import { renderToSvg, tokensFrom } from '@open-tomato/charts/engine';
55
+
56
+ const tokens = tokensFrom(values); // every token name, without `--color-`, to a colour
57
+ const svg = renderToSvg('LineChart', { ariaLabel: 'Tokens per day', series }, tokens, { width: 480, height: 260 });
58
+ ```
59
+
60
+ A headless caller has no CSS variables to read, so it passes a value for
61
+ every token. `renderToSvg` uses ECharts' server-side mode
62
+ (`echarts.init(null, null, { renderer: 'svg', ssr: true, width, height })`,
63
+ `setOption`, `renderToSVGString()`, `dispose()`) over the same
64
+ `echarts/core` registration the React adapter uses, with animation off.
65
+ The same input gives the same string: ECharts numbers ids and classes from
66
+ counters that grow with every instance, so the renderer renumbers them and
67
+ prefixes them with a hash of the drawing, or with `idPrefix` when given.
68
+ Text is measured on a canvas when the process has a page and estimated
69
+ when it has none, so a drawing made under a DOM and one made without can
70
+ differ by a pixel in label room.
71
+
72
+ ## Chart height
73
+
74
+ Every primitive takes `height` (`ChartHeight`, `number | 'fill'`). A
75
+ number is the plot height in px, 220 (`DEFAULT_CHART_HEIGHT`) when
76
+ absent; the width always follows the container. `'fill'` gives the chart
77
+ root `height: 100%`, so the chart takes the full height of its container
78
+ and its resize observer follows the container from then on. The
79
+ container needs a height of its own: a sized box, or a flex or grid cell
80
+ that is stretched. A maximised card's box is the case it was made for.
81
+
82
+ ```tsx
83
+ <div className="h-[80vmin]">
84
+ <BarChart ariaLabel="Minutes by agent" categories={categories} series={series} height="fill" />
85
+ </div>
86
+ ```
87
+
88
+ Two builders read the height as a number. Sunburst sizes its radial
89
+ labels from the measured height when it fills, and from 220px until it is
90
+ measured. Bullet cannot know a filling height, so ECharts centres its
91
+ track and text. `renderToSvg` takes an explicit size, so a headless
92
+ `'fill'` fills the drawing. `Engine/BarChart`'s `Fill` story draws one.
93
+
94
+ ## Formatting values
95
+
96
+ Every primitive takes `valueFormat`, a `(value: number) => string`. A
97
+ `ValueFormat` is the same choice as data, which a spec or a data point can
98
+ carry: `raw`, `number`, `compact`, `percent` (`signed` for "+12%"),
99
+ `money` (`compact` for "$1.2K"), `unit`, `duration` ("1.5 h"), `elapsed`
100
+ ("1h 3m 10s"), `date`, `relative` ("2 days ago", against the context's
101
+ `now` or the clock) or `custom`. `formatterFor(format, context)` turns one into the
102
+ function, over a `FormatContext` of locale, currency and custom formatters
103
+ (defaults `en-GB`, `USD`, `UTC`). A `custom` format names a formatter the
104
+ context registers by id, and an id the context lacks throws when the
105
+ formatter is built.
106
+
107
+ ```tsx
108
+ <FormatProvider context={{ locale: 'de-DE', currency: 'EUR' }}>
109
+ <Chart />
110
+ </FormatProvider>
111
+
112
+ // inside Chart
113
+ const valueFormat = useFormatter({ kind: 'money', digits: 0 });
114
+ return <LineChart ariaLabel="Spend per day" series={series} valueFormat={valueFormat} />;
115
+ ```
116
+
117
+ - `compact` is `formatCompact` as it was: "1K" and "1.2M", with a capital
118
+ K in every locale, so a chart with no format and one with `compact`
119
+ read the same.
120
+ - `formatMeasured({ value, unit, format }, context, specFormat)` writes a
121
+ value that carries its own unit or format. The point's format wins over
122
+ the spec's, and the context fills what both leave out. A `unit` follows
123
+ a bare number (`raw`, `number`, `compact`); the other kinds write their
124
+ own unit and drop it.
125
+ - `formatElapsed(seconds)` writes a count of seconds as "1h 3m 10s", zero
126
+ units left out; `formatRelative(value, now, locale)` climbs a ladder
127
+ from a clock time on the same UTC day through "6 hours ago",
128
+ "yesterday", "last week" and "2 months ago", mirrored for the future.
129
+ - Dates are UTC everywhere: `formatDay`, `formatWeek`, `formatDate` and
130
+ the `date` kind read UTC, and every option sets ECharts' `useUTC`, so a
131
+ time-axis tick sits at midnight UTC where its label names the day.
132
+ - A weekly `xFormat` goes with `xStep: 'week'` on `LineChart`: the axis
133
+ starts on the Monday of its first point and its labels sit on the
134
+ Mondays of the span (`axisLabel.customValues`), because the time
135
+ scale's own interval ignores a forced `interval` and lands "w/c" labels
136
+ on days that start no week.
137
+ - `valueFormatSchema` and `formatContextSchema` (zod v4) validate a format
138
+ and a context that arrive as data. A context's `customFormatters` are
139
+ functions, so they validate in code only.
140
+
141
+ The `Engine/Formats` stories draw one series under each kind.
142
+
143
+ ## Styles are CVA variants
144
+
145
+ - Every class a component paints lives in a `*.variants.ts` file, as `cva`
146
+ calls: `engine/shared.variants.ts` for the chart root and the tooltip,
147
+ and `chartTone` in `seam/tones.ts` for a tone's colour. The file exports
148
+ the variant props type, and the component's props extend it.
149
+ - A passthrough `className` prop is for layout context only (margin,
150
+ alignment, grid placement), never colour or size. It merges last:
151
+ `cn(chartRootVariants({ cursor }), className)`. `cn` (`src/lib/cn.ts`)
152
+ is clsx plus tailwind-merge, so the later class wins a conflict.
153
+ - No inline `style`, and no class string written on an element. The lint
154
+ rule `@open-tomato/cva-only-classname` (in
155
+ `@open-tomato/eslint-config/cva`) allows a `className` value only as a
156
+ variants call, a `cn(...)` over variants calls and the passthrough, or
157
+ the passthrough alone. Stories and tests are exempt.
158
+ - The package compiles with `isolatedDeclarations` (from
159
+ `@open-tomato/typescript-config`), so an exported `cva` call
160
+ carries an explicit function type, as `chartRootVariants` does.
161
+
162
+ ## Theming
163
+
164
+ The package ships token names only: `src/theme/` lists every CSS custom
165
+ property it reads (`--color-series-1` to `-8`, the four status colours,
166
+ surface, plane, ink, ink-2, muted, grid, baseline, ring, the `seq-100` to
167
+ `seq-700` ramp, `diverge-mid`, the six pole colours, `delta-up`). Each is a
168
+ Tailwind v4 colour token, so `--color-series-1` is also `bg-series-1`.
169
+
170
+ The consuming app defines every name: light values in its Tailwind
171
+ `@theme` block, the dark re-step under `:root[data-theme="dark"]`, and
172
+ `@custom-variant dark` on that attribute. Dark mode is
173
+ `data-theme="dark"` on `<html>`. This package's `.storybook/theme.css`
174
+ and the Atlas demo's `src/styles.css` hold the reference set, and the
175
+ demo's test holds it to the names listed here. The app's stylesheet
176
+ adds `@source` for this package's files so Tailwind generates the
177
+ classes the components use. Canvas cannot read CSS variables, so the
178
+ React engine reads the tokens from the computed style
179
+ (`useResolvedTokens`) and re-reads them on a theme flip.
180
+
181
+ ## Stories
182
+
183
+ Storybook 10 on `@storybook/react-vite`. Vite is Storybook's own builder
184
+ and appears nowhere else: the package builds with `bun build`.
185
+ `.storybook/preview.ts` imports `.storybook/theme.css`, the token values
186
+ in light and dark, which Tailwind compiles there, so no story imports
187
+ tokens. Its `theme` toolbar global sets `data-theme` on the document.
188
+
189
+ - A story sits beside its component as `{C}.stories.tsx`.
190
+ - The header is `import type { Meta, StoryObj } from '@storybook/react-vite'`,
191
+ and the meta ends in `satisfies Meta<typeof C>`.
192
+ - `title` is `Engine/<Name>`; `tags: ['autodocs']`;
193
+ `parameters.layout` is `'padded'`.
194
+ - One story per variant value.
195
+ - Stories are deterministic: fixed data (`engine/fixtures.ts`), fixed
196
+ reference dates, an explicit `locale: 'en-US'`, no `Date.now()`,
197
+ animations off.
198
+ - A story carries no assertion and never imports vitest. A `play()`
199
+ imports only from `storybook/test`.
200
+
201
+ Stories are type-checked by `tsconfig.stories.json` with
202
+ `isolatedDeclarations` off: a `satisfies` meta cannot carry the
203
+ annotation the flag asks for, and stories never ship.
204
+
205
+ ## Tests
206
+
207
+ `bun test`, never vitest. `bunfig.toml` preloads `test/happy-dom.ts`,
208
+ which registers happy-dom's globals and cleans up Testing Library after
209
+ each test. Component tests use `@testing-library/react`.
210
+
211
+ - Pure parts first: formatters, tones, the token bridge, the chrome.
212
+ `src/lib/cn.test.ts` is the example.
213
+ - happy-dom has no canvas, so a primitive is tested through its pure
214
+ option builder (props in, ECharts option out), never by drawing. The
215
+ picture is the visual suite's job.
216
+ - The headless engine is tested by drawing: a line chart and a radar to
217
+ SVG, the same string twice, a bundle of the entry with no React import,
218
+ and a drawing in a child process with no DOM.
219
+ - Run the tests from this folder, so `bun test` reads this folder's
220
+ `bunfig.toml` and its preload.
221
+
222
+ ## Visual regression
223
+
224
+ A native Playwright suite (`visual/`) over the built Storybook: every
225
+ story in light and in dark, picked with the `theme` global and checked on
226
+ `data-theme` before the shot; Chromium, animations disabled, fonts
227
+ settled, a 0.1% pixel budget. `@storybook/test-runner` with
228
+ `jest-image-snapshot` was not used: it runs Jest, which the repo does not
229
+ use, and plain Playwright's `toHaveScreenshot` needs no second runner.
230
+
231
+ Baselines are per machine and untracked, in
232
+ `visual/__image_snapshots__/` (gitignored with `visual/__diff_output__/`).
233
+ A machine only ever compares against baselines it wrote:
234
+ `bun run test:visual:update` writes them, `bun run test:visual` compares.
235
+ CI runs no visual gate yet, because baselines have no durable store there.
236
+ The suite's file is `stories.visual.ts`, never `.spec.ts`, so `bun test`
237
+ never picks it up. Playwright is pinned to an exact version, since a new
238
+ Chromium moves pixels. The suite serves on port 6016, and
239
+ `@open-tomato/atlas-ui`'s suite in rafa serves on 6017, so the two can
240
+ run at once.
241
+
242
+ ## Gate order
243
+
244
+ Run from this folder, in this order:
245
+
246
+ ```bash
247
+ bun run check-types # tsc --build, then tsconfig.stories.json
248
+ bun test
249
+ bun run lint
250
+ bun run build # dist/: bun build (ESM, browser) + tsc declarations
251
+ bun run build:storybook # storybook-static/
252
+ bun run check:stories # every story, light and dark, no console or page error
253
+ bun run test:visual # local only, against this machine's baselines
254
+ ```
255
+
256
+ CI's `verify` job (`.github/workflows/verify.yml`) runs this package's
257
+ `check-types` and `lint`, through the root's `check-types:all` and
258
+ `lint:all`. The tests, the build and the Storybook gates run locally for
259
+ now.
260
+
261
+ ## Publish shape
262
+
263
+ - `type: module`, `sideEffects: false`, ESM only. The package ships no
264
+ CSS: the app's stylesheet compiles the classes.
265
+ - `exports`: `.` (the seam, the React engine, `cn` and the theme),
266
+ `./theme`, `./engine` (the headless engine), each with `types` before
267
+ `import`, and `./package.json`.
268
+ - `files`: `dist` and this README. `bun run build` writes `dist/` from
269
+ `src/index.ts`, `src/theme/index.ts` and `src/engine/headless/index.ts`
270
+ with shared chunks, every package external, then the declarations with
271
+ `tsc -p tsconfig.build.json`.
272
+ - An entry barrel re-exports with `export *` only. With
273
+ `sideEffects: false`, bun 1.3 drops an entry module's own named
274
+ re-exports from the bundle, so `engine/headless/index.ts` is
275
+ `export * from './headless.js'` and `headless.ts` holds the list.
276
+ - `publishConfig` names npmjs for the registry and for the
277
+ `@open-tomato` scope, and `access: public`.
278
+ - Peer: `react` ^19. Dependencies: `echarts`, `class-variance-authority`,
279
+ `clsx`, `tailwind-merge` and `zod`, all from the public npm registry,
280
+ and no dependency on a private package.
281
+
282
+ ## Privacy
283
+
284
+ This package is public. No tracked file in it names a host, a home path,
285
+ an IP, a LAN name, a private registry, a self-hosted runner or a private
286
+ repository. The repository's privacy gate (`bun run gate:privacy`, and
287
+ `gate:privacy:history` in CI) enforces it over every file here.
@@ -0,0 +1,4 @@
1
+ import type { BarChartProps } from '../../seam/types.js';
2
+ import type { ReactElement } from 'react';
3
+ /** The BarChart drawn with ECharts. */
4
+ export declare function BarChart(props: BarChartProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { BarChartProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: BarChartProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { BarChart } from './BarChart.js';
2
+ export { buildOption as buildBarChartOption } from './BarChart.option.js';
@@ -0,0 +1,4 @@
1
+ import type { BoxPlotProps } from '../../seam/types.js';
2
+ import type { ReactElement } from 'react';
3
+ /** The BoxPlot drawn with ECharts. */
4
+ export declare function BoxPlot(props: BoxPlotProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { BoxPlotProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: BoxPlotProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { BoxPlot } from './BoxPlot.js';
2
+ export { buildOption as buildBoxPlotOption } from './BoxPlot.option.js';
@@ -0,0 +1,4 @@
1
+ import type { BulletProps } from '../../seam/types.js';
2
+ import type { ReactElement } from 'react';
3
+ /** The Bullet drawn with ECharts. */
4
+ export declare function Bullet(props: BulletProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { BulletProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: BulletProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { Bullet } from './Bullet.js';
2
+ export { buildOption as buildBulletOption } from './Bullet.option.js';
@@ -0,0 +1,4 @@
1
+ import type { DonutProps } from '../../seam/types.js';
2
+ import type { ReactElement } from 'react';
3
+ /** The Donut drawn with ECharts. */
4
+ export declare function Donut(props: DonutProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { DonutProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: DonutProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { Donut } from './Donut.js';
2
+ export { buildOption as buildDonutOption } from './Donut.option.js';
@@ -0,0 +1,4 @@
1
+ import type { GaugeProps } from '../../seam/types.js';
2
+ import type { ReactElement } from 'react';
3
+ /** The Gauge drawn with ECharts. */
4
+ export declare function Gauge(props: GaugeProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { GaugeProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: GaugeProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { Gauge } from './Gauge.js';
2
+ export { buildOption as buildGaugeOption } from './Gauge.option.js';
@@ -0,0 +1,4 @@
1
+ import type { HeatmapGridProps } from '../../seam/types.js';
2
+ import { type ReactElement } from 'react';
3
+ /** The HeatmapGrid drawn with ECharts. */
4
+ export declare function HeatmapGrid(props: HeatmapGridProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { HeatmapGridProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: HeatmapGridProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { HeatmapGrid } from './HeatmapGrid.js';
2
+ export { buildOption as buildHeatmapGridOption } from './HeatmapGrid.option.js';
@@ -0,0 +1,4 @@
1
+ import type { HistogramProps } from '../../seam/types.js';
2
+ import type { ReactElement } from 'react';
3
+ /** The Histogram drawn with ECharts. */
4
+ export declare function Histogram(props: HistogramProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { HistogramProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: HistogramProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { Histogram } from './Histogram.js';
2
+ export { buildOption as buildHistogramOption } from './Histogram.option.js';
@@ -0,0 +1,19 @@
1
+ import type { LineChartProps } from '../../seam/types.js';
2
+ import type { ChartOption } from '../core.js';
3
+ import type { ECharts } from 'echarts/core';
4
+ import { type ReactElement } from 'react';
5
+ /** The zoom window as axis values (epoch ms); null when the whole range shows. */
6
+ export type ZoomWindow = {
7
+ from: number;
8
+ to: number;
9
+ } | null;
10
+ /** The live data-zoom window, read back from the instance. */
11
+ export declare function readZoomWindow(instance: Pick<ECharts, 'getOption'>): ZoomWindow;
12
+ /**
13
+ * Pins the live zoom window into a rebuilt option, so a legend toggle or a
14
+ * theme flip never moves it. The window is read from the instance when the
15
+ * option is set, not while rendering; the whole range leaves the option as is.
16
+ */
17
+ export declare function carryZoom(option: ChartOption, instance: Pick<ECharts, 'getOption'>): ChartOption;
18
+ /** The LineChart drawn with ECharts. */
19
+ export declare function LineChart(props: LineChartProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { LineChartProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: LineChartProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { LineChart } from './LineChart.js';
2
+ export { buildOption as buildLineChartOption } from './LineChart.option.js';
@@ -0,0 +1,4 @@
1
+ import type { NetworkGraphProps } from '../../seam/types.js';
2
+ import { type ReactElement } from 'react';
3
+ /** The NetworkGraph drawn with ECharts. */
4
+ export declare function NetworkGraph(props: NetworkGraphProps): ReactElement;
@@ -0,0 +1,8 @@
1
+ import type { NetworkGraphProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** What the option reads; narrower than the component's props so a parent's new object does not restart the force layout. */
4
+ export type NetworkOptionProps = Pick<NetworkGraphProps, 'nodes' | 'links' | 'groupTones' | 'onNodeClick' | 'animate'>;
5
+ /** The id an ECharts graph event names, from its node data. */
6
+ export declare function nodeIdOf(data: unknown): string | undefined;
7
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
8
+ export declare function buildOption(props: NetworkOptionProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { NetworkGraph } from './NetworkGraph.js';
2
+ export { buildOption as buildNetworkGraphOption } from './NetworkGraph.option.js';
@@ -0,0 +1,4 @@
1
+ import type { NightingaleProps } from '../../seam/types.js';
2
+ import type { ReactElement } from 'react';
3
+ /** The Nightingale drawn with ECharts. */
4
+ export declare function Nightingale(props: NightingaleProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { NightingaleProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: NightingaleProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { Nightingale } from './Nightingale.js';
2
+ export { buildOption as buildNightingaleOption } from './Nightingale.option.js';
@@ -0,0 +1,4 @@
1
+ import type { RadarProps } from '../../seam/types.js';
2
+ import type { ReactElement } from 'react';
3
+ /** The Radar drawn with ECharts. */
4
+ export declare function Radar(props: RadarProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { RadarProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: RadarProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { Radar } from './Radar.js';
2
+ export { buildOption as buildRadarOption } from './Radar.option.js';
@@ -0,0 +1,4 @@
1
+ import type { SankeyProps } from '../../seam/types.js';
2
+ import { type ReactElement } from 'react';
3
+ /** The Sankey drawn with ECharts. */
4
+ export declare function Sankey(props: SankeyProps): ReactElement;
@@ -0,0 +1,6 @@
1
+ import type { SankeyProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** What the option reads; narrower than the component's props so a parent's new object does not redraw the layout. */
4
+ export type SankeyOptionProps = Pick<SankeyProps, 'nodes' | 'links' | 'groupTones' | 'groupOrder' | 'valueFormat' | 'animate'>;
5
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
6
+ export declare function buildOption(props: SankeyOptionProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { Sankey } from './Sankey.js';
2
+ export { buildOption as buildSankeyOption } from './Sankey.option.js';
@@ -0,0 +1,4 @@
1
+ import type { ScatterChartProps } from '../../seam/types.js';
2
+ import type { ReactElement } from 'react';
3
+ /** The ScatterChart drawn with ECharts. */
4
+ export declare function ScatterChart(props: ScatterChartProps): ReactElement;
@@ -0,0 +1,6 @@
1
+ import type { ScatterChartProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ export declare const DOTS_SERIES = "points";
4
+ export declare const HIT_SERIES = "points-hit";
5
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
6
+ export declare function buildOption(props: ScatterChartProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { ScatterChart } from './ScatterChart.js';
2
+ export { buildOption as buildScatterChartOption } from './ScatterChart.option.js';
@@ -0,0 +1,4 @@
1
+ import type { SunburstProps } from '../../seam/types.js';
2
+ import { type ReactElement } from 'react';
3
+ /** The Sunburst drawn with ECharts. */
4
+ export declare function Sunburst(props: SunburstProps): ReactElement;
@@ -0,0 +1,19 @@
1
+ import type { SunburstNode, SunburstProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /**
4
+ * The opening, in degrees, under which an arc of a ring carries no label
5
+ * (the tooltip still names it): the arc at the ring's inner edge must be as
6
+ * wide as the label is tall. A ring's inner edge is `inner` of the view
7
+ * radius, so the threshold falls as the chart grows: the slice that reads
8
+ * as a bare wedge in a card gets its label in the maximised view.
9
+ */
10
+ export declare function labelMinAngle(inner: number, viewRadius: number): number;
11
+ /** The ids from the root to every node, so a click can report its path. */
12
+ export declare function pathsById(nodes: readonly SunburstNode[], above?: readonly string[]): Map<string, string[]>;
13
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
14
+ /**
15
+ * `width` is the canvas width in px, which sizes the radial labels; 0 until
16
+ * it is measured. `measuredHeight` is the canvas height in px, read only for
17
+ * `height: 'fill'`; 0 until measured, when the default height stands in.
18
+ */
19
+ export declare function buildOption(props: SunburstProps, tokens: ResolvedTokens, width?: number, measuredHeight?: number): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { Sunburst } from './Sunburst.js';
2
+ export { buildOption as buildSunburstOption } from './Sunburst.option.js';
@@ -0,0 +1,4 @@
1
+ import type { TreemapProps } from '../../seam/types.js';
2
+ import type { ReactElement } from 'react';
3
+ /** The Treemap drawn with ECharts. */
4
+ export declare function Treemap(props: TreemapProps): ReactElement;
@@ -0,0 +1,4 @@
1
+ import type { TreemapProps } from '../../seam/types.js';
2
+ import { type ChartOption, type ResolvedTokens } from '../core.js';
3
+ /** The ECharts option for the props over the resolved tokens; pure, so it is tested without a canvas. */
4
+ export declare function buildOption(props: TreemapProps, tokens: ResolvedTokens): ChartOption;
@@ -0,0 +1,2 @@
1
+ export { Treemap } from './Treemap.js';
2
+ export { buildOption as buildTreemapOption } from './Treemap.option.js';