@ids-group-ltd/ids-design-system 0.13.0 → 0.13.2

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 (104) hide show
  1. package/CHANGELOG.md +656 -3
  2. package/components.md +32 -11
  3. package/docs/agent/INDEX.md +2 -0
  4. package/docs/agent/charts/ds-bar-chart.md +1 -1
  5. package/docs/agent/charts/ds-column-chart.md +1 -1
  6. package/docs/agent/charts/ds-config.md +12 -0
  7. package/docs/agent/charts/ds-donut-chart.md +2 -2
  8. package/docs/agent/charts/ds-funnel-chart.md +1 -1
  9. package/docs/agent/charts/ds-line-chart.md +3 -2
  10. package/docs/agent/feedback/ds-meter.md +11 -0
  11. package/docs/agent/feedback/ds-progress.md +4 -1
  12. package/docs/agent/forms/ds-button.md +1 -1
  13. package/docs/agent/forms/ds-icon-button.md +1 -1
  14. package/docs/agent/surfaces/ds-card.md +1 -1
  15. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +2 -2
  16. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
  17. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +2 -2
  18. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
  19. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +9 -4
  20. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
  21. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +2 -2
  22. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
  23. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +100 -15
  24. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
  25. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +2 -2
  26. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
  27. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +3 -0
  28. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
  29. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +47 -5
  30. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
  31. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +155 -21
  32. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
  33. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +9 -4
  34. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
  35. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +81 -18
  36. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
  37. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +9 -4
  38. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
  39. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +75 -23
  40. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +1 -1
  41. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +2 -1
  42. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
  43. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
  44. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
  45. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +107 -19
  46. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
  47. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +236 -31
  48. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
  49. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -1
  50. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
  51. package/fesm2022/ids-group-ltd-ids-design-system-components-meter.mjs +61 -0
  52. package/fesm2022/ids-group-ltd-ids-design-system-components-meter.mjs.map +1 -0
  53. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +4 -4
  54. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
  55. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +9 -4
  56. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
  57. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
  58. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
  59. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +1 -1
  60. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
  61. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +34 -10
  62. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +1 -1
  63. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +9 -4
  64. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
  65. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
  66. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
  67. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +9 -4
  68. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
  69. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +2 -2
  70. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
  71. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +119 -13
  72. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  73. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
  74. package/fesm2022/ids-group-ltd-ids-design-system.mjs +1 -0
  75. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  76. package/migrations/0.13.1.json +236 -0
  77. package/migrations/0.13.2.json +269 -0
  78. package/package.json +9 -1
  79. package/styles/_chart-frame.scss +116 -4
  80. package/styles/_chart-interactive.scss +27 -7
  81. package/styles/_chart-motion.scss +61 -18
  82. package/styles/_dropdown-overlay.scss +9 -3
  83. package/styles/_focus.scss +10 -1
  84. package/styles/_overlay-motion.scss +11 -1
  85. package/styles/_tokens-charts.scss +5 -0
  86. package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +6 -1
  87. package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +87 -10
  88. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +1 -0
  89. package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +25 -2
  90. package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +23 -3
  91. package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +6 -1
  92. package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +60 -9
  93. package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +6 -1
  94. package/types/ids-group-ltd-ids-design-system-components-donut-chart.d.ts +53 -13
  95. package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +73 -11
  96. package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +116 -12
  97. package/types/ids-group-ltd-ids-design-system-components-meter.d.ts +36 -0
  98. package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +6 -1
  99. package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +21 -3
  100. package/types/ids-group-ltd-ids-design-system-components-select.d.ts +6 -1
  101. package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +6 -1
  102. package/types/ids-group-ltd-ids-design-system-components.d.ts +47 -5
  103. package/types/ids-group-ltd-ids-design-system-core.d.ts +40 -1
  104. package/types/ids-group-ltd-ids-design-system.d.ts +6 -5
@@ -1,7 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, numberAttribute, booleanAttribute, output, contentChild, signal, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
- import { formatValue, staggerDelay, nextRovingIndex, focusMark, largestRemainder, CHART_SERIES_COLORS, describeSeries } from '@ids-group-ltd/ids-design-system/components';
3
+ import { formatValue, nextRovingIndex, focusMark, largestRemainder, CHART_SERIES_COLORS, describeSeries } from '@ids-group-ltd/ids-design-system/components';
4
4
  import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
