@skdx/angular-charts 0.32.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.
Files changed (65) hide show
  1. package/README.md +96 -41
  2. package/fesm2022/skdx-angular-charts-area.mjs +27 -33
  3. package/fesm2022/skdx-angular-charts-area.mjs.map +1 -1
  4. package/fesm2022/skdx-angular-charts-bar.mjs +30 -51
  5. package/fesm2022/skdx-angular-charts-bar.mjs.map +1 -1
  6. package/fesm2022/skdx-angular-charts-boxplot.mjs +26 -14
  7. package/fesm2022/skdx-angular-charts-boxplot.mjs.map +1 -1
  8. package/fesm2022/skdx-angular-charts-candlestick.mjs +49 -16
  9. package/fesm2022/skdx-angular-charts-candlestick.mjs.map +1 -1
  10. package/fesm2022/skdx-angular-charts-chord.mjs +26 -14
  11. package/fesm2022/skdx-angular-charts-chord.mjs.map +1 -1
  12. package/fesm2022/skdx-angular-charts-funnel.mjs +37 -48
  13. package/fesm2022/skdx-angular-charts-funnel.mjs.map +1 -1
  14. package/fesm2022/skdx-angular-charts-gantt.mjs +31 -19
  15. package/fesm2022/skdx-angular-charts-gantt.mjs.map +1 -1
  16. package/fesm2022/skdx-angular-charts-heatmap.mjs +54 -81
  17. package/fesm2022/skdx-angular-charts-heatmap.mjs.map +1 -1
  18. package/fesm2022/skdx-angular-charts-internal.mjs +2746 -707
  19. package/fesm2022/skdx-angular-charts-internal.mjs.map +1 -1
  20. package/fesm2022/skdx-angular-charts-line.mjs +26 -16
  21. package/fesm2022/skdx-angular-charts-line.mjs.map +1 -1
  22. package/fesm2022/skdx-angular-charts-map.mjs +35 -14
  23. package/fesm2022/skdx-angular-charts-map.mjs.map +1 -1
  24. package/fesm2022/skdx-angular-charts-pie.mjs +47 -25
  25. package/fesm2022/skdx-angular-charts-pie.mjs.map +1 -1
  26. package/fesm2022/skdx-angular-charts-radar.mjs +45 -81
  27. package/fesm2022/skdx-angular-charts-radar.mjs.map +1 -1
  28. package/fesm2022/skdx-angular-charts-radial.mjs +108 -0
  29. package/fesm2022/skdx-angular-charts-radial.mjs.map +1 -0
  30. package/fesm2022/skdx-angular-charts-sankey.mjs +26 -14
  31. package/fesm2022/skdx-angular-charts-sankey.mjs.map +1 -1
  32. package/fesm2022/skdx-angular-charts-scatter.mjs +49 -19
  33. package/fesm2022/skdx-angular-charts-scatter.mjs.map +1 -1
  34. package/fesm2022/skdx-angular-charts-sparkline.mjs +50 -60
  35. package/fesm2022/skdx-angular-charts-sparkline.mjs.map +1 -1
  36. package/fesm2022/skdx-angular-charts-sunburst.mjs +26 -14
  37. package/fesm2022/skdx-angular-charts-sunburst.mjs.map +1 -1
  38. package/fesm2022/skdx-angular-charts-treemap.mjs +26 -14
  39. package/fesm2022/skdx-angular-charts-treemap.mjs.map +1 -1
  40. package/fesm2022/skdx-angular-charts-waterfall.mjs +26 -14
  41. package/fesm2022/skdx-angular-charts-waterfall.mjs.map +1 -1
  42. package/fesm2022/skdx-angular-charts.mjs +2 -0
  43. package/fesm2022/skdx-angular-charts.mjs.map +1 -1
  44. package/package.json +7 -12
  45. package/types/skdx-angular-charts-area.d.ts +2 -2
  46. package/types/skdx-angular-charts-bar.d.ts +5 -13
  47. package/types/skdx-angular-charts-boxplot.d.ts +2 -2
  48. package/types/skdx-angular-charts-candlestick.d.ts +10 -4
  49. package/types/skdx-angular-charts-chord.d.ts +2 -2
  50. package/types/skdx-angular-charts-funnel.d.ts +5 -3
  51. package/types/skdx-angular-charts-gantt.d.ts +6 -6
  52. package/types/skdx-angular-charts-heatmap.d.ts +16 -15
  53. package/types/skdx-angular-charts-internal.d.ts +595 -232
  54. package/types/skdx-angular-charts-line.d.ts +2 -2
  55. package/types/skdx-angular-charts-map.d.ts +4 -3
  56. package/types/skdx-angular-charts-pie.d.ts +11 -3
  57. package/types/skdx-angular-charts-radar.d.ts +8 -10
  58. package/types/skdx-angular-charts-radial.d.ts +34 -0
  59. package/types/skdx-angular-charts-sankey.d.ts +2 -2
  60. package/types/skdx-angular-charts-scatter.d.ts +11 -4
  61. package/types/skdx-angular-charts-sparkline.d.ts +13 -5
  62. package/types/skdx-angular-charts-sunburst.d.ts +2 -2
  63. package/types/skdx-angular-charts-treemap.d.ts +4 -4
  64. package/types/skdx-angular-charts-waterfall.d.ts +2 -2
  65. package/types/skdx-angular-charts.d.ts +2 -1
