@umriss-ui/charts 0.9.0 → 0.10.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 +71 -1
- package/README.md +5 -3
- package/dist/charts.css +1 -1
- package/dist/charts.js +718 -706
- package/dist/de.d.ts +3 -0
- package/dist/index.d.ts +330 -151
- package/dist/wording/de.d.ts +2 -0
- package/docs/llms-full.md +8820 -3681
- package/package.json +2 -2
package/dist/charts.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "./charts.css";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var x = (o, t, e) =>
|
|
5
|
-
import { jsxs as
|
|
6
|
-
import { useRef as J, useEffect as
|
|
7
|
-
function
|
|
2
|
+
var Hn = Object.defineProperty;
|
|
3
|
+
var Rn = (o, t, e) => t in o ? Hn(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
4
|
+
var x = (o, t, e) => Rn(o, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { jsxs as R, jsx as N, Fragment as Nt } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as J, useEffect as B, createContext as _n, useContext as Bn, useSyncExternalStore as Wt, useId as dn, useState as Se, useLayoutEffect as Vn, useCallback as zn, Fragment as Yn, useMemo as V } from "react";
|
|
7
|
+
function Kn() {
|
|
8
8
|
var t;
|
|
9
9
|
const o = import.meta;
|
|
10
10
|
return typeof ((t = o.env) == null ? void 0 : t.DEV) == "boolean" ? o.env.DEV : typeof process < "u" && (process != null && process.env) ? process.env.NODE_ENV !== "production" : !1;
|
|
11
11
|
}
|
|
12
|
-
const wt =
|
|
13
|
-
function
|
|
12
|
+
const wt = Kn();
|
|
13
|
+
function $t(o, t) {
|
|
14
14
|
if (wt && !o)
|
|
15
15
|
throw new Error(`@umriss-ui/charts: ${t}`);
|
|
16
16
|
}
|
|
@@ -30,15 +30,15 @@ const K = {
|
|
|
30
30
|
fontMono: "ui-monospace, monospace",
|
|
31
31
|
series: ["#2563eb", "#db2777", "#059669", "#d97706", "#7c3aed", "#0891b2"],
|
|
32
32
|
forced: !1
|
|
33
|
-
},
|
|
34
|
-
function
|
|
35
|
-
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(
|
|
33
|
+
}, fn = "(forced-colors: active)";
|
|
34
|
+
function Gn() {
|
|
35
|
+
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(fn).matches;
|
|
36
36
|
}
|
|
37
37
|
const $e = /* @__PURE__ */ new WeakMap();
|
|
38
38
|
let ve = 0;
|
|
39
39
|
const ke = /* @__PURE__ */ new Set();
|
|
40
40
|
let ce = null;
|
|
41
|
-
function
|
|
41
|
+
function Ot(o, t, e) {
|
|
42
42
|
const n = o.getPropertyValue(t).trim();
|
|
43
43
|
return n === "" ? e : n;
|
|
44
44
|
}
|
|
@@ -55,7 +55,7 @@ function Le(o, t, e = !1) {
|
|
|
55
55
|
n.remove();
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Un(o, t) {
|
|
59
59
|
return Le(
|
|
60
60
|
o,
|
|
61
61
|
(e) => {
|
|
@@ -68,8 +68,8 @@ function Gn(o, t) {
|
|
|
68
68
|
colorWarning: i,
|
|
69
69
|
colorAlarm: i,
|
|
70
70
|
colorOk: n,
|
|
71
|
-
font:
|
|
72
|
-
fontMono:
|
|
71
|
+
font: Ot(t, "--uc-font", K.font),
|
|
72
|
+
fontMono: Ot(t, "--uc-font-mono", K.fontMono),
|
|
73
73
|
series: K.series.map(() => n),
|
|
74
74
|
forced: !0
|
|
75
75
|
};
|
|
@@ -77,11 +77,11 @@ function Gn(o, t) {
|
|
|
77
77
|
!0
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function qn(o) {
|
|
81
81
|
const t = getComputedStyle(o);
|
|
82
|
-
return
|
|
82
|
+
return Gn() ? Un(o, t) : Le(o, (e) => {
|
|
83
83
|
const n = (s, r) => {
|
|
84
|
-
const l =
|
|
84
|
+
const l = Ot(t, s, r);
|
|
85
85
|
if (l === r) return r;
|
|
86
86
|
const a = e(`var(${s})`);
|
|
87
87
|
return a === `var(${s})` ? l : a;
|
|
@@ -96,42 +96,42 @@ function Un(o) {
|
|
|
96
96
|
colorWarning: n("--uc-color-warning", K.colorWarning),
|
|
97
97
|
colorAlarm: n("--uc-color-alarm", K.colorAlarm),
|
|
98
98
|
colorOk: n("--uc-color-ok", K.colorOk),
|
|
99
|
-
font:
|
|
100
|
-
fontMono:
|
|
99
|
+
font: Ot(t, "--uc-font", K.font),
|
|
100
|
+
fontMono: Ot(t, "--uc-font-mono", K.fontMono),
|
|
101
101
|
series: i,
|
|
102
102
|
forced: !1
|
|
103
103
|
};
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function mn() {
|
|
107
107
|
var o, t, e, n;
|
|
108
|
-
ce === null && (typeof MutationObserver > "u" || typeof document > "u" || (ce = new MutationObserver(() => ue()), ce.observe(document.documentElement, { attributes: !0 }), typeof window < "u" && typeof window.matchMedia == "function" && ((t = (o = window.matchMedia("(prefers-color-scheme: dark)")).addEventListener) == null || t.call(o, "change", () => ue()), (n = (e = window.matchMedia(
|
|
108
|
+
ce === null && (typeof MutationObserver > "u" || typeof document > "u" || (ce = new MutationObserver(() => ue()), ce.observe(document.documentElement, { attributes: !0 }), typeof window < "u" && typeof window.matchMedia == "function" && ((t = (o = window.matchMedia("(prefers-color-scheme: dark)")).addEventListener) == null || t.call(o, "change", () => ue()), (n = (e = window.matchMedia(fn)).addEventListener) == null || n.call(e, "change", () => ue()))));
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
110
|
+
function Xn(o, t) {
|
|
111
|
+
return mn(), Le(o, (e) => {
|
|
112
112
|
const n = {};
|
|
113
113
|
for (const i of Object.keys(t)) n[i] = e(t[i]);
|
|
114
114
|
return n;
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
117
|
+
function Qn(o) {
|
|
118
|
+
mn();
|
|
119
119
|
const t = $e.get(o);
|
|
120
120
|
if (t !== void 0 && t.generation === ve) return t.theme;
|
|
121
|
-
const e =
|
|
121
|
+
const e = qn(o);
|
|
122
122
|
return $e.set(o, { generation: ve, theme: e }), e;
|
|
123
123
|
}
|
|
124
124
|
function ue() {
|
|
125
125
|
ve++;
|
|
126
126
|
for (const o of ke) o();
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Zn(o) {
|
|
129
129
|
return ke.add(o), () => {
|
|
130
130
|
ke.delete(o);
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
const
|
|
134
|
-
class
|
|
133
|
+
const jn = { width: 0, height: 0 };
|
|
134
|
+
class Jn {
|
|
135
135
|
constructor(t) {
|
|
136
136
|
x(this, "span", null);
|
|
137
137
|
x(this, "root");
|
|
@@ -149,7 +149,7 @@ class jn {
|
|
|
149
149
|
const n = `${e}|${t}`, i = this.cache.get(n);
|
|
150
150
|
if (i !== void 0) return i;
|
|
151
151
|
const s = this.ensure();
|
|
152
|
-
if (s === null) return
|
|
152
|
+
if (s === null) return jn;
|
|
153
153
|
s.className = `uc-measure ${e}`, s.textContent = t;
|
|
154
154
|
const r = s.getBoundingClientRect(), l = { width: r.width, height: r.height };
|
|
155
155
|
return this.cache.set(n, l), l;
|
|
@@ -183,7 +183,7 @@ function le(o) {
|
|
|
183
183
|
function ee(o, t) {
|
|
184
184
|
return t <= 0 || !Number.isFinite(o) || Math.abs(o) >= 1e21 ? te(o) : te(Number(o.toFixed(Math.min(20, t))));
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function ti(o, t, e) {
|
|
187
187
|
if (!Number.isFinite(o) || !Number.isFinite(t)) return [0, 1];
|
|
188
188
|
if (o === t) return [o - 1, t + 1];
|
|
189
189
|
const n = xt(t - o, e), i = le(n);
|
|
@@ -195,7 +195,7 @@ function Jn(o, t, e) {
|
|
|
195
195
|
function Bt(o, t) {
|
|
196
196
|
return !Number.isFinite(o) || !Number.isFinite(t) ? [0, 1] : o === t ? [o - 1, t + 1] : [o, t];
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function pn(o, t, e) {
|
|
199
199
|
if (!Number.isFinite(o) || !Number.isFinite(t)) return [];
|
|
200
200
|
if (o === t) return [te(o)];
|
|
201
201
|
const [n, i] = o < t ? [o, t] : [t, o], s = xt(i - n, e), r = le(s), l = s * 1e-9, a = Math.ceil((n - l) / s), c = Math.floor((i + l) / s);
|
|
@@ -205,23 +205,23 @@ function mn(o, t, e) {
|
|
|
205
205
|
u.push(ee(f * s, r));
|
|
206
206
|
return u;
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function ei(o, t, e, n) {
|
|
209
209
|
const i = n.length, s = n[0], r = n[i - 1];
|
|
210
210
|
if (i < 2 || s === void 0 || r === void 0 || !Number.isFinite(o) || !Number.isFinite(t))
|
|
211
211
|
return null;
|
|
212
|
-
const [l, a] = o === t ? [o - 1, t + 1] : [o, t], c = (r - s) / (i - 1), u = (s - e[0]) / c, f = (e[1] - r) / c, h = i - 1 + u + f,
|
|
213
|
-
let
|
|
212
|
+
const [l, a] = o === t ? [o - 1, t + 1] : [o, t], c = (r - s) / (i - 1), u = (s - e[0]) / c, f = (e[1] - r) / c, h = i - 1 + u + f, p = (d) => te(Number(d.toPrecision(12)));
|
|
213
|
+
let g = xt((a - l) / h, 1);
|
|
214
214
|
for (let d = 0; d < 64; d++) {
|
|
215
|
-
const m =
|
|
216
|
-
if (v + h *
|
|
217
|
-
const b = le(
|
|
215
|
+
const m = g * 1e-9, y = Math.floor((l + u * g + m) / g) * g, v = y - u * g;
|
|
216
|
+
if (v + h * g >= a - m) {
|
|
217
|
+
const b = le(g);
|
|
218
218
|
return {
|
|
219
|
-
domain: [
|
|
220
|
-
ticks: Array.from({ length: i }, (
|
|
221
|
-
step:
|
|
219
|
+
domain: [p(v), p(v + h * g)],
|
|
220
|
+
ticks: Array.from({ length: i }, (I, M) => ee(y + M * g, b)),
|
|
221
|
+
step: g
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
|
|
224
|
+
g = xt(g * 1.5, 1);
|
|
225
225
|
}
|
|
226
226
|
return null;
|
|
227
227
|
}
|
|
@@ -243,18 +243,18 @@ class Oe {
|
|
|
243
243
|
return this.m === 0 ? this.domain[0] : (t - this.b) / this.m;
|
|
244
244
|
}
|
|
245
245
|
ticks(t) {
|
|
246
|
-
return
|
|
246
|
+
return pn(this.domain[0], this.domain[1], t);
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
let Vt = null;
|
|
250
|
-
function
|
|
250
|
+
function gn() {
|
|
251
251
|
if (Vt !== null) return Vt;
|
|
252
252
|
const o = typeof navigator > "u" ? void 0 : navigator.language;
|
|
253
253
|
return Vt = typeof o == "string" && o !== "" ? o : "en-US", Vt;
|
|
254
254
|
}
|
|
255
255
|
const ne = /* @__PURE__ */ new Map();
|
|
256
|
-
function
|
|
257
|
-
const t =
|
|
256
|
+
function ni(o) {
|
|
257
|
+
const t = gn(), e = `${t}|${o}`;
|
|
258
258
|
let n = ne.get(e);
|
|
259
259
|
return n === void 0 && (n = new Intl.NumberFormat(t, {
|
|
260
260
|
minimumFractionDigits: o,
|
|
@@ -262,17 +262,17 @@ function ei(o) {
|
|
|
262
262
|
useGrouping: !0
|
|
263
263
|
}), ne.set(e, n)), n;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
return
|
|
265
|
+
function yn(o, t) {
|
|
266
|
+
return ni(Math.min(6, le(t))).format(o);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Lt(o) {
|
|
269
269
|
if (!Number.isFinite(o)) return "–";
|
|
270
|
-
const t =
|
|
270
|
+
const t = gn(), e = `${t}|value`;
|
|
271
271
|
let n = ne.get(e);
|
|
272
272
|
return n === void 0 && (n = new Intl.NumberFormat(t, { maximumFractionDigits: 3, useGrouping: !0 }), ne.set(e, n)), n.format(o);
|
|
273
273
|
}
|
|
274
274
|
const pt = 1e3, j = 60 * pt, gt = 60 * j, et = 24 * gt;
|
|
275
|
-
function
|
|
275
|
+
function ii(o) {
|
|
276
276
|
const t = o.filter((s) => Number.isFinite(s.from) && Number.isFinite(s.to) && s.to > s.from).sort((s, r) => s.from - r.from), e = [];
|
|
277
277
|
for (const s of t) {
|
|
278
278
|
const r = e[e.length - 1];
|
|
@@ -289,10 +289,10 @@ function at(o) {
|
|
|
289
289
|
if (!Array.isArray(o)) return o;
|
|
290
290
|
const t = o, e = Ce.get(t);
|
|
291
291
|
if (e !== void 0) return e;
|
|
292
|
-
const n =
|
|
292
|
+
const n = ii(t);
|
|
293
293
|
return Ce.set(t, n), n;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function oi(o, t) {
|
|
296
296
|
const e = o.intervals;
|
|
297
297
|
let n = 0, i = e.length - 1, s = -1;
|
|
298
298
|
for (; n <= i; ) {
|
|
@@ -301,13 +301,13 @@ function ii(o, t) {
|
|
|
301
301
|
}
|
|
302
302
|
return s < 0 ? -1 : t <= e[s].to ? s : -1;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function It(o, t) {
|
|
305
305
|
const e = at(t);
|
|
306
306
|
if (e.intervals.length === 0) return o;
|
|
307
|
-
const n =
|
|
307
|
+
const n = oi(e, o);
|
|
308
308
|
return n < 0 ? Number.NaN : e.offsets[n] + (o - e.intervals[n].from);
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function At(o, t) {
|
|
311
311
|
const e = at(t), n = e.intervals;
|
|
312
312
|
if (n.length === 0) return o;
|
|
313
313
|
if (!(o >= 0) || o > e.total) return Number.NaN;
|
|
@@ -320,15 +320,15 @@ function It(o, t) {
|
|
|
320
320
|
}
|
|
321
321
|
return n[r].from + (o - e.offsets[r]);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function as(o, t, e, n) {
|
|
324
324
|
const i = at(o);
|
|
325
325
|
for (let s = 0; s < e; s++)
|
|
326
|
-
n[s] =
|
|
326
|
+
n[s] = It(t[s], i);
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function si(o, t) {
|
|
329
329
|
const e = at(t);
|
|
330
330
|
if (e.intervals.length === 0) return o;
|
|
331
|
-
const n =
|
|
331
|
+
const n = It(o, e);
|
|
332
332
|
if (!Number.isNaN(n)) return n;
|
|
333
333
|
if (!Number.isFinite(o)) return Number.NaN;
|
|
334
334
|
for (let i = 0; i < e.intervals.length; i++) {
|
|
@@ -337,11 +337,11 @@ function oi(o, t) {
|
|
|
337
337
|
}
|
|
338
338
|
return e.total;
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function ri(o, t) {
|
|
341
341
|
const e = at(t);
|
|
342
|
-
return e.intervals.length === 0 ? !1 : Number.isNaN(
|
|
342
|
+
return e.intervals.length === 0 ? !1 : Number.isNaN(It(o, e));
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function li(o) {
|
|
345
345
|
const t = at(o), e = [];
|
|
346
346
|
for (let n = 1; n < t.intervals.length; n++)
|
|
347
347
|
e.push({
|
|
@@ -351,8 +351,8 @@ function ri(o) {
|
|
|
351
351
|
});
|
|
352
352
|
return e;
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
354
|
+
function ai(o, t, e) {
|
|
355
|
+
return li(o).map((n) => n.workingTime).filter((n) => n >= t && n <= e);
|
|
356
356
|
}
|
|
357
357
|
const We = [
|
|
358
358
|
pt,
|
|
@@ -378,49 +378,49 @@ const We = [
|
|
|
378
378
|
14 * et,
|
|
379
379
|
28 * et
|
|
380
380
|
];
|
|
381
|
-
function
|
|
381
|
+
function ci(o, t) {
|
|
382
382
|
const e = We[0];
|
|
383
383
|
if (!Number.isFinite(o) || o <= 0) return e;
|
|
384
384
|
const n = o / Math.max(1, Math.floor(t));
|
|
385
385
|
for (const i of We) if (i >= n) return i;
|
|
386
386
|
return et * xt(n / et, 1);
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function cs(o) {
|
|
389
389
|
return new Date(o).getTimezoneOffset() * j;
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function ui(o, t, e, n, i = 0) {
|
|
392
392
|
const s = at(o), r = [];
|
|
393
393
|
if (!Number.isFinite(t) || !Number.isFinite(e) || !(n > 0)) return r;
|
|
394
394
|
const l = Math.ceil((t - i) / n), a = Math.floor((e - i) / n);
|
|
395
395
|
if (!Number.isFinite(l) || !Number.isFinite(a)) return r;
|
|
396
396
|
let c = Number.NaN;
|
|
397
397
|
for (let u = l; u <= a; u++) {
|
|
398
|
-
const f = i + u * n, h =
|
|
398
|
+
const f = i + u * n, h = It(f, s);
|
|
399
399
|
Number.isNaN(h) || h === c || (r.push({ wallClock: f, workingTime: h }), c = h);
|
|
400
400
|
}
|
|
401
401
|
return r;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function us(o, t, e, n, i = 0) {
|
|
404
404
|
const s = at(o);
|
|
405
405
|
if (s.intervals.length === 0 || !(e > t)) return [];
|
|
406
|
-
const r = Math.max(0, Math.min(s.total, t)), l = Math.max(0, Math.min(s.total, e)), a =
|
|
407
|
-
return
|
|
406
|
+
const r = Math.max(0, Math.min(s.total, t)), l = Math.max(0, Math.min(s.total, e)), a = ci(e - t, n);
|
|
407
|
+
return ui(
|
|
408
408
|
s,
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
At(r, s),
|
|
410
|
+
At(l, s),
|
|
411
411
|
a,
|
|
412
412
|
i
|
|
413
413
|
).map((u) => u.workingTime).filter((u) => u >= t && u <= e);
|
|
414
414
|
}
|
|
415
|
-
const He = 365 * et,
|
|
415
|
+
const He = 365 * et, hi = [
|
|
416
416
|
...[1, 2, 5, 10, 15, 30].map((o) => ({ unit: "minute", n: o, ms: o * j })),
|
|
417
417
|
...[1, 2, 3, 6, 12].map((o) => ({ unit: "hour", n: o, ms: o * gt })),
|
|
418
418
|
...[1, 2, 7, 14].map((o) => ({ unit: "day", n: o, ms: o * et })),
|
|
419
419
|
...[1, 2, 3, 6].map((o) => ({ unit: "month", n: o, ms: o * 30 * et }))
|
|
420
420
|
];
|
|
421
|
-
function
|
|
421
|
+
function di(o, t) {
|
|
422
422
|
const e = o / Math.max(1, Math.floor(t));
|
|
423
|
-
for (const i of
|
|
423
|
+
for (const i of hi) if (i.ms >= e) return i;
|
|
424
424
|
const n = Math.max(1, xt(e / He, 1));
|
|
425
425
|
return { unit: "year", n, ms: n * He };
|
|
426
426
|
}
|
|
@@ -451,36 +451,36 @@ function Re(o, t, e) {
|
|
|
451
451
|
}
|
|
452
452
|
return n;
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function fi(o, t, e) {
|
|
455
455
|
const n = we(t, e), i = Ut(n, e, 0);
|
|
456
456
|
return [Ut(we(o, e), e, 0), i < t ? Ut(n, e, 1) : i];
|
|
457
457
|
}
|
|
458
|
-
const
|
|
458
|
+
const xn = new Intl.DateTimeFormat("en-GB", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }), mi = new Intl.DateTimeFormat("en-GB", {
|
|
459
459
|
hour: "2-digit",
|
|
460
460
|
minute: "2-digit",
|
|
461
461
|
second: "2-digit",
|
|
462
462
|
hourCycle: "h23"
|
|
463
|
-
}),
|
|
463
|
+
}), bn = new Intl.DateTimeFormat("en-GB", { day: "numeric", month: "short" }), pi = new Intl.DateTimeFormat("en-GB", { day: "numeric", month: "short", year: "numeric" }), gi = new Intl.DateTimeFormat("en-GB", { month: "short", year: "numeric" }), yi = new Intl.DateTimeFormat("en-GB", { year: "numeric" });
|
|
464
464
|
function Ne(o, t = !1) {
|
|
465
|
-
return Number.isFinite(o) ? `${
|
|
465
|
+
return Number.isFinite(o) ? `${bn.format(o)} ${(t ? mi : xn).format(o)}` : "";
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function xi(o, t) {
|
|
468
468
|
return o.map((e, n) => {
|
|
469
469
|
const i = n === 0 ? void 0 : new Date(o[n - 1]), s = new Date(e);
|
|
470
470
|
switch (t.unit) {
|
|
471
471
|
case "minute":
|
|
472
472
|
case "hour":
|
|
473
|
-
return i === void 0 || i.toDateString() !== s.toDateString() ? Ne(e) :
|
|
473
|
+
return i === void 0 || i.toDateString() !== s.toDateString() ? Ne(e) : xn.format(e);
|
|
474
474
|
case "day":
|
|
475
|
-
return i === void 0 || i.getFullYear() !== s.getFullYear() ?
|
|
475
|
+
return i === void 0 || i.getFullYear() !== s.getFullYear() ? pi.format(e) : bn.format(e);
|
|
476
476
|
case "month":
|
|
477
|
-
return pi.format(e);
|
|
478
|
-
default:
|
|
479
477
|
return gi.format(e);
|
|
478
|
+
default:
|
|
479
|
+
return yi.format(e);
|
|
480
480
|
}
|
|
481
481
|
});
|
|
482
482
|
}
|
|
483
|
-
const qt = 5, Xt = 4, he = 8, _e = 4,
|
|
483
|
+
const qt = 5, Xt = 4, he = 8, _e = 4, bi = 8, yt = "uc-tick-label", zt = "uc-axis-title", vn = {
|
|
484
484
|
width: 0,
|
|
485
485
|
height: 0,
|
|
486
486
|
plot: { x: 0, y: 0, width: 0, height: 0 },
|
|
@@ -488,16 +488,16 @@ const qt = 5, Xt = 4, he = 8, _e = 4, xi = 8, yt = "uc-tick-label", zt = "uc-axi
|
|
|
488
488
|
};
|
|
489
489
|
function Be(o, t, e) {
|
|
490
490
|
const n = Math.ceil(t), i = e.get(o);
|
|
491
|
-
return i === void 0 || n > i || i - n >=
|
|
491
|
+
return i === void 0 || n > i || i - n >= bi ? (e.set(o, n), n) : i;
|
|
492
492
|
}
|
|
493
493
|
function ae(o) {
|
|
494
494
|
return o.calendar !== void 0 && o.calendar.length > 0 ? o.calendar : void 0;
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function kn(o) {
|
|
497
497
|
return o[1] - o[0] >= j;
|
|
498
498
|
}
|
|
499
499
|
function oe(o, t) {
|
|
500
|
-
return
|
|
500
|
+
return di(o[1] - o[0], t);
|
|
501
501
|
}
|
|
502
502
|
function de(o, t) {
|
|
503
503
|
const e = o.domainMode;
|
|
@@ -511,45 +511,45 @@ function de(o, t) {
|
|
|
511
511
|
if (s !== void 0 && s.length > 0)
|
|
512
512
|
return Bt(Math.min(n, ...s), Math.max(i, ...s));
|
|
513
513
|
if (o.time === !0) {
|
|
514
|
-
if (!
|
|
514
|
+
if (!kn([n, i])) return Bt(n, i);
|
|
515
515
|
const r = oe([n, i], t);
|
|
516
|
-
return
|
|
516
|
+
return fi(n, i, r.unit === "minute" ? r : { ...r, n: 1, ms: r.ms / r.n });
|
|
517
517
|
}
|
|
518
|
-
return
|
|
518
|
+
return ti(n, i, t);
|
|
519
519
|
}
|
|
520
520
|
function Ve(o, t, e) {
|
|
521
521
|
const n = ae(o);
|
|
522
522
|
if (o.tickValues !== void 0)
|
|
523
|
-
return (n !== void 0 ? o.tickValues.map((s) =>
|
|
523
|
+
return (n !== void 0 ? o.tickValues.map((s) => It(s, n)) : o.tickValues).filter((s) => s >= t[0] && s <= t[1]);
|
|
524
524
|
if (n !== void 0) {
|
|
525
|
-
const i = at(n), s = (l) =>
|
|
525
|
+
const i = at(n), s = (l) => At(Math.min(Math.max(l, 0), i.total), i), r = [];
|
|
526
526
|
for (const l of Re(s(t[0]), s(t[1]), oe(t, e))) {
|
|
527
|
-
const a =
|
|
527
|
+
const a = It(l, i);
|
|
528
528
|
Number.isNaN(a) || a === r[r.length - 1] || a >= t[0] && a <= t[1] && r.push(a);
|
|
529
529
|
}
|
|
530
530
|
return r;
|
|
531
531
|
}
|
|
532
|
-
return o.time === !0 ?
|
|
532
|
+
return o.time === !0 ? kn(t) ? Re(t[0], t[1], oe(t, e)) : [] : pn(t[0], t[1], e);
|
|
533
533
|
}
|
|
534
534
|
function ze(o, t, e) {
|
|
535
535
|
const n = o.tickFormat, i = ae(o);
|
|
536
536
|
if (i !== void 0)
|
|
537
|
-
return n !== void 0 ? (r) => n(
|
|
537
|
+
return n !== void 0 ? (r) => n(At(r, i)) : (r, l) => Ne(At(r, i), l);
|
|
538
538
|
if (n !== void 0) return (r) => n(r);
|
|
539
539
|
if (o.time === !0) return Ne;
|
|
540
540
|
const s = xt(Math.abs(t[1] - t[0]), e);
|
|
541
|
-
return (r) =>
|
|
541
|
+
return (r) => yn(r, s);
|
|
542
542
|
}
|
|
543
543
|
function Ye(o, t, e, n, i) {
|
|
544
544
|
const s = ae(o);
|
|
545
545
|
if (o.tickFormat !== void 0 || o.time !== !0 && s === void 0) return n.map(i);
|
|
546
|
-
const r = s === void 0 ? n : n.map((l) =>
|
|
547
|
-
return
|
|
546
|
+
const r = s === void 0 ? n : n.map((l) => At(l, s));
|
|
547
|
+
return xi(r, oe(t, e));
|
|
548
548
|
}
|
|
549
|
-
function
|
|
549
|
+
function wn(o, t, e) {
|
|
550
550
|
return Math.min(Math.max(o, 0), Math.max(0, e - t));
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function vi(o, t) {
|
|
553
553
|
const e = o.split(" ");
|
|
554
554
|
let n = o, i = Number.POSITIVE_INFINITY;
|
|
555
555
|
for (let s = 1; s < e.length; s++) {
|
|
@@ -559,15 +559,15 @@ ${l}`);
|
|
|
559
559
|
}
|
|
560
560
|
return n;
|
|
561
561
|
}
|
|
562
|
-
const
|
|
562
|
+
const ki = 0.2, wi = 8;
|
|
563
563
|
function Yt(o) {
|
|
564
564
|
for (let t = 1; t < o.length; t++) {
|
|
565
565
|
const e = o[t - 1];
|
|
566
|
-
if (e.labelLeft + e.labelWidth +
|
|
566
|
+
if (e.labelLeft + e.labelWidth + wi > o[t].labelLeft) return !1;
|
|
567
567
|
}
|
|
568
568
|
return !0;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function Ni(o, t) {
|
|
571
571
|
const e = o.map((s, r) => r).sort((s, r) => o[s] - o[r]), n = [];
|
|
572
572
|
for (const s of e)
|
|
573
573
|
for (n.push({ members: [s], start: o[s] }); ; ) {
|
|
@@ -581,7 +581,7 @@ function wi(o, t) {
|
|
|
581
581
|
for (const s of n) s.members.forEach((r, l) => i[r] = s.start + l * t);
|
|
582
582
|
return i;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function Ii(o) {
|
|
585
585
|
const t = new Map(o.hysteresis), e = Ke(o, t, null);
|
|
586
586
|
if (e.wrapped.size === 0) {
|
|
587
587
|
for (const [n, i] of t) o.hysteresis.set(n, i);
|
|
@@ -590,10 +590,10 @@ function Ni(o) {
|
|
|
590
590
|
return Ke(o, o.hysteresis, e.wrapped).layout;
|
|
591
591
|
}
|
|
592
592
|
function Ke(o, t, e) {
|
|
593
|
-
const { width: n, height: i, padding: s, axes: r, measure: l } = o, a = /* @__PURE__ */ new Set(), c = r.filter((k) => k.position === "left"), u = r.filter((k) => k.position === "right"), f = r.filter((k) => k.position === "top"), h = r.filter((k) => k.position === "bottom"),
|
|
593
|
+
const { width: n, height: i, padding: s, axes: r, measure: l } = o, a = /* @__PURE__ */ new Set(), c = r.filter((k) => k.position === "left"), u = r.filter((k) => k.position === "right"), f = r.filter((k) => k.position === "top"), h = r.filter((k) => k.position === "bottom"), p = Math.ceil(l("0", yt).height) || 14, g = /* @__PURE__ */ new Map();
|
|
594
594
|
for (const k of [...f, ...h]) {
|
|
595
595
|
const T = k.label === void 0 || k.label === "" ? 0 : Math.ceil(l(k.label, zt).height) + _e, A = (e == null ? void 0 : e.has(k.key)) === !0 ? 2 : 1;
|
|
596
|
-
|
|
596
|
+
g.set(k.key, Be(k.key, qt + Xt + A * p + T, t));
|
|
597
597
|
}
|
|
598
598
|
const d = (k, T) => {
|
|
599
599
|
let A = 0;
|
|
@@ -602,20 +602,20 @@ function Ke(o, t, e) {
|
|
|
602
602
|
E !== void 0 && (A += T.get(E.key) ?? 0, $ > 0 && (A += he));
|
|
603
603
|
}
|
|
604
604
|
return A;
|
|
605
|
-
}, m = s.top + d(f,
|
|
605
|
+
}, m = s.top + d(f, g), y = i - s.bottom - d(h, g), v = Math.max(0, y - m), b = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), M = r.find((k) => k.orientation === "y");
|
|
606
606
|
for (const k of [...c, ...u].sort((T, A) => T === M ? -1 : A === M ? 1 : 0)) {
|
|
607
|
-
const T = k.tickCount ?? Math.max(2, Math.round(v / 50)), A = M === void 0 ? void 0 : b.get(M.key), [$, E] = Array.isArray(k.domainMode) ? de(k, T) : k.extent, S = k.alignTicks === !0 && k !== M && A !== void 0 ?
|
|
607
|
+
const T = k.tickCount ?? Math.max(2, Math.round(v / 50)), A = M === void 0 ? void 0 : b.get(M.key), [$, E] = Array.isArray(k.domainMode) ? de(k, T) : k.extent, S = k.alignTicks === !0 && k !== M && A !== void 0 ? ei($, E, A.domain, A.values) : null, W = (S == null ? void 0 : S.domain) ?? de(k, T), C = (S == null ? void 0 : S.ticks) ?? Ve(k, W, T), Q = S === null ? ze(k, W, T) : k.tickFormat ?? ((Y) => yn(Y, S.step)), U = Ye(k, W, T, C, Q), O = U.map((Y) => l(Y, yt).width);
|
|
608
608
|
let H = 0;
|
|
609
609
|
for (const Y of O) Y > H && (H = Y);
|
|
610
610
|
let q = 0;
|
|
611
611
|
for (const Y of k.limitLabels ?? []) q = Math.max(q, l(Y, yt).width + 4);
|
|
612
|
-
const P = k.label === void 0 || k.label === "" ? 0 : Math.ceil(l(k.label, zt).height) + _e, z = q > H && qt + Xt + q + P > n *
|
|
613
|
-
z || (H = Math.max(H, q)), b.set(k.key, { axis: k, domain: W, values: C, labels: U, widths: O, format: Q, limitsInside: z }),
|
|
612
|
+
const P = k.label === void 0 || k.label === "" ? 0 : Math.ceil(l(k.label, zt).height) + _e, z = q > H && qt + Xt + q + P > n * ki;
|
|
613
|
+
z || (H = Math.max(H, q)), b.set(k.key, { axis: k, domain: W, values: C, labels: U, widths: O, format: Q, limitsInside: z }), I.set(
|
|
614
614
|
k.key,
|
|
615
615
|
Be(k.key, qt + Xt + H + P, t)
|
|
616
616
|
);
|
|
617
617
|
}
|
|
618
|
-
const F = s.left + d(c,
|
|
618
|
+
const F = s.left + d(c, I), w = n - s.right - d(u, I), L = Math.max(0, w - F), D = { x: F, y: m, width: L, height: v }, G = (k, T, A, $) => {
|
|
619
619
|
switch (k.position) {
|
|
620
620
|
case "left":
|
|
621
621
|
return { x: F - A - $, y: m, width: $, height: v };
|
|
@@ -626,10 +626,10 @@ function Ke(o, t, e) {
|
|
|
626
626
|
default:
|
|
627
627
|
return { x: F, y: y + A, width: L, height: $ };
|
|
628
628
|
}
|
|
629
|
-
},
|
|
629
|
+
}, _ = [], Z = (k) => {
|
|
630
630
|
let T = 0;
|
|
631
631
|
k.forEach((A, $) => {
|
|
632
|
-
const E =
|
|
632
|
+
const E = I.get(A.key) ?? 0, S = b.get(A.key), W = G(A, $, T, E);
|
|
633
633
|
T += E + he;
|
|
634
634
|
const C = (S == null ? void 0 : S.domain) ?? [0, 1], Q = (S == null ? void 0 : S.format) ?? ((H) => String(H)), U = new Oe(C, [m + v, m]), O = ((S == null ? void 0 : S.values) ?? []).map((H, q) => ({
|
|
635
635
|
value: H,
|
|
@@ -638,7 +638,7 @@ function Ke(o, t, e) {
|
|
|
638
638
|
labelLeft: 0,
|
|
639
639
|
labelWidth: (S == null ? void 0 : S.widths[q]) ?? 0
|
|
640
640
|
}));
|
|
641
|
-
|
|
641
|
+
_.push({
|
|
642
642
|
key: A.key,
|
|
643
643
|
id: A.id,
|
|
644
644
|
orientation: "y",
|
|
@@ -662,13 +662,13 @@ function Ke(o, t, e) {
|
|
|
662
662
|
const X = (k) => {
|
|
663
663
|
let T = 0;
|
|
664
664
|
k.forEach((A, $) => {
|
|
665
|
-
const E =
|
|
665
|
+
const E = g.get(A.key) ?? 0, S = G(A, $, T, E);
|
|
666
666
|
T += E + he;
|
|
667
667
|
let W = A.tickCount ?? Math.max(2, Math.round(L / 80));
|
|
668
668
|
const C = de(A, W), Q = new Oe(C, [F, F + L]), U = (P, z, Y = !1) => {
|
|
669
|
-
const ct = Ve(A, C, P), ut = ct.filter((ht, rt) => rt % z === 0), Rt = ze(A, C, P), _t = Ye(A, C, P, ut, Rt), mt = Y ? _t.map((ht) =>
|
|
670
|
-
const vt = mt[rt] ?? "", kt = l(vt, yt).width,
|
|
671
|
-
return { value: ht, label: vt, px:
|
|
669
|
+
const ct = Ve(A, C, P), ut = ct.filter((ht, rt) => rt % z === 0), Rt = ze(A, C, P), _t = Ye(A, C, P, ut, Rt), mt = Y ? _t.map((ht) => vi(ht, (rt) => l(rt, yt).width)) : _t, st = ut.map((ht, rt) => {
|
|
670
|
+
const vt = mt[rt] ?? "", kt = l(vt, yt).width, St = Q.toPx(ht), Wn = wn(St - kt / 2, kt, n);
|
|
671
|
+
return { value: ht, label: vt, px: St, labelLeft: Wn, labelWidth: kt };
|
|
672
672
|
});
|
|
673
673
|
return { format: Rt, ticks: st, total: ct.length };
|
|
674
674
|
};
|
|
@@ -699,7 +699,7 @@ function Ke(o, t, e) {
|
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
701
|
const { format: H, ticks: q } = O;
|
|
702
|
-
|
|
702
|
+
_.push({
|
|
703
703
|
key: A.key,
|
|
704
704
|
id: A.id,
|
|
705
705
|
orientation: "x",
|
|
@@ -714,30 +714,30 @@ function Ke(o, t, e) {
|
|
|
714
714
|
ticks: q,
|
|
715
715
|
format: H,
|
|
716
716
|
titleSize: A.label === void 0 || A.label === "" ? 0 : Math.ceil(l(A.label, zt).height),
|
|
717
|
-
breaks: A.calendar === void 0 || A.calendar.length === 0 ? [] :
|
|
717
|
+
breaks: A.calendar === void 0 || A.calendar.length === 0 ? [] : ai(A.calendar, C[0], C[1]).map((P) => Q.toPx(P)),
|
|
718
718
|
limitsInside: !1
|
|
719
719
|
});
|
|
720
720
|
});
|
|
721
721
|
};
|
|
722
|
-
return X(f), X(h), { layout: { width: n, height: i, plot: D, axes:
|
|
722
|
+
return X(f), X(h), { layout: { width: n, height: i, plot: D, axes: _ }, wrapped: a };
|
|
723
723
|
}
|
|
724
|
-
const Ge = [[], [7, 4], [1, 4], [7, 3, 1, 3], [14, 4], [7, 3, 1, 3, 1, 3]],
|
|
725
|
-
function
|
|
726
|
-
const t =
|
|
727
|
-
return { dash: Ge[t], marker:
|
|
724
|
+
const Ge = [[], [7, 4], [1, 4], [7, 3, 1, 3], [14, 4], [7, 3, 1, 3, 1, 3]], Ai = ["circle", "square", "triangle", "diamond", "triangleDown", "plus"], Ie = ["none", "rising", "falling", "horizontal", "vertical", "crossed"];
|
|
725
|
+
function Ti(o) {
|
|
726
|
+
const t = Nn(o, Ge.length);
|
|
727
|
+
return { dash: Ge[t], marker: Ai[t], hatch: Ie[t] };
|
|
728
728
|
}
|
|
729
729
|
function Qt(o) {
|
|
730
|
-
return Ie[
|
|
730
|
+
return Ie[Nn(o, Ie.length)];
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function Mi(o) {
|
|
733
733
|
const t = /* @__PURE__ */ new Map();
|
|
734
734
|
for (const e of o) for (const { label: n } of e) t.has(n) || t.set(n, Qt(t.size));
|
|
735
735
|
return t;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function Nn(o, t) {
|
|
738
738
|
return (o % t + t) % t;
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function In(o, t, e) {
|
|
741
741
|
const n = [];
|
|
742
742
|
if (t === "none" || !(e > 0) || !(o.width > 0) || !(o.height > 0)) return n;
|
|
743
743
|
const { x: i, y: s, width: r, height: l } = o, a = (c) => Math.ceil(c / e) * e;
|
|
@@ -787,14 +787,14 @@ function Ue(o, t, e) {
|
|
|
787
787
|
}
|
|
788
788
|
return n;
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function An(o, t, e, n) {
|
|
791
791
|
return e + 1 < t ? o[e + 1] : n;
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function Si(o, t, e, n, i) {
|
|
794
794
|
const s = o[t - 1], r = e > s ? e : n > 0 ? s + n : i;
|
|
795
795
|
return Math.min(r, i);
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function Li(o, t) {
|
|
798
798
|
const e = [];
|
|
799
799
|
for (let n = 1; n < t; n++) {
|
|
800
800
|
const i = o[n] - o[n - 1];
|
|
@@ -805,7 +805,7 @@ function Si(o, t) {
|
|
|
805
805
|
function tt(o) {
|
|
806
806
|
return Math.round(o) + 0.5;
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function Ei(o, t) {
|
|
809
809
|
const { plot: e, axes: n, theme: i } = t, s = e.x, r = e.x + e.width, l = e.y, a = e.y + e.height;
|
|
810
810
|
o.lineWidth = 1;
|
|
811
811
|
for (const c of n)
|
|
@@ -814,58 +814,58 @@ function Li(o, t) {
|
|
|
814
814
|
const f = u === 1;
|
|
815
815
|
o.beginPath();
|
|
816
816
|
let h = !1;
|
|
817
|
-
for (const
|
|
818
|
-
if ((c.orientation === "y" &&
|
|
817
|
+
for (const p of c.ticks)
|
|
818
|
+
if ((c.orientation === "y" && p.value === 0) === f)
|
|
819
819
|
if (h = !0, c.orientation === "y") {
|
|
820
|
-
const d = tt(
|
|
820
|
+
const d = tt(p.px);
|
|
821
821
|
o.moveTo(s, d), o.lineTo(r, d);
|
|
822
822
|
} else {
|
|
823
|
-
const d = tt(
|
|
823
|
+
const d = tt(p.px);
|
|
824
824
|
o.moveTo(d, l), o.lineTo(d, a);
|
|
825
825
|
}
|
|
826
826
|
h && (o.strokeStyle = f ? i.colorAxis : i.colorGrid, o.stroke());
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
|
-
const
|
|
830
|
-
function
|
|
829
|
+
const Fi = 6;
|
|
830
|
+
function Mt(o, t, e, n, i) {
|
|
831
831
|
if (n === "none") return;
|
|
832
|
-
const s =
|
|
832
|
+
const s = In(e, n, Fi), r = new Path2D();
|
|
833
833
|
for (let l = 0; l < s.length; l += 4)
|
|
834
834
|
r.moveTo(s[l], s[l + 1]), r.lineTo(s[l + 2], s[l + 3]);
|
|
835
835
|
o.save(), o.clip(t), o.strokeStyle = i, o.lineWidth = 1, o.setLineDash([]), o.stroke(r), o.restore();
|
|
836
836
|
}
|
|
837
|
-
const
|
|
838
|
-
function
|
|
837
|
+
const Di = 60;
|
|
838
|
+
function Pi(o, t, e) {
|
|
839
839
|
return (e === 0 || Number.isNaN(o[e - 1])) && (e === t - 1 || Number.isNaN(o[e + 1]));
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function Tn(o, t, e) {
|
|
842
842
|
return t >= o.x - 0.5 && t <= o.x + o.width + 0.5 && e >= o.y - 0.5 && e <= o.y + o.height + 0.5;
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function $i(o, t, e, n) {
|
|
845
845
|
const i = t.length, s = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, u = t.y, f = t.step === !0, h = new Path2D();
|
|
846
|
-
let
|
|
846
|
+
let p = !1, g = 0;
|
|
847
847
|
for (let d = 0; d < i; d++) {
|
|
848
848
|
const m = u[d], y = c[d] * s + r;
|
|
849
849
|
if (Number.isNaN(m)) {
|
|
850
|
-
f &&
|
|
850
|
+
f && p && h.lineTo(y, g), p = !1;
|
|
851
851
|
continue;
|
|
852
852
|
}
|
|
853
853
|
const v = m * l + a;
|
|
854
|
-
|
|
854
|
+
p ? (f && h.lineTo(y, g), h.lineTo(y, v)) : (h.moveTo(y, v), p = !0), g = v;
|
|
855
855
|
}
|
|
856
856
|
if (o.strokeStyle = t.color, o.lineWidth = t.strokeWidth, t.dash !== void 0 && t.dash.length > 0 ? o.setLineDash(t.dash) : o.setLineDash([]), o.stroke(h), o.setLineDash([]), t.markers !== "never") {
|
|
857
|
-
const d = t.markers === "always" || i <=
|
|
857
|
+
const d = t.markers === "always" || i <= Di, m = t.strokeWidth + 1.5, y = t.marker ?? "circle", v = new Path2D();
|
|
858
858
|
for (let b = 0; b < i; b++) {
|
|
859
|
-
const
|
|
860
|
-
if (Number.isNaN(
|
|
861
|
-
const M = c[b] * s + r, F =
|
|
862
|
-
|
|
859
|
+
const I = u[b];
|
|
860
|
+
if (Number.isNaN(I) || !d && !Pi(u, i, b)) continue;
|
|
861
|
+
const M = c[b] * s + r, F = I * l + a;
|
|
862
|
+
Tn(e, M, F) && Ee(v, y, M, F, m);
|
|
863
863
|
}
|
|
864
864
|
n.push({ path: v, color: t.color, alpha: t.alpha });
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
|
-
function
|
|
868
|
-
const i = t.length, s = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, u = t.y, f = t.y0, h = t.baseline * l + a,
|
|
867
|
+
function Oi(o, t, e, n) {
|
|
868
|
+
const i = t.length, s = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, u = t.y, f = t.y0, h = t.baseline * l + a, p = new Path2D(), g = new Path2D(), d = new Path2D();
|
|
869
869
|
let m = 0;
|
|
870
870
|
for (; m < i; ) {
|
|
871
871
|
for (; m < i && (Number.isNaN(u[m]) || f !== null && Number.isNaN(f[m])); )
|
|
@@ -881,99 +881,99 @@ function $i(o, t, e, n) {
|
|
|
881
881
|
continue;
|
|
882
882
|
}
|
|
883
883
|
for (let b = y; b <= v; b++) {
|
|
884
|
-
const
|
|
885
|
-
b === y ? (
|
|
884
|
+
const I = c[b] * s + r, M = u[b] * l + a;
|
|
885
|
+
b === y ? (p.moveTo(I, M), g.moveTo(I, M)) : (p.lineTo(I, M), g.lineTo(I, M));
|
|
886
886
|
}
|
|
887
887
|
if (f === null)
|
|
888
|
-
|
|
888
|
+
p.lineTo(c[v] * s + r, h), p.lineTo(c[y] * s + r, h);
|
|
889
889
|
else
|
|
890
890
|
for (let b = v; b >= y; b--)
|
|
891
|
-
|
|
892
|
-
|
|
891
|
+
p.lineTo(c[b] * s + r, f[b] * l + a);
|
|
892
|
+
p.closePath();
|
|
893
893
|
}
|
|
894
|
-
o.globalAlpha = t.alpha * t.fillOpacity, o.fillStyle = t.color, o.fill(
|
|
894
|
+
o.globalAlpha = t.alpha * t.fillOpacity, o.fillStyle = t.color, o.fill(p), o.globalAlpha = t.alpha, Mt(o, p, e, t.hatch ?? "none", t.color), t.edges === !0 && (o.setLineDash([]), o.strokeStyle = n, o.lineWidth = t.strokeWidth + 2, o.stroke(g)), o.strokeStyle = t.color, t.strokeWidth > 0 && (o.setLineDash(t.dash ?? []), o.lineWidth = t.strokeWidth, o.stroke(g)), o.setLineDash([]), o.lineWidth = Math.max(1, t.strokeWidth), o.stroke(d);
|
|
895
895
|
}
|
|
896
|
-
function
|
|
897
|
-
const i = t.length, s = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, u = t.y, f = t.y0, h = t.baseline * l + a,
|
|
896
|
+
function Ci(o, t, e, n) {
|
|
897
|
+
const i = t.length, s = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, u = t.y, f = t.y0, h = t.baseline * l + a, p = t.offset * s, g = t.width * s, d = new Path2D(), m = t.edges === !0 && f !== null ? new Path2D() : null;
|
|
898
898
|
for (let y = 0; y < i; y++) {
|
|
899
899
|
const v = u[y];
|
|
900
900
|
if (Number.isNaN(v)) continue;
|
|
901
|
-
const b = c[y] * s + r +
|
|
902
|
-
d.rect(b,
|
|
901
|
+
const b = c[y] * s + r + p, I = v * l + a, M = f === null ? h : f[y] * l + a;
|
|
902
|
+
d.rect(b, I, g, M - I), m !== null && (f == null ? void 0 : f[y]) !== 0 && (m.moveTo(b, M), m.lineTo(b + g, M));
|
|
903
903
|
}
|
|
904
|
-
o.fillStyle = t.color, o.fill(d),
|
|
904
|
+
o.fillStyle = t.color, o.fill(d), Mt(o, d, e, t.hatch ?? "none", n), m !== null && (o.strokeStyle = n, o.lineWidth = 1, o.setLineDash([]), o.stroke(m));
|
|
905
905
|
}
|
|
906
|
-
const
|
|
907
|
-
function
|
|
908
|
-
const n = t.length, i = t.xScale.m, s = t.xScale.b, r = t.yScale.m, l = t.yScale.b, a = t.x, c = t.y, { lowerQuartile: u, upperQuartile: f, lowerWhisker: h, upperWhisker:
|
|
906
|
+
const Wi = 0.18, Hi = 2, qe = 3, dt = 3.5, Ri = 1.5, _i = 0.2, Bi = 3, Xe = 3;
|
|
907
|
+
function Vi(o, t, e) {
|
|
908
|
+
const n = t.length, i = t.xScale.m, s = t.xScale.b, r = t.yScale.m, l = t.yScale.b, a = t.x, c = t.y, { lowerQuartile: u, upperQuartile: f, lowerWhisker: h, upperWhisker: p, outliers: g, outlierOffsets: d, mean: m, notchLower: y, notchUpper: v } = t.box, b = t.offset * i, I = t.width * i, M = I > 4 * Xe ? Xe / 2 : 0, F = (t.offset + t.width / 2) * i, w = new Path2D(), L = new Path2D(), D = new Path2D(), G = new Path2D(), _ = new Path2D(), Z = new Path2D();
|
|
909
909
|
for (let T = 0; T < n; T++) {
|
|
910
910
|
const A = c[T];
|
|
911
911
|
if (Number.isNaN(A)) continue;
|
|
912
|
-
const $ = a[T] * i + s + b, E = tt($ + M), S = Math.round($ +
|
|
912
|
+
const $ = a[T] * i + s + b, E = tt($ + M), S = Math.round($ + I - M) - 0.5, W = S - E, C = tt(a[T] * i + s + F), Q = W / 4, U = W * _i, O = tt(u[T] * r + l), H = tt(f[T] * r + l), q = Math.round(A * r + l), P = y === null ? Number.NaN : y[T] * r + l, z = v === null ? Number.NaN : v[T] * r + l, Y = !Number.isNaN(P) && !Number.isNaN(z);
|
|
913
913
|
!Number.isNaN(O) && !Number.isNaN(H) && (Y ? (w.moveTo(E, H), w.lineTo(E, z), w.lineTo(E + U, q), w.lineTo(E, P), w.lineTo(E, O), w.lineTo(S, O), w.lineTo(S, P), w.lineTo(S - U, q), w.lineTo(S, z), w.lineTo(S, H), w.closePath()) : w.rect(E, H, W, O - H));
|
|
914
914
|
const ct = Y ? U : 0;
|
|
915
915
|
L.moveTo(E + ct, q), L.lineTo(S - ct, q);
|
|
916
916
|
const ut = m === null ? Number.NaN : m[T] * r + l;
|
|
917
|
-
Number.isNaN(ut) || (
|
|
918
|
-
const Rt = tt(h[T] * r + l), _t = tt(
|
|
917
|
+
Number.isNaN(ut) || (_.moveTo(C - dt, ut - dt), _.lineTo(C + dt, ut + dt), _.moveTo(C - dt, ut + dt), _.lineTo(C + dt, ut - dt));
|
|
918
|
+
const Rt = tt(h[T] * r + l), _t = tt(p[T] * r + l);
|
|
919
919
|
for (const [mt, st] of [[H, _t], [O, Rt]])
|
|
920
920
|
Number.isNaN(mt) || Number.isNaN(st) || (D.moveTo(C, mt), D.lineTo(C, st), D.moveTo(C - Q, st), D.lineTo(C + Q, st));
|
|
921
|
-
if (
|
|
922
|
-
const mt = u[T], st = f[T], ht =
|
|
921
|
+
if (g !== null && d !== null) {
|
|
922
|
+
const mt = u[T], st = f[T], ht = Bi * (st - mt);
|
|
923
923
|
for (let rt = d[T]; rt < d[T + 1]; rt++) {
|
|
924
|
-
const vt =
|
|
925
|
-
kt.moveTo(C + qe,
|
|
924
|
+
const vt = g[rt], kt = vt > st + ht || vt < mt - ht ? Z : G, St = vt * r + l;
|
|
925
|
+
kt.moveTo(C + qe, St), kt.arc(C, St, qe, 0, Math.PI * 2);
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
929
|
const X = o.globalAlpha, k = o.lineCap;
|
|
930
|
-
o.globalAlpha = X *
|
|
930
|
+
o.globalAlpha = X * Wi, o.fillStyle = t.color, o.fill(w), o.globalAlpha = X, Mt(o, w, e, t.hatch ?? "none", t.color), o.strokeStyle = t.color, o.setLineDash([]), o.lineCap = "butt", o.lineWidth = 1, o.stroke(w), o.stroke(D), o.stroke(Z), o.lineWidth = Ri, o.stroke(_), o.lineWidth = 1, o.fillStyle = t.color, o.fill(G), o.lineWidth = Hi, o.stroke(L), o.lineCap = k;
|
|
931
931
|
}
|
|
932
|
-
function
|
|
932
|
+
function zi(o, t, e) {
|
|
933
933
|
const n = o.length, i = o.xScale.m, s = o.xScale.b, r = o.yScale.m, l = o.yScale.b, a = o.x, c = o.y, u = o.radius, f = o.marker ?? "circle", h = new Path2D();
|
|
934
|
-
for (let
|
|
935
|
-
const
|
|
936
|
-
if (Number.isNaN(
|
|
937
|
-
const d = a[
|
|
938
|
-
|
|
934
|
+
for (let p = 0; p < n; p++) {
|
|
935
|
+
const g = c[p];
|
|
936
|
+
if (Number.isNaN(g)) continue;
|
|
937
|
+
const d = a[p] * i + s, m = g * r + l;
|
|
938
|
+
Tn(t, d, m) && Ee(h, f, d, m, u);
|
|
939
939
|
}
|
|
940
940
|
e.push({ path: h, color: o.color, alpha: o.alpha });
|
|
941
941
|
}
|
|
942
|
-
function
|
|
943
|
-
var
|
|
942
|
+
function Yi(o, t, e, n) {
|
|
943
|
+
var g;
|
|
944
944
|
const i = t.length, s = t.xScale.m, r = t.xScale.b, l = t.x, a = t.y, c = t.laneTop, u = t.laneBottom - t.laneTop, f = t.colors.length;
|
|
945
945
|
if (f === 0 || u <= 0) return;
|
|
946
946
|
const h = [];
|
|
947
947
|
for (let d = 0; d < f; d++) h.push(new Path2D());
|
|
948
|
-
let
|
|
948
|
+
let p = !1;
|
|
949
949
|
for (let d = 0; d < i; d++) {
|
|
950
950
|
const m = a[d];
|
|
951
951
|
if (Number.isNaN(m)) continue;
|
|
952
952
|
const y = m | 0, v = h[y];
|
|
953
953
|
if (v === void 0) continue;
|
|
954
|
-
const b = l[d],
|
|
955
|
-
|
|
954
|
+
const b = l[d], I = An(l, i, d, t.lastEnd);
|
|
955
|
+
I > b && (v.rect(b * s + r, c, (I - b) * s, u), p = !0);
|
|
956
956
|
}
|
|
957
|
-
if (
|
|
957
|
+
if (p)
|
|
958
958
|
for (let d = 0; d < f; d++)
|
|
959
|
-
o.fillStyle = t.colors[d], o.fill(h[d]),
|
|
959
|
+
o.fillStyle = t.colors[d], o.fill(h[d]), Mt(o, h[d], e, ((g = t.hatches) == null ? void 0 : g[d]) ?? "none", n);
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function Ki(o, t, e, n) {
|
|
962
962
|
var m;
|
|
963
963
|
const i = t.length, s = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, u = t.y, f = t.buckets, h = t.colors.length;
|
|
964
964
|
if (h === 0) return;
|
|
965
|
-
const
|
|
965
|
+
const p = t.width * s, g = Math.abs(t.height * l), d = [];
|
|
966
966
|
for (let y = 0; y < h; y++) d.push(new Path2D());
|
|
967
967
|
for (let y = 0; y < i; y++) {
|
|
968
968
|
const v = f[y];
|
|
969
969
|
if (v < 0) continue;
|
|
970
970
|
const b = d[v];
|
|
971
971
|
if (b === void 0) continue;
|
|
972
|
-
const
|
|
973
|
-
b.rect(
|
|
972
|
+
const I = c[y] * s + r - p / 2, M = u[y] * l + a - g / 2;
|
|
973
|
+
b.rect(I, M, p, g);
|
|
974
974
|
}
|
|
975
975
|
for (let y = 0; y < h; y++)
|
|
976
|
-
o.fillStyle = t.colors[y], o.fill(d[y]),
|
|
976
|
+
o.fillStyle = t.colors[y], o.fill(d[y]), Mt(o, d[y], e, ((m = t.hatches) == null ? void 0 : m[y]) ?? "none", n);
|
|
977
977
|
}
|
|
978
978
|
function Qe(o, t, e) {
|
|
979
979
|
for (const n of e) {
|
|
@@ -984,7 +984,7 @@ function Qe(o, t, e) {
|
|
|
984
984
|
continue;
|
|
985
985
|
}
|
|
986
986
|
const r = new Path2D();
|
|
987
|
-
n.orientation === "y" ? r.rect(t.x, i, t.width, s - i) : r.rect(i, t.y, s - i, t.height), o.fill(r), o.globalAlpha = 0.5,
|
|
987
|
+
n.orientation === "y" ? r.rect(t.x, i, t.width, s - i) : r.rect(i, t.y, s - i, t.height), o.fill(r), o.globalAlpha = 0.5, Mt(o, r, t, "rising", n.color), o.restore();
|
|
988
988
|
continue;
|
|
989
989
|
}
|
|
990
990
|
if (o.beginPath(), n.orientation === "y") {
|
|
@@ -997,35 +997,35 @@ function Qe(o, t, e) {
|
|
|
997
997
|
o.strokeStyle = n.color, o.lineWidth = 1, o.setLineDash(n.dash), o.stroke(), o.setLineDash([]);
|
|
998
998
|
}
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function Gi(o, t) {
|
|
1001
1001
|
const { width: e, height: n, plot: i, series: s } = t;
|
|
1002
1002
|
if (o.clearRect(0, 0, e, n), i.width <= 0 || i.height <= 0) return;
|
|
1003
|
-
|
|
1003
|
+
Ei(o, t), o.save(), o.beginPath(), o.rect(i.x, i.y, i.width, i.height), o.clip(), o.lineJoin = "round", o.lineCap = "round";
|
|
1004
1004
|
const r = [];
|
|
1005
1005
|
o.globalAlpha = 1, Qe(o, i, t.limitBands);
|
|
1006
1006
|
for (const l of s)
|
|
1007
1007
|
if (l.length !== 0)
|
|
1008
1008
|
switch (o.globalAlpha = l.alpha, l.kind) {
|
|
1009
1009
|
case "line":
|
|
1010
|
-
|
|
1010
|
+
$i(o, l, i, r);
|
|
1011
1011
|
break;
|
|
1012
1012
|
case "area":
|
|
1013
|
-
|
|
1013
|
+
Oi(o, l, i, t.theme.colorBg);
|
|
1014
1014
|
break;
|
|
1015
1015
|
case "bar":
|
|
1016
|
-
|
|
1016
|
+
Ci(o, l, i, t.theme.colorBg);
|
|
1017
1017
|
break;
|
|
1018
1018
|
case "box":
|
|
1019
|
-
|
|
1019
|
+
Vi(o, l, i);
|
|
1020
1020
|
break;
|
|
1021
1021
|
case "scatter":
|
|
1022
|
-
|
|
1022
|
+
zi(l, i, r);
|
|
1023
1023
|
break;
|
|
1024
1024
|
case "state":
|
|
1025
|
-
|
|
1025
|
+
Yi(o, l, i, t.theme.colorBg);
|
|
1026
1026
|
break;
|
|
1027
1027
|
case "matrix":
|
|
1028
|
-
|
|
1028
|
+
Ki(o, l, i, t.theme.colorBg);
|
|
1029
1029
|
break;
|
|
1030
1030
|
}
|
|
1031
1031
|
o.globalAlpha = 1, Qe(o, i, t.limitLines), o.restore();
|
|
@@ -1033,7 +1033,7 @@ function Ki(o, t) {
|
|
|
1033
1033
|
o.globalAlpha = l.alpha, o.fillStyle = l.color, o.fill(l.path);
|
|
1034
1034
|
o.globalAlpha = 1;
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function Ui(o, t) {
|
|
1037
1037
|
const { width: e, height: n, plot: i, theme: s, hover: r } = t;
|
|
1038
1038
|
o.clearRect(0, 0, e, n);
|
|
1039
1039
|
const l = (r == null ? void 0 : r.hit.xPx) ?? t.syncPx;
|
|
@@ -1064,30 +1064,30 @@ function lt(o, t, e) {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
return n;
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function qi(o, t, e, n, i, s, r) {
|
|
1068
1068
|
const l = Ae(o, e, n);
|
|
1069
1069
|
if (l < 0) return -1;
|
|
1070
1070
|
const a = s.toPx(n), c = r.toPx(i);
|
|
1071
1071
|
let u = -1, f = Number.POSITIVE_INFINITY;
|
|
1072
1072
|
for (let h = l; h >= 0; h--) {
|
|
1073
|
-
const
|
|
1074
|
-
if (
|
|
1075
|
-
const
|
|
1076
|
-
if (Number.isNaN(
|
|
1077
|
-
const d = r.toPx(
|
|
1073
|
+
const p = s.toPx(o[h]) - a;
|
|
1074
|
+
if (p * p > f) break;
|
|
1075
|
+
const g = t[h];
|
|
1076
|
+
if (Number.isNaN(g)) continue;
|
|
1077
|
+
const d = r.toPx(g) - c, m = p * p + d * d;
|
|
1078
1078
|
m < f && (f = m, u = h);
|
|
1079
1079
|
}
|
|
1080
1080
|
for (let h = l + 1; h < e; h++) {
|
|
1081
|
-
const
|
|
1082
|
-
if (
|
|
1083
|
-
const
|
|
1084
|
-
if (Number.isNaN(
|
|
1085
|
-
const d = r.toPx(
|
|
1081
|
+
const p = s.toPx(o[h]) - a;
|
|
1082
|
+
if (p * p > f) break;
|
|
1083
|
+
const g = t[h];
|
|
1084
|
+
if (Number.isNaN(g)) continue;
|
|
1085
|
+
const d = r.toPx(g) - c, m = p * p + d * d;
|
|
1086
1086
|
m < f && (f = m, u = h);
|
|
1087
1087
|
}
|
|
1088
1088
|
return u;
|
|
1089
1089
|
}
|
|
1090
|
-
const
|
|
1090
|
+
const Mn = {
|
|
1091
1091
|
roleDescription: "chart",
|
|
1092
1092
|
empty: "No data",
|
|
1093
1093
|
seriesList: (o) => `${o.length === 1 ? "1 series" : `${o.length} series`}: ${o.join(", ")}.`,
|
|
@@ -1199,7 +1199,7 @@ function je(o, t, e) {
|
|
|
1199
1199
|
}
|
|
1200
1200
|
return n ?? t;
|
|
1201
1201
|
}
|
|
1202
|
-
function
|
|
1202
|
+
function Xi(o, t, e) {
|
|
1203
1203
|
let n = t;
|
|
1204
1204
|
for (let i = 0; i < o.length; i++) {
|
|
1205
1205
|
if (o.y[i] !== t.y || !Ht(o, i)) continue;
|
|
@@ -1208,12 +1208,12 @@ function qi(o, t, e) {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
return n;
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function Qi(o, t) {
|
|
1212
1212
|
for (let e = 0; e < o.length; e++)
|
|
1213
1213
|
if (o.x[e] === t.x && o.y[e] === t.y && Ht(o, e)) return !0;
|
|
1214
1214
|
return !1;
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1216
|
+
function Sn(o, t, e, n, i, s) {
|
|
1217
1217
|
const { x: r, y: l, y0: a, length: c } = o, u = Math.max(0, lt(r, c, t) - 1), f = Math.min(c - 1, lt(r, c, e));
|
|
1218
1218
|
if (f < u) return { x: r.subarray(0, 0), y: l.subarray(0, 0), y0: null, length: 0 };
|
|
1219
1219
|
if (f - u + 1 <= 2 * s)
|
|
@@ -1223,22 +1223,22 @@ function Mn(o, t, e, n, i, s) {
|
|
|
1223
1223
|
y0: a === null ? null : a.subarray(u, f + 1),
|
|
1224
1224
|
length: f - u + 1
|
|
1225
1225
|
};
|
|
1226
|
-
const h = [],
|
|
1227
|
-
let
|
|
1228
|
-
for (;
|
|
1229
|
-
const m = Math.floor(r[
|
|
1230
|
-
let y = -1, v = -1, b = -1,
|
|
1231
|
-
for (;
|
|
1232
|
-
const L = l[
|
|
1233
|
-
if (Number.isNaN(L) || a !== null && Number.isNaN(a[
|
|
1234
|
-
M < 0 && (M =
|
|
1226
|
+
const h = [], p = new Array(6);
|
|
1227
|
+
let g = u;
|
|
1228
|
+
for (; g <= f; ) {
|
|
1229
|
+
const m = Math.floor(r[g] * n + i);
|
|
1230
|
+
let y = -1, v = -1, b = -1, I = -1, M = -1, F = -1;
|
|
1231
|
+
for (; g <= f && Math.floor(r[g] * n + i) === m; g++) {
|
|
1232
|
+
const L = l[g];
|
|
1233
|
+
if (Number.isNaN(L) || a !== null && Number.isNaN(a[g])) {
|
|
1234
|
+
M < 0 && (M = g), F < 0 && (F = g);
|
|
1235
1235
|
continue;
|
|
1236
1236
|
}
|
|
1237
|
-
F = -1, y < 0 && (y =
|
|
1237
|
+
F = -1, y < 0 && (y = g), v = g, (b < 0 || L < l[b]) && (b = g), (I < 0 || L > l[I]) && (I = g);
|
|
1238
1238
|
}
|
|
1239
|
-
|
|
1239
|
+
p[0] = y, p[1] = b, p[2] = I, p[3] = v, p[4] = M, p[5] = F, p.sort((L, D) => L - D);
|
|
1240
1240
|
let w = -1;
|
|
1241
|
-
for (const L of
|
|
1241
|
+
for (const L of p)
|
|
1242
1242
|
L < 0 || L === w || (h.push(L), w = L);
|
|
1243
1243
|
}
|
|
1244
1244
|
const d = {
|
|
@@ -1251,19 +1251,19 @@ function Mn(o, t, e, n, i, s) {
|
|
|
1251
1251
|
d.x[y] = r[m], d.y[y] = l[m], d.y0 !== null && (d.y0[y] = a[m]);
|
|
1252
1252
|
}), d;
|
|
1253
1253
|
}
|
|
1254
|
-
const
|
|
1255
|
-
function
|
|
1256
|
-
const i = o.map((c) =>
|
|
1254
|
+
const Zi = 500;
|
|
1255
|
+
function ji(o, t, e, n = Zi) {
|
|
1256
|
+
const i = o.map((c) => to(c, t, e)), s = me(i, !1).count;
|
|
1257
1257
|
if (s <= n || !(e > t)) return { ...me(i, !0), courses: i, readings: s, thinned: !1 };
|
|
1258
1258
|
const r = Math.max(1, Math.floor(n / 6 / Math.max(1, o.length))), l = (r - 1) / (e - t), a = i.map(
|
|
1259
1259
|
(c, u) => {
|
|
1260
1260
|
var f;
|
|
1261
|
-
return ((f = o[u]) == null ? void 0 : f.changesOnly) === !0 ?
|
|
1261
|
+
return ((f = o[u]) == null ? void 0 : f.changesOnly) === !0 ? Ji(c) : Sn(c, t, e, l, -t * l, r);
|
|
1262
1262
|
}
|
|
1263
1263
|
);
|
|
1264
1264
|
return { ...me(a, !0), courses: a, readings: s, thinned: !0 };
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function Ji(o) {
|
|
1267
1267
|
const t = [];
|
|
1268
1268
|
for (let e = 0; e < o.length; e++) (e === 0 || !Object.is(o.y[e], o.y[e - 1])) && t.push(e);
|
|
1269
1269
|
return {
|
|
@@ -1273,7 +1273,7 @@ function ji(o) {
|
|
|
1273
1273
|
length: t.length
|
|
1274
1274
|
};
|
|
1275
1275
|
}
|
|
1276
|
-
function
|
|
1276
|
+
function to(o, t, e) {
|
|
1277
1277
|
const n = lt(o.x, o.length, t);
|
|
1278
1278
|
let i = lt(o.x, o.length, e);
|
|
1279
1279
|
for (; i < o.length && o.x[i] <= e; ) i++;
|
|
@@ -1303,7 +1303,7 @@ function me(o, t) {
|
|
|
1303
1303
|
}
|
|
1304
1304
|
return { x: n, at: i, count: s };
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1306
|
+
function eo(o, t = !1) {
|
|
1307
1307
|
const e = /* @__PURE__ */ new Map();
|
|
1308
1308
|
for (const n of o)
|
|
1309
1309
|
for (let i = 0; i < n.length; i++) {
|
|
@@ -1348,7 +1348,7 @@ function Je(o, t) {
|
|
|
1348
1348
|
function Kt(o, t) {
|
|
1349
1349
|
return o > 0 ? o : t;
|
|
1350
1350
|
}
|
|
1351
|
-
function
|
|
1351
|
+
function no(o, t, e, n, i, s, r) {
|
|
1352
1352
|
const l = s / 2, a = r / 2;
|
|
1353
1353
|
for (let c = 0; c < e; c++) {
|
|
1354
1354
|
const u = n - o[c];
|
|
@@ -1359,17 +1359,17 @@ function eo(o, t, e, n, i, s, r) {
|
|
|
1359
1359
|
}
|
|
1360
1360
|
return -1;
|
|
1361
1361
|
}
|
|
1362
|
-
const
|
|
1362
|
+
const io = {
|
|
1363
1363
|
ok: 0,
|
|
1364
1364
|
unknown: 1,
|
|
1365
1365
|
warning: 2,
|
|
1366
1366
|
alarm: 3
|
|
1367
1367
|
};
|
|
1368
|
-
function
|
|
1369
|
-
return
|
|
1368
|
+
function hs(o) {
|
|
1369
|
+
return io[o];
|
|
1370
1370
|
}
|
|
1371
1371
|
const tn = { warning: 2, alarm: 3 };
|
|
1372
|
-
function
|
|
1372
|
+
function oo(o, t = {}) {
|
|
1373
1373
|
if (o == null || !Number.isFinite(o))
|
|
1374
1374
|
return { verdict: "unknown" };
|
|
1375
1375
|
const e = t.target, n = e !== void 0 && Number.isFinite(e) ? o - e : void 0;
|
|
@@ -1387,11 +1387,11 @@ function io(o, t = {}) {
|
|
|
1387
1387
|
};
|
|
1388
1388
|
return n === void 0 ? r : { ...r, deviation: n };
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Et(o) {
|
|
1391
1391
|
return o == null || !Number.isFinite(o) ? Number.NaN : o;
|
|
1392
1392
|
}
|
|
1393
|
-
function
|
|
1394
|
-
const s = o.length, r = new Float64Array(s), l = new Float64Array(s), a = typeof n == "function" ? n : null, c = a === null ? null : new Float64Array(s), u = (i == null ? void 0 : i.value) ?? null, f = u === null ? null : new Float64Array(s), h = (i == null ? void 0 : i.box) ?? null,
|
|
1393
|
+
function so(o, t, e, n, i) {
|
|
1394
|
+
const s = o.length, r = new Float64Array(s), l = new Float64Array(s), a = typeof n == "function" ? n : null, c = a === null ? null : new Float64Array(s), u = (i == null ? void 0 : i.value) ?? null, f = u === null ? null : new Float64Array(s), h = (i == null ? void 0 : i.box) ?? null, p = h === null ? null : {
|
|
1395
1395
|
lowerQuartile: new Float64Array(s),
|
|
1396
1396
|
upperQuartile: new Float64Array(s),
|
|
1397
1397
|
lowerWhisker: new Float64Array(s),
|
|
@@ -1402,42 +1402,42 @@ function oo(o, t, e, n, i) {
|
|
|
1402
1402
|
notchLower: h.notchLower === void 0 ? null : new Float64Array(s),
|
|
1403
1403
|
notchUpper: h.notchUpper === void 0 ? null : new Float64Array(s),
|
|
1404
1404
|
count: h.count === void 0 ? null : new Float64Array(s)
|
|
1405
|
-
},
|
|
1406
|
-
let b = Number.POSITIVE_INFINITY,
|
|
1405
|
+
}, g = (h == null ? void 0 : h.outliers) ?? null, d = (p == null ? void 0 : p.outlierOffsets) ?? null, m = [], y = (i == null ? void 0 : i.xMap) ?? null, v = (i == null ? void 0 : i.xGap) ?? null;
|
|
1406
|
+
let b = Number.POSITIVE_INFINITY, I = Number.NEGATIVE_INFINITY, M = Number.POSITIVE_INFINITY, F = Number.NEGATIVE_INFINITY;
|
|
1407
1407
|
typeof n == "number" && s > 0 && (M = n, F = n);
|
|
1408
1408
|
for (let w = 0; w < s; w++) {
|
|
1409
|
-
const L = o[w], D = t(L, w), G = !Number.isFinite(D),
|
|
1410
|
-
r[w] =
|
|
1409
|
+
const L = o[w], D = t(L, w), G = !Number.isFinite(D), _ = G ? w > 0 ? r[w - 1] : Number.NEGATIVE_INFINITY : y === null ? D : y(D);
|
|
1410
|
+
r[w] = _;
|
|
1411
1411
|
const Z = G || v !== null && v(D);
|
|
1412
|
-
Z || (
|
|
1413
|
-
const X = Z ? Number.NaN :
|
|
1414
|
-
if (l[w] = X, X < M && (M = X), X > F && (F = X), u !== null && (f[w] = Z ? Number.NaN :
|
|
1415
|
-
for (const k of
|
|
1416
|
-
const T = Number.isNaN(X) ? Number.NaN :
|
|
1417
|
-
|
|
1412
|
+
Z || (_ < b && (b = _), _ > I && (I = _));
|
|
1413
|
+
const X = Z ? Number.NaN : Et(e(L, w));
|
|
1414
|
+
if (l[w] = X, X < M && (M = X), X > F && (F = X), u !== null && (f[w] = Z ? Number.NaN : Et(u(L, w))), h !== null) {
|
|
1415
|
+
for (const k of Tt) {
|
|
1416
|
+
const T = Number.isNaN(X) ? Number.NaN : Et(h[k](L, w));
|
|
1417
|
+
p[k][w] = T, T < M && (M = T), T > F && (F = T);
|
|
1418
1418
|
}
|
|
1419
1419
|
for (const k of Fe) {
|
|
1420
|
-
const T = h[k], A =
|
|
1420
|
+
const T = h[k], A = p[k];
|
|
1421
1421
|
if (T === void 0 || A === null) continue;
|
|
1422
|
-
const $ = Number.isNaN(X) ? Number.NaN :
|
|
1423
|
-
A[w] = $,
|
|
1422
|
+
const $ = Number.isNaN(X) ? Number.NaN : Et(T(L, w));
|
|
1423
|
+
A[w] = $, Ln.includes(k) && ($ < M && (M = $), $ > F && (F = $));
|
|
1424
1424
|
}
|
|
1425
|
-
if (
|
|
1426
|
-
const k = Number.isNaN(X) ? null :
|
|
1425
|
+
if (g !== null) {
|
|
1426
|
+
const k = Number.isNaN(X) ? null : g(L, w);
|
|
1427
1427
|
for (const T of k ?? [])
|
|
1428
1428
|
Number.isFinite(T) && (m.push(T), T < M && (M = T), T > F && (F = T));
|
|
1429
1429
|
d !== null && (d[w + 1] = m.length);
|
|
1430
1430
|
}
|
|
1431
1431
|
}
|
|
1432
1432
|
if (a !== null) {
|
|
1433
|
-
const k = Z ? Number.NaN :
|
|
1433
|
+
const k = Z ? Number.NaN : Et(a(L, w));
|
|
1434
1434
|
c[w] = k, k < M && (M = k), k > F && (F = k);
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
|
-
return
|
|
1437
|
+
return p !== null && g !== null && (p.outliers = Float64Array.from(m)), { series: { x: r, y: l, y0: c, w: f, box: p, length: s }, extent: { xMin: b, xMax: I, yMin: M, yMax: F } };
|
|
1438
1438
|
}
|
|
1439
|
-
const
|
|
1440
|
-
function
|
|
1439
|
+
const Tt = ["upperWhisker", "upperQuartile", "lowerQuartile", "lowerWhisker"], Fe = ["mean", "notchUpper", "notchLower", "count"], Ln = ["mean", "notchUpper", "notchLower"];
|
|
1440
|
+
function ro(o) {
|
|
1441
1441
|
const t = o.box;
|
|
1442
1442
|
if (t === null) return -1;
|
|
1443
1443
|
for (let e = 0; e < o.length; e++) {
|
|
@@ -1448,7 +1448,7 @@ function so(o) {
|
|
|
1448
1448
|
}
|
|
1449
1449
|
return -1;
|
|
1450
1450
|
}
|
|
1451
|
-
function
|
|
1451
|
+
function lo(o, t) {
|
|
1452
1452
|
for (let e = 1; e < t; e++)
|
|
1453
1453
|
if (o[e] < o[e - 1]) return e;
|
|
1454
1454
|
return -1;
|
|
@@ -1463,27 +1463,27 @@ function en(o, t, e) {
|
|
|
1463
1463
|
h < a && (a = h), h > c && (c = h);
|
|
1464
1464
|
}
|
|
1465
1465
|
if (r !== null) {
|
|
1466
|
-
for (const
|
|
1467
|
-
const d = r[
|
|
1466
|
+
for (const g of Tt) {
|
|
1467
|
+
const d = r[g][u];
|
|
1468
1468
|
d < a && (a = d), d > c && (c = d);
|
|
1469
1469
|
}
|
|
1470
|
-
for (const
|
|
1471
|
-
const d = r[
|
|
1470
|
+
for (const g of Ln) {
|
|
1471
|
+
const d = r[g];
|
|
1472
1472
|
if (d === null) continue;
|
|
1473
1473
|
const m = d[u];
|
|
1474
1474
|
m < a && (a = m), m > c && (c = m);
|
|
1475
1475
|
}
|
|
1476
|
-
const { outliers: h, outlierOffsets:
|
|
1477
|
-
if (h !== null &&
|
|
1478
|
-
for (let
|
|
1479
|
-
const d = h[
|
|
1476
|
+
const { outliers: h, outlierOffsets: p } = r;
|
|
1477
|
+
if (h !== null && p !== null)
|
|
1478
|
+
for (let g = p[u]; g < p[u + 1]; g++) {
|
|
1479
|
+
const d = h[g];
|
|
1480
1480
|
d < a && (a = d), d > c && (c = d);
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
1484
|
return [a, c];
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function ao(o, t, e, n) {
|
|
1487
1487
|
let i = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY;
|
|
1488
1488
|
for (const r of e) {
|
|
1489
1489
|
const l = r.extent;
|
|
@@ -1496,7 +1496,7 @@ function lo(o, t, e, n) {
|
|
|
1496
1496
|
Number.isFinite(r) && (r < i && (i = r), r > s && (s = r));
|
|
1497
1497
|
return !Number.isFinite(i) || !Number.isFinite(s) ? [0, 1] : [i, s];
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1499
|
+
function co(o, t) {
|
|
1500
1500
|
let e = Number.POSITIVE_INFINITY;
|
|
1501
1501
|
for (let n = 1; n < t; n++) {
|
|
1502
1502
|
const i = o[n] - o[n - 1];
|
|
@@ -1504,14 +1504,14 @@ function ao(o, t) {
|
|
|
1504
1504
|
}
|
|
1505
1505
|
return Number.isFinite(e) ? e : 0;
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1507
|
+
function uo(o, t) {
|
|
1508
1508
|
return o > 0 ? o : t;
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1510
|
+
function ho(o, t, e, n) {
|
|
1511
1511
|
const i = o * t, s = i / n;
|
|
1512
1512
|
return { offset: -i / 2 + e * s, width: s };
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1514
|
+
function fo(o) {
|
|
1515
1515
|
const t = /* @__PURE__ */ new Map();
|
|
1516
1516
|
for (const n of o) {
|
|
1517
1517
|
if (n.kind !== "bar" && n.kind !== "box") continue;
|
|
@@ -1538,9 +1538,9 @@ function ho(o) {
|
|
|
1538
1538
|
}
|
|
1539
1539
|
return e;
|
|
1540
1540
|
}
|
|
1541
|
-
const
|
|
1541
|
+
const mo = [...Tt.slice(0, 2), "median", ...Tt.slice(2)], nn = 5, on = {
|
|
1542
1542
|
version: 0,
|
|
1543
|
-
layout:
|
|
1543
|
+
layout: vn,
|
|
1544
1544
|
legend: null,
|
|
1545
1545
|
series: [],
|
|
1546
1546
|
limits: [],
|
|
@@ -1554,16 +1554,16 @@ const fo = [...At.slice(0, 2), "median", ...At.slice(2)], nn = 5, on = {
|
|
|
1554
1554
|
xLabel: "",
|
|
1555
1555
|
rows: [],
|
|
1556
1556
|
totals: []
|
|
1557
|
-
},
|
|
1557
|
+
}, po = 4, go = 14, rn = 12;
|
|
1558
1558
|
let ge = 0;
|
|
1559
|
-
const
|
|
1559
|
+
const Ft = /* @__PURE__ */ new Map();
|
|
1560
1560
|
function ot(o, t) {
|
|
1561
1561
|
if (o === t) return !0;
|
|
1562
1562
|
if (typeof o != "function" || typeof t != "function") return !1;
|
|
1563
1563
|
const e = String(o);
|
|
1564
1564
|
return e.includes("[native code]") ? !1 : e === String(t);
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1566
|
+
function yo(o, t) {
|
|
1567
1567
|
var e, n, i, s;
|
|
1568
1568
|
if (o === t) return !0;
|
|
1569
1569
|
if (o === void 0 || t === void 0 || o.length !== t.length) return !1;
|
|
@@ -1571,10 +1571,10 @@ function po(o, t) {
|
|
|
1571
1571
|
if (((e = o[r]) == null ? void 0 : e.from) !== ((n = t[r]) == null ? void 0 : n.from) || ((i = o[r]) == null ? void 0 : i.to) !== ((s = t[r]) == null ? void 0 : s.to)) return !1;
|
|
1572
1572
|
return !0;
|
|
1573
1573
|
}
|
|
1574
|
-
function
|
|
1574
|
+
function Dt(o) {
|
|
1575
1575
|
return o.kind !== "state" && o.kind !== "matrix";
|
|
1576
1576
|
}
|
|
1577
|
-
function
|
|
1577
|
+
function xo(o) {
|
|
1578
1578
|
const t = o.entry.materialized;
|
|
1579
1579
|
if (t === null) return !1;
|
|
1580
1580
|
const e = t.x[o.index], n = (i) => i > 0 && i < j;
|
|
@@ -1586,8 +1586,8 @@ function Ct(o, t) {
|
|
|
1586
1586
|
for (let e = 0; e < o.length; e++) if (o[e] !== t[e]) return !1;
|
|
1587
1587
|
return !0;
|
|
1588
1588
|
}
|
|
1589
|
-
function
|
|
1590
|
-
return o.kind === t.kind && it(o) === it(t) && se(o) === se(t) && ot(o.accessor, t.accessor) && o.data === t.data && ot(re(o), re(t)) && ot(Me(o), Me(t)) &&
|
|
1589
|
+
function bo(o, t) {
|
|
1590
|
+
return o.kind === t.kind && it(o) === it(t) && se(o) === se(t) && ot(o.accessor, t.accessor) && o.data === t.data && ot(re(o), re(t)) && ot(Me(o), Me(t)) && vo(Te(o), Te(t));
|
|
1591
1591
|
}
|
|
1592
1592
|
function Te(o) {
|
|
1593
1593
|
if (o.kind !== "box") return;
|
|
@@ -1604,12 +1604,12 @@ function Te(o) {
|
|
|
1604
1604
|
notchUpper: a ? o.notchUpper : void 0
|
|
1605
1605
|
};
|
|
1606
1606
|
}
|
|
1607
|
-
function
|
|
1608
|
-
return o === void 0 || t === void 0 ? o === t : [...
|
|
1607
|
+
function vo(o, t) {
|
|
1608
|
+
return o === void 0 || t === void 0 ? o === t : [...Tt, ...Fe, "outliers"].every((e) => ot(o[e], t[e]));
|
|
1609
1609
|
}
|
|
1610
1610
|
function ln(o, t) {
|
|
1611
1611
|
const e = {};
|
|
1612
|
-
for (const s of
|
|
1612
|
+
for (const s of Tt) e[s] = o[s][t];
|
|
1613
1613
|
for (const s of Fe) {
|
|
1614
1614
|
const r = o[s];
|
|
1615
1615
|
r !== null && (e[s] = r[t]);
|
|
@@ -1647,7 +1647,7 @@ function re(o) {
|
|
|
1647
1647
|
return;
|
|
1648
1648
|
}
|
|
1649
1649
|
}
|
|
1650
|
-
function
|
|
1650
|
+
function ko(o, t) {
|
|
1651
1651
|
if (o.kind !== t.kind) return !1;
|
|
1652
1652
|
switch (t.kind) {
|
|
1653
1653
|
case "line": {
|
|
@@ -1666,13 +1666,13 @@ function bo(o, t) {
|
|
|
1666
1666
|
return o.radius === t.radius;
|
|
1667
1667
|
case "state": {
|
|
1668
1668
|
const e = o;
|
|
1669
|
-
return e.laneFrom === t.laneFrom && e.laneTo === t.laneTo &&
|
|
1669
|
+
return e.laneFrom === t.laneFrom && e.laneTo === t.laneTo && wo(e.states, t.states);
|
|
1670
1670
|
}
|
|
1671
1671
|
case "matrix":
|
|
1672
|
-
return
|
|
1672
|
+
return No(o.coloring, t.coloring);
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
1675
|
-
function
|
|
1675
|
+
function wo(o, t) {
|
|
1676
1676
|
var e, n, i, s;
|
|
1677
1677
|
if (o === t) return !0;
|
|
1678
1678
|
if (o.length !== t.length) return !1;
|
|
@@ -1680,17 +1680,17 @@ function vo(o, t) {
|
|
|
1680
1680
|
if (((e = o[r]) == null ? void 0 : e.label) !== ((n = t[r]) == null ? void 0 : n.label) || ((i = o[r]) == null ? void 0 : i.color) !== ((s = t[r]) == null ? void 0 : s.color)) return !1;
|
|
1681
1681
|
return !0;
|
|
1682
1682
|
}
|
|
1683
|
-
function
|
|
1683
|
+
function No(o, t) {
|
|
1684
1684
|
return o === t ? !0 : o.kind !== t.kind ? !1 : o.kind === "assessment" && t.kind === "assessment" ? o.limits === t.limits : o.kind === "gradient" && t.kind === "gradient" ? Ct(o.stops, t.stops) && Ct(o.range, t.range) : !1;
|
|
1685
1685
|
}
|
|
1686
1686
|
function Gt(o, t) {
|
|
1687
1687
|
return o.kind === "assessment" ? [t.colorOk, t.colorWarning, t.colorAlarm] : o.stops;
|
|
1688
1688
|
}
|
|
1689
|
-
function
|
|
1689
|
+
function Io(o) {
|
|
1690
1690
|
const t = 100 / Math.max(1, o.length);
|
|
1691
1691
|
return `linear-gradient(to right, ${o.map((n, i) => `${n} ${i * t}% ${(i + 1) * t}%`).join(", ")})`;
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function Ao(o, t, e) {
|
|
1694
1694
|
let n = e == null ? void 0 : e[0], i = e == null ? void 0 : e[1];
|
|
1695
1695
|
if (n === void 0 || i === void 0) {
|
|
1696
1696
|
n = Number.POSITIVE_INFINITY, i = Number.NEGATIVE_INFINITY;
|
|
@@ -1701,9 +1701,9 @@ function No(o, t, e) {
|
|
|
1701
1701
|
}
|
|
1702
1702
|
return [n, i];
|
|
1703
1703
|
}
|
|
1704
|
-
function
|
|
1704
|
+
function To(o, t, e, n, i) {
|
|
1705
1705
|
if (t.kind === "assessment") {
|
|
1706
|
-
const a =
|
|
1706
|
+
const a = oo(o, t.limits);
|
|
1707
1707
|
return a.verdict === "alarm" ? 2 : a.verdict === "warning" ? 1 : a.verdict === "ok" ? 0 : -1;
|
|
1708
1708
|
}
|
|
1709
1709
|
if (!Number.isFinite(o)) return -1;
|
|
@@ -1714,27 +1714,27 @@ function an(o, t, e) {
|
|
|
1714
1714
|
const n = o.length, i = new Int32Array(n), s = o.w;
|
|
1715
1715
|
if (s === null || e === 0)
|
|
1716
1716
|
return i.fill(-1), i;
|
|
1717
|
-
const [r, l] = t.kind === "gradient" ?
|
|
1718
|
-
for (let a = 0; a < n; a++) i[a] =
|
|
1717
|
+
const [r, l] = t.kind === "gradient" ? Ao(s, n, t.range) : [0, 0];
|
|
1718
|
+
for (let a = 0; a < n; a++) i[a] = To(s[a], t, e, r, l);
|
|
1719
1719
|
return i;
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1721
|
+
function Mo(o, t) {
|
|
1722
1722
|
return o === t ? !0 : Array.isArray(o) && Array.isArray(t) ? o[0] === t[0] && o[1] === t[1] : !1;
|
|
1723
1723
|
}
|
|
1724
|
-
const
|
|
1724
|
+
const So = 150, Lo = 100, Eo = {
|
|
1725
1725
|
ArrowRight: "next",
|
|
1726
1726
|
ArrowLeft: "previous",
|
|
1727
1727
|
Home: "first",
|
|
1728
1728
|
End: "last",
|
|
1729
1729
|
PageDown: "pageNext",
|
|
1730
1730
|
PageUp: "pagePrevious"
|
|
1731
|
-
},
|
|
1731
|
+
}, Fo = {
|
|
1732
1732
|
ArrowLeft: "left",
|
|
1733
1733
|
ArrowRight: "right",
|
|
1734
1734
|
ArrowUp: "up",
|
|
1735
1735
|
ArrowDown: "down"
|
|
1736
1736
|
}, cn = 1.25;
|
|
1737
|
-
class
|
|
1737
|
+
class En {
|
|
1738
1738
|
constructor() {
|
|
1739
1739
|
/* ---------- Registration ---------- */
|
|
1740
1740
|
x(this, "series", /* @__PURE__ */ new Map());
|
|
@@ -1761,7 +1761,7 @@ class Ln {
|
|
|
1761
1761
|
x(this, "summaryEl", null);
|
|
1762
1762
|
x(this, "readoutTimer", null);
|
|
1763
1763
|
x(this, "summaryTimer", null);
|
|
1764
|
-
x(this, "wording",
|
|
1764
|
+
x(this, "wording", Mn);
|
|
1765
1765
|
x(this, "measurer", null);
|
|
1766
1766
|
/* ---------- Size and DPR ---------- */
|
|
1767
1767
|
x(this, "cssWidth", 0);
|
|
@@ -1787,7 +1787,7 @@ class Ln {
|
|
|
1787
1787
|
`var(--…)` or a `light-dark(…)` and keeps the previous fillStyle. */
|
|
1788
1788
|
x(this, "painted", /* @__PURE__ */ new Map());
|
|
1789
1789
|
/* ---------- Layout and interaction ---------- */
|
|
1790
|
-
x(this, "layout",
|
|
1790
|
+
x(this, "layout", vn);
|
|
1791
1791
|
x(this, "hysteresis", /* @__PURE__ */ new Map());
|
|
1792
1792
|
x(this, "hover", null);
|
|
1793
1793
|
x(this, "hoverKey", "");
|
|
@@ -1826,7 +1826,7 @@ class Ln {
|
|
|
1826
1826
|
(t = this.measurer) == null || t.clear(), this.hysteresis.clear(), this.markLayoutDirty();
|
|
1827
1827
|
});
|
|
1828
1828
|
x(this, "themeRoot", null);
|
|
1829
|
-
x(this, "percent", (t) => this.wording.percent(
|
|
1829
|
+
x(this, "percent", (t) => this.wording.percent(Lt(t)));
|
|
1830
1830
|
/* ---------- Cursor sync (charts-long-series 04) ----------
|
|
1831
1831
|
|
|
1832
1832
|
Only the x position travels, in domain units: each chart draws its own
|
|
@@ -1889,7 +1889,7 @@ class Ln {
|
|
|
1889
1889
|
return this.series.set(e, {
|
|
1890
1890
|
order: e,
|
|
1891
1891
|
config: t,
|
|
1892
|
-
slot:
|
|
1892
|
+
slot: Dt(t) ? this.slotFor(t.name) : -1,
|
|
1893
1893
|
lastSlot: null,
|
|
1894
1894
|
materialized: null,
|
|
1895
1895
|
extent: null,
|
|
@@ -1903,8 +1903,8 @@ class Ln {
|
|
|
1903
1903
|
updateSeries(t, e) {
|
|
1904
1904
|
const n = this.series.get(t);
|
|
1905
1905
|
if (n === void 0) return;
|
|
1906
|
-
const i = n.config, s =
|
|
1907
|
-
if (n.slot < 0 &&
|
|
1906
|
+
const i = n.config, s = bo(i, e), r = s && i.xAxisId === e.xAxisId && i.yAxisId === e.yAxisId && i.name === e.name && ot(i.format, e.format) && i.color === e.color && i.tone === e.tone && i.hidden === e.hidden && ko(i, e);
|
|
1907
|
+
if (n.slot < 0 && Dt(e))
|
|
1908
1908
|
n.slot = this.slotFor(e.name);
|
|
1909
1909
|
else if (i.name !== e.name && e.name !== void 0 && n.slot >= 0) {
|
|
1910
1910
|
const l = this.slotsByName.get(e.name);
|
|
@@ -1922,7 +1922,7 @@ class Ln {
|
|
|
1922
1922
|
updateAxis(t, e) {
|
|
1923
1923
|
const n = this.axes.get(t);
|
|
1924
1924
|
if (n === void 0) return;
|
|
1925
|
-
const i = n.config, s = ot(i.accessor, e.accessor) &&
|
|
1925
|
+
const i = n.config, s = ot(i.accessor, e.accessor) && yo(i.calendar, e.calendar), r = s && 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 && Ct(i.ticks, e.ticks) && Mo(i.domain, e.domain) && i.onDomainChange === void 0 == (e.onDomainChange === void 0) && ot(i.tickFormat, e.tickFormat);
|
|
1926
1926
|
if (n.config = e, !r) {
|
|
1927
1927
|
if (!s || i.id !== e.id) {
|
|
1928
1928
|
for (const l of this.series.values())
|
|
@@ -2003,14 +2003,14 @@ class Ln {
|
|
|
2003
2003
|
from; null without encoding by marks, and for the kinds that take no
|
|
2004
2004
|
place (a band and a cell are hatched by state and by step instead). */
|
|
2005
2005
|
marksOf(t) {
|
|
2006
|
-
return this.marked() &&
|
|
2006
|
+
return this.marked() && Dt(t.config) ? Ti(this.paletteSlot(t)) : null;
|
|
2007
2007
|
}
|
|
2008
2008
|
/** Each state's hatch by its name, across every band of the chart - so the
|
|
2009
2009
|
legend and each band agree (charts-alternatives 04). */
|
|
2010
2010
|
stateHatches() {
|
|
2011
2011
|
const t = [];
|
|
2012
2012
|
for (const { config: e } of this.seriesInOrder()) e.kind === "state" && t.push(e.states);
|
|
2013
|
-
return
|
|
2013
|
+
return Mi(t);
|
|
2014
2014
|
}
|
|
2015
2015
|
/** The words the HTML layer writes - the data table's key among them. */
|
|
2016
2016
|
getWording() {
|
|
@@ -2044,22 +2044,22 @@ class Ln {
|
|
|
2044
2044
|
const t = /* @__PURE__ */ new Set();
|
|
2045
2045
|
for (const { config: s } of this.axesInOrder()) {
|
|
2046
2046
|
const r = `${s.orientation}:${s.id}`, l = s.orientation === "x" ? "XAxis" : "YAxis";
|
|
2047
|
-
|
|
2047
|
+
$t(
|
|
2048
2048
|
!t.has(r),
|
|
2049
2049
|
`Two <${l}> with the same id "${s.id}". A second ${l} needs an own id (R-4.12).`
|
|
2050
2050
|
), t.add(r);
|
|
2051
2051
|
}
|
|
2052
2052
|
const e = /* @__PURE__ */ new Set();
|
|
2053
2053
|
for (const { config: s } of this.series.values())
|
|
2054
|
-
|
|
2054
|
+
$t(
|
|
2055
2055
|
t.has(`x:${s.xAxisId}`),
|
|
2056
2056
|
`Series "${s.name ?? "?"}" refers to the unknown x axis "${s.xAxisId}" (R-4.12).`
|
|
2057
|
-
),
|
|
2057
|
+
), $t(
|
|
2058
2058
|
t.has(`y:${s.yAxisId}`),
|
|
2059
2059
|
`Series "${s.name ?? "?"}" refers to the unknown y axis "${s.yAxisId}" (R-4.12).`
|
|
2060
2060
|
), e.add(`x:${s.xAxisId}`), e.add(`y:${s.yAxisId}`);
|
|
2061
2061
|
for (const { config: s } of this.limits.values())
|
|
2062
|
-
|
|
2062
|
+
$t(
|
|
2063
2063
|
t.has(`${s.orientation}:${this.limitAxisId(s)}`),
|
|
2064
2064
|
`A limit refers to the unknown ${s.orientation} axis "${this.limitAxisId(s)}" (R-4.12).`
|
|
2065
2065
|
);
|
|
@@ -2115,7 +2115,7 @@ class Ln {
|
|
|
2115
2115
|
}
|
|
2116
2116
|
const i = n.config, s = i.data ?? this.data, r = this.findAxisConfig("x", i.xAxisId);
|
|
2117
2117
|
if (r === null) continue;
|
|
2118
|
-
const l =
|
|
2118
|
+
const l = so(
|
|
2119
2119
|
s,
|
|
2120
2120
|
r.accessor,
|
|
2121
2121
|
i.accessor,
|
|
@@ -2128,7 +2128,7 @@ class Ln {
|
|
|
2128
2128
|
}
|
|
2129
2129
|
);
|
|
2130
2130
|
if (n.materialized = l.series, n.own = it(i) === void 0 ? null : l.series.y, n.stacked = null, e += l.series.length, i.kind === "bar" || i.kind === "box") {
|
|
2131
|
-
const a =
|
|
2131
|
+
const a = co(l.series.x, l.series.length);
|
|
2132
2132
|
n.step = a;
|
|
2133
2133
|
const c = a / 2;
|
|
2134
2134
|
n.extent = {
|
|
@@ -2145,7 +2145,7 @@ class Ln {
|
|
|
2145
2145
|
yMax: l.extent.yMax + c / 2
|
|
2146
2146
|
};
|
|
2147
2147
|
} else if (i.kind === "state") {
|
|
2148
|
-
const a =
|
|
2148
|
+
const a = Li(l.series.x, l.series.length);
|
|
2149
2149
|
n.step = a, n.extent = {
|
|
2150
2150
|
...l.extent,
|
|
2151
2151
|
xMax: l.extent.xMax + a,
|
|
@@ -2155,7 +2155,7 @@ class Ln {
|
|
|
2155
2155
|
} else
|
|
2156
2156
|
n.step = null, n.extent = l.extent;
|
|
2157
2157
|
if (wt && i.kind === "box") {
|
|
2158
|
-
const a =
|
|
2158
|
+
const a = ro(l.series);
|
|
2159
2159
|
if (a >= 0) {
|
|
2160
2160
|
const c = i.name ?? "?";
|
|
2161
2161
|
nt(
|
|
@@ -2165,7 +2165,7 @@ class Ln {
|
|
|
2165
2165
|
}
|
|
2166
2166
|
}
|
|
2167
2167
|
if (wt && i.kind !== "matrix") {
|
|
2168
|
-
const a =
|
|
2168
|
+
const a = lo(l.series.x, l.series.length);
|
|
2169
2169
|
if (a >= 0) {
|
|
2170
2170
|
const c = i.name ?? "?";
|
|
2171
2171
|
nt(
|
|
@@ -2192,7 +2192,7 @@ class Ln {
|
|
|
2192
2192
|
i === void 0 ? t.set(n, [e]) : i.push(e);
|
|
2193
2193
|
}
|
|
2194
2194
|
for (const e of t.values()) {
|
|
2195
|
-
const n = it(e[0].config), i = [...this.series.values()].some((r) => it(r.config) === n && se(r.config)), s =
|
|
2195
|
+
const n = it(e[0].config), i = [...this.series.values()].some((r) => it(r.config) === n && se(r.config)), s = eo(
|
|
2196
2196
|
e.map((r) => ({ ...r.materialized, y: r.own })),
|
|
2197
2197
|
i
|
|
2198
2198
|
);
|
|
@@ -2207,7 +2207,7 @@ class Ln {
|
|
|
2207
2207
|
/* ================= DOM binding, DPR, resize ================= */
|
|
2208
2208
|
bind(t, e, n, i) {
|
|
2209
2209
|
var r;
|
|
2210
|
-
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
|
|
2210
|
+
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 Jn(i), this.dpr = typeof devicePixelRatio == "number" ? devicePixelRatio : 1, this.rebindDprWatch(), this.unsubscribeTheme = Zn(() => {
|
|
2211
2211
|
var l;
|
|
2212
2212
|
this.theme = null, this.painted.clear(), (l = this.measurer) == null || l.clear(), this.hysteresis.clear(), this.markLayoutDirty();
|
|
2213
2213
|
});
|
|
@@ -2264,7 +2264,7 @@ class Ln {
|
|
|
2264
2264
|
}));
|
|
2265
2265
|
}
|
|
2266
2266
|
frame() {
|
|
2267
|
-
if (this.applyPendingSize(), this.theme === null && this.themeRoot !== null && (this.theme =
|
|
2267
|
+
if (this.applyPendingSize(), this.theme === null && this.themeRoot !== null && (this.theme = Qn(this.themeRoot)), this.cssWidth <= 0 || this.cssHeight <= 0) {
|
|
2268
2268
|
this.layoutDirty && this.pushLayoutSnapshot();
|
|
2269
2269
|
return;
|
|
2270
2270
|
}
|
|
@@ -2304,7 +2304,7 @@ class Ln {
|
|
|
2304
2304
|
// A hidden series has no say: the axis fits what is shown.
|
|
2305
2305
|
extent: r.config.hidden === !0 ? null : n ? this.visibleExtentOf(r) : r.extent
|
|
2306
2306
|
}));
|
|
2307
|
-
return
|
|
2307
|
+
return ao(t, e, i, this.limitValues(t, e));
|
|
2308
2308
|
}
|
|
2309
2309
|
/** The extent of what a fixed x domain shows. A domain that is not fixed
|
|
2310
2310
|
shows every point - "nice" and "data" both contain the data -, and a band
|
|
@@ -2340,12 +2340,12 @@ class Ln {
|
|
|
2340
2340
|
mapFor(t) {
|
|
2341
2341
|
const e = t.calendar;
|
|
2342
2342
|
if (!(e === void 0 || e.length === 0))
|
|
2343
|
-
return (n) =>
|
|
2343
|
+
return (n) => si(n, e);
|
|
2344
2344
|
}
|
|
2345
2345
|
gapFor(t) {
|
|
2346
2346
|
const e = t.calendar;
|
|
2347
2347
|
if (!(e === void 0 || e.length === 0))
|
|
2348
|
-
return (n) =>
|
|
2348
|
+
return (n) => ri(n, e);
|
|
2349
2349
|
}
|
|
2350
2350
|
extentFor(t) {
|
|
2351
2351
|
return this.axisExtent(t.orientation, t.id);
|
|
@@ -2374,7 +2374,7 @@ class Ln {
|
|
|
2374
2374
|
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
|
|
2375
2375
|
});
|
|
2376
2376
|
}
|
|
2377
|
-
this.layout =
|
|
2377
|
+
this.layout = Ii({
|
|
2378
2378
|
width: this.cssWidth,
|
|
2379
2379
|
height: this.cssHeight,
|
|
2380
2380
|
padding: this.padding,
|
|
@@ -2396,12 +2396,12 @@ class Ln {
|
|
|
2396
2396
|
if (e === null) return t;
|
|
2397
2397
|
if (((i = this.theme) == null ? void 0 : i.forced) === !0) return this.theme.colorText;
|
|
2398
2398
|
let n = this.painted.get(t);
|
|
2399
|
-
return n === void 0 && (n =
|
|
2399
|
+
return n === void 0 && (n = Xn(e, { color: t }).color, this.painted.set(t, n)), n;
|
|
2400
2400
|
}
|
|
2401
2401
|
colorFor(t) {
|
|
2402
2402
|
var i;
|
|
2403
2403
|
if (t.config.color !== void 0) return this.paint(t.config.color);
|
|
2404
|
-
if (!
|
|
2404
|
+
if (!Dt(t.config)) return "";
|
|
2405
2405
|
const e = t.config.tone;
|
|
2406
2406
|
if (e !== void 0) {
|
|
2407
2407
|
const s = this.theme ?? K;
|
|
@@ -2417,7 +2417,7 @@ class Ln {
|
|
|
2417
2417
|
if (t.config.name !== void 0) return t.slot;
|
|
2418
2418
|
let e = 0;
|
|
2419
2419
|
for (const n of this.series.values())
|
|
2420
|
-
n.order < t.order &&
|
|
2420
|
+
n.order < t.order && Dt(n.config) && e++;
|
|
2421
2421
|
return t.lastSlot !== null && t.lastSlot !== e && nt(
|
|
2422
2422
|
"series-without-name-colour",
|
|
2423
2423
|
"a series without a name has changed its colour, because a series before it went away - with `name` it keeps it."
|
|
@@ -2456,7 +2456,7 @@ class Ln {
|
|
|
2456
2456
|
id: String(s.order),
|
|
2457
2457
|
name: this.nameFor(s, r),
|
|
2458
2458
|
hidden: l.hidden === !0,
|
|
2459
|
-
color: l.kind === "matrix" ?
|
|
2459
|
+
color: l.kind === "matrix" ? Io(Gt(l.coloring, n)) : this.colorFor(s),
|
|
2460
2460
|
seriesIds: [s.order],
|
|
2461
2461
|
mark: this.legendMark(s, n)
|
|
2462
2462
|
});
|
|
@@ -2541,23 +2541,25 @@ class Ln {
|
|
|
2541
2541
|
if (i.label === void 0 || i.label === "") continue;
|
|
2542
2542
|
const s = this.findAxis(i.orientation, this.limitAxisId(i));
|
|
2543
2543
|
if (s === null) continue;
|
|
2544
|
-
const r = i.kind === "line" ? this.limitAt(i, i.value) : (this.limitAt(i, i.from) + this.limitAt(i, i.to)) / 2, l = (e = this.measurer) == null ? void 0 : e.measure(i.label, yt), a = (l == null ? void 0 : l.height) ?? 0, c = s.scale.toPx(r), u = ((l == null ? void 0 : l.width) ?? 0) + 4;
|
|
2544
|
+
const r = i.kind === "line" ? this.limitAt(i, i.value) : (this.limitAt(i, i.from) + this.limitAt(i, i.to)) / 2, l = (e = this.measurer) == null ? void 0 : e.measure(i.label, yt), a = (l == null ? void 0 : l.height) ?? 0, c = s.scale.toPx(r), u = ((l == null ? void 0 : l.width) ?? 0) + 4 + (i.color === void 0 ? 0 : go);
|
|
2545
2545
|
t.push({
|
|
2546
2546
|
id: n,
|
|
2547
2547
|
axisKey: s.key,
|
|
2548
2548
|
px: c,
|
|
2549
|
-
labelLeft:
|
|
2549
|
+
labelLeft: wn(c, u, this.cssWidth),
|
|
2550
|
+
width: u,
|
|
2550
2551
|
height: a,
|
|
2551
2552
|
inside: s.limitsInside,
|
|
2552
2553
|
label: i.label,
|
|
2553
2554
|
severity: i.severity,
|
|
2554
|
-
role: i.role
|
|
2555
|
+
role: i.role,
|
|
2556
|
+
...i.color !== void 0 ? { color: i.color } : {}
|
|
2555
2557
|
});
|
|
2556
2558
|
}
|
|
2557
2559
|
for (const n of new Set(t.map((i) => i.axisKey))) {
|
|
2558
2560
|
if (!n.startsWith("y:")) continue;
|
|
2559
2561
|
const i = t.filter((r) => r.axisKey === n), s = Math.max(...i.map((r) => r.height));
|
|
2560
|
-
|
|
2562
|
+
Ni(i.map((r) => r.px), s).forEach((r, l) => i[l].px = r);
|
|
2561
2563
|
}
|
|
2562
2564
|
return t;
|
|
2563
2565
|
}
|
|
@@ -2571,7 +2573,7 @@ class Ln {
|
|
|
2571
2573
|
if (a === null) return;
|
|
2572
2574
|
const c = this.findAxis("x", l.config.xAxisId), u = this.findAxis("y", l.config.yAxisId);
|
|
2573
2575
|
if (c === null || u === null) return;
|
|
2574
|
-
const f = s !== null && !s.includes(l.order), h = this.marksOf(l),
|
|
2576
|
+
const f = s !== null && !s.includes(l.order), h = this.marksOf(l), p = {
|
|
2575
2577
|
x: a.x,
|
|
2576
2578
|
y: a.y,
|
|
2577
2579
|
length: a.length,
|
|
@@ -2579,29 +2581,29 @@ class Ln {
|
|
|
2579
2581
|
yScale: u.scale,
|
|
2580
2582
|
color: this.colorFor(l),
|
|
2581
2583
|
alpha: f ? 0.25 : 1
|
|
2582
|
-
},
|
|
2583
|
-
switch (
|
|
2584
|
+
}, g = l.config, d = g.kind === "line" || g.kind === "area" ? Sn(a, c.scale.domain[0], c.scale.domain[1], c.scale.m, c.scale.b, this.layout.plot.width) : a;
|
|
2585
|
+
switch (p.x = d.x, p.y = d.y, p.length = d.length, g.kind) {
|
|
2584
2586
|
case "line":
|
|
2585
2587
|
t.push({
|
|
2586
|
-
...
|
|
2588
|
+
...p,
|
|
2587
2589
|
kind: "line",
|
|
2588
|
-
strokeWidth:
|
|
2590
|
+
strokeWidth: g.strokeWidth,
|
|
2589
2591
|
// A dash of the caller's own wins over the one its place gives.
|
|
2590
|
-
dash:
|
|
2591
|
-
markers:
|
|
2592
|
-
step:
|
|
2592
|
+
dash: g.dash ?? (h == null ? void 0 : h.dash),
|
|
2593
|
+
markers: g.markers,
|
|
2594
|
+
step: g.step,
|
|
2593
2595
|
marker: h == null ? void 0 : h.marker
|
|
2594
2596
|
});
|
|
2595
2597
|
break;
|
|
2596
2598
|
case "area":
|
|
2597
2599
|
t.push({
|
|
2598
|
-
...
|
|
2600
|
+
...p,
|
|
2599
2601
|
kind: "area",
|
|
2600
2602
|
y0: d.y0,
|
|
2601
2603
|
baseline: 0,
|
|
2602
|
-
fillOpacity:
|
|
2603
|
-
strokeWidth:
|
|
2604
|
-
dash:
|
|
2604
|
+
fillOpacity: g.fillOpacity,
|
|
2605
|
+
strokeWidth: g.strokeWidth,
|
|
2606
|
+
dash: g.dash ?? (h == null ? void 0 : h.dash),
|
|
2605
2607
|
hatch: h == null ? void 0 : h.hatch,
|
|
2606
2608
|
edges: l.stacked !== null
|
|
2607
2609
|
});
|
|
@@ -2610,7 +2612,7 @@ class Ln {
|
|
|
2610
2612
|
const m = r.get(l.order);
|
|
2611
2613
|
if (m === void 0) break;
|
|
2612
2614
|
t.push({
|
|
2613
|
-
...
|
|
2615
|
+
...p,
|
|
2614
2616
|
kind: "bar",
|
|
2615
2617
|
y0: a.y0,
|
|
2616
2618
|
baseline: 0,
|
|
@@ -2625,7 +2627,7 @@ class Ln {
|
|
|
2625
2627
|
const m = r.get(l.order);
|
|
2626
2628
|
if (m === void 0) break;
|
|
2627
2629
|
t.push({
|
|
2628
|
-
...
|
|
2630
|
+
...p,
|
|
2629
2631
|
kind: "box",
|
|
2630
2632
|
box: a.box,
|
|
2631
2633
|
offset: m.offset,
|
|
@@ -2635,27 +2637,27 @@ class Ln {
|
|
|
2635
2637
|
break;
|
|
2636
2638
|
}
|
|
2637
2639
|
case "scatter":
|
|
2638
|
-
t.push({ ...
|
|
2640
|
+
t.push({ ...p, kind: "scatter", radius: g.radius, marker: h == null ? void 0 : h.marker });
|
|
2639
2641
|
break;
|
|
2640
2642
|
case "state": {
|
|
2641
|
-
const m = this.lanePx(
|
|
2643
|
+
const m = this.lanePx(g, u);
|
|
2642
2644
|
t.push({
|
|
2643
|
-
...
|
|
2645
|
+
...p,
|
|
2644
2646
|
kind: "state",
|
|
2645
|
-
colors:
|
|
2647
|
+
colors: g.states.map((y) => this.paint(y.color)),
|
|
2646
2648
|
laneTop: m.top,
|
|
2647
2649
|
laneBottom: m.bottom,
|
|
2648
2650
|
lastEnd: this.lastEnd(l, a, c),
|
|
2649
|
-
hatches: this.marked() ?
|
|
2651
|
+
hatches: this.marked() ? g.states.map((y) => (e ?? (e = this.stateHatches())).get(y.label) ?? "none") : null
|
|
2650
2652
|
});
|
|
2651
2653
|
break;
|
|
2652
2654
|
}
|
|
2653
2655
|
case "matrix": {
|
|
2654
|
-
const m = Gt(
|
|
2656
|
+
const m = Gt(g.coloring, this.theme ?? K).map((y) => this.paint(y));
|
|
2655
2657
|
t.push({
|
|
2656
|
-
...
|
|
2658
|
+
...p,
|
|
2657
2659
|
kind: "matrix",
|
|
2658
|
-
buckets: l.buckets ?? (l.buckets = an(a,
|
|
2660
|
+
buckets: l.buckets ?? (l.buckets = an(a, g.coloring, m.length)),
|
|
2659
2661
|
colors: m,
|
|
2660
2662
|
hatches: this.marked() ? m.map((y, v) => Qt(v)) : null,
|
|
2661
2663
|
width: Kt(
|
|
@@ -2679,7 +2681,7 @@ class Ln {
|
|
|
2679
2681
|
compute their offsets from different group widths and lie on top of one
|
|
2680
2682
|
another. */
|
|
2681
2683
|
placements() {
|
|
2682
|
-
const t = this.seriesInOrder().filter((i) => i.config.hidden !== !0), e =
|
|
2684
|
+
const t = this.seriesInOrder().filter((i) => i.config.hidden !== !0), e = fo(
|
|
2683
2685
|
t.map((i) => ({
|
|
2684
2686
|
order: i.order,
|
|
2685
2687
|
kind: i.config.kind,
|
|
@@ -2695,7 +2697,7 @@ class Ln {
|
|
|
2695
2697
|
const r = e.get(i.order);
|
|
2696
2698
|
if (r === void 0) continue;
|
|
2697
2699
|
const l = s.scale.domain;
|
|
2698
|
-
n.set(i.order, uo(
|
|
2700
|
+
n.set(i.order, ho(uo(r.step, l[1] - l[0]), r.fraction, r.index, r.size));
|
|
2699
2701
|
}
|
|
2700
2702
|
return n;
|
|
2701
2703
|
}
|
|
@@ -2710,7 +2712,7 @@ class Ln {
|
|
|
2710
2712
|
const l = r.x[r.length - 1];
|
|
2711
2713
|
l > i && (i = l);
|
|
2712
2714
|
}
|
|
2713
|
-
return
|
|
2715
|
+
return Si(e.x, e.length, i, t.step ?? 0, n.scale.domain[1]);
|
|
2714
2716
|
}
|
|
2715
2717
|
/** Lane of a state series in pixels. Without a value the whole domain of its y
|
|
2716
2718
|
axis: a single series fills its band, a stack gets a domain with one unit per
|
|
@@ -2724,7 +2726,7 @@ class Ln {
|
|
|
2724
2726
|
const t = this.seriesCtx, e = this.theme;
|
|
2725
2727
|
if (!t || !e) return;
|
|
2726
2728
|
const n = typeof performance > "u" ? 0 : performance.now();
|
|
2727
|
-
|
|
2729
|
+
Gi(t, {
|
|
2728
2730
|
width: this.cssWidth,
|
|
2729
2731
|
height: this.cssHeight,
|
|
2730
2732
|
plot: this.layout.plot,
|
|
@@ -2737,7 +2739,7 @@ class Ln {
|
|
|
2737
2739
|
}
|
|
2738
2740
|
drawOverlayLayer() {
|
|
2739
2741
|
const t = this.overlayCtx, e = this.theme;
|
|
2740
|
-
!t || !e || (
|
|
2742
|
+
!t || !e || (Ui(t, {
|
|
2741
2743
|
width: this.cssWidth,
|
|
2742
2744
|
height: this.cssHeight,
|
|
2743
2745
|
plot: this.layout.plot,
|
|
@@ -2780,7 +2782,7 @@ class Ln {
|
|
|
2780
2782
|
const s = this.findAxis("x", n.primary.entry.config.xAxisId);
|
|
2781
2783
|
if (s !== null && this.share({ axisId: s.id, value: s.scale.fromPx(n.state.hit.xPx) }), i !== this.hoverKey) {
|
|
2782
2784
|
const r = n.primary.entry.config.xAxisId;
|
|
2783
|
-
this.hoverKey = i, this.hoverXLabel = this.xLabel(r, n.primary.xValue,
|
|
2785
|
+
this.hoverKey = i, this.hoverXLabel = this.xLabel(r, n.primary.xValue, xo(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();
|
|
2784
2786
|
}
|
|
2785
2787
|
return !0;
|
|
2786
2788
|
}
|
|
@@ -2793,15 +2795,15 @@ class Ln {
|
|
|
2793
2795
|
this.releaseKey(), this.activeBy = null, this.share(null), !(this.hover === null && this.hoverKey === "") && (this.hover = null, this.hoverKey = "", this.markOverlayDirty(), this.pushHoverSnapshot());
|
|
2794
2796
|
}
|
|
2795
2797
|
hitTest(t, e) {
|
|
2796
|
-
var
|
|
2797
|
-
const n = ((
|
|
2798
|
+
var g;
|
|
2799
|
+
const n = ((g = this.tooltip) == null ? void 0 : g.mode) ?? "x", i = [];
|
|
2798
2800
|
let s;
|
|
2799
2801
|
if (this.seriesInOrder().forEach((d, m) => {
|
|
2800
2802
|
const y = d.materialized;
|
|
2801
2803
|
if (y === null || y.length === 0 || d.config.hidden === !0) return;
|
|
2802
|
-
const v = d.config, b = this.findAxis("x", v.xAxisId),
|
|
2803
|
-
if (b === null ||
|
|
2804
|
-
const M = b.scale.fromPx(t), F =
|
|
2804
|
+
const v = d.config, b = this.findAxis("x", v.xAxisId), I = this.findAxis("y", v.yAxisId);
|
|
2805
|
+
if (b === null || I === null) return;
|
|
2806
|
+
const M = b.scale.fromPx(t), F = I.scale.fromPx(e), w = this.hitIn(d, y, b, I, e, M, F, n);
|
|
2805
2807
|
w !== null && i.push({
|
|
2806
2808
|
entry: d,
|
|
2807
2809
|
index: w.index,
|
|
@@ -2826,8 +2828,8 @@ class Ln {
|
|
|
2826
2828
|
let d = Number.POSITIVE_INFINITY;
|
|
2827
2829
|
const m = r.filter((y) => y.covers);
|
|
2828
2830
|
for (const y of m.length > 0 ? m : r) {
|
|
2829
|
-
const v = (y.markX ?? y.px) - t, b = y.py - e,
|
|
2830
|
-
(
|
|
2831
|
+
const v = (y.markX ?? y.px) - t, b = y.py - e, I = v * v + b * b;
|
|
2832
|
+
(I < d || I === d && y.covers) && (d = I, a = y);
|
|
2831
2833
|
}
|
|
2832
2834
|
if (m.length === 0 && d > rn * rn) {
|
|
2833
2835
|
for (const y of i)
|
|
@@ -2847,7 +2849,7 @@ class Ln {
|
|
|
2847
2849
|
// An area is always included: it covers the pointer, otherwise it
|
|
2848
2850
|
// would not have reported a hit at all. Only points have to share the
|
|
2849
2851
|
// x position.
|
|
2850
|
-
(d) => d.areal || Math.abs(d.px - a.px) <=
|
|
2852
|
+
(d) => d.areal || Math.abs(d.px - a.px) <= po
|
|
2851
2853
|
), u = c.map((d) => ({
|
|
2852
2854
|
seriesName: d.name,
|
|
2853
2855
|
color: d.color,
|
|
@@ -2915,7 +2917,7 @@ class Ln {
|
|
|
2915
2917
|
const e = this.emphasised();
|
|
2916
2918
|
if (e === null) return !1;
|
|
2917
2919
|
if (e.config.kind === "matrix") return this.cellKey(t.key, e);
|
|
2918
|
-
const n = t.shiftKey ? void 0 :
|
|
2920
|
+
const n = t.shiftKey ? void 0 : Eo[t.key];
|
|
2919
2921
|
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;
|
|
2920
2922
|
}
|
|
2921
2923
|
/** Zoom and pan by key (Q6), only where the caller controls the domain:
|
|
@@ -2969,10 +2971,10 @@ class Ln {
|
|
|
2969
2971
|
cellKey(t, e) {
|
|
2970
2972
|
const n = e.materialized, i = this.keyCell ?? this.lastCell(e);
|
|
2971
2973
|
if (i === null) return !1;
|
|
2972
|
-
const s =
|
|
2974
|
+
const s = Fo[t];
|
|
2973
2975
|
let r;
|
|
2974
2976
|
if (s !== void 0) r = je(n, i, s);
|
|
2975
|
-
else if (t === "Home" || t === "End") r =
|
|
2977
|
+
else if (t === "Home" || t === "End") r = Xi(n, i, t === "Home" ? "start" : "end");
|
|
2976
2978
|
else return !1;
|
|
2977
2979
|
return r === i && (s === "up" || s === "down") && this.walkable().length > 1 ? (this.changeSeries(s === "down" ? 1 : -1), !0) : (this.showCell(e, r), !0);
|
|
2978
2980
|
}
|
|
@@ -3021,7 +3023,7 @@ class Ln {
|
|
|
3021
3023
|
this.readoutTimer = null;
|
|
3022
3024
|
const t = this.readoutEl;
|
|
3023
3025
|
t !== null && this.activeBy === "keyboard" && (t.textContent = this.readoutText());
|
|
3024
|
-
},
|
|
3026
|
+
}, So));
|
|
3025
3027
|
}
|
|
3026
3028
|
readoutText() {
|
|
3027
3029
|
var s;
|
|
@@ -3044,7 +3046,7 @@ class Ln {
|
|
|
3044
3046
|
return t.forEach((n, i) => {
|
|
3045
3047
|
const s = it(n.entry.config), r = n.entry.stacked;
|
|
3046
3048
|
if (s === void 0 || r === null || t.some((c, u) => u > i && it(c.entry.config) === s)) return;
|
|
3047
|
-
const l = r.total[n.index], a = r.normalize ? (n.entry.config.format ??
|
|
3049
|
+
const l = r.total[n.index], a = r.normalize ? (n.entry.config.format ?? Lt)(l) : this.formatY(n.entry, l);
|
|
3048
3050
|
e.push({ after: i, name: this.wording.stackTotal, value: a });
|
|
3049
3051
|
}), e;
|
|
3050
3052
|
}
|
|
@@ -3053,7 +3055,7 @@ class Ln {
|
|
|
3053
3055
|
scheduleSummary() {
|
|
3054
3056
|
this.summaryEl !== null && (this.summaryTimer !== null && clearTimeout(this.summaryTimer), this.summaryTimer = setTimeout(() => {
|
|
3055
3057
|
this.summaryTimer = null, this.summaryEl !== null && (this.summaryEl.textContent = this.summaryText());
|
|
3056
|
-
},
|
|
3058
|
+
}, Lo));
|
|
3057
3059
|
}
|
|
3058
3060
|
/** Kind of content, series by name, the visible stretch, each series' range
|
|
3059
3061
|
in it and the keys (R10). A band has no range - its values are states. */
|
|
@@ -3094,9 +3096,9 @@ class Ln {
|
|
|
3094
3096
|
var s, r, l;
|
|
3095
3097
|
const n = t.config;
|
|
3096
3098
|
if (n.format !== void 0 && ((s = t.stacked) == null ? void 0 : s.normalize) !== !0) return n.format(e);
|
|
3097
|
-
if (n.kind === "matrix") return
|
|
3099
|
+
if (n.kind === "matrix") return Lt(e);
|
|
3098
3100
|
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;
|
|
3099
|
-
return i === void 0 ?
|
|
3101
|
+
return i === void 0 ? Lt(e) : i(e);
|
|
3100
3102
|
}
|
|
3101
3103
|
/** A y axis' `tickFormat`; without one, an axis that carries a normalised
|
|
3102
3104
|
stack reads in percent (K5). */
|
|
@@ -3132,18 +3134,18 @@ class Ln {
|
|
|
3132
3134
|
var f;
|
|
3133
3135
|
const n = this.wording, i = t[0].config.xAxisId, s = this.findAxis("x", i);
|
|
3134
3136
|
if (s === null) return null;
|
|
3135
|
-
const [r, l] = s.scale.domain, a =
|
|
3137
|
+
const [r, l] = s.scale.domain, a = ji(
|
|
3136
3138
|
t.map((h) => {
|
|
3137
|
-
const
|
|
3138
|
-
return h.stacked !== null ? { ...
|
|
3139
|
+
const p = h.materialized;
|
|
3140
|
+
return h.stacked !== null ? { ...p, y: h.stacked.value, y0: null } : h.config.kind === "state" ? { ...p, changesOnly: !0 } : p;
|
|
3139
3141
|
}),
|
|
3140
3142
|
r,
|
|
3141
3143
|
l
|
|
3142
3144
|
);
|
|
3143
3145
|
let c = !1;
|
|
3144
3146
|
for (let h = 1; h < a.x.length && !c; h++) {
|
|
3145
|
-
const
|
|
3146
|
-
c =
|
|
3147
|
+
const p = a.x[h] - a.x[h - 1];
|
|
3148
|
+
c = p > 0 && p < j;
|
|
3147
3149
|
}
|
|
3148
3150
|
const u = n.tableCaption(this.xLabel(i, r), this.xLabel(i, l));
|
|
3149
3151
|
return {
|
|
@@ -3152,16 +3154,16 @@ class Ln {
|
|
|
3152
3154
|
columns: [
|
|
3153
3155
|
((f = this.findAxisConfig("x", i)) == null ? void 0 : f.label) ?? n.positionColumn,
|
|
3154
3156
|
...t.flatMap((h) => {
|
|
3155
|
-
const
|
|
3156
|
-
return h.config.kind !== "box" ? [
|
|
3157
|
+
const p = this.nameFor(h, e.indexOf(h));
|
|
3158
|
+
return h.config.kind !== "box" ? [p] : this.boxParts(h, null).map((g) => `${p} – ${g.label}`);
|
|
3157
3159
|
})
|
|
3158
3160
|
],
|
|
3159
|
-
rows: a.x.map((h,
|
|
3161
|
+
rows: a.x.map((h, p) => [
|
|
3160
3162
|
this.xLabel(i, h, c),
|
|
3161
|
-
...t.flatMap((
|
|
3163
|
+
...t.flatMap((g, d) => {
|
|
3162
3164
|
var v;
|
|
3163
|
-
const m = a.courses[d], y = ((v = a.at[
|
|
3164
|
-
return
|
|
3165
|
+
const m = a.courses[d], y = ((v = a.at[p]) == null ? void 0 : v[d]) ?? -1;
|
|
3166
|
+
return g.config.kind === "box" ? this.boxCells(g, m, y) : [this.cellText(g, m, y)];
|
|
3165
3167
|
})
|
|
3166
3168
|
])
|
|
3167
3169
|
};
|
|
@@ -3195,8 +3197,8 @@ class Ln {
|
|
|
3195
3197
|
if (n === null || n.w === null || i === null || s === null) return null;
|
|
3196
3198
|
const [r, l] = i.scale.domain, a = [];
|
|
3197
3199
|
for (let h = 0; h < n.length; h++) {
|
|
3198
|
-
const
|
|
3199
|
-
|
|
3200
|
+
const p = n.x[h], g = n.w[h];
|
|
3201
|
+
p < r || p > l || !Number.isFinite(g) || a.push([this.xLabel(i.id, p), s.format(n.y[h]), this.formatY(t, g)]);
|
|
3200
3202
|
}
|
|
3201
3203
|
const c = this.wording;
|
|
3202
3204
|
return {
|
|
@@ -3220,7 +3222,7 @@ class Ln {
|
|
|
3220
3222
|
}
|
|
3221
3223
|
if (t.config.kind !== "matrix") this.showPosition(t, n, !1);
|
|
3222
3224
|
else {
|
|
3223
|
-
const i = this.keyCell, s = t.materialized, r = i !== null &&
|
|
3225
|
+
const i = this.keyCell, s = t.materialized, r = i !== null && Qi(s, { x: n, y: i.y }) ? { x: n, y: i.y } : this.columnStart(t, n);
|
|
3224
3226
|
r !== null && this.showCell(t, r, !1);
|
|
3225
3227
|
}
|
|
3226
3228
|
}
|
|
@@ -3232,12 +3234,12 @@ class Ln {
|
|
|
3232
3234
|
if (t !== this.syncId) {
|
|
3233
3235
|
if (this.syncId !== null) {
|
|
3234
3236
|
this.share(null);
|
|
3235
|
-
const e =
|
|
3236
|
-
e == null || e.delete(this), (e == null ? void 0 : e.size) === 0 &&
|
|
3237
|
+
const e = Ft.get(this.syncId);
|
|
3238
|
+
e == null || e.delete(this), (e == null ? void 0 : e.size) === 0 && Ft.delete(this.syncId), this.synced = null, this.markOverlayDirty();
|
|
3237
3239
|
}
|
|
3238
3240
|
if (this.syncId = t, t !== null) {
|
|
3239
|
-
const e =
|
|
3240
|
-
e.add(this),
|
|
3241
|
+
const e = Ft.get(t) ?? /* @__PURE__ */ new Set();
|
|
3242
|
+
e.add(this), Ft.set(t, e);
|
|
3241
3243
|
}
|
|
3242
3244
|
}
|
|
3243
3245
|
}
|
|
@@ -3245,7 +3247,7 @@ class Ln {
|
|
|
3245
3247
|
var e, n;
|
|
3246
3248
|
if (!(this.syncId === null || (t == null ? void 0 : t.value) === ((e = this.sent) == null ? void 0 : e.value) && (t == null ? void 0 : t.axisId) === ((n = this.sent) == null ? void 0 : n.axisId))) {
|
|
3247
3249
|
this.sent = t;
|
|
3248
|
-
for (const i of
|
|
3250
|
+
for (const i of Ft.get(this.syncId) ?? [])
|
|
3249
3251
|
i !== this && (i.synced = t, i.markOverlayDirty());
|
|
3250
3252
|
}
|
|
3251
3253
|
}
|
|
@@ -3353,14 +3355,14 @@ class Ln {
|
|
|
3353
3355
|
row with no box) every value is empty, and so is one not given. */
|
|
3354
3356
|
boxParts(t, e) {
|
|
3355
3357
|
var l;
|
|
3356
|
-
const n = this.wording, i = ((l = t.materialized) == null ? void 0 : l.box) ?? null, s = (a) => a === void 0 || !Number.isFinite(a) ? "" : this.formatY(t, a), r =
|
|
3358
|
+
const n = this.wording, i = ((l = t.materialized) == null ? void 0 : l.box) ?? null, s = (a) => a === void 0 || !Number.isFinite(a) ? "" : this.formatY(t, a), r = mo.map((a) => ({ label: n[a], value: s(e == null ? void 0 : e[a]) }));
|
|
3357
3359
|
if ((i == null ? void 0 : i.mean) != null && r.push({ label: n.mean, value: s(e == null ? void 0 : e.mean) }), (i == null ? void 0 : i.notchLower) != null) {
|
|
3358
3360
|
const a = s(e == null ? void 0 : e.notchLower), c = s(e == null ? void 0 : e.notchUpper);
|
|
3359
3361
|
r.push({ label: n.notch, value: a === "" || c === "" ? "" : `${a} – ${c}` });
|
|
3360
3362
|
}
|
|
3361
3363
|
if ((i == null ? void 0 : i.count) != null) {
|
|
3362
3364
|
const a = e == null ? void 0 : e.count;
|
|
3363
|
-
r.push({ label: n.count, value: a === void 0 || !Number.isFinite(a) ? "" :
|
|
3365
|
+
r.push({ label: n.count, value: a === void 0 || !Number.isFinite(a) ? "" : Lt(a) });
|
|
3364
3366
|
}
|
|
3365
3367
|
if ((i == null ? void 0 : i.outliers) != null) {
|
|
3366
3368
|
const a = (e == null ? void 0 : e.outliers) ?? [];
|
|
@@ -3402,9 +3404,9 @@ class Ln {
|
|
|
3402
3404
|
if (m < 0) return null;
|
|
3403
3405
|
const y = e.y[m];
|
|
3404
3406
|
if (Number.isNaN(y)) return null;
|
|
3405
|
-
const v = e.x[m], b =
|
|
3407
|
+
const v = e.x[m], b = An(e.x, u, m, this.lastEnd(t, e, n));
|
|
3406
3408
|
if (m === u - 1 && !(r < b)) return null;
|
|
3407
|
-
const
|
|
3409
|
+
const I = c.states[y | 0];
|
|
3408
3410
|
return {
|
|
3409
3411
|
index: m,
|
|
3410
3412
|
px: n.scale.toPx(v),
|
|
@@ -3413,12 +3415,12 @@ class Ln {
|
|
|
3413
3415
|
yValue: y,
|
|
3414
3416
|
marked: !1,
|
|
3415
3417
|
areal: !0,
|
|
3416
|
-
color:
|
|
3417
|
-
segment: { from: v, to: b, label: (
|
|
3418
|
+
color: I == null ? void 0 : I.color,
|
|
3419
|
+
segment: { from: v, to: b, label: (I == null ? void 0 : I.label) ?? "" }
|
|
3418
3420
|
};
|
|
3419
3421
|
}
|
|
3420
3422
|
if (c.kind === "matrix") {
|
|
3421
|
-
const d =
|
|
3423
|
+
const d = no(
|
|
3422
3424
|
e.x,
|
|
3423
3425
|
e.y,
|
|
3424
3426
|
u,
|
|
@@ -3430,12 +3432,12 @@ class Ln {
|
|
|
3430
3432
|
if (d < 0) return null;
|
|
3431
3433
|
const m = e.w, y = m === null ? Number.NaN : m[d];
|
|
3432
3434
|
if (!Number.isFinite(y)) return null;
|
|
3433
|
-
const v = e.x[d], b = e.y[d],
|
|
3434
|
-
return t.buckets ?? (t.buckets = an(e, c.coloring,
|
|
3435
|
+
const v = e.x[d], b = e.y[d], I = Gt(c.coloring, this.theme ?? K);
|
|
3436
|
+
return t.buckets ?? (t.buckets = an(e, c.coloring, I.length)), {
|
|
3435
3437
|
index: d,
|
|
3436
3438
|
px: n.scale.toPx(v),
|
|
3437
3439
|
py: i.scale.toPx(b),
|
|
3438
|
-
color:
|
|
3440
|
+
color: I[t.buckets[d]],
|
|
3439
3441
|
xValue: v,
|
|
3440
3442
|
// yValue stays the position on the y axis; the value that carries the
|
|
3441
3443
|
// colour stands in a field of its own. Colour alone can transport no
|
|
@@ -3446,20 +3448,20 @@ class Ln {
|
|
|
3446
3448
|
areal: !0
|
|
3447
3449
|
};
|
|
3448
3450
|
}
|
|
3449
|
-
const f = c.kind === "scatter" && a === "nearest" ?
|
|
3451
|
+
const f = c.kind === "scatter" && a === "nearest" ? qi(e.x, e.y, u, r, l, n.scale, i.scale) : c.kind === "line" && c.step === !0 ? Ue(e.x, u, r) : Ae(e.x, u, r);
|
|
3450
3452
|
if (f < 0) return null;
|
|
3451
3453
|
const h = e.y[f];
|
|
3452
3454
|
if (Number.isNaN(h)) return null;
|
|
3453
|
-
const
|
|
3455
|
+
const p = e.x[f], g = t.stacked === null || e.y0 === null ? Number.NaN : e.y0[f];
|
|
3454
3456
|
return {
|
|
3455
3457
|
index: f,
|
|
3456
|
-
px: n.scale.toPx(
|
|
3458
|
+
px: n.scale.toPx(p),
|
|
3457
3459
|
py: i.scale.toPx(h),
|
|
3458
|
-
xValue:
|
|
3460
|
+
xValue: p,
|
|
3459
3461
|
yValue: t.stacked === null ? h : t.stacked.value[f],
|
|
3460
3462
|
marked: !0,
|
|
3461
3463
|
areal: !1,
|
|
3462
|
-
covers: l >= Math.min(
|
|
3464
|
+
covers: l >= Math.min(g, h) && l <= Math.max(g, h),
|
|
3463
3465
|
box: e.box === null ? void 0 : ln(e.box, f)
|
|
3464
3466
|
};
|
|
3465
3467
|
}
|
|
@@ -3519,10 +3521,10 @@ class Ln {
|
|
|
3519
3521
|
}
|
|
3520
3522
|
/** Class name of the measuring span for tick labels - keeps the CSS and the
|
|
3521
3523
|
layout in step. */
|
|
3522
|
-
x(
|
|
3523
|
-
const
|
|
3524
|
+
x(En, "classTick", yt);
|
|
3525
|
+
const Fn = _n(null);
|
|
3524
3526
|
function ft(o) {
|
|
3525
|
-
const t =
|
|
3527
|
+
const t = Bn(Fn);
|
|
3526
3528
|
if (t === null && wt)
|
|
3527
3529
|
throw new Error(
|
|
3528
3530
|
`@umriss-ui/charts: <${o}> must be used inside a <Chart>.`
|
|
@@ -3531,83 +3533,83 @@ function ft(o) {
|
|
|
3531
3533
|
}
|
|
3532
3534
|
function bt(o, t) {
|
|
3533
3535
|
const e = ft(o), n = J(null);
|
|
3534
|
-
|
|
3536
|
+
B(() => {
|
|
3535
3537
|
if (e !== null)
|
|
3536
3538
|
return n.current = e.registerSeries(t), () => {
|
|
3537
3539
|
n.current !== null && e.unregisterSeries(n.current), n.current = null;
|
|
3538
3540
|
};
|
|
3539
|
-
}, [e]),
|
|
3541
|
+
}, [e]), B(() => {
|
|
3540
3542
|
e !== null && n.current !== null && e.updateSeries(n.current, t);
|
|
3541
3543
|
});
|
|
3542
3544
|
}
|
|
3543
|
-
function
|
|
3545
|
+
function Dn(o, t) {
|
|
3544
3546
|
const e = ft(o), n = J(null);
|
|
3545
|
-
|
|
3547
|
+
B(() => {
|
|
3546
3548
|
if (e !== null)
|
|
3547
3549
|
return n.current = e.registerAxis(t), () => {
|
|
3548
3550
|
n.current !== null && e.unregisterAxis(n.current), n.current = null;
|
|
3549
3551
|
};
|
|
3550
|
-
}, [e]),
|
|
3552
|
+
}, [e]), B(() => {
|
|
3551
3553
|
e !== null && n.current !== null && e.updateAxis(n.current, t);
|
|
3552
3554
|
});
|
|
3553
3555
|
}
|
|
3554
|
-
function
|
|
3556
|
+
function Pn(o, t) {
|
|
3555
3557
|
const e = ft(o), n = J(null);
|
|
3556
|
-
|
|
3558
|
+
B(() => {
|
|
3557
3559
|
if (e !== null)
|
|
3558
3560
|
return n.current = e.registerLimit(t), () => {
|
|
3559
3561
|
n.current !== null && e.unregisterLimit(n.current), n.current = null;
|
|
3560
3562
|
};
|
|
3561
|
-
}, [e]),
|
|
3563
|
+
}, [e]), B(() => {
|
|
3562
3564
|
e !== null && n.current !== null && e.updateLimit(n.current, t);
|
|
3563
3565
|
});
|
|
3564
3566
|
}
|
|
3565
|
-
function
|
|
3567
|
+
function Do(o, t) {
|
|
3566
3568
|
const e = ft(o);
|
|
3567
|
-
|
|
3569
|
+
B(() => {
|
|
3568
3570
|
if (e !== null)
|
|
3569
3571
|
return e.registerLegend(t), () => e.unregisterLegend();
|
|
3570
|
-
}, [e]),
|
|
3572
|
+
}, [e]), B(() => {
|
|
3571
3573
|
e == null || e.updateLegend(t);
|
|
3572
3574
|
});
|
|
3573
3575
|
}
|
|
3574
|
-
function
|
|
3576
|
+
function Po(o, t) {
|
|
3575
3577
|
const e = ft(o);
|
|
3576
|
-
|
|
3578
|
+
B(() => {
|
|
3577
3579
|
if (e !== null)
|
|
3578
3580
|
return e.registerDataTable(t), () => e.unregisterDataTable();
|
|
3579
3581
|
}, [e, t]);
|
|
3580
3582
|
}
|
|
3581
|
-
function
|
|
3583
|
+
function $o(o, t) {
|
|
3582
3584
|
const e = ft(o);
|
|
3583
|
-
|
|
3585
|
+
B(() => {
|
|
3584
3586
|
if (e !== null)
|
|
3585
3587
|
return e.registerTooltip(t), () => e.unregisterTooltip();
|
|
3586
|
-
}, [e]),
|
|
3588
|
+
}, [e]), B(() => {
|
|
3587
3589
|
e == null || e.updateTooltip(t);
|
|
3588
3590
|
});
|
|
3589
3591
|
}
|
|
3590
|
-
function
|
|
3592
|
+
function Oo(o, t, e) {
|
|
3591
3593
|
const { band: n, position: i, orientation: s } = o, r = {
|
|
3592
3594
|
left: `${n.x}px`,
|
|
3593
3595
|
top: `${n.y}px`,
|
|
3594
3596
|
width: `${n.width}px`,
|
|
3595
3597
|
height: `${n.height}px`
|
|
3596
3598
|
}, l = qt + Xt;
|
|
3597
|
-
return /* @__PURE__ */
|
|
3599
|
+
return /* @__PURE__ */ R(
|
|
3598
3600
|
"div",
|
|
3599
3601
|
{
|
|
3600
3602
|
className: `uc-axis uc-axis-${s} uc-axis-${i}`,
|
|
3601
3603
|
style: r,
|
|
3602
3604
|
"data-axis": o.id,
|
|
3603
3605
|
children: [
|
|
3604
|
-
/* @__PURE__ */
|
|
3606
|
+
/* @__PURE__ */ N("span", { className: "uc-axis-line" }),
|
|
3605
3607
|
o.ticks.map((a) => {
|
|
3606
3608
|
if (s === "y") {
|
|
3607
|
-
const
|
|
3608
|
-
return /* @__PURE__ */
|
|
3609
|
-
/* @__PURE__ */
|
|
3610
|
-
!
|
|
3609
|
+
const f = Math.round(a.px - n.y), h = t.some((p) => !p.inside && Math.abs(p.px - a.px) < p.height);
|
|
3610
|
+
return /* @__PURE__ */ R("span", { className: "uc-tick", style: { top: `${f}px` }, children: [
|
|
3611
|
+
/* @__PURE__ */ N("span", { className: "uc-tick-mark" }),
|
|
3612
|
+
!h && /* @__PURE__ */ N(
|
|
3611
3613
|
"span",
|
|
3612
3614
|
{
|
|
3613
3615
|
className: "uc-tick-label",
|
|
@@ -3617,10 +3619,12 @@ function Po(o, t, e) {
|
|
|
3617
3619
|
)
|
|
3618
3620
|
] }, a.value);
|
|
3619
3621
|
}
|
|
3620
|
-
const c = Math.round(a.px - n.x)
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3622
|
+
const c = Math.round(a.px - n.x), u = t.some(
|
|
3623
|
+
(f) => f.labelLeft < a.labelLeft + a.labelWidth && a.labelLeft < f.labelLeft + f.width
|
|
3624
|
+
);
|
|
3625
|
+
return /* @__PURE__ */ R("span", { className: "uc-tick", style: { left: `${c}px` }, children: [
|
|
3626
|
+
/* @__PURE__ */ N("span", { className: "uc-tick-mark" }),
|
|
3627
|
+
!u && /* @__PURE__ */ N(
|
|
3624
3628
|
"span",
|
|
3625
3629
|
{
|
|
3626
3630
|
className: "uc-tick-label",
|
|
@@ -3633,7 +3637,7 @@ function Po(o, t, e) {
|
|
|
3633
3637
|
)
|
|
3634
3638
|
] }, a.value);
|
|
3635
3639
|
}),
|
|
3636
|
-
o.breaks.map((a, c) => /* @__PURE__ */
|
|
3640
|
+
o.breaks.map((a, c) => /* @__PURE__ */ N(
|
|
3637
3641
|
"span",
|
|
3638
3642
|
{
|
|
3639
3643
|
className: "uc-break",
|
|
@@ -3643,42 +3647,50 @@ function Po(o, t, e) {
|
|
|
3643
3647
|
`break-${c}`
|
|
3644
3648
|
)),
|
|
3645
3649
|
t.map(
|
|
3646
|
-
(a) => s === "y" ? /* @__PURE__ */
|
|
3650
|
+
(a) => s === "y" ? /* @__PURE__ */ N(
|
|
3647
3651
|
"span",
|
|
3648
3652
|
{
|
|
3649
3653
|
className: "uc-limit-label",
|
|
3650
3654
|
"data-severity": a.severity,
|
|
3651
3655
|
"data-role": a.role,
|
|
3656
|
+
"data-own": a.color === void 0 ? void 0 : "",
|
|
3652
3657
|
style: {
|
|
3653
3658
|
top: `${Math.round(a.px - n.y)}px`,
|
|
3654
3659
|
// Inside: against the plot's far edge, 4 px in.
|
|
3655
3660
|
...a.inside ? i === "left" ? { right: `${n.x + n.width - (e.x + e.width) + 4}px` } : { left: `${e.x - n.x + 4}px` } : {}
|
|
3656
3661
|
},
|
|
3657
|
-
children: a
|
|
3662
|
+
children: un(a)
|
|
3658
3663
|
},
|
|
3659
3664
|
`limit-${a.id}`
|
|
3660
|
-
) : /* @__PURE__ */
|
|
3665
|
+
) : /* @__PURE__ */ N(
|
|
3661
3666
|
"span",
|
|
3662
3667
|
{
|
|
3663
3668
|
className: "uc-limit-label",
|
|
3664
3669
|
"data-severity": a.severity,
|
|
3665
3670
|
"data-role": a.role,
|
|
3671
|
+
"data-own": a.color === void 0 ? void 0 : "",
|
|
3666
3672
|
style: {
|
|
3667
3673
|
left: `${Math.round(a.labelLeft - n.x)}px`,
|
|
3668
3674
|
[i === "top" ? "bottom" : "top"]: `${l}px`
|
|
3669
3675
|
},
|
|
3670
|
-
children: a
|
|
3676
|
+
children: un(a)
|
|
3671
3677
|
},
|
|
3672
3678
|
`limit-${a.id}`
|
|
3673
3679
|
)
|
|
3674
3680
|
),
|
|
3675
|
-
o.label !== void 0 && o.label !== "" && /* @__PURE__ */
|
|
3681
|
+
o.label !== void 0 && o.label !== "" && /* @__PURE__ */ N("span", { className: "uc-axis-title", children: o.label })
|
|
3676
3682
|
]
|
|
3677
3683
|
},
|
|
3678
3684
|
o.key
|
|
3679
3685
|
);
|
|
3680
3686
|
}
|
|
3681
|
-
function
|
|
3687
|
+
function un(o) {
|
|
3688
|
+
return o.color === void 0 ? o.label : /* @__PURE__ */ R(Nt, { children: [
|
|
3689
|
+
/* @__PURE__ */ N("span", { className: "uc-limit-mark", style: { color: o.color }, "aria-hidden": "true" }),
|
|
3690
|
+
o.label
|
|
3691
|
+
] });
|
|
3692
|
+
}
|
|
3693
|
+
function Co({ scene: o, empty: t }) {
|
|
3682
3694
|
const e = Wt(
|
|
3683
3695
|
o.subscribeLayout,
|
|
3684
3696
|
o.getLayoutSnapshot,
|
|
@@ -3686,8 +3698,8 @@ function $o({ scene: o, empty: t }) {
|
|
|
3686
3698
|
), { layout: n } = e;
|
|
3687
3699
|
if (n.plot.width <= 0 || n.plot.height <= 0) return null;
|
|
3688
3700
|
const { plot: i } = n;
|
|
3689
|
-
return /* @__PURE__ */
|
|
3690
|
-
e.empty && /* @__PURE__ */
|
|
3701
|
+
return /* @__PURE__ */ R("div", { className: "uc-axes", children: [
|
|
3702
|
+
e.empty && /* @__PURE__ */ N(
|
|
3691
3703
|
"div",
|
|
3692
3704
|
{
|
|
3693
3705
|
className: "uc-empty",
|
|
@@ -3696,7 +3708,7 @@ function $o({ scene: o, empty: t }) {
|
|
|
3696
3708
|
}
|
|
3697
3709
|
),
|
|
3698
3710
|
n.axes.map(
|
|
3699
|
-
(s) =>
|
|
3711
|
+
(s) => Oo(
|
|
3700
3712
|
s,
|
|
3701
3713
|
e.limits.filter((r) => r.axisKey === s.key),
|
|
3702
3714
|
i
|
|
@@ -3704,9 +3716,9 @@ function $o({ scene: o, empty: t }) {
|
|
|
3704
3716
|
)
|
|
3705
3717
|
] });
|
|
3706
3718
|
}
|
|
3707
|
-
function
|
|
3719
|
+
function $n({ scene: o, state: t }) {
|
|
3708
3720
|
const e = o.getWording();
|
|
3709
|
-
return /* @__PURE__ */
|
|
3721
|
+
return /* @__PURE__ */ N(
|
|
3710
3722
|
"button",
|
|
3711
3723
|
{
|
|
3712
3724
|
type: "button",
|
|
@@ -3718,59 +3730,59 @@ function Pn({ scene: o, state: t }) {
|
|
|
3718
3730
|
}
|
|
3719
3731
|
);
|
|
3720
3732
|
}
|
|
3721
|
-
function
|
|
3722
|
-
const t =
|
|
3723
|
-
|
|
3733
|
+
function Wo({ scene: o }) {
|
|
3734
|
+
const t = dn();
|
|
3735
|
+
Po("DataTable", t);
|
|
3724
3736
|
const e = Wt(o.subscribeLayout, o.getLayoutSnapshot, o.getLayoutServerSnapshot), n = e.dataTable, i = (n == null ? void 0 : n.open) === !0, s = i ? o.dataTableGroups() : [], r = J(null), [l, a] = Se(null);
|
|
3725
|
-
if (
|
|
3726
|
-
var h,
|
|
3727
|
-
const u = (
|
|
3737
|
+
if (Vn(() => {
|
|
3738
|
+
var h, p;
|
|
3739
|
+
const u = (p = (h = r.current) == null ? void 0 : h.parentElement) == null ? void 0 : p.querySelector(":scope > .uc-plot");
|
|
3728
3740
|
if (u == null) return;
|
|
3729
3741
|
const f = { top: u.offsetTop, height: u.offsetHeight };
|
|
3730
|
-
a((
|
|
3742
|
+
a((g) => g !== null && g.top === f.top && g.height === f.height ? g : f);
|
|
3731
3743
|
}, [e, i]), n === null) return null;
|
|
3732
3744
|
const c = l === null ? void 0 : { top: l.top, height: l.height };
|
|
3733
|
-
return /* @__PURE__ */
|
|
3734
|
-
e.legend === null && /* @__PURE__ */
|
|
3745
|
+
return /* @__PURE__ */ R(Nt, { children: [
|
|
3746
|
+
e.legend === null && /* @__PURE__ */ N("div", { className: "uc-legend uc-legend-top", children: /* @__PURE__ */ N($n, { scene: o, state: n }) }),
|
|
3735
3747
|
i && // A tab stop of its own: the panel scrolls, and a keyboard has to be
|
|
3736
3748
|
// able to scroll it.
|
|
3737
|
-
/* @__PURE__ */
|
|
3738
|
-
/* @__PURE__ */
|
|
3739
|
-
/* @__PURE__ */
|
|
3740
|
-
/* @__PURE__ */
|
|
3741
|
-
/* @__PURE__ */
|
|
3742
|
-
f.slice(1).map((
|
|
3749
|
+
/* @__PURE__ */ N("div", { ref: r, id: n.id, className: "uc-data-panel", style: c, tabIndex: 0, children: s.map((u) => /* @__PURE__ */ R("table", { className: "uc-data-table", children: [
|
|
3750
|
+
/* @__PURE__ */ N("caption", { children: u.caption }),
|
|
3751
|
+
/* @__PURE__ */ N("thead", { children: /* @__PURE__ */ N("tr", { children: u.columns.map((f, h) => /* @__PURE__ */ N("th", { scope: "col", children: f }, h)) }) }),
|
|
3752
|
+
/* @__PURE__ */ N("tbody", { children: u.rows.map((f, h) => /* @__PURE__ */ R("tr", { children: [
|
|
3753
|
+
/* @__PURE__ */ N("th", { scope: "row", children: f[0] }),
|
|
3754
|
+
f.slice(1).map((p, g) => /* @__PURE__ */ N("td", { children: p }, g))
|
|
3743
3755
|
] }, h)) })
|
|
3744
3756
|
] }, u.key)) })
|
|
3745
3757
|
] });
|
|
3746
3758
|
}
|
|
3747
|
-
function
|
|
3759
|
+
function ds() {
|
|
3748
3760
|
const o = ft("DataTable");
|
|
3749
|
-
return o === null ? null : /* @__PURE__ */
|
|
3761
|
+
return o === null ? null : /* @__PURE__ */ N(Wo, { scene: o });
|
|
3750
3762
|
}
|
|
3751
|
-
function
|
|
3763
|
+
function Ho({
|
|
3752
3764
|
scene: o,
|
|
3753
3765
|
placement: t,
|
|
3754
3766
|
onToggle: e
|
|
3755
3767
|
}) {
|
|
3756
|
-
|
|
3768
|
+
Do("Legend", { placement: t });
|
|
3757
3769
|
const n = Wt(
|
|
3758
3770
|
o.subscribeLayout,
|
|
3759
3771
|
o.getLayoutSnapshot,
|
|
3760
3772
|
o.getLayoutServerSnapshot
|
|
3761
3773
|
), i = n.dataTable;
|
|
3762
|
-
return n.series.length === 0 && i === null ? null : /* @__PURE__ */
|
|
3774
|
+
return n.series.length === 0 && i === null ? null : /* @__PURE__ */ R("div", { className: `uc-legend uc-legend-${t}`, children: [
|
|
3763
3775
|
n.series.map((s) => {
|
|
3764
3776
|
const r = {
|
|
3765
3777
|
className: "uc-legend-item",
|
|
3766
3778
|
"data-hidden": s.hidden ? "" : void 0,
|
|
3767
3779
|
onPointerEnter: () => o.setHighlight(s.seriesIds),
|
|
3768
3780
|
onPointerLeave: () => o.setHighlight(null)
|
|
3769
|
-
}, l = /* @__PURE__ */
|
|
3770
|
-
s.mark === null ? /* @__PURE__ */
|
|
3781
|
+
}, l = /* @__PURE__ */ R(Nt, { children: [
|
|
3782
|
+
s.mark === null ? /* @__PURE__ */ N("span", { className: "uc-legend-chip", style: { background: s.color } }) : /* @__PURE__ */ N(On, { color: s.color, mark: s.mark }),
|
|
3771
3783
|
s.name
|
|
3772
3784
|
] });
|
|
3773
|
-
return e === void 0 ? /* @__PURE__ */
|
|
3785
|
+
return e === void 0 ? /* @__PURE__ */ N("span", { ...r, children: l }, s.id) : /* @__PURE__ */ N(
|
|
3774
3786
|
"button",
|
|
3775
3787
|
{
|
|
3776
3788
|
type: "button",
|
|
@@ -3782,18 +3794,18 @@ function Co({
|
|
|
3782
3794
|
s.id
|
|
3783
3795
|
);
|
|
3784
3796
|
}),
|
|
3785
|
-
i !== null && /* @__PURE__ */
|
|
3797
|
+
i !== null && /* @__PURE__ */ N($n, { scene: o, state: i })
|
|
3786
3798
|
] });
|
|
3787
3799
|
}
|
|
3788
|
-
const
|
|
3789
|
-
function
|
|
3800
|
+
const Ro = 3;
|
|
3801
|
+
function On({ color: o, mark: t }) {
|
|
3790
3802
|
var n;
|
|
3791
3803
|
const e = t.dash !== null ? (n = t.swatches) == null ? void 0 : n[0] : void 0;
|
|
3792
3804
|
if (e !== void 0)
|
|
3793
|
-
return /* @__PURE__ */
|
|
3794
|
-
/* @__PURE__ */
|
|
3795
|
-
/* @__PURE__ */
|
|
3796
|
-
/* @__PURE__ */
|
|
3805
|
+
return /* @__PURE__ */ R("svg", { className: "uc-legend-mark", width: 18, height: 10, viewBox: "0 0 18 10", "aria-hidden": "true", children: [
|
|
3806
|
+
/* @__PURE__ */ N("rect", { y: 3, width: 18, height: 7, fill: e.color, fillOpacity: e.opacity }),
|
|
3807
|
+
/* @__PURE__ */ N("path", { d: hn({ x: 0, y: 3, width: 18, height: 7 }, e.hatch), stroke: e.color, strokeWidth: 1 }),
|
|
3808
|
+
/* @__PURE__ */ N(
|
|
3797
3809
|
"line",
|
|
3798
3810
|
{
|
|
3799
3811
|
x1: 1,
|
|
@@ -3809,16 +3821,16 @@ function $n({ color: o, mark: t }) {
|
|
|
3809
3821
|
] });
|
|
3810
3822
|
if (t.swatches !== null) {
|
|
3811
3823
|
const i = t.swatches.length === 1 ? 10 : 8, s = i * t.swatches.length;
|
|
3812
|
-
return /* @__PURE__ */
|
|
3824
|
+
return /* @__PURE__ */ N("svg", { className: "uc-legend-mark", width: s, height: 10, viewBox: `0 0 ${s} 10`, "aria-hidden": "true", children: t.swatches.map((r, l) => (
|
|
3813
3825
|
// A nested svg clips its hatch to its own swatch.
|
|
3814
|
-
/* @__PURE__ */
|
|
3815
|
-
/* @__PURE__ */
|
|
3816
|
-
/* @__PURE__ */
|
|
3826
|
+
/* @__PURE__ */ R("svg", { x: l * i, y: 0, width: i, height: 10, children: [
|
|
3827
|
+
/* @__PURE__ */ N("rect", { width: i, height: 10, fill: r.color }),
|
|
3828
|
+
/* @__PURE__ */ N("path", { d: hn({ x: 0, y: 0, width: i, height: 10 }, r.hatch), stroke: t.ground, strokeWidth: 1 })
|
|
3817
3829
|
] }, l)
|
|
3818
3830
|
)) });
|
|
3819
3831
|
}
|
|
3820
|
-
return /* @__PURE__ */
|
|
3821
|
-
t.dash !== null && /* @__PURE__ */
|
|
3832
|
+
return /* @__PURE__ */ R("svg", { className: "uc-legend-mark", width: 18, height: 10, viewBox: "0 0 18 10", "aria-hidden": "true", children: [
|
|
3833
|
+
t.dash !== null && /* @__PURE__ */ N(
|
|
3822
3834
|
"line",
|
|
3823
3835
|
{
|
|
3824
3836
|
x1: 1,
|
|
@@ -3831,16 +3843,16 @@ function $n({ color: o, mark: t }) {
|
|
|
3831
3843
|
strokeDasharray: t.dash.length > 0 ? t.dash.join(" ") : void 0
|
|
3832
3844
|
}
|
|
3833
3845
|
),
|
|
3834
|
-
t.marker !== null && /* @__PURE__ */
|
|
3846
|
+
t.marker !== null && /* @__PURE__ */ N("path", { d: _o(t.marker, 9, 5, 3), fill: o })
|
|
3835
3847
|
] });
|
|
3836
3848
|
}
|
|
3837
|
-
function
|
|
3838
|
-
const e =
|
|
3849
|
+
function hn(o, t) {
|
|
3850
|
+
const e = In(o, t, Ro);
|
|
3839
3851
|
let n = "";
|
|
3840
3852
|
for (let i = 0; i < e.length; i += 4) n += `M${e[i]} ${e[i + 1]}L${e[i + 2]} ${e[i + 3]}`;
|
|
3841
3853
|
return n;
|
|
3842
3854
|
}
|
|
3843
|
-
function
|
|
3855
|
+
function _o(o, t, e, n) {
|
|
3844
3856
|
let i = "";
|
|
3845
3857
|
return Ee(
|
|
3846
3858
|
{
|
|
@@ -3856,52 +3868,52 @@ function Ho(o, t, e, n) {
|
|
|
3856
3868
|
n
|
|
3857
3869
|
), i;
|
|
3858
3870
|
}
|
|
3859
|
-
function
|
|
3871
|
+
function fs({ placement: o = "top", onToggle: t }) {
|
|
3860
3872
|
const e = ft("Legend");
|
|
3861
|
-
return e === null ? null : /* @__PURE__ */
|
|
3873
|
+
return e === null ? null : /* @__PURE__ */ N(Ho, { scene: e, placement: o, onToggle: t });
|
|
3862
3874
|
}
|
|
3863
|
-
function
|
|
3875
|
+
function Bo({ scene: o }) {
|
|
3864
3876
|
const t = Wt(
|
|
3865
3877
|
o.subscribeHover,
|
|
3866
3878
|
o.getHoverSnapshot,
|
|
3867
3879
|
o.getHoverServerSnapshot
|
|
3868
|
-
), e =
|
|
3880
|
+
), e = zn(
|
|
3869
3881
|
(i) => {
|
|
3870
3882
|
o.bindTooltip(i);
|
|
3871
3883
|
},
|
|
3872
3884
|
[o]
|
|
3873
3885
|
);
|
|
3874
|
-
if (
|
|
3886
|
+
if (B(() => {
|
|
3875
3887
|
o.markOverlayDirty();
|
|
3876
3888
|
}, [o, t.version]), t.tooltip === null) return null;
|
|
3877
3889
|
const n = t.hover;
|
|
3878
|
-
return /* @__PURE__ */
|
|
3879
|
-
/* @__PURE__ */
|
|
3880
|
-
/* @__PURE__ */
|
|
3890
|
+
return /* @__PURE__ */ N("div", { className: "uc-tooltip", ref: e, role: "presentation", children: n === null ? null : t.tooltip.render !== void 0 ? t.tooltip.render(n.hit) : /* @__PURE__ */ R(Nt, { children: [
|
|
3891
|
+
/* @__PURE__ */ N("div", { className: "uc-tooltip-head", children: t.xLabel }),
|
|
3892
|
+
/* @__PURE__ */ N("div", { className: "uc-tooltip-list", children: n.hit.points.map((i, s) => {
|
|
3881
3893
|
var l;
|
|
3882
3894
|
const r = t.rows[s];
|
|
3883
|
-
return /* @__PURE__ */
|
|
3884
|
-
/* @__PURE__ */
|
|
3885
|
-
(r == null ? void 0 : r.chip) != null ? /* @__PURE__ */
|
|
3886
|
-
/* @__PURE__ */
|
|
3895
|
+
return /* @__PURE__ */ R(Yn, { children: [
|
|
3896
|
+
/* @__PURE__ */ R("div", { className: "uc-tooltip-row", children: [
|
|
3897
|
+
(r == null ? void 0 : r.chip) != null ? /* @__PURE__ */ N(On, { color: r.chip.color, mark: r.chip.mark }) : /* @__PURE__ */ N("span", { className: "uc-tooltip-chip", style: { background: i.color } }),
|
|
3898
|
+
/* @__PURE__ */ R("span", { className: "uc-tooltip-name", children: [
|
|
3887
3899
|
i.seriesName,
|
|
3888
|
-
r !== void 0 && r.x !== "" ? /* @__PURE__ */
|
|
3900
|
+
r !== void 0 && r.x !== "" ? /* @__PURE__ */ N("span", { className: "uc-tooltip-x", children: r.x }) : null
|
|
3889
3901
|
] }),
|
|
3890
|
-
/* @__PURE__ */
|
|
3902
|
+
/* @__PURE__ */ N("span", { className: "uc-tooltip-value", children: (r == null ? void 0 : r.box) == null ? r == null ? void 0 : r.value : null })
|
|
3891
3903
|
] }),
|
|
3892
|
-
(l = r == null ? void 0 : r.box) == null ? void 0 : l.map((a) => /* @__PURE__ */
|
|
3893
|
-
/* @__PURE__ */
|
|
3894
|
-
/* @__PURE__ */
|
|
3904
|
+
(l = r == null ? void 0 : r.box) == null ? void 0 : l.map((a) => /* @__PURE__ */ R("div", { className: "uc-tooltip-row", children: [
|
|
3905
|
+
/* @__PURE__ */ N("span", { className: "uc-tooltip-name uc-tooltip-part", children: a.label }),
|
|
3906
|
+
/* @__PURE__ */ N("span", { className: "uc-tooltip-value", children: a.value })
|
|
3895
3907
|
] }, a.label)),
|
|
3896
|
-
t.totals.filter((a) => a.after === s).map((a) => /* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
3898
|
-
/* @__PURE__ */
|
|
3908
|
+
t.totals.filter((a) => a.after === s).map((a) => /* @__PURE__ */ R("div", { className: "uc-tooltip-row", children: [
|
|
3909
|
+
/* @__PURE__ */ N("span", { className: "uc-tooltip-name uc-tooltip-total", children: a.name }),
|
|
3910
|
+
/* @__PURE__ */ N("span", { className: "uc-tooltip-value", children: a.value })
|
|
3899
3911
|
] }, "total"))
|
|
3900
3912
|
] }, `${i.seriesName}-${i.index}`);
|
|
3901
3913
|
}) })
|
|
3902
3914
|
] }) });
|
|
3903
3915
|
}
|
|
3904
|
-
function
|
|
3916
|
+
function ms(o) {
|
|
3905
3917
|
const {
|
|
3906
3918
|
data: t,
|
|
3907
3919
|
width: e = "100%",
|
|
@@ -3915,21 +3927,21 @@ function ds(o) {
|
|
|
3915
3927
|
empty: u,
|
|
3916
3928
|
wording: f,
|
|
3917
3929
|
encoding: h = "color",
|
|
3918
|
-
children:
|
|
3919
|
-
} = o,
|
|
3930
|
+
children: p
|
|
3931
|
+
} = o, g = V(() => ({ ...Mn, ...f }), [f]), d = u ?? g.empty, [m] = Se(() => new En()), y = J(null), v = J(null), b = J(null), I = J(null), M = J(null), F = J(null), w = dn(), L = typeof i == "number" ? void 0 : i, D = typeof i == "number" ? i : void 0, G = D ?? (L == null ? void 0 : L.top), _ = D ?? (L == null ? void 0 : L.right), Z = D ?? (L == null ? void 0 : L.bottom), X = D ?? (L == null ? void 0 : L.left), k = V(
|
|
3920
3932
|
() => ({
|
|
3921
3933
|
top: G ?? 8,
|
|
3922
|
-
right:
|
|
3934
|
+
right: _ ?? 8,
|
|
3923
3935
|
bottom: Z ?? 8,
|
|
3924
3936
|
left: X ?? 8
|
|
3925
3937
|
}),
|
|
3926
|
-
[G,
|
|
3938
|
+
[G, _, Z, X]
|
|
3927
3939
|
);
|
|
3928
3940
|
s === void 0 && nt(
|
|
3929
3941
|
"chart-arialabel",
|
|
3930
3942
|
"Chart without ariaLabel - please set a meaningful description (R-7.6)."
|
|
3931
|
-
),
|
|
3932
|
-
const E = y.current, S = v.current, W = b.current, C =
|
|
3943
|
+
), B(() => {
|
|
3944
|
+
const E = y.current, S = v.current, W = b.current, C = I.current;
|
|
3933
3945
|
if (!E || !S || !W || !C) return;
|
|
3934
3946
|
m.bind(S, W, C, E), m.bindA11y(M.current, F.current);
|
|
3935
3947
|
const Q = S.getBoundingClientRect();
|
|
@@ -3952,17 +3964,17 @@ function ds(o) {
|
|
|
3952
3964
|
return S.addEventListener("wheel", q, { passive: !1 }), () => {
|
|
3953
3965
|
S.removeEventListener("wheel", q), window.removeEventListener("blur", O), document.removeEventListener("pointerdown", H), U.disconnect(), m.unbind();
|
|
3954
3966
|
};
|
|
3955
|
-
}, [m]),
|
|
3967
|
+
}, [m]), B(() => {
|
|
3956
3968
|
m.setData(t);
|
|
3957
|
-
}, [m, t]),
|
|
3969
|
+
}, [m, t]), B(() => {
|
|
3958
3970
|
m.setPadding(k);
|
|
3959
|
-
}, [m, k]),
|
|
3960
|
-
m.setWording(
|
|
3961
|
-
}, [m,
|
|
3971
|
+
}, [m, k]), B(() => {
|
|
3972
|
+
m.setWording(g);
|
|
3973
|
+
}, [m, g]), B(() => {
|
|
3962
3974
|
m.setEncoding(h);
|
|
3963
|
-
}, [m, h]),
|
|
3975
|
+
}, [m, h]), B(() => {
|
|
3964
3976
|
m.setOnPerf(a ?? null);
|
|
3965
|
-
}, [m, a]),
|
|
3977
|
+
}, [m, a]), B(() => (m.setSyncId(c ?? null), () => m.setSyncId(null)), [m, c]), B(() => {
|
|
3966
3978
|
m.validate();
|
|
3967
3979
|
});
|
|
3968
3980
|
const T = Wt(
|
|
@@ -3976,27 +3988,27 @@ function ds(o) {
|
|
|
3976
3988
|
}, $ = (E) => {
|
|
3977
3989
|
m.drag(E.nativeEvent), m.pointerMove(E.nativeEvent.offsetX, E.nativeEvent.offsetY);
|
|
3978
3990
|
};
|
|
3979
|
-
return /* @__PURE__ */
|
|
3991
|
+
return /* @__PURE__ */ N(Fn.Provider, { value: m, children: /* @__PURE__ */ R(
|
|
3980
3992
|
"div",
|
|
3981
3993
|
{
|
|
3982
3994
|
ref: y,
|
|
3983
3995
|
className: r ? `uc-root ${r}` : "uc-root",
|
|
3984
3996
|
style: A,
|
|
3985
3997
|
children: [
|
|
3986
|
-
/* @__PURE__ */
|
|
3998
|
+
/* @__PURE__ */ R(
|
|
3987
3999
|
"div",
|
|
3988
4000
|
{
|
|
3989
4001
|
ref: v,
|
|
3990
4002
|
className: "uc-plot",
|
|
3991
4003
|
role: T ? "application" : "img",
|
|
3992
|
-
"aria-roledescription": T ?
|
|
4004
|
+
"aria-roledescription": T ? g.roleDescription : void 0,
|
|
3993
4005
|
"aria-label": s,
|
|
3994
4006
|
"aria-describedby": w,
|
|
3995
4007
|
tabIndex: T ? 0 : void 0,
|
|
3996
4008
|
onKeyDown: (E) => {
|
|
3997
4009
|
m.key(E.nativeEvent) && E.preventDefault();
|
|
3998
4010
|
},
|
|
3999
|
-
onFocus: (E) => m.focus(
|
|
4011
|
+
onFocus: (E) => m.focus(Vo(E.currentTarget)),
|
|
4000
4012
|
onBlur: () => m.blur(),
|
|
4001
4013
|
onPointerMove: $,
|
|
4002
4014
|
onPointerDown: (E) => {
|
|
@@ -4009,28 +4021,28 @@ function ds(o) {
|
|
|
4009
4021
|
E.pointerType !== "touch" && m.pointerLeave();
|
|
4010
4022
|
},
|
|
4011
4023
|
children: [
|
|
4012
|
-
/* @__PURE__ */
|
|
4013
|
-
/* @__PURE__ */
|
|
4014
|
-
/* @__PURE__ */
|
|
4015
|
-
/* @__PURE__ */
|
|
4024
|
+
/* @__PURE__ */ N("canvas", { ref: b, className: "uc-layer-series", "aria-hidden": "true" }),
|
|
4025
|
+
/* @__PURE__ */ N("canvas", { ref: I, className: "uc-layer-overlay", "aria-hidden": "true" }),
|
|
4026
|
+
/* @__PURE__ */ N(Co, { scene: m, empty: d }),
|
|
4027
|
+
/* @__PURE__ */ N(Bo, { scene: m })
|
|
4016
4028
|
]
|
|
4017
4029
|
}
|
|
4018
4030
|
),
|
|
4019
|
-
/* @__PURE__ */
|
|
4020
|
-
/* @__PURE__ */
|
|
4021
|
-
|
|
4031
|
+
/* @__PURE__ */ N("div", { ref: M, className: "uc-sr", "aria-live": "polite" }),
|
|
4032
|
+
/* @__PURE__ */ N("div", { ref: F, id: w, className: "uc-sr" }),
|
|
4033
|
+
p
|
|
4022
4034
|
]
|
|
4023
4035
|
}
|
|
4024
4036
|
) });
|
|
4025
4037
|
}
|
|
4026
|
-
function
|
|
4038
|
+
function Vo(o) {
|
|
4027
4039
|
try {
|
|
4028
4040
|
return o.matches(":focus-visible");
|
|
4029
4041
|
} catch {
|
|
4030
4042
|
return !0;
|
|
4031
4043
|
}
|
|
4032
4044
|
}
|
|
4033
|
-
function
|
|
4045
|
+
function ps(o) {
|
|
4034
4046
|
const {
|
|
4035
4047
|
accessor: t,
|
|
4036
4048
|
baseline: e,
|
|
@@ -4044,10 +4056,10 @@ function fs(o) {
|
|
|
4044
4056
|
tone: u,
|
|
4045
4057
|
stack: f,
|
|
4046
4058
|
normalize: h,
|
|
4047
|
-
fillOpacity:
|
|
4048
|
-
strokeWidth:
|
|
4059
|
+
fillOpacity: p = 0.18,
|
|
4060
|
+
strokeWidth: g = 1.5,
|
|
4049
4061
|
dash: d
|
|
4050
|
-
} = o, m =
|
|
4062
|
+
} = o, m = V(
|
|
4051
4063
|
() => ({
|
|
4052
4064
|
kind: "area",
|
|
4053
4065
|
accessor: t,
|
|
@@ -4062,15 +4074,15 @@ function fs(o) {
|
|
|
4062
4074
|
tone: u,
|
|
4063
4075
|
stack: f,
|
|
4064
4076
|
normalize: h,
|
|
4065
|
-
fillOpacity:
|
|
4066
|
-
strokeWidth:
|
|
4077
|
+
fillOpacity: p,
|
|
4078
|
+
strokeWidth: g,
|
|
4067
4079
|
dash: d
|
|
4068
4080
|
}),
|
|
4069
|
-
[t, e, n, i, s, r, l, a, c, u, f, h,
|
|
4081
|
+
[t, e, n, i, s, r, l, a, c, u, f, h, p, g, d]
|
|
4070
4082
|
);
|
|
4071
4083
|
return bt("Area", m), null;
|
|
4072
4084
|
}
|
|
4073
|
-
function
|
|
4085
|
+
function gs(o) {
|
|
4074
4086
|
const {
|
|
4075
4087
|
accessor: t,
|
|
4076
4088
|
xAxisId: e = "x",
|
|
@@ -4084,7 +4096,7 @@ function ms(o) {
|
|
|
4084
4096
|
stack: u,
|
|
4085
4097
|
normalize: f,
|
|
4086
4098
|
barWidth: h = 0.8
|
|
4087
|
-
} = o,
|
|
4099
|
+
} = o, p = V(
|
|
4088
4100
|
() => ({
|
|
4089
4101
|
kind: "bar",
|
|
4090
4102
|
accessor: t,
|
|
@@ -4102,9 +4114,9 @@ function ms(o) {
|
|
|
4102
4114
|
}),
|
|
4103
4115
|
[t, e, n, i, s, r, l, a, c, u, f, h]
|
|
4104
4116
|
);
|
|
4105
|
-
return bt("Bar",
|
|
4117
|
+
return bt("Bar", p), null;
|
|
4106
4118
|
}
|
|
4107
|
-
function
|
|
4119
|
+
function zo(o) {
|
|
4108
4120
|
const {
|
|
4109
4121
|
accessor: t,
|
|
4110
4122
|
xAxisId: e = "x",
|
|
@@ -4118,8 +4130,8 @@ function Bo(o) {
|
|
|
4118
4130
|
strokeWidth: u = 1.5,
|
|
4119
4131
|
dash: f,
|
|
4120
4132
|
markers: h = "auto",
|
|
4121
|
-
step:
|
|
4122
|
-
} = o,
|
|
4133
|
+
step: p
|
|
4134
|
+
} = o, g = V(
|
|
4123
4135
|
() => ({
|
|
4124
4136
|
kind: "line",
|
|
4125
4137
|
accessor: t,
|
|
@@ -4134,13 +4146,13 @@ function Bo(o) {
|
|
|
4134
4146
|
strokeWidth: u,
|
|
4135
4147
|
dash: f,
|
|
4136
4148
|
markers: h,
|
|
4137
|
-
step:
|
|
4149
|
+
step: p
|
|
4138
4150
|
}),
|
|
4139
|
-
[t, e, n, i, s, r, l, a, c, u, f, h,
|
|
4151
|
+
[t, e, n, i, s, r, l, a, c, u, f, h, p]
|
|
4140
4152
|
);
|
|
4141
|
-
return bt("Line",
|
|
4153
|
+
return bt("Line", g), null;
|
|
4142
4154
|
}
|
|
4143
|
-
function
|
|
4155
|
+
function Yo(o) {
|
|
4144
4156
|
const {
|
|
4145
4157
|
accessor: t,
|
|
4146
4158
|
xAxisId: e = "x",
|
|
@@ -4152,7 +4164,7 @@ function Vo(o) {
|
|
|
4152
4164
|
color: a,
|
|
4153
4165
|
tone: c,
|
|
4154
4166
|
radius: u = 3
|
|
4155
|
-
} = o, f =
|
|
4167
|
+
} = o, f = V(
|
|
4156
4168
|
() => ({
|
|
4157
4169
|
kind: "scatter",
|
|
4158
4170
|
accessor: t,
|
|
@@ -4170,7 +4182,7 @@ function Vo(o) {
|
|
|
4170
4182
|
);
|
|
4171
4183
|
return bt("Scatter", f), null;
|
|
4172
4184
|
}
|
|
4173
|
-
function
|
|
4185
|
+
function ys(o) {
|
|
4174
4186
|
const {
|
|
4175
4187
|
accessor: t,
|
|
4176
4188
|
states: e,
|
|
@@ -4181,7 +4193,7 @@ function ps(o) {
|
|
|
4181
4193
|
hidden: l,
|
|
4182
4194
|
laneFrom: a,
|
|
4183
4195
|
laneTo: c
|
|
4184
|
-
} = o, u =
|
|
4196
|
+
} = o, u = V(
|
|
4185
4197
|
() => ({
|
|
4186
4198
|
kind: "state",
|
|
4187
4199
|
accessor: t,
|
|
@@ -4198,7 +4210,7 @@ function ps(o) {
|
|
|
4198
4210
|
);
|
|
4199
4211
|
return bt("StateBand", u), null;
|
|
4200
4212
|
}
|
|
4201
|
-
const
|
|
4213
|
+
const Ko = [
|
|
4202
4214
|
"#eef2ff",
|
|
4203
4215
|
"#c7d2fe",
|
|
4204
4216
|
"#a5b4fc",
|
|
@@ -4207,7 +4219,7 @@ const zo = [
|
|
|
4207
4219
|
"#4f46e5",
|
|
4208
4220
|
"#4338ca"
|
|
4209
4221
|
];
|
|
4210
|
-
function
|
|
4222
|
+
function xs(o) {
|
|
4211
4223
|
const {
|
|
4212
4224
|
accessor: t,
|
|
4213
4225
|
value: e,
|
|
@@ -4218,10 +4230,10 @@ function gs(o) {
|
|
|
4218
4230
|
name: l,
|
|
4219
4231
|
hidden: a,
|
|
4220
4232
|
format: c
|
|
4221
|
-
} = o, u =
|
|
4222
|
-
() => n ?? { kind: "gradient", stops:
|
|
4233
|
+
} = o, u = V(
|
|
4234
|
+
() => n ?? { kind: "gradient", stops: Ko },
|
|
4223
4235
|
[n]
|
|
4224
|
-
), f =
|
|
4236
|
+
), f = V(
|
|
4225
4237
|
() => ({
|
|
4226
4238
|
kind: "matrix",
|
|
4227
4239
|
accessor: t,
|
|
@@ -4238,7 +4250,7 @@ function gs(o) {
|
|
|
4238
4250
|
);
|
|
4239
4251
|
return bt("Matrix", f), null;
|
|
4240
4252
|
}
|
|
4241
|
-
function
|
|
4253
|
+
function Pt(o) {
|
|
4242
4254
|
const {
|
|
4243
4255
|
value: t,
|
|
4244
4256
|
orientation: e = "y",
|
|
@@ -4248,7 +4260,7 @@ function Dt(o) {
|
|
|
4248
4260
|
color: r,
|
|
4249
4261
|
inExtent: l = !0,
|
|
4250
4262
|
role: a = "specification"
|
|
4251
|
-
} = o, c =
|
|
4263
|
+
} = o, c = V(
|
|
4252
4264
|
() => ({
|
|
4253
4265
|
kind: "line",
|
|
4254
4266
|
value: t,
|
|
@@ -4262,9 +4274,9 @@ function Dt(o) {
|
|
|
4262
4274
|
}),
|
|
4263
4275
|
[t, n, e, i, a, s, r, l]
|
|
4264
4276
|
);
|
|
4265
|
-
return
|
|
4277
|
+
return Pn("LimitLine", c), null;
|
|
4266
4278
|
}
|
|
4267
|
-
function
|
|
4279
|
+
function bs(o) {
|
|
4268
4280
|
const {
|
|
4269
4281
|
from: t,
|
|
4270
4282
|
to: e,
|
|
@@ -4275,7 +4287,7 @@ function ys(o) {
|
|
|
4275
4287
|
color: l,
|
|
4276
4288
|
inExtent: a = !0,
|
|
4277
4289
|
role: c = "specification"
|
|
4278
|
-
} = o, u =
|
|
4290
|
+
} = o, u = V(
|
|
4279
4291
|
() => ({
|
|
4280
4292
|
kind: "band",
|
|
4281
4293
|
from: t,
|
|
@@ -4290,9 +4302,9 @@ function ys(o) {
|
|
|
4290
4302
|
}),
|
|
4291
4303
|
[t, e, i, n, s, c, r, l, a]
|
|
4292
4304
|
);
|
|
4293
|
-
return
|
|
4305
|
+
return Pn("LimitBand", u), null;
|
|
4294
4306
|
}
|
|
4295
|
-
const
|
|
4307
|
+
const Go = 1.128;
|
|
4296
4308
|
function xe(o, t) {
|
|
4297
4309
|
return {
|
|
4298
4310
|
center: o,
|
|
@@ -4301,10 +4313,10 @@ function xe(o, t) {
|
|
|
4301
4313
|
lower: o - 3 * t
|
|
4302
4314
|
};
|
|
4303
4315
|
}
|
|
4304
|
-
function
|
|
4316
|
+
function vs(o, t) {
|
|
4305
4317
|
return (t - o) / 3;
|
|
4306
4318
|
}
|
|
4307
|
-
function
|
|
4319
|
+
function Uo(o, t) {
|
|
4308
4320
|
if (t.kind === "given")
|
|
4309
4321
|
return xe(t.center, t.sigma);
|
|
4310
4322
|
const e = Math.max(0, Math.trunc(t.from)), n = Math.min(o.length, Math.trunc(t.to));
|
|
@@ -4318,20 +4330,20 @@ function Ko(o, t) {
|
|
|
4318
4330
|
i += f, s++, Number.isFinite(a) && (r += Math.abs(f - a), l++), a = f;
|
|
4319
4331
|
}
|
|
4320
4332
|
if (s === 0) return xe(Number.NaN, Number.NaN);
|
|
4321
|
-
const c = l === 0 ? 0 : r / l /
|
|
4333
|
+
const c = l === 0 ? 0 : r / l / Go;
|
|
4322
4334
|
return xe(i / s, c);
|
|
4323
4335
|
}
|
|
4324
|
-
function
|
|
4336
|
+
function qo(o, t = [1, 2]) {
|
|
4325
4337
|
return t.map((e) => ({
|
|
4326
4338
|
k: e,
|
|
4327
4339
|
upper: o.center + e * o.sigma,
|
|
4328
4340
|
lower: o.center - e * o.sigma
|
|
4329
4341
|
}));
|
|
4330
4342
|
}
|
|
4331
|
-
function
|
|
4343
|
+
function Xo(o, t) {
|
|
4332
4344
|
return Number.isFinite(o) ? o > t ? 1 : o < t ? -1 : 0 : 0;
|
|
4333
4345
|
}
|
|
4334
|
-
function
|
|
4346
|
+
function Cn(o, t) {
|
|
4335
4347
|
const e = [];
|
|
4336
4348
|
if (t < 1) return e;
|
|
4337
4349
|
let n = 0;
|
|
@@ -4353,7 +4365,7 @@ const De = {
|
|
|
4353
4365
|
runLength: 9,
|
|
4354
4366
|
trendLength: 6
|
|
4355
4367
|
};
|
|
4356
|
-
function
|
|
4368
|
+
function Qo(o, t) {
|
|
4357
4369
|
const e = [];
|
|
4358
4370
|
if (!(t.sigma > 0)) return e;
|
|
4359
4371
|
for (let n = 0; n < o.length; n++) {
|
|
@@ -4362,24 +4374,24 @@ function qo(o, t) {
|
|
|
4362
4374
|
}
|
|
4363
4375
|
return e;
|
|
4364
4376
|
}
|
|
4365
|
-
function
|
|
4366
|
-
return
|
|
4367
|
-
o.map((n) =>
|
|
4377
|
+
function Zo(o, t, e = De.runLength) {
|
|
4378
|
+
return Cn(
|
|
4379
|
+
o.map((n) => Xo(n, t.center)),
|
|
4368
4380
|
e
|
|
4369
4381
|
);
|
|
4370
4382
|
}
|
|
4371
|
-
function
|
|
4383
|
+
function jo(o, t = De.trendLength) {
|
|
4372
4384
|
const e = [];
|
|
4373
4385
|
for (let i = 1; i < o.length; i++) {
|
|
4374
4386
|
const s = o[i - 1], r = o[i];
|
|
4375
4387
|
e.push(Number.isFinite(s) && Number.isFinite(r) ? Math.sign(r - s) : 0);
|
|
4376
4388
|
}
|
|
4377
4389
|
const n = [];
|
|
4378
|
-
for (const i of
|
|
4390
|
+
for (const i of Cn(e, Math.max(1, t - 1)))
|
|
4379
4391
|
n[n.length - 1] !== i && n.push(i), n.push(i + 1);
|
|
4380
4392
|
return n;
|
|
4381
4393
|
}
|
|
4382
|
-
function
|
|
4394
|
+
function Jo(o, t) {
|
|
4383
4395
|
if (!(t.sigma > 0)) return [];
|
|
4384
4396
|
const e = t.center + 2 * t.sigma, n = t.center - 2 * t.sigma, i = /* @__PURE__ */ new Set();
|
|
4385
4397
|
for (let s = 0; s + 2 < o.length; s++)
|
|
@@ -4390,7 +4402,7 @@ function Zo(o, t) {
|
|
|
4390
4402
|
if (r.length >= 2) for (const l of r) i.add(l);
|
|
4391
4403
|
return [...i].sort((s, r) => s - r);
|
|
4392
4404
|
}
|
|
4393
|
-
function
|
|
4405
|
+
function ts(o, t, e = {}) {
|
|
4394
4406
|
const n = { ...De, ...e };
|
|
4395
4407
|
t.sigma > 0 || nt(
|
|
4396
4408
|
"control-sigma-zero",
|
|
@@ -4399,9 +4411,9 @@ function jo(o, t, e = {}) {
|
|
|
4399
4411
|
const i = [], s = (r, l) => {
|
|
4400
4412
|
l.length > 0 && i.push({ rule: r, indices: l });
|
|
4401
4413
|
};
|
|
4402
|
-
return n.outlier && s("outlier",
|
|
4414
|
+
return n.outlier && s("outlier", Qo(o, t)), n.run && s("run", Zo(o, t, n.runLength)), n.trend && s("trend", jo(o, n.trendLength)), n.twoOfThree && s("twoOfThree", Jo(o, t)), i;
|
|
4403
4415
|
}
|
|
4404
|
-
function
|
|
4416
|
+
function es(o) {
|
|
4405
4417
|
const t = /* @__PURE__ */ new Set();
|
|
4406
4418
|
for (const e of o) for (const n of e.indices) t.add(n);
|
|
4407
4419
|
return [...t].sort((e, n) => e - n);
|
|
@@ -4410,10 +4422,10 @@ function be(o, t) {
|
|
|
4410
4422
|
const [e, n] = Se({ value: o });
|
|
4411
4423
|
return e.value === o || t(e.value, o) ? e.value : (n({ value: o }), o);
|
|
4412
4424
|
}
|
|
4413
|
-
function
|
|
4425
|
+
function ns(o, t) {
|
|
4414
4426
|
return o.kind === "given" && t.kind === "given" ? o.center === t.center && o.sigma === t.sigma : o.kind === "referenceWindow" && t.kind === "referenceWindow" ? o.from === t.from && o.to === t.to : !1;
|
|
4415
4427
|
}
|
|
4416
|
-
function
|
|
4428
|
+
function is(o, t) {
|
|
4417
4429
|
if (o.length !== t.length) return !1;
|
|
4418
4430
|
for (let e = 0; e < o.length; e++) {
|
|
4419
4431
|
const n = o[e], i = t[e];
|
|
@@ -4422,7 +4434,7 @@ function es(o, t) {
|
|
|
4422
4434
|
}
|
|
4423
4435
|
return !0;
|
|
4424
4436
|
}
|
|
4425
|
-
function
|
|
4437
|
+
function ks(o) {
|
|
4426
4438
|
const {
|
|
4427
4439
|
data: t,
|
|
4428
4440
|
xAxisId: e = "x",
|
|
@@ -4436,39 +4448,39 @@ function bs(o) {
|
|
|
4436
4448
|
labelUpper: u,
|
|
4437
4449
|
labelLower: f,
|
|
4438
4450
|
violationName: h,
|
|
4439
|
-
onViolations:
|
|
4440
|
-
} = o,
|
|
4451
|
+
onViolations: p
|
|
4452
|
+
} = o, g = be(o.accessor, ot), d = be(o.origin, ns), m = V(() => {
|
|
4441
4453
|
const D = [];
|
|
4442
4454
|
for (let G = 0; G < t.length; G++) {
|
|
4443
|
-
const
|
|
4444
|
-
D.push(
|
|
4455
|
+
const _ = g(t[G], G);
|
|
4456
|
+
D.push(_ ?? Number.NaN);
|
|
4445
4457
|
}
|
|
4446
4458
|
return D;
|
|
4447
|
-
}, [t,
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
), b =
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
}, [
|
|
4459
|
+
}, [t, g]), y = V(() => Uo(m, d), [m, d]), v = be(
|
|
4460
|
+
V(() => ts(m, y, a ?? {}), [m, y, a]),
|
|
4461
|
+
is
|
|
4462
|
+
), b = V(() => new Set(es(v)), [v]), I = J(p);
|
|
4463
|
+
B(() => {
|
|
4464
|
+
I.current = p;
|
|
4465
|
+
}, [p]), B(() => {
|
|
4454
4466
|
var D;
|
|
4455
|
-
(D =
|
|
4467
|
+
(D = I.current) == null || D.call(I, v);
|
|
4456
4468
|
}, [v]);
|
|
4457
|
-
const M =
|
|
4458
|
-
() => (D, G) => b.has(G) ?
|
|
4459
|
-
[b,
|
|
4460
|
-
), F =
|
|
4469
|
+
const M = V(
|
|
4470
|
+
() => (D, G) => b.has(G) ? g(D, G) : null,
|
|
4471
|
+
[b, g]
|
|
4472
|
+
), F = V(
|
|
4461
4473
|
() => b.size === 0 ? t : t.slice(),
|
|
4462
4474
|
[t, b]
|
|
4463
|
-
), w =
|
|
4464
|
-
() => c ?
|
|
4475
|
+
), w = V(
|
|
4476
|
+
() => c ? qo(y, [1, 2]) : [],
|
|
4465
4477
|
[c, y]
|
|
4466
4478
|
), L = Number.isFinite(y.center);
|
|
4467
|
-
return /* @__PURE__ */
|
|
4468
|
-
/* @__PURE__ */
|
|
4469
|
-
L && /* @__PURE__ */
|
|
4470
|
-
w.map((D) => /* @__PURE__ */
|
|
4471
|
-
|
|
4479
|
+
return /* @__PURE__ */ R(Nt, { children: [
|
|
4480
|
+
/* @__PURE__ */ N(zo, { accessor: g, data: t, xAxisId: e, yAxisId: n, name: i, format: s, color: r, tone: l }),
|
|
4481
|
+
L && /* @__PURE__ */ R(Nt, { children: [
|
|
4482
|
+
w.map((D) => /* @__PURE__ */ N(
|
|
4483
|
+
Pt,
|
|
4472
4484
|
{
|
|
4473
4485
|
value: D.upper,
|
|
4474
4486
|
axisId: n,
|
|
@@ -4477,8 +4489,8 @@ function bs(o) {
|
|
|
4477
4489
|
},
|
|
4478
4490
|
`zone-${D.k}-upper`
|
|
4479
4491
|
)),
|
|
4480
|
-
w.map((D) => /* @__PURE__ */
|
|
4481
|
-
|
|
4492
|
+
w.map((D) => /* @__PURE__ */ N(
|
|
4493
|
+
Pt,
|
|
4482
4494
|
{
|
|
4483
4495
|
value: D.lower,
|
|
4484
4496
|
axisId: n,
|
|
@@ -4487,12 +4499,12 @@ function bs(o) {
|
|
|
4487
4499
|
},
|
|
4488
4500
|
`zone-${D.k}-lower`
|
|
4489
4501
|
)),
|
|
4490
|
-
/* @__PURE__ */
|
|
4491
|
-
/* @__PURE__ */
|
|
4492
|
-
/* @__PURE__ */
|
|
4502
|
+
/* @__PURE__ */ N(Pt, { value: y.center, axisId: n, role: "control" }),
|
|
4503
|
+
/* @__PURE__ */ N(Pt, { value: y.upper, axisId: n, role: "control", label: u }),
|
|
4504
|
+
/* @__PURE__ */ N(Pt, { value: y.lower, axisId: n, role: "control", label: f })
|
|
4493
4505
|
] }),
|
|
4494
|
-
/* @__PURE__ */
|
|
4495
|
-
|
|
4506
|
+
/* @__PURE__ */ N(
|
|
4507
|
+
Yo,
|
|
4496
4508
|
{
|
|
4497
4509
|
accessor: M,
|
|
4498
4510
|
data: F,
|
|
@@ -4506,7 +4518,7 @@ function bs(o) {
|
|
|
4506
4518
|
)
|
|
4507
4519
|
] });
|
|
4508
4520
|
}
|
|
4509
|
-
function
|
|
4521
|
+
function ws(o) {
|
|
4510
4522
|
const {
|
|
4511
4523
|
id: t = "x",
|
|
4512
4524
|
position: e = "bottom",
|
|
@@ -4520,7 +4532,7 @@ function vs(o) {
|
|
|
4520
4532
|
time: u,
|
|
4521
4533
|
calendar: f,
|
|
4522
4534
|
onDomainChange: h
|
|
4523
|
-
} = o,
|
|
4535
|
+
} = o, p = V(
|
|
4524
4536
|
() => ({
|
|
4525
4537
|
id: t,
|
|
4526
4538
|
orientation: "x",
|
|
@@ -4538,9 +4550,9 @@ function vs(o) {
|
|
|
4538
4550
|
}),
|
|
4539
4551
|
[t, e, n, i, s, r, l, a, c, u, f, h]
|
|
4540
4552
|
);
|
|
4541
|
-
return
|
|
4553
|
+
return Dn("XAxis", p), null;
|
|
4542
4554
|
}
|
|
4543
|
-
function
|
|
4555
|
+
function Ns(o) {
|
|
4544
4556
|
const {
|
|
4545
4557
|
id: t = "y",
|
|
4546
4558
|
position: e = "left",
|
|
@@ -4552,7 +4564,7 @@ function ks(o) {
|
|
|
4552
4564
|
grid: a,
|
|
4553
4565
|
ticks: c,
|
|
4554
4566
|
alignTicks: u
|
|
4555
|
-
} = o, f =
|
|
4567
|
+
} = o, f = V(
|
|
4556
4568
|
() => ({
|
|
4557
4569
|
id: t,
|
|
4558
4570
|
orientation: "y",
|
|
@@ -4568,42 +4580,42 @@ function ks(o) {
|
|
|
4568
4580
|
}),
|
|
4569
4581
|
[t, e, n, i, s, r, l, a, c, u]
|
|
4570
4582
|
);
|
|
4571
|
-
return
|
|
4583
|
+
return Dn("YAxis", f), null;
|
|
4572
4584
|
}
|
|
4573
|
-
function
|
|
4574
|
-
const { mode: t = "x", render: e } = o, n =
|
|
4585
|
+
function Is(o) {
|
|
4586
|
+
const { mode: t = "x", render: e } = o, n = V(
|
|
4575
4587
|
() => ({ mode: t, render: e }),
|
|
4576
4588
|
[t, e]
|
|
4577
4589
|
);
|
|
4578
|
-
return
|
|
4590
|
+
return $o("Tooltip", n), null;
|
|
4579
4591
|
}
|
|
4580
|
-
const
|
|
4592
|
+
const os = {
|
|
4581
4593
|
cutoff: 0.8,
|
|
4582
4594
|
collectRank: Number.POSITIVE_INFINITY
|
|
4583
4595
|
};
|
|
4584
|
-
function
|
|
4585
|
-
const e = { ...
|
|
4586
|
-
|
|
4596
|
+
function As(o, t = {}) {
|
|
4597
|
+
const e = { ...os, ...t };
|
|
4598
|
+
$t(
|
|
4587
4599
|
!Number.isFinite(e.collectRank) || e.remainderName !== void 0,
|
|
4588
4600
|
"pareto: a collect rank needs `remainderName` - the package brings no name for the remainder."
|
|
4589
4601
|
);
|
|
4590
|
-
const n = o.map((
|
|
4602
|
+
const n = o.map((p, g) => ({ item: p, inputIndex: g })).sort((p, g) => g.item.value - p.item.value || p.inputIndex - g.inputIndex).map(({ item: p }) => p), i = Math.max(0, Math.min(n.length, Math.floor(e.collectRank))), s = n.slice(0, i), r = n.slice(i), l = r.length === 0 ? s : [...s, { name: e.remainderName ?? "", value: r.reduce((p, g) => p + g.value, 0) }], a = l.reduce((p, g) => p + g.value, 0), c = [];
|
|
4591
4603
|
let u = 0;
|
|
4592
|
-
for (let
|
|
4593
|
-
const
|
|
4594
|
-
u +=
|
|
4595
|
-
name:
|
|
4596
|
-
value:
|
|
4597
|
-
index:
|
|
4598
|
-
share: a === 0 ? 0 :
|
|
4604
|
+
for (let p = 0; p < l.length; p++) {
|
|
4605
|
+
const g = l[p];
|
|
4606
|
+
u += g.value, c.push({
|
|
4607
|
+
name: g.name,
|
|
4608
|
+
value: g.value,
|
|
4609
|
+
index: p,
|
|
4610
|
+
share: a === 0 ? 0 : g.value / a,
|
|
4599
4611
|
cumulative: a === 0 ? 0 : u / a,
|
|
4600
|
-
remainder: r.length > 0 &&
|
|
4612
|
+
remainder: r.length > 0 && p === l.length - 1
|
|
4601
4613
|
});
|
|
4602
4614
|
}
|
|
4603
|
-
const f = Math.abs(e.cutoff) * 1e-12, h = c.findIndex((
|
|
4615
|
+
const f = Math.abs(e.cutoff) * 1e-12, h = c.findIndex((p) => p.cumulative >= e.cutoff - f);
|
|
4604
4616
|
return { entries: c, total: a, cutoffIndex: h };
|
|
4605
4617
|
}
|
|
4606
|
-
function
|
|
4618
|
+
function Ts(o) {
|
|
4607
4619
|
const {
|
|
4608
4620
|
median: t,
|
|
4609
4621
|
lowerQuartile: e,
|
|
@@ -4617,14 +4629,14 @@ function Is(o) {
|
|
|
4617
4629
|
count: u,
|
|
4618
4630
|
xAxisId: f = "x",
|
|
4619
4631
|
yAxisId: h = "y",
|
|
4620
|
-
data:
|
|
4621
|
-
name:
|
|
4632
|
+
data: p,
|
|
4633
|
+
name: g,
|
|
4622
4634
|
hidden: d,
|
|
4623
4635
|
format: m,
|
|
4624
4636
|
color: y,
|
|
4625
4637
|
tone: v,
|
|
4626
4638
|
boxWidth: b = 0.8
|
|
4627
|
-
} = o,
|
|
4639
|
+
} = o, I = V(
|
|
4628
4640
|
() => ({
|
|
4629
4641
|
kind: "box",
|
|
4630
4642
|
accessor: t,
|
|
@@ -4639,69 +4651,69 @@ function Is(o) {
|
|
|
4639
4651
|
count: u,
|
|
4640
4652
|
xAxisId: f,
|
|
4641
4653
|
yAxisId: h,
|
|
4642
|
-
data:
|
|
4643
|
-
name:
|
|
4654
|
+
data: p,
|
|
4655
|
+
name: g,
|
|
4644
4656
|
hidden: d,
|
|
4645
4657
|
format: m,
|
|
4646
4658
|
color: y,
|
|
4647
4659
|
tone: v,
|
|
4648
4660
|
boxWidth: b
|
|
4649
4661
|
}),
|
|
4650
|
-
[t, e, n, i, s, r, l, a, c, u, f, h,
|
|
4662
|
+
[t, e, n, i, s, r, l, a, c, u, f, h, p, g, d, m, y, v, b]
|
|
4651
4663
|
);
|
|
4652
|
-
return bt("BoxPlot",
|
|
4664
|
+
return bt("BoxPlot", I), null;
|
|
4653
4665
|
}
|
|
4654
4666
|
export {
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4667
|
+
ps as Area,
|
|
4668
|
+
gs as Bar,
|
|
4669
|
+
Ts as BoxPlot,
|
|
4670
|
+
ms as Chart,
|
|
4671
|
+
ks as ControlChart,
|
|
4660
4672
|
et as DAY,
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4673
|
+
Mn as DEFAULT_CHARTS_WORDING,
|
|
4674
|
+
Ko as DEFAULT_GRADIENT,
|
|
4675
|
+
ds as DataTable,
|
|
4664
4676
|
gt as HOUR,
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4677
|
+
fs as Legend,
|
|
4678
|
+
bs as LimitBand,
|
|
4679
|
+
Pt as LimitLine,
|
|
4680
|
+
zo as Line,
|
|
4669
4681
|
Oe as LinearScale,
|
|
4670
4682
|
j as MINUTE,
|
|
4671
|
-
|
|
4683
|
+
xs as Matrix,
|
|
4672
4684
|
pt as SECOND,
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4685
|
+
Yo as Scatter,
|
|
4686
|
+
ys as StateBand,
|
|
4687
|
+
Is as Tooltip,
|
|
4688
|
+
ws as XAxis,
|
|
4689
|
+
Ns as YAxis,
|
|
4690
|
+
oo as assess,
|
|
4691
|
+
ai as breaks,
|
|
4680
4692
|
at as calendarFrom,
|
|
4681
|
-
|
|
4693
|
+
Uo as controlLimits,
|
|
4682
4694
|
De as defaultRules,
|
|
4683
4695
|
ue as invalidateTheme,
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4696
|
+
cs as localOffset,
|
|
4697
|
+
as as mapSeries,
|
|
4698
|
+
As as pareto,
|
|
4699
|
+
os as paretoDefaults,
|
|
4700
|
+
li as removedIntervals,
|
|
4701
|
+
Xn as resolveColours,
|
|
4702
|
+
Qo as ruleOutlier,
|
|
4703
|
+
Zo as ruleRun,
|
|
4704
|
+
jo as ruleTrend,
|
|
4705
|
+
Jo as ruleTwoOfThree,
|
|
4706
|
+
vs as sigmaFromLimit,
|
|
4707
|
+
Zn as subscribeTheme,
|
|
4708
|
+
ci as timeStep,
|
|
4709
|
+
At as toWallClock,
|
|
4710
|
+
It as toWorkingTime,
|
|
4711
|
+
si as toWorkingTimeClamped,
|
|
4712
|
+
hs as verdictWeight,
|
|
4713
|
+
es as violatedIndices,
|
|
4714
|
+
ts as violations,
|
|
4715
|
+
ii as workingCalendar,
|
|
4716
|
+
us as workingTicks,
|
|
4717
|
+
ui as workingTimeTicks,
|
|
4718
|
+
qo as zones
|
|
4707
4719
|
};
|