5
+ import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
6
+ import { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';
5
7
  import { chartActiveMark, ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
6
8
 
7
9
  const FULL_TURN = Math.PI * 2;
@@ -86,7 +88,15 @@ function paletteIndex(slot, index, paletteLength) {
86
88
  * reader expects a ring to start; SVG's y axis points down, so that is
87
89
  * (sin, -cos) rather than the (cos, sin) of the maths convention. */
88
90
  function ringPoint(centerX, centerY, radius, angle) {
89
- return `${round(centerX + radius * Math.sin(angle))} ${round(centerY - radius * Math.cos(angle))}`;
91
+ const { x, y } = ringCoords(centerX, centerY, radius, angle);
92
+ return `${x} ${y}`;
93
+ }
94
+ /** The same point as numbers, for PLACING something rather than drawing a path. */
95
+ function ringCoords(centerX, centerY, radius, angle) {
96
+ return {
97
+ x: round(centerX + radius * Math.sin(angle)),
98
+ y: round(centerY - radius * Math.cos(angle)),
99
+ };
90
100
  }
91
101
  function arcPath(centerX, centerY, outerRadius, innerRadius, startAngle, endAngle) {
92
102
  const finite = [
@@ -162,6 +172,20 @@ class DonutChartComponent {
162
172
  otherLabel = input('Other', ...(ngDevMode ? [{ debugName: "otherLabel" }] : /* istanbul ignore next */ []));
163
173
  /** Ring width as a fraction of the radius. */
164
174
  thickness = input(DEFAULT_THICKNESS, { ...(ngDevMode ? { debugName: "thickness" } : /* istanbul ignore next */ {}), transform: numberAttribute });
175
+ /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;
176
+ * `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.
177
+ * Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards
178
+ * is one decision per app rather than per plot. */
179
+ frame = input(null, ...(ngDevMode ? [{ debugName: "frame" }] : /* istanbul ignore next */ []));
180
+ /** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the
181
+ * default, takes it away at once: a panel that outlives the pointer sits over the plot the
182
+ * reader has moved on to.
183
+ *
184
+ * Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything
185
+ * selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so
186
+ * crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to
187
+ * `DS_CONFIG.chart.tooltipLingerMs`, then 0. */
188
+ tooltipLingerMs = input(null, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
165
189
  /** Printed above the plot as the chart's visible title, and reused as the annex table's
166
190
  * caption. */
167
191
  caption = input(null, ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
@@ -169,22 +193,31 @@ class DonutChartComponent {
169
193
  summary = input(null, ...(ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []));
170
194
  /** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,
171
195
  * `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so
172
- * `'none'` belongs only where the same data is already in a table on the page. */
173
- dataTable = input('toggle', ...(ngDevMode ? [{ debugName: "dataTable" }] : /* istanbul ignore next */ []));
196
+ * `'none'` belongs only where the same data is already in a table on the page.
197
+ * Unset falls back to `DS_CONFIG.chart.dataTable`, then `'none'`. */
198
+ dataTable = input(null, ...(ngDevMode ? [{ debugName: "dataTable" }] : /* istanbul ignore next */ []));
174
199
  /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize
175
200
  * when the data lands. */
176
201
  loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
177
- /** Shown in place of the plot when `data` is empty. */
178
- emptyText = input('No data', ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
202
+ /** Shown in place of the plot when `data` is empty. Unset falls back to
203
+ * `DS_CONFIG.chart.emptyText`, then `'No data'`. */
204
+ emptyText = input(null, ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
179
205
  /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,
180
206
  * because "the request failed" and "there is nothing to show" read the same to a reader and
181
207
  * mean opposite things. */
182
208
  error = input(false, { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
183
- /** The message the error state prints. */
184
- errorText = input('Could not load the data', ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
209
+ /** The message the error state prints. Unset falls back to `DS_CONFIG.chart.errorText`, then
210
+ * `'Could not load the data'`. */
211
+ errorText = input(null, ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
185
212
  /** Formats every value the chart prints, the annex table and the generated description
186
- * included. Defaults to the browser's locale grouping with a K/M/B suffix past four digits. */
187
- valueFormat = input(defaultValueFormat, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
213
+ * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale
214
+ * grouping with a K/M/B suffix past four digits. */
215
+ valueFormat = input(null, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
216
+ frameResolved = resolveWithConfig(this.frame, (config) => config.chart?.frame, 'auto');
217
+ dataTableResolved = resolveWithConfig(this.dataTable, (config) => config.chart?.dataTable, 'none');
218
+ emptyTextResolved = resolveWithConfig(this.emptyText, (config) => config.chart?.emptyText, 'No data');
219
+ errorTextResolved = resolveWithConfig(this.errorText, (config) => config.chart?.errorText, 'Could not load the data');
220
+ valueFormatResolved = resolveWithConfig(this.valueFormat, (config) => config.chart?.valueFormat, defaultValueFormat);
188
221
  /** Turns on the click affordance — the pointer cursor and any hover tint.
189
222
  * The click output fires whether or not this is set, so a consumer that
190
223
  * binds the output and forgets the flag still receives every click. */
@@ -192,18 +225,33 @@ class DonutChartComponent {
192
225
  /** The slice that was clicked, or activated with Enter or Space. Fires whether or not
193
226
  * `interactive` is set. */
194
227
  sliceClicked = output();
195
- /** Milliseconds between one mark's entrance and the next. `0`, the default, is no stagger at
196
- * all; `40` is the documented non-zero step. The total is capped, so a long series does not
197
- * crawl in. */
228
+ /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press
229
+ * outside releases it. Off by default: a click is already the drill-down hook, and a mark left
230
+ * lit after the pointer has gone needs a reader who knows why it is lit. `sliceClicked` fires
231
+ * either way — pinning is a state, not a handler. */
232
+ pinOnClick = input(false, { ...(ngDevMode ? { debugName: "pinOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
233
+ /** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the
234
+ * one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed
235
+ * marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full
236
+ * opacity to 2.1 at `--ds-chart-dim-opacity`'s default 0.3 — so it buys loudness for one mark
237
+ * and pays for it with the rest of the chart. */
238
+ dimOthers = input(false, { ...(ngDevMode ? { debugName: "dimOthers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
239
+ /** Accepted for parity with the other four charts and deliberately without effect here: a ring
240
+ * arrives as ONE object, because arcs share their edges and fading them one at a time lets the
241
+ * background through every seam. There is nothing to stagger. */
198
242
  staggerMs = input(0, { ...(ngDevMode ? { debugName: "staggerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
199
- markStagger(index) {
200
- return `${staggerDelay(index, this.staggerMs())}ms`;
201
- }
202
243
  /** Whether a hovered or focused slice opens a tooltip. `'axis'` is not offered — a ring
203
244
  * has no axis to group readings under. */
204
245
  tooltip = input('item', ...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
205
246
  tooltipTemplate = contentChild('dsChartTooltip', ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
206
- activeMark = chartActiveMark();
247
+ tooltipLingerResolved = resolveWithConfig(this.tooltipLingerMs, (config) => config.chart?.tooltipLingerMs, 0);
248
+ activeMark = chartActiveMark(() => this.tooltipLingerResolved());
249
+ onMarkClick(payload, index, event) {
250
+ this.sliceClicked.emit(payload);
251
+ if (this.pinOnClick()) {
252
+ this.activeMark.pin(index, event);
253
+ }
254
+ }
207
255
  /** One tab stop per chart, not one per slice: WCAG 2.1.1's Understanding is explicit that not
208
256
  * every mouse-operable control has to be separately focusable. */
209
257
  rovingIndex = signal(0, ...(ngDevMode ? [{ debugName: "rovingIndex" }] : /* istanbul ignore next */ []));
@@ -247,21 +295,25 @@ class DonutChartComponent {
247
295
  const arcs = sliceArcs(values);
248
296
  const percents = largestRemainder(positiveValues(values));
249
297
  const innerRadius = resolveInnerRadius(RING_OUTER_RADIUS, this.thickness());
250
- const format = this.valueFormat();
298
+ const format = this.valueFormatResolved();
299
+ const midRadius = (RING_OUTER_RADIUS + innerRadius) / 2;
251
300
  return data.map((slice, index) => ({
252
301
  slice,
302
+ // Halfway along the arc and halfway through the ring: the one point that is inside a slice
303
+ // whatever its sweep, which the bounding box of a curved wedge is not.
304
+ center: ringCoords(RING_CENTER, RING_CENTER, midRadius, (arcs[index].startAngle + arcs[index].endAngle) / 2),
253
305
  path: arcPath(RING_CENTER, RING_CENTER, RING_OUTER_RADIUS, innerRadius, arcs[index].startAngle, arcs[index].endAngle),
254
306
  color: CHART_SERIES_COLORS[paletteIndex(slice.slot, index, CHART_SERIES_COLORS.length)],
255
307
  formattedValue: format(slice.value),
256
308
  formattedPercent: `${percents[index]}%`,
257
309
  }));
258
310
  }, ...(ngDevMode ? [{ debugName: "slices" }] : /* istanbul ignore next */ []));
259
- resolvedCenterValue = computed(() => this.centerValue() ?? this.valueFormat()(this.total()), ...(ngDevMode ? [{ debugName: "resolvedCenterValue" }] : /* istanbul ignore next */ []));
311
+ resolvedCenterValue = computed(() => this.centerValue() ?? this.valueFormatResolved()(this.total()), ...(ngDevMode ? [{ debugName: "resolvedCenterValue" }] : /* istanbul ignore next */ []));
260
312
  accessibleName = computed(() => this.summary() ??
261
313
  describeSeries(this.caption() ?? 'Chart', this.data().map((slice) => ({
262
314
  label: slice.label,
263
315
  value: slice.value,
264
- })), this.valueFormat(), this.dataTable() !== 'none'), ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
316
+ })), this.valueFormatResolved(), this.dataTableResolved() !== 'none'), ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
265
317
  hole = computed(() => holeFraction(this.thickness()), ...(ngDevMode ? [{ debugName: "hole" }] : /* istanbul ignore next */ []));
266
318
  entryLabel(entry) {
267
319
  return `${entry.slice.label}, ${entry.formattedValue}, ${entry.formattedPercent}`;
@@ -284,12 +336,12 @@ class DonutChartComponent {
284
336
  * is still empty. */
285
337
  skeletonRows = computed(() => Array.from({ length: Math.max(this.data().length, 3) }), ...(ngDevMode ? [{ debugName: "skeletonRows" }] : /* istanbul ignore next */ []));
286
338
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DonutChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
287
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DonutChartComponent, isStandalone: true, selector: "ds-donut-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, centerValue: { classPropertyName: "centerValue", publicName: "centerValue", isSignal: true, isRequired: false, transformFunction: null }, centerLabel: { classPropertyName: "centerLabel", publicName: "centerLabel", isSignal: true, isRequired: false, transformFunction: null }, legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: false, transformFunction: null }, maxSlices: { classPropertyName: "maxSlices", publicName: "maxSlices", isSignal: true, isRequired: false, transformFunction: null }, otherLabel: { classPropertyName: "otherLabel", publicName: "otherLabel", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sliceClicked: "sliceClicked" }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<figure\n class=\"donut-chart\"\n [style.--_donut-chart-hole-fraction]=\"hole()\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorText() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\"\n [class.legend-bottom]=\"legend() === 'bottom'\">\n <ds-skeleton\n circle\n width=\"var(--_donut-chart-size)\"\n height=\"var(--_donut-chart-size)\" />\n\n @if (legend() !== 'none') {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_donut-chart-legend-row-height)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p class=\"empty-text\">\n {{ emptyText() }}\n </p>\n </div>\n } @else {\n <div\n class=\"chart\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [class.legend-bottom]=\"legend() === 'bottom'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <div\n class=\"ring\"\n [class.ring-outline]=\"total() === 0\">\n <svg\n class=\"ring-svg\"\n [attr.aria-hidden]=\"ringCarriesTheRoute() ? null : true\"\n [attr.viewBox]=\"viewBox\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <path\n class=\"slice\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.focusable]=\"ringCarriesTheRoute()\"\n [attr.d]=\"entry.path\"\n [style.fill]=\"entry.color\"\n [attr.role]=\"ringCarriesTheRoute() ? 'button' : null\"\n [attr.tabindex]=\"\n ringCarriesTheRoute()\n ? index === tabStopIndex()\n ? 0\n : -1\n : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"\n ringCarriesTheRoute() ? entryLabel(entry) : null\n \"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.ring-svg')\"\n (click)=\"sliceClicked.emit(entry.slice)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n </path>\n }\n </svg>\n\n <div class=\"center\">\n <span class=\"center-value\">\n {{ resolvedCenterValue() }}\n </span>\n\n @if (centerLabel()) {\n <span class=\"center-label\">\n {{ centerLabel() }}\n </span>\n }\n </div>\n </div>\n\n @if (legend() !== 'none') {\n <ul class=\"legend\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <li\n class=\"legend-item\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.legend')\"\n (click)=\"sliceClicked.emit(entry.slice)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n <span\n class=\"swatch\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ entry.slice.label }}\n </span>\n\n <span class=\"legend-value\">\n {{ entry.formattedValue }}\n </span>\n\n <span class=\"legend-percent\">\n {{ entry.formattedPercent }}\n </span>\n </li>\n }\n </ul>\n }\n </div>\n\n @if (dataTable() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTable() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Share\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of slices(); track entry.slice.id) {\n <tr>\n <td>\n {{ entry.slice.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-enter{0%{opacity:0;transform:scale(.94)}}@keyframes ds-chart-mark-exit{to{opacity:0;transform:scale(.94)}}.slice{transform-box:fill-box;transform-origin:center}.slice.mark-enter{animation:ds-chart-mark-enter var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.slice.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.donut-chart{--_donut-chart-size: var(--ds-donut-chart-size, 180px);--_donut-chart-gap: var(--ds-donut-chart-gap, var(--space-5));--_donut-chart-legend-row-gap: var(--ds-donut-chart-legend-row-gap, var(--space-2));--_donut-chart-legend-row-height: var(--ds-donut-chart-legend-row-height, 16px);--_donut-chart-swatch-size: var(--ds-donut-chart-swatch-size, 10px);--_donut-chart-focus-color: var(--ds-donut-chart-focus-color, var(--focus-ring-color));--_donut-chart-focus-width: var(--ds-donut-chart-focus-width, var(--focus-ring-width));--_donut-chart-outline-width: var(--ds-donut-chart-outline-width, calc(var(--border-width-strong) + var(--border-width-default)));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:flex;flex-direction:column;gap:var(--space-3);align-items:center}.empty-ring,.ring-outline{position:relative;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size);border:var(--_donut-chart-outline-width) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-ring:before,.ring-outline:before{content:\"\";position:absolute;inset:calc((100% - var(--_donut-chart-hole-fraction) * 100%) / 2);border:calc(var(--_donut-chart-hole-fraction) * var(--_donut-chart-outline-width)) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-text{margin:0;color:var(--text-secondary)}.chart,.skeleton{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-gap);align-items:center;justify-content:center}.chart.legend-bottom,.skeleton.legend-bottom{flex-direction:column}.ring{position:relative;flex:none;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size)}.ring-svg{display:block;inline-size:100%;block-size:100%}@media not (forced-colors:active){.slice.focusable:focus-visible{outline:none}}.slice.focusable:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 1px var(--ds-chart-focus-halo-color)) drop-shadow(0 0 1px var(--ds-chart-focus-halo-color))}.center{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;inline-size:max(56%,var(--_donut-chart-hole-fraction) * 70%);margin-inline:auto;overflow-wrap:anywhere;text-align:center;pointer-events:none}.center-value,.center-label{text-shadow:0 0 var(--space-1) var(--ds-chart-frame-bg-color),0 0 var(--space-0-5) var(--ds-chart-frame-bg-color)}.center-value{color:var(--text-primary);font-size:var(--font-size-h4);font-weight:700}.center-label{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend,.skeleton-legend{display:grid;row-gap:var(--_donut-chart-legend-row-gap);min-inline-size:0}.legend{margin:0;padding:0;list-style:none}.skeleton-legend{flex:1 1 auto}.legend-item{display:grid;grid-template-columns:auto 1fr auto auto;column-gap:var(--space-2);align-items:baseline}.legend-item.interactive{cursor:pointer}.swatch{align-self:center;inline-size:var(--_donut-chart-swatch-size);block-size:var(--_donut-chart-swatch-size);border-radius:var(--radius-pill)}.legend-label{color:var(--text-secondary)}.legend-value{font-weight:700}.legend-percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend-bottom .legend{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-legend-row-gap) var(--space-4)}.legend-bottom .legend-item{display:flex;column-gap:var(--space-2)}.empty.is-error{color:var(--error)}.ring-svg .slice{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.ring-svg .slice.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.ring-svg:has(.slice.interactive:hover) .slice.interactive:not(:hover),.ring-svg:has(.slice.interactive:focus-visible) .slice.interactive:not(:focus-visible){opacity:var(--ds-chart-dim-opacity)}.ring-svg .slice.interactive{cursor:pointer}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
339
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DonutChartComponent, isStandalone: true, selector: "ds-donut-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, centerValue: { classPropertyName: "centerValue", publicName: "centerValue", isSignal: true, isRequired: false, transformFunction: null }, centerLabel: { classPropertyName: "centerLabel", publicName: "centerLabel", isSignal: true, isRequired: false, transformFunction: null }, legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: false, transformFunction: null }, maxSlices: { classPropertyName: "maxSlices", publicName: "maxSlices", isSignal: true, isRequired: false, transformFunction: null }, otherLabel: { classPropertyName: "otherLabel", publicName: "otherLabel", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sliceClicked: "sliceClicked" }, host: { properties: { "class.framed": "frameResolved() === 'auto'" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<figure\n class=\"donut-chart\"\n [style.--_donut-chart-hole-fraction]=\"hole()\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p\n class=\"empty-text is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n </div>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\"\n [class.legend-bottom]=\"legend() === 'bottom'\">\n <ds-skeleton\n circle\n width=\"var(--_donut-chart-size)\"\n height=\"var(--_donut-chart-size)\" />\n\n @if (legend() !== 'none') {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_donut-chart-legend-row-height)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p class=\"empty-text\">\n {{ emptyTextResolved() }}\n </p>\n </div>\n } @else {\n <div\n class=\"chart\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [class.legend-bottom]=\"legend() === 'bottom'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <div\n class=\"ring\"\n [class.ring-outline]=\"total() === 0\">\n <svg\n class=\"ring-svg\"\n animate.enter=\"mark-enter\"\n [class.dims-others]=\"dimOthers()\"\n [attr.aria-hidden]=\"ringCarriesTheRoute() ? null : true\"\n [attr.viewBox]=\"viewBox\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <path\n class=\"slice\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [class.focusable]=\"ringCarriesTheRoute()\"\n [attr.d]=\"entry.path\"\n [style.fill]=\"entry.color\"\n [attr.role]=\"ringCarriesTheRoute() ? 'button' : null\"\n [attr.tabindex]=\"\n ringCarriesTheRoute()\n ? index === tabStopIndex()\n ? 0\n : -1\n : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"\n ringCarriesTheRoute() ? entryLabel(entry) : null\n \"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.ring-svg')\"\n (click)=\"onMarkClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n </path>\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <foreignObject\n class=\"pin-marker\"\n width=\"14\"\n height=\"14\"\n [attr.x]=\"entry.center.x - 7\"\n [attr.y]=\"entry.center.y - 7\">\n <ds-icon\n name=\"pin\"\n [size]=\"14\" />\n </foreignObject>\n }\n }\n </svg>\n\n <div class=\"center\">\n <span class=\"center-value\">\n {{ resolvedCenterValue() }}\n </span>\n\n @if (centerLabel()) {\n <span class=\"center-label\">\n {{ centerLabel() }}\n </span>\n }\n </div>\n </div>\n\n @if (legend() !== 'none') {\n <ul class=\"legend\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <li\n class=\"legend-item\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.legend')\"\n (click)=\"onMarkClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n <span\n class=\"swatch\"\n animate.enter=\"mark-enter\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ entry.slice.label }}\n </span>\n\n <span class=\"legend-value\">\n {{ entry.formattedValue }}\n </span>\n\n <span class=\"legend-percent\">\n {{ entry.formattedPercent }}\n </span>\n </li>\n }\n </ul>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Share\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of slices(); track entry.slice.id) {\n <tr>\n <td>\n {{ entry.slice.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.ring-svg.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.ring-svg.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.swatch.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table,figcaption{-webkit-user-select:text;user-select:text}@media not (forced-colors:active){.slice:focus{outline:none}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.donut-chart{--_donut-chart-size: var(--ds-donut-chart-size, 180px);--_donut-chart-gap: var(--ds-donut-chart-gap, var(--space-5));--_donut-chart-legend-row-gap: var(--ds-donut-chart-legend-row-gap, var(--space-2));--_donut-chart-legend-row-height: var(--ds-donut-chart-legend-row-height, 16px);--_donut-chart-swatch-size: var(--ds-donut-chart-swatch-size, 10px);--_donut-chart-focus-color: var(--ds-donut-chart-focus-color, var(--focus-ring-color));--_donut-chart-focus-width: var(--ds-donut-chart-focus-width, var(--focus-ring-width));--_donut-chart-outline-width: var(--ds-donut-chart-outline-width, calc(var(--border-width-strong) + var(--border-width-default)));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:flex;flex-direction:column;gap:var(--space-3);align-items:center}.empty-ring,.ring-outline{position:relative;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size);border:var(--_donut-chart-outline-width) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-ring:before,.ring-outline:before{content:\"\";position:absolute;inset:calc((100% - var(--_donut-chart-hole-fraction) * 100%) / 2);border:calc(var(--_donut-chart-hole-fraction) * var(--_donut-chart-outline-width)) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-text{margin:0;color:var(--text-secondary)}.chart,.skeleton{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-gap);align-items:center;justify-content:center}.chart.legend-bottom,.skeleton.legend-bottom{flex-direction:column}.ring{position:relative;flex:none;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size)}.ring-svg{display:block;inline-size:100%;block-size:100%}@media not (forced-colors:active){.slice.focusable:focus-visible{outline:none}}.slice.focusable:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 1px var(--ds-chart-focus-halo-color)) drop-shadow(0 0 1px var(--ds-chart-focus-halo-color))}.center{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;inline-size:max(56%,var(--_donut-chart-hole-fraction) * 70%);margin-inline:auto;overflow-wrap:anywhere;text-align:center;pointer-events:none}.center-value,.center-label{text-shadow:0 0 var(--space-1) var(--ds-chart-frame-bg-color),0 0 var(--space-0-5) var(--ds-chart-frame-bg-color)}.center-value{color:var(--text-primary);font-size:var(--font-size-h4);font-weight:700}.center-label{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend,.skeleton-legend{display:grid;row-gap:var(--_donut-chart-legend-row-gap);min-inline-size:0}.legend{margin:0;padding:0;list-style:none}.skeleton-legend{flex:1 1 auto}.legend-item{display:grid;grid-template-columns:auto 1fr auto auto;column-gap:var(--space-2);align-items:baseline}.legend-item.interactive{cursor:pointer}.swatch{align-self:center;inline-size:var(--_donut-chart-swatch-size);block-size:var(--_donut-chart-swatch-size);border-radius:var(--radius-pill)}.legend-label{color:var(--text-secondary)}.legend-value{font-weight:700}.legend-percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend-bottom .legend{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-legend-row-gap) var(--space-4)}.legend-bottom .legend-item{display:flex;column-gap:var(--space-2)}.empty-text.is-error{color:var(--error)}.ring-svg .slice{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.ring-svg .slice.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.ring-svg.dims-others:not(:has(.slice.is-pinned)):has(.slice.interactive:hover) .slice.interactive:not(:hover),.ring-svg.dims-others:not(:has(.slice.is-pinned)):has(.slice.interactive:focus-visible) .slice.interactive:not(:focus-visible),.ring-svg.dims-others:has(.slice.is-pinned) .slice:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.ring-svg .slice.interactive{cursor:pointer}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}.pin-marker{display:grid;place-items:center;inline-size:var(--ds-chart-pin-size, 22px);block-size:var(--ds-chart-pin-size, 22px);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-primary);box-shadow:var(--shadow-1);pointer-events:none}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
288
340
  }
289
341
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DonutChartComponent, decorators: [{
290
342
  type: Component,
291
- args: [{ selector: 'ds-donut-chart', standalone: true, imports: [SkeletonComponent, ChartTooltipDirective], encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure\n class=\"donut-chart\"\n [style.--_donut-chart-hole-fraction]=\"hole()\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorText() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\"\n [class.legend-bottom]=\"legend() === 'bottom'\">\n <ds-skeleton\n circle\n width=\"var(--_donut-chart-size)\"\n height=\"var(--_donut-chart-size)\" />\n\n @if (legend() !== 'none') {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_donut-chart-legend-row-height)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p class=\"empty-text\">\n {{ emptyText() }}\n </p>\n </div>\n } @else {\n <div\n class=\"chart\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [class.legend-bottom]=\"legend() === 'bottom'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <div\n class=\"ring\"\n [class.ring-outline]=\"total() === 0\">\n <svg\n class=\"ring-svg\"\n [attr.aria-hidden]=\"ringCarriesTheRoute() ? null : true\"\n [attr.viewBox]=\"viewBox\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <path\n class=\"slice\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.focusable]=\"ringCarriesTheRoute()\"\n [attr.d]=\"entry.path\"\n [style.fill]=\"entry.color\"\n [attr.role]=\"ringCarriesTheRoute() ? 'button' : null\"\n [attr.tabindex]=\"\n ringCarriesTheRoute()\n ? index === tabStopIndex()\n ? 0\n : -1\n : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"\n ringCarriesTheRoute() ? entryLabel(entry) : null\n \"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.ring-svg')\"\n (click)=\"sliceClicked.emit(entry.slice)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n </path>\n }\n </svg>\n\n <div class=\"center\">\n <span class=\"center-value\">\n {{ resolvedCenterValue() }}\n </span>\n\n @if (centerLabel()) {\n <span class=\"center-label\">\n {{ centerLabel() }}\n </span>\n }\n </div>\n </div>\n\n @if (legend() !== 'none') {\n <ul class=\"legend\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <li\n class=\"legend-item\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.legend')\"\n (click)=\"sliceClicked.emit(entry.slice)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n <span\n class=\"swatch\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ entry.slice.label }}\n </span>\n\n <span class=\"legend-value\">\n {{ entry.formattedValue }}\n </span>\n\n <span class=\"legend-percent\">\n {{ entry.formattedPercent }}\n </span>\n </li>\n }\n </ul>\n }\n </div>\n\n @if (dataTable() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTable() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Share\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of slices(); track entry.slice.id) {\n <tr>\n <td>\n {{ entry.slice.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-enter{0%{opacity:0;transform:scale(.94)}}@keyframes ds-chart-mark-exit{to{opacity:0;transform:scale(.94)}}.slice{transform-box:fill-box;transform-origin:center}.slice.mark-enter{animation:ds-chart-mark-enter var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.slice.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.donut-chart{--_donut-chart-size: var(--ds-donut-chart-size, 180px);--_donut-chart-gap: var(--ds-donut-chart-gap, var(--space-5));--_donut-chart-legend-row-gap: var(--ds-donut-chart-legend-row-gap, var(--space-2));--_donut-chart-legend-row-height: var(--ds-donut-chart-legend-row-height, 16px);--_donut-chart-swatch-size: var(--ds-donut-chart-swatch-size, 10px);--_donut-chart-focus-color: var(--ds-donut-chart-focus-color, var(--focus-ring-color));--_donut-chart-focus-width: var(--ds-donut-chart-focus-width, var(--focus-ring-width));--_donut-chart-outline-width: var(--ds-donut-chart-outline-width, calc(var(--border-width-strong) + var(--border-width-default)));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:flex;flex-direction:column;gap:var(--space-3);align-items:center}.empty-ring,.ring-outline{position:relative;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size);border:var(--_donut-chart-outline-width) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-ring:before,.ring-outline:before{content:\"\";position:absolute;inset:calc((100% - var(--_donut-chart-hole-fraction) * 100%) / 2);border:calc(var(--_donut-chart-hole-fraction) * var(--_donut-chart-outline-width)) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-text{margin:0;color:var(--text-secondary)}.chart,.skeleton{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-gap);align-items:center;justify-content:center}.chart.legend-bottom,.skeleton.legend-bottom{flex-direction:column}.ring{position:relative;flex:none;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size)}.ring-svg{display:block;inline-size:100%;block-size:100%}@media not (forced-colors:active){.slice.focusable:focus-visible{outline:none}}.slice.focusable:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 1px var(--ds-chart-focus-halo-color)) drop-shadow(0 0 1px var(--ds-chart-focus-halo-color))}.center{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;inline-size:max(56%,var(--_donut-chart-hole-fraction) * 70%);margin-inline:auto;overflow-wrap:anywhere;text-align:center;pointer-events:none}.center-value,.center-label{text-shadow:0 0 var(--space-1) var(--ds-chart-frame-bg-color),0 0 var(--space-0-5) var(--ds-chart-frame-bg-color)}.center-value{color:var(--text-primary);font-size:var(--font-size-h4);font-weight:700}.center-label{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend,.skeleton-legend{display:grid;row-gap:var(--_donut-chart-legend-row-gap);min-inline-size:0}.legend{margin:0;padding:0;list-style:none}.skeleton-legend{flex:1 1 auto}.legend-item{display:grid;grid-template-columns:auto 1fr auto auto;column-gap:var(--space-2);align-items:baseline}.legend-item.interactive{cursor:pointer}.swatch{align-self:center;inline-size:var(--_donut-chart-swatch-size);block-size:var(--_donut-chart-swatch-size);border-radius:var(--radius-pill)}.legend-label{color:var(--text-secondary)}.legend-value{font-weight:700}.legend-percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend-bottom .legend{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-legend-row-gap) var(--space-4)}.legend-bottom .legend-item{display:flex;column-gap:var(--space-2)}.empty.is-error{color:var(--error)}.ring-svg .slice{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.ring-svg .slice.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.ring-svg:has(.slice.interactive:hover) .slice.interactive:not(:hover),.ring-svg:has(.slice.interactive:focus-visible) .slice.interactive:not(:focus-visible){opacity:var(--ds-chart-dim-opacity)}.ring-svg .slice.interactive{cursor:pointer}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}\n"] }]
292
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], centerValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerValue", required: false }] }], centerLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerLabel", required: false }] }], legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: false }] }], maxSlices: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSlices", required: false }] }], otherLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "otherLabel", required: false }] }], thickness: [{ type: i0.Input, args: [{ isSignal: true, alias: "thickness", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], sliceClicked: [{ type: i0.Output, args: ["sliceClicked"] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipTemplate: [{ type: i0.ContentChild, args: ['dsChartTooltip', { isSignal: true }] }] } });
343
+ args: [{ selector: 'ds-donut-chart', standalone: true, imports: [SkeletonComponent, ChartTooltipDirective, IconComponent], host: { '[class.framed]': "frameResolved() === 'auto'" }, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure\n class=\"donut-chart\"\n [style.--_donut-chart-hole-fraction]=\"hole()\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p\n class=\"empty-text is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n </div>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\"\n [class.legend-bottom]=\"legend() === 'bottom'\">\n <ds-skeleton\n circle\n width=\"var(--_donut-chart-size)\"\n height=\"var(--_donut-chart-size)\" />\n\n @if (legend() !== 'none') {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_donut-chart-legend-row-height)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p class=\"empty-text\">\n {{ emptyTextResolved() }}\n </p>\n </div>\n } @else {\n <div\n class=\"chart\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [class.legend-bottom]=\"legend() === 'bottom'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <div\n class=\"ring\"\n [class.ring-outline]=\"total() === 0\">\n <svg\n class=\"ring-svg\"\n animate.enter=\"mark-enter\"\n [class.dims-others]=\"dimOthers()\"\n [attr.aria-hidden]=\"ringCarriesTheRoute() ? null : true\"\n [attr.viewBox]=\"viewBox\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <path\n class=\"slice\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [class.focusable]=\"ringCarriesTheRoute()\"\n [attr.d]=\"entry.path\"\n [style.fill]=\"entry.color\"\n [attr.role]=\"ringCarriesTheRoute() ? 'button' : null\"\n [attr.tabindex]=\"\n ringCarriesTheRoute()\n ? index === tabStopIndex()\n ? 0\n : -1\n : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"\n ringCarriesTheRoute() ? entryLabel(entry) : null\n \"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.ring-svg')\"\n (click)=\"onMarkClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n </path>\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <foreignObject\n class=\"pin-marker\"\n width=\"14\"\n height=\"14\"\n [attr.x]=\"entry.center.x - 7\"\n [attr.y]=\"entry.center.y - 7\">\n <ds-icon\n name=\"pin\"\n [size]=\"14\" />\n </foreignObject>\n }\n }\n </svg>\n\n <div class=\"center\">\n <span class=\"center-value\">\n {{ resolvedCenterValue() }}\n </span>\n\n @if (centerLabel()) {\n <span class=\"center-label\">\n {{ centerLabel() }}\n </span>\n }\n </div>\n </div>\n\n @if (legend() !== 'none') {\n <ul class=\"legend\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <li\n class=\"legend-item\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.legend')\"\n (click)=\"onMarkClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n <span\n class=\"swatch\"\n animate.enter=\"mark-enter\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ entry.slice.label }}\n </span>\n\n <span class=\"legend-value\">\n {{ entry.formattedValue }}\n </span>\n\n <span class=\"legend-percent\">\n {{ entry.formattedPercent }}\n </span>\n </li>\n }\n </ul>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Share\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of slices(); track entry.slice.id) {\n <tr>\n <td>\n {{ entry.slice.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.ring-svg.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.ring-svg.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.swatch.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table,figcaption{-webkit-user-select:text;user-select:text}@media not (forced-colors:active){.slice:focus{outline:none}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.donut-chart{--_donut-chart-size: var(--ds-donut-chart-size, 180px);--_donut-chart-gap: var(--ds-donut-chart-gap, var(--space-5));--_donut-chart-legend-row-gap: var(--ds-donut-chart-legend-row-gap, var(--space-2));--_donut-chart-legend-row-height: var(--ds-donut-chart-legend-row-height, 16px);--_donut-chart-swatch-size: var(--ds-donut-chart-swatch-size, 10px);--_donut-chart-focus-color: var(--ds-donut-chart-focus-color, var(--focus-ring-color));--_donut-chart-focus-width: var(--ds-donut-chart-focus-width, var(--focus-ring-width));--_donut-chart-outline-width: var(--ds-donut-chart-outline-width, calc(var(--border-width-strong) + var(--border-width-default)));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:flex;flex-direction:column;gap:var(--space-3);align-items:center}.empty-ring,.ring-outline{position:relative;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size);border:var(--_donut-chart-outline-width) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-ring:before,.ring-outline:before{content:\"\";position:absolute;inset:calc((100% - var(--_donut-chart-hole-fraction) * 100%) / 2);border:calc(var(--_donut-chart-hole-fraction) * var(--_donut-chart-outline-width)) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-text{margin:0;color:var(--text-secondary)}.chart,.skeleton{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-gap);align-items:center;justify-content:center}.chart.legend-bottom,.skeleton.legend-bottom{flex-direction:column}.ring{position:relative;flex:none;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size)}.ring-svg{display:block;inline-size:100%;block-size:100%}@media not (forced-colors:active){.slice.focusable:focus-visible{outline:none}}.slice.focusable:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 1px var(--ds-chart-focus-halo-color)) drop-shadow(0 0 1px var(--ds-chart-focus-halo-color))}.center{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;inline-size:max(56%,var(--_donut-chart-hole-fraction) * 70%);margin-inline:auto;overflow-wrap:anywhere;text-align:center;pointer-events:none}.center-value,.center-label{text-shadow:0 0 var(--space-1) var(--ds-chart-frame-bg-color),0 0 var(--space-0-5) var(--ds-chart-frame-bg-color)}.center-value{color:var(--text-primary);font-size:var(--font-size-h4);font-weight:700}.center-label{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend,.skeleton-legend{display:grid;row-gap:var(--_donut-chart-legend-row-gap);min-inline-size:0}.legend{margin:0;padding:0;list-style:none}.skeleton-legend{flex:1 1 auto}.legend-item{display:grid;grid-template-columns:auto 1fr auto auto;column-gap:var(--space-2);align-items:baseline}.legend-item.interactive{cursor:pointer}.swatch{align-self:center;inline-size:var(--_donut-chart-swatch-size);block-size:var(--_donut-chart-swatch-size);border-radius:var(--radius-pill)}.legend-label{color:var(--text-secondary)}.legend-value{font-weight:700}.legend-percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend-bottom .legend{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-legend-row-gap) var(--space-4)}.legend-bottom .legend-item{display:flex;column-gap:var(--space-2)}.empty-text.is-error{color:var(--error)}.ring-svg .slice{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.ring-svg .slice.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.ring-svg.dims-others:not(:has(.slice.is-pinned)):has(.slice.interactive:hover) .slice.interactive:not(:hover),.ring-svg.dims-others:not(:has(.slice.is-pinned)):has(.slice.interactive:focus-visible) .slice.interactive:not(:focus-visible),.ring-svg.dims-others:has(.slice.is-pinned) .slice:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.ring-svg .slice.interactive{cursor:pointer}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}.pin-marker{display:grid;place-items:center;inline-size:var(--ds-chart-pin-size, 22px);block-size:var(--ds-chart-pin-size, 22px);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-primary);box-shadow:var(--shadow-1);pointer-events:none}\n"] }]
344
+ }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], centerValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerValue", required: false }] }], centerLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerLabel", required: false }] }], legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: false }] }], maxSlices: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSlices", required: false }] }], otherLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "otherLabel", required: false }] }], thickness: [{ type: i0.Input, args: [{ isSignal: true, alias: "thickness", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], sliceClicked: [{ type: i0.Output, args: ["sliceClicked"] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipTemplate: [{ type: i0.ContentChild, args: ['dsChartTooltip', { isSignal: true }] }] } });
293
345
 
294
346
  /**
295
347
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-donut-chart.mjs","sources":["../../../src/lib/components/donut-chart/donut-chart.math.ts","../../../src/lib/components/donut-chart/donut-chart.component.ts","../../../src/lib/components/donut-chart/donut-chart.component.html","../../../src/lib/components/donut-chart/ids-group-ltd-ids-design-system-components-donut-chart.ts"],"sourcesContent":["import type { DonutChartSlice } from './donut-chart.types';\n\nconst FULL_TURN = Math.PI * 2;\nconst FULL_TURN_EPSILON = 1e-9;\n\nexport const DEFAULT_THICKNESS = 0.32;\n\n/** Diameter of the hole, as a fraction of the ring's own diameter. The centre content is held to\n * the square that fits inside it. */\nexport function holeFraction(thickness: number): number {\n const ratio =\n Number.isFinite(thickness) && thickness > 0 && thickness <= 1\n ? thickness\n : DEFAULT_THICKNESS;\n\n return round(1 - ratio);\n}\n\n/** The slices a legend can carry, with everything past `limit` summed into one. The kept slices stay\n * in the order given — a ring is read against its legend top to bottom, so reordering by value\n * would move every other slice to make room for the grouping. The remainder takes the neutral\n * eighth palette slot, which is what that slot is for. */\nexport function groupSmallest(\n slices: readonly DonutChartSlice[],\n limit: number | null,\n otherLabel: string,\n): DonutChartSlice[] {\n if (limit === null || !Number.isInteger(limit) || limit < 2) {\n return [...slices];\n }\n if (slices.length <= limit) {\n return [...slices];\n }\n const ranked = [...slices]\n .map((slice, index) => ({ index, value: positiveValues([slice.value])[0] }))\n .sort((a, b) => b.value - a.value || a.index - b.index);\n const kept = new Set(ranked.slice(0, limit - 1).map((entry) => entry.index));\n const remainder = slices\n .filter((unusedSlice, index) => !kept.has(index))\n .reduce((sum, slice) => sum + positiveValues([slice.value])[0], 0);\n\n return [\n ...slices.filter((unusedSlice, index) => kept.has(index)),\n { id: 'ds-donut-other', label: otherLabel, value: remainder, slot: 8 },\n ];\n}\n\nexport interface DonutArc {\n readonly startAngle: number;\n readonly endAngle: number;\n}\n\n/** A ring is a part-to-whole picture, so anything that is not a positive share\n * becomes zero. Non-finite values go in the same pass: one NaN reaches every\n * other slice through the total, and a `d` attribute holding NaN draws nothing\n * at all rather than failing loudly. */\nexport function positiveValues(values: readonly number[]): number[] {\n return values.map((value) =>\n Number.isFinite(value) && value > 0 ? value : 0,\n );\n}\n\nexport function resolveTotal(values: readonly number[]): number {\n return positiveValues(values).reduce((sum, value) => sum + value, 0);\n}\n\nexport function sliceArcs(values: readonly number[]): DonutArc[] {\n const positive = positiveValues(values);\n const total = resolveTotal(positive);\n if (total <= 0) {\n return positive.map(() => ({ startAngle: 0, endAngle: 0 }));\n }\n let cursor = 0;\n\n return positive.map((value) => {\n const startAngle = cursor;\n cursor += (value / total) * FULL_TURN;\n\n return { startAngle, endAngle: cursor };\n });\n}\n\nexport function resolveInnerRadius(\n outerRadius: number,\n thickness: number,\n): number {\n if (!Number.isFinite(outerRadius) || outerRadius <= 0) {\n return 0;\n }\n // A thickness outside (0, 1] draws no ring: at 0 the band has no width, above\n // 1 the inner radius goes negative. An unusable one falls back to the default\n // instead of rendering an empty chart.\n const ratio =\n Number.isFinite(thickness) && thickness > 0 && thickness <= 1\n ? thickness\n : DEFAULT_THICKNESS;\n\n return outerRadius * (1 - ratio);\n}\n\nexport function paletteIndex(\n slot: number | undefined,\n index: number,\n paletteLength: number,\n): number {\n if (paletteLength <= 0) {\n return 0;\n }\n if (slot !== undefined && Number.isInteger(slot) && slot > 0) {\n return (slot - 1) % paletteLength;\n }\n\n return index % paletteLength;\n}\n\n/** One `\"x y\"` pair for a path. Angles run clockwise from 12 o'clock, where a\n * reader expects a ring to start; SVG's y axis points down, so that is\n * (sin, -cos) rather than the (cos, sin) of the maths convention. */\nexport function ringPoint(\n centerX: number,\n centerY: number,\n radius: number,\n angle: number,\n): string {\n return `${round(centerX + radius * Math.sin(angle))} ${round(\n centerY - radius * Math.cos(angle),\n )}`;\n}\n\nexport function arcPath(\n centerX: number,\n centerY: number,\n outerRadius: number,\n innerRadius: number,\n startAngle: number,\n endAngle: number,\n): string {\n const finite = [\n centerX,\n centerY,\n outerRadius,\n innerRadius,\n startAngle,\n endAngle,\n ].every((value) => Number.isFinite(value));\n if (!finite || outerRadius <= 0) {\n return '';\n }\n const inner = Math.min(Math.max(innerRadius, 0), outerRadius);\n const sweep = endAngle - startAngle;\n if (sweep <= 0) {\n return '';\n }\n if (sweep >= FULL_TURN - FULL_TURN_EPSILON) {\n return fullRingPath(centerX, centerY, outerRadius, inner);\n }\n const largeArcFlag = sweep > Math.PI ? 1 : 0;\n const outerRadii = `${round(outerRadius)} ${round(outerRadius)}`;\n const outerArc =\n `M ${ringPoint(centerX, centerY, outerRadius, startAngle)}` +\n ` A ${outerRadii} 0 ${largeArcFlag} 1 ${ringPoint(centerX, centerY, outerRadius, endAngle)}`;\n if (inner === 0) {\n return `${outerArc} L ${round(centerX)} ${round(centerY)} Z`;\n }\n const innerRadii = `${round(inner)} ${round(inner)}`;\n\n return (\n `${outerArc} L ${ringPoint(centerX, centerY, inner, endAngle)}` +\n ` A ${innerRadii} 0 ${largeArcFlag} 0 ${ringPoint(centerX, centerY, inner, startAngle)} Z`\n );\n}\n\nfunction fullRingPath(\n centerX: number,\n centerY: number,\n outerRadius: number,\n innerRadius: number,\n): string {\n const outer = circlePath(centerX, centerY, outerRadius, 1);\n if (innerRadius <= 0) {\n return outer;\n }\n\n // The hole is cut by winding the inner circle the other way, which the default\n // nonzero fill rule then cancels against the outer one.\n return `${outer} ${circlePath(centerX, centerY, innerRadius, 0)}`;\n}\n\n/** A single arc of a full turn ends where it starts and SVG draws nothing for\n * it, so a closed circle is two half-turns. */\nfunction circlePath(\n centerX: number,\n centerY: number,\n radius: number,\n sweepFlag: 0 | 1,\n): string {\n const top = ringPoint(centerX, centerY, radius, 0);\n const bottom = ringPoint(centerX, centerY, radius, Math.PI);\n const radii = `${round(radius)} ${round(radius)}`;\n\n return `M ${top} A ${radii} 0 1 ${sweepFlag} ${bottom} A ${radii} 0 1 ${sweepFlag} ${top} Z`;\n}\n\nfunction round(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n input,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport {\n CHART_SERIES_COLORS,\n describeSeries,\n formatValue,\n focusMark,\n largestRemainder,\n nextRovingIndex,\n staggerDelay,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n DEFAULT_THICKNESS,\n arcPath,\n groupSmallest,\n holeFraction,\n paletteIndex,\n positiveValues,\n resolveInnerRadius,\n resolveTotal,\n sliceArcs,\n} from './donut-chart.math';\nimport type { DonutChartSlice } from './donut-chart.types';\n\nconst defaultValueFormat = (value: number) => formatValue(value);\n\nconst RING_VIEW_BOX_SIZE = 100;\nconst RING_CENTER = RING_VIEW_BOX_SIZE / 2;\nconst RING_OUTER_RADIUS = RING_VIEW_BOX_SIZE / 2;\n\n@Component({\n selector: 'ds-donut-chart',\n standalone: true,\n imports: [SkeletonComponent, ChartTooltipDirective],\n templateUrl: './donut-chart.component.html',\n styleUrl: './donut-chart.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DonutChartComponent {\n /** One slice per entry. A non-positive or non-finite value counts as zero — a ring is a\n * part-to-whole picture and has no way to draw a negative share. */\n readonly data = input.required<readonly DonutChartSlice[]>();\n\n /** Printed inside the ring. Null prints the sum through `valueFormat`. */\n readonly centerValue = input<string | null>(null);\n\n /** Caption under the centre value. */\n readonly centerLabel = input<string | null>(null);\n\n /** Logical placement, so a right-to-left page needs no second value. */\n readonly legend = input<'end' | 'bottom' | 'none'>('end');\n\n /** Longest legend to draw. Past it the smallest slices are summed into one, so a long tail does\n * not become a legend nobody reads. Off by default: grouping changes what the chart says, and\n * that is the consumer's call. Values below 2 are ignored — one slice is not a donut. */\n readonly maxSlices = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n\n /** Names the grouped slice. */\n readonly otherLabel = input<string>('Other');\n\n /** Ring width as a fraction of the radius. */\n readonly thickness = input(DEFAULT_THICKNESS, { transform: numberAttribute });\n\n /** Printed above the plot as the chart's visible title, and reused as the annex table's\n * caption. */\n readonly caption = input<string | null>(null);\n\n /** Accessible name. Generated from the data when omitted. */\n readonly summary = input<string | null>(null);\n\n /** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,\n * `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so\n * `'none'` belongs only where the same data is already in a table on the page. */\n readonly dataTable = input<'toggle' | 'visible' | 'none'>('toggle');\n /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize\n * when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Shown in place of the plot when `data` is empty. */\n readonly emptyText = input<string>('No data');\n\n /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,\n * because \"the request failed\" and \"there is nothing to show\" read the same to a reader and\n * mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** The message the error state prints. */\n readonly errorText = input<string>('Could not load the data');\n /** Formats every value the chart prints, the annex table and the generated description\n * included. Defaults to the browser's locale grouping with a K/M/B suffix past four digits. */\n readonly valueFormat = input<(value: number) => string>(defaultValueFormat);\n\n /** Turns on the click affordance — the pointer cursor and any hover tint.\n * The click output fires whether or not this is set, so a consumer that\n * binds the output and forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The slice that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly sliceClicked = output<DonutChartSlice>();\n\n /** Milliseconds between one mark's entrance and the next. `0`, the default, is no stagger at\n * all; `40` is the documented non-zero step. The total is capped, so a long series does not\n * crawl in. */\n readonly staggerMs = input(0, { transform: numberAttribute });\n\n protected markStagger(index: number): string {\n return `${staggerDelay(index, this.staggerMs())}ms`;\n }\n\n /** Whether a hovered or focused slice opens a tooltip. `'axis'` is not offered — a ring\n * has no axis to group readings under. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n protected readonly activeMark = chartActiveMark();\n /** One tab stop per chart, not one per slice: WCAG 2.1.1's Understanding is explicit that not\n * every mouse-operable control has to be separately focusable. */\n protected readonly rovingIndex = signal(0);\n\n protected readonly tabStopIndex = computed(() =>\n Math.min(this.rovingIndex(), Math.max(0, this.slices().length - 1)),\n );\n\n protected onMarkFocus(index: number, event: FocusEvent): void {\n this.rovingIndex.set(index);\n this.activeMark.enter(index, event);\n }\n\n protected onMarkNavigation(\n event: KeyboardEvent,\n index: number,\n scope: string,\n ): void {\n const next = nextRovingIndex(event.key, index, this.slices().length);\n if (next === null) {\n return;\n }\n event.preventDefault();\n this.rovingIndex.set(next);\n focusMark((event.currentTarget as Element).closest(scope), next);\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const entry = this.slices()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !entry) {\n return null;\n }\n\n return {\n category: '',\n entries: [\n {\n label: entry.slice.label,\n value: entry.slice.value,\n formatted: `${entry.formattedValue} · ${entry.formattedPercent}`,\n color: entry.color,\n },\n ],\n };\n },\n );\n\n protected readonly viewBox = `0 0 ${RING_VIEW_BOX_SIZE} ${RING_VIEW_BOX_SIZE}`;\n\n protected readonly total = computed(() =>\n resolveTotal(this.data().map((slice) => slice.value)),\n );\n\n protected readonly visibleSlices = computed(() =>\n groupSmallest(this.data(), this.maxSlices(), this.otherLabel()),\n );\n\n protected readonly slices = computed(() => {\n const data = this.visibleSlices();\n const values = data.map((slice) => slice.value);\n const arcs = sliceArcs(values);\n const percents = largestRemainder(positiveValues(values));\n const innerRadius = resolveInnerRadius(RING_OUTER_RADIUS, this.thickness());\n const format = this.valueFormat();\n\n return data.map((slice, index) => ({\n slice,\n path: arcPath(\n RING_CENTER,\n RING_CENTER,\n RING_OUTER_RADIUS,\n innerRadius,\n arcs[index].startAngle,\n arcs[index].endAngle,\n ),\n color:\n CHART_SERIES_COLORS[\n paletteIndex(slice.slot, index, CHART_SERIES_COLORS.length)\n ],\n formattedValue: format(slice.value),\n formattedPercent: `${percents[index]}%`,\n }));\n });\n\n protected readonly resolvedCenterValue = computed(\n () => this.centerValue() ?? this.valueFormat()(this.total()),\n );\n\n protected readonly accessibleName = computed(\n () =>\n this.summary() ??\n describeSeries(\n this.caption() ?? 'Chart',\n this.data().map((slice) => ({\n label: slice.label,\n value: slice.value,\n })),\n this.valueFormat(),\n this.dataTable() !== 'none',\n ),\n );\n\n protected readonly hole = computed(() => holeFraction(this.thickness()));\n\n protected entryLabel(entry: {\n slice: DonutChartSlice;\n formattedValue: string;\n formattedPercent: string;\n }) {\n return `${entry.slice.label}, ${entry.formattedValue}, ${entry.formattedPercent}`;\n }\n\n protected onSliceKey(slice: DonutChartSlice, event: Event): void {\n // Only the legend item's own key opens it: a key pressed on a control inside belongs to that\n // control.\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.sliceClicked.emit(slice);\n }\n\n // Both focusable would double the tab order; the legend items already carry the route.\n // Without this the ring is unreachable at `legend=\"none\"`.\n protected readonly ringCarriesTheRoute = computed(\n () => this.interactive() && this.legend() === 'none',\n );\n\n protected readonly isEmpty = computed(() => this.data().length === 0);\n\n /** Placeholder legend rows while loading. Follows the real slice count so the\n * chart does not resize when the data lands; falls back to three when `data`\n * is still empty. */\n protected readonly skeletonRows = computed(() =>\n Array.from({ length: Math.max(this.data().length, 3) }),\n );\n}\n","<figure\n class=\"donut-chart\"\n [style.--_donut-chart-hole-fraction]=\"hole()\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorText() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\"\n [class.legend-bottom]=\"legend() === 'bottom'\">\n <ds-skeleton\n circle\n width=\"var(--_donut-chart-size)\"\n height=\"var(--_donut-chart-size)\" />\n\n @if (legend() !== 'none') {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_donut-chart-legend-row-height)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p class=\"empty-text\">\n {{ emptyText() }}\n </p>\n </div>\n } @else {\n <div\n class=\"chart\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [class.legend-bottom]=\"legend() === 'bottom'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <div\n class=\"ring\"\n [class.ring-outline]=\"total() === 0\">\n <svg\n class=\"ring-svg\"\n [attr.aria-hidden]=\"ringCarriesTheRoute() ? null : true\"\n [attr.viewBox]=\"viewBox\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <path\n class=\"slice\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.focusable]=\"ringCarriesTheRoute()\"\n [attr.d]=\"entry.path\"\n [style.fill]=\"entry.color\"\n [attr.role]=\"ringCarriesTheRoute() ? 'button' : null\"\n [attr.tabindex]=\"\n ringCarriesTheRoute()\n ? index === tabStopIndex()\n ? 0\n : -1\n : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"\n ringCarriesTheRoute() ? entryLabel(entry) : null\n \"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.ring-svg')\"\n (click)=\"sliceClicked.emit(entry.slice)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n </path>\n }\n </svg>\n\n <div class=\"center\">\n <span class=\"center-value\">\n {{ resolvedCenterValue() }}\n </span>\n\n @if (centerLabel()) {\n <span class=\"center-label\">\n {{ centerLabel() }}\n </span>\n }\n </div>\n </div>\n\n @if (legend() !== 'none') {\n <ul class=\"legend\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <li\n class=\"legend-item\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.legend')\"\n (click)=\"sliceClicked.emit(entry.slice)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n <span\n class=\"swatch\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ entry.slice.label }}\n </span>\n\n <span class=\"legend-value\">\n {{ entry.formattedValue }}\n </span>\n\n <span class=\"legend-percent\">\n {{ entry.formattedPercent }}\n </span>\n </li>\n }\n </ul>\n }\n </div>\n\n @if (dataTable() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTable() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Share\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of slices(); track entry.slice.id) {\n <tr>\n <td>\n {{ entry.slice.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC;AAC7B,MAAM,iBAAiB,GAAG,IAAI;AAEvB,MAAM,iBAAiB,GAAG,IAAI;AAErC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,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC3DhC,wiMA0MA,EAAA,MAAA,EAAA,CAAA,slOAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDrJY,iBAAiB,yGAAE,qBAAqB,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,gBAAA,EAAA,sBAAA,EAAA,wBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAMvC,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAT/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,EAAA,aAAA,EAGpC,iBAAiB,CAAC,QAAQ,EAAA,eAAA,EACxB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,wiMAAA,EAAA,MAAA,EAAA,CAAA,slOAAA,CAAA,EAAA;01DAiF3C,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE1ItB;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-donut-chart.mjs","sources":["../../../src/lib/components/donut-chart/donut-chart.math.ts","../../../src/lib/components/donut-chart/donut-chart.component.ts","../../../src/lib/components/donut-chart/donut-chart.component.html","../../../src/lib/components/donut-chart/ids-group-ltd-ids-design-system-components-donut-chart.ts"],"sourcesContent":["import type { DonutChartSlice } from './donut-chart.types';\n\nconst FULL_TURN = Math.PI * 2;\nconst FULL_TURN_EPSILON = 1e-9;\n\nexport const DEFAULT_THICKNESS = 0.32;\n\n/** Diameter of the hole, as a fraction of the ring's own diameter. The centre content is held to\n * the square that fits inside it. */\nexport function holeFraction(thickness: number): number {\n const ratio =\n Number.isFinite(thickness) && thickness > 0 && thickness <= 1\n ? thickness\n : DEFAULT_THICKNESS;\n\n return round(1 - ratio);\n}\n\n/** The slices a legend can carry, with everything past `limit` summed into one. The kept slices stay\n * in the order given — a ring is read against its legend top to bottom, so reordering by value\n * would move every other slice to make room for the grouping. The remainder takes the neutral\n * eighth palette slot, which is what that slot is for. */\nexport function groupSmallest(\n slices: readonly DonutChartSlice[],\n limit: number | null,\n otherLabel: string,\n): DonutChartSlice[] {\n if (limit === null || !Number.isInteger(limit) || limit < 2) {\n return [...slices];\n }\n if (slices.length <= limit) {\n return [...slices];\n }\n const ranked = [...slices]\n .map((slice, index) => ({ index, value: positiveValues([slice.value])[0] }))\n .sort((a, b) => b.value - a.value || a.index - b.index);\n const kept = new Set(ranked.slice(0, limit - 1).map((entry) => entry.index));\n const remainder = slices\n .filter((unusedSlice, index) => !kept.has(index))\n .reduce((sum, slice) => sum + positiveValues([slice.value])[0], 0);\n\n return [\n ...slices.filter((unusedSlice, index) => kept.has(index)),\n { id: 'ds-donut-other', label: otherLabel, value: remainder, slot: 8 },\n ];\n}\n\nexport interface DonutArc {\n readonly startAngle: number;\n readonly endAngle: number;\n}\n\n/** A ring is a part-to-whole picture, so anything that is not a positive share\n * becomes zero. Non-finite values go in the same pass: one NaN reaches every\n * other slice through the total, and a `d` attribute holding NaN draws nothing\n * at all rather than failing loudly. */\nexport function positiveValues(values: readonly number[]): number[] {\n return values.map((value) =>\n Number.isFinite(value) && value > 0 ? value : 0,\n );\n}\n\nexport function resolveTotal(values: readonly number[]): number {\n return positiveValues(values).reduce((sum, value) => sum + value, 0);\n}\n\nexport function sliceArcs(values: readonly number[]): DonutArc[] {\n const positive = positiveValues(values);\n const total = resolveTotal(positive);\n if (total <= 0) {\n return positive.map(() => ({ startAngle: 0, endAngle: 0 }));\n }\n let cursor = 0;\n\n return positive.map((value) => {\n const startAngle = cursor;\n cursor += (value / total) * FULL_TURN;\n\n return { startAngle, endAngle: cursor };\n });\n}\n\nexport function resolveInnerRadius(\n outerRadius: number,\n thickness: number,\n): number {\n if (!Number.isFinite(outerRadius) || outerRadius <= 0) {\n return 0;\n }\n // A thickness outside (0, 1] draws no ring: at 0 the band has no width, above\n // 1 the inner radius goes negative. An unusable one falls back to the default\n // instead of rendering an empty chart.\n const ratio =\n Number.isFinite(thickness) && thickness > 0 && thickness <= 1\n ? thickness\n : DEFAULT_THICKNESS;\n\n return outerRadius * (1 - ratio);\n}\n\nexport function paletteIndex(\n slot: number | undefined,\n index: number,\n paletteLength: number,\n): number {\n if (paletteLength <= 0) {\n return 0;\n }\n if (slot !== undefined && Number.isInteger(slot) && slot > 0) {\n return (slot - 1) % paletteLength;\n }\n\n return index % paletteLength;\n}\n\n/** One `\"x y\"` pair for a path. Angles run clockwise from 12 o'clock, where a\n * reader expects a ring to start; SVG's y axis points down, so that is\n * (sin, -cos) rather than the (cos, sin) of the maths convention. */\nexport function ringPoint(\n centerX: number,\n centerY: number,\n radius: number,\n angle: number,\n): string {\n const { x, y } = ringCoords(centerX, centerY, radius, angle);\n\n return `${x} ${y}`;\n}\n\n/** The same point as numbers, for PLACING something rather than drawing a path. */\nexport function ringCoords(\n centerX: number,\n centerY: number,\n radius: number,\n angle: number,\n): { x: number; y: number } {\n return {\n x: round(centerX + radius * Math.sin(angle)),\n y: round(centerY - radius * Math.cos(angle)),\n };\n}\n\nexport function arcPath(\n centerX: number,\n centerY: number,\n outerRadius: number,\n innerRadius: number,\n startAngle: number,\n endAngle: number,\n): string {\n const finite = [\n centerX,\n centerY,\n outerRadius,\n innerRadius,\n startAngle,\n endAngle,\n ].every((value) => Number.isFinite(value));\n if (!finite || outerRadius <= 0) {\n return '';\n }\n const inner = Math.min(Math.max(innerRadius, 0), outerRadius);\n const sweep = endAngle - startAngle;\n if (sweep <= 0) {\n return '';\n }\n if (sweep >= FULL_TURN - FULL_TURN_EPSILON) {\n return fullRingPath(centerX, centerY, outerRadius, inner);\n }\n const largeArcFlag = sweep > Math.PI ? 1 : 0;\n const outerRadii = `${round(outerRadius)} ${round(outerRadius)}`;\n const outerArc =\n `M ${ringPoint(centerX, centerY, outerRadius, startAngle)}` +\n ` A ${outerRadii} 0 ${largeArcFlag} 1 ${ringPoint(centerX, centerY, outerRadius, endAngle)}`;\n if (inner === 0) {\n return `${outerArc} L ${round(centerX)} ${round(centerY)} Z`;\n }\n const innerRadii = `${round(inner)} ${round(inner)}`;\n\n return (\n `${outerArc} L ${ringPoint(centerX, centerY, inner, endAngle)}` +\n ` A ${innerRadii} 0 ${largeArcFlag} 0 ${ringPoint(centerX, centerY, inner, startAngle)} Z`\n );\n}\n\nfunction fullRingPath(\n centerX: number,\n centerY: number,\n outerRadius: number,\n innerRadius: number,\n): string {\n const outer = circlePath(centerX, centerY, outerRadius, 1);\n if (innerRadius <= 0) {\n return outer;\n }\n\n // The hole is cut by winding the inner circle the other way, which the default\n // nonzero fill rule then cancels against the outer one.\n return `${outer} ${circlePath(centerX, centerY, innerRadius, 0)}`;\n}\n\n/** A single arc of a full turn ends where it starts and SVG draws nothing for\n * it, so a closed circle is two half-turns. */\nfunction circlePath(\n centerX: number,\n centerY: number,\n radius: number,\n sweepFlag: 0 | 1,\n): string {\n const top = ringPoint(centerX, centerY, radius, 0);\n const bottom = ringPoint(centerX, centerY, radius, Math.PI);\n const radii = `${round(radius)} ${round(radius)}`;\n\n return `M ${top} A ${radii} 0 1 ${sweepFlag} ${bottom} A ${radii} 0 1 ${sweepFlag} ${top} Z`;\n}\n\nfunction round(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n input,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport {\n CHART_SERIES_COLORS,\n describeSeries,\n formatValue,\n focusMark,\n largestRemainder,\n nextRovingIndex,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n DEFAULT_THICKNESS,\n arcPath,\n groupSmallest,\n holeFraction,\n paletteIndex,\n positiveValues,\n resolveInnerRadius,\n resolveTotal,\n ringCoords,\n sliceArcs,\n} from './donut-chart.math';\nimport type { DonutChartSlice } from './donut-chart.types';\n\nconst defaultValueFormat = (value: number) => formatValue(value);\n\nconst RING_VIEW_BOX_SIZE = 100;\nconst RING_CENTER = RING_VIEW_BOX_SIZE / 2;\nconst RING_OUTER_RADIUS = RING_VIEW_BOX_SIZE / 2;\n\n@Component({\n selector: 'ds-donut-chart',\n standalone: true,\n imports: [SkeletonComponent, ChartTooltipDirective, IconComponent],\n templateUrl: './donut-chart.component.html',\n styleUrl: './donut-chart.component.scss',\n host: { '[class.framed]': \"frameResolved() === 'auto'\" },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DonutChartComponent {\n /** One slice per entry. A non-positive or non-finite value counts as zero — a ring is a\n * part-to-whole picture and has no way to draw a negative share. */\n readonly data = input.required<readonly DonutChartSlice[]>();\n\n /** Printed inside the ring. Null prints the sum through `valueFormat`. */\n readonly centerValue = input<string | null>(null);\n\n /** Caption under the centre value. */\n readonly centerLabel = input<string | null>(null);\n\n /** Logical placement, so a right-to-left page needs no second value. */\n readonly legend = input<'end' | 'bottom' | 'none'>('end');\n\n /** Longest legend to draw. Past it the smallest slices are summed into one, so a long tail does\n * not become a legend nobody reads. Off by default: grouping changes what the chart says, and\n * that is the consumer's call. Values below 2 are ignored — one slice is not a donut. */\n readonly maxSlices = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n\n /** Names the grouped slice. */\n readonly otherLabel = input<string>('Other');\n\n /** Ring width as a fraction of the radius. */\n readonly thickness = input(DEFAULT_THICKNESS, { transform: numberAttribute });\n\n /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;\n * `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.\n * Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards\n * is one decision per app rather than per plot. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the\n * default, takes it away at once: a panel that outlives the pointer sits over the plot the\n * reader has moved on to.\n *\n * Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything\n * selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so\n * crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to\n * `DS_CONFIG.chart.tooltipLingerMs`, then 0. */\n readonly tooltipLingerMs = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Printed above the plot as the chart's visible title, and reused as the annex table's\n * caption. */\n readonly caption = input<string | null>(null);\n\n /** Accessible name. Generated from the data when omitted. */\n readonly summary = input<string | null>(null);\n\n /** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,\n * `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so\n * `'none'` belongs only where the same data is already in a table on the page.\n * Unset falls back to `DS_CONFIG.chart.dataTable`, then `'none'`. */\n readonly dataTable = input<ChartDataTable | null>(null);\n /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize\n * when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Shown in place of the plot when `data` is empty. Unset falls back to\n * `DS_CONFIG.chart.emptyText`, then `'No data'`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,\n * because \"the request failed\" and \"there is nothing to show\" read the same to a reader and\n * mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** The message the error state prints. Unset falls back to `DS_CONFIG.chart.errorText`, then\n * `'Could not load the data'`. */\n readonly errorText = input<string | null>(null);\n /** Formats every value the chart prints, the annex table and the generated description\n * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale\n * grouping with a K/M/B suffix past four digits. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n readonly frameResolved = resolveWithConfig(\n this.frame,\n (config) => config.chart?.frame,\n 'auto' as ChartFrame,\n );\n readonly dataTableResolved = resolveWithConfig(\n this.dataTable,\n (config) => config.chart?.dataTable,\n 'none' as ChartDataTable,\n );\n readonly emptyTextResolved = resolveWithConfig(\n this.emptyText,\n (config) => config.chart?.emptyText,\n 'No data',\n );\n readonly errorTextResolved = resolveWithConfig(\n this.errorText,\n (config) => config.chart?.errorText,\n 'Could not load the data',\n );\n readonly valueFormatResolved = resolveWithConfig(\n this.valueFormat,\n (config) => config.chart?.valueFormat,\n defaultValueFormat as ChartValueFormat,\n );\n\n /** Turns on the click affordance — the pointer cursor and any hover tint.\n * The click output fires whether or not this is set, so a consumer that\n * binds the output and forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The slice that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly sliceClicked = output<DonutChartSlice>();\n\n /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press\n * outside releases it. Off by default: a click is already the drill-down hook, and a mark left\n * lit after the pointer has gone needs a reader who knows why it is lit. `sliceClicked` fires\n * either way — pinning is a state, not a handler. */\n readonly pinOnClick = input(false, { transform: booleanAttribute });\n\n /** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the\n * one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed\n * marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full\n * opacity to 2.1 at `--ds-chart-dim-opacity`'s default 0.3 — so it buys loudness for one mark\n * and pays for it with the rest of the chart. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** Accepted for parity with the other four charts and deliberately without effect here: a ring\n * arrives as ONE object, because arcs share their edges and fading them one at a time lets the\n * background through every seam. There is nothing to stagger. */\n readonly staggerMs = input(0, { transform: numberAttribute });\n\n /** Whether a hovered or focused slice opens a tooltip. `'axis'` is not offered — a ring\n * has no axis to group readings under. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n private readonly tooltipLingerResolved = resolveWithConfig(\n this.tooltipLingerMs,\n (config) => config.chart?.tooltipLingerMs,\n 0,\n );\n\n protected readonly activeMark = chartActiveMark(() =>\n this.tooltipLingerResolved(),\n );\n\n protected onMarkClick(\n payload: DonutChartSlice,\n index: number,\n event: Event,\n ): void {\n this.sliceClicked.emit(payload);\n if (this.pinOnClick()) {\n this.activeMark.pin(index, event);\n }\n }\n /** One tab stop per chart, not one per slice: WCAG 2.1.1's Understanding is explicit that not\n * every mouse-operable control has to be separately focusable. */\n protected readonly rovingIndex = signal(0);\n\n protected readonly tabStopIndex = computed(() =>\n Math.min(this.rovingIndex(), Math.max(0, this.slices().length - 1)),\n );\n\n protected onMarkFocus(index: number, event: FocusEvent): void {\n this.rovingIndex.set(index);\n this.activeMark.enter(index, event);\n }\n\n protected onMarkNavigation(\n event: KeyboardEvent,\n index: number,\n scope: string,\n ): void {\n const next = nextRovingIndex(event.key, index, this.slices().length);\n if (next === null) {\n return;\n }\n event.preventDefault();\n this.rovingIndex.set(next);\n focusMark((event.currentTarget as Element).closest(scope), next);\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const entry = this.slices()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !entry) {\n return null;\n }\n\n return {\n category: '',\n entries: [\n {\n label: entry.slice.label,\n value: entry.slice.value,\n formatted: `${entry.formattedValue} · ${entry.formattedPercent}`,\n color: entry.color,\n },\n ],\n };\n },\n );\n\n protected readonly viewBox = `0 0 ${RING_VIEW_BOX_SIZE} ${RING_VIEW_BOX_SIZE}`;\n\n protected readonly total = computed(() =>\n resolveTotal(this.data().map((slice) => slice.value)),\n );\n\n protected readonly visibleSlices = computed(() =>\n groupSmallest(this.data(), this.maxSlices(), this.otherLabel()),\n );\n\n protected readonly slices = computed(() => {\n const data = this.visibleSlices();\n const values = data.map((slice) => slice.value);\n const arcs = sliceArcs(values);\n const percents = largestRemainder(positiveValues(values));\n const innerRadius = resolveInnerRadius(RING_OUTER_RADIUS, this.thickness());\n const format = this.valueFormatResolved();\n\n const midRadius = (RING_OUTER_RADIUS + innerRadius) / 2;\n\n return data.map((slice, index) => ({\n slice,\n // Halfway along the arc and halfway through the ring: the one point that is inside a slice\n // whatever its sweep, which the bounding box of a curved wedge is not.\n center: ringCoords(\n RING_CENTER,\n RING_CENTER,\n midRadius,\n (arcs[index].startAngle + arcs[index].endAngle) / 2,\n ),\n path: arcPath(\n RING_CENTER,\n RING_CENTER,\n RING_OUTER_RADIUS,\n innerRadius,\n arcs[index].startAngle,\n arcs[index].endAngle,\n ),\n color:\n CHART_SERIES_COLORS[\n paletteIndex(slice.slot, index, CHART_SERIES_COLORS.length)\n ],\n formattedValue: format(slice.value),\n formattedPercent: `${percents[index]}%`,\n }));\n });\n\n protected readonly resolvedCenterValue = computed(\n () => this.centerValue() ?? this.valueFormatResolved()(this.total()),\n );\n\n protected readonly accessibleName = computed(\n () =>\n this.summary() ??\n describeSeries(\n this.caption() ?? 'Chart',\n this.data().map((slice) => ({\n label: slice.label,\n value: slice.value,\n })),\n this.valueFormatResolved(),\n this.dataTableResolved() !== 'none',\n ),\n );\n\n protected readonly hole = computed(() => holeFraction(this.thickness()));\n\n protected entryLabel(entry: {\n slice: DonutChartSlice;\n formattedValue: string;\n formattedPercent: string;\n }) {\n return `${entry.slice.label}, ${entry.formattedValue}, ${entry.formattedPercent}`;\n }\n\n protected onSliceKey(slice: DonutChartSlice, event: Event): void {\n // Only the legend item's own key opens it: a key pressed on a control inside belongs to that\n // control.\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.sliceClicked.emit(slice);\n }\n\n // Both focusable would double the tab order; the legend items already carry the route.\n // Without this the ring is unreachable at `legend=\"none\"`.\n protected readonly ringCarriesTheRoute = computed(\n () => this.interactive() && this.legend() === 'none',\n );\n\n protected readonly isEmpty = computed(() => this.data().length === 0);\n\n /** Placeholder legend rows while loading. Follows the real slice count so the\n * chart does not resize when the data lands; falls back to three when `data`\n * is still empty. */\n protected readonly skeletonRows = computed(() =>\n Array.from({ length: Math.max(this.data().length, 3) }),\n );\n}\n","<figure\n class=\"donut-chart\"\n [style.--_donut-chart-hole-fraction]=\"hole()\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p\n class=\"empty-text is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n </div>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\"\n [class.legend-bottom]=\"legend() === 'bottom'\">\n <ds-skeleton\n circle\n width=\"var(--_donut-chart-size)\"\n height=\"var(--_donut-chart-size)\" />\n\n @if (legend() !== 'none') {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_donut-chart-legend-row-height)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p class=\"empty-text\">\n {{ emptyTextResolved() }}\n </p>\n </div>\n } @else {\n <div\n class=\"chart\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [class.legend-bottom]=\"legend() === 'bottom'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <div\n class=\"ring\"\n [class.ring-outline]=\"total() === 0\">\n <svg\n class=\"ring-svg\"\n animate.enter=\"mark-enter\"\n [class.dims-others]=\"dimOthers()\"\n [attr.aria-hidden]=\"ringCarriesTheRoute() ? null : true\"\n [attr.viewBox]=\"viewBox\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <path\n class=\"slice\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [class.focusable]=\"ringCarriesTheRoute()\"\n [attr.d]=\"entry.path\"\n [style.fill]=\"entry.color\"\n [attr.role]=\"ringCarriesTheRoute() ? 'button' : null\"\n [attr.tabindex]=\"\n ringCarriesTheRoute()\n ? index === tabStopIndex()\n ? 0\n : -1\n : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"\n ringCarriesTheRoute() ? entryLabel(entry) : null\n \"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.ring-svg')\"\n (click)=\"onMarkClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n </path>\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <foreignObject\n class=\"pin-marker\"\n width=\"14\"\n height=\"14\"\n [attr.x]=\"entry.center.x - 7\"\n [attr.y]=\"entry.center.y - 7\">\n <ds-icon\n name=\"pin\"\n [size]=\"14\" />\n </foreignObject>\n }\n }\n </svg>\n\n <div class=\"center\">\n <span class=\"center-value\">\n {{ resolvedCenterValue() }}\n </span>\n\n @if (centerLabel()) {\n <span class=\"center-label\">\n {{ centerLabel() }}\n </span>\n }\n </div>\n </div>\n\n @if (legend() !== 'none') {\n <ul class=\"legend\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <li\n class=\"legend-item\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.legend')\"\n (click)=\"onMarkClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n <span\n class=\"swatch\"\n animate.enter=\"mark-enter\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ entry.slice.label }}\n </span>\n\n <span class=\"legend-value\">\n {{ entry.formattedValue }}\n </span>\n\n <span class=\"legend-percent\">\n {{ entry.formattedPercent }}\n </span>\n </li>\n }\n </ul>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Share\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of slices(); track entry.slice.id) {\n <tr>\n <td>\n {{ entry.slice.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC;AAC7B,MAAM,iBAAiB,GAAG,IAAI;AAEvB,MAAM,iBAAiB,GAAG,IAAI;AAErC;AACsC;AAChC,SAAU,YAAY,CAAC,SAAiB,EAAA;AAC5C,IAAA,MAAM,KAAK,GACT,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,IAAI;AAC1D,UAAE;UACA,iBAAiB;AAEvB,IAAA,OAAO,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC;AACzB;AAEA;;;AAG2D;SAC3C,aAAa,CAC3B,MAAkC,EAClC,KAAoB,EACpB,UAAkB,EAAA;AAElB,IAAA,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE;AAC3D,QAAA,OAAO,CAAC,GAAG,MAAM,CAAC;IACpB;AACA,IAAA,IAAI,MAAM,CAAC,MAAM,IAAI,KAAK,EAAE;AAC1B,QAAA,OAAO,CAAC,GAAG,MAAM,CAAC;IACpB;AACA,IAAA,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM;SACtB,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1E,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC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