@umriss-ui/charts 0.6.0 → 0.7.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 +83 -0
- package/README.md +16 -7
- package/dist/charts.css +1 -1
- package/dist/charts.js +1656 -1069
- package/dist/de.d.ts +18 -0
- package/dist/index.d.ts +75 -3
- package/dist/wording/de.js +13 -5
- package/docs/llms-full.md +4031 -0
- package/package.json +3 -2
package/dist/charts.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import "./charts.css";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var x = (s, t, e) =>
|
|
5
|
-
import { jsxs as
|
|
6
|
-
import { useRef as
|
|
7
|
-
function
|
|
2
|
+
var fn = Object.defineProperty;
|
|
3
|
+
var mn = (s, t, e) => t in s ? fn(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
4
|
+
var x = (s, t, e) => mn(s, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { jsxs as O, jsx as k, Fragment as xt } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as G, useEffect as D, createContext as pn, useContext as gn, useSyncExternalStore as wt, useId as Ve, useState as fe, useLayoutEffect as yn, useCallback as xn, Fragment as bn, useMemo as $ } from "react";
|
|
7
|
+
function vn() {
|
|
8
8
|
var t;
|
|
9
9
|
const s = import.meta;
|
|
10
10
|
return typeof ((t = s.env) == null ? void 0 : t.DEV) == "boolean" ? s.env.DEV : typeof process < "u" && (process != null && process.env) ? process.env.NODE_ENV !== "production" : !1;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
12
|
+
const bt = vn();
|
|
13
|
+
function gt(s, t) {
|
|
14
|
+
if (bt && !s)
|
|
15
15
|
throw new Error(`@umriss-ui/charts: ${t}`);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
!
|
|
17
|
+
const ye = /* @__PURE__ */ new Set();
|
|
18
|
+
function nt(s, t) {
|
|
19
|
+
!bt || ye.has(s) || (ye.add(s), console.warn(`@umriss-ui/charts: ${t}`));
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const H = {
|
|
22
22
|
colorAxis: "rgba(23, 23, 23, 0.17)",
|
|
23
23
|
colorGrid: "rgba(23, 23, 23, 0.06)",
|
|
24
24
|
colorText: "#71717a",
|
|
@@ -28,82 +28,110 @@ const R = {
|
|
|
28
28
|
colorOk: "#217a4b",
|
|
29
29
|
font: "system-ui, sans-serif",
|
|
30
30
|
fontMono: "ui-monospace, monospace",
|
|
31
|
-
series: ["#2563eb", "#db2777", "#059669", "#d97706", "#7c3aed", "#0891b2"]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
series: ["#2563eb", "#db2777", "#059669", "#d97706", "#7c3aed", "#0891b2"],
|
|
32
|
+
forced: !1
|
|
33
|
+
}, Ye = "(forced-colors: active)";
|
|
34
|
+
function kn() {
|
|
35
|
+
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(Ye).matches;
|
|
36
|
+
}
|
|
37
|
+
const xe = /* @__PURE__ */ new WeakMap();
|
|
38
|
+
let se = 0;
|
|
39
|
+
const oe = /* @__PURE__ */ new Set();
|
|
40
|
+
let Kt = null;
|
|
41
|
+
function yt(s, t, e) {
|
|
37
42
|
const n = s.getPropertyValue(t).trim();
|
|
38
43
|
return n === "" ? e : n;
|
|
39
44
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
|
|
45
|
+
function me(s, t, e = !1) {
|
|
46
|
+
const n = s.ownerDocument.createElement("span");
|
|
47
|
+
n.setAttribute("aria-hidden", "true"), n.style.position = "absolute", n.style.visibility = "hidden", e && n.style.setProperty("forced-color-adjust", "none"), s.appendChild(n);
|
|
43
48
|
try {
|
|
44
|
-
return t((
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
return
|
|
49
|
+
return t((i) => {
|
|
50
|
+
n.style.color = "", n.style.color = i;
|
|
51
|
+
const o = getComputedStyle(n).color;
|
|
52
|
+
return o === "" || o.startsWith("var(") ? i : o;
|
|
48
53
|
});
|
|
49
54
|
} finally {
|
|
50
|
-
|
|
55
|
+
n.remove();
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
|
-
function
|
|
58
|
+
function wn(s, t) {
|
|
59
|
+
return me(
|
|
60
|
+
s,
|
|
61
|
+
(e) => {
|
|
62
|
+
const n = e("CanvasText"), i = e("Highlight");
|
|
63
|
+
return {
|
|
64
|
+
colorAxis: n,
|
|
65
|
+
colorGrid: e("GrayText"),
|
|
66
|
+
colorText: n,
|
|
67
|
+
colorBg: e("Canvas"),
|
|
68
|
+
colorWarning: i,
|
|
69
|
+
colorAlarm: i,
|
|
70
|
+
colorOk: n,
|
|
71
|
+
font: yt(t, "--uc-font", H.font),
|
|
72
|
+
fontMono: yt(t, "--uc-font-mono", H.fontMono),
|
|
73
|
+
series: H.series.map(() => n),
|
|
74
|
+
forced: !0
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
!0
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function Nn(s) {
|
|
54
81
|
const t = getComputedStyle(s);
|
|
55
|
-
return
|
|
82
|
+
return kn() ? wn(s, t) : me(s, (e) => {
|
|
56
83
|
const n = (o, r) => {
|
|
57
|
-
const l =
|
|
84
|
+
const l = yt(t, o, r);
|
|
58
85
|
if (l === r) return r;
|
|
59
86
|
const a = e(`var(${o})`);
|
|
60
87
|
return a === `var(${o})` ? l : a;
|
|
61
88
|
}, i = [];
|
|
62
89
|
for (let o = 1; o <= 6; o++)
|
|
63
|
-
i.push(n(`--uc-series-${o}`,
|
|
90
|
+
i.push(n(`--uc-series-${o}`, H.series[o - 1] ?? "#2563eb"));
|
|
64
91
|
return {
|
|
65
|
-
colorAxis: n("--uc-color-axis",
|
|
66
|
-
colorGrid: n("--uc-color-grid",
|
|
67
|
-
colorText: n("--uc-color-text",
|
|
68
|
-
colorBg: n("--uc-color-bg",
|
|
69
|
-
colorWarning: n("--uc-color-warning",
|
|
70
|
-
colorAlarm: n("--uc-color-alarm",
|
|
71
|
-
colorOk: n("--uc-color-ok",
|
|
72
|
-
font:
|
|
73
|
-
fontMono:
|
|
74
|
-
series: i
|
|
92
|
+
colorAxis: n("--uc-color-axis", H.colorAxis),
|
|
93
|
+
colorGrid: n("--uc-color-grid", H.colorGrid),
|
|
94
|
+
colorText: n("--uc-color-text", H.colorText),
|
|
95
|
+
colorBg: n("--uc-color-bg", H.colorBg),
|
|
96
|
+
colorWarning: n("--uc-color-warning", H.colorWarning),
|
|
97
|
+
colorAlarm: n("--uc-color-alarm", H.colorAlarm),
|
|
98
|
+
colorOk: n("--uc-color-ok", H.colorOk),
|
|
99
|
+
font: yt(t, "--uc-font", H.font),
|
|
100
|
+
fontMono: yt(t, "--uc-font-mono", H.fontMono),
|
|
101
|
+
series: i,
|
|
102
|
+
forced: !1
|
|
75
103
|
};
|
|
76
104
|
});
|
|
77
105
|
}
|
|
78
|
-
function
|
|
79
|
-
var s, t;
|
|
80
|
-
|
|
106
|
+
function Ge() {
|
|
107
|
+
var s, t, e, n;
|
|
108
|
+
Kt === null && (typeof MutationObserver > "u" || typeof document > "u" || (Kt = new MutationObserver(() => qt()), Kt.observe(document.documentElement, { attributes: !0 }), typeof window < "u" && typeof window.matchMedia == "function" && ((t = (s = window.matchMedia("(prefers-color-scheme: dark)")).addEventListener) == null || t.call(s, "change", () => qt()), (n = (e = window.matchMedia(Ye)).addEventListener) == null || n.call(e, "change", () => qt()))));
|
|
81
109
|
}
|
|
82
|
-
function
|
|
83
|
-
return
|
|
110
|
+
function In(s, t) {
|
|
111
|
+
return Ge(), me(s, (e) => {
|
|
84
112
|
const n = {};
|
|
85
113
|
for (const i of Object.keys(t)) n[i] = e(t[i]);
|
|
86
114
|
return n;
|
|
87
115
|
});
|
|
88
116
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
const t =
|
|
92
|
-
if (t !== void 0 && t.generation ===
|
|
93
|
-
const e =
|
|
94
|
-
return
|
|
117
|
+
function An(s) {
|
|
118
|
+
Ge();
|
|
119
|
+
const t = xe.get(s);
|
|
120
|
+
if (t !== void 0 && t.generation === se) return t.theme;
|
|
121
|
+
const e = Nn(s);
|
|
122
|
+
return xe.set(s, { generation: se, theme: e }), e;
|
|
95
123
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
for (const s of
|
|
124
|
+
function qt() {
|
|
125
|
+
se++;
|
|
126
|
+
for (const s of oe) s();
|
|
99
127
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
102
|
-
|
|
128
|
+
function Tn(s) {
|
|
129
|
+
return oe.add(s), () => {
|
|
130
|
+
oe.delete(s);
|
|
103
131
|
};
|
|
104
132
|
}
|
|
105
|
-
const
|
|
106
|
-
class
|
|
133
|
+
const Mn = { width: 0, height: 0 };
|
|
134
|
+
class Sn {
|
|
107
135
|
constructor(t) {
|
|
108
136
|
x(this, "span", null);
|
|
109
137
|
x(this, "root");
|
|
@@ -121,7 +149,7 @@ class ln {
|
|
|
121
149
|
const n = `${e}|${t}`, i = this.cache.get(n);
|
|
122
150
|
if (i !== void 0) return i;
|
|
123
151
|
const o = this.ensure();
|
|
124
|
-
if (o === null) return
|
|
152
|
+
if (o === null) return Mn;
|
|
125
153
|
o.className = `uc-measure ${e}`, o.textContent = t;
|
|
126
154
|
const r = o.getBoundingClientRect(), l = { width: r.width, height: r.height };
|
|
127
155
|
return this.cache.set(n, l), l;
|
|
@@ -134,15 +162,15 @@ class ln {
|
|
|
134
162
|
(t = this.span) == null || t.remove(), this.span = null, this.cache.clear();
|
|
135
163
|
}
|
|
136
164
|
}
|
|
137
|
-
function
|
|
165
|
+
function Ht(s) {
|
|
138
166
|
return Object.is(s, -0) ? 0 : s;
|
|
139
167
|
}
|
|
140
|
-
function
|
|
168
|
+
function lt(s, t) {
|
|
141
169
|
if (!Number.isFinite(s) || s <= 0) return 1;
|
|
142
170
|
const e = Math.max(1, Math.floor(t)), n = s / e, i = Math.pow(10, Math.floor(Math.log10(n))), o = n / i, r = 1e-9;
|
|
143
171
|
return (o <= 1 + r ? 1 : o <= 2 + r ? 2 : o <= 5 + r ? 5 : 10) * i;
|
|
144
172
|
}
|
|
145
|
-
function
|
|
173
|
+
function Yt(s) {
|
|
146
174
|
const t = Math.abs(s);
|
|
147
175
|
if (!Number.isFinite(t) || t === 0) return 0;
|
|
148
176
|
const e = Math.floor(Math.log10(t));
|
|
@@ -152,52 +180,52 @@ function Rt(s) {
|
|
|
152
180
|
n++;
|
|
153
181
|
return n;
|
|
154
182
|
}
|
|
155
|
-
function
|
|
156
|
-
return t <= 0 || !Number.isFinite(s) || Math.abs(s) >= 1e21 ?
|
|
183
|
+
function Rt(s, t) {
|
|
184
|
+
return t <= 0 || !Number.isFinite(s) || Math.abs(s) >= 1e21 ? Ht(s) : Ht(Number(s.toFixed(Math.min(20, t))));
|
|
157
185
|
}
|
|
158
|
-
function
|
|
186
|
+
function Ln(s, t, e) {
|
|
159
187
|
if (!Number.isFinite(s) || !Number.isFinite(t)) return [0, 1];
|
|
160
188
|
if (s === t) return [s - 1, t + 1];
|
|
161
|
-
const n =
|
|
189
|
+
const n = lt(t - s, e), i = Yt(n);
|
|
162
190
|
return [
|
|
163
|
-
|
|
164
|
-
|
|
191
|
+
Rt(Math.floor(s / n) * n, i),
|
|
192
|
+
Rt(Math.ceil(t / n) * n, i)
|
|
165
193
|
];
|
|
166
194
|
}
|
|
167
|
-
function
|
|
195
|
+
function Ut(s, t) {
|
|
168
196
|
return !Number.isFinite(s) || !Number.isFinite(t) ? [0, 1] : s === t ? [s - 1, t + 1] : [s, t];
|
|
169
197
|
}
|
|
170
|
-
function
|
|
198
|
+
function Ke(s, t, e) {
|
|
171
199
|
if (!Number.isFinite(s) || !Number.isFinite(t)) return [];
|
|
172
|
-
if (s === t) return [
|
|
173
|
-
const [n, i] = s < t ? [s, t] : [t, s], o =
|
|
200
|
+
if (s === t) return [Ht(s)];
|
|
201
|
+
const [n, i] = s < t ? [s, t] : [t, s], o = lt(i - n, e), r = Yt(o), l = o * 1e-9, a = Math.ceil((n - l) / o), c = Math.floor((i + l) / o);
|
|
174
202
|
if (!Number.isFinite(a) || !Number.isFinite(c)) return [];
|
|
175
203
|
const h = [];
|
|
176
204
|
for (let f = a; f <= c; f++)
|
|
177
|
-
h.push(
|
|
205
|
+
h.push(Rt(f * o, r));
|
|
178
206
|
return h;
|
|
179
207
|
}
|
|
180
|
-
function
|
|
208
|
+
function En(s, t, e, n) {
|
|
181
209
|
const i = n.length, o = n[0], r = n[i - 1];
|
|
182
210
|
if (i < 2 || o === void 0 || r === void 0 || !Number.isFinite(s) || !Number.isFinite(t))
|
|
183
211
|
return null;
|
|
184
|
-
const [l, a] = s === t ? [s - 1, t + 1] : [s, t], c = (r - o) / (i - 1), h = (o - e[0]) / c, f = (e[1] - r) / c, m = i - 1 + h + f, p = (
|
|
185
|
-
let u =
|
|
186
|
-
for (let
|
|
187
|
-
const
|
|
188
|
-
if (b + m * u >= a -
|
|
189
|
-
const
|
|
212
|
+
const [l, a] = s === t ? [s - 1, t + 1] : [s, t], c = (r - o) / (i - 1), h = (o - e[0]) / c, f = (e[1] - r) / c, m = i - 1 + h + f, p = (g) => Ht(Number(g.toPrecision(12)));
|
|
213
|
+
let u = lt((a - l) / m, 1);
|
|
214
|
+
for (let g = 0; g < 64; g++) {
|
|
215
|
+
const d = u * 1e-9, y = Math.floor((l + h * u + d) / u) * u, b = y - h * u;
|
|
216
|
+
if (b + m * u >= a - d) {
|
|
217
|
+
const v = Yt(u);
|
|
190
218
|
return {
|
|
191
219
|
domain: [p(b), p(b + m * u)],
|
|
192
|
-
ticks: Array.from({ length: i }, (
|
|
220
|
+
ticks: Array.from({ length: i }, (w, L) => Rt(y + L * u, v)),
|
|
193
221
|
step: u
|
|
194
222
|
};
|
|
195
223
|
}
|
|
196
|
-
u =
|
|
224
|
+
u = lt(u * 1.5, 1);
|
|
197
225
|
}
|
|
198
226
|
return null;
|
|
199
227
|
}
|
|
200
|
-
class
|
|
228
|
+
class be {
|
|
201
229
|
constructor(t, e) {
|
|
202
230
|
x(this, "domain");
|
|
203
231
|
x(this, "range");
|
|
@@ -215,36 +243,36 @@ class ae {
|
|
|
215
243
|
return this.m === 0 ? this.domain[0] : (t - this.b) / this.m;
|
|
216
244
|
}
|
|
217
245
|
ticks(t) {
|
|
218
|
-
return
|
|
246
|
+
return Ke(this.domain[0], this.domain[1], t);
|
|
219
247
|
}
|
|
220
248
|
}
|
|
221
|
-
let
|
|
222
|
-
function
|
|
223
|
-
if (
|
|
249
|
+
let Mt = null;
|
|
250
|
+
function qe() {
|
|
251
|
+
if (Mt !== null) return Mt;
|
|
224
252
|
const s = typeof navigator > "u" ? void 0 : navigator.language;
|
|
225
|
-
return
|
|
253
|
+
return Mt = typeof s == "string" && s !== "" ? s : "en-US", Mt;
|
|
226
254
|
}
|
|
227
|
-
const
|
|
228
|
-
function
|
|
229
|
-
const t =
|
|
230
|
-
let n =
|
|
255
|
+
const Wt = /* @__PURE__ */ new Map();
|
|
256
|
+
function Fn(s) {
|
|
257
|
+
const t = qe(), e = `${t}|${s}`;
|
|
258
|
+
let n = Wt.get(e);
|
|
231
259
|
return n === void 0 && (n = new Intl.NumberFormat(t, {
|
|
232
260
|
minimumFractionDigits: s,
|
|
233
261
|
maximumFractionDigits: s,
|
|
234
262
|
useGrouping: !0
|
|
235
|
-
}),
|
|
263
|
+
}), Wt.set(e, n)), n;
|
|
236
264
|
}
|
|
237
|
-
function
|
|
238
|
-
return
|
|
265
|
+
function Ue(s, t) {
|
|
266
|
+
return Fn(Math.min(6, Yt(t))).format(s);
|
|
239
267
|
}
|
|
240
|
-
function
|
|
268
|
+
function St(s) {
|
|
241
269
|
if (!Number.isFinite(s)) return "–";
|
|
242
|
-
const t =
|
|
243
|
-
let n =
|
|
244
|
-
return n === void 0 && (n = new Intl.NumberFormat(t, { maximumFractionDigits: 3, useGrouping: !0 }),
|
|
270
|
+
const t = qe(), e = `${t}|value`;
|
|
271
|
+
let n = Wt.get(e);
|
|
272
|
+
return n === void 0 && (n = new Intl.NumberFormat(t, { maximumFractionDigits: 3, useGrouping: !0 }), Wt.set(e, n)), n.format(s);
|
|
245
273
|
}
|
|
246
|
-
const
|
|
247
|
-
function
|
|
274
|
+
const ot = 1e3, V = 60 * ot, rt = 60 * V, K = 24 * rt;
|
|
275
|
+
function Dn(s) {
|
|
248
276
|
const t = s.filter((o) => Number.isFinite(o.from) && Number.isFinite(o.to) && o.to > o.from).sort((o, r) => o.from - r.from), e = [];
|
|
249
277
|
for (const o of t) {
|
|
250
278
|
const r = e[e.length - 1];
|
|
@@ -256,15 +284,15 @@ function hn(s) {
|
|
|
256
284
|
n.push(i), i += o.to - o.from;
|
|
257
285
|
return { intervals: e, offsets: n, total: i };
|
|
258
286
|
}
|
|
259
|
-
const
|
|
260
|
-
function
|
|
287
|
+
const ve = /* @__PURE__ */ new WeakMap();
|
|
288
|
+
function tt(s) {
|
|
261
289
|
if (!Array.isArray(s)) return s;
|
|
262
|
-
const t = s, e =
|
|
290
|
+
const t = s, e = ve.get(t);
|
|
263
291
|
if (e !== void 0) return e;
|
|
264
|
-
const n =
|
|
265
|
-
return
|
|
292
|
+
const n = Dn(t);
|
|
293
|
+
return ve.set(t, n), n;
|
|
266
294
|
}
|
|
267
|
-
function
|
|
295
|
+
function Pn(s, t) {
|
|
268
296
|
const e = s.intervals;
|
|
269
297
|
let n = 0, i = e.length - 1, o = -1;
|
|
270
298
|
for (; n <= i; ) {
|
|
@@ -273,14 +301,14 @@ function dn(s, t) {
|
|
|
273
301
|
}
|
|
274
302
|
return o < 0 ? -1 : t <= e[o].to ? o : -1;
|
|
275
303
|
}
|
|
276
|
-
function
|
|
277
|
-
const e =
|
|
304
|
+
function ut(s, t) {
|
|
305
|
+
const e = tt(t);
|
|
278
306
|
if (e.intervals.length === 0) return s;
|
|
279
|
-
const n =
|
|
307
|
+
const n = Pn(e, s);
|
|
280
308
|
return n < 0 ? Number.NaN : e.offsets[n] + (s - e.intervals[n].from);
|
|
281
309
|
}
|
|
282
|
-
function
|
|
283
|
-
const e =
|
|
310
|
+
function ht(s, t) {
|
|
311
|
+
const e = tt(t), n = e.intervals;
|
|
284
312
|
if (n.length === 0) return s;
|
|
285
313
|
if (!(s >= 0) || s > e.total) return Number.NaN;
|
|
286
314
|
if (s === e.total)
|
|
@@ -292,15 +320,15 @@ function at(s, t) {
|
|
|
292
320
|
}
|
|
293
321
|
return n[r].from + (s - e.offsets[r]);
|
|
294
322
|
}
|
|
295
|
-
function
|
|
296
|
-
const i =
|
|
323
|
+
function ws(s, t, e, n) {
|
|
324
|
+
const i = tt(s);
|
|
297
325
|
for (let o = 0; o < e; o++)
|
|
298
|
-
n[o] =
|
|
326
|
+
n[o] = ut(t[o], i);
|
|
299
327
|
}
|
|
300
|
-
function
|
|
301
|
-
const e =
|
|
328
|
+
function Cn(s, t) {
|
|
329
|
+
const e = tt(t);
|
|
302
330
|
if (e.intervals.length === 0) return s;
|
|
303
|
-
const n =
|
|
331
|
+
const n = ut(s, e);
|
|
304
332
|
if (!Number.isNaN(n)) return n;
|
|
305
333
|
if (!Number.isFinite(s)) return Number.NaN;
|
|
306
334
|
for (let i = 0; i < e.intervals.length; i++) {
|
|
@@ -309,12 +337,12 @@ function fn(s, t) {
|
|
|
309
337
|
}
|
|
310
338
|
return e.total;
|
|
311
339
|
}
|
|
312
|
-
function
|
|
313
|
-
const e =
|
|
314
|
-
return e.intervals.length === 0 ? !1 : Number.isNaN(
|
|
340
|
+
function $n(s, t) {
|
|
341
|
+
const e = tt(t);
|
|
342
|
+
return e.intervals.length === 0 ? !1 : Number.isNaN(ut(s, e));
|
|
315
343
|
}
|
|
316
|
-
function
|
|
317
|
-
const t =
|
|
344
|
+
function On(s) {
|
|
345
|
+
const t = tt(s), e = [];
|
|
318
346
|
for (let n = 1; n < t.intervals.length; n++)
|
|
319
347
|
e.push({
|
|
320
348
|
from: t.intervals[n - 1].to,
|
|
@@ -323,83 +351,83 @@ function pn(s) {
|
|
|
323
351
|
});
|
|
324
352
|
return e;
|
|
325
353
|
}
|
|
326
|
-
function
|
|
327
|
-
return
|
|
328
|
-
}
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
2 *
|
|
332
|
-
5 *
|
|
333
|
-
10 *
|
|
334
|
-
15 *
|
|
335
|
-
30 *
|
|
336
|
-
|
|
337
|
-
2 *
|
|
338
|
-
5 *
|
|
339
|
-
10 *
|
|
340
|
-
15 *
|
|
341
|
-
30 *
|
|
342
|
-
|
|
343
|
-
2 *
|
|
344
|
-
3 *
|
|
345
|
-
6 *
|
|
346
|
-
12 *
|
|
354
|
+
function Hn(s, t, e) {
|
|
355
|
+
return On(s).map((n) => n.operatingTime).filter((n) => n >= t && n <= e);
|
|
356
|
+
}
|
|
357
|
+
const ke = [
|
|
358
|
+
ot,
|
|
359
|
+
2 * ot,
|
|
360
|
+
5 * ot,
|
|
361
|
+
10 * ot,
|
|
362
|
+
15 * ot,
|
|
363
|
+
30 * ot,
|
|
364
|
+
V,
|
|
365
|
+
2 * V,
|
|
366
|
+
5 * V,
|
|
367
|
+
10 * V,
|
|
368
|
+
15 * V,
|
|
369
|
+
30 * V,
|
|
370
|
+
rt,
|
|
371
|
+
2 * rt,
|
|
372
|
+
3 * rt,
|
|
373
|
+
6 * rt,
|
|
374
|
+
12 * rt,
|
|
347
375
|
K,
|
|
348
376
|
2 * K,
|
|
349
377
|
7 * K,
|
|
350
378
|
14 * K,
|
|
351
379
|
28 * K
|
|
352
380
|
];
|
|
353
|
-
function
|
|
354
|
-
const e =
|
|
381
|
+
function Rn(s, t) {
|
|
382
|
+
const e = ke[0];
|
|
355
383
|
if (!Number.isFinite(s) || s <= 0) return e;
|
|
356
384
|
const n = s / Math.max(1, Math.floor(t));
|
|
357
|
-
for (const i of
|
|
358
|
-
return K *
|
|
385
|
+
for (const i of ke) if (i >= n) return i;
|
|
386
|
+
return K * lt(n / K, 1);
|
|
359
387
|
}
|
|
360
|
-
function
|
|
361
|
-
return new Date(s).getTimezoneOffset() *
|
|
388
|
+
function Ns(s) {
|
|
389
|
+
return new Date(s).getTimezoneOffset() * V;
|
|
362
390
|
}
|
|
363
|
-
function
|
|
364
|
-
const o =
|
|
391
|
+
function Wn(s, t, e, n, i = 0) {
|
|
392
|
+
const o = tt(s), r = [];
|
|
365
393
|
if (!Number.isFinite(t) || !Number.isFinite(e) || !(n > 0)) return r;
|
|
366
394
|
const l = Math.ceil((t - i) / n), a = Math.floor((e - i) / n);
|
|
367
395
|
if (!Number.isFinite(l) || !Number.isFinite(a)) return r;
|
|
368
396
|
let c = Number.NaN;
|
|
369
397
|
for (let h = l; h <= a; h++) {
|
|
370
|
-
const f = i + h * n, m =
|
|
398
|
+
const f = i + h * n, m = ut(f, o);
|
|
371
399
|
Number.isNaN(m) || m === c || (r.push({ wallClock: f, operatingTime: m }), c = m);
|
|
372
400
|
}
|
|
373
401
|
return r;
|
|
374
402
|
}
|
|
375
|
-
function
|
|
376
|
-
const o =
|
|
403
|
+
function Is(s, t, e, n, i = 0) {
|
|
404
|
+
const o = tt(s);
|
|
377
405
|
if (o.intervals.length === 0 || !(e > t)) return [];
|
|
378
|
-
const r = Math.max(0, Math.min(o.total, t)), l = Math.max(0, Math.min(o.total, e)), a =
|
|
379
|
-
return
|
|
406
|
+
const r = Math.max(0, Math.min(o.total, t)), l = Math.max(0, Math.min(o.total, e)), a = Rn(e - t, n);
|
|
407
|
+
return Wn(
|
|
380
408
|
o,
|
|
381
|
-
|
|
382
|
-
|
|
409
|
+
ht(r, o),
|
|
410
|
+
ht(l, o),
|
|
383
411
|
a,
|
|
384
412
|
i
|
|
385
413
|
).map((h) => h.operatingTime).filter((h) => h >= t && h <= e);
|
|
386
414
|
}
|
|
387
|
-
const
|
|
388
|
-
...[1, 2, 5, 10, 15, 30].map((s) => ({ unit: "minute", n: s, ms: s *
|
|
389
|
-
...[1, 2, 3, 6, 12].map((s) => ({ unit: "hour", n: s, ms: s *
|
|
415
|
+
const we = 365 * K, zn = [
|
|
416
|
+
...[1, 2, 5, 10, 15, 30].map((s) => ({ unit: "minute", n: s, ms: s * V })),
|
|
417
|
+
...[1, 2, 3, 6, 12].map((s) => ({ unit: "hour", n: s, ms: s * rt })),
|
|
390
418
|
...[1, 2, 7, 14].map((s) => ({ unit: "day", n: s, ms: s * K })),
|
|
391
419
|
...[1, 2, 3, 6].map((s) => ({ unit: "month", n: s, ms: s * 30 * K }))
|
|
392
420
|
];
|
|
393
|
-
function
|
|
421
|
+
function Bn(s, t) {
|
|
394
422
|
const e = s / Math.max(1, Math.floor(t));
|
|
395
|
-
for (const i of
|
|
396
|
-
const n = Math.max(1,
|
|
397
|
-
return { unit: "year", n, ms: n *
|
|
398
|
-
}
|
|
399
|
-
const
|
|
400
|
-
function
|
|
401
|
-
const e = new Date(s), n = [e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes()], i =
|
|
402
|
-
for (let r = i + 1; r < n.length; r++) n[r] = r ===
|
|
423
|
+
for (const i of zn) if (i.ms >= e) return i;
|
|
424
|
+
const n = Math.max(1, lt(e / we, 1));
|
|
425
|
+
return { unit: "year", n, ms: n * we };
|
|
426
|
+
}
|
|
427
|
+
const zt = { year: 0, month: 1, day: 2, hour: 3, minute: 4 };
|
|
428
|
+
function re(s, t) {
|
|
429
|
+
const e = new Date(s), n = [e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes()], i = zt[t.unit];
|
|
430
|
+
for (let r = i + 1; r < n.length; r++) n[r] = r === zt.day ? 1 : 0;
|
|
403
431
|
const o = n[i];
|
|
404
432
|
if (t.unit === "day") {
|
|
405
433
|
const r = Math.round(Date.UTC(n[0], n[1], o) / K);
|
|
@@ -408,209 +436,265 @@ function Jt(s, t) {
|
|
|
408
436
|
n[i] = Math.floor(o / t.n) * t.n;
|
|
409
437
|
return n;
|
|
410
438
|
}
|
|
411
|
-
function
|
|
439
|
+
function Dt(s, t, e) {
|
|
412
440
|
const n = s.slice();
|
|
413
|
-
return n[
|
|
441
|
+
return n[zt[t.unit]] = n[zt[t.unit]] + e * t.n, new Date(n[0], n[1], n[2], n[3], n[4]).getTime();
|
|
414
442
|
}
|
|
415
|
-
function
|
|
443
|
+
function Ne(s, t, e) {
|
|
416
444
|
const n = [];
|
|
417
445
|
if (!Number.isFinite(s) || !Number.isFinite(t)) return n;
|
|
418
|
-
const i =
|
|
446
|
+
const i = re(s, e);
|
|
419
447
|
for (let o = 0; o < 1e3; o++) {
|
|
420
|
-
const r =
|
|
448
|
+
const r = Dt(i, e, o);
|
|
421
449
|
if (r > t) break;
|
|
422
450
|
r >= s && !(r <= n[n.length - 1]) && n.push(r);
|
|
423
451
|
}
|
|
424
452
|
return n;
|
|
425
453
|
}
|
|
426
|
-
function
|
|
427
|
-
const n =
|
|
428
|
-
return [
|
|
454
|
+
function _n(s, t, e) {
|
|
455
|
+
const n = re(t, e), i = Dt(n, e, 0);
|
|
456
|
+
return [Dt(re(s, e), e, 0), i < t ? Dt(n, e, 1) : i];
|
|
429
457
|
}
|
|
430
|
-
const
|
|
458
|
+
const Xe = new Intl.DateTimeFormat("en-GB", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }), Vn = new Intl.DateTimeFormat("en-GB", {
|
|
431
459
|
hour: "2-digit",
|
|
432
460
|
minute: "2-digit",
|
|
433
461
|
second: "2-digit",
|
|
434
462
|
hourCycle: "h23"
|
|
435
|
-
}),
|
|
436
|
-
function
|
|
437
|
-
return Number.isFinite(s) ? `${
|
|
463
|
+
}), Ze = new Intl.DateTimeFormat("en-GB", { day: "numeric", month: "short" }), Yn = new Intl.DateTimeFormat("en-GB", { day: "numeric", month: "short", year: "numeric" }), Gn = new Intl.DateTimeFormat("en-GB", { month: "short", year: "numeric" }), Kn = new Intl.DateTimeFormat("en-GB", { year: "numeric" });
|
|
464
|
+
function le(s, t = !1) {
|
|
465
|
+
return Number.isFinite(s) ? `${Ze.format(s)} ${(t ? Vn : Xe).format(s)}` : "";
|
|
438
466
|
}
|
|
439
|
-
function
|
|
467
|
+
function qn(s, t) {
|
|
440
468
|
return s.map((e, n) => {
|
|
441
469
|
const i = n === 0 ? void 0 : new Date(s[n - 1]), o = new Date(e);
|
|
442
470
|
switch (t.unit) {
|
|
443
471
|
case "minute":
|
|
444
472
|
case "hour":
|
|
445
|
-
return i === void 0 || i.toDateString() !== o.toDateString() ?
|
|
473
|
+
return i === void 0 || i.toDateString() !== o.toDateString() ? le(e) : Xe.format(e);
|
|
446
474
|
case "day":
|
|
447
|
-
return i === void 0 || i.getFullYear() !== o.getFullYear() ?
|
|
475
|
+
return i === void 0 || i.getFullYear() !== o.getFullYear() ? Yn.format(e) : Ze.format(e);
|
|
448
476
|
case "month":
|
|
449
|
-
return
|
|
477
|
+
return Gn.format(e);
|
|
450
478
|
default:
|
|
451
|
-
return
|
|
479
|
+
return Kn.format(e);
|
|
452
480
|
}
|
|
453
481
|
});
|
|
454
482
|
}
|
|
455
|
-
const
|
|
483
|
+
const ae = 5, ce = 4, Xt = 8, Ie = 4, Un = 8, ct = "uc-tick-label", Lt = "uc-axis-title", je = {
|
|
456
484
|
width: 0,
|
|
457
485
|
height: 0,
|
|
458
486
|
plot: { x: 0, y: 0, width: 0, height: 0 },
|
|
459
487
|
axes: []
|
|
460
488
|
};
|
|
461
|
-
function
|
|
489
|
+
function Ae(s, t, e) {
|
|
462
490
|
const n = Math.ceil(t), i = e.get(s);
|
|
463
|
-
return i === void 0 || n > i || i - n >=
|
|
491
|
+
return i === void 0 || n > i || i - n >= Un ? (e.set(s, n), n) : i;
|
|
464
492
|
}
|
|
465
|
-
function
|
|
493
|
+
function Gt(s) {
|
|
466
494
|
return s.calendar !== void 0 && s.calendar.length > 0 ? s.calendar : void 0;
|
|
467
495
|
}
|
|
468
|
-
function
|
|
469
|
-
return s[1] - s[0] >=
|
|
496
|
+
function Je(s) {
|
|
497
|
+
return s[1] - s[0] >= V;
|
|
470
498
|
}
|
|
471
|
-
function
|
|
472
|
-
return
|
|
499
|
+
function Bt(s, t) {
|
|
500
|
+
return Bn(s[1] - s[0], t);
|
|
473
501
|
}
|
|
474
|
-
function
|
|
502
|
+
function Zt(s, t) {
|
|
475
503
|
const e = s.domainMode;
|
|
476
504
|
if (Array.isArray(e)) {
|
|
477
505
|
const o = e;
|
|
478
506
|
return o[0] === o[1] ? [o[0] - 1, o[1] + 1] : o;
|
|
479
507
|
}
|
|
480
508
|
const [n, i] = s.extent;
|
|
481
|
-
return
|
|
509
|
+
return Gt(s) !== void 0 || e === "data" ? Ut(n, i) : s.time === !0 ? Je([n, i]) ? _n(n, i, Bt([n, i], t)) : Ut(n, i) : Ln(n, i, t);
|
|
482
510
|
}
|
|
483
|
-
function
|
|
484
|
-
const n =
|
|
511
|
+
function Te(s, t, e) {
|
|
512
|
+
const n = Gt(s);
|
|
485
513
|
if (s.tickValues !== void 0)
|
|
486
|
-
return (n !== void 0 ? s.tickValues.map((o) =>
|
|
514
|
+
return (n !== void 0 ? s.tickValues.map((o) => ut(o, n)) : s.tickValues).filter((o) => o >= t[0] && o <= t[1]);
|
|
487
515
|
if (n !== void 0) {
|
|
488
|
-
const i =
|
|
489
|
-
for (const l of
|
|
490
|
-
const a =
|
|
516
|
+
const i = tt(n), o = (l) => ht(Math.min(Math.max(l, 0), i.total), i), r = [];
|
|
517
|
+
for (const l of Ne(o(t[0]), o(t[1]), Bt(t, e))) {
|
|
518
|
+
const a = ut(l, i);
|
|
491
519
|
Number.isNaN(a) || a === r[r.length - 1] || a >= t[0] && a <= t[1] && r.push(a);
|
|
492
520
|
}
|
|
493
521
|
return r;
|
|
494
522
|
}
|
|
495
|
-
return s.time === !0 ?
|
|
523
|
+
return s.time === !0 ? Je(t) ? Ne(t[0], t[1], Bt(t, e)) : [] : Ke(t[0], t[1], e);
|
|
496
524
|
}
|
|
497
|
-
function
|
|
498
|
-
const n = s.tickFormat, i =
|
|
525
|
+
function Me(s, t, e) {
|
|
526
|
+
const n = s.tickFormat, i = Gt(s);
|
|
499
527
|
if (i !== void 0)
|
|
500
|
-
return n !== void 0 ? (r) => n(
|
|
528
|
+
return n !== void 0 ? (r) => n(ht(r, i)) : (r, l) => le(ht(r, i), l);
|
|
501
529
|
if (n !== void 0) return (r) => n(r);
|
|
502
|
-
if (s.time === !0) return
|
|
503
|
-
const o =
|
|
504
|
-
return (r) =>
|
|
530
|
+
if (s.time === !0) return le;
|
|
531
|
+
const o = lt(Math.abs(t[1] - t[0]), e);
|
|
532
|
+
return (r) => Ue(r, o);
|
|
505
533
|
}
|
|
506
|
-
function
|
|
507
|
-
const o =
|
|
534
|
+
function Se(s, t, e, n, i) {
|
|
535
|
+
const o = Gt(s);
|
|
508
536
|
if (s.tickFormat !== void 0 || s.time !== !0 && o === void 0) return n.map(i);
|
|
509
|
-
const r = o === void 0 ? n : n.map((l) =>
|
|
510
|
-
return
|
|
537
|
+
const r = o === void 0 ? n : n.map((l) => ht(l, o));
|
|
538
|
+
return qn(r, Bt(t, e));
|
|
511
539
|
}
|
|
512
|
-
function
|
|
540
|
+
function Qe(s, t, e) {
|
|
513
541
|
return Math.min(Math.max(s, 0), Math.max(0, e - t));
|
|
514
542
|
}
|
|
515
|
-
function
|
|
516
|
-
const { width: t, height: e, padding: n, axes: i, measure: o, hysteresis: r } = s, l = i.filter((
|
|
517
|
-
for (const
|
|
518
|
-
const
|
|
519
|
-
m.set(
|
|
520
|
-
}
|
|
521
|
-
const p = (
|
|
522
|
-
let
|
|
523
|
-
for (let F = 0; F <
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
}
|
|
527
|
-
return
|
|
528
|
-
}, u = n.top + p(c, m),
|
|
529
|
-
for (const
|
|
530
|
-
const
|
|
531
|
-
let
|
|
532
|
-
for (const W of
|
|
533
|
-
for (const W of
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
543
|
+
function Xn(s) {
|
|
544
|
+
const { width: t, height: e, padding: n, axes: i, measure: o, hysteresis: r } = s, l = i.filter((I) => I.position === "left"), a = i.filter((I) => I.position === "right"), c = i.filter((I) => I.position === "top"), h = i.filter((I) => I.position === "bottom"), f = Math.ceil(o("0", ct).height) || 14, m = /* @__PURE__ */ new Map();
|
|
545
|
+
for (const I of [...c, ...h]) {
|
|
546
|
+
const P = I.label === void 0 || I.label === "" ? 0 : Math.ceil(o(I.label, Lt).height) + Ie;
|
|
547
|
+
m.set(I.key, Ae(I.key, ae + ce + f + P, r));
|
|
548
|
+
}
|
|
549
|
+
const p = (I, P) => {
|
|
550
|
+
let N = 0;
|
|
551
|
+
for (let F = 0; F < I.length; F++) {
|
|
552
|
+
const B = I[F];
|
|
553
|
+
B !== void 0 && (N += P.get(B.key) ?? 0, F > 0 && (N += Xt));
|
|
554
|
+
}
|
|
555
|
+
return N;
|
|
556
|
+
}, u = n.top + p(c, m), g = e - n.bottom - p(h, m), d = Math.max(0, g - u), y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), v = i.find((I) => I.orientation === "y");
|
|
557
|
+
for (const I of [...l, ...a].sort((P, N) => P === v ? -1 : N === v ? 1 : 0)) {
|
|
558
|
+
const P = I.tickCount ?? Math.max(2, Math.round(d / 50)), N = v === void 0 ? void 0 : y.get(v.key), [F, B] = Array.isArray(I.domainMode) ? Zt(I, P) : I.extent, E = I.alignTicks === !0 && I !== v && N !== void 0 ? En(F, B, N.domain, N.values) : null, M = (E == null ? void 0 : E.domain) ?? Zt(I, P), C = (E == null ? void 0 : E.ticks) ?? Te(I, M, P), q = E === null ? Me(I, M, P) : I.tickFormat ?? ((W) => Ue(W, E.step)), Y = Se(I, M, P, C, q), Z = Y.map((W) => o(W, ct).width);
|
|
559
|
+
let R = 0;
|
|
560
|
+
for (const W of Z) W > R && (R = W);
|
|
561
|
+
for (const W of I.limitLabels ?? []) R = Math.max(R, o(W, ct).width + 4);
|
|
562
|
+
const j = I.label === void 0 || I.label === "" ? 0 : Math.ceil(o(I.label, Lt).height) + Ie;
|
|
563
|
+
y.set(I.key, { axis: I, domain: M, values: C, labels: Y, widths: Z, format: q }), b.set(
|
|
564
|
+
I.key,
|
|
565
|
+
Ae(I.key, ae + ce + R + j, r)
|
|
538
566
|
);
|
|
539
567
|
}
|
|
540
|
-
const
|
|
541
|
-
switch (
|
|
568
|
+
const w = n.left + p(l, b), L = t - n.right - p(a, b), A = Math.max(0, L - w), z = { x: w, y: u, width: A, height: d }, T = (I, P, N, F) => {
|
|
569
|
+
switch (I.position) {
|
|
542
570
|
case "left":
|
|
543
|
-
return { x:
|
|
571
|
+
return { x: w - N - F, y: u, width: F, height: d };
|
|
544
572
|
case "right":
|
|
545
|
-
return { x:
|
|
573
|
+
return { x: L + N, y: u, width: F, height: d };
|
|
546
574
|
case "top":
|
|
547
|
-
return { x:
|
|
575
|
+
return { x: w, y: u - N - F, width: A, height: F };
|
|
548
576
|
default:
|
|
549
|
-
return { x:
|
|
550
|
-
}
|
|
551
|
-
},
|
|
552
|
-
let
|
|
553
|
-
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
const
|
|
557
|
-
value:
|
|
558
|
-
label: (
|
|
559
|
-
px: Y.toPx(
|
|
577
|
+
return { x: w, y: g + N, width: A, height: F };
|
|
578
|
+
}
|
|
579
|
+
}, S = [], _ = (I) => {
|
|
580
|
+
let P = 0;
|
|
581
|
+
I.forEach((N, F) => {
|
|
582
|
+
const B = b.get(N.key) ?? 0, E = y.get(N.key), M = T(N, F, P, B);
|
|
583
|
+
P += B + Xt;
|
|
584
|
+
const C = (E == null ? void 0 : E.domain) ?? [0, 1], q = (E == null ? void 0 : E.format) ?? ((R) => String(R)), Y = new be(C, [u + d, u]), Z = ((E == null ? void 0 : E.values) ?? []).map((R, j) => ({
|
|
585
|
+
value: R,
|
|
586
|
+
label: (E == null ? void 0 : E.labels[j]) ?? "",
|
|
587
|
+
px: Y.toPx(R),
|
|
560
588
|
labelLeft: 0,
|
|
561
|
-
labelWidth: (
|
|
589
|
+
labelWidth: (E == null ? void 0 : E.widths[j]) ?? 0
|
|
562
590
|
}));
|
|
563
|
-
|
|
564
|
-
key:
|
|
565
|
-
id:
|
|
591
|
+
S.push({
|
|
592
|
+
key: N.key,
|
|
593
|
+
id: N.id,
|
|
566
594
|
orientation: "y",
|
|
567
|
-
position:
|
|
568
|
-
label:
|
|
569
|
-
grid:
|
|
570
|
-
band:
|
|
571
|
-
size:
|
|
595
|
+
position: N.position,
|
|
596
|
+
label: N.label,
|
|
597
|
+
grid: N.grid,
|
|
598
|
+
band: M,
|
|
599
|
+
size: B,
|
|
572
600
|
stack: F,
|
|
573
|
-
domain:
|
|
601
|
+
domain: C,
|
|
574
602
|
scale: Y,
|
|
575
|
-
ticks:
|
|
576
|
-
format:
|
|
577
|
-
titleSize:
|
|
603
|
+
ticks: Z,
|
|
604
|
+
format: q,
|
|
605
|
+
titleSize: N.label === void 0 || N.label === "" ? 0 : Math.ceil(o(N.label, Lt).height),
|
|
578
606
|
breaks: []
|
|
579
607
|
});
|
|
580
608
|
});
|
|
581
609
|
};
|
|
582
610
|
_(l), _(a);
|
|
583
|
-
const
|
|
584
|
-
let
|
|
585
|
-
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
const
|
|
589
|
-
const
|
|
590
|
-
return { value: W, label:
|
|
611
|
+
const X = (I) => {
|
|
612
|
+
let P = 0;
|
|
613
|
+
I.forEach((N, F) => {
|
|
614
|
+
const B = m.get(N.key) ?? 0, E = T(N, F, P, B);
|
|
615
|
+
P += B + Xt;
|
|
616
|
+
const M = N.tickCount ?? Math.max(2, Math.round(A / 80)), C = Zt(N, M), q = Te(N, C, M), Y = Me(N, C, M), Z = Se(N, C, M, q, Y), R = new be(C, [w, w + A]), j = q.map((W, At) => {
|
|
617
|
+
const J = Z[At] ?? "", et = o(J, ct).width, at = R.toPx(W), Tt = Qe(at - et / 2, et, t);
|
|
618
|
+
return { value: W, label: J, px: at, labelLeft: Tt, labelWidth: et };
|
|
591
619
|
});
|
|
592
|
-
|
|
593
|
-
key:
|
|
594
|
-
id:
|
|
620
|
+
S.push({
|
|
621
|
+
key: N.key,
|
|
622
|
+
id: N.id,
|
|
595
623
|
orientation: "x",
|
|
596
|
-
position:
|
|
597
|
-
label:
|
|
598
|
-
grid:
|
|
599
|
-
band:
|
|
600
|
-
size:
|
|
624
|
+
position: N.position,
|
|
625
|
+
label: N.label,
|
|
626
|
+
grid: N.grid,
|
|
627
|
+
band: E,
|
|
628
|
+
size: B,
|
|
601
629
|
stack: F,
|
|
602
|
-
domain:
|
|
603
|
-
scale:
|
|
604
|
-
ticks:
|
|
630
|
+
domain: C,
|
|
631
|
+
scale: R,
|
|
632
|
+
ticks: j,
|
|
605
633
|
format: Y,
|
|
606
|
-
titleSize:
|
|
607
|
-
breaks:
|
|
634
|
+
titleSize: N.label === void 0 || N.label === "" ? 0 : Math.ceil(o(N.label, Lt).height),
|
|
635
|
+
breaks: N.calendar === void 0 || N.calendar.length === 0 ? [] : Hn(N.calendar, C[0], C[1]).map((W) => R.toPx(W))
|
|
608
636
|
});
|
|
609
637
|
});
|
|
610
638
|
};
|
|
611
|
-
return
|
|
639
|
+
return X(c), X(h), { width: t, height: e, plot: z, axes: S };
|
|
640
|
+
}
|
|
641
|
+
const Le = [[], [7, 4], [1, 4], [7, 3, 1, 3], [14, 4], [7, 3, 1, 3, 1, 3]], Zn = ["circle", "square", "triangle", "diamond", "triangleDown", "plus"], ue = ["none", "rising", "falling", "horizontal", "vertical", "crossed"];
|
|
642
|
+
function jn(s) {
|
|
643
|
+
const t = tn(s, Le.length);
|
|
644
|
+
return { dash: Le[t], marker: Zn[t], hatch: ue[t] };
|
|
645
|
+
}
|
|
646
|
+
function Pt(s) {
|
|
647
|
+
return ue[tn(s, ue.length)];
|
|
648
|
+
}
|
|
649
|
+
function Jn(s) {
|
|
650
|
+
const t = /* @__PURE__ */ new Map();
|
|
651
|
+
for (const e of s) for (const { label: n } of e) t.has(n) || t.set(n, Pt(t.size));
|
|
652
|
+
return t;
|
|
653
|
+
}
|
|
654
|
+
function tn(s, t) {
|
|
655
|
+
return (s % t + t) % t;
|
|
656
|
+
}
|
|
657
|
+
function en(s, t, e) {
|
|
658
|
+
const n = [];
|
|
659
|
+
if (t === "none" || !(e > 0) || !(s.width > 0) || !(s.height > 0)) return n;
|
|
660
|
+
const { x: i, y: o, width: r, height: l } = s, a = (c) => Math.ceil(c / e) * e;
|
|
661
|
+
if (t === "rising" || t === "crossed")
|
|
662
|
+
for (let c = a(i + o); c <= i + r + o + l; c += e) n.push(c - o - l, o + l, c - o, o);
|
|
663
|
+
if (t === "falling" || t === "crossed")
|
|
664
|
+
for (let c = a(i - o - l); c <= i + r - o; c += e) n.push(c + o, o, c + o + l, o + l);
|
|
665
|
+
if (t === "horizontal")
|
|
666
|
+
for (let c = a(o); c <= o + l; c += e) n.push(i, c, i + r, c);
|
|
667
|
+
if (t === "vertical")
|
|
668
|
+
for (let c = a(i); c <= i + r; c += e) n.push(c, o, c, o + l);
|
|
669
|
+
return n;
|
|
670
|
+
}
|
|
671
|
+
function pe(s, t, e, n, i) {
|
|
672
|
+
const o = (r) => {
|
|
673
|
+
r.forEach(([l, a], c) => c === 0 ? s.moveTo(e + l * i, n + a * i) : s.lineTo(e + l * i, n + a * i)), s.closePath();
|
|
674
|
+
};
|
|
675
|
+
switch (t) {
|
|
676
|
+
case "circle":
|
|
677
|
+
s.moveTo(e + i, n), s.arc(e, n, i, 0, Math.PI * 2);
|
|
678
|
+
return;
|
|
679
|
+
case "square":
|
|
680
|
+
o([[-0.89, -0.89], [0.89, -0.89], [0.89, 0.89], [-0.89, 0.89]]);
|
|
681
|
+
return;
|
|
682
|
+
case "triangle":
|
|
683
|
+
o([[0, -1.35], [1.17, 0.68], [-1.17, 0.68]]);
|
|
684
|
+
return;
|
|
685
|
+
case "triangleDown":
|
|
686
|
+
o([[0, 1.35], [1.17, -0.68], [-1.17, -0.68]]);
|
|
687
|
+
return;
|
|
688
|
+
case "diamond":
|
|
689
|
+
o([[0, -1.25], [1.25, 0], [0, 1.25], [-1.25, 0]]);
|
|
690
|
+
return;
|
|
691
|
+
case "plus": {
|
|
692
|
+
o([[-0.42, -1.2], [0.42, -1.2], [0.42, -0.42], [1.2, -0.42], [1.2, 0.42], [0.42, 0.42], [0.42, 1.2], [-0.42, 1.2], [-0.42, 0.42], [-1.2, 0.42], [-1.2, -0.42], [-0.42, -0.42]]);
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
612
696
|
}
|
|
613
|
-
function
|
|
697
|
+
function Ee(s, t, e) {
|
|
614
698
|
if (t <= 0 || !(e >= s[0])) return -1;
|
|
615
699
|
let n = 0, i = t - 1;
|
|
616
700
|
if (s[i] <= e) return i;
|
|
@@ -620,14 +704,14 @@ function ge(s, t, e) {
|
|
|
620
704
|
}
|
|
621
705
|
return n;
|
|
622
706
|
}
|
|
623
|
-
function
|
|
707
|
+
function nn(s, t, e, n) {
|
|
624
708
|
return e + 1 < t ? s[e + 1] : n;
|
|
625
709
|
}
|
|
626
|
-
function
|
|
710
|
+
function Qn(s, t, e, n, i) {
|
|
627
711
|
const o = s[t - 1], r = e > o ? e : n > 0 ? o + n : i;
|
|
628
712
|
return Math.min(r, i);
|
|
629
713
|
}
|
|
630
|
-
function
|
|
714
|
+
function ti(s, t) {
|
|
631
715
|
const e = [];
|
|
632
716
|
for (let n = 1; n < t; n++) {
|
|
633
717
|
const i = s[n] - s[n - 1];
|
|
@@ -635,10 +719,10 @@ function Ln(s, t) {
|
|
|
635
719
|
}
|
|
636
720
|
return e.length === 0 ? 0 : (e.sort((n, i) => n - i), e[e.length - 1 >> 1]);
|
|
637
721
|
}
|
|
638
|
-
function
|
|
722
|
+
function vt(s) {
|
|
639
723
|
return Math.round(s) + 0.5;
|
|
640
724
|
}
|
|
641
|
-
function
|
|
725
|
+
function ei(s, t) {
|
|
642
726
|
const { plot: e, axes: n, theme: i } = t, o = e.x, r = e.x + e.width, l = e.y, a = e.y + e.height;
|
|
643
727
|
s.lineWidth = 1;
|
|
644
728
|
for (const c of n)
|
|
@@ -650,182 +734,197 @@ function Fn(s, t) {
|
|
|
650
734
|
for (const p of c.ticks)
|
|
651
735
|
if ((c.orientation === "y" && p.value === 0) === f)
|
|
652
736
|
if (m = !0, c.orientation === "y") {
|
|
653
|
-
const
|
|
654
|
-
s.moveTo(o,
|
|
737
|
+
const g = vt(p.px);
|
|
738
|
+
s.moveTo(o, g), s.lineTo(r, g);
|
|
655
739
|
} else {
|
|
656
|
-
const
|
|
657
|
-
s.moveTo(
|
|
740
|
+
const g = vt(p.px);
|
|
741
|
+
s.moveTo(g, l), s.lineTo(g, a);
|
|
658
742
|
}
|
|
659
743
|
m && (s.strokeStyle = f ? i.colorAxis : i.colorGrid, s.stroke());
|
|
660
744
|
}
|
|
661
745
|
}
|
|
662
|
-
const
|
|
663
|
-
function
|
|
746
|
+
const ni = 6;
|
|
747
|
+
function Nt(s, t, e, n, i) {
|
|
748
|
+
if (n === "none") return;
|
|
749
|
+
const o = en(e, n, ni), r = new Path2D();
|
|
750
|
+
for (let l = 0; l < o.length; l += 4)
|
|
751
|
+
r.moveTo(o[l], o[l + 1]), r.lineTo(o[l + 2], o[l + 3]);
|
|
752
|
+
s.save(), s.clip(t), s.strokeStyle = i, s.lineWidth = 1, s.setLineDash([]), s.stroke(r), s.restore();
|
|
753
|
+
}
|
|
754
|
+
const ii = 60;
|
|
755
|
+
function si(s, t, e) {
|
|
664
756
|
return (e === 0 || Number.isNaN(s[e - 1])) && (e === t - 1 || Number.isNaN(s[e + 1]));
|
|
665
757
|
}
|
|
666
|
-
function
|
|
758
|
+
function oi(s, t) {
|
|
667
759
|
const e = t.length, n = t.xScale.m, i = t.xScale.b, o = t.yScale.m, r = t.yScale.b, l = t.x, a = t.y, c = t.step === !0, h = new Path2D();
|
|
668
760
|
let f = !1, m = 0;
|
|
669
761
|
for (let p = 0; p < e; p++) {
|
|
670
|
-
const u = a[p],
|
|
762
|
+
const u = a[p], g = l[p] * n + i;
|
|
671
763
|
if (Number.isNaN(u)) {
|
|
672
|
-
c && f && h.lineTo(
|
|
764
|
+
c && f && h.lineTo(g, m), f = !1;
|
|
673
765
|
continue;
|
|
674
766
|
}
|
|
675
|
-
const
|
|
676
|
-
f ? (c && h.lineTo(
|
|
767
|
+
const d = u * o + r;
|
|
768
|
+
f ? (c && h.lineTo(g, m), h.lineTo(g, d)) : (h.moveTo(g, d), f = !0), m = d;
|
|
677
769
|
}
|
|
678
770
|
if (s.strokeStyle = t.color, s.lineWidth = t.strokeWidth, t.dash !== void 0 && t.dash.length > 0 ? s.setLineDash(t.dash) : s.setLineDash([]), s.stroke(h), s.setLineDash([]), t.markers !== "never") {
|
|
679
|
-
const p = t.markers === "always" || e <=
|
|
771
|
+
const p = t.markers === "always" || e <= ii, u = t.strokeWidth + 1.5, g = t.marker ?? "circle", d = new Path2D();
|
|
680
772
|
for (let y = 0; y < e; y++) {
|
|
681
|
-
const
|
|
682
|
-
if (Number.isNaN(
|
|
683
|
-
const
|
|
684
|
-
d
|
|
773
|
+
const b = a[y];
|
|
774
|
+
if (Number.isNaN(b) || !p && !si(a, e, y)) continue;
|
|
775
|
+
const v = l[y] * n + i, w = b * o + r;
|
|
776
|
+
pe(d, g, v, w, u);
|
|
685
777
|
}
|
|
686
778
|
s.fillStyle = t.color, s.fill(d);
|
|
687
779
|
}
|
|
688
780
|
}
|
|
689
|
-
function
|
|
690
|
-
const
|
|
691
|
-
let
|
|
692
|
-
for (;
|
|
693
|
-
for (;
|
|
694
|
-
|
|
695
|
-
if (
|
|
696
|
-
const
|
|
697
|
-
for (;
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
701
|
-
const
|
|
702
|
-
|
|
781
|
+
function ri(s, t, e, n) {
|
|
782
|
+
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, h = t.y, f = t.y0, m = t.baseline * l + a, p = new Path2D(), u = new Path2D(), g = new Path2D();
|
|
783
|
+
let d = 0;
|
|
784
|
+
for (; d < i; ) {
|
|
785
|
+
for (; d < i && (Number.isNaN(h[d]) || f !== null && Number.isNaN(f[d])); )
|
|
786
|
+
d++;
|
|
787
|
+
if (d >= i) break;
|
|
788
|
+
const y = d;
|
|
789
|
+
for (; d < i && !Number.isNaN(h[d]) && (f === null || !Number.isNaN(f[d])); )
|
|
790
|
+
d++;
|
|
791
|
+
const b = d - 1;
|
|
792
|
+
if (y === b) {
|
|
793
|
+
const v = c[y] * o + r;
|
|
794
|
+
g.moveTo(v, f === null ? m : f[y] * l + a), g.lineTo(v, h[y] * l + a);
|
|
703
795
|
continue;
|
|
704
796
|
}
|
|
705
|
-
for (let
|
|
706
|
-
const
|
|
707
|
-
|
|
797
|
+
for (let v = y; v <= b; v++) {
|
|
798
|
+
const w = c[v] * o + r, L = h[v] * l + a;
|
|
799
|
+
v === y ? (p.moveTo(w, L), u.moveTo(w, L)) : (p.lineTo(w, L), u.lineTo(w, L));
|
|
708
800
|
}
|
|
709
|
-
if (
|
|
710
|
-
|
|
801
|
+
if (f === null)
|
|
802
|
+
p.lineTo(c[b] * o + r, m), p.lineTo(c[y] * o + r, m);
|
|
711
803
|
else
|
|
712
|
-
for (let
|
|
713
|
-
|
|
714
|
-
|
|
804
|
+
for (let v = b; v >= y; v--)
|
|
805
|
+
p.lineTo(c[v] * o + r, f[v] * l + a);
|
|
806
|
+
p.closePath();
|
|
715
807
|
}
|
|
716
|
-
s.globalAlpha = t.alpha * t.fillOpacity, s.fillStyle = t.color, s.fill(
|
|
808
|
+
s.globalAlpha = t.alpha * t.fillOpacity, s.fillStyle = t.color, s.fill(p), s.globalAlpha = t.alpha, Nt(s, p, e, t.hatch ?? "none", t.color), t.edges === !0 && (s.setLineDash([]), s.strokeStyle = n, s.lineWidth = t.strokeWidth + 2, s.stroke(u)), s.strokeStyle = t.color, t.strokeWidth > 0 && (s.setLineDash(t.dash ?? []), s.lineWidth = t.strokeWidth, s.stroke(u)), s.setLineDash([]), s.lineWidth = Math.max(1, t.strokeWidth), s.stroke(g);
|
|
717
809
|
}
|
|
718
|
-
function
|
|
719
|
-
const
|
|
720
|
-
for (let
|
|
721
|
-
const
|
|
722
|
-
if (Number.isNaN(
|
|
723
|
-
const
|
|
724
|
-
|
|
810
|
+
function li(s, t, e, n) {
|
|
811
|
+
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, h = t.y, f = t.y0, m = t.baseline * l + a, p = t.offset * o, u = t.width * o, g = new Path2D(), d = t.edges === !0 && f !== null ? new Path2D() : null;
|
|
812
|
+
for (let y = 0; y < i; y++) {
|
|
813
|
+
const b = h[y];
|
|
814
|
+
if (Number.isNaN(b)) continue;
|
|
815
|
+
const v = c[y] * o + r + p, w = b * l + a, L = f === null ? m : f[y] * l + a;
|
|
816
|
+
g.rect(v, w, u, L - w), d !== null && (f == null ? void 0 : f[y]) !== 0 && (d.moveTo(v, L), d.lineTo(v + u, L));
|
|
725
817
|
}
|
|
726
|
-
s.fillStyle = t.color, s.fill(
|
|
818
|
+
s.fillStyle = t.color, s.fill(g), Nt(s, g, e, t.hatch ?? "none", n), d !== null && (s.strokeStyle = n, s.lineWidth = 1, s.setLineDash([]), s.stroke(d));
|
|
727
819
|
}
|
|
728
|
-
function
|
|
729
|
-
const e = t.length, n = t.xScale.m, i = t.xScale.b, o = t.yScale.m, r = t.yScale.b, l = t.x, a = t.y, c = t.radius, h = new Path2D();
|
|
730
|
-
for (let f = 0; f < e; f++) {
|
|
731
|
-
const m = a[f];
|
|
732
|
-
if (Number.isNaN(m)) continue;
|
|
733
|
-
const p = l[f] * n + i, u = m * o + r;
|
|
734
|
-
h.moveTo(p + c, u), h.arc(p, u, c, 0, Math.PI * 2);
|
|
735
|
-
}
|
|
736
|
-
s.fillStyle = t.color, s.fill(h);
|
|
737
|
-
}
|
|
738
|
-
function Hn(s, t) {
|
|
739
|
-
const e = t.length, n = t.xScale.m, i = t.xScale.b, o = t.x, r = t.y, l = t.laneTop, a = t.laneBottom - t.laneTop, c = t.colors.length;
|
|
740
|
-
if (c === 0 || a <= 0) return;
|
|
741
|
-
const h = [];
|
|
742
|
-
for (let m = 0; m < c; m++) h.push(new Path2D());
|
|
743
|
-
let f = !1;
|
|
820
|
+
function ai(s, t) {
|
|
821
|
+
const e = t.length, n = t.xScale.m, i = t.xScale.b, o = t.yScale.m, r = t.yScale.b, l = t.x, a = t.y, c = t.radius, h = t.marker ?? "circle", f = new Path2D();
|
|
744
822
|
for (let m = 0; m < e; m++) {
|
|
745
|
-
const p =
|
|
823
|
+
const p = a[m];
|
|
746
824
|
if (Number.isNaN(p)) continue;
|
|
747
|
-
const u =
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
const d =
|
|
763
|
-
if (
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
825
|
+
const u = l[m] * n + i, g = p * o + r;
|
|
826
|
+
pe(f, h, u, g, c);
|
|
827
|
+
}
|
|
828
|
+
s.fillStyle = t.color, s.fill(f);
|
|
829
|
+
}
|
|
830
|
+
function ci(s, t, e, n) {
|
|
831
|
+
var u;
|
|
832
|
+
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.x, a = t.y, c = t.laneTop, h = t.laneBottom - t.laneTop, f = t.colors.length;
|
|
833
|
+
if (f === 0 || h <= 0) return;
|
|
834
|
+
const m = [];
|
|
835
|
+
for (let g = 0; g < f; g++) m.push(new Path2D());
|
|
836
|
+
let p = !1;
|
|
837
|
+
for (let g = 0; g < i; g++) {
|
|
838
|
+
const d = a[g];
|
|
839
|
+
if (Number.isNaN(d)) continue;
|
|
840
|
+
const y = d | 0, b = m[y];
|
|
841
|
+
if (b === void 0) continue;
|
|
842
|
+
const v = l[g], w = nn(l, i, g, t.lastEnd);
|
|
843
|
+
w > v && (b.rect(v * o + r, c, (w - v) * o, h), p = !0);
|
|
844
|
+
}
|
|
845
|
+
if (p)
|
|
846
|
+
for (let g = 0; g < f; g++)
|
|
847
|
+
s.fillStyle = t.colors[g], s.fill(m[g]), Nt(s, m[g], e, ((u = t.hatches) == null ? void 0 : u[g]) ?? "none", n);
|
|
848
|
+
}
|
|
849
|
+
function ui(s, t, e, n) {
|
|
850
|
+
var d;
|
|
851
|
+
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, h = t.y, f = t.buckets, m = t.colors.length;
|
|
852
|
+
if (m === 0) return;
|
|
853
|
+
const p = t.width * o, u = Math.abs(t.height * l), g = [];
|
|
854
|
+
for (let y = 0; y < m; y++) g.push(new Path2D());
|
|
855
|
+
for (let y = 0; y < i; y++) {
|
|
856
|
+
const b = f[y];
|
|
857
|
+
if (b < 0) continue;
|
|
858
|
+
const v = g[b];
|
|
859
|
+
if (v === void 0) continue;
|
|
860
|
+
const w = c[y] * o + r - p / 2, L = h[y] * l + a - u / 2;
|
|
861
|
+
v.rect(w, L, p, u);
|
|
862
|
+
}
|
|
863
|
+
for (let y = 0; y < m; y++)
|
|
864
|
+
s.fillStyle = t.colors[y], s.fill(g[y]), Nt(s, g[y], e, ((d = t.hatches) == null ? void 0 : d[y]) ?? "none", n);
|
|
865
|
+
}
|
|
866
|
+
function Fe(s, t, e) {
|
|
773
867
|
for (const n of e) {
|
|
774
868
|
if (n.band) {
|
|
775
869
|
const i = Math.min(n.fromPx, n.toPx), o = Math.max(n.fromPx, n.toPx);
|
|
776
|
-
s.fillStyle = n.color, s.save(), s.globalAlpha = 0.12, n.
|
|
870
|
+
if (s.fillStyle = n.color, s.save(), s.globalAlpha = 0.12, n.hatch !== !0) {
|
|
871
|
+
n.orientation === "y" ? s.fillRect(t.x, i, t.width, o - i) : s.fillRect(i, t.y, o - i, t.height), s.restore();
|
|
872
|
+
continue;
|
|
873
|
+
}
|
|
874
|
+
const r = new Path2D();
|
|
875
|
+
n.orientation === "y" ? r.rect(t.x, i, t.width, o - i) : r.rect(i, t.y, o - i, t.height), s.fill(r), s.globalAlpha = 0.5, Nt(s, r, t, "rising", n.color), s.restore();
|
|
777
876
|
continue;
|
|
778
877
|
}
|
|
779
878
|
if (s.beginPath(), n.orientation === "y") {
|
|
780
|
-
const i =
|
|
879
|
+
const i = vt(n.fromPx);
|
|
781
880
|
s.moveTo(t.x, i), s.lineTo(t.x + t.width, i);
|
|
782
881
|
} else {
|
|
783
|
-
const i =
|
|
882
|
+
const i = vt(n.fromPx);
|
|
784
883
|
s.moveTo(i, t.y), s.lineTo(i, t.y + t.height);
|
|
785
884
|
}
|
|
786
885
|
s.strokeStyle = n.color, s.lineWidth = 1, s.setLineDash(n.dash), s.stroke(), s.setLineDash([]);
|
|
787
886
|
}
|
|
788
887
|
}
|
|
789
|
-
function
|
|
888
|
+
function hi(s, t) {
|
|
790
889
|
const { width: e, height: n, plot: i, series: o } = t;
|
|
791
890
|
if (s.clearRect(0, 0, e, n), !(i.width <= 0 || i.height <= 0)) {
|
|
792
|
-
|
|
891
|
+
ei(s, t), s.save(), s.beginPath(), s.rect(i.x, i.y, i.width, i.height), s.clip(), s.lineJoin = "round", s.lineCap = "round", s.globalAlpha = 1, Fe(s, i, t.limitBands);
|
|
793
892
|
for (const r of o)
|
|
794
893
|
if (r.length !== 0)
|
|
795
894
|
switch (s.globalAlpha = r.alpha, r.kind) {
|
|
796
895
|
case "line":
|
|
797
|
-
|
|
896
|
+
oi(s, r);
|
|
798
897
|
break;
|
|
799
898
|
case "area":
|
|
800
|
-
|
|
899
|
+
ri(s, r, i, t.theme.colorBg);
|
|
801
900
|
break;
|
|
802
901
|
case "bar":
|
|
803
|
-
|
|
902
|
+
li(s, r, i, t.theme.colorBg);
|
|
804
903
|
break;
|
|
805
904
|
case "scatter":
|
|
806
|
-
|
|
905
|
+
ai(s, r);
|
|
807
906
|
break;
|
|
808
907
|
case "state":
|
|
809
|
-
|
|
908
|
+
ci(s, r, i, t.theme.colorBg);
|
|
810
909
|
break;
|
|
811
910
|
case "matrix":
|
|
812
|
-
|
|
911
|
+
ui(s, r, i, t.theme.colorBg);
|
|
813
912
|
break;
|
|
814
913
|
}
|
|
815
|
-
s.globalAlpha = 1,
|
|
914
|
+
s.globalAlpha = 1, Fe(s, i, t.limitLines), s.restore();
|
|
816
915
|
}
|
|
817
916
|
}
|
|
818
|
-
function
|
|
917
|
+
function di(s, t) {
|
|
819
918
|
const { width: e, height: n, plot: i, theme: o, hover: r } = t;
|
|
820
919
|
s.clearRect(0, 0, e, n);
|
|
821
920
|
const l = (r == null ? void 0 : r.hit.xPx) ?? t.syncPx;
|
|
822
921
|
if (l === null || i.width <= 0 || i.height <= 0) return;
|
|
823
|
-
const a =
|
|
922
|
+
const a = vt(l);
|
|
824
923
|
a >= i.x && a <= i.x + i.width && (s.beginPath(), s.moveTo(a, i.y), s.lineTo(a, i.y + i.height), s.lineWidth = 1, s.strokeStyle = o.colorAxis, s.setLineDash([]), s.stroke());
|
|
825
924
|
for (const c of (r == null ? void 0 : r.marker) ?? [])
|
|
826
925
|
c.x < i.x || c.x > i.x + i.width || c.y < i.y || c.y > i.y + i.height || (s.beginPath(), s.arc(c.x, c.y, 5.5, 0, Math.PI * 2), s.fillStyle = o.colorBg, s.fill(), s.beginPath(), s.arc(c.x, c.y, 3.5, 0, Math.PI * 2), s.fillStyle = c.color, s.fill());
|
|
827
926
|
}
|
|
828
|
-
function
|
|
927
|
+
function he(s, t, e) {
|
|
829
928
|
if (t <= 0) return -1;
|
|
830
929
|
if (t === 1) return 0;
|
|
831
930
|
let n = 0, i = t - 1;
|
|
@@ -838,7 +937,7 @@ function ne(s, t, e) {
|
|
|
838
937
|
const o = e - s[n];
|
|
839
938
|
return s[i] - e < o ? i : n;
|
|
840
939
|
}
|
|
841
|
-
function
|
|
940
|
+
function it(s, t, e) {
|
|
842
941
|
let n = 0, i = t;
|
|
843
942
|
for (; n < i; ) {
|
|
844
943
|
const o = n + i >> 1;
|
|
@@ -846,8 +945,8 @@ function ut(s, t, e) {
|
|
|
846
945
|
}
|
|
847
946
|
return n;
|
|
848
947
|
}
|
|
849
|
-
function
|
|
850
|
-
const l =
|
|
948
|
+
function fi(s, t, e, n, i, o, r) {
|
|
949
|
+
const l = he(s, e, n);
|
|
851
950
|
if (l < 0) return -1;
|
|
852
951
|
const a = o.toPx(n), c = r.toPx(i);
|
|
853
952
|
let h = -1, f = Number.POSITIVE_INFINITY;
|
|
@@ -856,51 +955,59 @@ function zn(s, t, e, n, i, o, r) {
|
|
|
856
955
|
if (p * p > f) break;
|
|
857
956
|
const u = t[m];
|
|
858
957
|
if (Number.isNaN(u)) continue;
|
|
859
|
-
const
|
|
860
|
-
|
|
958
|
+
const g = r.toPx(u) - c, d = p * p + g * g;
|
|
959
|
+
d < f && (f = d, h = m);
|
|
861
960
|
}
|
|
862
961
|
for (let m = l + 1; m < e; m++) {
|
|
863
962
|
const p = o.toPx(s[m]) - a;
|
|
864
963
|
if (p * p > f) break;
|
|
865
964
|
const u = t[m];
|
|
866
965
|
if (Number.isNaN(u)) continue;
|
|
867
|
-
const
|
|
868
|
-
|
|
966
|
+
const g = r.toPx(u) - c, d = p * p + g * g;
|
|
967
|
+
d < f && (f = d, h = m);
|
|
869
968
|
}
|
|
870
969
|
return h;
|
|
871
970
|
}
|
|
872
|
-
const
|
|
971
|
+
const sn = {
|
|
873
972
|
roleDescription: "chart",
|
|
874
973
|
empty: "No data",
|
|
875
974
|
seriesList: (s) => `${s.length === 1 ? "1 series" : `${s.length} series`}: ${s.join(", ")}.`,
|
|
876
975
|
visibleRange: (s, t) => `From ${s} to ${t}.`,
|
|
877
976
|
seriesExtent: (s, t, e) => `${s} from ${t} to ${e}.`,
|
|
878
977
|
readout: (s, t) => [`${s}.`, ...t.map((e) => `${e.name} ${e.value}${e.x === "" ? "" : ` at ${e.x}`}.`)].join(" "),
|
|
978
|
+
stackTotal: "Total",
|
|
979
|
+
percent: (s) => `${s}%`,
|
|
879
980
|
walkHelp: "Left and right arrows move through the values, up and down change the series, Home and End go to the first and the last, Escape clears.",
|
|
880
|
-
zoomHelp: "Plus and minus zoom, Shift with left or right pans, 0 shows everything."
|
|
881
|
-
|
|
882
|
-
|
|
981
|
+
zoomHelp: "Plus and minus zoom, Shift with left or right pans, 0 shows everything.",
|
|
982
|
+
showData: "Show data",
|
|
983
|
+
hideData: "Hide data",
|
|
984
|
+
positionColumn: "Position",
|
|
985
|
+
rowColumn: "Row",
|
|
986
|
+
tableCaption: (s, t) => `Values from ${s} to ${t}.`,
|
|
987
|
+
downsampled: (s) => `Downsampled from ${s.toLocaleString("en-GB")} readings: the first, lowest, highest and last value of each stretch.`
|
|
988
|
+
}, It = (s, t) => !Number.isNaN(s.y[t]) && (s.w === null || Number.isFinite(s.w[t])) && (s.changesOnly !== !0 || t === 0 || s.y[t] !== s.y[t - 1]);
|
|
989
|
+
function Ct(s, t, e) {
|
|
883
990
|
let n = Number.POSITIVE_INFINITY;
|
|
884
991
|
for (const i of s)
|
|
885
|
-
for (let o =
|
|
992
|
+
for (let o = it(i.x, i.length, t); o < i.length; o++) {
|
|
886
993
|
const r = i.x[o];
|
|
887
994
|
if (r >= n) break;
|
|
888
|
-
if (!(e && r === t || !
|
|
995
|
+
if (!(e && r === t || !It(i, o))) {
|
|
889
996
|
n = r;
|
|
890
997
|
break;
|
|
891
998
|
}
|
|
892
999
|
}
|
|
893
1000
|
return n;
|
|
894
1001
|
}
|
|
895
|
-
function
|
|
1002
|
+
function $t(s, t, e) {
|
|
896
1003
|
let n = Number.NEGATIVE_INFINITY;
|
|
897
1004
|
for (const i of s) {
|
|
898
|
-
let o =
|
|
1005
|
+
let o = it(i.x, i.length, t) - 1;
|
|
899
1006
|
if (!e) for (; o + 1 < i.length && i.x[o + 1] === t; ) o++;
|
|
900
1007
|
for (; o >= 0; o--) {
|
|
901
1008
|
const r = i.x[o];
|
|
902
1009
|
if (r <= n) break;
|
|
903
|
-
if (
|
|
1010
|
+
if (It(i, o)) {
|
|
904
1011
|
n = r;
|
|
905
1012
|
break;
|
|
906
1013
|
}
|
|
@@ -908,10 +1015,10 @@ function Mt(s, t, e) {
|
|
|
908
1015
|
}
|
|
909
1016
|
return n;
|
|
910
1017
|
}
|
|
911
|
-
const
|
|
912
|
-
function
|
|
913
|
-
const i =
|
|
914
|
-
if (!
|
|
1018
|
+
const Ot = (s, [t, e]) => s >= t && s <= e;
|
|
1019
|
+
function jt(s, t, e, n) {
|
|
1020
|
+
const i = Ct(s, n[0], !1), o = $t(s, n[1], !1);
|
|
1021
|
+
if (!Ot(i, n) || !Ot(o, n)) return null;
|
|
915
1022
|
if (t === null) return e === "previous" || e === "last" || e === "pagePrevious" ? o : i;
|
|
916
1023
|
const r = (n[1] - n[0]) / 10;
|
|
917
1024
|
let l;
|
|
@@ -921,28 +1028,28 @@ function Bt(s, t, e, n) {
|
|
|
921
1028
|
case "last":
|
|
922
1029
|
return o;
|
|
923
1030
|
case "next":
|
|
924
|
-
l =
|
|
1031
|
+
l = Ct(s, t, !0);
|
|
925
1032
|
break;
|
|
926
1033
|
case "previous":
|
|
927
|
-
l =
|
|
1034
|
+
l = $t(s, t, !0);
|
|
928
1035
|
break;
|
|
929
1036
|
case "pageNext":
|
|
930
|
-
l = Math.min(
|
|
1037
|
+
l = Math.min(Ct(s, t + r, !1), o);
|
|
931
1038
|
break;
|
|
932
1039
|
case "pagePrevious":
|
|
933
|
-
l = Math.max(
|
|
1040
|
+
l = Math.max($t(s, t - r, !1), i);
|
|
934
1041
|
break;
|
|
935
1042
|
}
|
|
936
|
-
return
|
|
1043
|
+
return Ot(l, n) ? l : t;
|
|
937
1044
|
}
|
|
938
|
-
function
|
|
939
|
-
const n = Math.min(Math.max(t, e[0]), e[1]), i =
|
|
1045
|
+
function De(s, t, e) {
|
|
1046
|
+
const n = Math.min(Math.max(t, e[0]), e[1]), i = Ct(s, n, !1), o = $t(s, n, !1), r = [i, o].filter((l) => Ot(l, e));
|
|
940
1047
|
return r.length === 0 ? null : r.reduce((l, a) => Math.abs(a - t) < Math.abs(l - t) ? a : l);
|
|
941
1048
|
}
|
|
942
|
-
function
|
|
1049
|
+
function Pe(s, t, e) {
|
|
943
1050
|
let n = null;
|
|
944
1051
|
for (let i = 0; i < s.length; i++) {
|
|
945
|
-
if (!
|
|
1052
|
+
if (!It(s, i)) continue;
|
|
946
1053
|
const o = s.x[i], r = s.y[i];
|
|
947
1054
|
let l, a;
|
|
948
1055
|
switch (e) {
|
|
@@ -963,22 +1070,22 @@ function ke(s, t, e) {
|
|
|
963
1070
|
}
|
|
964
1071
|
return n ?? t;
|
|
965
1072
|
}
|
|
966
|
-
function
|
|
1073
|
+
function mi(s, t, e) {
|
|
967
1074
|
let n = t;
|
|
968
1075
|
for (let i = 0; i < s.length; i++) {
|
|
969
|
-
if (s.y[i] !== t.y || !
|
|
1076
|
+
if (s.y[i] !== t.y || !It(s, i)) continue;
|
|
970
1077
|
const o = s.x[i];
|
|
971
1078
|
(e === "start" ? o < n.x : o > n.x) && (n = { x: o, y: t.y });
|
|
972
1079
|
}
|
|
973
1080
|
return n;
|
|
974
1081
|
}
|
|
975
|
-
function
|
|
1082
|
+
function pi(s, t) {
|
|
976
1083
|
for (let e = 0; e < s.length; e++)
|
|
977
|
-
if (s.x[e] === t.x && s.y[e] === t.y &&
|
|
1084
|
+
if (s.x[e] === t.x && s.y[e] === t.y && It(s, e)) return !0;
|
|
978
1085
|
return !1;
|
|
979
1086
|
}
|
|
980
|
-
function
|
|
981
|
-
const { x: r, y: l, y0: a, length: c } = s, h = Math.max(0,
|
|
1087
|
+
function on(s, t, e, n, i, o) {
|
|
1088
|
+
const { x: r, y: l, y0: a, length: c } = s, h = Math.max(0, it(r, c, t) - 1), f = Math.min(c - 1, it(r, c, e));
|
|
982
1089
|
if (f < h) return { x: r.subarray(0, 0), y: l.subarray(0, 0), y0: null, length: 0 };
|
|
983
1090
|
if (f - h + 1 <= 2 * o)
|
|
984
1091
|
return {
|
|
@@ -990,32 +1097,116 @@ function Kn(s, t, e, n, i, o) {
|
|
|
990
1097
|
const m = [], p = new Array(6);
|
|
991
1098
|
let u = h;
|
|
992
1099
|
for (; u <= f; ) {
|
|
993
|
-
const
|
|
994
|
-
let
|
|
995
|
-
for (; u <= f && Math.floor(r[u] * n + i) ===
|
|
996
|
-
const
|
|
997
|
-
if (Number.isNaN(
|
|
998
|
-
|
|
1100
|
+
const d = Math.floor(r[u] * n + i);
|
|
1101
|
+
let y = -1, b = -1, v = -1, w = -1, L = -1, A = -1;
|
|
1102
|
+
for (; u <= f && Math.floor(r[u] * n + i) === d; u++) {
|
|
1103
|
+
const T = l[u];
|
|
1104
|
+
if (Number.isNaN(T) || a !== null && Number.isNaN(a[u])) {
|
|
1105
|
+
L < 0 && (L = u), A < 0 && (A = u);
|
|
999
1106
|
continue;
|
|
1000
1107
|
}
|
|
1001
|
-
A = -1,
|
|
1108
|
+
A = -1, y < 0 && (y = u), b = u, (v < 0 || T < l[v]) && (v = u), (w < 0 || T > l[w]) && (w = u);
|
|
1002
1109
|
}
|
|
1003
|
-
p[0] =
|
|
1004
|
-
let
|
|
1005
|
-
for (const
|
|
1006
|
-
|
|
1110
|
+
p[0] = y, p[1] = v, p[2] = w, p[3] = b, p[4] = L, p[5] = A, p.sort((T, S) => T - S);
|
|
1111
|
+
let z = -1;
|
|
1112
|
+
for (const T of p)
|
|
1113
|
+
T < 0 || T === z || (m.push(T), z = T);
|
|
1007
1114
|
}
|
|
1008
|
-
const
|
|
1115
|
+
const g = {
|
|
1009
1116
|
x: new Float64Array(m.length),
|
|
1010
1117
|
y: new Float64Array(m.length),
|
|
1011
1118
|
y0: a === null ? null : new Float64Array(m.length),
|
|
1012
1119
|
length: m.length
|
|
1013
1120
|
};
|
|
1014
|
-
return m.forEach((
|
|
1015
|
-
|
|
1016
|
-
}),
|
|
1121
|
+
return m.forEach((d, y) => {
|
|
1122
|
+
g.x[y] = r[d], g.y[y] = l[d], g.y0 !== null && (g.y0[y] = a[d]);
|
|
1123
|
+
}), g;
|
|
1124
|
+
}
|
|
1125
|
+
const gi = 500;
|
|
1126
|
+
function yi(s, t, e, n = gi) {
|
|
1127
|
+
const i = s.map((c) => bi(c, t, e)), o = Jt(i, !1).count;
|
|
1128
|
+
if (o <= n || !(e > t)) return { ...Jt(i, !0), courses: i, readings: o, thinned: !1 };
|
|
1129
|
+
const r = Math.max(1, Math.floor(n / 6 / Math.max(1, s.length))), l = (r - 1) / (e - t), a = i.map(
|
|
1130
|
+
(c, h) => {
|
|
1131
|
+
var f;
|
|
1132
|
+
return ((f = s[h]) == null ? void 0 : f.changesOnly) === !0 ? xi(c) : on(c, t, e, l, -t * l, r);
|
|
1133
|
+
}
|
|
1134
|
+
);
|
|
1135
|
+
return { ...Jt(a, !0), courses: a, readings: o, thinned: !0 };
|
|
1136
|
+
}
|
|
1137
|
+
function xi(s) {
|
|
1138
|
+
const t = [];
|
|
1139
|
+
for (let e = 0; e < s.length; e++) (e === 0 || !Object.is(s.y[e], s.y[e - 1])) && t.push(e);
|
|
1140
|
+
return {
|
|
1141
|
+
x: Float64Array.from(t, (e) => s.x[e]),
|
|
1142
|
+
y: Float64Array.from(t, (e) => s.y[e]),
|
|
1143
|
+
y0: null,
|
|
1144
|
+
length: t.length
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
function bi(s, t, e) {
|
|
1148
|
+
const n = it(s.x, s.length, t);
|
|
1149
|
+
let i = it(s.x, s.length, e);
|
|
1150
|
+
for (; i < s.length && s.x[i] <= e; ) i++;
|
|
1151
|
+
return {
|
|
1152
|
+
x: s.x.subarray(n, i),
|
|
1153
|
+
y: s.y.subarray(n, i),
|
|
1154
|
+
y0: s.y0 === null ? null : s.y0.subarray(n, i),
|
|
1155
|
+
length: Math.max(0, i - n)
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
function Jt(s, t) {
|
|
1159
|
+
const e = s.map(() => 0), n = [], i = [];
|
|
1160
|
+
let o = 0;
|
|
1161
|
+
for (; ; ) {
|
|
1162
|
+
let r = Number.POSITIVE_INFINITY;
|
|
1163
|
+
for (let a = 0; a < s.length; a++) {
|
|
1164
|
+
const c = s[a], h = e[a];
|
|
1165
|
+
h < c.length && c.x[h] < r && (r = c.x[h]);
|
|
1166
|
+
}
|
|
1167
|
+
if (r === Number.POSITIVE_INFINITY) break;
|
|
1168
|
+
const l = t ? s.map(() => -1) : null;
|
|
1169
|
+
for (let a = 0; a < s.length; a++) {
|
|
1170
|
+
const c = s[a], h = e[a];
|
|
1171
|
+
h < c.length && c.x[h] === r && (l !== null && (l[a] = h), e[a] = h + 1);
|
|
1172
|
+
}
|
|
1173
|
+
o++, l !== null && (n.push(r), i.push(l));
|
|
1174
|
+
}
|
|
1175
|
+
return { x: n, at: i, count: o };
|
|
1176
|
+
}
|
|
1177
|
+
function vi(s, t = !1) {
|
|
1178
|
+
const e = /* @__PURE__ */ new Map();
|
|
1179
|
+
for (const n of s)
|
|
1180
|
+
for (let i = 0; i < n.length; i++) {
|
|
1181
|
+
const o = n.y[i];
|
|
1182
|
+
if (Number.isNaN(o)) continue;
|
|
1183
|
+
const r = n.x[i], l = e.get(r);
|
|
1184
|
+
l === void 0 ? e.set(r, { net: o, abs: Math.abs(o), up: 0, down: 0 }) : (l.net += o, l.abs += Math.abs(o));
|
|
1185
|
+
}
|
|
1186
|
+
return s.map((n) => {
|
|
1187
|
+
const i = {
|
|
1188
|
+
top: new Float64Array(n.length),
|
|
1189
|
+
bottom: new Float64Array(n.length),
|
|
1190
|
+
value: new Float64Array(n.length),
|
|
1191
|
+
total: new Float64Array(n.length)
|
|
1192
|
+
};
|
|
1193
|
+
for (let o = 0; o < n.length; o++) {
|
|
1194
|
+
const r = n.y[o], l = e.get(n.x[o]);
|
|
1195
|
+
if (i.total[o] = l === void 0 ? Number.NaN : l.net, Number.isNaN(r) || l === void 0) {
|
|
1196
|
+
i.top[o] = Number.NaN, i.bottom[o] = Number.NaN, i.value[o] = Number.NaN;
|
|
1197
|
+
continue;
|
|
1198
|
+
}
|
|
1199
|
+
i.value[o] = Qt(r, l.abs, t);
|
|
1200
|
+
const a = r >= 0 ? l.up : l.down, c = a + r;
|
|
1201
|
+
r >= 0 ? l.up = c : l.down = c, i.bottom[o] = Qt(a, l.abs, t), i.top[o] = Qt(c, l.abs, t);
|
|
1202
|
+
}
|
|
1203
|
+
return i;
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
function Qt(s, t, e) {
|
|
1207
|
+
return e ? t === 0 ? 0 : s / t * 100 : s;
|
|
1017
1208
|
}
|
|
1018
|
-
function
|
|
1209
|
+
function Ce(s, t) {
|
|
1019
1210
|
if (t < 2) return 0;
|
|
1020
1211
|
const e = s.slice(0, t).sort();
|
|
1021
1212
|
let n = Number.POSITIVE_INFINITY;
|
|
@@ -1025,10 +1216,10 @@ function we(s, t) {
|
|
|
1025
1216
|
}
|
|
1026
1217
|
return Number.isFinite(n) ? n : 0;
|
|
1027
1218
|
}
|
|
1028
|
-
function
|
|
1219
|
+
function Et(s, t) {
|
|
1029
1220
|
return s > 0 ? s : t;
|
|
1030
1221
|
}
|
|
1031
|
-
function
|
|
1222
|
+
function ki(s, t, e, n, i, o, r) {
|
|
1032
1223
|
const l = o / 2, a = r / 2;
|
|
1033
1224
|
for (let c = 0; c < e; c++) {
|
|
1034
1225
|
const h = n - s[c];
|
|
@@ -1039,24 +1230,24 @@ function Gn(s, t, e, n, i, o, r) {
|
|
|
1039
1230
|
}
|
|
1040
1231
|
return -1;
|
|
1041
1232
|
}
|
|
1042
|
-
const
|
|
1233
|
+
const wi = {
|
|
1043
1234
|
ok: 0,
|
|
1044
1235
|
unknown: 1,
|
|
1045
1236
|
warning: 2,
|
|
1046
1237
|
alarm: 3
|
|
1047
1238
|
};
|
|
1048
|
-
function
|
|
1049
|
-
return
|
|
1239
|
+
function As(s) {
|
|
1240
|
+
return wi[s];
|
|
1050
1241
|
}
|
|
1051
|
-
const
|
|
1052
|
-
function
|
|
1242
|
+
const $e = { warning: 2, alarm: 3 };
|
|
1243
|
+
function Ni(s, t = {}) {
|
|
1053
1244
|
if (s == null || !Number.isFinite(s))
|
|
1054
1245
|
return { verdict: "unknown" };
|
|
1055
1246
|
const e = t.target, n = e !== void 0 && Number.isFinite(e) ? s - e : void 0;
|
|
1056
1247
|
let i, o = 0;
|
|
1057
1248
|
for (const l of t.limits ?? []) {
|
|
1058
1249
|
const a = l.side === "upper" ? s - l.value : l.value - s;
|
|
1059
|
-
a > 0 && (i === void 0 ||
|
|
1250
|
+
a > 0 && (i === void 0 || $e[l.severity] > $e[i.severity] || l.severity === i.severity && a > o) && (i = l, o = a);
|
|
1060
1251
|
}
|
|
1061
1252
|
if (i === void 0)
|
|
1062
1253
|
return n === void 0 ? { verdict: "ok" } : { verdict: "ok", deviation: n };
|
|
@@ -1067,35 +1258,35 @@ function Un(s, t = {}) {
|
|
|
1067
1258
|
};
|
|
1068
1259
|
return n === void 0 ? r : { ...r, deviation: n };
|
|
1069
1260
|
}
|
|
1070
|
-
function
|
|
1261
|
+
function te(s) {
|
|
1071
1262
|
return s == null || !Number.isFinite(s) ? Number.NaN : s;
|
|
1072
1263
|
}
|
|
1073
|
-
function
|
|
1264
|
+
function Ii(s, t, e, n, i) {
|
|
1074
1265
|
const o = s.length, r = new Float64Array(o), l = new Float64Array(o), a = typeof n == "function" ? n : null, c = a === null ? null : new Float64Array(o), h = (i == null ? void 0 : i.value) ?? null, f = h === null ? null : new Float64Array(o), m = (i == null ? void 0 : i.xMap) ?? null, p = (i == null ? void 0 : i.xGap) ?? null;
|
|
1075
|
-
let u = Number.POSITIVE_INFINITY,
|
|
1076
|
-
typeof n == "number" && o > 0 && (
|
|
1266
|
+
let u = Number.POSITIVE_INFINITY, g = Number.NEGATIVE_INFINITY, d = Number.POSITIVE_INFINITY, y = Number.NEGATIVE_INFINITY;
|
|
1267
|
+
typeof n == "number" && o > 0 && (d = n, y = n);
|
|
1077
1268
|
for (let b = 0; b < o; b++) {
|
|
1078
|
-
const
|
|
1269
|
+
const v = s[b], w = t(v, b), L = !Number.isFinite(w), A = L ? b > 0 ? r[b - 1] : Number.NEGATIVE_INFINITY : m === null ? w : m(w);
|
|
1079
1270
|
r[b] = A;
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1082
|
-
const
|
|
1083
|
-
if (l[b] =
|
|
1084
|
-
const
|
|
1085
|
-
c[b] =
|
|
1271
|
+
const z = L || p !== null && p(w);
|
|
1272
|
+
z || (A < u && (u = A), A > g && (g = A));
|
|
1273
|
+
const T = z ? Number.NaN : te(e(v, b));
|
|
1274
|
+
if (l[b] = T, T < d && (d = T), T > y && (y = T), h !== null && (f[b] = z ? Number.NaN : te(h(v, b))), a !== null) {
|
|
1275
|
+
const S = z ? Number.NaN : te(a(v, b));
|
|
1276
|
+
c[b] = S, S < d && (d = S), S > y && (y = S);
|
|
1086
1277
|
}
|
|
1087
1278
|
}
|
|
1088
|
-
return { series: { x: r, y: l, y0: c, w: f, length: o }, extent: { xMin: u, xMax:
|
|
1279
|
+
return { series: { x: r, y: l, y0: c, w: f, length: o }, extent: { xMin: u, xMax: g, yMin: d, yMax: y } };
|
|
1089
1280
|
}
|
|
1090
|
-
function
|
|
1281
|
+
function Ai(s, t) {
|
|
1091
1282
|
for (let e = 1; e < t; e++)
|
|
1092
1283
|
if (s[e] < s[e - 1]) return e;
|
|
1093
1284
|
return -1;
|
|
1094
1285
|
}
|
|
1095
|
-
function
|
|
1286
|
+
function Oe(s, t, e) {
|
|
1096
1287
|
const { x: n, y: i, y0: o, length: r } = s;
|
|
1097
1288
|
let l = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY;
|
|
1098
|
-
for (let c =
|
|
1289
|
+
for (let c = it(n, r, t); c < r && n[c] <= e; c++) {
|
|
1099
1290
|
const h = i[c];
|
|
1100
1291
|
if (h < l && (l = h), h > a && (a = h), o !== null) {
|
|
1101
1292
|
const f = o[c];
|
|
@@ -1104,7 +1295,7 @@ function jn(s, t, e) {
|
|
|
1104
1295
|
}
|
|
1105
1296
|
return [l, a];
|
|
1106
1297
|
}
|
|
1107
|
-
function
|
|
1298
|
+
function Ti(s, t, e, n) {
|
|
1108
1299
|
let i = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY;
|
|
1109
1300
|
for (const r of e) {
|
|
1110
1301
|
const l = r.extent;
|
|
@@ -1117,7 +1308,7 @@ function Jn(s, t, e, n) {
|
|
|
1117
1308
|
Number.isFinite(r) && (r < i && (i = r), r > o && (o = r));
|
|
1118
1309
|
return !Number.isFinite(i) || !Number.isFinite(o) ? [0, 1] : [i, o];
|
|
1119
1310
|
}
|
|
1120
|
-
function
|
|
1311
|
+
function Mi(s, t) {
|
|
1121
1312
|
let e = Number.POSITIVE_INFINITY;
|
|
1122
1313
|
for (let n = 1; n < t; n++) {
|
|
1123
1314
|
const i = s[n] - s[n - 1];
|
|
@@ -1125,14 +1316,14 @@ function Qn(s, t) {
|
|
|
1125
1316
|
}
|
|
1126
1317
|
return Number.isFinite(e) ? e : 0;
|
|
1127
1318
|
}
|
|
1128
|
-
function
|
|
1319
|
+
function Si(s, t) {
|
|
1129
1320
|
return s > 0 ? s : t;
|
|
1130
1321
|
}
|
|
1131
|
-
function
|
|
1322
|
+
function Li(s, t, e, n) {
|
|
1132
1323
|
const i = s * t, o = i / n;
|
|
1133
1324
|
return { offset: -i / 2 + e * o, width: o };
|
|
1134
1325
|
}
|
|
1135
|
-
function
|
|
1326
|
+
function Ei(s) {
|
|
1136
1327
|
const t = /* @__PURE__ */ new Map();
|
|
1137
1328
|
for (const n of s) {
|
|
1138
1329
|
if (n.kind !== "bar") continue;
|
|
@@ -1142,44 +1333,49 @@ function ni(s) {
|
|
|
1142
1333
|
const e = /* @__PURE__ */ new Map();
|
|
1143
1334
|
for (const n of t.values()) {
|
|
1144
1335
|
let i = Number.POSITIVE_INFINITY;
|
|
1145
|
-
for (const
|
|
1146
|
-
|
|
1147
|
-
const o = Number.isFinite(i) ? i : 0, r = n[0].fraction;
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1336
|
+
for (const a of n)
|
|
1337
|
+
a.step > 0 && a.step < i && (i = a.step);
|
|
1338
|
+
const o = Number.isFinite(i) ? i : 0, r = n[0].fraction, l = /* @__PURE__ */ new Map();
|
|
1339
|
+
for (const a of n) {
|
|
1340
|
+
const c = a.stack ?? a.order;
|
|
1341
|
+
l.has(c) || l.set(c, l.size);
|
|
1342
|
+
}
|
|
1343
|
+
for (const a of n)
|
|
1344
|
+
e.set(a.order, {
|
|
1345
|
+
index: l.get(a.stack ?? a.order),
|
|
1346
|
+
size: l.size,
|
|
1152
1347
|
step: o,
|
|
1153
1348
|
fraction: r
|
|
1154
1349
|
});
|
|
1155
|
-
});
|
|
1156
1350
|
}
|
|
1157
1351
|
return e;
|
|
1158
1352
|
}
|
|
1159
|
-
const
|
|
1353
|
+
const He = {
|
|
1160
1354
|
version: 0,
|
|
1161
|
-
layout:
|
|
1355
|
+
layout: je,
|
|
1162
1356
|
legend: null,
|
|
1163
1357
|
series: [],
|
|
1164
1358
|
limits: [],
|
|
1165
1359
|
// Unknown before the first frame: saying "No data" there would flash.
|
|
1166
|
-
empty: !1
|
|
1167
|
-
|
|
1360
|
+
empty: !1,
|
|
1361
|
+
dataTable: null
|
|
1362
|
+
}, Re = {
|
|
1168
1363
|
version: 0,
|
|
1169
1364
|
hover: null,
|
|
1170
1365
|
tooltip: null,
|
|
1171
1366
|
xLabel: "",
|
|
1172
|
-
rows: []
|
|
1173
|
-
|
|
1174
|
-
|
|
1367
|
+
rows: [],
|
|
1368
|
+
totals: []
|
|
1369
|
+
}, Fi = 4, We = 12;
|
|
1370
|
+
let ee = 0;
|
|
1175
1371
|
const ft = /* @__PURE__ */ new Map();
|
|
1176
|
-
function
|
|
1372
|
+
function Q(s, t) {
|
|
1177
1373
|
if (s === t) return !0;
|
|
1178
1374
|
if (typeof s != "function" || typeof t != "function") return !1;
|
|
1179
1375
|
const e = String(s);
|
|
1180
1376
|
return e.includes("[native code]") ? !1 : e === String(t);
|
|
1181
1377
|
}
|
|
1182
|
-
function
|
|
1378
|
+
function Di(s, t) {
|
|
1183
1379
|
var e, n, i, o;
|
|
1184
1380
|
if (s === t) return !0;
|
|
1185
1381
|
if (s === void 0 || t === void 0 || s.length !== t.length) return !1;
|
|
@@ -1187,34 +1383,43 @@ function si(s, t) {
|
|
|
1187
1383
|
if (((e = s[r]) == null ? void 0 : e.from) !== ((n = t[r]) == null ? void 0 : n.from) || ((i = s[r]) == null ? void 0 : i.to) !== ((o = t[r]) == null ? void 0 : o.to)) return !1;
|
|
1188
1384
|
return !0;
|
|
1189
1385
|
}
|
|
1190
|
-
function
|
|
1386
|
+
function mt(s) {
|
|
1191
1387
|
return s.kind !== "state" && s.kind !== "matrix";
|
|
1192
1388
|
}
|
|
1193
|
-
function
|
|
1389
|
+
function Pi(s) {
|
|
1194
1390
|
const t = s.entry.materialized;
|
|
1195
1391
|
if (t === null) return !1;
|
|
1196
|
-
const e = t.x[s.index], n = (i) => i > 0 && i <
|
|
1392
|
+
const e = t.x[s.index], n = (i) => i > 0 && i < V;
|
|
1197
1393
|
return s.index > 0 && n(e - t.x[s.index - 1]) || s.index + 1 < t.length && n(t.x[s.index + 1] - e);
|
|
1198
1394
|
}
|
|
1199
|
-
function
|
|
1395
|
+
function kt(s, t) {
|
|
1200
1396
|
if (s === t) return !0;
|
|
1201
1397
|
if (s === void 0 || t === void 0 || s.length !== t.length) return !1;
|
|
1202
1398
|
for (let e = 0; e < s.length; e++) if (s[e] !== t[e]) return !1;
|
|
1203
1399
|
return !0;
|
|
1204
1400
|
}
|
|
1205
|
-
function
|
|
1206
|
-
return s.kind === t.kind &&
|
|
1401
|
+
function Ci(s, t) {
|
|
1402
|
+
return s.kind === t.kind && U(s) === U(t) && _t(s) === _t(t) && Q(s.accessor, t.accessor) && s.data === t.data && Q(Vt(s), Vt(t)) && Q(de(s), de(t));
|
|
1403
|
+
}
|
|
1404
|
+
function U(s) {
|
|
1405
|
+
if (!(s.kind !== "bar" && s.kind !== "area" || s.stack === void 0))
|
|
1406
|
+
return `${s.xAxisId}
|
|
1407
|
+
${s.yAxisId}
|
|
1408
|
+
${s.stack}`;
|
|
1207
1409
|
}
|
|
1208
|
-
function
|
|
1410
|
+
function _t(s) {
|
|
1411
|
+
return (s.kind === "bar" || s.kind === "area") && s.stack !== void 0 && s.normalize === !0;
|
|
1412
|
+
}
|
|
1413
|
+
function de(s) {
|
|
1209
1414
|
return s.kind === "matrix" ? s.value : void 0;
|
|
1210
1415
|
}
|
|
1211
|
-
function
|
|
1416
|
+
function Vt(s) {
|
|
1212
1417
|
switch (s.kind) {
|
|
1213
1418
|
case "line":
|
|
1214
1419
|
case "scatter":
|
|
1215
1420
|
return;
|
|
1216
1421
|
case "area":
|
|
1217
|
-
return s.baseline ?? 0;
|
|
1422
|
+
return s.stack === void 0 ? s.baseline ?? 0 : 0;
|
|
1218
1423
|
case "bar":
|
|
1219
1424
|
return 0;
|
|
1220
1425
|
case "state":
|
|
@@ -1222,16 +1427,16 @@ function Ot(s) {
|
|
|
1222
1427
|
return;
|
|
1223
1428
|
}
|
|
1224
1429
|
}
|
|
1225
|
-
function
|
|
1430
|
+
function $i(s, t) {
|
|
1226
1431
|
if (s.kind !== t.kind) return !1;
|
|
1227
1432
|
switch (t.kind) {
|
|
1228
1433
|
case "line": {
|
|
1229
1434
|
const e = s;
|
|
1230
|
-
return e.strokeWidth === t.strokeWidth && e.markers === t.markers && e.step === t.step &&
|
|
1435
|
+
return e.strokeWidth === t.strokeWidth && e.markers === t.markers && e.step === t.step && kt(e.dash, t.dash);
|
|
1231
1436
|
}
|
|
1232
1437
|
case "area": {
|
|
1233
1438
|
const e = s;
|
|
1234
|
-
return
|
|
1439
|
+
return Q(e.baseline, t.baseline) && e.fillOpacity === t.fillOpacity && e.strokeWidth === t.strokeWidth && kt(e.dash, t.dash);
|
|
1235
1440
|
}
|
|
1236
1441
|
case "bar":
|
|
1237
1442
|
return s.barWidth === t.barWidth;
|
|
@@ -1239,13 +1444,13 @@ function li(s, t) {
|
|
|
1239
1444
|
return s.radius === t.radius;
|
|
1240
1445
|
case "state": {
|
|
1241
1446
|
const e = s;
|
|
1242
|
-
return e.laneFrom === t.laneFrom && e.laneTo === t.laneTo &&
|
|
1447
|
+
return e.laneFrom === t.laneFrom && e.laneTo === t.laneTo && Oi(e.states, t.states);
|
|
1243
1448
|
}
|
|
1244
1449
|
case "matrix":
|
|
1245
|
-
return
|
|
1450
|
+
return Hi(s.coloring, t.coloring);
|
|
1246
1451
|
}
|
|
1247
1452
|
}
|
|
1248
|
-
function
|
|
1453
|
+
function Oi(s, t) {
|
|
1249
1454
|
var e, n, i, o;
|
|
1250
1455
|
if (s === t) return !0;
|
|
1251
1456
|
if (s.length !== t.length) return !1;
|
|
@@ -1253,17 +1458,17 @@ function ai(s, t) {
|
|
|
1253
1458
|
if (((e = s[r]) == null ? void 0 : e.label) !== ((n = t[r]) == null ? void 0 : n.label) || ((i = s[r]) == null ? void 0 : i.color) !== ((o = t[r]) == null ? void 0 : o.color)) return !1;
|
|
1254
1459
|
return !0;
|
|
1255
1460
|
}
|
|
1256
|
-
function
|
|
1257
|
-
return s === t ? !0 : s.kind !== t.kind ? !1 : s.kind === "assessment" && t.kind === "assessment" ? s.limits === t.limits : s.kind === "gradient" && t.kind === "gradient" ?
|
|
1461
|
+
function Hi(s, t) {
|
|
1462
|
+
return s === t ? !0 : s.kind !== t.kind ? !1 : s.kind === "assessment" && t.kind === "assessment" ? s.limits === t.limits : s.kind === "gradient" && t.kind === "gradient" ? kt(s.stops, t.stops) && kt(s.range, t.range) : !1;
|
|
1258
1463
|
}
|
|
1259
|
-
function
|
|
1464
|
+
function Ft(s, t) {
|
|
1260
1465
|
return s.kind === "assessment" ? [t.colorOk, t.colorWarning, t.colorAlarm] : s.stops;
|
|
1261
1466
|
}
|
|
1262
|
-
function
|
|
1467
|
+
function Ri(s) {
|
|
1263
1468
|
const t = 100 / Math.max(1, s.length);
|
|
1264
1469
|
return `linear-gradient(to right, ${s.map((n, i) => `${n} ${i * t}% ${(i + 1) * t}%`).join(", ")})`;
|
|
1265
1470
|
}
|
|
1266
|
-
function
|
|
1471
|
+
function Wi(s, t, e) {
|
|
1267
1472
|
let n = e == null ? void 0 : e[0], i = e == null ? void 0 : e[1];
|
|
1268
1473
|
if (n === void 0 || i === void 0) {
|
|
1269
1474
|
n = Number.POSITIVE_INFINITY, i = Number.NEGATIVE_INFINITY;
|
|
@@ -1274,46 +1479,49 @@ function hi(s, t, e) {
|
|
|
1274
1479
|
}
|
|
1275
1480
|
return [n, i];
|
|
1276
1481
|
}
|
|
1277
|
-
function
|
|
1482
|
+
function zi(s, t, e, n, i) {
|
|
1278
1483
|
if (t.kind === "assessment") {
|
|
1279
|
-
const a =
|
|
1484
|
+
const a = Ni(s, t.limits);
|
|
1280
1485
|
return a.verdict === "alarm" ? 2 : a.verdict === "warning" ? 1 : a.verdict === "ok" ? 0 : -1;
|
|
1281
1486
|
}
|
|
1282
1487
|
if (!Number.isFinite(s)) return -1;
|
|
1283
1488
|
const o = i - n, r = o > 0 ? (s - n) / o : 0.5, l = Math.floor(r * e);
|
|
1284
1489
|
return l < 0 ? 0 : l >= e ? e - 1 : l;
|
|
1285
1490
|
}
|
|
1286
|
-
function
|
|
1491
|
+
function ze(s, t, e) {
|
|
1287
1492
|
const n = s.length, i = new Int32Array(n), o = s.w;
|
|
1288
1493
|
if (o === null || e === 0)
|
|
1289
1494
|
return i.fill(-1), i;
|
|
1290
|
-
const [r, l] = t.kind === "gradient" ?
|
|
1291
|
-
for (let a = 0; a < n; a++) i[a] =
|
|
1495
|
+
const [r, l] = t.kind === "gradient" ? Wi(o, n, t.range) : [0, 0];
|
|
1496
|
+
for (let a = 0; a < n; a++) i[a] = zi(o[a], t, e, r, l);
|
|
1292
1497
|
return i;
|
|
1293
1498
|
}
|
|
1294
|
-
function
|
|
1499
|
+
function Bi(s, t) {
|
|
1295
1500
|
return s === t ? !0 : Array.isArray(s) && Array.isArray(t) ? s[0] === t[0] && s[1] === t[1] : !1;
|
|
1296
1501
|
}
|
|
1297
|
-
const
|
|
1502
|
+
const _i = 150, Vi = 100, Yi = {
|
|
1298
1503
|
ArrowRight: "next",
|
|
1299
1504
|
ArrowLeft: "previous",
|
|
1300
1505
|
Home: "first",
|
|
1301
1506
|
End: "last",
|
|
1302
1507
|
PageDown: "pageNext",
|
|
1303
1508
|
PageUp: "pagePrevious"
|
|
1304
|
-
},
|
|
1509
|
+
}, Gi = {
|
|
1305
1510
|
ArrowLeft: "left",
|
|
1306
1511
|
ArrowRight: "right",
|
|
1307
1512
|
ArrowUp: "up",
|
|
1308
1513
|
ArrowDown: "down"
|
|
1309
|
-
},
|
|
1310
|
-
class
|
|
1514
|
+
}, Be = 1.25;
|
|
1515
|
+
class rn {
|
|
1311
1516
|
constructor() {
|
|
1312
1517
|
/* ---------- Registration ---------- */
|
|
1313
1518
|
x(this, "series", /* @__PURE__ */ new Map());
|
|
1314
1519
|
x(this, "axes", /* @__PURE__ */ new Map());
|
|
1315
1520
|
x(this, "legend", null);
|
|
1316
1521
|
x(this, "tooltip", null);
|
|
1522
|
+
x(this, "dataTable", null);
|
|
1523
|
+
/** `Chart encoding` (charts-alternatives C3). */
|
|
1524
|
+
x(this, "encoding", "color");
|
|
1317
1525
|
x(this, "limits", /* @__PURE__ */ new Map());
|
|
1318
1526
|
/* ---------- Data and layout inputs ---------- */
|
|
1319
1527
|
x(this, "data", []);
|
|
@@ -1331,7 +1539,7 @@ class ze {
|
|
|
1331
1539
|
x(this, "summaryEl", null);
|
|
1332
1540
|
x(this, "readoutTimer", null);
|
|
1333
1541
|
x(this, "summaryTimer", null);
|
|
1334
|
-
x(this, "wording",
|
|
1542
|
+
x(this, "wording", sn);
|
|
1335
1543
|
x(this, "measurer", null);
|
|
1336
1544
|
/* ---------- Size and DPR ---------- */
|
|
1337
1545
|
x(this, "cssWidth", 0);
|
|
@@ -1357,12 +1565,13 @@ class ze {
|
|
|
1357
1565
|
`var(--…)` or a `light-dark(…)` and keeps the previous fillStyle. */
|
|
1358
1566
|
x(this, "painted", /* @__PURE__ */ new Map());
|
|
1359
1567
|
/* ---------- Layout and interaction ---------- */
|
|
1360
|
-
x(this, "layout",
|
|
1568
|
+
x(this, "layout", je);
|
|
1361
1569
|
x(this, "hysteresis", /* @__PURE__ */ new Map());
|
|
1362
1570
|
x(this, "hover", null);
|
|
1363
1571
|
x(this, "hoverKey", "");
|
|
1364
1572
|
x(this, "hoverXLabel", "");
|
|
1365
1573
|
x(this, "hoverRows", []);
|
|
1574
|
+
x(this, "hoverTotals", []);
|
|
1366
1575
|
/** The orders of the series in the current hit, beside its rows. */
|
|
1367
1576
|
x(this, "hoverOrders", []);
|
|
1368
1577
|
x(this, "highlight", null);
|
|
@@ -1378,8 +1587,8 @@ class ze {
|
|
|
1378
1587
|
/** The highlight is the keyboard's, and goes with its Active point. */
|
|
1379
1588
|
x(this, "keyHighlight", !1);
|
|
1380
1589
|
/* ---------- Snapshots for the HTML layer ---------- */
|
|
1381
|
-
x(this, "layoutSnapshot",
|
|
1382
|
-
x(this, "hoverSnapshot",
|
|
1590
|
+
x(this, "layoutSnapshot", He);
|
|
1591
|
+
x(this, "hoverSnapshot", Re);
|
|
1383
1592
|
x(this, "layoutSubscribers", /* @__PURE__ */ new Set());
|
|
1384
1593
|
x(this, "hoverSubscribers", /* @__PURE__ */ new Set());
|
|
1385
1594
|
/* ---------- Instrumentation (R-5.1) ---------- */
|
|
@@ -1395,6 +1604,7 @@ class ze {
|
|
|
1395
1604
|
(t = this.measurer) == null || t.clear(), this.hysteresis.clear(), this.markLayoutDirty();
|
|
1396
1605
|
});
|
|
1397
1606
|
x(this, "themeRoot", null);
|
|
1607
|
+
x(this, "percent", (t) => this.wording.percent(St(t)));
|
|
1398
1608
|
/* ---------- Cursor sync (charts-long-series 04) ----------
|
|
1399
1609
|
|
|
1400
1610
|
Only the x position travels, in domain units: each chart draws its own
|
|
@@ -1422,12 +1632,12 @@ class ze {
|
|
|
1422
1632
|
this.layoutSubscribers.delete(t);
|
|
1423
1633
|
}));
|
|
1424
1634
|
x(this, "getLayoutSnapshot", () => this.layoutSnapshot);
|
|
1425
|
-
x(this, "getLayoutServerSnapshot", () =>
|
|
1635
|
+
x(this, "getLayoutServerSnapshot", () => He);
|
|
1426
1636
|
x(this, "subscribeHover", (t) => (this.hoverSubscribers.add(t), () => {
|
|
1427
1637
|
this.hoverSubscribers.delete(t);
|
|
1428
1638
|
}));
|
|
1429
1639
|
x(this, "getHoverSnapshot", () => this.hoverSnapshot);
|
|
1430
|
-
x(this, "getHoverServerSnapshot", () =>
|
|
1640
|
+
x(this, "getHoverServerSnapshot", () => Re);
|
|
1431
1641
|
}
|
|
1432
1642
|
setOnPerf(t) {
|
|
1433
1643
|
this.onPerf = t;
|
|
@@ -1453,42 +1663,44 @@ class ze {
|
|
|
1453
1663
|
return !1;
|
|
1454
1664
|
}
|
|
1455
1665
|
registerSeries(t) {
|
|
1456
|
-
const e =
|
|
1666
|
+
const e = ee++;
|
|
1457
1667
|
return this.series.set(e, {
|
|
1458
1668
|
order: e,
|
|
1459
1669
|
config: t,
|
|
1460
|
-
slot:
|
|
1670
|
+
slot: mt(t) ? this.slotFor(t.name) : -1,
|
|
1461
1671
|
lastSlot: null,
|
|
1462
1672
|
materialized: null,
|
|
1463
1673
|
extent: null,
|
|
1464
1674
|
step: null,
|
|
1465
1675
|
cellHeight: null,
|
|
1466
|
-
buckets: null
|
|
1676
|
+
buckets: null,
|
|
1677
|
+
own: null,
|
|
1678
|
+
stacked: null
|
|
1467
1679
|
}), this.materialsDirty = !0, this.markLayoutDirty(), e;
|
|
1468
1680
|
}
|
|
1469
1681
|
updateSeries(t, e) {
|
|
1470
1682
|
const n = this.series.get(t);
|
|
1471
1683
|
if (n === void 0) return;
|
|
1472
|
-
const i = n.config, o =
|
|
1473
|
-
if (n.slot < 0 &&
|
|
1684
|
+
const i = n.config, o = Ci(i, e), r = o && i.xAxisId === e.xAxisId && i.yAxisId === e.yAxisId && i.name === e.name && Q(i.format, e.format) && i.color === e.color && i.tone === e.tone && i.hidden === e.hidden && $i(i, e);
|
|
1685
|
+
if (n.slot < 0 && mt(e))
|
|
1474
1686
|
n.slot = this.slotFor(e.name);
|
|
1475
1687
|
else if (i.name !== e.name && e.name !== void 0 && n.slot >= 0) {
|
|
1476
1688
|
const l = this.slotsByName.get(e.name);
|
|
1477
1689
|
l === void 0 ? this.slotsByName.set(e.name, n.slot) : this.slotTaken(l, n) || (n.slot = l);
|
|
1478
1690
|
}
|
|
1479
|
-
n.config = e, !r && (n.buckets = null, o || (n.materialized = null, n.extent = null, n.step = null, n.cellHeight = null, n.buckets = null, this.materialsDirty = !0), this.markLayoutDirty());
|
|
1691
|
+
n.config = e, !r && (n.buckets = null, i.hidden !== e.hidden && U(e) !== void 0 && (this.materialsDirty = !0), o || (n.materialized = null, n.extent = null, n.step = null, n.cellHeight = null, n.buckets = null, this.materialsDirty = !0), this.markLayoutDirty());
|
|
1480
1692
|
}
|
|
1481
1693
|
unregisterSeries(t) {
|
|
1482
1694
|
this.series.delete(t) && (this.materialsDirty = !0, this.markLayoutDirty());
|
|
1483
1695
|
}
|
|
1484
1696
|
registerAxis(t) {
|
|
1485
|
-
const e =
|
|
1697
|
+
const e = ee++;
|
|
1486
1698
|
return this.axes.set(e, { order: e, config: t }), this.materialsDirty = !0, this.markLayoutDirty(), e;
|
|
1487
1699
|
}
|
|
1488
1700
|
updateAxis(t, e) {
|
|
1489
1701
|
const n = this.axes.get(t);
|
|
1490
1702
|
if (n === void 0) return;
|
|
1491
|
-
const i = n.config, o =
|
|
1703
|
+
const i = n.config, o = Q(i.accessor, e.accessor) && Di(i.calendar, e.calendar), r = o && i.id === e.id && i.orientation === e.orientation && i.position === e.position && i.label === e.label && i.tickCount === e.tickCount && i.grid === e.grid && i.time === e.time && i.alignTicks === e.alignTicks && kt(i.ticks, e.ticks) && Bi(i.domain, e.domain) && i.onDomainChange === void 0 == (e.onDomainChange === void 0) && Q(i.tickFormat, e.tickFormat);
|
|
1492
1704
|
if (n.config = e, !r) {
|
|
1493
1705
|
if (!o || i.id !== e.id) {
|
|
1494
1706
|
for (const l of this.series.values())
|
|
@@ -1505,7 +1717,7 @@ class ze {
|
|
|
1505
1717
|
anything in this library. They are therefore not series: no accessor, no
|
|
1506
1718
|
data, no legend entry, no hit. */
|
|
1507
1719
|
registerLimit(t) {
|
|
1508
|
-
const e =
|
|
1720
|
+
const e = ee++;
|
|
1509
1721
|
return this.limits.set(e, { order: e, config: t }), this.markLayoutDirty(), e;
|
|
1510
1722
|
}
|
|
1511
1723
|
updateLimit(t, e) {
|
|
@@ -1534,7 +1746,7 @@ class ze {
|
|
|
1534
1746
|
}
|
|
1535
1747
|
updateTooltip(t) {
|
|
1536
1748
|
const e = this.tooltip;
|
|
1537
|
-
if (e !== null && e.mode === t.mode &&
|
|
1749
|
+
if (e !== null && e.mode === t.mode && Q(e.render, t.render)) {
|
|
1538
1750
|
this.tooltip = t;
|
|
1539
1751
|
return;
|
|
1540
1752
|
}
|
|
@@ -1543,6 +1755,45 @@ class ze {
|
|
|
1543
1755
|
unregisterTooltip() {
|
|
1544
1756
|
this.tooltip = null, this.hover = null, this.hoverKey = "", this.markOverlayDirty(), this.pushHoverSnapshot();
|
|
1545
1757
|
}
|
|
1758
|
+
/* The data table (charts-alternatives 01) registers like the legend: one per
|
|
1759
|
+
chart. Whether it is open is the scene's, because two elements show it -
|
|
1760
|
+
the key in the legend and the panel. Opening it changes no pixel of the
|
|
1761
|
+
plot, so it only pushes the snapshot. */
|
|
1762
|
+
registerDataTable(t) {
|
|
1763
|
+
this.dataTable = { id: t, open: !1 }, this.pushLayoutSnapshot();
|
|
1764
|
+
}
|
|
1765
|
+
unregisterDataTable() {
|
|
1766
|
+
this.dataTable = null, this.pushLayoutSnapshot();
|
|
1767
|
+
}
|
|
1768
|
+
toggleDataTable() {
|
|
1769
|
+
this.dataTable !== null && (this.dataTable = { ...this.dataTable, open: !this.dataTable.open }, this.pushLayoutSnapshot());
|
|
1770
|
+
}
|
|
1771
|
+
setEncoding(t) {
|
|
1772
|
+
t !== this.encoding && (this.encoding = t, this.markLayoutDirty());
|
|
1773
|
+
}
|
|
1774
|
+
/** Is every series drawn with its marks as well as its colour? Under forced
|
|
1775
|
+
colours always: every series is drawn in the one text colour then (C4). */
|
|
1776
|
+
marked() {
|
|
1777
|
+
var t;
|
|
1778
|
+
return this.encoding === "marks" || ((t = this.theme) == null ? void 0 : t.forced) === !0;
|
|
1779
|
+
}
|
|
1780
|
+
/** A series' marks by its palette place - the same place its colour comes
|
|
1781
|
+
from; null without encoding by marks, and for the kinds that take no
|
|
1782
|
+
place (a band and a cell are hatched by state and by step instead). */
|
|
1783
|
+
marksOf(t) {
|
|
1784
|
+
return this.marked() && mt(t.config) ? jn(this.paletteSlot(t)) : null;
|
|
1785
|
+
}
|
|
1786
|
+
/** Each state's hatch by its name, across every band of the chart - so the
|
|
1787
|
+
legend and each band agree (charts-alternatives 04). */
|
|
1788
|
+
stateHatches() {
|
|
1789
|
+
const t = [];
|
|
1790
|
+
for (const { config: e } of this.seriesInOrder()) e.kind === "state" && t.push(e.states);
|
|
1791
|
+
return Jn(t);
|
|
1792
|
+
}
|
|
1793
|
+
/** The words the HTML layer writes - the data table's key among them. */
|
|
1794
|
+
getWording() {
|
|
1795
|
+
return this.wording;
|
|
1796
|
+
}
|
|
1546
1797
|
/** Series in registration order - the drawing order. The palette follows it
|
|
1547
1798
|
only on the first mount; after that it follows the name. */
|
|
1548
1799
|
seriesInOrder() {
|
|
@@ -1567,31 +1818,31 @@ class ze {
|
|
|
1567
1818
|
/* ================= Checks (R-4.12, R-4.13) ================= */
|
|
1568
1819
|
/** Called from the Chart after the child effects; DEV only. */
|
|
1569
1820
|
validate() {
|
|
1570
|
-
if (!
|
|
1821
|
+
if (!bt) return;
|
|
1571
1822
|
const t = /* @__PURE__ */ new Set();
|
|
1572
1823
|
for (const { config: o } of this.axesInOrder()) {
|
|
1573
1824
|
const r = `${o.orientation}:${o.id}`, l = o.orientation === "x" ? "XAxis" : "YAxis";
|
|
1574
|
-
|
|
1825
|
+
gt(
|
|
1575
1826
|
!t.has(r),
|
|
1576
1827
|
`Two <${l}> with the same id "${o.id}". A second ${l} needs an own id (R-4.12).`
|
|
1577
1828
|
), t.add(r);
|
|
1578
1829
|
}
|
|
1579
1830
|
const e = /* @__PURE__ */ new Set();
|
|
1580
1831
|
for (const { config: o } of this.series.values())
|
|
1581
|
-
|
|
1832
|
+
gt(
|
|
1582
1833
|
t.has(`x:${o.xAxisId}`),
|
|
1583
1834
|
`Series "${o.name ?? "?"}" refers to the unknown x axis "${o.xAxisId}" (R-4.12).`
|
|
1584
|
-
),
|
|
1835
|
+
), gt(
|
|
1585
1836
|
t.has(`y:${o.yAxisId}`),
|
|
1586
1837
|
`Series "${o.name ?? "?"}" refers to the unknown y axis "${o.yAxisId}" (R-4.12).`
|
|
1587
1838
|
), e.add(`x:${o.xAxisId}`), e.add(`y:${o.yAxisId}`);
|
|
1588
1839
|
for (const { config: o } of this.limits.values())
|
|
1589
|
-
|
|
1840
|
+
gt(
|
|
1590
1841
|
t.has(`${o.orientation}:${this.limitAxisId(o)}`),
|
|
1591
1842
|
`A limit refers to the unknown ${o.orientation} axis "${this.limitAxisId(o)}" (R-4.12).`
|
|
1592
1843
|
);
|
|
1593
1844
|
for (const o of t)
|
|
1594
|
-
!e.has(o) && this.series.size > 0 &&
|
|
1845
|
+
!e.has(o) && this.series.size > 0 && nt(
|
|
1595
1846
|
`axis-without-series-${o}`,
|
|
1596
1847
|
`Axis "${o}" has no bound series; it is drawn with the domain [0, 1] (R-4.13).`
|
|
1597
1848
|
);
|
|
@@ -1599,14 +1850,14 @@ class ze {
|
|
|
1599
1850
|
for (const { config: o } of this.seriesInOrder()) {
|
|
1600
1851
|
if (o.kind !== "bar") continue;
|
|
1601
1852
|
const r = n.get(o.xAxisId);
|
|
1602
|
-
r === void 0 ? n.set(o.xAxisId, o.barWidth) : r !== o.barWidth &&
|
|
1853
|
+
r === void 0 ? n.set(o.xAxisId, o.barWidth) : r !== o.barWidth && nt(
|
|
1603
1854
|
`bar-width-${o.xAxisId}`,
|
|
1604
1855
|
`Bars on the x axis "${o.xAxisId}" give different barWidth. A group shares one width fraction; that of the first (${r}) applies (ADR-0002).`
|
|
1605
1856
|
);
|
|
1606
1857
|
}
|
|
1607
1858
|
let i = 0;
|
|
1608
1859
|
for (const o of this.axesInOrder()) o.config.grid === !0 && i++;
|
|
1609
|
-
i > 1 &&
|
|
1860
|
+
i > 1 && nt(
|
|
1610
1861
|
"multiple-grids",
|
|
1611
1862
|
"More than one axis draws grid. Unaligned grids compete visually; `alignTicks` puts a further y axis' ticks on the first one's grid instead (R-4.15)."
|
|
1612
1863
|
);
|
|
@@ -1634,19 +1885,19 @@ class ze {
|
|
|
1634
1885
|
}
|
|
1635
1886
|
const i = n.config, o = i.data ?? this.data, r = this.findAxisConfig("x", i.xAxisId);
|
|
1636
1887
|
if (r === null) continue;
|
|
1637
|
-
const l =
|
|
1888
|
+
const l = Ii(
|
|
1638
1889
|
o,
|
|
1639
1890
|
r.accessor,
|
|
1640
1891
|
i.accessor,
|
|
1641
|
-
|
|
1892
|
+
Vt(i),
|
|
1642
1893
|
{
|
|
1643
|
-
value:
|
|
1894
|
+
value: de(i),
|
|
1644
1895
|
xMap: this.mapFor(r),
|
|
1645
1896
|
xGap: this.gapFor(r)
|
|
1646
1897
|
}
|
|
1647
1898
|
);
|
|
1648
|
-
if (n.materialized = l.series, e += l.series.length, i.kind === "bar") {
|
|
1649
|
-
const a =
|
|
1899
|
+
if (n.materialized = l.series, n.own = U(i) === void 0 ? null : l.series.y, n.stacked = null, e += l.series.length, i.kind === "bar") {
|
|
1900
|
+
const a = Mi(l.series.x, l.series.length);
|
|
1650
1901
|
n.step = a;
|
|
1651
1902
|
const c = a / 2;
|
|
1652
1903
|
n.extent = {
|
|
@@ -1655,7 +1906,7 @@ class ze {
|
|
|
1655
1906
|
xMax: l.extent.xMax + c
|
|
1656
1907
|
};
|
|
1657
1908
|
} else if (i.kind === "matrix") {
|
|
1658
|
-
const a =
|
|
1909
|
+
const a = Ce(l.series.x, l.series.length), c = Ce(l.series.y, l.series.length);
|
|
1659
1910
|
n.step = a, n.cellHeight = c, n.extent = {
|
|
1660
1911
|
xMin: l.extent.xMin - a / 2,
|
|
1661
1912
|
xMax: l.extent.xMax + a / 2,
|
|
@@ -1663,7 +1914,7 @@ class ze {
|
|
|
1663
1914
|
yMax: l.extent.yMax + c / 2
|
|
1664
1915
|
};
|
|
1665
1916
|
} else if (i.kind === "state") {
|
|
1666
|
-
const a =
|
|
1917
|
+
const a = ti(l.series.x, l.series.length);
|
|
1667
1918
|
n.step = a, n.extent = {
|
|
1668
1919
|
...l.extent,
|
|
1669
1920
|
xMax: l.extent.xMax + a,
|
|
@@ -1672,23 +1923,50 @@ class ze {
|
|
|
1672
1923
|
};
|
|
1673
1924
|
} else
|
|
1674
1925
|
n.step = null, n.extent = l.extent;
|
|
1675
|
-
if (
|
|
1676
|
-
const a =
|
|
1926
|
+
if (bt && i.kind !== "matrix") {
|
|
1927
|
+
const a = Ai(l.series.x, l.series.length);
|
|
1677
1928
|
if (a >= 0) {
|
|
1678
1929
|
const c = i.name ?? "?";
|
|
1679
|
-
|
|
1930
|
+
nt(
|
|
1680
1931
|
`x-unsorted-${c}`,
|
|
1681
1932
|
`Series "${c}": x values are not sorted ascending (index ${a}). Binary search and path building assume sortedness; there is no automatic sorting (R-2.6).`
|
|
1682
1933
|
);
|
|
1683
1934
|
}
|
|
1684
1935
|
}
|
|
1685
1936
|
}
|
|
1686
|
-
this.materialsDirty = !1, this.perf.materializeMs = (typeof performance > "u" ? 0 : performance.now()) - t, this.perf.points = e;
|
|
1937
|
+
this.stackAll(), this.materialsDirty = !1, this.perf.materializeMs = (typeof performance > "u" ? 0 : performance.now()) - t, this.perf.points = e;
|
|
1938
|
+
}
|
|
1939
|
+
/** Sums every stack anew from its members' own values (charts-stacking K2),
|
|
1940
|
+
once per materialisation: a member that changes moves every one above
|
|
1941
|
+
it. The stack is summed before anything is drawn, so an area's
|
|
1942
|
+
downsampling thins the stacked edges - each member keeps its own
|
|
1943
|
+
extremes per pixel column, and inside one column the edge of a member
|
|
1944
|
+
and the foot of the one above may part by a stroke's width. */
|
|
1945
|
+
stackAll() {
|
|
1946
|
+
const t = /* @__PURE__ */ new Map();
|
|
1947
|
+
for (const e of this.seriesInOrder()) {
|
|
1948
|
+
const n = U(e.config);
|
|
1949
|
+
if (n === void 0 || e.config.hidden === !0 || e.materialized === null || e.own === null) continue;
|
|
1950
|
+
const i = t.get(n);
|
|
1951
|
+
i === void 0 ? t.set(n, [e]) : i.push(e);
|
|
1952
|
+
}
|
|
1953
|
+
for (const e of t.values()) {
|
|
1954
|
+
const n = U(e[0].config), i = [...this.series.values()].some((r) => U(r.config) === n && _t(r.config)), o = vi(
|
|
1955
|
+
e.map((r) => ({ ...r.materialized, y: r.own })),
|
|
1956
|
+
i
|
|
1957
|
+
);
|
|
1958
|
+
e.forEach((r, l) => {
|
|
1959
|
+
const a = o[l], c = { ...r.materialized, y: a.top, y0: a.bottom };
|
|
1960
|
+
r.materialized = c, r.stacked = { value: a.value, total: a.total, normalize: i };
|
|
1961
|
+
const [h, f] = Oe(c, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY);
|
|
1962
|
+
r.extent !== null && (r.extent = { ...r.extent, yMin: h, yMax: f });
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1687
1965
|
}
|
|
1688
1966
|
/* ================= DOM binding, DPR, resize ================= */
|
|
1689
1967
|
bind(t, e, n, i) {
|
|
1690
1968
|
var r;
|
|
1691
|
-
this.container = t, this.themeRoot = i, this.seriesCanvas = e, this.overlayCanvas = n, this.seriesCtx = e.getContext("2d"), this.overlayCtx = n.getContext("2d"), this.measurer = new
|
|
1969
|
+
this.container = t, this.themeRoot = i, this.seriesCanvas = e, this.overlayCanvas = n, this.seriesCtx = e.getContext("2d"), this.overlayCtx = n.getContext("2d"), this.measurer = new Sn(i), this.dpr = typeof devicePixelRatio == "number" ? devicePixelRatio : 1, this.rebindDprWatch(), this.unsubscribeTheme = Tn(() => {
|
|
1692
1970
|
var l;
|
|
1693
1971
|
this.theme = null, this.painted.clear(), (l = this.measurer) == null || l.clear(), this.hysteresis.clear(), this.markLayoutDirty();
|
|
1694
1972
|
});
|
|
@@ -1702,7 +1980,7 @@ class ze {
|
|
|
1702
1980
|
this.readoutEl = t, this.summaryEl = e, this.scheduleSummary();
|
|
1703
1981
|
}
|
|
1704
1982
|
setWording(t) {
|
|
1705
|
-
t !== this.wording && (this.wording = t, this.
|
|
1983
|
+
t !== this.wording && (this.wording = t, this.markLayoutDirty());
|
|
1706
1984
|
}
|
|
1707
1985
|
unbind() {
|
|
1708
1986
|
var t, e, n, i, o;
|
|
@@ -1745,7 +2023,7 @@ class ze {
|
|
|
1745
2023
|
}));
|
|
1746
2024
|
}
|
|
1747
2025
|
frame() {
|
|
1748
|
-
if (this.applyPendingSize(), this.theme === null && this.themeRoot !== null && (this.theme =
|
|
2026
|
+
if (this.applyPendingSize(), this.theme === null && this.themeRoot !== null && (this.theme = An(this.themeRoot)), this.cssWidth <= 0 || this.cssHeight <= 0) {
|
|
1749
2027
|
this.layoutDirty && this.pushLayoutSnapshot();
|
|
1750
2028
|
return;
|
|
1751
2029
|
}
|
|
@@ -1785,7 +2063,7 @@ class ze {
|
|
|
1785
2063
|
// A hidden series has no say: the axis fits what is shown.
|
|
1786
2064
|
extent: r.config.hidden === !0 ? null : n ? this.visibleExtentOf(r) : r.extent
|
|
1787
2065
|
}));
|
|
1788
|
-
return
|
|
2066
|
+
return Ti(t, e, i, this.limitValues(t, e));
|
|
1789
2067
|
}
|
|
1790
2068
|
/** The extent of what a fixed x domain shows. A domain that is not fixed
|
|
1791
2069
|
shows every point - "nice" and "data" both contain the data -, and a band
|
|
@@ -1796,8 +2074,8 @@ class ze {
|
|
|
1796
2074
|
if (!Array.isArray(e) || t.materialized === null || n === "state" || n === "matrix")
|
|
1797
2075
|
return t.extent;
|
|
1798
2076
|
const [i, o] = e;
|
|
1799
|
-
let [r, l] =
|
|
1800
|
-
const a =
|
|
2077
|
+
let [r, l] = Oe(t.materialized, i, o);
|
|
2078
|
+
const a = Vt(t.config);
|
|
1801
2079
|
return typeof a == "number" && r <= l && (r = Math.min(r, a), l = Math.max(l, a)), { xMin: i, xMax: o, yMin: r, yMax: l };
|
|
1802
2080
|
}
|
|
1803
2081
|
/** The values of the limits that are to pull this axis along. */
|
|
@@ -1821,12 +2099,12 @@ class ze {
|
|
|
1821
2099
|
mapFor(t) {
|
|
1822
2100
|
const e = t.calendar;
|
|
1823
2101
|
if (!(e === void 0 || e.length === 0))
|
|
1824
|
-
return (n) =>
|
|
2102
|
+
return (n) => Cn(n, e);
|
|
1825
2103
|
}
|
|
1826
2104
|
gapFor(t) {
|
|
1827
2105
|
const e = t.calendar;
|
|
1828
2106
|
if (!(e === void 0 || e.length === 0))
|
|
1829
|
-
return (n) =>
|
|
2107
|
+
return (n) => $n(n, e);
|
|
1830
2108
|
}
|
|
1831
2109
|
extentFor(t) {
|
|
1832
2110
|
return this.axisExtent(t.orientation, t.id);
|
|
@@ -1847,7 +2125,7 @@ class ze {
|
|
|
1847
2125
|
extent: this.extentFor(r),
|
|
1848
2126
|
domainMode: r.domain,
|
|
1849
2127
|
tickCount: r.tickCount,
|
|
1850
|
-
tickFormat: r.tickFormat,
|
|
2128
|
+
tickFormat: r.orientation === "y" ? this.yTickFormat(r.id) : r.tickFormat,
|
|
1851
2129
|
tickValues: r.ticks,
|
|
1852
2130
|
time: r.time,
|
|
1853
2131
|
calendar: r.calendar,
|
|
@@ -1855,7 +2133,7 @@ class ze {
|
|
|
1855
2133
|
limitLabels: r.orientation === "y" ? this.limitsInOrder().map((l) => l.config).filter((l) => l.orientation === "y" && this.limitAxisId(l) === r.id && l.label !== void 0 && l.label !== "").map((l) => l.label) : void 0
|
|
1856
2134
|
});
|
|
1857
2135
|
}
|
|
1858
|
-
this.layout =
|
|
2136
|
+
this.layout = Xn({
|
|
1859
2137
|
width: this.cssWidth,
|
|
1860
2138
|
height: this.cssHeight,
|
|
1861
2139
|
padding: this.padding,
|
|
@@ -1872,22 +2150,24 @@ class ze {
|
|
|
1872
2150
|
/* ================= Series colours and legend entries ================= */
|
|
1873
2151
|
/** A caller's CSS colour as the canvas can draw it (finding 15). */
|
|
1874
2152
|
paint(t) {
|
|
2153
|
+
var i;
|
|
1875
2154
|
const e = this.themeRoot;
|
|
1876
2155
|
if (e === null) return t;
|
|
2156
|
+
if (((i = this.theme) == null ? void 0 : i.forced) === !0) return this.theme.colorText;
|
|
1877
2157
|
let n = this.painted.get(t);
|
|
1878
|
-
return n === void 0 && (n =
|
|
2158
|
+
return n === void 0 && (n = In(e, { color: t }).color, this.painted.set(t, n)), n;
|
|
1879
2159
|
}
|
|
1880
2160
|
colorFor(t) {
|
|
1881
2161
|
var i;
|
|
1882
2162
|
if (t.config.color !== void 0) return this.paint(t.config.color);
|
|
1883
|
-
if (!
|
|
2163
|
+
if (!mt(t.config)) return "";
|
|
1884
2164
|
const e = t.config.tone;
|
|
1885
2165
|
if (e !== void 0) {
|
|
1886
|
-
const o = this.theme ??
|
|
2166
|
+
const o = this.theme ?? H;
|
|
1887
2167
|
return e === "alarm" ? o.colorAlarm : e === "warning" ? o.colorWarning : o.colorOk;
|
|
1888
2168
|
}
|
|
1889
|
-
const n = ((i = this.theme) == null ? void 0 : i.series) ??
|
|
1890
|
-
return n[this.paletteSlot(t) % Math.max(1, n.length)] ??
|
|
2169
|
+
const n = ((i = this.theme) == null ? void 0 : i.series) ?? H.series;
|
|
2170
|
+
return n[this.paletteSlot(t) % Math.max(1, n.length)] ?? H.series[0] ?? "#2563eb";
|
|
1891
2171
|
}
|
|
1892
2172
|
/** Named: the place of the name. Nameless: the position among the series that
|
|
1893
2173
|
take a palette place, as before - and a warning as soon as that shifts
|
|
@@ -1896,49 +2176,75 @@ class ze {
|
|
|
1896
2176
|
if (t.config.name !== void 0) return t.slot;
|
|
1897
2177
|
let e = 0;
|
|
1898
2178
|
for (const n of this.series.values())
|
|
1899
|
-
n.order < t.order &&
|
|
1900
|
-
return t.lastSlot !== null && t.lastSlot !== e &&
|
|
2179
|
+
n.order < t.order && mt(n.config) && e++;
|
|
2180
|
+
return t.lastSlot !== null && t.lastSlot !== e && nt(
|
|
1901
2181
|
"series-without-name-colour",
|
|
1902
2182
|
"a series without a name has changed its colour, because a series before it went away - with `name` it keeps it."
|
|
1903
2183
|
), t.lastSlot = e, e;
|
|
1904
2184
|
}
|
|
1905
2185
|
nameFor(t, e) {
|
|
1906
|
-
return t.config.name !== void 0 ? t.config.name : (
|
|
2186
|
+
return t.config.name !== void 0 ? t.config.name : (nt(
|
|
1907
2187
|
"series-without-name",
|
|
1908
2188
|
`a series without a name is called "Series ${e + 1}" in the legend and the tooltip - the name belongs in \`name\`.`
|
|
1909
2189
|
), `Series ${e + 1}`);
|
|
1910
2190
|
}
|
|
1911
2191
|
legendItems() {
|
|
1912
|
-
const t = [], e = /* @__PURE__ */ new Map();
|
|
1913
|
-
return this.seriesInOrder().forEach((
|
|
1914
|
-
const
|
|
1915
|
-
if (
|
|
1916
|
-
|
|
1917
|
-
const
|
|
1918
|
-
if (
|
|
1919
|
-
|
|
2192
|
+
const t = [], e = /* @__PURE__ */ new Map(), n = this.theme ?? H, i = this.marked() ? this.stateHatches() : null;
|
|
2193
|
+
return this.seriesInOrder().forEach((o, r) => {
|
|
2194
|
+
const l = o.config;
|
|
2195
|
+
if (l.kind === "state") {
|
|
2196
|
+
l.states.forEach((a, c) => {
|
|
2197
|
+
const h = `${a.label}\0${a.color}`, f = e.get(h);
|
|
2198
|
+
if (f !== void 0) {
|
|
2199
|
+
f.seriesIds.includes(o.order) || f.seriesIds.push(o.order), f.hidden && (f.hidden = l.hidden === !0);
|
|
1920
2200
|
return;
|
|
1921
2201
|
}
|
|
1922
|
-
const
|
|
1923
|
-
id: `${
|
|
1924
|
-
name:
|
|
1925
|
-
hidden:
|
|
1926
|
-
color:
|
|
1927
|
-
seriesIds: [
|
|
2202
|
+
const m = {
|
|
2203
|
+
id: `${o.order}:${c}`,
|
|
2204
|
+
name: a.label,
|
|
2205
|
+
hidden: l.hidden === !0,
|
|
2206
|
+
color: a.color,
|
|
2207
|
+
seriesIds: [o.order],
|
|
2208
|
+
mark: i === null ? null : { dash: null, marker: null, swatches: [{ color: this.paint(a.color), hatch: i.get(a.label) ?? "none" }], ground: n.colorBg }
|
|
1928
2209
|
};
|
|
1929
|
-
e.set(
|
|
2210
|
+
e.set(h, m), t.push(m);
|
|
1930
2211
|
});
|
|
1931
2212
|
return;
|
|
1932
2213
|
}
|
|
1933
2214
|
t.push({
|
|
1934
|
-
id: String(
|
|
1935
|
-
name: this.nameFor(
|
|
1936
|
-
hidden:
|
|
1937
|
-
color:
|
|
1938
|
-
seriesIds: [
|
|
2215
|
+
id: String(o.order),
|
|
2216
|
+
name: this.nameFor(o, r),
|
|
2217
|
+
hidden: l.hidden === !0,
|
|
2218
|
+
color: l.kind === "matrix" ? Ri(Ft(l.coloring, n)) : this.colorFor(o),
|
|
2219
|
+
seriesIds: [o.order],
|
|
2220
|
+
mark: this.legendMark(o, n)
|
|
1939
2221
|
});
|
|
1940
2222
|
}), t;
|
|
1941
2223
|
}
|
|
2224
|
+
/** What a series' chip shows under encoding by marks. */
|
|
2225
|
+
legendMark(t, e) {
|
|
2226
|
+
if (!this.marked()) return null;
|
|
2227
|
+
const n = t.config;
|
|
2228
|
+
if (n.kind === "matrix")
|
|
2229
|
+
return { dash: null, marker: null, swatches: Ft(n.coloring, e).map((r, l) => ({ color: this.paint(r), hatch: Pt(l) })), ground: e.colorBg };
|
|
2230
|
+
const i = this.marksOf(t);
|
|
2231
|
+
if (i === null) return null;
|
|
2232
|
+
switch (n.kind) {
|
|
2233
|
+
case "line":
|
|
2234
|
+
return { dash: n.dash ?? i.dash, marker: i.marker, swatches: null, ground: e.colorBg };
|
|
2235
|
+
case "area":
|
|
2236
|
+
return {
|
|
2237
|
+
dash: n.dash ?? i.dash,
|
|
2238
|
+
marker: null,
|
|
2239
|
+
swatches: [{ color: this.colorFor(t), hatch: i.hatch, opacity: n.fillOpacity }],
|
|
2240
|
+
ground: e.colorBg
|
|
2241
|
+
};
|
|
2242
|
+
case "scatter":
|
|
2243
|
+
return { dash: null, marker: i.marker, swatches: null, ground: e.colorBg };
|
|
2244
|
+
default:
|
|
2245
|
+
return { dash: null, marker: null, swatches: [{ color: this.colorFor(t), hatch: i.hatch }], ground: e.colorBg };
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
1942
2248
|
/* ---------- Limits, ready in pixels ---------- */
|
|
1943
2249
|
limitColor(t, e) {
|
|
1944
2250
|
return t.color !== void 0 ? this.paint(t.color) : t.role === "control" ? e.colorAxis : t.role === "zone" ? e.colorGrid : t.severity === "alarm" ? e.colorAlarm : e.colorWarning;
|
|
@@ -1956,7 +2262,7 @@ class ze {
|
|
|
1956
2262
|
}
|
|
1957
2263
|
}
|
|
1958
2264
|
limitItems(t) {
|
|
1959
|
-
const e = this.theme ??
|
|
2265
|
+
const e = this.theme ?? H, n = [];
|
|
1960
2266
|
for (const { config: i } of this.limitsInOrder()) {
|
|
1961
2267
|
if (i.kind === "band" !== t) continue;
|
|
1962
2268
|
const o = this.findAxis(i.orientation, this.limitAxisId(i));
|
|
@@ -1969,7 +2275,8 @@ class ze {
|
|
|
1969
2275
|
toPx: o.scale.toPx(this.limitAt(i, i.to)),
|
|
1970
2276
|
color: r,
|
|
1971
2277
|
band: !0,
|
|
1972
|
-
dash: l
|
|
2278
|
+
dash: l,
|
|
2279
|
+
hatch: this.marked()
|
|
1973
2280
|
});
|
|
1974
2281
|
else {
|
|
1975
2282
|
const a = o.scale.toPx(this.limitAt(i, i.value));
|
|
@@ -1993,12 +2300,12 @@ class ze {
|
|
|
1993
2300
|
if (i.label === void 0 || i.label === "") continue;
|
|
1994
2301
|
const o = this.findAxis(i.orientation, this.limitAxisId(i));
|
|
1995
2302
|
if (o === null) continue;
|
|
1996
|
-
const r = i.kind === "line" ? this.limitAt(i, i.value) : (this.limitAt(i, i.from) + this.limitAt(i, i.to)) / 2, l = o.scale.toPx(r), a = (((e = this.measurer) == null ? void 0 : e.measure(i.label,
|
|
2303
|
+
const r = i.kind === "line" ? this.limitAt(i, i.value) : (this.limitAt(i, i.from) + this.limitAt(i, i.to)) / 2, l = o.scale.toPx(r), a = (((e = this.measurer) == null ? void 0 : e.measure(i.label, ct).width) ?? 0) + 4;
|
|
1997
2304
|
t.push({
|
|
1998
2305
|
id: n,
|
|
1999
2306
|
axisKey: o.key,
|
|
2000
2307
|
px: l,
|
|
2001
|
-
labelLeft:
|
|
2308
|
+
labelLeft: Qe(l, a, this.cssWidth),
|
|
2002
2309
|
label: i.label,
|
|
2003
2310
|
severity: i.severity,
|
|
2004
2311
|
role: i.role
|
|
@@ -2008,101 +2315,113 @@ class ze {
|
|
|
2008
2315
|
}
|
|
2009
2316
|
/* ================= Drawing ================= */
|
|
2010
2317
|
drawItems() {
|
|
2011
|
-
const t = []
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2318
|
+
const t = [];
|
|
2319
|
+
let e;
|
|
2320
|
+
const n = this.seriesInOrder().filter((l) => l.config.hidden !== !0), i = this.highlight, o = i !== null && n.some((l) => i.includes(l.order)) ? i : null, r = Ei(
|
|
2321
|
+
n.map((l) => ({
|
|
2322
|
+
order: l.order,
|
|
2323
|
+
kind: l.config.kind,
|
|
2324
|
+
xAxisId: l.config.xAxisId,
|
|
2325
|
+
step: l.step ?? 0,
|
|
2326
|
+
fraction: l.config.kind === "bar" ? l.config.barWidth : 0,
|
|
2327
|
+
stack: U(l.config)
|
|
2018
2328
|
}))
|
|
2019
2329
|
);
|
|
2020
|
-
return
|
|
2021
|
-
const
|
|
2022
|
-
if (
|
|
2023
|
-
const
|
|
2024
|
-
if (
|
|
2025
|
-
const
|
|
2026
|
-
x:
|
|
2027
|
-
y:
|
|
2028
|
-
length:
|
|
2029
|
-
xScale:
|
|
2030
|
-
yScale:
|
|
2031
|
-
color: this.colorFor(
|
|
2032
|
-
alpha:
|
|
2033
|
-
},
|
|
2034
|
-
switch (
|
|
2330
|
+
return n.forEach((l) => {
|
|
2331
|
+
const a = l.materialized;
|
|
2332
|
+
if (a === null) return;
|
|
2333
|
+
const c = this.findAxis("x", l.config.xAxisId), h = this.findAxis("y", l.config.yAxisId);
|
|
2334
|
+
if (c === null || h === null) return;
|
|
2335
|
+
const f = o !== null && !o.includes(l.order), m = this.marksOf(l), p = {
|
|
2336
|
+
x: a.x,
|
|
2337
|
+
y: a.y,
|
|
2338
|
+
length: a.length,
|
|
2339
|
+
xScale: c.scale,
|
|
2340
|
+
yScale: h.scale,
|
|
2341
|
+
color: this.colorFor(l),
|
|
2342
|
+
alpha: f ? 0.25 : 1
|
|
2343
|
+
}, u = l.config, g = u.kind === "line" || u.kind === "area" ? on(a, c.scale.domain[0], c.scale.domain[1], c.scale.m, c.scale.b, this.layout.plot.width) : a;
|
|
2344
|
+
switch (p.x = g.x, p.y = g.y, p.length = g.length, u.kind) {
|
|
2035
2345
|
case "line":
|
|
2036
2346
|
t.push({
|
|
2037
|
-
...
|
|
2347
|
+
...p,
|
|
2038
2348
|
kind: "line",
|
|
2039
|
-
strokeWidth:
|
|
2040
|
-
dash
|
|
2041
|
-
|
|
2042
|
-
|
|
2349
|
+
strokeWidth: u.strokeWidth,
|
|
2350
|
+
// A dash of the caller's own wins over the one its place gives.
|
|
2351
|
+
dash: u.dash ?? (m == null ? void 0 : m.dash),
|
|
2352
|
+
markers: u.markers,
|
|
2353
|
+
step: u.step,
|
|
2354
|
+
marker: m == null ? void 0 : m.marker
|
|
2043
2355
|
});
|
|
2044
2356
|
break;
|
|
2045
2357
|
case "area":
|
|
2046
2358
|
t.push({
|
|
2047
|
-
...
|
|
2359
|
+
...p,
|
|
2048
2360
|
kind: "area",
|
|
2049
|
-
y0:
|
|
2361
|
+
y0: g.y0,
|
|
2050
2362
|
baseline: 0,
|
|
2051
|
-
fillOpacity:
|
|
2052
|
-
strokeWidth:
|
|
2053
|
-
dash: m.dash
|
|
2363
|
+
fillOpacity: u.fillOpacity,
|
|
2364
|
+
strokeWidth: u.strokeWidth,
|
|
2365
|
+
dash: u.dash ?? (m == null ? void 0 : m.dash),
|
|
2366
|
+
hatch: m == null ? void 0 : m.hatch,
|
|
2367
|
+
edges: l.stacked !== null
|
|
2054
2368
|
});
|
|
2055
2369
|
break;
|
|
2056
2370
|
case "bar": {
|
|
2057
|
-
const
|
|
2371
|
+
const d = r.get(l.order) ?? {
|
|
2058
2372
|
index: 0,
|
|
2059
2373
|
size: 1,
|
|
2060
|
-
step:
|
|
2061
|
-
fraction:
|
|
2062
|
-
},
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2374
|
+
step: l.step ?? 0,
|
|
2375
|
+
fraction: u.barWidth
|
|
2376
|
+
}, y = c.scale.domain, b = Li(
|
|
2377
|
+
Si(d.step, y[1] - y[0]),
|
|
2378
|
+
d.fraction,
|
|
2379
|
+
d.index,
|
|
2380
|
+
d.size
|
|
2067
2381
|
);
|
|
2068
2382
|
t.push({
|
|
2069
|
-
...
|
|
2383
|
+
...p,
|
|
2070
2384
|
kind: "bar",
|
|
2385
|
+
y0: a.y0,
|
|
2071
2386
|
baseline: 0,
|
|
2072
|
-
offset:
|
|
2073
|
-
width:
|
|
2387
|
+
offset: b.offset,
|
|
2388
|
+
width: b.width,
|
|
2389
|
+
hatch: m == null ? void 0 : m.hatch,
|
|
2390
|
+
edges: l.stacked !== null
|
|
2074
2391
|
});
|
|
2075
2392
|
break;
|
|
2076
2393
|
}
|
|
2077
2394
|
case "scatter":
|
|
2078
|
-
t.push({ ...
|
|
2395
|
+
t.push({ ...p, kind: "scatter", radius: u.radius, marker: m == null ? void 0 : m.marker });
|
|
2079
2396
|
break;
|
|
2080
2397
|
case "state": {
|
|
2081
|
-
const
|
|
2398
|
+
const d = this.lanePx(u, h);
|
|
2082
2399
|
t.push({
|
|
2083
|
-
...
|
|
2400
|
+
...p,
|
|
2084
2401
|
kind: "state",
|
|
2085
|
-
colors:
|
|
2086
|
-
laneTop:
|
|
2087
|
-
laneBottom:
|
|
2088
|
-
lastEnd: this.lastEnd(
|
|
2402
|
+
colors: u.states.map((y) => this.paint(y.color)),
|
|
2403
|
+
laneTop: d.top,
|
|
2404
|
+
laneBottom: d.bottom,
|
|
2405
|
+
lastEnd: this.lastEnd(l, a, c),
|
|
2406
|
+
hatches: this.marked() ? u.states.map((y) => (e ?? (e = this.stateHatches())).get(y.label) ?? "none") : null
|
|
2089
2407
|
});
|
|
2090
2408
|
break;
|
|
2091
2409
|
}
|
|
2092
2410
|
case "matrix": {
|
|
2093
|
-
const
|
|
2411
|
+
const d = Ft(u.coloring, this.theme ?? H).map((y) => this.paint(y));
|
|
2094
2412
|
t.push({
|
|
2095
|
-
...
|
|
2413
|
+
...p,
|
|
2096
2414
|
kind: "matrix",
|
|
2097
|
-
buckets:
|
|
2098
|
-
colors:
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
),
|
|
2103
|
-
height: Nt(
|
|
2104
|
-
r.cellHeight ?? 0,
|
|
2415
|
+
buckets: l.buckets ?? (l.buckets = ze(a, u.coloring, d.length)),
|
|
2416
|
+
colors: d,
|
|
2417
|
+
hatches: this.marked() ? d.map((y, b) => Pt(b)) : null,
|
|
2418
|
+
width: Et(
|
|
2419
|
+
l.step ?? 0,
|
|
2105
2420
|
c.scale.domain[1] - c.scale.domain[0]
|
|
2421
|
+
),
|
|
2422
|
+
height: Et(
|
|
2423
|
+
l.cellHeight ?? 0,
|
|
2424
|
+
h.scale.domain[1] - h.scale.domain[0]
|
|
2106
2425
|
)
|
|
2107
2426
|
});
|
|
2108
2427
|
break;
|
|
@@ -2121,7 +2440,7 @@ class ze {
|
|
|
2121
2440
|
const l = r.x[r.length - 1];
|
|
2122
2441
|
l > i && (i = l);
|
|
2123
2442
|
}
|
|
2124
|
-
return
|
|
2443
|
+
return Qn(e.x, e.length, i, t.step ?? 0, n.scale.domain[1]);
|
|
2125
2444
|
}
|
|
2126
2445
|
/** Lane of a state series in pixels. Without a value the whole domain of its y
|
|
2127
2446
|
axis: a single series fills its band, a stack gets a domain with one unit per
|
|
@@ -2135,7 +2454,7 @@ class ze {
|
|
|
2135
2454
|
const t = this.seriesCtx, e = this.theme;
|
|
2136
2455
|
if (!t || !e) return;
|
|
2137
2456
|
const n = typeof performance > "u" ? 0 : performance.now();
|
|
2138
|
-
|
|
2457
|
+
hi(t, {
|
|
2139
2458
|
width: this.cssWidth,
|
|
2140
2459
|
height: this.cssHeight,
|
|
2141
2460
|
plot: this.layout.plot,
|
|
@@ -2148,7 +2467,7 @@ class ze {
|
|
|
2148
2467
|
}
|
|
2149
2468
|
drawOverlayLayer() {
|
|
2150
2469
|
const t = this.overlayCtx, e = this.theme;
|
|
2151
|
-
!t || !e || (
|
|
2470
|
+
!t || !e || (di(t, {
|
|
2152
2471
|
width: this.cssWidth,
|
|
2153
2472
|
height: this.cssHeight,
|
|
2154
2473
|
plot: this.layout.plot,
|
|
@@ -2191,7 +2510,7 @@ class ze {
|
|
|
2191
2510
|
const o = this.findAxis("x", n.primary.entry.config.xAxisId);
|
|
2192
2511
|
if (o !== null && this.share({ axisId: o.id, value: o.scale.fromPx(n.state.hit.xPx) }), i !== this.hoverKey) {
|
|
2193
2512
|
const r = n.primary.entry.config.xAxisId;
|
|
2194
|
-
this.hoverKey = i, this.hoverXLabel = this.xLabel(r, n.primary.xValue,
|
|
2513
|
+
this.hoverKey = i, this.hoverXLabel = this.xLabel(r, n.primary.xValue, Pi(n.primary)), this.hoverRows = n.chosen.map((l) => this.tooltipRow(l, r)), this.hoverOrders = n.chosen.map((l) => l.entry.order), this.hoverTotals = this.totalsOf(n.chosen), this.pushHoverSnapshot();
|
|
2195
2514
|
}
|
|
2196
2515
|
return !0;
|
|
2197
2516
|
}
|
|
@@ -2206,23 +2525,24 @@ class ze {
|
|
|
2206
2525
|
hitTest(t, e) {
|
|
2207
2526
|
var p;
|
|
2208
2527
|
const n = ((p = this.tooltip) == null ? void 0 : p.mode) ?? "x", i = [];
|
|
2209
|
-
if (this.seriesInOrder().forEach((u,
|
|
2210
|
-
const
|
|
2211
|
-
if (
|
|
2212
|
-
const
|
|
2213
|
-
if (b === null ||
|
|
2214
|
-
const
|
|
2528
|
+
if (this.seriesInOrder().forEach((u, g) => {
|
|
2529
|
+
const d = u.materialized;
|
|
2530
|
+
if (d === null || d.length === 0 || u.config.hidden === !0) return;
|
|
2531
|
+
const y = u.config, b = this.findAxis("x", y.xAxisId), v = this.findAxis("y", y.yAxisId);
|
|
2532
|
+
if (b === null || v === null) return;
|
|
2533
|
+
const w = b.scale.fromPx(t), L = v.scale.fromPx(e), A = this.hitIn(u, d, b, v, e, w, L, n);
|
|
2215
2534
|
A !== null && i.push({
|
|
2216
2535
|
entry: u,
|
|
2217
2536
|
index: A.index,
|
|
2218
2537
|
color: A.color ?? this.colorFor(u),
|
|
2219
|
-
name: this.nameFor(u,
|
|
2538
|
+
name: this.nameFor(u, g),
|
|
2220
2539
|
px: A.px,
|
|
2221
2540
|
py: A.py,
|
|
2222
2541
|
xValue: A.xValue,
|
|
2223
2542
|
yValue: A.yValue,
|
|
2224
2543
|
marked: A.marked,
|
|
2225
2544
|
areal: A.areal,
|
|
2545
|
+
covers: A.covers === !0,
|
|
2226
2546
|
value: A.value,
|
|
2227
2547
|
segment: A.segment
|
|
2228
2548
|
});
|
|
@@ -2231,11 +2551,12 @@ class ze {
|
|
|
2231
2551
|
let l = r[0];
|
|
2232
2552
|
if (n === "nearest") {
|
|
2233
2553
|
let u = Number.POSITIVE_INFINITY;
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2554
|
+
const g = o.filter((d) => d.covers);
|
|
2555
|
+
for (const d of g.length > 0 ? g : o) {
|
|
2556
|
+
const y = d.px - t, b = d.py - e, v = y * y + b * b;
|
|
2557
|
+
(v < u || v === u && d.covers) && (u = v, l = d);
|
|
2237
2558
|
}
|
|
2238
|
-
if (u >
|
|
2559
|
+
if (g.length === 0 && u > We * We) {
|
|
2239
2560
|
for (const d of i)
|
|
2240
2561
|
if (d.areal) {
|
|
2241
2562
|
l = d;
|
|
@@ -2244,16 +2565,16 @@ class ze {
|
|
|
2244
2565
|
}
|
|
2245
2566
|
} else {
|
|
2246
2567
|
let u = Number.POSITIVE_INFINITY;
|
|
2247
|
-
for (const
|
|
2248
|
-
const
|
|
2249
|
-
|
|
2568
|
+
for (const g of r) {
|
|
2569
|
+
const d = Math.abs(g.px - t);
|
|
2570
|
+
d < u && (u = d, l = g);
|
|
2250
2571
|
}
|
|
2251
2572
|
}
|
|
2252
2573
|
const a = n === "nearest" ? [l] : i.filter(
|
|
2253
2574
|
// An area is always included: it covers the pointer, otherwise it
|
|
2254
2575
|
// would not have reported a hit at all. Only points have to share the
|
|
2255
2576
|
// x position.
|
|
2256
|
-
(u) => u.areal || Math.abs(u.px - l.px) <=
|
|
2577
|
+
(u) => u.areal || Math.abs(u.px - l.px) <= Fi
|
|
2257
2578
|
), c = a.map((u) => ({
|
|
2258
2579
|
seriesName: u.name,
|
|
2259
2580
|
color: u.color,
|
|
@@ -2320,7 +2641,7 @@ class ze {
|
|
|
2320
2641
|
const e = this.emphasised();
|
|
2321
2642
|
if (e === null) return !1;
|
|
2322
2643
|
if (e.config.kind === "matrix") return this.cellKey(t.key, e);
|
|
2323
|
-
const n = t.shiftKey ? void 0 :
|
|
2644
|
+
const n = t.shiftKey ? void 0 : Yi[t.key];
|
|
2324
2645
|
return n !== void 0 ? (this.walk(n), !0) : !t.shiftKey && (t.key === "ArrowDown" || t.key === "ArrowUp") ? (this.changeSeries(t.key === "ArrowDown" ? 1 : -1), !0) : !1;
|
|
2325
2646
|
}
|
|
2326
2647
|
/** Zoom and pan by key (Q6), only where the caller controls the domain:
|
|
@@ -2329,8 +2650,8 @@ class ze {
|
|
|
2329
2650
|
var i;
|
|
2330
2651
|
if (!this.hasZoom()) return !1;
|
|
2331
2652
|
const e = this.layout.plot, n = ((i = this.hover) == null ? void 0 : i.hit.xPx) ?? e.x + e.width / 2;
|
|
2332
|
-
if (t.key === "+" || t.key === "=") this.zoomAt(n, 1 /
|
|
2333
|
-
else if (t.key === "-" || t.key === "_") this.zoomAt(n,
|
|
2653
|
+
if (t.key === "+" || t.key === "=") this.zoomAt(n, 1 / Be);
|
|
2654
|
+
else if (t.key === "-" || t.key === "_") this.zoomAt(n, Be);
|
|
2334
2655
|
else if (t.key === "0") this.doubleClick();
|
|
2335
2656
|
else if (t.shiftKey && (t.key === "ArrowLeft" || t.key === "ArrowRight"))
|
|
2336
2657
|
this.panBy((t.key === "ArrowLeft" ? 1 : -1) * e.width / 10);
|
|
@@ -2351,7 +2672,7 @@ class ze {
|
|
|
2351
2672
|
}
|
|
2352
2673
|
const n = e === null ? null : this.findAxis("x", e.config.xAxisId);
|
|
2353
2674
|
if (e === null || n === null) return;
|
|
2354
|
-
const i = this.activeBy === null ? null : this.walkFrom(), o =
|
|
2675
|
+
const i = this.activeBy === null ? null : this.walkFrom(), o = jt(this.walked(e), i, t, n.scale.domain);
|
|
2355
2676
|
o !== null && this.showPosition(e, o);
|
|
2356
2677
|
}
|
|
2357
2678
|
changeSeries(t) {
|
|
@@ -2361,7 +2682,7 @@ class ze {
|
|
|
2361
2682
|
this.emphasis = i.order, this.setHighlight([i.order]), this.keyHighlight = !0;
|
|
2362
2683
|
const o = this.walkFrom(), r = this.findAxis("x", i.config.xAxisId);
|
|
2363
2684
|
if (r === null) return;
|
|
2364
|
-
const l = o === null ?
|
|
2685
|
+
const l = o === null ? jt(this.walked(i), null, "last", r.scale.domain) : De(this.walked(i), o, r.scale.domain);
|
|
2365
2686
|
if (l !== null)
|
|
2366
2687
|
if (this.keyCell = null, i.config.kind === "matrix") {
|
|
2367
2688
|
const a = this.columnStart(i, l);
|
|
@@ -2374,21 +2695,21 @@ class ze {
|
|
|
2374
2695
|
cellKey(t, e) {
|
|
2375
2696
|
const n = e.materialized, i = this.keyCell ?? this.lastCell(e);
|
|
2376
2697
|
if (i === null) return !1;
|
|
2377
|
-
const o =
|
|
2698
|
+
const o = Gi[t];
|
|
2378
2699
|
let r;
|
|
2379
|
-
if (o !== void 0) r =
|
|
2380
|
-
else if (t === "Home" || t === "End") r =
|
|
2700
|
+
if (o !== void 0) r = Pe(n, i, o);
|
|
2701
|
+
else if (t === "Home" || t === "End") r = mi(n, i, t === "Home" ? "start" : "end");
|
|
2381
2702
|
else return !1;
|
|
2382
2703
|
return r === i && (o === "up" || o === "down") && this.walkable().length > 1 ? (this.changeSeries(o === "down" ? 1 : -1), !0) : (this.showCell(e, r), !0);
|
|
2383
2704
|
}
|
|
2384
2705
|
/** Where a matrix' walk starts: the newest column, its lowest row. */
|
|
2385
2706
|
lastCell(t) {
|
|
2386
|
-
const e = t.materialized, n = this.findAxis("x", t.config.xAxisId), i = n === null ? null :
|
|
2707
|
+
const e = t.materialized, n = this.findAxis("x", t.config.xAxisId), i = n === null ? null : jt([e], null, "last", n.scale.domain);
|
|
2387
2708
|
return i === null ? null : this.columnStart(t, i);
|
|
2388
2709
|
}
|
|
2389
2710
|
/** The lowest cell with a value in a matrix' column. */
|
|
2390
2711
|
columnStart(t, e) {
|
|
2391
|
-
const n = { x: e, y: Number.NEGATIVE_INFINITY }, i =
|
|
2712
|
+
const n = { x: e, y: Number.NEGATIVE_INFINITY }, i = Pe(t.materialized, n, "up");
|
|
2392
2713
|
return i === n ? null : i;
|
|
2393
2714
|
}
|
|
2394
2715
|
showCell(t, e, n = !0) {
|
|
@@ -2405,7 +2726,7 @@ class ze {
|
|
|
2405
2726
|
const a = this.lanePx(t.config, o);
|
|
2406
2727
|
l = (a.top + a.bottom) / 2;
|
|
2407
2728
|
} else {
|
|
2408
|
-
const a = r.y[
|
|
2729
|
+
const a = r.y[he(r.x, r.length, e)];
|
|
2409
2730
|
l = Number.isNaN(a) ? this.layout.plot.y + this.layout.plot.height / 2 : o.scale.toPx(a);
|
|
2410
2731
|
}
|
|
2411
2732
|
this.moveKey(e, i.scale.toPx(e), l, n);
|
|
@@ -2421,24 +2742,38 @@ class ze {
|
|
|
2421
2742
|
this.readoutTimer = null;
|
|
2422
2743
|
const t = this.readoutEl;
|
|
2423
2744
|
t !== null && this.activeBy === "keyboard" && (t.textContent = this.readoutText());
|
|
2424
|
-
},
|
|
2745
|
+
}, _i));
|
|
2425
2746
|
}
|
|
2426
2747
|
readoutText() {
|
|
2427
|
-
var
|
|
2748
|
+
var o;
|
|
2428
2749
|
const t = this.hover;
|
|
2429
2750
|
if (t === null) return "";
|
|
2430
|
-
const e = t.hit.points.map((
|
|
2431
|
-
const
|
|
2432
|
-
return { order: this.hoverOrders[
|
|
2433
|
-
}), n = (
|
|
2434
|
-
|
|
2751
|
+
const e = t.hit.points.map((r, l) => {
|
|
2752
|
+
const a = this.hoverRows[l];
|
|
2753
|
+
return { order: this.hoverOrders[l], name: r.seriesName, value: (a == null ? void 0 : a.value) ?? "", x: (a == null ? void 0 : a.x) ?? "" };
|
|
2754
|
+
}), n = (o = this.emphasised()) == null ? void 0 : o.order;
|
|
2755
|
+
e.sort((r, l) => +(l.order === n) - +(r.order === n));
|
|
2756
|
+
const i = this.hoverTotals.map((r) => ({ name: r.name, value: r.value, x: "" }));
|
|
2757
|
+
return this.wording.readout(this.hoverXLabel, [...e, ...i]);
|
|
2758
|
+
}
|
|
2759
|
+
/** The totals of the stacks in a hit (K4), each after its stack's last
|
|
2760
|
+
member. A normalised stack's total is no share: it is written in the
|
|
2761
|
+
series' own `format`, as its readings would be. */
|
|
2762
|
+
totalsOf(t) {
|
|
2763
|
+
const e = [];
|
|
2764
|
+
return t.forEach((n, i) => {
|
|
2765
|
+
const o = U(n.entry.config), r = n.entry.stacked;
|
|
2766
|
+
if (o === void 0 || r === null || t.some((c, h) => h > i && U(c.entry.config) === o)) return;
|
|
2767
|
+
const l = r.total[n.index], a = r.normalize ? (n.entry.config.format ?? St)(l) : this.formatY(n.entry, l);
|
|
2768
|
+
e.push({ after: i, name: this.wording.stackTotal, value: a });
|
|
2769
|
+
}), e;
|
|
2435
2770
|
}
|
|
2436
2771
|
/** The summary is rebuilt after a layout, but not on every one: a zoom lays
|
|
2437
2772
|
out every frame, and the summary reads every visible point. */
|
|
2438
2773
|
scheduleSummary() {
|
|
2439
2774
|
this.summaryEl !== null && (this.summaryTimer !== null && clearTimeout(this.summaryTimer), this.summaryTimer = setTimeout(() => {
|
|
2440
2775
|
this.summaryTimer = null, this.summaryEl !== null && (this.summaryEl.textContent = this.summaryText());
|
|
2441
|
-
},
|
|
2776
|
+
}, Vi));
|
|
2442
2777
|
}
|
|
2443
2778
|
/** Kind of content, series by name, the visible stretch, each series' range
|
|
2444
2779
|
in it and the keys (R10). A band has no range - its values are states. */
|
|
@@ -2462,37 +2797,138 @@ class ze {
|
|
|
2462
2797
|
/** The lowest and highest value of a series inside its x axis' domain; a
|
|
2463
2798
|
cell's value, every other kind's y. */
|
|
2464
2799
|
visibleRange(t) {
|
|
2800
|
+
var c;
|
|
2465
2801
|
const e = t.materialized, n = this.findAxis("x", t.config.xAxisId);
|
|
2466
2802
|
if (e === null || n === null) return null;
|
|
2467
|
-
const [i, o] = n.scale.domain, r = e.w ?? e.y;
|
|
2803
|
+
const [i, o] = n.scale.domain, r = e.w ?? ((c = t.stacked) == null ? void 0 : c.value) ?? e.y;
|
|
2468
2804
|
let l = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY;
|
|
2469
|
-
for (let
|
|
2470
|
-
const
|
|
2471
|
-
!Number.isFinite(
|
|
2805
|
+
for (let h = it(e.x, e.length, i); h < e.length && e.x[h] <= o; h++) {
|
|
2806
|
+
const f = r[h];
|
|
2807
|
+
!Number.isFinite(f) || Number.isNaN(e.y[h]) || (f < l && (l = f), f > a && (a = f));
|
|
2472
2808
|
}
|
|
2473
2809
|
return l <= a ? [l, a] : null;
|
|
2474
2810
|
}
|
|
2475
2811
|
/** A value as the tooltip writes it: the series' format, else its y axis'
|
|
2476
2812
|
(a cell's value has no y axis format). */
|
|
2477
2813
|
formatY(t, e) {
|
|
2478
|
-
var o;
|
|
2814
|
+
var o, r, l;
|
|
2479
2815
|
const n = t.config;
|
|
2480
|
-
if (n.format !== void 0) return n.format(e);
|
|
2481
|
-
if (n.kind === "matrix") return
|
|
2482
|
-
const i = (
|
|
2483
|
-
return i === void 0 ?
|
|
2816
|
+
if (n.format !== void 0 && ((o = t.stacked) == null ? void 0 : o.normalize) !== !0) return n.format(e);
|
|
2817
|
+
if (n.kind === "matrix") return St(e);
|
|
2818
|
+
const i = ((r = t.stacked) == null ? void 0 : r.normalize) === !0 ? this.yTickFormat(n.yAxisId) : (l = this.findAxisConfig("y", n.yAxisId)) == null ? void 0 : l.tickFormat;
|
|
2819
|
+
return i === void 0 ? St(e) : i(e);
|
|
2820
|
+
}
|
|
2821
|
+
/** A y axis' `tickFormat`; without one, an axis that carries a normalised
|
|
2822
|
+
stack reads in percent (K5). */
|
|
2823
|
+
yTickFormat(t) {
|
|
2824
|
+
var n;
|
|
2825
|
+
const e = (n = this.findAxisConfig("y", t)) == null ? void 0 : n.tickFormat;
|
|
2826
|
+
if (e !== void 0) return e;
|
|
2827
|
+
for (const i of this.series.values())
|
|
2828
|
+
if (i.config.yAxisId === t && _t(i.config)) return this.percent;
|
|
2829
|
+
}
|
|
2830
|
+
/* ---------- The data table (charts-alternatives 01) ---------- */
|
|
2831
|
+
/** What the data table lists: one table per x axis for the series on it, one
|
|
2832
|
+
per matrix - a matrix has two positions per value, and shares no rows.
|
|
2833
|
+
Only the visible domain, and above the limit its downsampled course
|
|
2834
|
+
(table.ts). Called by the open table, once per layout. */
|
|
2835
|
+
dataTableGroups() {
|
|
2836
|
+
const t = this.seriesInOrder(), e = [], n = /* @__PURE__ */ new Map();
|
|
2837
|
+
for (const i of this.walkable()) {
|
|
2838
|
+
const o = i.config.kind === "matrix" ? void 0 : n.get(i.config.xAxisId);
|
|
2839
|
+
if (o !== void 0) o.push(i);
|
|
2840
|
+
else {
|
|
2841
|
+
const r = [i];
|
|
2842
|
+
e.push(r), i.config.kind !== "matrix" && n.set(i.config.xAxisId, r);
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
return e.flatMap((i) => {
|
|
2846
|
+
const o = i[0];
|
|
2847
|
+
return o.config.kind === "matrix" ? this.matrixTable(o, t) ?? [] : this.courseTable(i, t) ?? [];
|
|
2848
|
+
});
|
|
2849
|
+
}
|
|
2850
|
+
/** The series of one x axis, merged on their x. */
|
|
2851
|
+
courseTable(t, e) {
|
|
2852
|
+
var f;
|
|
2853
|
+
const n = this.wording, i = t[0].config.xAxisId, o = this.findAxis("x", i);
|
|
2854
|
+
if (o === null) return null;
|
|
2855
|
+
const [r, l] = o.scale.domain, a = yi(
|
|
2856
|
+
t.map((m) => {
|
|
2857
|
+
const p = m.materialized;
|
|
2858
|
+
return m.stacked !== null ? { ...p, y: m.stacked.value, y0: null } : m.config.kind === "state" ? { ...p, changesOnly: !0 } : p;
|
|
2859
|
+
}),
|
|
2860
|
+
r,
|
|
2861
|
+
l
|
|
2862
|
+
);
|
|
2863
|
+
let c = !1;
|
|
2864
|
+
for (let m = 1; m < a.x.length && !c; m++) {
|
|
2865
|
+
const p = a.x[m] - a.x[m - 1];
|
|
2866
|
+
c = p > 0 && p < V;
|
|
2867
|
+
}
|
|
2868
|
+
const h = n.tableCaption(this.xLabel(i, r), this.xLabel(i, l));
|
|
2869
|
+
return {
|
|
2870
|
+
key: `x:${i}`,
|
|
2871
|
+
caption: a.thinned ? `${h} ${n.downsampled(a.readings)}` : h,
|
|
2872
|
+
columns: [
|
|
2873
|
+
((f = this.findAxisConfig("x", i)) == null ? void 0 : f.label) ?? n.positionColumn,
|
|
2874
|
+
...t.map((m) => this.nameFor(m, e.indexOf(m)))
|
|
2875
|
+
],
|
|
2876
|
+
rows: a.x.map((m, p) => [
|
|
2877
|
+
this.xLabel(i, m, c),
|
|
2878
|
+
...t.map((u, g) => {
|
|
2879
|
+
var d;
|
|
2880
|
+
return this.cellText(u, a.courses[g], ((d = a.at[p]) == null ? void 0 : d[g]) ?? -1);
|
|
2881
|
+
})
|
|
2882
|
+
])
|
|
2883
|
+
};
|
|
2884
|
+
}
|
|
2885
|
+
/** One cell: empty where the series has no reading there or a gap; a
|
|
2886
|
+
state's name; a corridor's two edges; every other value as the tooltip
|
|
2887
|
+
writes it. */
|
|
2888
|
+
cellText(t, e, n) {
|
|
2889
|
+
var l, a;
|
|
2890
|
+
if (n < 0) return "";
|
|
2891
|
+
const i = e.y[n];
|
|
2892
|
+
if (Number.isNaN(i)) return "";
|
|
2893
|
+
const o = t.config;
|
|
2894
|
+
if (o.kind === "state") return ((l = o.states[i | 0]) == null ? void 0 : l.label) ?? "";
|
|
2895
|
+
const r = (a = e.y0) == null ? void 0 : a[n];
|
|
2896
|
+
return r !== void 0 && !Number.isNaN(r) ? `${this.formatY(t, r)} – ${this.formatY(t, i)}` : this.formatY(t, i);
|
|
2897
|
+
}
|
|
2898
|
+
/** A matrix' table: its cells inside the visible x domain, by column and
|
|
2899
|
+
row, with their value. */
|
|
2900
|
+
matrixTable(t, e) {
|
|
2901
|
+
var h, f;
|
|
2902
|
+
const n = t.materialized, i = this.findAxis("x", t.config.xAxisId), o = this.findAxis("y", t.config.yAxisId);
|
|
2903
|
+
if (n === null || n.w === null || i === null || o === null) return null;
|
|
2904
|
+
const [r, l] = i.scale.domain, a = [];
|
|
2905
|
+
for (let m = 0; m < n.length; m++) {
|
|
2906
|
+
const p = n.x[m], u = n.w[m];
|
|
2907
|
+
p < r || p > l || !Number.isFinite(u) || a.push([this.xLabel(i.id, p), o.format(n.y[m]), this.formatY(t, u)]);
|
|
2908
|
+
}
|
|
2909
|
+
const c = this.wording;
|
|
2910
|
+
return {
|
|
2911
|
+
key: `m:${t.order}`,
|
|
2912
|
+
caption: c.tableCaption(i.format(r), i.format(l)),
|
|
2913
|
+
columns: [
|
|
2914
|
+
((h = this.findAxisConfig("x", t.config.xAxisId)) == null ? void 0 : h.label) ?? c.positionColumn,
|
|
2915
|
+
((f = this.findAxisConfig("y", t.config.yAxisId)) == null ? void 0 : f.label) ?? c.rowColumn,
|
|
2916
|
+
this.nameFor(t, e.indexOf(t))
|
|
2917
|
+
],
|
|
2918
|
+
rows: a
|
|
2919
|
+
};
|
|
2484
2920
|
}
|
|
2485
2921
|
/** After a layout - new data, a new domain -, the keyboard's point goes to
|
|
2486
2922
|
the nearest position still visible (Q6), or goes away. */
|
|
2487
2923
|
reapplyKey() {
|
|
2488
|
-
const t = this.emphasised(), e = t === null ? null : this.findAxis("x", t.config.xAxisId), n = t === null || e === null || this.keyX === null ? null :
|
|
2924
|
+
const t = this.emphasised(), e = t === null ? null : this.findAxis("x", t.config.xAxisId), n = t === null || e === null || this.keyX === null ? null : De(this.walked(t), this.keyX, e.scale.domain);
|
|
2489
2925
|
if (t === null || n === null) {
|
|
2490
2926
|
this.clearActive();
|
|
2491
2927
|
return;
|
|
2492
2928
|
}
|
|
2493
2929
|
if (t.config.kind !== "matrix") this.showPosition(t, n, !1);
|
|
2494
2930
|
else {
|
|
2495
|
-
const i = this.keyCell, o = t.materialized, r = i !== null &&
|
|
2931
|
+
const i = this.keyCell, o = t.materialized, r = i !== null && pi(o, { x: n, y: i.y }) ? { x: n, y: i.y } : this.columnStart(t, n);
|
|
2496
2932
|
r !== null && this.showCell(t, r, !1);
|
|
2497
2933
|
}
|
|
2498
2934
|
}
|
|
@@ -2616,16 +3052,21 @@ class ze {
|
|
|
2616
3052
|
written in its format. A series' own `format` comes before either. */
|
|
2617
3053
|
tooltipRow(t, e) {
|
|
2618
3054
|
var l, a;
|
|
2619
|
-
const n = t.entry.config, i = (l = t.segment) == null ? void 0 : l.label;
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
3055
|
+
const n = t.entry.config, i = (l = t.segment) == null ? void 0 : l.label, o = i !== void 0 && i !== "" ? i : this.formatY(t.entry, t.value ?? t.yValue), r = n.xAxisId === e ? "" : this.xLabel(n.xAxisId, t.xValue);
|
|
3056
|
+
return { value: o, x: r, chip: ((a = this.theme) == null ? void 0 : a.forced) === !0 ? this.tooltipChip(t, this.theme) : null };
|
|
3057
|
+
}
|
|
3058
|
+
/** A hit's chip drawn as its legend entry is: a band's state and a cell's
|
|
3059
|
+
step by their hatch, every other series by its marks. */
|
|
3060
|
+
tooltipChip(t, e) {
|
|
3061
|
+
var r, l;
|
|
3062
|
+
const n = t.entry.config, i = (a) => ({
|
|
3063
|
+
color: e.colorText,
|
|
3064
|
+
mark: { dash: null, marker: null, swatches: [{ color: e.colorText, hatch: a }], ground: e.colorBg }
|
|
3065
|
+
});
|
|
3066
|
+
if (n.kind === "state") return i(this.stateHatches().get(((r = t.segment) == null ? void 0 : r.label) ?? "") ?? "none");
|
|
3067
|
+
if (n.kind === "matrix") return i(Pt(((l = t.entry.buckets) == null ? void 0 : l[t.index]) ?? 0));
|
|
3068
|
+
const o = this.legendMark(t.entry, e);
|
|
3069
|
+
return o === null ? null : { color: this.colorFor(t.entry), mark: o };
|
|
2629
3070
|
}
|
|
2630
3071
|
/** The hit of one series - one different question per kind.
|
|
2631
3072
|
|
|
@@ -2636,69 +3077,70 @@ class ze {
|
|
|
2636
3077
|
hitIn(t, e, n, i, o, r, l, a) {
|
|
2637
3078
|
const c = t.config, h = e.length;
|
|
2638
3079
|
if (c.kind === "state") {
|
|
2639
|
-
const
|
|
2640
|
-
if (o <
|
|
2641
|
-
const d =
|
|
3080
|
+
const g = this.lanePx(c, i);
|
|
3081
|
+
if (o < g.top || o > g.bottom) return null;
|
|
3082
|
+
const d = Ee(e.x, h, r);
|
|
2642
3083
|
if (d < 0) return null;
|
|
2643
3084
|
const y = e.y[d];
|
|
2644
3085
|
if (Number.isNaN(y)) return null;
|
|
2645
|
-
const
|
|
2646
|
-
if (d === h - 1 && !(r <
|
|
2647
|
-
const
|
|
3086
|
+
const b = e.x[d], v = nn(e.x, h, d, this.lastEnd(t, e, n));
|
|
3087
|
+
if (d === h - 1 && !(r < v)) return null;
|
|
3088
|
+
const w = c.states[y | 0];
|
|
2648
3089
|
return {
|
|
2649
3090
|
index: d,
|
|
2650
|
-
px: n.scale.toPx(
|
|
2651
|
-
py: (
|
|
2652
|
-
xValue:
|
|
3091
|
+
px: n.scale.toPx(b),
|
|
3092
|
+
py: (g.top + g.bottom) / 2,
|
|
3093
|
+
xValue: b,
|
|
2653
3094
|
yValue: y,
|
|
2654
3095
|
marked: !1,
|
|
2655
3096
|
areal: !0,
|
|
2656
|
-
color:
|
|
2657
|
-
segment: { from:
|
|
3097
|
+
color: w == null ? void 0 : w.color,
|
|
3098
|
+
segment: { from: b, to: v, label: (w == null ? void 0 : w.label) ?? "" }
|
|
2658
3099
|
};
|
|
2659
3100
|
}
|
|
2660
3101
|
if (c.kind === "matrix") {
|
|
2661
|
-
const
|
|
3102
|
+
const g = ki(
|
|
2662
3103
|
e.x,
|
|
2663
3104
|
e.y,
|
|
2664
3105
|
h,
|
|
2665
3106
|
r,
|
|
2666
3107
|
l,
|
|
2667
|
-
|
|
2668
|
-
|
|
3108
|
+
Et(t.step ?? 0, n.scale.domain[1] - n.scale.domain[0]),
|
|
3109
|
+
Et(t.cellHeight ?? 0, i.scale.domain[1] - i.scale.domain[0])
|
|
2669
3110
|
);
|
|
2670
|
-
if (
|
|
2671
|
-
const d = e.w, y = d === null ? Number.NaN : d[
|
|
3111
|
+
if (g < 0) return null;
|
|
3112
|
+
const d = e.w, y = d === null ? Number.NaN : d[g];
|
|
2672
3113
|
if (!Number.isFinite(y)) return null;
|
|
2673
|
-
const
|
|
2674
|
-
return t.buckets ?? (t.buckets =
|
|
2675
|
-
index:
|
|
2676
|
-
px: n.scale.toPx(
|
|
2677
|
-
py: i.scale.toPx(
|
|
2678
|
-
color:
|
|
2679
|
-
xValue:
|
|
3114
|
+
const b = e.x[g], v = e.y[g], w = Ft(c.coloring, this.theme ?? H);
|
|
3115
|
+
return t.buckets ?? (t.buckets = ze(e, c.coloring, w.length)), {
|
|
3116
|
+
index: g,
|
|
3117
|
+
px: n.scale.toPx(b),
|
|
3118
|
+
py: i.scale.toPx(v),
|
|
3119
|
+
color: w[t.buckets[g]],
|
|
3120
|
+
xValue: b,
|
|
2680
3121
|
// yValue stays the position on the y axis; the value that carries the
|
|
2681
3122
|
// colour stands in a field of its own. Colour alone can transport no
|
|
2682
3123
|
// number - which is why the tooltip has to carry it.
|
|
2683
|
-
yValue:
|
|
3124
|
+
yValue: v,
|
|
2684
3125
|
value: y,
|
|
2685
3126
|
marked: !1,
|
|
2686
3127
|
areal: !0
|
|
2687
3128
|
};
|
|
2688
3129
|
}
|
|
2689
|
-
const f = c.kind === "scatter" && a === "nearest" ?
|
|
3130
|
+
const f = c.kind === "scatter" && a === "nearest" ? fi(e.x, e.y, h, r, l, n.scale, i.scale) : c.kind === "line" && c.step === !0 ? Ee(e.x, h, r) : he(e.x, h, r);
|
|
2690
3131
|
if (f < 0) return null;
|
|
2691
3132
|
const m = e.y[f];
|
|
2692
3133
|
if (Number.isNaN(m)) return null;
|
|
2693
|
-
const p = e.x[f];
|
|
3134
|
+
const p = e.x[f], u = t.stacked === null || e.y0 === null ? Number.NaN : e.y0[f];
|
|
2694
3135
|
return {
|
|
2695
3136
|
index: f,
|
|
2696
3137
|
px: n.scale.toPx(p),
|
|
2697
3138
|
py: i.scale.toPx(m),
|
|
2698
3139
|
xValue: p,
|
|
2699
|
-
yValue: m,
|
|
3140
|
+
yValue: t.stacked === null ? m : t.stacked.value[f],
|
|
2700
3141
|
marked: !0,
|
|
2701
|
-
areal: !1
|
|
3142
|
+
areal: !1,
|
|
3143
|
+
covers: l >= Math.min(u, m) && l <= Math.max(u, m)
|
|
2702
3144
|
};
|
|
2703
3145
|
}
|
|
2704
3146
|
/** R-4.9: 12 px to the right of the crosshair, flipping at the right edge,
|
|
@@ -2738,7 +3180,8 @@ class ze {
|
|
|
2738
3180
|
legend: this.legend,
|
|
2739
3181
|
series: this.legendItems(),
|
|
2740
3182
|
limits: this.limitLabels(),
|
|
2741
|
-
empty: !this.showsAPoint()
|
|
3183
|
+
empty: !this.showsAPoint(),
|
|
3184
|
+
dataTable: this.dataTable
|
|
2742
3185
|
};
|
|
2743
3186
|
for (const t of this.layoutSubscribers) t();
|
|
2744
3187
|
}
|
|
@@ -2748,25 +3191,26 @@ class ze {
|
|
|
2748
3191
|
hover: this.hover,
|
|
2749
3192
|
tooltip: this.tooltip,
|
|
2750
3193
|
xLabel: this.hoverXLabel,
|
|
2751
|
-
rows: this.hoverRows
|
|
3194
|
+
rows: this.hoverRows,
|
|
3195
|
+
totals: this.hoverTotals
|
|
2752
3196
|
};
|
|
2753
3197
|
for (const t of this.hoverSubscribers) t();
|
|
2754
3198
|
}
|
|
2755
3199
|
}
|
|
2756
3200
|
/** Class name of the measuring span for tick labels - keeps the CSS and the
|
|
2757
3201
|
layout in step. */
|
|
2758
|
-
x(
|
|
2759
|
-
const
|
|
2760
|
-
function
|
|
2761
|
-
const t =
|
|
2762
|
-
if (t === null &&
|
|
3202
|
+
x(rn, "classTick", ct);
|
|
3203
|
+
const ln = pn(null);
|
|
3204
|
+
function st(s) {
|
|
3205
|
+
const t = gn(ln);
|
|
3206
|
+
if (t === null && bt)
|
|
2763
3207
|
throw new Error(
|
|
2764
3208
|
`@umriss-ui/charts: <${s}> must be used inside a <Chart>.`
|
|
2765
3209
|
);
|
|
2766
3210
|
return t;
|
|
2767
3211
|
}
|
|
2768
|
-
function
|
|
2769
|
-
const e =
|
|
3212
|
+
function dt(s, t) {
|
|
3213
|
+
const e = st(s), n = G(null);
|
|
2770
3214
|
D(() => {
|
|
2771
3215
|
if (e !== null)
|
|
2772
3216
|
return n.current = e.registerSeries(t), () => {
|
|
@@ -2776,8 +3220,8 @@ function ht(s, t) {
|
|
|
2776
3220
|
e !== null && n.current !== null && e.updateSeries(n.current, t);
|
|
2777
3221
|
});
|
|
2778
3222
|
}
|
|
2779
|
-
function
|
|
2780
|
-
const e =
|
|
3223
|
+
function an(s, t) {
|
|
3224
|
+
const e = st(s), n = G(null);
|
|
2781
3225
|
D(() => {
|
|
2782
3226
|
if (e !== null)
|
|
2783
3227
|
return n.current = e.registerAxis(t), () => {
|
|
@@ -2787,8 +3231,8 @@ function Be(s, t) {
|
|
|
2787
3231
|
e !== null && n.current !== null && e.updateAxis(n.current, t);
|
|
2788
3232
|
});
|
|
2789
3233
|
}
|
|
2790
|
-
function
|
|
2791
|
-
const e =
|
|
3234
|
+
function cn(s, t) {
|
|
3235
|
+
const e = st(s), n = G(null);
|
|
2792
3236
|
D(() => {
|
|
2793
3237
|
if (e !== null)
|
|
2794
3238
|
return n.current = e.registerLimit(t), () => {
|
|
@@ -2798,8 +3242,8 @@ function Ke(s, t) {
|
|
|
2798
3242
|
e !== null && n.current !== null && e.updateLimit(n.current, t);
|
|
2799
3243
|
});
|
|
2800
3244
|
}
|
|
2801
|
-
function
|
|
2802
|
-
const e =
|
|
3245
|
+
function Ki(s, t) {
|
|
3246
|
+
const e = st(s);
|
|
2803
3247
|
D(() => {
|
|
2804
3248
|
if (e !== null)
|
|
2805
3249
|
return e.registerLegend(t), () => e.unregisterLegend();
|
|
@@ -2807,8 +3251,15 @@ function gi(s, t) {
|
|
|
2807
3251
|
e == null || e.updateLegend(t);
|
|
2808
3252
|
});
|
|
2809
3253
|
}
|
|
2810
|
-
function
|
|
2811
|
-
const e =
|
|
3254
|
+
function qi(s, t) {
|
|
3255
|
+
const e = st(s);
|
|
3256
|
+
D(() => {
|
|
3257
|
+
if (e !== null)
|
|
3258
|
+
return e.registerDataTable(t), () => e.unregisterDataTable();
|
|
3259
|
+
}, [e, t]);
|
|
3260
|
+
}
|
|
3261
|
+
function Ui(s, t) {
|
|
3262
|
+
const e = st(s);
|
|
2812
3263
|
D(() => {
|
|
2813
3264
|
if (e !== null)
|
|
2814
3265
|
return e.registerTooltip(t), () => e.unregisterTooltip();
|
|
@@ -2816,27 +3267,27 @@ function bi(s, t) {
|
|
|
2816
3267
|
e == null || e.updateTooltip(t);
|
|
2817
3268
|
});
|
|
2818
3269
|
}
|
|
2819
|
-
function
|
|
3270
|
+
function Xi(s, t) {
|
|
2820
3271
|
const { band: e, position: n, orientation: i } = s, o = {
|
|
2821
3272
|
left: `${e.x}px`,
|
|
2822
3273
|
top: `${e.y}px`,
|
|
2823
3274
|
width: `${e.width}px`,
|
|
2824
3275
|
height: `${e.height}px`
|
|
2825
|
-
}, r =
|
|
2826
|
-
return /* @__PURE__ */
|
|
3276
|
+
}, r = ae + ce;
|
|
3277
|
+
return /* @__PURE__ */ O(
|
|
2827
3278
|
"div",
|
|
2828
3279
|
{
|
|
2829
3280
|
className: `uc-axis uc-axis-${i} uc-axis-${n}`,
|
|
2830
3281
|
style: o,
|
|
2831
3282
|
"data-axis": s.id,
|
|
2832
3283
|
children: [
|
|
2833
|
-
/* @__PURE__ */
|
|
3284
|
+
/* @__PURE__ */ k("span", { className: "uc-axis-line" }),
|
|
2834
3285
|
s.ticks.map((l) => {
|
|
2835
3286
|
if (i === "y") {
|
|
2836
3287
|
const c = Math.round(l.px - e.y);
|
|
2837
|
-
return /* @__PURE__ */
|
|
2838
|
-
/* @__PURE__ */
|
|
2839
|
-
/* @__PURE__ */
|
|
3288
|
+
return /* @__PURE__ */ O("span", { className: "uc-tick", style: { top: `${c}px` }, children: [
|
|
3289
|
+
/* @__PURE__ */ k("span", { className: "uc-tick-mark" }),
|
|
3290
|
+
/* @__PURE__ */ k(
|
|
2840
3291
|
"span",
|
|
2841
3292
|
{
|
|
2842
3293
|
className: "uc-tick-label",
|
|
@@ -2847,9 +3298,9 @@ function vi(s, t) {
|
|
|
2847
3298
|
] }, l.value);
|
|
2848
3299
|
}
|
|
2849
3300
|
const a = Math.round(l.px - e.x);
|
|
2850
|
-
return /* @__PURE__ */
|
|
2851
|
-
/* @__PURE__ */
|
|
2852
|
-
/* @__PURE__ */
|
|
3301
|
+
return /* @__PURE__ */ O("span", { className: "uc-tick", style: { left: `${a}px` }, children: [
|
|
3302
|
+
/* @__PURE__ */ k("span", { className: "uc-tick-mark" }),
|
|
3303
|
+
/* @__PURE__ */ k(
|
|
2853
3304
|
"span",
|
|
2854
3305
|
{
|
|
2855
3306
|
className: "uc-tick-label",
|
|
@@ -2862,7 +3313,7 @@ function vi(s, t) {
|
|
|
2862
3313
|
)
|
|
2863
3314
|
] }, l.value);
|
|
2864
3315
|
}),
|
|
2865
|
-
s.breaks.map((l, a) => /* @__PURE__ */
|
|
3316
|
+
s.breaks.map((l, a) => /* @__PURE__ */ k(
|
|
2866
3317
|
"span",
|
|
2867
3318
|
{
|
|
2868
3319
|
className: "uc-break",
|
|
@@ -2872,7 +3323,7 @@ function vi(s, t) {
|
|
|
2872
3323
|
`break-${a}`
|
|
2873
3324
|
)),
|
|
2874
3325
|
t.map(
|
|
2875
|
-
(l) => i === "y" ? /* @__PURE__ */
|
|
3326
|
+
(l) => i === "y" ? /* @__PURE__ */ k(
|
|
2876
3327
|
"span",
|
|
2877
3328
|
{
|
|
2878
3329
|
className: "uc-limit-label",
|
|
@@ -2882,7 +3333,7 @@ function vi(s, t) {
|
|
|
2882
3333
|
children: l.label
|
|
2883
3334
|
},
|
|
2884
3335
|
`limit-${l.id}`
|
|
2885
|
-
) : /* @__PURE__ */
|
|
3336
|
+
) : /* @__PURE__ */ k(
|
|
2886
3337
|
"span",
|
|
2887
3338
|
{
|
|
2888
3339
|
className: "uc-limit-label",
|
|
@@ -2897,22 +3348,22 @@ function vi(s, t) {
|
|
|
2897
3348
|
`limit-${l.id}`
|
|
2898
3349
|
)
|
|
2899
3350
|
),
|
|
2900
|
-
s.label !== void 0 && s.label !== "" && /* @__PURE__ */
|
|
3351
|
+
s.label !== void 0 && s.label !== "" && /* @__PURE__ */ k("span", { className: "uc-axis-title", children: s.label })
|
|
2901
3352
|
]
|
|
2902
3353
|
},
|
|
2903
3354
|
s.key
|
|
2904
3355
|
);
|
|
2905
3356
|
}
|
|
2906
|
-
function
|
|
2907
|
-
const e =
|
|
3357
|
+
function Zi({ scene: s, empty: t }) {
|
|
3358
|
+
const e = wt(
|
|
2908
3359
|
s.subscribeLayout,
|
|
2909
3360
|
s.getLayoutSnapshot,
|
|
2910
3361
|
s.getLayoutServerSnapshot
|
|
2911
3362
|
), { layout: n } = e;
|
|
2912
3363
|
if (n.plot.width <= 0 || n.plot.height <= 0) return null;
|
|
2913
3364
|
const { plot: i } = n;
|
|
2914
|
-
return /* @__PURE__ */
|
|
2915
|
-
e.empty && /* @__PURE__ */
|
|
3365
|
+
return /* @__PURE__ */ O("div", { className: "uc-axes", children: [
|
|
3366
|
+
e.empty && /* @__PURE__ */ k(
|
|
2916
3367
|
"div",
|
|
2917
3368
|
{
|
|
2918
3369
|
className: "uc-empty",
|
|
@@ -2921,19 +3372,175 @@ function ki({ scene: s, empty: t }) {
|
|
|
2921
3372
|
}
|
|
2922
3373
|
),
|
|
2923
3374
|
n.axes.map(
|
|
2924
|
-
(o) =>
|
|
3375
|
+
(o) => Xi(
|
|
2925
3376
|
o,
|
|
2926
3377
|
e.limits.filter((r) => r.axisKey === o.key)
|
|
2927
3378
|
)
|
|
2928
3379
|
)
|
|
2929
3380
|
] });
|
|
2930
3381
|
}
|
|
2931
|
-
function
|
|
2932
|
-
const
|
|
3382
|
+
function un({ scene: s, state: t }) {
|
|
3383
|
+
const e = s.getWording();
|
|
3384
|
+
return /* @__PURE__ */ k(
|
|
3385
|
+
"button",
|
|
3386
|
+
{
|
|
3387
|
+
type: "button",
|
|
3388
|
+
className: "uc-legend-item uc-data-key",
|
|
3389
|
+
"aria-expanded": t.open,
|
|
3390
|
+
"aria-controls": t.open ? t.id : void 0,
|
|
3391
|
+
onClick: () => s.toggleDataTable(),
|
|
3392
|
+
children: t.open ? e.hideData : e.showData
|
|
3393
|
+
}
|
|
3394
|
+
);
|
|
3395
|
+
}
|
|
3396
|
+
function ji({ scene: s }) {
|
|
3397
|
+
const t = Ve();
|
|
3398
|
+
qi("DataTable", t);
|
|
3399
|
+
const e = wt(s.subscribeLayout, s.getLayoutSnapshot, s.getLayoutServerSnapshot), n = e.dataTable, i = (n == null ? void 0 : n.open) === !0, o = i ? s.dataTableGroups() : [], r = G(null), [l, a] = fe(null);
|
|
3400
|
+
if (yn(() => {
|
|
3401
|
+
var m, p;
|
|
3402
|
+
const h = (p = (m = r.current) == null ? void 0 : m.parentElement) == null ? void 0 : p.querySelector(":scope > .uc-plot");
|
|
3403
|
+
if (h == null) return;
|
|
3404
|
+
const f = { top: h.offsetTop, height: h.offsetHeight };
|
|
3405
|
+
a((u) => u !== null && u.top === f.top && u.height === f.height ? u : f);
|
|
3406
|
+
}, [e, i]), n === null) return null;
|
|
3407
|
+
const c = l === null ? void 0 : { top: l.top, height: l.height };
|
|
3408
|
+
return /* @__PURE__ */ O(xt, { children: [
|
|
3409
|
+
e.legend === null && /* @__PURE__ */ k("div", { className: "uc-legend uc-legend-top", children: /* @__PURE__ */ k(un, { scene: s, state: n }) }),
|
|
3410
|
+
i && // A tab stop of its own: the panel scrolls, and a keyboard has to be
|
|
3411
|
+
// able to scroll it.
|
|
3412
|
+
/* @__PURE__ */ k("div", { ref: r, id: n.id, className: "uc-data-panel", style: c, tabIndex: 0, children: o.map((h) => /* @__PURE__ */ O("table", { className: "uc-data-table", children: [
|
|
3413
|
+
/* @__PURE__ */ k("caption", { children: h.caption }),
|
|
3414
|
+
/* @__PURE__ */ k("thead", { children: /* @__PURE__ */ k("tr", { children: h.columns.map((f, m) => /* @__PURE__ */ k("th", { scope: "col", children: f }, m)) }) }),
|
|
3415
|
+
/* @__PURE__ */ k("tbody", { children: h.rows.map((f, m) => /* @__PURE__ */ O("tr", { children: [
|
|
3416
|
+
/* @__PURE__ */ k("th", { scope: "row", children: f[0] }),
|
|
3417
|
+
f.slice(1).map((p, u) => /* @__PURE__ */ k("td", { children: p }, u))
|
|
3418
|
+
] }, m)) })
|
|
3419
|
+
] }, h.key)) })
|
|
3420
|
+
] });
|
|
3421
|
+
}
|
|
3422
|
+
function Ts() {
|
|
3423
|
+
const s = st("DataTable");
|
|
3424
|
+
return s === null ? null : /* @__PURE__ */ k(ji, { scene: s });
|
|
3425
|
+
}
|
|
3426
|
+
function Ji({
|
|
3427
|
+
scene: s,
|
|
3428
|
+
placement: t,
|
|
3429
|
+
onToggle: e
|
|
3430
|
+
}) {
|
|
3431
|
+
Ki("Legend", { placement: t });
|
|
3432
|
+
const n = wt(
|
|
3433
|
+
s.subscribeLayout,
|
|
3434
|
+
s.getLayoutSnapshot,
|
|
3435
|
+
s.getLayoutServerSnapshot
|
|
3436
|
+
), i = n.dataTable;
|
|
3437
|
+
return n.series.length === 0 && i === null ? null : /* @__PURE__ */ O("div", { className: `uc-legend uc-legend-${t}`, children: [
|
|
3438
|
+
n.series.map((o) => {
|
|
3439
|
+
const r = {
|
|
3440
|
+
className: "uc-legend-item",
|
|
3441
|
+
"data-hidden": o.hidden ? "" : void 0,
|
|
3442
|
+
onPointerEnter: () => s.setHighlight(o.seriesIds),
|
|
3443
|
+
onPointerLeave: () => s.setHighlight(null)
|
|
3444
|
+
}, l = /* @__PURE__ */ O(xt, { children: [
|
|
3445
|
+
o.mark === null ? /* @__PURE__ */ k("span", { className: "uc-legend-chip", style: { background: o.color } }) : /* @__PURE__ */ k(hn, { color: o.color, mark: o.mark }),
|
|
3446
|
+
o.name
|
|
3447
|
+
] });
|
|
3448
|
+
return e === void 0 ? /* @__PURE__ */ k("span", { ...r, children: l }, o.id) : /* @__PURE__ */ k(
|
|
3449
|
+
"button",
|
|
3450
|
+
{
|
|
3451
|
+
type: "button",
|
|
3452
|
+
"aria-pressed": !o.hidden,
|
|
3453
|
+
onClick: () => e(o.name),
|
|
3454
|
+
...r,
|
|
3455
|
+
children: l
|
|
3456
|
+
},
|
|
3457
|
+
o.id
|
|
3458
|
+
);
|
|
3459
|
+
}),
|
|
3460
|
+
i !== null && /* @__PURE__ */ k(un, { scene: s, state: i })
|
|
3461
|
+
] });
|
|
3462
|
+
}
|
|
3463
|
+
const Qi = 3;
|
|
3464
|
+
function hn({ color: s, mark: t }) {
|
|
3465
|
+
var n;
|
|
3466
|
+
const e = t.dash !== null ? (n = t.swatches) == null ? void 0 : n[0] : void 0;
|
|
3467
|
+
if (e !== void 0)
|
|
3468
|
+
return /* @__PURE__ */ O("svg", { className: "uc-legend-mark", width: 18, height: 10, viewBox: "0 0 18 10", "aria-hidden": "true", children: [
|
|
3469
|
+
/* @__PURE__ */ k("rect", { y: 3, width: 18, height: 7, fill: e.color, fillOpacity: e.opacity }),
|
|
3470
|
+
/* @__PURE__ */ k("path", { d: _e({ x: 0, y: 3, width: 18, height: 7 }, e.hatch), stroke: e.color, strokeWidth: 1 }),
|
|
3471
|
+
/* @__PURE__ */ k(
|
|
3472
|
+
"line",
|
|
3473
|
+
{
|
|
3474
|
+
x1: 1,
|
|
3475
|
+
y1: 3,
|
|
3476
|
+
x2: 17,
|
|
3477
|
+
y2: 3,
|
|
3478
|
+
stroke: s,
|
|
3479
|
+
strokeWidth: 1.5,
|
|
3480
|
+
strokeLinecap: "round",
|
|
3481
|
+
strokeDasharray: t.dash !== null && t.dash.length > 0 ? t.dash.join(" ") : void 0
|
|
3482
|
+
}
|
|
3483
|
+
)
|
|
3484
|
+
] });
|
|
3485
|
+
if (t.swatches !== null) {
|
|
3486
|
+
const i = t.swatches.length === 1 ? 10 : 8, o = i * t.swatches.length;
|
|
3487
|
+
return /* @__PURE__ */ k("svg", { className: "uc-legend-mark", width: o, height: 10, viewBox: `0 0 ${o} 10`, "aria-hidden": "true", children: t.swatches.map((r, l) => (
|
|
3488
|
+
// A nested svg clips its hatch to its own swatch.
|
|
3489
|
+
/* @__PURE__ */ O("svg", { x: l * i, y: 0, width: i, height: 10, children: [
|
|
3490
|
+
/* @__PURE__ */ k("rect", { width: i, height: 10, fill: r.color }),
|
|
3491
|
+
/* @__PURE__ */ k("path", { d: _e({ x: 0, y: 0, width: i, height: 10 }, r.hatch), stroke: t.ground, strokeWidth: 1 })
|
|
3492
|
+
] }, l)
|
|
3493
|
+
)) });
|
|
3494
|
+
}
|
|
3495
|
+
return /* @__PURE__ */ O("svg", { className: "uc-legend-mark", width: 18, height: 10, viewBox: "0 0 18 10", "aria-hidden": "true", children: [
|
|
3496
|
+
t.dash !== null && /* @__PURE__ */ k(
|
|
3497
|
+
"line",
|
|
3498
|
+
{
|
|
3499
|
+
x1: 1,
|
|
3500
|
+
y1: 5,
|
|
3501
|
+
x2: 17,
|
|
3502
|
+
y2: 5,
|
|
3503
|
+
stroke: s,
|
|
3504
|
+
strokeWidth: 1.5,
|
|
3505
|
+
strokeLinecap: "round",
|
|
3506
|
+
strokeDasharray: t.dash.length > 0 ? t.dash.join(" ") : void 0
|
|
3507
|
+
}
|
|
3508
|
+
),
|
|
3509
|
+
t.marker !== null && /* @__PURE__ */ k("path", { d: ts(t.marker, 9, 5, 3), fill: s })
|
|
3510
|
+
] });
|
|
3511
|
+
}
|
|
3512
|
+
function _e(s, t) {
|
|
3513
|
+
const e = en(s, t, Qi);
|
|
3514
|
+
let n = "";
|
|
3515
|
+
for (let i = 0; i < e.length; i += 4) n += `M${e[i]} ${e[i + 1]}L${e[i + 2]} ${e[i + 3]}`;
|
|
3516
|
+
return n;
|
|
3517
|
+
}
|
|
3518
|
+
function ts(s, t, e, n) {
|
|
3519
|
+
let i = "";
|
|
3520
|
+
return pe(
|
|
3521
|
+
{
|
|
3522
|
+
moveTo: (o, r) => i += `M${o} ${r}`,
|
|
3523
|
+
lineTo: (o, r) => i += `L${o} ${r}`,
|
|
3524
|
+
// Only ever a whole circle: two half arcs, as SVG has no full one.
|
|
3525
|
+
arc: (o, r, l) => i += `M${o - l} ${r}A${l} ${l} 0 1 0 ${o + l} ${r}A${l} ${l} 0 1 0 ${o - l} ${r}`,
|
|
3526
|
+
closePath: () => i += "Z"
|
|
3527
|
+
},
|
|
3528
|
+
s,
|
|
3529
|
+
t,
|
|
3530
|
+
e,
|
|
3531
|
+
n
|
|
3532
|
+
), i;
|
|
3533
|
+
}
|
|
3534
|
+
function Ms({ placement: s = "top", onToggle: t }) {
|
|
3535
|
+
const e = st("Legend");
|
|
3536
|
+
return e === null ? null : /* @__PURE__ */ k(Ji, { scene: e, placement: s, onToggle: t });
|
|
3537
|
+
}
|
|
3538
|
+
function es({ scene: s }) {
|
|
3539
|
+
const t = wt(
|
|
2933
3540
|
s.subscribeHover,
|
|
2934
3541
|
s.getHoverSnapshot,
|
|
2935
3542
|
s.getHoverServerSnapshot
|
|
2936
|
-
), e =
|
|
3543
|
+
), e = xn(
|
|
2937
3544
|
(i) => {
|
|
2938
3545
|
s.bindTooltip(i);
|
|
2939
3546
|
},
|
|
@@ -2943,22 +3550,28 @@ function wi({ scene: s }) {
|
|
|
2943
3550
|
s.markOverlayDirty();
|
|
2944
3551
|
}, [s, t.version]), t.tooltip === null) return null;
|
|
2945
3552
|
const n = t.hover;
|
|
2946
|
-
return /* @__PURE__ */
|
|
2947
|
-
/* @__PURE__ */
|
|
2948
|
-
/* @__PURE__ */
|
|
3553
|
+
return /* @__PURE__ */ k("div", { className: "uc-tooltip", ref: e, role: "presentation", children: n === null ? null : t.tooltip.render !== void 0 ? t.tooltip.render(n.hit) : /* @__PURE__ */ O(xt, { children: [
|
|
3554
|
+
/* @__PURE__ */ k("div", { className: "uc-tooltip-head", children: t.xLabel }),
|
|
3555
|
+
/* @__PURE__ */ k("div", { className: "uc-tooltip-list", children: n.hit.points.map((i, o) => {
|
|
2949
3556
|
const r = t.rows[o];
|
|
2950
|
-
return /* @__PURE__ */
|
|
2951
|
-
/* @__PURE__ */
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
3557
|
+
return /* @__PURE__ */ O(bn, { children: [
|
|
3558
|
+
/* @__PURE__ */ O("div", { className: "uc-tooltip-row", children: [
|
|
3559
|
+
(r == null ? void 0 : r.chip) != null ? /* @__PURE__ */ k(hn, { color: r.chip.color, mark: r.chip.mark }) : /* @__PURE__ */ k("span", { className: "uc-tooltip-chip", style: { background: i.color } }),
|
|
3560
|
+
/* @__PURE__ */ O("span", { className: "uc-tooltip-name", children: [
|
|
3561
|
+
i.seriesName,
|
|
3562
|
+
r !== void 0 && r.x !== "" ? /* @__PURE__ */ k("span", { className: "uc-tooltip-x", children: r.x }) : null
|
|
3563
|
+
] }),
|
|
3564
|
+
/* @__PURE__ */ k("span", { className: "uc-tooltip-value", children: r == null ? void 0 : r.value })
|
|
2955
3565
|
] }),
|
|
2956
|
-
/* @__PURE__ */
|
|
3566
|
+
t.totals.filter((l) => l.after === o).map((l) => /* @__PURE__ */ O("div", { className: "uc-tooltip-row", children: [
|
|
3567
|
+
/* @__PURE__ */ k("span", { className: "uc-tooltip-name uc-tooltip-total", children: l.name }),
|
|
3568
|
+
/* @__PURE__ */ k("span", { className: "uc-tooltip-value", children: l.value })
|
|
3569
|
+
] }, "total"))
|
|
2957
3570
|
] }, `${i.seriesName}-${i.index}`);
|
|
2958
3571
|
}) })
|
|
2959
3572
|
] }) });
|
|
2960
3573
|
}
|
|
2961
|
-
function
|
|
3574
|
+
function Ss(s) {
|
|
2962
3575
|
const {
|
|
2963
3576
|
data: t,
|
|
2964
3577
|
width: e = "100%",
|
|
@@ -2971,120 +3584,123 @@ function Ui(s) {
|
|
|
2971
3584
|
syncId: c,
|
|
2972
3585
|
empty: h,
|
|
2973
3586
|
wording: f,
|
|
2974
|
-
|
|
2975
|
-
|
|
3587
|
+
encoding: m = "color",
|
|
3588
|
+
children: p
|
|
3589
|
+
} = s, u = $(() => ({ ...sn, ...f }), [f]), g = h ?? u.empty, [d] = fe(() => new rn()), y = G(null), b = G(null), v = G(null), w = G(null), L = G(null), A = G(null), z = Ve(), T = typeof i == "number" ? void 0 : i, S = typeof i == "number" ? i : void 0, _ = S ?? (T == null ? void 0 : T.top), X = S ?? (T == null ? void 0 : T.right), I = S ?? (T == null ? void 0 : T.bottom), P = S ?? (T == null ? void 0 : T.left), N = $(
|
|
2976
3590
|
() => ({
|
|
2977
|
-
top:
|
|
2978
|
-
right:
|
|
2979
|
-
bottom:
|
|
2980
|
-
left:
|
|
3591
|
+
top: _ ?? 8,
|
|
3592
|
+
right: X ?? 8,
|
|
3593
|
+
bottom: I ?? 8,
|
|
3594
|
+
left: P ?? 8
|
|
2981
3595
|
}),
|
|
2982
|
-
[
|
|
3596
|
+
[_, X, I, P]
|
|
2983
3597
|
);
|
|
2984
|
-
o === void 0 &&
|
|
3598
|
+
o === void 0 && nt(
|
|
2985
3599
|
"chart-arialabel",
|
|
2986
3600
|
"Chart without ariaLabel - please set a meaningful description (R-7.6)."
|
|
2987
3601
|
), D(() => {
|
|
2988
|
-
const
|
|
2989
|
-
if (!
|
|
2990
|
-
d.bind(C,
|
|
2991
|
-
const
|
|
2992
|
-
d.requestResize(
|
|
2993
|
-
const
|
|
2994
|
-
var
|
|
2995
|
-
const et =
|
|
3602
|
+
const M = y.current, C = b.current, q = v.current, Y = w.current;
|
|
3603
|
+
if (!M || !C || !q || !Y) return;
|
|
3604
|
+
d.bind(C, q, Y, M), d.bindA11y(L.current, A.current);
|
|
3605
|
+
const Z = C.getBoundingClientRect();
|
|
3606
|
+
d.requestResize(Z.width, Z.height);
|
|
3607
|
+
const R = new ResizeObserver((J) => {
|
|
3608
|
+
var Tt;
|
|
3609
|
+
const et = J[J.length - 1];
|
|
2996
3610
|
if (et === void 0) return;
|
|
2997
|
-
const
|
|
2998
|
-
|
|
3611
|
+
const at = (Tt = et.contentBoxSize) == null ? void 0 : Tt[0];
|
|
3612
|
+
at !== void 0 ? d.requestResize(at.inlineSize, at.blockSize) : d.requestResize(et.contentRect.width, et.contentRect.height);
|
|
2999
3613
|
});
|
|
3000
|
-
|
|
3001
|
-
const
|
|
3002
|
-
window.addEventListener("blur",
|
|
3003
|
-
const
|
|
3004
|
-
C.contains(
|
|
3614
|
+
R.observe(C);
|
|
3615
|
+
const j = () => d.pointerLeave();
|
|
3616
|
+
window.addEventListener("blur", j);
|
|
3617
|
+
const W = (J) => {
|
|
3618
|
+
C.contains(J.target) || d.pointerLeave();
|
|
3005
3619
|
};
|
|
3006
|
-
document.addEventListener("pointerdown",
|
|
3007
|
-
const
|
|
3008
|
-
return C.addEventListener("wheel",
|
|
3009
|
-
C.removeEventListener("wheel",
|
|
3620
|
+
document.addEventListener("pointerdown", W);
|
|
3621
|
+
const At = (J) => d.wheel(J);
|
|
3622
|
+
return C.addEventListener("wheel", At, { passive: !1 }), () => {
|
|
3623
|
+
C.removeEventListener("wheel", At), window.removeEventListener("blur", j), document.removeEventListener("pointerdown", W), R.disconnect(), d.unbind();
|
|
3010
3624
|
};
|
|
3011
3625
|
}, [d]), D(() => {
|
|
3012
3626
|
d.setData(t);
|
|
3013
3627
|
}, [d, t]), D(() => {
|
|
3014
|
-
d.setPadding(
|
|
3015
|
-
}, [d,
|
|
3016
|
-
d.setWording(
|
|
3017
|
-
}, [d,
|
|
3628
|
+
d.setPadding(N);
|
|
3629
|
+
}, [d, N]), D(() => {
|
|
3630
|
+
d.setWording(u);
|
|
3631
|
+
}, [d, u]), D(() => {
|
|
3632
|
+
d.setEncoding(m);
|
|
3633
|
+
}, [d, m]), D(() => {
|
|
3018
3634
|
d.setOnPerf(a ?? null);
|
|
3019
3635
|
}, [d, a]), D(() => (d.setSyncId(c ?? null), () => d.setSyncId(null)), [d, c]), D(() => {
|
|
3020
3636
|
d.validate();
|
|
3021
3637
|
});
|
|
3022
|
-
const
|
|
3638
|
+
const F = wt(
|
|
3023
3639
|
d.subscribeHover,
|
|
3024
3640
|
() => d.getHoverSnapshot().tooltip !== null,
|
|
3025
3641
|
() => !1
|
|
3026
|
-
),
|
|
3642
|
+
), B = {
|
|
3027
3643
|
width: e === "100%" ? "100%" : `${e}px`,
|
|
3028
3644
|
height: `${n}px`,
|
|
3029
3645
|
...l
|
|
3030
|
-
},
|
|
3031
|
-
d.drag(
|
|
3646
|
+
}, E = (M) => {
|
|
3647
|
+
d.drag(M.nativeEvent), d.pointerMove(M.nativeEvent.offsetX, M.nativeEvent.offsetY);
|
|
3032
3648
|
};
|
|
3033
|
-
return /* @__PURE__ */
|
|
3649
|
+
return /* @__PURE__ */ k(ln.Provider, { value: d, children: /* @__PURE__ */ O(
|
|
3034
3650
|
"div",
|
|
3035
3651
|
{
|
|
3036
3652
|
ref: y,
|
|
3037
3653
|
className: r ? `uc-root ${r}` : "uc-root",
|
|
3038
|
-
style:
|
|
3654
|
+
style: B,
|
|
3039
3655
|
children: [
|
|
3040
|
-
/* @__PURE__ */
|
|
3656
|
+
/* @__PURE__ */ O(
|
|
3041
3657
|
"div",
|
|
3042
3658
|
{
|
|
3043
|
-
ref:
|
|
3659
|
+
ref: b,
|
|
3044
3660
|
className: "uc-plot",
|
|
3045
|
-
role:
|
|
3046
|
-
"aria-roledescription":
|
|
3661
|
+
role: F ? "application" : "img",
|
|
3662
|
+
"aria-roledescription": F ? u.roleDescription : void 0,
|
|
3047
3663
|
"aria-label": o,
|
|
3048
|
-
"aria-describedby":
|
|
3049
|
-
tabIndex:
|
|
3050
|
-
onKeyDown: (
|
|
3051
|
-
d.key(
|
|
3664
|
+
"aria-describedby": z,
|
|
3665
|
+
tabIndex: F ? 0 : void 0,
|
|
3666
|
+
onKeyDown: (M) => {
|
|
3667
|
+
d.key(M.nativeEvent) && M.preventDefault();
|
|
3052
3668
|
},
|
|
3053
|
-
onFocus: (
|
|
3669
|
+
onFocus: (M) => d.focus(ns(M.currentTarget)),
|
|
3054
3670
|
onBlur: () => d.blur(),
|
|
3055
|
-
onPointerMove:
|
|
3056
|
-
onPointerDown: (
|
|
3057
|
-
d.pointerDown(
|
|
3671
|
+
onPointerMove: E,
|
|
3672
|
+
onPointerDown: (M) => {
|
|
3673
|
+
d.pointerDown(M.nativeEvent), E(M);
|
|
3058
3674
|
},
|
|
3059
|
-
onPointerUp: (
|
|
3060
|
-
onPointerCancel: (
|
|
3675
|
+
onPointerUp: (M) => d.pointerUp(M.nativeEvent),
|
|
3676
|
+
onPointerCancel: (M) => d.pointerUp(M.nativeEvent),
|
|
3061
3677
|
onDoubleClick: () => d.doubleClick(),
|
|
3062
|
-
onPointerLeave: (
|
|
3063
|
-
|
|
3678
|
+
onPointerLeave: (M) => {
|
|
3679
|
+
M.pointerType !== "touch" && d.pointerLeave();
|
|
3064
3680
|
},
|
|
3065
3681
|
children: [
|
|
3066
|
-
/* @__PURE__ */
|
|
3067
|
-
/* @__PURE__ */
|
|
3068
|
-
/* @__PURE__ */
|
|
3069
|
-
/* @__PURE__ */
|
|
3682
|
+
/* @__PURE__ */ k("canvas", { ref: v, className: "uc-layer-series", "aria-hidden": "true" }),
|
|
3683
|
+
/* @__PURE__ */ k("canvas", { ref: w, className: "uc-layer-overlay", "aria-hidden": "true" }),
|
|
3684
|
+
/* @__PURE__ */ k(Zi, { scene: d, empty: g }),
|
|
3685
|
+
/* @__PURE__ */ k(es, { scene: d })
|
|
3070
3686
|
]
|
|
3071
3687
|
}
|
|
3072
3688
|
),
|
|
3073
|
-
/* @__PURE__ */
|
|
3074
|
-
/* @__PURE__ */
|
|
3075
|
-
|
|
3689
|
+
/* @__PURE__ */ k("div", { ref: L, className: "uc-sr", "aria-live": "polite" }),
|
|
3690
|
+
/* @__PURE__ */ k("div", { ref: A, id: z, className: "uc-sr" }),
|
|
3691
|
+
p
|
|
3076
3692
|
]
|
|
3077
3693
|
}
|
|
3078
3694
|
) });
|
|
3079
3695
|
}
|
|
3080
|
-
function
|
|
3696
|
+
function ns(s) {
|
|
3081
3697
|
try {
|
|
3082
3698
|
return s.matches(":focus-visible");
|
|
3083
3699
|
} catch {
|
|
3084
3700
|
return !0;
|
|
3085
3701
|
}
|
|
3086
3702
|
}
|
|
3087
|
-
function
|
|
3703
|
+
function Ls(s) {
|
|
3088
3704
|
const {
|
|
3089
3705
|
accessor: t,
|
|
3090
3706
|
baseline: e,
|
|
@@ -3096,10 +3712,12 @@ function Xi(s) {
|
|
|
3096
3712
|
format: a,
|
|
3097
3713
|
color: c,
|
|
3098
3714
|
tone: h,
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3715
|
+
stack: f,
|
|
3716
|
+
normalize: m,
|
|
3717
|
+
fillOpacity: p = 0.18,
|
|
3718
|
+
strokeWidth: u = 1.5,
|
|
3719
|
+
dash: g
|
|
3720
|
+
} = s, d = $(
|
|
3103
3721
|
() => ({
|
|
3104
3722
|
kind: "area",
|
|
3105
3723
|
accessor: t,
|
|
@@ -3112,15 +3730,17 @@ function Xi(s) {
|
|
|
3112
3730
|
format: a,
|
|
3113
3731
|
color: c,
|
|
3114
3732
|
tone: h,
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3733
|
+
stack: f,
|
|
3734
|
+
normalize: m,
|
|
3735
|
+
fillOpacity: p,
|
|
3736
|
+
strokeWidth: u,
|
|
3737
|
+
dash: g
|
|
3118
3738
|
}),
|
|
3119
|
-
[t, e, n, i, o, r, l, a, c, h, f, m, p]
|
|
3739
|
+
[t, e, n, i, o, r, l, a, c, h, f, m, p, u, g]
|
|
3120
3740
|
);
|
|
3121
|
-
return
|
|
3741
|
+
return dt("Area", d), null;
|
|
3122
3742
|
}
|
|
3123
|
-
function
|
|
3743
|
+
function Es(s) {
|
|
3124
3744
|
const {
|
|
3125
3745
|
accessor: t,
|
|
3126
3746
|
xAxisId: e = "x",
|
|
@@ -3131,8 +3751,10 @@ function Zi(s) {
|
|
|
3131
3751
|
format: l,
|
|
3132
3752
|
color: a,
|
|
3133
3753
|
tone: c,
|
|
3134
|
-
|
|
3135
|
-
|
|
3754
|
+
stack: h,
|
|
3755
|
+
normalize: f,
|
|
3756
|
+
barWidth: m = 0.8
|
|
3757
|
+
} = s, p = $(
|
|
3136
3758
|
() => ({
|
|
3137
3759
|
kind: "bar",
|
|
3138
3760
|
accessor: t,
|
|
@@ -3144,13 +3766,15 @@ function Zi(s) {
|
|
|
3144
3766
|
format: l,
|
|
3145
3767
|
color: a,
|
|
3146
3768
|
tone: c,
|
|
3147
|
-
|
|
3769
|
+
stack: h,
|
|
3770
|
+
normalize: f,
|
|
3771
|
+
barWidth: m
|
|
3148
3772
|
}),
|
|
3149
|
-
[t, e, n, i, o, r, l, a, c, h]
|
|
3773
|
+
[t, e, n, i, o, r, l, a, c, h, f, m]
|
|
3150
3774
|
);
|
|
3151
|
-
return
|
|
3775
|
+
return dt("Bar", p), null;
|
|
3152
3776
|
}
|
|
3153
|
-
function
|
|
3777
|
+
function is(s) {
|
|
3154
3778
|
const {
|
|
3155
3779
|
accessor: t,
|
|
3156
3780
|
xAxisId: e = "x",
|
|
@@ -3165,7 +3789,7 @@ function Ii(s) {
|
|
|
3165
3789
|
dash: f,
|
|
3166
3790
|
markers: m = "auto",
|
|
3167
3791
|
step: p
|
|
3168
|
-
} = s, u =
|
|
3792
|
+
} = s, u = $(
|
|
3169
3793
|
() => ({
|
|
3170
3794
|
kind: "line",
|
|
3171
3795
|
accessor: t,
|
|
@@ -3184,9 +3808,9 @@ function Ii(s) {
|
|
|
3184
3808
|
}),
|
|
3185
3809
|
[t, e, n, i, o, r, l, a, c, h, f, m, p]
|
|
3186
3810
|
);
|
|
3187
|
-
return
|
|
3811
|
+
return dt("Line", u), null;
|
|
3188
3812
|
}
|
|
3189
|
-
function
|
|
3813
|
+
function ss(s) {
|
|
3190
3814
|
const {
|
|
3191
3815
|
accessor: t,
|
|
3192
3816
|
xAxisId: e = "x",
|
|
@@ -3198,7 +3822,7 @@ function Ai(s) {
|
|
|
3198
3822
|
color: a,
|
|
3199
3823
|
tone: c,
|
|
3200
3824
|
radius: h = 3
|
|
3201
|
-
} = s, f =
|
|
3825
|
+
} = s, f = $(
|
|
3202
3826
|
() => ({
|
|
3203
3827
|
kind: "scatter",
|
|
3204
3828
|
accessor: t,
|
|
@@ -3214,9 +3838,9 @@ function Ai(s) {
|
|
|
3214
3838
|
}),
|
|
3215
3839
|
[t, e, n, i, o, r, l, a, c, h]
|
|
3216
3840
|
);
|
|
3217
|
-
return
|
|
3841
|
+
return dt("Scatter", f), null;
|
|
3218
3842
|
}
|
|
3219
|
-
function
|
|
3843
|
+
function Fs(s) {
|
|
3220
3844
|
const {
|
|
3221
3845
|
accessor: t,
|
|
3222
3846
|
states: e,
|
|
@@ -3227,7 +3851,7 @@ function ji(s) {
|
|
|
3227
3851
|
hidden: l,
|
|
3228
3852
|
laneFrom: a,
|
|
3229
3853
|
laneTo: c
|
|
3230
|
-
} = s, h =
|
|
3854
|
+
} = s, h = $(
|
|
3231
3855
|
() => ({
|
|
3232
3856
|
kind: "state",
|
|
3233
3857
|
accessor: t,
|
|
@@ -3242,9 +3866,9 @@ function ji(s) {
|
|
|
3242
3866
|
}),
|
|
3243
3867
|
[t, e, n, i, o, r, l, a, c]
|
|
3244
3868
|
);
|
|
3245
|
-
return
|
|
3869
|
+
return dt("StateBand", h), null;
|
|
3246
3870
|
}
|
|
3247
|
-
const
|
|
3871
|
+
const os = [
|
|
3248
3872
|
"#eef2ff",
|
|
3249
3873
|
"#c7d2fe",
|
|
3250
3874
|
"#a5b4fc",
|
|
@@ -3253,7 +3877,7 @@ const Ti = [
|
|
|
3253
3877
|
"#4f46e5",
|
|
3254
3878
|
"#4338ca"
|
|
3255
3879
|
];
|
|
3256
|
-
function
|
|
3880
|
+
function Ds(s) {
|
|
3257
3881
|
const {
|
|
3258
3882
|
accessor: t,
|
|
3259
3883
|
value: e,
|
|
@@ -3264,10 +3888,10 @@ function Ji(s) {
|
|
|
3264
3888
|
name: l,
|
|
3265
3889
|
hidden: a,
|
|
3266
3890
|
format: c
|
|
3267
|
-
} = s, h =
|
|
3268
|
-
() => n ?? { kind: "gradient", stops:
|
|
3891
|
+
} = s, h = $(
|
|
3892
|
+
() => n ?? { kind: "gradient", stops: os },
|
|
3269
3893
|
[n]
|
|
3270
|
-
), f =
|
|
3894
|
+
), f = $(
|
|
3271
3895
|
() => ({
|
|
3272
3896
|
kind: "matrix",
|
|
3273
3897
|
accessor: t,
|
|
@@ -3282,9 +3906,9 @@ function Ji(s) {
|
|
|
3282
3906
|
}),
|
|
3283
3907
|
[t, e, h, i, o, r, l, a, c]
|
|
3284
3908
|
);
|
|
3285
|
-
return
|
|
3909
|
+
return dt("Matrix", f), null;
|
|
3286
3910
|
}
|
|
3287
|
-
function
|
|
3911
|
+
function pt(s) {
|
|
3288
3912
|
const {
|
|
3289
3913
|
value: t,
|
|
3290
3914
|
orientation: e = "y",
|
|
@@ -3294,7 +3918,7 @@ function mt(s) {
|
|
|
3294
3918
|
color: r,
|
|
3295
3919
|
inExtent: l = !0,
|
|
3296
3920
|
role: a = "specification"
|
|
3297
|
-
} = s, c =
|
|
3921
|
+
} = s, c = $(
|
|
3298
3922
|
() => ({
|
|
3299
3923
|
kind: "line",
|
|
3300
3924
|
value: t,
|
|
@@ -3308,9 +3932,9 @@ function mt(s) {
|
|
|
3308
3932
|
}),
|
|
3309
3933
|
[t, n, e, i, a, o, r, l]
|
|
3310
3934
|
);
|
|
3311
|
-
return
|
|
3935
|
+
return cn("LimitLine", c), null;
|
|
3312
3936
|
}
|
|
3313
|
-
function
|
|
3937
|
+
function Ps(s) {
|
|
3314
3938
|
const {
|
|
3315
3939
|
from: t,
|
|
3316
3940
|
to: e,
|
|
@@ -3321,7 +3945,7 @@ function Qi(s) {
|
|
|
3321
3945
|
color: l,
|
|
3322
3946
|
inExtent: a = !0,
|
|
3323
3947
|
role: c = "specification"
|
|
3324
|
-
} = s, h =
|
|
3948
|
+
} = s, h = $(
|
|
3325
3949
|
() => ({
|
|
3326
3950
|
kind: "band",
|
|
3327
3951
|
from: t,
|
|
@@ -3336,10 +3960,10 @@ function Qi(s) {
|
|
|
3336
3960
|
}),
|
|
3337
3961
|
[t, e, i, n, o, c, r, l, a]
|
|
3338
3962
|
);
|
|
3339
|
-
return
|
|
3963
|
+
return cn("LimitBand", h), null;
|
|
3340
3964
|
}
|
|
3341
|
-
const
|
|
3342
|
-
function
|
|
3965
|
+
const rs = 1.128;
|
|
3966
|
+
function ne(s, t) {
|
|
3343
3967
|
return {
|
|
3344
3968
|
center: s,
|
|
3345
3969
|
sigma: t,
|
|
@@ -3347,12 +3971,12 @@ function Ut(s, t) {
|
|
|
3347
3971
|
lower: s - 3 * t
|
|
3348
3972
|
};
|
|
3349
3973
|
}
|
|
3350
|
-
function
|
|
3974
|
+
function Cs(s, t) {
|
|
3351
3975
|
return (t - s) / 3;
|
|
3352
3976
|
}
|
|
3353
|
-
function
|
|
3977
|
+
function ls(s, t) {
|
|
3354
3978
|
if (t.kind === "given")
|
|
3355
|
-
return
|
|
3979
|
+
return ne(t.center, t.sigma);
|
|
3356
3980
|
const e = Math.max(0, Math.trunc(t.from)), n = Math.min(s.length, Math.trunc(t.to));
|
|
3357
3981
|
let i = 0, o = 0, r = 0, l = 0, a = Number.NaN;
|
|
3358
3982
|
for (let h = e; h < n; h++) {
|
|
@@ -3363,21 +3987,21 @@ function Si(s, t) {
|
|
|
3363
3987
|
}
|
|
3364
3988
|
i += f, o++, Number.isFinite(a) && (r += Math.abs(f - a), l++), a = f;
|
|
3365
3989
|
}
|
|
3366
|
-
if (o === 0) return
|
|
3367
|
-
const c = l === 0 ? 0 : r / l /
|
|
3368
|
-
return
|
|
3990
|
+
if (o === 0) return ne(Number.NaN, Number.NaN);
|
|
3991
|
+
const c = l === 0 ? 0 : r / l / rs;
|
|
3992
|
+
return ne(i / o, c);
|
|
3369
3993
|
}
|
|
3370
|
-
function
|
|
3994
|
+
function as(s, t = [1, 2]) {
|
|
3371
3995
|
return t.map((e) => ({
|
|
3372
3996
|
k: e,
|
|
3373
3997
|
upper: s.center + e * s.sigma,
|
|
3374
3998
|
lower: s.center - e * s.sigma
|
|
3375
3999
|
}));
|
|
3376
4000
|
}
|
|
3377
|
-
function
|
|
4001
|
+
function cs(s, t) {
|
|
3378
4002
|
return Number.isFinite(s) ? s > t ? 1 : s < t ? -1 : 0 : 0;
|
|
3379
4003
|
}
|
|
3380
|
-
function
|
|
4004
|
+
function dn(s, t) {
|
|
3381
4005
|
const e = [];
|
|
3382
4006
|
if (t < 1) return e;
|
|
3383
4007
|
let n = 0;
|
|
@@ -3391,7 +4015,7 @@ function Ge(s, t) {
|
|
|
3391
4015
|
}
|
|
3392
4016
|
return e;
|
|
3393
4017
|
}
|
|
3394
|
-
const
|
|
4018
|
+
const ge = {
|
|
3395
4019
|
outlier: !0,
|
|
3396
4020
|
run: !0,
|
|
3397
4021
|
trend: !0,
|
|
@@ -3399,7 +4023,7 @@ const se = {
|
|
|
3399
4023
|
runLength: 9,
|
|
3400
4024
|
trendLength: 6
|
|
3401
4025
|
};
|
|
3402
|
-
function
|
|
4026
|
+
function us(s, t) {
|
|
3403
4027
|
const e = [];
|
|
3404
4028
|
if (!(t.sigma > 0)) return e;
|
|
3405
4029
|
for (let n = 0; n < s.length; n++) {
|
|
@@ -3408,24 +4032,24 @@ function Fi(s, t) {
|
|
|
3408
4032
|
}
|
|
3409
4033
|
return e;
|
|
3410
4034
|
}
|
|
3411
|
-
function
|
|
3412
|
-
return
|
|
3413
|
-
s.map((n) =>
|
|
4035
|
+
function hs(s, t, e = ge.runLength) {
|
|
4036
|
+
return dn(
|
|
4037
|
+
s.map((n) => cs(n, t.center)),
|
|
3414
4038
|
e
|
|
3415
4039
|
);
|
|
3416
4040
|
}
|
|
3417
|
-
function
|
|
4041
|
+
function ds(s, t = ge.trendLength) {
|
|
3418
4042
|
const e = [];
|
|
3419
4043
|
for (let i = 1; i < s.length; i++) {
|
|
3420
4044
|
const o = s[i - 1], r = s[i];
|
|
3421
4045
|
e.push(Number.isFinite(o) && Number.isFinite(r) ? Math.sign(r - o) : 0);
|
|
3422
4046
|
}
|
|
3423
4047
|
const n = [];
|
|
3424
|
-
for (const i of
|
|
4048
|
+
for (const i of dn(e, Math.max(1, t - 1)))
|
|
3425
4049
|
n[n.length - 1] !== i && n.push(i), n.push(i + 1);
|
|
3426
4050
|
return n;
|
|
3427
4051
|
}
|
|
3428
|
-
function
|
|
4052
|
+
function fs(s, t) {
|
|
3429
4053
|
if (!(t.sigma > 0)) return [];
|
|
3430
4054
|
const e = t.center + 2 * t.sigma, n = t.center - 2 * t.sigma, i = /* @__PURE__ */ new Set();
|
|
3431
4055
|
for (let o = 0; o + 2 < s.length; o++)
|
|
@@ -3436,30 +4060,30 @@ function Ci(s, t) {
|
|
|
3436
4060
|
if (r.length >= 2) for (const l of r) i.add(l);
|
|
3437
4061
|
return [...i].sort((o, r) => o - r);
|
|
3438
4062
|
}
|
|
3439
|
-
function
|
|
3440
|
-
const n = { ...
|
|
3441
|
-
t.sigma > 0 ||
|
|
4063
|
+
function ms(s, t, e = {}) {
|
|
4064
|
+
const n = { ...ge, ...e };
|
|
4065
|
+
t.sigma > 0 || nt(
|
|
3442
4066
|
"control-sigma-zero",
|
|
3443
4067
|
`control limits with sigma ${t.sigma} span no band - a constant reference window, or a given sigma not above 0. Rules 1 and 4 find nothing there; take a window with spread, or a positive given sigma.`
|
|
3444
4068
|
);
|
|
3445
4069
|
const i = [], o = (r, l) => {
|
|
3446
4070
|
l.length > 0 && i.push({ rule: r, indices: l });
|
|
3447
4071
|
};
|
|
3448
|
-
return n.outlier && o("outlier",
|
|
4072
|
+
return n.outlier && o("outlier", us(s, t)), n.run && o("run", hs(s, t, n.runLength)), n.trend && o("trend", ds(s, n.trendLength)), n.twoOfThree && o("twoOfThree", fs(s, t)), i;
|
|
3449
4073
|
}
|
|
3450
|
-
function
|
|
4074
|
+
function ps(s) {
|
|
3451
4075
|
const t = /* @__PURE__ */ new Set();
|
|
3452
4076
|
for (const e of s) for (const n of e.indices) t.add(n);
|
|
3453
4077
|
return [...t].sort((e, n) => e - n);
|
|
3454
4078
|
}
|
|
3455
|
-
function
|
|
3456
|
-
const [e, n] =
|
|
4079
|
+
function ie(s, t) {
|
|
4080
|
+
const [e, n] = fe({ value: s });
|
|
3457
4081
|
return e.value === s || t(e.value, s) ? e.value : (n({ value: s }), s);
|
|
3458
4082
|
}
|
|
3459
|
-
function
|
|
4083
|
+
function gs(s, t) {
|
|
3460
4084
|
return s.kind === "given" && t.kind === "given" ? s.center === t.center && s.sigma === t.sigma : s.kind === "referenceWindow" && t.kind === "referenceWindow" ? s.from === t.from && s.to === t.to : !1;
|
|
3461
4085
|
}
|
|
3462
|
-
function
|
|
4086
|
+
function ys(s, t) {
|
|
3463
4087
|
if (s.length !== t.length) return !1;
|
|
3464
4088
|
for (let e = 0; e < s.length; e++) {
|
|
3465
4089
|
const n = s[e], i = t[e];
|
|
@@ -3468,7 +4092,7 @@ function Hi(s, t) {
|
|
|
3468
4092
|
}
|
|
3469
4093
|
return !0;
|
|
3470
4094
|
}
|
|
3471
|
-
function
|
|
4095
|
+
function $s(s) {
|
|
3472
4096
|
const {
|
|
3473
4097
|
data: t,
|
|
3474
4098
|
xAxisId: e = "x",
|
|
@@ -3483,64 +4107,64 @@ function es(s) {
|
|
|
3483
4107
|
labelLower: f,
|
|
3484
4108
|
violationName: m,
|
|
3485
4109
|
onViolations: p
|
|
3486
|
-
} = s, u =
|
|
3487
|
-
const
|
|
4110
|
+
} = s, u = ie(s.accessor, Q), g = ie(s.origin, gs), d = $(() => {
|
|
4111
|
+
const S = [];
|
|
3488
4112
|
for (let _ = 0; _ < t.length; _++) {
|
|
3489
|
-
const
|
|
3490
|
-
|
|
3491
|
-
}
|
|
3492
|
-
return
|
|
3493
|
-
}, [t, u]),
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
),
|
|
4113
|
+
const X = u(t[_], _);
|
|
4114
|
+
S.push(X ?? Number.NaN);
|
|
4115
|
+
}
|
|
4116
|
+
return S;
|
|
4117
|
+
}, [t, u]), y = $(() => ls(d, g), [d, g]), b = ie(
|
|
4118
|
+
$(() => ms(d, y, a ?? {}), [d, y, a]),
|
|
4119
|
+
ys
|
|
4120
|
+
), v = $(() => new Set(ps(b)), [b]), w = G(p);
|
|
3497
4121
|
D(() => {
|
|
3498
|
-
|
|
4122
|
+
w.current = p;
|
|
3499
4123
|
}, [p]), D(() => {
|
|
3500
|
-
var
|
|
3501
|
-
(
|
|
4124
|
+
var S;
|
|
4125
|
+
(S = w.current) == null || S.call(w, b);
|
|
3502
4126
|
}, [b]);
|
|
3503
|
-
const
|
|
3504
|
-
() => (
|
|
3505
|
-
[
|
|
3506
|
-
), A =
|
|
3507
|
-
() =>
|
|
3508
|
-
[t,
|
|
3509
|
-
),
|
|
3510
|
-
() => c ?
|
|
3511
|
-
[c,
|
|
3512
|
-
),
|
|
3513
|
-
return /* @__PURE__ */
|
|
3514
|
-
/* @__PURE__ */
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
4127
|
+
const L = $(
|
|
4128
|
+
() => (S, _) => v.has(_) ? u(S, _) : null,
|
|
4129
|
+
[v, u]
|
|
4130
|
+
), A = $(
|
|
4131
|
+
() => v.size === 0 ? t : t.slice(),
|
|
4132
|
+
[t, v]
|
|
4133
|
+
), z = $(
|
|
4134
|
+
() => c ? as(y, [1, 2]) : [],
|
|
4135
|
+
[c, y]
|
|
4136
|
+
), T = Number.isFinite(y.center);
|
|
4137
|
+
return /* @__PURE__ */ O(xt, { children: [
|
|
4138
|
+
/* @__PURE__ */ k(is, { accessor: u, data: t, xAxisId: e, yAxisId: n, name: i, format: o, color: r, tone: l }),
|
|
4139
|
+
T && /* @__PURE__ */ O(xt, { children: [
|
|
4140
|
+
z.map((S) => /* @__PURE__ */ k(
|
|
4141
|
+
pt,
|
|
3518
4142
|
{
|
|
3519
|
-
value:
|
|
4143
|
+
value: S.upper,
|
|
3520
4144
|
axisId: n,
|
|
3521
4145
|
role: "zone",
|
|
3522
4146
|
inExtent: !1
|
|
3523
4147
|
},
|
|
3524
|
-
`zone-${
|
|
4148
|
+
`zone-${S.k}-upper`
|
|
3525
4149
|
)),
|
|
3526
|
-
|
|
3527
|
-
|
|
4150
|
+
z.map((S) => /* @__PURE__ */ k(
|
|
4151
|
+
pt,
|
|
3528
4152
|
{
|
|
3529
|
-
value:
|
|
4153
|
+
value: S.lower,
|
|
3530
4154
|
axisId: n,
|
|
3531
4155
|
role: "zone",
|
|
3532
4156
|
inExtent: !1
|
|
3533
4157
|
},
|
|
3534
|
-
`zone-${
|
|
4158
|
+
`zone-${S.k}-lower`
|
|
3535
4159
|
)),
|
|
3536
|
-
/* @__PURE__ */
|
|
3537
|
-
/* @__PURE__ */
|
|
3538
|
-
/* @__PURE__ */
|
|
4160
|
+
/* @__PURE__ */ k(pt, { value: y.center, axisId: n, role: "control" }),
|
|
4161
|
+
/* @__PURE__ */ k(pt, { value: y.upper, axisId: n, role: "control", label: h }),
|
|
4162
|
+
/* @__PURE__ */ k(pt, { value: y.lower, axisId: n, role: "control", label: f })
|
|
3539
4163
|
] }),
|
|
3540
|
-
/* @__PURE__ */
|
|
3541
|
-
|
|
4164
|
+
/* @__PURE__ */ k(
|
|
4165
|
+
ss,
|
|
3542
4166
|
{
|
|
3543
|
-
accessor:
|
|
4167
|
+
accessor: L,
|
|
3544
4168
|
data: A,
|
|
3545
4169
|
xAxisId: e,
|
|
3546
4170
|
yAxisId: n,
|
|
@@ -3552,7 +4176,7 @@ function es(s) {
|
|
|
3552
4176
|
)
|
|
3553
4177
|
] });
|
|
3554
4178
|
}
|
|
3555
|
-
function
|
|
4179
|
+
function Os(s) {
|
|
3556
4180
|
const {
|
|
3557
4181
|
id: t = "x",
|
|
3558
4182
|
position: e = "bottom",
|
|
@@ -3566,7 +4190,7 @@ function ns(s) {
|
|
|
3566
4190
|
time: h,
|
|
3567
4191
|
calendar: f,
|
|
3568
4192
|
onDomainChange: m
|
|
3569
|
-
} = s, p =
|
|
4193
|
+
} = s, p = $(
|
|
3570
4194
|
() => ({
|
|
3571
4195
|
id: t,
|
|
3572
4196
|
orientation: "x",
|
|
@@ -3584,9 +4208,9 @@ function ns(s) {
|
|
|
3584
4208
|
}),
|
|
3585
4209
|
[t, e, n, i, o, r, l, a, c, h, f, m]
|
|
3586
4210
|
);
|
|
3587
|
-
return
|
|
4211
|
+
return an("XAxis", p), null;
|
|
3588
4212
|
}
|
|
3589
|
-
function
|
|
4213
|
+
function Hs(s) {
|
|
3590
4214
|
const {
|
|
3591
4215
|
id: t = "y",
|
|
3592
4216
|
position: e = "left",
|
|
@@ -3598,7 +4222,7 @@ function is(s) {
|
|
|
3598
4222
|
grid: a,
|
|
3599
4223
|
ticks: c,
|
|
3600
4224
|
alignTicks: h
|
|
3601
|
-
} = s, f =
|
|
4225
|
+
} = s, f = $(
|
|
3602
4226
|
() => ({
|
|
3603
4227
|
id: t,
|
|
3604
4228
|
orientation: "y",
|
|
@@ -3614,60 +4238,22 @@ function is(s) {
|
|
|
3614
4238
|
}),
|
|
3615
4239
|
[t, e, n, i, o, r, l, a, c, h]
|
|
3616
4240
|
);
|
|
3617
|
-
return
|
|
3618
|
-
}
|
|
3619
|
-
function Wi({
|
|
3620
|
-
scene: s,
|
|
3621
|
-
placement: t,
|
|
3622
|
-
onToggle: e
|
|
3623
|
-
}) {
|
|
3624
|
-
gi("Legend", { placement: t });
|
|
3625
|
-
const n = $t(
|
|
3626
|
-
s.subscribeLayout,
|
|
3627
|
-
s.getLayoutSnapshot,
|
|
3628
|
-
s.getLayoutServerSnapshot
|
|
3629
|
-
);
|
|
3630
|
-
return n.series.length === 0 ? null : /* @__PURE__ */ I("div", { className: `uc-legend uc-legend-${t}`, children: n.series.map((i) => {
|
|
3631
|
-
const o = {
|
|
3632
|
-
className: "uc-legend-item",
|
|
3633
|
-
"data-hidden": i.hidden ? "" : void 0,
|
|
3634
|
-
onPointerEnter: () => s.setHighlight(i.seriesIds),
|
|
3635
|
-
onPointerLeave: () => s.setHighlight(null)
|
|
3636
|
-
}, r = /* @__PURE__ */ z(Et, { children: [
|
|
3637
|
-
/* @__PURE__ */ I("span", { className: "uc-legend-chip", style: { background: i.color } }),
|
|
3638
|
-
i.name
|
|
3639
|
-
] });
|
|
3640
|
-
return e === void 0 ? /* @__PURE__ */ I("span", { ...o, children: r }, i.id) : /* @__PURE__ */ I(
|
|
3641
|
-
"button",
|
|
3642
|
-
{
|
|
3643
|
-
type: "button",
|
|
3644
|
-
"aria-pressed": !i.hidden,
|
|
3645
|
-
onClick: () => e(i.name),
|
|
3646
|
-
...o,
|
|
3647
|
-
children: r
|
|
3648
|
-
},
|
|
3649
|
-
i.id
|
|
3650
|
-
);
|
|
3651
|
-
}) });
|
|
3652
|
-
}
|
|
3653
|
-
function ss({ placement: s = "top", onToggle: t }) {
|
|
3654
|
-
const e = ct("Legend");
|
|
3655
|
-
return e === null ? null : /* @__PURE__ */ I(Wi, { scene: e, placement: s, onToggle: t });
|
|
4241
|
+
return an("YAxis", f), null;
|
|
3656
4242
|
}
|
|
3657
|
-
function
|
|
3658
|
-
const { mode: t = "x", render: e } = s, n =
|
|
4243
|
+
function Rs(s) {
|
|
4244
|
+
const { mode: t = "x", render: e } = s, n = $(
|
|
3659
4245
|
() => ({ mode: t, render: e }),
|
|
3660
4246
|
[t, e]
|
|
3661
4247
|
);
|
|
3662
|
-
return
|
|
4248
|
+
return Ui("Tooltip", n), null;
|
|
3663
4249
|
}
|
|
3664
|
-
const
|
|
4250
|
+
const xs = {
|
|
3665
4251
|
cutoff: 0.8,
|
|
3666
4252
|
collectRank: Number.POSITIVE_INFINITY
|
|
3667
4253
|
};
|
|
3668
|
-
function
|
|
3669
|
-
const e = { ...
|
|
3670
|
-
|
|
4254
|
+
function Ws(s, t = {}) {
|
|
4255
|
+
const e = { ...xs, ...t };
|
|
4256
|
+
gt(
|
|
3671
4257
|
!Number.isFinite(e.collectRank) || e.remainderName !== void 0,
|
|
3672
4258
|
"pareto: a collect rank needs `remainderName` - the package brings no name for the remainder."
|
|
3673
4259
|
);
|
|
@@ -3688,54 +4274,55 @@ function rs(s, t = {}) {
|
|
|
3688
4274
|
return { entries: c, total: a, cutoffIndex: m };
|
|
3689
4275
|
}
|
|
3690
4276
|
export {
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
4277
|
+
Ls as Area,
|
|
4278
|
+
Es as Bar,
|
|
4279
|
+
Ss as Chart,
|
|
4280
|
+
$s as ControlChart,
|
|
3695
4281
|
K as DAY,
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
4282
|
+
sn as DEFAULT_CHARTS_WORDING,
|
|
4283
|
+
os as DEFAULT_GRADIENT,
|
|
4284
|
+
Ts as DataTable,
|
|
4285
|
+
rt as HOUR,
|
|
4286
|
+
Ms as Legend,
|
|
4287
|
+
Ps as LimitBand,
|
|
4288
|
+
pt as LimitLine,
|
|
4289
|
+
is as Line,
|
|
4290
|
+
be as LinearScale,
|
|
4291
|
+
V as MINUTE,
|
|
4292
|
+
Ds as Matrix,
|
|
4293
|
+
ot as SECOND,
|
|
4294
|
+
ss as Scatter,
|
|
4295
|
+
Fs as StateBand,
|
|
4296
|
+
Rs as Tooltip,
|
|
4297
|
+
Os as XAxis,
|
|
4298
|
+
Hs as YAxis,
|
|
4299
|
+
Ni as assess,
|
|
4300
|
+
Hn as breaks,
|
|
4301
|
+
tt as calendarFrom,
|
|
4302
|
+
ls as controlLimits,
|
|
4303
|
+
ge as defaultRules,
|
|
4304
|
+
qt as invalidateTheme,
|
|
4305
|
+
Ns as localOffset,
|
|
4306
|
+
ws as mapSeries,
|
|
4307
|
+
Dn as operatingCalendar,
|
|
4308
|
+
Is as operatingTicks,
|
|
4309
|
+
Wn as operatingTimeTicks,
|
|
4310
|
+
Ws as pareto,
|
|
4311
|
+
xs as paretoDefaults,
|
|
4312
|
+
On as removedIntervals,
|
|
4313
|
+
In as resolveColours,
|
|
4314
|
+
us as ruleOutlier,
|
|
4315
|
+
hs as ruleRun,
|
|
4316
|
+
ds as ruleTrend,
|
|
4317
|
+
fs as ruleTwoOfThree,
|
|
4318
|
+
Cs as sigmaFromLimit,
|
|
4319
|
+
Tn as subscribeTheme,
|
|
4320
|
+
Rn as timeStep,
|
|
4321
|
+
ut as toOperatingTime,
|
|
4322
|
+
Cn as toOperatingTimeClamped,
|
|
4323
|
+
ht as toWallClock,
|
|
4324
|
+
As as verdictWeight,
|
|
4325
|
+
ps as violatedIndices,
|
|
4326
|
+
ms as violations,
|
|
4327
|
+
as as zones
|
|
3741
4328
|
};
|