@silverpoint/core 0.1.1 → 0.3.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.
@@ -0,0 +1,605 @@
1
+ /** A row of data. Charts reach its fields through accessors. */
2
+ type Datum = Readonly<Record<string, unknown>>;
3
+ /** Access to a field: key name or pure function. */
4
+ type Accessor<T = number> = string | ((d: Datum, i: number) => T);
5
+ /** Inking mode. `precision` amounts to using NullInker (REQ-021). */
6
+ type InkMode = 'ink' | 'precision';
7
+ /** Seed. A string is converted to an integer stably (REQ-003). */
8
+ type Seed = number | string;
9
+ /** Prepared substrates of the silverpoint ground (REQ-046). */
10
+ type SubstrateName = 'cream' | 'green' | 'blue' | 'ochre';
11
+ /** Active item resolved by the interaction engine (REQ-140). */
12
+ interface ActiveItem {
13
+ readonly seriesKey: string;
14
+ readonly index: number;
15
+ readonly datum: Datum;
16
+ readonly value: number;
17
+ /** Coordinates in SVG space, not screen space. */
18
+ readonly point: Readonly<{
19
+ x: number;
20
+ y: number;
21
+ }>;
22
+ }
23
+
24
+ /** What a stroke is. Determines whether the Inker may touch it (REQ-022). */
25
+ type StrokeRole = 'encoding' | 'ornament' | 'hatch';
26
+ /** Semantic paint slot; maps to a CSS variable (API Spec §10). */
27
+ type StrokePart = 'ink' | 'ink-secondary' | 'heighten' | 'rule' | 'grid' | 'axis';
28
+ /**
29
+ * How the stylesheet paints the shape: its outline, its interior with the part colour, its
30
+ * interior with a hatch tile, or nothing — a toned shape whose edges other strokes draw, so the
31
+ * Inker hatches it and no outline covers those edges.
32
+ * @internal
33
+ */
34
+ type StrokePaint = 'stroke' | 'fill' | 'tile' | 'none';
35
+ /** Tonal level on the ground's ramp; 0 is no fill (Data Model §3.4). */
36
+ type ToneLevel = 0 | 1 | 2 | 3 | 4;
37
+ /** Stroke instruction. It carries no color: color comes from CSS (REQ-042). */
38
+ interface Stroke {
39
+ /** SVG path data, already rounded to 2 decimals (REQ-002). */
40
+ readonly d: string;
41
+ readonly role: StrokeRole;
42
+ readonly part: StrokePart;
43
+ /** Relative weight, resolved against the ground's token. */
44
+ readonly weight?: number;
45
+ /** @internal Defaults to `'stroke'`. */
46
+ readonly paint?: StrokePaint;
47
+ /** @internal Dash pattern, resolved by the stylesheet. */
48
+ readonly dash?: 'dotted';
49
+ /** @internal Tonal level a closed shape asks the Inker to hatch. */
50
+ readonly tone?: ToneLevel;
51
+ /** @internal Id of the tile in `Geometry.defs` that fills this shape. */
52
+ readonly tile?: string;
53
+ /**
54
+ * @internal The tonal level a `weight` ground's Inker drew as line weight in place of hatching;
55
+ * written as `data-weight` and resolved by the stylesheet to a stroke width (REQ-028).
56
+ */
57
+ readonly tonalWeight?: Exclude<ToneLevel, 0>;
58
+ }
59
+ /** Kind of text a label carries; the stylesheet sets type by it. */
60
+ type LabelKind = 'title' | 'badge' | 'value' | 'unit' | 'footer' | 'tick' | 'empty';
61
+ interface TextLabel {
62
+ readonly x: number;
63
+ readonly y: number;
64
+ readonly text: string;
65
+ readonly kind: LabelKind;
66
+ /** Paint slot: `text` for primary labels, `axis` for muted ones. */
67
+ readonly part: 'text' | 'axis';
68
+ readonly anchor: 'start' | 'middle' | 'end';
69
+ }
70
+ /** A datum's position, as the interaction engine sees it (REQ-140). */
71
+ interface HitArea {
72
+ readonly seriesKey: string;
73
+ readonly index: number;
74
+ readonly datum: Datum;
75
+ readonly value: number;
76
+ readonly x: number;
77
+ readonly y: number;
78
+ /** The item's area, when it has one — a bar, a cell, a tile. A pointer inside it wins. */
79
+ readonly box?: Rect;
80
+ /**
81
+ * The item's place in a grid, when the chart is one. When every item has one, the arrow keys
82
+ * move by column (left, right) and by row (up, down) across the whole grid (REQ-122).
83
+ */
84
+ readonly cell?: Readonly<{
85
+ column: number;
86
+ row: number;
87
+ }>;
88
+ }
89
+ /**
90
+ * A hatch tile shared by every shape of one tonal level (REQ-029).
91
+ * @internal
92
+ */
93
+ interface Tile {
94
+ /** Scoped to the chart instance (REQ-030). */
95
+ readonly id: string;
96
+ readonly width: number;
97
+ readonly height: number;
98
+ /** Rotation of the tile in degrees. */
99
+ readonly angle: number;
100
+ readonly strokes: readonly Stroke[];
101
+ }
102
+ interface Rect {
103
+ readonly x: number;
104
+ readonly y: number;
105
+ readonly width: number;
106
+ readonly height: number;
107
+ }
108
+ /** Everything a chart needs in order to draw itself. Serializable (REQ-011). */
109
+ interface Geometry {
110
+ readonly viewBox: Rect;
111
+ readonly strokes: readonly Stroke[];
112
+ readonly labels: readonly TextLabel[];
113
+ readonly hitAreas: readonly HitArea[];
114
+ /** @internal Hatch tiles referenced by strokes painted with `'tile'`. */
115
+ readonly defs: readonly Tile[];
116
+ /** @internal The drawing area; the interaction engine ignores anything outside it. */
117
+ readonly plot: Rect;
118
+ }
119
+
120
+ /** One step of a `hatch` ground's tonal ramp (Data Model §3.4). */
121
+ interface HatchToneSpec {
122
+ readonly style: 'hachure' | 'cross-hatch';
123
+ readonly gap: number;
124
+ /** Hatch angle in degrees; cross-hatch adds the perpendicular. */
125
+ readonly angle: number;
126
+ }
127
+ /** One step of a `weight` ground's tonal ramp (Data Model §3.7, REQ-028). */
128
+ interface WeightToneSpec {
129
+ readonly style: 'weight';
130
+ /** Stroke width of a toned shape's outline, times `--sp-stroke-width`. */
131
+ readonly weight: number;
132
+ }
133
+ /** One step of a ground's tonal ramp: a hatch under `hatch`, a line weight under `weight`. */
134
+ type ToneSpec = HatchToneSpec | WeightToneSpec;
135
+ type TonalRamp = Readonly<Record<Exclude<ToneLevel, 0>, ToneSpec>>;
136
+ interface InkOptions {
137
+ readonly seed: number;
138
+ readonly roughness: number;
139
+ readonly bowing: number;
140
+ readonly hatchAngle: number;
141
+ readonly hatchGap: number;
142
+ readonly fillWeight: number;
143
+ /** Upper bound of nodes the Inker must not exceed. */
144
+ readonly nodeBudget: number;
145
+ /** @internal `tile` shares one hatch tile per tonal level (REQ-029). */
146
+ readonly hatchFill?: 'tile' | 'per-shape';
147
+ /** @internal The ground's tonal ramp. */
148
+ readonly tonalRamp?: TonalRamp;
149
+ /** @internal Prefix that scopes generated ids to the chart instance (REQ-030). */
150
+ readonly scope?: string;
151
+ }
152
+ interface Inker {
153
+ readonly name: string;
154
+ /** Receives exact geometry and returns the inked geometry. */
155
+ ink(geometry: Geometry, options: InkOptions): Geometry;
156
+ }
157
+
158
+ type ToneStep = 1 | 2 | 3 | 4;
159
+ /**
160
+ * The interface components' tokens of a ground (Data Model §3.8, REQ-312). Optional: a ground
161
+ * without them takes the defaults, so grounds registered before `0.3.0` keep working.
162
+ */
163
+ interface UiTokens {
164
+ /** `inked`: build-time pieces laid as masks (DD-022). `css`: an exact border. */
165
+ readonly frame: 'inked' | 'css';
166
+ /** Frame variants generated per kind, 1..6. */
167
+ readonly frameVariants: number;
168
+ /** Control heights in px per size, each ≥ 24 (REQ-317). */
169
+ readonly controlHeight: Readonly<{
170
+ sm: number;
171
+ md: number;
172
+ lg: number;
173
+ }>;
174
+ /** Corner radius of the exact frame (`precision`, `css`), px. */
175
+ readonly radius: number;
176
+ /** Focus indicator width, px, ≥ 2 (REQ-316). */
177
+ readonly focusWidth: number;
178
+ /** Tonal level per state (DD-026); `alertError` fills an error Alert's box (C-3). */
179
+ readonly tone: Readonly<{
180
+ selected: ToneStep;
181
+ primary: ToneStep;
182
+ danger: ToneStep;
183
+ disabled: ToneStep;
184
+ alertError: ToneStep;
185
+ }>;
186
+ }
187
+ /** Name of a registered ground. */
188
+ type GroundName = 'silverpoint' | (string & {});
189
+ /** Declarative token set of a style ground (API Spec §6, Art. 7). */
190
+ interface Ground {
191
+ readonly name: string;
192
+ /** How it builds tonal value. `wash` is the anticipated exception to Art. 6. */
193
+ readonly tonalMechanism: 'hatch' | 'weight' | 'wash';
194
+ /** Name of the registered Inker that inks it. */
195
+ readonly inker: string;
196
+ readonly substrates: Readonly<Record<string, string>>;
197
+ readonly ink: Readonly<{
198
+ primary: string;
199
+ secondary: string;
200
+ heighten: string;
201
+ rule: string;
202
+ grid: string;
203
+ text: string;
204
+ textMuted: string;
205
+ }>;
206
+ readonly inkOptions: Omit<InkOptions, 'seed' | 'nodeBudget' | 'hatchFill' | 'tonalRamp' | 'scope'>;
207
+ /** Hatch density bound, to stay within the node budget. */
208
+ readonly maxHatchDensity: number;
209
+ /** Tonal levels 1-4 (Data Model §3.4). */
210
+ readonly tonalRamp: TonalRamp;
211
+ readonly typography: Readonly<{
212
+ display: string;
213
+ scale: number;
214
+ }>;
215
+ /** What to draw when there is no data (REQ-007). */
216
+ readonly emptyState: Readonly<{
217
+ text: string;
218
+ rule: boolean;
219
+ }>;
220
+ /** Expansion of degenerate domains (REQ-010). */
221
+ readonly domainPadding: number;
222
+ /** Interface components' tokens (Data Model §3.8); defaults when absent. */
223
+ readonly ui?: UiTokens;
224
+ }
225
+ /** Name of a registered ground, or a complete ground. */
226
+ type GroundRef = GroundName | Ground;
227
+
228
+ /** Props present in every chart, identical in React and Angular (REQ-094). */
229
+ interface CommonChartProps {
230
+ /**
231
+ * Rows to draw. If omitted, the demo dataset is rendered (REQ-093): accessor props (`…Key`,
232
+ * `keys`, `names`) are ignored, every other prop applies.
233
+ */
234
+ data?: readonly Datum[];
235
+ /** Style ground. Defaults to the app provider's, or `silverpoint`. */
236
+ ground?: GroundRef;
237
+ /** Prepared substrate within the ground (REQ-046). */
238
+ substrate?: SubstrateName;
239
+ /** `ink` by default; `precision` disables inking (REQ-021). */
240
+ mode?: InkMode;
241
+ /** Seed. If omitted, it is derived from `id` stably (REQ-003). */
242
+ seed?: Seed;
243
+ /** Stable identifier. If omitted, it is generated deterministically. */
244
+ id?: string;
245
+ /** Height of the drawing area in px. Width is the container's unless pinned. */
246
+ height?: number;
247
+ width?: number;
248
+ /** `card` draws the full frame; `bare` only the drawing area (REQ-095). */
249
+ chrome?: 'card' | 'bare';
250
+ /** How areas are filled (REQ-029). */
251
+ hatchFill?: 'tile' | 'per-shape';
252
+ title?: string;
253
+ badge?: string;
254
+ value?: string | number;
255
+ unit?: string;
256
+ footerLeft?: string;
257
+ footerRight?: string;
258
+ /** Accessible name. If omitted, it is derived from `title` (REQ-120). */
259
+ label?: string;
260
+ /** Long description for screen readers (REQ-120). */
261
+ description?: string;
262
+ /** Tabular alternative; `hidden` leaves it for assistive technology only (REQ-121). */
263
+ dataTable?: 'visible' | 'hidden' | 'none';
264
+ locale?: string;
265
+ numberFormat?: Intl.NumberFormatOptions;
266
+ className?: string;
267
+ }
268
+ type LineCurve = 'monotone' | 'linear' | 'natural' | 'step';
269
+ /** `LineChart` (REQ-060): spline with an optional dotted baseline series. */
270
+ interface LineChartProps extends CommonChartProps {
271
+ /** Ignored without `data`. */
272
+ xKey?: Accessor<string | number>;
273
+ /** Ignored without `data`. */
274
+ valueKey?: Accessor<number | null | undefined>;
275
+ /** Ignored without `data`. */
276
+ secondaryKey?: Accessor<number | null | undefined>;
277
+ curve?: LineCurve;
278
+ /** `all` draws the secondary series when there is one; `primary` omits it. */
279
+ series?: 'all' | 'primary';
280
+ /** Whether a gap left by a missing value is bridged (REQ-008). */
281
+ connectNulls?: boolean;
282
+ }
283
+ /** Configuration an application sets once for every chart (API Spec §8). */
284
+ interface ProviderConfig {
285
+ ground?: GroundRef;
286
+ substrate?: SubstrateName;
287
+ mode?: InkMode;
288
+ locale?: string;
289
+ }
290
+ /** `BulletChart` (REQ-069): one bar per target, with a marker at the target. Values in 0-100. */
291
+ interface BulletChartProps extends CommonChartProps {
292
+ /** Ignored without `data`. */
293
+ titleKey?: Accessor<string>;
294
+ /** Ignored without `data`. */
295
+ actualKey?: Accessor<number | null | undefined>;
296
+ /** Ignored without `data`. */
297
+ targetKey?: Accessor<number | null | undefined>;
298
+ }
299
+ /** `PyramidChart` (REQ-070): stacked tiers whose width encodes the value (0-100). */
300
+ interface PyramidChartProps extends CommonChartProps {
301
+ /** Ignored without `data`. */
302
+ labelKey?: Accessor<string>;
303
+ /** Ignored without `data`. */
304
+ widthKey?: Accessor<number | null | undefined>;
305
+ /** Ignored without `data`. */
306
+ toneKey?: Accessor<number | null | undefined>;
307
+ }
308
+ /** `HeatmapChart` (REQ-084): labelled rows of values, normalised against `scaleMax`. */
309
+ interface HeatmapChartProps extends CommonChartProps {
310
+ /** Ignored without `data`. */
311
+ labelKey?: Accessor<string>;
312
+ /** Ignored without `data`. */
313
+ valuesKey?: Accessor<readonly (number | null)[] | null | undefined>;
314
+ /** Value that maps to the darkest tone; 100 by default. */
315
+ scaleMax?: number;
316
+ /** Names of the columns, in order; missing ones fall back to `#k` (delta-006). */
317
+ columnLabels?: readonly string[];
318
+ }
319
+ /** `TreemapChart` (REQ-085): tiles of `cols × rows` cells placed in a `columns × rows` grid. */
320
+ interface TreemapChartProps extends CommonChartProps {
321
+ /** Ignored without `data`. */
322
+ labelKey?: Accessor<string>;
323
+ /** Ignored without `data`. */
324
+ shareKey?: Accessor<number | null | undefined>;
325
+ columns?: number;
326
+ rows?: number;
327
+ }
328
+ /** `SankeyChart` (REQ-086): flow bands between layered nodes. */
329
+ interface SankeyChartProps extends CommonChartProps {
330
+ /** Ignored without `data`. */
331
+ sourceKey?: Accessor<string>;
332
+ /** Ignored without `data`. */
333
+ targetKey?: Accessor<string>;
334
+ /** Ignored without `data`. */
335
+ valueKey?: Accessor<number | null | undefined>;
336
+ }
337
+ /** `ActivityGrid` (REQ-087): one cell per day, a column per week. */
338
+ interface ActivityGridProps extends CommonChartProps {
339
+ /** Ignored without `data`. */
340
+ dateKey?: Accessor<string>;
341
+ /** Ignored without `data`. */
342
+ countKey?: Accessor<number | null | undefined>;
343
+ /** Ignored without `data`. */
344
+ levelKey?: Accessor<number | null | undefined>;
345
+ /** Weeks shown, the most recent last; 26 by default. */
346
+ weeks?: number;
347
+ }
348
+ /** `StepChart` (REQ-061): a series drawn as steps. */
349
+ interface StepChartProps extends CommonChartProps {
350
+ /** Ignored without `data`. */
351
+ xKey?: Accessor<string | number>;
352
+ /** Ignored without `data`. */
353
+ valueKey?: Accessor<number | null | undefined>;
354
+ /** Where the step sits between two points; `after` by default. */
355
+ step?: 'after' | 'before' | 'middle';
356
+ }
357
+ /** `SparklineRows` (REQ-062): one row per series — name, sparkline, readout (delta-008). */
358
+ interface SparklineRowsProps extends CommonChartProps {
359
+ /** Rows shown, from the first; all by default. */
360
+ rows?: number;
361
+ /** Ignored without `data`. */
362
+ nameKey?: Accessor<string>;
363
+ /** The printed readout; the last value of the series by default. Ignored without `data`. */
364
+ readoutKey?: Accessor<string | number | null | undefined>;
365
+ /** The row's points: an array. Ignored without `data`. */
366
+ seriesKey?: Accessor<readonly unknown[] | null | undefined>;
367
+ /** The value of one point; the point itself when it is a number, else its `value`. Ignored without `data`. */
368
+ pointKey?: Accessor<number | null | undefined>;
369
+ }
370
+ /** `KpiCard` (REQ-063): a metric, its delta, and an area sparkline of the series. */
371
+ interface KpiCardProps extends CommonChartProps {
372
+ /** Ignored without `data`. */
373
+ valueKey?: Accessor<number | null | undefined>;
374
+ /** The metric's name, printed under the figure. */
375
+ metric?: string;
376
+ /** Signed change, printed with its sign and a direction mark. */
377
+ delta?: number;
378
+ /** Direction of the mark; from the sign of `delta` by default. */
379
+ deltaTone?: 'up' | 'down' | 'flat';
380
+ }
381
+ /** `BarChart` (REQ-064): pill bars, as columns or rows, with an optional second series. */
382
+ interface BarChartProps extends CommonChartProps {
383
+ /** Ignored without `data`. */
384
+ xKey?: Accessor<string | number>;
385
+ /** Ignored without `data`. */
386
+ valueKey?: Accessor<number | null | undefined>;
387
+ /** Ignored without `data`. */
388
+ secondaryKey?: Accessor<number | null | undefined>;
389
+ orientation?: 'columns' | 'rows';
390
+ }
391
+ /** `StackedBarChart` (REQ-065): one stacked segment per key. */
392
+ interface StackedBarChartProps extends CommonChartProps {
393
+ /** Ignored without `data`. */
394
+ xKey?: Accessor<string | number>;
395
+ /** Ignored without `data`. */
396
+ keys?: readonly string[];
397
+ /** Display names of the keys, in order; the keys themselves by default. Ignored without `data`. */
398
+ names?: readonly string[];
399
+ }
400
+ /** `ComposedChart` (REQ-066): columns and a spline on one value scale. */
401
+ interface ComposedChartProps extends CommonChartProps {
402
+ /** Ignored without `data`. */
403
+ xKey?: Accessor<string | number>;
404
+ /** Ignored without `data`. */
405
+ barKey?: Accessor<number | null | undefined>;
406
+ /** Ignored without `data`. */
407
+ lineKey?: Accessor<number | null | undefined>;
408
+ showLine?: boolean;
409
+ }
410
+ /** `WaterfallChart` (REQ-067): totals from zero and floating deltas from the running total. */
411
+ interface WaterfallChartProps extends CommonChartProps {
412
+ /** Ignored without `data`. */
413
+ stepKey?: Accessor<string>;
414
+ /** An absolute total: the bar starts at zero and resets the running total. Ignored without `data`. */
415
+ baseKey?: Accessor<number | null | undefined>;
416
+ /** A change from the running total. Ignored without `data`. */
417
+ deltaKey?: Accessor<number | null | undefined>;
418
+ }
419
+ /** `FunnelChart` (REQ-068): horizontal, centred stages. */
420
+ interface FunnelChartProps extends CommonChartProps {
421
+ /** Ignored without `data`. */
422
+ stageKey?: Accessor<string>;
423
+ /** Ignored without `data`. */
424
+ valueKey?: Accessor<number | null | undefined>;
425
+ }
426
+ /** `CandlestickChart` (REQ-071): OHLC bodies and wicks (Data Model §2.6). */
427
+ interface CandlestickChartProps extends CommonChartProps {
428
+ /** Ignored without `data`. */
429
+ timeKey?: Accessor<string | number>;
430
+ /** Ignored without `data`. */
431
+ openKey?: Accessor<number | null | undefined>;
432
+ /** Ignored without `data`. */
433
+ highKey?: Accessor<number | null | undefined>;
434
+ /** Ignored without `data`. */
435
+ lowKey?: Accessor<number | null | undefined>;
436
+ /** Ignored without `data`. */
437
+ closeKey?: Accessor<number | null | undefined>;
438
+ /** Price bounds of the scale; derived from the data when omitted (REQ-097). */
439
+ bounds?: readonly [number, number];
440
+ }
441
+ /** `AreaChart` (REQ-072): a curved, toned area under its line. */
442
+ interface AreaChartProps extends CommonChartProps {
443
+ /** Ignored without `data`. */
444
+ xKey?: Accessor<string | number>;
445
+ /** Ignored without `data`. */
446
+ valueKey?: Accessor<number | null | undefined>;
447
+ curve?: LineCurve;
448
+ }
449
+ /** `RangeBandChart` (REQ-073): the band between a low and a high series. */
450
+ interface RangeBandChartProps extends CommonChartProps {
451
+ /** Ignored without `data`. */
452
+ xKey?: Accessor<string | number>;
453
+ /** Ignored without `data`. */
454
+ lowKey?: Accessor<number | null | undefined>;
455
+ /** Ignored without `data`. */
456
+ highKey?: Accessor<number | null | undefined>;
457
+ }
458
+ /** `StreamChart` (REQ-074): two waves, overlaid or stacked. */
459
+ interface StreamChartProps extends CommonChartProps {
460
+ /** Ignored without `data`. */
461
+ xKey?: Accessor<string | number>;
462
+ /** Ignored without `data`. */
463
+ keys?: readonly string[];
464
+ stacked?: boolean;
465
+ }
466
+ /** `ScatterChart` (REQ-082): points on two linear scales, optionally sized. */
467
+ interface ScatterChartProps extends CommonChartProps {
468
+ /** Ignored without `data`. */
469
+ xKey?: Accessor<number | null | undefined>;
470
+ /** Ignored without `data`. */
471
+ yKey?: Accessor<number | null | undefined>;
472
+ /** Ignored without `data`. */
473
+ sizeKey?: Accessor<number | null | undefined>;
474
+ /** Marker area in px², smallest to largest; `[60, 240]` by default. */
475
+ sizeRange?: readonly [number, number];
476
+ }
477
+ /** `BubbleChart` (REQ-083): circles whose area encodes `sizeKey`. */
478
+ interface BubbleChartProps extends CommonChartProps {
479
+ /** Ignored without `data`. */
480
+ xKey?: Accessor<number | null | undefined>;
481
+ /** Ignored without `data`. */
482
+ yKey?: Accessor<number | null | undefined>;
483
+ /** Ignored without `data`. */
484
+ sizeKey?: Accessor<number | null | undefined>;
485
+ /** Circle area in px², smallest to largest; `[100, 500]` by default. */
486
+ sizeRange?: readonly [number, number];
487
+ }
488
+ /** `DonutChart` (REQ-075): sectors ∝ value around a central readout (Data Model §2.2). */
489
+ interface DonutChartProps extends CommonChartProps {
490
+ /** Ignored without `data`. */
491
+ nameKey?: Accessor<string | number>;
492
+ /** Ignored without `data`. */
493
+ valueKey?: Accessor<number | null | undefined>;
494
+ /** Printed in the centre; the total by default. */
495
+ centerValue?: string | number;
496
+ /** A line under the centre value. */
497
+ centerLabel?: string;
498
+ /** Names every sector with its share beside the ring; `true` by default. */
499
+ legend?: boolean;
500
+ }
501
+ /** `RadarChart` (REQ-076): one spoke per subject, a closed polygon of values (Data Model §2.2). */
502
+ interface RadarChartProps extends CommonChartProps {
503
+ /** Ignored without `data`. */
504
+ subjectKey?: Accessor<string | number>;
505
+ /** Ignored without `data`. */
506
+ valueKey?: Accessor<number | null | undefined>;
507
+ /** The value range along a spoke; `[0, the largest value]`, niced, by default. */
508
+ domain?: readonly [number, number];
509
+ }
510
+ /** `PolarBarChart` (REQ-077): 360° bars out from a hole, length ∝ value (Data Model §2.2). */
511
+ interface PolarBarChartProps extends CommonChartProps {
512
+ /** Ignored without `data`. */
513
+ nameKey?: Accessor<string | number>;
514
+ /** Ignored without `data`. */
515
+ valueKey?: Accessor<number | null | undefined>;
516
+ }
517
+ /** `CoxcombChart` (REQ-088): equal angles, sector **area** ∝ value (Data Model §2.2). */
518
+ interface CoxcombChartProps extends CommonChartProps {
519
+ /** Ignored without `data`. */
520
+ nameKey?: Accessor<string | number>;
521
+ /** Ignored without `data`. */
522
+ valueKey?: Accessor<number | null | undefined>;
523
+ /** Where the first sector starts, in degrees clockwise from 12 o'clock; 0 by default. */
524
+ startAngle?: number;
525
+ }
526
+ /** `RadialArcGroup` (REQ-078): concentric 180° tracks, sweep ∝ value / the largest (Data Model §2.2). */
527
+ interface RadialArcGroupProps extends CommonChartProps {
528
+ /** Ignored without `data`. */
529
+ nameKey?: Accessor<string | number>;
530
+ /** Ignored without `data`. */
531
+ valueKey?: Accessor<number | null | undefined>;
532
+ }
533
+ /** `RadialRings` (REQ-079): concentric progress rings, sweep ∝ value in 0-100 (Data Model §2.2). */
534
+ interface RadialRingsProps extends CommonChartProps {
535
+ /** Ignored without `data`. */
536
+ nameKey?: Accessor<string | number>;
537
+ /** Ignored without `data`. */
538
+ valueKey?: Accessor<number | null | undefined>;
539
+ }
540
+ /** `GaugeArc` (REQ-080): a 240° arc swept to a percent (Data Model §2.3). */
541
+ interface GaugeArcProps extends CommonChartProps {
542
+ /** 0 to 100; saturated at the ends outside it. */
543
+ percent?: number;
544
+ /** Names the measure under the readout. */
545
+ caption?: string;
546
+ /** Printed in place of the percent. */
547
+ readout?: string;
548
+ }
549
+ /** `MeterChart` (REQ-081): a semicircular meter with a needle at a percent (Data Model §2.3). */
550
+ interface MeterChartProps extends CommonChartProps {
551
+ /** 0 to 100; saturated at the ends outside it. */
552
+ percent?: number;
553
+ /** Names the measure under the readout. */
554
+ caption?: string;
555
+ /** Printed in place of the percent. */
556
+ readout?: string;
557
+ }
558
+ /** `WindRose` (REQ-089): observations of (bearing, speed) binned by compass sector and speed. */
559
+ interface WindRoseProps extends CommonChartProps {
560
+ /** Where the wind blows from, in degrees clockwise from north. Ignored without `data`. */
561
+ bearingKey?: Accessor<number | null | undefined>;
562
+ /** The wind speed; 0 is a calm, which has no direction. Ignored without `data`. */
563
+ valueKey?: Accessor<number | null | undefined>;
564
+ /** Compass sectors: 4, 8, 16 or 32; 16 by default. */
565
+ sectors?: number;
566
+ /** Ascending speed thresholds that split each sector; `[5, 10, 15, 20]` by default. */
567
+ bins?: readonly number[];
568
+ }
569
+ /** `ChordRing` (REQ-091): directed flows between categories around a circle (Data Model §2.7). */
570
+ interface ChordRingProps extends CommonChartProps {
571
+ /** Ignored without `data`. */
572
+ sourceKey?: Accessor<string | number>;
573
+ /** Ignored without `data`. */
574
+ targetKey?: Accessor<string | number>;
575
+ /** Ignored without `data`. */
576
+ valueKey?: Accessor<number | null | undefined>;
577
+ /** Categories drawn; past it the smallest merge into "Other" (`SP010`). 12 by default. */
578
+ maxCategories?: number;
579
+ }
580
+ /** `OrbitChart` (REQ-092): nested elliptical orbits with markers along them (Data Model §2.10, delta-009). */
581
+ interface OrbitChartProps extends CommonChartProps {
582
+ /** Orbits shown, from the inside out; all by default. */
583
+ orbits?: number;
584
+ /** A row's markers; `'markers'` by default. Ignored without `data`. */
585
+ markerKey?: Accessor<readonly unknown[] | null | undefined>;
586
+ /** A marker's period, 0-1 over the cycle; `'period'` by default. Ignored without `data`. */
587
+ periodKey?: Accessor<number | null | undefined>;
588
+ }
589
+ /** `VolvelleChart` (REQ-090): concentric categorical rings read against one index (delta-010). */
590
+ interface VolvelleChartProps extends CommonChartProps {
591
+ /** Rings shown, from the inside out; all by default. */
592
+ rings?: number;
593
+ /**
594
+ * The ring whose segment is brought under the index, 0-based; 0 by default. Without `data`, it
595
+ * addresses the demo’s rings: `Day`, `Shift`, `Team`.
596
+ */
597
+ indexRing?: number;
598
+ /**
599
+ * The segment of `indexRing` under the index; its first segment by default. Without `data`, it
600
+ * addresses the demo’s rings: `Day`, `Shift`, `Team`.
601
+ */
602
+ indexValue?: string;
603
+ }
604
+
605
+ export type { LabelKind as $, ActiveItem as A, BulletChartProps as B, CommonChartProps as C, Datum as D, RangeBandChartProps as E, FunnelChartProps as F, Geometry as G, HeatmapChartProps as H, InkMode as I, StreamChartProps as J, KpiCardProps as K, LineChartProps as L, MeterChartProps as M, ScatterChartProps as N, OrbitChartProps as O, ProviderConfig as P, BubbleChartProps as Q, Rect as R, Seed as S, TextLabel as T, Accessor as U, VolvelleChartProps as V, WaterfallChartProps as W, GroundName as X, HatchToneSpec as Y, HitArea as Z, InkOptions as _, Ground as a, LineCurve as a0, StrokePart as a1, StrokeRole as a2, Tile as a3, TonalRamp as a4, ToneLevel as a5, ToneSpec as a6, UiTokens as a7, WeightToneSpec as a8, Stroke as b, StrokePaint as c, Inker as d, GroundRef as e, SubstrateName as f, PyramidChartProps as g, TreemapChartProps as h, SankeyChartProps as i, ActivityGridProps as j, StepChartProps as k, SparklineRowsProps as l, BarChartProps as m, StackedBarChartProps as n, ComposedChartProps as o, DonutChartProps as p, RadarChartProps as q, PolarBarChartProps as r, CoxcombChartProps as s, RadialArcGroupProps as t, RadialRingsProps as u, GaugeArcProps as v, WindRoseProps as w, ChordRingProps as x, CandlestickChartProps as y, AreaChartProps as z };