@ids-group-ltd/ids-design-system 0.13.1 → 0.13.3

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 (62) hide show
  1. package/CHANGELOG.md +626 -0
  2. package/components.md +17 -9
  3. package/docs/agent/INDEX.md +1 -1
  4. package/docs/agent/charts/ds-column-chart.md +3 -2
  5. package/docs/agent/charts/ds-line-chart.md +2 -1
  6. package/docs/agent/feedback/ds-bar.md +13 -0
  7. package/docs/agent/forms/ds-button.md +1 -1
  8. package/docs/agent/forms/ds-icon-button.md +1 -1
  9. package/docs/agent/surfaces/ds-card.md +1 -1
  10. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +81 -13
  11. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
  12. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +95 -0
  13. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -0
  14. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +3 -0
  15. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
  16. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +47 -5
  17. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
  18. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +198 -50
  19. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
  20. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +973 -0
  21. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -0
  22. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +172 -111
  23. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
  24. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +86 -15
  25. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +1 -1
  26. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +87 -12
  27. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
  28. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +193 -98
  29. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
  30. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
  31. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
  32. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +233 -33
  33. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  34. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +1 -1
  35. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
  36. package/fesm2022/ids-group-ltd-ids-design-system.mjs +2 -1
  37. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  38. package/migrations/0.13.2.json +269 -0
  39. package/migrations/0.13.3.json +211 -0
  40. package/package.json +17 -9
  41. package/styles/_chart-frame.scss +117 -10
  42. package/styles/_chart-interactive.scss +12 -3
  43. package/styles/_overlay-motion.scss +7 -6
  44. package/styles/_tokens-charts.scss +29 -5
  45. package/styles/_tokens.scss +1 -1
  46. package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +68 -5
  47. package/types/ids-group-ltd-ids-design-system-components-bar.d.ts +63 -0
  48. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +3 -2
  49. package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +25 -2
  50. package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +21 -4
  51. package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +543 -0
  52. package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +125 -37
  53. package/types/ids-group-ltd-ids-design-system-components-donut-chart.d.ts +43 -4
  54. package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +52 -4
  55. package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +90 -23
  56. package/types/ids-group-ltd-ids-design-system-components.d.ts +91 -16
  57. package/types/ids-group-ltd-ids-design-system-core.d.ts +73 -6
  58. package/types/ids-group-ltd-ids-design-system.d.ts +7 -6
  59. package/docs/agent/feedback/ds-progress.md +0 -7
  60. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +0 -41
  61. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +0 -1
  62. package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +0 -22
