@joanroucoux/cairn-ui 0.8.1 → 0.9.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 +105 -0
- package/README.md +2 -0
- package/fesm2022/joanroucoux-cairn-ui-action-bar.mjs +57 -53
- package/fesm2022/joanroucoux-cairn-ui-action-bar.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-alert.mjs +155 -47
- package/fesm2022/joanroucoux-cairn-ui-alert.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-amount.mjs +220 -110
- package/fesm2022/joanroucoux-cairn-ui-amount.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-async.mjs +392 -216
- package/fesm2022/joanroucoux-cairn-ui-async.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-avatar.mjs +145 -68
- package/fesm2022/joanroucoux-cairn-ui-avatar.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-back-link.mjs +87 -47
- package/fesm2022/joanroucoux-cairn-ui-back-link.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-badge.mjs +83 -43
- package/fesm2022/joanroucoux-cairn-ui-badge.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-button.mjs +184 -104
- package/fesm2022/joanroucoux-cairn-ui-button.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-card.mjs +232 -137
- package/fesm2022/joanroucoux-cairn-ui-card.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-choice-chips.mjs +298 -102
- package/fesm2022/joanroucoux-cairn-ui-choice-chips.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-control.mjs +4 -17
- package/fesm2022/joanroucoux-cairn-ui-control.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-delta.mjs +150 -83
- package/fesm2022/joanroucoux-cairn-ui-delta.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-dialog.mjs +508 -471
- package/fesm2022/joanroucoux-cairn-ui-dialog.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-donut.mjs +255 -157
- package/fesm2022/joanroucoux-cairn-ui-donut.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-drawer.mjs +303 -0
- package/fesm2022/joanroucoux-cairn-ui-drawer.mjs.map +1 -0
- package/fesm2022/joanroucoux-cairn-ui-empty.mjs +76 -35
- package/fesm2022/joanroucoux-cairn-ui-empty.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-external-link.mjs +40 -31
- package/fesm2022/joanroucoux-cairn-ui-external-link.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-fact.mjs +188 -79
- package/fesm2022/joanroucoux-cairn-ui-fact.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-field.mjs +309 -173
- package/fesm2022/joanroucoux-cairn-ui-field.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-filter-chips.mjs +165 -87
- package/fesm2022/joanroucoux-cairn-ui-filter-chips.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-group-header.mjs +269 -0
- package/fesm2022/joanroucoux-cairn-ui-group-header.mjs.map +1 -0
- package/fesm2022/joanroucoux-cairn-ui-input.mjs +205 -85
- package/fesm2022/joanroucoux-cairn-ui-input.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-line-chart.mjs +838 -512
- package/fesm2022/joanroucoux-cairn-ui-line-chart.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-menu.mjs +401 -225
- package/fesm2022/joanroucoux-cairn-ui-menu.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-meter.mjs +143 -57
- package/fesm2022/joanroucoux-cairn-ui-meter.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-motion.mjs +367 -399
- package/fesm2022/joanroucoux-cairn-ui-motion.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-nav-item.mjs +73 -44
- package/fesm2022/joanroucoux-cairn-ui-nav-item.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-result-group.mjs +191 -0
- package/fesm2022/joanroucoux-cairn-ui-result-group.mjs.map +1 -0
- package/fesm2022/joanroucoux-cairn-ui-row.mjs +376 -146
- package/fesm2022/joanroucoux-cairn-ui-row.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-segmented.mjs +183 -81
- package/fesm2022/joanroucoux-cairn-ui-segmented.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-select-pill.mjs +233 -0
- package/fesm2022/joanroucoux-cairn-ui-select-pill.mjs.map +1 -0
- package/fesm2022/joanroucoux-cairn-ui-select.mjs +121 -67
- package/fesm2022/joanroucoux-cairn-ui-select.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-skeleton.mjs +129 -51
- package/fesm2022/joanroucoux-cairn-ui-skeleton.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-stale-link.mjs +80 -39
- package/fesm2022/joanroucoux-cairn-ui-stale-link.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-stat.mjs +85 -55
- package/fesm2022/joanroucoux-cairn-ui-stat.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-switch.mjs +48 -35
- package/fesm2022/joanroucoux-cairn-ui-switch.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-tab-bar.mjs +113 -69
- package/fesm2022/joanroucoux-cairn-ui-tab-bar.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-table.mjs +1036 -310
- package/fesm2022/joanroucoux-cairn-ui-table.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-toast.mjs +240 -127
- package/fesm2022/joanroucoux-cairn-ui-toast.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui.mjs +0 -4
- package/package.json +17 -1
- package/styles/motion.css +1 -13
- package/styles/tokens.css +35 -64
- package/types/joanroucoux-cairn-ui-action-bar.d.ts +9 -14
- package/types/joanroucoux-cairn-ui-alert.d.ts +29 -15
- package/types/joanroucoux-cairn-ui-amount.d.ts +64 -32
- package/types/joanroucoux-cairn-ui-async.d.ts +85 -38
- package/types/joanroucoux-cairn-ui-avatar.d.ts +34 -22
- package/types/joanroucoux-cairn-ui-back-link.d.ts +20 -15
- package/types/joanroucoux-cairn-ui-badge.d.ts +22 -14
- package/types/joanroucoux-cairn-ui-button.d.ts +36 -18
- package/types/joanroucoux-cairn-ui-card.d.ts +48 -23
- package/types/joanroucoux-cairn-ui-choice-chips.d.ts +91 -35
- package/types/joanroucoux-cairn-ui-control.d.ts +9 -18
- package/types/joanroucoux-cairn-ui-delta.d.ts +46 -24
- package/types/joanroucoux-cairn-ui-dialog.d.ts +124 -57
- package/types/joanroucoux-cairn-ui-donut.d.ts +83 -46
- package/types/joanroucoux-cairn-ui-drawer.d.ts +73 -0
- package/types/joanroucoux-cairn-ui-empty.d.ts +20 -13
- package/types/joanroucoux-cairn-ui-external-link.d.ts +6 -10
- package/types/joanroucoux-cairn-ui-fact.d.ts +49 -25
- package/types/joanroucoux-cairn-ui-field.d.ts +72 -49
- package/types/joanroucoux-cairn-ui-filter-chips.d.ts +35 -20
- package/types/joanroucoux-cairn-ui-group-header.d.ts +58 -0
- package/types/joanroucoux-cairn-ui-input.d.ts +59 -37
- package/types/joanroucoux-cairn-ui-line-chart.d.ts +199 -89
- package/types/joanroucoux-cairn-ui-menu.d.ts +81 -44
- package/types/joanroucoux-cairn-ui-meter.d.ts +44 -22
- package/types/joanroucoux-cairn-ui-motion.d.ts +61 -75
- package/types/joanroucoux-cairn-ui-nav-item.d.ts +15 -13
- package/types/joanroucoux-cairn-ui-result-group.d.ts +52 -0
- package/types/joanroucoux-cairn-ui-row.d.ts +79 -37
- package/types/joanroucoux-cairn-ui-segmented.d.ts +51 -27
- package/types/joanroucoux-cairn-ui-select-pill.d.ts +52 -0
- package/types/joanroucoux-cairn-ui-select.d.ts +28 -18
- package/types/joanroucoux-cairn-ui-skeleton.d.ts +35 -18
- package/types/joanroucoux-cairn-ui-stale-link.d.ts +23 -16
- package/types/joanroucoux-cairn-ui-stat.d.ts +26 -21
- package/types/joanroucoux-cairn-ui-switch.d.ts +7 -11
- package/types/joanroucoux-cairn-ui-tab-bar.d.ts +20 -17
- package/types/joanroucoux-cairn-ui-table.d.ts +251 -89
- package/types/joanroucoux-cairn-ui-toast.d.ts +46 -36
- package/types/joanroucoux-cairn-ui.d.ts +1 -2
- package/fesm2022/joanroucoux-cairn-ui.mjs.map +0 -1
|
@@ -1,553 +1,718 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { injectReducedMotion } from
|
|
4
|
-
import { scaleLinear } from
|
|
5
|
-
import { curveMonotoneX, line } from
|
|
6
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, DestroyRef, ElementRef, afterNextRender, booleanAttribute, computed, effect, inject, input, signal, untracked, viewChild } from "@angular/core";
|
|
3
|
+
import { injectReducedMotion } from "@joanroucoux/cairn-ui/motion";
|
|
4
|
+
import { scaleLinear } from "d3-scale";
|
|
5
|
+
import { curveMonotoneX, line } from "d3-shape";
|
|
7
6
|
const axisTicks = (points, maxTicks = 5) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
for (let tick = 0; tick < count; tick++) {
|
|
15
|
-
indexes.add(Math.round(tick * step));
|
|
16
|
-
}
|
|
17
|
-
return [...indexes].sort((a, b) => a - b).map((index) => points[index]);
|
|
7
|
+
if (points.length <= maxTicks) return [...points];
|
|
8
|
+
const count = Math.max(3, Math.min(maxTicks, points.length));
|
|
9
|
+
const step = (points.length - 1) / (count - 1);
|
|
10
|
+
const indexes = /* @__PURE__ */ new Set();
|
|
11
|
+
for (let tick = 0; tick < count; tick++) indexes.add(Math.round(tick * step));
|
|
12
|
+
return [...indexes].sort((a, b) => a - b).map((index) => points[index]);
|
|
18
13
|
};
|
|
19
14
|
const isCoreTick = (index, count) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const middle = Math.floor((count - 1) / 2);
|
|
24
|
-
return index === 0 || index === count - 1 || index === middle;
|
|
15
|
+
if (count <= 3) return true;
|
|
16
|
+
const middle = Math.floor((count - 1) / 2);
|
|
17
|
+
return index === 0 || index === count - 1 || index === middle;
|
|
25
18
|
};
|
|
26
19
|
const firstOfEachRun = (labels, included) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return distinct;
|
|
35
|
-
});
|
|
20
|
+
let previous = null;
|
|
21
|
+
return labels.map((text, index) => {
|
|
22
|
+
if (!included(index)) return false;
|
|
23
|
+
const distinct = text !== previous;
|
|
24
|
+
previous = text;
|
|
25
|
+
return distinct;
|
|
26
|
+
});
|
|
36
27
|
};
|
|
37
28
|
const tickLabels = (ticks, format, mode) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
29
|
+
const labels = ticks.map((tick) => format(tick.t));
|
|
30
|
+
const count = labels.length;
|
|
31
|
+
const core = (index) => isCoreTick(index, count);
|
|
32
|
+
const everyTick = firstOfEachRun(labels, () => true);
|
|
33
|
+
const coreTicks = firstOfEachRun(labels, core);
|
|
34
|
+
return labels.map((text, index) => {
|
|
35
|
+
const wide = mode === 3 ? coreTicks[index] : everyTick[index];
|
|
36
|
+
const narrow = coreTicks[index];
|
|
37
|
+
if (!wide && !narrow) return null;
|
|
38
|
+
return {
|
|
39
|
+
text,
|
|
40
|
+
classes: mode === "auto" ? `${narrow ? "" : "max-sm:hidden"} ${wide ? "" : "sm:hidden"}`.trim() : wide ? "" : "hidden"
|
|
41
|
+
};
|
|
42
|
+
});
|
|
52
43
|
};
|
|
53
|
-
|
|
54
44
|
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
55
45
|
const nearestPointIndex = (points, x) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
46
|
+
let nearest = 0;
|
|
47
|
+
let nearestDistance = Infinity;
|
|
48
|
+
points.forEach((point, index) => {
|
|
49
|
+
const distance = Math.abs(point.x - x);
|
|
50
|
+
if (distance < nearestDistance) {
|
|
51
|
+
nearestDistance = distance;
|
|
52
|
+
nearest = index;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return nearest;
|
|
66
56
|
};
|
|
67
57
|
const navigateIndex = (key, current, last) => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
58
|
+
switch (key) {
|
|
59
|
+
case "ArrowRight": return {
|
|
60
|
+
index: clamp((current ?? -1) + 1, 0, last),
|
|
61
|
+
preventDefault: true
|
|
62
|
+
};
|
|
63
|
+
case "ArrowLeft": return {
|
|
64
|
+
index: clamp((current ?? last + 1) - 1, 0, last),
|
|
65
|
+
preventDefault: true
|
|
66
|
+
};
|
|
67
|
+
case "Home": return {
|
|
68
|
+
index: 0,
|
|
69
|
+
preventDefault: true
|
|
70
|
+
};
|
|
71
|
+
case "End": return {
|
|
72
|
+
index: last,
|
|
73
|
+
preventDefault: true
|
|
74
|
+
};
|
|
75
|
+
case "Escape": return {
|
|
76
|
+
index: null,
|
|
77
|
+
preventDefault: false
|
|
78
|
+
};
|
|
79
|
+
default: return null;
|
|
80
|
+
}
|
|
82
81
|
};
|
|
83
|
-
|
|
84
|
-
const START_LABEL_HEIGHT = 16;
|
|
85
82
|
const AXIS_ROW = 17;
|
|
86
|
-
const TOOLTIP_SIZES = ['compact', 'large'];
|
|
87
83
|
const TOOLTIP_CLASSES = {
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
compact: {
|
|
85
|
+
box: "-top-3 px-2.5",
|
|
86
|
+
value: "text-label",
|
|
87
|
+
delta: "text-caption"
|
|
88
|
+
},
|
|
89
|
+
large: {
|
|
90
|
+
box: "top-0 px-3",
|
|
91
|
+
value: "text-body",
|
|
92
|
+
delta: "text-label"
|
|
93
|
+
}
|
|
90
94
|
};
|
|
91
95
|
const PLOT_PADDING_RATIO = 16 / 240;
|
|
92
96
|
const SPARKLINE_PADDING = 4;
|
|
93
97
|
const START_LABEL_BASELINE_OFFSET = 4;
|
|
94
98
|
const TOOLTIP_OFFSET = 14;
|
|
95
|
-
const TOOLTIP_FLIP_RATIO =
|
|
99
|
+
const TOOLTIP_FLIP_RATIO = .55;
|
|
96
100
|
const plotHeightFor = (height, sparkline, axisGap, wide) => sparkline ? height : Math.max(height - resolveGap(axisGap, wide) - AXIS_ROW, 1);
|
|
97
101
|
const plotPaddingFor = (plotHeight, sparkline) => sparkline ? SPARKLINE_PADDING : plotHeight * PLOT_PADDING_RATIO;
|
|
98
102
|
const startLabelBaseline = (boxBottom) => boxBottom - START_LABEL_BASELINE_OFFSET;
|
|
99
103
|
const tooltipPlacement = (ratio) => {
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
const flipped = ratio > TOOLTIP_FLIP_RATIO;
|
|
105
|
+
return `left: calc(${ratio * 100}% ${flipped ? "-" : "+"} ${TOOLTIP_OFFSET}px); transform: ${flipped ? "translateX(-100%)" : "none"}`;
|
|
102
106
|
};
|
|
103
|
-
const deltaTone = (delta) => delta > 0 ?
|
|
104
|
-
const DEFAULT_WIDTH = 640;
|
|
105
|
-
const DEFAULT_HEIGHT = 240;
|
|
107
|
+
const deltaTone = (delta) => delta > 0 ? "text-(--positive)" : delta < 0 ? "text-(--negative)" : "text-(--muted-foreground)";
|
|
106
108
|
const identityValue = (value) => `${value}`;
|
|
107
|
-
const identityDelta = (delta) => `${delta > 0 ?
|
|
109
|
+
const identityDelta = (delta) => `${delta > 0 ? "+" : ""}${delta}`;
|
|
108
110
|
const identityTime = (time) => new Date(time).toISOString();
|
|
109
|
-
const parseAxisTicks = (value) => value ===
|
|
110
|
-
const resolveGap = (gap, wide) =>
|
|
111
|
-
const resolveTooltip = (size, wide) => size ===
|
|
111
|
+
const parseAxisTicks = (value) => value === "auto" ? "auto" : Number(value);
|
|
112
|
+
const resolveGap = (gap, wide) => gap === "auto" ? wide ? 16 : 12 : gap;
|
|
113
|
+
const resolveTooltip = (size, wide) => size === "auto" ? wide ? "large" : "compact" : size;
|
|
112
114
|
const tooltipClassesFor = (size, wide) => TOOLTIP_CLASSES[resolveTooltip(size, wide)];
|
|
113
|
-
|
|
114
115
|
const CURVE = curveMonotoneX;
|
|
115
116
|
const buildGeometry = (points, width, height, padding = {}) => {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
plotTop,
|
|
146
|
-
};
|
|
117
|
+
if (points.length === 0) return null;
|
|
118
|
+
const { x: paddingX = 4, top: paddingTop = 4, bottom: paddingBottom = 4 } = padding;
|
|
119
|
+
const plotTop = paddingTop;
|
|
120
|
+
const plotBottom = height - paddingBottom;
|
|
121
|
+
const times = points.map((point) => point.t);
|
|
122
|
+
const values = points.map((point) => point.v);
|
|
123
|
+
const minValue = Math.min(...values);
|
|
124
|
+
const maxValue = Math.max(...values);
|
|
125
|
+
const x = scaleLinear().domain([Math.min(...times), Math.max(...times)]).range([paddingX, width - paddingX]);
|
|
126
|
+
const y = minValue === maxValue ? () => (plotTop + plotBottom) / 2 : scaleLinear().domain([minValue, maxValue]).range([plotBottom, plotTop]);
|
|
127
|
+
const toX = (point) => points.length === 1 ? paddingX : x(point.t);
|
|
128
|
+
const lineGenerator = line().x(toX).y((point) => y(point.v)).curve(CURVE);
|
|
129
|
+
const first = points[0];
|
|
130
|
+
const last = points.at(-1);
|
|
131
|
+
return {
|
|
132
|
+
line: lineGenerator(points),
|
|
133
|
+
end: {
|
|
134
|
+
x: toX(last),
|
|
135
|
+
y: y(last.v)
|
|
136
|
+
},
|
|
137
|
+
start: { y: y(first.v) },
|
|
138
|
+
points: points.map((point) => ({
|
|
139
|
+
...point,
|
|
140
|
+
x: toX(point),
|
|
141
|
+
y: y(point.v)
|
|
142
|
+
})),
|
|
143
|
+
plotBottom,
|
|
144
|
+
plotTop
|
|
145
|
+
};
|
|
147
146
|
};
|
|
148
|
-
|
|
149
147
|
const observeSize = (element, destroyRef, measured) => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
148
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
149
|
+
const { clientWidth: width, clientHeight: height } = element;
|
|
150
|
+
if (width > 0 && height > 0) measured({
|
|
151
|
+
width,
|
|
152
|
+
height
|
|
153
|
+
});
|
|
154
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
155
|
+
if (entry) measured({
|
|
156
|
+
width: entry.contentRect.width,
|
|
157
|
+
height: entry.contentRect.height
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
observer.observe(element);
|
|
161
|
+
destroyRef.onDestroy(() => observer.disconnect());
|
|
164
162
|
};
|
|
165
|
-
|
|
166
163
|
const LINE_GAP = 6;
|
|
167
164
|
const COLLISION_MARGIN = 6;
|
|
168
165
|
const EDGE_TOLERANCE = 3;
|
|
169
166
|
const candidateSlots = (startY, box, label) => {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
167
|
+
const aboveTop = startY - LINE_GAP - label.height;
|
|
168
|
+
const aboveBottom = startY - LINE_GAP;
|
|
169
|
+
const belowTop = startY + LINE_GAP;
|
|
170
|
+
const belowBottom = startY + LINE_GAP + label.height;
|
|
171
|
+
return [
|
|
172
|
+
{
|
|
173
|
+
anchor: "end",
|
|
174
|
+
x: box.width,
|
|
175
|
+
y: aboveBottom,
|
|
176
|
+
top: aboveTop,
|
|
177
|
+
bottom: aboveBottom
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
anchor: "end",
|
|
181
|
+
x: box.width,
|
|
182
|
+
y: belowBottom,
|
|
183
|
+
top: belowTop,
|
|
184
|
+
bottom: belowBottom
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
anchor: "start",
|
|
188
|
+
x: 0,
|
|
189
|
+
y: aboveBottom,
|
|
190
|
+
top: aboveTop,
|
|
191
|
+
bottom: aboveBottom
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
anchor: "start",
|
|
195
|
+
x: 0,
|
|
196
|
+
y: belowBottom,
|
|
197
|
+
top: belowTop,
|
|
198
|
+
bottom: belowBottom
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
anchor: "end",
|
|
202
|
+
x: box.width,
|
|
203
|
+
y: label.height,
|
|
204
|
+
top: 0,
|
|
205
|
+
bottom: label.height
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
anchor: "start",
|
|
209
|
+
x: 0,
|
|
210
|
+
y: label.height,
|
|
211
|
+
top: 0,
|
|
212
|
+
bottom: label.height
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
anchor: "end",
|
|
216
|
+
x: box.width,
|
|
217
|
+
y: box.height,
|
|
218
|
+
top: box.height - label.height,
|
|
219
|
+
bottom: box.height
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
anchor: "start",
|
|
223
|
+
x: 0,
|
|
224
|
+
y: box.height,
|
|
225
|
+
top: box.height - label.height,
|
|
226
|
+
bottom: box.height
|
|
227
|
+
}
|
|
228
|
+
].filter((slot) => slot.top >= -3 && slot.bottom <= box.height + EDGE_TOLERANCE);
|
|
185
229
|
};
|
|
186
230
|
const hitsFor = (slot, label, points) => {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
231
|
+
const left = slot.anchor === "end" ? slot.x - label.width : slot.x;
|
|
232
|
+
const right = slot.anchor === "end" ? slot.x : slot.x + label.width;
|
|
233
|
+
const top = slot.top - COLLISION_MARGIN;
|
|
234
|
+
const bottom = slot.bottom + COLLISION_MARGIN;
|
|
235
|
+
return points.filter((point) => point.x >= left && point.x <= right && point.y >= top && point.y <= bottom).length;
|
|
192
236
|
};
|
|
193
237
|
const placeStartLabel = (points, startY, box, label) => {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
238
|
+
let best = null;
|
|
239
|
+
for (const slot of candidateSlots(startY, box, label)) {
|
|
240
|
+
const hits = hitsFor(slot, label, points);
|
|
241
|
+
if (!best || hits < best.hits) best = {
|
|
242
|
+
slot,
|
|
243
|
+
hits
|
|
244
|
+
};
|
|
245
|
+
if (hits === 0) break;
|
|
246
|
+
}
|
|
247
|
+
if (!best) return {
|
|
248
|
+
anchor: "end",
|
|
249
|
+
x: box.width,
|
|
250
|
+
y: label.height
|
|
251
|
+
};
|
|
252
|
+
const { anchor, x, y } = best.slot;
|
|
253
|
+
return {
|
|
254
|
+
anchor,
|
|
255
|
+
x,
|
|
256
|
+
y
|
|
257
|
+
};
|
|
209
258
|
};
|
|
210
|
-
|
|
211
|
-
const TRANSITION_SAMPLES = 120;
|
|
212
|
-
const TRANSITION_DURATION = 260;
|
|
213
259
|
const easeOutQuint = (t) => 1 - (1 - t) ** 5;
|
|
214
260
|
const durationFrom = (value) => {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
261
|
+
const match = /^\s*([\d.]+)(ms|s)\s*$/.exec(value);
|
|
262
|
+
const duration = match ? Number(match[1]) * (match[2] === "s" ? 1e3 : 1) : NaN;
|
|
263
|
+
return Number.isFinite(duration) ? duration : 260;
|
|
218
264
|
};
|
|
219
|
-
const sameSeries = (a, b) => a === b ||
|
|
220
|
-
(b !== null &&
|
|
221
|
-
a.length === b.length &&
|
|
222
|
-
a.every((point, index) => point.t === b[index].t && point.v === b[index].v));
|
|
265
|
+
const sameSeries = (a, b) => a === b || b !== null && a.length === b.length && a.every((point, index) => point.t === b[index].t && point.v === b[index].v);
|
|
223
266
|
const monotoneTangents = (xs, ys) => {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
267
|
+
const n = xs.length;
|
|
268
|
+
const slopes = [];
|
|
269
|
+
for (let i = 0; i < n - 1; i++) {
|
|
270
|
+
const dx = xs[i + 1] - xs[i];
|
|
271
|
+
slopes.push(dx === 0 ? 0 : (ys[i + 1] - ys[i]) / dx);
|
|
272
|
+
}
|
|
273
|
+
const tangents = new Array(n).fill(0);
|
|
274
|
+
tangents[0] = slopes[0];
|
|
275
|
+
tangents[n - 1] = slopes[n - 2];
|
|
276
|
+
for (let i = 1; i < n - 1; i++) {
|
|
277
|
+
const a = slopes[i - 1];
|
|
278
|
+
const b = slopes[i];
|
|
279
|
+
tangents[i] = a * b <= 0 ? 0 : (a + b) / 2;
|
|
280
|
+
}
|
|
281
|
+
for (let i = 0; i < n - 1; i++) {
|
|
282
|
+
const slope = slopes[i];
|
|
283
|
+
if (slope === 0) {
|
|
284
|
+
tangents[i] = 0;
|
|
285
|
+
tangents[i + 1] = 0;
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
const a = tangents[i] / slope;
|
|
289
|
+
const b = tangents[i + 1] / slope;
|
|
290
|
+
const s = a * a + b * b;
|
|
291
|
+
if (s > 9) {
|
|
292
|
+
const t = 3 / Math.sqrt(s);
|
|
293
|
+
tangents[i] = t * a * slope;
|
|
294
|
+
tangents[i + 1] = t * b * slope;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return tangents;
|
|
255
298
|
};
|
|
256
299
|
const sampleMonotone = (points, sampleXs) => {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
const m1 = tangents[segment + 1];
|
|
275
|
-
return (2 * f3 - 3 * f2 + 1) * y0 + (f3 - 2 * f2 + f) * m0 * dx + (-2 * f3 + 3 * f2) * y1 + (f3 - f2) * m1 * dx;
|
|
276
|
-
});
|
|
300
|
+
const xs = points.map((point) => point.x);
|
|
301
|
+
const ys = points.map((point) => point.y);
|
|
302
|
+
const tangents = monotoneTangents(xs, ys);
|
|
303
|
+
let segment = 0;
|
|
304
|
+
return sampleXs.map((x) => {
|
|
305
|
+
while (segment < xs.length - 2 && x > xs[segment + 1]) segment++;
|
|
306
|
+
const x0 = xs[segment];
|
|
307
|
+
const dx = xs[segment + 1] - x0;
|
|
308
|
+
const f = dx === 0 ? 0 : (x - x0) / dx;
|
|
309
|
+
const f2 = f * f;
|
|
310
|
+
const f3 = f2 * f;
|
|
311
|
+
const y0 = ys[segment];
|
|
312
|
+
const y1 = ys[segment + 1];
|
|
313
|
+
const m0 = tangents[segment];
|
|
314
|
+
const m1 = tangents[segment + 1];
|
|
315
|
+
return (2 * f3 - 3 * f2 + 1) * y0 + (f3 - 2 * f2 + f) * m0 * dx + (-2 * f3 + 3 * f2) * y1 + (f3 - f2) * m1 * dx;
|
|
316
|
+
});
|
|
277
317
|
};
|
|
278
|
-
const polyline = (xs, ys) => xs.map((x, index) => `${index === 0 ?
|
|
318
|
+
const polyline = (xs, ys) => xs.map((x, index) => `${index === 0 ? "M" : "L"}${x.toFixed(2)},${ys[index].toFixed(2)}`).join(" ");
|
|
279
319
|
const shapeTransition = (from, to) => {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
320
|
+
const left = to[0].x;
|
|
321
|
+
const right = to.at(-1).x;
|
|
322
|
+
const xs = Array.from({ length: 120 }, (_, index) => left + (right - left) * index / 119);
|
|
323
|
+
return {
|
|
324
|
+
xs,
|
|
325
|
+
from: sampleMonotone(from, xs),
|
|
326
|
+
to: sampleMonotone(to, xs)
|
|
327
|
+
};
|
|
284
328
|
};
|
|
285
329
|
const shapeAt = (transition, progress) => transition.from.map((fromY, index) => fromY + (transition.to[index] - fromY) * progress);
|
|
286
330
|
const animateShape = (from, to, duration, draw, done) => {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
331
|
+
const transition = shapeTransition(from, to);
|
|
332
|
+
const start = performance.now();
|
|
333
|
+
let frame = 0;
|
|
334
|
+
const step = (now) => {
|
|
335
|
+
const t = Math.min(1, Math.max(0, (now - start) / duration));
|
|
336
|
+
if (t === 1) {
|
|
337
|
+
done();
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const ys = shapeAt(transition, easeOutQuint(t));
|
|
341
|
+
draw(transition.xs.map((x, index) => ({
|
|
342
|
+
x,
|
|
343
|
+
y: ys[index]
|
|
344
|
+
})), polyline(transition.xs, ys));
|
|
345
|
+
frame = requestAnimationFrame(step);
|
|
346
|
+
};
|
|
347
|
+
frame = requestAnimationFrame(step);
|
|
348
|
+
return () => cancelAnimationFrame(frame);
|
|
302
349
|
};
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
if (geometry) {
|
|
360
|
-
this.#draw(geometry.points, geometry.line, geometry.end);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
#draw(shape, line, end) {
|
|
364
|
-
this.#drawn = shape;
|
|
365
|
-
this.#view.draw(line, end);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
const WIDE_QUERY = '(min-width: 64rem)';
|
|
350
|
+
var ShapeMotion = class {
|
|
351
|
+
#view;
|
|
352
|
+
#points = null;
|
|
353
|
+
#rangeKey = null;
|
|
354
|
+
#target = null;
|
|
355
|
+
#held = null;
|
|
356
|
+
#drawn = null;
|
|
357
|
+
#stop = null;
|
|
358
|
+
constructor(view) {
|
|
359
|
+
this.#view = view;
|
|
360
|
+
}
|
|
361
|
+
follow(points, geometry, options) {
|
|
362
|
+
const newSeries = !sameSeries(points, this.#points);
|
|
363
|
+
const newRange = options.rangeKey === null || options.rangeKey !== this.#rangeKey;
|
|
364
|
+
this.#points = points;
|
|
365
|
+
if (newSeries) this.#rangeKey = options.rangeKey;
|
|
366
|
+
if (this.#stop && !newSeries && !options.reduced && geometry?.line === this.#target?.line) {
|
|
367
|
+
this.#target = geometry;
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
const from = this.#drawn;
|
|
371
|
+
const held = this.#held ?? this.#target;
|
|
372
|
+
this.#target = geometry;
|
|
373
|
+
this.stop();
|
|
374
|
+
if (!newSeries || !newRange || !geometry || !from || from.length < 2 || geometry.points.length < 2 || options.reduced) {
|
|
375
|
+
this.#settle(geometry);
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
const duration = options.duration();
|
|
379
|
+
if (duration <= 0) {
|
|
380
|
+
this.#settle(geometry);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
this.#hold(held);
|
|
384
|
+
this.#stop = animateShape(from, geometry.points, duration, (shape, line) => this.#draw(shape, line, shape.at(-1)), () => this.#settle(geometry));
|
|
385
|
+
}
|
|
386
|
+
stop() {
|
|
387
|
+
this.#stop?.();
|
|
388
|
+
this.#stop = null;
|
|
389
|
+
}
|
|
390
|
+
#hold(geometry) {
|
|
391
|
+
this.#held = geometry;
|
|
392
|
+
this.#view.hold(geometry);
|
|
393
|
+
}
|
|
394
|
+
#settle(geometry) {
|
|
395
|
+
this.#stop = null;
|
|
396
|
+
this.#hold(null);
|
|
397
|
+
this.#drawn = null;
|
|
398
|
+
if (geometry) this.#draw(geometry.points, geometry.line, geometry.end);
|
|
399
|
+
}
|
|
400
|
+
#draw(shape, line, end) {
|
|
401
|
+
this.#drawn = shape;
|
|
402
|
+
this.#view.draw(line, end);
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
const WIDE_QUERY = "(min-width: 64rem)";
|
|
370
406
|
const wideViewport = () => {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
return wide;
|
|
407
|
+
const query = typeof matchMedia === "function" ? matchMedia(WIDE_QUERY) : null;
|
|
408
|
+
const wide = signal(query?.matches ?? false, ...ngDevMode ? [{ debugName: "wide" }] : /* istanbul ignore next */ []);
|
|
409
|
+
const onChange = (event) => wide.set(event.matches);
|
|
410
|
+
if (query) {
|
|
411
|
+
query.onchange = onChange;
|
|
412
|
+
inject(DestroyRef).onDestroy(() => query.onchange = null);
|
|
413
|
+
}
|
|
414
|
+
return wide;
|
|
380
415
|
};
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
416
|
+
var UiLineChart = class UiLineChart {
|
|
417
|
+
points = input.required(...ngDevMode ? [{ debugName: "points" }] : /* istanbul ignore next */ []);
|
|
418
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
419
|
+
valueFormat = input(identityValue, ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
|
|
420
|
+
tooltipFormat = input(...ngDevMode ? [void 0, { debugName: "tooltipFormat" }] : /* istanbul ignore next */ []);
|
|
421
|
+
deltaFormat = input(identityDelta, ...ngDevMode ? [{ debugName: "deltaFormat" }] : /* istanbul ignore next */ []);
|
|
422
|
+
deltaSuffix = input("", ...ngDevMode ? [{ debugName: "deltaSuffix" }] : /* istanbul ignore next */ []);
|
|
423
|
+
timeFormat = input(identityTime, ...ngDevMode ? [{ debugName: "timeFormat" }] : /* istanbul ignore next */ []);
|
|
424
|
+
axisFormat = input(identityTime, ...ngDevMode ? [{ debugName: "axisFormat" }] : /* istanbul ignore next */ []);
|
|
425
|
+
startLabel = input("", ...ngDevMode ? [{ debugName: "startLabel" }] : /* istanbul ignore next */ []);
|
|
426
|
+
timeColumnLabel = input("Time", ...ngDevMode ? [{ debugName: "timeColumnLabel" }] : /* istanbul ignore next */ []);
|
|
427
|
+
valueColumnLabel = input("Value", ...ngDevMode ? [{ debugName: "valueColumnLabel" }] : /* istanbul ignore next */ []);
|
|
428
|
+
sparkline = input(false, {
|
|
429
|
+
...ngDevMode ? { debugName: "sparkline" } : /* istanbul ignore next */ {},
|
|
430
|
+
transform: booleanAttribute
|
|
431
|
+
});
|
|
432
|
+
tooltip = input("compact", ...ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []);
|
|
433
|
+
tooltipDelta = input(true, {
|
|
434
|
+
...ngDevMode ? { debugName: "tooltipDelta" } : /* istanbul ignore next */ {},
|
|
435
|
+
transform: booleanAttribute
|
|
436
|
+
});
|
|
437
|
+
axisGap = input(12, ...ngDevMode ? [{ debugName: "axisGap" }] : /* istanbul ignore next */ []);
|
|
438
|
+
axisTicks = input("auto", {
|
|
439
|
+
...ngDevMode ? { debugName: "axisTicks" } : /* istanbul ignore next */ {},
|
|
440
|
+
transform: parseAxisTicks
|
|
441
|
+
});
|
|
442
|
+
rangeKey = input(null, ...ngDevMode ? [{ debugName: "rangeKey" }] : /* istanbul ignore next */ []);
|
|
443
|
+
#destroyRef = inject(DestroyRef);
|
|
444
|
+
#host = inject(ElementRef);
|
|
445
|
+
#wide = wideViewport();
|
|
446
|
+
#reducedMotion = injectReducedMotion();
|
|
447
|
+
#motion = new ShapeMotion({
|
|
448
|
+
hold: (geometry) => {
|
|
449
|
+
this.held.set(geometry);
|
|
450
|
+
this.activeIndex.update((index) => geometry ? null : index);
|
|
451
|
+
},
|
|
452
|
+
draw: (line, end) => {
|
|
453
|
+
this.lineRef()?.nativeElement.setAttribute("d", line);
|
|
454
|
+
this.endRef()?.nativeElement.setAttribute("cx", String(end.x));
|
|
455
|
+
this.endRef()?.nativeElement.setAttribute("cy", String(end.y));
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
svgRef = viewChild.required("svgRef", ...ngDevMode ? [{ debugName: "svgRef" }] : /* istanbul ignore next */ []);
|
|
459
|
+
lineRef = viewChild("lineRef", ...ngDevMode ? [{ debugName: "lineRef" }] : /* istanbul ignore next */ []);
|
|
460
|
+
endRef = viewChild("endRef", ...ngDevMode ? [{ debugName: "endRef" }] : /* istanbul ignore next */ []);
|
|
461
|
+
activeIndex = signal(null, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
|
|
462
|
+
held = signal(null, ...ngDevMode ? [{ debugName: "held" }] : /* istanbul ignore next */ []);
|
|
463
|
+
measuredSize = signal(null, ...ngDevMode ? [{ debugName: "measuredSize" }] : /* istanbul ignore next */ []);
|
|
464
|
+
spacedDeltaSuffix = computed(() => this.deltaSuffix() ? ` ${this.deltaSuffix()}` : "", ...ngDevMode ? [{ debugName: "spacedDeltaSuffix" }] : /* istanbul ignore next */ []);
|
|
465
|
+
effectiveWidth = computed(() => this.measuredSize()?.width ?? 640, ...ngDevMode ? [{ debugName: "effectiveWidth" }] : /* istanbul ignore next */ []);
|
|
466
|
+
effectiveHeight = computed(() => this.measuredSize()?.height ?? 240, ...ngDevMode ? [{ debugName: "effectiveHeight" }] : /* istanbul ignore next */ []);
|
|
467
|
+
plotHeight = computed(() => plotHeightFor(this.effectiveHeight(), this.sparkline(), this.axisGap(), this.#wide()), ...ngDevMode ? [{ debugName: "plotHeight" }] : /* istanbul ignore next */ []);
|
|
468
|
+
tooltipStyle = (point) => tooltipPlacement(point.x / this.effectiveWidth());
|
|
469
|
+
tooltipClasses = computed(() => tooltipClassesFor(this.tooltip(), this.#wide()), ...ngDevMode ? [{ debugName: "tooltipClasses" }] : /* istanbul ignore next */ []);
|
|
470
|
+
geometry = computed(() => {
|
|
471
|
+
const plotHeight = this.plotHeight();
|
|
472
|
+
const padding = plotPaddingFor(plotHeight, this.sparkline());
|
|
473
|
+
return buildGeometry(this.points(), this.effectiveWidth(), plotHeight, {
|
|
474
|
+
x: 0,
|
|
475
|
+
top: padding,
|
|
476
|
+
bottom: padding
|
|
477
|
+
});
|
|
478
|
+
}, ...ngDevMode ? [{ debugName: "geometry" }] : /* istanbul ignore next */ []);
|
|
479
|
+
shown = computed(() => this.held() ?? this.geometry(), ...ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []);
|
|
480
|
+
startFade = computed(() => this.held() ? "opacity-0 duration-(--duration-exit)" : "duration-(--duration-fast)", ...ngDevMode ? [{ debugName: "startFade" }] : /* istanbul ignore next */ []);
|
|
481
|
+
ticks = computed(() => axisTicks(this.geometry().points), ...ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []);
|
|
482
|
+
tickTexts = computed(() => tickLabels(this.ticks(), this.axisFormat(), this.axisTicks()), ...ngDevMode ? [{ debugName: "tickTexts" }] : /* istanbul ignore next */ []);
|
|
483
|
+
active = computed(() => {
|
|
484
|
+
const geometry = this.geometry();
|
|
485
|
+
const index = this.activeIndex();
|
|
486
|
+
return geometry && index !== null && !this.held() ? geometry.points[index] : null;
|
|
487
|
+
}, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
488
|
+
startLabelInfo = computed(() => {
|
|
489
|
+
const text = this.startLabel();
|
|
490
|
+
const geometry = this.shown();
|
|
491
|
+
if (!text || !geometry) return null;
|
|
492
|
+
const label = `${text} ${this.valueFormat()(geometry.points[0].v)}`;
|
|
493
|
+
const size = {
|
|
494
|
+
width: label.length * .56 * 12 + 8,
|
|
495
|
+
height: 16
|
|
496
|
+
};
|
|
497
|
+
const placement = placeStartLabel(geometry.points, geometry.start.y, {
|
|
498
|
+
width: this.effectiveWidth(),
|
|
499
|
+
height: this.plotHeight()
|
|
500
|
+
}, size);
|
|
501
|
+
return {
|
|
502
|
+
label,
|
|
503
|
+
placement: {
|
|
504
|
+
...placement,
|
|
505
|
+
y: startLabelBaseline(placement.y)
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
}, ...ngDevMode ? [{ debugName: "startLabelInfo" }] : /* istanbul ignore next */ []);
|
|
509
|
+
#renderRef = afterNextRender(() => {
|
|
510
|
+
this.#destroyRef.onDestroy(() => this.#renderRef.destroy());
|
|
511
|
+
observeSize(this.svgRef().nativeElement, this.#destroyRef, (size) => this.measuredSize.set(size));
|
|
512
|
+
});
|
|
513
|
+
constructor() {
|
|
514
|
+
effect(() => {
|
|
515
|
+
const points = this.points();
|
|
516
|
+
const geometry = this.geometry();
|
|
517
|
+
const reduced = this.#reducedMotion();
|
|
518
|
+
untracked(() => this.#motion.follow(points, geometry, {
|
|
519
|
+
reduced,
|
|
520
|
+
rangeKey: this.rangeKey(),
|
|
521
|
+
duration: () => durationFrom(getComputedStyle(this.#host.nativeElement).getPropertyValue("--duration-base"))
|
|
522
|
+
}));
|
|
523
|
+
});
|
|
524
|
+
this.#destroyRef.onDestroy(() => this.#motion.stop());
|
|
525
|
+
}
|
|
526
|
+
deltaFor(point) {
|
|
527
|
+
return point.v - this.points()[0].v;
|
|
528
|
+
}
|
|
529
|
+
deltaClasses(point) {
|
|
530
|
+
return `${this.tooltipClasses().delta} ${deltaTone(this.deltaFor(point))}`;
|
|
531
|
+
}
|
|
532
|
+
onPointerMove(event) {
|
|
533
|
+
const geometry = this.geometry();
|
|
534
|
+
if (this.sparkline() || !geometry || geometry.points.length === 0) return;
|
|
535
|
+
const rect = this.svgRef().nativeElement.getBoundingClientRect();
|
|
536
|
+
const ratio = rect.width === 0 ? 1 : this.effectiveWidth() / rect.width;
|
|
537
|
+
const x = (event.clientX - rect.left) * ratio;
|
|
538
|
+
this.activeIndex.set(nearestPointIndex(geometry.points, x));
|
|
539
|
+
}
|
|
540
|
+
onPointerLeave() {
|
|
541
|
+
this.activeIndex.set(null);
|
|
542
|
+
}
|
|
543
|
+
onKeydown(event) {
|
|
544
|
+
const geometry = this.geometry();
|
|
545
|
+
if (this.sparkline() || !geometry || geometry.points.length === 0) return;
|
|
546
|
+
const navigation = navigateIndex(event.key, this.activeIndex(), geometry.points.length - 1);
|
|
547
|
+
if (!navigation) return;
|
|
548
|
+
if (navigation.preventDefault) event.preventDefault();
|
|
549
|
+
this.activeIndex.set(navigation.index);
|
|
550
|
+
}
|
|
551
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
552
|
+
minVersion: "12.0.0",
|
|
553
|
+
version: "22.2.0",
|
|
554
|
+
ngImport: i0,
|
|
555
|
+
type: UiLineChart,
|
|
556
|
+
deps: [],
|
|
557
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
558
|
+
});
|
|
559
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
560
|
+
minVersion: "17.0.0",
|
|
561
|
+
version: "22.2.0",
|
|
562
|
+
type: UiLineChart,
|
|
563
|
+
isStandalone: true,
|
|
564
|
+
selector: "ui-line-chart",
|
|
565
|
+
inputs: {
|
|
566
|
+
points: {
|
|
567
|
+
classPropertyName: "points",
|
|
568
|
+
publicName: "points",
|
|
569
|
+
isSignal: true,
|
|
570
|
+
isRequired: true,
|
|
571
|
+
transformFunction: null
|
|
572
|
+
},
|
|
573
|
+
label: {
|
|
574
|
+
classPropertyName: "label",
|
|
575
|
+
publicName: "label",
|
|
576
|
+
isSignal: true,
|
|
577
|
+
isRequired: true,
|
|
578
|
+
transformFunction: null
|
|
579
|
+
},
|
|
580
|
+
valueFormat: {
|
|
581
|
+
classPropertyName: "valueFormat",
|
|
582
|
+
publicName: "valueFormat",
|
|
583
|
+
isSignal: true,
|
|
584
|
+
isRequired: false,
|
|
585
|
+
transformFunction: null
|
|
586
|
+
},
|
|
587
|
+
tooltipFormat: {
|
|
588
|
+
classPropertyName: "tooltipFormat",
|
|
589
|
+
publicName: "tooltipFormat",
|
|
590
|
+
isSignal: true,
|
|
591
|
+
isRequired: false,
|
|
592
|
+
transformFunction: null
|
|
593
|
+
},
|
|
594
|
+
deltaFormat: {
|
|
595
|
+
classPropertyName: "deltaFormat",
|
|
596
|
+
publicName: "deltaFormat",
|
|
597
|
+
isSignal: true,
|
|
598
|
+
isRequired: false,
|
|
599
|
+
transformFunction: null
|
|
600
|
+
},
|
|
601
|
+
deltaSuffix: {
|
|
602
|
+
classPropertyName: "deltaSuffix",
|
|
603
|
+
publicName: "deltaSuffix",
|
|
604
|
+
isSignal: true,
|
|
605
|
+
isRequired: false,
|
|
606
|
+
transformFunction: null
|
|
607
|
+
},
|
|
608
|
+
timeFormat: {
|
|
609
|
+
classPropertyName: "timeFormat",
|
|
610
|
+
publicName: "timeFormat",
|
|
611
|
+
isSignal: true,
|
|
612
|
+
isRequired: false,
|
|
613
|
+
transformFunction: null
|
|
614
|
+
},
|
|
615
|
+
axisFormat: {
|
|
616
|
+
classPropertyName: "axisFormat",
|
|
617
|
+
publicName: "axisFormat",
|
|
618
|
+
isSignal: true,
|
|
619
|
+
isRequired: false,
|
|
620
|
+
transformFunction: null
|
|
621
|
+
},
|
|
622
|
+
startLabel: {
|
|
623
|
+
classPropertyName: "startLabel",
|
|
624
|
+
publicName: "startLabel",
|
|
625
|
+
isSignal: true,
|
|
626
|
+
isRequired: false,
|
|
627
|
+
transformFunction: null
|
|
628
|
+
},
|
|
629
|
+
timeColumnLabel: {
|
|
630
|
+
classPropertyName: "timeColumnLabel",
|
|
631
|
+
publicName: "timeColumnLabel",
|
|
632
|
+
isSignal: true,
|
|
633
|
+
isRequired: false,
|
|
634
|
+
transformFunction: null
|
|
635
|
+
},
|
|
636
|
+
valueColumnLabel: {
|
|
637
|
+
classPropertyName: "valueColumnLabel",
|
|
638
|
+
publicName: "valueColumnLabel",
|
|
639
|
+
isSignal: true,
|
|
640
|
+
isRequired: false,
|
|
641
|
+
transformFunction: null
|
|
642
|
+
},
|
|
643
|
+
sparkline: {
|
|
644
|
+
classPropertyName: "sparkline",
|
|
645
|
+
publicName: "sparkline",
|
|
646
|
+
isSignal: true,
|
|
647
|
+
isRequired: false,
|
|
648
|
+
transformFunction: null
|
|
649
|
+
},
|
|
650
|
+
tooltip: {
|
|
651
|
+
classPropertyName: "tooltip",
|
|
652
|
+
publicName: "tooltip",
|
|
653
|
+
isSignal: true,
|
|
654
|
+
isRequired: false,
|
|
655
|
+
transformFunction: null
|
|
656
|
+
},
|
|
657
|
+
tooltipDelta: {
|
|
658
|
+
classPropertyName: "tooltipDelta",
|
|
659
|
+
publicName: "tooltipDelta",
|
|
660
|
+
isSignal: true,
|
|
661
|
+
isRequired: false,
|
|
662
|
+
transformFunction: null
|
|
663
|
+
},
|
|
664
|
+
axisGap: {
|
|
665
|
+
classPropertyName: "axisGap",
|
|
666
|
+
publicName: "axisGap",
|
|
667
|
+
isSignal: true,
|
|
668
|
+
isRequired: false,
|
|
669
|
+
transformFunction: null
|
|
670
|
+
},
|
|
671
|
+
axisTicks: {
|
|
672
|
+
classPropertyName: "axisTicks",
|
|
673
|
+
publicName: "axisTicks",
|
|
674
|
+
isSignal: true,
|
|
675
|
+
isRequired: false,
|
|
676
|
+
transformFunction: null
|
|
677
|
+
},
|
|
678
|
+
rangeKey: {
|
|
679
|
+
classPropertyName: "rangeKey",
|
|
680
|
+
publicName: "rangeKey",
|
|
681
|
+
isSignal: true,
|
|
682
|
+
isRequired: false,
|
|
683
|
+
transformFunction: null
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
host: { classAttribute: "block h-full" },
|
|
687
|
+
viewQueries: [
|
|
688
|
+
{
|
|
689
|
+
propertyName: "svgRef",
|
|
690
|
+
first: true,
|
|
691
|
+
predicate: ["svgRef"],
|
|
692
|
+
descendants: true,
|
|
693
|
+
isSignal: true
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
propertyName: "lineRef",
|
|
697
|
+
first: true,
|
|
698
|
+
predicate: ["lineRef"],
|
|
699
|
+
descendants: true,
|
|
700
|
+
isSignal: true
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
propertyName: "endRef",
|
|
704
|
+
first: true,
|
|
705
|
+
predicate: ["endRef"],
|
|
706
|
+
descendants: true,
|
|
707
|
+
isSignal: true
|
|
708
|
+
}
|
|
709
|
+
],
|
|
710
|
+
ngImport: i0,
|
|
711
|
+
template: `
|
|
547
712
|
<div class="relative h-full">
|
|
548
713
|
<svg
|
|
549
714
|
#svgRef
|
|
550
|
-
class="block h-full w-full touch-
|
|
715
|
+
class="block h-full w-full touch-none overflow-visible"
|
|
551
716
|
role="img"
|
|
552
717
|
[attr.aria-label]="label()"
|
|
553
718
|
[attr.height]="effectiveHeight()"
|
|
@@ -555,6 +720,8 @@ class UiLineChart {
|
|
|
555
720
|
[attr.viewBox]="'0 0 ' + effectiveWidth() + ' ' + effectiveHeight()"
|
|
556
721
|
[attr.width]="effectiveWidth()"
|
|
557
722
|
(keydown)="onKeydown($event)"
|
|
723
|
+
(pointercancel)="onPointerLeave()"
|
|
724
|
+
(pointerdown)="onPointerMove($event)"
|
|
558
725
|
(pointerleave)="onPointerLeave()"
|
|
559
726
|
(pointermove)="onPointerMove($event)"
|
|
560
727
|
>
|
|
@@ -656,7 +823,9 @@ class UiLineChart {
|
|
|
656
823
|
{{ tooltipFormat()?.(point) ?? valueFormat()(point.v) }}
|
|
657
824
|
</p>
|
|
658
825
|
@if (tooltipDelta()) {
|
|
659
|
-
<p data-chart-delta [class]="deltaClasses(point)">
|
|
826
|
+
<p data-chart-delta [class]="deltaClasses(point)">
|
|
827
|
+
{{ deltaFormat()(deltaFor(point)) }}{{ spacedDeltaSuffix() }}
|
|
828
|
+
</p>
|
|
660
829
|
}
|
|
661
830
|
<p class="text-caption text-(--subtle-foreground)" data-chart-date>{{ timeFormat()(point.t) }}</p>
|
|
662
831
|
</div>
|
|
@@ -683,17 +852,24 @@ class UiLineChart {
|
|
|
683
852
|
</div>
|
|
684
853
|
}
|
|
685
854
|
</div>
|
|
686
|
-
`,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
855
|
+
`,
|
|
856
|
+
isInline: true
|
|
857
|
+
});
|
|
858
|
+
};
|
|
859
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
860
|
+
minVersion: "12.0.0",
|
|
861
|
+
version: "22.2.0",
|
|
862
|
+
ngImport: i0,
|
|
863
|
+
type: UiLineChart,
|
|
864
|
+
decorators: [{
|
|
865
|
+
type: Component,
|
|
866
|
+
args: [{
|
|
867
|
+
selector: "ui-line-chart",
|
|
868
|
+
template: `
|
|
693
869
|
<div class="relative h-full">
|
|
694
870
|
<svg
|
|
695
871
|
#svgRef
|
|
696
|
-
class="block h-full w-full touch-
|
|
872
|
+
class="block h-full w-full touch-none overflow-visible"
|
|
697
873
|
role="img"
|
|
698
874
|
[attr.aria-label]="label()"
|
|
699
875
|
[attr.height]="effectiveHeight()"
|
|
@@ -701,6 +877,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
701
877
|
[attr.viewBox]="'0 0 ' + effectiveWidth() + ' ' + effectiveHeight()"
|
|
702
878
|
[attr.width]="effectiveWidth()"
|
|
703
879
|
(keydown)="onKeydown($event)"
|
|
880
|
+
(pointercancel)="onPointerLeave()"
|
|
881
|
+
(pointerdown)="onPointerMove($event)"
|
|
704
882
|
(pointerleave)="onPointerLeave()"
|
|
705
883
|
(pointermove)="onPointerMove($event)"
|
|
706
884
|
>
|
|
@@ -802,7 +980,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
802
980
|
{{ tooltipFormat()?.(point) ?? valueFormat()(point.v) }}
|
|
803
981
|
</p>
|
|
804
982
|
@if (tooltipDelta()) {
|
|
805
|
-
<p data-chart-delta [class]="deltaClasses(point)">
|
|
983
|
+
<p data-chart-delta [class]="deltaClasses(point)">
|
|
984
|
+
{{ deltaFormat()(deltaFor(point)) }}{{ spacedDeltaSuffix() }}
|
|
985
|
+
</p>
|
|
806
986
|
}
|
|
807
987
|
<p class="text-caption text-(--subtle-foreground)" data-chart-date>{{ timeFormat()(point.t) }}</p>
|
|
808
988
|
</div>
|
|
@@ -830,15 +1010,161 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
830
1010
|
}
|
|
831
1011
|
</div>
|
|
832
1012
|
`,
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
1013
|
+
host: { class: "block h-full" }
|
|
1014
|
+
}]
|
|
1015
|
+
}],
|
|
1016
|
+
ctorParameters: () => [],
|
|
1017
|
+
propDecorators: {
|
|
1018
|
+
points: [{
|
|
1019
|
+
type: i0.Input,
|
|
1020
|
+
args: [{
|
|
1021
|
+
isSignal: true,
|
|
1022
|
+
alias: "points",
|
|
1023
|
+
required: true
|
|
1024
|
+
}]
|
|
1025
|
+
}],
|
|
1026
|
+
label: [{
|
|
1027
|
+
type: i0.Input,
|
|
1028
|
+
args: [{
|
|
1029
|
+
isSignal: true,
|
|
1030
|
+
alias: "label",
|
|
1031
|
+
required: true
|
|
1032
|
+
}]
|
|
1033
|
+
}],
|
|
1034
|
+
valueFormat: [{
|
|
1035
|
+
type: i0.Input,
|
|
1036
|
+
args: [{
|
|
1037
|
+
isSignal: true,
|
|
1038
|
+
alias: "valueFormat",
|
|
1039
|
+
required: false
|
|
1040
|
+
}]
|
|
1041
|
+
}],
|
|
1042
|
+
tooltipFormat: [{
|
|
1043
|
+
type: i0.Input,
|
|
1044
|
+
args: [{
|
|
1045
|
+
isSignal: true,
|
|
1046
|
+
alias: "tooltipFormat",
|
|
1047
|
+
required: false
|
|
1048
|
+
}]
|
|
1049
|
+
}],
|
|
1050
|
+
deltaFormat: [{
|
|
1051
|
+
type: i0.Input,
|
|
1052
|
+
args: [{
|
|
1053
|
+
isSignal: true,
|
|
1054
|
+
alias: "deltaFormat",
|
|
1055
|
+
required: false
|
|
1056
|
+
}]
|
|
1057
|
+
}],
|
|
1058
|
+
deltaSuffix: [{
|
|
1059
|
+
type: i0.Input,
|
|
1060
|
+
args: [{
|
|
1061
|
+
isSignal: true,
|
|
1062
|
+
alias: "deltaSuffix",
|
|
1063
|
+
required: false
|
|
1064
|
+
}]
|
|
1065
|
+
}],
|
|
1066
|
+
timeFormat: [{
|
|
1067
|
+
type: i0.Input,
|
|
1068
|
+
args: [{
|
|
1069
|
+
isSignal: true,
|
|
1070
|
+
alias: "timeFormat",
|
|
1071
|
+
required: false
|
|
1072
|
+
}]
|
|
1073
|
+
}],
|
|
1074
|
+
axisFormat: [{
|
|
1075
|
+
type: i0.Input,
|
|
1076
|
+
args: [{
|
|
1077
|
+
isSignal: true,
|
|
1078
|
+
alias: "axisFormat",
|
|
1079
|
+
required: false
|
|
1080
|
+
}]
|
|
1081
|
+
}],
|
|
1082
|
+
startLabel: [{
|
|
1083
|
+
type: i0.Input,
|
|
1084
|
+
args: [{
|
|
1085
|
+
isSignal: true,
|
|
1086
|
+
alias: "startLabel",
|
|
1087
|
+
required: false
|
|
1088
|
+
}]
|
|
1089
|
+
}],
|
|
1090
|
+
timeColumnLabel: [{
|
|
1091
|
+
type: i0.Input,
|
|
1092
|
+
args: [{
|
|
1093
|
+
isSignal: true,
|
|
1094
|
+
alias: "timeColumnLabel",
|
|
1095
|
+
required: false
|
|
1096
|
+
}]
|
|
1097
|
+
}],
|
|
1098
|
+
valueColumnLabel: [{
|
|
1099
|
+
type: i0.Input,
|
|
1100
|
+
args: [{
|
|
1101
|
+
isSignal: true,
|
|
1102
|
+
alias: "valueColumnLabel",
|
|
1103
|
+
required: false
|
|
1104
|
+
}]
|
|
1105
|
+
}],
|
|
1106
|
+
sparkline: [{
|
|
1107
|
+
type: i0.Input,
|
|
1108
|
+
args: [{
|
|
1109
|
+
isSignal: true,
|
|
1110
|
+
alias: "sparkline",
|
|
1111
|
+
required: false
|
|
1112
|
+
}]
|
|
1113
|
+
}],
|
|
1114
|
+
tooltip: [{
|
|
1115
|
+
type: i0.Input,
|
|
1116
|
+
args: [{
|
|
1117
|
+
isSignal: true,
|
|
1118
|
+
alias: "tooltip",
|
|
1119
|
+
required: false
|
|
1120
|
+
}]
|
|
1121
|
+
}],
|
|
1122
|
+
tooltipDelta: [{
|
|
1123
|
+
type: i0.Input,
|
|
1124
|
+
args: [{
|
|
1125
|
+
isSignal: true,
|
|
1126
|
+
alias: "tooltipDelta",
|
|
1127
|
+
required: false
|
|
1128
|
+
}]
|
|
1129
|
+
}],
|
|
1130
|
+
axisGap: [{
|
|
1131
|
+
type: i0.Input,
|
|
1132
|
+
args: [{
|
|
1133
|
+
isSignal: true,
|
|
1134
|
+
alias: "axisGap",
|
|
1135
|
+
required: false
|
|
1136
|
+
}]
|
|
1137
|
+
}],
|
|
1138
|
+
axisTicks: [{
|
|
1139
|
+
type: i0.Input,
|
|
1140
|
+
args: [{
|
|
1141
|
+
isSignal: true,
|
|
1142
|
+
alias: "axisTicks",
|
|
1143
|
+
required: false
|
|
1144
|
+
}]
|
|
1145
|
+
}],
|
|
1146
|
+
rangeKey: [{
|
|
1147
|
+
type: i0.Input,
|
|
1148
|
+
args: [{
|
|
1149
|
+
isSignal: true,
|
|
1150
|
+
alias: "rangeKey",
|
|
1151
|
+
required: false
|
|
1152
|
+
}]
|
|
1153
|
+
}],
|
|
1154
|
+
svgRef: [{
|
|
1155
|
+
type: i0.ViewChild,
|
|
1156
|
+
args: ["svgRef", { isSignal: true }]
|
|
1157
|
+
}],
|
|
1158
|
+
lineRef: [{
|
|
1159
|
+
type: i0.ViewChild,
|
|
1160
|
+
args: ["lineRef", { isSignal: true }]
|
|
1161
|
+
}],
|
|
1162
|
+
endRef: [{
|
|
1163
|
+
type: i0.ViewChild,
|
|
1164
|
+
args: ["endRef", { isSignal: true }]
|
|
1165
|
+
}]
|
|
1166
|
+
}
|
|
1167
|
+
});
|
|
843
1168
|
export { UiLineChart };
|
|
844
|
-
|
|
1169
|
+
|
|
1170
|
+
//# sourceMappingURL=joanroucoux-cairn-ui-line-chart.mjs.map
|