@silverpoint/core 0.2.0 → 0.6.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/README.md +4 -0
- package/dist/catalog.d.ts +97 -0
- package/dist/catalog.js +8002 -0
- package/dist/catalog.js.map +1 -0
- package/dist/chunk-KFBSQH5G.js +34 -0
- package/dist/chunk-KFBSQH5G.js.map +1 -0
- package/dist/chunk-OLYKR5PS.js +632 -0
- package/dist/chunk-OLYKR5PS.js.map +1 -0
- package/dist/chunk-PD4MD7JU.js +170 -0
- package/dist/chunk-PD4MD7JU.js.map +1 -0
- package/dist/dashboard-demos.d.ts +2 -1
- package/dist/index.d.ts +10 -55
- package/dist/index.js +36 -793
- package/dist/index.js.map +1 -1
- package/dist/model-CLhtoG75.d.ts +53 -0
- package/dist/{types-D1hjElfL.d.ts → props-Dq8FC8GG.d.ts} +369 -143
- package/dist/types-B81k-s9_.d.ts +148 -0
- package/dist/ui-demos.d.ts +17 -0
- package/dist/ui-demos.js +129 -0
- package/dist/ui-demos.js.map +1 -0
- package/dist/ui.d.ts +545 -0
- package/dist/ui.js +716 -0
- package/dist/ui.js.map +1 -0
- package/package.json +19 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { m as CommonChartProps, am as Ground, G as Geometry } from './props-Dq8FC8GG.js';
|
|
2
|
+
|
|
3
|
+
/** Tabular alternative of a chart's data, already formatted (REQ-121). */
|
|
4
|
+
interface DataTable {
|
|
5
|
+
readonly caption: string;
|
|
6
|
+
readonly columns: readonly string[];
|
|
7
|
+
readonly rows: readonly (readonly string[])[];
|
|
8
|
+
}
|
|
9
|
+
/** What a recipe needs beyond the props: the resolved environment. */
|
|
10
|
+
interface RecipeContext {
|
|
11
|
+
/** Resolved instance id. */
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/** Resolved container width in px; `undefined` while it has not been measured. */
|
|
14
|
+
readonly width: number | undefined;
|
|
15
|
+
readonly locale: string;
|
|
16
|
+
readonly emptyState: Ground['emptyState'];
|
|
17
|
+
readonly domainPadding: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Everything an adapter renders: the geometry plus the accessible layer. Adapters translate
|
|
21
|
+
* it into nodes and compute nothing (Art. 2).
|
|
22
|
+
*/
|
|
23
|
+
interface ChartModel {
|
|
24
|
+
readonly chart: string;
|
|
25
|
+
readonly id: string;
|
|
26
|
+
/** `deferred` while the container has no usable size (REQ-009). */
|
|
27
|
+
readonly status: 'ready' | 'deferred';
|
|
28
|
+
readonly geometry: Geometry;
|
|
29
|
+
readonly chrome: 'card' | 'bare';
|
|
30
|
+
/** Accessible name (REQ-120). */
|
|
31
|
+
readonly name: string;
|
|
32
|
+
/** Description summarising the series (REQ-120). */
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly ids: Readonly<{
|
|
35
|
+
title: string;
|
|
36
|
+
desc: string;
|
|
37
|
+
table: string;
|
|
38
|
+
}>;
|
|
39
|
+
readonly table: DataTable;
|
|
40
|
+
readonly dataTable: 'visible' | 'hidden' | 'none';
|
|
41
|
+
}
|
|
42
|
+
/** A chart: its display name and the pure function from props to model. */
|
|
43
|
+
interface ChartRecipe<P extends CommonChartProps> {
|
|
44
|
+
readonly name: string;
|
|
45
|
+
build(props: P, context: RecipeContext): ChartModel;
|
|
46
|
+
}
|
|
47
|
+
/** Imperative handle every adapter exposes, deliberately minimal (API Spec §8.1). */
|
|
48
|
+
interface ChartHandle {
|
|
49
|
+
getGeometry(): Geometry;
|
|
50
|
+
toSVGString(): string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type { ChartRecipe as C, DataTable as D, RecipeContext as R, ChartModel as a, ChartHandle as b };
|
|
@@ -85,6 +85,23 @@ interface HitArea {
|
|
|
85
85
|
column: number;
|
|
86
86
|
row: number;
|
|
87
87
|
}>;
|
|
88
|
+
/**
|
|
89
|
+
* The item's place in a hierarchy, when the chart draws one; `order` is the depth-first
|
|
90
|
+
* pre-order (REQ-438).
|
|
91
|
+
*/
|
|
92
|
+
readonly node?: Readonly<{
|
|
93
|
+
id: string;
|
|
94
|
+
parent: string | null;
|
|
95
|
+
depth: number;
|
|
96
|
+
order: number;
|
|
97
|
+
}>;
|
|
98
|
+
/**
|
|
99
|
+
* Where each navigation key moves from this item, as an index into `hitAreas`, for a chart with
|
|
100
|
+
* its own keyboard model (a tree, REQ-438). When the first item has them, the keys follow them
|
|
101
|
+
* and nothing else; a key without a move stays. Computed in the core with the layout, so a chart
|
|
102
|
+
* without such a model carries none of its code (REQ-444).
|
|
103
|
+
*/
|
|
104
|
+
readonly moves?: Readonly<Partial<Record<string, number>>>;
|
|
88
105
|
}
|
|
89
106
|
/**
|
|
90
107
|
* A hatch tile shared by every shape of one tonal level (REQ-029).
|
|
@@ -155,6 +172,35 @@ interface Inker {
|
|
|
155
172
|
ink(geometry: Geometry, options: InkOptions): Geometry;
|
|
156
173
|
}
|
|
157
174
|
|
|
175
|
+
type ToneStep = 1 | 2 | 3 | 4;
|
|
176
|
+
/**
|
|
177
|
+
* The interface components' tokens of a ground (Data Model §3.8, REQ-312). Optional: a ground
|
|
178
|
+
* without them takes the defaults, so grounds registered before `0.3.0` keep working.
|
|
179
|
+
*/
|
|
180
|
+
interface UiTokens {
|
|
181
|
+
/** `inked`: build-time pieces laid as masks (DD-022). `css`: an exact border. */
|
|
182
|
+
readonly frame: 'inked' | 'css';
|
|
183
|
+
/** Frame variants generated per kind, 1..6. */
|
|
184
|
+
readonly frameVariants: number;
|
|
185
|
+
/** Control heights in px per size, each ≥ 24 (REQ-317). */
|
|
186
|
+
readonly controlHeight: Readonly<{
|
|
187
|
+
sm: number;
|
|
188
|
+
md: number;
|
|
189
|
+
lg: number;
|
|
190
|
+
}>;
|
|
191
|
+
/** Corner radius of the exact frame (`precision`, `css`), px. */
|
|
192
|
+
readonly radius: number;
|
|
193
|
+
/** Focus indicator width, px, ≥ 2 (REQ-316). */
|
|
194
|
+
readonly focusWidth: number;
|
|
195
|
+
/** Tonal level per state (DD-026); `alertError` fills an error Alert's box (C-3). */
|
|
196
|
+
readonly tone: Readonly<{
|
|
197
|
+
selected: ToneStep;
|
|
198
|
+
primary: ToneStep;
|
|
199
|
+
danger: ToneStep;
|
|
200
|
+
disabled: ToneStep;
|
|
201
|
+
alertError: ToneStep;
|
|
202
|
+
}>;
|
|
203
|
+
}
|
|
158
204
|
/** Name of a registered ground. */
|
|
159
205
|
type GroundName = 'silverpoint' | (string & {});
|
|
160
206
|
/** Declarative token set of a style ground (API Spec §6, Art. 7). */
|
|
@@ -190,6 +236,8 @@ interface Ground {
|
|
|
190
236
|
}>;
|
|
191
237
|
/** Expansion of degenerate domains (REQ-010). */
|
|
192
238
|
readonly domainPadding: number;
|
|
239
|
+
/** Interface components' tokens (Data Model §3.8); defaults when absent. */
|
|
240
|
+
readonly ui?: UiTokens;
|
|
193
241
|
}
|
|
194
242
|
/** Name of a registered ground, or a complete ground. */
|
|
195
243
|
type GroundRef = GroundName | Ground;
|
|
@@ -198,7 +246,8 @@ type GroundRef = GroundName | Ground;
|
|
|
198
246
|
interface CommonChartProps {
|
|
199
247
|
/**
|
|
200
248
|
* Rows to draw. If omitted, the demo dataset is rendered (REQ-093): accessor props (`…Key`,
|
|
201
|
-
* `keys`, `names`) are ignored, every other
|
|
249
|
+
* `keys`, `names`, `levels`, `axis`, `dimensions`, `period`, `nodes`) are ignored, every other
|
|
250
|
+
* prop applies.
|
|
202
251
|
*/
|
|
203
252
|
data?: readonly Datum[];
|
|
204
253
|
/** Style ground. Defaults to the app provider's, or `silverpoint`. */
|
|
@@ -570,150 +619,327 @@ interface VolvelleChartProps extends CommonChartProps {
|
|
|
570
619
|
*/
|
|
571
620
|
indexValue?: string;
|
|
572
621
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
interface
|
|
590
|
-
/**
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
|
|
596
|
-
}
|
|
597
|
-
/**
|
|
598
|
-
interface
|
|
599
|
-
/**
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
622
|
+
/** Bars as columns or rows, as `BarChart` has them. */
|
|
623
|
+
type ChartOrientation = 'columns' | 'rows';
|
|
624
|
+
/** `HistogramChart` (REQ-400): raw observations binned in the core (Data Model §2.15). */
|
|
625
|
+
interface HistogramChartProps extends CommonChartProps {
|
|
626
|
+
/** Ignored without `data`. */
|
|
627
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
628
|
+
/**
|
|
629
|
+
* A number asks for that many equal-width bins over the niced extent; an array gives the
|
|
630
|
+
* thresholds, increasing. Freedman–Diaconis by default, Sturges when the IQR is 0 (REQ-432).
|
|
631
|
+
*/
|
|
632
|
+
bins?: number | readonly number[];
|
|
633
|
+
/** Turns the counts into a running total. */
|
|
634
|
+
cumulative?: boolean;
|
|
635
|
+
orientation?: ChartOrientation;
|
|
636
|
+
}
|
|
637
|
+
/** `EcdfChart` (REQ-401): the empirical cumulative distribution as a step function. */
|
|
638
|
+
interface EcdfChartProps extends CommonChartProps {
|
|
639
|
+
/** Ignored without `data`. */
|
|
640
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
641
|
+
/** Two groups at most are drawn. Ignored without `data`. */
|
|
642
|
+
groupKey?: Accessor<string | null | undefined>;
|
|
643
|
+
/** Quantiles, in 0-1, drawn as rules. */
|
|
644
|
+
markers?: readonly number[];
|
|
645
|
+
}
|
|
646
|
+
/** `BoxPlotChart` (REQ-402): quartiles, median, Tukey whiskers and outliers per group. */
|
|
647
|
+
interface BoxPlotChartProps extends CommonChartProps {
|
|
648
|
+
/** Ignored without `data`. */
|
|
649
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
650
|
+
/** Ignored without `data`. */
|
|
651
|
+
groupKey?: Accessor<string | null | undefined>;
|
|
652
|
+
/** Whisker reach as a multiple of the IQR; 1.5 by default (REQ-432). */
|
|
653
|
+
whisker?: number;
|
|
654
|
+
/** Draws the observations past the whiskers; `true` by default. */
|
|
655
|
+
outliers?: boolean;
|
|
656
|
+
orientation?: ChartOrientation;
|
|
657
|
+
}
|
|
658
|
+
/** `ViolinChart` (REQ-403): a mirrored kernel density per group, quartiles marked inside. */
|
|
659
|
+
interface ViolinChartProps extends CommonChartProps {
|
|
660
|
+
/** Ignored without `data`. */
|
|
661
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
662
|
+
/** Ignored without `data`. */
|
|
663
|
+
groupKey?: Accessor<string | null | undefined>;
|
|
664
|
+
/** Kernel bandwidth in data units, shared by every group; Silverman's rule by default. */
|
|
665
|
+
bandwidth?: number;
|
|
666
|
+
/** Marks the quartiles inside each violin; `true` by default. */
|
|
667
|
+
quartiles?: boolean;
|
|
668
|
+
orientation?: ChartOrientation;
|
|
669
|
+
}
|
|
670
|
+
/** `RidgelineChart` (REQ-404): a kernel density per group on overlapping baselines. */
|
|
671
|
+
interface RidgelineChartProps extends CommonChartProps {
|
|
672
|
+
/** Ignored without `data`. */
|
|
673
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
674
|
+
/** The group of an observation; one ridge per group. Ignored without `data`. */
|
|
675
|
+
groupKey: Accessor<string | null | undefined>;
|
|
676
|
+
/** Kernel bandwidth in data units, shared by every group; Silverman's rule by default. */
|
|
677
|
+
bandwidth?: number;
|
|
678
|
+
/** How far a ridge reaches into the one behind it, 0-1; 0.5 by default. */
|
|
679
|
+
overlap?: number;
|
|
680
|
+
}
|
|
681
|
+
/** `BeeswarmChart` (REQ-405): one point per observation, packed without overlap. */
|
|
682
|
+
interface BeeswarmChartProps extends CommonChartProps {
|
|
683
|
+
/** Ignored without `data`. */
|
|
684
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
685
|
+
/** Ignored without `data`. */
|
|
686
|
+
groupKey?: Accessor<string | null | undefined>;
|
|
687
|
+
/** Names the point in the readout and the table. Ignored without `data`. */
|
|
688
|
+
labelKey?: Accessor<string | null | undefined>;
|
|
689
|
+
/** Point radius in px; 3 by default. */
|
|
690
|
+
radius?: number;
|
|
691
|
+
}
|
|
692
|
+
/** `LollipopChart` (REQ-406): a stem from the baseline and a head at the value (Data Model §2.1). */
|
|
693
|
+
interface LollipopChartProps extends CommonChartProps {
|
|
694
|
+
/** Ignored without `data`. */
|
|
695
|
+
xKey?: Accessor<string | number>;
|
|
696
|
+
/** Ignored without `data`. */
|
|
697
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
698
|
+
orientation?: ChartOrientation;
|
|
699
|
+
/** Order of the categories; `none` keeps the data order. */
|
|
700
|
+
sort?: 'none' | 'ascending' | 'descending';
|
|
701
|
+
}
|
|
702
|
+
/** `DumbbellChart` (REQ-407): two values per category joined by a segment (Data Model §2.16). */
|
|
703
|
+
interface DumbbellChartProps extends CommonChartProps {
|
|
704
|
+
/** Ignored without `data`. */
|
|
705
|
+
labelKey?: Accessor<string>;
|
|
706
|
+
/** Ignored without `data`. */
|
|
707
|
+
startKey?: Accessor<number | null | undefined>;
|
|
708
|
+
/** Ignored without `data`. */
|
|
709
|
+
endKey?: Accessor<number | null | undefined>;
|
|
710
|
+
/** Titles of the two values; `['start', 'end']` by default. Ignored without `data`. */
|
|
711
|
+
names?: readonly [string, string];
|
|
712
|
+
/** `arrow` encodes the direction from the first value to the second. */
|
|
713
|
+
endMarker?: 'dot' | 'arrow';
|
|
714
|
+
/** `rows` by default: long category names read across. */
|
|
715
|
+
orientation?: ChartOrientation;
|
|
716
|
+
}
|
|
717
|
+
/** `SlopeChart` (REQ-408): two period axes, one segment per category (Data Model §2.16). */
|
|
718
|
+
interface SlopeChartProps extends CommonChartProps {
|
|
719
|
+
/** Ignored without `data`. */
|
|
720
|
+
labelKey?: Accessor<string>;
|
|
721
|
+
/** Ignored without `data`. */
|
|
722
|
+
startKey?: Accessor<number | null | undefined>;
|
|
723
|
+
/** Ignored without `data`. */
|
|
724
|
+
endKey?: Accessor<number | null | undefined>;
|
|
725
|
+
/** Titles of the two periods; `['start', 'end']` by default. Ignored without `data`. */
|
|
726
|
+
names?: readonly [string, string];
|
|
727
|
+
}
|
|
728
|
+
/** `BumpChart` (REQ-409): the rank of each series at each x, computed in the core (Data Model §2.17). */
|
|
729
|
+
interface BumpChartProps extends CommonChartProps {
|
|
730
|
+
/** Ignored without `data`. */
|
|
731
|
+
xKey?: Accessor<string | number>;
|
|
732
|
+
/** Ignored without `data`. */
|
|
733
|
+
seriesKey?: Accessor<string>;
|
|
734
|
+
/** Ignored without `data`. */
|
|
735
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
736
|
+
/** `descending` gives rank 1 to the highest value (the default). */
|
|
737
|
+
order?: 'descending' | 'ascending';
|
|
738
|
+
/** Series drawn, the best-ranked first; all by default. */
|
|
739
|
+
series?: number;
|
|
740
|
+
}
|
|
741
|
+
/** `ErrorBarChart` (REQ-410): a point estimate with its interval (Data Model §2.18). */
|
|
742
|
+
interface ErrorBarChartProps extends CommonChartProps {
|
|
743
|
+
/** Ignored without `data`. */
|
|
744
|
+
labelKey?: Accessor<string>;
|
|
745
|
+
/** Ignored without `data`. */
|
|
746
|
+
estimateKey?: Accessor<number | null | undefined>;
|
|
747
|
+
/** Ignored without `data`. */
|
|
748
|
+
lowKey?: Accessor<number | null | undefined>;
|
|
749
|
+
/** Ignored without `data`. */
|
|
750
|
+
highKey?: Accessor<number | null | undefined>;
|
|
751
|
+
/** A reference value drawn as a dotted rule. */
|
|
752
|
+
reference?: number;
|
|
753
|
+
/** `rows` by default, as a forest plot reads. */
|
|
754
|
+
orientation?: ChartOrientation;
|
|
656
755
|
}
|
|
657
|
-
|
|
658
|
-
|
|
756
|
+
/** `IntervalChart` (REQ-411): floating bars from start to end on lanes (Data Model §2.19). */
|
|
757
|
+
interface IntervalChartProps extends CommonChartProps {
|
|
758
|
+
/** Ignored without `data`. */
|
|
759
|
+
laneKey?: Accessor<string>;
|
|
760
|
+
/** Ignored without `data`. */
|
|
761
|
+
startKey?: Accessor<number | string | null | undefined>;
|
|
762
|
+
/** Ignored without `data`. */
|
|
763
|
+
endKey?: Accessor<number | string | null | undefined>;
|
|
764
|
+
/** Ignored without `data`. */
|
|
765
|
+
labelKey?: Accessor<string | null | undefined>;
|
|
766
|
+
/** `date` reads ISO `YYYY-MM-DD` days in UTC; `number` by default. Ignored without `data`. */
|
|
767
|
+
axis?: 'number' | 'date';
|
|
768
|
+
}
|
|
769
|
+
/** `DivergingBarChart` (REQ-412): ordered levels stacked on both sides of a neutral centre (Data Model §2.20). */
|
|
770
|
+
interface DivergingBarChartProps extends CommonChartProps {
|
|
771
|
+
/** Ignored without `data`. */
|
|
772
|
+
labelKey?: Accessor<string>;
|
|
773
|
+
/** The level columns, most negative first. Ignored without `data`. */
|
|
774
|
+
levels: readonly string[];
|
|
775
|
+
/** Index of the neutral level, split across the centre; `null` for none. The middle one by default. */
|
|
776
|
+
neutral?: number | null;
|
|
777
|
+
/** Normalises each row to 100 %; `true` by default. */
|
|
778
|
+
percent?: boolean;
|
|
779
|
+
}
|
|
780
|
+
/** `ConnectedScatterChart` (REQ-413): an ordered path through x-y points (Data Model §2.21). */
|
|
781
|
+
interface ConnectedScatterChartProps extends CommonChartProps {
|
|
782
|
+
/** Ignored without `data`. */
|
|
783
|
+
xKey?: Accessor<number | null | undefined>;
|
|
784
|
+
/** Ignored without `data`. */
|
|
785
|
+
yKey?: Accessor<number | null | undefined>;
|
|
786
|
+
/** Ignored without `data`. */
|
|
787
|
+
labelKey?: Accessor<string | null | undefined>;
|
|
788
|
+
/** Draws direction marks along the path; `true` by default. */
|
|
789
|
+
arrows?: boolean;
|
|
790
|
+
}
|
|
791
|
+
/** `WaffleChart` (REQ-414): a unit grid filled in reading order by category (Data Model §2.2). */
|
|
792
|
+
interface WaffleChartProps extends CommonChartProps {
|
|
793
|
+
/** Ignored without `data`. */
|
|
794
|
+
nameKey?: Accessor<string | number>;
|
|
795
|
+
/** Ignored without `data`. */
|
|
796
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
797
|
+
/** Cells in the grid; 100 by default. */
|
|
798
|
+
cells?: number;
|
|
799
|
+
/** Cells per row; 10 by default. */
|
|
800
|
+
columns?: number;
|
|
801
|
+
}
|
|
802
|
+
/** `MarimekkoChart` (REQ-415): column width ∝ total, segment height ∝ share (Data Model §2.22). */
|
|
803
|
+
interface MarimekkoChartProps extends CommonChartProps {
|
|
804
|
+
/** Ignored without `data`. */
|
|
805
|
+
columnKey?: Accessor<string>;
|
|
806
|
+
/** Ignored without `data`. */
|
|
807
|
+
segmentKey?: Accessor<string>;
|
|
808
|
+
/** Ignored without `data`. */
|
|
809
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
810
|
+
}
|
|
811
|
+
/** Props shared by the hierarchy charts (Data Model §2.23). */
|
|
812
|
+
interface HierarchyChartProps extends CommonChartProps {
|
|
813
|
+
/** Ignored without `data`. */
|
|
814
|
+
idKey?: Accessor<string>;
|
|
815
|
+
/** `null` for the root. Ignored without `data`. */
|
|
816
|
+
parentKey?: Accessor<string | null | undefined>;
|
|
817
|
+
/** Ignored without `data`. */
|
|
818
|
+
labelKey?: Accessor<string | null | undefined>;
|
|
819
|
+
}
|
|
820
|
+
/** `SquarifiedTreemap` (REQ-416): a hierarchy laid out by the squarified algorithm. */
|
|
821
|
+
interface SquarifiedTreemapProps extends HierarchyChartProps {
|
|
822
|
+
/** Read on leaves; an internal node is the sum of its children. Ignored without `data`. */
|
|
823
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
824
|
+
/** Levels drawn below the root; all by default. */
|
|
825
|
+
depth?: number;
|
|
826
|
+
/** The node drawn as root, controlled (REQ-439); the data root by default. */
|
|
827
|
+
rootId?: string | null;
|
|
828
|
+
}
|
|
829
|
+
/** `SunburstChart` (REQ-417): a hierarchy as concentric rings of arcs. */
|
|
830
|
+
interface SunburstChartProps extends HierarchyChartProps {
|
|
831
|
+
/** Read on leaves; an internal node is the sum of its children. Ignored without `data`. */
|
|
832
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
833
|
+
/** Rings drawn below the root; all by default. */
|
|
834
|
+
depth?: number;
|
|
835
|
+
/** The node drawn as root, controlled (REQ-439); the data root by default. */
|
|
836
|
+
rootId?: string | null;
|
|
837
|
+
}
|
|
838
|
+
/** `TreeChart` (REQ-418): a tidy node-link tree. */
|
|
839
|
+
interface TreeChartProps extends HierarchyChartProps {
|
|
840
|
+
/** Ignored without `data`. */
|
|
841
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
842
|
+
orientation?: 'horizontal' | 'vertical';
|
|
843
|
+
}
|
|
844
|
+
/** `ParallelCoordinatesChart` (REQ-419): one axis per dimension, one polyline per row (Data Model §2.20). */
|
|
845
|
+
interface ParallelCoordinatesChartProps extends CommonChartProps {
|
|
846
|
+
/** Ignored without `data`. */
|
|
847
|
+
labelKey?: Accessor<string | null | undefined>;
|
|
848
|
+
/** The dimension columns, in axis order. Ignored without `data`. */
|
|
849
|
+
dimensions: readonly string[];
|
|
850
|
+
/** Axis domains by dimension; derived from the data when omitted (REQ-097). */
|
|
851
|
+
domains?: Readonly<Record<string, readonly [number, number]>>;
|
|
852
|
+
}
|
|
853
|
+
/** `PolarLineChart` (REQ-420): a line over angle × radius (Data Model §2.21). */
|
|
854
|
+
interface PolarLineChartProps extends CommonChartProps {
|
|
855
|
+
/** In the units of `period`. Ignored without `data`. */
|
|
856
|
+
angleKey?: Accessor<number | null | undefined>;
|
|
857
|
+
/** The radius, `≥ 0`. Ignored without `data`. */
|
|
858
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
859
|
+
/** One turn, in the units of the angle; when set, the line closes. Ignored without `data`. */
|
|
860
|
+
period?: number;
|
|
861
|
+
/** Where the angle 0 sits, in degrees clockwise from 12 o'clock; 0 by default. */
|
|
862
|
+
startAngle?: number;
|
|
863
|
+
}
|
|
864
|
+
/** `PolarScatterChart` (REQ-421): points over angle × radius (Data Model §2.21). */
|
|
865
|
+
interface PolarScatterChartProps extends CommonChartProps {
|
|
866
|
+
/** In the units of `period`. Ignored without `data`. */
|
|
867
|
+
angleKey?: Accessor<number | null | undefined>;
|
|
868
|
+
/** The radius, `≥ 0`. Ignored without `data`. */
|
|
869
|
+
radiusKey?: Accessor<number | null | undefined>;
|
|
870
|
+
/** Ignored without `data`. */
|
|
871
|
+
sizeKey?: Accessor<number | null | undefined>;
|
|
872
|
+
/** One turn, in the units of the angle; 360 by default. Ignored without `data`. */
|
|
873
|
+
period?: number;
|
|
874
|
+
}
|
|
875
|
+
/** `DensityBinChart` (REQ-422): x-y points binned in two dimensions (Data Model §2.24). */
|
|
876
|
+
interface DensityBinChartProps extends CommonChartProps {
|
|
877
|
+
/** Ignored without `data`. */
|
|
878
|
+
xKey?: Accessor<number | null | undefined>;
|
|
879
|
+
/** Ignored without `data`. */
|
|
880
|
+
yKey?: Accessor<number | null | undefined>;
|
|
881
|
+
binShape?: 'hexagon' | 'rect';
|
|
882
|
+
/** Bin size in px; 14 by default. */
|
|
883
|
+
binSize?: number;
|
|
884
|
+
}
|
|
885
|
+
/** `ContourChart` (REQ-423): iso-lines and filled bands of a density or a grid (Data Model §2.24). */
|
|
886
|
+
interface ContourChartProps extends CommonChartProps {
|
|
887
|
+
/** `points` estimates a density from a point cloud; `grid` reads a regular grid of values. */
|
|
888
|
+
source?: 'points' | 'grid';
|
|
889
|
+
/** Ignored without `data`. */
|
|
890
|
+
xKey?: Accessor<number | null | undefined>;
|
|
891
|
+
/** Ignored without `data`. */
|
|
892
|
+
yKey?: Accessor<number | null | undefined>;
|
|
893
|
+
/** The grid value (`source: 'grid'`). Ignored without `data`. */
|
|
894
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
895
|
+
/** A count of levels, or the thresholds, increasing: in the grid's values, or as shares of the density's peak. Ignored without `data`. */
|
|
896
|
+
levels?: number | readonly number[];
|
|
897
|
+
/** Fills the bands between levels; `true` by default. */
|
|
898
|
+
filled?: boolean;
|
|
899
|
+
}
|
|
900
|
+
/** `DelaunayChart` (REQ-424): the triangulation of x-y points, or its Voronoi cells (Data Model §2.24). */
|
|
901
|
+
interface DelaunayChartProps extends CommonChartProps {
|
|
902
|
+
/** Ignored without `data`. */
|
|
903
|
+
xKey?: Accessor<number | null | undefined>;
|
|
904
|
+
/** Ignored without `data`. */
|
|
905
|
+
yKey?: Accessor<number | null | undefined>;
|
|
906
|
+
/** Ignored without `data`. */
|
|
907
|
+
labelKey?: Accessor<string | null | undefined>;
|
|
908
|
+
mesh?: 'delaunay' | 'voronoi';
|
|
909
|
+
}
|
|
910
|
+
/** `VectorFieldChart` (REQ-425): an arrow per grid point (Data Model §2.24). */
|
|
911
|
+
interface VectorFieldChartProps extends CommonChartProps {
|
|
912
|
+
/** Ignored without `data`. */
|
|
913
|
+
xKey?: Accessor<number | null | undefined>;
|
|
914
|
+
/** Ignored without `data`. */
|
|
915
|
+
yKey?: Accessor<number | null | undefined>;
|
|
916
|
+
/** Ignored without `data`. */
|
|
917
|
+
uKey?: Accessor<number | null | undefined>;
|
|
918
|
+
/** Ignored without `data`. */
|
|
919
|
+
vKey?: Accessor<number | null | undefined>;
|
|
920
|
+
/** Arrow length per unit of magnitude; fitted to the grid by default. */
|
|
921
|
+
scale?: number;
|
|
922
|
+
}
|
|
923
|
+
/** A node of a `NetworkChart`; with finite `x` and `y` on every node, no layout runs (REQ-436). */
|
|
924
|
+
interface NetworkNode {
|
|
659
925
|
readonly id: string;
|
|
660
|
-
|
|
661
|
-
readonly
|
|
662
|
-
|
|
663
|
-
readonly
|
|
664
|
-
readonly span: ResolvedSpan;
|
|
665
|
-
/** Outer box at `ssrWidth`, 2 decimals (REQ-002, REQ-206). */
|
|
666
|
-
readonly nominal: {
|
|
667
|
-
readonly width: number;
|
|
668
|
-
readonly height: number;
|
|
669
|
-
};
|
|
670
|
-
/** The cell's CSS custom properties, e.g. `--sp-cell-col-lg: 2`. */
|
|
671
|
-
readonly style: Readonly<Record<string, string>>;
|
|
926
|
+
readonly label?: string;
|
|
927
|
+
readonly group?: string;
|
|
928
|
+
readonly x?: number;
|
|
929
|
+
readonly y?: number;
|
|
672
930
|
}
|
|
673
|
-
/**
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
|
|
685
|
-
}
|
|
686
|
-
/** Everything an adapter writes for a dashboard: attributes, texts and cells, all from the core (Art. 2). */
|
|
687
|
-
interface DashboardView {
|
|
688
|
-
readonly model: DashboardModel;
|
|
689
|
-
readonly section: {
|
|
690
|
-
readonly className: string;
|
|
691
|
-
readonly substrate: SubstrateName;
|
|
692
|
-
/** The heading's id, when there is a title. */
|
|
693
|
-
readonly labelledby?: string;
|
|
694
|
-
readonly describedby?: string;
|
|
695
|
-
/** `aria-label`, when only `label` names the dashboard. */
|
|
696
|
-
readonly label?: string;
|
|
697
|
-
readonly style: Readonly<Record<string, string>>;
|
|
698
|
-
};
|
|
699
|
-
readonly heading?: {
|
|
700
|
-
readonly level: 2 | 3 | 4 | 5 | 6;
|
|
701
|
-
readonly id: string;
|
|
702
|
-
readonly text: string;
|
|
703
|
-
};
|
|
704
|
-
readonly description?: {
|
|
705
|
-
readonly id: string;
|
|
706
|
-
readonly text: string;
|
|
707
|
-
};
|
|
708
|
-
/** In reading order. */
|
|
709
|
-
readonly cells: readonly {
|
|
710
|
-
/** Index of the child this cell holds. */
|
|
711
|
-
readonly child: number;
|
|
712
|
-
/** The chart's title id: `aria-labelledby` of the `article` (REQ-214). */
|
|
713
|
-
readonly labelledby: string;
|
|
714
|
-
readonly style: Readonly<Record<string, string>>;
|
|
715
|
-
readonly context: DashboardCellContext;
|
|
716
|
-
}[];
|
|
931
|
+
/** `NetworkChart` (REQ-426): a node-link graph laid out deterministically (Data Model §2.7, §2.24). */
|
|
932
|
+
interface NetworkChartProps extends CommonChartProps {
|
|
933
|
+
/** Ignored without `data`. */
|
|
934
|
+
sourceKey?: Accessor<string>;
|
|
935
|
+
/** Ignored without `data`. */
|
|
936
|
+
targetKey?: Accessor<string>;
|
|
937
|
+
/** 1 by default. Ignored without `data`. */
|
|
938
|
+
valueKey?: Accessor<number | null | undefined>;
|
|
939
|
+
/** The nodes, as data; the distinct ends of the links by default. Ignored without `data`. */
|
|
940
|
+
nodes?: readonly NetworkNode[];
|
|
941
|
+
/** Layout iterations; 300 by default. */
|
|
942
|
+
iterations?: number;
|
|
717
943
|
}
|
|
718
944
|
|
|
719
|
-
export type {
|
|
945
|
+
export type { ComposedChartProps as $, ActiveItem as A, BoxPlotChartProps as B, ConnectedScatterChartProps as C, DumbbellChartProps as D, EcdfChartProps as E, PyramidChartProps as F, Geometry as G, HistogramChartProps as H, IntervalChartProps as I, HeatmapChartProps as J, TreemapChartProps as K, LollipopChartProps as L, MarimekkoChartProps as M, NetworkChartProps as N, SankeyChartProps as O, ParallelCoordinatesChartProps as P, ActivityGridProps as Q, RidgelineChartProps as R, SlopeChartProps as S, TreeChartProps as T, StepChartProps as U, ViolinChartProps as V, WaffleChartProps as W, SparklineRowsProps as X, KpiCardProps as Y, BarChartProps as Z, StackedBarChartProps as _, BeeswarmChartProps as a, WaterfallChartProps as a0, FunnelChartProps as a1, DonutChartProps as a2, RadarChartProps as a3, PolarBarChartProps as a4, CoxcombChartProps as a5, RadialArcGroupProps as a6, RadialRingsProps as a7, GaugeArcProps as a8, MeterChartProps as a9, UiTokens as aA, WeightToneSpec as aB, WindRoseProps as aa, ChordRingProps as ab, OrbitChartProps as ac, VolvelleChartProps as ad, CandlestickChartProps as ae, AreaChartProps as af, RangeBandChartProps as ag, StreamChartProps as ah, ScatterChartProps as ai, BubbleChartProps as aj, Accessor as ak, ChartOrientation as al, Ground as am, GroundName as an, HatchToneSpec as ao, HitArea as ap, InkOptions as aq, LabelKind as ar, LineCurve as as, NetworkNode as at, StrokePart as au, StrokeRole as av, Tile as aw, TonalRamp as ax, ToneLevel as ay, ToneSpec as az, BumpChartProps as b, ErrorBarChartProps as c, DivergingBarChartProps as d, SquarifiedTreemapProps as e, SunburstChartProps as f, PolarLineChartProps as g, PolarScatterChartProps as h, DensityBinChartProps as i, ContourChartProps as j, DelaunayChartProps as k, VectorFieldChartProps as l, CommonChartProps as m, Seed as n, Stroke as o, StrokePaint as p, InkMode as q, TextLabel as r, Inker as s, GroundRef as t, SubstrateName as u, ProviderConfig as v, LineChartProps as w, Datum as x, Rect as y, BulletChartProps as z };
|