@@ -0,0 +1,543 @@
1
+ import * as _ids_group_ltd_ids_design_system_components from '@ids-group-ltd/ids-design-system/components';
2
+ import { NiceDomain, defaultChartFormat } from '@ids-group-ltd/ids-design-system/components';
3
+ import { ChartThresholdDash, ChartStackMode, ChartAxis, ChartFrame, ChartValueFormat, ChartAxisMode, ChartThreshold } from '@ids-group-ltd/ids-design-system/core';
4
+ import * as _angular_core from '@angular/core';
5
+ import { InjectionToken, Signal, OnDestroy } from '@angular/core';
6
+ import * as _ids_group_ltd_ids_design_system_components_chart_tooltip from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
7
+ import { ChartItemTooltipTrigger, ChartTooltipContext } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
8
+ import { SafeHtml } from '@angular/platform-browser';
9
+
10
+ /** The viewBox's height, and the `<svg>`'s rendered height in pixels - the two are the same
11
+ * number, which is what holds the 1:1 scale on the vertical axis too.
12
+ *
13
+ * `valueSpace` is always budgeted above the plot, for a value label over the tallest mark. It is
14
+ * budgeted a SECOND time below the baseline only when the domain reaches under zero, where a
15
+ * negative mark's label would otherwise print into the category labels: reserving it for every
16
+ * chart costs the all-positive ones - the common case - that much height for nothing.
17
+ *
18
+ * @internal */
19
+ declare function chartViewHeight(plotHeight: number, valueSpace: number, reservesBelowBaseline?: boolean): number;
20
+ /** @internal */
21
+ interface ThresholdMark {
22
+ /** Position in the list, not the reading: two thresholds may legitimately name the same value -
23
+ * a target and the floor of the band around it - and keying on the value would collapse them
24
+ * into one drawn line. */
25
+ readonly key: number;
26
+ readonly label: string;
27
+ readonly color: string | null;
28
+ readonly dash: ChartThresholdDash;
29
+ readonly band: boolean;
30
+ readonly left: number;
31
+ readonly right: number;
32
+ readonly width: number;
33
+ readonly y: number;
34
+ readonly top: number;
35
+ readonly height: number;
36
+ readonly labelX: number;
37
+ readonly labelY: number;
38
+ }
39
+ /** @internal */
40
+ interface SecondaryAxis {
41
+ readonly domain: NiceDomain;
42
+ readonly ticks: readonly number[];
43
+ /** True when the labels below belong on the PRIMARY axis's own tick rows, so the plot carries
44
+ * one set of gridlines rather than two crossing each other. */
45
+ readonly aligned: boolean;
46
+ }
47
+ /** Where one series' segment starts and ends on the value axis, in the axis's own unit - or in
48
+ * shares of the category total under `'normalized'`.
49
+ *
50
+ * @internal */
51
+ interface ChartStackOffset {
52
+ readonly from: number;
53
+ readonly to: number;
54
+ }
55
+ /** Every segment's span on the value axis, series-major: `offsets[series][category]`.
56
+ *
57
+ * `'none'` and `'grouped'` give every series the same span it would have alone - the two differ in
58
+ * where the band puts them, which is geometry rather than value. The stacking modes run a
59
+ * POSITIVE and a NEGATIVE pile per category, so a negative segment hangs below the baseline
60
+ * instead of being subtracted from the positive pile it sits in.
61
+ *
62
+ * `'normalized'` divides a running SUM rather than each share in turn: adding 20/60 to 40/60
63
+ * lands on 0.9999999999999999, which draws a category that visibly falls short of full.
64
+ *
65
+ * @internal */
66
+ declare function stackOffsets(series: readonly (readonly number[])[], mode: ChartStackMode): readonly (readonly ChartStackOffset[])[];
67
+
68
+ /** The drawable rectangle inside `ds-chart`, in CSS pixels: the container measures itself and
69
+ * sizes its `viewBox` so one user unit is one pixel. A length written into a mark is therefore
70
+ * the length it says it is, at every card width. The gutters outside it carry the axis labels. */
71
+ interface ChartPlot {
72
+ readonly width: number;
73
+ readonly height: number;
74
+ readonly left: number;
75
+ readonly top: number;
76
+ }
77
+ /** What `ds-chart` offers the marks projected into it: one shared coordinate space, one shared
78
+ * value domain, and one shared idea of which category the reader is on.
79
+ *
80
+ * A mark injects the token, reports the values it intends to draw, and reads its coordinates
81
+ * back. It never sees the other marks, and the container never learns what kind of mark it is
82
+ * holding - which is what lets a reference line, a bar series and an annotation share an axis
83
+ * without any of them importing the others. */
84
+ interface ChartScales {
85
+ readonly categories: Signal<readonly string[]>;
86
+ readonly plot: Signal<ChartPlot>;
87
+ /** The CENTRE of a category's band. A mark with a width of its own subtracts half of
88
+ * `bandWidth` to reach its leading edge. */
89
+ readonly xPosition: Signal<(index: number) => number>;
90
+ /** Clamped into the plot, so a value outside the drawn domain lands on an edge rather than
91
+ * over the axis labels. */
92
+ readonly yPosition: Signal<(value: number) => number>;
93
+ readonly bandWidth: Signal<number>;
94
+ /** The rectangle a secondary-axis mark draws in. The same one as `plot` unless the two axes are
95
+ * stacked, where it is the lower of the two plots. */
96
+ readonly secondaryPlot: Signal<ChartPlot>;
97
+ /** `yPosition` for the second value axis. Identical to it while no mark has reported against
98
+ * that axis, so a mark may read it without first asking whether one exists. */
99
+ readonly secondaryYPosition: Signal<(value: number) => number>;
100
+ readonly hasSecondaryAxis: Signal<boolean>;
101
+ /** The y of value zero, which is the baseline a bar grows from and the line a signed domain
102
+ * is read against. */
103
+ readonly zeroOffset: Signal<number>;
104
+ /** The category under the pointer or the keyboard, or `-1` for none. */
105
+ readonly activeIndex: Signal<number>;
106
+ setActiveIndex(index: number): void;
107
+ /** Contributes values to the shared domain under an id the caller owns. Reporting again with
108
+ * the same id replaces that contribution.
109
+ *
110
+ * Call it from an `effect`: a mark whose values come from a required `input` cannot read them
111
+ * in its constructor, and the effect is also what re-reports when they change. */
112
+ reportDomain(id: string, values: readonly number[], axis?: ChartAxis): void;
113
+ /** Withdraws a contribution, which a mark does in `ngOnDestroy`. */
114
+ releaseDomain(id: string): void;
115
+ }
116
+ declare const CHART_SCALES: InjectionToken<ChartScales>;
117
+
118
+ declare class ChartComponent implements ChartScales {
119
+ /** The category axis. Every projected mark is positioned against this list, so its length is
120
+ * what decides how many bands the plot has. */
121
+ readonly categories: _angular_core.InputSignal<readonly string[]>;
122
+ /** How many value-axis ticks to aim for. A hint, not a count: ticks snap to a round step, so
123
+ * the axis may carry one more or one fewer. */
124
+ readonly tickCount: _angular_core.InputSignalWithTransform<number, unknown>;
125
+ /** Pins the floor of the value axis instead of deriving it from the marks. It only ever opens
126
+ * the axis further: a floor above the data would push readings off the plot. */
127
+ readonly min: _angular_core.InputSignalWithTransform<number | null, number | null>;
128
+ /** Pins the ceiling of the value axis. See `min`. Two charts drawn one subject at a time are
129
+ * only comparable when both are pinned. */
130
+ readonly max: _angular_core.InputSignalWithTransform<number | null, number | null>;
131
+ /** Height of the plot itself, in CSS pixels, axis labels and value headroom excluded. Real
132
+ * pixels rather than a share of the width: one viewBox unit is one pixel, so a card that
133
+ * widens spreads the categories further apart and leaves the plot exactly this tall. */
134
+ readonly plotHeight: _angular_core.InputSignalWithTransform<number, unknown>;
135
+ /** Width in CSS pixels of the gutter down the left that carries the value-axis labels. Widen it
136
+ * for long tick labels; the plot takes whatever is left. */
137
+ readonly axisGutter: _angular_core.InputSignalWithTransform<number, unknown>;
138
+ /** Pixels reserved for a value label at each end of the plot: above the top tick for a mark at
139
+ * the ceiling, and below the baseline for a negative mark, whose label would otherwise print
140
+ * over the category labels. Reserved whether or not a mark draws one, because a chart that
141
+ * gains a label on one value must not change height. */
142
+ readonly valueSpace: _angular_core.InputSignalWithTransform<number, unknown>;
143
+ /** Printed above the plot as the chart's visible title. */
144
+ readonly caption: _angular_core.InputSignal<string | null>;
145
+ /** Whether the projected marks answer to the pointer and the keyboard. The container draws no
146
+ * marks of its own and only reads this for the plot's role: a group of controls to step
147
+ * through, against a single image to be described. */
148
+ readonly interactive: _angular_core.InputSignalWithTransform<boolean, unknown>;
149
+ /** Accessible name for the plot. The container holds no readings of its own, so a chart that
150
+ * needs its numbers described supplies the sentence here - `describeSeries` is what the five
151
+ * presets build it with. It is the whole label in the static case, where nothing else is
152
+ * reachable. */
153
+ readonly summary: _angular_core.InputSignal<string | null>;
154
+ /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;
155
+ * `'none'` leaves it bare, for one placed inside a card the page has already drawn. Unset
156
+ * falls back to `DS_CONFIG.chart.frame`, then `'auto'`. */
157
+ readonly frame: _angular_core.InputSignal<ChartFrame | null>;
158
+ /** Draws a placeholder in place of the plot, at the plot's own height, so the page does not
159
+ * resize when the data lands. */
160
+ readonly loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
161
+ /** Shown in place of the plot when `categories` is empty. Unset falls back to
162
+ * `DS_CONFIG.chart.emptyText`, then `'No data'`. */
163
+ readonly emptyText: _angular_core.InputSignal<string | null>;
164
+ /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty
165
+ * `categories`, because "the request failed" and "there is nothing to show" read the same to a
166
+ * reader and mean opposite things. */
167
+ readonly error: _angular_core.InputSignalWithTransform<boolean, unknown>;
168
+ /** The message the error state prints. Unset falls back to `DS_CONFIG.chart.errorText`, then
169
+ * `'Could not load the data'`. */
170
+ readonly errorText: _angular_core.InputSignal<string | null>;
171
+ /** Formats the value-axis ticks. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the
172
+ * browser's locale grouping with a K/M/B suffix past four digits. */
173
+ readonly valueFormat: _angular_core.InputSignal<ChartValueFormat | null>;
174
+ /** How the second value axis relates to the first, once a mark has reported against it. The
175
+ * same four words `ds-line-chart` takes. */
176
+ readonly secondaryAxisMode: _angular_core.InputSignal<ChartAxisMode>;
177
+ /** Paints the first axis's tick labels in the colour of the marks measured against it. A
178
+ * two-scale plot is ambiguous without it - nothing on the canvas says which of two lines is
179
+ * read against which set of numbers - and it is the author, not the container, who knows which
180
+ * colour an axis belongs to, because several marks can share one. */
181
+ readonly axisColor: _angular_core.InputSignal<string | null>;
182
+ /** `axisColor` for the second axis. */
183
+ readonly secondaryAxisColor: _angular_core.InputSignal<string | null>;
184
+ readonly frameResolved: Signal<ChartFrame>;
185
+ protected readonly emptyTextResolved: Signal<string>;
186
+ protected readonly errorTextResolved: Signal<string>;
187
+ protected readonly valueFormatResolved: Signal<typeof defaultChartFormat>;
188
+ private readonly host;
189
+ /** The `<svg>`'s own rendered width: `:host(.framed)` carries the frame padding, so the host's
190
+ * CONTENT box - which is what a `ResizeObserver` reports - is the box the canvas fills at
191
+ * `inline-size: 100%`. Measuring the host is therefore measuring the canvas. */
192
+ private readonly measuredWidth;
193
+ protected readonly viewWidth: Signal<number>;
194
+ /** Whether the marks may animate yet. The first frame draws at `CHART_FALLBACK_WIDTH` scaled to
195
+ * fit, so the measurement that follows moves every mark - and a mark that transitions its
196
+ * geometry would play that correction as an animated slide on every load, hydration included.
197
+ *
198
+ * Two frames, not one. A transition starts when the property changes in a style that also
199
+ * enables it, so the enabling must not land in the same style recalculation as the correction.
200
+ * One `requestAnimationFrame` is not enough: scheduled from the change detection that writes
201
+ * the corrected geometry, it runs at the START of the next frame, still before that geometry
202
+ * has been through a recalculation. Measured with one frame: `transitionrun` on `x` and
203
+ * `width`, both marks, on the same tick the class cleared. */
204
+ protected readonly settled: _angular_core.WritableSignal<boolean>;
205
+ constructor();
206
+ private widestLabel;
207
+ /** Two plots, one above the other, sharing the category axis: the only mode whose second axis
208
+ * is a second PLOT rather than a second scale over the first. */
209
+ protected readonly stacked: Signal<boolean>;
210
+ protected readonly viewHeight: Signal<number>;
211
+ /** One viewBox unit is one CSS pixel, in both axes. That is the whole point of measuring: a
212
+ * radius, a gutter or a width cap set anywhere inside the plot is then the length it says it
213
+ * is, at every card width, instead of a share of one that a fixed viewBox stretches. */
214
+ protected readonly viewBox: Signal<string>;
215
+ /** Widest tick label actually rendered, in the CSS pixels the canvas is drawn in. Zero until the
216
+ * first read, and zero under SSR, where `axisGutter` alone decides. */
217
+ private readonly measuredLabelWidth;
218
+ /** `axisGutter` is the FLOOR, not the answer: a compact number is far wider in some locales than
219
+ * in others - `3,5 тыс.` against `3.5k` - and an SVG canvas CLIPS what a DOM column merely
220
+ * overflowed, so a fixed gutter silently eats the leading digit. The gutter takes whichever is
221
+ * larger, so setting the token still guarantees at least that much room.
222
+ *
223
+ * This converges rather than oscillating: a tick's TEXT is decided by the domain and the tick
224
+ * count, neither of which the gutter feeds, so widening it moves the labels without rewriting
225
+ * them and the second measurement equals the first. */
226
+ protected readonly effectiveAxisGutter: Signal<number>;
227
+ /** Widest secondary tick label, measured the same way and for the same reason as the primary
228
+ * one: those labels sit OUTSIDE the plot's right edge and an SVG canvas clips what a DOM
229
+ * column merely overflowed. */
230
+ private readonly measuredSecondaryLabelWidth;
231
+ /** The plot gives the right-hand labels room only when they are drawn there - a stacked second
232
+ * axis puts both label columns down the left, so the plot keeps the full width. */
233
+ protected readonly rightGutter: Signal<number>;
234
+ readonly plot: Signal<ChartPlot>;
235
+ readonly secondaryPlot: Signal<ChartPlot>;
236
+ private readonly reportedDomains;
237
+ reportDomain(id: string, values: readonly number[], axis?: ChartAxis): void;
238
+ private valuesOn;
239
+ releaseDomain(id: string): void;
240
+ /** Compared by value, which is what stops a mark that reports AND reads `yPosition()` in one
241
+ * effect from running forever: every report allocates a fresh `Map` and `niceDomain` a fresh
242
+ * object, so identity always differs and the read would re-arm the write. Measured without it:
243
+ * 97507 effect runs in 45 seconds, no Angular loop error, renderer unresponsive. */
244
+ protected readonly domain: Signal<_ids_group_ltd_ids_design_system_components.NiceDomain>;
245
+ readonly hasSecondaryAxis: Signal<boolean>;
246
+ protected readonly secondary: Signal<SecondaryAxis>;
247
+ readonly secondaryYPosition: Signal<(value: number) => number>;
248
+ protected readonly secondaryTicks: Signal<{
249
+ value: number;
250
+ y: number;
251
+ label: string;
252
+ }[]>;
253
+ /** A second set of gridlines only where the two scales do NOT share rows: drawn against an
254
+ * aligned axis they would land on the primary's own lines and double every stroke. */
255
+ protected readonly showSecondaryGridlines: Signal<boolean>;
256
+ protected readonly secondaryLabelX: Signal<number>;
257
+ protected readonly secondaryLabelAnchor: Signal<"end" | "start">;
258
+ protected readonly secondaryPlotBottom: Signal<number>;
259
+ /** No tint on a single-scale plot: one axis needs no telling apart, and colouring it would only
260
+ * restate the marks' own colour in the furniture. */
261
+ protected readonly axisLabelFill: Signal<string | null>;
262
+ protected readonly secondaryAxisLabelFill: Signal<string | null>;
263
+ private readonly bands;
264
+ readonly bandWidth: Signal<number>;
265
+ readonly xPosition: Signal<(index: number) => number>;
266
+ readonly yPosition: Signal<(value: number) => number>;
267
+ readonly zeroOffset: Signal<number>;
268
+ readonly activeIndex: _angular_core.WritableSignal<number>;
269
+ setActiveIndex(index: number): void;
270
+ protected readonly plotRight: Signal<number>;
271
+ protected readonly plotBottom: Signal<number>;
272
+ protected readonly axisLabelX: Signal<number>;
273
+ /** Clears the same reservation the view height budgets, and only when it is there: adding it
274
+ * unconditionally would drop the labels past a viewBox that no longer holds the space. */
275
+ protected readonly categoryLabelY: Signal<number>;
276
+ protected readonly ticks: Signal<{
277
+ value: number;
278
+ y: number;
279
+ label: string;
280
+ }[]>;
281
+ protected readonly categoryLabels: Signal<{
282
+ x: number;
283
+ text: string;
284
+ }[]>;
285
+ protected readonly reachesBelowZero: Signal<boolean>;
286
+ /** Empty is read off `categories` alone, never off the reported domains: the marks are
287
+ * projected INTO the branch that this decides, so a container that waited for a report before
288
+ * rendering them would never receive one. */
289
+ protected readonly isEmpty: Signal<boolean>;
290
+ protected readonly accessibleName: Signal<string>;
291
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartComponent, never>;
292
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartComponent, "ds-chart", never, { "categories": { "alias": "categories"; "required": false; "isSignal": true; }; "tickCount": { "alias": "tickCount"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "plotHeight": { "alias": "plotHeight"; "required": false; "isSignal": true; }; "axisGutter": { "alias": "axisGutter"; "required": false; "isSignal": true; }; "valueSpace": { "alias": "valueSpace"; "required": false; "isSignal": true; }; "caption": { "alias": "caption"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "summary": { "alias": "summary"; "required": false; "isSignal": true; }; "frame": { "alias": "frame"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "errorText": { "alias": "errorText"; "required": false; "isSignal": true; }; "valueFormat": { "alias": "valueFormat"; "required": false; "isSignal": true; }; "secondaryAxisMode": { "alias": "secondaryAxisMode"; "required": false; "isSignal": true; }; "axisColor": { "alias": "axisColor"; "required": false; "isSignal": true; }; "secondaryAxisColor": { "alias": "secondaryAxisColor"; "required": false; "isSignal": true; }; }, {}, never, ["[dsReferenceLine]", "*", "[dsReferenceLabel]"], true, never>;
293
+ }
294
+
295
+ /** @internal */
296
+ interface ColumnSeriesPoint {
297
+ id?: string;
298
+ label: string;
299
+ value: number;
300
+ color?: string;
301
+ fill?: 'solid' | 'hatched';
302
+ }
303
+ /**
304
+ * One column per datum, drawn against the scales `ds-chart` supplies.
305
+ *
306
+ * Hosted on a `<g>` rather than an element of its own: an element the SVG specification does not
307
+ * know is not rendered, and neither are its descendants, so `<ds-column-series>` inside the
308
+ * container's canvas would draw nothing. Written as `<svg:g dsColumnSeries>`.
309
+ *
310
+ * @internal
311
+ */
312
+ declare class ColumnSeriesComponent implements OnDestroy {
313
+ private readonly scales;
314
+ /** Not `input.required`: the preset reads `tooltipContext()` from a binding on this same
315
+ * element, and a required input throws NG0950 for the pass before its own value is written. */
316
+ readonly data: _angular_core.InputSignal<readonly ColumnSeriesPoint[]>;
317
+ readonly showValues: _angular_core.InputSignalWithTransform<boolean, unknown>;
318
+ readonly interactive: _angular_core.InputSignalWithTransform<boolean, unknown>;
319
+ readonly pinOnClick: _angular_core.InputSignalWithTransform<boolean, unknown>;
320
+ readonly dimOthers: _angular_core.InputSignalWithTransform<boolean, unknown>;
321
+ readonly staggerMs: _angular_core.InputSignalWithTransform<number, unknown>;
322
+ readonly partOfWhole: _angular_core.InputSignalWithTransform<boolean, unknown>;
323
+ readonly tooltip: _angular_core.InputSignal<ChartItemTooltipTrigger>;
324
+ readonly tooltipAnchor: _angular_core.InputSignal<"mark" | "cell">;
325
+ readonly tooltipLingerMs: _angular_core.InputSignalWithTransform<number, unknown>;
326
+ readonly valueFormat: _angular_core.InputSignal<ChartValueFormat>;
327
+ /** The mark's share of its category's own slot, before the maximum width caps it. Measured off
328
+ * the slot rather than off `bandWidth()`, which has the container's own padding already taken
329
+ * out of it - applying both would narrow every uncapped column twice. */
330
+ readonly columnWidthRatio: _angular_core.InputSignalWithTransform<number, unknown>;
331
+ /** This series' position among the slots a category's band is divided into. */
332
+ readonly slot: _angular_core.InputSignalWithTransform<number, unknown>;
333
+ /** How many slots the band is divided into - the number of series drawn side by side. One, the
334
+ * default, is the whole band, which is what a single series has always taken. */
335
+ readonly slotCount: _angular_core.InputSignalWithTransform<number, unknown>;
336
+ /** Where each mark starts and ends on the value axis, one entry per point. Unset, every mark
337
+ * runs from zero to its own value, which is the unstacked case. */
338
+ readonly offsets: _angular_core.InputSignal<readonly ChartStackOffset[] | null>;
339
+ /** One colour for the whole series, which is what several series drawn together need. Unset,
340
+ * each mark takes the categorical palette by its own position - the right reading when the
341
+ * marks ARE the categories, which is the single-series case. A point's own colour wins over
342
+ * both. */
343
+ readonly seriesColor: _angular_core.InputSignal<string | null>;
344
+ /** `seriesColor` for the fill pattern. A point's own `fill` wins. */
345
+ readonly seriesFill: _angular_core.InputSignal<"solid" | "hatched" | null>;
346
+ /** Names the series in the tooltip, where the category then becomes the panel's heading. Unset,
347
+ * the panel names the category instead, which is what a chart of one series has to say. */
348
+ readonly seriesLabel: _angular_core.InputSignal<string | null>;
349
+ readonly pointClicked: _angular_core.OutputEmitterRef<ColumnSeriesPoint>;
350
+ private readonly seriesId;
351
+ private readonly domainId;
352
+ /** Per instance: two charts on one page would otherwise share the first `<pattern>` to reach the
353
+ * document, and every hatched mark would take that chart's colour. */
354
+ protected readonly hatchId: string;
355
+ /** Where each mark actually spans, which is what the axis has to hold: a stacked segment's top
356
+ * is its category's running total, not its own reading. */
357
+ private readonly spans;
358
+ constructor();
359
+ ngOnDestroy(): void;
360
+ readonly activeMark: _ids_group_ltd_ids_design_system_components_chart_tooltip.ChartActiveMark;
361
+ /** One SERIES' slot inside a category's band: the whole band while a chart draws one series,
362
+ * a share of it per series when several are grouped. The box that catches the pointer is sized
363
+ * from this rather than from the drawn column, so a short column stays reachable. */
364
+ private readonly slotStep;
365
+ protected readonly slotStepPx: _angular_core.Signal<string>;
366
+ protected readonly markWidthPx: _angular_core.Signal<string>;
367
+ /** The whole canvas, reserved end included. Overshooting when the container drops that
368
+ * reservation costs nothing - the outer `<svg>` clips it - while falling short would leave a
369
+ * strip under the plot that answers no pointer. */
370
+ protected readonly hitHeight: _angular_core.Signal<number>;
371
+ protected readonly pinDiscRadius = 11;
372
+ protected readonly pinGlyphSize = 14;
373
+ protected readonly pinGlyphOffset: number;
374
+ protected readonly pinGlyph: SafeHtml;
375
+ protected readonly marks: _angular_core.Signal<{
376
+ key: string;
377
+ point: ColumnSeriesPoint;
378
+ x: number;
379
+ tip: number;
380
+ below: boolean;
381
+ baseline: number;
382
+ top: number;
383
+ height: number;
384
+ labelY: number;
385
+ pinY: number;
386
+ origin: string;
387
+ formattedValue: string;
388
+ color: string;
389
+ hatched: boolean;
390
+ }[]>;
391
+ protected markStagger(index: number): string;
392
+ protected onMarkClick(payload: ColumnSeriesPoint, index: number, event: Event): void;
393
+ protected onMarkEnter(index: number, event: Event): void;
394
+ /** One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not
395
+ * every mouse-operable control has to be separately focusable, and that is what keeps a
396
+ * twenty-five mark chart from being twenty-five stops in the page's tab order. */
397
+ protected readonly rovingIndex: _angular_core.WritableSignal<number>;
398
+ protected readonly tabStopIndex: _angular_core.Signal<number>;
399
+ protected onMarkFocus(index: number, event: FocusEvent): void;
400
+ protected onMarkNavigation(event: KeyboardEvent, index: number): void;
401
+ protected onPointKey(point: ColumnSeriesPoint, event: Event): void;
402
+ protected entryLabel(mark: {
403
+ point: ColumnSeriesPoint;
404
+ formattedValue: string;
405
+ }): string;
406
+ readonly tooltipContext: _angular_core.Signal<ChartTooltipContext | null>;
407
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ColumnSeriesComponent, never>;
408
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ColumnSeriesComponent, "g[dsColumnSeries]", ["dsColumnSeries"], { "data": { "alias": "data"; "required": false; "isSignal": true; }; "showValues": { "alias": "showValues"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "pinOnClick": { "alias": "pinOnClick"; "required": false; "isSignal": true; }; "dimOthers": { "alias": "dimOthers"; "required": false; "isSignal": true; }; "staggerMs": { "alias": "staggerMs"; "required": false; "isSignal": true; }; "partOfWhole": { "alias": "partOfWhole"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "tooltipAnchor": { "alias": "tooltipAnchor"; "required": false; "isSignal": true; }; "tooltipLingerMs": { "alias": "tooltipLingerMs"; "required": false; "isSignal": true; }; "valueFormat": { "alias": "valueFormat"; "required": false; "isSignal": true; }; "columnWidthRatio": { "alias": "columnWidthRatio"; "required": false; "isSignal": true; }; "slot": { "alias": "slot"; "required": false; "isSignal": true; }; "slotCount": { "alias": "slotCount"; "required": false; "isSignal": true; }; "offsets": { "alias": "offsets"; "required": false; "isSignal": true; }; "seriesColor": { "alias": "seriesColor"; "required": false; "isSignal": true; }; "seriesFill": { "alias": "seriesFill"; "required": false; "isSignal": true; }; "seriesLabel": { "alias": "seriesLabel"; "required": false; "isSignal": true; }; }, { "pointClicked": "pointClicked"; }, never, never, true, never>;
409
+ }
410
+
411
+ /** @internal */
412
+ interface LineSeriesData {
413
+ id: string;
414
+ label: string;
415
+ /** One reading per category. A `null` is a missing reading, and `gaps` decides what it draws. */
416
+ data: readonly (number | null)[];
417
+ /** Which value axis the readings are measured against. Defaults to `'primary'`. */
418
+ axis?: ChartAxis;
419
+ /** Fills the band between the line and its axis baseline. */
420
+ area?: boolean;
421
+ /** Any CSS colour. Unset takes the categorical palette slot for the series' position. */
422
+ color?: string;
423
+ }
424
+ /** What a `null` reading draws: a hole in the line, or a point at zero.
425
+ *
426
+ * @internal */
427
+ type LineSeriesGaps = 'break' | 'zero';
428
+ /**
429
+ * One line per series, drawn against the scales `ds-chart` supplies, on either of its two value
430
+ * axes.
431
+ *
432
+ * Hosted on a `<g>` rather than an element of its own: an element the SVG specification does not
433
+ * know is not rendered, and neither are its descendants. Written as `<svg:g dsLineSeries>`.
434
+ *
435
+ * @internal
436
+ */
437
+ declare class LineSeriesComponent implements OnDestroy {
438
+ private readonly scales;
439
+ /** Not `input.required`: the preset reads `tooltipContext()` from a binding on this same
440
+ * element, and a required input throws NG0950 for the pass before its own value is written. */
441
+ readonly data: _angular_core.InputSignal<readonly LineSeriesData[]>;
442
+ readonly showMarkers: _angular_core.InputSignalWithTransform<boolean, unknown>;
443
+ readonly interactive: _angular_core.InputSignalWithTransform<boolean, unknown>;
444
+ readonly staggerMs: _angular_core.InputSignalWithTransform<number, unknown>;
445
+ readonly gaps: _angular_core.InputSignal<LineSeriesGaps>;
446
+ readonly tooltip: _angular_core.InputSignal<ChartItemTooltipTrigger>;
447
+ readonly tooltipLingerMs: _angular_core.InputSignalWithTransform<number, unknown>;
448
+ readonly valueFormat: _angular_core.InputSignal<ChartValueFormat>;
449
+ readonly pointClicked: _angular_core.OutputEmitterRef<{
450
+ series: LineSeriesData;
451
+ categoryIndex: number;
452
+ value: number;
453
+ }>;
454
+ private readonly domainId;
455
+ constructor();
456
+ ngOnDestroy(): void;
457
+ readonly activeMark: _ids_group_ltd_ids_design_system_components_chart_tooltip.ChartActiveMark;
458
+ private valuesOn;
459
+ /** A `null` past the end is the same missing reading as a `null` inside the run, so a series
460
+ * shorter than `categories` ends its line rather than running off the plot's edge. */
461
+ private readingsOf;
462
+ protected readonly plotted: _angular_core.Signal<{
463
+ series: LineSeriesData;
464
+ color: string;
465
+ seriesIndex: number;
466
+ polylines: string[];
467
+ areaPaths: string[];
468
+ markers: {
469
+ key: string;
470
+ markIndex: number;
471
+ x: number;
472
+ y: number;
473
+ value: number;
474
+ category: string;
475
+ formattedValue: string;
476
+ seriesLabel: string;
477
+ seriesId: string;
478
+ categoryIndex: number;
479
+ color: string;
480
+ }[];
481
+ }[]>;
482
+ private readonly allMarkers;
483
+ protected seriesStagger(index: number): string;
484
+ /** One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not
485
+ * every mouse-operable control has to be separately focusable. */
486
+ protected readonly rovingIndex: _angular_core.WritableSignal<number>;
487
+ protected readonly tabStopIndex: _angular_core.Signal<number>;
488
+ protected onMarkerEnter(markIndex: number, event: Event): void;
489
+ protected onMarkerFocus(markIndex: number, event: FocusEvent): void;
490
+ protected onMarkerNavigation(event: KeyboardEvent, markIndex: number): void;
491
+ protected onMarkerClick(markIndex: number): void;
492
+ protected markerLabel(marker: {
493
+ seriesLabel: string;
494
+ category: string;
495
+ formattedValue: string;
496
+ }): string;
497
+ readonly tooltipContext: _angular_core.Signal<ChartTooltipContext | null>;
498
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<LineSeriesComponent, never>;
499
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<LineSeriesComponent, "g[dsLineSeries]", ["dsLineSeries"], { "data": { "alias": "data"; "required": false; "isSignal": true; }; "showMarkers": { "alias": "showMarkers"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "staggerMs": { "alias": "staggerMs"; "required": false; "isSignal": true; }; "gaps": { "alias": "gaps"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "tooltipLingerMs": { "alias": "tooltipLingerMs"; "required": false; "isSignal": true; }; "valueFormat": { "alias": "valueFormat"; "required": false; "isSignal": true; }; }, { "pointClicked": "pointClicked"; }, never, never, true, never>;
500
+ }
501
+
502
+ /**
503
+ * The names of a chart's reference lines, laid out by the same geometry that draws them.
504
+ *
505
+ * A second element rather than part of `g[dsReferenceLine]`: the strokes belong under the marks
506
+ * and the names over them, and a projected element lands in exactly one of the container's slots.
507
+ * Reports no domain - the line it names already did.
508
+ *
509
+ * @internal
510
+ */
511
+ declare class ReferenceLabelComponent {
512
+ private readonly scales;
513
+ readonly thresholds: _angular_core.InputSignal<readonly ChartThreshold[]>;
514
+ protected readonly lines: _angular_core.Signal<ThresholdMark[]>;
515
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ReferenceLabelComponent, never>;
516
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ReferenceLabelComponent, "g[dsReferenceLabel]", never, { "thresholds": { "alias": "thresholds"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
517
+ }
518
+
519
+ /**
520
+ * Reference lines and bands across the plot, drawn against the scales `ds-chart` supplies.
521
+ *
522
+ * Strokes only: the LABELS are a second element, `g[dsReferenceLabel]`, because the two belong in
523
+ * different layers of the canvas - a line reads as furniture under the marks, a label has to stay
524
+ * legible over them - and one projected element can only land in one of the container's slots.
525
+ *
526
+ * Hosted on a `<g>` rather than an element of its own: an element the SVG specification does not
527
+ * know is not rendered, and neither are its descendants. Written as `<svg:g dsReferenceLine>`.
528
+ *
529
+ * @internal
530
+ */
531
+ declare class ReferenceLineComponent implements OnDestroy {
532
+ private readonly scales;
533
+ readonly thresholds: _angular_core.InputSignal<readonly ChartThreshold[]>;
534
+ private readonly domainId;
535
+ constructor();
536
+ ngOnDestroy(): void;
537
+ protected readonly lines: _angular_core.Signal<readonly ThresholdMark[]>;
538
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ReferenceLineComponent, never>;
539
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ReferenceLineComponent, "g[dsReferenceLine]", never, { "thresholds": { "alias": "thresholds"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
540
+ }
541
+
542
+ export { CHART_SCALES, ChartComponent, ColumnSeriesComponent, LineSeriesComponent, ReferenceLabelComponent, ReferenceLineComponent, chartViewHeight, stackOffsets };
543
+ export type { ChartPlot, ChartScales, ChartStackOffset, ColumnSeriesPoint, LineSeriesData, LineSeriesGaps };