@ids-group-ltd/ids-design-system 0.12.3 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +603 -6
- package/components.md +85 -2
- package/docs/agent/INDEX.md +11 -1
- package/docs/agent/charts/chart-colour-which-palette-a-chart-takes.md +9 -0
- package/docs/agent/charts/chart-frame-the-box-a-chart-draws-around-itself.md +12 -0
- package/docs/agent/charts/ds-bar-chart.md +15 -0
- package/docs/agent/charts/ds-column-chart.md +14 -0
- package/docs/agent/charts/ds-donut-chart.md +17 -0
- package/docs/agent/charts/ds-funnel-chart.md +16 -0
- package/docs/agent/charts/ds-line-chart.md +15 -0
- package/docs/agent/forms/ds-button.md +4 -2
- package/docs/agent/forms/ds-number-stepper.md +1 -0
- package/docs/agent/navigation/ds-sidenav-item.md +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +16 -14
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +161 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +58 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +43 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +197 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +173 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +9 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +299 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +69 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +366 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +10 -14
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +631 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +2 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +9 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +18 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +30 -71
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +31 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +393 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +17 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +3 -0
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +10 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.13.0.json +530 -0
- package/package.json +57 -1
- package/styles/_chart-data-table.scss +95 -0
- package/styles/_chart-frame.scss +53 -0
- package/styles/_chart-interactive.scss +40 -0
- package/styles/_chart-motion.scss +45 -0
- package/styles/_focus.scss +1 -1
- package/styles/_tokens-charts.scss +149 -39
- package/styles/_tokens.scss +17 -4
- package/themes/dark/_theme.scss +37 -29
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +11 -9
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +104 -0
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +37 -4
- package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +34 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +78 -0
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +105 -0
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +4 -1
- package/types/ids-group-ltd-ids-design-system-components-donut-chart.d.ts +113 -0
- package/types/ids-group-ltd-ids-design-system-components-field-group.d.ts +52 -11
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +109 -0
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +5 -7
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +241 -0
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +5 -2
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +16 -4
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +13 -28
- package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +11 -1
- package/types/ids-group-ltd-ids-design-system-components.d.ts +154 -4
- package/types/ids-group-ltd-ids-design-system-core.d.ts +12 -1
- package/types/ids-group-ltd-ids-design-system.d.ts +9 -2
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, output, numberAttribute, computed, model, signal, contentChild, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { tickValues, niceMax, bandScale, linearScale, formatValue, CHART_SERIES_COLORS, staggerDelay, nextRovingIndex, focusMark, describeSeries, tickStep, formatTick } from '@ids-group-ltd/ids-design-system/components';
|
|
4
|
+
import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
|
|
5
|
+
import { ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
|
|
6
|
+
import { ChartLegendComponent } from '@ids-group-ltd/ids-design-system/components/chart-legend';
|
|
7
|
+
|
|
8
|
+
const LINE_CHART_VIEW_WIDTH = 640;
|
|
9
|
+
const LINE_CHART_VIEW_HEIGHT = 320;
|
|
10
|
+
const LINE_CHART_DEFAULT_TICK_COUNT = 5;
|
|
11
|
+
const LINE_CHART_AXIS_LABEL_GAP = 8;
|
|
12
|
+
const AXIS_GUTTER = 46;
|
|
13
|
+
const BARE_EDGE_GUTTER = 12;
|
|
14
|
+
const PLOT_TOP = 14;
|
|
15
|
+
const CATEGORY_GUTTER = 30;
|
|
16
|
+
const CATEGORY_LABEL_OFFSET = 18;
|
|
17
|
+
const STACKED_PLOT_GAP = 34;
|
|
18
|
+
const MAX_CATEGORY_LABELS = 12;
|
|
19
|
+
const COORDINATE_DECIMALS = 2;
|
|
20
|
+
const TICK_DECIMALS = 6;
|
|
21
|
+
const ROUND_STEP_FACTORS = [1, 2, 5, 10];
|
|
22
|
+
// A step divided out of a domain and multiplied back rarely lands on itself, so a
|
|
23
|
+
// candidate equal to the minimum can compare as smaller by one bit and push the
|
|
24
|
+
// whole axis up a rung.
|
|
25
|
+
const ROUND_STEP_TOLERANCE = 1 - 1e-12;
|
|
26
|
+
function roundTo(value, decimals) {
|
|
27
|
+
if (!Number.isFinite(value)) {
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
return Number(value.toFixed(decimals));
|
|
31
|
+
}
|
|
32
|
+
function normalizeTickCount(tickCount) {
|
|
33
|
+
return Number.isFinite(tickCount) && tickCount >= 1
|
|
34
|
+
? Math.floor(tickCount)
|
|
35
|
+
: LINE_CHART_DEFAULT_TICK_COUNT;
|
|
36
|
+
}
|
|
37
|
+
/** One reading per category, however long the series actually was. A series longer
|
|
38
|
+
* than `categories` loses its tail and a shorter one ends early: a line that stops
|
|
39
|
+
* short is a defect the reader can see, while a thrown error takes down the page
|
|
40
|
+
* around it. Anything that is not a finite number is a missing reading, so `NaN`
|
|
41
|
+
* and `Infinity` follow the `gaps` policy rather than reaching a coordinate. */
|
|
42
|
+
function alignSeriesValues(data, categoryCount, gaps) {
|
|
43
|
+
const length = Number.isFinite(categoryCount) && categoryCount > 0
|
|
44
|
+
? Math.floor(categoryCount)
|
|
45
|
+
: 0;
|
|
46
|
+
const aligned = [];
|
|
47
|
+
for (let index = 0; index < length; index++) {
|
|
48
|
+
const raw = data[index];
|
|
49
|
+
const reading = typeof raw === 'number' && Number.isFinite(raw) ? raw : null;
|
|
50
|
+
aligned.push(reading === null && gaps === 'zero' ? 0 : reading);
|
|
51
|
+
}
|
|
52
|
+
return aligned;
|
|
53
|
+
}
|
|
54
|
+
/** Largest finite reading across the given series, or zero. Never negative: the
|
|
55
|
+
* tick helpers only describe axes that start at zero, and a negative domain there
|
|
56
|
+
* is a division waiting to happen. */
|
|
57
|
+
function domainMaxOf(valueGroups) {
|
|
58
|
+
let max = 0;
|
|
59
|
+
for (const values of valueGroups) {
|
|
60
|
+
for (const value of values) {
|
|
61
|
+
if (value !== null && Number.isFinite(value) && value > max) {
|
|
62
|
+
max = value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return max;
|
|
67
|
+
}
|
|
68
|
+
/** The smallest 1/2/5/10 × power-of-ten step that is not below `minimumStep`.
|
|
69
|
+
* `niceMax` picks its own number of intervals, so it cannot answer this: an aligned
|
|
70
|
+
* secondary axis has to reach its data within the intervals the primary already
|
|
71
|
+
* drew. */
|
|
72
|
+
function roundStepAtLeast(minimumStep) {
|
|
73
|
+
if (!Number.isFinite(minimumStep) || minimumStep <= 0) {
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
const base = Math.pow(10, Math.floor(Math.log10(minimumStep)));
|
|
77
|
+
for (const factor of ROUND_STEP_FACTORS) {
|
|
78
|
+
const candidate = factor * base;
|
|
79
|
+
if (candidate >= minimumStep * ROUND_STEP_TOLERANCE) {
|
|
80
|
+
return candidate;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return 10 * base;
|
|
84
|
+
}
|
|
85
|
+
function nicedAxis(domainMax, tickCount) {
|
|
86
|
+
return {
|
|
87
|
+
max: niceMax(domainMax, tickCount),
|
|
88
|
+
ticks: tickValues(domainMax, tickCount),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** Both y axes, as the four modes define them. `'rounded'` and `'exact'` share the
|
|
92
|
+
* primary's gridlines and differ only in the step they divide the secondary domain
|
|
93
|
+
* by: `'rounded'` snaps the step up to a round number and overshoots the data,
|
|
94
|
+
* `'exact'` takes the domain itself and lands on it. `'independent'` and
|
|
95
|
+
* `'stacked'` nice each axis on its own — stacked plots sit one above the other,
|
|
96
|
+
* so there is nothing to align. */
|
|
97
|
+
function axisLayout(primaryDomainMax, secondaryDomainMax, mode, tickCount) {
|
|
98
|
+
const count = normalizeTickCount(tickCount);
|
|
99
|
+
const primary = nicedAxis(primaryDomainMax, count);
|
|
100
|
+
if (secondaryDomainMax === null) {
|
|
101
|
+
return { primary, secondary: null, alignedTicks: true };
|
|
102
|
+
}
|
|
103
|
+
const intervals = primary.ticks.length - 1;
|
|
104
|
+
const canAlign = (mode === 'rounded' || mode === 'exact') &&
|
|
105
|
+
intervals >= 1 &&
|
|
106
|
+
Number.isFinite(secondaryDomainMax) &&
|
|
107
|
+
secondaryDomainMax > 0;
|
|
108
|
+
if (!canAlign) {
|
|
109
|
+
return {
|
|
110
|
+
primary,
|
|
111
|
+
secondary: nicedAxis(secondaryDomainMax, count),
|
|
112
|
+
alignedTicks: false,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const step = mode === 'rounded'
|
|
116
|
+
? roundStepAtLeast(secondaryDomainMax / intervals)
|
|
117
|
+
: secondaryDomainMax / intervals;
|
|
118
|
+
if (step <= 0) {
|
|
119
|
+
return { primary, secondary: { max: 0, ticks: [0] }, alignedTicks: true };
|
|
120
|
+
}
|
|
121
|
+
const ticks = [];
|
|
122
|
+
for (let index = 0; index <= intervals; index++) {
|
|
123
|
+
ticks.push(roundTo(step * index, TICK_DECIMALS));
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
primary,
|
|
127
|
+
secondary: { max: roundTo(step * intervals, TICK_DECIMALS), ticks },
|
|
128
|
+
alignedTicks: true,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function chartLayout(mode, hasSecondaryAxis) {
|
|
132
|
+
const stacked = mode === 'stacked' && hasSecondaryAxis;
|
|
133
|
+
const left = AXIS_GUTTER;
|
|
134
|
+
const right = hasSecondaryAxis && !stacked ? AXIS_GUTTER : BARE_EDGE_GUTTER;
|
|
135
|
+
const width = LINE_CHART_VIEW_WIDTH - left - right;
|
|
136
|
+
const plotBottom = LINE_CHART_VIEW_HEIGHT - CATEGORY_GUTTER;
|
|
137
|
+
const categoryLabelY = plotBottom + CATEGORY_LABEL_OFFSET;
|
|
138
|
+
if (!stacked) {
|
|
139
|
+
const plot = {
|
|
140
|
+
left,
|
|
141
|
+
top: PLOT_TOP,
|
|
142
|
+
width,
|
|
143
|
+
height: plotBottom - PLOT_TOP,
|
|
144
|
+
};
|
|
145
|
+
return {
|
|
146
|
+
primaryPlot: plot,
|
|
147
|
+
secondaryPlot: plot,
|
|
148
|
+
categoryLabelY,
|
|
149
|
+
stacked: false,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const height = (plotBottom - PLOT_TOP - STACKED_PLOT_GAP) / 2;
|
|
153
|
+
return {
|
|
154
|
+
primaryPlot: { left, top: PLOT_TOP, width, height },
|
|
155
|
+
secondaryPlot: {
|
|
156
|
+
left,
|
|
157
|
+
top: PLOT_TOP + height + STACKED_PLOT_GAP,
|
|
158
|
+
width,
|
|
159
|
+
height,
|
|
160
|
+
},
|
|
161
|
+
categoryLabelY,
|
|
162
|
+
stacked: true,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function categoryCenters(count, plot) {
|
|
166
|
+
const total = Number.isFinite(count) && count > 0 ? Math.floor(count) : 0;
|
|
167
|
+
const band = bandScale(total, plot.width, 0);
|
|
168
|
+
const centers = [];
|
|
169
|
+
for (let index = 0; index < total; index++) {
|
|
170
|
+
centers.push(plot.left + band.position(index) + band.bandWidth / 2);
|
|
171
|
+
}
|
|
172
|
+
return centers;
|
|
173
|
+
}
|
|
174
|
+
/** The y a reading sits at, always inside the plot. The clamp is what keeps a
|
|
175
|
+
* negative reading — which no zero-based axis can place — off the category labels
|
|
176
|
+
* below, and the finite test is what stops an unplottable one becoming `NaN`. */
|
|
177
|
+
function valueY(value, axisMax, plot) {
|
|
178
|
+
const baseline = plot.top + plot.height;
|
|
179
|
+
const y = baseline - linearScale(axisMax, plot.height)(value);
|
|
180
|
+
if (!Number.isFinite(y)) {
|
|
181
|
+
return baseline;
|
|
182
|
+
}
|
|
183
|
+
return Math.min(Math.max(y, plot.top), baseline);
|
|
184
|
+
}
|
|
185
|
+
function seriesPoints(values, axisMax, plot, centers) {
|
|
186
|
+
return values.map((value, index) => {
|
|
187
|
+
const x = centers[index];
|
|
188
|
+
if (value === null || !Number.isFinite(value) || !Number.isFinite(x)) {
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
return { categoryIndex: index, x, y: valueY(value, axisMax, plot), value };
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function lineSegments(points) {
|
|
195
|
+
const segments = [];
|
|
196
|
+
let current = [];
|
|
197
|
+
for (const point of points) {
|
|
198
|
+
if (point === null) {
|
|
199
|
+
if (current.length > 0) {
|
|
200
|
+
segments.push(current);
|
|
201
|
+
}
|
|
202
|
+
current = [];
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
current.push(point);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (current.length > 0) {
|
|
209
|
+
segments.push(current);
|
|
210
|
+
}
|
|
211
|
+
return segments;
|
|
212
|
+
}
|
|
213
|
+
/** `''` rather than a partial list when a coordinate is unplottable: one `NaN` in a
|
|
214
|
+
* `points` list or a path `d` voids the whole attribute, and the line then vanishes
|
|
215
|
+
* with nothing logged. */
|
|
216
|
+
function polylinePoints(segment) {
|
|
217
|
+
if (segment.length === 0 || !segment.every(isPlottable)) {
|
|
218
|
+
return '';
|
|
219
|
+
}
|
|
220
|
+
return segment.map((point) => coordinatePair(point)).join(' ');
|
|
221
|
+
}
|
|
222
|
+
function areaPath(segment, baselineY) {
|
|
223
|
+
if (segment.length < 2 ||
|
|
224
|
+
!Number.isFinite(baselineY) ||
|
|
225
|
+
!segment.every(isPlottable)) {
|
|
226
|
+
return '';
|
|
227
|
+
}
|
|
228
|
+
const first = segment[0];
|
|
229
|
+
const last = segment[segment.length - 1];
|
|
230
|
+
const along = segment.map((point) => coordinatePair(point)).join(' L ');
|
|
231
|
+
const baseline = roundTo(baselineY, COORDINATE_DECIMALS);
|
|
232
|
+
return `M ${along} L ${roundTo(last.x, COORDINATE_DECIMALS)},${baseline} L ${roundTo(first.x, COORDINATE_DECIMALS)},${baseline} Z`;
|
|
233
|
+
}
|
|
234
|
+
function isPlottable(point) {
|
|
235
|
+
return Number.isFinite(point.x) && Number.isFinite(point.y);
|
|
236
|
+
}
|
|
237
|
+
function coordinatePair(point) {
|
|
238
|
+
return `${roundTo(point.x, COORDINATE_DECIMALS)},${roundTo(point.y, COORDINATE_DECIMALS)}`;
|
|
239
|
+
}
|
|
240
|
+
/** Show every nth category label. Every label at 60 categories is a grey smear, and
|
|
241
|
+
* the axis stops saying anything at all. */
|
|
242
|
+
function categoryLabelStride(count, maxLabels = MAX_CATEGORY_LABELS) {
|
|
243
|
+
if (!Number.isFinite(count) || count <= 0 || maxLabels < 1) {
|
|
244
|
+
return 1;
|
|
245
|
+
}
|
|
246
|
+
return Math.max(1, Math.ceil(count / maxLabels));
|
|
247
|
+
}
|
|
248
|
+
function paletteIndexFor(slot, index, paletteSize) {
|
|
249
|
+
if (!Number.isFinite(paletteSize) || paletteSize < 1) {
|
|
250
|
+
return 0;
|
|
251
|
+
}
|
|
252
|
+
const chosen = slot !== undefined && Number.isFinite(slot) && slot >= 1
|
|
253
|
+
? Math.floor(slot) - 1
|
|
254
|
+
: index;
|
|
255
|
+
return ((chosen % paletteSize) + paletteSize) % paletteSize;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const defaultValueFormat = (value) => formatValue(value);
|
|
259
|
+
// One dash per palette slot, in the same order the colours are. Slot 1 stays solid so a
|
|
260
|
+
// single-series chart is unchanged by turning patterns on.
|
|
261
|
+
const SERIES_DASH_ARRAYS = [
|
|
262
|
+
'none',
|
|
263
|
+
'7 4',
|
|
264
|
+
'2 3',
|
|
265
|
+
'11 4 2 4',
|
|
266
|
+
'1 4',
|
|
267
|
+
'8 3 2 3',
|
|
268
|
+
'4 2',
|
|
269
|
+
'14 5',
|
|
270
|
+
];
|
|
271
|
+
function baselineOf(plot) {
|
|
272
|
+
return plot.top + plot.height;
|
|
273
|
+
}
|
|
274
|
+
class LineChartComponent {
|
|
275
|
+
/** X labels. Every series' `data` is read against this length. */
|
|
276
|
+
categories = input.required(...(ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []));
|
|
277
|
+
/** One line per entry. Every series is read against `categories`, so a series longer than it
|
|
278
|
+
* loses its tail and a shorter one ends early. */
|
|
279
|
+
series = input.required(...(ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []));
|
|
280
|
+
/** How a secondary axis relates to the primary one. */
|
|
281
|
+
yAxisMode = input('rounded', ...(ngDevMode ? [{ debugName: "yAxisMode" }] : /* istanbul ignore next */ []));
|
|
282
|
+
/** Draws a dot at every reading. Off, the dots appear on hover and on focus only. */
|
|
283
|
+
showMarkers = input(true, { ...(ngDevMode ? { debugName: "showMarkers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
284
|
+
/** Makes every reading focusable and clickable. A series drawn without markers grows invisible
|
|
285
|
+
* ones so there is something to land on; they appear on hover and on focus.
|
|
286
|
+
*
|
|
287
|
+
* The click output fires whether or not this is set, so a consumer that binds the output and
|
|
288
|
+
* forgets the flag still receives every click. */
|
|
289
|
+
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
290
|
+
/** The point that was clicked, or activated with Enter or Space. Fires whether or not
|
|
291
|
+
* `interactive` is set. */
|
|
292
|
+
pointClicked = output();
|
|
293
|
+
/** What a `null` reading draws. The default refuses to assert that a missing
|
|
294
|
+
* reading is a zero. */
|
|
295
|
+
gaps = input('break', ...(ngDevMode ? [{ debugName: "gaps" }] : /* istanbul ignore next */ []));
|
|
296
|
+
/** How many value-axis ticks to aim for. A hint, not a count: ticks snap to a round step, so
|
|
297
|
+
* the axis may carry one more or one fewer. */
|
|
298
|
+
tickCount = input(LINE_CHART_DEFAULT_TICK_COUNT, { ...(ngDevMode ? { debugName: "tickCount" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
299
|
+
/** Printed above the plot as the chart's visible title, and reused as the annex table's
|
|
300
|
+
* caption. */
|
|
301
|
+
caption = input(null, ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
302
|
+
/** Accessible name. Generated from the data when omitted. */
|
|
303
|
+
summary = input(null, ...(ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []));
|
|
304
|
+
/** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,
|
|
305
|
+
* `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so
|
|
306
|
+
* `'none'` belongs only where the same data is already in a table on the page. */
|
|
307
|
+
dataTable = input('toggle', ...(ngDevMode ? [{ debugName: "dataTable" }] : /* istanbul ignore next */ []));
|
|
308
|
+
/** Draws skeleton marks in place of the data, at the same count, so the chart does not resize
|
|
309
|
+
* when the data lands. */
|
|
310
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
311
|
+
/** Shown in place of the plot when `data` is empty. */
|
|
312
|
+
emptyText = input('No data', ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
313
|
+
/** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,
|
|
314
|
+
* because "the request failed" and "there is nothing to show" read the same to a reader and
|
|
315
|
+
* mean opposite things. */
|
|
316
|
+
error = input(false, { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
317
|
+
/** The message the error state prints. */
|
|
318
|
+
errorText = input('Could not load the data', ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
319
|
+
/** Formats every value the chart prints, the annex table and the generated description
|
|
320
|
+
* included. Defaults to the browser's locale grouping with a K/M/B suffix past four digits. */
|
|
321
|
+
valueFormat = input(defaultValueFormat, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
322
|
+
viewBox = `0 0 ${LINE_CHART_VIEW_WIDTH} ${LINE_CHART_VIEW_HEIGHT}`;
|
|
323
|
+
resolvedSeries = computed(() => {
|
|
324
|
+
const categoryCount = this.categories().length;
|
|
325
|
+
const gaps = this.gaps();
|
|
326
|
+
const patterns = this.patterns();
|
|
327
|
+
return this.series().map((series, index) => {
|
|
328
|
+
const slot = paletteIndexFor(series.slot, index, CHART_SERIES_COLORS.length);
|
|
329
|
+
return {
|
|
330
|
+
series,
|
|
331
|
+
values: alignSeriesValues(series.data, categoryCount, gaps),
|
|
332
|
+
onSecondaryAxis: series.axis === 'secondary',
|
|
333
|
+
color: CHART_SERIES_COLORS[slot],
|
|
334
|
+
dash: patterns ? SERIES_DASH_ARRAYS[slot] : null,
|
|
335
|
+
};
|
|
336
|
+
});
|
|
337
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedSeries" }] : /* istanbul ignore next */ []));
|
|
338
|
+
/** Ids of the series the legend has switched off. Two-way, so a page can drive it from a URL
|
|
339
|
+
* parameter and read back what the reader chose. */
|
|
340
|
+
hiddenSeries = model([], ...(ngDevMode ? [{ debugName: "hiddenSeries" }] : /* istanbul ignore next */ []));
|
|
341
|
+
/** Whether hiding a series re-scales the value axis to what is left. Default `false`: a silent
|
|
342
|
+
* rescale turns a period-over-period comparison into a different claim, and a comparison
|
|
343
|
+
* dashboard is the common case. */
|
|
344
|
+
rescaleOnHide = input(false, { ...(ngDevMode ? { debugName: "rescaleOnHide" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
345
|
+
/** Whether the legend switches series off. Off leaves it a plain key. */
|
|
346
|
+
legendFilters = input(false, { ...(ngDevMode ? { debugName: "legendFilters" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
347
|
+
/** Shown in place of the plot once the legend has switched every series off. Without it the
|
|
348
|
+
* reader is left with an empty grid and nothing saying why. */
|
|
349
|
+
noVisibleSeriesText = input('All series are hidden', ...(ngDevMode ? [{ debugName: "noVisibleSeriesText" }] : /* istanbul ignore next */ []));
|
|
350
|
+
/** Gives every series a dash pattern of its own, so the lines are told apart by shape as well
|
|
351
|
+
* as by colour — WCAG technique G111. Off by default: the shipped palette clears the
|
|
352
|
+
* colour-blind separation threshold on its own, so the patterns are for monochrome print, for a
|
|
353
|
+
* retuned palette, and for a reader who asks for them. */
|
|
354
|
+
patterns = input(false, { ...(ngDevMode ? { debugName: "patterns" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
355
|
+
/** Milliseconds between one series' entrance and the next. `0`, the default, is no stagger at
|
|
356
|
+
* all; `40` is the documented non-zero step. The total is capped, so a long list of series does
|
|
357
|
+
* not crawl in. */
|
|
358
|
+
staggerMs = input(0, { ...(ngDevMode ? { debugName: "staggerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
359
|
+
markStagger(index) {
|
|
360
|
+
return `${staggerDelay(index, this.staggerMs())}ms`;
|
|
361
|
+
}
|
|
362
|
+
highlightedSeries = signal(null, ...(ngDevMode ? [{ debugName: "highlightedSeries" }] : /* istanbul ignore next */ []));
|
|
363
|
+
visibleSeries = computed(() => {
|
|
364
|
+
const hidden = this.hiddenSeries();
|
|
365
|
+
return this.resolvedSeries().filter((entry) => !hidden.includes(entry.series.id));
|
|
366
|
+
}, ...(ngDevMode ? [{ debugName: "visibleSeries" }] : /* istanbul ignore next */ []));
|
|
367
|
+
legendItems = computed(() => this.resolvedSeries().map((entry) => ({
|
|
368
|
+
id: entry.series.id,
|
|
369
|
+
label: entry.series.label,
|
|
370
|
+
color: entry.color,
|
|
371
|
+
})), ...(ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []));
|
|
372
|
+
isDimmed(seriesId) {
|
|
373
|
+
const highlighted = this.highlightedSeries();
|
|
374
|
+
return highlighted !== null && highlighted !== seriesId;
|
|
375
|
+
}
|
|
376
|
+
hasSecondaryAxis = computed(() => this.visibleSeries().some((entry) => entry.onSecondaryAxis), ...(ngDevMode ? [{ debugName: "hasSecondaryAxis" }] : /* istanbul ignore next */ []));
|
|
377
|
+
layout = computed(() => chartLayout(this.yAxisMode(), this.hasSecondaryAxis()), ...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
378
|
+
axes = computed(() => {
|
|
379
|
+
// The axis is scaled from every series unless `rescaleOnHide` says otherwise, so switching one
|
|
380
|
+
// off does not move the gridlines under the ones still drawn.
|
|
381
|
+
const entries = this.rescaleOnHide()
|
|
382
|
+
? this.visibleSeries()
|
|
383
|
+
: this.resolvedSeries();
|
|
384
|
+
const valuesOn = (secondary) => entries
|
|
385
|
+
.filter((entry) => entry.onSecondaryAxis === secondary)
|
|
386
|
+
.map((entry) => entry.values);
|
|
387
|
+
return axisLayout(domainMaxOf(valuesOn(false)), this.hasSecondaryAxis() ? domainMaxOf(valuesOn(true)) : null, this.yAxisMode(), this.tickCount());
|
|
388
|
+
}, ...(ngDevMode ? [{ debugName: "axes" }] : /* istanbul ignore next */ []));
|
|
389
|
+
categoryPositions = computed(() => categoryCenters(this.categories().length, this.layout().primaryPlot), ...(ngDevMode ? [{ debugName: "categoryPositions" }] : /* istanbul ignore next */ []));
|
|
390
|
+
plottedSeries = computed(() => {
|
|
391
|
+
const axes = this.axes();
|
|
392
|
+
const centers = this.categoryPositions();
|
|
393
|
+
return this.visibleSeries().map((entry) => {
|
|
394
|
+
const plot = this.plotFor(entry.onSecondaryAxis);
|
|
395
|
+
const axisMax = entry.onSecondaryAxis && axes.secondary
|
|
396
|
+
? axes.secondary.max
|
|
397
|
+
: axes.primary.max;
|
|
398
|
+
const segments = lineSegments(seriesPoints(entry.values, axisMax, plot, centers));
|
|
399
|
+
const baselineY = plot.top + plot.height;
|
|
400
|
+
return {
|
|
401
|
+
...entry,
|
|
402
|
+
polylines: segments
|
|
403
|
+
.map((segment) => polylinePoints(segment))
|
|
404
|
+
.filter((points) => points.length > 0),
|
|
405
|
+
areaPaths: entry.series.area
|
|
406
|
+
? segments
|
|
407
|
+
.map((segment) => areaPath(segment, baselineY))
|
|
408
|
+
.filter((path) => path.length > 0)
|
|
409
|
+
: [],
|
|
410
|
+
markers: segments.flat(),
|
|
411
|
+
};
|
|
412
|
+
});
|
|
413
|
+
}, ...(ngDevMode ? [{ debugName: "plottedSeries" }] : /* istanbul ignore next */ []));
|
|
414
|
+
primaryTicks = computed(() => this.ticksFor(this.axes().primary.ticks, this.axes().primary.max, false), ...(ngDevMode ? [{ debugName: "primaryTicks" }] : /* istanbul ignore next */ []));
|
|
415
|
+
secondaryTicks = computed(() => {
|
|
416
|
+
const secondary = this.axes().secondary;
|
|
417
|
+
return secondary ? this.ticksFor(secondary.ticks, secondary.max, true) : [];
|
|
418
|
+
}, ...(ngDevMode ? [{ debugName: "secondaryTicks" }] : /* istanbul ignore next */ []));
|
|
419
|
+
/** Drawn only when the two axes do not share the primary's gridlines, and only
|
|
420
|
+
* when the axis has more than the single tick a degenerate domain leaves. */
|
|
421
|
+
showSecondaryGridlines = computed(() => !this.axes().alignedTicks && this.secondaryTicks().length > 1, ...(ngDevMode ? [{ debugName: "showSecondaryGridlines" }] : /* istanbul ignore next */ []));
|
|
422
|
+
stacked = computed(() => this.layout().stacked, ...(ngDevMode ? [{ debugName: "stacked" }] : /* istanbul ignore next */ []));
|
|
423
|
+
categoryLabelY = computed(() => this.layout().categoryLabelY, ...(ngDevMode ? [{ debugName: "categoryLabelY" }] : /* istanbul ignore next */ []));
|
|
424
|
+
/** The category under the pointer, or -1. */
|
|
425
|
+
activeCategory = signal(-1, ...(ngDevMode ? [{ debugName: "activeCategory" }] : /* istanbul ignore next */ []));
|
|
426
|
+
categoryBands = computed(() => bandScale(this.categories().length, this.layout().primaryPlot.width, 0), ...(ngDevMode ? [{ debugName: "categoryBands" }] : /* istanbul ignore next */ []));
|
|
427
|
+
activeBandX = computed(() => this.layout().primaryPlot.left +
|
|
428
|
+
this.categoryBands().position(this.activeCategory()), ...(ngDevMode ? [{ debugName: "activeBandX" }] : /* istanbul ignore next */ []));
|
|
429
|
+
activeBandWidth = computed(() => this.categoryBands().bandWidth, ...(ngDevMode ? [{ debugName: "activeBandWidth" }] : /* istanbul ignore next */ []));
|
|
430
|
+
activeCategoryX = computed(() => this.activeBandX() + this.activeBandWidth() / 2, ...(ngDevMode ? [{ debugName: "activeCategoryX" }] : /* istanbul ignore next */ []));
|
|
431
|
+
onPlotPointer(event) {
|
|
432
|
+
const canvas = event.currentTarget;
|
|
433
|
+
const screen = canvas.getScreenCTM();
|
|
434
|
+
if (!screen) {
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
// Client pixels are not viewBox units — the plot scales to the card's width.
|
|
438
|
+
const point = new DOMPoint(event.clientX, event.clientY).matrixTransform(screen.inverse());
|
|
439
|
+
const plot = this.layout().primaryPlot;
|
|
440
|
+
this.activeCategory.set(this.categoryBands().indexAt(point.x - plot.left));
|
|
441
|
+
this.tooltipOrigin.set({ x: event.clientX, y: event.clientY });
|
|
442
|
+
}
|
|
443
|
+
clearActiveCategory() {
|
|
444
|
+
this.activeCategory.set(-1);
|
|
445
|
+
this.tooltipOrigin.set(null);
|
|
446
|
+
}
|
|
447
|
+
/** Whether the plot opens a tooltip, and for what. `'axis'` names every series at the
|
|
448
|
+
* category under the pointer, which is the reading a multi-series line is compared on;
|
|
449
|
+
* `'item'` names only the marker itself. */
|
|
450
|
+
tooltip = input('axis', ...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
451
|
+
tooltipTemplate = contentChild('dsChartTooltip', ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
|
|
452
|
+
tooltipOrigin = signal(null, ...(ngDevMode ? [{ debugName: "tooltipOrigin" }] : /* istanbul ignore next */ []));
|
|
453
|
+
/** The series focus is on, or -1 for the whole category. A pointer answers for every
|
|
454
|
+
* series at once; a focused marker answers for its own. */
|
|
455
|
+
activeSeries = signal(-1, ...(ngDevMode ? [{ debugName: "activeSeries" }] : /* istanbul ignore next */ []));
|
|
456
|
+
/** One tab stop PER SERIES, keyed by series id — each line is a strand the reader walks with
|
|
457
|
+
* the arrows. WCAG 2.1.1's Understanding is explicit that not every mouse-operable control has
|
|
458
|
+
* to be separately focusable, which is what keeps a 12-category, 2-series plot from being
|
|
459
|
+
* twenty-four stops in the page's tab order. */
|
|
460
|
+
rovingByCategory = signal(new Map(), ...(ngDevMode ? [{ debugName: "rovingByCategory" }] : /* istanbul ignore next */ []));
|
|
461
|
+
isTabStop(seriesId, categoryIndex) {
|
|
462
|
+
return (this.rovingByCategory().get(seriesId) ?? 0) === categoryIndex;
|
|
463
|
+
}
|
|
464
|
+
onMarkerFocus(seriesIndex, categoryIndex, event) {
|
|
465
|
+
if (event.currentTarget instanceof Element) {
|
|
466
|
+
this.tooltipOrigin.set(event.currentTarget);
|
|
467
|
+
}
|
|
468
|
+
this.activeSeries.set(seriesIndex);
|
|
469
|
+
this.activeCategory.set(categoryIndex);
|
|
470
|
+
this.setRoving(seriesIndex, categoryIndex);
|
|
471
|
+
}
|
|
472
|
+
onMarkerNavigation(event, seriesIndex, categoryIndex) {
|
|
473
|
+
const markers = this.plottedSeries()[seriesIndex]?.markers ?? [];
|
|
474
|
+
const positions = markers.map((marker) => marker.categoryIndex);
|
|
475
|
+
const current = positions.indexOf(categoryIndex);
|
|
476
|
+
const next = nextRovingIndex(event.key, current, positions.length);
|
|
477
|
+
if (next === null) {
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
event.preventDefault();
|
|
481
|
+
const nextCategory = positions[next];
|
|
482
|
+
this.setRoving(seriesIndex, nextCategory);
|
|
483
|
+
focusMark(event.currentTarget.closest('svg'), nextCategory, `[data-series-index="${seriesIndex}"]`);
|
|
484
|
+
}
|
|
485
|
+
setRoving(seriesIndex, categoryIndex) {
|
|
486
|
+
const seriesId = this.plottedSeries()[seriesIndex]?.series.id;
|
|
487
|
+
if (seriesId === undefined) {
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
const next = new Map(this.rovingByCategory());
|
|
491
|
+
next.set(seriesId, categoryIndex);
|
|
492
|
+
this.rovingByCategory.set(next);
|
|
493
|
+
}
|
|
494
|
+
onMarkerBlur() {
|
|
495
|
+
this.activeSeries.set(-1);
|
|
496
|
+
this.clearActiveCategory();
|
|
497
|
+
}
|
|
498
|
+
tooltipContext = computed(() => {
|
|
499
|
+
const categoryIndex = this.activeCategory();
|
|
500
|
+
const categories = this.categories();
|
|
501
|
+
if (this.tooltip() === 'none' ||
|
|
502
|
+
categoryIndex < 0 ||
|
|
503
|
+
categoryIndex >= categories.length) {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
const format = this.valueFormat();
|
|
507
|
+
const focusedSeries = this.activeSeries();
|
|
508
|
+
const perSeries = this.tooltip() === 'item' || focusedSeries >= 0
|
|
509
|
+
? this.visibleSeries().slice(Math.max(focusedSeries, 0), Math.max(focusedSeries, 0) + 1)
|
|
510
|
+
: this.visibleSeries();
|
|
511
|
+
return {
|
|
512
|
+
category: categories[categoryIndex],
|
|
513
|
+
entries: perSeries
|
|
514
|
+
.map((entry) => ({ entry, value: entry.values[categoryIndex] }))
|
|
515
|
+
.filter((reading) => typeof reading.value === 'number' &&
|
|
516
|
+
Number.isFinite(reading.value))
|
|
517
|
+
.map(({ entry, value }) => ({
|
|
518
|
+
label: entry.series.label,
|
|
519
|
+
value,
|
|
520
|
+
formatted: format(value),
|
|
521
|
+
color: entry.color,
|
|
522
|
+
})),
|
|
523
|
+
};
|
|
524
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
|
|
525
|
+
plotLeft = computed(() => this.layout().primaryPlot.left, ...(ngDevMode ? [{ debugName: "plotLeft" }] : /* istanbul ignore next */ []));
|
|
526
|
+
plotRight = computed(() => this.layout().primaryPlot.left + this.layout().primaryPlot.width, ...(ngDevMode ? [{ debugName: "plotRight" }] : /* istanbul ignore next */ []));
|
|
527
|
+
primaryTopY = computed(() => this.layout().primaryPlot.top, ...(ngDevMode ? [{ debugName: "primaryTopY" }] : /* istanbul ignore next */ []));
|
|
528
|
+
secondaryTopY = computed(() => this.layout().secondaryPlot.top, ...(ngDevMode ? [{ debugName: "secondaryTopY" }] : /* istanbul ignore next */ []));
|
|
529
|
+
primaryBaselineY = computed(() => baselineOf(this.layout().primaryPlot), ...(ngDevMode ? [{ debugName: "primaryBaselineY" }] : /* istanbul ignore next */ []));
|
|
530
|
+
secondaryBaselineY = computed(() => baselineOf(this.layout().secondaryPlot), ...(ngDevMode ? [{ debugName: "secondaryBaselineY" }] : /* istanbul ignore next */ []));
|
|
531
|
+
primaryLabelX = computed(() => this.layout().primaryPlot.left - LINE_CHART_AXIS_LABEL_GAP, ...(ngDevMode ? [{ debugName: "primaryLabelX" }] : /* istanbul ignore next */ []));
|
|
532
|
+
secondaryLabelX = computed(() => {
|
|
533
|
+
const layout = this.layout();
|
|
534
|
+
return layout.stacked
|
|
535
|
+
? layout.secondaryPlot.left - LINE_CHART_AXIS_LABEL_GAP
|
|
536
|
+
: layout.primaryPlot.left +
|
|
537
|
+
layout.primaryPlot.width +
|
|
538
|
+
LINE_CHART_AXIS_LABEL_GAP;
|
|
539
|
+
}, ...(ngDevMode ? [{ debugName: "secondaryLabelX" }] : /* istanbul ignore next */ []));
|
|
540
|
+
secondaryLabelAnchor = computed(() => this.layout().stacked ? 'end' : 'start', ...(ngDevMode ? [{ debugName: "secondaryLabelAnchor" }] : /* istanbul ignore next */ []));
|
|
541
|
+
categoryLabels = computed(() => {
|
|
542
|
+
const categories = this.categories();
|
|
543
|
+
const centers = this.categoryPositions();
|
|
544
|
+
const stride = categoryLabelStride(categories.length);
|
|
545
|
+
const labels = [];
|
|
546
|
+
for (let index = 0; index < categories.length; index += stride) {
|
|
547
|
+
labels.push({ x: centers[index], text: categories[index] });
|
|
548
|
+
}
|
|
549
|
+
return labels;
|
|
550
|
+
}, ...(ngDevMode ? [{ debugName: "categoryLabels" }] : /* istanbul ignore next */ []));
|
|
551
|
+
tableRows = computed(() => {
|
|
552
|
+
const format = this.valueFormat();
|
|
553
|
+
return this.categories().map((category, index) => ({
|
|
554
|
+
category,
|
|
555
|
+
cells: this.resolvedSeries().map((entry) => {
|
|
556
|
+
const value = entry.values[index];
|
|
557
|
+
return value === null || value === undefined ? '—' : format(value);
|
|
558
|
+
}),
|
|
559
|
+
}));
|
|
560
|
+
}, ...(ngDevMode ? [{ debugName: "tableRows" }] : /* istanbul ignore next */ []));
|
|
561
|
+
accessibleName = computed(() => {
|
|
562
|
+
const summary = this.summary();
|
|
563
|
+
if (summary !== null) {
|
|
564
|
+
return summary;
|
|
565
|
+
}
|
|
566
|
+
const title = this.caption() ?? 'Chart';
|
|
567
|
+
const format = this.valueFormat();
|
|
568
|
+
const categories = this.categories();
|
|
569
|
+
// The pointer belongs to the WHOLE chart, not to each series, or a two-series plot promises
|
|
570
|
+
// the table twice.
|
|
571
|
+
const sentences = this.resolvedSeries().map((entry) => describeSeries(entry.series.label, entry.values.flatMap((value, index) => value === null ? [] : [{ label: categories[index] ?? '', value }]), format, false));
|
|
572
|
+
const pointer = this.dataTable() === 'none' ? '' : ' Full values in the table below.';
|
|
573
|
+
return sentences.length === 0
|
|
574
|
+
? describeSeries(title, [], format, this.dataTable() !== 'none')
|
|
575
|
+
: `${title}. ${sentences.join(' ')}${pointer}`;
|
|
576
|
+
}, ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
|
|
577
|
+
pointOf(entry, marker) {
|
|
578
|
+
return {
|
|
579
|
+
series: entry.series,
|
|
580
|
+
categoryIndex: marker.categoryIndex,
|
|
581
|
+
category: this.categories()[marker.categoryIndex] ?? '',
|
|
582
|
+
value: marker.value,
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
markerLabel(entry, marker) {
|
|
586
|
+
const point = this.pointOf(entry, marker);
|
|
587
|
+
return `${entry.series.label}, ${point.category}, ${this.valueFormat()(marker.value)}`;
|
|
588
|
+
}
|
|
589
|
+
onMarkerKey(entry, marker, event) {
|
|
590
|
+
if (!this.interactive() || event.target !== event.currentTarget) {
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
event.preventDefault();
|
|
594
|
+
this.pointClicked.emit(this.pointOf(entry, marker));
|
|
595
|
+
}
|
|
596
|
+
isEmpty = computed(() => this.series().length === 0 || this.categories().length === 0, ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
597
|
+
showLegend = computed(() => this.series().length > 1, ...(ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []));
|
|
598
|
+
noVisibleSeries = computed(() => this.series().length > 0 && this.visibleSeries().length === 0, ...(ngDevMode ? [{ debugName: "noVisibleSeries" }] : /* istanbul ignore next */ []));
|
|
599
|
+
/** Placeholder legend rows while loading. Follows the real series count so the
|
|
600
|
+
* chart does not resize when the data lands; falls back to three when `series`
|
|
601
|
+
* is still empty. */
|
|
602
|
+
skeletonSeries = computed(() => Array.from({ length: Math.max(this.series().length, 3) }), ...(ngDevMode ? [{ debugName: "skeletonSeries" }] : /* istanbul ignore next */ []));
|
|
603
|
+
plotFor(onSecondaryAxis) {
|
|
604
|
+
const layout = this.layout();
|
|
605
|
+
return onSecondaryAxis && layout.stacked
|
|
606
|
+
? layout.secondaryPlot
|
|
607
|
+
: layout.primaryPlot;
|
|
608
|
+
}
|
|
609
|
+
ticksFor(ticks, axisMax, onSecondaryAxis) {
|
|
610
|
+
const plot = this.plotFor(onSecondaryAxis);
|
|
611
|
+
const step = tickStep(ticks);
|
|
612
|
+
const format = this.valueFormat();
|
|
613
|
+
return ticks.map((value) => ({
|
|
614
|
+
y: valueY(value, axisMax, plot),
|
|
615
|
+
label: format === defaultValueFormat ? formatTick(value, step) : format(value),
|
|
616
|
+
}));
|
|
617
|
+
}
|
|
618
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: LineChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
619
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: LineChartComponent, isStandalone: true, selector: "ds-line-chart", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: true, transformFunction: null }, series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, yAxisMode: { classPropertyName: "yAxisMode", publicName: "yAxisMode", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, gaps: { classPropertyName: "gaps", publicName: "gaps", isSignal: true, isRequired: false, transformFunction: null }, tickCount: { classPropertyName: "tickCount", publicName: "tickCount", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, hiddenSeries: { classPropertyName: "hiddenSeries", publicName: "hiddenSeries", isSignal: true, isRequired: false, transformFunction: null }, rescaleOnHide: { classPropertyName: "rescaleOnHide", publicName: "rescaleOnHide", isSignal: true, isRequired: false, transformFunction: null }, legendFilters: { classPropertyName: "legendFilters", publicName: "legendFilters", isSignal: true, isRequired: false, transformFunction: null }, noVisibleSeriesText: { classPropertyName: "noVisibleSeriesText", publicName: "noVisibleSeriesText", isSignal: true, isRequired: false, transformFunction: null }, patterns: { classPropertyName: "patterns", publicName: "patterns", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked", hiddenSeries: "hiddenSeriesChange" }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<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 {{ errorText() }}\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 {{ emptyText() }}\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 <rect\n class=\"category-band\"\n aria-hidden=\"true\"\n [attr.x]=\"activeBandX()\"\n [attr.y]=\"primaryTopY()\"\n [attr.width]=\"activeBandWidth()\"\n [attr.height]=\"primaryBaselineY() - primaryTopY()\" />\n\n <line\n class=\"cursor-line\"\n aria-hidden=\"true\"\n [attr.x1]=\"activeCategoryX()\"\n [attr.x2]=\"activeCategoryX()\"\n [attr.y1]=\"primaryTopY()\"\n [attr.y2]=\"primaryBaselineY()\" />\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 [attr.stroke-dasharray]=\"entry.dash\"\n animate.leave=\"mark-leave\"\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 (dataTable() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTable() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n 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", styles: [":where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-enter{0%{opacity:0;transform:scale(.94)}}@keyframes ds-chart-mark-exit{to{opacity:0;transform:scale(.94)}}.series-line{transform-box:fill-box;transform-origin:center}.series-line.mark-enter{animation:ds-chart-mark-enter var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-line.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-area{transform-box:fill-box;transform-origin:center}.series-area.mark-enter{animation:ds-chart-mark-enter var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-area.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-marker{transform-box:fill-box;transform-origin:center}.series-marker.mark-enter{animation:ds-chart-mark-enter var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-marker.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.line-chart{--_line-chart-grid-line-color: var(--ds-line-chart-grid-line-color, var(--ds-chart-grid-line-color));--_line-chart-axis-line-color: var(--ds-line-chart-axis-line-color, var(--ds-chart-axis-line-color));--_line-chart-axis-label-color: var(--ds-line-chart-axis-label-color, var(--ds-chart-axis-label-color));--_line-chart-axis-font-size: var(--ds-line-chart-axis-font-size, var(--ds-chart-axis-font-size));--_line-chart-line-width: var(--ds-line-chart-line-width, var(--ds-chart-line-width));--_line-chart-dot-radius: var(--ds-line-chart-dot-radius, var(--ds-chart-dot-radius));--_line-chart-dot-radius-active: var(--ds-line-chart-dot-radius-active, var(--ds-chart-dot-radius-active));--_line-chart-hover-bg-color: var(--ds-line-chart-hover-bg-color, var(--ds-chart-hover-bg-color));--_line-chart-cursor-line-color: var(--ds-line-chart-cursor-line-color, var(--ds-chart-cursor-line-color));--_line-chart-line-width-bold: var( --ds-line-chart-line-width-bold, var(--ds-chart-line-width-bold) );--_line-chart-focus-color: var(--ds-line-chart-focus-color, var(--focus-ring-color));--_line-chart-focus-width: var(--ds-line-chart-focus-width, var(--focus-ring-width));--_line-chart-area-opacity: var(--ds-line-chart-area-opacity, .16);--_line-chart-plot-height: var(--ds-line-chart-plot-height, 240px);--_line-chart-swatch-size: var(--ds-line-chart-swatch-size, 10px);margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{margin:0;color:var(--text-secondary)}.canvas{display:block;inline-size:100%;block-size:auto}.grid-line{stroke:var(--_line-chart-grid-line-color);stroke-width:1}.grid-line.secondary{stroke-dasharray:4 4}.axis-line{stroke:var(--_line-chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_line-chart-axis-label-color);font-size:var(--_line-chart-axis-font-size)}.axis-label{dominant-baseline:middle}.series-area{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-area.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-line{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-line.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-marker.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-area{fill-opacity:var(--_line-chart-area-opacity);stroke:none}.series-line{fill:none;stroke-width:var(--_line-chart-line-width);stroke-linecap:round;stroke-linejoin:round;transition:stroke-width var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.plot:has(.series-line.is-dimmed) .series-line:not(.is-dimmed){stroke-width:var(--_line-chart-line-width-bold)}.series-marker{r:var(--_line-chart-dot-radius)}.category-band{fill:var(--_line-chart-hover-bg-color)}.cursor-line{stroke:var(--_line-chart-cursor-line-color);stroke-width:1}.series-marker{transition:r var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-marker.is-active{r:var(--_line-chart-dot-radius-active)}.series-marker.ghost.is-active{fill-opacity:1}.series-marker.interactive{cursor:pointer;stroke:transparent;stroke-width:24px;vector-effect:non-scaling-stroke}@media(hover:none)and (pointer:coarse){.series-marker.interactive{stroke-width:44px}}.series-marker.ghost{fill-opacity:0}.series-marker.ghost:hover,.series-marker.ghost:focus-visible{fill-opacity:1}@media not (forced-colors:active){.series-marker.interactive:focus-visible{outline:none}}.series-marker.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 1px var(--ds-chart-focus-halo-color)) drop-shadow(0 0 1px var(--ds-chart-focus-halo-color));r:var(--_line-chart-dot-radius-active)}.legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin:var(--space-3) 0 0;padding:0;list-style:none}.legend-item{display:inline-flex;gap:var(--space-2);align-items:center;color:var(--text-secondary);font-size:var(--font-size-xs)}.legend-swatch{flex:none;inline-size:var(--_line-chart-swatch-size);block-size:var(--_line-chart-swatch-size);border-radius:var(--radius-pill)}.skeleton{display:grid}.skeleton-legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin-block-start:var(--space-3)}.empty.is-error{color:var(--error)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate"] }, { kind: "component", type: ChartLegendComponent, selector: "ds-chart-legend", inputs: ["items", "hidden", "toggleable", "highlighted"], outputs: ["hiddenChange", "highlightedChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
620
|
+
}
|
|
621
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: LineChartComponent, decorators: [{
|
|
622
|
+
type: Component,
|
|
623
|
+
args: [{ selector: 'ds-line-chart', standalone: true, imports: [SkeletonComponent, ChartTooltipDirective, ChartLegendComponent], encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<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 {{ errorText() }}\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 {{ emptyText() }}\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 <rect\n class=\"category-band\"\n aria-hidden=\"true\"\n [attr.x]=\"activeBandX()\"\n [attr.y]=\"primaryTopY()\"\n [attr.width]=\"activeBandWidth()\"\n [attr.height]=\"primaryBaselineY() - primaryTopY()\" />\n\n <line\n class=\"cursor-line\"\n aria-hidden=\"true\"\n [attr.x1]=\"activeCategoryX()\"\n [attr.x2]=\"activeCategoryX()\"\n [attr.y1]=\"primaryTopY()\"\n [attr.y2]=\"primaryBaselineY()\" />\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 [attr.stroke-dasharray]=\"entry.dash\"\n animate.leave=\"mark-leave\"\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 (dataTable() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTable() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n 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", styles: [":where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-enter{0%{opacity:0;transform:scale(.94)}}@keyframes ds-chart-mark-exit{to{opacity:0;transform:scale(.94)}}.series-line{transform-box:fill-box;transform-origin:center}.series-line.mark-enter{animation:ds-chart-mark-enter var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-line.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-area{transform-box:fill-box;transform-origin:center}.series-area.mark-enter{animation:ds-chart-mark-enter var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-area.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-marker{transform-box:fill-box;transform-origin:center}.series-marker.mark-enter{animation:ds-chart-mark-enter var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-marker.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.line-chart{--_line-chart-grid-line-color: var(--ds-line-chart-grid-line-color, var(--ds-chart-grid-line-color));--_line-chart-axis-line-color: var(--ds-line-chart-axis-line-color, var(--ds-chart-axis-line-color));--_line-chart-axis-label-color: var(--ds-line-chart-axis-label-color, var(--ds-chart-axis-label-color));--_line-chart-axis-font-size: var(--ds-line-chart-axis-font-size, var(--ds-chart-axis-font-size));--_line-chart-line-width: var(--ds-line-chart-line-width, var(--ds-chart-line-width));--_line-chart-dot-radius: var(--ds-line-chart-dot-radius, var(--ds-chart-dot-radius));--_line-chart-dot-radius-active: var(--ds-line-chart-dot-radius-active, var(--ds-chart-dot-radius-active));--_line-chart-hover-bg-color: var(--ds-line-chart-hover-bg-color, var(--ds-chart-hover-bg-color));--_line-chart-cursor-line-color: var(--ds-line-chart-cursor-line-color, var(--ds-chart-cursor-line-color));--_line-chart-line-width-bold: var( --ds-line-chart-line-width-bold, var(--ds-chart-line-width-bold) );--_line-chart-focus-color: var(--ds-line-chart-focus-color, var(--focus-ring-color));--_line-chart-focus-width: var(--ds-line-chart-focus-width, var(--focus-ring-width));--_line-chart-area-opacity: var(--ds-line-chart-area-opacity, .16);--_line-chart-plot-height: var(--ds-line-chart-plot-height, 240px);--_line-chart-swatch-size: var(--ds-line-chart-swatch-size, 10px);margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{margin:0;color:var(--text-secondary)}.canvas{display:block;inline-size:100%;block-size:auto}.grid-line{stroke:var(--_line-chart-grid-line-color);stroke-width:1}.grid-line.secondary{stroke-dasharray:4 4}.axis-line{stroke:var(--_line-chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_line-chart-axis-label-color);font-size:var(--_line-chart-axis-font-size)}.axis-label{dominant-baseline:middle}.series-area{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-area.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-line{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-line.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-marker.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-area{fill-opacity:var(--_line-chart-area-opacity);stroke:none}.series-line{fill:none;stroke-width:var(--_line-chart-line-width);stroke-linecap:round;stroke-linejoin:round;transition:stroke-width var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.plot:has(.series-line.is-dimmed) .series-line:not(.is-dimmed){stroke-width:var(--_line-chart-line-width-bold)}.series-marker{r:var(--_line-chart-dot-radius)}.category-band{fill:var(--_line-chart-hover-bg-color)}.cursor-line{stroke:var(--_line-chart-cursor-line-color);stroke-width:1}.series-marker{transition:r var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-marker.is-active{r:var(--_line-chart-dot-radius-active)}.series-marker.ghost.is-active{fill-opacity:1}.series-marker.interactive{cursor:pointer;stroke:transparent;stroke-width:24px;vector-effect:non-scaling-stroke}@media(hover:none)and (pointer:coarse){.series-marker.interactive{stroke-width:44px}}.series-marker.ghost{fill-opacity:0}.series-marker.ghost:hover,.series-marker.ghost:focus-visible{fill-opacity:1}@media not (forced-colors:active){.series-marker.interactive:focus-visible{outline:none}}.series-marker.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 1px var(--ds-chart-focus-halo-color)) drop-shadow(0 0 1px var(--ds-chart-focus-halo-color));r:var(--_line-chart-dot-radius-active)}.legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin:var(--space-3) 0 0;padding:0;list-style:none}.legend-item{display:inline-flex;gap:var(--space-2);align-items:center;color:var(--text-secondary);font-size:var(--font-size-xs)}.legend-swatch{flex:none;inline-size:var(--_line-chart-swatch-size);block-size:var(--_line-chart-swatch-size);border-radius:var(--radius-pill)}.skeleton{display:grid}.skeleton-legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin-block-start:var(--space-3)}.empty.is-error{color:var(--error)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}\n"] }]
|
|
624
|
+
}], propDecorators: { categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: true }] }], series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: true }] }], yAxisMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisMode", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }], gaps: [{ type: i0.Input, args: [{ isSignal: true, alias: "gaps", required: false }] }], tickCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "tickCount", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], hiddenSeries: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenSeries", required: false }] }, { type: i0.Output, args: ["hiddenSeriesChange"] }], rescaleOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "rescaleOnHide", required: false }] }], legendFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendFilters", required: false }] }], noVisibleSeriesText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noVisibleSeriesText", required: false }] }], patterns: [{ type: i0.Input, args: [{ isSignal: true, alias: "patterns", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipTemplate: [{ type: i0.ContentChild, args: ['dsChartTooltip', { isSignal: true }] }] } });
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Generated bundle index. Do not edit.
|
|
628
|
+
*/
|
|
629
|
+
|
|
630
|
+
export { LineChartComponent };
|
|
631
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-line-chart.mjs.map
|