@silverpoint/core 0.1.0 → 0.2.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/dist/index.d.ts CHANGED
@@ -1,486 +1,5 @@
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
- /** Kind of text a label carries; the stylesheet sets type by it. */
55
- type LabelKind = 'title' | 'badge' | 'value' | 'unit' | 'footer' | 'tick' | 'empty';
56
- interface TextLabel {
57
- readonly x: number;
58
- readonly y: number;
59
- readonly text: string;
60
- readonly kind: LabelKind;
61
- /** Paint slot: `text` for primary labels, `axis` for muted ones. */
62
- readonly part: 'text' | 'axis';
63
- readonly anchor: 'start' | 'middle' | 'end';
64
- }
65
- /** A datum's position, as the interaction engine sees it (REQ-140). */
66
- interface HitArea {
67
- readonly seriesKey: string;
68
- readonly index: number;
69
- readonly datum: Datum;
70
- readonly value: number;
71
- readonly x: number;
72
- readonly y: number;
73
- /** The item's area, when it has one — a bar, a cell, a tile. A pointer inside it wins. */
74
- readonly box?: Rect;
75
- /**
76
- * The item's place in a grid, when the chart is one. When every item has one, the arrow keys
77
- * move by column (left, right) and by row (up, down) across the whole grid (REQ-122).
78
- */
79
- readonly cell?: Readonly<{
80
- column: number;
81
- row: number;
82
- }>;
83
- }
84
- /**
85
- * A hatch tile shared by every shape of one tonal level (REQ-029).
86
- * @internal
87
- */
88
- interface Tile {
89
- /** Scoped to the chart instance (REQ-030). */
90
- readonly id: string;
91
- readonly width: number;
92
- readonly height: number;
93
- /** Rotation of the tile in degrees. */
94
- readonly angle: number;
95
- readonly strokes: readonly Stroke[];
96
- }
97
- interface Rect {
98
- readonly x: number;
99
- readonly y: number;
100
- readonly width: number;
101
- readonly height: number;
102
- }
103
- /** Everything a chart needs in order to draw itself. Serializable (REQ-011). */
104
- interface Geometry {
105
- readonly viewBox: Rect;
106
- readonly strokes: readonly Stroke[];
107
- readonly labels: readonly TextLabel[];
108
- readonly hitAreas: readonly HitArea[];
109
- /** @internal Hatch tiles referenced by strokes painted with `'tile'`. */
110
- readonly defs: readonly Tile[];
111
- /** @internal The drawing area; the interaction engine ignores anything outside it. */
112
- readonly plot: Rect;
113
- }
114
-
115
- /** One step of a ground's tonal ramp (Data Model §3.4). */
116
- interface ToneSpec {
117
- readonly style: 'hachure' | 'cross-hatch';
118
- readonly gap: number;
119
- /** Hatch angle in degrees; cross-hatch adds the perpendicular. */
120
- readonly angle: number;
121
- }
122
- type TonalRamp = Readonly<Record<Exclude<ToneLevel, 0>, ToneSpec>>;
123
- interface InkOptions {
124
- readonly seed: number;
125
- readonly roughness: number;
126
- readonly bowing: number;
127
- readonly hatchAngle: number;
128
- readonly hatchGap: number;
129
- readonly fillWeight: number;
130
- /** Upper bound of nodes the Inker must not exceed. */
131
- readonly nodeBudget: number;
132
- /** @internal `tile` shares one hatch tile per tonal level (REQ-029). */
133
- readonly hatchFill?: 'tile' | 'per-shape';
134
- /** @internal The ground's tonal ramp. */
135
- readonly tonalRamp?: TonalRamp;
136
- /** @internal Prefix that scopes generated ids to the chart instance (REQ-030). */
137
- readonly scope?: string;
138
- }
139
- interface Inker {
140
- readonly name: string;
141
- /** Receives exact geometry and returns the inked geometry. */
142
- ink(geometry: Geometry, options: InkOptions): Geometry;
143
- }
144
-
145
- /** Name of a registered ground. */
146
- type GroundName = 'silverpoint' | (string & {});
147
- /** Declarative token set of a style ground (API Spec §6, Art. 7). */
148
- interface Ground {
149
- readonly name: string;
150
- /** How it builds tonal value. `wash` is the anticipated exception to Art. 6. */
151
- readonly tonalMechanism: 'hatch' | 'weight' | 'wash';
152
- /** Name of the registered Inker that inks it. */
153
- readonly inker: string;
154
- readonly substrates: Readonly<Record<string, string>>;
155
- readonly ink: Readonly<{
156
- primary: string;
157
- secondary: string;
158
- heighten: string;
159
- rule: string;
160
- grid: string;
161
- text: string;
162
- textMuted: string;
163
- }>;
164
- readonly inkOptions: Omit<InkOptions, 'seed' | 'nodeBudget' | 'hatchFill' | 'tonalRamp' | 'scope'>;
165
- /** Hatch density bound, to stay within the node budget. */
166
- readonly maxHatchDensity: number;
167
- /** Tonal levels 1-4 (Data Model §3.4). */
168
- readonly tonalRamp: TonalRamp;
169
- readonly typography: Readonly<{
170
- display: string;
171
- scale: number;
172
- }>;
173
- /** What to draw when there is no data (REQ-007). */
174
- readonly emptyState: Readonly<{
175
- text: string;
176
- rule: boolean;
177
- }>;
178
- /** Expansion of degenerate domains (REQ-010). */
179
- readonly domainPadding: number;
180
- }
181
- /** Name of a registered ground, or a complete ground. */
182
- type GroundRef = GroundName | Ground;
183
-
184
- /** Props present in every chart, identical in React and Angular (REQ-094). */
185
- interface CommonChartProps {
186
- /** Rows to draw. If omitted, the demo dataset is rendered (REQ-093). */
187
- data?: readonly Datum[];
188
- /** Style ground. Defaults to the app provider's, or `silverpoint`. */
189
- ground?: GroundRef;
190
- /** Prepared substrate within the ground (REQ-046). */
191
- substrate?: SubstrateName;
192
- /** `ink` by default; `precision` disables inking (REQ-021). */
193
- mode?: InkMode;
194
- /** Seed. If omitted, it is derived from `id` stably (REQ-003). */
195
- seed?: Seed;
196
- /** Stable identifier. If omitted, it is generated deterministically. */
197
- id?: string;
198
- /** Height of the drawing area in px. Width is the container's unless pinned. */
199
- height?: number;
200
- width?: number;
201
- /** `card` draws the full frame; `bare` only the drawing area (REQ-095). */
202
- chrome?: 'card' | 'bare';
203
- /** How areas are filled (REQ-029). */
204
- hatchFill?: 'tile' | 'per-shape';
205
- title?: string;
206
- badge?: string;
207
- value?: string | number;
208
- unit?: string;
209
- footerLeft?: string;
210
- footerRight?: string;
211
- /** Accessible name. If omitted, it is derived from `title` (REQ-120). */
212
- label?: string;
213
- /** Long description for screen readers (REQ-120). */
214
- description?: string;
215
- /** Tabular alternative; `hidden` leaves it for assistive technology only (REQ-121). */
216
- dataTable?: 'visible' | 'hidden' | 'none';
217
- locale?: string;
218
- numberFormat?: Intl.NumberFormatOptions;
219
- className?: string;
220
- }
221
- type LineCurve = 'monotone' | 'linear' | 'natural' | 'step';
222
- /** `LineChart` (REQ-060): spline with an optional dotted baseline series. */
223
- interface LineChartProps extends CommonChartProps {
224
- xKey?: Accessor<string | number>;
225
- valueKey?: Accessor<number | null | undefined>;
226
- secondaryKey?: Accessor<number | null | undefined>;
227
- curve?: LineCurve;
228
- /** `all` draws the secondary series when there is one; `primary` omits it. */
229
- series?: 'all' | 'primary';
230
- /** Whether a gap left by a missing value is bridged (REQ-008). */
231
- connectNulls?: boolean;
232
- }
233
- /** Configuration an application sets once for every chart (API Spec §8). */
234
- interface ProviderConfig {
235
- ground?: GroundRef;
236
- substrate?: SubstrateName;
237
- mode?: InkMode;
238
- locale?: string;
239
- }
240
- /** `BulletChart` (REQ-069): one bar per target, with a marker at the target. Values in 0-100. */
241
- interface BulletChartProps extends CommonChartProps {
242
- titleKey?: Accessor<string>;
243
- actualKey?: Accessor<number | null | undefined>;
244
- targetKey?: Accessor<number | null | undefined>;
245
- }
246
- /** `PyramidChart` (REQ-070): stacked tiers whose width encodes the value (0-100). */
247
- interface PyramidChartProps extends CommonChartProps {
248
- labelKey?: Accessor<string>;
249
- widthKey?: Accessor<number | null | undefined>;
250
- toneKey?: Accessor<number | null | undefined>;
251
- }
252
- /** `HeatmapChart` (REQ-084): labelled rows of values, normalised against `scaleMax`. */
253
- interface HeatmapChartProps extends CommonChartProps {
254
- labelKey?: Accessor<string>;
255
- valuesKey?: Accessor<readonly (number | null)[] | null | undefined>;
256
- /** Value that maps to the darkest tone; 100 by default. */
257
- scaleMax?: number;
258
- /** Names of the columns, in order; missing ones fall back to `#k` (delta-006). */
259
- columnLabels?: readonly string[];
260
- }
261
- /** `TreemapChart` (REQ-085): tiles of `cols × rows` cells placed in a `columns × rows` grid. */
262
- interface TreemapChartProps extends CommonChartProps {
263
- labelKey?: Accessor<string>;
264
- shareKey?: Accessor<number | null | undefined>;
265
- columns?: number;
266
- rows?: number;
267
- }
268
- /** `SankeyChart` (REQ-086): flow bands between layered nodes. */
269
- interface SankeyChartProps extends CommonChartProps {
270
- sourceKey?: Accessor<string>;
271
- targetKey?: Accessor<string>;
272
- valueKey?: Accessor<number | null | undefined>;
273
- }
274
- /** `ActivityGrid` (REQ-087): one cell per day, a column per week. */
275
- interface ActivityGridProps extends CommonChartProps {
276
- dateKey?: Accessor<string>;
277
- countKey?: Accessor<number | null | undefined>;
278
- levelKey?: Accessor<number | null | undefined>;
279
- /** Weeks shown, the most recent last; 26 by default. */
280
- weeks?: number;
281
- }
282
- /** `StepChart` (REQ-061): a series drawn as steps. */
283
- interface StepChartProps extends CommonChartProps {
284
- xKey?: Accessor<string | number>;
285
- valueKey?: Accessor<number | null | undefined>;
286
- /** Where the step sits between two points; `after` by default. */
287
- step?: 'after' | 'before' | 'middle';
288
- }
289
- /** `SparklineRows` (REQ-062): one row per series — name, sparkline, readout (delta-008). */
290
- interface SparklineRowsProps extends CommonChartProps {
291
- /** Rows shown, from the first; all by default. */
292
- rows?: number;
293
- nameKey?: Accessor<string>;
294
- /** The printed readout; the last value of the series by default. */
295
- readoutKey?: Accessor<string | number | null | undefined>;
296
- /** The row's points: an array. */
297
- seriesKey?: Accessor<readonly unknown[] | null | undefined>;
298
- /** The value of one point; the point itself when it is a number, else its `value`. */
299
- pointKey?: Accessor<number | null | undefined>;
300
- }
301
- /** `KpiCard` (REQ-063): a metric, its delta, and an area sparkline of the series. */
302
- interface KpiCardProps extends CommonChartProps {
303
- valueKey?: Accessor<number | null | undefined>;
304
- /** The metric's name, printed under the figure. */
305
- metric?: string;
306
- /** Signed change, printed with its sign and a direction mark. */
307
- delta?: number;
308
- /** Direction of the mark; from the sign of `delta` by default. */
309
- deltaTone?: 'up' | 'down' | 'flat';
310
- }
311
- /** `BarChart` (REQ-064): pill bars, as columns or rows, with an optional second series. */
312
- interface BarChartProps extends CommonChartProps {
313
- xKey?: Accessor<string | number>;
314
- valueKey?: Accessor<number | null | undefined>;
315
- secondaryKey?: Accessor<number | null | undefined>;
316
- orientation?: 'columns' | 'rows';
317
- }
318
- /** `StackedBarChart` (REQ-065): one stacked segment per key. */
319
- interface StackedBarChartProps extends CommonChartProps {
320
- xKey?: Accessor<string | number>;
321
- keys?: readonly string[];
322
- /** Display names of the keys, in order; the keys themselves by default. */
323
- names?: readonly string[];
324
- }
325
- /** `ComposedChart` (REQ-066): columns and a spline on one value scale. */
326
- interface ComposedChartProps extends CommonChartProps {
327
- xKey?: Accessor<string | number>;
328
- barKey?: Accessor<number | null | undefined>;
329
- lineKey?: Accessor<number | null | undefined>;
330
- showLine?: boolean;
331
- }
332
- /** `WaterfallChart` (REQ-067): totals from zero and floating deltas from the running total. */
333
- interface WaterfallChartProps extends CommonChartProps {
334
- stepKey?: Accessor<string>;
335
- /** An absolute total: the bar starts at zero and resets the running total. */
336
- baseKey?: Accessor<number | null | undefined>;
337
- /** A change from the running total. */
338
- deltaKey?: Accessor<number | null | undefined>;
339
- }
340
- /** `FunnelChart` (REQ-068): horizontal, centred stages. */
341
- interface FunnelChartProps extends CommonChartProps {
342
- stageKey?: Accessor<string>;
343
- valueKey?: Accessor<number | null | undefined>;
344
- }
345
- /** `CandlestickChart` (REQ-071): OHLC bodies and wicks (Data Model §2.6). */
346
- interface CandlestickChartProps extends CommonChartProps {
347
- timeKey?: Accessor<string | number>;
348
- openKey?: Accessor<number | null | undefined>;
349
- highKey?: Accessor<number | null | undefined>;
350
- lowKey?: Accessor<number | null | undefined>;
351
- closeKey?: Accessor<number | null | undefined>;
352
- /** Price bounds of the scale; derived from the data when omitted (REQ-097). */
353
- bounds?: readonly [number, number];
354
- }
355
- /** `AreaChart` (REQ-072): a curved, toned area under its line. */
356
- interface AreaChartProps extends CommonChartProps {
357
- xKey?: Accessor<string | number>;
358
- valueKey?: Accessor<number | null | undefined>;
359
- curve?: LineCurve;
360
- }
361
- /** `RangeBandChart` (REQ-073): the band between a low and a high series. */
362
- interface RangeBandChartProps extends CommonChartProps {
363
- xKey?: Accessor<string | number>;
364
- lowKey?: Accessor<number | null | undefined>;
365
- highKey?: Accessor<number | null | undefined>;
366
- }
367
- /** `StreamChart` (REQ-074): two waves, overlaid or stacked. */
368
- interface StreamChartProps extends CommonChartProps {
369
- xKey?: Accessor<string | number>;
370
- keys?: readonly string[];
371
- stacked?: boolean;
372
- }
373
- /** `ScatterChart` (REQ-082): points on two linear scales, optionally sized. */
374
- interface ScatterChartProps extends CommonChartProps {
375
- xKey?: Accessor<number | null | undefined>;
376
- yKey?: Accessor<number | null | undefined>;
377
- sizeKey?: Accessor<number | null | undefined>;
378
- /** Marker area in px², smallest to largest; `[60, 240]` by default. */
379
- sizeRange?: readonly [number, number];
380
- }
381
- /** `BubbleChart` (REQ-083): circles whose area encodes `sizeKey`. */
382
- interface BubbleChartProps extends CommonChartProps {
383
- xKey?: Accessor<number | null | undefined>;
384
- yKey?: Accessor<number | null | undefined>;
385
- sizeKey?: Accessor<number | null | undefined>;
386
- /** Circle area in px², smallest to largest; `[100, 500]` by default. */
387
- sizeRange?: readonly [number, number];
388
- }
389
- /** `DonutChart` (REQ-075): sectors ∝ value around a central readout (Data Model §2.2). */
390
- interface DonutChartProps extends CommonChartProps {
391
- nameKey?: Accessor<string | number>;
392
- valueKey?: Accessor<number | null | undefined>;
393
- /** Printed in the centre; the total by default. */
394
- centerValue?: string | number;
395
- /** A line under the centre value. */
396
- centerLabel?: string;
397
- /** Names every sector with its share beside the ring; `true` by default. */
398
- legend?: boolean;
399
- }
400
- /** `RadarChart` (REQ-076): one spoke per subject, a closed polygon of values (Data Model §2.2). */
401
- interface RadarChartProps extends CommonChartProps {
402
- subjectKey?: Accessor<string | number>;
403
- valueKey?: Accessor<number | null | undefined>;
404
- /** The value range along a spoke; `[0, the largest value]`, niced, by default. */
405
- domain?: readonly [number, number];
406
- }
407
- /** `PolarBarChart` (REQ-077): 360° bars out from a hole, length ∝ value (Data Model §2.2). */
408
- interface PolarBarChartProps extends CommonChartProps {
409
- nameKey?: Accessor<string | number>;
410
- valueKey?: Accessor<number | null | undefined>;
411
- }
412
- /** `CoxcombChart` (REQ-088): equal angles, sector **area** ∝ value (Data Model §2.2). */
413
- interface CoxcombChartProps extends CommonChartProps {
414
- nameKey?: Accessor<string | number>;
415
- valueKey?: Accessor<number | null | undefined>;
416
- /** Where the first sector starts, in degrees clockwise from 12 o'clock; 0 by default. */
417
- startAngle?: number;
418
- }
419
- /** `RadialArcGroup` (REQ-078): concentric 180° tracks, sweep ∝ value / the largest (Data Model §2.2). */
420
- interface RadialArcGroupProps extends CommonChartProps {
421
- nameKey?: Accessor<string | number>;
422
- valueKey?: Accessor<number | null | undefined>;
423
- }
424
- /** `RadialRings` (REQ-079): concentric progress rings, sweep ∝ value in 0-100 (Data Model §2.2). */
425
- interface RadialRingsProps extends CommonChartProps {
426
- nameKey?: Accessor<string | number>;
427
- valueKey?: Accessor<number | null | undefined>;
428
- }
429
- /** `GaugeArc` (REQ-080): a 240° arc swept to a percent (Data Model §2.3). */
430
- interface GaugeArcProps extends CommonChartProps {
431
- /** 0 to 100; saturated at the ends outside it. */
432
- percent?: number;
433
- /** Names the measure under the readout. */
434
- caption?: string;
435
- /** Printed in place of the percent. */
436
- readout?: string;
437
- }
438
- /** `MeterChart` (REQ-081): a semicircular meter with a needle at a percent (Data Model §2.3). */
439
- interface MeterChartProps extends CommonChartProps {
440
- /** 0 to 100; saturated at the ends outside it. */
441
- percent?: number;
442
- /** Names the measure under the readout. */
443
- caption?: string;
444
- /** Printed in place of the percent. */
445
- readout?: string;
446
- }
447
- /** `WindRose` (REQ-089): observations of (bearing, speed) binned by compass sector and speed. */
448
- interface WindRoseProps extends CommonChartProps {
449
- /** Where the wind blows from, in degrees clockwise from north. */
450
- bearingKey?: Accessor<number | null | undefined>;
451
- /** The wind speed; 0 is a calm, which has no direction. */
452
- valueKey?: Accessor<number | null | undefined>;
453
- /** Compass sectors: 4, 8, 16 or 32; 16 by default. */
454
- sectors?: number;
455
- /** Ascending speed thresholds that split each sector; `[5, 10, 15, 20]` by default. */
456
- bins?: readonly number[];
457
- }
458
- /** `ChordRing` (REQ-091): directed flows between categories around a circle (Data Model §2.7). */
459
- interface ChordRingProps extends CommonChartProps {
460
- sourceKey?: Accessor<string | number>;
461
- targetKey?: Accessor<string | number>;
462
- valueKey?: Accessor<number | null | undefined>;
463
- /** Categories drawn; past it the smallest merge into "Other" (`SP010`). 12 by default. */
464
- maxCategories?: number;
465
- }
466
- /** `OrbitChart` (REQ-092): nested elliptical orbits with markers along them (Data Model §2.10, delta-009). */
467
- interface OrbitChartProps extends CommonChartProps {
468
- /** Orbits shown, from the inside out; all by default. */
469
- orbits?: number;
470
- /** A row's markers; `'markers'` by default. */
471
- markerKey?: Accessor<readonly unknown[] | null | undefined>;
472
- /** A marker's period, 0-1 over the cycle; `'period'` by default. */
473
- periodKey?: Accessor<number | null | undefined>;
474
- }
475
- /** `VolvelleChart` (REQ-090): concentric categorical rings read against one index (delta-010). */
476
- interface VolvelleChartProps extends CommonChartProps {
477
- /** Rings shown, from the inside out; all by default. */
478
- rings?: number;
479
- /** The ring whose segment is brought under the index, 0-based; 0 by default. */
480
- indexRing?: number;
481
- /** The segment of `indexRing` under the index; its first segment by default. */
482
- indexValue?: string;
483
- }
1
+ import { G as Geometry, C as CommonChartProps, a as Ground, S as Seed, b as Stroke, c as StrokePaint, I as InkMode, T as TextLabel, d as Inker, e as GroundRef, f as SubstrateName, P as ProviderConfig, L as LineChartProps, g as Datum, A as ActiveItem, R as Rect, B as BulletChartProps, h as PyramidChartProps, H as HeatmapChartProps, i as TreemapChartProps, j as SankeyChartProps, k as ActivityGridProps, l as StepChartProps, m as SparklineRowsProps, K as KpiCardProps, n as BarChartProps, o as StackedBarChartProps, p as ComposedChartProps, W as WaterfallChartProps, F as FunnelChartProps, q as DonutChartProps, r as RadarChartProps, s as PolarBarChartProps, t as CoxcombChartProps, u as RadialArcGroupProps, v as RadialRingsProps, w as GaugeArcProps, M as MeterChartProps, x as WindRoseProps, y as ChordRingProps, O as OrbitChartProps, V as VolvelleChartProps, z as CandlestickChartProps, E as AreaChartProps, J as RangeBandChartProps, N as StreamChartProps, Q as ScatterChartProps, U as BubbleChartProps, X as PerBreakpoint, Y as DashboardBreakpoint, Z as DashboardLayout, _ as ResolvedLayout, D as DashboardProps, $ as DashboardModel, a0 as DashboardView, a1 as DashboardCellContext } from './types-D1hjElfL.js';
2
+ export { a2 as Accessor, a3 as DashboardCellLayout, a4 as DashboardCellProps, a5 as DashboardLink, a6 as GroundName, a7 as HatchToneSpec, a8 as HitArea, a9 as InkOptions, aa as LabelKind, ab as LineCurve, ac as ResolvedCell, ad as ResolvedSpan, ae as StrokePart, af as StrokeRole, ag as Tile, ah as TonalRamp, ai as ToneLevel, aj as ToneSpec, ak as WeightToneSpec } from './types-D1hjElfL.js';
484
3
 
