@ids-group-ltd/ids-design-system 0.13.1 → 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 (52) hide show
  1. package/CHANGELOG.md +361 -0
  2. package/components.md +17 -5
  3. package/docs/agent/INDEX.md +1 -0
  4. package/docs/agent/charts/ds-line-chart.md +2 -1
  5. package/docs/agent/feedback/ds-meter.md +11 -0
  6. package/docs/agent/feedback/ds-progress.md +4 -1
  7. package/docs/agent/forms/ds-button.md +1 -1
  8. package/docs/agent/forms/ds-icon-button.md +1 -1
  9. package/docs/agent/surfaces/ds-card.md +1 -1
  10. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +77 -8
  11. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
  12. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +3 -0
  13. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
  14. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +47 -5
  15. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
  16. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +141 -22
  17. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
  18. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +49 -9
  19. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
  20. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +47 -7
  21. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +1 -1
  22. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +74 -8
  23. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
  24. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +182 -18
  25. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
  26. package/fesm2022/ids-group-ltd-ids-design-system-components-meter.mjs +61 -0
  27. package/fesm2022/ids-group-ltd-ids-design-system-components-meter.mjs.map +1 -0
  28. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +34 -10
  29. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +1 -1
  30. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +71 -13
  31. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  32. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
  33. package/fesm2022/ids-group-ltd-ids-design-system.mjs +1 -0
  34. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  35. package/migrations/0.13.2.json +269 -0
  36. package/package.json +9 -1
  37. package/styles/_chart-frame.scss +101 -4
  38. package/styles/_chart-interactive.scss +12 -3
  39. package/styles/_overlay-motion.scss +7 -6
  40. package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +66 -4
  41. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +1 -0
  42. package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +25 -2
  43. package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +16 -2
  44. package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +34 -3
  45. package/types/ids-group-ltd-ids-design-system-components-donut-chart.d.ts +29 -3
  46. package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +46 -3
  47. package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +83 -6
  48. package/types/ids-group-ltd-ids-design-system-components-meter.d.ts +36 -0
  49. package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +21 -3
  50. package/types/ids-group-ltd-ids-design-system-components.d.ts +35 -9
  51. package/types/ids-group-ltd-ids-design-system-core.d.ts +19 -3
  52. package/types/ids-group-ltd-ids-design-system.d.ts +5 -4
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-line-chart.mjs","sources":["../../../src/lib/components/line-chart/line-chart.math.ts","../../../src/lib/components/line-chart/line-chart.component.ts","../../../src/lib/components/line-chart/line-chart.component.html","../../../src/lib/components/line-chart/ids-group-ltd-ids-design-system-components-line-chart.ts"],"sourcesContent":["import {\n bandScale,\n linearScale,\n niceMax,\n tickValues,\n} from '@ids-group-ltd/ids-design-system/components';\nimport type { LineChartAxisMode, LineChartGaps } from './line-chart.types';\n\nexport const LINE_CHART_VIEW_WIDTH = 640;\nexport const LINE_CHART_VIEW_HEIGHT = 320;\nexport const LINE_CHART_DEFAULT_TICK_COUNT = 5;\nexport const LINE_CHART_AXIS_LABEL_GAP = 8;\n\nconst AXIS_GUTTER = 46;\nconst BARE_EDGE_GUTTER = 12;\nconst PLOT_TOP = 14;\nconst CATEGORY_GUTTER = 30;\nconst CATEGORY_LABEL_OFFSET = 18;\nconst STACKED_PLOT_GAP = 34;\nconst MAX_CATEGORY_LABELS = 12;\nconst COORDINATE_DECIMALS = 2;\nconst TICK_DECIMALS = 6;\nconst ROUND_STEP_FACTORS = [1, 2, 5, 10];\n// A step divided out of a domain and multiplied back rarely lands on itself, so a\n// candidate equal to the minimum can compare as smaller by one bit and push the\n// whole axis up a rung.\nconst ROUND_STEP_TOLERANCE = 1 - 1e-12;\n\nexport interface PlotArea {\n readonly left: number;\n readonly top: number;\n readonly width: number;\n readonly height: number;\n}\n\nexport interface AxisScale {\n readonly max: number;\n readonly ticks: readonly number[];\n}\n\nexport interface AxisLayout {\n readonly primary: AxisScale;\n /** Null when no series asked for a second axis. */\n readonly secondary: AxisScale | null;\n /** True when the secondary axis is drawn against the primary's gridlines. */\n readonly alignedTicks: boolean;\n}\n\nexport interface ChartLayout {\n readonly primaryPlot: PlotArea;\n /** The same area as `primaryPlot` unless the plots are stacked. */\n readonly secondaryPlot: PlotArea;\n readonly categoryLabelY: number;\n readonly stacked: boolean;\n}\n\nexport interface LinePoint {\n readonly categoryIndex: number;\n readonly x: number;\n readonly y: number;\n readonly value: number;\n}\n\nfunction roundTo(value: number, decimals: number): number {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Number(value.toFixed(decimals));\n}\n\nexport function normalizeTickCount(tickCount: number): number {\n return Number.isFinite(tickCount) && tickCount >= 1\n ? Math.floor(tickCount)\n : LINE_CHART_DEFAULT_TICK_COUNT;\n}\n\n/** One reading per category, however long the series actually was. A series longer\n * than `categories` loses its tail and a shorter one ends early: a line that stops\n * short is a defect the reader can see, while a thrown error takes down the page\n * around it. Anything that is not a finite number is a missing reading, so `NaN`\n * and `Infinity` follow the `gaps` policy rather than reaching a coordinate. */\nexport function alignSeriesValues(\n data: readonly (number | null)[],\n categoryCount: number,\n gaps: LineChartGaps,\n): (number | null)[] {\n const length =\n Number.isFinite(categoryCount) && categoryCount > 0\n ? Math.floor(categoryCount)\n : 0;\n const aligned: (number | null)[] = [];\n for (let index = 0; index < length; index++) {\n const raw = data[index];\n const reading =\n typeof raw === 'number' && Number.isFinite(raw) ? raw : null;\n aligned.push(reading === null && gaps === 'zero' ? 0 : reading);\n }\n\n return aligned;\n}\n\n/** Largest finite reading across the given series, or zero. Never negative: the\n * tick helpers only describe axes that start at zero, and a negative domain there\n * is a division waiting to happen. */\nexport function domainMaxOf(\n valueGroups: readonly (readonly (number | null)[])[],\n): number {\n let max = 0;\n for (const values of valueGroups) {\n for (const value of values) {\n if (value !== null && Number.isFinite(value) && value > max) {\n max = value;\n }\n }\n }\n\n return max;\n}\n\n/** The smallest 1/2/5/10 × power-of-ten step that is not below `minimumStep`.\n * `niceMax` picks its own number of intervals, so it cannot answer this: an aligned\n * secondary axis has to reach its data within the intervals the primary already\n * drew. */\nexport function roundStepAtLeast(minimumStep: number): number {\n if (!Number.isFinite(minimumStep) || minimumStep <= 0) {\n return 0;\n }\n const base = Math.pow(10, Math.floor(Math.log10(minimumStep)));\n for (const factor of ROUND_STEP_FACTORS) {\n const candidate = factor * base;\n if (candidate >= minimumStep * ROUND_STEP_TOLERANCE) {\n return candidate;\n }\n }\n\n return 10 * base;\n}\n\nfunction nicedAxis(domainMax: number, tickCount: number): AxisScale {\n return {\n max: niceMax(domainMax, tickCount),\n ticks: tickValues(domainMax, tickCount),\n };\n}\n\n/** Both y axes, as the four modes define them. `'rounded'` and `'exact'` share the\n * primary's gridlines and differ only in the step they divide the secondary domain\n * by: `'rounded'` snaps the step up to a round number and overshoots the data,\n * `'exact'` takes the domain itself and lands on it. `'independent'` and\n * `'stacked'` nice each axis on its own — stacked plots sit one above the other,\n * so there is nothing to align. */\nexport function axisLayout(\n primaryDomainMax: number,\n secondaryDomainMax: number | null,\n mode: LineChartAxisMode,\n tickCount: number,\n): AxisLayout {\n const count = normalizeTickCount(tickCount);\n const primary = nicedAxis(primaryDomainMax, count);\n if (secondaryDomainMax === null) {\n return { primary, secondary: null, alignedTicks: true };\n }\n\n const intervals = primary.ticks.length - 1;\n const canAlign =\n (mode === 'rounded' || mode === 'exact') &&\n intervals >= 1 &&\n Number.isFinite(secondaryDomainMax) &&\n secondaryDomainMax > 0;\n if (!canAlign) {\n return {\n primary,\n secondary: nicedAxis(secondaryDomainMax, count),\n alignedTicks: false,\n };\n }\n\n const step =\n mode === 'rounded'\n ? roundStepAtLeast(secondaryDomainMax / intervals)\n : secondaryDomainMax / intervals;\n if (step <= 0) {\n return { primary, secondary: { max: 0, ticks: [0] }, alignedTicks: true };\n }\n\n const ticks: number[] = [];\n for (let index = 0; index <= intervals; index++) {\n ticks.push(roundTo(step * index, TICK_DECIMALS));\n }\n\n return {\n primary,\n secondary: { max: roundTo(step * intervals, TICK_DECIMALS), ticks },\n alignedTicks: true,\n };\n}\n\nexport function chartLayout(\n mode: LineChartAxisMode,\n hasSecondaryAxis: boolean,\n): ChartLayout {\n const stacked = mode === 'stacked' && hasSecondaryAxis;\n const left = AXIS_GUTTER;\n const right = hasSecondaryAxis && !stacked ? AXIS_GUTTER : BARE_EDGE_GUTTER;\n const width = LINE_CHART_VIEW_WIDTH - left - right;\n const plotBottom = LINE_CHART_VIEW_HEIGHT - CATEGORY_GUTTER;\n const categoryLabelY = plotBottom + CATEGORY_LABEL_OFFSET;\n\n if (!stacked) {\n const plot: PlotArea = {\n left,\n top: PLOT_TOP,\n width,\n height: plotBottom - PLOT_TOP,\n };\n\n return {\n primaryPlot: plot,\n secondaryPlot: plot,\n categoryLabelY,\n stacked: false,\n };\n }\n\n const height = (plotBottom - PLOT_TOP - STACKED_PLOT_GAP) / 2;\n\n return {\n primaryPlot: { left, top: PLOT_TOP, width, height },\n secondaryPlot: {\n left,\n top: PLOT_TOP + height + STACKED_PLOT_GAP,\n width,\n height,\n },\n categoryLabelY,\n stacked: true,\n };\n}\n\nexport function categoryCenters(count: number, plot: PlotArea): number[] {\n const total = Number.isFinite(count) && count > 0 ? Math.floor(count) : 0;\n const band = bandScale(total, plot.width, 0);\n const centers: number[] = [];\n for (let index = 0; index < total; index++) {\n centers.push(plot.left + band.position(index) + band.bandWidth / 2);\n }\n\n return centers;\n}\n\n/** The y a reading sits at, always inside the plot. The clamp is what keeps a\n * negative reading — which no zero-based axis can place — off the category labels\n * below, and the finite test is what stops an unplottable one becoming `NaN`. */\nexport function valueY(value: number, axisMax: number, plot: PlotArea): number {\n const baseline = plot.top + plot.height;\n const y = baseline - linearScale(axisMax, plot.height)(value);\n if (!Number.isFinite(y)) {\n return baseline;\n }\n\n return Math.min(Math.max(y, plot.top), baseline);\n}\n\nexport function seriesPoints(\n values: readonly (number | null)[],\n axisMax: number,\n plot: PlotArea,\n centers: readonly number[],\n): (LinePoint | null)[] {\n return values.map((value, index) => {\n const x = centers[index];\n if (value === null || !Number.isFinite(value) || !Number.isFinite(x)) {\n return null;\n }\n\n return { categoryIndex: index, x, y: valueY(value, axisMax, plot), value };\n });\n}\n\nexport function lineSegments(\n points: readonly (LinePoint | null)[],\n): LinePoint[][] {\n const segments: LinePoint[][] = [];\n let current: LinePoint[] = [];\n for (const point of points) {\n if (point === null) {\n if (current.length > 0) {\n segments.push(current);\n }\n current = [];\n } else {\n current.push(point);\n }\n }\n if (current.length > 0) {\n segments.push(current);\n }\n\n return segments;\n}\n\n/** `''` rather than a partial list when a coordinate is unplottable: one `NaN` in a\n * `points` list or a path `d` voids the whole attribute, and the line then vanishes\n * with nothing logged. */\nexport function polylinePoints(segment: readonly LinePoint[]): string {\n if (segment.length === 0 || !segment.every(isPlottable)) {\n return '';\n }\n\n return segment.map((point) => coordinatePair(point)).join(' ');\n}\n\nexport function areaPath(\n segment: readonly LinePoint[],\n baselineY: number,\n): string {\n if (\n segment.length < 2 ||\n !Number.isFinite(baselineY) ||\n !segment.every(isPlottable)\n ) {\n return '';\n }\n const first = segment[0];\n const last = segment[segment.length - 1];\n const along = segment.map((point) => coordinatePair(point)).join(' L ');\n const baseline = roundTo(baselineY, COORDINATE_DECIMALS);\n\n return `M ${along} L ${roundTo(last.x, COORDINATE_DECIMALS)},${baseline} L ${roundTo(first.x, COORDINATE_DECIMALS)},${baseline} Z`;\n}\n\nfunction isPlottable(point: LinePoint): boolean {\n return Number.isFinite(point.x) && Number.isFinite(point.y);\n}\n\nfunction coordinatePair(point: LinePoint): string {\n return `${roundTo(point.x, COORDINATE_DECIMALS)},${roundTo(point.y, COORDINATE_DECIMALS)}`;\n}\n\n/** Show every nth category label. Every label at 60 categories is a grey smear, and\n * the axis stops saying anything at all. */\nexport function categoryLabelStride(\n count: number,\n maxLabels: number = MAX_CATEGORY_LABELS,\n): number {\n if (!Number.isFinite(count) || count <= 0 || maxLabels < 1) {\n return 1;\n }\n\n return Math.max(1, Math.ceil(count / maxLabels));\n}\n\nexport function paletteIndexFor(\n slot: number | undefined,\n index: number,\n paletteSize: number,\n): number {\n if (!Number.isFinite(paletteSize) || paletteSize < 1) {\n return 0;\n }\n const chosen =\n slot !== undefined && Number.isFinite(slot) && slot >= 1\n ? Math.floor(slot) - 1\n : index;\n\n return ((chosen % paletteSize) + paletteSize) % paletteSize;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n input,\n model,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport {\n CHART_SERIES_COLORS,\n describeSeries,\n bandScale,\n formatTick,\n focusMark,\n formatValue,\n nextRovingIndex,\n staggerDelay,\n tickStep,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\nimport type {\n ChartDataTable,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport { ChartLegendComponent } from '@ids-group-ltd/ids-design-system/components/chart-legend';\nimport type { ChartLegendItem } from '@ids-group-ltd/ids-design-system/components/chart-legend';\nimport type {\n ChartTooltipContext,\n ChartTooltipOrigin,\n ChartTooltipTrigger,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n LINE_CHART_AXIS_LABEL_GAP,\n LINE_CHART_DEFAULT_TICK_COUNT,\n LINE_CHART_VIEW_HEIGHT,\n LINE_CHART_VIEW_WIDTH,\n type LinePoint,\n type PlotArea,\n alignSeriesValues,\n areaPath,\n axisLayout,\n categoryCenters,\n categoryLabelStride,\n chartLayout,\n domainMaxOf,\n lineSegments,\n paletteIndexFor,\n polylinePoints,\n seriesPoints,\n valueY,\n} from './line-chart.math';\nimport type {\n LineChartAxisMode,\n LineChartGaps,\n LineChartPoint,\n LineChartSeries,\n} from './line-chart.types';\n\nconst defaultValueFormat = (value: number) => formatValue(value);\n\ninterface ResolvedSeries {\n readonly series: LineChartSeries;\n readonly values: readonly (number | null)[];\n readonly onSecondaryAxis: boolean;\n readonly color: string;\n /** `null` while `patterns` is off, which is what keeps a solid line solid. */\n readonly dash: string | null;\n}\n\n// One dash per palette slot, in the same order the colours are. Slot 1 stays solid so a\n// single-series chart is unchanged by turning patterns on.\nconst SERIES_DASH_ARRAYS = [\n 'none',\n '7 4',\n '2 3',\n '11 4 2 4',\n '1 4',\n '8 3 2 3',\n '4 2',\n '14 5',\n];\n\ninterface PlottedSeries extends ResolvedSeries {\n readonly polylines: readonly string[];\n readonly areaPaths: readonly string[];\n readonly markers: readonly LinePoint[];\n}\n\ninterface AxisTick {\n readonly y: number;\n readonly label: string;\n}\n\ninterface CategoryLabel {\n readonly x: number;\n readonly text: string;\n}\n\nfunction baselineOf(plot: PlotArea): number {\n return plot.top + plot.height;\n}\n\n@Component({\n selector: 'ds-line-chart',\n standalone: true,\n imports: [SkeletonComponent, ChartTooltipDirective, ChartLegendComponent],\n templateUrl: './line-chart.component.html',\n styleUrl: './line-chart.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class LineChartComponent {\n /** X labels. Every series' `data` is read against this length. */\n readonly categories = input.required<readonly string[]>();\n\n /** One line per entry. Every series is read against `categories`, so a series longer than it\n * loses its tail and a shorter one ends early. */\n readonly series = input.required<readonly LineChartSeries[]>();\n\n /** How a secondary axis relates to the primary one. */\n readonly yAxisMode = input<LineChartAxisMode>('rounded');\n\n /** Draws a dot at every reading. Off, the dots appear on hover and on focus only. */\n readonly showMarkers = input(true, { transform: booleanAttribute });\n\n /** Makes every reading focusable and clickable. A series drawn without markers grows invisible\n * ones so there is something to land on; they appear on hover and on focus.\n *\n * The click output fires whether or not this is set, so a consumer that binds the output and\n * forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The point that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly pointClicked = output<LineChartPoint>();\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 /** What a `null` reading draws. The default refuses to assert that a missing\n * reading is a zero. */\n readonly gaps = input<LineChartGaps>('break');\n\n /** How many value-axis ticks to aim for. A hint, not a count: ticks snap to a round step, so\n * the axis may carry one more or one fewer. */\n readonly tickCount = input(LINE_CHART_DEFAULT_TICK_COUNT, {\n transform: numberAttribute,\n });\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 `'toggle'`. */\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 dataTableResolved = resolveWithConfig(\n this.dataTable,\n (config) => config.chart?.dataTable,\n 'toggle' 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 protected readonly viewBox = `0 0 ${LINE_CHART_VIEW_WIDTH} ${LINE_CHART_VIEW_HEIGHT}`;\n\n protected readonly resolvedSeries = computed<readonly ResolvedSeries[]>(\n () => {\n const categoryCount = this.categories().length;\n const gaps = this.gaps();\n\n const patterns = this.patterns();\n\n return this.series().map((series, index) => {\n const slot = paletteIndexFor(\n series.slot,\n index,\n CHART_SERIES_COLORS.length,\n );\n\n return {\n series,\n values: alignSeriesValues(series.data, categoryCount, gaps),\n onSecondaryAxis: series.axis === 'secondary',\n color: CHART_SERIES_COLORS[slot],\n dash: patterns ? SERIES_DASH_ARRAYS[slot] : null,\n };\n });\n },\n );\n\n /** Ids of the series the legend has switched off. Two-way, so a page can drive it from a URL\n * parameter and read back what the reader chose. */\n readonly hiddenSeries = model<readonly string[]>([]);\n\n /** Whether hiding a series re-scales the value axis to what is left. Default `false`: a silent\n * rescale turns a period-over-period comparison into a different claim, and a comparison\n * dashboard is the common case. */\n readonly rescaleOnHide = input(false, { transform: booleanAttribute });\n\n /** Whether the legend switches series off. Off leaves it a plain key. */\n readonly legendFilters = input(false, { transform: booleanAttribute });\n\n /** Shown in place of the plot once the legend has switched every series off. Without it the\n * reader is left with an empty grid and nothing saying why. */\n readonly noVisibleSeriesText = input<string>('All series are hidden');\n\n /** Gives every series a dash pattern of its own, so the lines are told apart by shape as well\n * as by colour — WCAG technique G111. Off by default: the shipped palette clears the\n * colour-blind separation threshold on its own, so the patterns are for monochrome print, for a\n * retuned palette, and for a reader who asks for them. */\n readonly patterns = input(false, { transform: booleanAttribute });\n\n /** Milliseconds between one series' 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 list of series does\n * not 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 protected readonly highlightedSeries = signal<string | null>(null);\n\n protected readonly visibleSeries = computed<readonly ResolvedSeries[]>(() => {\n const hidden = this.hiddenSeries();\n\n return this.resolvedSeries().filter(\n (entry) => !hidden.includes(entry.series.id),\n );\n });\n\n protected readonly legendItems = computed<readonly ChartLegendItem[]>(() =>\n this.resolvedSeries().map((entry) => ({\n id: entry.series.id,\n label: entry.series.label,\n color: entry.color,\n })),\n );\n\n protected isDimmed(seriesId: string): boolean {\n const highlighted = this.highlightedSeries();\n\n return this.dimOthers() && highlighted !== null && highlighted !== seriesId;\n }\n\n protected readonly hasSecondaryAxis = computed(() =>\n this.visibleSeries().some((entry) => entry.onSecondaryAxis),\n );\n\n protected readonly layout = computed(() =>\n chartLayout(this.yAxisMode(), this.hasSecondaryAxis()),\n );\n\n protected readonly axes = computed(() => {\n // The axis is scaled from every series unless `rescaleOnHide` says otherwise, so switching one\n // off does not move the gridlines under the ones still drawn.\n const entries = this.rescaleOnHide()\n ? this.visibleSeries()\n : this.resolvedSeries();\n const valuesOn = (secondary: boolean) =>\n entries\n .filter((entry) => entry.onSecondaryAxis === secondary)\n .map((entry) => entry.values);\n\n return axisLayout(\n domainMaxOf(valuesOn(false)),\n this.hasSecondaryAxis() ? domainMaxOf(valuesOn(true)) : null,\n this.yAxisMode(),\n this.tickCount(),\n );\n });\n\n protected readonly categoryPositions = computed(() =>\n categoryCenters(this.categories().length, this.layout().primaryPlot),\n );\n\n protected readonly plottedSeries = computed<readonly PlottedSeries[]>(() => {\n const axes = this.axes();\n const centers = this.categoryPositions();\n\n return this.visibleSeries().map((entry) => {\n const plot = this.plotFor(entry.onSecondaryAxis);\n const axisMax =\n entry.onSecondaryAxis && axes.secondary\n ? axes.secondary.max\n : axes.primary.max;\n const segments = lineSegments(\n seriesPoints(entry.values, axisMax, plot, centers),\n );\n const baselineY = plot.top + plot.height;\n\n return {\n ...entry,\n polylines: segments\n .map((segment) => polylinePoints(segment))\n .filter((points) => points.length > 0),\n areaPaths: entry.series.area\n ? segments\n .map((segment) => areaPath(segment, baselineY))\n .filter((path) => path.length > 0)\n : [],\n markers: segments.flat(),\n };\n });\n });\n\n protected readonly primaryTicks = computed(() =>\n this.ticksFor(this.axes().primary.ticks, this.axes().primary.max, false),\n );\n\n protected readonly secondaryTicks = computed<readonly AxisTick[]>(() => {\n const secondary = this.axes().secondary;\n\n return secondary ? this.ticksFor(secondary.ticks, secondary.max, true) : [];\n });\n\n /** Drawn only when the two axes do not share the primary's gridlines, and only\n * when the axis has more than the single tick a degenerate domain leaves. */\n protected readonly showSecondaryGridlines = computed(\n () => !this.axes().alignedTicks && this.secondaryTicks().length > 1,\n );\n\n protected readonly stacked = computed(() => this.layout().stacked);\n protected readonly categoryLabelY = computed(\n () => this.layout().categoryLabelY,\n );\n\n /** The category under the pointer, or -1. */\n protected readonly activeCategory = signal(-1);\n\n protected readonly categoryBands = computed(() =>\n bandScale(this.categories().length, this.layout().primaryPlot.width, 0),\n );\n\n protected readonly activeBandX = computed(\n () =>\n this.layout().primaryPlot.left +\n this.categoryBands().position(this.activeCategory()),\n );\n\n protected readonly activeBandWidth = computed(\n () => this.categoryBands().bandWidth,\n );\n\n protected readonly activeCategoryX = computed(\n () => this.activeBandX() + this.activeBandWidth() / 2,\n );\n\n protected onPlotPointer(event: PointerEvent): void {\n const canvas = event.currentTarget as SVGSVGElement;\n const screen = canvas.getScreenCTM();\n if (!screen) {\n return;\n }\n // Client pixels are not viewBox units — the plot scales to the card's width.\n const point = new DOMPoint(event.clientX, event.clientY).matrixTransform(\n screen.inverse(),\n );\n const plot = this.layout().primaryPlot;\n const category = this.categoryBands().indexAt(point.x - plot.left);\n this.activeCategory.set(category);\n this.tooltipOrigin.set(\n this.tooltipAnchor() === 'pointer'\n ? { x: event.clientX, y: event.clientY }\n : this.readingAnchor(screen, category),\n );\n }\n\n /** The highest reading in the category, mapped back into client pixels. Anchoring there rather\n * than at the cursor keeps the panel still while the pointer travels within one band, and puts\n * it over the readings it names instead of over the finger. */\n private readingAnchor(\n screen: DOMMatrix,\n category: number,\n ): ChartTooltipOrigin {\n const tops = this.plottedSeries().flatMap((entry) =>\n entry.markers\n .filter((marker) => marker.categoryIndex === category)\n .map((marker) => marker.y),\n );\n const y = tops.length ? Math.min(...tops) : this.layout().primaryPlot.top;\n const point = new DOMPoint(\n this.plotLeft() +\n this.categoryBands().position(category) +\n this.categoryBands().bandWidth / 2,\n y,\n ).matrixTransform(screen);\n\n return { x: point.x, y: point.y };\n }\n\n protected clearActiveCategory(): void {\n this.activeCategory.set(-1);\n this.tooltipOrigin.set(null);\n }\n\n /** Whether the plot opens a tooltip, and for what. `'axis'` names every series at the\n * category under the pointer, which is the reading a multi-series line is compared on;\n * `'item'` names only the marker itself. */\n readonly tooltip = input<ChartTooltipTrigger>('axis');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n /** Where the tooltip is pinned. `'point'`, the default, is the highest reading in the category,\n * so the panel stays put while the pointer moves within one band. `'pointer'` follows the\n * cursor. */\n readonly tooltipAnchor = input<'point' | 'pointer'>('point');\n\n protected readonly tooltipOrigin = signal<ChartTooltipOrigin | null>(null);\n\n /** The series focus is on, or -1 for the whole category. A pointer answers for every\n * series at once; a focused marker answers for its own. */\n protected readonly activeSeries = signal(-1);\n\n /** One tab stop PER SERIES, keyed by series id — each line is a strand the reader walks with\n * the arrows. WCAG 2.1.1's Understanding is explicit that not every mouse-operable control has\n * to be separately focusable, which is what keeps a 12-category, 2-series plot from being\n * twenty-four stops in the page's tab order. */\n protected readonly rovingByCategory = signal<ReadonlyMap<string, number>>(\n new Map(),\n );\n\n protected isTabStop(seriesId: string, categoryIndex: number): boolean {\n return (this.rovingByCategory().get(seriesId) ?? 0) === categoryIndex;\n }\n\n protected onMarkerFocus(\n seriesIndex: number,\n categoryIndex: number,\n event: FocusEvent,\n ): void {\n if (event.currentTarget instanceof Element) {\n this.tooltipOrigin.set(event.currentTarget);\n }\n this.activeSeries.set(seriesIndex);\n this.activeCategory.set(categoryIndex);\n this.setRoving(seriesIndex, categoryIndex);\n }\n\n protected onMarkerNavigation(\n event: KeyboardEvent,\n seriesIndex: number,\n categoryIndex: number,\n ): void {\n const markers = this.plottedSeries()[seriesIndex]?.markers ?? [];\n const positions = markers.map((marker) => marker.categoryIndex);\n const current = positions.indexOf(categoryIndex);\n const next = nextRovingIndex(event.key, current, positions.length);\n if (next === null) {\n return;\n }\n event.preventDefault();\n const nextCategory = positions[next];\n this.setRoving(seriesIndex, nextCategory);\n focusMark(\n (event.currentTarget as Element).closest('svg'),\n nextCategory,\n `[data-series-index=\"${seriesIndex}\"]`,\n );\n }\n\n private setRoving(seriesIndex: number, categoryIndex: number): void {\n const seriesId = this.plottedSeries()[seriesIndex]?.series.id;\n if (seriesId === undefined) {\n return;\n }\n const next = new Map(this.rovingByCategory());\n next.set(seriesId, categoryIndex);\n this.rovingByCategory.set(next);\n }\n\n protected onMarkerBlur(): void {\n this.activeSeries.set(-1);\n this.clearActiveCategory();\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const categoryIndex = this.activeCategory();\n const categories = this.categories();\n if (\n this.tooltip() === 'none' ||\n categoryIndex < 0 ||\n categoryIndex >= categories.length\n ) {\n return null;\n }\n const format = this.valueFormatResolved();\n const focusedSeries = this.activeSeries();\n const perSeries =\n this.tooltip() === 'item' || focusedSeries >= 0\n ? this.visibleSeries().slice(\n Math.max(focusedSeries, 0),\n Math.max(focusedSeries, 0) + 1,\n )\n : this.visibleSeries();\n\n return {\n category: categories[categoryIndex],\n entries: perSeries\n .map((entry) => ({ entry, value: entry.values[categoryIndex] }))\n .filter(\n (\n reading,\n ): reading is {\n entry: (typeof perSeries)[number];\n value: number;\n } =>\n typeof reading.value === 'number' &&\n Number.isFinite(reading.value),\n )\n .map(({ entry, value }) => ({\n label: entry.series.label,\n value,\n formatted: format(value),\n color: entry.color,\n })),\n };\n },\n );\n\n protected readonly plotLeft = computed(() => this.layout().primaryPlot.left);\n protected readonly plotRight = computed(\n () => this.layout().primaryPlot.left + this.layout().primaryPlot.width,\n );\n\n protected readonly primaryTopY = computed(\n () => this.layout().primaryPlot.top,\n );\n protected readonly secondaryTopY = computed(\n () => this.layout().secondaryPlot.top,\n );\n\n protected readonly primaryBaselineY = computed(() =>\n baselineOf(this.layout().primaryPlot),\n );\n\n protected readonly secondaryBaselineY = computed(() =>\n baselineOf(this.layout().secondaryPlot),\n );\n\n /** Where the crosshair stops. Under `'stacked'` the two plots sit one above the other over one\n * category axis, so a crosshair that ends at the upper plot's baseline leaves the lower plot —\n * the same category, the same pointer — with nothing marked at all. */\n protected readonly cursorBottomY = computed(() =>\n this.stacked() ? this.secondaryBaselineY() : this.primaryBaselineY(),\n );\n\n protected readonly primaryLabelX = computed(\n () => this.layout().primaryPlot.left - LINE_CHART_AXIS_LABEL_GAP,\n );\n\n protected readonly secondaryLabelX = computed(() => {\n const layout = this.layout();\n\n return layout.stacked\n ? layout.secondaryPlot.left - LINE_CHART_AXIS_LABEL_GAP\n : layout.primaryPlot.left +\n layout.primaryPlot.width +\n LINE_CHART_AXIS_LABEL_GAP;\n });\n\n protected readonly secondaryLabelAnchor = computed(() =>\n this.layout().stacked ? 'end' : 'start',\n );\n\n protected readonly categoryLabels = computed<readonly CategoryLabel[]>(() => {\n const categories = this.categories();\n const centers = this.categoryPositions();\n const stride = categoryLabelStride(categories.length);\n const labels: CategoryLabel[] = [];\n for (let index = 0; index < categories.length; index += stride) {\n labels.push({ x: centers[index], text: categories[index] });\n }\n\n return labels;\n });\n\n protected readonly tableRows = computed(() => {\n const format = this.valueFormatResolved();\n\n return this.categories().map((category, index) => ({\n category,\n cells: this.resolvedSeries().map((entry) => {\n const value = entry.values[index];\n\n return value === null || value === undefined ? '—' : format(value);\n }),\n }));\n });\n\n protected readonly accessibleName = computed(() => {\n const summary = this.summary();\n if (summary !== null) {\n return summary;\n }\n\n const title = this.caption() ?? 'Chart';\n const format = this.valueFormatResolved();\n const categories = this.categories();\n // The pointer belongs to the WHOLE chart, not to each series, or a two-series plot promises\n // the table twice.\n const sentences = this.resolvedSeries().map((entry) =>\n describeSeries(\n entry.series.label,\n entry.values.flatMap((value, index) =>\n value === null ? [] : [{ label: categories[index] ?? '', value }],\n ),\n format,\n false,\n ),\n );\n const pointer =\n this.dataTableResolved() === 'none'\n ? ''\n : ' Full values in the table below.';\n\n return sentences.length === 0\n ? describeSeries(title, [], format, this.dataTableResolved() !== 'none')\n : `${title}. ${sentences.join(' ')}${pointer}`;\n });\n\n protected pointOf(entry: PlottedSeries, marker: LinePoint): LineChartPoint {\n return {\n series: entry.series,\n categoryIndex: marker.categoryIndex,\n category: this.categories()[marker.categoryIndex] ?? '',\n value: marker.value,\n };\n }\n\n protected markerLabel(entry: PlottedSeries, marker: LinePoint): string {\n const point = this.pointOf(entry, marker);\n\n return `${entry.series.label}, ${point.category}, ${this.valueFormatResolved()(marker.value)}`;\n }\n\n protected onMarkerKey(\n entry: PlottedSeries,\n marker: LinePoint,\n event: Event,\n ): void {\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.pointClicked.emit(this.pointOf(entry, marker));\n }\n\n protected readonly isEmpty = computed(\n () => this.series().length === 0 || this.categories().length === 0,\n );\n\n protected readonly showLegend = computed(() => this.series().length > 1);\n\n protected readonly noVisibleSeries = computed(\n () => this.series().length > 0 && this.visibleSeries().length === 0,\n );\n\n /** Placeholder legend rows while loading. Follows the real series count so the\n * chart does not resize when the data lands; falls back to three when `series`\n * is still empty. */\n protected readonly skeletonSeries = computed(() =>\n Array.from({ length: Math.max(this.series().length, 3) }),\n );\n\n private plotFor(onSecondaryAxis: boolean): PlotArea {\n const layout = this.layout();\n\n return onSecondaryAxis && layout.stacked\n ? layout.secondaryPlot\n : layout.primaryPlot;\n }\n\n private ticksFor(\n ticks: readonly number[],\n axisMax: number,\n onSecondaryAxis: boolean,\n ): AxisTick[] {\n const plot = this.plotFor(onSecondaryAxis);\n const step = tickStep(ticks);\n const format = this.valueFormatResolved();\n\n return ticks.map((value) => ({\n y: valueY(value, axisMax, plot),\n label:\n format === defaultValueFormat ? formatTick(value, step) : format(value),\n }));\n }\n}\n","<figure class=\"line-chart\">\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 {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n <ds-skeleton height=\"var(--_line-chart-plot-height)\" />\n\n @if (skeletonSeries().length > 1) {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonSeries(); track $index) {\n <ds-skeleton\n width=\"var(--space-16)\"\n height=\"var(--space-3)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else if (noVisibleSeries()) {\n <p\n class=\"empty\"\n role=\"status\">\n {{ noVisibleSeriesText() }}\n </p>\n\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n (pointermove)=\"onPlotPointer($event)\"\n (pointerdown)=\"onPlotPointer($event)\"\n (pointerleave)=\"clearActiveCategory()\">\n @if (activeCategory() >= 0) {\n <g\n class=\"cursor\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\"\n [style.transform]=\"'translateX(' + activeBandX() + 'px)'\">\n <rect\n class=\"category-band\"\n aria-hidden=\"true\"\n x=\"0\"\n [attr.y]=\"primaryTopY()\"\n [attr.width]=\"activeBandWidth()\"\n [attr.height]=\"cursorBottomY() - primaryTopY()\" />\n\n <line\n class=\"cursor-line\"\n aria-hidden=\"true\"\n [attr.x1]=\"activeBandWidth() / 2\"\n [attr.x2]=\"activeBandWidth() / 2\"\n [attr.y1]=\"primaryTopY()\"\n [attr.y2]=\"cursorBottomY()\" />\n </g>\n }\n\n @for (tick of primaryTicks(); track $index) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track $index) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n [class.secondary]=\"!stacked()\" />\n }\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"primaryBaselineY()\"\n [attr.y2]=\"primaryBaselineY()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotLeft()\"\n [attr.y1]=\"primaryTopY()\"\n [attr.y2]=\"primaryBaselineY()\" />\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryBaselineY()\"\n [attr.y2]=\"secondaryBaselineY()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotLeft()\"\n [attr.y1]=\"secondaryTopY()\"\n [attr.y2]=\"secondaryBaselineY()\" />\n }\n\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (path of entry.areaPaths; track $index) {\n <path\n class=\"series-area\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(seriesIndex)\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.d]=\"path\"\n [attr.fill]=\"entry.color\" />\n }\n }\n\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (points of entry.polylines; track $index) {\n <polyline\n class=\"series-line\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [attr.stroke-dasharray]=\"entry.dash\"\n [style.--_chart-mark-stagger]=\"markStagger(seriesIndex)\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.points]=\"points\"\n [attr.stroke]=\"entry.color\" />\n }\n }\n\n @if (showMarkers() || interactive()) {\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (marker of entry.markers; track marker.categoryIndex) {\n <circle\n class=\"series-marker\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [class.ghost]=\"!showMarkers()\"\n [class.interactive]=\"interactive()\"\n [class.is-active]=\"marker.categoryIndex === activeCategory()\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.data-series-index]=\"seriesIndex\"\n [attr.data-mark-index]=\"marker.categoryIndex\"\n [attr.tabindex]=\"\n interactive()\n ? isTabStop(entry.series.id, marker.categoryIndex)\n ? 0\n : -1\n : null\n \"\n [attr.aria-label]=\"\n interactive() ? markerLabel(entry, marker) : null\n \"\n (focus)=\"\n onMarkerFocus(seriesIndex, marker.categoryIndex, $event)\n \"\n (blur)=\"onMarkerBlur()\"\n (keydown)=\"\n onMarkerNavigation($event, seriesIndex, marker.categoryIndex)\n \"\n (click)=\"pointClicked.emit(pointOf(entry, marker))\"\n (keydown.enter)=\"onMarkerKey(entry, marker, $event)\"\n (keydown.space)=\"onMarkerKey(entry, marker, $event)\" />\n }\n }\n }\n\n @for (tick of primaryTicks(); track $index) {\n <text\n class=\"axis-label\"\n text-anchor=\"end\"\n [attr.x]=\"primaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track $index) {\n <text\n class=\"axis-label\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track $index) {\n <text\n class=\"category-label\"\n text-anchor=\"middle\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\">\n {{ label.text }}\n </text>\n }\n </svg>\n </div>\n\n @if (showLegend()) {\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n }\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 Category\n </th>\n\n @for (entry of resolvedSeries(); track entry.series.id) {\n <th scope=\"col\">\n {{ entry.series.label }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (row of tableRows(); track $index) {\n <tr>\n <th scope=\"row\">\n {{ row.category }}\n </th>\n\n @for (cell of row.cells; track $index) {\n <td>\n {{ cell }}\n </td>\n }\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":";;;;;;;;AAQO,MAAM,qBAAqB,GAAG,GAAG;AACjC,MAAM,sBAAsB,GAAG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A,OAAA,EAAA,QAAA,EAAA,YAAA,EAAA,aAAA,CAAA,EAAA,OAAA,EAAA,CAAA,cAAA,EAAA,mBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAM7D,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAT9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,cACb,IAAI,EAAA,OAAA,EACP,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,oBAAoB,CAAC,iBAG1D,iBAAiB,CAAC,QAAQ,EAAA,eAAA,EACxB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,oxSAAA,EAAA,MAAA,EAAA,CAAA,w+RAAA,CAAA,EAAA;05EAiV3C,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,eAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEtctB;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-line-chart.mjs","sources":["../../../src/lib/components/line-chart/line-chart.math.ts","../../../src/lib/components/line-chart/line-chart.component.ts","../../../src/lib/components/line-chart/line-chart.component.html","../../../src/lib/components/line-chart/ids-group-ltd-ids-design-system-components-line-chart.ts"],"sourcesContent":["import {\n pointScale,\n linearScale,\n niceMax,\n tickValues,\n} from '@ids-group-ltd/ids-design-system/components';\nimport type { LineChartAxisMode, LineChartGaps } from './line-chart.types';\n\nexport const LINE_CHART_VIEW_WIDTH = 640;\nexport const LINE_CHART_VIEW_HEIGHT = 320;\nexport const LINE_CHART_DEFAULT_TICK_COUNT = 5;\nexport const LINE_CHART_AXIS_LABEL_GAP = 8;\n\nconst AXIS_GUTTER = 46;\nconst BARE_EDGE_GUTTER = 12;\nconst PLOT_TOP = 14;\nconst CATEGORY_GUTTER = 30;\nconst CATEGORY_LABEL_OFFSET = 18;\nconst STACKED_PLOT_GAP = 34;\nconst MAX_CATEGORY_LABELS = 12;\nconst COORDINATE_DECIMALS = 2;\nconst TICK_DECIMALS = 6;\nconst ROUND_STEP_FACTORS = [1, 2, 5, 10];\n// A step divided out of a domain and multiplied back rarely lands on itself, so a\n// candidate equal to the minimum can compare as smaller by one bit and push the\n// whole axis up a rung.\nconst ROUND_STEP_TOLERANCE = 1 - 1e-12;\n\nexport interface PlotArea {\n readonly left: number;\n readonly top: number;\n readonly width: number;\n readonly height: number;\n}\n\nexport interface AxisScale {\n readonly max: number;\n readonly ticks: readonly number[];\n}\n\nexport interface AxisLayout {\n readonly primary: AxisScale;\n /** Null when no series asked for a second axis. */\n readonly secondary: AxisScale | null;\n /** True when the secondary axis is drawn against the primary's gridlines. */\n readonly alignedTicks: boolean;\n}\n\nexport interface ChartLayout {\n readonly primaryPlot: PlotArea;\n /** The same area as `primaryPlot` unless the plots are stacked. */\n readonly secondaryPlot: PlotArea;\n readonly categoryLabelY: number;\n readonly stacked: boolean;\n}\n\nexport interface LinePoint {\n readonly categoryIndex: number;\n readonly x: number;\n readonly y: number;\n readonly value: number;\n}\n\nfunction roundTo(value: number, decimals: number): number {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Number(value.toFixed(decimals));\n}\n\nexport function normalizeTickCount(tickCount: number): number {\n return Number.isFinite(tickCount) && tickCount >= 1\n ? Math.floor(tickCount)\n : LINE_CHART_DEFAULT_TICK_COUNT;\n}\n\n/** One reading per category, however long the series actually was. A series longer\n * than `categories` loses its tail and a shorter one ends early: a line that stops\n * short is a defect the reader can see, while a thrown error takes down the page\n * around it. Anything that is not a finite number is a missing reading, so `NaN`\n * and `Infinity` follow the `gaps` policy rather than reaching a coordinate. */\nexport function alignSeriesValues(\n data: readonly (number | null)[],\n categoryCount: number,\n gaps: LineChartGaps,\n): (number | null)[] {\n const length =\n Number.isFinite(categoryCount) && categoryCount > 0\n ? Math.floor(categoryCount)\n : 0;\n const aligned: (number | null)[] = [];\n for (let index = 0; index < length; index++) {\n const raw = data[index];\n const reading =\n typeof raw === 'number' && Number.isFinite(raw) ? raw : null;\n aligned.push(reading === null && gaps === 'zero' ? 0 : reading);\n }\n\n return aligned;\n}\n\n/** Largest finite reading across the given series, or zero. Never negative: the\n * tick helpers only describe axes that start at zero, and a negative domain there\n * is a division waiting to happen. */\nexport function domainMaxOf(\n valueGroups: readonly (readonly (number | null)[])[],\n): number {\n let max = 0;\n for (const values of valueGroups) {\n for (const value of values) {\n if (value !== null && Number.isFinite(value) && value > max) {\n max = value;\n }\n }\n }\n\n return max;\n}\n\n/** The smallest 1/2/5/10 × power-of-ten step that is not below `minimumStep`.\n * `niceMax` picks its own number of intervals, so it cannot answer this: an aligned\n * secondary axis has to reach its data within the intervals the primary already\n * drew. */\nexport function roundStepAtLeast(minimumStep: number): number {\n if (!Number.isFinite(minimumStep) || minimumStep <= 0) {\n return 0;\n }\n const base = Math.pow(10, Math.floor(Math.log10(minimumStep)));\n for (const factor of ROUND_STEP_FACTORS) {\n const candidate = factor * base;\n if (candidate >= minimumStep * ROUND_STEP_TOLERANCE) {\n return candidate;\n }\n }\n\n return 10 * base;\n}\n\nfunction nicedAxis(domainMax: number, tickCount: number): AxisScale {\n return {\n max: niceMax(domainMax, tickCount),\n ticks: tickValues(domainMax, tickCount),\n };\n}\n\n/** Both y axes, as the four modes define them. `'rounded'` and `'exact'` share the\n * primary's gridlines and differ only in the step they divide the secondary domain\n * by: `'rounded'` snaps the step up to a round number and overshoots the data,\n * `'exact'` takes the domain itself and lands on it. `'independent'` and\n * `'stacked'` nice each axis on its own — stacked plots sit one above the other,\n * so there is nothing to align. */\nexport function axisLayout(\n primaryDomainMax: number,\n secondaryDomainMax: number | null,\n mode: LineChartAxisMode,\n tickCount: number,\n): AxisLayout {\n const count = normalizeTickCount(tickCount);\n const primary = nicedAxis(primaryDomainMax, count);\n if (secondaryDomainMax === null) {\n return { primary, secondary: null, alignedTicks: true };\n }\n\n const intervals = primary.ticks.length - 1;\n const canAlign =\n (mode === 'rounded' || mode === 'exact') &&\n intervals >= 1 &&\n Number.isFinite(secondaryDomainMax) &&\n secondaryDomainMax > 0;\n if (!canAlign) {\n return {\n primary,\n secondary: nicedAxis(secondaryDomainMax, count),\n alignedTicks: false,\n };\n }\n\n const step =\n mode === 'rounded'\n ? roundStepAtLeast(secondaryDomainMax / intervals)\n : secondaryDomainMax / intervals;\n if (step <= 0) {\n return { primary, secondary: { max: 0, ticks: [0] }, alignedTicks: true };\n }\n\n const ticks: number[] = [];\n for (let index = 0; index <= intervals; index++) {\n ticks.push(roundTo(step * index, TICK_DECIMALS));\n }\n\n return {\n primary,\n secondary: { max: roundTo(step * intervals, TICK_DECIMALS), ticks },\n alignedTicks: true,\n };\n}\n\nexport function chartLayout(\n mode: LineChartAxisMode,\n hasSecondaryAxis: boolean,\n): ChartLayout {\n const stacked = mode === 'stacked' && hasSecondaryAxis;\n const left = AXIS_GUTTER;\n const right = hasSecondaryAxis && !stacked ? AXIS_GUTTER : BARE_EDGE_GUTTER;\n const width = LINE_CHART_VIEW_WIDTH - left - right;\n const plotBottom = LINE_CHART_VIEW_HEIGHT - CATEGORY_GUTTER;\n const categoryLabelY = plotBottom + CATEGORY_LABEL_OFFSET;\n\n if (!stacked) {\n const plot: PlotArea = {\n left,\n top: PLOT_TOP,\n width,\n height: plotBottom - PLOT_TOP,\n };\n\n return {\n primaryPlot: plot,\n secondaryPlot: plot,\n categoryLabelY,\n stacked: false,\n };\n }\n\n const height = (plotBottom - PLOT_TOP - STACKED_PLOT_GAP) / 2;\n\n return {\n primaryPlot: { left, top: PLOT_TOP, width, height },\n secondaryPlot: {\n left,\n top: PLOT_TOP + height + STACKED_PLOT_GAP,\n width,\n height,\n },\n categoryLabelY,\n stacked: true,\n };\n}\n\nexport function categoryCenters(count: number, plot: PlotArea): number[] {\n const total = Number.isFinite(count) && count > 0 ? Math.floor(count) : 0;\n const scale = pointScale(total, plot.width);\n const centers: number[] = [];\n for (let index = 0; index < total; index++) {\n centers.push(plot.left + scale.position(index));\n }\n\n return centers;\n}\n\n/** The y a reading sits at, always inside the plot. The clamp is what keeps a\n * negative reading — which no zero-based axis can place — off the category labels\n * below, and the finite test is what stops an unplottable one becoming `NaN`. */\nexport function valueY(value: number, axisMax: number, plot: PlotArea): number {\n const baseline = plot.top + plot.height;\n const y = baseline - linearScale(axisMax, plot.height)(value);\n if (!Number.isFinite(y)) {\n return baseline;\n }\n\n return Math.min(Math.max(y, plot.top), baseline);\n}\n\nexport function seriesPoints(\n values: readonly (number | null)[],\n axisMax: number,\n plot: PlotArea,\n centers: readonly number[],\n): (LinePoint | null)[] {\n return values.map((value, index) => {\n const x = centers[index];\n if (value === null || !Number.isFinite(value) || !Number.isFinite(x)) {\n return null;\n }\n\n return { categoryIndex: index, x, y: valueY(value, axisMax, plot), value };\n });\n}\n\nexport function lineSegments(\n points: readonly (LinePoint | null)[],\n): LinePoint[][] {\n const segments: LinePoint[][] = [];\n let current: LinePoint[] = [];\n for (const point of points) {\n if (point === null) {\n if (current.length > 0) {\n segments.push(current);\n }\n current = [];\n } else {\n current.push(point);\n }\n }\n if (current.length > 0) {\n segments.push(current);\n }\n\n return segments;\n}\n\n/** `''` rather than a partial list when a coordinate is unplottable: one `NaN` in a\n * `points` list or a path `d` voids the whole attribute, and the line then vanishes\n * with nothing logged. */\nexport function polylinePoints(segment: readonly LinePoint[]): string {\n if (segment.length === 0 || !segment.every(isPlottable)) {\n return '';\n }\n\n return segment.map((point) => coordinatePair(point)).join(' ');\n}\n\nexport function areaPath(\n segment: readonly LinePoint[],\n baselineY: number,\n): string {\n if (\n segment.length < 2 ||\n !Number.isFinite(baselineY) ||\n !segment.every(isPlottable)\n ) {\n return '';\n }\n const first = segment[0];\n const last = segment[segment.length - 1];\n const along = segment.map((point) => coordinatePair(point)).join(' L ');\n const baseline = roundTo(baselineY, COORDINATE_DECIMALS);\n\n return `M ${along} L ${roundTo(last.x, COORDINATE_DECIMALS)},${baseline} L ${roundTo(first.x, COORDINATE_DECIMALS)},${baseline} Z`;\n}\n\nfunction isPlottable(point: LinePoint): boolean {\n return Number.isFinite(point.x) && Number.isFinite(point.y);\n}\n\nfunction coordinatePair(point: LinePoint): string {\n return `${roundTo(point.x, COORDINATE_DECIMALS)},${roundTo(point.y, COORDINATE_DECIMALS)}`;\n}\n\n/** Show every nth category label. Every label at 60 categories is a grey smear, and\n * the axis stops saying anything at all. */\nexport function categoryLabelStride(\n count: number,\n maxLabels: number = MAX_CATEGORY_LABELS,\n): number {\n if (!Number.isFinite(count) || count <= 0 || maxLabels < 1) {\n return 1;\n }\n\n return Math.max(1, Math.ceil(count / maxLabels));\n}\n\nexport function paletteIndexFor(\n slot: number | undefined,\n index: number,\n paletteSize: number,\n): number {\n if (!Number.isFinite(paletteSize) || paletteSize < 1) {\n return 0;\n }\n const chosen =\n slot !== undefined && Number.isFinite(slot) && slot >= 1\n ? Math.floor(slot) - 1\n : index;\n\n return ((chosen % paletteSize) + paletteSize) % paletteSize;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n model,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport {\n CHART_SERIES_COLORS,\n describeSeries,\n pointScale,\n formatTick,\n focusMark,\n formatValue,\n nextRovingIndex,\n staggerDelay,\n tickStep,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\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 { ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport { ChartLegendComponent } from '@ids-group-ltd/ids-design-system/components/chart-legend';\nimport type { ChartLegendItem } from '@ids-group-ltd/ids-design-system/components/chart-legend';\nimport type {\n ChartTooltipContext,\n ChartTooltipOrigin,\n ChartTooltipTrigger,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n LINE_CHART_AXIS_LABEL_GAP,\n LINE_CHART_DEFAULT_TICK_COUNT,\n LINE_CHART_VIEW_HEIGHT,\n LINE_CHART_VIEW_WIDTH,\n type LinePoint,\n type PlotArea,\n alignSeriesValues,\n areaPath,\n axisLayout,\n categoryCenters,\n categoryLabelStride,\n chartLayout,\n domainMaxOf,\n lineSegments,\n paletteIndexFor,\n polylinePoints,\n seriesPoints,\n valueY,\n} from './line-chart.math';\nimport type {\n LineChartAnnotation,\n LineChartAxisMode,\n LineChartGaps,\n LineChartPoint,\n LineChartSeries,\n} from './line-chart.types';\n\nconst defaultValueFormat = (value: number) => formatValue(value);\n\n// Long enough to cross the gap between the plot and its panel at an ordinary pointer speed.\n\n// View units between a reading and the label above it, and the margin inside which a label\n// anchors to its own edge instead of centring. Both in the 640x320 viewBox.\nconst ANNOTATION_GAP = 12;\nconst ANNOTATION_EDGE_GUARD = 48;\n\ninterface ResolvedSeries {\n readonly series: LineChartSeries;\n readonly values: readonly (number | null)[];\n readonly onSecondaryAxis: boolean;\n readonly color: string;\n /** `null` while `patterns` is off, which is what keeps a solid line solid. */\n readonly dash: string | null;\n}\n\n// One dash per palette slot, in the same order the colours are. Slot 1 stays solid so a\n// single-series chart is unchanged by turning patterns on.\nconst SERIES_DASH_ARRAYS = [\n 'none',\n '7 4',\n '2 3',\n '11 4 2 4',\n '1 4',\n '8 3 2 3',\n '4 2',\n '14 5',\n];\n\ninterface PlottedSeries extends ResolvedSeries {\n readonly polylines: readonly string[];\n readonly areaPaths: readonly string[];\n readonly markers: readonly LinePoint[];\n}\n\ninterface AxisTick {\n readonly y: number;\n readonly label: string;\n}\n\ninterface CategoryLabel {\n readonly x: number;\n readonly text: string;\n}\n\nfunction baselineOf(plot: PlotArea): number {\n return plot.top + plot.height;\n}\n\n@Component({\n selector: 'ds-line-chart',\n standalone: true,\n imports: [SkeletonComponent, ChartTooltipDirective, ChartLegendComponent],\n templateUrl: './line-chart.component.html',\n styleUrl: './line-chart.component.scss',\n // Escape releases a pinned category, the same key that dismisses its panel — otherwise the\n // crosshair would stand on a chart with nothing left on screen to explain why.\n host: {\n '[class.framed]': \"frameResolved() === 'auto'\",\n '(document:keydown.escape)': 'releaseCategoryPin()',\n '(document:pointerover)': 'onPointerAnywhere($event)',\n },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class LineChartComponent {\n /** X labels. Every series' `data` is read against this length. */\n readonly categories = input.required<readonly string[]>();\n\n /** One line per entry. Every series is read against `categories`, so a series longer than it\n * loses its tail and a shorter one ends early. */\n readonly series = input.required<readonly LineChartSeries[]>();\n\n /** How a secondary axis relates to the primary one. */\n readonly yAxisMode = input<LineChartAxisMode>('rounded');\n\n /** Draws a dot at every reading. Off, the dots appear on hover and on focus only. */\n readonly showMarkers = input(true, { transform: booleanAttribute });\n\n /** Labels pinned over their readings, for the points that have to read without a pointer. They\n * are drawn, not announced: the data table already carries every reading, and repeating one in\n * the plot makes a screen reader say it twice. */\n readonly annotations = input<readonly LineChartAnnotation[]>([]);\n\n /** Makes every reading focusable and clickable. A series drawn without markers grows invisible\n * ones so there is something to land on; they appear on hover and on focus.\n *\n * The click output fires whether or not this is set, so a consumer that binds the output and\n * forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The point that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly pointClicked = output<LineChartPoint>();\n\n /** Holds the crosshair and its tooltip on the category that was clicked, until Escape or a\n * press outside releases it. Off by default: a click is already the drill-down hook, and a\n * crosshair left standing after the pointer has gone needs a reader who knows why. `pointClicked`\n * fires either way — pinning is a state, not a handler. */\n readonly pinOnClick = input(false, { transform: booleanAttribute });\n\n protected readonly pinnedCategory = signal(false);\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 /** What a `null` reading draws. The default refuses to assert that a missing\n * reading is a zero. */\n readonly gaps = input<LineChartGaps>('break');\n\n /** How many value-axis ticks to aim for. A hint, not a count: ticks snap to a round step, so\n * the axis may carry one more or one fewer. */\n readonly tickCount = input(LINE_CHART_DEFAULT_TICK_COUNT, {\n transform: numberAttribute,\n });\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 /** Pins the value axis instead of deriving it from the data. A panel opened one subject at a\n * time — one agent, one microsite — derives a different axis for each of them, so two plots with\n * the same gentle wiggle can be four times apart in value and nothing on screen says so. A fixed\n * maximum is what makes two renders comparable.\n *\n * Null, the default, keeps the derived axis. Applies to the primary axis; `maxSecondary` pins\n * the second one where a series sets `axis: 'secondary'`. A maximum below the data does not clip\n * it — the larger of the two wins, because silently hiding a reading is worse than a taller axis\n * than you asked for. */\n readonly max = input<number | null>(null);\n\n /** Pins the secondary value axis. See `max`. */\n readonly maxSecondary = input<number | null>(null);\n\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 protected readonly viewBox = `0 0 ${LINE_CHART_VIEW_WIDTH} ${LINE_CHART_VIEW_HEIGHT}`;\n\n protected readonly resolvedSeries = computed<readonly ResolvedSeries[]>(\n () => {\n const categoryCount = this.categories().length;\n const gaps = this.gaps();\n\n const patterns = this.patterns();\n\n return this.series().map((series, index) => {\n const slot = paletteIndexFor(\n series.slot,\n index,\n CHART_SERIES_COLORS.length,\n );\n\n return {\n series,\n values: alignSeriesValues(series.data, categoryCount, gaps),\n onSecondaryAxis: series.axis === 'secondary',\n color: CHART_SERIES_COLORS[slot],\n dash: patterns ? SERIES_DASH_ARRAYS[slot] : null,\n };\n });\n },\n );\n\n /** Ids of the series the legend has switched off. Two-way, so a page can drive it from a URL\n * parameter and read back what the reader chose. */\n readonly hiddenSeries = model<readonly string[]>([]);\n\n /** Whether hiding a series re-scales the value axis to what is left. Default `false`: a silent\n * rescale turns a period-over-period comparison into a different claim, and a comparison\n * dashboard is the common case. */\n readonly rescaleOnHide = input(false, { transform: booleanAttribute });\n\n /** Whether the legend switches series off. Off leaves it a plain key. */\n readonly legendFilters = input(false, { transform: booleanAttribute });\n\n /** What a legend control does. `'isolate'` shows one series and hides the rest — one action to\n * answer \"show me only this\" rather than one per series. `'toggle'` hides one and leaves the\n * rest, for taking a dominant series out so the others can be read at a usable scale.\n * Forwarded to `ds-chart-legend`, which renders radios for the first and checkboxes for the\n * second. */\n readonly legendMode = input<'toggle' | 'isolate'>('isolate');\n\n /** Shown in place of the plot once the legend has switched every series off. Without it the\n * reader is left with an empty grid and nothing saying why. */\n readonly noVisibleSeriesText = input<string>('All series are hidden');\n\n /** Gives every series a dash pattern of its own, so the lines are told apart by shape as well\n * as by colour — WCAG technique G111. Off by default: the shipped palette clears the\n * colour-blind separation threshold on its own, so the patterns are for monochrome print, for a\n * retuned palette, and for a reader who asks for them. */\n readonly patterns = input(false, { transform: booleanAttribute });\n\n /** Milliseconds between one series' 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 list of series does\n * not 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 protected readonly highlightedSeries = signal<string | null>(null);\n\n protected readonly visibleSeries = computed<readonly ResolvedSeries[]>(() => {\n const hidden = this.hiddenSeries();\n\n return this.resolvedSeries().filter(\n (entry) => !hidden.includes(entry.series.id),\n );\n });\n\n protected readonly legendItems = computed<readonly ChartLegendItem[]>(() =>\n this.resolvedSeries().map((entry) => ({\n id: entry.series.id,\n label: entry.series.label,\n color: entry.color,\n })),\n );\n\n protected isDimmed(seriesId: string): boolean {\n const highlighted = this.highlightedSeries();\n\n return this.dimOthers() && highlighted !== null && highlighted !== seriesId;\n }\n\n protected readonly hasSecondaryAxis = computed(() =>\n this.visibleSeries().some((entry) => entry.onSecondaryAxis),\n );\n\n protected readonly layout = computed(() =>\n chartLayout(this.yAxisMode(), this.hasSecondaryAxis()),\n );\n\n protected readonly axes = computed(() => {\n // The axis is scaled from every series unless `rescaleOnHide` says otherwise, so switching one\n // off does not move the gridlines under the ones still drawn.\n const entries = this.rescaleOnHide()\n ? this.visibleSeries()\n : this.resolvedSeries();\n const valuesOn = (secondary: boolean) =>\n entries\n .filter((entry) => entry.onSecondaryAxis === secondary)\n .map((entry) => entry.values);\n\n // The pin raises the axis, never lowers it: a maximum under the data would push readings off\n // the top of the plot, and a chart that hides a value is worse than one with headroom.\n const pinned = (asked: number | null, derived: number) =>\n asked !== null && Number.isFinite(asked) && asked > derived\n ? asked\n : derived;\n\n return axisLayout(\n pinned(this.max(), domainMaxOf(valuesOn(false))),\n this.hasSecondaryAxis()\n ? pinned(this.maxSecondary(), domainMaxOf(valuesOn(true)))\n : null,\n this.yAxisMode(),\n this.tickCount(),\n );\n });\n\n protected readonly categoryPositions = computed(() =>\n categoryCenters(this.categories().length, this.layout().primaryPlot),\n );\n\n protected readonly plottedSeries = computed<readonly PlottedSeries[]>(() => {\n const axes = this.axes();\n const centers = this.categoryPositions();\n\n return this.visibleSeries().map((entry) => {\n const plot = this.plotFor(entry.onSecondaryAxis);\n const axisMax =\n entry.onSecondaryAxis && axes.secondary\n ? axes.secondary.max\n : axes.primary.max;\n const segments = lineSegments(\n seriesPoints(entry.values, axisMax, plot, centers),\n );\n const baselineY = plot.top + plot.height;\n\n return {\n ...entry,\n polylines: segments\n .map((segment) => polylinePoints(segment))\n .filter((points) => points.length > 0),\n areaPaths: entry.series.area\n ? segments\n .map((segment) => areaPath(segment, baselineY))\n .filter((path) => path.length > 0)\n : [],\n markers: segments.flat(),\n };\n });\n });\n\n /** Annotations resolved onto the markers the plot already computed, so a label sits exactly on\n * its reading and moves with it. One whose series is hidden or whose reading is missing has no\n * marker and is dropped — a hidden series must not leave its label floating over the plot. */\n protected readonly placedAnnotations = computed(() => {\n const plotted = this.plottedSeries();\n\n return this.annotations().flatMap((annotation) => {\n const entry = annotation.seriesId\n ? plotted.find(\n (candidate) => candidate.series.id === annotation.seriesId,\n )\n : plotted[0];\n const marker = entry?.markers.find(\n (candidate) => candidate.categoryIndex === annotation.categoryIndex,\n );\n if (!entry || !marker) {\n return [];\n }\n\n // Anchored away from the plot edges, because a centred label at the first or last category\n // hangs half outside the viewBox and is clipped rather than merely tight.\n const anchor =\n marker.x < ANNOTATION_EDGE_GUARD\n ? 'start'\n : marker.x > LINE_CHART_VIEW_WIDTH - ANNOTATION_EDGE_GUARD\n ? 'end'\n : 'middle';\n\n return [\n {\n key: `${entry.series.id}:${annotation.categoryIndex}`,\n label: annotation.label,\n x: marker.x,\n // Above the reading, and below it where there is no room — a peak sits at the top of\n // the plot, which is exactly where a label clamped upward lands on its own marker.\n y:\n marker.y - ANNOTATION_GAP >= ANNOTATION_GAP\n ? marker.y - ANNOTATION_GAP\n : marker.y + ANNOTATION_GAP,\n anchor,\n },\n ];\n });\n });\n\n protected readonly primaryTicks = computed(() =>\n this.ticksFor(this.axes().primary.ticks, this.axes().primary.max, false),\n );\n\n protected readonly secondaryTicks = computed<readonly AxisTick[]>(() => {\n const secondary = this.axes().secondary;\n\n return secondary ? this.ticksFor(secondary.ticks, secondary.max, true) : [];\n });\n\n /** Drawn only when the two axes do not share the primary's gridlines, and only\n * when the axis has more than the single tick a degenerate domain leaves. */\n protected readonly showSecondaryGridlines = computed(\n () => !this.axes().alignedTicks && this.secondaryTicks().length > 1,\n );\n\n protected readonly stacked = computed(() => this.layout().stacked);\n protected readonly categoryLabelY = computed(\n () => this.layout().categoryLabelY,\n );\n\n /** The category under the pointer, or -1. */\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly activeCategory = signal(-1);\n\n protected readonly categoryBands = computed(() =>\n pointScale(this.categories().length, this.layout().primaryPlot.width),\n );\n\n // The band is a slot CENTRED on its reading, so it starts half a step before it. At the two ends\n // half of that slot is outside the plot, and clamping is what keeps the band off the axis labels\n // rather than letting it hang past them.\n protected readonly activeBandX = computed(() => {\n const plot = this.layout().primaryPlot;\n const scale = this.categoryBands();\n const center = plot.left + scale.position(this.activeCategory());\n\n return Math.max(center - scale.step / 2, plot.left);\n });\n\n protected readonly activeBandWidth = computed(() => {\n const plot = this.layout().primaryPlot;\n const scale = this.categoryBands();\n const center = plot.left + scale.position(this.activeCategory());\n const start = Math.max(center - scale.step / 2, plot.left);\n const end = Math.min(center + scale.step / 2, plot.left + plot.width);\n\n return Math.max(end - start, 0);\n });\n\n protected readonly activeCategoryX = computed(\n () => this.activeBandX() + this.activeBandWidth() / 2,\n );\n\n protected onPlotPointer(event: PointerEvent): void {\n const canvas = event.currentTarget as SVGSVGElement;\n const screen = canvas.getScreenCTM();\n if (!screen) {\n return;\n }\n // Client pixels are not viewBox units — the plot scales to the card's width.\n const point = new DOMPoint(event.clientX, event.clientY).matrixTransform(\n screen.inverse(),\n );\n const plot = this.layout().primaryPlot;\n if (this.pinnedCategory()) {\n return;\n }\n this.cancelCategoryClear();\n const category = this.categoryBands().indexAt(point.x - plot.left);\n this.activeCategory.set(category);\n this.tooltipOrigin.set(\n this.tooltipAnchor() === 'pointer'\n ? { x: event.clientX, y: event.clientY }\n : this.readingAnchor(screen, category),\n );\n }\n\n /** The highest reading in the category, mapped back into client pixels. Anchoring there rather\n * than at the cursor keeps the panel still while the pointer travels within one band, and puts\n * it over the readings it names instead of over the finger. */\n private readingAnchor(\n screen: DOMMatrix,\n category: number,\n ): ChartTooltipOrigin {\n const tops = this.plottedSeries().flatMap((entry) =>\n entry.markers\n .filter((marker) => marker.categoryIndex === category)\n .map((marker) => marker.y),\n );\n const y = tops.length ? Math.min(...tops) : this.layout().primaryPlot.top;\n const point = new DOMPoint(\n this.plotLeft() + this.categoryBands().position(category),\n y,\n ).matrixTransform(screen);\n\n return { x: point.x, y: point.y };\n }\n\n protected clearActiveCategory(): void {\n if (this.pinnedCategory()) {\n return;\n }\n // Same grace the element-mark charts get from `chartActiveMark`: the panel is portaled out of\n // the plot, so leaving the plot fires before the pointer can reach it. Clearing at once made\n // the panel unreachable, and — because the pane takes pointer events now — put the plot and the\n // panel in a loop where each closed the other.\n this.cancelCategoryClear();\n this.pendingCategoryClear = setTimeout(\n () => {\n this.pendingCategoryClear = null;\n this.activeCategory.set(-1);\n this.tooltipOrigin.set(null);\n },\n Math.max(this.tooltipLingerResolved(), 0),\n );\n }\n\n /** The panel is portaled to the body, so the plot never sees the pointer arrive on it. This is\n * the other half of the grace period: reaching the panel keeps it open, and leaving the panel for\n * anything that is not the plot starts the clear the plot can no longer start itself. */\n protected onPointerAnywhere(event: PointerEvent): void {\n if (!(event.target instanceof Element) || this.pinnedCategory()) {\n return;\n }\n if (event.target.closest('.ds-chart-tooltip-pane')) {\n this.cancelCategoryClear();\n\n return;\n }\n if (\n this.activeCategory() !== -1 &&\n !this.host.nativeElement.contains(event.target)\n ) {\n this.clearActiveCategory();\n }\n }\n\n private cancelCategoryClear(): void {\n if (this.pendingCategoryClear !== null) {\n clearTimeout(this.pendingCategoryClear);\n this.pendingCategoryClear = null;\n }\n }\n\n private readonly tooltipLingerResolved = resolveWithConfig(\n this.tooltipLingerMs,\n (config) => config.chart?.tooltipLingerMs,\n 0,\n );\n\n private pendingCategoryClear: ReturnType<typeof setTimeout> | null = null;\n\n protected releaseCategoryPin(): void {\n this.pinnedCategory.set(false);\n this.activeCategory.set(-1);\n this.tooltipOrigin.set(null);\n }\n\n /** Whether the plot opens a tooltip, and for what. `'axis'` names every series at the\n * category under the pointer, which is the reading a multi-series line is compared on;\n * `'item'` names only the marker itself. */\n readonly tooltip = input<ChartTooltipTrigger>('axis');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n /** Where the tooltip is pinned. `'point'`, the default, is the highest reading in the category,\n * so the panel stays put while the pointer moves within one band. `'pointer'` follows the\n * cursor. */\n readonly tooltipAnchor = input<'point' | 'pointer'>('point');\n\n protected readonly tooltipOrigin = signal<ChartTooltipOrigin | null>(null);\n\n /** The series focus is on, or -1 for the whole category. A pointer answers for every\n * series at once; a focused marker answers for its own. */\n protected readonly activeSeries = signal(-1);\n\n /** One tab stop PER SERIES, keyed by series id — each line is a strand the reader walks with\n * the arrows. WCAG 2.1.1's Understanding is explicit that not every mouse-operable control has\n * to be separately focusable, which is what keeps a 12-category, 2-series plot from being\n * twenty-four stops in the page's tab order. */\n protected readonly rovingByCategory = signal<ReadonlyMap<string, number>>(\n new Map(),\n );\n\n protected isTabStop(seriesId: string, categoryIndex: number): boolean {\n return (this.rovingByCategory().get(seriesId) ?? 0) === categoryIndex;\n }\n\n protected onMarkerFocus(\n seriesIndex: number,\n categoryIndex: number,\n event: FocusEvent,\n ): void {\n if (event.currentTarget instanceof Element) {\n this.tooltipOrigin.set(event.currentTarget);\n }\n this.activeSeries.set(seriesIndex);\n this.activeCategory.set(categoryIndex);\n this.setRoving(seriesIndex, categoryIndex);\n }\n\n protected onMarkerNavigation(\n event: KeyboardEvent,\n seriesIndex: number,\n categoryIndex: number,\n ): void {\n const markers = this.plottedSeries()[seriesIndex]?.markers ?? [];\n const positions = markers.map((marker) => marker.categoryIndex);\n const current = positions.indexOf(categoryIndex);\n const next = nextRovingIndex(event.key, current, positions.length);\n if (next === null) {\n return;\n }\n event.preventDefault();\n const nextCategory = positions[next];\n this.setRoving(seriesIndex, nextCategory);\n focusMark(\n (event.currentTarget as Element).closest('svg'),\n nextCategory,\n `[data-series-index=\"${seriesIndex}\"]`,\n );\n }\n\n private setRoving(seriesIndex: number, categoryIndex: number): void {\n const seriesId = this.plottedSeries()[seriesIndex]?.series.id;\n if (seriesId === undefined) {\n return;\n }\n const next = new Map(this.rovingByCategory());\n next.set(seriesId, categoryIndex);\n this.rovingByCategory.set(next);\n }\n\n protected onMarkerBlur(): void {\n this.activeSeries.set(-1);\n this.clearActiveCategory();\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const categoryIndex = this.activeCategory();\n const categories = this.categories();\n if (\n this.tooltip() === 'none' ||\n categoryIndex < 0 ||\n categoryIndex >= categories.length\n ) {\n return null;\n }\n const format = this.valueFormatResolved();\n const focusedSeries = this.activeSeries();\n const perSeries =\n this.tooltip() === 'item' || focusedSeries >= 0\n ? this.visibleSeries().slice(\n Math.max(focusedSeries, 0),\n Math.max(focusedSeries, 0) + 1,\n )\n : this.visibleSeries();\n\n return {\n category: categories[categoryIndex],\n entries: perSeries\n .map((entry) => ({ entry, value: entry.values[categoryIndex] }))\n .filter(\n (\n reading,\n ): reading is {\n entry: (typeof perSeries)[number];\n value: number;\n } =>\n typeof reading.value === 'number' &&\n Number.isFinite(reading.value),\n )\n .map(({ entry, value }) => ({\n label: entry.series.label,\n value,\n formatted: format(value),\n color: entry.color,\n })),\n };\n },\n );\n\n protected readonly plotLeft = computed(() => this.layout().primaryPlot.left);\n protected readonly plotRight = computed(\n () => this.layout().primaryPlot.left + this.layout().primaryPlot.width,\n );\n\n protected readonly primaryTopY = computed(\n () => this.layout().primaryPlot.top,\n );\n protected readonly secondaryTopY = computed(\n () => this.layout().secondaryPlot.top,\n );\n\n protected readonly primaryBaselineY = computed(() =>\n baselineOf(this.layout().primaryPlot),\n );\n\n protected readonly secondaryBaselineY = computed(() =>\n baselineOf(this.layout().secondaryPlot),\n );\n\n /** Where the crosshair stops. Under `'stacked'` the two plots sit one above the other over one\n * category axis, so a crosshair that ends at the upper plot's baseline leaves the lower plot —\n * the same category, the same pointer — with nothing marked at all. */\n protected readonly cursorBottomY = computed(() =>\n this.stacked() ? this.secondaryBaselineY() : this.primaryBaselineY(),\n );\n\n protected readonly primaryLabelX = computed(\n () => this.layout().primaryPlot.left - LINE_CHART_AXIS_LABEL_GAP,\n );\n\n protected readonly secondaryLabelX = computed(() => {\n const layout = this.layout();\n\n return layout.stacked\n ? layout.secondaryPlot.left - LINE_CHART_AXIS_LABEL_GAP\n : layout.primaryPlot.left +\n layout.primaryPlot.width +\n LINE_CHART_AXIS_LABEL_GAP;\n });\n\n protected readonly secondaryLabelAnchor = computed(() =>\n this.layout().stacked ? 'end' : 'start',\n );\n\n protected readonly categoryLabels = computed<readonly CategoryLabel[]>(() => {\n const categories = this.categories();\n const centers = this.categoryPositions();\n const stride = categoryLabelStride(categories.length);\n const labels: CategoryLabel[] = [];\n for (let index = 0; index < categories.length; index += stride) {\n labels.push({ x: centers[index], text: categories[index] });\n }\n\n return labels;\n });\n\n protected readonly tableRows = computed(() => {\n const format = this.valueFormatResolved();\n\n return this.categories().map((category, index) => ({\n category,\n cells: this.resolvedSeries().map((entry) => {\n const value = entry.values[index];\n\n return value === null || value === undefined ? '—' : format(value);\n }),\n }));\n });\n\n protected readonly accessibleName = computed(() => {\n const summary = this.summary();\n if (summary !== null) {\n return summary;\n }\n\n const title = this.caption() ?? 'Chart';\n const format = this.valueFormatResolved();\n const categories = this.categories();\n // The pointer belongs to the WHOLE chart, not to each series, or a two-series plot promises\n // the table twice.\n const sentences = this.resolvedSeries().map((entry) =>\n describeSeries(\n entry.series.label,\n entry.values.flatMap((value, index) =>\n value === null ? [] : [{ label: categories[index] ?? '', value }],\n ),\n format,\n false,\n ),\n );\n const pointer =\n this.dataTableResolved() === 'none'\n ? ''\n : ' Full values in the table below.';\n // The plot's own text is inside an `aria-hidden` svg, so an annotation a sighted reader takes\n // as the point of the chart would otherwise reach nobody else.\n const notes = this.placedAnnotations().map((note) => note.label);\n const noted = notes.length ? ` Noted: ${notes.join('; ')}.` : '';\n\n return sentences.length === 0\n ? describeSeries(title, [], format, this.dataTableResolved() !== 'none')\n : `${title}. ${sentences.join(' ')}${noted}${pointer}`;\n });\n\n protected pointOf(entry: PlottedSeries, marker: LinePoint): LineChartPoint {\n return {\n series: entry.series,\n categoryIndex: marker.categoryIndex,\n category: this.categories()[marker.categoryIndex] ?? '',\n value: marker.value,\n };\n }\n\n protected markerLabel(entry: PlottedSeries, marker: LinePoint): string {\n const point = this.pointOf(entry, marker);\n\n return `${entry.series.label}, ${point.category}, ${this.valueFormatResolved()(marker.value)}`;\n }\n\n protected onMarkerKey(\n entry: PlottedSeries,\n marker: LinePoint,\n event: Event,\n ): void {\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.onMarkerClick(entry, marker);\n }\n\n /** The pin hangs off the MARKER, not off the plot: the marker is already focusable and already\n * answers Enter and Space, so the keyboard gets the pin for free. A click handler on the plot\n * would have no keyboard route at all. A second activation of the pinned category releases it. */\n protected onMarkerClick(entry: PlottedSeries, marker: LinePoint): void {\n this.pointClicked.emit(this.pointOf(entry, marker));\n if (this.pinOnClick()) {\n this.pinnedCategory.set(!this.pinnedCategory());\n }\n }\n\n protected readonly isEmpty = computed(\n () => this.series().length === 0 || this.categories().length === 0,\n );\n\n protected readonly showLegend = computed(() => this.series().length > 1);\n\n protected readonly noVisibleSeries = computed(\n () => this.series().length > 0 && this.visibleSeries().length === 0,\n );\n\n /** Placeholder legend rows while loading. Follows the real series count so the\n * chart does not resize when the data lands; falls back to three when `series`\n * is still empty. */\n protected readonly skeletonSeries = computed(() =>\n Array.from({ length: Math.max(this.series().length, 3) }),\n );\n\n private plotFor(onSecondaryAxis: boolean): PlotArea {\n const layout = this.layout();\n\n return onSecondaryAxis && layout.stacked\n ? layout.secondaryPlot\n : layout.primaryPlot;\n }\n\n private ticksFor(\n ticks: readonly number[],\n axisMax: number,\n onSecondaryAxis: boolean,\n ): AxisTick[] {\n const plot = this.plotFor(onSecondaryAxis);\n const step = tickStep(ticks);\n const format = this.valueFormatResolved();\n\n return ticks.map((value) => ({\n y: valueY(value, axisMax, plot),\n label:\n format === defaultValueFormat ? formatTick(value, step) : format(value),\n }));\n }\n}\n","<figure class=\"line-chart\">\n @if (pinnedCategory()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"releaseCategoryPin()\">\n Unpin\n </button>\n }\n\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 {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n <ds-skeleton height=\"var(--_line-chart-plot-height)\" />\n\n @if (skeletonSeries().length > 1) {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonSeries(); track $index) {\n <ds-skeleton\n width=\"var(--space-16)\"\n height=\"var(--space-3)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else if (noVisibleSeries()) {\n <p\n class=\"empty\"\n role=\"status\">\n {{ noVisibleSeriesText() }}\n </p>\n\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [mode]=\"legendMode()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n (pointermove)=\"onPlotPointer($event)\"\n (pointerdown)=\"onPlotPointer($event)\"\n (pointerleave)=\"clearActiveCategory()\">\n @if (activeCategory() >= 0) {\n <g\n class=\"cursor\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\"\n [style.transform]=\"'translateX(' + activeBandX() + 'px)'\">\n <rect\n class=\"category-band\"\n aria-hidden=\"true\"\n x=\"0\"\n [attr.y]=\"primaryTopY()\"\n [attr.width]=\"activeBandWidth()\"\n [attr.height]=\"cursorBottomY() - primaryTopY()\" />\n\n <line\n class=\"cursor-line\"\n aria-hidden=\"true\"\n [attr.x1]=\"activeBandWidth() / 2\"\n [attr.x2]=\"activeBandWidth() / 2\"\n [attr.y1]=\"primaryTopY()\"\n [attr.y2]=\"cursorBottomY()\" />\n </g>\n }\n\n @for (tick of primaryTicks(); track $index) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track $index) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n [class.secondary]=\"!stacked()\" />\n }\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"primaryBaselineY()\"\n [attr.y2]=\"primaryBaselineY()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotLeft()\"\n [attr.y1]=\"primaryTopY()\"\n [attr.y2]=\"primaryBaselineY()\" />\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryBaselineY()\"\n [attr.y2]=\"secondaryBaselineY()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotLeft()\"\n [attr.y1]=\"secondaryTopY()\"\n [attr.y2]=\"secondaryBaselineY()\" />\n }\n\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (path of entry.areaPaths; track $index) {\n <path\n class=\"series-area\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(seriesIndex)\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.d]=\"path\"\n [attr.fill]=\"entry.color\" />\n }\n }\n\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (points of entry.polylines; track $index) {\n <polyline\n class=\"series-line\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [attr.stroke-dasharray]=\"entry.dash\"\n [style.--_chart-mark-stagger]=\"markStagger(seriesIndex)\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.points]=\"points\"\n [attr.stroke]=\"entry.color\" />\n }\n }\n\n @if (showMarkers() || interactive()) {\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (marker of entry.markers; track marker.categoryIndex) {\n <circle\n class=\"series-marker\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [class.ghost]=\"!showMarkers()\"\n [class.interactive]=\"interactive()\"\n [class.is-active]=\"marker.categoryIndex === activeCategory()\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.data-series-index]=\"seriesIndex\"\n [attr.data-mark-index]=\"marker.categoryIndex\"\n [attr.tabindex]=\"\n interactive()\n ? isTabStop(entry.series.id, marker.categoryIndex)\n ? 0\n : -1\n : null\n \"\n [attr.aria-label]=\"\n interactive() ? markerLabel(entry, marker) : null\n \"\n (focus)=\"\n onMarkerFocus(seriesIndex, marker.categoryIndex, $event)\n \"\n (blur)=\"onMarkerBlur()\"\n (keydown)=\"\n onMarkerNavigation($event, seriesIndex, marker.categoryIndex)\n \"\n (click)=\"onMarkerClick(entry, marker)\"\n (keydown.enter)=\"onMarkerKey(entry, marker, $event)\"\n (keydown.space)=\"onMarkerKey(entry, marker, $event)\" />\n }\n }\n }\n\n @for (note of placedAnnotations(); track note.key) {\n <text\n class=\"annotation\"\n aria-hidden=\"true\"\n [attr.x]=\"note.x\"\n [attr.y]=\"note.y\"\n [attr.text-anchor]=\"note.anchor\">\n {{ note.label }}\n </text>\n }\n\n @for (tick of primaryTicks(); track $index) {\n <text\n class=\"axis-label\"\n text-anchor=\"end\"\n [attr.x]=\"primaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track $index) {\n <text\n class=\"axis-label\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track $index) {\n <text\n class=\"category-label\"\n text-anchor=\"middle\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\">\n {{ label.text }}\n </text>\n }\n </svg>\n </div>\n\n @if (showLegend()) {\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [mode]=\"legendMode()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n }\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 Category\n </th>\n\n @for (entry of resolvedSeries(); track entry.series.id) {\n <th scope=\"col\">\n {{ entry.series.label }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (row of tableRows(); track $index) {\n <tr>\n <th scope=\"row\">\n {{ row.category }}\n </th>\n\n @for (cell of row.cells; track $index) {\n <td>\n {{ cell }}\n </td>\n }\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":";;;;;;;;AAQO,MAAM,qBAAqB,GAAG,GAAG;AACjC,MAAM,sBAAsB,GAAG,GAAG;AAClC,MAAM,6BAA6B,GAAG,CAAC;AACvC,MAAM,yBAAyB,GAAG,CAAC;AAE1C,MAAM,WAAW,GAAG,EAAE;AACtB,MAAM,gBAAgB,GAAG,EAAE;AAC3B,MAAM,QAAQ,GAAG,EAAE;AACnB,MAAM,eAAe,GAAG,EAAE;AAC1B,MAAM,qBAAqB,GAAG,EAAE;AAChC,MAAM,gBAAgB,GAAG,EAAE;AAC3B,MAAM,mBAAmB,GAAG,EAAE;AAC9B,MAAM,mBAAmB,GAAG,CAAC;AAC7B,MAAM,aAAa,GAAG,CAAC;AACvB,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AACxC;AACA;AACA;AACA,MAAM,oBAAoB,GAAG,CAAC,GAAG,KAAK;AAqCtC,SAAS,OAAO,CAAC,KAAa,EAAE,QAAgB,EAAA;IAC9C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAC3B,QAAA,OAAO,CAAC;IACV;IAEA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A,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,eAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE5oBtB;;AAEG;;;;"}
@@ -0,0 +1,61 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, numberAttribute, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
+
4
+ /**
5
+ * One track and one fill, for a measurement inside a table cell.
6
+ *
7
+ * A chart is a block with a caption, a legend and an annex table; in a 60px cell that chrome is
8
+ * the whole cell. This is the mark on its own — no caption, no legend, no tooltip, no table.
9
+ *
10
+ * It is NOT `ds-progress`, which reports how far a task has got and says so with
11
+ * `role="progressbar"`. A rate, a score or a count against a ceiling is a measurement: it has no
12
+ * beginning and no completion, and a table of two hundred of them would announce two hundred
13
+ * progress bars. Here the mark is hidden from assistive technology unless `ariaLabel` names it,
14
+ * because the cell beside it almost always prints the number already.
15
+ */
16
+ class MeterComponent {
17
+ /** The measurement, in units of `max`. Clamped to the track. */
18
+ value = input(0, { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), transform: numberAttribute });
19
+ /** The ceiling `value` is read against — the column's own largest, or the scale the number
20
+ * means something on. Left at 100, `value` is a percentage. Zero or less falls back to 100,
21
+ * because a scale with no width has no fraction to draw. */
22
+ max = input(100, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: numberAttribute });
23
+ /** The fill's colour. Unset takes `--ds-meter-fill-color`, so a column is coloured once in a
24
+ * stylesheet rather than per row; set it per row where the colour carries meaning. */
25
+ color = input(null, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
26
+ /** Names the measurement, and is what decides whether it is announced at all. Unset, the mark
27
+ * is `aria-hidden` — right where the cell prints the figure beside it, and wrong where the bar
28
+ * is the only place the number appears. */
29
+ ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
30
+ scale = computed(() => {
31
+ const max = this.max();
32
+ return Number.isFinite(max) && max > 0 ? max : 100;
33
+ }, ...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
34
+ clamped = computed(() => {
35
+ const value = this.value();
36
+ return Number.isFinite(value)
37
+ ? Math.max(0, Math.min(this.scale(), value))
38
+ : 0;
39
+ }, ...(ngDevMode ? [{ debugName: "clamped" }] : /* istanbul ignore next */ []));
40
+ percent = computed(() => (this.clamped() / this.scale()) * 100, ...(ngDevMode ? [{ debugName: "percent" }] : /* istanbul ignore next */ []));
41
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MeterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
42
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: MeterComponent, isStandalone: true, selector: "ds-meter", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.role": "ariaLabel() ? 'meter' : null", "attr.aria-hidden": "ariaLabel() ? null : true", "attr.aria-valuemin": "ariaLabel() ? 0 : null", "attr.aria-valuemax": "ariaLabel() ? scale() : null", "attr.aria-valuenow": "ariaLabel() ? clamped() : null", "attr.aria-label": "ariaLabel()" } }, ngImport: i0, template: "<span\n class=\"fill\"\n [style.width.%]=\"percent()\"\n [style.background]=\"color()\">\n</span>\n", styles: [":host{--_meter-height: var(--ds-meter-height, 6px);--_meter-track-color: var(--ds-meter-track-color, var(--surface-muted));--_meter-radius: var(--ds-meter-radius, var(--radius-pill));display:block;inline-size:100%;min-inline-size:var(--ds-meter-min-width, 3rem);block-size:var(--_meter-height);border-radius:var(--_meter-radius);background:var(--_meter-track-color);overflow:hidden}.fill{display:block;block-size:100%;border-radius:inherit;background:var(--ds-meter-fill-color, var(--ds-chart-series-1-color));transition:inline-size var(--duration-base) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.fill{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
43
+ }
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MeterComponent, decorators: [{
45
+ type: Component,
46
+ args: [{ selector: 'ds-meter', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
47
+ '[attr.role]': "ariaLabel() ? 'meter' : null",
48
+ '[attr.aria-hidden]': 'ariaLabel() ? null : true',
49
+ '[attr.aria-valuemin]': 'ariaLabel() ? 0 : null',
50
+ '[attr.aria-valuemax]': 'ariaLabel() ? scale() : null',
51
+ '[attr.aria-valuenow]': 'ariaLabel() ? clamped() : null',
52
+ '[attr.aria-label]': 'ariaLabel()',
53
+ }, template: "<span\n class=\"fill\"\n [style.width.%]=\"percent()\"\n [style.background]=\"color()\">\n</span>\n", styles: [":host{--_meter-height: var(--ds-meter-height, 6px);--_meter-track-color: var(--ds-meter-track-color, var(--surface-muted));--_meter-radius: var(--ds-meter-radius, var(--radius-pill));display:block;inline-size:100%;min-inline-size:var(--ds-meter-min-width, 3rem);block-size:var(--_meter-height);border-radius:var(--_meter-radius);background:var(--_meter-track-color);overflow:hidden}.fill{display:block;block-size:100%;border-radius:inherit;background:var(--ds-meter-fill-color, var(--ds-chart-series-1-color));transition:inline-size var(--duration-base) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.fill{transition:none}}\n"] }]
54
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
55
+
56
+ /**
57
+ * Generated bundle index. Do not edit.
58
+ */
59
+
60
+ export { MeterComponent };
61
+ //# sourceMappingURL=ids-group-ltd-ids-design-system-components-meter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-meter.mjs","sources":["../../../src/lib/components/meter/meter.component.ts","../../../src/lib/components/meter/meter.component.html","../../../src/lib/components/meter/ids-group-ltd-ids-design-system-components-meter.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n numberAttribute,\n} from '@angular/core';\n\n/**\n * One track and one fill, for a measurement inside a table cell.\n *\n * A chart is a block with a caption, a legend and an annex table; in a 60px cell that chrome is\n * the whole cell. This is the mark on its own — no caption, no legend, no tooltip, no table.\n *\n * It is NOT `ds-progress`, which reports how far a task has got and says so with\n * `role=\"progressbar\"`. A rate, a score or a count against a ceiling is a measurement: it has no\n * beginning and no completion, and a table of two hundred of them would announce two hundred\n * progress bars. Here the mark is hidden from assistive technology unless `ariaLabel` names it,\n * because the cell beside it almost always prints the number already.\n */\n@Component({\n selector: 'ds-meter',\n standalone: true,\n imports: [],\n templateUrl: './meter.component.html',\n styleUrl: './meter.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[attr.role]': \"ariaLabel() ? 'meter' : null\",\n '[attr.aria-hidden]': 'ariaLabel() ? null : true',\n '[attr.aria-valuemin]': 'ariaLabel() ? 0 : null',\n '[attr.aria-valuemax]': 'ariaLabel() ? scale() : null',\n '[attr.aria-valuenow]': 'ariaLabel() ? clamped() : null',\n '[attr.aria-label]': 'ariaLabel()',\n },\n})\nexport class MeterComponent {\n /** The measurement, in units of `max`. Clamped to the track. */\n readonly value = input(0, { transform: numberAttribute });\n /** The ceiling `value` is read against — the column's own largest, or the scale the number\n * means something on. Left at 100, `value` is a percentage. Zero or less falls back to 100,\n * because a scale with no width has no fraction to draw. */\n readonly max = input(100, { transform: numberAttribute });\n /** The fill's colour. Unset takes `--ds-meter-fill-color`, so a column is coloured once in a\n * stylesheet rather than per row; set it per row where the colour carries meaning. */\n readonly color = input<string | null>(null);\n /** Names the measurement, and is what decides whether it is announced at all. Unset, the mark\n * is `aria-hidden` — right where the cell prints the figure beside it, and wrong where the bar\n * is the only place the number appears. */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly scale = computed(() => {\n const max = this.max();\n\n return Number.isFinite(max) && max > 0 ? max : 100;\n });\n\n protected readonly clamped = computed(() => {\n const value = this.value();\n\n return Number.isFinite(value)\n ? Math.max(0, Math.min(this.scale(), value))\n : 0;\n });\n\n protected readonly percent = computed(\n () => (this.clamped() / this.scale()) * 100,\n );\n}\n","<span\n class=\"fill\"\n [style.width.%]=\"percent()\"\n [style.background]=\"color()\">\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AASA;;;;;;;;;;;AAWG;MAkBU,cAAc,CAAA;;IAEhB,KAAK,GAAG,KAAK,CAAC,CAAC,6EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AACzD;;AAE6D;IACpD,GAAG,GAAG,KAAK,CAAC,GAAG,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AACzD;AACuF;AAC9E,IAAA,KAAK,GAAG,KAAK,CAAgB,IAAI,4EAAC;AAC3C;;AAE4C;AACnC,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;AAE5B,IAAA,KAAK,GAAG,QAAQ,CAAC,MAAK;AACvC,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;AAEtB,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IA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wBAAA,sBAAsB,EAAE,gCAAgC;AACxD,wBAAA,mBAAmB,EAAE,aAAa;AACnC,qBAAA,EAAA,QAAA,EAAA,wGAAA,EAAA,MAAA,EAAA,CAAA,goBAAA,CAAA,EAAA;;;AEpCH;;AAEG;;;;"}
@@ -2,36 +2,60 @@ import * as i0 from '@angular/core';
2
2
  import { input, booleanAttribute, computed, ViewEncapsulation, Component } from '@angular/core';
3
3
 
4
4
  class ProgressComponent {
5
- /** Progress 0–100; clamped, and ignored while `indeterminate`. */
5
+ /** Progress in units of `max`, so 0–100 by default; clamped, and ignored while
6
+ * `indeterminate`. */
6
7
  value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
8
+ /** The full scale `value` and `target` are read against. Left at 100 they are percentages, which
9
+ * is why nothing existing changes. Set it to the real total — `[value]="37" [max]="80"` — and
10
+ * the accessible name carries "37 of 80" rather than the 46% a caller would otherwise have to
11
+ * compute and a screen reader would read instead. Zero or less falls back to 100, because a
12
+ * scale with no width has no fraction to draw. */
13
+ max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
7
14
  /** Colour variant — drives the success/warning/error styling. */
8
15
  variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
9
16
  /** Indeterminate (unknown-duration) animation instead of a fixed `value`. */
10
17
  indeterminate = input(false, { ...(ngDevMode ? { debugName: "indeterminate" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
11
- /** Accessible name for the progress bar (e.g. "Upload progress"). */
18
+ /** Accessible name for the progress bar (e.g. "Upload progress"). With a `target` set, name the
19
+ * comparison here — the mark is drawn, and `role="progressbar"` has no second value to announce,
20
+ * so "Resolved 62% against a 75% target" is what reaches a screen reader. */
12
21
  ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
13
- clampedValue = computed(() => {
14
- const value = this.value();
15
- return Math.max(0, Math.min(100, value));
16
- }, ...(ngDevMode ? [{ debugName: "clampedValue" }] : /* istanbul ignore next */ []));
22
+ /** A second point on the same scale as `value`, drawn as a hairline across the track — a goal or
23
+ * a baseline to read `value` against. Clamped like `value`, ignored while `indeterminate`, and
24
+ * unset draws nothing. */
25
+ target = input(null, ...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
26
+ scale = computed(() => {
27
+ const max = this.max();
28
+ return max > 0 ? max : 100;
29
+ }, ...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
30
+ clampedValue = computed(() => Math.max(0, Math.min(this.scale(), this.value())), ...(ngDevMode ? [{ debugName: "clampedValue" }] : /* istanbul ignore next */ []));
31
+ /** Width and offset are percentages of the track whatever the scale is. */
32
+ valuePercent = computed(() => (this.clampedValue() / this.scale()) * 100, ...(ngDevMode ? [{ debugName: "valuePercent" }] : /* istanbul ignore next */ []));
33
+ clampedTarget = computed(() => {
34
+ const target = this.target();
35
+ return target == null ? null : Math.max(0, Math.min(this.scale(), target));
36
+ }, ...(ngDevMode ? [{ debugName: "clampedTarget" }] : /* istanbul ignore next */ []));
37
+ targetPercent = computed(() => {
38
+ const target = this.clampedTarget();
39
+ return target == null ? null : (target / this.scale()) * 100;
40
+ }, ...(ngDevMode ? [{ debugName: "targetPercent" }] : /* istanbul ignore next */ []));
17
41
  isIndet = computed(() => this.indeterminate(), ...(ngDevMode ? [{ debugName: "isIndet" }] : /* istanbul ignore next */ []));
18
42
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
19
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ProgressComponent, isStandalone: true, selector: "ds-progress", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar", "aria-valuemin": "0", "aria-valuemax": "100" }, properties: { "attr.aria-valuenow": "isIndet() ? null : clampedValue()", "attr.aria-label": "ariaLabel()", "class.success": "variant() === 'success'", "class.warning": "variant() === 'warning'", "class.error": "variant() === 'error'", "class.indeterminate": "isIndet()" } }, ngImport: i0, template: "@if (isIndet()) {\n <span></span>\n} @else {\n <span [style.width.%]=\"clampedValue()\"></span>\n}\n", styles: ["@charset \"UTF-8\";:host{--_progress-height: var(--ds-progress-height, var(--progress-h));--_progress-track-color: var(--ds-progress-track-color, var(--surface-muted));--_progress-bar-color: var(--ds-progress-bar-color, var(--accent));display:block;width:100%;height:var(--_progress-height);background:var(--_progress-track-color);border-radius:var(--radius-pill);overflow:hidden}:host>span{display:block;height:100%;background:var(--_progress-bar-color);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}:host(.success){--_progress-bar-color-success: var(--ds-progress-bar-color-success, var(--success))}:host(.warning){--_progress-bar-color-warning: var(--ds-progress-bar-color-warning, var(--yellow-500))}:host(.error){--_progress-bar-color-error: var(--ds-progress-bar-color-error, var(--error))}:host(.success)>span{background:var(--_progress-bar-color-success)}:host(.warning)>span{background:var(--_progress-bar-color-warning)}:host(.error)>span{background:var(--_progress-bar-color-error)}:host(.indeterminate)>span{width:30%;animation:progress-indet var(--duration-loop-slow) var(--ease-standard) infinite}@keyframes progress-indet{0%{transform:translate(-100%)}to{transform:translate(400%)}}\n"] });
43
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ProgressComponent, isStandalone: true, selector: "ds-progress", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar", "aria-valuemin": "0" }, properties: { "attr.aria-valuemax": "scale()", "attr.aria-valuenow": "isIndet() ? null : clampedValue()", "attr.aria-label": "ariaLabel()", "class.success": "variant() === 'success'", "class.warning": "variant() === 'warning'", "class.error": "variant() === 'error'", "class.indeterminate": "isIndet()" } }, ngImport: i0, template: "@if (isIndet()) {\n <span></span>\n} @else {\n <span [style.width.%]=\"valuePercent()\"></span>\n\n @if (targetPercent() !== null) {\n <div\n class=\"target\"\n [style.left.%]=\"targetPercent()\">\n </div>\n }\n}\n", styles: ["@charset \"UTF-8\";:host{--_progress-height: var(--ds-progress-height, var(--progress-h));--_progress-track-color: var(--ds-progress-track-color, var(--surface-muted));--_progress-bar-color: var(--ds-progress-bar-color, var(--accent));--_progress-target-color: var(--ds-progress-target-color, var(--text-primary));--_progress-target-width: var(--ds-progress-target-width, 2px);display:block;position:relative;width:100%;height:var(--_progress-height);background:var(--_progress-track-color);border-radius:var(--radius-pill);overflow:hidden}:host>span{display:block;height:100%;background:var(--_progress-bar-color);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}:host>.target{position:absolute;top:0;height:100%;width:var(--_progress-target-width);transform:translate(-50%);background:var(--_progress-target-color);transition:left var(--duration-base) var(--ease-standard)}:host(.success){--_progress-bar-color-success: var(--ds-progress-bar-color-success, var(--success))}:host(.warning){--_progress-bar-color-warning: var(--ds-progress-bar-color-warning, var(--yellow-500))}:host(.error){--_progress-bar-color-error: var(--ds-progress-bar-color-error, var(--error))}:host(.success)>span{background:var(--_progress-bar-color-success)}:host(.warning)>span{background:var(--_progress-bar-color-warning)}:host(.error)>span{background:var(--_progress-bar-color-error)}:host(.indeterminate)>span{width:30%;animation:progress-indet var(--duration-loop-slow) var(--ease-standard) infinite}@keyframes progress-indet{0%{transform:translate(-100%)}to{transform:translate(400%)}}\n"] });
20
44
  }
21
45
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ProgressComponent, decorators: [{
22
46
  type: Component,
23
47
  args: [{ selector: 'ds-progress', standalone: true, imports: [], encapsulation: ViewEncapsulation.Emulated, host: {
24
48
  role: 'progressbar',
25
49
  'aria-valuemin': '0',
26
- 'aria-valuemax': '100',
50
+ '[attr.aria-valuemax]': 'scale()',
27
51
  '[attr.aria-valuenow]': 'isIndet() ? null : clampedValue()',
28
52
  '[attr.aria-label]': 'ariaLabel()',
29
53
  '[class.success]': "variant() === 'success'",
30
54
  '[class.warning]': "variant() === 'warning'",
31
55
  '[class.error]': "variant() === 'error'",
32
56
  '[class.indeterminate]': 'isIndet()',
33
- }, template: "@if (isIndet()) {\n <span></span>\n} @else {\n <span [style.width.%]=\"clampedValue()\"></span>\n}\n", styles: ["@charset \"UTF-8\";:host{--_progress-height: var(--ds-progress-height, var(--progress-h));--_progress-track-color: var(--ds-progress-track-color, var(--surface-muted));--_progress-bar-color: var(--ds-progress-bar-color, var(--accent));display:block;width:100%;height:var(--_progress-height);background:var(--_progress-track-color);border-radius:var(--radius-pill);overflow:hidden}:host>span{display:block;height:100%;background:var(--_progress-bar-color);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}:host(.success){--_progress-bar-color-success: var(--ds-progress-bar-color-success, var(--success))}:host(.warning){--_progress-bar-color-warning: var(--ds-progress-bar-color-warning, var(--yellow-500))}:host(.error){--_progress-bar-color-error: var(--ds-progress-bar-color-error, var(--error))}:host(.success)>span{background:var(--_progress-bar-color-success)}:host(.warning)>span{background:var(--_progress-bar-color-warning)}:host(.error)>span{background:var(--_progress-bar-color-error)}:host(.indeterminate)>span{width:30%;animation:progress-indet var(--duration-loop-slow) var(--ease-standard) infinite}@keyframes progress-indet{0%{transform:translate(-100%)}to{transform:translate(400%)}}\n"] }]
34
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
57
+ }, template: "@if (isIndet()) {\n <span></span>\n} @else {\n <span [style.width.%]=\"valuePercent()\"></span>\n\n @if (targetPercent() !== null) {\n <div\n class=\"target\"\n [style.left.%]=\"targetPercent()\">\n </div>\n }\n}\n", styles: ["@charset \"UTF-8\";:host{--_progress-height: var(--ds-progress-height, var(--progress-h));--_progress-track-color: var(--ds-progress-track-color, var(--surface-muted));--_progress-bar-color: var(--ds-progress-bar-color, var(--accent));--_progress-target-color: var(--ds-progress-target-color, var(--text-primary));--_progress-target-width: var(--ds-progress-target-width, 2px);display:block;position:relative;width:100%;height:var(--_progress-height);background:var(--_progress-track-color);border-radius:var(--radius-pill);overflow:hidden}:host>span{display:block;height:100%;background:var(--_progress-bar-color);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}:host>.target{position:absolute;top:0;height:100%;width:var(--_progress-target-width);transform:translate(-50%);background:var(--_progress-target-color);transition:left var(--duration-base) var(--ease-standard)}:host(.success){--_progress-bar-color-success: var(--ds-progress-bar-color-success, var(--success))}:host(.warning){--_progress-bar-color-warning: var(--ds-progress-bar-color-warning, var(--yellow-500))}:host(.error){--_progress-bar-color-error: var(--ds-progress-bar-color-error, var(--error))}:host(.success)>span{background:var(--_progress-bar-color-success)}:host(.warning)>span{background:var(--_progress-bar-color-warning)}:host(.error)>span{background:var(--_progress-bar-color-error)}:host(.indeterminate)>span{width:30%;animation:progress-indet var(--duration-loop-slow) var(--ease-standard) infinite}@keyframes progress-indet{0%{transform:translate(-100%)}to{transform:translate(400%)}}\n"] }]
58
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }] } });
35
59
 
36
60
  /**
37
61
  * Generated bundle index. Do not edit.