@skdx/angular-charts 0.33.0 → 0.34.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 +96 -41
- package/fesm2022/skdx-angular-charts-area.mjs +14 -2
- package/fesm2022/skdx-angular-charts-area.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-bar.mjs +18 -15
- package/fesm2022/skdx-angular-charts-bar.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-boxplot.mjs +18 -6
- package/fesm2022/skdx-angular-charts-boxplot.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-candlestick.mjs +41 -8
- package/fesm2022/skdx-angular-charts-candlestick.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-chord.mjs +18 -6
- package/fesm2022/skdx-angular-charts-chord.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-funnel.mjs +29 -8
- package/fesm2022/skdx-angular-charts-funnel.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-gantt.mjs +23 -11
- package/fesm2022/skdx-angular-charts-gantt.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-heatmap.mjs +53 -15
- package/fesm2022/skdx-angular-charts-heatmap.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-internal.mjs +2709 -494
- package/fesm2022/skdx-angular-charts-internal.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-line.mjs +14 -2
- package/fesm2022/skdx-angular-charts-line.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-map.mjs +35 -8
- package/fesm2022/skdx-angular-charts-map.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-pie.mjs +37 -5
- package/fesm2022/skdx-angular-charts-pie.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-radar.mjs +35 -8
- package/fesm2022/skdx-angular-charts-radar.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-radial.mjs +108 -0
- package/fesm2022/skdx-angular-charts-radial.mjs.map +1 -0
- package/fesm2022/skdx-angular-charts-sankey.mjs +18 -6
- package/fesm2022/skdx-angular-charts-sankey.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-scatter.mjs +37 -5
- package/fesm2022/skdx-angular-charts-scatter.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-sparkline.mjs +42 -8
- package/fesm2022/skdx-angular-charts-sparkline.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-sunburst.mjs +18 -6
- package/fesm2022/skdx-angular-charts-sunburst.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-treemap.mjs +26 -6
- package/fesm2022/skdx-angular-charts-treemap.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts-waterfall.mjs +18 -6
- package/fesm2022/skdx-angular-charts-waterfall.mjs.map +1 -1
- package/fesm2022/skdx-angular-charts.mjs +2 -0
- package/fesm2022/skdx-angular-charts.mjs.map +1 -1
- package/package.json +7 -3
- package/types/skdx-angular-charts-area.d.ts +1 -1
- package/types/skdx-angular-charts-bar.d.ts +5 -13
- package/types/skdx-angular-charts-boxplot.d.ts +2 -2
- package/types/skdx-angular-charts-candlestick.d.ts +10 -4
- package/types/skdx-angular-charts-chord.d.ts +2 -2
- package/types/skdx-angular-charts-funnel.d.ts +5 -3
- package/types/skdx-angular-charts-gantt.d.ts +6 -6
- package/types/skdx-angular-charts-heatmap.d.ts +16 -8
- package/types/skdx-angular-charts-internal.d.ts +581 -44
- package/types/skdx-angular-charts-line.d.ts +1 -1
- package/types/skdx-angular-charts-map.d.ts +4 -3
- package/types/skdx-angular-charts-pie.d.ts +10 -2
- package/types/skdx-angular-charts-radar.d.ts +8 -3
- package/types/skdx-angular-charts-radial.d.ts +34 -0
- package/types/skdx-angular-charts-sankey.d.ts +2 -2
- package/types/skdx-angular-charts-scatter.d.ts +10 -3
- package/types/skdx-angular-charts-sparkline.d.ts +13 -5
- package/types/skdx-angular-charts-sunburst.d.ts +2 -2
- package/types/skdx-angular-charts-treemap.d.ts +4 -4
- package/types/skdx-angular-charts-waterfall.d.ts +2 -2
- package/types/skdx-angular-charts.d.ts +2 -1
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
|
|
3
|
+
/** A plotted value; `null` (or `NaN`) is a gap. */
|
|
4
|
+
type Value = number | null;
|
|
3
5
|
/** One plotted series: a name for the legend/title and a value per category. */
|
|
4
6
|
interface Series {
|
|
5
7
|
name: string;
|
|
6
|
-
data:
|
|
8
|
+
data: Value[];
|
|
7
9
|
/** Any CSS color; defaults to the next `@skdx/tokens` series color. */
|
|
8
10
|
color?: string | undefined;
|
|
9
11
|
}
|
|
10
|
-
/** One named value, for the part-of-whole charts (pie, funnel). */
|
|
12
|
+
/** One named value, for the part-of-whole charts (pie, funnel, radial bar). */
|
|
11
13
|
interface Datum {
|
|
12
14
|
name: string;
|
|
13
15
|
value: number;
|
|
14
16
|
color?: string | undefined;
|
|
15
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* How values are written: a function, or a named `Intl` style. `percent` expects fractions
|
|
20
|
+
* (0.25 → 25%), `duration` expects seconds, the date styles expect epoch milliseconds.
|
|
21
|
+
*/
|
|
22
|
+
type Format = ((value: number) => string) | {
|
|
23
|
+
style: 'integer' | 'decimal' | 'percent' | 'currency' | 'compact' | 'scientific' | 'date' | 'time' | 'datetime' | 'duration';
|
|
24
|
+
/** BCP-47 locale; defaults to the runtime locale. */
|
|
25
|
+
locale?: string | undefined;
|
|
26
|
+
/** ISO 4217 code for `currency`. @default 'USD' */
|
|
27
|
+
currency?: string | undefined;
|
|
28
|
+
/** Fraction digits for the number styles. */
|
|
29
|
+
digits?: number | undefined;
|
|
30
|
+
/** Suffix written after the number, e.g. ` ms`. */
|
|
31
|
+
unit?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
/** Semantic color of a reference line or band. */
|
|
34
|
+
type Variant = 'neutral' | 'primary' | 'success' | 'warning' | 'danger';
|
|
16
35
|
interface Sized {
|
|
17
36
|
/** @default 600 (300 for the round charts, 120 for sparklines) */
|
|
18
37
|
width?: number | undefined;
|
|
@@ -22,43 +41,185 @@ interface Sized {
|
|
|
22
41
|
legend?: boolean | undefined;
|
|
23
42
|
/** Show a hover tooltip for the mark under the pointer. @default true */
|
|
24
43
|
tooltip?: boolean | undefined;
|
|
44
|
+
/** How values are written in ticks, labels and tooltips. @default the runtime locale's number format */
|
|
45
|
+
format?: Format | undefined;
|
|
46
|
+
/** Categorical series colors, cycled by series index. @default the `@skdx/tokens` scales */
|
|
47
|
+
palette?: string[] | undefined;
|
|
48
|
+
/** Series (by name) left out of the plot; their legend entries stay, dimmed. */
|
|
49
|
+
hiddenSeries?: string[] | undefined;
|
|
50
|
+
/** Draw a loading placeholder instead of the chart. @default false */
|
|
51
|
+
loading?: boolean | undefined;
|
|
52
|
+
/** Draw this message instead of the chart. */
|
|
53
|
+
error?: string | undefined;
|
|
54
|
+
/** Written in place of an empty chart. @default 'No data available' */
|
|
55
|
+
emptyMessage?: string | undefined;
|
|
56
|
+
/** Longer accessible description, rendered as the svg `<desc>`. */
|
|
57
|
+
description?: string | undefined;
|
|
58
|
+
/** Hide the chart from assistive technology, for charts that repeat adjacent text. @default false */
|
|
59
|
+
decorative?: boolean | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Fade marks in on mount and transition them on data changes; `true` is 300 ms, a number sets
|
|
62
|
+
* the duration. Off under `prefers-reduced-motion` and above 1500 shapes. @default false
|
|
63
|
+
*/
|
|
64
|
+
animate?: boolean | number | undefined;
|
|
65
|
+
/** Measure the container and lay the chart out at that width, so text keeps its size. @default false */
|
|
66
|
+
responsive?: boolean | undefined;
|
|
67
|
+
}
|
|
68
|
+
type Curve = 'linear' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter';
|
|
69
|
+
/** A horizontal or vertical line, or a shaded band, drawn behind the marks in data coordinates. */
|
|
70
|
+
type Reference = {
|
|
71
|
+
label?: string | undefined;
|
|
72
|
+
/** @default 'neutral' */
|
|
73
|
+
variant?: Variant | undefined;
|
|
74
|
+
} & ({
|
|
75
|
+
y: number;
|
|
76
|
+
axis?: 'left' | 'right' | undefined;
|
|
77
|
+
} | {
|
|
78
|
+
x: number | string | Date;
|
|
79
|
+
} | {
|
|
80
|
+
y1: number;
|
|
81
|
+
y2: number;
|
|
82
|
+
axis?: 'left' | 'right' | undefined;
|
|
83
|
+
} | {
|
|
84
|
+
x1: number | string | Date;
|
|
85
|
+
x2: number | string | Date;
|
|
86
|
+
});
|
|
87
|
+
interface AxisOptions {
|
|
88
|
+
min?: number | undefined;
|
|
89
|
+
max?: number | undefined;
|
|
90
|
+
/** @default 'linear' */
|
|
91
|
+
scale?: 'linear' | 'log' | undefined;
|
|
92
|
+
/** Overrides the chart-level `format` for this axis. */
|
|
93
|
+
format?: Format | undefined;
|
|
94
|
+
/** Axis title. */
|
|
95
|
+
label?: string | undefined;
|
|
96
|
+
}
|
|
97
|
+
interface XAxisOptions extends Pick<AxisOptions, 'format' | 'label'> {
|
|
98
|
+
/**
|
|
99
|
+
* `category` spaces points evenly; `time` and `linear` place numeric or date categories
|
|
100
|
+
* proportionally, so irregular timestamps land where they belong. @default 'category'
|
|
101
|
+
*/
|
|
102
|
+
type?: 'category' | 'time' | 'linear' | undefined;
|
|
103
|
+
}
|
|
104
|
+
/** A visible window over the categories: indexes `[start, end)`. */
|
|
105
|
+
interface Zoom {
|
|
106
|
+
start: number;
|
|
107
|
+
end: number;
|
|
25
108
|
}
|
|
26
|
-
|
|
27
|
-
interface
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
109
|
+
/** A bar, line or area series inside a cartesian chart. */
|
|
110
|
+
interface CartesianSeries extends Series {
|
|
111
|
+
/** Defaults to the chart's own type: bars in a BarChart, lines in a LineChart, areas in an AreaChart. */
|
|
112
|
+
type?: 'bar' | 'line' | 'area' | undefined;
|
|
113
|
+
/** Which y axis the values are measured on. @default 'left' */
|
|
114
|
+
axis?: 'left' | 'right' | undefined;
|
|
115
|
+
/** Overrides the chart-level curve for this line or area. */
|
|
116
|
+
curve?: Curve | undefined;
|
|
117
|
+
/** SVG dash pattern, e.g. `'4 3'`, for a line or area outline. */
|
|
118
|
+
dash?: string | undefined;
|
|
119
|
+
/** Dots on line and area points. @default true up to 100 points, then off */
|
|
120
|
+
markers?: boolean | undefined;
|
|
121
|
+
/** Stack with the other series that share the same group; `true` is the default group. */
|
|
122
|
+
stack?: boolean | string | undefined;
|
|
123
|
+
}
|
|
124
|
+
/** A shaded band between two series of values, e.g. a forecast interval. */
|
|
125
|
+
interface RangeSeries {
|
|
126
|
+
type: 'range';
|
|
127
|
+
name: string;
|
|
128
|
+
low: Value[];
|
|
129
|
+
high: Value[];
|
|
130
|
+
color?: string | undefined;
|
|
131
|
+
axis?: 'left' | 'right' | undefined;
|
|
38
132
|
curve?: Curve | undefined;
|
|
39
133
|
}
|
|
40
|
-
type
|
|
134
|
+
type Category = string | number | Date;
|
|
135
|
+
interface ChartInput extends Sized {
|
|
136
|
+
series: (CartesianSeries | RangeSeries)[];
|
|
137
|
+
/** X-axis labels; defaults to the 1-based index of each point. Numbers and dates are written with `xAxis.format`. */
|
|
138
|
+
categories?: Category[] | undefined;
|
|
139
|
+
xAxis?: XAxisOptions | undefined;
|
|
140
|
+
yAxis?: AxisOptions | undefined;
|
|
141
|
+
/** Enables the second y axis on the right; series opt in with `axis: 'right'`. */
|
|
142
|
+
rightAxis?: AxisOptions | undefined;
|
|
143
|
+
references?: Reference[] | undefined;
|
|
144
|
+
/** Write each value next to its mark. @default false */
|
|
145
|
+
labels?: boolean | undefined;
|
|
146
|
+
/** Straight segments, a monotone cubic, or steps, for the line and area series. @default 'linear' */
|
|
147
|
+
curve?: Curve | undefined;
|
|
148
|
+
/** Draw lines across gaps instead of breaking them. @default false */
|
|
149
|
+
connectNulls?: boolean | undefined;
|
|
150
|
+
/** Stack the series instead of grouping them; `'percent'` normalizes each category to 100%. @default false */
|
|
151
|
+
stacked?: boolean | 'percent' | undefined;
|
|
152
|
+
/** Bars grow along x, categories run down the y axis. Line and area series are ignored. @default 'vertical' */
|
|
153
|
+
orientation?: 'vertical' | 'horizontal' | undefined;
|
|
154
|
+
/** Corner radius of bars, in pixels. @default 0 */
|
|
155
|
+
radius?: number | undefined;
|
|
156
|
+
/** Order categories by the first series' value. */
|
|
157
|
+
sort?: 'asc' | 'desc' | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* `histogram`: each series' data is a raw sample, binned into equal-width bars.
|
|
160
|
+
* `cumulative`: each series is replaced by its running total.
|
|
161
|
+
*/
|
|
162
|
+
transform?: 'histogram' | 'cumulative' | undefined;
|
|
163
|
+
/** Histogram bin count. @default Sturges' rule */
|
|
164
|
+
bins?: number | undefined;
|
|
165
|
+
/** Histogram bin width; wins over `bins`. */
|
|
166
|
+
binWidth?: number | undefined;
|
|
167
|
+
/** Histogram domain; samples outside are dropped. @default the sample extent */
|
|
168
|
+
binDomain?: [number, number] | undefined;
|
|
169
|
+
/** What histogram bars measure. @default 'count' */
|
|
170
|
+
binMode?: 'count' | 'density' | 'cumulative' | undefined;
|
|
171
|
+
/** Visible category window, for zooming. */
|
|
172
|
+
zoom?: Zoom | undefined;
|
|
173
|
+
/** Draw a range strip under the plot showing the whole series and the zoomed window. @default false */
|
|
174
|
+
brush?: boolean | undefined;
|
|
175
|
+
/** Snap the hover tooltip to the nearest category and list every series' value there. @default false */
|
|
176
|
+
crosshair?: boolean | undefined;
|
|
177
|
+
}
|
|
178
|
+
type BarChartInput = ChartInput;
|
|
179
|
+
type LineChartInput = ChartInput;
|
|
180
|
+
type AreaChartInput = ChartInput;
|
|
41
181
|
interface PieChartInput extends Sized {
|
|
42
182
|
data: Datum[];
|
|
43
183
|
/** Hole radius as a fraction of the outer radius: 0 is a pie, 0.6 a donut. @default 0 */
|
|
44
184
|
innerRadius?: number | undefined;
|
|
45
185
|
/** Write each slice's name and share on the slice. @default false */
|
|
46
186
|
labels?: boolean | undefined;
|
|
187
|
+
/** Degrees clockwise from 12 o'clock where the first slice starts. @default 0 */
|
|
188
|
+
startAngle?: number | undefined;
|
|
189
|
+
/** Degrees clockwise from 12 o'clock where the last slice ends; `-90`/`90` makes a half circle. @default startAngle + 360 */
|
|
190
|
+
endAngle?: number | undefined;
|
|
191
|
+
/** Text in the middle of a donut, e.g. the total. */
|
|
192
|
+
centerLabel?: string | undefined;
|
|
47
193
|
}
|
|
48
194
|
interface ScatterSeries {
|
|
49
195
|
name: string;
|
|
50
|
-
/** `[x, y]` pairs. */
|
|
51
|
-
data: [number, number][];
|
|
196
|
+
/** `[x, y]` pairs, or `[x, y, size]` triples for bubbles. */
|
|
197
|
+
data: ([number, number] | [number, number, number])[];
|
|
52
198
|
color?: string | undefined;
|
|
53
199
|
}
|
|
54
200
|
interface ScatterChartInput extends Sized {
|
|
55
201
|
series: ScatterSeries[];
|
|
202
|
+
/** Bubble radius range in pixels, for `[x, y, size]` data. @default [3, 18] */
|
|
203
|
+
sizeRange?: [number, number] | undefined;
|
|
204
|
+
/** Least-squares line per series. @default false */
|
|
205
|
+
trendline?: boolean | undefined;
|
|
206
|
+
xAxis?: AxisOptions | undefined;
|
|
207
|
+
yAxis?: AxisOptions | undefined;
|
|
208
|
+
references?: Reference[] | undefined;
|
|
56
209
|
}
|
|
57
210
|
interface SparklineInput extends Sized {
|
|
58
|
-
data:
|
|
211
|
+
data: Value[];
|
|
59
212
|
color?: string | undefined;
|
|
60
213
|
/** @default 'linear' */
|
|
61
214
|
curve?: Curve | undefined;
|
|
215
|
+
/** @default 'area' */
|
|
216
|
+
variant?: 'area' | 'line' | 'bar' | undefined;
|
|
217
|
+
/** Color by direction: success when the last value is above the first, danger below. @default false */
|
|
218
|
+
trend?: boolean | undefined;
|
|
219
|
+
/** Mark the minimum and maximum. @default false */
|
|
220
|
+
extremes?: boolean | undefined;
|
|
221
|
+
/** Write the last value after the line. @default false */
|
|
222
|
+
lastValue?: boolean | undefined;
|
|
62
223
|
}
|
|
63
224
|
interface RadarChartInput extends Sized {
|
|
64
225
|
series: Series[];
|
|
@@ -66,21 +227,40 @@ interface RadarChartInput extends Sized {
|
|
|
66
227
|
categories: string[];
|
|
67
228
|
/** Scale every series to its own maximum, so rings read as percentages. @default false */
|
|
68
229
|
normalize?: boolean | undefined;
|
|
230
|
+
/** Outer ring value. @default the largest value, rounded up */
|
|
231
|
+
max?: number | undefined;
|
|
232
|
+
/** Fill the polygons. @default true */
|
|
233
|
+
fill?: boolean | undefined;
|
|
69
234
|
}
|
|
235
|
+
interface CalendarCell {
|
|
236
|
+
date: string | number | Date;
|
|
237
|
+
value: number;
|
|
238
|
+
}
|
|
239
|
+
/** A matrix (`rows`, `columns`, `data`) or a calendar (`calendar`); one of the two must be given. */
|
|
70
240
|
interface HeatmapInput extends Sized {
|
|
71
|
-
rows
|
|
72
|
-
columns
|
|
73
|
-
/** `data[row][column]
|
|
74
|
-
data
|
|
241
|
+
rows?: string[] | undefined;
|
|
242
|
+
columns?: string[] | undefined;
|
|
243
|
+
/** `data[row][column]`; `null` cells are left blank. */
|
|
244
|
+
data?: Value[][] | undefined;
|
|
245
|
+
/** One value per day; laid out as weekday rows and week columns, labelled by month. */
|
|
246
|
+
calendar?: CalendarCell[] | undefined;
|
|
75
247
|
/** The cell color; each cell's opacity follows its value. */
|
|
76
248
|
color?: string | undefined;
|
|
77
249
|
/** Split around zero: values below use `negativeColor`, opacity follows the distance from zero. @default false */
|
|
78
250
|
diverging?: boolean | undefined;
|
|
79
251
|
/** @default the tokens danger color */
|
|
80
252
|
negativeColor?: string | undefined;
|
|
253
|
+
/** Write each value in its cell. @default false */
|
|
254
|
+
labels?: boolean | undefined;
|
|
255
|
+
/** Value range the opacity ramp covers. @default the data extent */
|
|
256
|
+
domain?: [number, number] | undefined;
|
|
81
257
|
}
|
|
82
258
|
interface FunnelChartInput extends Sized {
|
|
83
259
|
data: Datum[];
|
|
260
|
+
/** @default 'vertical' */
|
|
261
|
+
orientation?: 'vertical' | 'horizontal' | undefined;
|
|
262
|
+
/** `pyramid` widens toward the end and reports shares of the total instead of conversion. @default 'funnel' */
|
|
263
|
+
variant?: 'funnel' | 'pyramid' | undefined;
|
|
84
264
|
}
|
|
85
265
|
interface Tick {
|
|
86
266
|
/** Pixel position along the axis. */
|
|
@@ -115,16 +295,25 @@ interface TreemapInput extends Sized {
|
|
|
115
295
|
data: TreeNode[];
|
|
116
296
|
}
|
|
117
297
|
interface Candle {
|
|
118
|
-
label:
|
|
298
|
+
label: Category;
|
|
119
299
|
open: number;
|
|
120
300
|
high: number;
|
|
121
301
|
low: number;
|
|
122
302
|
close: number;
|
|
303
|
+
/** Drawn as a bar in a pane under the candles when any candle has one. */
|
|
304
|
+
volume?: number | undefined;
|
|
123
305
|
}
|
|
124
306
|
interface CandlestickInput extends Sized {
|
|
125
307
|
data: Candle[];
|
|
126
308
|
/** @default 'linear' */
|
|
127
309
|
scale?: 'linear' | 'log' | undefined;
|
|
310
|
+
/** Bars with open/close ticks instead of filled candles. @default 'candlestick' */
|
|
311
|
+
variant?: 'candlestick' | 'ohlc' | undefined;
|
|
312
|
+
xAxis?: Pick<AxisOptions, 'format'> | undefined;
|
|
313
|
+
references?: Reference[] | undefined;
|
|
314
|
+
zoom?: Zoom | undefined;
|
|
315
|
+
brush?: boolean | undefined;
|
|
316
|
+
crosshair?: boolean | undefined;
|
|
128
317
|
}
|
|
129
318
|
interface WaterfallInput extends Sized {
|
|
130
319
|
/** Signed deltas, applied in order. */
|
|
@@ -137,11 +326,13 @@ interface GanttTask {
|
|
|
137
326
|
start: number;
|
|
138
327
|
end: number;
|
|
139
328
|
color?: string | undefined;
|
|
329
|
+
/** Tasks sharing a group share a row, so one row can hold several intervals. */
|
|
330
|
+
group?: string | undefined;
|
|
140
331
|
}
|
|
141
332
|
interface GanttInput extends Sized {
|
|
142
333
|
tasks: GanttTask[];
|
|
143
|
-
/**
|
|
144
|
-
|
|
334
|
+
/** Vertical lines and bands in time coordinates, e.g. `{ x: Date.now(), label: 'Today' }`. */
|
|
335
|
+
references?: Reference[] | undefined;
|
|
145
336
|
}
|
|
146
337
|
interface BoxplotInput extends Sized {
|
|
147
338
|
/** One box per series, over that series' raw samples. */
|
|
@@ -184,11 +375,56 @@ interface MapInput extends Sized {
|
|
|
184
375
|
/** @default 'equirectangular' */
|
|
185
376
|
projection?: 'equirectangular' | 'mercator' | undefined;
|
|
186
377
|
}
|
|
378
|
+
interface RadialBand {
|
|
379
|
+
from: number;
|
|
380
|
+
to: number;
|
|
381
|
+
variant?: Variant | undefined;
|
|
382
|
+
}
|
|
383
|
+
interface RadialBarInput extends Sized {
|
|
384
|
+
/** One concentric arc per datum, the first outermost. */
|
|
385
|
+
data: Datum[];
|
|
386
|
+
/** The value a full arc represents. @default the largest value */
|
|
387
|
+
max?: number | undefined;
|
|
388
|
+
/** Degrees clockwise from 12 o'clock. @default 0 */
|
|
389
|
+
startAngle?: number | undefined;
|
|
390
|
+
/** @default 360 */
|
|
391
|
+
endAngle?: number | undefined;
|
|
392
|
+
/** Hole radius as a fraction of the outer radius. @default 0.3 */
|
|
393
|
+
innerRadius?: number | undefined;
|
|
394
|
+
/** Gap between arcs as a fraction of one arc's thickness. @default 0.25 */
|
|
395
|
+
gap?: number | undefined;
|
|
396
|
+
/** Draw the full-range track behind each arc. @default true */
|
|
397
|
+
track?: boolean | undefined;
|
|
398
|
+
/** Round the arc ends. @default true */
|
|
399
|
+
rounded?: boolean | undefined;
|
|
400
|
+
/** Write each name and value at the arc start. @default false */
|
|
401
|
+
labels?: boolean | undefined;
|
|
402
|
+
/** Threshold sectors drawn outside the arcs, in value units. */
|
|
403
|
+
bands?: RadialBand[] | undefined;
|
|
404
|
+
/** A tick across every arc at this value. */
|
|
405
|
+
target?: number | undefined;
|
|
406
|
+
/** Text in the middle, e.g. the headline value. */
|
|
407
|
+
centerLabel?: string | undefined;
|
|
408
|
+
}
|
|
409
|
+
/** What a click, focus or hover refers to. */
|
|
410
|
+
interface ChartItem {
|
|
411
|
+
/** The tooltip text. */
|
|
412
|
+
label: string;
|
|
413
|
+
series?: string | undefined;
|
|
414
|
+
category?: string | undefined;
|
|
415
|
+
index?: number | undefined;
|
|
416
|
+
value?: number | undefined;
|
|
417
|
+
name?: string | undefined;
|
|
418
|
+
/** Set on legend entries, which toggle a series instead of reporting a value. */
|
|
419
|
+
legend?: boolean | undefined;
|
|
420
|
+
}
|
|
187
421
|
interface ShapeBase {
|
|
188
422
|
/** The `data-skdx-part` value, e.g. `node`, `link`, `grid`. */
|
|
189
423
|
part: string;
|
|
190
424
|
/** Native tooltip text. */
|
|
191
425
|
title?: string | undefined;
|
|
426
|
+
/** What the mark stands for; makes it clickable and keyboard-focusable. */
|
|
427
|
+
item?: ChartItem | undefined;
|
|
192
428
|
}
|
|
193
429
|
type Shape = (ShapeBase & {
|
|
194
430
|
kind: 'path';
|
|
@@ -200,6 +436,7 @@ type Shape = (ShapeBase & {
|
|
|
200
436
|
strokeLinejoin?: 'round' | undefined;
|
|
201
437
|
opacity?: number | undefined;
|
|
202
438
|
fillOpacity?: number | undefined;
|
|
439
|
+
dash?: string | undefined;
|
|
203
440
|
}) | (ShapeBase & {
|
|
204
441
|
kind: 'rect';
|
|
205
442
|
x: number;
|
|
@@ -209,6 +446,7 @@ type Shape = (ShapeBase & {
|
|
|
209
446
|
fill: string;
|
|
210
447
|
stroke?: string | undefined;
|
|
211
448
|
opacity?: number | undefined;
|
|
449
|
+
rx?: number | undefined;
|
|
212
450
|
}) | (ShapeBase & {
|
|
213
451
|
kind: 'line';
|
|
214
452
|
x1: number;
|
|
@@ -217,12 +455,15 @@ type Shape = (ShapeBase & {
|
|
|
217
455
|
y2: number;
|
|
218
456
|
stroke: string;
|
|
219
457
|
dash?: string | undefined;
|
|
458
|
+
strokeWidth?: number | undefined;
|
|
220
459
|
}) | (ShapeBase & {
|
|
221
460
|
kind: 'circle';
|
|
222
461
|
cx: number;
|
|
223
462
|
cy: number;
|
|
224
463
|
r: number;
|
|
225
464
|
fill: string;
|
|
465
|
+
stroke?: string | undefined;
|
|
466
|
+
opacity?: number | undefined;
|
|
226
467
|
}) | (ShapeBase & {
|
|
227
468
|
kind: 'text';
|
|
228
469
|
x: number;
|
|
@@ -231,7 +472,25 @@ type Shape = (ShapeBase & {
|
|
|
231
472
|
anchor?: 'start' | 'middle' | 'end' | undefined;
|
|
232
473
|
baseline?: 'middle' | 'hanging' | undefined;
|
|
233
474
|
fill?: string | undefined;
|
|
475
|
+
weight?: 'bold' | undefined;
|
|
234
476
|
});
|
|
477
|
+
/** Where the pointer can act inside a cartesian chart: category slots, the shared tooltip rows and the brush strip. */
|
|
478
|
+
interface Hit {
|
|
479
|
+
plot: Box;
|
|
480
|
+
/** Pixel center of every visible category. */
|
|
481
|
+
xs: number[];
|
|
482
|
+
/** Tooltip lines per visible category: the category, then one per series. */
|
|
483
|
+
rows: string[][];
|
|
484
|
+
/** Total category count, before zooming. */
|
|
485
|
+
count: number;
|
|
486
|
+
zoom: Zoom;
|
|
487
|
+
/** The range strip, when `brush` is on. */
|
|
488
|
+
brush?: {
|
|
489
|
+
box: Box;
|
|
490
|
+
window: Box;
|
|
491
|
+
} | undefined;
|
|
492
|
+
crosshair: boolean;
|
|
493
|
+
}
|
|
235
494
|
/** What every layout returns: the outer size, the whole chart as shapes and the tooltip switch. */
|
|
236
495
|
interface Canvas {
|
|
237
496
|
width: number;
|
|
@@ -239,51 +498,199 @@ interface Canvas {
|
|
|
239
498
|
/** Everything drawn, back to front: grid, marks, legend and labels. */
|
|
240
499
|
shapes: Shape[];
|
|
241
500
|
tooltip: boolean;
|
|
501
|
+
description?: string | undefined;
|
|
502
|
+
decorative?: boolean | undefined;
|
|
503
|
+
/** Transition duration in ms when animation is on. */
|
|
504
|
+
animate?: number | undefined;
|
|
505
|
+
responsive?: boolean | undefined;
|
|
506
|
+
hit?: Hit | undefined;
|
|
242
507
|
}
|
|
243
508
|
interface LegendItem {
|
|
244
509
|
name: string;
|
|
245
510
|
color: string;
|
|
246
511
|
}
|
|
247
512
|
|
|
248
|
-
|
|
513
|
+
/** Grouped, stacked, horizontal or histogram bars; series may also be lines, areas or ranges. */
|
|
514
|
+
declare const layoutBarChart: (input: BarChartInput) => Canvas;
|
|
515
|
+
|
|
516
|
+
/** One polyline per series with a dot per value; series may also be bars, areas or ranges. */
|
|
517
|
+
declare const layoutLineChart: (input: LineChartInput) => Canvas;
|
|
518
|
+
/** Filled (optionally stacked) areas down to zero; series may also be bars, lines or ranges. */
|
|
519
|
+
declare const layoutAreaChart: (input: AreaChartInput) => Canvas;
|
|
249
520
|
|
|
250
|
-
|
|
251
|
-
|
|
521
|
+
type Kind = 'bar' | 'line' | 'area';
|
|
522
|
+
/** Markers are drawn up to this many visible points per series. */
|
|
523
|
+
declare const MARKER_LIMIT = 100;
|
|
524
|
+
/** Per-point titles (and so per-point tooltips) are emitted up to this many visible points per series. */
|
|
525
|
+
declare const TITLE_LIMIT = 2000;
|
|
526
|
+
/** Bars, lines, areas and range bands that share one category axis and up to two value axes. */
|
|
527
|
+
declare function layoutCartesian(input: ChartInput, defaultType: Kind): Canvas;
|
|
252
528
|
|
|
253
529
|
declare function layoutScatterChart(input: ScatterChartInput): Canvas;
|
|
254
530
|
|
|
255
531
|
declare function layoutPieChart(input: PieChartInput): Canvas;
|
|
256
532
|
|
|
533
|
+
/** A small axis-less trend: an area (default), a bare line, or bars; optional extremes and last value. */
|
|
257
534
|
declare function layoutSparkline(input: SparklineInput): Canvas;
|
|
258
535
|
|
|
259
536
|
declare function layoutRadarChart(input: RadarChartInput): Canvas;
|
|
260
537
|
|
|
261
538
|
declare function layoutHeatmap(input: HeatmapInput): Canvas;
|
|
262
539
|
|
|
540
|
+
/**
|
|
541
|
+
* Stages narrowing with their value (conversion), or a pyramid widening toward the end
|
|
542
|
+
* (shares of a whole). Vertical by default, horizontal when asked.
|
|
543
|
+
*/
|
|
263
544
|
declare function layoutFunnelChart(input: FunnelChartInput): Canvas;
|
|
264
545
|
|
|
265
546
|
/**
|
|
266
|
-
*
|
|
267
|
-
*
|
|
547
|
+
* Concentric arcs, one per datum, each a share of `max`: KPI completion, utilization,
|
|
548
|
+
* quota attainment. `bands` and `target` turn it into a gauge; `startAngle`/`endAngle` open it.
|
|
268
549
|
*/
|
|
269
|
-
declare function
|
|
550
|
+
declare function layoutRadialBar(input: RadialBarInput): Canvas;
|
|
270
551
|
|
|
552
|
+
/**
|
|
553
|
+
* Series colors, cycling through the `@skdx/tokens` scales so charts follow the
|
|
554
|
+
* active theme. Load `@skdx/tokens/css` (or any theme) for these to resolve.
|
|
555
|
+
*/
|
|
556
|
+
declare const SERIES_COLORS: readonly string[];
|
|
271
557
|
declare const CHART_COLORS: {
|
|
272
558
|
readonly axis: "var(--skdx-color-border-strong)";
|
|
273
559
|
readonly grid: "var(--skdx-color-border-subtle)";
|
|
274
560
|
readonly label: "var(--skdx-color-text-muted)";
|
|
561
|
+
readonly focus: "var(--skdx-color-focus-ring)";
|
|
562
|
+
readonly positive: "var(--skdx-color-success-500)";
|
|
563
|
+
readonly negative: "var(--skdx-color-danger-500)";
|
|
275
564
|
readonly fontFamily: "var(--skdx-font-family)";
|
|
276
565
|
readonly fontSize: "var(--skdx-font-size-xs)";
|
|
277
566
|
};
|
|
567
|
+
/** Semantic color of a reference line, band or threshold sector. */
|
|
568
|
+
declare const variantColor: (variant?: Variant) => string;
|
|
569
|
+
|
|
570
|
+
/** The default: the runtime locale's plain number format, with float noise trimmed. */
|
|
571
|
+
declare const formatValue: (v: number) => string;
|
|
572
|
+
/** Turns a `Format` into a function; `undefined` gives the default number format. */
|
|
573
|
+
declare function makeFormatter(format: Format | undefined): (value: number) => string;
|
|
574
|
+
/** A category as axis text: strings as they are, numbers and dates through `format`. */
|
|
575
|
+
declare function categoryLabel(c: Category, format?: Format): string;
|
|
576
|
+
|
|
577
|
+
/** A tooltip box next to the pointer, kept inside the canvas; one line per entry. */
|
|
578
|
+
declare function tooltipShapes(x: number, y: number, text: string | string[], width: number, height: number): Shape[];
|
|
579
|
+
/**
|
|
580
|
+
* The loading, error or empty placeholder, or `null` when the chart should draw. Charts call this
|
|
581
|
+
* first so no axis is drawn around missing data.
|
|
582
|
+
*/
|
|
583
|
+
declare function stateCanvas(input: Sized, empty: boolean, w?: number, h?: number): Canvas | null;
|
|
584
|
+
|
|
585
|
+
/** Converts a client position into viewBox units of the svg. */
|
|
586
|
+
declare function toViewBox(svg: Element, clientX: number, clientY: number, width: number, height: number): {
|
|
587
|
+
x: number;
|
|
588
|
+
y: number;
|
|
589
|
+
};
|
|
590
|
+
/** The crosshair line and shared tooltip at the category nearest to `x`, or none outside the plot. */
|
|
591
|
+
declare function crosshairShapes(layout: Canvas, x: number, y: number): Shape[];
|
|
592
|
+
/**
|
|
593
|
+
* Tooltip shapes for the mark under the pointer, or none. Reads the mark's
|
|
594
|
+
* `<title>` and converts the pointer position into viewBox units.
|
|
595
|
+
*/
|
|
596
|
+
declare function hoverTooltip(target: EventTarget | null, svg: Element, clientX: number, clientY: number, width: number, height: number): Shape[];
|
|
597
|
+
/** What to draw for a pointer at the given position: the crosshair when on, else the hovered mark's tooltip. */
|
|
598
|
+
declare function pointerShapes(layout: Canvas, target: EventTarget | null, svg: Element, clientX: number, clientY: number): Shape[];
|
|
599
|
+
/** The shape index and item of the mark an event landed on, if it stands for something. */
|
|
600
|
+
declare function itemAt(layout: Canvas, target: EventTarget | null): {
|
|
601
|
+
index: number;
|
|
602
|
+
item: ChartItem;
|
|
603
|
+
} | undefined;
|
|
604
|
+
/** Indexes of the shapes a keyboard user can land on, in drawing order. */
|
|
605
|
+
declare const focusTargets: (layout: Canvas) => number[];
|
|
606
|
+
/** A representative point of a shape, where its tooltip is anchored. */
|
|
607
|
+
declare function anchorOf(s: Shape): {
|
|
608
|
+
x: number;
|
|
609
|
+
y: number;
|
|
610
|
+
};
|
|
611
|
+
/** The focus ring around a shape plus its tooltip, for keyboard users. */
|
|
612
|
+
declare function focusShapes(layout: Canvas, index: number | null): Shape[];
|
|
613
|
+
/**
|
|
614
|
+
* The mark to focus after a key press: arrows step, Home/End jump, Escape clears (`null`);
|
|
615
|
+
* `undefined` means the key was not handled and should propagate.
|
|
616
|
+
*/
|
|
617
|
+
declare function nextFocus(layout: Canvas, current: number | null, key: string): number | null | undefined;
|
|
618
|
+
/** Whether the zoom shows everything. */
|
|
619
|
+
declare const isUnzoomed: (zoom: Zoom | undefined, count: number) => boolean;
|
|
620
|
+
/** The window after a wheel step at viewBox `x`: scrolling up narrows around the pointer, down widens. */
|
|
621
|
+
declare function zoomWheel(hit: Hit, deltaY: number, x: number): Zoom | undefined;
|
|
622
|
+
/**
|
|
623
|
+
* The window after a pinch: `ratio` is the current finger distance over the distance when the
|
|
624
|
+
* pinch began (`> 1` narrows the window), anchored at viewBox `x`.
|
|
625
|
+
*/
|
|
626
|
+
declare function zoomPinch(hit: Hit, from: Zoom, ratio: number, x: number): Zoom;
|
|
627
|
+
/** The window after dragging the plot by `dx` viewBox pixels from where `from` was set. */
|
|
628
|
+
declare function zoomPan(hit: Hit, from: Zoom, dx: number): Zoom;
|
|
629
|
+
type BrushGrab = 'move' | 'left' | 'right';
|
|
630
|
+
/**
|
|
631
|
+
* What a pointer-down at viewBox (x, y) grabs in the range strip: a handle, the window,
|
|
632
|
+
* or (outside the window) a window re-centred there. `undefined` outside the strip.
|
|
633
|
+
*/
|
|
634
|
+
declare function brushGrab(hit: Hit, x: number, y: number): {
|
|
635
|
+
grab: BrushGrab;
|
|
636
|
+
zoom: Zoom;
|
|
637
|
+
} | undefined;
|
|
638
|
+
/** The window after dragging a brush grab by `dx` viewBox pixels. */
|
|
639
|
+
declare function brushDrag(hit: Hit, grab: BrushGrab, from: Zoom, dx: number): Zoom;
|
|
640
|
+
|
|
641
|
+
/** One shape as SVG markup. Shared by the export and usable for server rendering. */
|
|
642
|
+
declare function shapeMarkup(s: Shape): string;
|
|
643
|
+
/**
|
|
644
|
+
* A standalone SVG document of a layout, for download or server rendering. Colors stay as
|
|
645
|
+
* `var(--skdx-…)` references unless `resolve` maps them to concrete values, e.g. from
|
|
646
|
+
* `getComputedStyle(document.documentElement).getPropertyValue(name)`.
|
|
647
|
+
*/
|
|
648
|
+
declare function svgMarkup(layout: Canvas, label: string, resolve?: (cssVariable: string) => string): string;
|
|
649
|
+
/**
|
|
650
|
+
* Rasterizes SVG markup (from `svgMarkup`, with tokens resolved) to a PNG blob at `scale` device
|
|
651
|
+
* pixels per unit. Browser only: needs `Image`, `document` and a canvas.
|
|
652
|
+
*/
|
|
653
|
+
declare function svgToPng(markup: string, width: number, height: number, scale?: number, background?: string): Promise<Blob>;
|
|
654
|
+
/** RFC 4180 CSV of rows, for "download data" and clipboard copy. */
|
|
655
|
+
declare function csv(rows: (string | number | null | undefined)[][]): string;
|
|
656
|
+
/** Series and categories as CSV rows: a header of series names, one row per category. */
|
|
657
|
+
declare function seriesCsv(series: {
|
|
658
|
+
name: string;
|
|
659
|
+
data: (number | null)[];
|
|
660
|
+
}[], categories?: (string | number | Date)[]): string;
|
|
661
|
+
|
|
662
|
+
/** Above this many shapes animation switches itself off; the transitions would cost more than they explain. */
|
|
663
|
+
declare const ANIMATION_LIMIT = 1500;
|
|
664
|
+
/**
|
|
665
|
+
* The static stylesheet every root ships: marks fade in on mount and their geometry transitions on
|
|
666
|
+
* change, both over `--skdx-chart-duration`, which is `0ms` (nothing moves) unless the root sets it
|
|
667
|
+
* from `animationDuration`. Tooltips, focus rings and the crosshair are excluded so interaction
|
|
668
|
+
* stays immediate; `prefers-reduced-motion` turns everything off. Geometry transitions rely on
|
|
669
|
+
* SVG 2 presentation attributes as CSS properties, which evergreen browsers support.
|
|
670
|
+
*/
|
|
671
|
+
declare const ANIMATION_CSS: string;
|
|
672
|
+
/** The `--skdx-chart-duration` value for a layout, e.g. `300ms`, or `undefined` when it must not animate. */
|
|
673
|
+
declare function animationDuration(layout: Canvas): string | undefined;
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* Round timestamps covering `[min, max]` (epoch ms), about `count` of them: seconds to weeks as
|
|
677
|
+
* UTC-aligned multiples, then whole months or years.
|
|
678
|
+
*/
|
|
679
|
+
declare function timeTicks(min: number, max: number, count?: number): number[];
|
|
278
680
|
|
|
279
681
|
declare function layoutSankey(input: SankeyInput): Canvas;
|
|
280
682
|
|
|
281
683
|
declare function layoutTreemap(input: TreemapInput): Canvas;
|
|
282
684
|
|
|
685
|
+
/** Candles or OHLC bars on a time axis, with an optional volume pane, references, zoom and brush. */
|
|
283
686
|
declare function layoutCandlestick(input: CandlestickInput): Canvas;
|
|
284
687
|
|
|
285
688
|
declare function layoutWaterfall(input: WaterfallInput): Canvas;
|
|
286
689
|
|
|
690
|
+
/**
|
|
691
|
+
* Intervals on a numeric time axis, one row per task, or per `group` when tasks share one.
|
|
692
|
+
* Generic enough for schedules, on-call shifts, uptime windows and market sessions.
|
|
693
|
+
*/
|
|
287
694
|
declare function layoutGantt(input: GanttInput): Canvas;
|
|
288
695
|
|
|
289
696
|
declare function layoutBoxplot(input: BoxplotInput): Canvas;
|
|
@@ -295,24 +702,58 @@ declare function layoutChord(input: ChordInput): Canvas;
|
|
|
295
702
|
/** Projection fitted to the features' bounds (equirectangular by default, or Mercator); opacity follows the value. */
|
|
296
703
|
declare function layoutMap(input: MapInput): Canvas;
|
|
297
704
|
|
|
298
|
-
/**
|
|
705
|
+
/**
|
|
706
|
+
* The accessible `<svg>` root every chart renders into: marks, decorations, then the hover or
|
|
707
|
+
* keyboard tooltip. Owns focus state; reports legend toggles and zoom changes to the chart.
|
|
708
|
+
*/
|
|
299
709
|
declare class SkdxChartRootComponent {
|
|
300
710
|
readonly layout: _angular_core.InputSignal<Canvas>;
|
|
301
711
|
readonly kind: _angular_core.InputSignal<string>;
|
|
302
712
|
readonly label: _angular_core.InputSignal<string>;
|
|
713
|
+
/** Wheel and pinch zoom, drag pans the category axis. */
|
|
714
|
+
readonly zoomable: _angular_core.InputSignal<boolean>;
|
|
715
|
+
/** Measure the host and report its width, so the chart can lay out at that width. */
|
|
716
|
+
readonly responsive: _angular_core.InputSignal<boolean>;
|
|
717
|
+
/** A mark was clicked, or Enter/Space was pressed on the focused mark. */
|
|
718
|
+
readonly itemClick: _angular_core.OutputEmitterRef<ChartItem>;
|
|
719
|
+
/** The legend toggled a series; the chart applies it through its `hiddenSeries` model. */
|
|
720
|
+
readonly hiddenSeriesChange: _angular_core.OutputEmitterRef<string[]>;
|
|
721
|
+
/** Wheel, drag, pinch or brush moved the window; the chart applies it through its `zoom` model. */
|
|
722
|
+
readonly zoomChange: _angular_core.OutputEmitterRef<Zoom | undefined>;
|
|
723
|
+
/** The host's measured width, under `responsive`. */
|
|
724
|
+
readonly measured: _angular_core.OutputEmitterRef<number>;
|
|
303
725
|
protected readonly colors: {
|
|
304
726
|
readonly axis: "var(--skdx-color-border-strong)";
|
|
305
727
|
readonly grid: "var(--skdx-color-border-subtle)";
|
|
306
728
|
readonly label: "var(--skdx-color-text-muted)";
|
|
729
|
+
readonly focus: "var(--skdx-color-focus-ring)";
|
|
730
|
+
readonly positive: "var(--skdx-color-success-500)";
|
|
731
|
+
readonly negative: "var(--skdx-color-danger-500)";
|
|
307
732
|
readonly fontFamily: "var(--skdx-font-family)";
|
|
308
733
|
readonly fontSize: "var(--skdx-font-size-xs)";
|
|
309
734
|
};
|
|
735
|
+
protected readonly duration: _angular_core.Signal<string | null>;
|
|
736
|
+
private readonly pointers;
|
|
737
|
+
private readonly svg;
|
|
738
|
+
constructor();
|
|
310
739
|
protected readonly tip: _angular_core.WritableSignal<Shape[]>;
|
|
740
|
+
protected readonly focused: _angular_core.WritableSignal<number | null>;
|
|
741
|
+
protected readonly canZoom: _angular_core.Signal<boolean>;
|
|
742
|
+
protected readonly focusable: _angular_core.Signal<boolean>;
|
|
743
|
+
protected readonly descId: _angular_core.Signal<string | null>;
|
|
744
|
+
protected readonly focusShapes: _angular_core.Signal<Shape[]>;
|
|
745
|
+
private drag;
|
|
746
|
+
private viewBox;
|
|
311
747
|
protected onPointerMove(e: PointerEvent): void;
|
|
748
|
+
protected onPointerDown(e: PointerEvent): void;
|
|
749
|
+
protected onPointerUp(e: PointerEvent): void;
|
|
750
|
+
protected onWheel(e: WheelEvent): void;
|
|
751
|
+
protected onClick(e: MouseEvent): void;
|
|
752
|
+
protected onKeyDown(e: KeyboardEvent): void;
|
|
312
753
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxChartRootComponent, never>;
|
|
313
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkdxChartRootComponent, "skdx-chart-root", never, { "layout": { "alias": "layout"; "required": true; "isSignal": true; }; "kind": { "alias": "kind"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
754
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkdxChartRootComponent, "skdx-chart-root", never, { "layout": { "alias": "layout"; "required": true; "isSignal": true; }; "kind": { "alias": "kind"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "zoomable": { "alias": "zoomable"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; }, { "itemClick": "itemClick"; "hiddenSeriesChange": "hiddenSeriesChange"; "zoomChange": "zoomChange"; "measured": "measured"; }, never, never, true, never>;
|
|
314
755
|
}
|
|
315
|
-
/**
|
|
756
|
+
/** Size, state, formatting, accessibility and interaction inputs every chart takes. */
|
|
316
757
|
declare abstract class SkdxSizedBase {
|
|
317
758
|
readonly width: _angular_core.InputSignal<number | undefined>;
|
|
318
759
|
readonly height: _angular_core.InputSignal<number | undefined>;
|
|
@@ -322,37 +763,133 @@ declare abstract class SkdxSizedBase {
|
|
|
322
763
|
readonly legend: _angular_core.InputSignal<boolean>;
|
|
323
764
|
/** Show a hover tooltip for the mark under the pointer. */
|
|
324
765
|
readonly tooltip: _angular_core.InputSignal<boolean>;
|
|
766
|
+
/** How values are written: a function or an `Intl` style such as `{ style: 'currency', currency: 'EUR' }`. */
|
|
767
|
+
readonly format: _angular_core.InputSignal<Format | undefined>;
|
|
768
|
+
/** Categorical series colors, cycled by series index. */
|
|
769
|
+
readonly palette: _angular_core.InputSignal<string[] | undefined>;
|
|
770
|
+
/** Series left out of the plot; two-way bindable, the legend toggles it. */
|
|
771
|
+
readonly hiddenSeries: _angular_core.ModelSignal<string[] | undefined>;
|
|
772
|
+
/** Draw a loading placeholder instead of the chart. */
|
|
773
|
+
readonly loading: _angular_core.InputSignal<boolean>;
|
|
774
|
+
/** Draw this message instead of the chart. */
|
|
775
|
+
readonly error: _angular_core.InputSignal<string | undefined>;
|
|
776
|
+
/** Written in place of an empty chart. */
|
|
777
|
+
readonly emptyMessage: _angular_core.InputSignal<string | undefined>;
|
|
778
|
+
/** Longer accessible description, rendered as the svg `<desc>`. */
|
|
779
|
+
readonly description: _angular_core.InputSignal<string | undefined>;
|
|
780
|
+
/** Hide the chart from assistive technology. */
|
|
781
|
+
readonly decorative: _angular_core.InputSignal<boolean>;
|
|
782
|
+
/** Fade marks in and transition them on change; `true` is 300 ms, a number sets the duration. */
|
|
783
|
+
readonly animate: _angular_core.InputSignal<number | boolean>;
|
|
784
|
+
/** Lay the chart out at the host's width, so text keeps its size. */
|
|
785
|
+
readonly responsive: _angular_core.InputSignal<boolean>;
|
|
786
|
+
/** The width the root measured under `responsive`. */
|
|
787
|
+
protected readonly measuredWidth: _angular_core.WritableSignal<number | undefined>;
|
|
788
|
+
/** Visible category window; two-way bindable, wheel, drag, pinch and brush update it. */
|
|
789
|
+
readonly zoom: _angular_core.ModelSignal<Zoom | undefined>;
|
|
790
|
+
/** Wheel zooms and drag pans the category axis. */
|
|
791
|
+
readonly zoomable: _angular_core.InputSignal<boolean>;
|
|
792
|
+
/** A mark was clicked, or Enter/Space was pressed on the focused mark. */
|
|
793
|
+
readonly itemClick: _angular_core.OutputEmitterRef<ChartItem>;
|
|
794
|
+
/** Applies a legend toggle reported by the root. */
|
|
795
|
+
protected toggle([name]: string[]): void;
|
|
325
796
|
protected sized(): {
|
|
326
797
|
width: number | undefined;
|
|
327
798
|
height: number | undefined;
|
|
799
|
+
animate: number | boolean;
|
|
800
|
+
responsive: boolean;
|
|
328
801
|
legend: boolean;
|
|
329
802
|
tooltip: boolean;
|
|
803
|
+
format: Format | undefined;
|
|
804
|
+
palette: string[] | undefined;
|
|
805
|
+
hiddenSeries: string[] | undefined;
|
|
806
|
+
loading: boolean;
|
|
807
|
+
error: string | undefined;
|
|
808
|
+
emptyMessage: string | undefined;
|
|
809
|
+
description: string | undefined;
|
|
810
|
+
decorative: boolean;
|
|
811
|
+
zoom: Zoom | undefined;
|
|
330
812
|
};
|
|
331
813
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxSizedBase, never>;
|
|
332
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SkdxSizedBase, never, never, { "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "legend": { "alias": "legend"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
814
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SkdxSizedBase, never, never, { "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "legend": { "alias": "legend"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "palette": { "alias": "palette"; "required": false; "isSignal": true; }; "hiddenSeries": { "alias": "hiddenSeries"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "decorative": { "alias": "decorative"; "required": false; "isSignal": true; }; "animate": { "alias": "animate"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "zoomable": { "alias": "zoomable"; "required": false; "isSignal": true; }; }, { "hiddenSeries": "hiddenSeriesChange"; "zoom": "zoomChange"; "itemClick": "itemClick"; }, never, never, true, never>;
|
|
333
815
|
}
|
|
334
|
-
/** Inputs the
|
|
816
|
+
/** Inputs the cartesian charts (bar, line, area) take. */
|
|
335
817
|
declare abstract class SkdxChartBase extends SkdxSizedBase {
|
|
336
|
-
readonly series: _angular_core.InputSignal<
|
|
337
|
-
|
|
818
|
+
readonly series: _angular_core.InputSignal<(CartesianSeries | RangeSeries)[]>;
|
|
819
|
+
/** X-axis labels; numbers and dates are written with `xAxis.format`. */
|
|
820
|
+
readonly categories: _angular_core.InputSignal<Category[] | undefined>;
|
|
821
|
+
readonly xAxis: _angular_core.InputSignal<XAxisOptions | undefined>;
|
|
822
|
+
readonly yAxis: _angular_core.InputSignal<AxisOptions | undefined>;
|
|
823
|
+
/** Enables the second y axis; series opt in with `axis: 'right'`. */
|
|
824
|
+
readonly rightAxis: _angular_core.InputSignal<AxisOptions | undefined>;
|
|
825
|
+
/** Lines and bands in data coordinates: targets, SLAs, forecast periods. */
|
|
826
|
+
readonly references: _angular_core.InputSignal<Reference[] | undefined>;
|
|
827
|
+
/** Write each value next to its mark. */
|
|
828
|
+
readonly labels: _angular_core.InputSignal<boolean>;
|
|
829
|
+
readonly curve: _angular_core.InputSignal<Curve | undefined>;
|
|
830
|
+
readonly connectNulls: _angular_core.InputSignal<boolean>;
|
|
831
|
+
/** Stack the series; `'percent'` normalizes each category to 100%. */
|
|
832
|
+
readonly stacked: _angular_core.InputSignal<boolean | "percent">;
|
|
833
|
+
readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal" | undefined>;
|
|
834
|
+
/** Corner radius of bars. */
|
|
835
|
+
readonly radius: _angular_core.InputSignal<number | undefined>;
|
|
836
|
+
readonly sort: _angular_core.InputSignal<"asc" | "desc" | undefined>;
|
|
837
|
+
readonly transform: _angular_core.InputSignal<"histogram" | "cumulative" | undefined>;
|
|
838
|
+
readonly bins: _angular_core.InputSignal<number | undefined>;
|
|
839
|
+
readonly binWidth: _angular_core.InputSignal<number | undefined>;
|
|
840
|
+
readonly binDomain: _angular_core.InputSignal<[number, number] | undefined>;
|
|
841
|
+
readonly binMode: _angular_core.InputSignal<"cumulative" | "count" | "density" | undefined>;
|
|
842
|
+
/** Draw a range strip under the plot showing the whole series and the zoomed window. */
|
|
843
|
+
readonly brush: _angular_core.InputSignal<boolean>;
|
|
844
|
+
/** Snap the hover tooltip to the nearest category and list every series. */
|
|
845
|
+
readonly crosshair: _angular_core.InputSignal<boolean>;
|
|
338
846
|
protected input(): {
|
|
339
|
-
series:
|
|
340
|
-
categories:
|
|
847
|
+
series: (CartesianSeries | RangeSeries)[];
|
|
848
|
+
categories: Category[] | undefined;
|
|
849
|
+
xAxis: XAxisOptions | undefined;
|
|
850
|
+
yAxis: AxisOptions | undefined;
|
|
851
|
+
rightAxis: AxisOptions | undefined;
|
|
852
|
+
references: Reference[] | undefined;
|
|
853
|
+
labels: boolean;
|
|
854
|
+
curve: Curve | undefined;
|
|
855
|
+
connectNulls: boolean;
|
|
856
|
+
stacked: boolean | "percent";
|
|
857
|
+
orientation: "vertical" | "horizontal" | undefined;
|
|
858
|
+
radius: number | undefined;
|
|
859
|
+
sort: "asc" | "desc" | undefined;
|
|
860
|
+
transform: "histogram" | "cumulative" | undefined;
|
|
861
|
+
bins: number | undefined;
|
|
862
|
+
binWidth: number | undefined;
|
|
863
|
+
binDomain: [number, number] | undefined;
|
|
864
|
+
binMode: "cumulative" | "count" | "density" | undefined;
|
|
865
|
+
brush: boolean;
|
|
866
|
+
crosshair: boolean;
|
|
341
867
|
width: number | undefined;
|
|
342
868
|
height: number | undefined;
|
|
869
|
+
animate: number | boolean;
|
|
870
|
+
responsive: boolean;
|
|
343
871
|
legend: boolean;
|
|
344
872
|
tooltip: boolean;
|
|
873
|
+
format: Format | undefined;
|
|
874
|
+
palette: string[] | undefined;
|
|
875
|
+
hiddenSeries: string[] | undefined;
|
|
876
|
+
loading: boolean;
|
|
877
|
+
error: string | undefined;
|
|
878
|
+
emptyMessage: string | undefined;
|
|
879
|
+
description: string | undefined;
|
|
880
|
+
decorative: boolean;
|
|
881
|
+
zoom: Zoom | undefined;
|
|
345
882
|
};
|
|
346
883
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxChartBase, never>;
|
|
347
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SkdxChartBase, never, never, { "series": { "alias": "series"; "required": true; "isSignal": true; }; "categories": { "alias": "categories"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
884
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SkdxChartBase, never, never, { "series": { "alias": "series"; "required": true; "isSignal": true; }; "categories": { "alias": "categories"; "required": false; "isSignal": true; }; "xAxis": { "alias": "xAxis"; "required": false; "isSignal": true; }; "yAxis": { "alias": "yAxis"; "required": false; "isSignal": true; }; "rightAxis": { "alias": "rightAxis"; "required": false; "isSignal": true; }; "references": { "alias": "references"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "curve": { "alias": "curve"; "required": false; "isSignal": true; }; "connectNulls": { "alias": "connectNulls"; "required": false; "isSignal": true; }; "stacked": { "alias": "stacked"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "radius": { "alias": "radius"; "required": false; "isSignal": true; }; "sort": { "alias": "sort"; "required": false; "isSignal": true; }; "transform": { "alias": "transform"; "required": false; "isSignal": true; }; "bins": { "alias": "bins"; "required": false; "isSignal": true; }; "binWidth": { "alias": "binWidth"; "required": false; "isSignal": true; }; "binDomain": { "alias": "binDomain"; "required": false; "isSignal": true; }; "binMode": { "alias": "binMode"; "required": false; "isSignal": true; }; "brush": { "alias": "brush"; "required": false; "isSignal": true; }; "crosshair": { "alias": "crosshair"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
348
885
|
}
|
|
349
886
|
|
|
350
|
-
/** Draws a core shape list back to front. */
|
|
887
|
+
/** Draws a core shape list back to front; marks with an `item` carry their index for hit-testing. */
|
|
351
888
|
declare class SkdxChartShapesComponent {
|
|
352
889
|
readonly shapes: _angular_core.InputSignal<Shape[]>;
|
|
353
890
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxChartShapesComponent, never>;
|
|
354
891
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkdxChartShapesComponent, "g[skdxChartShapes]", never, { "shapes": { "alias": "shapes"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
355
892
|
}
|
|
356
893
|
|
|
357
|
-
export { CHART_COLORS, SkdxChartBase, SkdxChartRootComponent, SkdxChartShapesComponent, SkdxSizedBase, hoverTooltip, layoutAreaChart, layoutBarChart, layoutBoxplot, layoutCandlestick, layoutChord, layoutFunnelChart, layoutGantt, layoutHeatmap, layoutLineChart, layoutMap, layoutPieChart, layoutRadarChart, layoutSankey, layoutScatterChart, layoutSparkline, layoutSunburst, layoutTreemap, layoutWaterfall };
|
|
358
|
-
export type { AreaChartInput, BarChartInput, Box, BoxplotInput, Candle, CandlestickInput, Canvas, ChartInput, ChordInput, Curve, Datum, Frame, FunnelChartInput, GanttInput, GanttTask, GeoMultiPolygon, GeoPolygon, HeatmapInput, LegendItem, LineChartInput, MapFeature, MapInput, PieChartInput, RadarChartInput, SankeyInput, SankeyLink, ScatterChartInput, ScatterSeries, Series, Shape, Sized, SparklineInput, SunburstInput, Tick, TreeNode, TreemapInput, WaterfallInput };
|
|
894
|
+
export { ANIMATION_CSS, ANIMATION_LIMIT, CHART_COLORS, MARKER_LIMIT, SERIES_COLORS, SkdxChartBase, SkdxChartRootComponent, SkdxChartShapesComponent, SkdxSizedBase, TITLE_LIMIT, anchorOf, animationDuration, brushDrag, brushGrab, categoryLabel, crosshairShapes, csv, focusShapes, focusTargets, formatValue, hoverTooltip, isUnzoomed, itemAt, layoutAreaChart, layoutBarChart, layoutBoxplot, layoutCandlestick, layoutCartesian, layoutChord, layoutFunnelChart, layoutGantt, layoutHeatmap, layoutLineChart, layoutMap, layoutPieChart, layoutRadarChart, layoutRadialBar, layoutSankey, layoutScatterChart, layoutSparkline, layoutSunburst, layoutTreemap, layoutWaterfall, makeFormatter, nextFocus, pointerShapes, seriesCsv, shapeMarkup, stateCanvas, svgMarkup, svgToPng, timeTicks, toViewBox, tooltipShapes, variantColor, zoomPan, zoomPinch, zoomWheel };
|
|
895
|
+
export type { AreaChartInput, AxisOptions, BarChartInput, Box, BoxplotInput, BrushGrab, CalendarCell, Candle, CandlestickInput, Canvas, CartesianSeries, Category, ChartInput, ChartItem, ChordInput, Curve, Datum, Format, Frame, FunnelChartInput, GanttInput, GanttTask, GeoMultiPolygon, GeoPolygon, HeatmapInput, Hit, LegendItem, LineChartInput, MapFeature, MapInput, PieChartInput, RadarChartInput, RadialBand, RadialBarInput, RangeSeries, Reference, SankeyInput, SankeyLink, ScatterChartInput, ScatterSeries, Series, Shape, Sized, SparklineInput, SunburstInput, Tick, TreeNode, TreemapInput, Value, Variant, WaterfallInput, XAxisOptions, Zoom };
|