@umriss-ui/charts 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +4 -1
- package/dist/charts.js +832 -803
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/charts.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import "./charts.css";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var g = (n, t, e) =>
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useRef as
|
|
7
|
-
function
|
|
2
|
+
var be = Object.defineProperty;
|
|
3
|
+
var xe = (n, t, e) => t in n ? be(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
4
|
+
var g = (n, t, e) => xe(n, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { jsx as S, jsxs as _, Fragment as Nt } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as Z, useEffect as $, createContext as ve, useContext as ke, useSyncExternalStore as Et, useCallback as Ne, useState as we, useMemo as E } from "react";
|
|
7
|
+
function Ie() {
|
|
8
8
|
var t;
|
|
9
9
|
const n = import.meta;
|
|
10
10
|
return typeof ((t = n.env) == null ? void 0 : t.DEV) == "boolean" ? n.env.DEV : typeof process < "u" && (process != null && process.env) ? process.env.NODE_ENV !== "production" : !1;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
12
|
+
const rt = Ie();
|
|
13
|
+
function ut(n, t) {
|
|
14
|
+
if (rt && !n)
|
|
15
15
|
throw new Error(`@umriss-ui/charts: ${t}`);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
!
|
|
17
|
+
const Wt = /* @__PURE__ */ new Set();
|
|
18
|
+
function q(n, t) {
|
|
19
|
+
!rt || Wt.has(n) || (Wt.add(n), console.warn(`@umriss-ui/charts: ${t}`));
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const O = {
|
|
22
22
|
colorAxis: "rgba(23, 23, 23, 0.17)",
|
|
23
23
|
colorGrid: "rgba(23, 23, 23, 0.06)",
|
|
24
24
|
colorText: "#71717a",
|
|
@@ -37,7 +37,7 @@ function bt(n, t, e) {
|
|
|
37
37
|
const i = n.getPropertyValue(t).trim();
|
|
38
38
|
return i === "" ? e : i;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ie(n, t) {
|
|
41
41
|
const e = n.ownerDocument.createElement("span");
|
|
42
42
|
e.setAttribute("aria-hidden", "true"), e.style.position = "absolute", e.style.visibility = "hidden", n.appendChild(e);
|
|
43
43
|
try {
|
|
@@ -50,60 +50,60 @@ function ne(n, t) {
|
|
|
50
50
|
e.remove();
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Se(n) {
|
|
54
54
|
const t = getComputedStyle(n);
|
|
55
|
-
return
|
|
56
|
-
const i = (
|
|
57
|
-
const a = bt(t,
|
|
58
|
-
if (a ===
|
|
59
|
-
const l = e(`var(${
|
|
60
|
-
return l === `var(${
|
|
55
|
+
return ie(n, (e) => {
|
|
56
|
+
const i = (o, s) => {
|
|
57
|
+
const a = bt(t, o, s);
|
|
58
|
+
if (a === s) return s;
|
|
59
|
+
const l = e(`var(${o})`);
|
|
60
|
+
return l === `var(${o})` ? a : l;
|
|
61
61
|
}, r = [];
|
|
62
|
-
for (let
|
|
63
|
-
r.push(i(`--uc-series-${
|
|
62
|
+
for (let o = 1; o <= 6; o++)
|
|
63
|
+
r.push(i(`--uc-series-${o}`, O.series[o - 1] ?? "#2563eb"));
|
|
64
64
|
return {
|
|
65
|
-
colorAxis: i("--uc-color-axis",
|
|
66
|
-
colorGrid: i("--uc-color-grid",
|
|
67
|
-
colorText: i("--uc-color-text",
|
|
68
|
-
colorBg: i("--uc-color-bg",
|
|
69
|
-
colorWarning: i("--uc-color-warning",
|
|
70
|
-
colorAlarm: i("--uc-color-alarm",
|
|
71
|
-
colorOk: i("--uc-color-ok",
|
|
72
|
-
font: bt(t, "--uc-font",
|
|
73
|
-
fontMono: bt(t, "--uc-font-mono",
|
|
65
|
+
colorAxis: i("--uc-color-axis", O.colorAxis),
|
|
66
|
+
colorGrid: i("--uc-color-grid", O.colorGrid),
|
|
67
|
+
colorText: i("--uc-color-text", O.colorText),
|
|
68
|
+
colorBg: i("--uc-color-bg", O.colorBg),
|
|
69
|
+
colorWarning: i("--uc-color-warning", O.colorWarning),
|
|
70
|
+
colorAlarm: i("--uc-color-alarm", O.colorAlarm),
|
|
71
|
+
colorOk: i("--uc-color-ok", O.colorOk),
|
|
72
|
+
font: bt(t, "--uc-font", O.font),
|
|
73
|
+
fontMono: bt(t, "--uc-font-mono", O.fontMono),
|
|
74
74
|
series: r
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function re() {
|
|
79
79
|
var n, t;
|
|
80
80
|
gt === null && (typeof MutationObserver > "u" || typeof document > "u" || (gt = new MutationObserver(() => Rt()), gt.observe(document.documentElement, { attributes: !0 }), typeof window < "u" && typeof window.matchMedia == "function" && ((t = (n = window.matchMedia("(prefers-color-scheme: dark)")).addEventListener) == null || t.call(n, "change", () => Rt()))));
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
return
|
|
82
|
+
function jn(n, t) {
|
|
83
|
+
return re(), ie(n, (e) => {
|
|
84
84
|
const i = {};
|
|
85
85
|
for (const r of Object.keys(t)) i[r] = e(t[r]);
|
|
86
86
|
return i;
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
89
|
+
function Me(n) {
|
|
90
|
+
re();
|
|
91
91
|
const t = Ht.get(n);
|
|
92
92
|
if (t !== void 0 && t.generation === wt) return t.theme;
|
|
93
|
-
const e =
|
|
93
|
+
const e = Se(n);
|
|
94
94
|
return Ht.set(n, { generation: wt, theme: e }), e;
|
|
95
95
|
}
|
|
96
96
|
function Rt() {
|
|
97
97
|
wt++;
|
|
98
98
|
for (const n of It) n();
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function Le(n) {
|
|
101
101
|
return It.add(n), () => {
|
|
102
102
|
It.delete(n);
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
class
|
|
105
|
+
const Te = { width: 0, height: 0 };
|
|
106
|
+
class Ae {
|
|
107
107
|
constructor(t) {
|
|
108
108
|
g(this, "span", null);
|
|
109
109
|
g(this, "root");
|
|
@@ -120,10 +120,10 @@ class Te {
|
|
|
120
120
|
measure(t, e) {
|
|
121
121
|
const i = `${e}|${t}`, r = this.cache.get(i);
|
|
122
122
|
if (r !== void 0) return r;
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
const
|
|
123
|
+
const o = this.ensure();
|
|
124
|
+
if (o === null) return Te;
|
|
125
|
+
o.className = `uc-measure ${e}`, o.textContent = t;
|
|
126
|
+
const s = o.getBoundingClientRect(), a = { width: s.width, height: s.height };
|
|
127
127
|
return this.cache.set(i, a), a;
|
|
128
128
|
}
|
|
129
129
|
clear() {
|
|
@@ -139,8 +139,8 @@ function St(n) {
|
|
|
139
139
|
}
|
|
140
140
|
function mt(n, t) {
|
|
141
141
|
if (!Number.isFinite(n) || n <= 0) return 1;
|
|
142
|
-
const e = Math.max(1, Math.floor(t)), i = n / e, r = Math.pow(10, Math.floor(Math.log10(i))),
|
|
143
|
-
return (
|
|
142
|
+
const e = Math.max(1, Math.floor(t)), i = n / e, r = Math.pow(10, Math.floor(Math.log10(i))), o = i / r, s = 1e-9;
|
|
143
|
+
return (o <= 1 + s ? 1 : o <= 2 + s ? 2 : o <= 5 + s ? 5 : 10) * r;
|
|
144
144
|
}
|
|
145
145
|
function Dt(n) {
|
|
146
146
|
const t = Math.abs(n);
|
|
@@ -155,7 +155,7 @@ function Dt(n) {
|
|
|
155
155
|
function Mt(n, t) {
|
|
156
156
|
return t <= 0 || !Number.isFinite(n) || Math.abs(n) >= 1e21 ? St(n) : St(Number(n.toFixed(Math.min(20, t))));
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Fe(n, t, e) {
|
|
159
159
|
if (!Number.isFinite(n) || !Number.isFinite(t)) return [0, 1];
|
|
160
160
|
if (n === t) return [n - 1, t + 1];
|
|
161
161
|
const i = mt(t - n, e), r = Dt(i);
|
|
@@ -167,14 +167,14 @@ function Ae(n, t, e) {
|
|
|
167
167
|
function Vt(n, t) {
|
|
168
168
|
return !Number.isFinite(n) || !Number.isFinite(t) ? [0, 1] : n === t ? [n - 1, t + 1] : [n, t];
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function oe(n, t, e) {
|
|
171
171
|
if (!Number.isFinite(n) || !Number.isFinite(t)) return [];
|
|
172
172
|
if (n === t) return [St(n)];
|
|
173
|
-
const [i, r] = n < t ? [n, t] : [t, n],
|
|
173
|
+
const [i, r] = n < t ? [n, t] : [t, n], o = mt(r - i, e), s = Dt(o), a = o * 1e-9, l = Math.ceil((i - a) / o), c = Math.floor((r + a) / o);
|
|
174
174
|
if (!Number.isFinite(l) || !Number.isFinite(c)) return [];
|
|
175
175
|
const u = [];
|
|
176
176
|
for (let h = l; h <= c; h++)
|
|
177
|
-
u.push(Mt(h *
|
|
177
|
+
u.push(Mt(h * o, s));
|
|
178
178
|
return u;
|
|
179
179
|
}
|
|
180
180
|
class _t {
|
|
@@ -195,17 +195,17 @@ class _t {
|
|
|
195
195
|
return this.m === 0 ? this.domain[0] : (t - this.b) / this.m;
|
|
196
196
|
}
|
|
197
197
|
ticks(t) {
|
|
198
|
-
return
|
|
198
|
+
return oe(this.domain[0], this.domain[1], t);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
let
|
|
201
|
+
let at = null;
|
|
202
202
|
function se() {
|
|
203
|
-
if (
|
|
203
|
+
if (at !== null) return at;
|
|
204
204
|
const n = typeof navigator > "u" ? void 0 : navigator.language;
|
|
205
|
-
return
|
|
205
|
+
return at = typeof n == "string" && n !== "" ? n : "en-US", at;
|
|
206
206
|
}
|
|
207
207
|
const ht = /* @__PURE__ */ new Map();
|
|
208
|
-
function
|
|
208
|
+
function Pe(n) {
|
|
209
209
|
const t = se(), e = `${t}|${n}`;
|
|
210
210
|
let i = ht.get(e);
|
|
211
211
|
return i === void 0 && (i = new Intl.NumberFormat(t, {
|
|
@@ -214,8 +214,8 @@ function Le(n) {
|
|
|
214
214
|
useGrouping: !0
|
|
215
215
|
}), ht.set(e, i)), i;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
return
|
|
217
|
+
function Ee(n, t) {
|
|
218
|
+
return Pe(Math.min(6, Dt(t))).format(n);
|
|
219
219
|
}
|
|
220
220
|
function Bt(n) {
|
|
221
221
|
if (!Number.isFinite(n)) return "–";
|
|
@@ -223,78 +223,78 @@ function Bt(n) {
|
|
|
223
223
|
let i = ht.get(e);
|
|
224
224
|
return i === void 0 && (i = new Intl.NumberFormat(t, { maximumFractionDigits: 3, useGrouping: !0 }), ht.set(e, i)), i.format(n);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
227
|
-
function
|
|
228
|
-
const t = n.filter((
|
|
229
|
-
for (const
|
|
230
|
-
const
|
|
231
|
-
|
|
226
|
+
const K = 1e3, U = 60 * K, Q = 60 * U, X = 24 * Q;
|
|
227
|
+
function De(n) {
|
|
228
|
+
const t = n.filter((o) => Number.isFinite(o.from) && Number.isFinite(o.to) && o.to > o.from).sort((o, s) => o.from - s.from), e = [];
|
|
229
|
+
for (const o of t) {
|
|
230
|
+
const s = e[e.length - 1];
|
|
231
|
+
s !== void 0 && o.from <= s.to ? o.to > s.to && (e[e.length - 1] = { from: s.from, to: o.to }) : e.push({ from: o.from, to: o.to });
|
|
232
232
|
}
|
|
233
233
|
const i = [];
|
|
234
234
|
let r = 0;
|
|
235
|
-
for (const
|
|
236
|
-
i.push(r), r +=
|
|
235
|
+
for (const o of e)
|
|
236
|
+
i.push(r), r += o.to - o.from;
|
|
237
237
|
return { intervals: e, offsets: i, total: r };
|
|
238
238
|
}
|
|
239
239
|
const Yt = /* @__PURE__ */ new WeakMap();
|
|
240
|
-
function
|
|
240
|
+
function G(n) {
|
|
241
241
|
if (!Array.isArray(n)) return n;
|
|
242
242
|
const t = n, e = Yt.get(t);
|
|
243
243
|
if (e !== void 0) return e;
|
|
244
|
-
const i =
|
|
244
|
+
const i = De(t);
|
|
245
245
|
return Yt.set(t, i), i;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function $e(n, t) {
|
|
248
248
|
const e = n.intervals;
|
|
249
|
-
let i = 0, r = e.length - 1,
|
|
249
|
+
let i = 0, r = e.length - 1, o = -1;
|
|
250
250
|
for (; i <= r; ) {
|
|
251
|
-
const
|
|
252
|
-
e[
|
|
251
|
+
const s = i + r >> 1;
|
|
252
|
+
e[s].from <= t ? (o = s, i = s + 1) : r = s - 1;
|
|
253
253
|
}
|
|
254
|
-
return
|
|
254
|
+
return o < 0 ? -1 : t <= e[o].to ? o : -1;
|
|
255
255
|
}
|
|
256
256
|
function pt(n, t) {
|
|
257
|
-
const e =
|
|
257
|
+
const e = G(t);
|
|
258
258
|
if (e.intervals.length === 0) return n;
|
|
259
|
-
const i =
|
|
259
|
+
const i = $e(e, n);
|
|
260
260
|
return i < 0 ? Number.NaN : e.offsets[i] + (n - e.intervals[i].from);
|
|
261
261
|
}
|
|
262
262
|
function dt(n, t) {
|
|
263
|
-
const e =
|
|
263
|
+
const e = G(t), i = e.intervals;
|
|
264
264
|
if (i.length === 0) return n;
|
|
265
265
|
if (!(n >= 0) || n > e.total) return Number.NaN;
|
|
266
266
|
if (n === e.total)
|
|
267
267
|
return i[i.length - 1].to;
|
|
268
|
-
let r = 0,
|
|
269
|
-
for (; r <=
|
|
270
|
-
const a = r +
|
|
271
|
-
e.offsets[a] <= n ? (
|
|
268
|
+
let r = 0, o = i.length - 1, s = 0;
|
|
269
|
+
for (; r <= o; ) {
|
|
270
|
+
const a = r + o >> 1;
|
|
271
|
+
e.offsets[a] <= n ? (s = a, r = a + 1) : o = a - 1;
|
|
272
272
|
}
|
|
273
|
-
return i[
|
|
273
|
+
return i[s].from + (n - e.offsets[s]);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
const r =
|
|
277
|
-
for (let
|
|
278
|
-
i[
|
|
275
|
+
function Jn(n, t, e, i) {
|
|
276
|
+
const r = G(n);
|
|
277
|
+
for (let o = 0; o < e; o++)
|
|
278
|
+
i[o] = pt(t[o], r);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
const e =
|
|
280
|
+
function Ce(n, t) {
|
|
281
|
+
const e = G(t);
|
|
282
282
|
if (e.intervals.length === 0) return n;
|
|
283
283
|
const i = pt(n, e);
|
|
284
284
|
if (!Number.isNaN(i)) return i;
|
|
285
285
|
if (!Number.isFinite(n)) return Number.NaN;
|
|
286
286
|
for (let r = 0; r < e.intervals.length; r++) {
|
|
287
|
-
const
|
|
288
|
-
if (n <
|
|
287
|
+
const o = e.intervals[r];
|
|
288
|
+
if (n < o.from) return e.offsets[r];
|
|
289
289
|
}
|
|
290
290
|
return e.total;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
const e =
|
|
292
|
+
function Oe(n, t) {
|
|
293
|
+
const e = G(t);
|
|
294
294
|
return e.intervals.length === 0 ? !1 : Number.isNaN(pt(n, e));
|
|
295
295
|
}
|
|
296
|
-
function
|
|
297
|
-
const t =
|
|
296
|
+
function We(n) {
|
|
297
|
+
const t = G(n), e = [];
|
|
298
298
|
for (let i = 1; i < t.intervals.length; i++)
|
|
299
299
|
e.push({
|
|
300
300
|
from: t.intervals[i - 1].to,
|
|
@@ -303,65 +303,65 @@ function Ce(n) {
|
|
|
303
303
|
});
|
|
304
304
|
return e;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
return
|
|
306
|
+
function He(n, t, e) {
|
|
307
|
+
return We(n).map((i) => i.operatingTime).filter((i) => i >= t && i <= e);
|
|
308
308
|
}
|
|
309
309
|
const zt = [
|
|
310
|
-
q,
|
|
311
|
-
2 * q,
|
|
312
|
-
5 * q,
|
|
313
|
-
10 * q,
|
|
314
|
-
15 * q,
|
|
315
|
-
30 * q,
|
|
316
310
|
K,
|
|
317
311
|
2 * K,
|
|
318
312
|
5 * K,
|
|
319
313
|
10 * K,
|
|
320
314
|
15 * K,
|
|
321
315
|
30 * K,
|
|
322
|
-
J,
|
|
323
|
-
2 * J,
|
|
324
|
-
3 * J,
|
|
325
|
-
6 * J,
|
|
326
|
-
12 * J,
|
|
327
316
|
U,
|
|
328
317
|
2 * U,
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
318
|
+
5 * U,
|
|
319
|
+
10 * U,
|
|
320
|
+
15 * U,
|
|
321
|
+
30 * U,
|
|
322
|
+
Q,
|
|
323
|
+
2 * Q,
|
|
324
|
+
3 * Q,
|
|
325
|
+
6 * Q,
|
|
326
|
+
12 * Q,
|
|
327
|
+
X,
|
|
328
|
+
2 * X,
|
|
329
|
+
7 * X,
|
|
330
|
+
14 * X,
|
|
331
|
+
28 * X
|
|
332
332
|
];
|
|
333
|
-
function
|
|
333
|
+
function Re(n, t) {
|
|
334
334
|
const e = zt[0];
|
|
335
335
|
if (!Number.isFinite(n) || n <= 0) return e;
|
|
336
336
|
const i = n / Math.max(1, Math.floor(t));
|
|
337
337
|
for (const r of zt) if (r >= i) return r;
|
|
338
|
-
return
|
|
338
|
+
return X * mt(i / X, 1);
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
const
|
|
342
|
-
if (!Number.isFinite(t) || !Number.isFinite(e) || !(i > 0)) return
|
|
340
|
+
function Ve(n, t, e, i, r = 0) {
|
|
341
|
+
const o = G(n), s = [];
|
|
342
|
+
if (!Number.isFinite(t) || !Number.isFinite(e) || !(i > 0)) return s;
|
|
343
343
|
const a = Math.ceil((t - r) / i), l = Math.floor((e - r) / i);
|
|
344
|
-
if (!Number.isFinite(a) || !Number.isFinite(l)) return
|
|
344
|
+
if (!Number.isFinite(a) || !Number.isFinite(l)) return s;
|
|
345
345
|
let c = Number.NaN;
|
|
346
346
|
for (let u = a; u <= l; u++) {
|
|
347
|
-
const h = r + u * i, p = pt(h,
|
|
348
|
-
Number.isNaN(p) || p === c || (
|
|
349
|
-
}
|
|
350
|
-
return
|
|
351
|
-
}
|
|
352
|
-
function
|
|
353
|
-
const
|
|
354
|
-
if (
|
|
355
|
-
const
|
|
356
|
-
return
|
|
357
|
-
|
|
358
|
-
dt(
|
|
359
|
-
dt(a,
|
|
347
|
+
const h = r + u * i, p = pt(h, o);
|
|
348
|
+
Number.isNaN(p) || p === c || (s.push({ wallClock: h, operatingTime: p }), c = p);
|
|
349
|
+
}
|
|
350
|
+
return s;
|
|
351
|
+
}
|
|
352
|
+
function _e(n, t, e, i, r = 0) {
|
|
353
|
+
const o = G(n);
|
|
354
|
+
if (o.intervals.length === 0 || !(e > t)) return [];
|
|
355
|
+
const s = Math.max(0, Math.min(o.total, t)), a = Math.max(0, Math.min(o.total, e)), l = Re(e - t, i);
|
|
356
|
+
return Ve(
|
|
357
|
+
o,
|
|
358
|
+
dt(s, o),
|
|
359
|
+
dt(a, o),
|
|
360
360
|
l,
|
|
361
361
|
r
|
|
362
362
|
).map((u) => u.operatingTime).filter((u) => u >= t && u <= e);
|
|
363
363
|
}
|
|
364
|
-
const
|
|
364
|
+
const Lt = 5, Tt = 4, xt = 8, Gt = 4, Be = 8, it = "uc-tick-label", lt = "uc-axis-title", ae = {
|
|
365
365
|
width: 0,
|
|
366
366
|
height: 0,
|
|
367
367
|
plot: { x: 0, y: 0, width: 0, height: 0 },
|
|
@@ -369,18 +369,18 @@ const Tt = 5, At = 4, xt = 8, Gt = 4, Ve = 8, ut = "uc-tick-label", at = "uc-axi
|
|
|
369
369
|
};
|
|
370
370
|
function qt(n, t, e) {
|
|
371
371
|
const i = Math.ceil(t), r = e.get(n);
|
|
372
|
-
return r === void 0 || i > r || r - i >=
|
|
372
|
+
return r === void 0 || i > r || r - i >= Be ? (e.set(n, i), i) : r;
|
|
373
373
|
}
|
|
374
374
|
function Kt(n, t) {
|
|
375
375
|
const e = n.domainMode;
|
|
376
376
|
if (Array.isArray(e)) {
|
|
377
|
-
const
|
|
378
|
-
return
|
|
377
|
+
const o = e;
|
|
378
|
+
return o[0] === o[1] ? [o[0] - 1, o[1] + 1] : o;
|
|
379
379
|
}
|
|
380
380
|
const [i, r] = n.extent;
|
|
381
|
-
return n.calendar !== void 0 && n.calendar.length > 0 || e === "data" ? Vt(i, r) :
|
|
381
|
+
return n.calendar !== void 0 && n.calendar.length > 0 || e === "data" ? Vt(i, r) : Fe(i, r, t);
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Ye(n) {
|
|
384
384
|
if (!Number.isFinite(n)) return "";
|
|
385
385
|
const t = new Date(n), e = (i) => String(i).padStart(2, "0");
|
|
386
386
|
return `${e(t.getDate())}.${e(t.getMonth() + 1)}. ${e(t.getHours())}:${e(t.getMinutes())}`;
|
|
@@ -389,166 +389,168 @@ function Ut(n, t, e) {
|
|
|
389
389
|
if (n.tickValues !== void 0)
|
|
390
390
|
return n.tickValues.filter((r) => r >= t[0] && r <= t[1]);
|
|
391
391
|
const i = n.calendar;
|
|
392
|
-
return i !== void 0 && i.length > 0 ?
|
|
392
|
+
return i !== void 0 && i.length > 0 ? _e(i, t[0], t[1], e) : oe(t[0], t[1], e);
|
|
393
393
|
}
|
|
394
394
|
function Xt(n, t, e) {
|
|
395
395
|
const i = n.calendar;
|
|
396
396
|
if (i !== void 0 && i.length > 0) {
|
|
397
|
-
const
|
|
398
|
-
return
|
|
397
|
+
const o = n.tickFormat;
|
|
398
|
+
return o === void 0 ? (s) => Ye(dt(s, i)) : (s) => o(dt(s, i));
|
|
399
399
|
}
|
|
400
400
|
if (n.tickFormat !== void 0) return n.tickFormat;
|
|
401
401
|
const r = mt(Math.abs(t[1] - t[0]), e);
|
|
402
|
-
return (
|
|
402
|
+
return (o) => Ee(o, r);
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
const { width: t, height: e, padding: i, axes: r, measure:
|
|
404
|
+
function ze(n) {
|
|
405
|
+
const { width: t, height: e, padding: i, axes: r, measure: o, hysteresis: s } = n, a = r.filter((v) => v.position === "left"), l = r.filter((v) => v.position === "right"), c = r.filter((v) => v.position === "top"), u = r.filter((v) => v.position === "bottom"), h = Math.ceil(o("0", it).height) || 14, p = /* @__PURE__ */ new Map();
|
|
406
406
|
for (const v of [...c, ...u]) {
|
|
407
|
-
const M = v.label === void 0 || v.label === "" ? 0 : Math.ceil(
|
|
408
|
-
p.set(v.key, qt(v.key,
|
|
407
|
+
const M = v.label === void 0 || v.label === "" ? 0 : Math.ceil(o(v.label, lt).height) + Gt;
|
|
408
|
+
p.set(v.key, qt(v.key, Lt + Tt + h + M, s));
|
|
409
409
|
}
|
|
410
410
|
const d = (v, M) => {
|
|
411
411
|
let x = 0;
|
|
412
|
-
for (let
|
|
413
|
-
const
|
|
414
|
-
|
|
412
|
+
for (let T = 0; T < v.length; T++) {
|
|
413
|
+
const C = v[T];
|
|
414
|
+
C !== void 0 && (x += M.get(C.key) ?? 0, T > 0 && (x += xt));
|
|
415
415
|
}
|
|
416
416
|
return x;
|
|
417
417
|
}, m = i.top + d(c, p), y = e - i.bottom - d(u, p), f = Math.max(0, y - m), b = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map();
|
|
418
418
|
for (const v of [...a, ...l]) {
|
|
419
|
-
const M = v.tickCount ?? Math.max(2, Math.round(f / 50)), x = Kt(v, M),
|
|
420
|
-
let
|
|
421
|
-
for (const
|
|
422
|
-
const
|
|
423
|
-
|
|
419
|
+
const M = v.tickCount ?? Math.max(2, Math.round(f / 50)), x = Kt(v, M), T = Ut(v, x, M), C = Xt(v, x, M), L = T.map(C), W = L.map((R) => o(R, it).width);
|
|
420
|
+
let D = 0;
|
|
421
|
+
for (const R of W) R > D && (D = R);
|
|
422
|
+
for (const R of v.limitLabels ?? []) D = Math.max(D, o(R, it).width + 4);
|
|
423
|
+
const B = v.label === void 0 || v.label === "" ? 0 : Math.ceil(o(v.label, lt).height) + Gt;
|
|
424
|
+
b.set(v.key, { axis: v, domain: x, values: T, labels: L, widths: W, format: C }), k.set(
|
|
424
425
|
v.key,
|
|
425
|
-
qt(v.key,
|
|
426
|
+
qt(v.key, Lt + Tt + D + B, s)
|
|
426
427
|
);
|
|
427
428
|
}
|
|
428
|
-
const
|
|
429
|
+
const w = i.left + d(a, k), I = t - i.right - d(l, k), A = Math.max(0, I - w), F = { x: w, y: m, width: A, height: f }, P = (v, M, x, T) => {
|
|
429
430
|
switch (v.position) {
|
|
430
431
|
case "left":
|
|
431
|
-
return { x:
|
|
432
|
+
return { x: w - x - T, y: m, width: T, height: f };
|
|
432
433
|
case "right":
|
|
433
|
-
return { x:
|
|
434
|
+
return { x: I + x, y: m, width: T, height: f };
|
|
434
435
|
case "top":
|
|
435
|
-
return { x:
|
|
436
|
+
return { x: w, y: m - x - T, width: A, height: T };
|
|
436
437
|
default:
|
|
437
|
-
return { x:
|
|
438
|
+
return { x: w, y: y + x, width: A, height: T };
|
|
438
439
|
}
|
|
439
|
-
},
|
|
440
|
+
}, N = [], H = (v) => {
|
|
440
441
|
let M = 0;
|
|
441
|
-
v.forEach((x,
|
|
442
|
-
const
|
|
443
|
-
M +=
|
|
444
|
-
const
|
|
445
|
-
value:
|
|
446
|
-
label: (
|
|
447
|
-
px:
|
|
442
|
+
v.forEach((x, T) => {
|
|
443
|
+
const C = k.get(x.key) ?? 0, L = b.get(x.key), W = P(x, T, M, C);
|
|
444
|
+
M += C + xt;
|
|
445
|
+
const D = (L == null ? void 0 : L.domain) ?? [0, 1], B = (L == null ? void 0 : L.format) ?? ((J) => String(J)), R = new _t(D, [m + f, m]), et = ((L == null ? void 0 : L.values) ?? []).map((J, Y) => ({
|
|
446
|
+
value: J,
|
|
447
|
+
label: (L == null ? void 0 : L.labels[Y]) ?? "",
|
|
448
|
+
px: R.toPx(J),
|
|
448
449
|
labelLeft: 0,
|
|
449
|
-
labelWidth: (
|
|
450
|
+
labelWidth: (L == null ? void 0 : L.widths[Y]) ?? 0
|
|
450
451
|
}));
|
|
451
|
-
|
|
452
|
+
N.push({
|
|
452
453
|
key: x.key,
|
|
453
454
|
id: x.id,
|
|
454
455
|
orientation: "y",
|
|
455
456
|
position: x.position,
|
|
456
457
|
label: x.label,
|
|
457
458
|
grid: x.grid,
|
|
458
|
-
band:
|
|
459
|
-
size:
|
|
460
|
-
stack:
|
|
461
|
-
domain:
|
|
462
|
-
scale:
|
|
459
|
+
band: W,
|
|
460
|
+
size: C,
|
|
461
|
+
stack: T,
|
|
462
|
+
domain: D,
|
|
463
|
+
scale: R,
|
|
463
464
|
ticks: et,
|
|
464
|
-
format:
|
|
465
|
-
titleSize: x.label === void 0 || x.label === "" ? 0 : Math.ceil(
|
|
465
|
+
format: B,
|
|
466
|
+
titleSize: x.label === void 0 || x.label === "" ? 0 : Math.ceil(o(x.label, lt).height),
|
|
466
467
|
breaks: []
|
|
467
468
|
});
|
|
468
469
|
});
|
|
469
470
|
};
|
|
470
471
|
H(a), H(l);
|
|
471
|
-
const
|
|
472
|
+
const V = (v) => {
|
|
472
473
|
let M = 0;
|
|
473
|
-
v.forEach((x,
|
|
474
|
-
const
|
|
475
|
-
M +=
|
|
476
|
-
const
|
|
477
|
-
const Ct =
|
|
478
|
-
return { value:
|
|
474
|
+
v.forEach((x, T) => {
|
|
475
|
+
const C = p.get(x.key) ?? 0, L = P(x, T, M, C);
|
|
476
|
+
M += C + xt;
|
|
477
|
+
const W = x.tickCount ?? Math.max(2, Math.round(A / 80)), D = Kt(x, W), B = Ut(x, D, W), R = Xt(x, D, W), et = new _t(D, [w, w + A]), J = B.map((Y) => {
|
|
478
|
+
const Ct = R(Y), yt = o(Ct, it).width, Ot = et.toPx(Y), ye = Ot - yt / 2, ge = Math.min(Math.max(ye, 0), Math.max(0, t - yt));
|
|
479
|
+
return { value: Y, label: Ct, px: Ot, labelLeft: ge, labelWidth: yt };
|
|
479
480
|
});
|
|
480
|
-
|
|
481
|
+
N.push({
|
|
481
482
|
key: x.key,
|
|
482
483
|
id: x.id,
|
|
483
484
|
orientation: "x",
|
|
484
485
|
position: x.position,
|
|
485
486
|
label: x.label,
|
|
486
487
|
grid: x.grid,
|
|
487
|
-
band:
|
|
488
|
-
size:
|
|
489
|
-
stack:
|
|
490
|
-
domain:
|
|
488
|
+
band: L,
|
|
489
|
+
size: C,
|
|
490
|
+
stack: T,
|
|
491
|
+
domain: D,
|
|
491
492
|
scale: et,
|
|
492
|
-
ticks:
|
|
493
|
-
format:
|
|
494
|
-
titleSize: x.label === void 0 || x.label === "" ? 0 : Math.ceil(
|
|
495
|
-
breaks: x.calendar === void 0 || x.calendar.length === 0 ? [] :
|
|
493
|
+
ticks: J,
|
|
494
|
+
format: R,
|
|
495
|
+
titleSize: x.label === void 0 || x.label === "" ? 0 : Math.ceil(o(x.label, lt).height),
|
|
496
|
+
breaks: x.calendar === void 0 || x.calendar.length === 0 ? [] : He(x.calendar, D[0], D[1]).map((Y) => et.toPx(Y))
|
|
496
497
|
});
|
|
497
498
|
});
|
|
498
499
|
};
|
|
499
|
-
return
|
|
500
|
+
return V(c), V(u), { width: t, height: e, plot: F, axes: N };
|
|
500
501
|
}
|
|
501
|
-
function
|
|
502
|
+
function Ge(n, t, e) {
|
|
502
503
|
if (t <= 0 || !(e >= n[0])) return -1;
|
|
503
504
|
let i = 0, r = t - 1;
|
|
504
505
|
if (n[r] <= e) return r;
|
|
505
506
|
for (; r - i > 1; ) {
|
|
506
|
-
const
|
|
507
|
-
n[
|
|
507
|
+
const o = i + r >> 1;
|
|
508
|
+
n[o] <= e ? i = o : r = o;
|
|
508
509
|
}
|
|
509
510
|
return i;
|
|
510
511
|
}
|
|
511
|
-
function
|
|
512
|
+
function le(n, t, e, i) {
|
|
512
513
|
return e + 1 < t ? n[e + 1] : i;
|
|
513
514
|
}
|
|
514
|
-
|
|
515
|
+
const ce = 0.28;
|
|
516
|
+
function ot(n, t) {
|
|
515
517
|
return Number.isFinite(n) ? n : t;
|
|
516
518
|
}
|
|
517
|
-
function
|
|
519
|
+
function ue(n) {
|
|
518
520
|
return !Number.isFinite(n);
|
|
519
521
|
}
|
|
520
522
|
function Zt(n, t) {
|
|
521
523
|
return n < t;
|
|
522
524
|
}
|
|
523
|
-
function
|
|
525
|
+
function qe(n, t, e, i) {
|
|
524
526
|
const r = new Int32Array(e);
|
|
525
|
-
for (let
|
|
526
|
-
const
|
|
527
|
-
if (!Zt(
|
|
527
|
+
for (let o = 0; o < e; o++) {
|
|
528
|
+
const s = n[o], a = ot(t[o], i);
|
|
529
|
+
if (!Zt(s, a)) continue;
|
|
528
530
|
let l = 0;
|
|
529
|
-
for (let c = 0; c <
|
|
530
|
-
const u = n[c], h =
|
|
531
|
-
Zt(u, h) &&
|
|
531
|
+
for (let c = 0; c < o; c++) {
|
|
532
|
+
const u = n[c], h = ot(t[c], i);
|
|
533
|
+
Zt(u, h) && s < h && u < a && l++;
|
|
532
534
|
}
|
|
533
|
-
r[
|
|
535
|
+
r[o] = l;
|
|
534
536
|
}
|
|
535
537
|
return r;
|
|
536
538
|
}
|
|
537
|
-
function
|
|
538
|
-
const
|
|
539
|
-
for (let
|
|
540
|
-
const
|
|
541
|
-
if (!(Math.abs(
|
|
542
|
-
const
|
|
543
|
-
if (r >=
|
|
539
|
+
function Ke(n, t, e, i, r, o, s, a, l = null, c = 0) {
|
|
540
|
+
const u = s / 2;
|
|
541
|
+
for (let h = i - 1; h >= 0; h--) {
|
|
542
|
+
const p = e[h] + (l === null ? 0 : l[h] * c);
|
|
543
|
+
if (!(Math.abs(p - o) <= u)) continue;
|
|
544
|
+
const d = n[h], m = ot(t[h], a);
|
|
545
|
+
if (r >= d && r < m) return h;
|
|
544
546
|
}
|
|
545
547
|
return -1;
|
|
546
548
|
}
|
|
547
549
|
function st(n) {
|
|
548
550
|
return Math.round(n) + 0.5;
|
|
549
551
|
}
|
|
550
|
-
function
|
|
551
|
-
const { plot: e, axes: i, theme: r } = t,
|
|
552
|
+
function Ue(n, t) {
|
|
553
|
+
const { plot: e, axes: i, theme: r } = t, o = e.x, s = e.x + e.width, a = e.y, l = e.y + e.height;
|
|
552
554
|
n.lineWidth = 1;
|
|
553
555
|
for (const c of i)
|
|
554
556
|
if (c.grid)
|
|
@@ -560,7 +562,7 @@ function qe(n, t) {
|
|
|
560
562
|
if ((c.orientation === "y" && d.value === 0) === h)
|
|
561
563
|
if (p = !0, c.orientation === "y") {
|
|
562
564
|
const y = st(d.px);
|
|
563
|
-
n.moveTo(
|
|
565
|
+
n.moveTo(o, y), n.lineTo(s, y);
|
|
564
566
|
} else {
|
|
565
567
|
const y = st(d.px);
|
|
566
568
|
n.moveTo(y, a), n.lineTo(y, l);
|
|
@@ -568,8 +570,8 @@ function qe(n, t) {
|
|
|
568
570
|
p && (n.strokeStyle = h ? r.colorAxis : r.colorGrid, n.stroke());
|
|
569
571
|
}
|
|
570
572
|
}
|
|
571
|
-
function
|
|
572
|
-
const e = t.length, i = t.xScale.m, r = t.xScale.b,
|
|
573
|
+
function Xe(n, t) {
|
|
574
|
+
const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = new Path2D();
|
|
573
575
|
let u = !1;
|
|
574
576
|
for (let h = 0; h < e; h++) {
|
|
575
577
|
const p = l[h];
|
|
@@ -577,7 +579,7 @@ function Ke(n, t) {
|
|
|
577
579
|
u = !1;
|
|
578
580
|
continue;
|
|
579
581
|
}
|
|
580
|
-
const d = a[h] * i + r, m = p *
|
|
582
|
+
const d = a[h] * i + r, m = p * o + s;
|
|
581
583
|
u ? c.lineTo(d, m) : (c.moveTo(d, m), u = !0);
|
|
582
584
|
}
|
|
583
585
|
if (n.strokeStyle = t.color, n.lineWidth = t.strokeWidth, t.dash !== void 0 && t.dash.length > 0 ? n.setLineDash(t.dash) : n.setLineDash([]), n.stroke(c), n.setLineDash([]), t.marker) {
|
|
@@ -585,14 +587,14 @@ function Ke(n, t) {
|
|
|
585
587
|
for (let d = 0; d < e; d++) {
|
|
586
588
|
const m = l[d];
|
|
587
589
|
if (Number.isNaN(m)) continue;
|
|
588
|
-
const y = a[d] * i + r, f = m *
|
|
590
|
+
const y = a[d] * i + r, f = m * o + s;
|
|
589
591
|
p.moveTo(y + h, f), p.arc(y, f, h, 0, Math.PI * 2);
|
|
590
592
|
}
|
|
591
593
|
n.fillStyle = t.color, n.fill(p);
|
|
592
594
|
}
|
|
593
595
|
}
|
|
594
|
-
function
|
|
595
|
-
const e = t.length, i = t.xScale.m, r = t.xScale.b,
|
|
596
|
+
function Ze(n, t) {
|
|
597
|
+
const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = t.y0, u = t.baseline * o + s, h = new Path2D(), p = new Path2D();
|
|
596
598
|
let d = 0;
|
|
597
599
|
for (; d < e; ) {
|
|
598
600
|
for (; d < e && (Number.isNaN(l[d]) || c !== null && Number.isNaN(c[d])); )
|
|
@@ -603,91 +605,91 @@ function Ue(n, t) {
|
|
|
603
605
|
d++;
|
|
604
606
|
const y = d - 1;
|
|
605
607
|
for (let f = m; f <= y; f++) {
|
|
606
|
-
const b = a[f] * i + r, k = l[f] *
|
|
608
|
+
const b = a[f] * i + r, k = l[f] * o + s;
|
|
607
609
|
f === m ? (h.moveTo(b, k), p.moveTo(b, k)) : (h.lineTo(b, k), p.lineTo(b, k));
|
|
608
610
|
}
|
|
609
611
|
if (c === null)
|
|
610
612
|
h.lineTo(a[y] * i + r, u), h.lineTo(a[m] * i + r, u);
|
|
611
613
|
else
|
|
612
614
|
for (let f = y; f >= m; f--)
|
|
613
|
-
h.lineTo(a[f] * i + r, c[f] *
|
|
615
|
+
h.lineTo(a[f] * i + r, c[f] * o + s);
|
|
614
616
|
h.closePath();
|
|
615
617
|
}
|
|
616
618
|
n.globalAlpha = t.alpha * t.fillOpacity, n.fillStyle = t.color, n.fill(h), t.strokeWidth > 0 && (n.globalAlpha = t.alpha, n.strokeStyle = t.color, n.lineWidth = t.strokeWidth, n.setLineDash([]), n.stroke(p));
|
|
617
619
|
}
|
|
618
|
-
function
|
|
619
|
-
const e = t.length, i = t.xScale.m, r = t.xScale.b,
|
|
620
|
+
function je(n, t) {
|
|
621
|
+
const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = t.baseline * o + s, u = t.offset * i, h = t.width * i, p = new Path2D();
|
|
620
622
|
for (let d = 0; d < e; d++) {
|
|
621
623
|
const m = l[d];
|
|
622
624
|
if (Number.isNaN(m)) continue;
|
|
623
|
-
const y = a[d] * i + r + u, f = m *
|
|
625
|
+
const y = a[d] * i + r + u, f = m * o + s;
|
|
624
626
|
p.rect(y, f, h, c - f);
|
|
625
627
|
}
|
|
626
628
|
n.fillStyle = t.color, n.fill(p);
|
|
627
629
|
}
|
|
628
|
-
function
|
|
629
|
-
const e = t.length, i = t.xScale.m, r = t.xScale.b,
|
|
630
|
+
function Je(n, t) {
|
|
631
|
+
const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = t.radius, u = new Path2D();
|
|
630
632
|
for (let h = 0; h < e; h++) {
|
|
631
633
|
const p = l[h];
|
|
632
634
|
if (Number.isNaN(p)) continue;
|
|
633
|
-
const d = a[h] * i + r, m = p *
|
|
635
|
+
const d = a[h] * i + r, m = p * o + s;
|
|
634
636
|
u.moveTo(d + c, m), u.arc(d, m, c, 0, Math.PI * 2);
|
|
635
637
|
}
|
|
636
638
|
n.fillStyle = t.color, n.fill(u);
|
|
637
639
|
}
|
|
638
|
-
function
|
|
639
|
-
const e = t.length, i = t.xScale.m, r = t.xScale.b,
|
|
640
|
+
function Qe(n, t) {
|
|
641
|
+
const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.x, s = t.y, a = t.laneTop, l = t.laneBottom - t.laneTop, c = t.colors.length;
|
|
640
642
|
if (c === 0 || l <= 0) return;
|
|
641
643
|
const u = [];
|
|
642
644
|
for (let p = 0; p < c; p++) u.push(new Path2D());
|
|
643
645
|
let h = !1;
|
|
644
646
|
for (let p = 0; p < e; p++) {
|
|
645
|
-
const d =
|
|
647
|
+
const d = s[p];
|
|
646
648
|
if (Number.isNaN(d)) continue;
|
|
647
649
|
const m = d | 0, y = u[m];
|
|
648
650
|
if (y === void 0) continue;
|
|
649
|
-
const f =
|
|
651
|
+
const f = o[p], b = le(o, e, p, t.domainEnd);
|
|
650
652
|
b > f && (y.rect(f * i + r, a, (b - f) * i, l), h = !0);
|
|
651
653
|
}
|
|
652
654
|
if (h)
|
|
653
655
|
for (let p = 0; p < c; p++)
|
|
654
656
|
n.fillStyle = t.colors[p], n.fill(u[p]);
|
|
655
657
|
}
|
|
656
|
-
function
|
|
657
|
-
const e = t.length, i = t.xScale.m, r = t.xScale.b,
|
|
658
|
+
function tn(n, t) {
|
|
659
|
+
const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = t.buckets, u = t.colors.length;
|
|
658
660
|
if (u === 0) return;
|
|
659
|
-
const h = t.width * i, p = Math.abs(t.height *
|
|
661
|
+
const h = t.width * i, p = Math.abs(t.height * o), d = [];
|
|
660
662
|
for (let m = 0; m < u; m++) d.push(new Path2D());
|
|
661
663
|
for (let m = 0; m < e; m++) {
|
|
662
664
|
const y = c[m];
|
|
663
665
|
if (y < 0) continue;
|
|
664
666
|
const f = d[y];
|
|
665
667
|
if (f === void 0) continue;
|
|
666
|
-
const b = a[m] * i + r - h / 2, k = l[m] *
|
|
668
|
+
const b = a[m] * i + r - h / 2, k = l[m] * o + s - p / 2;
|
|
667
669
|
f.rect(b, k, h, p);
|
|
668
670
|
}
|
|
669
671
|
for (let m = 0; m < u; m++)
|
|
670
672
|
n.fillStyle = t.colors[m], n.fill(d[m]);
|
|
671
673
|
}
|
|
672
|
-
function
|
|
673
|
-
const e = t.length, i = t.xScale.m, r = t.xScale.b,
|
|
674
|
+
function en(n, t) {
|
|
675
|
+
const e = t.length, i = t.xScale.m, r = t.xScale.b, o = t.yScale.m, s = t.yScale.b, a = t.x, l = t.y, c = t.x1, u = t.depth, h = Math.abs(t.height * o), p = h * ce, d = new Path2D(), m = new Path2D();
|
|
674
676
|
for (let y = 0; y < e; y++) {
|
|
675
677
|
const f = l[y];
|
|
676
678
|
if (Number.isNaN(f)) continue;
|
|
677
679
|
const b = a[y];
|
|
678
680
|
if (Number.isNaN(b)) continue;
|
|
679
|
-
const k = c[y],
|
|
680
|
-
if (!(
|
|
681
|
-
const
|
|
682
|
-
(
|
|
681
|
+
const k = c[y], w = ot(k, t.domainEnd);
|
|
682
|
+
if (!(w >= b)) continue;
|
|
683
|
+
const I = b * i + r, A = Math.max(1, (w - b) * i), F = f * o + s + u[y] * p;
|
|
684
|
+
(ue(k) ? m : d).rect(I, F - h / 2, A, h);
|
|
683
685
|
}
|
|
684
686
|
n.fillStyle = t.color, n.fill(d), n.save(), n.globalAlpha = n.globalAlpha * 0.45, n.fill(m), n.restore(), n.strokeStyle = t.color, n.lineWidth = 1, n.setLineDash([3, 2]), n.stroke(m), n.setLineDash([]);
|
|
685
687
|
}
|
|
686
688
|
function jt(n, t, e) {
|
|
687
689
|
for (const i of e) {
|
|
688
690
|
if (i.band) {
|
|
689
|
-
const r = Math.min(i.fromPx, i.toPx),
|
|
690
|
-
n.fillStyle = i.color, n.save(), n.globalAlpha = 0.12, i.orientation === "y" ? n.fillRect(t.x, r, t.width,
|
|
691
|
+
const r = Math.min(i.fromPx, i.toPx), o = Math.max(i.fromPx, i.toPx);
|
|
692
|
+
n.fillStyle = i.color, n.save(), n.globalAlpha = 0.12, i.orientation === "y" ? n.fillRect(t.x, r, t.width, o - r) : n.fillRect(r, t.y, o - r, t.height), n.restore();
|
|
691
693
|
continue;
|
|
692
694
|
}
|
|
693
695
|
if (n.beginPath(), i.orientation === "y") {
|
|
@@ -700,47 +702,47 @@ function jt(n, t, e) {
|
|
|
700
702
|
n.strokeStyle = i.color, n.lineWidth = 1, n.setLineDash(i.dash), n.stroke(), n.setLineDash([]);
|
|
701
703
|
}
|
|
702
704
|
}
|
|
703
|
-
function
|
|
704
|
-
const { width: e, height: i, plot: r, series:
|
|
705
|
+
function nn(n, t) {
|
|
706
|
+
const { width: e, height: i, plot: r, series: o } = t;
|
|
705
707
|
if (n.clearRect(0, 0, e, i), !(r.width <= 0 || r.height <= 0)) {
|
|
706
|
-
|
|
707
|
-
for (const
|
|
708
|
-
if (
|
|
709
|
-
switch (n.globalAlpha =
|
|
708
|
+
Ue(n, t), n.save(), n.beginPath(), n.rect(r.x, r.y, r.width, r.height), n.clip(), n.lineJoin = "round", n.lineCap = "round", n.globalAlpha = 1, jt(n, r, t.limitBands);
|
|
709
|
+
for (const s of o)
|
|
710
|
+
if (s.length !== 0)
|
|
711
|
+
switch (n.globalAlpha = s.alpha, s.kind) {
|
|
710
712
|
case "line":
|
|
711
|
-
|
|
713
|
+
Xe(n, s);
|
|
712
714
|
break;
|
|
713
715
|
case "area":
|
|
714
|
-
|
|
716
|
+
Ze(n, s);
|
|
715
717
|
break;
|
|
716
718
|
case "bar":
|
|
717
|
-
|
|
719
|
+
je(n, s);
|
|
718
720
|
break;
|
|
719
721
|
case "scatter":
|
|
720
|
-
|
|
722
|
+
Je(n, s);
|
|
721
723
|
break;
|
|
722
724
|
case "state":
|
|
723
|
-
|
|
725
|
+
Qe(n, s);
|
|
724
726
|
break;
|
|
725
727
|
case "matrix":
|
|
726
|
-
|
|
728
|
+
tn(n, s);
|
|
727
729
|
break;
|
|
728
730
|
case "span":
|
|
729
|
-
|
|
731
|
+
en(n, s);
|
|
730
732
|
break;
|
|
731
733
|
}
|
|
732
734
|
n.globalAlpha = 1, jt(n, r, t.limitLines), n.restore();
|
|
733
735
|
}
|
|
734
736
|
}
|
|
735
|
-
function
|
|
736
|
-
const { width: e, height: i, plot: r, theme:
|
|
737
|
-
if (n.clearRect(0, 0, e, i),
|
|
738
|
-
const a = st(
|
|
739
|
-
a >= r.x && a <= r.x + r.width && (n.beginPath(), n.moveTo(a, r.y), n.lineTo(a, r.y + r.height), n.lineWidth = 1, n.strokeStyle =
|
|
740
|
-
for (const l of
|
|
741
|
-
n.beginPath(), n.arc(l.x, l.y, 5.5, 0, Math.PI * 2), n.fillStyle =
|
|
742
|
-
}
|
|
743
|
-
function
|
|
737
|
+
function rn(n, t) {
|
|
738
|
+
const { width: e, height: i, plot: r, theme: o, hover: s } = t;
|
|
739
|
+
if (n.clearRect(0, 0, e, i), s === null || r.width <= 0 || r.height <= 0) return;
|
|
740
|
+
const a = st(s.hit.xPx);
|
|
741
|
+
a >= r.x && a <= r.x + r.width && (n.beginPath(), n.moveTo(a, r.y), n.lineTo(a, r.y + r.height), n.lineWidth = 1, n.strokeStyle = o.colorAxis, n.setLineDash([]), n.stroke());
|
|
742
|
+
for (const l of s.marker)
|
|
743
|
+
n.beginPath(), n.arc(l.x, l.y, 5.5, 0, Math.PI * 2), n.fillStyle = o.colorBg, n.fill(), n.beginPath(), n.arc(l.x, l.y, 3.5, 0, Math.PI * 2), n.fillStyle = l.color, n.fill();
|
|
744
|
+
}
|
|
745
|
+
function on(n, t, e) {
|
|
744
746
|
if (t <= 0) return -1;
|
|
745
747
|
if (t === 1) return 0;
|
|
746
748
|
let i = 0, r = t - 1;
|
|
@@ -750,24 +752,24 @@ function nn(n, t, e) {
|
|
|
750
752
|
const a = i + r >> 1;
|
|
751
753
|
n[a] <= e ? i = a : r = a;
|
|
752
754
|
}
|
|
753
|
-
const
|
|
754
|
-
return n[r] - e <
|
|
755
|
+
const o = e - n[i];
|
|
756
|
+
return n[r] - e < o ? r : i;
|
|
755
757
|
}
|
|
756
758
|
function Jt(n, t) {
|
|
757
759
|
if (t < 2) return 0;
|
|
758
760
|
const e = n.slice(0, t).sort();
|
|
759
761
|
let i = Number.POSITIVE_INFINITY;
|
|
760
762
|
for (let r = 1; r < t; r++) {
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
+
const o = e[r] - e[r - 1];
|
|
764
|
+
o > 0 && o < i && (i = o);
|
|
763
765
|
}
|
|
764
766
|
return Number.isFinite(i) ? i : 0;
|
|
765
767
|
}
|
|
766
|
-
function
|
|
768
|
+
function ct(n, t) {
|
|
767
769
|
return n > 0 ? n : t;
|
|
768
770
|
}
|
|
769
|
-
function
|
|
770
|
-
const a =
|
|
771
|
+
function sn(n, t, e, i, r, o, s) {
|
|
772
|
+
const a = o / 2, l = s / 2;
|
|
771
773
|
for (let c = 0; c < e; c++) {
|
|
772
774
|
const u = i - n[c];
|
|
773
775
|
if (!(u >= -a && u < a)) continue;
|
|
@@ -777,77 +779,77 @@ function rn(n, t, e, i, r, s, o) {
|
|
|
777
779
|
}
|
|
778
780
|
return -1;
|
|
779
781
|
}
|
|
780
|
-
const
|
|
782
|
+
const an = {
|
|
781
783
|
ok: 0,
|
|
782
784
|
unknown: 1,
|
|
783
785
|
warning: 2,
|
|
784
786
|
alarm: 3
|
|
785
787
|
};
|
|
786
|
-
function
|
|
787
|
-
return
|
|
788
|
+
function Qn(n) {
|
|
789
|
+
return an[n];
|
|
788
790
|
}
|
|
789
791
|
const Qt = { warning: 2, alarm: 3 };
|
|
790
|
-
function
|
|
792
|
+
function ln(n, t = {}) {
|
|
791
793
|
if (n == null || !Number.isFinite(n))
|
|
792
794
|
return { verdict: "unknown" };
|
|
793
795
|
const e = t.target, i = e !== void 0 && Number.isFinite(e) ? n - e : void 0;
|
|
794
|
-
let r,
|
|
796
|
+
let r, o = 0;
|
|
795
797
|
for (const a of t.limits ?? []) {
|
|
796
798
|
const l = a.side === "upper" ? n - a.value : a.value - n;
|
|
797
|
-
l > 0 && (r === void 0 || Qt[a.severity] > Qt[r.severity] || a.severity === r.severity && l >
|
|
799
|
+
l > 0 && (r === void 0 || Qt[a.severity] > Qt[r.severity] || a.severity === r.severity && l > o) && (r = a, o = l);
|
|
798
800
|
}
|
|
799
801
|
if (r === void 0)
|
|
800
802
|
return i === void 0 ? { verdict: "ok" } : { verdict: "ok", deviation: i };
|
|
801
|
-
const
|
|
803
|
+
const s = {
|
|
802
804
|
verdict: r.severity,
|
|
803
805
|
limit: r,
|
|
804
|
-
excess:
|
|
806
|
+
excess: o
|
|
805
807
|
};
|
|
806
|
-
return i === void 0 ?
|
|
807
|
-
}
|
|
808
|
-
function
|
|
809
|
-
const
|
|
810
|
-
let f = Number.POSITIVE_INFINITY, b = Number.NEGATIVE_INFINITY, k = Number.POSITIVE_INFINITY,
|
|
811
|
-
typeof i == "number" &&
|
|
812
|
-
for (let
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
const
|
|
816
|
-
if (
|
|
817
|
-
const v = p(
|
|
818
|
-
d[
|
|
808
|
+
return i === void 0 ? s : { ...s, deviation: i };
|
|
809
|
+
}
|
|
810
|
+
function cn(n, t, e, i, r) {
|
|
811
|
+
const o = n.length, s = new Float64Array(o), a = new Float64Array(o), l = typeof i == "function" ? i : null, c = l === null ? null : new Float64Array(o), u = (r == null ? void 0 : r.value) ?? null, h = u === null ? null : new Float64Array(o), p = (r == null ? void 0 : r.xEnd) ?? null, d = p === null ? null : new Float64Array(o), m = (r == null ? void 0 : r.xMap) ?? null, y = (r == null ? void 0 : r.xGap) ?? null;
|
|
812
|
+
let f = Number.POSITIVE_INFINITY, b = Number.NEGATIVE_INFINITY, k = Number.POSITIVE_INFINITY, w = Number.NEGATIVE_INFINITY;
|
|
813
|
+
typeof i == "number" && o > 0 && (k = i, w = i);
|
|
814
|
+
for (let I = 0; I < o; I++) {
|
|
815
|
+
const A = n[I], F = t(A, I), P = m === null ? F : m(F);
|
|
816
|
+
s[I] = P;
|
|
817
|
+
const N = y !== null && y(F);
|
|
818
|
+
if (N || (P < f && (f = P), P > b && (b = P)), p !== null) {
|
|
819
|
+
const v = p(A, I), M = v ?? Number.NaN, x = !Number.isFinite(M) || m === null ? M : m(M);
|
|
820
|
+
d[I] = x, Number.isFinite(x) && (x < f && (f = x), x > b && (b = x));
|
|
819
821
|
}
|
|
820
|
-
const H =
|
|
821
|
-
if (a[
|
|
822
|
-
const v =
|
|
823
|
-
h[
|
|
822
|
+
const H = N ? null : e(A, I), V = H ?? Number.NaN;
|
|
823
|
+
if (a[I] = V, V < k && (k = V), V > w && (w = V), u !== null) {
|
|
824
|
+
const v = N ? null : u(A, I);
|
|
825
|
+
h[I] = v ?? Number.NaN;
|
|
824
826
|
}
|
|
825
827
|
if (l !== null) {
|
|
826
|
-
const v =
|
|
827
|
-
c[
|
|
828
|
+
const v = N ? null : l(A, I), M = v ?? Number.NaN;
|
|
829
|
+
c[I] = M, M < k && (k = M), M > w && (w = M);
|
|
828
830
|
}
|
|
829
831
|
}
|
|
830
|
-
return { series: { x:
|
|
832
|
+
return { series: { x: s, y: a, y0: c, w: h, x1: d, length: o }, extent: { xMin: f, xMax: b, yMin: k, yMax: w } };
|
|
831
833
|
}
|
|
832
|
-
function
|
|
834
|
+
function un(n, t) {
|
|
833
835
|
for (let e = 1; e < t; e++)
|
|
834
836
|
if (n[e] < n[e - 1]) return e;
|
|
835
837
|
return -1;
|
|
836
838
|
}
|
|
837
|
-
function
|
|
838
|
-
let r = Number.POSITIVE_INFINITY,
|
|
839
|
-
for (const
|
|
840
|
-
const a =
|
|
841
|
-
if (a === null || !(n === "x" ?
|
|
839
|
+
function hn(n, t, e, i) {
|
|
840
|
+
let r = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY;
|
|
841
|
+
for (const s of e) {
|
|
842
|
+
const a = s.extent;
|
|
843
|
+
if (a === null || !(n === "x" ? s.xAxisId === t : s.yAxisId === t)) continue;
|
|
842
844
|
const c = n === "x" ? a.xMin : a.yMin, u = n === "x" ? a.xMax : a.yMax;
|
|
843
|
-
c < r && (r = c), u >
|
|
845
|
+
c < r && (r = c), u > o && (o = u);
|
|
844
846
|
}
|
|
845
847
|
if (i !== void 0)
|
|
846
|
-
for (const
|
|
847
|
-
Number.isFinite(
|
|
848
|
-
return !Number.isFinite(r) || !Number.isFinite(
|
|
848
|
+
for (const s of i)
|
|
849
|
+
Number.isFinite(s) && (s < r && (r = s), s > o && (o = s));
|
|
850
|
+
return !Number.isFinite(r) || !Number.isFinite(o) ? [0, 1] : [r, o];
|
|
849
851
|
}
|
|
850
|
-
function
|
|
852
|
+
function dn(n, t) {
|
|
851
853
|
let e = Number.POSITIVE_INFINITY;
|
|
852
854
|
for (let i = 1; i < t; i++) {
|
|
853
855
|
const r = n[i] - n[i - 1];
|
|
@@ -855,14 +857,14 @@ function un(n, t) {
|
|
|
855
857
|
}
|
|
856
858
|
return Number.isFinite(e) ? e : 0;
|
|
857
859
|
}
|
|
858
|
-
function
|
|
860
|
+
function fn(n, t) {
|
|
859
861
|
return n > 0 ? n : t;
|
|
860
862
|
}
|
|
861
|
-
function
|
|
862
|
-
const r = n * t,
|
|
863
|
-
return { offset: -r / 2 + e *
|
|
863
|
+
function mn(n, t, e, i) {
|
|
864
|
+
const r = n * t, o = r / i;
|
|
865
|
+
return { offset: -r / 2 + e * o, width: o };
|
|
864
866
|
}
|
|
865
|
-
function
|
|
867
|
+
function pn(n) {
|
|
866
868
|
const t = /* @__PURE__ */ new Map();
|
|
867
869
|
for (const i of n) {
|
|
868
870
|
if (i.kind !== "bar") continue;
|
|
@@ -874,13 +876,13 @@ function fn(n) {
|
|
|
874
876
|
let r = Number.POSITIVE_INFINITY;
|
|
875
877
|
for (const a of i)
|
|
876
878
|
a.step > 0 && a.step < r && (r = a.step);
|
|
877
|
-
const
|
|
879
|
+
const o = Number.isFinite(r) ? r : 0, s = i[0].fraction;
|
|
878
880
|
i.forEach((a, l) => {
|
|
879
881
|
e.set(a.order, {
|
|
880
882
|
index: l,
|
|
881
883
|
size: i.length,
|
|
882
|
-
step:
|
|
883
|
-
fraction:
|
|
884
|
+
step: o,
|
|
885
|
+
fraction: s
|
|
884
886
|
});
|
|
885
887
|
});
|
|
886
888
|
}
|
|
@@ -888,7 +890,7 @@ function fn(n) {
|
|
|
888
890
|
}
|
|
889
891
|
const te = {
|
|
890
892
|
version: 0,
|
|
891
|
-
layout:
|
|
893
|
+
layout: ae,
|
|
892
894
|
legend: null,
|
|
893
895
|
series: [],
|
|
894
896
|
limits: []
|
|
@@ -897,10 +899,10 @@ const te = {
|
|
|
897
899
|
hover: null,
|
|
898
900
|
tooltip: null,
|
|
899
901
|
xLabel: ""
|
|
900
|
-
},
|
|
902
|
+
}, yn = 4, gn = 60;
|
|
901
903
|
let vt = 0;
|
|
902
|
-
const
|
|
903
|
-
function
|
|
904
|
+
const bn = new Float64Array(0), xn = new Int32Array(0);
|
|
905
|
+
function z(n, t) {
|
|
904
906
|
return n === t ? !0 : typeof n != "function" || typeof t != "function" ? !1 : String(n) === String(t);
|
|
905
907
|
}
|
|
906
908
|
function ft(n, t) {
|
|
@@ -909,10 +911,14 @@ function ft(n, t) {
|
|
|
909
911
|
for (let e = 0; e < n.length; e++) if (n[e] !== t[e]) return !1;
|
|
910
912
|
return !0;
|
|
911
913
|
}
|
|
912
|
-
function
|
|
913
|
-
return n.kind === t.kind &&
|
|
914
|
+
function vn(n, t) {
|
|
915
|
+
return n.kind === t.kind && z(n.accessor, t.accessor) && n.data === t.data && z(Pt(n), Pt(t)) && z(At(n), At(t)) && z(Ft(n), Ft(t)) && // The height of a span widens its y extent, and the extent is made here.
|
|
916
|
+
ne(n) === ne(t);
|
|
917
|
+
}
|
|
918
|
+
function ne(n) {
|
|
919
|
+
return n.kind === "span" ? n.height : void 0;
|
|
914
920
|
}
|
|
915
|
-
function
|
|
921
|
+
function At(n) {
|
|
916
922
|
return n.kind === "matrix" ? n.value : void 0;
|
|
917
923
|
}
|
|
918
924
|
function Ft(n) {
|
|
@@ -933,7 +939,7 @@ function Pt(n) {
|
|
|
933
939
|
return;
|
|
934
940
|
}
|
|
935
941
|
}
|
|
936
|
-
function
|
|
942
|
+
function kn(n, t) {
|
|
937
943
|
if (n.kind !== t.kind) return !1;
|
|
938
944
|
switch (t.kind) {
|
|
939
945
|
case "line": {
|
|
@@ -942,7 +948,7 @@ function xn(n, t) {
|
|
|
942
948
|
}
|
|
943
949
|
case "area": {
|
|
944
950
|
const e = n;
|
|
945
|
-
return
|
|
951
|
+
return z(e.baseline, t.baseline) && e.fillOpacity === t.fillOpacity && e.strokeWidth === t.strokeWidth;
|
|
946
952
|
}
|
|
947
953
|
case "bar":
|
|
948
954
|
return n.barWidth === t.barWidth;
|
|
@@ -950,64 +956,64 @@ function xn(n, t) {
|
|
|
950
956
|
return n.radius === t.radius;
|
|
951
957
|
case "state": {
|
|
952
958
|
const e = n;
|
|
953
|
-
return e.laneFrom === t.laneFrom && e.laneTo === t.laneTo &&
|
|
959
|
+
return e.laneFrom === t.laneFrom && e.laneTo === t.laneTo && Nn(e.states, t.states);
|
|
954
960
|
}
|
|
955
961
|
case "matrix":
|
|
956
|
-
return
|
|
962
|
+
return wn(n.coloring, t.coloring);
|
|
957
963
|
case "span":
|
|
958
964
|
return n.height === t.height;
|
|
959
965
|
}
|
|
960
966
|
}
|
|
961
|
-
function
|
|
962
|
-
var e, i, r,
|
|
967
|
+
function Nn(n, t) {
|
|
968
|
+
var e, i, r, o;
|
|
963
969
|
if (n === t) return !0;
|
|
964
970
|
if (n.length !== t.length) return !1;
|
|
965
|
-
for (let
|
|
966
|
-
if (((e = n[
|
|
971
|
+
for (let s = 0; s < n.length; s++)
|
|
972
|
+
if (((e = n[s]) == null ? void 0 : e.label) !== ((i = t[s]) == null ? void 0 : i.label) || ((r = n[s]) == null ? void 0 : r.color) !== ((o = t[s]) == null ? void 0 : o.color)) return !1;
|
|
967
973
|
return !0;
|
|
968
974
|
}
|
|
969
|
-
function
|
|
975
|
+
function wn(n, t) {
|
|
970
976
|
return n === t ? !0 : n.kind !== t.kind ? !1 : n.kind === "assessment" && t.kind === "assessment" ? n.limits === t.limits : n.kind === "gradient" && t.kind === "gradient" ? ft(n.stops, t.stops) && ft(n.range, t.range) : !1;
|
|
971
977
|
}
|
|
972
|
-
function
|
|
978
|
+
function In(n, t) {
|
|
973
979
|
return n.kind === "assessment" ? [t.colorOk, t.colorWarning, t.colorAlarm] : n.stops;
|
|
974
980
|
}
|
|
975
|
-
function
|
|
981
|
+
function Sn(n, t, e) {
|
|
976
982
|
var c, u;
|
|
977
|
-
const i = n.length, r = new Int32Array(i),
|
|
978
|
-
if (
|
|
983
|
+
const i = n.length, r = new Int32Array(i), o = n.w;
|
|
984
|
+
if (o === null || e === 0)
|
|
979
985
|
return r.fill(-1), r;
|
|
980
986
|
if (t.kind === "assessment") {
|
|
981
987
|
for (let h = 0; h < i; h++) {
|
|
982
|
-
const p =
|
|
988
|
+
const p = ln(o[h], t.limits);
|
|
983
989
|
r[h] = p.verdict === "alarm" ? 2 : p.verdict === "warning" ? 1 : p.verdict === "ok" ? 0 : -1;
|
|
984
990
|
}
|
|
985
991
|
return r;
|
|
986
992
|
}
|
|
987
|
-
let
|
|
988
|
-
if (
|
|
989
|
-
|
|
993
|
+
let s = (c = t.range) == null ? void 0 : c[0], a = (u = t.range) == null ? void 0 : u[1];
|
|
994
|
+
if (s === void 0 || a === void 0) {
|
|
995
|
+
s = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY;
|
|
990
996
|
for (let h = 0; h < i; h++) {
|
|
991
|
-
const p =
|
|
992
|
-
Number.isFinite(p) && (p <
|
|
997
|
+
const p = o[h];
|
|
998
|
+
Number.isFinite(p) && (p < s && (s = p), p > a && (a = p));
|
|
993
999
|
}
|
|
994
1000
|
}
|
|
995
|
-
const l = a -
|
|
1001
|
+
const l = a - s;
|
|
996
1002
|
for (let h = 0; h < i; h++) {
|
|
997
|
-
const p =
|
|
1003
|
+
const p = o[h];
|
|
998
1004
|
if (!Number.isFinite(p)) {
|
|
999
1005
|
r[h] = -1;
|
|
1000
1006
|
continue;
|
|
1001
1007
|
}
|
|
1002
|
-
const d = l > 0 ? (p -
|
|
1008
|
+
const d = l > 0 ? (p - s) / l : 0.5, m = Math.floor(d * e);
|
|
1003
1009
|
r[h] = m < 0 ? 0 : m >= e ? e - 1 : m;
|
|
1004
1010
|
}
|
|
1005
1011
|
return r;
|
|
1006
1012
|
}
|
|
1007
|
-
function
|
|
1013
|
+
function Mn(n, t) {
|
|
1008
1014
|
return n === t ? !0 : Array.isArray(n) && Array.isArray(t) ? n[0] === t[0] && n[1] === t[1] : !1;
|
|
1009
1015
|
}
|
|
1010
|
-
class
|
|
1016
|
+
class he {
|
|
1011
1017
|
constructor() {
|
|
1012
1018
|
/* ---------- Registration ---------- */
|
|
1013
1019
|
g(this, "series", /* @__PURE__ */ new Map());
|
|
@@ -1046,7 +1052,7 @@ class ce {
|
|
|
1046
1052
|
g(this, "theme", null);
|
|
1047
1053
|
g(this, "unsubscribeTheme", null);
|
|
1048
1054
|
/* ---------- Layout and interaction ---------- */
|
|
1049
|
-
g(this, "layout",
|
|
1055
|
+
g(this, "layout", ae);
|
|
1050
1056
|
g(this, "hysteresis", /* @__PURE__ */ new Map());
|
|
1051
1057
|
g(this, "hover", null);
|
|
1052
1058
|
g(this, "hoverKey", "");
|
|
@@ -1067,6 +1073,10 @@ class ce {
|
|
|
1067
1073
|
g(this, "onPerf", null);
|
|
1068
1074
|
/* ================= Materialisation (R-2.6, R-2.7) ================= */
|
|
1069
1075
|
g(this, "sortednessChecked", !1);
|
|
1076
|
+
g(this, "onFontsLoaded", () => {
|
|
1077
|
+
var t;
|
|
1078
|
+
(t = this.measurer) == null || t.clear(), this.markLayoutDirty();
|
|
1079
|
+
});
|
|
1070
1080
|
g(this, "themeRoot", null);
|
|
1071
1081
|
g(this, "subscribeLayout", (t) => (this.layoutSubscribers.add(t), () => {
|
|
1072
1082
|
this.layoutSubscribers.delete(t);
|
|
@@ -1119,12 +1129,12 @@ class ce {
|
|
|
1119
1129
|
updateSeries(t, e) {
|
|
1120
1130
|
const i = this.series.get(t);
|
|
1121
1131
|
if (i === void 0) return;
|
|
1122
|
-
const r = i.config,
|
|
1132
|
+
const r = i.config, o = vn(r, e), s = o && r.xAxisId === e.xAxisId && r.yAxisId === e.yAxisId && r.name === e.name && r.color === e.color && r.tone === e.tone && kn(r, e);
|
|
1123
1133
|
if (r.name !== e.name && e.name !== void 0) {
|
|
1124
1134
|
const a = this.slotsByName.get(e.name);
|
|
1125
1135
|
a === void 0 ? this.slotsByName.set(e.name, i.slot) : this.slotTaken(a, i) || (i.slot = a);
|
|
1126
1136
|
}
|
|
1127
|
-
i.config = e, !
|
|
1137
|
+
i.config = e, !s && (o || (i.materialized = null, i.extent = null, i.step = null, i.cellHeight = null, i.depth = null, this.materialsDirty = !0), this.markLayoutDirty());
|
|
1128
1138
|
}
|
|
1129
1139
|
unregisterSeries(t) {
|
|
1130
1140
|
this.series.delete(t) && (this.materialsDirty = !0, this.markLayoutDirty());
|
|
@@ -1136,9 +1146,9 @@ class ce {
|
|
|
1136
1146
|
updateAxis(t, e) {
|
|
1137
1147
|
const i = this.axes.get(t);
|
|
1138
1148
|
if (i === void 0) return;
|
|
1139
|
-
const r = i.config,
|
|
1140
|
-
if (i.config = e, !
|
|
1141
|
-
if (!
|
|
1149
|
+
const r = i.config, o = z(r.accessor, e.accessor) && r.calendar === e.calendar, s = o && r.id === e.id && r.orientation === e.orientation && r.position === e.position && r.label === e.label && r.tickCount === e.tickCount && r.grid === e.grid && ft(r.ticks, e.ticks) && Mn(r.domain, e.domain) && z(r.tickFormat, e.tickFormat);
|
|
1150
|
+
if (i.config = e, !s) {
|
|
1151
|
+
if (!o || r.id !== e.id) {
|
|
1142
1152
|
for (const a of this.series.values())
|
|
1143
1153
|
a.materialized = null, a.extent = null, a.step = null, a.cellHeight = null, a.depth = null;
|
|
1144
1154
|
this.materialsDirty = !0;
|
|
@@ -1182,7 +1192,7 @@ class ce {
|
|
|
1182
1192
|
}
|
|
1183
1193
|
updateTooltip(t) {
|
|
1184
1194
|
const e = this.tooltip;
|
|
1185
|
-
if (e !== null && e.mode === t.mode &&
|
|
1195
|
+
if (e !== null && e.mode === t.mode && z(e.render, t.render)) {
|
|
1186
1196
|
this.tooltip = t;
|
|
1187
1197
|
return;
|
|
1188
1198
|
}
|
|
@@ -1215,41 +1225,41 @@ class ce {
|
|
|
1215
1225
|
/* ================= Checks (R-4.12, R-4.13) ================= */
|
|
1216
1226
|
/** Called from the Chart after the child effects; DEV only. */
|
|
1217
1227
|
validate() {
|
|
1218
|
-
if (!
|
|
1228
|
+
if (!rt) return;
|
|
1219
1229
|
const t = /* @__PURE__ */ new Set();
|
|
1220
|
-
for (const { config:
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1223
|
-
!t.has(
|
|
1224
|
-
`Two <${a}> with the same id "${
|
|
1225
|
-
), t.add(
|
|
1230
|
+
for (const { config: o } of this.axesInOrder()) {
|
|
1231
|
+
const s = `${o.orientation}:${o.id}`, a = o.orientation === "x" ? "XAxis" : "YAxis";
|
|
1232
|
+
ut(
|
|
1233
|
+
!t.has(s),
|
|
1234
|
+
`Two <${a}> with the same id "${o.id}". A second ${a} needs an own id (R-4.12).`
|
|
1235
|
+
), t.add(s);
|
|
1226
1236
|
}
|
|
1227
1237
|
const e = /* @__PURE__ */ new Set();
|
|
1228
|
-
for (const { config:
|
|
1229
|
-
|
|
1230
|
-
t.has(`x:${
|
|
1231
|
-
`Series "${
|
|
1232
|
-
),
|
|
1233
|
-
t.has(`y:${
|
|
1234
|
-
`Series "${
|
|
1235
|
-
), e.add(`x:${
|
|
1236
|
-
for (const
|
|
1237
|
-
!e.has(
|
|
1238
|
-
`axis-without-series-${
|
|
1239
|
-
`Axis "${
|
|
1238
|
+
for (const { config: o } of this.series.values())
|
|
1239
|
+
ut(
|
|
1240
|
+
t.has(`x:${o.xAxisId}`),
|
|
1241
|
+
`Series "${o.name ?? "?"}" refers to the unknown x axis "${o.xAxisId}" (R-4.12).`
|
|
1242
|
+
), ut(
|
|
1243
|
+
t.has(`y:${o.yAxisId}`),
|
|
1244
|
+
`Series "${o.name ?? "?"}" refers to the unknown y axis "${o.yAxisId}" (R-4.12).`
|
|
1245
|
+
), e.add(`x:${o.xAxisId}`), e.add(`y:${o.yAxisId}`);
|
|
1246
|
+
for (const o of t)
|
|
1247
|
+
!e.has(o) && this.series.size > 0 && q(
|
|
1248
|
+
`axis-without-series-${o}`,
|
|
1249
|
+
`Axis "${o}" has no bound series; it is drawn with the domain [0, 1] (R-4.13).`
|
|
1240
1250
|
);
|
|
1241
1251
|
const i = /* @__PURE__ */ new Map();
|
|
1242
|
-
for (const { config:
|
|
1243
|
-
if (
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
`bar-width-${
|
|
1247
|
-
`Bars on the x axis "${
|
|
1252
|
+
for (const { config: o } of this.seriesInOrder()) {
|
|
1253
|
+
if (o.kind !== "bar") continue;
|
|
1254
|
+
const s = i.get(o.xAxisId);
|
|
1255
|
+
s === void 0 ? i.set(o.xAxisId, o.barWidth) : s !== o.barWidth && q(
|
|
1256
|
+
`bar-width-${o.xAxisId}`,
|
|
1257
|
+
`Bars on the x axis "${o.xAxisId}" give different barWidth. A group shares one width fraction; that of the first (${s}) applies (ADR-0002).`
|
|
1248
1258
|
);
|
|
1249
1259
|
}
|
|
1250
1260
|
let r = 0;
|
|
1251
|
-
for (const
|
|
1252
|
-
r > 1 &&
|
|
1261
|
+
for (const o of this.axesInOrder()) o.config.grid === !0 && r++;
|
|
1262
|
+
r > 1 && q(
|
|
1253
1263
|
"multiple-grids",
|
|
1254
1264
|
"More than one axis draws grid. Unaligned grids compete visually; there is no tick alignment between axes in V0 (R-4.15)."
|
|
1255
1265
|
);
|
|
@@ -1267,22 +1277,22 @@ class ce {
|
|
|
1267
1277
|
e += i.materialized.length;
|
|
1268
1278
|
continue;
|
|
1269
1279
|
}
|
|
1270
|
-
const r = i.config,
|
|
1271
|
-
if (
|
|
1272
|
-
const a =
|
|
1273
|
-
|
|
1274
|
-
|
|
1280
|
+
const r = i.config, o = r.data ?? this.data, s = this.findXAxis(r.xAxisId);
|
|
1281
|
+
if (s === null) continue;
|
|
1282
|
+
const a = cn(
|
|
1283
|
+
o,
|
|
1284
|
+
s.accessor,
|
|
1275
1285
|
r.accessor,
|
|
1276
1286
|
Pt(r),
|
|
1277
1287
|
{
|
|
1278
|
-
value:
|
|
1288
|
+
value: At(r),
|
|
1279
1289
|
xEnd: Ft(r),
|
|
1280
|
-
xMap: this.mapFor(
|
|
1281
|
-
xGap: this.gapFor(
|
|
1290
|
+
xMap: this.mapFor(s),
|
|
1291
|
+
xGap: this.gapFor(s)
|
|
1282
1292
|
}
|
|
1283
1293
|
);
|
|
1284
1294
|
if (i.materialized = a.series, e += a.series.length, r.kind === "bar") {
|
|
1285
|
-
const l =
|
|
1295
|
+
const l = dn(a.series.x, a.series.length);
|
|
1286
1296
|
i.step = l;
|
|
1287
1297
|
const c = l / 2;
|
|
1288
1298
|
i.extent = {
|
|
@@ -1305,7 +1315,7 @@ class ce {
|
|
|
1305
1315
|
yMax: Number.NEGATIVE_INFINITY
|
|
1306
1316
|
};
|
|
1307
1317
|
else if (r.kind === "span") {
|
|
1308
|
-
i.depth =
|
|
1318
|
+
i.depth = qe(
|
|
1309
1319
|
a.series.x,
|
|
1310
1320
|
a.series.x1 ?? new Float64Array(a.series.length),
|
|
1311
1321
|
a.series.length,
|
|
@@ -1322,10 +1332,10 @@ class ce {
|
|
|
1322
1332
|
};
|
|
1323
1333
|
} else
|
|
1324
1334
|
i.step = null, i.extent = a.extent;
|
|
1325
|
-
if (!this.sortednessChecked &&
|
|
1335
|
+
if (!this.sortednessChecked && rt) {
|
|
1326
1336
|
this.sortednessChecked = !0;
|
|
1327
|
-
const l =
|
|
1328
|
-
l >= 0 &&
|
|
1337
|
+
const l = un(a.series.x, a.series.length);
|
|
1338
|
+
l >= 0 && q(
|
|
1329
1339
|
"x-unsorted",
|
|
1330
1340
|
`X values are not sorted ascending (index ${l}). Binary search and path building assume sortedness; there is no automatic sorting (R-2.6).`
|
|
1331
1341
|
);
|
|
@@ -1335,17 +1345,20 @@ class ce {
|
|
|
1335
1345
|
}
|
|
1336
1346
|
/* ================= DOM binding, DPR, resize ================= */
|
|
1337
1347
|
bind(t, e, i, r) {
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1348
|
+
var s;
|
|
1349
|
+
this.container = t, this.themeRoot = r, this.seriesCanvas = e, this.overlayCanvas = i, this.seriesCtx = e.getContext("2d"), this.overlayCtx = i.getContext("2d"), this.measurer = new Ae(r), this.dpr = typeof devicePixelRatio == "number" ? devicePixelRatio : 1, this.rebindDprWatch(), this.unsubscribeTheme = Le(() => {
|
|
1350
|
+
var a;
|
|
1351
|
+
this.theme = null, (a = this.measurer) == null || a.clear(), this.markLayoutDirty();
|
|
1352
|
+
});
|
|
1353
|
+
const o = typeof document > "u" ? void 0 : document.fonts;
|
|
1354
|
+
(s = o == null ? void 0 : o.addEventListener) == null || s.call(o, "loadingdone", this.onFontsLoaded), this.theme = null, this.markLayoutDirty();
|
|
1342
1355
|
}
|
|
1343
1356
|
bindTooltip(t) {
|
|
1344
1357
|
this.tooltipEl = t;
|
|
1345
1358
|
}
|
|
1346
1359
|
unbind() {
|
|
1347
|
-
var t, e, i;
|
|
1348
|
-
this.frameHandle !== null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(this.frameHandle), this.frameHandle = null), (t = this.dprMedia) == null || t.removeEventListener("change", this.onDprChange), this.dprMedia = null, (e = this.unsubscribeTheme) == null || e.call(this), this.unsubscribeTheme = null, (i = this.measurer) == null ||
|
|
1360
|
+
var t, e, i, r, o;
|
|
1361
|
+
this.frameHandle !== null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(this.frameHandle), this.frameHandle = null), (t = this.dprMedia) == null || t.removeEventListener("change", this.onDprChange), this.dprMedia = null, (e = this.unsubscribeTheme) == null || e.call(this), this.unsubscribeTheme = null, typeof document < "u" && ((r = (i = document.fonts) == null ? void 0 : i.removeEventListener) == null || r.call(i, "loadingdone", this.onFontsLoaded)), (o = this.measurer) == null || o.remove(), this.measurer = null, this.container = null, this.themeRoot = null, this.seriesCanvas = null, this.overlayCanvas = null, this.seriesCtx = null, this.overlayCtx = null, this.tooltipEl = null;
|
|
1349
1362
|
}
|
|
1350
1363
|
/** Detect a change of DPR (a change of monitor): rebind matchMedia (R-2.9). */
|
|
1351
1364
|
rebindDprWatch() {
|
|
@@ -1354,17 +1367,17 @@ class ce {
|
|
|
1354
1367
|
}
|
|
1355
1368
|
/** Called by the ResizeObserver; coalesced onto one rAF (R-2.10). */
|
|
1356
1369
|
requestResize(t, e) {
|
|
1357
|
-
t === this.cssWidth && e === this.cssHeight || (this.pendingWidth = t, this.pendingHeight = e, this.markLayoutDirty());
|
|
1370
|
+
t === (this.pendingWidth ?? this.cssWidth) && e === (this.pendingHeight ?? this.cssHeight) || (this.pendingWidth = t, this.pendingHeight = e, this.markLayoutDirty());
|
|
1358
1371
|
}
|
|
1359
1372
|
applyPendingSize() {
|
|
1360
1373
|
if (this.pendingWidth === null || this.pendingHeight === null) return;
|
|
1361
1374
|
this.cssWidth = this.pendingWidth, this.cssHeight = this.pendingHeight, this.pendingWidth = null, this.pendingHeight = null;
|
|
1362
|
-
const { seriesCanvas: t, overlayCanvas: e, seriesCtx: i, overlayCtx: r, dpr:
|
|
1375
|
+
const { seriesCanvas: t, overlayCanvas: e, seriesCtx: i, overlayCtx: r, dpr: o } = this;
|
|
1363
1376
|
if (!t || !e || !i || !r) return;
|
|
1364
|
-
const
|
|
1377
|
+
const s = Math.max(0, Math.round(this.cssWidth * o)), a = Math.max(0, Math.round(this.cssHeight * o));
|
|
1365
1378
|
for (const l of [t, e])
|
|
1366
|
-
l.width =
|
|
1367
|
-
i.setTransform(
|
|
1379
|
+
l.width = s, l.height = a, l.style.width = `${this.cssWidth}px`, l.style.height = `${this.cssHeight}px`;
|
|
1380
|
+
i.setTransform(o, 0, 0, o, 0, 0), r.setTransform(o, 0, 0, o, 0, 0);
|
|
1368
1381
|
}
|
|
1369
1382
|
/* ================= Scheduling (R-2.11) ================= */
|
|
1370
1383
|
markSeriesDirty() {
|
|
@@ -1384,11 +1397,15 @@ class ce {
|
|
|
1384
1397
|
}));
|
|
1385
1398
|
}
|
|
1386
1399
|
frame() {
|
|
1387
|
-
if (this.applyPendingSize(), this.theme === null && this.themeRoot !== null && (this.theme =
|
|
1400
|
+
if (this.applyPendingSize(), this.theme === null && this.themeRoot !== null && (this.theme = Me(this.themeRoot)), this.cssWidth <= 0 || this.cssHeight <= 0) {
|
|
1388
1401
|
this.layoutDirty && this.pushLayoutSnapshot();
|
|
1389
1402
|
return;
|
|
1390
1403
|
}
|
|
1391
|
-
this.materialsDirty && this.materialize(), this.layoutDirty && (this.updateLayout(), this.layoutDirty = !1, this.pushLayoutSnapshot()
|
|
1404
|
+
if (this.materialsDirty && this.materialize(), this.layoutDirty && (this.updateLayout(), this.layoutDirty = !1, this.pushLayoutSnapshot(), this.hover !== null)) {
|
|
1405
|
+
const { mouseX: t, mouseY: e } = this.hover;
|
|
1406
|
+
this.hoverKey = "", this.pointerMove(t, e);
|
|
1407
|
+
}
|
|
1408
|
+
this.seriesDirty && (this.drawSeriesLayer(), this.seriesDirty = !1), this.overlayDirty && (this.drawOverlayLayer(), this.overlayDirty = !1);
|
|
1392
1409
|
}
|
|
1393
1410
|
/* ================= Layout ================= */
|
|
1394
1411
|
/** The effective grid default: only the first registered axis per orientation
|
|
@@ -1396,9 +1413,9 @@ class ce {
|
|
|
1396
1413
|
gridDefault() {
|
|
1397
1414
|
const t = /* @__PURE__ */ new Map();
|
|
1398
1415
|
let e = !0, i = !0;
|
|
1399
|
-
for (const [r,
|
|
1400
|
-
const
|
|
1401
|
-
t.set(r,
|
|
1416
|
+
for (const [r, o] of [...this.axes.entries()].sort((s, a) => s[1].order - a[1].order)) {
|
|
1417
|
+
const s = o.config.orientation === "x" ? e : i;
|
|
1418
|
+
t.set(r, o.config.grid ?? s), o.config.orientation === "x" ? e = !1 : i = !1;
|
|
1402
1419
|
}
|
|
1403
1420
|
return t;
|
|
1404
1421
|
}
|
|
@@ -1414,7 +1431,7 @@ class ce {
|
|
|
1414
1431
|
yAxisId: r.config.yAxisId,
|
|
1415
1432
|
extent: r.extent
|
|
1416
1433
|
}));
|
|
1417
|
-
return
|
|
1434
|
+
return hn(t, e, i, this.limitValues(t, e));
|
|
1418
1435
|
}
|
|
1419
1436
|
/** The values of the limits that are to pull this axis along. */
|
|
1420
1437
|
limitValues(t, e) {
|
|
@@ -1430,41 +1447,42 @@ class ce {
|
|
|
1430
1447
|
mapFor(t) {
|
|
1431
1448
|
const e = t.calendar;
|
|
1432
1449
|
if (!(e === void 0 || e.length === 0))
|
|
1433
|
-
return (i) =>
|
|
1450
|
+
return (i) => Ce(i, e);
|
|
1434
1451
|
}
|
|
1435
1452
|
gapFor(t) {
|
|
1436
1453
|
const e = t.calendar;
|
|
1437
1454
|
if (!(e === void 0 || e.length === 0))
|
|
1438
|
-
return (i) =>
|
|
1455
|
+
return (i) => Oe(i, e);
|
|
1439
1456
|
}
|
|
1440
1457
|
extentFor(t) {
|
|
1441
1458
|
return this.axisExtent(t.orientation, t.id);
|
|
1442
1459
|
}
|
|
1443
1460
|
updateLayout() {
|
|
1444
1461
|
const t = this.measurer, e = this.gridDefault(), i = [];
|
|
1445
|
-
for (const [r,
|
|
1446
|
-
const
|
|
1462
|
+
for (const [r, o] of [...this.axes.entries()].sort((s, a) => s[1].order - a[1].order)) {
|
|
1463
|
+
const s = o.config;
|
|
1447
1464
|
i.push({
|
|
1448
|
-
key: `${
|
|
1449
|
-
id:
|
|
1450
|
-
orientation:
|
|
1451
|
-
position:
|
|
1452
|
-
label:
|
|
1465
|
+
key: `${s.orientation}:${s.id}`,
|
|
1466
|
+
id: s.id,
|
|
1467
|
+
orientation: s.orientation,
|
|
1468
|
+
position: s.position,
|
|
1469
|
+
label: s.label,
|
|
1453
1470
|
grid: e.get(r) ?? !1,
|
|
1454
|
-
extent: this.extentFor(
|
|
1455
|
-
domainMode:
|
|
1456
|
-
tickCount:
|
|
1457
|
-
tickFormat:
|
|
1458
|
-
tickValues:
|
|
1459
|
-
calendar:
|
|
1471
|
+
extent: this.extentFor(s),
|
|
1472
|
+
domainMode: s.domain,
|
|
1473
|
+
tickCount: s.tickCount,
|
|
1474
|
+
tickFormat: s.tickFormat,
|
|
1475
|
+
tickValues: s.ticks,
|
|
1476
|
+
calendar: s.calendar,
|
|
1477
|
+
limitLabels: s.orientation === "y" ? this.limitsInOrder().map((a) => a.config).filter((a) => a.orientation === "y" && a.axisId === s.id && a.label !== void 0 && a.label !== "").map((a) => a.label) : void 0
|
|
1460
1478
|
});
|
|
1461
1479
|
}
|
|
1462
|
-
this.layout =
|
|
1480
|
+
this.layout = ze({
|
|
1463
1481
|
width: this.cssWidth,
|
|
1464
1482
|
height: this.cssHeight,
|
|
1465
1483
|
padding: this.padding,
|
|
1466
1484
|
axes: i,
|
|
1467
|
-
measure: (r,
|
|
1485
|
+
measure: (r, o) => t === null ? { width: 0, height: 0 } : t.measure(r, o),
|
|
1468
1486
|
hysteresis: this.hysteresis
|
|
1469
1487
|
});
|
|
1470
1488
|
}
|
|
@@ -1475,26 +1493,26 @@ class ce {
|
|
|
1475
1493
|
}
|
|
1476
1494
|
/* ================= Series colours and legend entries ================= */
|
|
1477
1495
|
colorFor(t, e) {
|
|
1478
|
-
var
|
|
1496
|
+
var o;
|
|
1479
1497
|
if (t.config.color !== void 0) return t.config.color;
|
|
1480
1498
|
const i = t.config.tone;
|
|
1481
1499
|
if (i !== void 0) {
|
|
1482
|
-
const
|
|
1483
|
-
return i === "alarm" ?
|
|
1500
|
+
const s = this.theme ?? O;
|
|
1501
|
+
return i === "alarm" ? s.colorAlarm : i === "warning" ? s.colorWarning : s.colorOk;
|
|
1484
1502
|
}
|
|
1485
|
-
const r = ((
|
|
1486
|
-
return r[this.paletteSlot(t, e) % Math.max(1, r.length)] ??
|
|
1503
|
+
const r = ((o = this.theme) == null ? void 0 : o.series) ?? O.series;
|
|
1504
|
+
return r[this.paletteSlot(t, e) % Math.max(1, r.length)] ?? O.series[0] ?? "#2563eb";
|
|
1487
1505
|
}
|
|
1488
1506
|
/** Named: the place of the name. Nameless: the index in the registration, as
|
|
1489
1507
|
before - and a warning as soon as that shifts underneath it. */
|
|
1490
1508
|
paletteSlot(t, e) {
|
|
1491
|
-
return t.config.name !== void 0 ? t.slot : (t.lastSlot !== null && t.lastSlot !== e &&
|
|
1509
|
+
return t.config.name !== void 0 ? t.slot : (t.lastSlot !== null && t.lastSlot !== e && q(
|
|
1492
1510
|
"series-without-name-colour",
|
|
1493
1511
|
"a series without a name has changed its colour, because a series before it went away - with `name` it keeps it."
|
|
1494
1512
|
), t.lastSlot = e, e);
|
|
1495
1513
|
}
|
|
1496
1514
|
nameFor(t, e) {
|
|
1497
|
-
return t.config.name !== void 0 ? t.config.name : (
|
|
1515
|
+
return t.config.name !== void 0 ? t.config.name : (q(
|
|
1498
1516
|
"series-without-name",
|
|
1499
1517
|
`a series without a name is called "Series ${e + 1}" in the legend and the tooltip - the name belongs in \`name\`.`
|
|
1500
1518
|
), `Series ${e + 1}`);
|
|
@@ -1502,14 +1520,14 @@ class ce {
|
|
|
1502
1520
|
legendItems() {
|
|
1503
1521
|
const t = [], e = /* @__PURE__ */ new Set();
|
|
1504
1522
|
return this.seriesInOrder().forEach((i, r) => {
|
|
1505
|
-
const
|
|
1506
|
-
if (
|
|
1507
|
-
|
|
1508
|
-
const l = `${
|
|
1523
|
+
const o = i.config;
|
|
1524
|
+
if (o.kind === "state") {
|
|
1525
|
+
o.states.forEach((s, a) => {
|
|
1526
|
+
const l = `${s.label}\0${s.color}`;
|
|
1509
1527
|
e.has(l) || (e.add(l), t.push({
|
|
1510
1528
|
id: `${i.order}:${a}`,
|
|
1511
|
-
name:
|
|
1512
|
-
color:
|
|
1529
|
+
name: s.label,
|
|
1530
|
+
color: s.color,
|
|
1513
1531
|
seriesId: i.order
|
|
1514
1532
|
}));
|
|
1515
1533
|
});
|
|
@@ -1540,28 +1558,28 @@ class ce {
|
|
|
1540
1558
|
}
|
|
1541
1559
|
}
|
|
1542
1560
|
limitItems(t) {
|
|
1543
|
-
const e = this.theme ??
|
|
1561
|
+
const e = this.theme ?? O, i = [];
|
|
1544
1562
|
for (const { config: r } of this.limitsInOrder()) {
|
|
1545
1563
|
if (r.kind === "band" !== t) continue;
|
|
1546
|
-
const
|
|
1547
|
-
if (
|
|
1548
|
-
const
|
|
1564
|
+
const o = this.findAxis(r.orientation, r.axisId);
|
|
1565
|
+
if (o === null) continue;
|
|
1566
|
+
const s = this.limitColor(r, e), a = this.limitDash(r);
|
|
1549
1567
|
if (r.kind === "band")
|
|
1550
1568
|
i.push({
|
|
1551
1569
|
orientation: r.orientation,
|
|
1552
|
-
fromPx:
|
|
1553
|
-
toPx:
|
|
1554
|
-
color:
|
|
1570
|
+
fromPx: o.scale.toPx(r.from),
|
|
1571
|
+
toPx: o.scale.toPx(r.to),
|
|
1572
|
+
color: s,
|
|
1555
1573
|
band: !0,
|
|
1556
1574
|
dash: a
|
|
1557
1575
|
});
|
|
1558
1576
|
else {
|
|
1559
|
-
const l =
|
|
1577
|
+
const l = o.scale.toPx(r.value);
|
|
1560
1578
|
i.push({
|
|
1561
1579
|
orientation: r.orientation,
|
|
1562
1580
|
fromPx: l,
|
|
1563
1581
|
toPx: l,
|
|
1564
|
-
color:
|
|
1582
|
+
color: s,
|
|
1565
1583
|
band: !1,
|
|
1566
1584
|
dash: a
|
|
1567
1585
|
});
|
|
@@ -1576,11 +1594,11 @@ class ce {
|
|
|
1576
1594
|
if (i.label === void 0 || i.label === "") continue;
|
|
1577
1595
|
const r = this.findAxis(i.orientation, i.axisId);
|
|
1578
1596
|
if (r === null) continue;
|
|
1579
|
-
const
|
|
1597
|
+
const o = i.kind === "line" ? i.value : (i.from + i.to) / 2;
|
|
1580
1598
|
t.push({
|
|
1581
1599
|
id: e,
|
|
1582
1600
|
axisKey: r.key,
|
|
1583
|
-
px: r.scale.toPx(
|
|
1601
|
+
px: r.scale.toPx(o),
|
|
1584
1602
|
label: i.label,
|
|
1585
1603
|
severity: i.severity,
|
|
1586
1604
|
role: i.role
|
|
@@ -1590,7 +1608,7 @@ class ce {
|
|
|
1590
1608
|
}
|
|
1591
1609
|
/* ================= Drawing ================= */
|
|
1592
1610
|
drawItems() {
|
|
1593
|
-
const t = [], e = this.seriesInOrder(), i =
|
|
1611
|
+
const t = [], e = this.seriesInOrder(), i = pn(
|
|
1594
1612
|
e.map((r) => ({
|
|
1595
1613
|
order: r.order,
|
|
1596
1614
|
kind: r.config.kind,
|
|
@@ -1599,18 +1617,18 @@ class ce {
|
|
|
1599
1617
|
fraction: r.config.kind === "bar" ? r.config.barWidth : 0
|
|
1600
1618
|
}))
|
|
1601
1619
|
);
|
|
1602
|
-
return e.forEach((r,
|
|
1603
|
-
const
|
|
1604
|
-
if (
|
|
1620
|
+
return e.forEach((r, o) => {
|
|
1621
|
+
const s = r.materialized;
|
|
1622
|
+
if (s === null) return;
|
|
1605
1623
|
const a = this.findAxis("x", r.config.xAxisId), l = this.findAxis("y", r.config.yAxisId);
|
|
1606
1624
|
if (a === null || l === null) return;
|
|
1607
1625
|
const c = this.highlight !== null && this.highlight !== r.order, u = {
|
|
1608
|
-
x:
|
|
1609
|
-
y:
|
|
1610
|
-
length:
|
|
1626
|
+
x: s.x,
|
|
1627
|
+
y: s.y,
|
|
1628
|
+
length: s.length,
|
|
1611
1629
|
xScale: a.scale,
|
|
1612
1630
|
yScale: l.scale,
|
|
1613
|
-
color: this.colorFor(r,
|
|
1631
|
+
color: this.colorFor(r, o),
|
|
1614
1632
|
alpha: c ? 0.25 : 1
|
|
1615
1633
|
}, h = r.config;
|
|
1616
1634
|
switch (h.kind) {
|
|
@@ -1620,14 +1638,14 @@ class ce {
|
|
|
1620
1638
|
kind: "line",
|
|
1621
1639
|
strokeWidth: h.strokeWidth,
|
|
1622
1640
|
dash: h.dash,
|
|
1623
|
-
marker: h.markers === "always" || h.markers === "auto" &&
|
|
1641
|
+
marker: h.markers === "always" || h.markers === "auto" && s.length <= gn
|
|
1624
1642
|
});
|
|
1625
1643
|
break;
|
|
1626
1644
|
case "area":
|
|
1627
1645
|
t.push({
|
|
1628
1646
|
...u,
|
|
1629
1647
|
kind: "area",
|
|
1630
|
-
y0:
|
|
1648
|
+
y0: s.y0,
|
|
1631
1649
|
baseline: 0,
|
|
1632
1650
|
fillOpacity: h.fillOpacity,
|
|
1633
1651
|
strokeWidth: h.strokeWidth
|
|
@@ -1639,8 +1657,8 @@ class ce {
|
|
|
1639
1657
|
size: 1,
|
|
1640
1658
|
step: r.step ?? 0,
|
|
1641
1659
|
fraction: h.barWidth
|
|
1642
|
-
}, d = a.scale.domain, m =
|
|
1643
|
-
|
|
1660
|
+
}, d = a.scale.domain, m = mn(
|
|
1661
|
+
fn(p.step, d[1] - d[0]),
|
|
1644
1662
|
p.fraction,
|
|
1645
1663
|
p.index,
|
|
1646
1664
|
p.size
|
|
@@ -1670,17 +1688,17 @@ class ce {
|
|
|
1670
1688
|
break;
|
|
1671
1689
|
}
|
|
1672
1690
|
case "matrix": {
|
|
1673
|
-
const p =
|
|
1691
|
+
const p = In(h.coloring, this.theme ?? O);
|
|
1674
1692
|
t.push({
|
|
1675
1693
|
...u,
|
|
1676
1694
|
kind: "matrix",
|
|
1677
|
-
buckets:
|
|
1695
|
+
buckets: Sn(s, h.coloring, p.length),
|
|
1678
1696
|
colors: p,
|
|
1679
|
-
width:
|
|
1697
|
+
width: ct(
|
|
1680
1698
|
r.step ?? 0,
|
|
1681
1699
|
a.scale.domain[1] - a.scale.domain[0]
|
|
1682
1700
|
),
|
|
1683
|
-
height:
|
|
1701
|
+
height: ct(
|
|
1684
1702
|
r.cellHeight ?? 0,
|
|
1685
1703
|
l.scale.domain[1] - l.scale.domain[0]
|
|
1686
1704
|
)
|
|
@@ -1691,11 +1709,11 @@ class ce {
|
|
|
1691
1709
|
t.push({
|
|
1692
1710
|
...u,
|
|
1693
1711
|
kind: "span",
|
|
1694
|
-
x1:
|
|
1712
|
+
x1: s.x1 ?? bn,
|
|
1695
1713
|
// Computed once per materialisation, not per frame: the calculation
|
|
1696
1714
|
// is quadratic, and a schedule with five hundred spans is pushed and
|
|
1697
1715
|
// pulled like any other chart.
|
|
1698
|
-
depth: r.depth ??
|
|
1716
|
+
depth: r.depth ?? xn,
|
|
1699
1717
|
height: h.height ?? 0.6,
|
|
1700
1718
|
domainEnd: a.scale.domain[1]
|
|
1701
1719
|
});
|
|
@@ -1708,15 +1726,15 @@ class ce {
|
|
|
1708
1726
|
axis: a single series fills its band, a stack gets a domain with one unit per
|
|
1709
1727
|
machine from the caller. */
|
|
1710
1728
|
lanePx(t, e) {
|
|
1711
|
-
const i = e.scale.domain, r = e.scale.toPx(t.laneFrom ?? i[0]),
|
|
1712
|
-
return { top: Math.min(r,
|
|
1729
|
+
const i = e.scale.domain, r = e.scale.toPx(t.laneFrom ?? i[0]), o = e.scale.toPx(t.laneTo ?? i[1]);
|
|
1730
|
+
return { top: Math.min(r, o), bottom: Math.max(r, o) };
|
|
1713
1731
|
}
|
|
1714
1732
|
drawSeriesLayer() {
|
|
1715
1733
|
var r;
|
|
1716
1734
|
const t = this.seriesCtx, e = this.theme;
|
|
1717
1735
|
if (!t || !e) return;
|
|
1718
1736
|
const i = typeof performance > "u" ? 0 : performance.now();
|
|
1719
|
-
|
|
1737
|
+
nn(t, {
|
|
1720
1738
|
width: this.cssWidth,
|
|
1721
1739
|
height: this.cssHeight,
|
|
1722
1740
|
plot: this.layout.plot,
|
|
@@ -1729,7 +1747,7 @@ class ce {
|
|
|
1729
1747
|
}
|
|
1730
1748
|
drawOverlayLayer() {
|
|
1731
1749
|
const t = this.overlayCtx, e = this.theme;
|
|
1732
|
-
!t || !e || (
|
|
1750
|
+
!t || !e || (rn(t, {
|
|
1733
1751
|
width: this.cssWidth,
|
|
1734
1752
|
height: this.cssHeight,
|
|
1735
1753
|
plot: this.layout.plot,
|
|
@@ -1768,35 +1786,35 @@ class ce {
|
|
|
1768
1786
|
if (this.seriesInOrder().forEach((f, b) => {
|
|
1769
1787
|
const k = f.materialized;
|
|
1770
1788
|
if (k === null || k.length === 0) return;
|
|
1771
|
-
const
|
|
1772
|
-
if (
|
|
1773
|
-
const F =
|
|
1774
|
-
|
|
1789
|
+
const w = f.config, I = this.findAxis("x", w.xAxisId), A = this.findAxis("y", w.yAxisId);
|
|
1790
|
+
if (I === null || A === null) return;
|
|
1791
|
+
const F = I.scale.fromPx(t), P = A.scale.fromPx(e), N = this.hitIn(f, k, I, A, e, F, P);
|
|
1792
|
+
N !== null && r.push({
|
|
1775
1793
|
entry: f,
|
|
1776
|
-
index:
|
|
1777
|
-
color:
|
|
1794
|
+
index: N.index,
|
|
1795
|
+
color: N.color ?? this.colorFor(f, b),
|
|
1778
1796
|
name: this.nameFor(f, b),
|
|
1779
|
-
px:
|
|
1780
|
-
py:
|
|
1781
|
-
xValue:
|
|
1782
|
-
yValue:
|
|
1783
|
-
marked:
|
|
1784
|
-
areal:
|
|
1785
|
-
value:
|
|
1786
|
-
segment:
|
|
1797
|
+
px: N.px,
|
|
1798
|
+
py: N.py,
|
|
1799
|
+
xValue: N.xValue,
|
|
1800
|
+
yValue: N.yValue,
|
|
1801
|
+
marked: N.marked,
|
|
1802
|
+
areal: N.areal,
|
|
1803
|
+
value: N.value,
|
|
1804
|
+
segment: N.segment
|
|
1787
1805
|
});
|
|
1788
1806
|
}), r.length === 0) return null;
|
|
1789
|
-
const
|
|
1790
|
-
let a =
|
|
1807
|
+
const o = r.filter((f) => !f.areal), s = o.length > 0 ? o : r;
|
|
1808
|
+
let a = s[0];
|
|
1791
1809
|
if (i === "nearest") {
|
|
1792
1810
|
let f = Number.POSITIVE_INFINITY;
|
|
1793
1811
|
for (const b of r) {
|
|
1794
|
-
const k = b.areal ? 0 : b.px - t,
|
|
1795
|
-
|
|
1812
|
+
const k = b.areal ? 0 : b.px - t, w = b.areal ? 0 : b.py - e, I = k * k + w * w;
|
|
1813
|
+
I < f && (f = I, a = b);
|
|
1796
1814
|
}
|
|
1797
1815
|
} else {
|
|
1798
1816
|
let f = Number.POSITIVE_INFINITY;
|
|
1799
|
-
for (const b of
|
|
1817
|
+
for (const b of s) {
|
|
1800
1818
|
const k = Math.abs(b.px - t);
|
|
1801
1819
|
k < f && (f = k, a = b);
|
|
1802
1820
|
}
|
|
@@ -1805,7 +1823,7 @@ class ce {
|
|
|
1805
1823
|
// An area is always included: it covers the pointer, otherwise it
|
|
1806
1824
|
// would not have reported a hit at all. Only points have to share the
|
|
1807
1825
|
// x position.
|
|
1808
|
-
(f) => f.areal || Math.abs(f.px - a.px) <=
|
|
1826
|
+
(f) => f.areal || Math.abs(f.px - a.px) <= yn
|
|
1809
1827
|
), c = l.map((f) => ({
|
|
1810
1828
|
seriesName: f.name,
|
|
1811
1829
|
color: f.color,
|
|
@@ -1833,16 +1851,16 @@ class ce {
|
|
|
1833
1851
|
and a span ask "what lies under the pointer", and that is not the same
|
|
1834
1852
|
question: for the right half of every segment the nearest point gives the
|
|
1835
1853
|
wrong answer. */
|
|
1836
|
-
hitIn(t, e, i, r,
|
|
1854
|
+
hitIn(t, e, i, r, o, s, a) {
|
|
1837
1855
|
const l = t.config, c = e.length;
|
|
1838
1856
|
if (l.kind === "state") {
|
|
1839
1857
|
const d = this.lanePx(l, r);
|
|
1840
|
-
if (
|
|
1841
|
-
const m =
|
|
1858
|
+
if (o < d.top || o > d.bottom) return null;
|
|
1859
|
+
const m = Ge(e.x, c, s);
|
|
1842
1860
|
if (m < 0) return null;
|
|
1843
1861
|
const y = e.y[m];
|
|
1844
1862
|
if (Number.isNaN(y)) return null;
|
|
1845
|
-
const f = e.x[m], b =
|
|
1863
|
+
const f = e.x[m], b = le(e.x, c, m, i.scale.domain[1]), k = l.states[y | 0];
|
|
1846
1864
|
return {
|
|
1847
1865
|
index: m,
|
|
1848
1866
|
px: i.scale.toPx(f),
|
|
@@ -1858,18 +1876,22 @@ class ce {
|
|
|
1858
1876
|
if (l.kind === "span") {
|
|
1859
1877
|
const d = e.x1;
|
|
1860
1878
|
if (d === null) return null;
|
|
1861
|
-
const m = i.scale.domain[1], y = l.height ?? 0.6, f =
|
|
1879
|
+
const m = i.scale.domain[1], y = l.height ?? 0.6, f = Ke(
|
|
1862
1880
|
e.x,
|
|
1863
1881
|
d,
|
|
1864
1882
|
e.y,
|
|
1865
1883
|
c,
|
|
1866
|
-
|
|
1884
|
+
s,
|
|
1867
1885
|
a,
|
|
1868
1886
|
y,
|
|
1869
|
-
m
|
|
1887
|
+
m,
|
|
1888
|
+
t.depth,
|
|
1889
|
+
// The drawing moves a covering span down the screen; in lane units that
|
|
1890
|
+
// way carries the sign of the y scale's slope.
|
|
1891
|
+
ce * y * Math.sign(r.scale.m)
|
|
1870
1892
|
);
|
|
1871
1893
|
if (f < 0) return null;
|
|
1872
|
-
const b = e.x[f], k = e.y[f],
|
|
1894
|
+
const b = e.x[f], k = e.y[f], w = d[f];
|
|
1873
1895
|
return {
|
|
1874
1896
|
index: f,
|
|
1875
1897
|
px: i.scale.toPx(b),
|
|
@@ -1880,21 +1902,21 @@ class ce {
|
|
|
1880
1902
|
areal: !0,
|
|
1881
1903
|
segment: {
|
|
1882
1904
|
from: b,
|
|
1883
|
-
to:
|
|
1905
|
+
to: ot(w, m),
|
|
1884
1906
|
label: "",
|
|
1885
|
-
open:
|
|
1907
|
+
open: ue(w)
|
|
1886
1908
|
}
|
|
1887
1909
|
};
|
|
1888
1910
|
}
|
|
1889
1911
|
if (l.kind === "matrix") {
|
|
1890
|
-
const d =
|
|
1912
|
+
const d = sn(
|
|
1891
1913
|
e.x,
|
|
1892
1914
|
e.y,
|
|
1893
1915
|
c,
|
|
1894
|
-
|
|
1916
|
+
s,
|
|
1895
1917
|
a,
|
|
1896
|
-
|
|
1897
|
-
|
|
1918
|
+
ct(t.step ?? 0, i.scale.domain[1] - i.scale.domain[0]),
|
|
1919
|
+
ct(t.cellHeight ?? 0, r.scale.domain[1] - r.scale.domain[0])
|
|
1898
1920
|
);
|
|
1899
1921
|
if (d < 0) return null;
|
|
1900
1922
|
const m = e.w, y = m === null ? Number.NaN : m[d];
|
|
@@ -1914,7 +1936,7 @@ class ce {
|
|
|
1914
1936
|
areal: !0
|
|
1915
1937
|
};
|
|
1916
1938
|
}
|
|
1917
|
-
const u =
|
|
1939
|
+
const u = on(e.x, c, s);
|
|
1918
1940
|
if (u < 0) return null;
|
|
1919
1941
|
const h = e.y[u];
|
|
1920
1942
|
if (Number.isNaN(h)) return null;
|
|
@@ -1940,10 +1962,10 @@ class ce {
|
|
|
1940
1962
|
return;
|
|
1941
1963
|
}
|
|
1942
1964
|
const i = t.offsetWidth, r = t.offsetHeight;
|
|
1943
|
-
let
|
|
1944
|
-
|
|
1945
|
-
let
|
|
1946
|
-
|
|
1965
|
+
let o = e.hit.xPx + 12;
|
|
1966
|
+
o + i > this.cssWidth && (o = e.hit.xPx - 12 - i), o < 0 && (o = 0);
|
|
1967
|
+
let s = e.mouseY - r / 2;
|
|
1968
|
+
s = Math.min(Math.max(s, 0), Math.max(0, this.cssHeight - r)), t.style.transform = `translate3d(${Math.round(o)}px, ${Math.round(s)}px, 0)`, t.style.opacity = "1";
|
|
1947
1969
|
}
|
|
1948
1970
|
/* ================= Snapshots for the HTML layer ================= */
|
|
1949
1971
|
pushLayoutSnapshot() {
|
|
@@ -1968,92 +1990,92 @@ class ce {
|
|
|
1968
1990
|
}
|
|
1969
1991
|
/** Class name of the measuring span for tick labels - keeps the CSS and the
|
|
1970
1992
|
layout in step. */
|
|
1971
|
-
g(
|
|
1972
|
-
const
|
|
1973
|
-
function
|
|
1974
|
-
const t =
|
|
1975
|
-
if (t === null &&
|
|
1993
|
+
g(he, "classTick", it);
|
|
1994
|
+
const de = ve(null);
|
|
1995
|
+
function tt(n) {
|
|
1996
|
+
const t = ke(de);
|
|
1997
|
+
if (t === null && rt)
|
|
1976
1998
|
throw new Error(
|
|
1977
1999
|
`@umriss-ui/charts: <${n}> must be used inside a <Chart>.`
|
|
1978
2000
|
);
|
|
1979
2001
|
return t;
|
|
1980
2002
|
}
|
|
1981
|
-
function
|
|
1982
|
-
const e =
|
|
1983
|
-
|
|
2003
|
+
function j(n, t) {
|
|
2004
|
+
const e = tt(n), i = Z(null);
|
|
2005
|
+
$(() => {
|
|
1984
2006
|
if (e !== null)
|
|
1985
2007
|
return i.current = e.registerSeries(t), () => {
|
|
1986
2008
|
i.current !== null && e.unregisterSeries(i.current), i.current = null;
|
|
1987
2009
|
};
|
|
1988
|
-
}, [e]),
|
|
2010
|
+
}, [e]), $(() => {
|
|
1989
2011
|
e !== null && i.current !== null && e.updateSeries(i.current, t);
|
|
1990
2012
|
});
|
|
1991
2013
|
}
|
|
1992
|
-
function
|
|
1993
|
-
const e =
|
|
1994
|
-
|
|
2014
|
+
function fe(n, t) {
|
|
2015
|
+
const e = tt(n), i = Z(null);
|
|
2016
|
+
$(() => {
|
|
1995
2017
|
if (e !== null)
|
|
1996
2018
|
return i.current = e.registerAxis(t), () => {
|
|
1997
2019
|
i.current !== null && e.unregisterAxis(i.current), i.current = null;
|
|
1998
2020
|
};
|
|
1999
|
-
}, [e]),
|
|
2021
|
+
}, [e]), $(() => {
|
|
2000
2022
|
e !== null && i.current !== null && e.updateAxis(i.current, t);
|
|
2001
2023
|
});
|
|
2002
2024
|
}
|
|
2003
|
-
function
|
|
2004
|
-
const e =
|
|
2005
|
-
|
|
2025
|
+
function me(n, t) {
|
|
2026
|
+
const e = tt(n), i = Z(null);
|
|
2027
|
+
$(() => {
|
|
2006
2028
|
if (e !== null)
|
|
2007
2029
|
return i.current = e.registerLimit(t), () => {
|
|
2008
2030
|
i.current !== null && e.unregisterLimit(i.current), i.current = null;
|
|
2009
2031
|
};
|
|
2010
|
-
}, [e]),
|
|
2032
|
+
}, [e]), $(() => {
|
|
2011
2033
|
e !== null && i.current !== null && e.updateLimit(i.current, t);
|
|
2012
2034
|
});
|
|
2013
2035
|
}
|
|
2014
|
-
function
|
|
2015
|
-
const e =
|
|
2016
|
-
|
|
2036
|
+
function Ln(n, t) {
|
|
2037
|
+
const e = tt(n);
|
|
2038
|
+
$(() => {
|
|
2017
2039
|
if (e !== null)
|
|
2018
2040
|
return e.registerLegend(t), () => e.unregisterLegend();
|
|
2019
|
-
}, [e]),
|
|
2041
|
+
}, [e]), $(() => {
|
|
2020
2042
|
e == null || e.updateLegend(t);
|
|
2021
2043
|
});
|
|
2022
2044
|
}
|
|
2023
|
-
function
|
|
2024
|
-
const e =
|
|
2025
|
-
|
|
2045
|
+
function Tn(n, t) {
|
|
2046
|
+
const e = tt(n);
|
|
2047
|
+
$(() => {
|
|
2026
2048
|
if (e !== null)
|
|
2027
2049
|
return e.registerTooltip(t), () => e.unregisterTooltip();
|
|
2028
|
-
}, [e]),
|
|
2050
|
+
}, [e]), $(() => {
|
|
2029
2051
|
e == null || e.updateTooltip(t);
|
|
2030
2052
|
});
|
|
2031
2053
|
}
|
|
2032
|
-
function
|
|
2033
|
-
const { band: e, position: i, orientation: r } = n,
|
|
2054
|
+
function An(n, t) {
|
|
2055
|
+
const { band: e, position: i, orientation: r } = n, o = {
|
|
2034
2056
|
left: `${e.x}px`,
|
|
2035
2057
|
top: `${e.y}px`,
|
|
2036
2058
|
width: `${e.width}px`,
|
|
2037
2059
|
height: `${e.height}px`
|
|
2038
|
-
},
|
|
2060
|
+
}, s = Lt + Tt;
|
|
2039
2061
|
return /* @__PURE__ */ _(
|
|
2040
2062
|
"div",
|
|
2041
2063
|
{
|
|
2042
2064
|
className: `uc-axis uc-axis-${r} uc-axis-${i}`,
|
|
2043
|
-
style:
|
|
2065
|
+
style: o,
|
|
2044
2066
|
"data-axis": n.id,
|
|
2045
2067
|
children: [
|
|
2046
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ S("span", { className: "uc-axis-line" }),
|
|
2047
2069
|
n.ticks.map((a) => {
|
|
2048
2070
|
if (r === "y") {
|
|
2049
2071
|
const c = Math.round(a.px - e.y);
|
|
2050
2072
|
return /* @__PURE__ */ _("span", { className: "uc-tick", style: { top: `${c}px` }, children: [
|
|
2051
|
-
/* @__PURE__ */
|
|
2052
|
-
/* @__PURE__ */
|
|
2073
|
+
/* @__PURE__ */ S("span", { className: "uc-tick-mark" }),
|
|
2074
|
+
/* @__PURE__ */ S(
|
|
2053
2075
|
"span",
|
|
2054
2076
|
{
|
|
2055
2077
|
className: "uc-tick-label",
|
|
2056
|
-
style: { [i === "left" ? "right" : "left"]: `${
|
|
2078
|
+
style: { [i === "left" ? "right" : "left"]: `${s}px` },
|
|
2057
2079
|
children: a.label
|
|
2058
2080
|
}
|
|
2059
2081
|
)
|
|
@@ -2061,21 +2083,21 @@ function Tn(n, t) {
|
|
|
2061
2083
|
}
|
|
2062
2084
|
const l = Math.round(a.px - e.x);
|
|
2063
2085
|
return /* @__PURE__ */ _("span", { className: "uc-tick", style: { left: `${l}px` }, children: [
|
|
2064
|
-
/* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2086
|
+
/* @__PURE__ */ S("span", { className: "uc-tick-mark" }),
|
|
2087
|
+
/* @__PURE__ */ S(
|
|
2066
2088
|
"span",
|
|
2067
2089
|
{
|
|
2068
2090
|
className: "uc-tick-label",
|
|
2069
2091
|
style: {
|
|
2070
2092
|
left: `${Math.round(a.labelLeft - e.x) - l}px`,
|
|
2071
|
-
[i === "top" ? "bottom" : "top"]: `${
|
|
2093
|
+
[i === "top" ? "bottom" : "top"]: `${s}px`
|
|
2072
2094
|
},
|
|
2073
2095
|
children: a.label
|
|
2074
2096
|
}
|
|
2075
2097
|
)
|
|
2076
2098
|
] }, a.value);
|
|
2077
2099
|
}),
|
|
2078
|
-
n.breaks.map((a, l) => /* @__PURE__ */
|
|
2100
|
+
n.breaks.map((a, l) => /* @__PURE__ */ S(
|
|
2079
2101
|
"span",
|
|
2080
2102
|
{
|
|
2081
2103
|
className: "uc-break",
|
|
@@ -2085,7 +2107,7 @@ function Tn(n, t) {
|
|
|
2085
2107
|
`break-${l}`
|
|
2086
2108
|
)),
|
|
2087
2109
|
t.map(
|
|
2088
|
-
(a) => r === "y" ? /* @__PURE__ */
|
|
2110
|
+
(a) => r === "y" ? /* @__PURE__ */ S(
|
|
2089
2111
|
"span",
|
|
2090
2112
|
{
|
|
2091
2113
|
className: "uc-limit-label",
|
|
@@ -2095,7 +2117,7 @@ function Tn(n, t) {
|
|
|
2095
2117
|
children: a.label
|
|
2096
2118
|
},
|
|
2097
2119
|
`limit-${a.id}`
|
|
2098
|
-
) : /* @__PURE__ */
|
|
2120
|
+
) : /* @__PURE__ */ S(
|
|
2099
2121
|
"span",
|
|
2100
2122
|
{
|
|
2101
2123
|
className: "uc-limit-label",
|
|
@@ -2103,123 +2125,127 @@ function Tn(n, t) {
|
|
|
2103
2125
|
"data-role": a.role,
|
|
2104
2126
|
style: {
|
|
2105
2127
|
left: `${Math.round(a.px - e.x)}px`,
|
|
2106
|
-
[i === "top" ? "bottom" : "top"]: `${
|
|
2128
|
+
[i === "top" ? "bottom" : "top"]: `${s}px`
|
|
2107
2129
|
},
|
|
2108
2130
|
children: a.label
|
|
2109
2131
|
},
|
|
2110
2132
|
`limit-${a.id}`
|
|
2111
2133
|
)
|
|
2112
2134
|
),
|
|
2113
|
-
n.label !== void 0 && n.label !== "" && /* @__PURE__ */
|
|
2135
|
+
n.label !== void 0 && n.label !== "" && /* @__PURE__ */ S("span", { className: "uc-axis-title", children: n.label })
|
|
2114
2136
|
]
|
|
2115
2137
|
},
|
|
2116
2138
|
n.key
|
|
2117
2139
|
);
|
|
2118
2140
|
}
|
|
2119
|
-
function
|
|
2141
|
+
function Fn({ scene: n }) {
|
|
2120
2142
|
const t = Et(
|
|
2121
2143
|
n.subscribeLayout,
|
|
2122
2144
|
n.getLayoutSnapshot,
|
|
2123
2145
|
n.getLayoutServerSnapshot
|
|
2124
2146
|
), { layout: e } = t;
|
|
2125
|
-
return e.plot.width <= 0 || e.plot.height <= 0 ? null : /* @__PURE__ */
|
|
2126
|
-
(i) =>
|
|
2147
|
+
return e.plot.width <= 0 || e.plot.height <= 0 ? null : /* @__PURE__ */ S("div", { className: "uc-axes", children: e.axes.map(
|
|
2148
|
+
(i) => An(
|
|
2127
2149
|
i,
|
|
2128
2150
|
t.limits.filter((r) => r.axisKey === i.key)
|
|
2129
2151
|
)
|
|
2130
2152
|
) });
|
|
2131
2153
|
}
|
|
2132
|
-
function
|
|
2154
|
+
function Pn(n) {
|
|
2133
2155
|
var e;
|
|
2134
2156
|
const t = (e = n.segment) == null ? void 0 : e.label;
|
|
2135
2157
|
return t !== void 0 && t !== "" ? t : n.value !== void 0 ? Bt(n.value) : Bt(n.yValue);
|
|
2136
2158
|
}
|
|
2137
|
-
function
|
|
2159
|
+
function En({ scene: n }) {
|
|
2138
2160
|
const t = Et(
|
|
2139
2161
|
n.subscribeHover,
|
|
2140
2162
|
n.getHoverSnapshot,
|
|
2141
2163
|
n.getHoverServerSnapshot
|
|
2142
|
-
), e =
|
|
2164
|
+
), e = Ne(
|
|
2143
2165
|
(r) => {
|
|
2144
2166
|
n.bindTooltip(r);
|
|
2145
2167
|
},
|
|
2146
2168
|
[n]
|
|
2147
2169
|
);
|
|
2148
|
-
if (
|
|
2170
|
+
if ($(() => {
|
|
2149
2171
|
n.markOverlayDirty();
|
|
2150
2172
|
}, [n, t.version]), t.tooltip === null) return null;
|
|
2151
2173
|
const i = t.hover;
|
|
2152
|
-
return /* @__PURE__ */
|
|
2153
|
-
/* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */
|
|
2155
|
-
/* @__PURE__ */
|
|
2156
|
-
/* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2174
|
+
return /* @__PURE__ */ S("div", { className: "uc-tooltip", ref: e, role: "presentation", children: i === null ? null : t.tooltip.render !== void 0 ? t.tooltip.render(i.hit) : /* @__PURE__ */ _(Nt, { children: [
|
|
2175
|
+
/* @__PURE__ */ S("div", { className: "uc-tooltip-head", children: t.xLabel }),
|
|
2176
|
+
/* @__PURE__ */ S("div", { className: "uc-tooltip-list", children: i.hit.points.map((r) => /* @__PURE__ */ _("div", { className: "uc-tooltip-row", children: [
|
|
2177
|
+
/* @__PURE__ */ S("span", { className: "uc-tooltip-chip", style: { background: r.color } }),
|
|
2178
|
+
/* @__PURE__ */ S("span", { className: "uc-tooltip-name", children: r.seriesName }),
|
|
2179
|
+
/* @__PURE__ */ S("span", { className: "uc-tooltip-value", children: Pn(r) })
|
|
2158
2180
|
] }, `${r.seriesName}-${r.index}`)) })
|
|
2159
2181
|
] }) });
|
|
2160
2182
|
}
|
|
2161
|
-
function
|
|
2183
|
+
function ti(n) {
|
|
2162
2184
|
const {
|
|
2163
2185
|
data: t,
|
|
2164
2186
|
width: e = "100%",
|
|
2165
2187
|
height: i = 300,
|
|
2166
2188
|
padding: r = 8,
|
|
2167
|
-
ariaLabel:
|
|
2168
|
-
className:
|
|
2189
|
+
ariaLabel: o,
|
|
2190
|
+
className: s,
|
|
2169
2191
|
style: a,
|
|
2170
2192
|
onPerf: l,
|
|
2171
2193
|
children: c
|
|
2172
|
-
} = n, [u] =
|
|
2194
|
+
} = n, [u] = we(() => new he()), h = Z(null), p = Z(null), d = Z(null), m = Z(null), y = typeof r == "number" ? void 0 : r, f = typeof r == "number" ? r : void 0, b = f ?? (y == null ? void 0 : y.top), k = f ?? (y == null ? void 0 : y.right), w = f ?? (y == null ? void 0 : y.bottom), I = f ?? (y == null ? void 0 : y.left), A = E(
|
|
2173
2195
|
() => ({
|
|
2174
2196
|
top: b ?? 8,
|
|
2175
2197
|
right: k ?? 8,
|
|
2176
|
-
bottom:
|
|
2177
|
-
left:
|
|
2198
|
+
bottom: w ?? 8,
|
|
2199
|
+
left: I ?? 8
|
|
2178
2200
|
}),
|
|
2179
|
-
[b, k,
|
|
2201
|
+
[b, k, w, I]
|
|
2180
2202
|
);
|
|
2181
|
-
|
|
2203
|
+
o === void 0 && q(
|
|
2182
2204
|
"chart-arialabel",
|
|
2183
2205
|
"Chart without ariaLabel - please set a meaningful description (R-7.6)."
|
|
2184
|
-
),
|
|
2185
|
-
const
|
|
2186
|
-
if (!
|
|
2187
|
-
u.bind(H,
|
|
2206
|
+
), $(() => {
|
|
2207
|
+
const N = h.current, H = p.current, V = d.current, v = m.current;
|
|
2208
|
+
if (!N || !H || !V || !v) return;
|
|
2209
|
+
u.bind(H, V, v, N);
|
|
2188
2210
|
const M = H.getBoundingClientRect();
|
|
2189
2211
|
u.requestResize(M.width, M.height);
|
|
2190
|
-
const x = new ResizeObserver((
|
|
2191
|
-
var
|
|
2192
|
-
const
|
|
2193
|
-
if (
|
|
2194
|
-
const
|
|
2195
|
-
|
|
2212
|
+
const x = new ResizeObserver((L) => {
|
|
2213
|
+
var B;
|
|
2214
|
+
const W = L[L.length - 1];
|
|
2215
|
+
if (W === void 0) return;
|
|
2216
|
+
const D = (B = W.contentBoxSize) == null ? void 0 : B[0];
|
|
2217
|
+
D !== void 0 ? u.requestResize(D.inlineSize, D.blockSize) : u.requestResize(W.contentRect.width, W.contentRect.height);
|
|
2196
2218
|
});
|
|
2197
2219
|
x.observe(H);
|
|
2198
|
-
const
|
|
2199
|
-
|
|
2200
|
-
|
|
2220
|
+
const T = () => u.pointerLeave();
|
|
2221
|
+
window.addEventListener("blur", T);
|
|
2222
|
+
const C = (L) => {
|
|
2223
|
+
H.contains(L.target) || u.pointerLeave();
|
|
2201
2224
|
};
|
|
2202
|
-
|
|
2225
|
+
return document.addEventListener("pointerdown", C), () => {
|
|
2226
|
+
window.removeEventListener("blur", T), document.removeEventListener("pointerdown", C), x.disconnect(), u.unbind();
|
|
2227
|
+
};
|
|
2228
|
+
}, [u]), $(() => {
|
|
2203
2229
|
u.setData(t);
|
|
2204
|
-
}, [u, t]),
|
|
2205
|
-
u.setPadding(
|
|
2206
|
-
}, [u,
|
|
2230
|
+
}, [u, t]), $(() => {
|
|
2231
|
+
u.setPadding(A);
|
|
2232
|
+
}, [u, A]), $(() => {
|
|
2207
2233
|
u.setOnPerf(l ?? null);
|
|
2208
|
-
}, [u, l]),
|
|
2234
|
+
}, [u, l]), $(() => {
|
|
2209
2235
|
u.validate();
|
|
2210
2236
|
});
|
|
2211
2237
|
const F = {
|
|
2212
2238
|
width: e === "100%" ? "100%" : `${e}px`,
|
|
2213
2239
|
height: `${i}px`,
|
|
2214
2240
|
...a
|
|
2215
|
-
}, P = (
|
|
2216
|
-
u.pointerMove(
|
|
2241
|
+
}, P = (N) => {
|
|
2242
|
+
u.pointerMove(N.nativeEvent.offsetX, N.nativeEvent.offsetY);
|
|
2217
2243
|
};
|
|
2218
|
-
return /* @__PURE__ */
|
|
2244
|
+
return /* @__PURE__ */ S(de.Provider, { value: u, children: /* @__PURE__ */ _(
|
|
2219
2245
|
"div",
|
|
2220
2246
|
{
|
|
2221
2247
|
ref: h,
|
|
2222
|
-
className:
|
|
2248
|
+
className: s ? `uc-root ${s}` : "uc-root",
|
|
2223
2249
|
style: F,
|
|
2224
2250
|
children: [
|
|
2225
2251
|
/* @__PURE__ */ _(
|
|
@@ -2228,14 +2254,17 @@ function Jn(n) {
|
|
|
2228
2254
|
ref: p,
|
|
2229
2255
|
className: "uc-plot",
|
|
2230
2256
|
role: "img",
|
|
2231
|
-
"aria-label":
|
|
2257
|
+
"aria-label": o,
|
|
2232
2258
|
onPointerMove: P,
|
|
2233
|
-
|
|
2259
|
+
onPointerDown: P,
|
|
2260
|
+
onPointerLeave: (N) => {
|
|
2261
|
+
N.pointerType !== "touch" && u.pointerLeave();
|
|
2262
|
+
},
|
|
2234
2263
|
children: [
|
|
2235
|
-
/* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
/* @__PURE__ */
|
|
2238
|
-
/* @__PURE__ */
|
|
2264
|
+
/* @__PURE__ */ S("canvas", { ref: d, className: "uc-layer-series", "aria-hidden": "true" }),
|
|
2265
|
+
/* @__PURE__ */ S("canvas", { ref: m, className: "uc-layer-overlay", "aria-hidden": "true" }),
|
|
2266
|
+
/* @__PURE__ */ S(Fn, { scene: u }),
|
|
2267
|
+
/* @__PURE__ */ S(En, { scene: u })
|
|
2239
2268
|
]
|
|
2240
2269
|
}
|
|
2241
2270
|
),
|
|
@@ -2244,14 +2273,14 @@ function Jn(n) {
|
|
|
2244
2273
|
}
|
|
2245
2274
|
) });
|
|
2246
2275
|
}
|
|
2247
|
-
function
|
|
2276
|
+
function ei(n) {
|
|
2248
2277
|
const {
|
|
2249
2278
|
accessor: t,
|
|
2250
2279
|
baseline: e,
|
|
2251
2280
|
xAxisId: i = "x",
|
|
2252
2281
|
yAxisId: r = "y",
|
|
2253
|
-
data:
|
|
2254
|
-
name:
|
|
2282
|
+
data: o,
|
|
2283
|
+
name: s,
|
|
2255
2284
|
color: a,
|
|
2256
2285
|
fillOpacity: l = 0.18,
|
|
2257
2286
|
strokeWidth: c = 1.5
|
|
@@ -2262,24 +2291,24 @@ function Qn(n) {
|
|
|
2262
2291
|
baseline: e,
|
|
2263
2292
|
xAxisId: i,
|
|
2264
2293
|
yAxisId: r,
|
|
2265
|
-
data:
|
|
2266
|
-
name:
|
|
2294
|
+
data: o,
|
|
2295
|
+
name: s,
|
|
2267
2296
|
color: a,
|
|
2268
2297
|
fillOpacity: l,
|
|
2269
2298
|
strokeWidth: c
|
|
2270
2299
|
}),
|
|
2271
|
-
[t, e, i, r,
|
|
2300
|
+
[t, e, i, r, o, s, a, l, c]
|
|
2272
2301
|
);
|
|
2273
|
-
return
|
|
2302
|
+
return j("Area", u), null;
|
|
2274
2303
|
}
|
|
2275
|
-
function
|
|
2304
|
+
function ni(n) {
|
|
2276
2305
|
const {
|
|
2277
2306
|
accessor: t,
|
|
2278
2307
|
xAxisId: e = "x",
|
|
2279
2308
|
yAxisId: i = "y",
|
|
2280
2309
|
data: r,
|
|
2281
|
-
name:
|
|
2282
|
-
color:
|
|
2310
|
+
name: o,
|
|
2311
|
+
color: s,
|
|
2283
2312
|
barWidth: a = 0.8
|
|
2284
2313
|
} = n, l = E(
|
|
2285
2314
|
() => ({
|
|
@@ -2288,22 +2317,22 @@ function ti(n) {
|
|
|
2288
2317
|
xAxisId: e,
|
|
2289
2318
|
yAxisId: i,
|
|
2290
2319
|
data: r,
|
|
2291
|
-
name:
|
|
2292
|
-
color:
|
|
2320
|
+
name: o,
|
|
2321
|
+
color: s,
|
|
2293
2322
|
barWidth: a
|
|
2294
2323
|
}),
|
|
2295
|
-
[t, e, i, r,
|
|
2324
|
+
[t, e, i, r, o, s, a]
|
|
2296
2325
|
);
|
|
2297
|
-
return
|
|
2326
|
+
return j("Bar", l), null;
|
|
2298
2327
|
}
|
|
2299
|
-
function
|
|
2328
|
+
function Dn(n) {
|
|
2300
2329
|
const {
|
|
2301
2330
|
accessor: t,
|
|
2302
2331
|
xAxisId: e = "x",
|
|
2303
2332
|
yAxisId: i = "y",
|
|
2304
2333
|
data: r,
|
|
2305
|
-
name:
|
|
2306
|
-
color:
|
|
2334
|
+
name: o,
|
|
2335
|
+
color: s,
|
|
2307
2336
|
tone: a,
|
|
2308
2337
|
strokeWidth: l = 1.5,
|
|
2309
2338
|
dash: c,
|
|
@@ -2315,25 +2344,25 @@ function Pn(n) {
|
|
|
2315
2344
|
xAxisId: e,
|
|
2316
2345
|
yAxisId: i,
|
|
2317
2346
|
data: r,
|
|
2318
|
-
name:
|
|
2319
|
-
color:
|
|
2347
|
+
name: o,
|
|
2348
|
+
color: s,
|
|
2320
2349
|
tone: a,
|
|
2321
2350
|
strokeWidth: l,
|
|
2322
2351
|
dash: c,
|
|
2323
2352
|
markers: u
|
|
2324
2353
|
}),
|
|
2325
|
-
[t, e, i, r,
|
|
2354
|
+
[t, e, i, r, o, s, a, l, c, u]
|
|
2326
2355
|
);
|
|
2327
|
-
return
|
|
2356
|
+
return j("Line", h), null;
|
|
2328
2357
|
}
|
|
2329
|
-
function
|
|
2358
|
+
function $n(n) {
|
|
2330
2359
|
const {
|
|
2331
2360
|
accessor: t,
|
|
2332
2361
|
xAxisId: e = "x",
|
|
2333
2362
|
yAxisId: i = "y",
|
|
2334
2363
|
data: r,
|
|
2335
|
-
name:
|
|
2336
|
-
color:
|
|
2364
|
+
name: o,
|
|
2365
|
+
color: s,
|
|
2337
2366
|
tone: a,
|
|
2338
2367
|
radius: l = 3
|
|
2339
2368
|
} = n, c = E(
|
|
@@ -2343,23 +2372,23 @@ function En(n) {
|
|
|
2343
2372
|
xAxisId: e,
|
|
2344
2373
|
yAxisId: i,
|
|
2345
2374
|
data: r,
|
|
2346
|
-
name:
|
|
2347
|
-
color:
|
|
2375
|
+
name: o,
|
|
2376
|
+
color: s,
|
|
2348
2377
|
tone: a,
|
|
2349
2378
|
radius: l
|
|
2350
2379
|
}),
|
|
2351
|
-
[t, e, i, r,
|
|
2380
|
+
[t, e, i, r, o, s, a, l]
|
|
2352
2381
|
);
|
|
2353
|
-
return
|
|
2382
|
+
return j("Scatter", c), null;
|
|
2354
2383
|
}
|
|
2355
|
-
function
|
|
2384
|
+
function ii(n) {
|
|
2356
2385
|
const {
|
|
2357
2386
|
accessor: t,
|
|
2358
2387
|
states: e,
|
|
2359
2388
|
xAxisId: i = "x",
|
|
2360
2389
|
yAxisId: r = "y",
|
|
2361
|
-
data:
|
|
2362
|
-
name:
|
|
2390
|
+
data: o,
|
|
2391
|
+
name: s,
|
|
2363
2392
|
laneFrom: a,
|
|
2364
2393
|
laneTo: l
|
|
2365
2394
|
} = n, c = E(
|
|
@@ -2369,16 +2398,16 @@ function ei(n) {
|
|
|
2369
2398
|
states: e,
|
|
2370
2399
|
xAxisId: i,
|
|
2371
2400
|
yAxisId: r,
|
|
2372
|
-
data:
|
|
2373
|
-
name:
|
|
2401
|
+
data: o,
|
|
2402
|
+
name: s,
|
|
2374
2403
|
laneFrom: a,
|
|
2375
2404
|
laneTo: l
|
|
2376
2405
|
}),
|
|
2377
|
-
[t, e, i, r,
|
|
2406
|
+
[t, e, i, r, o, s, a, l]
|
|
2378
2407
|
);
|
|
2379
|
-
return
|
|
2408
|
+
return j("StateBand", c), null;
|
|
2380
2409
|
}
|
|
2381
|
-
const
|
|
2410
|
+
const Cn = [
|
|
2382
2411
|
"#eef2ff",
|
|
2383
2412
|
"#c7d2fe",
|
|
2384
2413
|
"#a5b4fc",
|
|
@@ -2387,17 +2416,17 @@ const Dn = [
|
|
|
2387
2416
|
"#4f46e5",
|
|
2388
2417
|
"#4338ca"
|
|
2389
2418
|
];
|
|
2390
|
-
function
|
|
2419
|
+
function ri(n) {
|
|
2391
2420
|
const {
|
|
2392
2421
|
accessor: t,
|
|
2393
2422
|
value: e,
|
|
2394
2423
|
coloring: i,
|
|
2395
2424
|
xAxisId: r = "x",
|
|
2396
|
-
yAxisId:
|
|
2397
|
-
data:
|
|
2425
|
+
yAxisId: o = "y",
|
|
2426
|
+
data: s,
|
|
2398
2427
|
name: a
|
|
2399
2428
|
} = n, l = E(
|
|
2400
|
-
() => i ?? { kind: "gradient", stops:
|
|
2429
|
+
() => i ?? { kind: "gradient", stops: Cn },
|
|
2401
2430
|
[i]
|
|
2402
2431
|
), c = E(
|
|
2403
2432
|
() => ({
|
|
@@ -2406,22 +2435,22 @@ function ni(n) {
|
|
|
2406
2435
|
value: e,
|
|
2407
2436
|
coloring: l,
|
|
2408
2437
|
xAxisId: r,
|
|
2409
|
-
yAxisId:
|
|
2410
|
-
data:
|
|
2438
|
+
yAxisId: o,
|
|
2439
|
+
data: s,
|
|
2411
2440
|
name: a
|
|
2412
2441
|
}),
|
|
2413
|
-
[t, e, l, r,
|
|
2442
|
+
[t, e, l, r, o, s, a]
|
|
2414
2443
|
);
|
|
2415
|
-
return
|
|
2444
|
+
return j("Matrix", c), null;
|
|
2416
2445
|
}
|
|
2417
|
-
function
|
|
2446
|
+
function oi(n) {
|
|
2418
2447
|
const {
|
|
2419
2448
|
accessor: t,
|
|
2420
2449
|
to: e,
|
|
2421
2450
|
xAxisId: i = "x",
|
|
2422
2451
|
yAxisId: r = "y",
|
|
2423
|
-
data:
|
|
2424
|
-
name:
|
|
2452
|
+
data: o,
|
|
2453
|
+
name: s,
|
|
2425
2454
|
color: a,
|
|
2426
2455
|
height: l = 0.6
|
|
2427
2456
|
} = n, c = E(
|
|
@@ -2431,14 +2460,14 @@ function ii(n) {
|
|
|
2431
2460
|
to: e,
|
|
2432
2461
|
xAxisId: i,
|
|
2433
2462
|
yAxisId: r,
|
|
2434
|
-
data:
|
|
2435
|
-
name:
|
|
2463
|
+
data: o,
|
|
2464
|
+
name: s,
|
|
2436
2465
|
color: a,
|
|
2437
2466
|
height: l
|
|
2438
2467
|
}),
|
|
2439
|
-
[t, e, i, r,
|
|
2468
|
+
[t, e, i, r, o, s, a, l]
|
|
2440
2469
|
);
|
|
2441
|
-
return
|
|
2470
|
+
return j("Span", c), null;
|
|
2442
2471
|
}
|
|
2443
2472
|
function nt(n) {
|
|
2444
2473
|
const {
|
|
@@ -2446,8 +2475,8 @@ function nt(n) {
|
|
|
2446
2475
|
axisId: e = "y",
|
|
2447
2476
|
orientation: i = "y",
|
|
2448
2477
|
severity: r = "alarm",
|
|
2449
|
-
label:
|
|
2450
|
-
color:
|
|
2478
|
+
label: o,
|
|
2479
|
+
color: s,
|
|
2451
2480
|
inExtent: a = !0,
|
|
2452
2481
|
role: l = "specification"
|
|
2453
2482
|
} = n, c = E(
|
|
@@ -2458,22 +2487,22 @@ function nt(n) {
|
|
|
2458
2487
|
orientation: i,
|
|
2459
2488
|
severity: r,
|
|
2460
2489
|
role: l,
|
|
2461
|
-
label:
|
|
2462
|
-
color:
|
|
2490
|
+
label: o,
|
|
2491
|
+
color: s,
|
|
2463
2492
|
inExtent: a
|
|
2464
2493
|
}),
|
|
2465
|
-
[t, e, i, r, l,
|
|
2494
|
+
[t, e, i, r, l, o, s, a]
|
|
2466
2495
|
);
|
|
2467
|
-
return
|
|
2496
|
+
return me("LimitLine", c), null;
|
|
2468
2497
|
}
|
|
2469
|
-
function
|
|
2498
|
+
function si(n) {
|
|
2470
2499
|
const {
|
|
2471
2500
|
from: t,
|
|
2472
2501
|
to: e,
|
|
2473
2502
|
axisId: i = "y",
|
|
2474
2503
|
orientation: r = "y",
|
|
2475
|
-
severity:
|
|
2476
|
-
label:
|
|
2504
|
+
severity: o = "warning",
|
|
2505
|
+
label: s,
|
|
2477
2506
|
color: a,
|
|
2478
2507
|
inExtent: l = !0,
|
|
2479
2508
|
role: c = "specification"
|
|
@@ -2484,17 +2513,17 @@ function ri(n) {
|
|
|
2484
2513
|
to: e,
|
|
2485
2514
|
axisId: i,
|
|
2486
2515
|
orientation: r,
|
|
2487
|
-
severity:
|
|
2516
|
+
severity: o,
|
|
2488
2517
|
role: c,
|
|
2489
|
-
label:
|
|
2518
|
+
label: s,
|
|
2490
2519
|
color: a,
|
|
2491
2520
|
inExtent: l
|
|
2492
2521
|
}),
|
|
2493
|
-
[t, e, i, r,
|
|
2522
|
+
[t, e, i, r, o, c, s, a, l]
|
|
2494
2523
|
);
|
|
2495
|
-
return
|
|
2524
|
+
return me("LimitBand", u), null;
|
|
2496
2525
|
}
|
|
2497
|
-
const
|
|
2526
|
+
const On = 1.128;
|
|
2498
2527
|
function kt(n, t) {
|
|
2499
2528
|
return {
|
|
2500
2529
|
center: n,
|
|
@@ -2503,44 +2532,44 @@ function kt(n, t) {
|
|
|
2503
2532
|
lower: n - 3 * t
|
|
2504
2533
|
};
|
|
2505
2534
|
}
|
|
2506
|
-
function
|
|
2535
|
+
function ai(n, t) {
|
|
2507
2536
|
return (t - n) / 3;
|
|
2508
2537
|
}
|
|
2509
|
-
function
|
|
2538
|
+
function Wn(n, t) {
|
|
2510
2539
|
if (t.kind === "given")
|
|
2511
2540
|
return kt(t.center, t.sigma);
|
|
2512
2541
|
const e = Math.max(0, Math.trunc(t.from)), i = Math.min(n.length, Math.trunc(t.to));
|
|
2513
|
-
let r = 0,
|
|
2542
|
+
let r = 0, o = 0, s = 0, a = 0, l = Number.NaN;
|
|
2514
2543
|
for (let u = e; u < i; u++) {
|
|
2515
2544
|
const h = n[u];
|
|
2516
2545
|
if (!Number.isFinite(h)) {
|
|
2517
2546
|
l = Number.NaN;
|
|
2518
2547
|
continue;
|
|
2519
2548
|
}
|
|
2520
|
-
r += h,
|
|
2549
|
+
r += h, o++, Number.isFinite(l) && (s += Math.abs(h - l), a++), l = h;
|
|
2521
2550
|
}
|
|
2522
|
-
if (
|
|
2523
|
-
const c = a === 0 ? 0 :
|
|
2524
|
-
return kt(r /
|
|
2551
|
+
if (o === 0) return kt(Number.NaN, Number.NaN);
|
|
2552
|
+
const c = a === 0 ? 0 : s / a / On;
|
|
2553
|
+
return kt(r / o, c);
|
|
2525
2554
|
}
|
|
2526
|
-
function
|
|
2555
|
+
function Hn(n, t = [1, 2]) {
|
|
2527
2556
|
return t.map((e) => ({
|
|
2528
2557
|
k: e,
|
|
2529
2558
|
upper: n.center + e * n.sigma,
|
|
2530
2559
|
lower: n.center - e * n.sigma
|
|
2531
2560
|
}));
|
|
2532
2561
|
}
|
|
2533
|
-
function
|
|
2562
|
+
function Rn(n, t) {
|
|
2534
2563
|
return Number.isFinite(n) ? n > t ? 1 : n < t ? -1 : 0 : 0;
|
|
2535
2564
|
}
|
|
2536
|
-
function
|
|
2565
|
+
function pe(n, t) {
|
|
2537
2566
|
const e = [];
|
|
2538
2567
|
if (t < 1) return e;
|
|
2539
2568
|
let i = 0;
|
|
2540
2569
|
for (let r = 1; r <= n.length; r++) {
|
|
2541
|
-
const
|
|
2542
|
-
if (
|
|
2543
|
-
if (
|
|
2570
|
+
const o = r < n.length ? n[r] : Number.NaN, s = n[i];
|
|
2571
|
+
if (o !== s) {
|
|
2572
|
+
if (s !== 0 && r - i >= t)
|
|
2544
2573
|
for (let a = i; a < r; a++) e.push(a);
|
|
2545
2574
|
i = r;
|
|
2546
2575
|
}
|
|
@@ -2555,7 +2584,7 @@ const $t = {
|
|
|
2555
2584
|
runLength: 9,
|
|
2556
2585
|
trendLength: 6
|
|
2557
2586
|
};
|
|
2558
|
-
function
|
|
2587
|
+
function Vn(n, t) {
|
|
2559
2588
|
const e = [];
|
|
2560
2589
|
for (let i = 0; i < n.length; i++) {
|
|
2561
2590
|
const r = n[i];
|
|
@@ -2563,52 +2592,52 @@ function Hn(n, t) {
|
|
|
2563
2592
|
}
|
|
2564
2593
|
return e;
|
|
2565
2594
|
}
|
|
2566
|
-
function
|
|
2567
|
-
return
|
|
2568
|
-
n.map((i) =>
|
|
2595
|
+
function _n(n, t, e = $t.runLength) {
|
|
2596
|
+
return pe(
|
|
2597
|
+
n.map((i) => Rn(i, t.center)),
|
|
2569
2598
|
e
|
|
2570
2599
|
);
|
|
2571
2600
|
}
|
|
2572
|
-
function
|
|
2601
|
+
function Bn(n, t = $t.trendLength) {
|
|
2573
2602
|
const e = [];
|
|
2574
2603
|
for (let r = 1; r < n.length; r++) {
|
|
2575
|
-
const
|
|
2576
|
-
e.push(Number.isFinite(
|
|
2604
|
+
const o = n[r - 1], s = n[r];
|
|
2605
|
+
e.push(Number.isFinite(o) && Number.isFinite(s) ? Math.sign(s - o) : 0);
|
|
2577
2606
|
}
|
|
2578
2607
|
const i = [];
|
|
2579
|
-
for (const r of
|
|
2608
|
+
for (const r of pe(e, Math.max(1, t - 1)))
|
|
2580
2609
|
i[i.length - 1] !== r && i.push(r), i.push(r + 1);
|
|
2581
2610
|
return i;
|
|
2582
2611
|
}
|
|
2583
|
-
function
|
|
2612
|
+
function Yn(n, t) {
|
|
2584
2613
|
const e = t.center + 2 * t.sigma, i = t.center - 2 * t.sigma, r = /* @__PURE__ */ new Set();
|
|
2585
|
-
for (let
|
|
2586
|
-
for (const
|
|
2587
|
-
[
|
|
2588
|
-
[
|
|
2614
|
+
for (let o = 0; o + 2 < n.length; o++)
|
|
2615
|
+
for (const s of [
|
|
2616
|
+
[o, o + 1, o + 2].filter((a) => n[a] > e),
|
|
2617
|
+
[o, o + 1, o + 2].filter((a) => n[a] < i)
|
|
2589
2618
|
])
|
|
2590
|
-
if (
|
|
2591
|
-
return [...r].sort((
|
|
2619
|
+
if (s.length >= 2) for (const a of s) r.add(a);
|
|
2620
|
+
return [...r].sort((o, s) => o - s);
|
|
2592
2621
|
}
|
|
2593
|
-
function
|
|
2594
|
-
const i = { ...$t, ...e }, r = [],
|
|
2595
|
-
a.length > 0 && r.push({ rule:
|
|
2622
|
+
function zn(n, t, e = {}) {
|
|
2623
|
+
const i = { ...$t, ...e }, r = [], o = (s, a) => {
|
|
2624
|
+
a.length > 0 && r.push({ rule: s, indices: a });
|
|
2596
2625
|
};
|
|
2597
|
-
return i.outlier &&
|
|
2626
|
+
return i.outlier && o("outlier", Vn(n, t)), i.run && o("run", _n(n, t, i.runLength)), i.trend && o("trend", Bn(n, i.trendLength)), i.twoOfThree && o("twoOfThree", Yn(n, t)), r;
|
|
2598
2627
|
}
|
|
2599
|
-
function
|
|
2628
|
+
function Gn(n) {
|
|
2600
2629
|
const t = /* @__PURE__ */ new Set();
|
|
2601
2630
|
for (const e of n) for (const i of e.indices) t.add(i);
|
|
2602
2631
|
return [...t].sort((e, i) => e - i);
|
|
2603
2632
|
}
|
|
2604
|
-
function
|
|
2633
|
+
function li(n) {
|
|
2605
2634
|
const {
|
|
2606
2635
|
accessor: t,
|
|
2607
2636
|
data: e,
|
|
2608
2637
|
origin: i,
|
|
2609
2638
|
xAxisId: r = "x",
|
|
2610
|
-
yAxisId:
|
|
2611
|
-
name:
|
|
2639
|
+
yAxisId: o = "y",
|
|
2640
|
+
name: s,
|
|
2612
2641
|
color: a,
|
|
2613
2642
|
rules: l,
|
|
2614
2643
|
zoneLines: c = !0,
|
|
@@ -2619,61 +2648,61 @@ function oi(n) {
|
|
|
2619
2648
|
} = n, m = E(() => {
|
|
2620
2649
|
const F = [];
|
|
2621
2650
|
for (let P = 0; P < e.length; P++) {
|
|
2622
|
-
const
|
|
2623
|
-
F.push(
|
|
2651
|
+
const N = t(e[P], P);
|
|
2652
|
+
F.push(N ?? Number.NaN);
|
|
2624
2653
|
}
|
|
2625
2654
|
return F;
|
|
2626
|
-
}, [e, t]), y = E(() =>
|
|
2627
|
-
() =>
|
|
2655
|
+
}, [e, t]), y = E(() => Wn(m, i), [m, i]), f = E(
|
|
2656
|
+
() => zn(m, y, l ?? {}),
|
|
2628
2657
|
[m, y, l]
|
|
2629
|
-
), b = E(() => new Set(
|
|
2630
|
-
|
|
2658
|
+
), b = E(() => new Set(Gn(f)), [f]);
|
|
2659
|
+
$(() => {
|
|
2631
2660
|
d == null || d(f);
|
|
2632
2661
|
}, [f, d]);
|
|
2633
2662
|
const k = E(
|
|
2634
2663
|
() => (F, P) => b.has(P) ? t(F, P) : null,
|
|
2635
2664
|
[b, t]
|
|
2636
|
-
),
|
|
2665
|
+
), w = E(
|
|
2637
2666
|
() => b.size === 0 ? e : e.slice(),
|
|
2638
2667
|
[e, b]
|
|
2639
|
-
),
|
|
2640
|
-
() => c ?
|
|
2668
|
+
), I = E(
|
|
2669
|
+
() => c ? Hn(y, [1, 2]) : [],
|
|
2641
2670
|
[c, y]
|
|
2642
|
-
),
|
|
2671
|
+
), A = Number.isFinite(y.center);
|
|
2643
2672
|
return /* @__PURE__ */ _(Nt, { children: [
|
|
2644
|
-
/* @__PURE__ */
|
|
2645
|
-
|
|
2646
|
-
|
|
2673
|
+
/* @__PURE__ */ S(Dn, { accessor: t, data: e, xAxisId: r, yAxisId: o, name: s, color: a }),
|
|
2674
|
+
A && /* @__PURE__ */ _(Nt, { children: [
|
|
2675
|
+
I.map((F) => /* @__PURE__ */ S(
|
|
2647
2676
|
nt,
|
|
2648
2677
|
{
|
|
2649
2678
|
value: F.upper,
|
|
2650
|
-
axisId:
|
|
2679
|
+
axisId: o,
|
|
2651
2680
|
role: "zone",
|
|
2652
2681
|
inExtent: !1
|
|
2653
2682
|
},
|
|
2654
2683
|
`zone-${F.k}-upper`
|
|
2655
2684
|
)),
|
|
2656
|
-
|
|
2685
|
+
I.map((F) => /* @__PURE__ */ S(
|
|
2657
2686
|
nt,
|
|
2658
2687
|
{
|
|
2659
2688
|
value: F.lower,
|
|
2660
|
-
axisId:
|
|
2689
|
+
axisId: o,
|
|
2661
2690
|
role: "zone",
|
|
2662
2691
|
inExtent: !1
|
|
2663
2692
|
},
|
|
2664
2693
|
`zone-${F.k}-lower`
|
|
2665
2694
|
)),
|
|
2666
|
-
/* @__PURE__ */
|
|
2667
|
-
/* @__PURE__ */
|
|
2668
|
-
/* @__PURE__ */
|
|
2695
|
+
/* @__PURE__ */ S(nt, { value: y.center, axisId: o, role: "control" }),
|
|
2696
|
+
/* @__PURE__ */ S(nt, { value: y.upper, axisId: o, role: "control", label: u }),
|
|
2697
|
+
/* @__PURE__ */ S(nt, { value: y.lower, axisId: o, role: "control", label: h })
|
|
2669
2698
|
] }),
|
|
2670
|
-
/* @__PURE__ */
|
|
2671
|
-
|
|
2699
|
+
/* @__PURE__ */ S(
|
|
2700
|
+
$n,
|
|
2672
2701
|
{
|
|
2673
2702
|
accessor: k,
|
|
2674
|
-
data:
|
|
2703
|
+
data: w,
|
|
2675
2704
|
xAxisId: r,
|
|
2676
|
-
yAxisId:
|
|
2705
|
+
yAxisId: o,
|
|
2677
2706
|
name: p,
|
|
2678
2707
|
tone: "alarm",
|
|
2679
2708
|
radius: 4
|
|
@@ -2681,14 +2710,14 @@ function oi(n) {
|
|
|
2681
2710
|
)
|
|
2682
2711
|
] });
|
|
2683
2712
|
}
|
|
2684
|
-
function
|
|
2713
|
+
function ci(n) {
|
|
2685
2714
|
const {
|
|
2686
2715
|
id: t = "x",
|
|
2687
2716
|
position: e = "bottom",
|
|
2688
2717
|
accessor: i,
|
|
2689
2718
|
label: r,
|
|
2690
|
-
tickCount:
|
|
2691
|
-
tickFormat:
|
|
2719
|
+
tickCount: o,
|
|
2720
|
+
tickFormat: s,
|
|
2692
2721
|
domain: a = "nice",
|
|
2693
2722
|
grid: l,
|
|
2694
2723
|
ticks: c,
|
|
@@ -2700,25 +2729,25 @@ function ai(n) {
|
|
|
2700
2729
|
position: e,
|
|
2701
2730
|
accessor: i,
|
|
2702
2731
|
label: r,
|
|
2703
|
-
tickCount:
|
|
2704
|
-
tickFormat:
|
|
2732
|
+
tickCount: o,
|
|
2733
|
+
tickFormat: s,
|
|
2705
2734
|
domain: a,
|
|
2706
2735
|
grid: l,
|
|
2707
2736
|
ticks: c,
|
|
2708
2737
|
calendar: u
|
|
2709
2738
|
}),
|
|
2710
|
-
[t, e, i, r,
|
|
2739
|
+
[t, e, i, r, o, s, a, l, c, u]
|
|
2711
2740
|
);
|
|
2712
|
-
return
|
|
2741
|
+
return fe("XAxis", h), null;
|
|
2713
2742
|
}
|
|
2714
|
-
function
|
|
2743
|
+
function ui(n) {
|
|
2715
2744
|
const {
|
|
2716
2745
|
id: t = "y",
|
|
2717
2746
|
position: e = "left",
|
|
2718
2747
|
accessor: i,
|
|
2719
2748
|
label: r,
|
|
2720
|
-
tickCount:
|
|
2721
|
-
tickFormat:
|
|
2749
|
+
tickCount: o,
|
|
2750
|
+
tickFormat: s,
|
|
2722
2751
|
domain: a = "nice",
|
|
2723
2752
|
grid: l,
|
|
2724
2753
|
ticks: c
|
|
@@ -2729,62 +2758,62 @@ function li(n) {
|
|
|
2729
2758
|
position: e,
|
|
2730
2759
|
accessor: i,
|
|
2731
2760
|
label: r,
|
|
2732
|
-
tickCount:
|
|
2733
|
-
tickFormat:
|
|
2761
|
+
tickCount: o,
|
|
2762
|
+
tickFormat: s,
|
|
2734
2763
|
domain: a,
|
|
2735
2764
|
grid: l,
|
|
2736
2765
|
ticks: c
|
|
2737
2766
|
}),
|
|
2738
|
-
[t, e, i, r,
|
|
2767
|
+
[t, e, i, r, o, s, a, l, c]
|
|
2739
2768
|
);
|
|
2740
|
-
return
|
|
2769
|
+
return fe("YAxis", u), null;
|
|
2741
2770
|
}
|
|
2742
|
-
function
|
|
2771
|
+
function qn({
|
|
2743
2772
|
scene: n,
|
|
2744
2773
|
placement: t
|
|
2745
2774
|
}) {
|
|
2746
|
-
|
|
2775
|
+
Ln("Legend", { placement: t });
|
|
2747
2776
|
const e = Et(
|
|
2748
2777
|
n.subscribeLayout,
|
|
2749
2778
|
n.getLayoutSnapshot,
|
|
2750
2779
|
n.getLayoutServerSnapshot
|
|
2751
2780
|
);
|
|
2752
|
-
return e.series.length === 0 ? null : /* @__PURE__ */
|
|
2781
|
+
return e.series.length === 0 ? null : /* @__PURE__ */ S("div", { className: `uc-legend uc-legend-${t}`, children: e.series.map((i) => /* @__PURE__ */ _(
|
|
2753
2782
|
"span",
|
|
2754
2783
|
{
|
|
2755
2784
|
className: "uc-legend-item",
|
|
2756
2785
|
onPointerEnter: () => n.setHighlight(i.seriesId),
|
|
2757
2786
|
onPointerLeave: () => n.setHighlight(null),
|
|
2758
2787
|
children: [
|
|
2759
|
-
/* @__PURE__ */
|
|
2788
|
+
/* @__PURE__ */ S("span", { className: "uc-legend-chip", style: { background: i.color } }),
|
|
2760
2789
|
i.name
|
|
2761
2790
|
]
|
|
2762
2791
|
},
|
|
2763
2792
|
i.id
|
|
2764
2793
|
)) });
|
|
2765
2794
|
}
|
|
2766
|
-
function
|
|
2767
|
-
const t =
|
|
2768
|
-
return t === null ? null : /* @__PURE__ */
|
|
2795
|
+
function hi({ placement: n = "top" }) {
|
|
2796
|
+
const t = tt("Legend");
|
|
2797
|
+
return t === null ? null : /* @__PURE__ */ S(qn, { scene: t, placement: n });
|
|
2769
2798
|
}
|
|
2770
|
-
function
|
|
2799
|
+
function di(n) {
|
|
2771
2800
|
const { mode: t = "x", render: e } = n, i = E(
|
|
2772
2801
|
() => ({ mode: t, render: e }),
|
|
2773
2802
|
[t, e]
|
|
2774
2803
|
);
|
|
2775
|
-
return
|
|
2804
|
+
return Tn("Tooltip", i), null;
|
|
2776
2805
|
}
|
|
2777
|
-
const
|
|
2806
|
+
const Kn = {
|
|
2778
2807
|
cutoff: 0.8,
|
|
2779
2808
|
collectRank: Number.POSITIVE_INFINITY
|
|
2780
2809
|
};
|
|
2781
|
-
function
|
|
2782
|
-
const e = { ...
|
|
2783
|
-
|
|
2810
|
+
function fi(n, t = {}) {
|
|
2811
|
+
const e = { ...Kn, ...t };
|
|
2812
|
+
ut(
|
|
2784
2813
|
!Number.isFinite(e.collectRank) || e.remainderName !== void 0,
|
|
2785
2814
|
"pareto: a collect rank needs `remainderName` - the package brings no name for the remainder."
|
|
2786
2815
|
);
|
|
2787
|
-
const i = n.map((d, m) => ({ item: d, inputIndex: m })).sort((d, m) => m.item.value - d.item.value || d.inputIndex - m.inputIndex).map(({ item: d }) => d), r = Math.max(0, Math.min(i.length, Math.floor(e.collectRank))),
|
|
2816
|
+
const i = n.map((d, m) => ({ item: d, inputIndex: m })).sort((d, m) => m.item.value - d.item.value || d.inputIndex - m.inputIndex).map(({ item: d }) => d), r = Math.max(0, Math.min(i.length, Math.floor(e.collectRank))), o = i.slice(0, r), s = i.slice(r), a = s.length === 0 ? o : [...o, { name: e.remainderName ?? "", value: s.reduce((d, m) => d + m.value, 0) }], l = a.reduce((d, m) => d + m.value, 0), c = [];
|
|
2788
2817
|
let u = 0;
|
|
2789
2818
|
for (let d = 0; d < a.length; d++) {
|
|
2790
2819
|
const m = a[d];
|
|
@@ -2794,60 +2823,60 @@ function hi(n, t = {}) {
|
|
|
2794
2823
|
index: d,
|
|
2795
2824
|
share: l === 0 ? 0 : m.value / l,
|
|
2796
2825
|
cumulative: l === 0 ? 0 : u / l,
|
|
2797
|
-
remainder:
|
|
2826
|
+
remainder: s.length > 0 && d === a.length - 1
|
|
2798
2827
|
});
|
|
2799
2828
|
}
|
|
2800
2829
|
const h = Math.abs(e.cutoff) * 1e-12, p = c.findIndex((d) => d.cumulative >= e.cutoff - h);
|
|
2801
2830
|
return { entries: c, total: l, cutoffIndex: p };
|
|
2802
2831
|
}
|
|
2803
2832
|
export {
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2833
|
+
ei as Area,
|
|
2834
|
+
ni as Bar,
|
|
2835
|
+
ti as Chart,
|
|
2836
|
+
li as ControlChart,
|
|
2837
|
+
X as DAY,
|
|
2838
|
+
Cn as DEFAULT_GRADIENT,
|
|
2839
|
+
Q as HOUR,
|
|
2840
|
+
hi as Legend,
|
|
2841
|
+
si as LimitBand,
|
|
2813
2842
|
nt as LimitLine,
|
|
2814
|
-
|
|
2843
|
+
Dn as Line,
|
|
2815
2844
|
_t as LinearScale,
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2845
|
+
U as MINUTE,
|
|
2846
|
+
ri as Matrix,
|
|
2847
|
+
K as SECOND,
|
|
2848
|
+
$n as Scatter,
|
|
2849
|
+
oi as Span,
|
|
2850
|
+
ii as StateBand,
|
|
2851
|
+
di as Tooltip,
|
|
2852
|
+
ci as XAxis,
|
|
2853
|
+
ui as YAxis,
|
|
2854
|
+
ln as assess,
|
|
2855
|
+
He as breaks,
|
|
2856
|
+
G as calendarFrom,
|
|
2857
|
+
Wn as controlLimits,
|
|
2829
2858
|
$t as defaultRules,
|
|
2830
2859
|
Rt as invalidateTheme,
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2860
|
+
Jn as mapSeries,
|
|
2861
|
+
De as operatingCalendar,
|
|
2862
|
+
_e as operatingTicks,
|
|
2863
|
+
Ve as operatingTimeTicks,
|
|
2864
|
+
fi as pareto,
|
|
2865
|
+
Kn as paretoDefaults,
|
|
2866
|
+
We as removedIntervals,
|
|
2867
|
+
jn as resolveColours,
|
|
2868
|
+
Vn as ruleOutlier,
|
|
2869
|
+
_n as ruleRun,
|
|
2870
|
+
Bn as ruleTrend,
|
|
2871
|
+
Yn as ruleTwoOfThree,
|
|
2872
|
+
ai as sigmaFromLimit,
|
|
2873
|
+
Le as subscribeTheme,
|
|
2874
|
+
Re as timeStep,
|
|
2846
2875
|
pt as toOperatingTime,
|
|
2847
|
-
|
|
2876
|
+
Ce as toOperatingTimeClamped,
|
|
2848
2877
|
dt as toWallClock,
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2878
|
+
Qn as verdictWeight,
|
|
2879
|
+
Gn as violatedIndices,
|
|
2880
|
+
zn as violations,
|
|
2881
|
+
Hn as zones
|
|
2853
2882
|
};
|