485
4
  /** Tabular alternative of a chart's data, already formatted (REQ-121). */
486
5
  interface DataTable {
@@ -637,6 +156,8 @@ interface PathView {
637
156
  readonly paint: StrokePaint;
638
157
  /** `data-dash` attribute, omitted when `null`. */
639
158
  readonly dash: string | null;
159
+ /** `data-weight` attribute: a `weight` ground's tonal level (REQ-028), omitted when `null`. */
160
+ readonly weight: string | null;
640
161
  /** `fill` attribute — only ever a `url(#tile)` reference, omitted when `null`. */
641
162
  readonly fill: string | null;
642
163
  }
@@ -665,7 +186,7 @@ declare function toSvgView(model: ChartModel, style: ViewStyle): SvgView;
665
186
  declare function svgString(view: SvgView): string;
666
187
 
667
188
  /** Stable diagnostic codes, part of the public surface (API Spec §11). */
668
- type SpCode = 'SP001' | 'SP002' | 'SP003' | 'SP004' | 'SP005' | 'SP006' | 'SP007' | 'SP008' | 'SP009' | 'SP010' | 'SP011' | 'SP012' | 'SP013';
189
+ type SpCode = 'SP001' | 'SP002' | 'SP003' | 'SP004' | 'SP005' | 'SP006' | 'SP007' | 'SP008' | 'SP009' | 'SP010' | 'SP011' | 'SP012' | 'SP013' | 'SP014' | 'SP015' | 'SP016';
669
190
  interface Detail {
670
191
  /** The property involved. */
671
192
  readonly property: string;
@@ -1015,4 +536,90 @@ declare const scatterChart: ChartRecipe<ScatterChartProps>;
1015
536
  /** `BubbleChart` recipe (REQ-083): circles whose area encodes the size. */
1016
537
  declare const bubbleChart: ChartRecipe<BubbleChartProps>;
1017
538
 
1018
- export { type Accessor, type ActiveItem, type ActivityGridProps, type AreaChartProps, type BandScale, type BarChartProps, type BubbleChartProps, type BulletChartProps, type CandlestickChartProps, type ChartHandle, type ChartModel, type ChartRecipe, type ChordRingProps, type CommonChartProps, type ComposedChartProps, type CoxcombChartProps, DEFAULTS, DISPLAY_FACE_PROBE, type DataTable, type Datum, type Detail, type DiagnosticSink, type DonutChartProps, FORCED_PRECISION_QUERY, type FontFaceSetLike, type FunnelChartProps, type GaugeArcProps, type Geometry, type Ground, type GroundName, type GroundRef, type HeatmapChartProps, type HitArea, type InkMode, type InkOptions, type Inker, type InteractionEvent, type InteractionResult, type KpiCardProps, LINE_CHART_DEMO, LINE_CHART_DEMO_KEYS, type LabelKind, type LineChartProps, type LineCurve, type LinearScale, MIN_TOUCH_TARGET, type MeterChartProps, NAVIGATION_KEYS, NullInker, type OrbitChartProps, PATH_BYTE_BUDGET, type PathView, type PatternView, type PointerKind, type PolarBarChartProps, type ProviderConfig, type PyramidChartProps, type RadarChartProps, type RadialArcGroupProps, type RadialRingsProps, type RangeBandChartProps, type Readout, type RecipeContext, type Rect, type ResolvedConfig, type SankeyChartProps, type ScaleSite, type ScatterChartProps, type Seed, SilverpointError, type SpCode, type SparklineRowsProps, type StackedBarChartProps, type StepChartProps, type StreamChartProps, type Stroke, type StrokePaint, type StrokePart, type StrokeRole, type SubstrateName, type SvgView, type TextLabel, type TextView, type Tile, type TonalRamp, type ToneLevel, type ToneSpec, type TreemapChartProps, type ViewStyle, type VolvelleChartProps, type WaterfallChartProps, type WindRoseProps, __setDiagnosticSink, activityGrid, addDays, areaChart, bandScale, barChart, bubbleChart, bulletChart, candlestickChart, checkTypeface, chordRing, circlePath, composedChart, coxcombChart, createPrng, deriveSeed, diagnose, donutChart, enforceHeightening, expandDomain, extent, fnv1a32, funnelChart, gaugeArc, heatmapChart, instanceId, isoDate, kpiCard, lineChart, linearScale, max, meterChart, min, orbitChart, parseGeometry, parseIsoDate, pathBytes, polarBarChart, pyramidChart, radarChart, radialArcGroup, radialRings, rangeBandChart, readout, reduceInteraction, registerInker, resolveActive, resolveConfig, resolveInker, resolveSeed, round2, roundGeometry, roundPathData, sameActive, sankeyChart, scatterChart, serializeGeometry, sparklineRows, stackedBarChart, stepActive, stepChart, streamChart, svgString, toSvgPoint, toSvgView, treemapChart, volvelleChart, waterfallChart, weekday, windRose };
539
+ /** The dashboard's documented defaults (API Spec §5.1, REQ-208). */
540
+ declare const DASHBOARD_DEFAULTS: Readonly<{
541
+ readonly columns: Readonly<{
542
+ sm: 1;
543
+ md: 2;
544
+ lg: 4;
545
+ }>;
546
+ readonly rowHeight: 240;
547
+ readonly gap: 16;
548
+ readonly span: 1;
549
+ readonly headingLevel: 2;
550
+ readonly ssrWidth: 1200;
551
+ }>;
552
+ /** A per-breakpoint value expanded to all three: a bare value applies everywhere, a gap keeps `fallback`. */
553
+ declare function perBreakpoint<T>(value: PerBreakpoint<T> | undefined, fallback: Readonly<Record<DashboardBreakpoint, T>>): Record<DashboardBreakpoint, T>;
554
+ /**
555
+ * The layout with its defaults applied and its numbers held to the contract of Data Model §2.13
556
+ * (REQ-201, REQ-204, REQ-208): invalid numbers fall back with SP002, a column span wider than its
557
+ * breakpoint is clamped with SP014 (I-12). Pure but for diagnostics; JSON-serialisable (I-10).
558
+ */
559
+ declare function resolveLayout(layout: DashboardLayout | undefined): ResolvedLayout;
560
+
561
+ /** The breakpoint a container of `width` px falls in (DD-014). */
562
+ declare function breakpointOf(width: number): DashboardBreakpoint;
563
+ /**
564
+ * The dashboard's resolved model (REQ-201): children matched to layout cells by id in the four
565
+ * rules of Data Model §2.13, spans held to the columns, chart ids derived from the dashboard's id
566
+ * (REQ-209), nominal boxes at `ssrWidth` (REQ-206) and the custom properties the adapters write
567
+ * (REQ-202). Pure but for diagnostics; never throws on a mismatch (REQ-205).
568
+ */
569
+ declare function resolveDashboard(props: DashboardProps, childCells: readonly (string | undefined)[]): DashboardModel;
570
+ /**
571
+ * The size a chart is drawn at inside a cell box (REQ-206): the cell's width, and its height less
572
+ * the chart's own card chrome, so every card in a row has the same outer height (I-13). The chrome
573
+ * is measured by building `recipe` at a probe height — the recipe may add rows of its own (KpiCard's
574
+ * value line) — and read from `cardLayout` when no recipe is given. The chart's own `width` and
575
+ * `height` take precedence (API Spec §7.1, size precedence).
576
+ */
577
+ declare function cellChartBox<P extends CommonChartProps>(cell: {
578
+ width: number;
579
+ height: number;
580
+ }, chartProps: P, recipe?: ChartRecipe<P>): {
581
+ width: number;
582
+ height: number;
583
+ };
584
+
585
+ /**
586
+ * The dashboard as an adapter writes it (REQ-200, REQ-214): the section's class, substrate, name
587
+ * and variables, the heading and description, and per cell its variables, its label and the
588
+ * context its chart reads. `children` gives, in source order, each child's `cell` and its chart's
589
+ * own `id` when the adapter can read it.
590
+ */
591
+ declare function dashboardView(props: DashboardProps, children: readonly {
592
+ readonly cell?: string;
593
+ readonly id?: string;
594
+ }[]): DashboardView;
595
+ /**
596
+ * A chart's props inside a cell (API Spec §7.1, size precedence; REQ-212 config precedence): its
597
+ * own `id`, `height` and config win; the cell supplies the rest. `width` is the width to draw at
598
+ * until the chart is measured — the chart's own, else the cell's nominal width (REQ-207).
599
+ */
600
+ declare function inCell<P extends CommonChartProps>(props: P, cell: DashboardCellContext | undefined, recipe: ChartRecipe<P>): {
601
+ props: P;
602
+ width: number | undefined;
603
+ };
604
+
605
+ /**
606
+ * The items of `model` whose datum carries `value` under `key` (REQ-216), by the index of their hit
607
+ * area: exact matches only, never the nearest (REQ-217). A chart whose data has no `key` at all
608
+ * shows no linked mark and warns SP016, once. Pure: the model is read, never touched.
609
+ */
610
+ declare function linkedItems(model: ChartModel, key: string, value: unknown): readonly number[];
611
+ /** A dashboard's linked value (REQ-216): the key, the value of the source's active item, and the source chart's id. */
612
+ interface LinkState {
613
+ readonly key: string;
614
+ readonly value: unknown;
615
+ readonly source: string;
616
+ }
617
+ /** The link a chart's active item sets; `null` when it clears, which clears every chart (REQ-218). */
618
+ declare function linkFrom(key: string, source: string, active: ActiveItem | null): LinkState | null;
619
+ /**
620
+ * The marker paths a chart draws for a link (REQ-216): the readout's own marker, for each item
621
+ * carrying the value. None for the source, which shows its active item, nor for a cleared link.
622
+ */
623
+ declare function linkedMarks(model: Pick<ChartModel, 'id' | 'chart' | 'geometry' | 'table'>, state: LinkState | null | undefined): readonly string[];
624
+
625
+ export { ActiveItem, ActivityGridProps, AreaChartProps, type BandScale, BarChartProps, BubbleChartProps, BulletChartProps, CandlestickChartProps, type ChartHandle, type ChartModel, type ChartRecipe, ChordRingProps, CommonChartProps, ComposedChartProps, CoxcombChartProps, DASHBOARD_DEFAULTS, DEFAULTS, DISPLAY_FACE_PROBE, DashboardBreakpoint, DashboardCellContext, DashboardLayout, DashboardModel, DashboardProps, DashboardView, type DataTable, Datum, type Detail, type DiagnosticSink, DonutChartProps, FORCED_PRECISION_QUERY, type FontFaceSetLike, FunnelChartProps, GaugeArcProps, Geometry, Ground, GroundRef, HeatmapChartProps, InkMode, Inker, type InteractionEvent, type InteractionResult, KpiCardProps, LINE_CHART_DEMO, LINE_CHART_DEMO_KEYS, LineChartProps, type LinearScale, type LinkState, MIN_TOUCH_TARGET, MeterChartProps, NAVIGATION_KEYS, NullInker, OrbitChartProps, PATH_BYTE_BUDGET, type PathView, type PatternView, PerBreakpoint, type PointerKind, PolarBarChartProps, ProviderConfig, PyramidChartProps, RadarChartProps, RadialArcGroupProps, RadialRingsProps, RangeBandChartProps, type Readout, type RecipeContext, Rect, type ResolvedConfig, ResolvedLayout, SankeyChartProps, type ScaleSite, ScatterChartProps, Seed, SilverpointError, type SpCode, SparklineRowsProps, StackedBarChartProps, StepChartProps, StreamChartProps, Stroke, StrokePaint, SubstrateName, type SvgView, TextLabel, type TextView, TreemapChartProps, type ViewStyle, VolvelleChartProps, WaterfallChartProps, WindRoseProps, __setDiagnosticSink, activityGrid, addDays, areaChart, bandScale, barChart, breakpointOf, bubbleChart, bulletChart, candlestickChart, cellChartBox, checkTypeface, chordRing, circlePath, composedChart, coxcombChart, createPrng, dashboardView, deriveSeed, diagnose, donutChart, enforceHeightening, expandDomain, extent, fnv1a32, funnelChart, gaugeArc, heatmapChart, inCell, instanceId, isoDate, kpiCard, lineChart, linearScale, linkFrom, linkedItems, linkedMarks, max, meterChart, min, orbitChart, parseGeometry, parseIsoDate, pathBytes, perBreakpoint, polarBarChart, pyramidChart, radarChart, radialArcGroup, radialRings, rangeBandChart, readout, reduceInteraction, registerInker, resolveActive, resolveConfig, resolveDashboard, resolveInker, resolveLayout, resolveSeed, round2, roundGeometry, roundPathData, sameActive, sankeyChart, scatterChart, serializeGeometry, sparklineRows, stackedBarChart, stepActive, stepChart, streamChart, svgString, toSvgPoint, toSvgView, treemapChart, volvelleChart, waterfallChart, weekday, windRose };