@@ -1,19 +1,37 @@
1
- import * as _skdx_angular_charts_internal from '@skdx/angular-charts/internal';
2
1
  import * as _angular_core from '@angular/core';
3
2
 
3
+ /** A plotted value; `null` (or `NaN`) is a gap. */
4
+ type Value = number | null;
4
5
  /** One plotted series: a name for the legend/title and a value per category. */
5
6
  interface Series {
6
7
  name: string;
7
- data: number[];
8
+ data: Value[];
8
9
  /** Any CSS color; defaults to the next `@skdx/tokens` series color. */
9
10
  color?: string | undefined;
10
11
  }
11
- /** 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). */
12
13
  interface Datum {
13
14
  name: string;
14
15
  value: number;
15
16
  color?: string | undefined;
16
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';
17
35
  interface Sized {
18
36
  /** @default 600 (300 for the round charts, 120 for sparklines) */
19
37
  width?: number | undefined;
@@ -23,43 +41,185 @@ interface Sized {
23
41
  legend?: boolean | undefined;
24
42
  /** Show a hover tooltip for the mark under the pointer. @default true */
25
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;
26
108
  }
27
- type Curve = 'linear' | 'monotone';
28
- interface ChartInput extends Sized {
29
- series: Series[];
30
- /** X-axis labels; defaults to the 1-based index of each point. */
31
- categories?: string[] | undefined;
32
- }
33
- interface BarChartInput extends ChartInput {
34
- /** Stack series on top of each other instead of grouping them side by side. @default false */
35
- stacked?: boolean | undefined;
36
- }
37
- interface LineChartInput extends ChartInput {
38
- /** Straight segments, or a monotone cubic that never overshoots the data. @default 'linear' */
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;
39
132
  curve?: Curve | undefined;
40
133
  }
41
- type AreaChartInput = LineChartInput;
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;
42
181
  interface PieChartInput extends Sized {
43
182
  data: Datum[];
44
183
  /** Hole radius as a fraction of the outer radius: 0 is a pie, 0.6 a donut. @default 0 */
45
184
  innerRadius?: number | undefined;
46
185
  /** Write each slice's name and share on the slice. @default false */
47
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;
48
193
  }
49
194
  interface ScatterSeries {
50
195
  name: string;
51
- /** `[x, y]` pairs. */
52
- data: [number, number][];
196
+ /** `[x, y]` pairs, or `[x, y, size]` triples for bubbles. */
197
+ data: ([number, number] | [number, number, number])[];
53
198
  color?: string | undefined;
54
199
  }
55
200
  interface ScatterChartInput extends Sized {
56
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;
57
209
  }
58
210
  interface SparklineInput extends Sized {
59
- data: number[];
211
+ data: Value[];
60
212
  color?: string | undefined;
61
213
  /** @default 'linear' */
62
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;
63
223
  }
64
224
  interface RadarChartInput extends Sized {
65
225
  series: Series[];
@@ -67,21 +227,40 @@ interface RadarChartInput extends Sized {
67
227
  categories: string[];
68
228
  /** Scale every series to its own maximum, so rings read as percentages. @default false */
69
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;
70
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. */
71
240
  interface HeatmapInput extends Sized {
72
- rows: string[];
73
- columns: string[];
74
- /** `data[row][column]`. */
75
- data: number[][];
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;
76
247
  /** The cell color; each cell's opacity follows its value. */
77
248
  color?: string | undefined;
78
249
  /** Split around zero: values below use `negativeColor`, opacity follows the distance from zero. @default false */
79
250
  diverging?: boolean | undefined;
80
251
  /** @default the tokens danger color */
81
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;
82
257
  }
83
258
  interface FunnelChartInput extends Sized {
84
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;
85
264
  }
86
265
  interface Tick {
87
266
  /** Pixel position along the axis. */
@@ -94,11 +273,6 @@ interface Box {
94
273
  width: number;
95
274
  height: number;
96
275
  }
97
- interface Label {
98
- x: number;
99
- y: number;
100
- label: string;
101
- }
102
276
  /** What every axis chart shares: the outer size, the plot box and the axis ticks. */
103
277
  interface Frame extends Canvas {
104
278
  plot: Box;
@@ -107,100 +281,6 @@ interface Frame extends Canvas {
107
281
  /** Pixel y of value 0 (clamped into the plot): where bars and areas start and the x axis is drawn. */
108
282
  baseline: number;
109
283
  }
110
- interface Mark {
111
- series: string;
112
- color: string;
113
- /** Native tooltip text, e.g. `Sales, Q1: 1,234`. */
114
- title: string;
115
- }
116
- interface BarMark extends Mark, Box {
117
- category: string;
118
- value: number;
119
- }
120
- interface PointMark extends Mark {
121
- x: number;
122
- y: number;
123
- }
124
- interface PathMark {
125
- series: string;
126
- color: string;
127
- /** SVG path data. */
128
- d: string;
129
- }
130
- interface SliceMark extends Mark {
131
- name: string;
132
- value: number;
133
- /** 0..1 share of the total. */
134
- percent: number;
135
- d: string;
136
- }
137
- interface CellMark extends Mark, Box {
138
- row: string;
139
- column: string;
140
- value: number;
141
- /** 0.15..1, the value's place between the smallest and largest cell. */
142
- opacity: number;
143
- }
144
- interface StageMark extends Mark, Label {
145
- name: string;
146
- value: number;
147
- /** 0..1 share of the first stage. */
148
- percent: number;
149
- d: string;
150
- }
151
- interface BarChartLayout extends Frame {
152
- bars: BarMark[];
153
- }
154
- interface LineChartLayout extends Frame {
155
- lines: PathMark[];
156
- points: PointMark[];
157
- }
158
- interface AreaChartLayout extends LineChartLayout {
159
- areas: PathMark[];
160
- }
161
- interface ScatterChartLayout extends Frame {
162
- points: PointMark[];
163
- }
164
- interface PieChartLayout extends Canvas {
165
- slices: SliceMark[];
166
- }
167
- interface SparklineLayout extends Canvas {
168
- color: string;
169
- line: string;
170
- area: string;
171
- /** The most recent point, drawn as a dot. */
172
- last: {
173
- x: number;
174
- y: number;
175
- } | undefined;
176
- }
177
- interface RadarChartLayout extends Canvas {
178
- /** Concentric grid polygons, one per tick, innermost first. */
179
- rings: {
180
- d: string;
181
- label: Label;
182
- }[];
183
- spokes: {
184
- x1: number;
185
- y1: number;
186
- x2: number;
187
- y2: number;
188
- }[];
189
- axisLabels: (Label & {
190
- anchor: 'start' | 'middle' | 'end';
191
- })[];
192
- polygons: PathMark[];
193
- points: PointMark[];
194
- }
195
- interface HeatmapLayout extends Canvas {
196
- plot: Box;
197
- cells: CellMark[];
198
- rowLabels: Label[];
199
- columnLabels: Label[];
200
- }
201
- interface FunnelChartLayout extends Canvas {
202
- stages: StageMark[];
203
- }
204
284
  interface SankeyLink {
205
285
  source: string;
206
286
  target: string;
@@ -215,16 +295,25 @@ interface TreemapInput extends Sized {
215
295
  data: TreeNode[];
216
296
  }
217
297
  interface Candle {
218
- label: string;
298
+ label: Category;
219
299
  open: number;
220
300
  high: number;
221
301
  low: number;
222
302
  close: number;
303
+ /** Drawn as a bar in a pane under the candles when any candle has one. */
304
+ volume?: number | undefined;
223
305
  }
224
306
  interface CandlestickInput extends Sized {
225
307
  data: Candle[];
226
308
  /** @default 'linear' */
227
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;
228
317
  }
229
318
  interface WaterfallInput extends Sized {
230
319
  /** Signed deltas, applied in order. */
@@ -237,11 +326,13 @@ interface GanttTask {
237
326
  start: number;
238
327
  end: number;
239
328
  color?: string | undefined;
329
+ /** Tasks sharing a group share a row, so one row can hold several intervals. */
330
+ group?: string | undefined;
240
331
  }
241
332
  interface GanttInput extends Sized {
242
333
  tasks: GanttTask[];
243
- /** Formats the x-axis ticks, e.g. a timestamp as a date. @default formatValue */
244
- format?: ((value: number) => string) | undefined;
334
+ /** Vertical lines and bands in time coordinates, e.g. `{ x: Date.now(), label: 'Today' }`. */
335
+ references?: Reference[] | undefined;
245
336
  }
246
337
  interface BoxplotInput extends Sized {
247
338
  /** One box per series, over that series' raw samples. */
@@ -284,11 +375,56 @@ interface MapInput extends Sized {
284
375
  /** @default 'equirectangular' */
285
376
  projection?: 'equirectangular' | 'mercator' | undefined;
286
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
+ }
287
421
  interface ShapeBase {
288
422
  /** The `data-skdx-part` value, e.g. `node`, `link`, `grid`. */
289
423
  part: string;
290
424
  /** Native tooltip text. */
291
425
  title?: string | undefined;
426
+ /** What the mark stands for; makes it clickable and keyboard-focusable. */
427
+ item?: ChartItem | undefined;
292
428
  }
293
429
  type Shape = (ShapeBase & {
294
430
  kind: 'path';
@@ -296,7 +432,11 @@ type Shape = (ShapeBase & {
296
432
  fill?: string | undefined;
297
433
  stroke?: string | undefined;
298
434
  strokeWidth?: number | undefined;
435
+ strokeLinecap?: 'round' | undefined;
436
+ strokeLinejoin?: 'round' | undefined;
299
437
  opacity?: number | undefined;
438
+ fillOpacity?: number | undefined;
439
+ dash?: string | undefined;
300
440
  }) | (ShapeBase & {
301
441
  kind: 'rect';
302
442
  x: number;
@@ -306,6 +446,7 @@ type Shape = (ShapeBase & {
306
446
  fill: string;
307
447
  stroke?: string | undefined;
308
448
  opacity?: number | undefined;
449
+ rx?: number | undefined;
309
450
  }) | (ShapeBase & {
310
451
  kind: 'line';
311
452
  x1: number;
@@ -314,12 +455,15 @@ type Shape = (ShapeBase & {
314
455
  y2: number;
315
456
  stroke: string;
316
457
  dash?: string | undefined;
458
+ strokeWidth?: number | undefined;
317
459
  }) | (ShapeBase & {
318
460
  kind: 'circle';
319
461
  cx: number;
320
462
  cy: number;
321
463
  r: number;
322
464
  fill: string;
465
+ stroke?: string | undefined;
466
+ opacity?: number | undefined;
323
467
  }) | (ShapeBase & {
324
468
  kind: 'text';
325
469
  x: number;
@@ -328,73 +472,82 @@ type Shape = (ShapeBase & {
328
472
  anchor?: 'start' | 'middle' | 'end' | undefined;
329
473
  baseline?: 'middle' | 'hanging' | undefined;
330
474
  fill?: string | undefined;
475
+ weight?: 'bold' | undefined;
331
476
  });
332
- /** What every layout returns: the outer size, decorations (legend, labels) and the tooltip switch. */
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
+ }
494
+ /** What every layout returns: the outer size, the whole chart as shapes and the tooltip switch. */
333
495
  interface Canvas {
334
496
  width: number;
335
497
  height: number;
336
- /** Decorations drawn after the marks, back to front: the legend, slice labels, or the whole chart. */
498
+ /** Everything drawn, back to front: grid, marks, legend and labels. */
337
499
  shapes: Shape[];
338
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;
339
507
  }
340
- /** A chart described entirely as an ordered list of shapes. */
341
- type ShapeLayout = Canvas;
342
508
  interface LegendItem {
343
509
  name: string;
344
510
  color: string;
345
511
  }
346
512
 
347
- declare function layoutBarChart(input: BarChartInput): BarChartLayout;
513
+ /** Grouped, stacked, horizontal or histogram bars; series may also be lines, areas or ranges. */
514
+ declare const layoutBarChart: (input: BarChartInput) => Canvas;
348
515
 
349
- declare function layoutLineChart(input: LineChartInput): LineChartLayout;
350
- declare function layoutAreaChart(input: AreaChartInput): AreaChartLayout;
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;
351
520
 
352
- declare function layoutScatterChart(input: ScatterChartInput): ScatterChartLayout;
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;
353
528
 
354
- declare function layoutPieChart(input: PieChartInput): PieChartLayout;
529
+ declare function layoutScatterChart(input: ScatterChartInput): Canvas;
355
530
 
356
- declare function layoutSparkline(input: SparklineInput): SparklineLayout;
531
+ declare function layoutPieChart(input: PieChartInput): Canvas;
357
532
 
358
- declare function layoutRadarChart(input: RadarChartInput): RadarChartLayout;
533
+ /** A small axis-less trend: an area (default), a bare line, or bars; optional extremes and last value. */
534
+ declare function layoutSparkline(input: SparklineInput): Canvas;
359
535
 
360
- declare function layoutHeatmap(input: HeatmapInput): HeatmapLayout;
536
+ declare function layoutRadarChart(input: RadarChartInput): Canvas;
361
537
 
362
- declare function layoutFunnelChart(input: FunnelChartInput): FunnelChartLayout;
538
+ declare function layoutHeatmap(input: HeatmapInput): Canvas;
363
539
 
364
- /** Maps `[d0, d1]` onto `[r0, r1]` linearly; a zero-width domain maps to `r0`. */
365
- declare function linearScale([d0, d1]: readonly [number, number], [r0, r1]: readonly [number, number]): (value: number) => number;
366
- /** Round tick values covering `[min, max]` with a 1/2/5 step, about `count` of them. */
367
- declare function niceTicks(min: number, max: number, count?: number): number[];
368
- declare const formatValue: (v: number) => string;
369
- /** SVG path through the points: straight segments, or a monotone cubic (Fritsch–Carlson) that never overshoots. */
370
- declare function pathThrough(points: {
371
- x: number;
372
- y: number;
373
- }[], curve?: 'linear' | 'monotone'): string;
374
- /** Ticks at powers of ten covering `[min, max]` (both > 0), with 2× and 5× steps when a decade or less. */
375
- declare function logTicks(min: number, max: number): number[];
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
+ */
544
+ declare function layoutFunnelChart(input: FunnelChartInput): Canvas;
376
545
 
377
- /** A tooltip box next to the pointer, kept inside the canvas. */
378
- declare function tooltipShapes(x: number, y: number, text: string, width: number, height: number): Shape[];
379
- /** Attributes for the `<svg>` root every framework renders. */
380
- declare function svgAttrs(frame: {
381
- width: number;
382
- height: number;
383
- }, kind: string, label: string): {
384
- readonly viewBox: `0 0 ${number} ${number}`;
385
- readonly width: number;
386
- readonly height: number;
387
- readonly role: "img";
388
- readonly 'aria-label': string;
389
- readonly 'data-skdx-chart': string;
390
- readonly 'font-family': "var(--skdx-font-family)";
391
- readonly 'font-size': "var(--skdx-font-size-xs)";
392
- };
393
546
  /**
394
- * Tooltip shapes for the mark under the pointer, or none. Reads the mark's
395
- * `<title>` and converts the pointer position into viewBox units.
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.
396
549
  */
397
- declare function hoverTooltip(target: EventTarget | null, svg: Element, clientX: number, clientY: number, width: number, height: number): Shape[];
550
+ declare function layoutRadialBar(input: RadialBarInput): Canvas;
398
551
 
399
552
  /**
400
553
  * Series colors, cycling through the `@skdx/tokens` scales so charts follow the
@@ -405,80 +558,202 @@ declare const CHART_COLORS: {
405
558
  readonly axis: "var(--skdx-color-border-strong)";
406
559
  readonly grid: "var(--skdx-color-border-subtle)";
407
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)";
408
564
  readonly fontFamily: "var(--skdx-font-family)";
409
565
  readonly fontSize: "var(--skdx-font-size-xs)";
410
566
  };
411
- declare const seriesColor: (index: number, override?: string | undefined) => string;
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;
412
640
 
413
- declare function layoutSankey(input: SankeyInput): ShapeLayout;
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;
414
661
 
415
- declare function layoutTreemap(input: TreemapInput): ShapeLayout;
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;
416
674
 
417
- declare function layoutCandlestick(input: CandlestickInput): ShapeLayout;
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[];
418
680
 
419
- declare function layoutWaterfall(input: WaterfallInput): ShapeLayout;
681
+ declare function layoutSankey(input: SankeyInput): Canvas;
420
682
 
421
- declare function layoutGantt(input: GanttInput): ShapeLayout;
683
+ declare function layoutTreemap(input: TreemapInput): Canvas;
422
684
 
423
- /** Five-number summary with Tukey fences: whiskers reach the last sample within 1.5 IQR. */
424
- declare function boxStats(data: number[]): {
425
- q1: number;
426
- median: number;
427
- q3: number;
428
- low: number;
429
- high: number;
430
- outliers: number[];
431
- };
432
- declare function layoutBoxplot(input: BoxplotInput): ShapeLayout;
685
+ /** Candles or OHLC bars on a time axis, with an optional volume pane, references, zoom and brush. */
686
+ declare function layoutCandlestick(input: CandlestickInput): Canvas;
433
687
 
434
- declare function layoutSunburst(input: SunburstInput): ShapeLayout;
688
+ declare function layoutWaterfall(input: WaterfallInput): Canvas;
435
689
 
436
- declare function layoutChord(input: ChordInput): ShapeLayout;
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
+ */
694
+ declare function layoutGantt(input: GanttInput): Canvas;
695
+
696
+ declare function layoutBoxplot(input: BoxplotInput): Canvas;
697
+
698
+ declare function layoutSunburst(input: SunburstInput): Canvas;
699
+
700
+ declare function layoutChord(input: ChordInput): Canvas;
437
701
 
438
702
  /** Projection fitted to the features' bounds (equirectangular by default, or Mercator); opacity follows the value. */
439
- declare function layoutMap(input: MapInput): ShapeLayout;
703
+ declare function layoutMap(input: MapInput): Canvas;
440
704
 
441
- /** The accessible `<svg>` root every chart renders into: projected marks, then decorations, then the hover tooltip. */
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
+ */
442
709
  declare class SkdxChartRootComponent {
443
710
  readonly layout: _angular_core.InputSignal<Canvas>;
444
711
  readonly kind: _angular_core.InputSignal<string>;
445
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>;
446
725
  protected readonly colors: {
447
726
  readonly axis: "var(--skdx-color-border-strong)";
448
727
  readonly grid: "var(--skdx-color-border-subtle)";
449
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)";
450
732
  readonly fontFamily: "var(--skdx-font-family)";
451
733
  readonly fontSize: "var(--skdx-font-size-xs)";
452
734
  };
735
+ protected readonly duration: _angular_core.Signal<string | null>;
736
+ private readonly pointers;
737
+ private readonly svg;
738
+ constructor();
453
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;
454
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;
455
753
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxChartRootComponent, never>;
456
- 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, ["*"], 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>;
457
755
  }
458
- /** The `<svg>` root, grid, axis and tick labels every axis chart shares; marks are projected. */
459
- declare class SkdxChartFrameComponent {
460
- readonly layout: _angular_core.InputSignal<Frame>;
461
- readonly kind: _angular_core.InputSignal<string>;
462
- readonly label: _angular_core.InputSignal<string>;
463
- protected readonly colors: {
464
- readonly axis: "var(--skdx-color-border-strong)";
465
- readonly grid: "var(--skdx-color-border-subtle)";
466
- readonly label: "var(--skdx-color-text-muted)";
467
- readonly fontFamily: "var(--skdx-font-family)";
468
- readonly fontSize: "var(--skdx-font-size-xs)";
469
- };
470
- protected readonly plot: _angular_core.Signal<_skdx_angular_charts_internal.Box>;
471
- protected readonly right: _angular_core.Signal<number>;
472
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxChartFrameComponent, never>;
473
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkdxChartFrameComponent, "skdx-chart-frame", never, { "layout": { "alias": "layout"; "required": true; "isSignal": true; }; "kind": { "alias": "kind"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
474
- }
475
- /** A dot per value with its native tooltip. */
476
- declare class SkdxChartPointsComponent {
477
- readonly points: _angular_core.InputSignal<PointMark[]>;
478
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxChartPointsComponent, never>;
479
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkdxChartPointsComponent, "g[skdxChartPoints]", never, { "points": { "alias": "points"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
480
- }
481
- /** Size and label inputs every chart takes. */
756
+ /** Size, state, formatting, accessibility and interaction inputs every chart takes. */
482
757
  declare abstract class SkdxSizedBase {
483
758
  readonly width: _angular_core.InputSignal<number | undefined>;
484
759
  readonly height: _angular_core.InputSignal<number | undefined>;
@@ -488,45 +763,133 @@ declare abstract class SkdxSizedBase {
488
763
  readonly legend: _angular_core.InputSignal<boolean>;
489
764
  /** Show a hover tooltip for the mark under the pointer. */
490
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;
491
796
  protected sized(): {
492
797
  width: number | undefined;
493
798
  height: number | undefined;
799
+ animate: number | boolean;
800
+ responsive: boolean;
494
801
  legend: boolean;
495
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;
496
812
  };
497
813
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxSizedBase, never>;
498
- 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>;
499
815
  }
500
- /** Inputs the category charts take. */
816
+ /** Inputs the cartesian charts (bar, line, area) take. */
501
817
  declare abstract class SkdxChartBase extends SkdxSizedBase {
502
- readonly series: _angular_core.InputSignal<Series[]>;
503
- readonly categories: _angular_core.InputSignal<string[] | undefined>;
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>;
504
846
  protected input(): {
505
- series: Series[];
506
- categories: string[] | undefined;
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;
507
867
  width: number | undefined;
508
868
  height: number | undefined;
869
+ animate: number | boolean;
870
+ responsive: boolean;
509
871
  legend: boolean;
510
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;
511
882
  };
512
883
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxChartBase, never>;
513
- 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>;
514
- }
515
-
516
- /** Line strokes plus a dot per value, shared by the line and area charts. */
517
- declare class SkdxChartLinesComponent {
518
- readonly lines: _angular_core.InputSignal<PathMark[]>;
519
- readonly points: _angular_core.InputSignal<PointMark[]>;
520
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxChartLinesComponent, never>;
521
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkdxChartLinesComponent, "g[skdxChartLines]", never, { "lines": { "alias": "lines"; "required": true; "isSignal": true; }; "points": { "alias": "points"; "required": true; "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>;
522
885
  }
523
886
 
524
- /** 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. */
525
888
  declare class SkdxChartShapesComponent {
526
889
  readonly shapes: _angular_core.InputSignal<Shape[]>;
527
890
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SkdxChartShapesComponent, never>;
528
891
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SkdxChartShapesComponent, "g[skdxChartShapes]", never, { "shapes": { "alias": "shapes"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
529
892
  }
530
893
 
531
- export { CHART_COLORS, SERIES_COLORS, SkdxChartBase, SkdxChartFrameComponent, SkdxChartLinesComponent, SkdxChartPointsComponent, SkdxChartRootComponent, SkdxChartShapesComponent, SkdxSizedBase, boxStats, formatValue, hoverTooltip, layoutAreaChart, layoutBarChart, layoutBoxplot, layoutCandlestick, layoutChord, layoutFunnelChart, layoutGantt, layoutHeatmap, layoutLineChart, layoutMap, layoutPieChart, layoutRadarChart, layoutSankey, layoutScatterChart, layoutSparkline, layoutSunburst, layoutTreemap, layoutWaterfall, linearScale, logTicks, niceTicks, pathThrough, seriesColor, svgAttrs, tooltipShapes };
532
- export type { AreaChartInput, AreaChartLayout, BarChartInput, BarChartLayout, BarMark, Box, BoxplotInput, Candle, CandlestickInput, Canvas, CellMark, ChartInput, ChordInput, Curve, Datum, Frame, FunnelChartInput, FunnelChartLayout, GanttInput, GanttTask, GeoMultiPolygon, GeoPolygon, HeatmapInput, HeatmapLayout, Label, LegendItem, LineChartInput, LineChartLayout, MapFeature, MapInput, Mark, PathMark, PieChartInput, PieChartLayout, PointMark, RadarChartInput, RadarChartLayout, SankeyInput, SankeyLink, ScatterChartInput, ScatterChartLayout, ScatterSeries, Series, Shape, ShapeLayout, Sized, SliceMark, SparklineInput, SparklineLayout, StageMark, 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 };