@umriss-ui/charts 0.15.0 → 0.16.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 +21 -0
- package/README.md +10 -4
- package/dist/charts.js +735 -717
- package/dist/wording/de.js +1 -0
- package/docs/llms-full.md +53 -19
- package/package.json +2 -2
package/dist/charts.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import "./charts.css";
|
|
2
3
|
var ui = Object.defineProperty;
|
|
3
4
|
var hi = (s, t, e) => t in s ? ui(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
@@ -9,14 +10,14 @@ function gi() {
|
|
|
9
10
|
const s = import.meta;
|
|
10
11
|
return typeof ((t = s.env) == null ? void 0 : t.DEV) == "boolean" ? s.env.DEV : typeof process < "u" && (process != null && process.env) ? process.env.NODE_ENV !== "production" : !1;
|
|
11
12
|
}
|
|
12
|
-
const
|
|
13
|
+
const pt = gi();
|
|
13
14
|
function bt(s, t) {
|
|
14
|
-
if (
|
|
15
|
+
if (pt && !s)
|
|
15
16
|
throw new Error(`@umriss-ui/charts: ${t}`);
|
|
16
17
|
}
|
|
17
18
|
const Ge = /* @__PURE__ */ new Set();
|
|
18
19
|
function G(s, t) {
|
|
19
|
-
!
|
|
20
|
+
!pt || Ge.has(s) || (Ge.add(s), console.warn(`@umriss-ui/charts: ${t}`));
|
|
20
21
|
}
|
|
21
22
|
const U = {
|
|
22
23
|
colorAxis: "rgba(23, 23, 23, 0.17)",
|
|
@@ -207,28 +208,28 @@ function Wn(s, t, e) {
|
|
|
207
208
|
if (s === t) return [ue(s)];
|
|
208
209
|
const [n, i] = s < t ? [s, t] : [t, s], o = vt(i - n, e), r = Mt(o), l = o * 1e-9, a = Math.ceil((n - l) / o), c = Math.floor((i + l) / o);
|
|
209
210
|
if (!Number.isFinite(a) || !Number.isFinite(c)) return [];
|
|
210
|
-
const
|
|
211
|
-
for (let
|
|
212
|
-
|
|
213
|
-
return
|
|
211
|
+
const h = [];
|
|
212
|
+
for (let m = a; m <= c; m++)
|
|
213
|
+
h.push(he(m * o, r));
|
|
214
|
+
return h;
|
|
214
215
|
}
|
|
215
216
|
function Ti(s, t, e, n) {
|
|
216
217
|
const i = n.length, o = n[0], r = n[i - 1];
|
|
217
218
|
if (i < 2 || o === void 0 || r === void 0 || !Number.isFinite(s) || !Number.isFinite(t))
|
|
218
219
|
return null;
|
|
219
|
-
const [l, a] = s === t ? [s - 1, t + 1] : [s, t], c = (r - o) / (i - 1),
|
|
220
|
-
let
|
|
221
|
-
for (let
|
|
222
|
-
const
|
|
223
|
-
if (b +
|
|
224
|
-
const w = Mt(
|
|
220
|
+
const [l, a] = s === t ? [s - 1, t + 1] : [s, t], c = (r - o) / (i - 1), h = (o - e[0]) / c, m = (e[1] - r) / c, p = i - 1 + h + m, d = (u) => ue(Number(u.toPrecision(12)));
|
|
221
|
+
let f = vt((a - l) / p, 1);
|
|
222
|
+
for (let u = 0; u < 64; u++) {
|
|
223
|
+
const g = f * 1e-9, y = Math.floor((l + h * f + g) / f) * f, b = y - h * f;
|
|
224
|
+
if (b + p * f >= a - g) {
|
|
225
|
+
const w = Mt(f);
|
|
225
226
|
return {
|
|
226
|
-
domain: [
|
|
227
|
-
ticks: Array.from({ length: i }, (N,
|
|
228
|
-
step:
|
|
227
|
+
domain: [d(b), d(b + p * f)],
|
|
228
|
+
ticks: Array.from({ length: i }, (N, L) => he(y + L * f, w)),
|
|
229
|
+
step: f
|
|
229
230
|
};
|
|
230
231
|
}
|
|
231
|
-
|
|
232
|
+
f = vt(f * 1.5, 1);
|
|
232
233
|
}
|
|
233
234
|
return null;
|
|
234
235
|
}
|
|
@@ -278,7 +279,7 @@ function Pt(s) {
|
|
|
278
279
|
let n = de.get(e);
|
|
279
280
|
return n === void 0 && (n = new Intl.NumberFormat(t, { maximumFractionDigits: 3, useGrouping: !0 }), de.set(e, n)), n.format(s);
|
|
280
281
|
}
|
|
281
|
-
const kt = 1e3,
|
|
282
|
+
const kt = 1e3, it = 60 * kt, Nt = 60 * it, ct = 24 * Nt;
|
|
282
283
|
function Mi(s) {
|
|
283
284
|
const t = s.filter((o) => Number.isFinite(o.from) && Number.isFinite(o.to) && o.to > o.from).sort((o, r) => o.from - r.from), e = [];
|
|
284
285
|
for (const o of t) {
|
|
@@ -368,12 +369,12 @@ const Ze = [
|
|
|
368
369
|
10 * kt,
|
|
369
370
|
15 * kt,
|
|
370
371
|
30 * kt,
|
|
371
|
-
|
|
372
|
-
2 *
|
|
373
|
-
5 *
|
|
374
|
-
10 *
|
|
375
|
-
15 *
|
|
376
|
-
30 *
|
|
372
|
+
it,
|
|
373
|
+
2 * it,
|
|
374
|
+
5 * it,
|
|
375
|
+
10 * it,
|
|
376
|
+
15 * it,
|
|
377
|
+
30 * it,
|
|
377
378
|
Nt,
|
|
378
379
|
2 * Nt,
|
|
379
380
|
3 * Nt,
|
|
@@ -393,7 +394,7 @@ function Oi(s, t) {
|
|
|
393
394
|
return ct * vt(n / ct, 1);
|
|
394
395
|
}
|
|
395
396
|
function dr(s) {
|
|
396
|
-
return new Date(s).getTimezoneOffset() *
|
|
397
|
+
return new Date(s).getTimezoneOffset() * it;
|
|
397
398
|
}
|
|
398
399
|
function Pi(s, t, e, n, i = 0) {
|
|
399
400
|
const o = gt(s), r = [];
|
|
@@ -401,9 +402,9 @@ function Pi(s, t, e, n, i = 0) {
|
|
|
401
402
|
const l = Math.ceil((t - i) / n), a = Math.floor((e - i) / n);
|
|
402
403
|
if (!Number.isFinite(l) || !Number.isFinite(a)) return r;
|
|
403
404
|
let c = Number.NaN;
|
|
404
|
-
for (let
|
|
405
|
-
const
|
|
406
|
-
Number.isNaN(
|
|
405
|
+
for (let h = l; h <= a; h++) {
|
|
406
|
+
const m = i + h * n, p = Lt(m, o);
|
|
407
|
+
Number.isNaN(p) || p === c || (r.push({ wallClock: m, workingTime: p }), c = p);
|
|
407
408
|
}
|
|
408
409
|
return r;
|
|
409
410
|
}
|
|
@@ -417,10 +418,10 @@ function fr(s, t, e, n, i = 0) {
|
|
|
417
418
|
Dt(l, o),
|
|
418
419
|
a,
|
|
419
420
|
i
|
|
420
|
-
).map((
|
|
421
|
+
).map((h) => h.workingTime).filter((h) => h >= t && h <= e);
|
|
421
422
|
}
|
|
422
423
|
const Je = 365 * ct, Ci = [
|
|
423
|
-
...[1, 2, 5, 10, 15, 30].map((s) => ({ unit: "minute", n: s, ms: s *
|
|
424
|
+
...[1, 2, 5, 10, 15, 30].map((s) => ({ unit: "minute", n: s, ms: s * it })),
|
|
424
425
|
...[1, 2, 3, 6, 12].map((s) => ({ unit: "hour", n: s, ms: s * Nt })),
|
|
425
426
|
...[1, 2, 7, 14].map((s) => ({ unit: "day", n: s, ms: s * ct })),
|
|
426
427
|
...[1, 2, 3, 6].map((s) => ({ unit: "month", n: s, ms: s * 30 * ct }))
|
|
@@ -501,7 +502,7 @@ function xe(s) {
|
|
|
501
502
|
return s.calendar !== void 0 && s.calendar.length > 0 ? s.calendar : void 0;
|
|
502
503
|
}
|
|
503
504
|
function Yn(s) {
|
|
504
|
-
return s[1] - s[0] >=
|
|
505
|
+
return s[1] - s[0] >= it;
|
|
505
506
|
}
|
|
506
507
|
function me(s, t) {
|
|
507
508
|
return Hi(s[1] - s[0], t);
|
|
@@ -581,7 +582,7 @@ function qi(s, t) {
|
|
|
581
582
|
const r = n[n.length - 1], l = n[n.length - 2];
|
|
582
583
|
if (l === void 0 || l.start + l.members.length * t <= r.start) break;
|
|
583
584
|
n.pop(), l.members.push(...r.members);
|
|
584
|
-
const a = l.members.reduce((c,
|
|
585
|
+
const a = l.members.reduce((c, h) => c + s[h], 0) / l.members.length;
|
|
585
586
|
l.start = a - (l.members.length - 1) * t / 2;
|
|
586
587
|
}
|
|
587
588
|
const i = s.slice();
|
|
@@ -597,48 +598,48 @@ function Xi(s) {
|
|
|
597
598
|
return ln(s, s.hysteresis, e.wrapped).layout;
|
|
598
599
|
}
|
|
599
600
|
function ln(s, t, e) {
|
|
600
|
-
const { width: n, height: i, padding: o, axes: r, measure: l } = s, a = /* @__PURE__ */ new Set(), c = r.filter((A) => A.position === "left"),
|
|
601
|
-
for (const A of [...
|
|
601
|
+
const { width: n, height: i, padding: o, axes: r, measure: l } = s, a = /* @__PURE__ */ new Set(), c = r.filter((A) => A.position === "left"), h = r.filter((A) => A.position === "right"), m = r.filter((A) => A.position === "top"), p = r.filter((A) => A.position === "bottom"), d = Math.ceil(l("0", It).height) || 14, f = /* @__PURE__ */ new Map();
|
|
602
|
+
for (const A of [...m, ...p]) {
|
|
602
603
|
const S = A.label === void 0 || A.label === "" ? 0 : Math.ceil(l(A.label, Xt).height) + en, k = (e == null ? void 0 : e.has(A.key)) === !0 ? 2 : 1;
|
|
603
|
-
|
|
604
|
+
f.set(A.key, nn(A.key, ie + se + k * d + S, t));
|
|
604
605
|
}
|
|
605
|
-
const
|
|
606
|
+
const u = (A, S) => {
|
|
606
607
|
let k = 0;
|
|
607
|
-
for (let
|
|
608
|
-
const R = A[
|
|
609
|
-
R !== void 0 && (k += S.get(R.key) ?? 0,
|
|
608
|
+
for (let D = 0; D < A.length; D++) {
|
|
609
|
+
const R = A[D];
|
|
610
|
+
R !== void 0 && (k += S.get(R.key) ?? 0, D > 0 && (k += ke));
|
|
610
611
|
}
|
|
611
612
|
return k;
|
|
612
|
-
},
|
|
613
|
-
for (const A of [...c, ...
|
|
614
|
-
const S = A.tickCount ?? Math.max(2, Math.round(b / 50)), k =
|
|
613
|
+
}, g = o.top + u(m, f), y = i - o.bottom - u(p, f), b = Math.max(0, y - g), w = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), L = r.find((A) => A.orientation === "y");
|
|
614
|
+
for (const A of [...c, ...h].sort((S, k) => S === L ? -1 : k === L ? 1 : 0)) {
|
|
615
|
+
const S = A.tickCount ?? Math.max(2, Math.round(b / 50)), k = L === void 0 ? void 0 : w.get(L.key), [D, R] = Array.isArray(A.domainMode) ? jt(A, S) : A.extent, T = A.alignTicks === !0 && A !== L && k !== void 0 ? Ti(D, R, k.domain, k.values) : null, V = (T == null ? void 0 : T.domain) ?? jt(A, S), _ = (T == null ? void 0 : T.ticks) ?? sn(A, V, S), Z = T === null ? on(A, V, S) : A.tickFormat ?? ((O) => Vn(O, T.step)), $ = rn(A, V, S, _, Z), Y = $.map((O) => l(O, It).width);
|
|
615
616
|
let H = 0;
|
|
616
617
|
for (const O of Y) O > H && (H = O);
|
|
617
618
|
let P = 0;
|
|
618
619
|
for (const O of A.limitLabels ?? []) P = Math.max(P, l(O, It).width + 4);
|
|
619
|
-
const
|
|
620
|
-
|
|
620
|
+
const ot = A.label === void 0 || A.label === "" ? 0 : Math.ceil(l(A.label, Xt).height) + en, rt = P > H && ie + se + P + ot > n * Gi;
|
|
621
|
+
rt || (H = Math.max(H, P)), w.set(A.key, { axis: A, domain: V, values: _, labels: $, widths: Y, format: Z, limitsInside: rt }), N.set(
|
|
621
622
|
A.key,
|
|
622
|
-
nn(A.key, ie + se + H +
|
|
623
|
+
nn(A.key, ie + se + H + ot, t)
|
|
623
624
|
);
|
|
624
625
|
}
|
|
625
|
-
const F = o.left +
|
|
626
|
+
const F = o.left + u(c, N), I = n - o.right - u(h, N), E = Math.max(0, I - F), M = { x: F, y: g, width: E, height: b }, W = (A, S, k, D) => {
|
|
626
627
|
switch (A.position) {
|
|
627
628
|
case "left":
|
|
628
|
-
return { x: F - k -
|
|
629
|
+
return { x: F - k - D, y: g, width: D, height: b };
|
|
629
630
|
case "right":
|
|
630
|
-
return { x: I + k, y, width:
|
|
631
|
+
return { x: I + k, y: g, width: D, height: b };
|
|
631
632
|
case "top":
|
|
632
|
-
return { x: F, y:
|
|
633
|
+
return { x: F, y: g - k - D, width: E, height: D };
|
|
633
634
|
default:
|
|
634
|
-
return { x: F, y:
|
|
635
|
+
return { x: F, y: y + k, width: E, height: D };
|
|
635
636
|
}
|
|
636
|
-
}, K = [],
|
|
637
|
+
}, K = [], st = (A) => {
|
|
637
638
|
let S = 0;
|
|
638
|
-
A.forEach((k,
|
|
639
|
-
const R = N.get(k.key) ?? 0, T = w.get(k.key), V = W(k,
|
|
639
|
+
A.forEach((k, D) => {
|
|
640
|
+
const R = N.get(k.key) ?? 0, T = w.get(k.key), V = W(k, D, S, R);
|
|
640
641
|
S += R + ke;
|
|
641
|
-
const _ = (T == null ? void 0 : T.domain) ?? [0, 1], Z = (T == null ? void 0 : T.format) ?? ((H) => String(H)), $ = new je(_, [
|
|
642
|
+
const _ = (T == null ? void 0 : T.domain) ?? [0, 1], Z = (T == null ? void 0 : T.format) ?? ((H) => String(H)), $ = new je(_, [g + b, g]), Y = ((T == null ? void 0 : T.values) ?? []).map((H, P) => ({
|
|
642
643
|
value: H,
|
|
643
644
|
label: (T == null ? void 0 : T.labels[P]) ?? "",
|
|
644
645
|
px: $.toPx(H),
|
|
@@ -654,7 +655,7 @@ function ln(s, t, e) {
|
|
|
654
655
|
grid: k.grid,
|
|
655
656
|
band: V,
|
|
656
657
|
size: R,
|
|
657
|
-
stack:
|
|
658
|
+
stack: D,
|
|
658
659
|
domain: _,
|
|
659
660
|
scale: $,
|
|
660
661
|
ticks: Y,
|
|
@@ -665,19 +666,19 @@ function ln(s, t, e) {
|
|
|
665
666
|
});
|
|
666
667
|
});
|
|
667
668
|
};
|
|
668
|
-
|
|
669
|
+
st(c), st(h);
|
|
669
670
|
const j = (A) => {
|
|
670
671
|
let S = 0;
|
|
671
|
-
A.forEach((k,
|
|
672
|
-
const R =
|
|
672
|
+
A.forEach((k, D) => {
|
|
673
|
+
const R = f.get(k.key) ?? 0, T = W(k, D, S, R);
|
|
673
674
|
S += R + ke;
|
|
674
675
|
let V = k.tickCount ?? Math.max(2, Math.round(E / 80));
|
|
675
676
|
const _ = jt(k, V), Z = k.ownDomainMode, $ = Z === void 0 ? void 0 : jt({ ...k, domainMode: Z }, V), Y = new je(_, [F, F + E]), H = (O, Q, J = !1) => {
|
|
676
|
-
const
|
|
677
|
-
const Ot = Gt[yt] ?? "", be = l(Ot, It).width, Ke = Y.toPx(
|
|
678
|
-
return { value:
|
|
677
|
+
const lt = sn(k, _, O), ft = lt.filter((mt, yt) => yt % Q === 0), nt = on(k, _, O), tt = rn(k, _, O, ft, nt), Gt = J ? tt.map((mt) => Ki(mt, (yt) => l(yt, It).width)) : tt, Ft = ft.map((mt, yt) => {
|
|
678
|
+
const Ot = Gt[yt] ?? "", be = l(Ot, It).width, Ke = Y.toPx(mt), ci = Kn(Ke - be / 2, be, n);
|
|
679
|
+
return { value: mt, label: Ot, px: Ke, labelLeft: ci, labelWidth: be };
|
|
679
680
|
});
|
|
680
|
-
return { format:
|
|
681
|
+
return { format: nt, ticks: Ft, total: lt.length };
|
|
681
682
|
};
|
|
682
683
|
let P = H(V, 1);
|
|
683
684
|
if (k.tickValues === void 0) {
|
|
@@ -705,7 +706,7 @@ function ln(s, t, e) {
|
|
|
705
706
|
break t;
|
|
706
707
|
}
|
|
707
708
|
}
|
|
708
|
-
const { format:
|
|
709
|
+
const { format: ot, ticks: rt } = P;
|
|
709
710
|
K.push({
|
|
710
711
|
key: k.key,
|
|
711
712
|
id: k.id,
|
|
@@ -715,19 +716,19 @@ function ln(s, t, e) {
|
|
|
715
716
|
grid: k.grid,
|
|
716
717
|
band: T,
|
|
717
718
|
size: R,
|
|
718
|
-
stack:
|
|
719
|
+
stack: D,
|
|
719
720
|
domain: _,
|
|
720
721
|
...$ !== void 0 && { ownDomain: $ },
|
|
721
722
|
scale: Y,
|
|
722
|
-
ticks:
|
|
723
|
-
format:
|
|
723
|
+
ticks: rt,
|
|
724
|
+
format: ot,
|
|
724
725
|
titleSize: k.label === void 0 || k.label === "" ? 0 : Math.ceil(l(k.label, Xt).height),
|
|
725
726
|
breaks: k.calendar === void 0 || k.calendar.length === 0 ? [] : Fi(k.calendar, _[0], _[1]).map((O) => Y.toPx(O)),
|
|
726
727
|
limitsInside: !1
|
|
727
728
|
});
|
|
728
729
|
});
|
|
729
730
|
};
|
|
730
|
-
return j(
|
|
731
|
+
return j(m), j(p), { layout: { width: n, height: i, plot: M, axes: K }, wrapped: a };
|
|
731
732
|
}
|
|
732
733
|
const an = [[], [7, 4], [1, 4], [7, 3, 1, 3], [14, 4], [7, 3, 1, 3, 1, 3]], ji = ["circle", "square", "triangle", "diamond", "triangleDown", "plus"], Ce = ["none", "rising", "falling", "horizontal", "vertical", "crossed"];
|
|
733
734
|
function Qi(s) {
|
|
@@ -818,20 +819,20 @@ function es(s, t) {
|
|
|
818
819
|
s.lineWidth = 1;
|
|
819
820
|
for (const c of n)
|
|
820
821
|
if (c.grid)
|
|
821
|
-
for (const
|
|
822
|
-
const
|
|
822
|
+
for (const h of [0, 1]) {
|
|
823
|
+
const m = h === 1;
|
|
823
824
|
s.beginPath();
|
|
824
|
-
let
|
|
825
|
-
for (const
|
|
826
|
-
if ((c.orientation === "y" &&
|
|
827
|
-
if (
|
|
828
|
-
const
|
|
829
|
-
s.moveTo(o,
|
|
825
|
+
let p = !1;
|
|
826
|
+
for (const d of c.ticks)
|
|
827
|
+
if ((c.orientation === "y" && d.value === 0) === m)
|
|
828
|
+
if (p = !0, c.orientation === "y") {
|
|
829
|
+
const u = at(d.px);
|
|
830
|
+
s.moveTo(o, u), s.lineTo(r, u);
|
|
830
831
|
} else {
|
|
831
|
-
const
|
|
832
|
-
s.moveTo(
|
|
832
|
+
const u = at(d.px);
|
|
833
|
+
s.moveTo(u, l), s.lineTo(u, a);
|
|
833
834
|
}
|
|
834
|
-
|
|
835
|
+
p && (s.strokeStyle = m ? i.colorAxis : i.colorGrid, s.stroke());
|
|
835
836
|
}
|
|
836
837
|
}
|
|
837
838
|
const ns = 6;
|
|
@@ -850,138 +851,138 @@ function Xn(s, t, e) {
|
|
|
850
851
|
return t >= s.x - 0.5 && t <= s.x + s.width + 0.5 && e >= s.y - 0.5 && e <= s.y + s.height + 0.5;
|
|
851
852
|
}
|
|
852
853
|
function os(s, t, e, n) {
|
|
853
|
-
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x,
|
|
854
|
-
let
|
|
855
|
-
for (let
|
|
856
|
-
const
|
|
857
|
-
if (Number.isNaN(
|
|
858
|
-
|
|
854
|
+
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, h = t.y, m = t.step === !0, p = new Path2D();
|
|
855
|
+
let d = !1, f = 0;
|
|
856
|
+
for (let u = 0; u < i; u++) {
|
|
857
|
+
const g = h[u], y = c[u] * o + r;
|
|
858
|
+
if (Number.isNaN(g)) {
|
|
859
|
+
m && d && p.lineTo(y, f), d = !1;
|
|
859
860
|
continue;
|
|
860
861
|
}
|
|
861
|
-
const b =
|
|
862
|
-
|
|
862
|
+
const b = g * l + a;
|
|
863
|
+
d ? (m && p.lineTo(y, f), p.lineTo(y, b)) : (p.moveTo(y, b), d = !0), f = b;
|
|
863
864
|
}
|
|
864
|
-
if (s.strokeStyle = t.color, s.lineWidth = t.strokeWidth, t.dash !== void 0 && t.dash.length > 0 ? s.setLineDash(t.dash) : s.setLineDash([]), s.stroke(
|
|
865
|
-
const
|
|
865
|
+
if (s.strokeStyle = t.color, s.lineWidth = t.strokeWidth, t.dash !== void 0 && t.dash.length > 0 ? s.setLineDash(t.dash) : s.setLineDash([]), s.stroke(p), s.setLineDash([]), t.markers !== "never") {
|
|
866
|
+
const u = t.markers === "always" || i <= is, g = t.strokeWidth + 1.5, y = t.marker ?? "circle", b = new Path2D();
|
|
866
867
|
for (let w = 0; w < i; w++) {
|
|
867
|
-
const N =
|
|
868
|
-
if (Number.isNaN(N) || !
|
|
869
|
-
const
|
|
870
|
-
Xn(e,
|
|
868
|
+
const N = h[w];
|
|
869
|
+
if (Number.isNaN(N) || !u && !ss(h, i, w)) continue;
|
|
870
|
+
const L = c[w] * o + r, F = N * l + a;
|
|
871
|
+
Xn(e, L, F) && Be(b, y, L, F, g);
|
|
871
872
|
}
|
|
872
873
|
n.push({ path: b, color: t.color, alpha: t.alpha });
|
|
873
874
|
}
|
|
874
875
|
}
|
|
875
876
|
function rs(s, t, e, n) {
|
|
876
|
-
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x,
|
|
877
|
-
let
|
|
878
|
-
for (;
|
|
879
|
-
for (;
|
|
880
|
-
|
|
881
|
-
if (
|
|
882
|
-
const
|
|
883
|
-
for (;
|
|
884
|
-
|
|
885
|
-
const b =
|
|
886
|
-
if (
|
|
887
|
-
const w = c[
|
|
888
|
-
|
|
877
|
+
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, h = t.y, m = t.y0, p = t.baseline * l + a, d = new Path2D(), f = new Path2D(), u = new Path2D();
|
|
878
|
+
let g = 0;
|
|
879
|
+
for (; g < i; ) {
|
|
880
|
+
for (; g < i && (Number.isNaN(h[g]) || m !== null && Number.isNaN(m[g])); )
|
|
881
|
+
g++;
|
|
882
|
+
if (g >= i) break;
|
|
883
|
+
const y = g;
|
|
884
|
+
for (; g < i && !Number.isNaN(h[g]) && (m === null || !Number.isNaN(m[g])); )
|
|
885
|
+
g++;
|
|
886
|
+
const b = g - 1;
|
|
887
|
+
if (y === b) {
|
|
888
|
+
const w = c[y] * o + r;
|
|
889
|
+
u.moveTo(w, m === null ? p : m[y] * l + a), u.lineTo(w, h[y] * l + a);
|
|
889
890
|
continue;
|
|
890
891
|
}
|
|
891
|
-
for (let w =
|
|
892
|
-
const N = c[w] * o + r,
|
|
893
|
-
w ===
|
|
892
|
+
for (let w = y; w <= b; w++) {
|
|
893
|
+
const N = c[w] * o + r, L = h[w] * l + a;
|
|
894
|
+
w === y ? (d.moveTo(N, L), f.moveTo(N, L)) : (d.lineTo(N, L), f.lineTo(N, L));
|
|
894
895
|
}
|
|
895
|
-
if (
|
|
896
|
-
|
|
896
|
+
if (m === null)
|
|
897
|
+
d.lineTo(c[b] * o + r, p), d.lineTo(c[y] * o + r, p);
|
|
897
898
|
else
|
|
898
|
-
for (let w = b; w >=
|
|
899
|
-
|
|
900
|
-
|
|
899
|
+
for (let w = b; w >= y; w--)
|
|
900
|
+
d.lineTo(c[w] * o + r, m[w] * l + a);
|
|
901
|
+
d.closePath();
|
|
901
902
|
}
|
|
902
|
-
s.globalAlpha = t.alpha * t.fillOpacity, s.fillStyle = t.color, s.fill(
|
|
903
|
+
s.globalAlpha = t.alpha * t.fillOpacity, s.fillStyle = t.color, s.fill(d), s.globalAlpha = t.alpha, $t(s, d, e, t.hatch ?? "none", t.color), t.edges === !0 && (s.setLineDash([]), s.strokeStyle = n, s.lineWidth = t.strokeWidth + 2, s.stroke(f)), s.strokeStyle = t.color, t.strokeWidth > 0 && (s.setLineDash(t.dash ?? []), s.lineWidth = t.strokeWidth, s.stroke(f)), s.setLineDash([]), s.lineWidth = Math.max(1, t.strokeWidth), s.stroke(u);
|
|
903
904
|
}
|
|
904
905
|
function ls(s, t, e, n) {
|
|
905
|
-
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x,
|
|
906
|
-
for (let
|
|
907
|
-
const b =
|
|
906
|
+
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, h = t.y, m = t.y0, p = t.baseline * l + a, d = t.offset * o, f = t.width * o, u = new Path2D(), g = t.edges === !0 && m !== null ? new Path2D() : null;
|
|
907
|
+
for (let y = 0; y < i; y++) {
|
|
908
|
+
const b = h[y];
|
|
908
909
|
if (Number.isNaN(b)) continue;
|
|
909
|
-
const w = c[
|
|
910
|
-
|
|
910
|
+
const w = c[y] * o + r + d, N = b * l + a, L = m === null ? p : m[y] * l + a;
|
|
911
|
+
u.rect(w, N, f, L - N), g !== null && (m == null ? void 0 : m[y]) !== 0 && (g.moveTo(w, L), g.lineTo(w + f, L));
|
|
911
912
|
}
|
|
912
|
-
s.fillStyle = t.color, s.fill(
|
|
913
|
+
s.fillStyle = t.color, s.fill(u), $t(s, u, e, t.hatch ?? "none", n), g !== null && (s.strokeStyle = n, s.lineWidth = 1, s.setLineDash([]), s.stroke(g));
|
|
913
914
|
}
|
|
914
915
|
const as = 0.18, cs = 2, un = 3, xt = 3.5, us = 1.5, hs = 0.2, ds = 3, hn = 3;
|
|
915
916
|
function fs(s, t, e) {
|
|
916
|
-
const n = t.length, i = t.xScale.m, o = t.xScale.b, r = t.yScale.m, l = t.yScale.b, a = t.x, c = t.y, { lowerQuartile:
|
|
917
|
+
const n = t.length, i = t.xScale.m, o = t.xScale.b, r = t.yScale.m, l = t.yScale.b, a = t.x, c = t.y, { lowerQuartile: h, upperQuartile: m, lowerWhisker: p, upperWhisker: d, outliers: f, outlierOffsets: u, mean: g, notchLower: y, notchUpper: b } = t.box, w = t.offset * i, N = t.width * i, L = N > 4 * hn ? hn / 2 : 0, F = (t.offset + t.width / 2) * i, I = new Path2D(), E = new Path2D(), M = new Path2D(), W = new Path2D(), K = new Path2D(), st = new Path2D();
|
|
917
918
|
for (let S = 0; S < n; S++) {
|
|
918
919
|
const k = c[S];
|
|
919
920
|
if (Number.isNaN(k)) continue;
|
|
920
|
-
const
|
|
921
|
-
!Number.isNaN(Y) && !Number.isNaN(H) && (O ? (I.moveTo(R, H), I.lineTo(R,
|
|
921
|
+
const D = a[S] * i + o + w, R = at(D + L), T = Math.round(D + N - L) - 0.5, V = T - R, _ = at(a[S] * i + o + F), Z = V / 4, $ = V * hs, Y = at(h[S] * r + l), H = at(m[S] * r + l), P = Math.round(k * r + l), ot = y === null ? Number.NaN : y[S] * r + l, rt = b === null ? Number.NaN : b[S] * r + l, O = !Number.isNaN(ot) && !Number.isNaN(rt);
|
|
922
|
+
!Number.isNaN(Y) && !Number.isNaN(H) && (O ? (I.moveTo(R, H), I.lineTo(R, rt), I.lineTo(R + $, P), I.lineTo(R, ot), I.lineTo(R, Y), I.lineTo(T, Y), I.lineTo(T, ot), I.lineTo(T - $, P), I.lineTo(T, rt), I.lineTo(T, H), I.closePath()) : I.rect(R, H, V, Y - H));
|
|
922
923
|
const Q = O ? $ : 0;
|
|
923
924
|
E.moveTo(R + Q, P), E.lineTo(T - Q, P);
|
|
924
|
-
const J =
|
|
925
|
+
const J = g === null ? Number.NaN : g[S] * r + l;
|
|
925
926
|
Number.isNaN(J) || (K.moveTo(_ - xt, J - xt), K.lineTo(_ + xt, J + xt), K.moveTo(_ - xt, J + xt), K.lineTo(_ + xt, J - xt));
|
|
926
|
-
const
|
|
927
|
-
for (const [
|
|
928
|
-
Number.isNaN(
|
|
929
|
-
if (
|
|
930
|
-
const
|
|
931
|
-
for (let Ft =
|
|
932
|
-
const
|
|
927
|
+
const lt = at(p[S] * r + l), ft = at(d[S] * r + l);
|
|
928
|
+
for (const [nt, tt] of [[H, ft], [Y, lt]])
|
|
929
|
+
Number.isNaN(nt) || Number.isNaN(tt) || (M.moveTo(_, nt), M.lineTo(_, tt), M.moveTo(_ - Z, tt), M.lineTo(_ + Z, tt));
|
|
930
|
+
if (f !== null && u !== null) {
|
|
931
|
+
const nt = h[S], tt = m[S], Gt = ds * (tt - nt);
|
|
932
|
+
for (let Ft = u[S]; Ft < u[S + 1]; Ft++) {
|
|
933
|
+
const mt = f[Ft], yt = mt > tt + Gt || mt < nt - Gt ? st : W, Ot = mt * r + l;
|
|
933
934
|
yt.moveTo(_ + un, Ot), yt.arc(_, Ot, un, 0, Math.PI * 2);
|
|
934
935
|
}
|
|
935
936
|
}
|
|
936
937
|
}
|
|
937
938
|
const j = s.globalAlpha, A = s.lineCap;
|
|
938
|
-
s.globalAlpha = j * as, s.fillStyle = t.color, s.fill(I), s.globalAlpha = j, $t(s, I, e, t.hatch ?? "none", t.color), s.strokeStyle = t.color, s.setLineDash([]), s.lineCap = "butt", s.lineWidth = 1, s.stroke(I), s.stroke(M), s.stroke(
|
|
939
|
+
s.globalAlpha = j * as, s.fillStyle = t.color, s.fill(I), s.globalAlpha = j, $t(s, I, e, t.hatch ?? "none", t.color), s.strokeStyle = t.color, s.setLineDash([]), s.lineCap = "butt", s.lineWidth = 1, s.stroke(I), s.stroke(M), s.stroke(st), s.lineWidth = us, s.stroke(K), s.lineWidth = 1, s.fillStyle = t.color, s.fill(W), s.lineWidth = cs, s.stroke(E), s.lineCap = A;
|
|
939
940
|
}
|
|
940
941
|
function ms(s, t, e) {
|
|
941
|
-
const n = s.length, i = s.xScale.m, o = s.xScale.b, r = s.yScale.m, l = s.yScale.b, a = s.x, c = s.y,
|
|
942
|
-
for (let
|
|
943
|
-
const
|
|
944
|
-
if (Number.isNaN(
|
|
945
|
-
const
|
|
946
|
-
Xn(t,
|
|
942
|
+
const n = s.length, i = s.xScale.m, o = s.xScale.b, r = s.yScale.m, l = s.yScale.b, a = s.x, c = s.y, h = s.radius, m = s.marker ?? "circle", p = new Path2D();
|
|
943
|
+
for (let d = 0; d < n; d++) {
|
|
944
|
+
const f = c[d];
|
|
945
|
+
if (Number.isNaN(f)) continue;
|
|
946
|
+
const u = a[d] * i + o, g = f * r + l;
|
|
947
|
+
Xn(t, u, g) && Be(p, m, u, g, h);
|
|
947
948
|
}
|
|
948
|
-
e.push({ path:
|
|
949
|
+
e.push({ path: p, color: s.color, alpha: s.alpha });
|
|
949
950
|
}
|
|
950
951
|
function ps(s, t, e, n) {
|
|
951
|
-
var
|
|
952
|
-
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.x, a = t.y, c = t.laneTop,
|
|
953
|
-
if (
|
|
954
|
-
const
|
|
955
|
-
for (let
|
|
956
|
-
let
|
|
957
|
-
for (let
|
|
958
|
-
const
|
|
959
|
-
if (Number.isNaN(
|
|
960
|
-
const
|
|
952
|
+
var f;
|
|
953
|
+
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.x, a = t.y, c = t.laneTop, h = t.laneBottom - t.laneTop, m = t.colors.length;
|
|
954
|
+
if (m === 0 || h <= 0) return;
|
|
955
|
+
const p = [];
|
|
956
|
+
for (let u = 0; u < m; u++) p.push(new Path2D());
|
|
957
|
+
let d = !1;
|
|
958
|
+
for (let u = 0; u < i; u++) {
|
|
959
|
+
const g = a[u];
|
|
960
|
+
if (Number.isNaN(g)) continue;
|
|
961
|
+
const y = g | 0, b = p[y];
|
|
961
962
|
if (b === void 0) continue;
|
|
962
|
-
const w = l[
|
|
963
|
-
N > w && (b.rect(w * o + r, c, (N - w) * o,
|
|
963
|
+
const w = l[u], N = qn(l, i, u, t.lastEnd);
|
|
964
|
+
N > w && (b.rect(w * o + r, c, (N - w) * o, h), d = !0);
|
|
964
965
|
}
|
|
965
|
-
if (
|
|
966
|
-
for (let
|
|
967
|
-
s.fillStyle = t.colors[
|
|
966
|
+
if (d)
|
|
967
|
+
for (let u = 0; u < m; u++)
|
|
968
|
+
s.fillStyle = t.colors[u], s.fill(p[u]), $t(s, p[u], e, ((f = t.hatches) == null ? void 0 : f[u]) ?? "none", n);
|
|
968
969
|
}
|
|
969
970
|
function gs(s, t, e, n) {
|
|
970
|
-
var
|
|
971
|
-
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x,
|
|
972
|
-
if (
|
|
973
|
-
const
|
|
974
|
-
for (let
|
|
975
|
-
for (let
|
|
976
|
-
const b =
|
|
971
|
+
var g;
|
|
972
|
+
const i = t.length, o = t.xScale.m, r = t.xScale.b, l = t.yScale.m, a = t.yScale.b, c = t.x, h = t.y, m = t.buckets, p = t.colors.length;
|
|
973
|
+
if (p === 0) return;
|
|
974
|
+
const d = t.width * o, f = Math.abs(t.height * l), u = [];
|
|
975
|
+
for (let y = 0; y < p; y++) u.push(new Path2D());
|
|
976
|
+
for (let y = 0; y < i; y++) {
|
|
977
|
+
const b = m[y];
|
|
977
978
|
if (b < 0) continue;
|
|
978
|
-
const w =
|
|
979
|
+
const w = u[b];
|
|
979
980
|
if (w === void 0) continue;
|
|
980
|
-
const N = c[
|
|
981
|
-
w.rect(N,
|
|
981
|
+
const N = c[y] * o + r - d / 2, L = h[y] * l + a - f / 2;
|
|
982
|
+
w.rect(N, L, d, f);
|
|
982
983
|
}
|
|
983
|
-
for (let
|
|
984
|
-
s.fillStyle = t.colors[
|
|
984
|
+
for (let y = 0; y < p; y++)
|
|
985
|
+
s.fillStyle = t.colors[y], s.fill(u[y]), $t(s, u[y], e, ((g = t.hatches) == null ? void 0 : g[y]) ?? "none", n);
|
|
985
986
|
}
|
|
986
987
|
function dn(s, t, e) {
|
|
987
988
|
for (const n of e) {
|
|
@@ -1064,7 +1065,7 @@ function He(s, t, e) {
|
|
|
1064
1065
|
const o = e - s[n];
|
|
1065
1066
|
return s[i] - e < o ? i : n;
|
|
1066
1067
|
}
|
|
1067
|
-
function
|
|
1068
|
+
function dt(s, t, e) {
|
|
1068
1069
|
let n = 0, i = t;
|
|
1069
1070
|
for (; n < i; ) {
|
|
1070
1071
|
const o = n + i >> 1;
|
|
@@ -1076,24 +1077,24 @@ function bs(s, t, e, n, i, o, r) {
|
|
|
1076
1077
|
const l = He(s, e, n);
|
|
1077
1078
|
if (l < 0) return -1;
|
|
1078
1079
|
const a = o.toPx(n), c = r.toPx(i);
|
|
1079
|
-
let
|
|
1080
|
-
for (let
|
|
1081
|
-
const
|
|
1082
|
-
if (
|
|
1083
|
-
const
|
|
1084
|
-
if (Number.isNaN(
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
}
|
|
1088
|
-
for (let
|
|
1089
|
-
const
|
|
1090
|
-
if (
|
|
1091
|
-
const
|
|
1092
|
-
if (Number.isNaN(
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
}
|
|
1096
|
-
return
|
|
1080
|
+
let h = -1, m = Number.POSITIVE_INFINITY;
|
|
1081
|
+
for (let p = l; p >= 0; p--) {
|
|
1082
|
+
const d = o.toPx(s[p]) - a;
|
|
1083
|
+
if (d * d > m) break;
|
|
1084
|
+
const f = t[p];
|
|
1085
|
+
if (Number.isNaN(f)) continue;
|
|
1086
|
+
const u = r.toPx(f) - c, g = d * d + u * u;
|
|
1087
|
+
g < m && (m = g, h = p);
|
|
1088
|
+
}
|
|
1089
|
+
for (let p = l + 1; p < e; p++) {
|
|
1090
|
+
const d = o.toPx(s[p]) - a;
|
|
1091
|
+
if (d * d > m) break;
|
|
1092
|
+
const f = t[p];
|
|
1093
|
+
if (Number.isNaN(f)) continue;
|
|
1094
|
+
const u = r.toPx(f) - c, g = d * d + u * u;
|
|
1095
|
+
g < m && (m = g, h = p);
|
|
1096
|
+
}
|
|
1097
|
+
return h;
|
|
1097
1098
|
}
|
|
1098
1099
|
const jn = {
|
|
1099
1100
|
roleDescription: "chart",
|
|
@@ -1131,7 +1132,7 @@ const jn = {
|
|
|
1131
1132
|
function re(s, t, e) {
|
|
1132
1133
|
let n = Number.POSITIVE_INFINITY;
|
|
1133
1134
|
for (const i of s)
|
|
1134
|
-
for (let o =
|
|
1135
|
+
for (let o = dt(i.x, i.length, t); o < i.length; o++) {
|
|
1135
1136
|
const r = i.x[o];
|
|
1136
1137
|
if (r >= n) break;
|
|
1137
1138
|
if (!(e && r === t || !Kt(i, o))) {
|
|
@@ -1144,7 +1145,7 @@ function re(s, t, e) {
|
|
|
1144
1145
|
function le(s, t, e) {
|
|
1145
1146
|
let n = Number.NEGATIVE_INFINITY;
|
|
1146
1147
|
for (const i of s) {
|
|
1147
|
-
let o =
|
|
1148
|
+
let o = dt(i.x, i.length, t) - 1;
|
|
1148
1149
|
if (!e) for (; o + 1 < i.length && i.x[o + 1] === t; ) o++;
|
|
1149
1150
|
for (; o >= 0; o--) {
|
|
1150
1151
|
const r = i.x[o];
|
|
@@ -1227,51 +1228,51 @@ function ws(s, t) {
|
|
|
1227
1228
|
return !1;
|
|
1228
1229
|
}
|
|
1229
1230
|
function Qn(s, t, e, n, i, o) {
|
|
1230
|
-
const { x: r, y: l, y0: a, length: c } = s,
|
|
1231
|
-
if (
|
|
1232
|
-
if (
|
|
1231
|
+
const { x: r, y: l, y0: a, length: c } = s, h = Math.max(0, dt(r, c, t) - 1), m = Math.min(c - 1, dt(r, c, e));
|
|
1232
|
+
if (m < h) return { x: r.subarray(0, 0), y: l.subarray(0, 0), y0: null, length: 0 };
|
|
1233
|
+
if (m - h + 1 <= 2 * o)
|
|
1233
1234
|
return {
|
|
1234
|
-
x: r.subarray(
|
|
1235
|
-
y: l.subarray(
|
|
1236
|
-
y0: a === null ? null : a.subarray(
|
|
1237
|
-
length:
|
|
1235
|
+
x: r.subarray(h, m + 1),
|
|
1236
|
+
y: l.subarray(h, m + 1),
|
|
1237
|
+
y0: a === null ? null : a.subarray(h, m + 1),
|
|
1238
|
+
length: m - h + 1
|
|
1238
1239
|
};
|
|
1239
|
-
const
|
|
1240
|
-
let
|
|
1241
|
-
for (;
|
|
1242
|
-
const
|
|
1243
|
-
let
|
|
1244
|
-
for (;
|
|
1245
|
-
const E = l[
|
|
1246
|
-
if (Number.isNaN(E) || a !== null && Number.isNaN(a[
|
|
1247
|
-
|
|
1240
|
+
const p = [], d = new Array(6);
|
|
1241
|
+
let f = h;
|
|
1242
|
+
for (; f <= m; ) {
|
|
1243
|
+
const g = Math.floor(r[f] * n + i);
|
|
1244
|
+
let y = -1, b = -1, w = -1, N = -1, L = -1, F = -1;
|
|
1245
|
+
for (; f <= m && Math.floor(r[f] * n + i) === g; f++) {
|
|
1246
|
+
const E = l[f];
|
|
1247
|
+
if (Number.isNaN(E) || a !== null && Number.isNaN(a[f])) {
|
|
1248
|
+
L < 0 && (L = f), F < 0 && (F = f);
|
|
1248
1249
|
continue;
|
|
1249
1250
|
}
|
|
1250
|
-
F = -1,
|
|
1251
|
+
F = -1, y < 0 && (y = f), b = f, (w < 0 || E < l[w]) && (w = f), (N < 0 || E > l[N]) && (N = f);
|
|
1251
1252
|
}
|
|
1252
|
-
|
|
1253
|
+
d[0] = y, d[1] = w, d[2] = N, d[3] = b, d[4] = L, d[5] = F, d.sort((E, M) => E - M);
|
|
1253
1254
|
let I = -1;
|
|
1254
|
-
for (const E of
|
|
1255
|
-
E < 0 || E === I || (
|
|
1256
|
-
}
|
|
1257
|
-
const
|
|
1258
|
-
x: new Float64Array(
|
|
1259
|
-
y: new Float64Array(
|
|
1260
|
-
y0: a === null ? null : new Float64Array(
|
|
1261
|
-
length:
|
|
1255
|
+
for (const E of d)
|
|
1256
|
+
E < 0 || E === I || (p.push(E), I = E);
|
|
1257
|
+
}
|
|
1258
|
+
const u = {
|
|
1259
|
+
x: new Float64Array(p.length),
|
|
1260
|
+
y: new Float64Array(p.length),
|
|
1261
|
+
y0: a === null ? null : new Float64Array(p.length),
|
|
1262
|
+
length: p.length
|
|
1262
1263
|
};
|
|
1263
|
-
return
|
|
1264
|
-
|
|
1265
|
-
}),
|
|
1264
|
+
return p.forEach((g, y) => {
|
|
1265
|
+
u.x[y] = r[g], u.y[y] = l[g], u.y0 !== null && (u.y0[y] = a[g]);
|
|
1266
|
+
}), u;
|
|
1266
1267
|
}
|
|
1267
1268
|
const ks = 500;
|
|
1268
1269
|
function Ns(s, t, e, n = ks) {
|
|
1269
1270
|
const i = s.map((c) => As(c, t, e)), o = Ie(i, !1).count;
|
|
1270
1271
|
if (o <= n || !(e > t)) return { ...Ie(i, !0), courses: i, readings: o, thinned: !1 };
|
|
1271
1272
|
const r = Math.max(1, Math.floor(n / 6 / Math.max(1, s.length))), l = (r - 1) / (e - t), a = i.map(
|
|
1272
|
-
(c,
|
|
1273
|
-
var
|
|
1274
|
-
return ((
|
|
1273
|
+
(c, h) => {
|
|
1274
|
+
var m;
|
|
1275
|
+
return ((m = s[h]) == null ? void 0 : m.changesOnly) === !0 ? Is(c) : Qn(c, t, e, l, -t * l, r);
|
|
1275
1276
|
}
|
|
1276
1277
|
);
|
|
1277
1278
|
return { ...Ie(a, !0), courses: a, readings: o, thinned: !0 };
|
|
@@ -1287,8 +1288,8 @@ function Is(s) {
|
|
|
1287
1288
|
};
|
|
1288
1289
|
}
|
|
1289
1290
|
function As(s, t, e) {
|
|
1290
|
-
const n =
|
|
1291
|
-
let i =
|
|
1291
|
+
const n = dt(s.x, s.length, t);
|
|
1292
|
+
let i = dt(s.x, s.length, e);
|
|
1292
1293
|
for (; i < s.length && s.x[i] <= e; ) i++;
|
|
1293
1294
|
return {
|
|
1294
1295
|
x: s.x.subarray(n, i),
|
|
@@ -1303,14 +1304,14 @@ function Ie(s, t) {
|
|
|
1303
1304
|
for (; ; ) {
|
|
1304
1305
|
let r = Number.POSITIVE_INFINITY;
|
|
1305
1306
|
for (let a = 0; a < s.length; a++) {
|
|
1306
|
-
const c = s[a],
|
|
1307
|
-
|
|
1307
|
+
const c = s[a], h = e[a];
|
|
1308
|
+
h < c.length && c.x[h] < r && (r = c.x[h]);
|
|
1308
1309
|
}
|
|
1309
1310
|
if (r === Number.POSITIVE_INFINITY) break;
|
|
1310
1311
|
const l = t ? s.map(() => -1) : null;
|
|
1311
1312
|
for (let a = 0; a < s.length; a++) {
|
|
1312
|
-
const c = s[a],
|
|
1313
|
-
|
|
1313
|
+
const c = s[a], h = e[a];
|
|
1314
|
+
h < c.length && c.x[h] === r && (l !== null && (l[a] = h), e[a] = h + 1);
|
|
1314
1315
|
}
|
|
1315
1316
|
o++, l !== null && (n.push(r), i.push(l));
|
|
1316
1317
|
}
|
|
@@ -1364,10 +1365,10 @@ function Zt(s, t) {
|
|
|
1364
1365
|
function Ss(s, t, e, n, i, o, r) {
|
|
1365
1366
|
const l = o / 2, a = r / 2;
|
|
1366
1367
|
for (let c = 0; c < e; c++) {
|
|
1367
|
-
const
|
|
1368
|
-
if (!(
|
|
1369
|
-
const
|
|
1370
|
-
if (
|
|
1368
|
+
const h = n - s[c];
|
|
1369
|
+
if (!(h >= -l && h < l)) continue;
|
|
1370
|
+
const m = i - t[c];
|
|
1371
|
+
if (m >= -a && m < a)
|
|
1371
1372
|
return c;
|
|
1372
1373
|
}
|
|
1373
1374
|
return -1;
|
|
@@ -1463,50 +1464,50 @@ function Ct(s) {
|
|
|
1463
1464
|
return s == null || !Number.isFinite(s) ? Number.NaN : s;
|
|
1464
1465
|
}
|
|
1465
1466
|
function Ws(s, t, e, n, i) {
|
|
1466
|
-
const o = (i == null ? void 0 : i.rows) ?? null, r = o === null ? s.length : o.length, l = new Float64Array(r), a = new Float64Array(r), c = typeof n == "function" ? n : null,
|
|
1467
|
+
const o = (i == null ? void 0 : i.rows) ?? null, r = o === null ? s.length : o.length, l = new Float64Array(r), a = new Float64Array(r), c = typeof n == "function" ? n : null, h = c === null ? null : new Float64Array(r), m = (i == null ? void 0 : i.value) ?? null, p = m === null ? null : new Float64Array(r), d = (i == null ? void 0 : i.box) ?? null, f = d === null ? null : {
|
|
1467
1468
|
lowerQuartile: new Float64Array(r),
|
|
1468
1469
|
upperQuartile: new Float64Array(r),
|
|
1469
1470
|
lowerWhisker: new Float64Array(r),
|
|
1470
1471
|
upperWhisker: new Float64Array(r),
|
|
1471
1472
|
outliers: null,
|
|
1472
|
-
outlierOffsets:
|
|
1473
|
-
mean:
|
|
1474
|
-
notchLower:
|
|
1475
|
-
notchUpper:
|
|
1476
|
-
count:
|
|
1477
|
-
},
|
|
1478
|
-
let N = Number.POSITIVE_INFINITY,
|
|
1473
|
+
outlierOffsets: d.outliers === void 0 ? null : new Uint32Array(r + 1),
|
|
1474
|
+
mean: d.mean === void 0 ? null : new Float64Array(r),
|
|
1475
|
+
notchLower: d.notchLower === void 0 ? null : new Float64Array(r),
|
|
1476
|
+
notchUpper: d.notchUpper === void 0 ? null : new Float64Array(r),
|
|
1477
|
+
count: d.count === void 0 ? null : new Float64Array(r)
|
|
1478
|
+
}, u = (d == null ? void 0 : d.outliers) ?? null, g = (f == null ? void 0 : f.outlierOffsets) ?? null, y = [], b = (i == null ? void 0 : i.xMap) ?? null, w = (i == null ? void 0 : i.xGap) ?? null;
|
|
1479
|
+
let N = Number.POSITIVE_INFINITY, L = Number.NEGATIVE_INFINITY, F = Number.POSITIVE_INFINITY, I = Number.NEGATIVE_INFINITY;
|
|
1479
1480
|
typeof n == "number" && r > 0 && (F = n, I = n);
|
|
1480
1481
|
for (let E = 0; E < r; E++) {
|
|
1481
|
-
const M = o === null ? E : o[E], W = s[M], K = t(W, M),
|
|
1482
|
+
const M = o === null ? E : o[E], W = s[M], K = t(W, M), st = !Number.isFinite(K), j = st ? E > 0 ? l[E - 1] : Number.NEGATIVE_INFINITY : b === null ? K : b(K);
|
|
1482
1483
|
l[E] = j;
|
|
1483
|
-
const A =
|
|
1484
|
-
A || (j < N && (N = j), j >
|
|
1484
|
+
const A = st || w !== null && w(K);
|
|
1485
|
+
A || (j < N && (N = j), j > L && (L = j));
|
|
1485
1486
|
const S = A ? Number.NaN : Ct(e(W, M));
|
|
1486
|
-
if (a[E] = S, S < F && (F = S), S > I && (I = S),
|
|
1487
|
+
if (a[E] = S, S < F && (F = S), S > I && (I = S), m !== null && (p[E] = A ? Number.NaN : Ct(m(W, M))), d !== null) {
|
|
1487
1488
|
for (const k of Et) {
|
|
1488
|
-
const
|
|
1489
|
-
|
|
1489
|
+
const D = Number.isNaN(S) ? Number.NaN : Ct(d[k](W, M));
|
|
1490
|
+
f[k][E] = D, D < F && (F = D), D > I && (I = D);
|
|
1490
1491
|
}
|
|
1491
1492
|
for (const k of ze) {
|
|
1492
|
-
const
|
|
1493
|
-
if (
|
|
1494
|
-
const T = Number.isNaN(S) ? Number.NaN : Ct(
|
|
1493
|
+
const D = d[k], R = f[k];
|
|
1494
|
+
if (D === void 0 || R === null) continue;
|
|
1495
|
+
const T = Number.isNaN(S) ? Number.NaN : Ct(D(W, M));
|
|
1495
1496
|
R[E] = T, Zn.includes(k) && (T < F && (F = T), T > I && (I = T));
|
|
1496
1497
|
}
|
|
1497
|
-
if (
|
|
1498
|
-
const k = Number.isNaN(S) ? null :
|
|
1499
|
-
for (const
|
|
1500
|
-
Number.isFinite(
|
|
1501
|
-
|
|
1498
|
+
if (u !== null) {
|
|
1499
|
+
const k = Number.isNaN(S) ? null : u(W, M);
|
|
1500
|
+
for (const D of k ?? [])
|
|
1501
|
+
Number.isFinite(D) && (y.push(D), D < F && (F = D), D > I && (I = D));
|
|
1502
|
+
g !== null && (g[E + 1] = y.length);
|
|
1502
1503
|
}
|
|
1503
1504
|
}
|
|
1504
1505
|
if (c !== null) {
|
|
1505
1506
|
const k = A ? Number.NaN : Ct(c(W, M));
|
|
1506
|
-
|
|
1507
|
+
h[E] = k, k < F && (F = k), k > I && (I = k);
|
|
1507
1508
|
}
|
|
1508
1509
|
}
|
|
1509
|
-
return
|
|
1510
|
+
return f !== null && u !== null && (f.outliers = Float64Array.from(y)), { series: { x: l, y: a, y0: h, w: p, box: f, length: r }, extent: { xMin: N, xMax: L, yMin: F, yMax: I } };
|
|
1510
1511
|
}
|
|
1511
1512
|
const pe = (s) => typeof s == "number" && Number.isFinite(s), Bt = (s) => typeof s == "string" && s !== "";
|
|
1512
1513
|
function bn(s, t) {
|
|
@@ -1563,28 +1564,28 @@ function Bs(s, t) {
|
|
|
1563
1564
|
function vn(s, t, e) {
|
|
1564
1565
|
const { x: n, y: i, y0: o, box: r, length: l } = s;
|
|
1565
1566
|
let a = Number.POSITIVE_INFINITY, c = Number.NEGATIVE_INFINITY;
|
|
1566
|
-
for (let
|
|
1567
|
-
const
|
|
1568
|
-
if (
|
|
1569
|
-
const
|
|
1570
|
-
|
|
1567
|
+
for (let h = dt(n, l, t); h < l && n[h] <= e; h++) {
|
|
1568
|
+
const m = i[h];
|
|
1569
|
+
if (m < a && (a = m), m > c && (c = m), o !== null) {
|
|
1570
|
+
const p = o[h];
|
|
1571
|
+
p < a && (a = p), p > c && (c = p);
|
|
1571
1572
|
}
|
|
1572
1573
|
if (r !== null) {
|
|
1573
|
-
for (const
|
|
1574
|
-
const
|
|
1575
|
-
|
|
1574
|
+
for (const f of Et) {
|
|
1575
|
+
const u = r[f][h];
|
|
1576
|
+
u < a && (a = u), u > c && (c = u);
|
|
1576
1577
|
}
|
|
1577
|
-
for (const
|
|
1578
|
-
const
|
|
1579
|
-
if (
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1578
|
+
for (const f of Zn) {
|
|
1579
|
+
const u = r[f];
|
|
1580
|
+
if (u === null) continue;
|
|
1581
|
+
const g = u[h];
|
|
1582
|
+
g < a && (a = g), g > c && (c = g);
|
|
1582
1583
|
}
|
|
1583
|
-
const { outliers:
|
|
1584
|
-
if (
|
|
1585
|
-
for (let
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1584
|
+
const { outliers: p, outlierOffsets: d } = r;
|
|
1585
|
+
if (p !== null && d !== null)
|
|
1586
|
+
for (let f = d[h]; f < d[h + 1]; f++) {
|
|
1587
|
+
const u = p[f];
|
|
1588
|
+
u < a && (a = u), u > c && (c = u);
|
|
1588
1589
|
}
|
|
1589
1590
|
}
|
|
1590
1591
|
}
|
|
@@ -1595,8 +1596,8 @@ function wn(s, t, e, n) {
|
|
|
1595
1596
|
for (const r of e) {
|
|
1596
1597
|
const l = r.extent;
|
|
1597
1598
|
if (l === null || !(s === "x" ? r.xAxisId === t : r.yAxisId === t)) continue;
|
|
1598
|
-
const c = s === "x" ? l.xMin : l.yMin,
|
|
1599
|
-
c < i && (i = c),
|
|
1599
|
+
const c = s === "x" ? l.xMin : l.yMin, h = s === "x" ? l.xMax : l.yMax;
|
|
1600
|
+
c < i && (i = c), h > o && (o = h);
|
|
1600
1601
|
}
|
|
1601
1602
|
if (n !== void 0)
|
|
1602
1603
|
for (const r of n)
|
|
@@ -1711,7 +1712,7 @@ function Rt(s) {
|
|
|
1711
1712
|
function Js(s) {
|
|
1712
1713
|
const t = s.entry.materialized;
|
|
1713
1714
|
if (t === null) return !1;
|
|
1714
|
-
const e = t.x[s.index], n = (i) => i > 0 && i <
|
|
1715
|
+
const e = t.x[s.index], n = (i) => i > 0 && i < it;
|
|
1715
1716
|
return s.index > 0 && n(e - t.x[s.index - 1]) || s.index + 1 < t.length && n(t.x[s.index + 1] - e);
|
|
1716
1717
|
}
|
|
1717
1718
|
function Yt(s, t) {
|
|
@@ -1721,7 +1722,7 @@ function Yt(s, t) {
|
|
|
1721
1722
|
return !0;
|
|
1722
1723
|
}
|
|
1723
1724
|
function to(s, t) {
|
|
1724
|
-
return s.kind === t.kind &&
|
|
1725
|
+
return s.kind === t.kind && et(s) === et(t) && ge(s) === ge(t) && ut(s.accessor, t.accessor) && s.data === t.data && ut(ye(s), ye(t)) && ut(Re(s), Re(t)) && eo(We(s), We(t));
|
|
1725
1726
|
}
|
|
1726
1727
|
function We(s) {
|
|
1727
1728
|
if (s.kind !== "box") return;
|
|
@@ -1754,7 +1755,7 @@ function Ln(s, t) {
|
|
|
1754
1755
|
function Le(s) {
|
|
1755
1756
|
return s.kind === "bar" ? s.barWidth : s.kind === "box" ? s.boxWidth : 0;
|
|
1756
1757
|
}
|
|
1757
|
-
function
|
|
1758
|
+
function et(s) {
|
|
1758
1759
|
if (!(s.kind !== "bar" && s.kind !== "area" || s.stack === void 0))
|
|
1759
1760
|
return `${s.xAxisId}
|
|
1760
1761
|
${s.yAxisId}
|
|
@@ -2099,7 +2100,7 @@ class ti {
|
|
|
2099
2100
|
const l = this.slotsByName.get(e.name);
|
|
2100
2101
|
l === void 0 ? this.slotsByName.set(e.name, n.slot) : this.slotTaken(l, n) || (n.slot = l);
|
|
2101
2102
|
}
|
|
2102
|
-
n.config = e, !r && (Se(i) !== Se(e) && (this.materialsDirty = !0), n.buckets = null, this.isHidden(i) !== this.isHidden(e) &&
|
|
2103
|
+
n.config = e, !r && (Se(i) !== Se(e) && (this.materialsDirty = !0), n.buckets = null, this.isHidden(i) !== this.isHidden(e) && et(e) !== void 0 && (this.materialsDirty = !0), (!o || i.xAxisId !== e.xAxisId || i.yAxisId !== e.yAxisId) && (Ht(n), this.materialsDirty = !0), this.markLayoutDirty());
|
|
2103
2104
|
}
|
|
2104
2105
|
unregisterSeries(t) {
|
|
2105
2106
|
this.series.delete(t) && (this.materialsDirty = !0, this.markLayoutDirty());
|
|
@@ -2227,7 +2228,7 @@ class ti {
|
|
|
2227
2228
|
/* ================= Checks (R-4.12, R-4.13) ================= */
|
|
2228
2229
|
/** Called from the Chart after the child effects; DEV only. */
|
|
2229
2230
|
validate() {
|
|
2230
|
-
if (!
|
|
2231
|
+
if (!pt) return;
|
|
2231
2232
|
const t = /* @__PURE__ */ new Set();
|
|
2232
2233
|
for (const { config: o } of this.axesInOrder()) {
|
|
2233
2234
|
const r = `${o.orientation}:${o.id}`, l = o.orientation === "x" ? "XAxis" : "YAxis";
|
|
@@ -2321,7 +2322,7 @@ class ti {
|
|
|
2321
2322
|
const n = t.accessor;
|
|
2322
2323
|
if (n === void 0 || this.saysTime(t)) return null;
|
|
2323
2324
|
const i = bn(this.rowsOf(e), n);
|
|
2324
|
-
return
|
|
2325
|
+
return pt && i !== null && i.every((o) => Xs.test(o) && !Number.isNaN(Date.parse(o))) && G(
|
|
2325
2326
|
`category-instants-${t.id}`,
|
|
2326
2327
|
`The x axis "${t.id}" reads its rows' strings as categories, and every one is an ISO 8601 instant. If they are moments, say \`time\` on the axis: a string is an instant only there (ADR-0052).`
|
|
2327
2328
|
), i;
|
|
@@ -2348,10 +2349,10 @@ class ti {
|
|
|
2348
2349
|
placeOnX(t, e, n) {
|
|
2349
2350
|
const i = n.accessor, o = this.inTime(n) ? Te([e], i) : "number";
|
|
2350
2351
|
if (o === "number" || o === null) return i;
|
|
2351
|
-
if (
|
|
2352
|
+
if (pt && o === "string") {
|
|
2352
2353
|
const r = t.name ?? "?", l = e.findIndex((a, c) => {
|
|
2353
|
-
const
|
|
2354
|
-
return typeof
|
|
2354
|
+
const h = i(a, c);
|
|
2355
|
+
return typeof h == "string" && h !== "" && Number.isNaN(Date.parse(h));
|
|
2355
2356
|
});
|
|
2356
2357
|
l >= 0 && G(
|
|
2357
2358
|
`instant-unread-${n.id}-${r}`,
|
|
@@ -2374,42 +2375,42 @@ class ti {
|
|
|
2374
2375
|
categories -, the one that brings a category its axis does not list,
|
|
2375
2376
|
and the one that brings a category twice. */
|
|
2376
2377
|
checkValues(t, e, n, i) {
|
|
2377
|
-
const o = t.name ?? "?", r = `${n.orientation} axis "${n.id}"`, l = `${n.orientation}-${n.id}-${o}`, a = (
|
|
2378
|
+
const o = t.name ?? "?", r = `${n.orientation} axis "${n.id}"`, l = `${n.orientation}-${n.id}-${o}`, a = (p, d) => G(
|
|
2378
2379
|
`axis-kind-${l}`,
|
|
2379
|
-
`Series "${o}" brings ${
|
|
2380
|
+
`Series "${o}" brings ${p} to the ${r}, which reads ${d}. One axis has one kind: it is no place there and is not drawn (ADR-0052).`
|
|
2380
2381
|
), c = this.categoriesAt(n.orientation, n.id);
|
|
2381
2382
|
if (c === void 0) {
|
|
2382
|
-
const
|
|
2383
|
-
if (
|
|
2383
|
+
const p = n.orientation === "x" && this.dated.has(n.id), d = n.orientation === "x" ? this.findAxisConfig("x", n.id) : null;
|
|
2384
|
+
if (p || d !== null && this.saysTime(d)) {
|
|
2384
2385
|
if (Te([e], i) !== "number") return;
|
|
2385
|
-
const
|
|
2386
|
-
const
|
|
2387
|
-
return Bt(
|
|
2386
|
+
const f = e.findIndex((u, g) => {
|
|
2387
|
+
const y = i(u, g);
|
|
2388
|
+
return Bt(y) || y instanceof Date;
|
|
2388
2389
|
});
|
|
2389
|
-
|
|
2390
|
+
f >= 0 && G(
|
|
2390
2391
|
`instant-mixed-${l}`,
|
|
2391
|
-
`Series "${o}": row ${
|
|
2392
|
+
`Series "${o}": row ${f} holds a date or a string on the time axis "${n.id}" after numbers. A series that begins with milliseconds is read as milliseconds: that row has no place and is not drawn (ADR-0052).`
|
|
2392
2393
|
);
|
|
2393
2394
|
return;
|
|
2394
2395
|
}
|
|
2395
|
-
for (let
|
|
2396
|
-
const
|
|
2397
|
-
if (pe(
|
|
2398
|
-
if (Bt(
|
|
2399
|
-
if (
|
|
2396
|
+
for (let f = 0; f < e.length; f++) {
|
|
2397
|
+
const u = i(e[f], f);
|
|
2398
|
+
if (pe(u)) return;
|
|
2399
|
+
if (Bt(u)) return a("a category", "numbers");
|
|
2400
|
+
if (u instanceof Date) return a("a Date", "numbers");
|
|
2400
2401
|
}
|
|
2401
2402
|
return;
|
|
2402
2403
|
}
|
|
2403
|
-
const
|
|
2404
|
-
for (let
|
|
2405
|
-
const
|
|
2406
|
-
pe(
|
|
2404
|
+
const h = t.kind !== "matrix", m = /* @__PURE__ */ new Set();
|
|
2405
|
+
for (let p = 0; p < e.length; p++) {
|
|
2406
|
+
const d = i(e[p], p);
|
|
2407
|
+
pe(d) ? a("a number", "categories") : d instanceof Date && a("a Date", "categories"), Bt(d) && (c.place.has(d) || G(
|
|
2407
2408
|
`category-unlisted-${l}`,
|
|
2408
|
-
`Series "${o}" brings the category "${
|
|
2409
|
-
),
|
|
2409
|
+
`Series "${o}" brings the category "${d}", which the ${r} does not list in \`categories\`. It has no place and is not drawn (ADR-0052).`
|
|
2410
|
+
), h && m.has(d) && G(
|
|
2410
2411
|
`category-twice-${l}`,
|
|
2411
|
-
`Series "${o}" brings the category "${
|
|
2412
|
-
),
|
|
2412
|
+
`Series "${o}" brings the category "${d}" more than once to the ${r}. Both rows are drawn in the one place; add them up before the chart (ADR-0052).`
|
|
2413
|
+
), m.add(d));
|
|
2413
2414
|
}
|
|
2414
2415
|
}
|
|
2415
2416
|
materialize() {
|
|
@@ -2425,21 +2426,21 @@ class ti {
|
|
|
2425
2426
|
if ((r == null ? void 0 : r.accessor) === void 0) continue;
|
|
2426
2427
|
const l = this.categoriesAt("x", r.id), a = l === void 0 ? null : Vs(o, r.accessor, l.place);
|
|
2427
2428
|
n.rows = (a == null ? void 0 : a.rows) ?? null;
|
|
2428
|
-
const c = this.categoriesAt("y", i.yAxisId),
|
|
2429
|
-
|
|
2429
|
+
const c = this.categoriesAt("y", i.yAxisId), h = i.kind === "matrix" ? c : void 0, m = Se(i), p = m !== void 0 && (c == null ? void 0 : c.place.has(m)) !== !0, d = p || c !== void 0 && i.kind !== "matrix" && i.kind !== "state", f = i.accessor;
|
|
2430
|
+
pt && (this.checkValues(i, o, r, r.accessor), i.kind === "matrix" && this.checkValues(i, o, { orientation: "y", id: i.yAxisId }, f), d && !p && G(
|
|
2430
2431
|
`axis-kind-y-${i.yAxisId}-${i.name ?? "?"}`,
|
|
2431
2432
|
`Series "${i.name ?? "?"}" brings numbers to the y axis "${i.yAxisId}", which reads categories. One axis has one kind: a number is no place there and is not drawn (ADR-0052).`
|
|
2432
|
-
),
|
|
2433
|
-
`lane-unlisted-${i.yAxisId}-${
|
|
2434
|
-
`StateBand "${i.name ?? "?"}" names the lane "${
|
|
2433
|
+
), p && G(
|
|
2434
|
+
`lane-unlisted-${i.yAxisId}-${m}`,
|
|
2435
|
+
`StateBand "${i.name ?? "?"}" names the lane "${m}", which the y axis "${i.yAxisId}" does not list in \`categories\`. It has no place and is not drawn (ADR-0052).`
|
|
2435
2436
|
));
|
|
2436
|
-
const
|
|
2437
|
+
const u = Ws(
|
|
2437
2438
|
o,
|
|
2438
|
-
a === null ? this.placeOnX(i, o, r) : (
|
|
2439
|
-
|
|
2440
|
-
} :
|
|
2441
|
-
const b =
|
|
2442
|
-
return typeof b == "string" ?
|
|
2439
|
+
a === null ? this.placeOnX(i, o, r) : (g, y) => a.x[y],
|
|
2440
|
+
d ? () => {
|
|
2441
|
+
} : h === void 0 ? i.accessor : (g, y) => {
|
|
2442
|
+
const b = f(g, y);
|
|
2443
|
+
return typeof b == "string" ? h.place.get(b) : void 0;
|
|
2443
2444
|
},
|
|
2444
2445
|
ye(i),
|
|
2445
2446
|
{
|
|
@@ -2450,50 +2451,50 @@ class ti {
|
|
|
2450
2451
|
xGap: this.gapFor(r)
|
|
2451
2452
|
}
|
|
2452
2453
|
);
|
|
2453
|
-
if (n.materialized =
|
|
2454
|
-
const
|
|
2455
|
-
n.step =
|
|
2456
|
-
const
|
|
2454
|
+
if (n.materialized = u.series, n.own = et(i) === void 0 ? null : u.series.y, n.stacked = null, e += u.series.length, i.kind === "bar" || i.kind === "box") {
|
|
2455
|
+
const g = l === void 0 ? kn(u.series.x, u.series.length) : 1;
|
|
2456
|
+
n.step = g;
|
|
2457
|
+
const y = g / 2;
|
|
2457
2458
|
n.extent = {
|
|
2458
|
-
...
|
|
2459
|
-
xMin:
|
|
2460
|
-
xMax:
|
|
2459
|
+
...u.extent,
|
|
2460
|
+
xMin: u.extent.xMin - y,
|
|
2461
|
+
xMax: u.extent.xMax + y
|
|
2461
2462
|
};
|
|
2462
2463
|
} else if (i.kind === "matrix") {
|
|
2463
|
-
const
|
|
2464
|
-
n.step =
|
|
2465
|
-
xMin:
|
|
2466
|
-
xMax:
|
|
2467
|
-
yMin:
|
|
2468
|
-
yMax:
|
|
2464
|
+
const g = l === void 0 ? pn(u.series.x, u.series.length) : 1, y = h === void 0 ? pn(u.series.y, u.series.length) : 1;
|
|
2465
|
+
n.step = g, n.cellHeight = y, n.extent = {
|
|
2466
|
+
xMin: u.extent.xMin - g / 2,
|
|
2467
|
+
xMax: u.extent.xMax + g / 2,
|
|
2468
|
+
yMin: u.extent.yMin - y / 2,
|
|
2469
|
+
yMax: u.extent.yMax + y / 2
|
|
2469
2470
|
};
|
|
2470
2471
|
} else if (i.kind === "state") {
|
|
2471
|
-
const
|
|
2472
|
-
n.step =
|
|
2473
|
-
...
|
|
2474
|
-
xMax:
|
|
2472
|
+
const g = ts(u.series.x, u.series.length);
|
|
2473
|
+
n.step = g, n.extent = {
|
|
2474
|
+
...u.extent,
|
|
2475
|
+
xMax: u.extent.xMax + g,
|
|
2475
2476
|
yMin: Number.POSITIVE_INFINITY,
|
|
2476
2477
|
yMax: Number.NEGATIVE_INFINITY
|
|
2477
2478
|
};
|
|
2478
2479
|
} else
|
|
2479
|
-
n.step = null, n.extent =
|
|
2480
|
-
if (
|
|
2481
|
-
const
|
|
2482
|
-
if (
|
|
2483
|
-
const
|
|
2480
|
+
n.step = null, n.extent = u.extent;
|
|
2481
|
+
if (pt && i.kind === "box") {
|
|
2482
|
+
const g = _s(u.series);
|
|
2483
|
+
if (g >= 0) {
|
|
2484
|
+
const y = i.name ?? "?";
|
|
2484
2485
|
G(
|
|
2485
2486
|
`box-order-${n.order}`,
|
|
2486
|
-
`BoxPlot "${
|
|
2487
|
+
`BoxPlot "${y}": the numbers at index ${g} are out of order - expected lowerWhisker ≤ lowerQuartile ≤ median ≤ upperQuartile ≤ upperWhisker. It is drawn as given.`
|
|
2487
2488
|
);
|
|
2488
2489
|
}
|
|
2489
2490
|
}
|
|
2490
|
-
if (
|
|
2491
|
-
const
|
|
2492
|
-
if (
|
|
2493
|
-
const
|
|
2491
|
+
if (pt && i.kind !== "matrix") {
|
|
2492
|
+
const g = Bs(u.series.x, u.series.length);
|
|
2493
|
+
if (g >= 0) {
|
|
2494
|
+
const y = i.name ?? "?";
|
|
2494
2495
|
G(
|
|
2495
|
-
`x-unsorted-${
|
|
2496
|
-
`Series "${
|
|
2496
|
+
`x-unsorted-${y}`,
|
|
2497
|
+
`Series "${y}": x values are not sorted ascending (index ${g}). Binary search and path building assume sortedness; there is no automatic sorting (R-2.6).`
|
|
2497
2498
|
);
|
|
2498
2499
|
}
|
|
2499
2500
|
}
|
|
@@ -2509,21 +2510,21 @@ class ti {
|
|
|
2509
2510
|
stackAll() {
|
|
2510
2511
|
const t = /* @__PURE__ */ new Map();
|
|
2511
2512
|
for (const e of this.seriesInOrder()) {
|
|
2512
|
-
const n =
|
|
2513
|
+
const n = et(e.config);
|
|
2513
2514
|
if (n === void 0 || this.isHidden(e.config) || e.materialized === null || e.own === null) continue;
|
|
2514
2515
|
const i = t.get(n);
|
|
2515
2516
|
i === void 0 ? t.set(n, [e]) : i.push(e);
|
|
2516
2517
|
}
|
|
2517
2518
|
for (const e of t.values()) {
|
|
2518
|
-
const n =
|
|
2519
|
+
const n = et(e[0].config), i = [...this.series.values()].some((r) => et(r.config) === n && ge(r.config)), o = Ts(
|
|
2519
2520
|
e.map((r) => ({ ...r.materialized, y: r.own })),
|
|
2520
2521
|
i
|
|
2521
2522
|
);
|
|
2522
2523
|
e.forEach((r, l) => {
|
|
2523
2524
|
const a = o[l], c = { ...r.materialized, y: a.top, y0: a.bottom };
|
|
2524
2525
|
r.materialized = c, r.stacked = { value: a.value, total: a.total, normalize: i };
|
|
2525
|
-
const [
|
|
2526
|
-
r.extent !== null && (r.extent = { ...r.extent, yMin:
|
|
2526
|
+
const [h, m] = vn(c, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY);
|
|
2527
|
+
r.extent !== null && (r.extent = { ...r.extent, yMin: h, yMax: m });
|
|
2527
2528
|
});
|
|
2528
2529
|
}
|
|
2529
2530
|
}
|
|
@@ -2781,12 +2782,12 @@ class ti {
|
|
|
2781
2782
|
const l = o.config;
|
|
2782
2783
|
if (l.kind === "state") {
|
|
2783
2784
|
l.states.forEach((a, c) => {
|
|
2784
|
-
const
|
|
2785
|
-
if (
|
|
2786
|
-
|
|
2785
|
+
const h = `${a.label}\0${a.color}`, m = e.get(h);
|
|
2786
|
+
if (m !== void 0) {
|
|
2787
|
+
m.seriesIds.includes(o.order) || m.seriesIds.push(o.order), m.hidden && (m.hidden = this.isHidden(l)), l.name !== void 0 && !m.names.includes(l.name) && m.names.push(l.name);
|
|
2787
2788
|
return;
|
|
2788
2789
|
}
|
|
2789
|
-
const
|
|
2790
|
+
const p = {
|
|
2790
2791
|
id: `${o.order}:${c}`,
|
|
2791
2792
|
name: a.label,
|
|
2792
2793
|
hidden: this.isHidden(l),
|
|
@@ -2795,7 +2796,7 @@ class ti {
|
|
|
2795
2796
|
seriesIds: [o.order],
|
|
2796
2797
|
mark: i === null ? null : { dash: null, marker: null, swatches: [{ color: this.paint(a.color), hatch: i.get(a.label) ?? "none" }], ground: n.colorBg }
|
|
2797
2798
|
};
|
|
2798
|
-
e.set(
|
|
2799
|
+
e.set(h, p), t.push(p);
|
|
2799
2800
|
});
|
|
2800
2801
|
return;
|
|
2801
2802
|
}
|
|
@@ -2889,13 +2890,13 @@ class ti {
|
|
|
2889
2890
|
if (i.label === void 0 || i.label === "") continue;
|
|
2890
2891
|
const o = this.findAxis(i.orientation, this.limitAxisId(i));
|
|
2891
2892
|
if (o === null) continue;
|
|
2892
|
-
const r = i.kind === "line" ? this.limitAt(i, i.value) : (this.limitAt(i, i.from) + this.limitAt(i, i.to)) / 2, l = (e = this.measurer) == null ? void 0 : e.measure(i.label, It), a = (l == null ? void 0 : l.height) ?? 0, c = o.scale.toPx(r),
|
|
2893
|
+
const r = i.kind === "line" ? this.limitAt(i, i.value) : (this.limitAt(i, i.from) + this.limitAt(i, i.to)) / 2, l = (e = this.measurer) == null ? void 0 : e.measure(i.label, It), a = (l == null ? void 0 : l.height) ?? 0, c = o.scale.toPx(r), h = ((l == null ? void 0 : l.width) ?? 0) + 4 + (i.color === void 0 ? 0 : Qs);
|
|
2893
2894
|
t.push({
|
|
2894
2895
|
id: n,
|
|
2895
2896
|
axisKey: o.key,
|
|
2896
2897
|
px: c,
|
|
2897
|
-
labelLeft: Kn(c,
|
|
2898
|
-
width:
|
|
2898
|
+
labelLeft: Kn(c, h, this.cssWidth),
|
|
2899
|
+
width: h,
|
|
2899
2900
|
height: a,
|
|
2900
2901
|
inside: o.limitsInside,
|
|
2901
2902
|
label: i.label,
|
|
@@ -2919,102 +2920,102 @@ class ti {
|
|
|
2919
2920
|
return n.forEach((l) => {
|
|
2920
2921
|
const a = l.materialized;
|
|
2921
2922
|
if (a === null) return;
|
|
2922
|
-
const c = this.findAxis("x", l.config.xAxisId),
|
|
2923
|
-
if (c === null ||
|
|
2924
|
-
const
|
|
2923
|
+
const c = this.findAxis("x", l.config.xAxisId), h = this.findAxis("y", l.config.yAxisId);
|
|
2924
|
+
if (c === null || h === null) return;
|
|
2925
|
+
const m = o !== null && !o.includes(l.order), p = this.marksOf(l), d = {
|
|
2925
2926
|
x: a.x,
|
|
2926
2927
|
y: a.y,
|
|
2927
2928
|
length: a.length,
|
|
2928
2929
|
xScale: c.scale,
|
|
2929
|
-
yScale:
|
|
2930
|
+
yScale: h.scale,
|
|
2930
2931
|
color: this.colorFor(l),
|
|
2931
|
-
alpha:
|
|
2932
|
-
},
|
|
2933
|
-
switch (
|
|
2932
|
+
alpha: m ? 0.25 : 1
|
|
2933
|
+
}, f = l.config, u = f.kind === "line" || f.kind === "area" ? Qn(a, c.scale.domain[0], c.scale.domain[1], c.scale.m, c.scale.b, this.layout.plot.width) : a;
|
|
2934
|
+
switch (d.x = u.x, d.y = u.y, d.length = u.length, f.kind) {
|
|
2934
2935
|
case "line":
|
|
2935
2936
|
t.push({
|
|
2936
|
-
...
|
|
2937
|
+
...d,
|
|
2937
2938
|
kind: "line",
|
|
2938
|
-
strokeWidth:
|
|
2939
|
+
strokeWidth: f.strokeWidth,
|
|
2939
2940
|
// A dash of the caller's own wins over the one its place gives.
|
|
2940
|
-
dash:
|
|
2941
|
-
markers:
|
|
2942
|
-
step:
|
|
2943
|
-
marker:
|
|
2941
|
+
dash: f.dash ?? (p == null ? void 0 : p.dash),
|
|
2942
|
+
markers: f.markers,
|
|
2943
|
+
step: f.step,
|
|
2944
|
+
marker: p == null ? void 0 : p.marker
|
|
2944
2945
|
});
|
|
2945
2946
|
break;
|
|
2946
2947
|
case "area":
|
|
2947
2948
|
t.push({
|
|
2948
|
-
...
|
|
2949
|
+
...d,
|
|
2949
2950
|
kind: "area",
|
|
2950
|
-
y0:
|
|
2951
|
+
y0: u.y0,
|
|
2951
2952
|
baseline: 0,
|
|
2952
|
-
fillOpacity:
|
|
2953
|
-
strokeWidth:
|
|
2954
|
-
dash:
|
|
2955
|
-
hatch:
|
|
2953
|
+
fillOpacity: f.fillOpacity,
|
|
2954
|
+
strokeWidth: f.strokeWidth,
|
|
2955
|
+
dash: f.dash ?? (p == null ? void 0 : p.dash),
|
|
2956
|
+
hatch: p == null ? void 0 : p.hatch,
|
|
2956
2957
|
edges: l.stacked !== null
|
|
2957
2958
|
});
|
|
2958
2959
|
break;
|
|
2959
2960
|
case "bar": {
|
|
2960
|
-
const
|
|
2961
|
-
if (
|
|
2961
|
+
const g = r.get(l.order);
|
|
2962
|
+
if (g === void 0) break;
|
|
2962
2963
|
t.push({
|
|
2963
|
-
...
|
|
2964
|
+
...d,
|
|
2964
2965
|
kind: "bar",
|
|
2965
2966
|
y0: a.y0,
|
|
2966
2967
|
baseline: 0,
|
|
2967
|
-
offset:
|
|
2968
|
-
width:
|
|
2969
|
-
hatch:
|
|
2968
|
+
offset: g.offset,
|
|
2969
|
+
width: g.width,
|
|
2970
|
+
hatch: p == null ? void 0 : p.hatch,
|
|
2970
2971
|
edges: l.stacked !== null
|
|
2971
2972
|
});
|
|
2972
2973
|
break;
|
|
2973
2974
|
}
|
|
2974
2975
|
case "box": {
|
|
2975
|
-
const
|
|
2976
|
-
if (
|
|
2976
|
+
const g = r.get(l.order);
|
|
2977
|
+
if (g === void 0) break;
|
|
2977
2978
|
t.push({
|
|
2978
|
-
...
|
|
2979
|
+
...d,
|
|
2979
2980
|
kind: "box",
|
|
2980
2981
|
box: a.box,
|
|
2981
|
-
offset:
|
|
2982
|
-
width:
|
|
2983
|
-
hatch:
|
|
2982
|
+
offset: g.offset,
|
|
2983
|
+
width: g.width,
|
|
2984
|
+
hatch: p == null ? void 0 : p.hatch
|
|
2984
2985
|
});
|
|
2985
2986
|
break;
|
|
2986
2987
|
}
|
|
2987
2988
|
case "scatter":
|
|
2988
|
-
t.push({ ...
|
|
2989
|
+
t.push({ ...d, kind: "scatter", radius: f.radius, marker: p == null ? void 0 : p.marker });
|
|
2989
2990
|
break;
|
|
2990
2991
|
case "state": {
|
|
2991
|
-
const
|
|
2992
|
+
const g = this.lanePx(f, h);
|
|
2992
2993
|
t.push({
|
|
2993
|
-
...
|
|
2994
|
+
...d,
|
|
2994
2995
|
kind: "state",
|
|
2995
|
-
colors:
|
|
2996
|
-
laneTop:
|
|
2997
|
-
laneBottom:
|
|
2996
|
+
colors: f.states.map((y) => this.paint(y.color)),
|
|
2997
|
+
laneTop: g.top,
|
|
2998
|
+
laneBottom: g.bottom,
|
|
2998
2999
|
lastEnd: this.lastEnd(l, a, c),
|
|
2999
|
-
hatches: this.marked() ?
|
|
3000
|
+
hatches: this.marked() ? f.states.map((y) => (e ?? (e = this.stateHatches())).get(y.label) ?? "none") : null
|
|
3000
3001
|
});
|
|
3001
3002
|
break;
|
|
3002
3003
|
}
|
|
3003
3004
|
case "matrix": {
|
|
3004
|
-
const
|
|
3005
|
+
const g = Jt(f.coloring, this.theme ?? U).map((y) => this.paint(y));
|
|
3005
3006
|
t.push({
|
|
3006
|
-
...
|
|
3007
|
+
...d,
|
|
3007
3008
|
kind: "matrix",
|
|
3008
|
-
buckets: l.buckets ?? (l.buckets = Dn(a,
|
|
3009
|
-
colors:
|
|
3010
|
-
hatches: this.marked() ?
|
|
3009
|
+
buckets: l.buckets ?? (l.buckets = Dn(a, f.coloring, g.length)),
|
|
3010
|
+
colors: g,
|
|
3011
|
+
hatches: this.marked() ? g.map((y, b) => oe(b)) : null,
|
|
3011
3012
|
width: Zt(
|
|
3012
3013
|
l.step ?? 0,
|
|
3013
3014
|
c.scale.domain[1] - c.scale.domain[0]
|
|
3014
3015
|
),
|
|
3015
3016
|
height: Zt(
|
|
3016
3017
|
l.cellHeight ?? 0,
|
|
3017
|
-
|
|
3018
|
+
h.scale.domain[1] - h.scale.domain[0]
|
|
3018
3019
|
)
|
|
3019
3020
|
});
|
|
3020
3021
|
break;
|
|
@@ -3036,7 +3037,7 @@ class ti {
|
|
|
3036
3037
|
xAxisId: i.config.xAxisId,
|
|
3037
3038
|
step: i.step ?? 0,
|
|
3038
3039
|
fraction: Le(i.config),
|
|
3039
|
-
stack:
|
|
3040
|
+
stack: et(i.config)
|
|
3040
3041
|
}))
|
|
3041
3042
|
), n = /* @__PURE__ */ new Map();
|
|
3042
3043
|
for (const i of t) {
|
|
@@ -3152,20 +3153,20 @@ class ti {
|
|
|
3152
3153
|
this.releaseKey(), this.activeBy = null, this.share(null), !(this.hover === null && this.hoverKey === "") && (this.hover = null, this.hoverKey = "", this.markOverlayDirty(), this.pushHoverSnapshot());
|
|
3153
3154
|
}
|
|
3154
3155
|
hitTest(t, e) {
|
|
3155
|
-
var
|
|
3156
|
-
const n = ((
|
|
3156
|
+
var f;
|
|
3157
|
+
const n = ((f = this.tooltip) == null ? void 0 : f.mode) ?? "x", i = [];
|
|
3157
3158
|
let o;
|
|
3158
|
-
if (this.seriesInOrder().forEach((
|
|
3159
|
-
const
|
|
3160
|
-
if (
|
|
3161
|
-
const b =
|
|
3159
|
+
if (this.seriesInOrder().forEach((u, g) => {
|
|
3160
|
+
const y = u.materialized;
|
|
3161
|
+
if (y === null || y.length === 0 || this.isHidden(u.config)) return;
|
|
3162
|
+
const b = u.config, w = this.findAxis("x", b.xAxisId), N = this.findAxis("y", b.yAxisId);
|
|
3162
3163
|
if (w === null || N === null) return;
|
|
3163
|
-
const
|
|
3164
|
+
const L = w.scale.fromPx(t), F = N.scale.fromPx(e), I = this.hitIn(u, y, w, N, e, L, F, n);
|
|
3164
3165
|
I !== null && i.push({
|
|
3165
|
-
entry:
|
|
3166
|
+
entry: u,
|
|
3166
3167
|
index: I.index,
|
|
3167
|
-
color: I.color ?? this.colorFor(
|
|
3168
|
-
name: this.nameFor(
|
|
3168
|
+
color: I.color ?? this.colorFor(u),
|
|
3169
|
+
name: this.nameFor(u, g),
|
|
3169
3170
|
px: I.px,
|
|
3170
3171
|
py: I.py,
|
|
3171
3172
|
xValue: I.xValue,
|
|
@@ -3176,65 +3177,65 @@ class ti {
|
|
|
3176
3177
|
level: I.level,
|
|
3177
3178
|
segment: I.segment,
|
|
3178
3179
|
box: I.box,
|
|
3179
|
-
markX: b.kind === "box" ? I.px + this.centreOf((o ?? (o = this.placements())).get(
|
|
3180
|
+
markX: b.kind === "box" ? I.px + this.centreOf((o ?? (o = this.placements())).get(u.order), w) : void 0
|
|
3180
3181
|
});
|
|
3181
3182
|
}), i.length === 0) return null;
|
|
3182
|
-
const r = i.filter((
|
|
3183
|
+
const r = i.filter((u) => !u.areal), l = r.length > 0 ? r : i;
|
|
3183
3184
|
let a = l[0];
|
|
3184
3185
|
if (n === "nearest") {
|
|
3185
|
-
let
|
|
3186
|
-
const
|
|
3187
|
-
for (const
|
|
3188
|
-
const b = (
|
|
3189
|
-
(N <
|
|
3186
|
+
let u = Number.POSITIVE_INFINITY;
|
|
3187
|
+
const g = r.filter((y) => y.covers);
|
|
3188
|
+
for (const y of g.length > 0 ? g : r) {
|
|
3189
|
+
const b = (y.markX ?? y.px) - t, w = y.py - e, N = b * b + w * w;
|
|
3190
|
+
(N < u || N === u && y.covers) && (u = N, a = y);
|
|
3190
3191
|
}
|
|
3191
|
-
if (
|
|
3192
|
-
for (const
|
|
3193
|
-
if (
|
|
3194
|
-
a =
|
|
3192
|
+
if (g.length === 0 && u > Sn * Sn) {
|
|
3193
|
+
for (const y of i)
|
|
3194
|
+
if (y.areal) {
|
|
3195
|
+
a = y;
|
|
3195
3196
|
break;
|
|
3196
3197
|
}
|
|
3197
3198
|
}
|
|
3198
3199
|
} else {
|
|
3199
|
-
let
|
|
3200
|
-
for (const
|
|
3201
|
-
const
|
|
3202
|
-
|
|
3200
|
+
let u = Number.POSITIVE_INFINITY;
|
|
3201
|
+
for (const g of l) {
|
|
3202
|
+
const y = Math.abs(g.px - t);
|
|
3203
|
+
y < u && (u = y, a = g);
|
|
3203
3204
|
}
|
|
3204
3205
|
}
|
|
3205
3206
|
const c = n === "nearest" ? [a] : i.filter(
|
|
3206
3207
|
// An area is always included: it covers the pointer, otherwise it
|
|
3207
3208
|
// would not have reported a hit at all. Only points have to share the
|
|
3208
3209
|
// x position.
|
|
3209
|
-
(
|
|
3210
|
-
),
|
|
3211
|
-
var
|
|
3212
|
-
const
|
|
3210
|
+
(u) => u.areal || Math.abs(u.px - a.px) <= js
|
|
3211
|
+
), h = c.map((u) => {
|
|
3212
|
+
var y;
|
|
3213
|
+
const g = ((y = u.entry.rows) == null ? void 0 : y[u.index]) ?? u.index;
|
|
3213
3214
|
return {
|
|
3214
|
-
seriesName:
|
|
3215
|
-
color:
|
|
3216
|
-
xValue:
|
|
3217
|
-
yValue:
|
|
3218
|
-
datum: (
|
|
3219
|
-
index:
|
|
3220
|
-
level:
|
|
3221
|
-
segment:
|
|
3222
|
-
box:
|
|
3215
|
+
seriesName: u.name,
|
|
3216
|
+
color: u.color,
|
|
3217
|
+
xValue: u.xValue,
|
|
3218
|
+
yValue: u.yValue,
|
|
3219
|
+
datum: (u.entry.config.data ?? this.data)[g],
|
|
3220
|
+
index: g,
|
|
3221
|
+
level: u.level,
|
|
3222
|
+
segment: u.segment,
|
|
3223
|
+
box: u.box
|
|
3223
3224
|
};
|
|
3224
|
-
}),
|
|
3225
|
+
}), p = {
|
|
3225
3226
|
hit: {
|
|
3226
3227
|
xValue: a.xValue,
|
|
3227
|
-
points:
|
|
3228
|
+
points: h,
|
|
3228
3229
|
// An area's px is the beginning of its section; the crosshair and the
|
|
3229
3230
|
// tooltip stay with the pointer instead.
|
|
3230
3231
|
xPx: a.areal ? t : a.px,
|
|
3231
3232
|
yPx: a.py
|
|
3232
3233
|
},
|
|
3233
|
-
marker: c.filter((
|
|
3234
|
+
marker: c.filter((u) => u.marked).map((u) => ({ x: u.markX ?? u.px, y: u.py, color: u.color })),
|
|
3234
3235
|
mouseX: t,
|
|
3235
3236
|
mouseY: e
|
|
3236
3237
|
};
|
|
3237
|
-
return { key: c.map((
|
|
3238
|
+
return { key: c.map((u) => `${u.entry.order}:${u.index}`).join("|"), state: p, primary: a, chosen: c };
|
|
3238
3239
|
}
|
|
3239
3240
|
/* ---------- The keyboard's walk (charts-a11y, ADR-0030) ----------
|
|
3240
3241
|
|
|
@@ -3415,9 +3416,9 @@ class ti {
|
|
|
3415
3416
|
const t = this.hover;
|
|
3416
3417
|
if (t === null) return "";
|
|
3417
3418
|
const e = t.hit.points.map((l, a) => {
|
|
3418
|
-
var
|
|
3419
|
-
const c = this.hoverRows[a],
|
|
3420
|
-
return { order: this.hoverOrders[a], name:
|
|
3419
|
+
var p;
|
|
3420
|
+
const c = this.hoverRows[a], h = (p = c == null ? void 0 : c.box) == null ? void 0 : p.map((d) => `${d.label} ${d.value}`).join(", "), m = h === void 0 ? l.seriesName : `${l.seriesName}:`;
|
|
3421
|
+
return { order: this.hoverOrders[a], name: m, value: h ?? (c == null ? void 0 : c.value) ?? "", x: (c == null ? void 0 : c.x) ?? "" };
|
|
3421
3422
|
}), n = (r = this.emphasised()) == null ? void 0 : r.order;
|
|
3422
3423
|
e.sort((l, a) => +(a.order === n) - +(l.order === n));
|
|
3423
3424
|
const i = this.hoverTotals.map((l) => ({ name: l.name, value: l.value, x: "" })), o = this.hoverLimits.map((l) => ({ name: l.name, value: l.value, x: "" }));
|
|
@@ -3444,12 +3445,24 @@ class ti {
|
|
|
3444
3445
|
totalsOf(t) {
|
|
3445
3446
|
const e = [];
|
|
3446
3447
|
return t.forEach((n, i) => {
|
|
3447
|
-
const o =
|
|
3448
|
-
|
|
3449
|
-
const l = r.total[n.index], a = r.normalize ? (n.entry.config.format ?? Pt)(l) : this.formatY(n.entry, l);
|
|
3450
|
-
e.push({ after: i, name: this.wording.stackTotal, value: a });
|
|
3448
|
+
const o = et(n.entry.config), r = n.entry.stacked;
|
|
3449
|
+
o === void 0 || r === null || t.some((l, a) => a > i && et(l.entry.config) === o) || e.push({ after: i, name: this.wording.stackTotal, value: this.totalText(n.entry, r.total[n.index]) });
|
|
3451
3450
|
}), e;
|
|
3452
3451
|
}
|
|
3452
|
+
/** A stack's total as text, shared by the tooltip and the data table. */
|
|
3453
|
+
totalText(t, e) {
|
|
3454
|
+
return t.stacked.normalize ? (t.config.format ?? Pt)(e) : this.formatY(t, e);
|
|
3455
|
+
}
|
|
3456
|
+
/** The total of the stack `last` closes at the row's x, found in the
|
|
3457
|
+
members' own channels (the table's courses may be thinned); empty where
|
|
3458
|
+
no member reads there. */
|
|
3459
|
+
totalCell(t, e, n) {
|
|
3460
|
+
for (const i of t) {
|
|
3461
|
+
const o = i.materialized, r = dt(o.x, o.length, n), l = r < o.length && o.x[r] === n ? i.stacked.total[r] : void 0;
|
|
3462
|
+
if (l !== void 0 && !Number.isNaN(l)) return this.totalText(e, l);
|
|
3463
|
+
}
|
|
3464
|
+
return "";
|
|
3465
|
+
}
|
|
3453
3466
|
/** The summary is rebuilt after a layout, but not on every one: a zoom lays
|
|
3454
3467
|
out every frame, and the summary reads every visible point. */
|
|
3455
3468
|
scheduleSummary() {
|
|
@@ -3471,8 +3484,8 @@ class ti {
|
|
|
3471
3484
|
if (a.config.kind === "state") continue;
|
|
3472
3485
|
const c = this.visibleRange(a);
|
|
3473
3486
|
if (c === null) continue;
|
|
3474
|
-
const
|
|
3475
|
-
n.push(t.seriesExtent(
|
|
3487
|
+
const h = this.nameFor(a, i.indexOf(a));
|
|
3488
|
+
n.push(t.seriesExtent(h, this.formatY(a, c[0]), this.formatY(a, c[1])));
|
|
3476
3489
|
}
|
|
3477
3490
|
const l = this.limitTexts();
|
|
3478
3491
|
return l.length > 0 && n.push(t.limitList(l)), this.tooltip !== null && n.push(t.walkHelp), this.tooltip !== null && this.onSelect !== null && n.push(t.selectHelp), this.hasZoom() && n.push(t.zoomHelp), this.legend !== null && this.seriesNames().some((a) => a !== void 0) && n.push(t.legendHelp), n.join(" ");
|
|
@@ -3485,9 +3498,9 @@ class ti {
|
|
|
3485
3498
|
if (e === null || n === null) return null;
|
|
3486
3499
|
const [i, o] = n.scale.domain, r = e.w ?? ((c = t.stacked) == null ? void 0 : c.value) ?? e.y;
|
|
3487
3500
|
let l = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY;
|
|
3488
|
-
for (let
|
|
3489
|
-
const
|
|
3490
|
-
!Number.isFinite(
|
|
3501
|
+
for (let h = dt(e.x, e.length, i); h < e.length && e.x[h] <= o; h++) {
|
|
3502
|
+
const m = r[h];
|
|
3503
|
+
!Number.isFinite(m) || Number.isNaN(e.y[h]) || (m < l && (l = m), m > a && (a = m));
|
|
3491
3504
|
}
|
|
3492
3505
|
return l <= a ? [l, a] : null;
|
|
3493
3506
|
}
|
|
@@ -3546,25 +3559,30 @@ class ti {
|
|
|
3546
3559
|
let c = !1;
|
|
3547
3560
|
for (let d = 1; d < a.x.length && !c; d++) {
|
|
3548
3561
|
const f = a.x[d] - a.x[d - 1];
|
|
3549
|
-
c = f > 0 && f <
|
|
3562
|
+
c = f > 0 && f < it;
|
|
3550
3563
|
}
|
|
3551
|
-
const
|
|
3564
|
+
const h = n.tableCaption(this.xLabel(i, r), this.xLabel(i, l)), m = (d) => {
|
|
3565
|
+
const f = et(d.config);
|
|
3566
|
+
if (f === void 0 || d.stacked === null) return null;
|
|
3567
|
+
const u = t.filter((g) => et(g.config) === f);
|
|
3568
|
+
return u[u.length - 1] === d ? u : null;
|
|
3569
|
+
};
|
|
3552
3570
|
return {
|
|
3553
3571
|
key: `x:${i}`,
|
|
3554
|
-
caption: a.thinned ? `${
|
|
3572
|
+
caption: a.thinned ? `${h} ${n.downsampled(a.readings)}` : h,
|
|
3555
3573
|
columns: [
|
|
3556
3574
|
((p = this.findAxisConfig("x", i)) == null ? void 0 : p.label) ?? n.positionColumn,
|
|
3557
3575
|
...t.flatMap((d) => {
|
|
3558
|
-
const f = this.nameFor(d, e.indexOf(d));
|
|
3559
|
-
return d
|
|
3576
|
+
const f = this.nameFor(d, e.indexOf(d)), u = d.config.kind !== "box" ? [f] : this.boxParts(d, null).map((g) => `${f} – ${g.label}`);
|
|
3577
|
+
return m(d) === null ? u : [...u, n.stackTotal];
|
|
3560
3578
|
})
|
|
3561
3579
|
],
|
|
3562
3580
|
rows: a.x.map((d, f) => [
|
|
3563
3581
|
this.xLabel(i, d, c),
|
|
3564
|
-
...t.flatMap((
|
|
3565
|
-
var
|
|
3566
|
-
const y = a.courses[
|
|
3567
|
-
return
|
|
3582
|
+
...t.flatMap((u, g) => {
|
|
3583
|
+
var L;
|
|
3584
|
+
const y = a.courses[g], b = ((L = a.at[f]) == null ? void 0 : L[g]) ?? -1, w = u.config.kind === "box" ? this.boxCells(u, y, b) : [this.cellText(u, y, b)], N = m(u);
|
|
3585
|
+
return N === null ? w : [...w, this.totalCell(N, u, d)];
|
|
3568
3586
|
})
|
|
3569
3587
|
])
|
|
3570
3588
|
};
|
|
@@ -3574,7 +3592,7 @@ class ti {
|
|
|
3574
3592
|
ponytail: two boxes at one x read the first's numbers when thinned;
|
|
3575
3593
|
carry the index through downsample() should that ever matter. */
|
|
3576
3594
|
boxCells(t, e, n) {
|
|
3577
|
-
const i = t.materialized, o = n < 0 ? Number.NaN : e.y[n], r =
|
|
3595
|
+
const i = t.materialized, o = n < 0 ? Number.NaN : e.y[n], r = dt(i.x, i.length, e.x[n]), l = Number.isNaN(o) || i.box === null ? null : { ...Ln(i.box, r), median: o };
|
|
3578
3596
|
return this.boxParts(t, l).map((a) => a.value);
|
|
3579
3597
|
}
|
|
3580
3598
|
/** One cell: empty where the series has no reading there or a gap; a
|
|
@@ -3593,21 +3611,21 @@ class ti {
|
|
|
3593
3611
|
/** A matrix' table: its cells inside the visible x domain, by column and
|
|
3594
3612
|
row, with their value. */
|
|
3595
3613
|
matrixTable(t, e) {
|
|
3596
|
-
var
|
|
3614
|
+
var h, m;
|
|
3597
3615
|
const n = t.materialized, i = this.findAxis("x", t.config.xAxisId), o = this.findAxis("y", t.config.yAxisId);
|
|
3598
3616
|
if (n === null || n.w === null || i === null || o === null) return null;
|
|
3599
3617
|
const [r, l] = i.scale.domain, a = [];
|
|
3600
|
-
for (let
|
|
3601
|
-
const
|
|
3602
|
-
|
|
3618
|
+
for (let p = 0; p < n.length; p++) {
|
|
3619
|
+
const d = n.x[p], f = n.w[p];
|
|
3620
|
+
d < r || d > l || !Number.isFinite(f) || a.push([this.xLabel(i.id, d), o.format(n.y[p]), this.formatY(t, f)]);
|
|
3603
3621
|
}
|
|
3604
3622
|
const c = this.wording;
|
|
3605
3623
|
return {
|
|
3606
3624
|
key: `m:${t.order}`,
|
|
3607
3625
|
caption: c.tableCaption(i.format(r), i.format(l)),
|
|
3608
3626
|
columns: [
|
|
3609
|
-
((
|
|
3610
|
-
((
|
|
3627
|
+
((h = this.findAxisConfig("x", t.config.xAxisId)) == null ? void 0 : h.label) ?? c.positionColumn,
|
|
3628
|
+
((m = this.findAxisConfig("y", t.config.yAxisId)) == null ? void 0 : m.label) ?? c.rowColumn,
|
|
3611
3629
|
this.nameFor(t, e.indexOf(t))
|
|
3612
3630
|
],
|
|
3613
3631
|
rows: a
|
|
@@ -3701,7 +3719,7 @@ class ti {
|
|
|
3701
3719
|
const e = new Map([...this.series.values()].map((n) => [n, this.isHidden(n.config)]));
|
|
3702
3720
|
this.heldHidden = t;
|
|
3703
3721
|
for (const [n, i] of e)
|
|
3704
|
-
i !== this.isHidden(n.config) &&
|
|
3722
|
+
i !== this.isHidden(n.config) && et(n.config) !== void 0 && (this.materialsDirty = !0);
|
|
3705
3723
|
this.viewMoved();
|
|
3706
3724
|
}
|
|
3707
3725
|
viewMoved() {
|
|
@@ -3847,9 +3865,9 @@ class ti {
|
|
|
3847
3865
|
no y axis' format; every other value is read against its y axis and
|
|
3848
3866
|
written in its format. A series' own `format` comes before either. */
|
|
3849
3867
|
tooltipRow(t, e) {
|
|
3850
|
-
var p, d
|
|
3851
|
-
const n = t.entry.config, i = (
|
|
3852
|
-
return { value: o, x: c, chip: ((
|
|
3868
|
+
var m, p, d;
|
|
3869
|
+
const n = t.entry.config, i = (m = t.segment) == null ? void 0 : m.label, o = i !== void 0 && i !== "" ? i : this.formatY(t.entry, t.level ?? t.yValue), r = n.xAxisId === e ? "" : this.xLabel(n.xAxisId, t.xValue), a = n.kind === "matrix" && this.categoriesAt("y", n.yAxisId) !== void 0 ? ((p = this.findAxis("y", n.yAxisId)) == null ? void 0 : p.format(t.yValue)) ?? "" : "", c = [r, a].filter((f) => f !== "").join(", "), h = t.box === void 0 ? null : this.boxParts(t.entry, { ...t.box, median: t.yValue }).filter((f) => f.value !== "");
|
|
3870
|
+
return { value: o, x: c, chip: ((d = this.theme) == null ? void 0 : d.forced) === !0 ? this.tooltipChip(t, this.theme) : null, box: h };
|
|
3853
3871
|
}
|
|
3854
3872
|
/** A box's readings top to bottom as drawn (B9): the five, then mean,
|
|
3855
3873
|
notch, n and outliers - each only where the series has it. One list for
|
|
@@ -3898,23 +3916,23 @@ class ti {
|
|
|
3898
3916
|
for the right half of every segment the nearest point gives the wrong
|
|
3899
3917
|
answer. */
|
|
3900
3918
|
hitIn(t, e, n, i, o, r, l, a) {
|
|
3901
|
-
const c = t.config,
|
|
3919
|
+
const c = t.config, h = e.length;
|
|
3902
3920
|
if (c.kind === "state") {
|
|
3903
|
-
const
|
|
3904
|
-
if (o <
|
|
3905
|
-
const
|
|
3906
|
-
if (
|
|
3907
|
-
const
|
|
3908
|
-
if (Number.isNaN(
|
|
3909
|
-
const b = e.x[
|
|
3910
|
-
if (
|
|
3911
|
-
const N = c.states[
|
|
3921
|
+
const u = this.lanePx(c, i);
|
|
3922
|
+
if (o < u.top || o > u.bottom) return null;
|
|
3923
|
+
const g = cn(e.x, h, r);
|
|
3924
|
+
if (g < 0) return null;
|
|
3925
|
+
const y = e.y[g];
|
|
3926
|
+
if (Number.isNaN(y)) return null;
|
|
3927
|
+
const b = e.x[g], w = qn(e.x, h, g, this.lastEnd(t, e, n));
|
|
3928
|
+
if (g === h - 1 && !(r < w)) return null;
|
|
3929
|
+
const N = c.states[y | 0];
|
|
3912
3930
|
return {
|
|
3913
|
-
index:
|
|
3931
|
+
index: g,
|
|
3914
3932
|
px: n.scale.toPx(b),
|
|
3915
|
-
py: (
|
|
3933
|
+
py: (u.top + u.bottom) / 2,
|
|
3916
3934
|
xValue: b,
|
|
3917
|
-
yValue:
|
|
3935
|
+
yValue: y,
|
|
3918
3936
|
marked: !1,
|
|
3919
3937
|
areal: !0,
|
|
3920
3938
|
color: N == null ? void 0 : N.color,
|
|
@@ -3922,49 +3940,49 @@ class ti {
|
|
|
3922
3940
|
};
|
|
3923
3941
|
}
|
|
3924
3942
|
if (c.kind === "matrix") {
|
|
3925
|
-
const
|
|
3943
|
+
const u = Ss(
|
|
3926
3944
|
e.x,
|
|
3927
3945
|
e.y,
|
|
3928
|
-
|
|
3946
|
+
h,
|
|
3929
3947
|
r,
|
|
3930
3948
|
l,
|
|
3931
3949
|
Zt(t.step ?? 0, n.scale.domain[1] - n.scale.domain[0]),
|
|
3932
3950
|
Zt(t.cellHeight ?? 0, i.scale.domain[1] - i.scale.domain[0])
|
|
3933
3951
|
);
|
|
3934
|
-
if (
|
|
3935
|
-
const
|
|
3936
|
-
if (!Number.isFinite(
|
|
3937
|
-
const b = e.x[
|
|
3952
|
+
if (u < 0) return null;
|
|
3953
|
+
const g = e.w, y = g === null ? Number.NaN : g[u];
|
|
3954
|
+
if (!Number.isFinite(y)) return null;
|
|
3955
|
+
const b = e.x[u], w = e.y[u], N = Jt(c.coloring, this.theme ?? U);
|
|
3938
3956
|
return t.buckets ?? (t.buckets = Dn(e, c.coloring, N.length)), {
|
|
3939
|
-
index:
|
|
3957
|
+
index: u,
|
|
3940
3958
|
px: n.scale.toPx(b),
|
|
3941
3959
|
py: i.scale.toPx(w),
|
|
3942
|
-
color: N[t.buckets[
|
|
3960
|
+
color: N[t.buckets[u]],
|
|
3943
3961
|
xValue: b,
|
|
3944
3962
|
// yValue stays the position on the y axis; the level that carries the
|
|
3945
3963
|
// colour stands in a field of its own. Colour alone can transport no
|
|
3946
3964
|
// number - which is why the tooltip has to carry it.
|
|
3947
3965
|
yValue: w,
|
|
3948
|
-
level:
|
|
3966
|
+
level: y,
|
|
3949
3967
|
marked: !1,
|
|
3950
3968
|
areal: !0
|
|
3951
3969
|
};
|
|
3952
3970
|
}
|
|
3953
|
-
const
|
|
3954
|
-
if (
|
|
3955
|
-
const
|
|
3956
|
-
if (Number.isNaN(
|
|
3957
|
-
const
|
|
3971
|
+
const m = c.kind === "scatter" && a === "nearest" ? bs(e.x, e.y, h, r, l, n.scale, i.scale) : c.kind === "line" && c.step === !0 ? cn(e.x, h, r) : He(e.x, h, r);
|
|
3972
|
+
if (m < 0) return null;
|
|
3973
|
+
const p = e.y[m];
|
|
3974
|
+
if (Number.isNaN(p)) return null;
|
|
3975
|
+
const d = e.x[m], f = t.stacked === null || e.y0 === null ? Number.NaN : e.y0[m];
|
|
3958
3976
|
return {
|
|
3959
|
-
index:
|
|
3960
|
-
px: n.scale.toPx(
|
|
3961
|
-
py: i.scale.toPx(
|
|
3962
|
-
xValue:
|
|
3963
|
-
yValue: t.stacked === null ?
|
|
3977
|
+
index: m,
|
|
3978
|
+
px: n.scale.toPx(d),
|
|
3979
|
+
py: i.scale.toPx(p),
|
|
3980
|
+
xValue: d,
|
|
3981
|
+
yValue: t.stacked === null ? p : t.stacked.value[m],
|
|
3964
3982
|
marked: !0,
|
|
3965
3983
|
areal: !1,
|
|
3966
|
-
covers: l >= Math.min(
|
|
3967
|
-
box: e.box === null ? void 0 : Ln(e.box,
|
|
3984
|
+
covers: l >= Math.min(f, p) && l <= Math.max(f, p),
|
|
3985
|
+
box: e.box === null ? void 0 : Ln(e.box, m)
|
|
3968
3986
|
};
|
|
3969
3987
|
}
|
|
3970
3988
|
/** R-4.9: 12 px to the right of the crosshair, flipping at the right edge,
|
|
@@ -4040,7 +4058,7 @@ x(ti, "classTick", It);
|
|
|
4040
4058
|
const ei = fi(null);
|
|
4041
4059
|
function wt(s) {
|
|
4042
4060
|
const t = di(ei);
|
|
4043
|
-
if (t === null &&
|
|
4061
|
+
if (t === null && pt)
|
|
4044
4062
|
throw new Error(
|
|
4045
4063
|
`@umriss-ui/charts: <${s}> must be used inside a <Chart>.`
|
|
4046
4064
|
);
|
|
@@ -4126,7 +4144,7 @@ function xo(s) {
|
|
|
4126
4144
|
} = s, c = z(
|
|
4127
4145
|
() => n ?? { kind: "gradient", stops: yo },
|
|
4128
4146
|
[n]
|
|
4129
|
-
),
|
|
4147
|
+
), h = z(
|
|
4130
4148
|
() => ({
|
|
4131
4149
|
kind: "matrix",
|
|
4132
4150
|
// A row named by a string is given its place in materialisation.
|
|
@@ -4141,7 +4159,7 @@ function xo(s) {
|
|
|
4141
4159
|
}),
|
|
4142
4160
|
[t, e, c, i, o, r, l, a]
|
|
4143
4161
|
);
|
|
4144
|
-
return Tt("Matrix",
|
|
4162
|
+
return Tt("Matrix", h), null;
|
|
4145
4163
|
}
|
|
4146
4164
|
function Vt(s) {
|
|
4147
4165
|
const {
|
|
@@ -4177,7 +4195,7 @@ function pr(s) {
|
|
|
4177
4195
|
color: o,
|
|
4178
4196
|
inExtent: r = !0,
|
|
4179
4197
|
role: l = "specification"
|
|
4180
|
-
} = s, a = +s.from, c = +s.to,
|
|
4198
|
+
} = s, a = +s.from, c = +s.to, h = z(
|
|
4181
4199
|
() => ({
|
|
4182
4200
|
kind: "band",
|
|
4183
4201
|
from: a,
|
|
@@ -4192,7 +4210,7 @@ function pr(s) {
|
|
|
4192
4210
|
}),
|
|
4193
4211
|
[a, c, e, t, n, l, i, o, r]
|
|
4194
4212
|
);
|
|
4195
|
-
return ii("LimitBand",
|
|
4213
|
+
return ii("LimitBand", h), null;
|
|
4196
4214
|
}
|
|
4197
4215
|
function si(s) {
|
|
4198
4216
|
const {
|
|
@@ -4205,12 +4223,12 @@ function si(s) {
|
|
|
4205
4223
|
tone: l,
|
|
4206
4224
|
strokeWidth: a = 1.5,
|
|
4207
4225
|
dash: c,
|
|
4208
|
-
markers:
|
|
4209
|
-
step:
|
|
4210
|
-
} = s,
|
|
4226
|
+
markers: h = "auto",
|
|
4227
|
+
step: m
|
|
4228
|
+
} = s, p = q(s.value), d = z(
|
|
4211
4229
|
() => ({
|
|
4212
4230
|
kind: "line",
|
|
4213
|
-
accessor:
|
|
4231
|
+
accessor: p,
|
|
4214
4232
|
xAxisId: t,
|
|
4215
4233
|
yAxisId: e,
|
|
4216
4234
|
data: n,
|
|
@@ -4220,12 +4238,12 @@ function si(s) {
|
|
|
4220
4238
|
tone: l,
|
|
4221
4239
|
strokeWidth: a,
|
|
4222
4240
|
dash: c,
|
|
4223
|
-
markers:
|
|
4224
|
-
step:
|
|
4241
|
+
markers: h,
|
|
4242
|
+
step: m
|
|
4225
4243
|
}),
|
|
4226
|
-
[
|
|
4244
|
+
[p, t, e, n, i, o, r, l, a, c, h, m]
|
|
4227
4245
|
);
|
|
4228
|
-
return Tt("Line",
|
|
4246
|
+
return Tt("Line", d), null;
|
|
4229
4247
|
}
|
|
4230
4248
|
function oi(s) {
|
|
4231
4249
|
const {
|
|
@@ -4237,7 +4255,7 @@ function oi(s) {
|
|
|
4237
4255
|
color: r,
|
|
4238
4256
|
tone: l,
|
|
4239
4257
|
radius: a = 3
|
|
4240
|
-
} = s, c = q(s.value),
|
|
4258
|
+
} = s, c = q(s.value), h = z(
|
|
4241
4259
|
() => ({
|
|
4242
4260
|
kind: "scatter",
|
|
4243
4261
|
accessor: c,
|
|
@@ -4252,7 +4270,7 @@ function oi(s) {
|
|
|
4252
4270
|
}),
|
|
4253
4271
|
[c, t, e, n, i, o, r, l, a]
|
|
4254
4272
|
);
|
|
4255
|
-
return Tt("Scatter",
|
|
4273
|
+
return Tt("Scatter", h), null;
|
|
4256
4274
|
}
|
|
4257
4275
|
const bo = 1.128;
|
|
4258
4276
|
function De(s, t) {
|
|
@@ -4271,13 +4289,13 @@ function vo(s, t) {
|
|
|
4271
4289
|
return De(t.center, t.sigma);
|
|
4272
4290
|
const e = Math.max(0, Math.trunc(t.from)), n = Math.min(s.length, Math.trunc(t.to));
|
|
4273
4291
|
let i = 0, o = 0, r = 0, l = 0, a = Number.NaN;
|
|
4274
|
-
for (let
|
|
4275
|
-
const
|
|
4276
|
-
if (!Number.isFinite(
|
|
4292
|
+
for (let h = e; h < n; h++) {
|
|
4293
|
+
const m = s[h];
|
|
4294
|
+
if (!Number.isFinite(m)) {
|
|
4277
4295
|
a = Number.NaN;
|
|
4278
4296
|
continue;
|
|
4279
4297
|
}
|
|
4280
|
-
i +=
|
|
4298
|
+
i += m, o++, Number.isFinite(a) && (r += Math.abs(m - a), l++), a = m;
|
|
4281
4299
|
}
|
|
4282
4300
|
if (o === 0) return De(Number.NaN, Number.NaN);
|
|
4283
4301
|
const c = l === 0 ? 0 : r / l / bo;
|
|
@@ -4395,39 +4413,39 @@ function yr(s) {
|
|
|
4395
4413
|
tone: l,
|
|
4396
4414
|
rules: a,
|
|
4397
4415
|
zoneLines: c = !0,
|
|
4398
|
-
labelUpper:
|
|
4399
|
-
labelLower:
|
|
4400
|
-
violationName:
|
|
4401
|
-
onViolations:
|
|
4402
|
-
} = s,
|
|
4416
|
+
labelUpper: h,
|
|
4417
|
+
labelLower: m,
|
|
4418
|
+
violationName: p,
|
|
4419
|
+
onViolations: d
|
|
4420
|
+
} = s, f = Ee(q(s.value), ut), u = Ee(s.origin, Lo), g = z(() => {
|
|
4403
4421
|
const M = [];
|
|
4404
4422
|
for (let W = 0; W < t.length; W++) {
|
|
4405
|
-
const K =
|
|
4423
|
+
const K = f(t[W], W);
|
|
4406
4424
|
M.push(K ?? Number.NaN);
|
|
4407
4425
|
}
|
|
4408
4426
|
return M;
|
|
4409
|
-
}, [t,
|
|
4410
|
-
z(() => So(
|
|
4427
|
+
}, [t, f]), y = z(() => vo(g, u), [g, u]), b = Ee(
|
|
4428
|
+
z(() => So(g, y, a ?? {}), [g, y, a]),
|
|
4411
4429
|
Do
|
|
4412
|
-
), w = z(() => new Set(Mo(b)), [b]), N = X(
|
|
4430
|
+
), w = z(() => new Set(Mo(b)), [b]), N = X(d);
|
|
4413
4431
|
B(() => {
|
|
4414
|
-
N.current =
|
|
4415
|
-
}, [
|
|
4432
|
+
N.current = d;
|
|
4433
|
+
}, [d]), B(() => {
|
|
4416
4434
|
var M;
|
|
4417
4435
|
(M = N.current) == null || M.call(N, b);
|
|
4418
4436
|
}, [b]);
|
|
4419
|
-
const
|
|
4420
|
-
() => (M, W) => w.has(W) ?
|
|
4421
|
-
[w,
|
|
4437
|
+
const L = z(
|
|
4438
|
+
() => (M, W) => w.has(W) ? f(M, W) : null,
|
|
4439
|
+
[w, f]
|
|
4422
4440
|
), F = z(
|
|
4423
4441
|
() => w.size === 0 ? t : t.slice(),
|
|
4424
4442
|
[t, w]
|
|
4425
4443
|
), I = z(
|
|
4426
|
-
() => c ? wo(
|
|
4427
|
-
[c,
|
|
4428
|
-
), E = Number.isFinite(
|
|
4444
|
+
() => c ? wo(y, [1, 2]) : [],
|
|
4445
|
+
[c, y]
|
|
4446
|
+
), E = Number.isFinite(y.center);
|
|
4429
4447
|
return /* @__PURE__ */ C(At, { children: [
|
|
4430
|
-
/* @__PURE__ */ v(si, { value:
|
|
4448
|
+
/* @__PURE__ */ v(si, { value: f, data: t, xAxisId: e, yAxisId: n, name: i, format: o, color: r, tone: l }),
|
|
4431
4449
|
E && /* @__PURE__ */ C(At, { children: [
|
|
4432
4450
|
I.map((M) => /* @__PURE__ */ v(
|
|
4433
4451
|
Vt,
|
|
@@ -4449,18 +4467,18 @@ function yr(s) {
|
|
|
4449
4467
|
},
|
|
4450
4468
|
`zone-${M.k}-lower`
|
|
4451
4469
|
)),
|
|
4452
|
-
/* @__PURE__ */ v(Vt, { value:
|
|
4453
|
-
/* @__PURE__ */ v(Vt, { value:
|
|
4454
|
-
/* @__PURE__ */ v(Vt, { value:
|
|
4470
|
+
/* @__PURE__ */ v(Vt, { value: y.center, axisId: n, role: "control" }),
|
|
4471
|
+
/* @__PURE__ */ v(Vt, { value: y.upper, axisId: n, role: "control", label: h }),
|
|
4472
|
+
/* @__PURE__ */ v(Vt, { value: y.lower, axisId: n, role: "control", label: m })
|
|
4455
4473
|
] }),
|
|
4456
4474
|
/* @__PURE__ */ v(
|
|
4457
4475
|
oi,
|
|
4458
4476
|
{
|
|
4459
|
-
value:
|
|
4477
|
+
value: L,
|
|
4460
4478
|
data: F,
|
|
4461
4479
|
xAxisId: e,
|
|
4462
4480
|
yAxisId: n,
|
|
4463
|
-
name:
|
|
4481
|
+
name: p,
|
|
4464
4482
|
format: o,
|
|
4465
4483
|
tone: "alarm",
|
|
4466
4484
|
radius: 4
|
|
@@ -4487,25 +4505,25 @@ function Eo({ scene: s }) {
|
|
|
4487
4505
|
po("DataTable", t);
|
|
4488
4506
|
const e = ht(s.subscribeLayout, s.getLayoutSnapshot, s.getLayoutServerSnapshot), n = e.dataTable, i = (n == null ? void 0 : n.open) === !0, o = i ? s.dataTableGroups() : [], r = X(null), [l, a] = zt(null);
|
|
4489
4507
|
if (ce(() => {
|
|
4490
|
-
var
|
|
4491
|
-
const
|
|
4492
|
-
if (
|
|
4493
|
-
const
|
|
4494
|
-
a((
|
|
4508
|
+
var p, d;
|
|
4509
|
+
const h = (d = (p = r.current) == null ? void 0 : p.parentElement) == null ? void 0 : d.querySelector(":scope > .uc-plot");
|
|
4510
|
+
if (h == null) return;
|
|
4511
|
+
const m = { top: h.offsetTop, height: h.offsetHeight };
|
|
4512
|
+
a((f) => f !== null && f.top === m.top && f.height === m.height ? f : m);
|
|
4495
4513
|
}, [e, i]), n === null) return null;
|
|
4496
4514
|
const c = l === null ? void 0 : { top: l.top, height: l.height };
|
|
4497
4515
|
return /* @__PURE__ */ C(At, { children: [
|
|
4498
4516
|
e.legend === null && /* @__PURE__ */ v("div", { className: "uc-legend uc-legend-top", children: /* @__PURE__ */ v(li, { scene: s, state: n }) }),
|
|
4499
4517
|
i && // A tab stop of its own: the panel scrolls, and a keyboard has to be
|
|
4500
4518
|
// able to scroll it.
|
|
4501
|
-
/* @__PURE__ */ v("div", { ref: r, id: n.id, className: "uc-data-panel", style: c, tabIndex: 0, children: o.map((
|
|
4502
|
-
/* @__PURE__ */ v("caption", { children:
|
|
4503
|
-
/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ v("tr", { children:
|
|
4504
|
-
/* @__PURE__ */ v("tbody", { children:
|
|
4505
|
-
/* @__PURE__ */ v("th", { scope: "row", children:
|
|
4506
|
-
|
|
4507
|
-
] },
|
|
4508
|
-
] },
|
|
4519
|
+
/* @__PURE__ */ v("div", { ref: r, id: n.id, className: "uc-data-panel", style: c, tabIndex: 0, children: o.map((h) => /* @__PURE__ */ C("table", { className: "uc-data-table", children: [
|
|
4520
|
+
/* @__PURE__ */ v("caption", { children: h.caption }),
|
|
4521
|
+
/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ v("tr", { children: h.columns.map((m, p) => /* @__PURE__ */ v("th", { scope: "col", children: m }, p)) }) }),
|
|
4522
|
+
/* @__PURE__ */ v("tbody", { children: h.rows.map((m, p) => /* @__PURE__ */ C("tr", { children: [
|
|
4523
|
+
/* @__PURE__ */ v("th", { scope: "row", children: m[0] }),
|
|
4524
|
+
m.slice(1).map((d, f) => /* @__PURE__ */ v("td", { children: d }, f))
|
|
4525
|
+
] }, p)) })
|
|
4526
|
+
] }, h.key)) })
|
|
4509
4527
|
] });
|
|
4510
4528
|
}
|
|
4511
4529
|
function xr() {
|
|
@@ -4636,31 +4654,31 @@ function vr(s) {
|
|
|
4636
4654
|
}
|
|
4637
4655
|
const Po = 1e4;
|
|
4638
4656
|
function wr(s, t, e) {
|
|
4639
|
-
const [n, i] = typeof t == "function" ? [t, e ?? {}] : [(
|
|
4657
|
+
const [n, i] = typeof t == "function" ? [t, e ?? {}] : [(y) => y, t ?? {}];
|
|
4640
4658
|
bt(i.width === void 0 || i.width > 0 && Number.isFinite(i.width), "bin: `width` has to be a number above 0."), bt(i.count === void 0 || i.count >= 1, "bin: `count` has to be at least 1.");
|
|
4641
4659
|
const o = [];
|
|
4642
|
-
for (const
|
|
4643
|
-
const b = n(
|
|
4660
|
+
for (const y of s) {
|
|
4661
|
+
const b = n(y);
|
|
4644
4662
|
typeof b == "number" && Number.isFinite(b) && o.push(b);
|
|
4645
4663
|
}
|
|
4646
4664
|
const r = i.domain;
|
|
4647
4665
|
if (r === void 0 ? o.length === 0 : !Number.isFinite(r[0] + r[1])) return [];
|
|
4648
|
-
const l = r === void 0 ? o.reduce((
|
|
4649
|
-
bt(
|
|
4650
|
-
const
|
|
4651
|
-
{ length:
|
|
4652
|
-
(
|
|
4653
|
-
),
|
|
4654
|
-
for (const
|
|
4655
|
-
if (
|
|
4656
|
-
let b = Math.min(
|
|
4657
|
-
for (; b <
|
|
4658
|
-
for (; b > 0 &&
|
|
4659
|
-
|
|
4660
|
-
}
|
|
4661
|
-
return
|
|
4662
|
-
const w =
|
|
4663
|
-
return { from: w, to: N, x: (w + N) / 2, count:
|
|
4666
|
+
const l = r === void 0 ? o.reduce((y, b) => Math.min(y, b)) : Math.min(r[0], r[1]), a = r === void 0 ? o.reduce((y, b) => Math.max(y, b)) : Math.max(r[0], r[1]), c = Math.max(1, Math.floor(i.count ?? 10)), h = i.width ?? (r !== void 0 && a > l ? (a - l) / c : vt(a - l, c)), m = r === void 0 ? Math.floor(l / h) * h : l, p = Math.max(r === void 0 ? Math.ceil(a / h) * h : a, m + h), d = Math.max(1, Math.ceil((p - m) / h - 1e-9));
|
|
4667
|
+
bt(d <= Po, `bin: ${d} bins - the width is far too small for the span.`);
|
|
4668
|
+
const f = Math.min(20, Math.max(Mt(h), Mt(m))), u = Array.from(
|
|
4669
|
+
{ length: d + 1 },
|
|
4670
|
+
(y, b) => r !== void 0 && b === d ? p : Number((m + b * h).toFixed(f)) + 0
|
|
4671
|
+
), g = new Array(d).fill(0);
|
|
4672
|
+
for (const y of o) {
|
|
4673
|
+
if (y < u[0] || y > u[d]) continue;
|
|
4674
|
+
let b = Math.min(d - 1, Math.max(0, Math.floor((y - m) / h)));
|
|
4675
|
+
for (; b < d - 1 && y >= u[b + 1]; ) b++;
|
|
4676
|
+
for (; b > 0 && y < u[b]; ) b--;
|
|
4677
|
+
g[b] = g[b] + 1;
|
|
4678
|
+
}
|
|
4679
|
+
return g.map((y, b) => {
|
|
4680
|
+
const w = u[b], N = u[b + 1];
|
|
4681
|
+
return { from: w, to: N, x: (w + N) / 2, count: y };
|
|
4664
4682
|
});
|
|
4665
4683
|
}
|
|
4666
4684
|
const Co = {
|
|
@@ -4673,21 +4691,21 @@ function kr(s, t = {}) {
|
|
|
4673
4691
|
!Number.isFinite(e.collectRank) || e.remainderName !== void 0,
|
|
4674
4692
|
"pareto: a collect rank needs `remainderName` - the package brings no name for the remainder."
|
|
4675
4693
|
);
|
|
4676
|
-
const n = s.map((
|
|
4677
|
-
let
|
|
4678
|
-
for (let
|
|
4679
|
-
const
|
|
4680
|
-
|
|
4681
|
-
name:
|
|
4682
|
-
value:
|
|
4683
|
-
index:
|
|
4684
|
-
share: a === 0 ? 0 :
|
|
4685
|
-
cumulative: a === 0 ? 0 :
|
|
4686
|
-
remainder: r.length > 0 &&
|
|
4694
|
+
const n = s.map((d, f) => ({ item: d, inputIndex: f })).sort((d, f) => f.item.value - d.item.value || d.inputIndex - f.inputIndex).map(({ item: d }) => d), i = Math.max(0, Math.min(n.length, Math.floor(e.collectRank))), o = n.slice(0, i), r = n.slice(i), l = r.length === 0 ? o : [...o, { name: e.remainderName ?? "", value: r.reduce((d, f) => d + f.value, 0) }], a = l.reduce((d, f) => d + f.value, 0), c = [];
|
|
4695
|
+
let h = 0;
|
|
4696
|
+
for (let d = 0; d < l.length; d++) {
|
|
4697
|
+
const f = l[d];
|
|
4698
|
+
h += f.value, c.push({
|
|
4699
|
+
name: f.name,
|
|
4700
|
+
value: f.value,
|
|
4701
|
+
index: d,
|
|
4702
|
+
share: a === 0 ? 0 : f.value / a,
|
|
4703
|
+
cumulative: a === 0 ? 0 : h / a,
|
|
4704
|
+
remainder: r.length > 0 && d === l.length - 1
|
|
4687
4705
|
});
|
|
4688
4706
|
}
|
|
4689
|
-
const
|
|
4690
|
-
return { entries: c, total: a, cutoffIndex:
|
|
4707
|
+
const m = Math.abs(e.cutoff) * 1e-12, p = c.findIndex((d) => d.cumulative >= e.cutoff - m);
|
|
4708
|
+
return { entries: c, total: a, cutoffIndex: p };
|
|
4691
4709
|
}
|
|
4692
4710
|
const Ho = 240, te = 220, Wo = 240, Ro = 0.8, ee = 6;
|
|
4693
4711
|
function Vo(s) {
|
|
@@ -4799,10 +4817,10 @@ function Uo(s, t, e, n) {
|
|
|
4799
4817
|
/* @__PURE__ */ v("span", { className: "uc-axis-line" }),
|
|
4800
4818
|
n && s.ticks.map((c) => {
|
|
4801
4819
|
if (r === "y") {
|
|
4802
|
-
const
|
|
4803
|
-
return /* @__PURE__ */ C("span", { className: "uc-tick", style: { top: `${
|
|
4820
|
+
const p = Math.round(c.px - i.y), d = t.some((f) => !f.inside && Math.abs(f.px - c.px) < f.height);
|
|
4821
|
+
return /* @__PURE__ */ C("span", { className: "uc-tick", style: { top: `${p}px` }, children: [
|
|
4804
4822
|
/* @__PURE__ */ v("span", { className: "uc-tick-mark" }),
|
|
4805
|
-
!
|
|
4823
|
+
!d && /* @__PURE__ */ v(
|
|
4806
4824
|
"span",
|
|
4807
4825
|
{
|
|
4808
4826
|
className: "uc-tick-label",
|
|
@@ -4812,17 +4830,17 @@ function Uo(s, t, e, n) {
|
|
|
4812
4830
|
)
|
|
4813
4831
|
] }, c.value);
|
|
4814
4832
|
}
|
|
4815
|
-
const
|
|
4816
|
-
(
|
|
4833
|
+
const h = Math.round(c.px - i.x), m = t.some(
|
|
4834
|
+
(p) => p.labelLeft < c.labelLeft + c.labelWidth && c.labelLeft < p.labelLeft + p.width
|
|
4817
4835
|
);
|
|
4818
|
-
return /* @__PURE__ */ C("span", { className: "uc-tick", style: { left: `${
|
|
4836
|
+
return /* @__PURE__ */ C("span", { className: "uc-tick", style: { left: `${h}px` }, children: [
|
|
4819
4837
|
/* @__PURE__ */ v("span", { className: "uc-tick-mark" }),
|
|
4820
|
-
!
|
|
4838
|
+
!m && /* @__PURE__ */ v(
|
|
4821
4839
|
"span",
|
|
4822
4840
|
{
|
|
4823
4841
|
className: "uc-tick-label",
|
|
4824
4842
|
style: {
|
|
4825
|
-
left: `${Math.round(c.labelLeft - i.x) -
|
|
4843
|
+
left: `${Math.round(c.labelLeft - i.x) - h}px`,
|
|
4826
4844
|
[o === "top" ? "bottom" : "top"]: `${a}px`
|
|
4827
4845
|
},
|
|
4828
4846
|
children: c.label
|
|
@@ -4830,14 +4848,14 @@ function Uo(s, t, e, n) {
|
|
|
4830
4848
|
)
|
|
4831
4849
|
] }, c.value);
|
|
4832
4850
|
}),
|
|
4833
|
-
s.breaks.map((c,
|
|
4851
|
+
s.breaks.map((c, h) => /* @__PURE__ */ v(
|
|
4834
4852
|
"span",
|
|
4835
4853
|
{
|
|
4836
4854
|
className: "uc-break",
|
|
4837
4855
|
style: { left: `${Math.round(c - i.x)}px` },
|
|
4838
4856
|
"aria-hidden": "true"
|
|
4839
4857
|
},
|
|
4840
|
-
`break-${
|
|
4858
|
+
`break-${h}`
|
|
4841
4859
|
)),
|
|
4842
4860
|
t.map(
|
|
4843
4861
|
(c) => r === "y" ? /* @__PURE__ */ v(
|
|
@@ -4973,68 +4991,68 @@ function jo(s) {
|
|
|
4973
4991
|
className: l,
|
|
4974
4992
|
style: a,
|
|
4975
4993
|
onPerf: c,
|
|
4976
|
-
syncId:
|
|
4977
|
-
empty:
|
|
4978
|
-
loading:
|
|
4979
|
-
wording:
|
|
4980
|
-
encoding:
|
|
4981
|
-
children:
|
|
4982
|
-
} = s,
|
|
4994
|
+
syncId: h,
|
|
4995
|
+
empty: m,
|
|
4996
|
+
loading: p = !1,
|
|
4997
|
+
wording: d,
|
|
4998
|
+
encoding: f = "color",
|
|
4999
|
+
children: u
|
|
5000
|
+
} = s, g = z(() => ({ ...jn, ...d }), [d]), y = m ?? g.empty, b = X(null), w = X(null), N = X(null), L = X(null), F = X(null), I = X(null), E = Ve(), M = typeof o == "number" ? void 0 : o, W = typeof o == "number" ? o : void 0, K = W ?? (M == null ? void 0 : M.top), st = W ?? (M == null ? void 0 : M.right), j = W ?? (M == null ? void 0 : M.bottom), A = W ?? (M == null ? void 0 : M.left), S = z(
|
|
4983
5001
|
() => ({
|
|
4984
5002
|
top: K ?? 8,
|
|
4985
|
-
right:
|
|
5003
|
+
right: st ?? 8,
|
|
4986
5004
|
bottom: j ?? 8,
|
|
4987
5005
|
left: A ?? 8
|
|
4988
5006
|
}),
|
|
4989
|
-
[K,
|
|
5007
|
+
[K, st, j, A]
|
|
4990
5008
|
);
|
|
4991
5009
|
r === void 0 && G(
|
|
4992
5010
|
"chart-arialabel",
|
|
4993
5011
|
"Chart without ariaLabel - please set a meaningful description (R-7.6)."
|
|
4994
5012
|
), B(() => {
|
|
4995
|
-
const $ = b.current, Y = w.current, H = N.current, P =
|
|
5013
|
+
const $ = b.current, Y = w.current, H = N.current, P = L.current;
|
|
4996
5014
|
if (!$ || !Y || !H || !P) return;
|
|
4997
5015
|
e.bind(Y, H, P, $), e.bindA11y(F.current, I.current);
|
|
4998
|
-
const
|
|
4999
|
-
e.requestResize(
|
|
5000
|
-
const
|
|
5016
|
+
const ot = Y.getBoundingClientRect();
|
|
5017
|
+
e.requestResize(ot.width, ot.height);
|
|
5018
|
+
const rt = new ResizeObserver((lt) => {
|
|
5001
5019
|
var tt;
|
|
5002
|
-
const
|
|
5003
|
-
if (
|
|
5004
|
-
const
|
|
5005
|
-
|
|
5020
|
+
const ft = lt[lt.length - 1];
|
|
5021
|
+
if (ft === void 0) return;
|
|
5022
|
+
const nt = (tt = ft.contentBoxSize) == null ? void 0 : tt[0];
|
|
5023
|
+
nt !== void 0 ? e.requestResize(nt.inlineSize, nt.blockSize) : e.requestResize(ft.contentRect.width, ft.contentRect.height);
|
|
5006
5024
|
});
|
|
5007
|
-
|
|
5025
|
+
rt.observe(Y);
|
|
5008
5026
|
const O = () => e.pointerLeave();
|
|
5009
5027
|
window.addEventListener("blur", O);
|
|
5010
|
-
const Q = (
|
|
5011
|
-
Y.contains(
|
|
5028
|
+
const Q = (lt) => {
|
|
5029
|
+
Y.contains(lt.target) || e.pointerLeave();
|
|
5012
5030
|
};
|
|
5013
5031
|
document.addEventListener("pointerdown", Q);
|
|
5014
|
-
const J = (
|
|
5032
|
+
const J = (lt) => e.wheel(lt);
|
|
5015
5033
|
return Y.addEventListener("wheel", J, { passive: !1 }), () => {
|
|
5016
|
-
Y.removeEventListener("wheel", J), window.removeEventListener("blur", O), document.removeEventListener("pointerdown", Q),
|
|
5034
|
+
Y.removeEventListener("wheel", J), window.removeEventListener("blur", O), document.removeEventListener("pointerdown", Q), rt.disconnect(), e.unbind();
|
|
5017
5035
|
};
|
|
5018
5036
|
}, [e]), B(() => {
|
|
5019
5037
|
e.setData(t);
|
|
5020
5038
|
}, [e, t]), B(() => {
|
|
5021
5039
|
e.setPadding(S);
|
|
5022
5040
|
}, [e, S]), B(() => {
|
|
5023
|
-
e.setWording(
|
|
5024
|
-
}, [e,
|
|
5025
|
-
e.setEncoding(
|
|
5026
|
-
}, [e,
|
|
5041
|
+
e.setWording(g);
|
|
5042
|
+
}, [e, g]), B(() => {
|
|
5043
|
+
e.setEncoding(f);
|
|
5044
|
+
}, [e, f]), B(() => {
|
|
5027
5045
|
e.setOnPerf(c ?? null);
|
|
5028
5046
|
}, [e, c]), B(() => {
|
|
5029
|
-
e.setLoading(
|
|
5030
|
-
}, [e,
|
|
5047
|
+
e.setLoading(p);
|
|
5048
|
+
}, [e, p]), B(() => (e.setSyncId(h ?? null), () => e.setSyncId(null)), [e, h]), B(() => {
|
|
5031
5049
|
e.validate();
|
|
5032
5050
|
});
|
|
5033
5051
|
const k = ht(
|
|
5034
5052
|
e.subscribeHover,
|
|
5035
5053
|
() => e.getHoverSnapshot().tooltip !== null,
|
|
5036
5054
|
() => !1
|
|
5037
|
-
),
|
|
5055
|
+
), D = ht(e.subscribeLayout, () => k || e.keyed(), () => !1), R = ht(
|
|
5038
5056
|
e.subscribeLayout,
|
|
5039
5057
|
() => {
|
|
5040
5058
|
const $ = e.getLayoutSnapshot();
|
|
@@ -5062,14 +5080,14 @@ function jo(s) {
|
|
|
5062
5080
|
{
|
|
5063
5081
|
ref: w,
|
|
5064
5082
|
className: "uc-plot",
|
|
5065
|
-
role:
|
|
5066
|
-
"aria-roledescription":
|
|
5083
|
+
role: D ? "application" : "img",
|
|
5084
|
+
"aria-roledescription": D ? g.roleDescription : void 0,
|
|
5067
5085
|
"aria-label": r,
|
|
5068
5086
|
"aria-describedby": E,
|
|
5069
|
-
"aria-busy":
|
|
5087
|
+
"aria-busy": p || void 0,
|
|
5070
5088
|
"data-stale": R || void 0,
|
|
5071
5089
|
"data-arriving": V || void 0,
|
|
5072
|
-
tabIndex:
|
|
5090
|
+
tabIndex: D ? 0 : void 0,
|
|
5073
5091
|
onKeyDown: ($) => {
|
|
5074
5092
|
e.key($.nativeEvent) && $.preventDefault();
|
|
5075
5093
|
},
|
|
@@ -5088,16 +5106,16 @@ function jo(s) {
|
|
|
5088
5106
|
},
|
|
5089
5107
|
children: [
|
|
5090
5108
|
/* @__PURE__ */ v("canvas", { ref: N, className: "uc-layer-series", "aria-hidden": "true" }),
|
|
5091
|
-
/* @__PURE__ */ v("canvas", { ref:
|
|
5092
|
-
/* @__PURE__ */ v(qo, { scene: e, empty:
|
|
5109
|
+
/* @__PURE__ */ v("canvas", { ref: L, className: "uc-layer-overlay", "aria-hidden": "true" }),
|
|
5110
|
+
/* @__PURE__ */ v(qo, { scene: e, empty: y, silhouette: T }),
|
|
5093
5111
|
/* @__PURE__ */ v(Xo, { scene: e })
|
|
5094
5112
|
]
|
|
5095
5113
|
}
|
|
5096
5114
|
),
|
|
5097
|
-
/* @__PURE__ */ v(Qo, { scene: e, plotRef: w, label:
|
|
5115
|
+
/* @__PURE__ */ v(Qo, { scene: e, plotRef: w, label: g.showAll }),
|
|
5098
5116
|
/* @__PURE__ */ v("div", { ref: F, className: "uc-sr", "aria-live": "polite" }),
|
|
5099
5117
|
/* @__PURE__ */ v("div", { ref: I, id: E, className: "uc-sr" }),
|
|
5100
|
-
|
|
5118
|
+
u
|
|
5101
5119
|
]
|
|
5102
5120
|
}
|
|
5103
5121
|
) });
|
|
@@ -5161,17 +5179,17 @@ function tr(s) {
|
|
|
5161
5179
|
grid: l,
|
|
5162
5180
|
ticks: a,
|
|
5163
5181
|
categories: c,
|
|
5164
|
-
categoryLabel:
|
|
5165
|
-
time:
|
|
5166
|
-
calendar:
|
|
5167
|
-
zoomable:
|
|
5168
|
-
zoomLimits:
|
|
5169
|
-
} = s,
|
|
5182
|
+
categoryLabel: h,
|
|
5183
|
+
time: m,
|
|
5184
|
+
calendar: p,
|
|
5185
|
+
zoomable: d,
|
|
5186
|
+
zoomLimits: f
|
|
5187
|
+
} = s, u = f == null ? void 0 : f.min, g = f == null ? void 0 : f.max, y = q(s.value), b = z(
|
|
5170
5188
|
() => ({
|
|
5171
5189
|
id: t,
|
|
5172
5190
|
orientation: "x",
|
|
5173
5191
|
position: e,
|
|
5174
|
-
accessor:
|
|
5192
|
+
accessor: y,
|
|
5175
5193
|
label: n,
|
|
5176
5194
|
tickCount: i,
|
|
5177
5195
|
tickFormat: o,
|
|
@@ -5180,13 +5198,13 @@ function tr(s) {
|
|
|
5180
5198
|
grid: l,
|
|
5181
5199
|
ticks: a,
|
|
5182
5200
|
categories: c,
|
|
5183
|
-
categoryLabel:
|
|
5184
|
-
time:
|
|
5185
|
-
calendar:
|
|
5186
|
-
zoomable:
|
|
5187
|
-
zoomLimits:
|
|
5201
|
+
categoryLabel: h,
|
|
5202
|
+
time: m,
|
|
5203
|
+
calendar: p,
|
|
5204
|
+
zoomable: d,
|
|
5205
|
+
zoomLimits: u === void 0 || g === void 0 ? void 0 : { min: u, max: g }
|
|
5188
5206
|
}),
|
|
5189
|
-
[t, e,
|
|
5207
|
+
[t, e, y, n, i, o, r, l, a, c, h, m, p, d, u, g]
|
|
5190
5208
|
);
|
|
5191
5209
|
return ni("XAxis", b), null;
|
|
5192
5210
|
}
|
|
@@ -5201,9 +5219,9 @@ function er(s) {
|
|
|
5201
5219
|
grid: l,
|
|
5202
5220
|
ticks: a,
|
|
5203
5221
|
categories: c,
|
|
5204
|
-
categoryLabel:
|
|
5205
|
-
alignTicks:
|
|
5206
|
-
} = s,
|
|
5222
|
+
categoryLabel: h,
|
|
5223
|
+
alignTicks: m
|
|
5224
|
+
} = s, p = z(
|
|
5207
5225
|
() => ({
|
|
5208
5226
|
id: t,
|
|
5209
5227
|
orientation: "y",
|
|
@@ -5215,12 +5233,12 @@ function er(s) {
|
|
|
5215
5233
|
grid: l,
|
|
5216
5234
|
ticks: a,
|
|
5217
5235
|
categories: c,
|
|
5218
|
-
categoryLabel:
|
|
5219
|
-
alignTicks:
|
|
5236
|
+
categoryLabel: h,
|
|
5237
|
+
alignTicks: m
|
|
5220
5238
|
}),
|
|
5221
|
-
[t, e, n, i, o, r, l, a, c,
|
|
5239
|
+
[t, e, n, i, o, r, l, a, c, h, m]
|
|
5222
5240
|
);
|
|
5223
|
-
return ni("YAxis",
|
|
5241
|
+
return ni("YAxis", p), null;
|
|
5224
5242
|
}
|
|
5225
5243
|
function nr(s) {
|
|
5226
5244
|
const {
|
|
@@ -5233,14 +5251,14 @@ function nr(s) {
|
|
|
5233
5251
|
color: l,
|
|
5234
5252
|
tone: a,
|
|
5235
5253
|
stack: c,
|
|
5236
|
-
normalize:
|
|
5237
|
-
fillOpacity:
|
|
5238
|
-
strokeWidth:
|
|
5239
|
-
dash:
|
|
5240
|
-
} = s,
|
|
5254
|
+
normalize: h,
|
|
5255
|
+
fillOpacity: m = 0.18,
|
|
5256
|
+
strokeWidth: p = 1.5,
|
|
5257
|
+
dash: d
|
|
5258
|
+
} = s, f = q(s.value), u = z(
|
|
5241
5259
|
() => ({
|
|
5242
5260
|
kind: "area",
|
|
5243
|
-
accessor:
|
|
5261
|
+
accessor: f,
|
|
5244
5262
|
baseline: q(t),
|
|
5245
5263
|
xAxisId: e,
|
|
5246
5264
|
yAxisId: n,
|
|
@@ -5250,14 +5268,14 @@ function nr(s) {
|
|
|
5250
5268
|
color: l,
|
|
5251
5269
|
tone: a,
|
|
5252
5270
|
stack: c,
|
|
5253
|
-
normalize:
|
|
5254
|
-
fillOpacity:
|
|
5255
|
-
strokeWidth:
|
|
5256
|
-
dash:
|
|
5271
|
+
normalize: h,
|
|
5272
|
+
fillOpacity: m,
|
|
5273
|
+
strokeWidth: p,
|
|
5274
|
+
dash: d
|
|
5257
5275
|
}),
|
|
5258
|
-
[
|
|
5276
|
+
[f, t, e, n, i, o, r, l, a, c, h, m, p, d]
|
|
5259
5277
|
);
|
|
5260
|
-
return Tt("Area",
|
|
5278
|
+
return Tt("Area", u), null;
|
|
5261
5279
|
}
|
|
5262
5280
|
function ir(s) {
|
|
5263
5281
|
const {
|
|
@@ -5270,11 +5288,11 @@ function ir(s) {
|
|
|
5270
5288
|
tone: l,
|
|
5271
5289
|
stack: a,
|
|
5272
5290
|
normalize: c,
|
|
5273
|
-
barWidth:
|
|
5274
|
-
} = s,
|
|
5291
|
+
barWidth: h = 0.8
|
|
5292
|
+
} = s, m = q(s.value), p = z(
|
|
5275
5293
|
() => ({
|
|
5276
5294
|
kind: "bar",
|
|
5277
|
-
accessor:
|
|
5295
|
+
accessor: m,
|
|
5278
5296
|
xAxisId: t,
|
|
5279
5297
|
yAxisId: e,
|
|
5280
5298
|
data: n,
|
|
@@ -5284,11 +5302,11 @@ function ir(s) {
|
|
|
5284
5302
|
tone: l,
|
|
5285
5303
|
stack: a,
|
|
5286
5304
|
normalize: c,
|
|
5287
|
-
barWidth:
|
|
5305
|
+
barWidth: h
|
|
5288
5306
|
}),
|
|
5289
|
-
[
|
|
5307
|
+
[m, t, e, n, i, o, r, l, a, c, h]
|
|
5290
5308
|
);
|
|
5291
|
-
return Tt("Bar",
|
|
5309
|
+
return Tt("Bar", p), null;
|
|
5292
5310
|
}
|
|
5293
5311
|
function sr(s) {
|
|
5294
5312
|
const {
|
|
@@ -5300,7 +5318,7 @@ function sr(s) {
|
|
|
5300
5318
|
lane: r,
|
|
5301
5319
|
laneFrom: l,
|
|
5302
5320
|
laneTo: a
|
|
5303
|
-
} = s, c = q(s.value),
|
|
5321
|
+
} = s, c = q(s.value), h = z(
|
|
5304
5322
|
() => ({
|
|
5305
5323
|
kind: "state",
|
|
5306
5324
|
accessor: c,
|
|
@@ -5315,7 +5333,7 @@ function sr(s) {
|
|
|
5315
5333
|
}),
|
|
5316
5334
|
[c, t, e, n, i, o, r, l, a]
|
|
5317
5335
|
);
|
|
5318
|
-
return Tt("StateBand",
|
|
5336
|
+
return Tt("StateBand", h), null;
|
|
5319
5337
|
}
|
|
5320
5338
|
function or(s) {
|
|
5321
5339
|
const {
|
|
@@ -5328,14 +5346,14 @@ function or(s) {
|
|
|
5328
5346
|
mean: l,
|
|
5329
5347
|
notchLower: a,
|
|
5330
5348
|
notchUpper: c,
|
|
5331
|
-
count:
|
|
5332
|
-
xAxisId:
|
|
5333
|
-
yAxisId:
|
|
5334
|
-
data:
|
|
5335
|
-
name:
|
|
5336
|
-
format:
|
|
5337
|
-
color:
|
|
5338
|
-
tone:
|
|
5349
|
+
count: h,
|
|
5350
|
+
xAxisId: m = "x",
|
|
5351
|
+
yAxisId: p = "y",
|
|
5352
|
+
data: d,
|
|
5353
|
+
name: f,
|
|
5354
|
+
format: u,
|
|
5355
|
+
color: g,
|
|
5356
|
+
tone: y,
|
|
5339
5357
|
boxWidth: b = 0.8
|
|
5340
5358
|
} = s, w = z(
|
|
5341
5359
|
() => ({
|
|
@@ -5349,29 +5367,29 @@ function or(s) {
|
|
|
5349
5367
|
mean: q(l),
|
|
5350
5368
|
notchLower: q(a),
|
|
5351
5369
|
notchUpper: q(c),
|
|
5352
|
-
count: q(
|
|
5353
|
-
xAxisId:
|
|
5354
|
-
yAxisId:
|
|
5355
|
-
data:
|
|
5356
|
-
name:
|
|
5357
|
-
format:
|
|
5358
|
-
color:
|
|
5359
|
-
tone:
|
|
5370
|
+
count: q(h),
|
|
5371
|
+
xAxisId: m,
|
|
5372
|
+
yAxisId: p,
|
|
5373
|
+
data: d,
|
|
5374
|
+
name: f,
|
|
5375
|
+
format: u,
|
|
5376
|
+
color: g,
|
|
5377
|
+
tone: y,
|
|
5360
5378
|
boxWidth: b
|
|
5361
5379
|
}),
|
|
5362
|
-
[t, e, n, i, o, r, l, a, c,
|
|
5380
|
+
[t, e, n, i, o, r, l, a, c, h, m, p, d, f, u, g, y, b]
|
|
5363
5381
|
);
|
|
5364
5382
|
return Tt("BoxPlot", w), null;
|
|
5365
5383
|
}
|
|
5366
5384
|
const rr = {}, lr = [];
|
|
5367
5385
|
function Nr(s, t = {}) {
|
|
5368
5386
|
const { initialView: e, onViewChange: n, onSelect: i } = t, [o] = zt(() => {
|
|
5369
|
-
const
|
|
5370
|
-
function
|
|
5371
|
-
return /* @__PURE__ */ v(jo, { ...
|
|
5387
|
+
const d = { rows: s }, f = new ti(e);
|
|
5388
|
+
function u(y) {
|
|
5389
|
+
return /* @__PURE__ */ v(jo, { ...y, data: d.rows, scene: f });
|
|
5372
5390
|
}
|
|
5373
|
-
const
|
|
5374
|
-
Chart:
|
|
5391
|
+
const g = {
|
|
5392
|
+
Chart: u,
|
|
5375
5393
|
XAxis: tr,
|
|
5376
5394
|
YAxis: er,
|
|
5377
5395
|
Line: si,
|
|
@@ -5381,23 +5399,23 @@ function Nr(s, t = {}) {
|
|
|
5381
5399
|
StateBand: sr,
|
|
5382
5400
|
Matrix: xo,
|
|
5383
5401
|
BoxPlot: or,
|
|
5384
|
-
setDomain:
|
|
5385
|
-
toggleSeries:
|
|
5386
|
-
showOnly:
|
|
5387
|
-
showAllSeries:
|
|
5402
|
+
setDomain: f.setDomain,
|
|
5403
|
+
toggleSeries: f.toggleSeries,
|
|
5404
|
+
showOnly: f.showOnly,
|
|
5405
|
+
showAllSeries: f.showAllSeries
|
|
5388
5406
|
};
|
|
5389
|
-
return { held:
|
|
5390
|
-
}), { scene: r } = o, l = ht(r.subscribeView, r.getView, r.getView), a = e === void 0 ? null : St(e), c = X(a), [
|
|
5407
|
+
return { held: d, scene: f, parts: g };
|
|
5408
|
+
}), { scene: r } = o, l = ht(r.subscribeView, r.getView, r.getView), a = e === void 0 ? null : St(e), c = X(a), [h] = zt(() => new Os());
|
|
5391
5409
|
ce(() => {
|
|
5392
5410
|
if (e === void 0 || a === null || a === c.current) return;
|
|
5393
5411
|
c.current = a;
|
|
5394
|
-
const
|
|
5395
|
-
|
|
5412
|
+
const d = h.has(a);
|
|
5413
|
+
h.handed(a), d || r.applyView(e);
|
|
5396
5414
|
}, [a]);
|
|
5397
|
-
const
|
|
5415
|
+
const m = St(l), p = X(m);
|
|
5398
5416
|
return B(() => {
|
|
5399
|
-
|
|
5400
|
-
}, [
|
|
5417
|
+
p.current !== m && (p.current = m, r.acted && (h.reported(m), n == null || n(l)));
|
|
5418
|
+
}, [m]), o.held.rows = s, r.onSelect = i ?? null, B(() => {
|
|
5401
5419
|
i !== void 0 && !r.hasTooltip && G("select-without-tooltip", "`onSelect` needs a <Tooltip> - the hits it reports are the tooltip's.");
|
|
5402
5420
|
}, [i === void 0, r]), z(() => ({ ...o.parts, view: l, domains: l.domains ?? rr, hidden: l.hidden ?? lr }), [o, l]);
|
|
5403
5421
|
}
|
|
@@ -5413,7 +5431,7 @@ export {
|
|
|
5413
5431
|
pr as LimitBand,
|
|
5414
5432
|
Vt as LimitLine,
|
|
5415
5433
|
je as LinearScale,
|
|
5416
|
-
|
|
5434
|
+
it as MINUTE,
|
|
5417
5435
|
kt as SECOND,
|
|
5418
5436
|
vr as Tooltip,
|
|
5419
5437
|
Ls as assess,
|