@umriss-ui/charts 0.3.0-rc.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -5
- package/README.md +1 -5
- package/dist/charts.js +279 -261
- package/dist/index.d.ts +29 -0
- package/package.json +3 -4
package/dist/charts.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import "./charts.css";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var g = (n, t, e) =>
|
|
2
|
+
var ye = Object.defineProperty;
|
|
3
|
+
var ge = (n, t, e) => t in n ? ye(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
4
|
+
var g = (n, t, e) => ge(n, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
import { jsx as I, jsxs as _, Fragment as Nt } from "react/jsx-runtime";
|
|
6
|
-
import { useRef as X, useEffect as D, createContext as
|
|
7
|
-
function
|
|
6
|
+
import { useRef as X, useEffect as D, createContext as be, useContext as xe, useSyncExternalStore as Et, useCallback as ve, useState as ke, useMemo as E } from "react";
|
|
7
|
+
function Ne() {
|
|
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 it =
|
|
12
|
+
const it = Ne();
|
|
13
13
|
function ct(n, t) {
|
|
14
14
|
if (it && !n)
|
|
15
15
|
throw new Error(`@umriss-ui/charts: ${t}`);
|
|
@@ -37,18 +37,28 @@ function bt(n, t, e) {
|
|
|
37
37
|
const i = n.getPropertyValue(t).trim();
|
|
38
38
|
return i === "" ? e : i;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
40
|
+
function ne(n, t) {
|
|
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
|
-
const i = (r, s) => {
|
|
44
|
-
const o = bt(t, r, s);
|
|
45
|
-
if (o === s) return s;
|
|
46
|
-
e.style.color = `var(${r})`;
|
|
47
|
-
const a = getComputedStyle(e).color;
|
|
48
|
-
return a === "" || a.startsWith("var(") ? o : a;
|
|
49
|
-
};
|
|
50
43
|
try {
|
|
51
|
-
|
|
44
|
+
return t((i) => {
|
|
45
|
+
e.style.color = "", e.style.color = i;
|
|
46
|
+
const r = getComputedStyle(e).color;
|
|
47
|
+
return r === "" || r.startsWith("var(") ? i : r;
|
|
48
|
+
});
|
|
49
|
+
} finally {
|
|
50
|
+
e.remove();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function we(n) {
|
|
54
|
+
const t = getComputedStyle(n);
|
|
55
|
+
return ne(n, (e) => {
|
|
56
|
+
const i = (s, o) => {
|
|
57
|
+
const a = bt(t, s, o);
|
|
58
|
+
if (a === o) return o;
|
|
59
|
+
const l = e(`var(${s})`);
|
|
60
|
+
return l === `var(${s})` ? a : l;
|
|
61
|
+
}, r = [];
|
|
52
62
|
for (let s = 1; s <= 6; s++)
|
|
53
63
|
r.push(i(`--uc-series-${s}`, W.series[s - 1] ?? "#2563eb"));
|
|
54
64
|
return {
|
|
@@ -63,32 +73,37 @@ function ke(n) {
|
|
|
63
73
|
fontMono: bt(t, "--uc-font-mono", W.fontMono),
|
|
64
74
|
series: r
|
|
65
75
|
};
|
|
66
|
-
}
|
|
67
|
-
e.remove();
|
|
68
|
-
}
|
|
76
|
+
});
|
|
69
77
|
}
|
|
70
|
-
function
|
|
78
|
+
function ie() {
|
|
71
79
|
var n, t;
|
|
72
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()))));
|
|
73
81
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
82
|
+
function Xn(n, t) {
|
|
83
|
+
return ie(), ne(n, (e) => {
|
|
84
|
+
const i = {};
|
|
85
|
+
for (const r of Object.keys(t)) i[r] = e(t[r]);
|
|
86
|
+
return i;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function Ie(n) {
|
|
90
|
+
ie();
|
|
76
91
|
const t = Ht.get(n);
|
|
77
92
|
if (t !== void 0 && t.generation === wt) return t.theme;
|
|
78
|
-
const e =
|
|
93
|
+
const e = we(n);
|
|
79
94
|
return Ht.set(n, { generation: wt, theme: e }), e;
|
|
80
95
|
}
|
|
81
96
|
function Rt() {
|
|
82
97
|
wt++;
|
|
83
98
|
for (const n of It) n();
|
|
84
99
|
}
|
|
85
|
-
function
|
|
100
|
+
function Se(n) {
|
|
86
101
|
return It.add(n), () => {
|
|
87
102
|
It.delete(n);
|
|
88
103
|
};
|
|
89
104
|
}
|
|
90
|
-
const
|
|
91
|
-
class
|
|
105
|
+
const Me = { width: 0, height: 0 };
|
|
106
|
+
class Te {
|
|
92
107
|
constructor(t) {
|
|
93
108
|
g(this, "span", null);
|
|
94
109
|
g(this, "root");
|
|
@@ -106,7 +121,7 @@ class Me {
|
|
|
106
121
|
const i = `${e}|${t}`, r = this.cache.get(i);
|
|
107
122
|
if (r !== void 0) return r;
|
|
108
123
|
const s = this.ensure();
|
|
109
|
-
if (s === null) return
|
|
124
|
+
if (s === null) return Me;
|
|
110
125
|
s.className = `uc-measure ${e}`, s.textContent = t;
|
|
111
126
|
const o = s.getBoundingClientRect(), a = { width: o.width, height: o.height };
|
|
112
127
|
return this.cache.set(i, a), a;
|
|
@@ -140,7 +155,7 @@ function Dt(n) {
|
|
|
140
155
|
function Mt(n, t) {
|
|
141
156
|
return t <= 0 || !Number.isFinite(n) || Math.abs(n) >= 1e21 ? St(n) : St(Number(n.toFixed(Math.min(20, t))));
|
|
142
157
|
}
|
|
143
|
-
function
|
|
158
|
+
function Ae(n, t, e) {
|
|
144
159
|
if (!Number.isFinite(n) || !Number.isFinite(t)) return [0, 1];
|
|
145
160
|
if (n === t) return [n - 1, t + 1];
|
|
146
161
|
const i = mt(t - n, e), r = Dt(i);
|
|
@@ -152,7 +167,7 @@ function Te(n, t, e) {
|
|
|
152
167
|
function Vt(n, t) {
|
|
153
168
|
return !Number.isFinite(n) || !Number.isFinite(t) ? [0, 1] : n === t ? [n - 1, t + 1] : [n, t];
|
|
154
169
|
}
|
|
155
|
-
function
|
|
170
|
+
function re(n, t, e) {
|
|
156
171
|
if (!Number.isFinite(n) || !Number.isFinite(t)) return [];
|
|
157
172
|
if (n === t) return [St(n)];
|
|
158
173
|
const [i, r] = n < t ? [n, t] : [t, n], s = mt(r - i, e), o = Dt(s), a = s * 1e-9, l = Math.ceil((i - a) / s), c = Math.floor((r + a) / s);
|
|
@@ -180,18 +195,18 @@ class _t {
|
|
|
180
195
|
return this.m === 0 ? this.domain[0] : (t - this.b) / this.m;
|
|
181
196
|
}
|
|
182
197
|
ticks(t) {
|
|
183
|
-
return
|
|
198
|
+
return re(this.domain[0], this.domain[1], t);
|
|
184
199
|
}
|
|
185
200
|
}
|
|
186
201
|
let ot = null;
|
|
187
|
-
function
|
|
202
|
+
function se() {
|
|
188
203
|
if (ot !== null) return ot;
|
|
189
204
|
const n = typeof navigator > "u" ? void 0 : navigator.language;
|
|
190
205
|
return ot = typeof n == "string" && n !== "" ? n : "en-US", ot;
|
|
191
206
|
}
|
|
192
207
|
const ht = /* @__PURE__ */ new Map();
|
|
193
|
-
function
|
|
194
|
-
const t =
|
|
208
|
+
function Le(n) {
|
|
209
|
+
const t = se(), e = `${t}|${n}`;
|
|
195
210
|
let i = ht.get(e);
|
|
196
211
|
return i === void 0 && (i = new Intl.NumberFormat(t, {
|
|
197
212
|
minimumFractionDigits: n,
|
|
@@ -199,17 +214,17 @@ function Ae(n) {
|
|
|
199
214
|
useGrouping: !0
|
|
200
215
|
}), ht.set(e, i)), i;
|
|
201
216
|
}
|
|
202
|
-
function
|
|
203
|
-
return
|
|
217
|
+
function Fe(n, t) {
|
|
218
|
+
return Le(Math.min(6, Dt(t))).format(n);
|
|
204
219
|
}
|
|
205
220
|
function Bt(n) {
|
|
206
221
|
if (!Number.isFinite(n)) return "–";
|
|
207
|
-
const t =
|
|
222
|
+
const t = se(), e = `${t}|value`;
|
|
208
223
|
let i = ht.get(e);
|
|
209
224
|
return i === void 0 && (i = new Intl.NumberFormat(t, { maximumFractionDigits: 3, useGrouping: !0 }), ht.set(e, i)), i.format(n);
|
|
210
225
|
}
|
|
211
|
-
const q = 1e3, K = 60 * q,
|
|
212
|
-
function
|
|
226
|
+
const q = 1e3, K = 60 * q, J = 60 * K, U = 24 * J;
|
|
227
|
+
function Pe(n) {
|
|
213
228
|
const t = n.filter((s) => Number.isFinite(s.from) && Number.isFinite(s.to) && s.to > s.from).sort((s, o) => s.from - o.from), e = [];
|
|
214
229
|
for (const s of t) {
|
|
215
230
|
const o = e[e.length - 1];
|
|
@@ -226,10 +241,10 @@ function z(n) {
|
|
|
226
241
|
if (!Array.isArray(n)) return n;
|
|
227
242
|
const t = n, e = Yt.get(t);
|
|
228
243
|
if (e !== void 0) return e;
|
|
229
|
-
const i =
|
|
244
|
+
const i = Pe(t);
|
|
230
245
|
return Yt.set(t, i), i;
|
|
231
246
|
}
|
|
232
|
-
function
|
|
247
|
+
function Ee(n, t) {
|
|
233
248
|
const e = n.intervals;
|
|
234
249
|
let i = 0, r = e.length - 1, s = -1;
|
|
235
250
|
for (; i <= r; ) {
|
|
@@ -241,7 +256,7 @@ function Pe(n, t) {
|
|
|
241
256
|
function pt(n, t) {
|
|
242
257
|
const e = z(t);
|
|
243
258
|
if (e.intervals.length === 0) return n;
|
|
244
|
-
const i =
|
|
259
|
+
const i = Ee(e, n);
|
|
245
260
|
return i < 0 ? Number.NaN : e.offsets[i] + (n - e.intervals[i].from);
|
|
246
261
|
}
|
|
247
262
|
function dt(n, t) {
|
|
@@ -257,12 +272,12 @@ function dt(n, t) {
|
|
|
257
272
|
}
|
|
258
273
|
return i[o].from + (n - e.offsets[o]);
|
|
259
274
|
}
|
|
260
|
-
function
|
|
275
|
+
function Zn(n, t, e, i) {
|
|
261
276
|
const r = z(n);
|
|
262
277
|
for (let s = 0; s < e; s++)
|
|
263
278
|
i[s] = pt(t[s], r);
|
|
264
279
|
}
|
|
265
|
-
function
|
|
280
|
+
function De(n, t) {
|
|
266
281
|
const e = z(t);
|
|
267
282
|
if (e.intervals.length === 0) return n;
|
|
268
283
|
const i = pt(n, e);
|
|
@@ -274,11 +289,11 @@ function Ee(n, t) {
|
|
|
274
289
|
}
|
|
275
290
|
return e.total;
|
|
276
291
|
}
|
|
277
|
-
function
|
|
292
|
+
function $e(n, t) {
|
|
278
293
|
const e = z(t);
|
|
279
294
|
return e.intervals.length === 0 ? !1 : Number.isNaN(pt(n, e));
|
|
280
295
|
}
|
|
281
|
-
function
|
|
296
|
+
function Ce(n) {
|
|
282
297
|
const t = z(n), e = [];
|
|
283
298
|
for (let i = 1; i < t.intervals.length; i++)
|
|
284
299
|
e.push({
|
|
@@ -288,8 +303,8 @@ function $e(n) {
|
|
|
288
303
|
});
|
|
289
304
|
return e;
|
|
290
305
|
}
|
|
291
|
-
function
|
|
292
|
-
return
|
|
306
|
+
function We(n, t, e) {
|
|
307
|
+
return Ce(n).map((i) => i.operatingTime).filter((i) => i >= t && i <= e);
|
|
293
308
|
}
|
|
294
309
|
const zt = [
|
|
295
310
|
q,
|
|
@@ -304,25 +319,25 @@ const zt = [
|
|
|
304
319
|
10 * K,
|
|
305
320
|
15 * K,
|
|
306
321
|
30 * K,
|
|
307
|
-
|
|
308
|
-
2 *
|
|
309
|
-
3 *
|
|
310
|
-
6 *
|
|
311
|
-
12 *
|
|
322
|
+
J,
|
|
323
|
+
2 * J,
|
|
324
|
+
3 * J,
|
|
325
|
+
6 * J,
|
|
326
|
+
12 * J,
|
|
312
327
|
U,
|
|
313
328
|
2 * U,
|
|
314
329
|
7 * U,
|
|
315
330
|
14 * U,
|
|
316
331
|
28 * U
|
|
317
332
|
];
|
|
318
|
-
function
|
|
333
|
+
function Oe(n, t) {
|
|
319
334
|
const e = zt[0];
|
|
320
335
|
if (!Number.isFinite(n) || n <= 0) return e;
|
|
321
336
|
const i = n / Math.max(1, Math.floor(t));
|
|
322
337
|
for (const r of zt) if (r >= i) return r;
|
|
323
338
|
return U * mt(i / U, 1);
|
|
324
339
|
}
|
|
325
|
-
function
|
|
340
|
+
function He(n, t, e, i, r = 0) {
|
|
326
341
|
const s = z(n), o = [];
|
|
327
342
|
if (!Number.isFinite(t) || !Number.isFinite(e) || !(i > 0)) return o;
|
|
328
343
|
const a = Math.ceil((t - r) / i), l = Math.floor((e - r) / i);
|
|
@@ -334,11 +349,11 @@ function Oe(n, t, e, i, r = 0) {
|
|
|
334
349
|
}
|
|
335
350
|
return o;
|
|
336
351
|
}
|
|
337
|
-
function
|
|
352
|
+
function Re(n, t, e, i, r = 0) {
|
|
338
353
|
const s = z(n);
|
|
339
354
|
if (s.intervals.length === 0 || !(e > t)) return [];
|
|
340
|
-
const o = Math.max(0, Math.min(s.total, t)), a = Math.max(0, Math.min(s.total, e)), l =
|
|
341
|
-
return
|
|
355
|
+
const o = Math.max(0, Math.min(s.total, t)), a = Math.max(0, Math.min(s.total, e)), l = Oe(e - t, i);
|
|
356
|
+
return He(
|
|
342
357
|
s,
|
|
343
358
|
dt(o, s),
|
|
344
359
|
dt(a, s),
|
|
@@ -346,7 +361,7 @@ function He(n, t, e, i, r = 0) {
|
|
|
346
361
|
r
|
|
347
362
|
).map((u) => u.operatingTime).filter((u) => u >= t && u <= e);
|
|
348
363
|
}
|
|
349
|
-
const Tt = 5, At = 4, xt = 8, Gt = 4,
|
|
364
|
+
const Tt = 5, At = 4, xt = 8, Gt = 4, Ve = 8, ut = "uc-tick-label", at = "uc-axis-title", oe = {
|
|
350
365
|
width: 0,
|
|
351
366
|
height: 0,
|
|
352
367
|
plot: { x: 0, y: 0, width: 0, height: 0 },
|
|
@@ -354,7 +369,7 @@ const Tt = 5, At = 4, xt = 8, Gt = 4, Re = 8, ut = "uc-tick-label", at = "uc-axi
|
|
|
354
369
|
};
|
|
355
370
|
function qt(n, t, e) {
|
|
356
371
|
const i = Math.ceil(t), r = e.get(n);
|
|
357
|
-
return r === void 0 || i > r || r - i >=
|
|
372
|
+
return r === void 0 || i > r || r - i >= Ve ? (e.set(n, i), i) : r;
|
|
358
373
|
}
|
|
359
374
|
function Kt(n, t) {
|
|
360
375
|
const e = n.domainMode;
|
|
@@ -363,9 +378,9 @@ function Kt(n, t) {
|
|
|
363
378
|
return s[0] === s[1] ? [s[0] - 1, s[1] + 1] : s;
|
|
364
379
|
}
|
|
365
380
|
const [i, r] = n.extent;
|
|
366
|
-
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) : Ae(i, r, t);
|
|
367
382
|
}
|
|
368
|
-
function
|
|
383
|
+
function _e(n) {
|
|
369
384
|
if (!Number.isFinite(n)) return "";
|
|
370
385
|
const t = new Date(n), e = (i) => String(i).padStart(2, "0");
|
|
371
386
|
return `${e(t.getDate())}.${e(t.getMonth() + 1)}. ${e(t.getHours())}:${e(t.getMinutes())}`;
|
|
@@ -374,19 +389,19 @@ function Ut(n, t, e) {
|
|
|
374
389
|
if (n.tickValues !== void 0)
|
|
375
390
|
return n.tickValues.filter((r) => r >= t[0] && r <= t[1]);
|
|
376
391
|
const i = n.calendar;
|
|
377
|
-
return i !== void 0 && i.length > 0 ?
|
|
392
|
+
return i !== void 0 && i.length > 0 ? Re(i, t[0], t[1], e) : re(t[0], t[1], e);
|
|
378
393
|
}
|
|
379
394
|
function Xt(n, t, e) {
|
|
380
395
|
const i = n.calendar;
|
|
381
396
|
if (i !== void 0 && i.length > 0) {
|
|
382
397
|
const s = n.tickFormat;
|
|
383
|
-
return s === void 0 ? (o) =>
|
|
398
|
+
return s === void 0 ? (o) => _e(dt(o, i)) : (o) => s(dt(o, i));
|
|
384
399
|
}
|
|
385
400
|
if (n.tickFormat !== void 0) return n.tickFormat;
|
|
386
401
|
const r = mt(Math.abs(t[1] - t[0]), e);
|
|
387
|
-
return (s) =>
|
|
402
|
+
return (s) => Fe(s, r);
|
|
388
403
|
}
|
|
389
|
-
function
|
|
404
|
+
function Be(n) {
|
|
390
405
|
const { width: t, height: e, padding: i, axes: r, measure: s, hysteresis: o } = 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(s("0", ut).height) || 14, p = /* @__PURE__ */ new Map();
|
|
391
406
|
for (const v of [...c, ...u]) {
|
|
392
407
|
const M = v.label === void 0 || v.label === "" ? 0 : Math.ceil(s(v.label, at).height) + Gt;
|
|
@@ -426,10 +441,10 @@ function _e(n) {
|
|
|
426
441
|
v.forEach((x, A) => {
|
|
427
442
|
const $ = k.get(x.key) ?? 0, T = b.get(x.key), O = P(x, A, M, $);
|
|
428
443
|
M += $ + xt;
|
|
429
|
-
const C = (T == null ? void 0 : T.domain) ?? [0, 1], tt = (T == null ? void 0 : T.format) ?? ((
|
|
430
|
-
value:
|
|
444
|
+
const C = (T == null ? void 0 : T.domain) ?? [0, 1], tt = (T == null ? void 0 : T.format) ?? ((j) => String(j)), V = new _t(C, [m + f, m]), et = ((T == null ? void 0 : T.values) ?? []).map((j, B) => ({
|
|
445
|
+
value: j,
|
|
431
446
|
label: (T == null ? void 0 : T.labels[B]) ?? "",
|
|
432
|
-
px: V.toPx(
|
|
447
|
+
px: V.toPx(j),
|
|
433
448
|
labelLeft: 0,
|
|
434
449
|
labelWidth: (T == null ? void 0 : T.widths[B]) ?? 0
|
|
435
450
|
}));
|
|
@@ -458,9 +473,9 @@ function _e(n) {
|
|
|
458
473
|
v.forEach((x, A) => {
|
|
459
474
|
const $ = p.get(x.key) ?? 0, T = P(x, A, M, $);
|
|
460
475
|
M += $ + xt;
|
|
461
|
-
const O = x.tickCount ?? Math.max(2, Math.round(L / 80)), C = Kt(x, O), tt = Ut(x, C, O), V = Xt(x, C, O), et = new _t(C, [N, N + L]),
|
|
462
|
-
const Ct = V(B), yt = s(Ct, ut).width, Wt = et.toPx(B),
|
|
463
|
-
return { value: B, label: Ct, px: Wt, labelLeft:
|
|
476
|
+
const O = x.tickCount ?? Math.max(2, Math.round(L / 80)), C = Kt(x, O), tt = Ut(x, C, O), V = Xt(x, C, O), et = new _t(C, [N, N + L]), j = tt.map((B) => {
|
|
477
|
+
const Ct = V(B), yt = s(Ct, ut).width, Wt = et.toPx(B), me = Wt - yt / 2, pe = Math.min(Math.max(me, 0), Math.max(0, t - yt));
|
|
478
|
+
return { value: B, label: Ct, px: Wt, labelLeft: pe, labelWidth: yt };
|
|
464
479
|
});
|
|
465
480
|
S.push({
|
|
466
481
|
key: x.key,
|
|
@@ -474,16 +489,16 @@ function _e(n) {
|
|
|
474
489
|
stack: A,
|
|
475
490
|
domain: C,
|
|
476
491
|
scale: et,
|
|
477
|
-
ticks:
|
|
492
|
+
ticks: j,
|
|
478
493
|
format: V,
|
|
479
494
|
titleSize: x.label === void 0 || x.label === "" ? 0 : Math.ceil(s(x.label, at).height),
|
|
480
|
-
breaks: x.calendar === void 0 || x.calendar.length === 0 ? [] :
|
|
495
|
+
breaks: x.calendar === void 0 || x.calendar.length === 0 ? [] : We(x.calendar, C[0], C[1]).map((B) => et.toPx(B))
|
|
481
496
|
});
|
|
482
497
|
});
|
|
483
498
|
};
|
|
484
499
|
return R(c), R(u), { width: t, height: e, plot: F, axes: S };
|
|
485
500
|
}
|
|
486
|
-
function
|
|
501
|
+
function Ye(n, t, e) {
|
|
487
502
|
if (t <= 0 || !(e >= n[0])) return -1;
|
|
488
503
|
let i = 0, r = t - 1;
|
|
489
504
|
if (n[r] <= e) return r;
|
|
@@ -493,19 +508,19 @@ function Be(n, t, e) {
|
|
|
493
508
|
}
|
|
494
509
|
return i;
|
|
495
510
|
}
|
|
496
|
-
function
|
|
511
|
+
function ae(n, t, e, i) {
|
|
497
512
|
return e + 1 < t ? n[e + 1] : i;
|
|
498
513
|
}
|
|
499
514
|
function rt(n, t) {
|
|
500
515
|
return Number.isFinite(n) ? n : t;
|
|
501
516
|
}
|
|
502
|
-
function
|
|
517
|
+
function le(n) {
|
|
503
518
|
return !Number.isFinite(n);
|
|
504
519
|
}
|
|
505
520
|
function Zt(n, t) {
|
|
506
521
|
return n < t;
|
|
507
522
|
}
|
|
508
|
-
function
|
|
523
|
+
function ze(n, t, e, i) {
|
|
509
524
|
const r = new Int32Array(e);
|
|
510
525
|
for (let s = 0; s < e; s++) {
|
|
511
526
|
const o = n[s], a = rt(t[s], i);
|
|
@@ -519,7 +534,7 @@ function Ye(n, t, e, i) {
|
|
|
519
534
|
}
|
|
520
535
|
return r;
|
|
521
536
|
}
|
|
522
|
-
function
|
|
537
|
+
function Ge(n, t, e, i, r, s, o, a) {
|
|
523
538
|
const l = o / 2;
|
|
524
539
|
for (let c = i - 1; c >= 0; c--) {
|
|
525
540
|
const u = e[c];
|
|
@@ -532,7 +547,7 @@ function ze(n, t, e, i, r, s, o, a) {
|
|
|
532
547
|
function st(n) {
|
|
533
548
|
return Math.round(n) + 0.5;
|
|
534
549
|
}
|
|
535
|
-
function
|
|
550
|
+
function qe(n, t) {
|
|
536
551
|
const { plot: e, axes: i, theme: r } = t, s = e.x, o = e.x + e.width, a = e.y, l = e.y + e.height;
|
|
537
552
|
n.lineWidth = 1;
|
|
538
553
|
for (const c of i)
|
|
@@ -553,7 +568,7 @@ function Ge(n, t) {
|
|
|
553
568
|
p && (n.strokeStyle = h ? r.colorAxis : r.colorGrid, n.stroke());
|
|
554
569
|
}
|
|
555
570
|
}
|
|
556
|
-
function
|
|
571
|
+
function Ke(n, t) {
|
|
557
572
|
const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = new Path2D();
|
|
558
573
|
let u = !1;
|
|
559
574
|
for (let h = 0; h < e; h++) {
|
|
@@ -576,7 +591,7 @@ function qe(n, t) {
|
|
|
576
591
|
n.fillStyle = t.color, n.fill(p);
|
|
577
592
|
}
|
|
578
593
|
}
|
|
579
|
-
function
|
|
594
|
+
function Ue(n, t) {
|
|
580
595
|
const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = t.y0, u = t.baseline * s + o, h = new Path2D(), p = new Path2D();
|
|
581
596
|
let d = 0;
|
|
582
597
|
for (; d < e; ) {
|
|
@@ -600,7 +615,7 @@ function Ke(n, t) {
|
|
|
600
615
|
}
|
|
601
616
|
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));
|
|
602
617
|
}
|
|
603
|
-
function
|
|
618
|
+
function Xe(n, t) {
|
|
604
619
|
const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = t.baseline * s + o, u = t.offset * i, h = t.width * i, p = new Path2D();
|
|
605
620
|
for (let d = 0; d < e; d++) {
|
|
606
621
|
const m = l[d];
|
|
@@ -610,7 +625,7 @@ function Ue(n, t) {
|
|
|
610
625
|
}
|
|
611
626
|
n.fillStyle = t.color, n.fill(p);
|
|
612
627
|
}
|
|
613
|
-
function
|
|
628
|
+
function Ze(n, t) {
|
|
614
629
|
const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = t.radius, u = new Path2D();
|
|
615
630
|
for (let h = 0; h < e; h++) {
|
|
616
631
|
const p = l[h];
|
|
@@ -620,7 +635,7 @@ function Xe(n, t) {
|
|
|
620
635
|
}
|
|
621
636
|
n.fillStyle = t.color, n.fill(u);
|
|
622
637
|
}
|
|
623
|
-
function
|
|
638
|
+
function je(n, t) {
|
|
624
639
|
const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.x, o = t.y, a = t.laneTop, l = t.laneBottom - t.laneTop, c = t.colors.length;
|
|
625
640
|
if (c === 0 || l <= 0) return;
|
|
626
641
|
const u = [];
|
|
@@ -631,7 +646,7 @@ function Ze(n, t) {
|
|
|
631
646
|
if (Number.isNaN(d)) continue;
|
|
632
647
|
const m = d | 0, y = u[m];
|
|
633
648
|
if (y === void 0) continue;
|
|
634
|
-
const f = s[p], b =
|
|
649
|
+
const f = s[p], b = ae(s, e, p, t.domainEnd);
|
|
635
650
|
b > f && (y.rect(f * i + r, a, (b - f) * i, l), h = !0);
|
|
636
651
|
}
|
|
637
652
|
if (h)
|
|
@@ -654,7 +669,7 @@ function Je(n, t) {
|
|
|
654
669
|
for (let m = 0; m < u; m++)
|
|
655
670
|
n.fillStyle = t.colors[m], n.fill(d[m]);
|
|
656
671
|
}
|
|
657
|
-
function
|
|
672
|
+
function Qe(n, t) {
|
|
658
673
|
const e = t.length, i = t.xScale.m, r = t.xScale.b, s = t.yScale.m, o = t.yScale.b, a = t.x, l = t.y, c = t.x1, u = t.depth, h = Math.abs(t.height * s), p = h * 0.28, d = new Path2D(), m = new Path2D();
|
|
659
674
|
for (let y = 0; y < e; y++) {
|
|
660
675
|
const f = l[y];
|
|
@@ -664,11 +679,11 @@ function je(n, t) {
|
|
|
664
679
|
const k = c[y], N = rt(k, t.domainEnd);
|
|
665
680
|
if (!(N >= b)) continue;
|
|
666
681
|
const w = b * i + r, L = Math.max(1, (N - b) * i), F = f * s + o + u[y] * p;
|
|
667
|
-
(
|
|
682
|
+
(le(k) ? m : d).rect(w, F - h / 2, L, h);
|
|
668
683
|
}
|
|
669
684
|
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([]);
|
|
670
685
|
}
|
|
671
|
-
function
|
|
686
|
+
function jt(n, t, e) {
|
|
672
687
|
for (const i of e) {
|
|
673
688
|
if (i.band) {
|
|
674
689
|
const r = Math.min(i.fromPx, i.toPx), s = Math.max(i.fromPx, i.toPx);
|
|
@@ -685,39 +700,39 @@ function Jt(n, t, e) {
|
|
|
685
700
|
n.strokeStyle = i.color, n.lineWidth = 1, n.setLineDash(i.dash), n.stroke(), n.setLineDash([]);
|
|
686
701
|
}
|
|
687
702
|
}
|
|
688
|
-
function
|
|
703
|
+
function tn(n, t) {
|
|
689
704
|
const { width: e, height: i, plot: r, series: s } = t;
|
|
690
705
|
if (n.clearRect(0, 0, e, i), !(r.width <= 0 || r.height <= 0)) {
|
|
691
|
-
|
|
706
|
+
qe(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);
|
|
692
707
|
for (const o of s)
|
|
693
708
|
if (o.length !== 0)
|
|
694
709
|
switch (n.globalAlpha = o.alpha, o.kind) {
|
|
695
710
|
case "line":
|
|
696
|
-
|
|
711
|
+
Ke(n, o);
|
|
697
712
|
break;
|
|
698
713
|
case "area":
|
|
699
|
-
|
|
714
|
+
Ue(n, o);
|
|
700
715
|
break;
|
|
701
716
|
case "bar":
|
|
702
|
-
|
|
717
|
+
Xe(n, o);
|
|
703
718
|
break;
|
|
704
719
|
case "scatter":
|
|
705
|
-
|
|
720
|
+
Ze(n, o);
|
|
706
721
|
break;
|
|
707
722
|
case "state":
|
|
708
|
-
|
|
723
|
+
je(n, o);
|
|
709
724
|
break;
|
|
710
725
|
case "matrix":
|
|
711
726
|
Je(n, o);
|
|
712
727
|
break;
|
|
713
728
|
case "span":
|
|
714
|
-
|
|
729
|
+
Qe(n, o);
|
|
715
730
|
break;
|
|
716
731
|
}
|
|
717
|
-
n.globalAlpha = 1,
|
|
732
|
+
n.globalAlpha = 1, jt(n, r, t.limitLines), n.restore();
|
|
718
733
|
}
|
|
719
734
|
}
|
|
720
|
-
function
|
|
735
|
+
function en(n, t) {
|
|
721
736
|
const { width: e, height: i, plot: r, theme: s, hover: o } = t;
|
|
722
737
|
if (n.clearRect(0, 0, e, i), o === null || r.width <= 0 || r.height <= 0) return;
|
|
723
738
|
const a = st(o.hit.xPx);
|
|
@@ -725,7 +740,7 @@ function tn(n, t) {
|
|
|
725
740
|
for (const l of o.marker)
|
|
726
741
|
n.beginPath(), n.arc(l.x, l.y, 5.5, 0, Math.PI * 2), n.fillStyle = s.colorBg, n.fill(), n.beginPath(), n.arc(l.x, l.y, 3.5, 0, Math.PI * 2), n.fillStyle = l.color, n.fill();
|
|
727
742
|
}
|
|
728
|
-
function
|
|
743
|
+
function nn(n, t, e) {
|
|
729
744
|
if (t <= 0) return -1;
|
|
730
745
|
if (t === 1) return 0;
|
|
731
746
|
let i = 0, r = t - 1;
|
|
@@ -738,7 +753,7 @@ function en(n, t, e) {
|
|
|
738
753
|
const s = e - n[i];
|
|
739
754
|
return n[r] - e < s ? r : i;
|
|
740
755
|
}
|
|
741
|
-
function
|
|
756
|
+
function Jt(n, t) {
|
|
742
757
|
if (t < 2) return 0;
|
|
743
758
|
const e = n.slice(0, t).sort();
|
|
744
759
|
let i = Number.POSITIVE_INFINITY;
|
|
@@ -751,7 +766,7 @@ function jt(n, t) {
|
|
|
751
766
|
function lt(n, t) {
|
|
752
767
|
return n > 0 ? n : t;
|
|
753
768
|
}
|
|
754
|
-
function
|
|
769
|
+
function rn(n, t, e, i, r, s, o) {
|
|
755
770
|
const a = s / 2, l = o / 2;
|
|
756
771
|
for (let c = 0; c < e; c++) {
|
|
757
772
|
const u = i - n[c];
|
|
@@ -762,17 +777,17 @@ function nn(n, t, e, i, r, s, o) {
|
|
|
762
777
|
}
|
|
763
778
|
return -1;
|
|
764
779
|
}
|
|
765
|
-
const
|
|
780
|
+
const sn = {
|
|
766
781
|
ok: 0,
|
|
767
782
|
unknown: 1,
|
|
768
783
|
warning: 2,
|
|
769
784
|
alarm: 3
|
|
770
785
|
};
|
|
771
|
-
function
|
|
772
|
-
return
|
|
786
|
+
function jn(n) {
|
|
787
|
+
return sn[n];
|
|
773
788
|
}
|
|
774
789
|
const Qt = { warning: 2, alarm: 3 };
|
|
775
|
-
function
|
|
790
|
+
function on(n, t = {}) {
|
|
776
791
|
if (n == null || !Number.isFinite(n))
|
|
777
792
|
return { verdict: "unknown" };
|
|
778
793
|
const e = t.target, i = e !== void 0 && Number.isFinite(e) ? n - e : void 0;
|
|
@@ -790,7 +805,7 @@ function sn(n, t = {}) {
|
|
|
790
805
|
};
|
|
791
806
|
return i === void 0 ? o : { ...o, deviation: i };
|
|
792
807
|
}
|
|
793
|
-
function
|
|
808
|
+
function an(n, t, e, i, r) {
|
|
794
809
|
const s = n.length, o = new Float64Array(s), a = new Float64Array(s), l = typeof i == "function" ? i : null, c = l === null ? null : new Float64Array(s), u = (r == null ? void 0 : r.value) ?? null, h = u === null ? null : new Float64Array(s), p = (r == null ? void 0 : r.xEnd) ?? null, d = p === null ? null : new Float64Array(s), m = (r == null ? void 0 : r.xMap) ?? null, y = (r == null ? void 0 : r.xGap) ?? null;
|
|
795
810
|
let f = Number.POSITIVE_INFINITY, b = Number.NEGATIVE_INFINITY, k = Number.POSITIVE_INFINITY, N = Number.NEGATIVE_INFINITY;
|
|
796
811
|
typeof i == "number" && s > 0 && (k = i, N = i);
|
|
@@ -814,12 +829,12 @@ function on(n, t, e, i, r) {
|
|
|
814
829
|
}
|
|
815
830
|
return { series: { x: o, y: a, y0: c, w: h, x1: d, length: s }, extent: { xMin: f, xMax: b, yMin: k, yMax: N } };
|
|
816
831
|
}
|
|
817
|
-
function
|
|
832
|
+
function ln(n, t) {
|
|
818
833
|
for (let e = 1; e < t; e++)
|
|
819
834
|
if (n[e] < n[e - 1]) return e;
|
|
820
835
|
return -1;
|
|
821
836
|
}
|
|
822
|
-
function
|
|
837
|
+
function cn(n, t, e, i) {
|
|
823
838
|
let r = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY;
|
|
824
839
|
for (const o of e) {
|
|
825
840
|
const a = o.extent;
|
|
@@ -832,7 +847,7 @@ function ln(n, t, e, i) {
|
|
|
832
847
|
Number.isFinite(o) && (o < r && (r = o), o > s && (s = o));
|
|
833
848
|
return !Number.isFinite(r) || !Number.isFinite(s) ? [0, 1] : [r, s];
|
|
834
849
|
}
|
|
835
|
-
function
|
|
850
|
+
function un(n, t) {
|
|
836
851
|
let e = Number.POSITIVE_INFINITY;
|
|
837
852
|
for (let i = 1; i < t; i++) {
|
|
838
853
|
const r = n[i] - n[i - 1];
|
|
@@ -840,14 +855,14 @@ function cn(n, t) {
|
|
|
840
855
|
}
|
|
841
856
|
return Number.isFinite(e) ? e : 0;
|
|
842
857
|
}
|
|
843
|
-
function
|
|
858
|
+
function hn(n, t) {
|
|
844
859
|
return n > 0 ? n : t;
|
|
845
860
|
}
|
|
846
|
-
function
|
|
861
|
+
function dn(n, t, e, i) {
|
|
847
862
|
const r = n * t, s = r / i;
|
|
848
863
|
return { offset: -r / 2 + e * s, width: s };
|
|
849
864
|
}
|
|
850
|
-
function
|
|
865
|
+
function fn(n) {
|
|
851
866
|
const t = /* @__PURE__ */ new Map();
|
|
852
867
|
for (const i of n) {
|
|
853
868
|
if (i.kind !== "bar") continue;
|
|
@@ -873,7 +888,7 @@ function dn(n) {
|
|
|
873
888
|
}
|
|
874
889
|
const te = {
|
|
875
890
|
version: 0,
|
|
876
|
-
layout:
|
|
891
|
+
layout: oe,
|
|
877
892
|
legend: null,
|
|
878
893
|
series: [],
|
|
879
894
|
limits: []
|
|
@@ -882,9 +897,9 @@ const te = {
|
|
|
882
897
|
hover: null,
|
|
883
898
|
tooltip: null,
|
|
884
899
|
xLabel: ""
|
|
885
|
-
},
|
|
900
|
+
}, mn = 4, pn = 60;
|
|
886
901
|
let vt = 0;
|
|
887
|
-
const
|
|
902
|
+
const yn = new Float64Array(0), gn = new Int32Array(0);
|
|
888
903
|
function Y(n, t) {
|
|
889
904
|
return n === t ? !0 : typeof n != "function" || typeof t != "function" ? !1 : String(n) === String(t);
|
|
890
905
|
}
|
|
@@ -894,7 +909,7 @@ function ft(n, t) {
|
|
|
894
909
|
for (let e = 0; e < n.length; e++) if (n[e] !== t[e]) return !1;
|
|
895
910
|
return !0;
|
|
896
911
|
}
|
|
897
|
-
function
|
|
912
|
+
function bn(n, t) {
|
|
898
913
|
return n.kind === t.kind && Y(n.accessor, t.accessor) && n.data === t.data && Y(Pt(n), Pt(t)) && Y(Lt(n), Lt(t)) && Y(Ft(n), Ft(t));
|
|
899
914
|
}
|
|
900
915
|
function Lt(n) {
|
|
@@ -918,7 +933,7 @@ function Pt(n) {
|
|
|
918
933
|
return;
|
|
919
934
|
}
|
|
920
935
|
}
|
|
921
|
-
function
|
|
936
|
+
function xn(n, t) {
|
|
922
937
|
if (n.kind !== t.kind) return !1;
|
|
923
938
|
switch (t.kind) {
|
|
924
939
|
case "line": {
|
|
@@ -935,15 +950,15 @@ function bn(n, t) {
|
|
|
935
950
|
return n.radius === t.radius;
|
|
936
951
|
case "state": {
|
|
937
952
|
const e = n;
|
|
938
|
-
return e.laneFrom === t.laneFrom && e.laneTo === t.laneTo &&
|
|
953
|
+
return e.laneFrom === t.laneFrom && e.laneTo === t.laneTo && vn(e.states, t.states);
|
|
939
954
|
}
|
|
940
955
|
case "matrix":
|
|
941
|
-
return
|
|
956
|
+
return kn(n.coloring, t.coloring);
|
|
942
957
|
case "span":
|
|
943
958
|
return n.height === t.height;
|
|
944
959
|
}
|
|
945
960
|
}
|
|
946
|
-
function
|
|
961
|
+
function vn(n, t) {
|
|
947
962
|
var e, i, r, s;
|
|
948
963
|
if (n === t) return !0;
|
|
949
964
|
if (n.length !== t.length) return !1;
|
|
@@ -951,20 +966,20 @@ function xn(n, t) {
|
|
|
951
966
|
if (((e = n[o]) == null ? void 0 : e.label) !== ((i = t[o]) == null ? void 0 : i.label) || ((r = n[o]) == null ? void 0 : r.color) !== ((s = t[o]) == null ? void 0 : s.color)) return !1;
|
|
952
967
|
return !0;
|
|
953
968
|
}
|
|
954
|
-
function
|
|
969
|
+
function kn(n, t) {
|
|
955
970
|
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;
|
|
956
971
|
}
|
|
957
|
-
function
|
|
972
|
+
function Nn(n, t) {
|
|
958
973
|
return n.kind === "assessment" ? [t.colorOk, t.colorWarning, t.colorAlarm] : n.stops;
|
|
959
974
|
}
|
|
960
|
-
function
|
|
975
|
+
function wn(n, t, e) {
|
|
961
976
|
var c, u;
|
|
962
977
|
const i = n.length, r = new Int32Array(i), s = n.w;
|
|
963
978
|
if (s === null || e === 0)
|
|
964
979
|
return r.fill(-1), r;
|
|
965
980
|
if (t.kind === "assessment") {
|
|
966
981
|
for (let h = 0; h < i; h++) {
|
|
967
|
-
const p =
|
|
982
|
+
const p = on(s[h], t.limits);
|
|
968
983
|
r[h] = p.verdict === "alarm" ? 2 : p.verdict === "warning" ? 1 : p.verdict === "ok" ? 0 : -1;
|
|
969
984
|
}
|
|
970
985
|
return r;
|
|
@@ -989,10 +1004,10 @@ function Nn(n, t, e) {
|
|
|
989
1004
|
}
|
|
990
1005
|
return r;
|
|
991
1006
|
}
|
|
992
|
-
function
|
|
1007
|
+
function In(n, t) {
|
|
993
1008
|
return n === t ? !0 : Array.isArray(n) && Array.isArray(t) ? n[0] === t[0] && n[1] === t[1] : !1;
|
|
994
1009
|
}
|
|
995
|
-
class
|
|
1010
|
+
class ce {
|
|
996
1011
|
constructor() {
|
|
997
1012
|
/* ---------- Registration ---------- */
|
|
998
1013
|
g(this, "series", /* @__PURE__ */ new Map());
|
|
@@ -1031,7 +1046,7 @@ class ae {
|
|
|
1031
1046
|
g(this, "theme", null);
|
|
1032
1047
|
g(this, "unsubscribeTheme", null);
|
|
1033
1048
|
/* ---------- Layout and interaction ---------- */
|
|
1034
|
-
g(this, "layout",
|
|
1049
|
+
g(this, "layout", oe);
|
|
1035
1050
|
g(this, "hysteresis", /* @__PURE__ */ new Map());
|
|
1036
1051
|
g(this, "hover", null);
|
|
1037
1052
|
g(this, "hoverKey", "");
|
|
@@ -1104,7 +1119,7 @@ class ae {
|
|
|
1104
1119
|
updateSeries(t, e) {
|
|
1105
1120
|
const i = this.series.get(t);
|
|
1106
1121
|
if (i === void 0) return;
|
|
1107
|
-
const r = i.config, s =
|
|
1122
|
+
const r = i.config, s = bn(r, e), o = s && r.xAxisId === e.xAxisId && r.yAxisId === e.yAxisId && r.name === e.name && r.color === e.color && r.tone === e.tone && xn(r, e);
|
|
1108
1123
|
if (r.name !== e.name && e.name !== void 0) {
|
|
1109
1124
|
const a = this.slotsByName.get(e.name);
|
|
1110
1125
|
a === void 0 ? this.slotsByName.set(e.name, i.slot) : this.slotTaken(a, i) || (i.slot = a);
|
|
@@ -1121,7 +1136,7 @@ class ae {
|
|
|
1121
1136
|
updateAxis(t, e) {
|
|
1122
1137
|
const i = this.axes.get(t);
|
|
1123
1138
|
if (i === void 0) return;
|
|
1124
|
-
const r = i.config, s = Y(r.accessor, e.accessor) && r.calendar === e.calendar, o = s && 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) &&
|
|
1139
|
+
const r = i.config, s = Y(r.accessor, e.accessor) && r.calendar === e.calendar, o = s && 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) && In(r.domain, e.domain) && Y(r.tickFormat, e.tickFormat);
|
|
1125
1140
|
if (i.config = e, !o) {
|
|
1126
1141
|
if (!s || r.id !== e.id) {
|
|
1127
1142
|
for (const a of this.series.values())
|
|
@@ -1254,7 +1269,7 @@ class ae {
|
|
|
1254
1269
|
}
|
|
1255
1270
|
const r = i.config, s = r.data ?? this.data, o = this.findXAxis(r.xAxisId);
|
|
1256
1271
|
if (o === null) continue;
|
|
1257
|
-
const a =
|
|
1272
|
+
const a = an(
|
|
1258
1273
|
s,
|
|
1259
1274
|
o.accessor,
|
|
1260
1275
|
r.accessor,
|
|
@@ -1267,7 +1282,7 @@ class ae {
|
|
|
1267
1282
|
}
|
|
1268
1283
|
);
|
|
1269
1284
|
if (i.materialized = a.series, e += a.series.length, r.kind === "bar") {
|
|
1270
|
-
const l =
|
|
1285
|
+
const l = un(a.series.x, a.series.length);
|
|
1271
1286
|
i.step = l;
|
|
1272
1287
|
const c = l / 2;
|
|
1273
1288
|
i.extent = {
|
|
@@ -1276,7 +1291,7 @@ class ae {
|
|
|
1276
1291
|
xMax: a.extent.xMax + c
|
|
1277
1292
|
};
|
|
1278
1293
|
} else if (r.kind === "matrix") {
|
|
1279
|
-
const l =
|
|
1294
|
+
const l = Jt(a.series.x, a.series.length), c = Jt(a.series.y, a.series.length);
|
|
1280
1295
|
i.step = l, i.cellHeight = c, i.extent = {
|
|
1281
1296
|
xMin: a.extent.xMin - l / 2,
|
|
1282
1297
|
xMax: a.extent.xMax + l / 2,
|
|
@@ -1290,7 +1305,7 @@ class ae {
|
|
|
1290
1305
|
yMax: Number.NEGATIVE_INFINITY
|
|
1291
1306
|
};
|
|
1292
1307
|
else if (r.kind === "span") {
|
|
1293
|
-
i.depth =
|
|
1308
|
+
i.depth = ze(
|
|
1294
1309
|
a.series.x,
|
|
1295
1310
|
a.series.x1 ?? new Float64Array(a.series.length),
|
|
1296
1311
|
a.series.length,
|
|
@@ -1309,7 +1324,7 @@ class ae {
|
|
|
1309
1324
|
i.step = null, i.extent = a.extent;
|
|
1310
1325
|
if (!this.sortednessChecked && it) {
|
|
1311
1326
|
this.sortednessChecked = !0;
|
|
1312
|
-
const l =
|
|
1327
|
+
const l = ln(a.series.x, a.series.length);
|
|
1313
1328
|
l >= 0 && G(
|
|
1314
1329
|
"x-unsorted",
|
|
1315
1330
|
`X values are not sorted ascending (index ${l}). Binary search and path building assume sortedness; there is no automatic sorting (R-2.6).`
|
|
@@ -1320,7 +1335,7 @@ class ae {
|
|
|
1320
1335
|
}
|
|
1321
1336
|
/* ================= DOM binding, DPR, resize ================= */
|
|
1322
1337
|
bind(t, e, i, r) {
|
|
1323
|
-
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
|
|
1338
|
+
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 Te(r), this.dpr = typeof devicePixelRatio == "number" ? devicePixelRatio : 1, this.rebindDprWatch(), this.unsubscribeTheme = Se(() => {
|
|
1324
1339
|
var s;
|
|
1325
1340
|
this.theme = null, (s = this.measurer) == null || s.clear(), this.markLayoutDirty();
|
|
1326
1341
|
}), this.theme = null, this.markLayoutDirty();
|
|
@@ -1369,7 +1384,7 @@ class ae {
|
|
|
1369
1384
|
}));
|
|
1370
1385
|
}
|
|
1371
1386
|
frame() {
|
|
1372
|
-
if (this.applyPendingSize(), this.theme === null && this.themeRoot !== null && (this.theme =
|
|
1387
|
+
if (this.applyPendingSize(), this.theme === null && this.themeRoot !== null && (this.theme = Ie(this.themeRoot)), this.cssWidth <= 0 || this.cssHeight <= 0) {
|
|
1373
1388
|
this.layoutDirty && this.pushLayoutSnapshot();
|
|
1374
1389
|
return;
|
|
1375
1390
|
}
|
|
@@ -1399,7 +1414,7 @@ class ae {
|
|
|
1399
1414
|
yAxisId: r.config.yAxisId,
|
|
1400
1415
|
extent: r.extent
|
|
1401
1416
|
}));
|
|
1402
|
-
return
|
|
1417
|
+
return cn(t, e, i, this.limitValues(t, e));
|
|
1403
1418
|
}
|
|
1404
1419
|
/** The values of the limits that are to pull this axis along. */
|
|
1405
1420
|
limitValues(t, e) {
|
|
@@ -1415,12 +1430,12 @@ class ae {
|
|
|
1415
1430
|
mapFor(t) {
|
|
1416
1431
|
const e = t.calendar;
|
|
1417
1432
|
if (!(e === void 0 || e.length === 0))
|
|
1418
|
-
return (i) =>
|
|
1433
|
+
return (i) => De(i, e);
|
|
1419
1434
|
}
|
|
1420
1435
|
gapFor(t) {
|
|
1421
1436
|
const e = t.calendar;
|
|
1422
1437
|
if (!(e === void 0 || e.length === 0))
|
|
1423
|
-
return (i) =>
|
|
1438
|
+
return (i) => $e(i, e);
|
|
1424
1439
|
}
|
|
1425
1440
|
extentFor(t) {
|
|
1426
1441
|
return this.axisExtent(t.orientation, t.id);
|
|
@@ -1444,7 +1459,7 @@ class ae {
|
|
|
1444
1459
|
calendar: o.calendar
|
|
1445
1460
|
});
|
|
1446
1461
|
}
|
|
1447
|
-
this.layout =
|
|
1462
|
+
this.layout = Be({
|
|
1448
1463
|
width: this.cssWidth,
|
|
1449
1464
|
height: this.cssHeight,
|
|
1450
1465
|
padding: this.padding,
|
|
@@ -1575,7 +1590,7 @@ class ae {
|
|
|
1575
1590
|
}
|
|
1576
1591
|
/* ================= Drawing ================= */
|
|
1577
1592
|
drawItems() {
|
|
1578
|
-
const t = [], e = this.seriesInOrder(), i =
|
|
1593
|
+
const t = [], e = this.seriesInOrder(), i = fn(
|
|
1579
1594
|
e.map((r) => ({
|
|
1580
1595
|
order: r.order,
|
|
1581
1596
|
kind: r.config.kind,
|
|
@@ -1605,7 +1620,7 @@ class ae {
|
|
|
1605
1620
|
kind: "line",
|
|
1606
1621
|
strokeWidth: h.strokeWidth,
|
|
1607
1622
|
dash: h.dash,
|
|
1608
|
-
marker: h.markers === "always" || h.markers === "auto" && o.length <=
|
|
1623
|
+
marker: h.markers === "always" || h.markers === "auto" && o.length <= pn
|
|
1609
1624
|
});
|
|
1610
1625
|
break;
|
|
1611
1626
|
case "area":
|
|
@@ -1624,8 +1639,8 @@ class ae {
|
|
|
1624
1639
|
size: 1,
|
|
1625
1640
|
step: r.step ?? 0,
|
|
1626
1641
|
fraction: h.barWidth
|
|
1627
|
-
}, d = a.scale.domain, m =
|
|
1628
|
-
|
|
1642
|
+
}, d = a.scale.domain, m = dn(
|
|
1643
|
+
hn(p.step, d[1] - d[0]),
|
|
1629
1644
|
p.fraction,
|
|
1630
1645
|
p.index,
|
|
1631
1646
|
p.size
|
|
@@ -1655,11 +1670,11 @@ class ae {
|
|
|
1655
1670
|
break;
|
|
1656
1671
|
}
|
|
1657
1672
|
case "matrix": {
|
|
1658
|
-
const p =
|
|
1673
|
+
const p = Nn(h.coloring, this.theme ?? W);
|
|
1659
1674
|
t.push({
|
|
1660
1675
|
...u,
|
|
1661
1676
|
kind: "matrix",
|
|
1662
|
-
buckets:
|
|
1677
|
+
buckets: wn(o, h.coloring, p.length),
|
|
1663
1678
|
colors: p,
|
|
1664
1679
|
width: lt(
|
|
1665
1680
|
r.step ?? 0,
|
|
@@ -1676,11 +1691,11 @@ class ae {
|
|
|
1676
1691
|
t.push({
|
|
1677
1692
|
...u,
|
|
1678
1693
|
kind: "span",
|
|
1679
|
-
x1: o.x1 ??
|
|
1694
|
+
x1: o.x1 ?? yn,
|
|
1680
1695
|
// Computed once per materialisation, not per frame: the calculation
|
|
1681
1696
|
// is quadratic, and a schedule with five hundred spans is pushed and
|
|
1682
1697
|
// pulled like any other chart.
|
|
1683
|
-
depth: r.depth ??
|
|
1698
|
+
depth: r.depth ?? gn,
|
|
1684
1699
|
height: h.height ?? 0.6,
|
|
1685
1700
|
domainEnd: a.scale.domain[1]
|
|
1686
1701
|
});
|
|
@@ -1701,7 +1716,7 @@ class ae {
|
|
|
1701
1716
|
const t = this.seriesCtx, e = this.theme;
|
|
1702
1717
|
if (!t || !e) return;
|
|
1703
1718
|
const i = typeof performance > "u" ? 0 : performance.now();
|
|
1704
|
-
|
|
1719
|
+
tn(t, {
|
|
1705
1720
|
width: this.cssWidth,
|
|
1706
1721
|
height: this.cssHeight,
|
|
1707
1722
|
plot: this.layout.plot,
|
|
@@ -1714,7 +1729,7 @@ class ae {
|
|
|
1714
1729
|
}
|
|
1715
1730
|
drawOverlayLayer() {
|
|
1716
1731
|
const t = this.overlayCtx, e = this.theme;
|
|
1717
|
-
!t || !e || (
|
|
1732
|
+
!t || !e || (en(t, {
|
|
1718
1733
|
width: this.cssWidth,
|
|
1719
1734
|
height: this.cssHeight,
|
|
1720
1735
|
plot: this.layout.plot,
|
|
@@ -1790,7 +1805,7 @@ class ae {
|
|
|
1790
1805
|
// An area is always included: it covers the pointer, otherwise it
|
|
1791
1806
|
// would not have reported a hit at all. Only points have to share the
|
|
1792
1807
|
// x position.
|
|
1793
|
-
(f) => f.areal || Math.abs(f.px - a.px) <=
|
|
1808
|
+
(f) => f.areal || Math.abs(f.px - a.px) <= mn
|
|
1794
1809
|
), c = l.map((f) => ({
|
|
1795
1810
|
seriesName: f.name,
|
|
1796
1811
|
color: f.color,
|
|
@@ -1823,11 +1838,11 @@ class ae {
|
|
|
1823
1838
|
if (l.kind === "state") {
|
|
1824
1839
|
const d = this.lanePx(l, r);
|
|
1825
1840
|
if (s < d.top || s > d.bottom) return null;
|
|
1826
|
-
const m =
|
|
1841
|
+
const m = Ye(e.x, c, o);
|
|
1827
1842
|
if (m < 0) return null;
|
|
1828
1843
|
const y = e.y[m];
|
|
1829
1844
|
if (Number.isNaN(y)) return null;
|
|
1830
|
-
const f = e.x[m], b =
|
|
1845
|
+
const f = e.x[m], b = ae(e.x, c, m, i.scale.domain[1]), k = l.states[y | 0];
|
|
1831
1846
|
return {
|
|
1832
1847
|
index: m,
|
|
1833
1848
|
px: i.scale.toPx(f),
|
|
@@ -1843,7 +1858,7 @@ class ae {
|
|
|
1843
1858
|
if (l.kind === "span") {
|
|
1844
1859
|
const d = e.x1;
|
|
1845
1860
|
if (d === null) return null;
|
|
1846
|
-
const m = i.scale.domain[1], y = l.height ?? 0.6, f =
|
|
1861
|
+
const m = i.scale.domain[1], y = l.height ?? 0.6, f = Ge(
|
|
1847
1862
|
e.x,
|
|
1848
1863
|
d,
|
|
1849
1864
|
e.y,
|
|
@@ -1867,12 +1882,12 @@ class ae {
|
|
|
1867
1882
|
from: b,
|
|
1868
1883
|
to: rt(N, m),
|
|
1869
1884
|
label: "",
|
|
1870
|
-
open:
|
|
1885
|
+
open: le(N)
|
|
1871
1886
|
}
|
|
1872
1887
|
};
|
|
1873
1888
|
}
|
|
1874
1889
|
if (l.kind === "matrix") {
|
|
1875
|
-
const d =
|
|
1890
|
+
const d = rn(
|
|
1876
1891
|
e.x,
|
|
1877
1892
|
e.y,
|
|
1878
1893
|
c,
|
|
@@ -1899,7 +1914,7 @@ class ae {
|
|
|
1899
1914
|
areal: !0
|
|
1900
1915
|
};
|
|
1901
1916
|
}
|
|
1902
|
-
const u =
|
|
1917
|
+
const u = nn(e.x, c, o);
|
|
1903
1918
|
if (u < 0) return null;
|
|
1904
1919
|
const h = e.y[u];
|
|
1905
1920
|
if (Number.isNaN(h)) return null;
|
|
@@ -1953,10 +1968,10 @@ class ae {
|
|
|
1953
1968
|
}
|
|
1954
1969
|
/** Class name of the measuring span for tick labels - keeps the CSS and the
|
|
1955
1970
|
layout in step. */
|
|
1956
|
-
g(
|
|
1957
|
-
const
|
|
1971
|
+
g(ce, "classTick", ut);
|
|
1972
|
+
const ue = be(null);
|
|
1958
1973
|
function Q(n) {
|
|
1959
|
-
const t =
|
|
1974
|
+
const t = xe(ue);
|
|
1960
1975
|
if (t === null && it)
|
|
1961
1976
|
throw new Error(
|
|
1962
1977
|
`@umriss-ui/charts: <${n}> must be used inside a <Chart>.`
|
|
@@ -1974,7 +1989,7 @@ function Z(n, t) {
|
|
|
1974
1989
|
e !== null && i.current !== null && e.updateSeries(i.current, t);
|
|
1975
1990
|
});
|
|
1976
1991
|
}
|
|
1977
|
-
function
|
|
1992
|
+
function he(n, t) {
|
|
1978
1993
|
const e = Q(n), i = X(null);
|
|
1979
1994
|
D(() => {
|
|
1980
1995
|
if (e !== null)
|
|
@@ -1985,7 +2000,7 @@ function ce(n, t) {
|
|
|
1985
2000
|
e !== null && i.current !== null && e.updateAxis(i.current, t);
|
|
1986
2001
|
});
|
|
1987
2002
|
}
|
|
1988
|
-
function
|
|
2003
|
+
function de(n, t) {
|
|
1989
2004
|
const e = Q(n), i = X(null);
|
|
1990
2005
|
D(() => {
|
|
1991
2006
|
if (e !== null)
|
|
@@ -1996,7 +2011,7 @@ function ue(n, t) {
|
|
|
1996
2011
|
e !== null && i.current !== null && e.updateLimit(i.current, t);
|
|
1997
2012
|
});
|
|
1998
2013
|
}
|
|
1999
|
-
function
|
|
2014
|
+
function Sn(n, t) {
|
|
2000
2015
|
const e = Q(n);
|
|
2001
2016
|
D(() => {
|
|
2002
2017
|
if (e !== null)
|
|
@@ -2005,7 +2020,7 @@ function In(n, t) {
|
|
|
2005
2020
|
e == null || e.updateLegend(t);
|
|
2006
2021
|
});
|
|
2007
2022
|
}
|
|
2008
|
-
function
|
|
2023
|
+
function Mn(n, t) {
|
|
2009
2024
|
const e = Q(n);
|
|
2010
2025
|
D(() => {
|
|
2011
2026
|
if (e !== null)
|
|
@@ -2014,7 +2029,7 @@ function Sn(n, t) {
|
|
|
2014
2029
|
e == null || e.updateTooltip(t);
|
|
2015
2030
|
});
|
|
2016
2031
|
}
|
|
2017
|
-
function
|
|
2032
|
+
function Tn(n, t) {
|
|
2018
2033
|
const { band: e, position: i, orientation: r } = n, s = {
|
|
2019
2034
|
left: `${e.x}px`,
|
|
2020
2035
|
top: `${e.y}px`,
|
|
@@ -2101,30 +2116,30 @@ function Mn(n, t) {
|
|
|
2101
2116
|
n.key
|
|
2102
2117
|
);
|
|
2103
2118
|
}
|
|
2104
|
-
function
|
|
2119
|
+
function An({ scene: n }) {
|
|
2105
2120
|
const t = Et(
|
|
2106
2121
|
n.subscribeLayout,
|
|
2107
2122
|
n.getLayoutSnapshot,
|
|
2108
2123
|
n.getLayoutServerSnapshot
|
|
2109
2124
|
), { layout: e } = t;
|
|
2110
2125
|
return e.plot.width <= 0 || e.plot.height <= 0 ? null : /* @__PURE__ */ I("div", { className: "uc-axes", children: e.axes.map(
|
|
2111
|
-
(i) =>
|
|
2126
|
+
(i) => Tn(
|
|
2112
2127
|
i,
|
|
2113
2128
|
t.limits.filter((r) => r.axisKey === i.key)
|
|
2114
2129
|
)
|
|
2115
2130
|
) });
|
|
2116
2131
|
}
|
|
2117
|
-
function
|
|
2132
|
+
function Ln(n) {
|
|
2118
2133
|
var e;
|
|
2119
2134
|
const t = (e = n.segment) == null ? void 0 : e.label;
|
|
2120
2135
|
return t !== void 0 && t !== "" ? t : n.value !== void 0 ? Bt(n.value) : Bt(n.yValue);
|
|
2121
2136
|
}
|
|
2122
|
-
function
|
|
2137
|
+
function Fn({ scene: n }) {
|
|
2123
2138
|
const t = Et(
|
|
2124
2139
|
n.subscribeHover,
|
|
2125
2140
|
n.getHoverSnapshot,
|
|
2126
2141
|
n.getHoverServerSnapshot
|
|
2127
|
-
), e =
|
|
2142
|
+
), e = ve(
|
|
2128
2143
|
(r) => {
|
|
2129
2144
|
n.bindTooltip(r);
|
|
2130
2145
|
},
|
|
@@ -2139,11 +2154,11 @@ function Ln({ scene: n }) {
|
|
|
2139
2154
|
/* @__PURE__ */ I("div", { className: "uc-tooltip-list", children: i.hit.points.map((r) => /* @__PURE__ */ _("div", { className: "uc-tooltip-row", children: [
|
|
2140
2155
|
/* @__PURE__ */ I("span", { className: "uc-tooltip-chip", style: { background: r.color } }),
|
|
2141
2156
|
/* @__PURE__ */ I("span", { className: "uc-tooltip-name", children: r.seriesName }),
|
|
2142
|
-
/* @__PURE__ */ I("span", { className: "uc-tooltip-value", children:
|
|
2157
|
+
/* @__PURE__ */ I("span", { className: "uc-tooltip-value", children: Ln(r) })
|
|
2143
2158
|
] }, `${r.seriesName}-${r.index}`)) })
|
|
2144
2159
|
] }) });
|
|
2145
2160
|
}
|
|
2146
|
-
function
|
|
2161
|
+
function Jn(n) {
|
|
2147
2162
|
const {
|
|
2148
2163
|
data: t,
|
|
2149
2164
|
width: e = "100%",
|
|
@@ -2154,7 +2169,7 @@ function Zn(n) {
|
|
|
2154
2169
|
style: a,
|
|
2155
2170
|
onPerf: l,
|
|
2156
2171
|
children: c
|
|
2157
|
-
} = n, [u] =
|
|
2172
|
+
} = n, [u] = ke(() => new ce()), h = X(null), p = X(null), d = X(null), m = X(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), N = f ?? (y == null ? void 0 : y.bottom), w = f ?? (y == null ? void 0 : y.left), L = E(
|
|
2158
2173
|
() => ({
|
|
2159
2174
|
top: b ?? 8,
|
|
2160
2175
|
right: k ?? 8,
|
|
@@ -2200,7 +2215,7 @@ function Zn(n) {
|
|
|
2200
2215
|
}, P = (S) => {
|
|
2201
2216
|
u.pointerMove(S.nativeEvent.offsetX, S.nativeEvent.offsetY);
|
|
2202
2217
|
};
|
|
2203
|
-
return /* @__PURE__ */ I(
|
|
2218
|
+
return /* @__PURE__ */ I(ue.Provider, { value: u, children: /* @__PURE__ */ _(
|
|
2204
2219
|
"div",
|
|
2205
2220
|
{
|
|
2206
2221
|
ref: h,
|
|
@@ -2219,8 +2234,8 @@ function Zn(n) {
|
|
|
2219
2234
|
children: [
|
|
2220
2235
|
/* @__PURE__ */ I("canvas", { ref: d, className: "uc-layer-series", "aria-hidden": "true" }),
|
|
2221
2236
|
/* @__PURE__ */ I("canvas", { ref: m, className: "uc-layer-overlay", "aria-hidden": "true" }),
|
|
2222
|
-
/* @__PURE__ */ I(
|
|
2223
|
-
/* @__PURE__ */ I(
|
|
2237
|
+
/* @__PURE__ */ I(An, { scene: u }),
|
|
2238
|
+
/* @__PURE__ */ I(Fn, { scene: u })
|
|
2224
2239
|
]
|
|
2225
2240
|
}
|
|
2226
2241
|
),
|
|
@@ -2229,7 +2244,7 @@ function Zn(n) {
|
|
|
2229
2244
|
}
|
|
2230
2245
|
) });
|
|
2231
2246
|
}
|
|
2232
|
-
function
|
|
2247
|
+
function Qn(n) {
|
|
2233
2248
|
const {
|
|
2234
2249
|
accessor: t,
|
|
2235
2250
|
baseline: e,
|
|
@@ -2257,7 +2272,7 @@ function Jn(n) {
|
|
|
2257
2272
|
);
|
|
2258
2273
|
return Z("Area", u), null;
|
|
2259
2274
|
}
|
|
2260
|
-
function
|
|
2275
|
+
function ti(n) {
|
|
2261
2276
|
const {
|
|
2262
2277
|
accessor: t,
|
|
2263
2278
|
xAxisId: e = "x",
|
|
@@ -2281,7 +2296,7 @@ function jn(n) {
|
|
|
2281
2296
|
);
|
|
2282
2297
|
return Z("Bar", l), null;
|
|
2283
2298
|
}
|
|
2284
|
-
function
|
|
2299
|
+
function Pn(n) {
|
|
2285
2300
|
const {
|
|
2286
2301
|
accessor: t,
|
|
2287
2302
|
xAxisId: e = "x",
|
|
@@ -2311,7 +2326,7 @@ function Fn(n) {
|
|
|
2311
2326
|
);
|
|
2312
2327
|
return Z("Line", h), null;
|
|
2313
2328
|
}
|
|
2314
|
-
function
|
|
2329
|
+
function En(n) {
|
|
2315
2330
|
const {
|
|
2316
2331
|
accessor: t,
|
|
2317
2332
|
xAxisId: e = "x",
|
|
@@ -2337,7 +2352,7 @@ function Pn(n) {
|
|
|
2337
2352
|
);
|
|
2338
2353
|
return Z("Scatter", c), null;
|
|
2339
2354
|
}
|
|
2340
|
-
function
|
|
2355
|
+
function ei(n) {
|
|
2341
2356
|
const {
|
|
2342
2357
|
accessor: t,
|
|
2343
2358
|
states: e,
|
|
@@ -2363,7 +2378,7 @@ function Qn(n) {
|
|
|
2363
2378
|
);
|
|
2364
2379
|
return Z("StateBand", c), null;
|
|
2365
2380
|
}
|
|
2366
|
-
const
|
|
2381
|
+
const Dn = [
|
|
2367
2382
|
"#eef2ff",
|
|
2368
2383
|
"#c7d2fe",
|
|
2369
2384
|
"#a5b4fc",
|
|
@@ -2372,7 +2387,7 @@ const En = [
|
|
|
2372
2387
|
"#4f46e5",
|
|
2373
2388
|
"#4338ca"
|
|
2374
2389
|
];
|
|
2375
|
-
function
|
|
2390
|
+
function ni(n) {
|
|
2376
2391
|
const {
|
|
2377
2392
|
accessor: t,
|
|
2378
2393
|
value: e,
|
|
@@ -2382,7 +2397,7 @@ function ti(n) {
|
|
|
2382
2397
|
data: o,
|
|
2383
2398
|
name: a
|
|
2384
2399
|
} = n, l = E(
|
|
2385
|
-
() => i ?? { kind: "gradient", stops:
|
|
2400
|
+
() => i ?? { kind: "gradient", stops: Dn },
|
|
2386
2401
|
[i]
|
|
2387
2402
|
), c = E(
|
|
2388
2403
|
() => ({
|
|
@@ -2399,7 +2414,7 @@ function ti(n) {
|
|
|
2399
2414
|
);
|
|
2400
2415
|
return Z("Matrix", c), null;
|
|
2401
2416
|
}
|
|
2402
|
-
function
|
|
2417
|
+
function ii(n) {
|
|
2403
2418
|
const {
|
|
2404
2419
|
accessor: t,
|
|
2405
2420
|
to: e,
|
|
@@ -2449,9 +2464,9 @@ function nt(n) {
|
|
|
2449
2464
|
}),
|
|
2450
2465
|
[t, e, i, r, l, s, o, a]
|
|
2451
2466
|
);
|
|
2452
|
-
return
|
|
2467
|
+
return de("LimitLine", c), null;
|
|
2453
2468
|
}
|
|
2454
|
-
function
|
|
2469
|
+
function ri(n) {
|
|
2455
2470
|
const {
|
|
2456
2471
|
from: t,
|
|
2457
2472
|
to: e,
|
|
@@ -2477,9 +2492,9 @@ function ni(n) {
|
|
|
2477
2492
|
}),
|
|
2478
2493
|
[t, e, i, r, s, c, o, a, l]
|
|
2479
2494
|
);
|
|
2480
|
-
return
|
|
2495
|
+
return de("LimitBand", u), null;
|
|
2481
2496
|
}
|
|
2482
|
-
const
|
|
2497
|
+
const $n = 1.128;
|
|
2483
2498
|
function kt(n, t) {
|
|
2484
2499
|
return {
|
|
2485
2500
|
center: n,
|
|
@@ -2488,10 +2503,10 @@ function kt(n, t) {
|
|
|
2488
2503
|
lower: n - 3 * t
|
|
2489
2504
|
};
|
|
2490
2505
|
}
|
|
2491
|
-
function
|
|
2506
|
+
function si(n, t) {
|
|
2492
2507
|
return (t - n) / 3;
|
|
2493
2508
|
}
|
|
2494
|
-
function
|
|
2509
|
+
function Cn(n, t) {
|
|
2495
2510
|
if (t.kind === "given")
|
|
2496
2511
|
return kt(t.center, t.sigma);
|
|
2497
2512
|
const e = Math.max(0, Math.trunc(t.from)), i = Math.min(n.length, Math.trunc(t.to));
|
|
@@ -2505,20 +2520,20 @@ function $n(n, t) {
|
|
|
2505
2520
|
r += h, s++, Number.isFinite(l) && (o += Math.abs(h - l), a++), l = h;
|
|
2506
2521
|
}
|
|
2507
2522
|
if (s === 0) return kt(Number.NaN, Number.NaN);
|
|
2508
|
-
const c = a === 0 ? 0 : o / a /
|
|
2523
|
+
const c = a === 0 ? 0 : o / a / $n;
|
|
2509
2524
|
return kt(r / s, c);
|
|
2510
2525
|
}
|
|
2511
|
-
function
|
|
2526
|
+
function Wn(n, t = [1, 2]) {
|
|
2512
2527
|
return t.map((e) => ({
|
|
2513
2528
|
k: e,
|
|
2514
2529
|
upper: n.center + e * n.sigma,
|
|
2515
2530
|
lower: n.center - e * n.sigma
|
|
2516
2531
|
}));
|
|
2517
2532
|
}
|
|
2518
|
-
function
|
|
2533
|
+
function On(n, t) {
|
|
2519
2534
|
return Number.isFinite(n) ? n > t ? 1 : n < t ? -1 : 0 : 0;
|
|
2520
2535
|
}
|
|
2521
|
-
function
|
|
2536
|
+
function fe(n, t) {
|
|
2522
2537
|
const e = [];
|
|
2523
2538
|
if (t < 1) return e;
|
|
2524
2539
|
let i = 0;
|
|
@@ -2540,7 +2555,7 @@ const $t = {
|
|
|
2540
2555
|
runLength: 9,
|
|
2541
2556
|
trendLength: 6
|
|
2542
2557
|
};
|
|
2543
|
-
function
|
|
2558
|
+
function Hn(n, t) {
|
|
2544
2559
|
const e = [];
|
|
2545
2560
|
for (let i = 0; i < n.length; i++) {
|
|
2546
2561
|
const r = n[i];
|
|
@@ -2548,24 +2563,24 @@ function On(n, t) {
|
|
|
2548
2563
|
}
|
|
2549
2564
|
return e;
|
|
2550
2565
|
}
|
|
2551
|
-
function
|
|
2552
|
-
return
|
|
2553
|
-
n.map((i) =>
|
|
2566
|
+
function Rn(n, t, e = $t.runLength) {
|
|
2567
|
+
return fe(
|
|
2568
|
+
n.map((i) => On(i, t.center)),
|
|
2554
2569
|
e
|
|
2555
2570
|
);
|
|
2556
2571
|
}
|
|
2557
|
-
function
|
|
2572
|
+
function Vn(n, t = $t.trendLength) {
|
|
2558
2573
|
const e = [];
|
|
2559
2574
|
for (let r = 1; r < n.length; r++) {
|
|
2560
2575
|
const s = n[r - 1], o = n[r];
|
|
2561
2576
|
e.push(Number.isFinite(s) && Number.isFinite(o) ? Math.sign(o - s) : 0);
|
|
2562
2577
|
}
|
|
2563
2578
|
const i = [];
|
|
2564
|
-
for (const r of
|
|
2579
|
+
for (const r of fe(e, Math.max(1, t - 1)))
|
|
2565
2580
|
i[i.length - 1] !== r && i.push(r), i.push(r + 1);
|
|
2566
2581
|
return i;
|
|
2567
2582
|
}
|
|
2568
|
-
function
|
|
2583
|
+
function _n(n, t) {
|
|
2569
2584
|
const e = t.center + 2 * t.sigma, i = t.center - 2 * t.sigma, r = /* @__PURE__ */ new Set();
|
|
2570
2585
|
for (let s = 0; s + 2 < n.length; s++)
|
|
2571
2586
|
for (const o of [
|
|
@@ -2575,18 +2590,18 @@ function Vn(n, t) {
|
|
|
2575
2590
|
if (o.length >= 2) for (const a of o) r.add(a);
|
|
2576
2591
|
return [...r].sort((s, o) => s - o);
|
|
2577
2592
|
}
|
|
2578
|
-
function
|
|
2593
|
+
function Bn(n, t, e = {}) {
|
|
2579
2594
|
const i = { ...$t, ...e }, r = [], s = (o, a) => {
|
|
2580
2595
|
a.length > 0 && r.push({ rule: o, indices: a });
|
|
2581
2596
|
};
|
|
2582
|
-
return i.outlier && s("outlier",
|
|
2597
|
+
return i.outlier && s("outlier", Hn(n, t)), i.run && s("run", Rn(n, t, i.runLength)), i.trend && s("trend", Vn(n, i.trendLength)), i.twoOfThree && s("twoOfThree", _n(n, t)), r;
|
|
2583
2598
|
}
|
|
2584
|
-
function
|
|
2599
|
+
function Yn(n) {
|
|
2585
2600
|
const t = /* @__PURE__ */ new Set();
|
|
2586
2601
|
for (const e of n) for (const i of e.indices) t.add(i);
|
|
2587
2602
|
return [...t].sort((e, i) => e - i);
|
|
2588
2603
|
}
|
|
2589
|
-
function
|
|
2604
|
+
function oi(n) {
|
|
2590
2605
|
const {
|
|
2591
2606
|
accessor: t,
|
|
2592
2607
|
data: e,
|
|
@@ -2608,10 +2623,10 @@ function ri(n) {
|
|
|
2608
2623
|
F.push(S ?? Number.NaN);
|
|
2609
2624
|
}
|
|
2610
2625
|
return F;
|
|
2611
|
-
}, [e, t]), y = E(() =>
|
|
2612
|
-
() =>
|
|
2626
|
+
}, [e, t]), y = E(() => Cn(m, i), [m, i]), f = E(
|
|
2627
|
+
() => Bn(m, y, l ?? {}),
|
|
2613
2628
|
[m, y, l]
|
|
2614
|
-
), b = E(() => new Set(
|
|
2629
|
+
), b = E(() => new Set(Yn(f)), [f]);
|
|
2615
2630
|
D(() => {
|
|
2616
2631
|
d == null || d(f);
|
|
2617
2632
|
}, [f, d]);
|
|
@@ -2622,11 +2637,11 @@ function ri(n) {
|
|
|
2622
2637
|
() => b.size === 0 ? e : e.slice(),
|
|
2623
2638
|
[e, b]
|
|
2624
2639
|
), w = E(
|
|
2625
|
-
() => c ?
|
|
2640
|
+
() => c ? Wn(y, [1, 2]) : [],
|
|
2626
2641
|
[c, y]
|
|
2627
2642
|
), L = Number.isFinite(y.center);
|
|
2628
2643
|
return /* @__PURE__ */ _(Nt, { children: [
|
|
2629
|
-
/* @__PURE__ */ I(
|
|
2644
|
+
/* @__PURE__ */ I(Pn, { accessor: t, data: e, xAxisId: r, yAxisId: s, name: o, color: a }),
|
|
2630
2645
|
L && /* @__PURE__ */ _(Nt, { children: [
|
|
2631
2646
|
w.map((F) => /* @__PURE__ */ I(
|
|
2632
2647
|
nt,
|
|
@@ -2653,7 +2668,7 @@ function ri(n) {
|
|
|
2653
2668
|
/* @__PURE__ */ I(nt, { value: y.lower, axisId: s, role: "control", label: h })
|
|
2654
2669
|
] }),
|
|
2655
2670
|
/* @__PURE__ */ I(
|
|
2656
|
-
|
|
2671
|
+
En,
|
|
2657
2672
|
{
|
|
2658
2673
|
accessor: k,
|
|
2659
2674
|
data: N,
|
|
@@ -2666,7 +2681,7 @@ function ri(n) {
|
|
|
2666
2681
|
)
|
|
2667
2682
|
] });
|
|
2668
2683
|
}
|
|
2669
|
-
function
|
|
2684
|
+
function ai(n) {
|
|
2670
2685
|
const {
|
|
2671
2686
|
id: t = "x",
|
|
2672
2687
|
position: e = "bottom",
|
|
@@ -2694,9 +2709,9 @@ function si(n) {
|
|
|
2694
2709
|
}),
|
|
2695
2710
|
[t, e, i, r, s, o, a, l, c, u]
|
|
2696
2711
|
);
|
|
2697
|
-
return
|
|
2712
|
+
return he("XAxis", h), null;
|
|
2698
2713
|
}
|
|
2699
|
-
function
|
|
2714
|
+
function li(n) {
|
|
2700
2715
|
const {
|
|
2701
2716
|
id: t = "y",
|
|
2702
2717
|
position: e = "left",
|
|
@@ -2722,13 +2737,13 @@ function oi(n) {
|
|
|
2722
2737
|
}),
|
|
2723
2738
|
[t, e, i, r, s, o, a, l, c]
|
|
2724
2739
|
);
|
|
2725
|
-
return
|
|
2740
|
+
return he("YAxis", u), null;
|
|
2726
2741
|
}
|
|
2727
|
-
function
|
|
2742
|
+
function zn({
|
|
2728
2743
|
scene: n,
|
|
2729
2744
|
placement: t
|
|
2730
2745
|
}) {
|
|
2731
|
-
|
|
2746
|
+
Sn("Legend", { placement: t });
|
|
2732
2747
|
const e = Et(
|
|
2733
2748
|
n.subscribeLayout,
|
|
2734
2749
|
n.getLayoutSnapshot,
|
|
@@ -2748,23 +2763,23 @@ function Yn({
|
|
|
2748
2763
|
i.id
|
|
2749
2764
|
)) });
|
|
2750
2765
|
}
|
|
2751
|
-
function
|
|
2766
|
+
function ci({ placement: n = "top" }) {
|
|
2752
2767
|
const t = Q("Legend");
|
|
2753
|
-
return t === null ? null : /* @__PURE__ */ I(
|
|
2768
|
+
return t === null ? null : /* @__PURE__ */ I(zn, { scene: t, placement: n });
|
|
2754
2769
|
}
|
|
2755
|
-
function
|
|
2770
|
+
function ui(n) {
|
|
2756
2771
|
const { mode: t = "x", render: e } = n, i = E(
|
|
2757
2772
|
() => ({ mode: t, render: e }),
|
|
2758
2773
|
[t, e]
|
|
2759
2774
|
);
|
|
2760
|
-
return
|
|
2775
|
+
return Mn("Tooltip", i), null;
|
|
2761
2776
|
}
|
|
2762
|
-
const
|
|
2777
|
+
const Gn = {
|
|
2763
2778
|
cutoff: 0.8,
|
|
2764
2779
|
collectRank: Number.POSITIVE_INFINITY
|
|
2765
2780
|
};
|
|
2766
|
-
function
|
|
2767
|
-
const e = { ...
|
|
2781
|
+
function hi(n, t = {}) {
|
|
2782
|
+
const e = { ...Gn, ...t };
|
|
2768
2783
|
ct(
|
|
2769
2784
|
!Number.isFinite(e.collectRank) || e.remainderName !== void 0,
|
|
2770
2785
|
"pareto: a collect rank needs `remainderName` - the package brings no name for the remainder."
|
|
@@ -2786,50 +2801,53 @@ function ci(n, t = {}) {
|
|
|
2786
2801
|
return { entries: c, total: l, cutoffIndex: p };
|
|
2787
2802
|
}
|
|
2788
2803
|
export {
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2804
|
+
Qn as Area,
|
|
2805
|
+
ti as Bar,
|
|
2806
|
+
Jn as Chart,
|
|
2807
|
+
oi as ControlChart,
|
|
2793
2808
|
U as DAY,
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2809
|
+
Dn as DEFAULT_GRADIENT,
|
|
2810
|
+
J as HOUR,
|
|
2811
|
+
ci as Legend,
|
|
2812
|
+
ri as LimitBand,
|
|
2798
2813
|
nt as LimitLine,
|
|
2799
|
-
|
|
2814
|
+
Pn as Line,
|
|
2800
2815
|
_t as LinearScale,
|
|
2801
2816
|
K as MINUTE,
|
|
2802
|
-
|
|
2817
|
+
ni as Matrix,
|
|
2803
2818
|
q as SECOND,
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2819
|
+
En as Scatter,
|
|
2820
|
+
ii as Span,
|
|
2821
|
+
ei as StateBand,
|
|
2822
|
+
ui as Tooltip,
|
|
2823
|
+
ai as XAxis,
|
|
2824
|
+
li as YAxis,
|
|
2825
|
+
on as assess,
|
|
2826
|
+
We as breaks,
|
|
2812
2827
|
z as calendarFrom,
|
|
2813
|
-
|
|
2828
|
+
Cn as controlLimits,
|
|
2814
2829
|
$t as defaultRules,
|
|
2815
2830
|
Rt as invalidateTheme,
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
Hn as
|
|
2825
|
-
Rn as
|
|
2826
|
-
Vn as
|
|
2827
|
-
|
|
2828
|
-
|
|
2831
|
+
Zn as mapSeries,
|
|
2832
|
+
Pe as operatingCalendar,
|
|
2833
|
+
Re as operatingTicks,
|
|
2834
|
+
He as operatingTimeTicks,
|
|
2835
|
+
hi as pareto,
|
|
2836
|
+
Gn as paretoDefaults,
|
|
2837
|
+
Ce as removedIntervals,
|
|
2838
|
+
Xn as resolveColours,
|
|
2839
|
+
Hn as ruleOutlier,
|
|
2840
|
+
Rn as ruleRun,
|
|
2841
|
+
Vn as ruleTrend,
|
|
2842
|
+
_n as ruleTwoOfThree,
|
|
2843
|
+
si as sigmaFromLimit,
|
|
2844
|
+
Se as subscribeTheme,
|
|
2845
|
+
Oe as timeStep,
|
|
2829
2846
|
pt as toOperatingTime,
|
|
2847
|
+
De as toOperatingTimeClamped,
|
|
2830
2848
|
dt as toWallClock,
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2849
|
+
jn as verdictWeight,
|
|
2850
|
+
Yn as violatedIndices,
|
|
2851
|
+
Bn as violations,
|
|
2852
|
+
Wn as zones
|
|
2835
2853
|
};
|