@cascivo/charts 0.3.13 → 0.4.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/README.md +6 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +351 -351
- package/package.json +4 -4
- package/readme.body.md +6 -0
package/dist/index.js
CHANGED
|
@@ -329,7 +329,7 @@ function L(e, t) {
|
|
|
329
329
|
}
|
|
330
330
|
//#endregion
|
|
331
331
|
//#region src/engine/voronoi.ts
|
|
332
|
-
function
|
|
332
|
+
function R(e, t, n) {
|
|
333
333
|
let r = -1, i = Infinity;
|
|
334
334
|
for (let a = 0; a < e.length; a++) {
|
|
335
335
|
let o = e[a][0] - t, s = e[a][1] - n, c = o * o + s * s;
|
|
@@ -337,7 +337,7 @@ function ee(e, t, n) {
|
|
|
337
337
|
}
|
|
338
338
|
return r;
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function ee(e, t, n, r, i) {
|
|
341
341
|
if (e.length === 0) return e;
|
|
342
342
|
let a = [], o = (e) => (e[0] - r) * t + (e[1] - i) * n;
|
|
343
343
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -349,7 +349,7 @@ function te(e, t, n, r, i) {
|
|
|
349
349
|
}
|
|
350
350
|
return a;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function te(e, t) {
|
|
353
353
|
let n = [
|
|
354
354
|
[t.x0, t.y0],
|
|
355
355
|
[t.x1, t.y0],
|
|
@@ -361,7 +361,7 @@ function R(e, t) {
|
|
|
361
361
|
for (let n = 0; n < e.length && i.length > 0; n++) {
|
|
362
362
|
if (n === r) continue;
|
|
363
363
|
let a = e[n];
|
|
364
|
-
i =
|
|
364
|
+
i = ee(i, a[0] - t[0], a[1] - t[1], (t[0] + a[0]) / 2, (t[1] + a[1]) / 2);
|
|
365
365
|
}
|
|
366
366
|
return i;
|
|
367
367
|
});
|
|
@@ -532,7 +532,7 @@ function X(e) {
|
|
|
532
532
|
}
|
|
533
533
|
//#endregion
|
|
534
534
|
//#region src/engine/sankey.ts
|
|
535
|
-
function
|
|
535
|
+
function Z(e, t, { width: n, height: r, nodeWidth: i = 16, nodePadding: a = 12 }) {
|
|
536
536
|
let o = /* @__PURE__ */ new Map();
|
|
537
537
|
for (let t of e) o.set(t.id, {
|
|
538
538
|
...t,
|
|
@@ -586,61 +586,61 @@ function ie(e, t, { width: n, height: r, nodeWidth: i = 16, nodePadding: a = 12
|
|
|
586
586
|
links: v
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function ie(e) {
|
|
590
590
|
let t = e.source.x1, n = e.target.x0, r = (t + n) / 2, i = e.sy, a = e.sy + e.width, o = e.ty, s = e.ty + e.width;
|
|
591
591
|
return `M${t},${i}C${r},${i} ${r},${o} ${n},${o}L${n},${s}C${r},${s} ${r},${a} ${t},${a}Z`;
|
|
592
592
|
}
|
|
593
593
|
//#endregion
|
|
594
594
|
//#region src/engine/ramp.ts
|
|
595
|
-
var
|
|
596
|
-
l:
|
|
597
|
-
c:
|
|
598
|
-
h:
|
|
599
|
-
}),
|
|
595
|
+
var ae = (e) => e < 0 ? 0 : e > 1 ? 1 : e, oe = (e, t, n) => e + (t - e) * n, se = (e, t, n) => ({
|
|
596
|
+
l: oe(e.l, t.l, n),
|
|
597
|
+
c: oe(e.c, t.c, n),
|
|
598
|
+
h: oe(e.h, t.h, n)
|
|
599
|
+
}), ce = ({ l: e, c: t, h: n }) => `oklch(${e.toFixed(4)} ${t.toFixed(4)} ${n.toFixed(2)})`, le = {
|
|
600
600
|
l: .95,
|
|
601
601
|
c: .04,
|
|
602
602
|
h: 232
|
|
603
|
-
},
|
|
603
|
+
}, ue = {
|
|
604
604
|
l: .34,
|
|
605
605
|
c: .15,
|
|
606
606
|
h: 274
|
|
607
|
-
},
|
|
607
|
+
}, de = {
|
|
608
608
|
l: .48,
|
|
609
609
|
c: .14,
|
|
610
610
|
h: 248
|
|
611
|
-
},
|
|
611
|
+
}, fe = {
|
|
612
612
|
l: .96,
|
|
613
613
|
c: .02,
|
|
614
614
|
h: 110
|
|
615
|
-
},
|
|
615
|
+
}, pe = {
|
|
616
616
|
l: .52,
|
|
617
617
|
c: .15,
|
|
618
618
|
h: 42
|
|
619
619
|
};
|
|
620
|
+
function me(e) {
|
|
621
|
+
return ce(se(le, ue, ae(e)));
|
|
622
|
+
}
|
|
620
623
|
function he(e) {
|
|
621
|
-
|
|
624
|
+
let t = ae(e);
|
|
625
|
+
return ce(t < .5 ? se(de, fe, t * 2) : se(fe, pe, (t - .5) * 2));
|
|
622
626
|
}
|
|
623
627
|
function ge(e) {
|
|
624
|
-
|
|
625
|
-
return le(t < .5 ? ce(fe, pe, t * 2) : ce(pe, me, (t - .5) * 2));
|
|
626
|
-
}
|
|
627
|
-
function _e(e) {
|
|
628
|
-
return e === "diverging" ? ge : he;
|
|
628
|
+
return e === "diverging" ? he : me;
|
|
629
629
|
}
|
|
630
|
-
function
|
|
631
|
-
let n =
|
|
630
|
+
function _e(e, t = "sequential") {
|
|
631
|
+
let n = ge(t);
|
|
632
632
|
return e <= 1 ? [n(0)] : Array.from({ length: e }, (t, r) => n(r / (e - 1)));
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function ve(e) {
|
|
635
635
|
let t = /oklch\(([\d.]+)/.exec(e);
|
|
636
636
|
return t ? Number(t[1]) : NaN;
|
|
637
637
|
}
|
|
638
638
|
//#endregion
|
|
639
639
|
//#region src/engine/polar.ts
|
|
640
|
-
function
|
|
640
|
+
function ye(e, t, n, r) {
|
|
641
641
|
return [C(e + n * Math.sin(r)), C(t - n * Math.cos(r))];
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function be(e, t = [0, 2 * Math.PI]) {
|
|
644
644
|
let n = Math.max(1, e.length), r = (t[1] - t[0]) / n, i = new Map(e.map((e, t) => [e, t])), a = (e) => {
|
|
645
645
|
let n = i.get(e);
|
|
646
646
|
return n === void 0 ? void 0 : t[0] + n * r;
|
|
@@ -655,25 +655,25 @@ function xe(e, t = [0, 2 * Math.PI]) {
|
|
|
655
655
|
step: r
|
|
656
656
|
};
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function xe(e, t) {
|
|
659
659
|
return m(e, t);
|
|
660
660
|
}
|
|
661
661
|
//#endregion
|
|
662
662
|
//#region src/engine/transform.ts
|
|
663
|
-
function
|
|
663
|
+
function Se(e, t) {
|
|
664
664
|
return e.filter((e, n) => t(e, n));
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Ce(e, t) {
|
|
667
667
|
return e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t));
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function we(e, t, n = "asc") {
|
|
670
670
|
let r = typeof t == "function" ? t : (e) => e[t], i = n === "desc" ? -1 : 1;
|
|
671
671
|
return e.map((e, t) => ({
|
|
672
672
|
row: e,
|
|
673
673
|
i: t
|
|
674
|
-
})).sort((e, t) =>
|
|
674
|
+
})).sort((e, t) => Ce(r(e.row), r(t.row)) * i || e.i - t.i).map((e) => e.row);
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Te(e, t) {
|
|
677
677
|
if (e === "count") return t.length;
|
|
678
678
|
if (t.length === 0) return 0;
|
|
679
679
|
switch (e) {
|
|
@@ -687,7 +687,7 @@ function Ee(e, t) {
|
|
|
687
687
|
}
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function Ee(e, t) {
|
|
691
691
|
let n = typeof t.groupBy == "string" ? [t.groupBy] : t.groupBy, r = /* @__PURE__ */ new Map(), i = [];
|
|
692
692
|
for (let t of e) {
|
|
693
693
|
let e = n.map((e) => String(t[e])).join("\0"), a = r.get(e);
|
|
@@ -696,11 +696,11 @@ function De(e, t) {
|
|
|
696
696
|
return i.map((e) => {
|
|
697
697
|
let i = r.get(e), a = {};
|
|
698
698
|
for (let e of n) a[e] = i[0][e];
|
|
699
|
-
for (let [e, n] of Object.entries(t.ops)) a[e] =
|
|
699
|
+
for (let [e, n] of Object.entries(t.ops)) a[e] = Te(n, i.map((t) => t[e]).filter((e) => typeof e == "number" && Number.isFinite(e)));
|
|
700
700
|
return a;
|
|
701
701
|
});
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function De(e, t = {}) {
|
|
704
704
|
let n = e.filter((e) => Number.isFinite(e)), [r, i] = t.range ?? [Math.min(...n), Math.max(...n)], a = Math.max(1, t.bins ?? (Math.ceil(Math.sqrt(n.length)) || 1)), o = (i - r) / a || 1, s = Array.from({ length: a }, (e, t) => ({
|
|
705
705
|
x0: r + t * o,
|
|
706
706
|
x1: r + (t + 1) * o,
|
|
@@ -714,7 +714,7 @@ function Oe(e, t = {}) {
|
|
|
714
714
|
}
|
|
715
715
|
return s;
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function Oe(e, t) {
|
|
718
718
|
let n = t.length, r = e.map((e, n) => [...e, t[n]]);
|
|
719
719
|
for (let e = 0; e < n; e++) {
|
|
720
720
|
let t = e;
|
|
@@ -732,12 +732,12 @@ function ke(e, t) {
|
|
|
732
732
|
return Math.abs(i) < 1e-12 ? 0 : r[t][n] / i;
|
|
733
733
|
});
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function ke(e, t) {
|
|
736
736
|
let n = e.map((e) => e[1]), r = n.reduce((e, t) => e + t, 0) / n.length, i = 0, a = 0;
|
|
737
737
|
for (let [n, o] of e) i += (o - t(n)) ** 2, a += (o - r) ** 2;
|
|
738
738
|
return a === 0 ? 1 : 1 - i / a;
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function Ae(e, t = {}) {
|
|
741
741
|
let n = t.type ?? "linear", r = [...e].sort((e, t) => e[0] - t[0]), i = r.map((e) => e[0]), a = () => {
|
|
742
742
|
let e = r.length ? r.reduce((e, t) => e + t[1], 0) / r.length : 0;
|
|
743
743
|
return {
|
|
@@ -751,11 +751,11 @@ function je(e, t = {}) {
|
|
|
751
751
|
if (n === "exponential") {
|
|
752
752
|
let e = r.filter((e) => e[1] > 0);
|
|
753
753
|
if (e.length < 2) return a();
|
|
754
|
-
let t =
|
|
754
|
+
let t = Ae(e.map((e) => [e[0], Math.log(e[1])]), { type: "linear" }), n = Math.exp(t.coefficients[0]), o = t.coefficients[1], s = (e) => n * Math.exp(o * e);
|
|
755
755
|
return {
|
|
756
756
|
predict: s,
|
|
757
757
|
points: i.map((e) => [e, s(e)]),
|
|
758
|
-
r2:
|
|
758
|
+
r2: ke(r, s),
|
|
759
759
|
coefficients: [n, o]
|
|
760
760
|
};
|
|
761
761
|
}
|
|
@@ -767,18 +767,18 @@ function je(e, t = {}) {
|
|
|
767
767
|
for (let t = 0; t < o; t++) s[e][t] += n[e] * n[t];
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
|
-
let l =
|
|
770
|
+
let l = Oe(s, c), u = (e) => l.reduce((t, n, r) => t + n * e ** r, 0);
|
|
771
771
|
return {
|
|
772
772
|
predict: u,
|
|
773
773
|
points: i.map((e) => [e, u(e)]),
|
|
774
|
-
r2:
|
|
774
|
+
r2: ke(r, u),
|
|
775
775
|
coefficients: l
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
778
|
//#endregion
|
|
779
779
|
//#region src/engine/dataset.ts
|
|
780
|
-
var
|
|
781
|
-
function
|
|
780
|
+
var je = (e) => typeof e == "number" ? e : Number(e);
|
|
781
|
+
function Me(e, t) {
|
|
782
782
|
let n = (e) => e.x, r = (e) => e.y;
|
|
783
783
|
if (!t.series) return {
|
|
784
784
|
series: [{
|
|
@@ -786,7 +786,7 @@ function Ne(e, t) {
|
|
|
786
786
|
label: t.label ?? t.y,
|
|
787
787
|
data: e.map((e) => ({
|
|
788
788
|
x: e[t.x],
|
|
789
|
-
y:
|
|
789
|
+
y: je(e[t.y])
|
|
790
790
|
}))
|
|
791
791
|
}],
|
|
792
792
|
x: n,
|
|
@@ -801,7 +801,7 @@ function Ne(e, t) {
|
|
|
801
801
|
data: []
|
|
802
802
|
}, i.set(e, r), a.push(e)), r.data.push({
|
|
803
803
|
x: n[t.x],
|
|
804
|
-
y:
|
|
804
|
+
y: je(n[t.y])
|
|
805
805
|
});
|
|
806
806
|
}
|
|
807
807
|
return {
|
|
@@ -810,15 +810,15 @@ function Ne(e, t) {
|
|
|
810
810
|
y: r
|
|
811
811
|
};
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function Ne(e, t) {
|
|
814
814
|
return e.map((e) => ({
|
|
815
815
|
label: String(e[t.category]),
|
|
816
|
-
value:
|
|
816
|
+
value: je(e[t.value])
|
|
817
817
|
}));
|
|
818
818
|
}
|
|
819
819
|
//#endregion
|
|
820
820
|
//#region src/engine/decimate.ts
|
|
821
|
-
function
|
|
821
|
+
function Pe(e, t) {
|
|
822
822
|
let n = e.length;
|
|
823
823
|
if (t >= n || t < 3) return e.slice();
|
|
824
824
|
let r = [e[0]], i = (n - 2) / (t - 2), a = 0;
|
|
@@ -835,7 +835,7 @@ function Fe(e, t) {
|
|
|
835
835
|
}
|
|
836
836
|
return r.push(e[n - 1]), r;
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function Fe(e, t) {
|
|
839
839
|
let n = e.length;
|
|
840
840
|
if (t >= n || t < 4) return e.slice();
|
|
841
841
|
let r = Math.max(1, Math.floor(t / 2)), i = n / r, a = [e[0]];
|
|
@@ -848,27 +848,27 @@ function Ie(e, t) {
|
|
|
848
848
|
}
|
|
849
849
|
return a.push(e[n - 1]), a;
|
|
850
850
|
}
|
|
851
|
-
function
|
|
852
|
-
return n === "minmax" ?
|
|
851
|
+
function Ie(e, t, n = "lttb") {
|
|
852
|
+
return n === "minmax" ? Fe(e, t) : Pe(e, t);
|
|
853
853
|
}
|
|
854
854
|
//#endregion
|
|
855
855
|
//#region src/stream/use-stream-series.ts
|
|
856
|
-
function
|
|
857
|
-
return e.length <= t.to ? e :
|
|
856
|
+
function Le(e, t) {
|
|
857
|
+
return e.length <= t.to ? e : Ie(e.map((e, n) => [n, t.y(e)]), t.to, t.method).map(([t]) => e[t]);
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function Re(e) {
|
|
860
860
|
let { capacity: n, source: i, decimate: o } = e, s = c(t({ capacity: n })).current, l = c(i);
|
|
861
861
|
return l.current = i, a(() => {
|
|
862
862
|
let e = l.current((e) => s.append(e));
|
|
863
863
|
return () => {
|
|
864
864
|
e(), s.dispose();
|
|
865
865
|
};
|
|
866
|
-
}), r(() => o ?
|
|
866
|
+
}), r(() => o ? Le(s.signal.value, o) : s.signal.value);
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function ze(n) {
|
|
869
869
|
let { capacity: r, source: i, decimate: a } = n, o = t({ capacity: r }), s = i((e) => o.append(e));
|
|
870
870
|
return {
|
|
871
|
-
signal: a ? e(() =>
|
|
871
|
+
signal: a ? e(() => Le(o.signal.value, a)) : o.signal,
|
|
872
872
|
stop: () => {
|
|
873
873
|
s(), o.dispose();
|
|
874
874
|
}
|
|
@@ -876,7 +876,7 @@ function Be(n) {
|
|
|
876
876
|
}
|
|
877
877
|
//#endregion
|
|
878
878
|
//#region src/core/use-chart.ts
|
|
879
|
-
function
|
|
879
|
+
function Be(e = 400, t = 300) {
|
|
880
880
|
let n = c(null), r = i(e), o = i(t);
|
|
881
881
|
return a(() => {
|
|
882
882
|
let e = n.current;
|
|
@@ -904,7 +904,7 @@ function Ve(e = 400, t = 300) {
|
|
|
904
904
|
height: o
|
|
905
905
|
};
|
|
906
906
|
}
|
|
907
|
-
var
|
|
907
|
+
var Ve = {
|
|
908
908
|
top: 8,
|
|
909
909
|
right: 8,
|
|
910
910
|
bottom: 24,
|
|
@@ -1141,7 +1141,7 @@ var at = {
|
|
|
1141
1141
|
};
|
|
1142
1142
|
function Q({ title: e, description: t, width: n, height: r = 300, fallback: m, children: h, className: g, "data-state": _, emptyLabel: v, plain: y, tooltip: b, onSelect: x, hover: S = "rect", renderer: C = "svg", paint: w, zoom: T, toolbox: E, onRestore: D, transition: O, onBeforeDraw: k, onAfterDraw: A }) {
|
|
1143
1143
|
o();
|
|
1144
|
-
let j = s(), M = `${j}-desc`, N = `${j}-live`, { ref: P, width: F, height: I } =
|
|
1144
|
+
let j = s(), M = `${j}-desc`, N = `${j}-live`, { ref: P, width: F, height: I } = Be(n ?? 400, r), L = i(null), ee = i(!1), te = c(null), z = c(null), B = c(null), V = c(null);
|
|
1145
1145
|
a(() => {
|
|
1146
1146
|
let e = V.current;
|
|
1147
1147
|
if (!e || !T) return;
|
|
@@ -1174,9 +1174,9 @@ function Q({ title: e, description: t, width: n, height: r = 300, fallback: m, c
|
|
|
1174
1174
|
}) : b;
|
|
1175
1175
|
a(() => {
|
|
1176
1176
|
let e = L.value;
|
|
1177
|
-
if (!Y || !
|
|
1177
|
+
if (!Y || !te.current) return;
|
|
1178
1178
|
let t = e === null ? void 0 : Y.points[e];
|
|
1179
|
-
|
|
1179
|
+
te.current.textContent = t ? (Y.format ?? We)(t) : "";
|
|
1180
1180
|
});
|
|
1181
1181
|
let re = {
|
|
1182
1182
|
position: "absolute",
|
|
@@ -1184,19 +1184,19 @@ function Q({ title: e, description: t, width: n, height: r = 300, fallback: m, c
|
|
|
1184
1184
|
cursor: T ? "grab" : x ? "pointer" : "crosshair",
|
|
1185
1185
|
background: "transparent",
|
|
1186
1186
|
touchAction: T ? "none" : void 0
|
|
1187
|
-
}, X = C === "canvas" && w !== void 0,
|
|
1187
|
+
}, X = C === "canvas" && w !== void 0, Z = Y !== void 0 || T !== void 0, ie = {};
|
|
1188
1188
|
if (O && typeof O == "object") {
|
|
1189
|
-
let e =
|
|
1189
|
+
let e = ie;
|
|
1190
1190
|
O.duration !== void 0 && (e["--cascivo-chart-anim-dur"] = `${O.duration}ms`), O.easing && (e["--cascivo-chart-anim-ease"] = O.easing), O.properties && (e["--cascivo-chart-anim-props"] = O.properties.join(", "));
|
|
1191
1191
|
}
|
|
1192
|
-
let
|
|
1193
|
-
...
|
|
1194
|
-
...
|
|
1192
|
+
let ae = Z || X || G || Object.keys(ie).length > 0 ? {
|
|
1193
|
+
...ie,
|
|
1194
|
+
...Z || X || G ? { position: "relative" } : {}
|
|
1195
1195
|
} : void 0;
|
|
1196
1196
|
return /* @__PURE__ */ p("div", {
|
|
1197
1197
|
ref: P,
|
|
1198
1198
|
className: [Ue.frame, g].filter(Boolean).join(" "),
|
|
1199
|
-
style:
|
|
1199
|
+
style: ae,
|
|
1200
1200
|
..._ !== void 0 && { "data-state": _ },
|
|
1201
1201
|
...y === !0 && { "data-plain": "" },
|
|
1202
1202
|
...O === !1 && { "data-no-anim": "" },
|
|
@@ -1213,10 +1213,10 @@ function Q({ title: e, description: t, width: n, height: r = 300, fallback: m, c
|
|
|
1213
1213
|
onPng: ne,
|
|
1214
1214
|
onSvg: q,
|
|
1215
1215
|
onToggleData: () => {
|
|
1216
|
-
|
|
1216
|
+
ee.value = !ee.value;
|
|
1217
1217
|
},
|
|
1218
1218
|
onRestore: J,
|
|
1219
|
-
showData:
|
|
1219
|
+
showData: ee.value
|
|
1220
1220
|
})
|
|
1221
1221
|
}),
|
|
1222
1222
|
X && /* @__PURE__ */ f(qe, {
|
|
@@ -1268,16 +1268,16 @@ function Q({ title: e, description: t, width: n, height: r = 300, fallback: m, c
|
|
|
1268
1268
|
style: at,
|
|
1269
1269
|
children: m
|
|
1270
1270
|
}),
|
|
1271
|
-
G &&
|
|
1271
|
+
G && ee.value && m && /* @__PURE__ */ f("div", {
|
|
1272
1272
|
"data-data-view": "",
|
|
1273
1273
|
style: { overflowX: "auto" },
|
|
1274
1274
|
children: m
|
|
1275
1275
|
}),
|
|
1276
|
-
|
|
1276
|
+
Z && /* @__PURE__ */ p(d, { children: [
|
|
1277
1277
|
Y !== void 0 && /* @__PURE__ */ p(d, { children: [
|
|
1278
1278
|
/* @__PURE__ */ f("span", {
|
|
1279
1279
|
id: N,
|
|
1280
|
-
ref:
|
|
1280
|
+
ref: te,
|
|
1281
1281
|
"aria-live": "polite",
|
|
1282
1282
|
style: {
|
|
1283
1283
|
position: "absolute",
|
|
@@ -1366,7 +1366,7 @@ function Q({ title: e, description: t, width: n, height: r = 300, fallback: m, c
|
|
|
1366
1366
|
}
|
|
1367
1367
|
if (!Y || !Y.points.length) return;
|
|
1368
1368
|
let t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top;
|
|
1369
|
-
L.value = Y.mode === "axis" ? Ke(Y.points, n, r, "x") : S === "voronoi" ?
|
|
1369
|
+
L.value = Y.mode === "axis" ? Ke(Y.points, n, r, "x") : S === "voronoi" ? R(Y.points.map((e) => [e.cx, e.cy]), n, r) : Ke(Y.points, n, r, "xy");
|
|
1370
1370
|
},
|
|
1371
1371
|
onPointerUp: () => {
|
|
1372
1372
|
B.current = null;
|
|
@@ -2023,7 +2023,7 @@ function Vt(e, t) {
|
|
|
2023
2023
|
}
|
|
2024
2024
|
function Ht(e, t) {
|
|
2025
2025
|
let n = t.channel ?? "color", r = t.ramp ?? "sequential", i = Bt(e, t), a = {};
|
|
2026
|
-
if ((n === "color" || n === "both") && (a.color = (t.mode ?? "continuous") === "piecewise" ?
|
|
2026
|
+
if ((n === "color" || n === "both") && (a.color = (t.mode ?? "continuous") === "piecewise" ? _e(t.pieces ?? It, r)[Vt(e, t)] : ge(r)(i)), n === "size" || n === "both") {
|
|
2027
2027
|
let [e, n] = t.sizeRange ?? Lt;
|
|
2028
2028
|
a.size = zt(e, n, i);
|
|
2029
2029
|
}
|
|
@@ -2036,7 +2036,7 @@ function Wt({ options: e, range: t, hidden: n, label: r = "Value", format: i })
|
|
|
2036
2036
|
o();
|
|
2037
2037
|
let a = i ?? ((e) => String(Math.round(e)));
|
|
2038
2038
|
if ((e.mode ?? "continuous") === "piecewise") {
|
|
2039
|
-
let t = e.pieces ?? It, i =
|
|
2039
|
+
let t = e.pieces ?? It, i = _e(t, e.ramp ?? "sequential"), o = (e.max - e.min) / t, s = n?.value ?? /* @__PURE__ */ new Set(), c = (e) => {
|
|
2040
2040
|
if (!n) return;
|
|
2041
2041
|
let t = new Set(n.value);
|
|
2042
2042
|
t.has(e) ? t.delete(e) : t.add(e), n.value = t;
|
|
@@ -2084,7 +2084,7 @@ function Wt({ options: e, range: t, hidden: n, label: r = "Value", format: i })
|
|
|
2084
2084
|
})
|
|
2085
2085
|
});
|
|
2086
2086
|
}
|
|
2087
|
-
let { min: s, max: c } = e, l = c - s || 1, u =
|
|
2087
|
+
let { min: s, max: c } = e, l = c - s || 1, u = _e(8, e.ramp ?? "sequential"), m = (e) => (e - s) / l * 100, h = t?.value[0] ?? s, g = t?.value[1] ?? c, _ = `vm-grad-${u.length}`, v = (e, t) => {
|
|
2088
2088
|
let n = t.getBoundingClientRect();
|
|
2089
2089
|
return n.width === 0 ? s : s + Rt((e - n.left) / n.width) * l;
|
|
2090
2090
|
}, y = (e, n) => {
|
|
@@ -2222,7 +2222,7 @@ var Xt = Array.from({ length: 8 }, (e, t) => `var(--cascivo-chart-${t + 1})`);
|
|
|
2222
2222
|
function Zt(e) {
|
|
2223
2223
|
return [Math.min(0, ...e), Math.max(...e)];
|
|
2224
2224
|
}
|
|
2225
|
-
function Qt({ series: e, x: t, y: n, title: r, description: s, curve: l = "monotone", width: u, height: h, xTicks: g = 5, yTicks: _ = 5, legend: v, tooltip: y, formatTooltip: b, className: x, plain: C, annotations: E, labels: D, connectNulls: O, onSelect: k, brush: A, dataZoom: j, zoom: M, syncId: N, tooltipMode: P, secondAxis: F, decimate: I, toolbox: L, transition:
|
|
2225
|
+
function Qt({ series: e, x: t, y: n, title: r, description: s, curve: l = "monotone", width: u, height: h, xTicks: g = 5, yTicks: _ = 5, legend: v, tooltip: y, formatTooltip: b, className: x, plain: C, annotations: E, labels: D, connectNulls: O, onSelect: k, brush: A, dataZoom: j, zoom: M, syncId: N, tooltipMode: P, secondAxis: F, decimate: I, toolbox: L, transition: R, onBeforeDraw: ee, onAfterDraw: te }) {
|
|
2226
2226
|
o();
|
|
2227
2227
|
let z = i(/* @__PURE__ */ new Set()), B = C ? null : xt(D), V = I === !0 ? {
|
|
2228
2228
|
method: "lttb",
|
|
@@ -2247,12 +2247,12 @@ function Qt({ series: e, x: t, y: n, title: r, description: s, curve: l = "monot
|
|
|
2247
2247
|
let K = U ? e.map((e) => ({
|
|
2248
2248
|
...e,
|
|
2249
2249
|
data: e.data.slice(W.value[0], W.value[1] + 1)
|
|
2250
|
-
})) : e, q = !C && K.some((e) => e.axis === "right"), ne = C ? He :
|
|
2250
|
+
})) : e, q = !C && K.some((e) => e.axis === "right"), ne = C ? He : Ve, J = q ? {
|
|
2251
2251
|
...ne,
|
|
2252
2252
|
right: 60
|
|
2253
|
-
} : ne, Y = h ?? (C ? 48 : 300), re = C ? !1 : v ?? K.length > 1, X = K.flatMap((e) => e.data.map((e) => t(e))), ie = (e) => e.flatMap((e) => e.data.map((
|
|
2254
|
-
Yt("LineChart", () => K.flatMap((e) => e.data.map((
|
|
2255
|
-
let se =
|
|
2253
|
+
} : ne, Y = h ?? (C ? 48 : 300), re = C ? !1 : v ?? K.length > 1, X = (e) => e.y ?? n, Z = K.flatMap((e) => e.data.map((e) => t(e))), ie = (e) => e.flatMap((e) => e.data.map((t) => X(e)(t))).filter((e) => Number.isFinite(e)), ae = ie(q ? K.filter((e) => e.axis !== "right") : K), oe = q ? ie(K.filter((e) => e.axis === "right")) : [];
|
|
2254
|
+
Yt("LineChart", () => K.flatMap((e) => e.data.map((t) => X(e)(t))));
|
|
2255
|
+
let se = Z.length > 0, ce = se && Z[0] instanceof Date;
|
|
2256
2256
|
return /* @__PURE__ */ p("div", {
|
|
2257
2257
|
style: {
|
|
2258
2258
|
display: "flex",
|
|
@@ -2268,65 +2268,65 @@ function Qt({ series: e, x: t, y: n, title: r, description: s, curve: l = "monot
|
|
|
2268
2268
|
fallback: /* @__PURE__ */ p("table", { children: [
|
|
2269
2269
|
/* @__PURE__ */ f("caption", { children: r }),
|
|
2270
2270
|
/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [/* @__PURE__ */ f("th", { children: "X" }), K.map((e) => /* @__PURE__ */ f("th", { children: e.label }, e.id))] }) }),
|
|
2271
|
-
/* @__PURE__ */ f("tbody", { children: (K[0]?.data ?? []).map((e,
|
|
2271
|
+
/* @__PURE__ */ f("tbody", { children: (K[0]?.data ?? []).map((e, n) => /* @__PURE__ */ p("tr", { children: [/* @__PURE__ */ f("td", { children: String(K[0] ? t(K[0].data[n]) : "") }), K.map((e) => /* @__PURE__ */ f("td", { children: e.data[n] == null ? "" : X(e)(e.data[n]) }, e.id))] }, n)) })
|
|
2272
2272
|
] }),
|
|
2273
2273
|
className: x,
|
|
2274
2274
|
"data-state": se ? void 0 : "empty",
|
|
2275
2275
|
plain: C,
|
|
2276
|
-
tooltip: y !== !1 && se ? ({ width: e, height:
|
|
2276
|
+
tooltip: y !== !1 && se ? ({ width: e, height: n }) => {
|
|
2277
2277
|
if (y === !1 || !se) return;
|
|
2278
|
-
let
|
|
2278
|
+
let r = e - J.left - J.right, i = n - J.top - J.bottom, a = Math.min(...ce ? Z.map((e) => e.getTime()) : Z), o = Math.max(...ce ? Z.map((e) => e.getTime()) : Z), s = ce ? S([new Date(a), new Date(o)], [0, r]) : m([a, o], [0, r]), c = m(Zt(ae), [i, 0]), l = q ? m(Zt(oe), [i, 0]) : c, u = (e) => e.axis === "right" ? l : c, d = (e) => s.map(e);
|
|
2279
2279
|
if (P === "axis") {
|
|
2280
|
-
let e = K.reduce((e, t) => Math.max(e, t.data.length), 0),
|
|
2281
|
-
for (let
|
|
2282
|
-
let e = [],
|
|
2283
|
-
K.forEach((
|
|
2284
|
-
if (z.value.has(
|
|
2285
|
-
let
|
|
2286
|
-
if (
|
|
2287
|
-
let
|
|
2288
|
-
if (!Number.isFinite(
|
|
2289
|
-
let
|
|
2290
|
-
|
|
2291
|
-
label:
|
|
2292
|
-
value:
|
|
2293
|
-
color:
|
|
2280
|
+
let e = K.reduce((e, t) => Math.max(e, t.data.length), 0), n = [];
|
|
2281
|
+
for (let r = 0; r < e; r++) {
|
|
2282
|
+
let e = [], i = 0, a = 0, o = Infinity, s = "";
|
|
2283
|
+
K.forEach((n, c) => {
|
|
2284
|
+
if (z.value.has(n.id)) return;
|
|
2285
|
+
let l = n.data[r];
|
|
2286
|
+
if (l === void 0) return;
|
|
2287
|
+
let f = X(n)(l);
|
|
2288
|
+
if (!Number.isFinite(f)) return;
|
|
2289
|
+
let p = t(l);
|
|
2290
|
+
i += d(p), a++, o = Math.min(o, u(n).map(f)), s = p instanceof Date ? p.toLocaleDateString() : String(p), e.push({
|
|
2291
|
+
label: n.label,
|
|
2292
|
+
value: f,
|
|
2293
|
+
color: n.color ?? Xt[c % Xt.length]
|
|
2294
2294
|
});
|
|
2295
|
-
}),
|
|
2296
|
-
id: `x-${
|
|
2297
|
-
cx: J.left +
|
|
2298
|
-
cy: J.top + (
|
|
2299
|
-
label:
|
|
2300
|
-
value:
|
|
2295
|
+
}), a !== 0 && n.push({
|
|
2296
|
+
id: `x-${r}`,
|
|
2297
|
+
cx: J.left + i / a,
|
|
2298
|
+
cy: J.top + (o === Infinity ? 0 : o),
|
|
2299
|
+
label: s,
|
|
2300
|
+
value: s,
|
|
2301
2301
|
segments: e
|
|
2302
2302
|
});
|
|
2303
2303
|
}
|
|
2304
2304
|
return {
|
|
2305
|
-
points:
|
|
2305
|
+
points: n,
|
|
2306
2306
|
mode: "axis",
|
|
2307
2307
|
format: (e) => `${e.label}: ${(e.segments ?? []).map((e) => `${e.label} ${e.value}`).join(", ")}`
|
|
2308
2308
|
};
|
|
2309
2309
|
}
|
|
2310
|
-
let
|
|
2311
|
-
let
|
|
2312
|
-
if (!Number.isFinite(
|
|
2313
|
-
let
|
|
2310
|
+
let f = K.flatMap((e) => z.value.has(e.id) ? [] : e.data.flatMap((n, r) => {
|
|
2311
|
+
let i = X(e)(n);
|
|
2312
|
+
if (!Number.isFinite(i)) return [];
|
|
2313
|
+
let a = t(n), o = s.map(a), c = u(e).map(i), l = a instanceof Date ? a.toLocaleDateString() : String(a);
|
|
2314
2314
|
return {
|
|
2315
|
-
id: `${e.id}-${
|
|
2316
|
-
cx: J.left +
|
|
2317
|
-
cy: J.top +
|
|
2318
|
-
label:
|
|
2319
|
-
value:
|
|
2315
|
+
id: `${e.id}-${r}`,
|
|
2316
|
+
cx: J.left + o,
|
|
2317
|
+
cy: J.top + c,
|
|
2318
|
+
label: l,
|
|
2319
|
+
value: X(e)(n),
|
|
2320
2320
|
seriesId: e.id
|
|
2321
2321
|
};
|
|
2322
2322
|
}));
|
|
2323
2323
|
return b ? {
|
|
2324
|
-
points:
|
|
2324
|
+
points: f,
|
|
2325
2325
|
format: (e) => {
|
|
2326
2326
|
let t = K.find((t) => t.id === e.seriesId), n = parseInt(e.id.split("-").pop() ?? "0", 10);
|
|
2327
2327
|
return t && t.data[n] !== void 0 ? b(t.data[n], t) : `${e.label}: ${e.value}`;
|
|
2328
2328
|
}
|
|
2329
|
-
} : { points:
|
|
2329
|
+
} : { points: f };
|
|
2330
2330
|
} : void 0,
|
|
2331
2331
|
onSelect: k,
|
|
2332
2332
|
zoom: M && H > 1 ? {
|
|
@@ -2337,86 +2337,86 @@ function Qt({ series: e, x: t, y: n, title: r, description: s, curve: l = "monot
|
|
|
2337
2337
|
onRestore: U ? () => {
|
|
2338
2338
|
W.value = [0, Math.max(0, H - 1)];
|
|
2339
2339
|
} : void 0,
|
|
2340
|
-
transition:
|
|
2341
|
-
onBeforeDraw:
|
|
2342
|
-
onAfterDraw:
|
|
2343
|
-
children: ({ width: e, height:
|
|
2344
|
-
let
|
|
2340
|
+
transition: R,
|
|
2341
|
+
onBeforeDraw: ee,
|
|
2342
|
+
onAfterDraw: te,
|
|
2343
|
+
children: ({ width: e, height: n }) => {
|
|
2344
|
+
let r = e - J.left - J.right, i = n - J.top - J.bottom, a = Math.min(...ce ? Z.map((e) => e.getTime()) : Z), o = Math.max(...ce ? Z.map((e) => e.getTime()) : Z), s = ce ? S([new Date(a), new Date(o)], [0, r]) : m([a, o], [0, r]), c = m(Zt(ae), [i, 0]), u = q ? m(Zt(oe), [i, 0]) : c;
|
|
2345
2345
|
return /* @__PURE__ */ f("g", { children: /* @__PURE__ */ p("g", {
|
|
2346
2346
|
transform: `translate(${J.left},${J.top})`,
|
|
2347
2347
|
children: [
|
|
2348
2348
|
!C && /* @__PURE__ */ f(pt, {
|
|
2349
|
-
scale:
|
|
2349
|
+
scale: c,
|
|
2350
2350
|
orientation: "y",
|
|
2351
|
-
length:
|
|
2351
|
+
length: r,
|
|
2352
2352
|
tickCount: _
|
|
2353
2353
|
}),
|
|
2354
2354
|
!C && vt(E, {
|
|
2355
|
-
xScale:
|
|
2356
|
-
yScale:
|
|
2357
|
-
innerW:
|
|
2358
|
-
innerH:
|
|
2355
|
+
xScale: s,
|
|
2356
|
+
yScale: c,
|
|
2357
|
+
innerW: r,
|
|
2358
|
+
innerH: i
|
|
2359
2359
|
}),
|
|
2360
|
-
K.map((e,
|
|
2360
|
+
K.map((e, n) => {
|
|
2361
2361
|
if (z.value.has(e.id)) return null;
|
|
2362
|
-
let
|
|
2362
|
+
let r = e.color ?? Xt[n % Xt.length], i = e.axis === "right" ? u : c, a = (e) => s.map(e);
|
|
2363
2363
|
if (V && e.data.length > V.threshold) {
|
|
2364
|
-
let
|
|
2365
|
-
for (let
|
|
2366
|
-
let
|
|
2367
|
-
Number.isFinite(
|
|
2364
|
+
let n = [];
|
|
2365
|
+
for (let r of e.data) {
|
|
2366
|
+
let o = X(e)(r);
|
|
2367
|
+
Number.isFinite(o) && n.push([a(t(r)), i.map(o)]);
|
|
2368
2368
|
}
|
|
2369
2369
|
return /* @__PURE__ */ f("path", {
|
|
2370
|
-
d: T(
|
|
2370
|
+
d: T(Ie(n, V.threshold, V.method).map((e) => [e[0], e[1]]), l),
|
|
2371
2371
|
fill: "none",
|
|
2372
|
-
stroke:
|
|
2372
|
+
stroke: r,
|
|
2373
2373
|
strokeWidth: 2,
|
|
2374
2374
|
strokeLinecap: "round",
|
|
2375
2375
|
strokeLinejoin: "round",
|
|
2376
2376
|
"data-series": e.id
|
|
2377
2377
|
}, e.id);
|
|
2378
2378
|
}
|
|
2379
|
-
let
|
|
2380
|
-
let r =
|
|
2381
|
-
return Number.isFinite(r) ? [
|
|
2379
|
+
let o = e.data.map((n) => {
|
|
2380
|
+
let r = X(e)(n);
|
|
2381
|
+
return Number.isFinite(r) ? [a(t(n)), i.map(r)] : null;
|
|
2382
2382
|
});
|
|
2383
|
-
return /* @__PURE__ */ p("g", { children: [w(
|
|
2383
|
+
return /* @__PURE__ */ p("g", { children: [w(o, O).map((t, n) => /* @__PURE__ */ f("path", {
|
|
2384
2384
|
d: T(t, l),
|
|
2385
2385
|
fill: "none",
|
|
2386
|
-
stroke:
|
|
2386
|
+
stroke: r,
|
|
2387
2387
|
strokeWidth: 2,
|
|
2388
2388
|
strokeLinecap: "round",
|
|
2389
2389
|
strokeLinejoin: "round",
|
|
2390
2390
|
"data-series": e.id
|
|
2391
|
-
}, n)), B && e.data.map((
|
|
2392
|
-
let r =
|
|
2391
|
+
}, n)), B && e.data.map((t, n) => {
|
|
2392
|
+
let r = o[n];
|
|
2393
2393
|
return r ? /* @__PURE__ */ f(St, {
|
|
2394
2394
|
x: r[0],
|
|
2395
2395
|
y: r[1] - 8,
|
|
2396
|
-
text: B.format(
|
|
2397
|
-
},
|
|
2396
|
+
text: B.format(X(e)(t))
|
|
2397
|
+
}, n) : null;
|
|
2398
2398
|
})] }, e.id);
|
|
2399
2399
|
}),
|
|
2400
2400
|
!C && /* @__PURE__ */ p(d, { children: [
|
|
2401
2401
|
/* @__PURE__ */ f($, {
|
|
2402
|
-
scale:
|
|
2402
|
+
scale: s,
|
|
2403
2403
|
orientation: "x",
|
|
2404
|
-
length:
|
|
2404
|
+
length: r,
|
|
2405
2405
|
tickCount: g,
|
|
2406
|
-
transform: `translate(0,${
|
|
2406
|
+
transform: `translate(0,${i})`
|
|
2407
2407
|
}),
|
|
2408
2408
|
/* @__PURE__ */ f($, {
|
|
2409
|
-
scale:
|
|
2409
|
+
scale: c,
|
|
2410
2410
|
orientation: "y",
|
|
2411
|
-
length:
|
|
2411
|
+
length: i,
|
|
2412
2412
|
tickCount: _
|
|
2413
2413
|
}),
|
|
2414
2414
|
q && /* @__PURE__ */ f($, {
|
|
2415
|
-
scale:
|
|
2415
|
+
scale: u,
|
|
2416
2416
|
orientation: "y",
|
|
2417
|
-
length:
|
|
2417
|
+
length: i,
|
|
2418
2418
|
tickCount: _,
|
|
2419
|
-
transform: `translate(${
|
|
2419
|
+
transform: `translate(${r},0)`,
|
|
2420
2420
|
...F?.format ? { format: (e) => F.format(Number(e)) } : {}
|
|
2421
2421
|
})
|
|
2422
2422
|
] })
|
|
@@ -2448,14 +2448,14 @@ function Qt({ series: e, x: t, y: n, title: r, description: s, curve: l = "monot
|
|
|
2448
2448
|
//#endregion
|
|
2449
2449
|
//#region src/charts/area-chart/area-chart.tsx
|
|
2450
2450
|
var $t = { fillOpacity: "var(--cascivo-chart-fill-opacity, 0.25)" }, en = Array.from({ length: 8 }, (e, t) => `var(--cascivo-chart-${t + 1})`);
|
|
2451
|
-
function tn({ series: e, x: t, y: n, title: r, description: l, stacked: u = !1, curve: h = "monotone", fill: g = "solid", patternKind: _, width: v, height: y, xTicks: b = 5, yTicks: x = 5, legend: S, tooltip: C, className: w, plain: E, annotations: D, labels: O, onSelect: k, brush: A, dataZoom: j, zoom: M, syncId: P, tooltipMode: I, secondAxis: L, decimate:
|
|
2451
|
+
function tn({ series: e, x: t, y: n, title: r, description: l, stacked: u = !1, curve: h = "monotone", fill: g = "solid", patternKind: _, width: v, height: y, xTicks: b = 5, yTicks: x = 5, legend: S, tooltip: C, className: w, plain: E, annotations: D, labels: O, onSelect: k, brush: A, dataZoom: j, zoom: M, syncId: P, tooltipMode: I, secondAxis: L, decimate: R, toolbox: ee }) {
|
|
2452
2452
|
o();
|
|
2453
|
-
let
|
|
2453
|
+
let te = s(), z = i(/* @__PURE__ */ new Set()), B = E ? null : xt(O), V = R === !0 ? {
|
|
2454
2454
|
method: "lttb",
|
|
2455
2455
|
threshold: 1e3
|
|
2456
|
-
} :
|
|
2457
|
-
method:
|
|
2458
|
-
threshold:
|
|
2456
|
+
} : R ? {
|
|
2457
|
+
method: R.method ?? "lttb",
|
|
2458
|
+
threshold: R.threshold ?? 1e3
|
|
2459
2459
|
} : null, H = e.reduce((e, t) => Math.max(e, t.data.length), 0), U = (A || j || M || P !== void 0) && H > 0, W = i([0, Math.max(0, H - 1)]), G = c(null);
|
|
2460
2460
|
P && !G.current && (G.current = st(P)), a(() => () => {
|
|
2461
2461
|
P && ct(P);
|
|
@@ -2473,12 +2473,12 @@ function tn({ series: e, x: t, y: n, title: r, description: l, stacked: u = !1,
|
|
|
2473
2473
|
let K = U ? e.map((e) => ({
|
|
2474
2474
|
...e,
|
|
2475
2475
|
data: e.data.slice(W.value[0], W.value[1] + 1)
|
|
2476
|
-
})) : e, q = !E && !u && K.some((e) => e.axis === "right"), ne = E ? He :
|
|
2476
|
+
})) : e, q = !E && !u && K.some((e) => e.axis === "right"), ne = E ? He : Ve, J = q ? {
|
|
2477
2477
|
...ne,
|
|
2478
2478
|
right: 60
|
|
2479
|
-
} : ne, Y = y ?? (E ? 48 : 300), re = E ? !1 : S ?? K.length > 1, X = (K[0]?.data ?? []).map((e) => t(e)), ie = (q ? K.filter((e) => e.axis !== "right") : K).flatMap((e) => e.data.map((
|
|
2479
|
+
} : ne, Y = y ?? (E ? 48 : 300), re = E ? !1 : S ?? K.length > 1, X = (e) => e.y ?? n, Z = (K[0]?.data ?? []).map((e) => t(e)), ie = (q ? K.filter((e) => e.axis !== "right") : K).flatMap((e) => e.data.map((t) => X(e)(t))), ae = q ? K.filter((e) => e.axis === "right").flatMap((e) => e.data.map((t) => X(e)(t))) : [];
|
|
2480
2480
|
Yt("AreaChart", () => [...ie, ...ae]);
|
|
2481
|
-
let oe =
|
|
2481
|
+
let oe = Z.length > 0, se = oe ? Math.min(...Z) : 0, ce = oe ? Math.max(...Z) : 1, le = u ? 0 : Math.min(0, ...ie), ue = Math.max(...u ? (K[0]?.data ?? []).map((e, t) => K.reduce((e, n) => e + X(n)(n.data[t]), 0)) : ie), de = q ? Math.min(0, ...ae) : le, fe = q ? Math.max(...ae) : ue;
|
|
2482
2482
|
return /* @__PURE__ */ p("div", {
|
|
2483
2483
|
style: {
|
|
2484
2484
|
display: "flex",
|
|
@@ -2494,49 +2494,49 @@ function tn({ series: e, x: t, y: n, title: r, description: l, stacked: u = !1,
|
|
|
2494
2494
|
fallback: /* @__PURE__ */ p("table", { children: [
|
|
2495
2495
|
/* @__PURE__ */ f("caption", { children: r }),
|
|
2496
2496
|
/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [/* @__PURE__ */ f("th", { children: "X" }), K.map((e) => /* @__PURE__ */ f("th", { children: e.label }, e.id))] }) }),
|
|
2497
|
-
/* @__PURE__ */ f("tbody", { children: (K[0]?.data ?? []).map((e,
|
|
2497
|
+
/* @__PURE__ */ f("tbody", { children: (K[0]?.data ?? []).map((e, n) => /* @__PURE__ */ p("tr", { children: [/* @__PURE__ */ f("td", { children: K[0] ? String(t(K[0].data[n])) : "" }), K.map((e) => /* @__PURE__ */ f("td", { children: e.data[n] == null ? "" : X(e)(e.data[n]) }, e.id))] }, n)) })
|
|
2498
2498
|
] }),
|
|
2499
2499
|
className: w,
|
|
2500
2500
|
"data-state": oe ? void 0 : "empty",
|
|
2501
2501
|
plain: E,
|
|
2502
|
-
tooltip: C !== !1 && oe ? ({ width: e, height:
|
|
2502
|
+
tooltip: C !== !1 && oe ? ({ width: e, height: n }) => {
|
|
2503
2503
|
if (C === !1 || !oe) return;
|
|
2504
|
-
let
|
|
2504
|
+
let r = e - J.left - J.right, i = n - J.top - J.bottom, a = m([se, ce], [0, r]), o = m([le, ue], [i, 0]), s = q ? m([de, fe], [i, 0]) : o, c = (e) => e.axis === "right" ? s : o;
|
|
2505
2505
|
if (I === "axis") {
|
|
2506
|
-
let e = K.reduce((e, t) => Math.max(e, t.data.length), 0),
|
|
2507
|
-
for (let
|
|
2508
|
-
let e = [],
|
|
2509
|
-
K.forEach((
|
|
2510
|
-
if (z.value.has(
|
|
2511
|
-
let
|
|
2512
|
-
if (
|
|
2513
|
-
let
|
|
2514
|
-
Number.isFinite(
|
|
2515
|
-
label:
|
|
2516
|
-
value:
|
|
2517
|
-
color:
|
|
2506
|
+
let e = K.reduce((e, t) => Math.max(e, t.data.length), 0), n = [];
|
|
2507
|
+
for (let r = 0; r < e; r++) {
|
|
2508
|
+
let e = [], i = Infinity, o = "", s = J.left;
|
|
2509
|
+
K.forEach((n, l) => {
|
|
2510
|
+
if (z.value.has(n.id)) return;
|
|
2511
|
+
let u = n.data[r];
|
|
2512
|
+
if (u === void 0) return;
|
|
2513
|
+
let d = X(n)(u);
|
|
2514
|
+
Number.isFinite(d) && (s = J.left + a.map(t(u)), i = Math.min(i, c(n).map(d)), o = String(t(u)), e.push({
|
|
2515
|
+
label: n.label,
|
|
2516
|
+
value: d,
|
|
2517
|
+
color: n.color ?? en[l % en.length]
|
|
2518
2518
|
}));
|
|
2519
|
-
}), e.length !== 0 &&
|
|
2520
|
-
id: `x-${
|
|
2521
|
-
cx:
|
|
2522
|
-
cy: J.top + (
|
|
2523
|
-
label:
|
|
2524
|
-
value:
|
|
2519
|
+
}), e.length !== 0 && n.push({
|
|
2520
|
+
id: `x-${r}`,
|
|
2521
|
+
cx: s,
|
|
2522
|
+
cy: J.top + (i === Infinity ? 0 : i),
|
|
2523
|
+
label: o,
|
|
2524
|
+
value: o,
|
|
2525
2525
|
segments: e
|
|
2526
2526
|
});
|
|
2527
2527
|
}
|
|
2528
2528
|
return {
|
|
2529
|
-
points:
|
|
2529
|
+
points: n,
|
|
2530
2530
|
mode: "axis",
|
|
2531
2531
|
format: (e) => `${e.label}: ${(e.segments ?? []).map((e) => `${e.label} ${e.value}`).join(", ")}`
|
|
2532
2532
|
};
|
|
2533
2533
|
}
|
|
2534
|
-
return { points: K.flatMap((e) => z.value.has(e.id) ? [] : e.data.map((
|
|
2535
|
-
id: `${e.id}-${
|
|
2536
|
-
cx: J.left +
|
|
2537
|
-
cy: J.top +
|
|
2538
|
-
label: String(t(
|
|
2539
|
-
value:
|
|
2534
|
+
return { points: K.flatMap((e) => z.value.has(e.id) ? [] : e.data.map((n, r) => ({
|
|
2535
|
+
id: `${e.id}-${r}`,
|
|
2536
|
+
cx: J.left + a.map(t(n)),
|
|
2537
|
+
cy: J.top + c(e).map(X(e)(n)),
|
|
2538
|
+
label: String(t(n)),
|
|
2539
|
+
value: X(e)(n),
|
|
2540
2540
|
seriesId: e.id
|
|
2541
2541
|
}))) };
|
|
2542
2542
|
} : void 0,
|
|
@@ -2545,14 +2545,14 @@ function tn({ series: e, x: t, y: n, title: r, description: l, stacked: u = !1,
|
|
|
2545
2545
|
window: W,
|
|
2546
2546
|
count: H
|
|
2547
2547
|
} : void 0,
|
|
2548
|
-
toolbox:
|
|
2548
|
+
toolbox: ee,
|
|
2549
2549
|
onRestore: U ? () => {
|
|
2550
2550
|
W.value = [0, Math.max(0, H - 1)];
|
|
2551
2551
|
} : void 0,
|
|
2552
|
-
children: ({ width: e, height:
|
|
2553
|
-
let
|
|
2554
|
-
return u && (
|
|
2555
|
-
prefix:
|
|
2552
|
+
children: ({ width: e, height: n }) => {
|
|
2553
|
+
let r = e - J.left - J.right, i = n - J.top - J.bottom, a = m([se, ce], [0, r]), o = m([le, ue], [i, 0]), s = q ? m([de, fe], [i, 0]) : o, c = [];
|
|
2554
|
+
return u && (c = F(K.map((e) => e.data.map((t) => X(e)(t))))), /* @__PURE__ */ p("g", { children: [g !== "solid" && /* @__PURE__ */ f(Dt, {
|
|
2555
|
+
prefix: te,
|
|
2556
2556
|
fill: g,
|
|
2557
2557
|
patternKind: _,
|
|
2558
2558
|
series: K.map((e, t) => ({
|
|
@@ -2563,63 +2563,63 @@ function tn({ series: e, x: t, y: n, title: r, description: l, stacked: u = !1,
|
|
|
2563
2563
|
transform: `translate(${J.left},${J.top})`,
|
|
2564
2564
|
children: [
|
|
2565
2565
|
!E && /* @__PURE__ */ f(pt, {
|
|
2566
|
-
scale:
|
|
2566
|
+
scale: o,
|
|
2567
2567
|
orientation: "y",
|
|
2568
|
-
length:
|
|
2568
|
+
length: r,
|
|
2569
2569
|
tickCount: x
|
|
2570
2570
|
}),
|
|
2571
2571
|
!E && vt(D, {
|
|
2572
|
-
xScale:
|
|
2573
|
-
yScale:
|
|
2574
|
-
innerW:
|
|
2575
|
-
innerH:
|
|
2572
|
+
xScale: a,
|
|
2573
|
+
yScale: o,
|
|
2574
|
+
innerW: r,
|
|
2575
|
+
innerH: i
|
|
2576
2576
|
}),
|
|
2577
|
-
K.map((e,
|
|
2577
|
+
K.map((e, n) => {
|
|
2578
2578
|
if (z.value.has(e.id)) return null;
|
|
2579
|
-
let
|
|
2580
|
-
if (u &&
|
|
2581
|
-
let
|
|
2582
|
-
|
|
2583
|
-
let u = e.data.map((e, n) => [
|
|
2584
|
-
|
|
2585
|
-
let
|
|
2579
|
+
let r = e.color ?? en[n % en.length], i, l;
|
|
2580
|
+
if (u && c[n]) {
|
|
2581
|
+
let s = c[n];
|
|
2582
|
+
i = e.data.map((e, n) => [a.map(t(e)), o.map(s[n][1])]);
|
|
2583
|
+
let u = e.data.map((e, n) => [a.map(t(e)), o.map(s[n][0])]);
|
|
2584
|
+
l = o.map(0);
|
|
2585
|
+
let d = T(i, h), m = u[u.length - 1], _ = u[0], v = [...u].reverse().map(([e, t]) => `L${e},${t}`).join(""), y = `${d}L${m[0]},${m[1]}${v}L${_[0]},${_[1]}Z`;
|
|
2586
2586
|
return /* @__PURE__ */ p("g", {
|
|
2587
2587
|
"data-series": e.id,
|
|
2588
2588
|
children: [
|
|
2589
2589
|
/* @__PURE__ */ f("path", {
|
|
2590
|
-
d:
|
|
2591
|
-
fill: Et(
|
|
2590
|
+
d: y,
|
|
2591
|
+
fill: Et(te, e.id, g, r),
|
|
2592
2592
|
style: g === "solid" ? $t : void 0,
|
|
2593
2593
|
stroke: "none"
|
|
2594
2594
|
}),
|
|
2595
2595
|
/* @__PURE__ */ f("path", {
|
|
2596
|
-
d: T(
|
|
2596
|
+
d: T(i, h),
|
|
2597
2597
|
fill: "none",
|
|
2598
|
-
stroke:
|
|
2598
|
+
stroke: r,
|
|
2599
2599
|
strokeWidth: 2
|
|
2600
2600
|
}),
|
|
2601
|
-
B &&
|
|
2601
|
+
B && i.map((t, n) => /* @__PURE__ */ f(St, {
|
|
2602
2602
|
x: t[0],
|
|
2603
2603
|
y: t[1] - 8,
|
|
2604
|
-
text: B.format(
|
|
2605
|
-
},
|
|
2604
|
+
text: B.format(X(e)(e.data[n]))
|
|
2605
|
+
}, n))
|
|
2606
2606
|
]
|
|
2607
2607
|
}, e.id);
|
|
2608
2608
|
} else {
|
|
2609
|
-
let
|
|
2610
|
-
if (
|
|
2611
|
-
let t =
|
|
2609
|
+
let n = e.axis === "right" ? s : o;
|
|
2610
|
+
if (i = e.data.map((r) => [a.map(t(r)), n.map(X(e)(r))]), l = n.map(0), V && i.length > V.threshold) {
|
|
2611
|
+
let t = Ie(i, V.threshold, V.method).map((e) => [e[0], e[1]]);
|
|
2612
2612
|
return /* @__PURE__ */ p("g", {
|
|
2613
2613
|
"data-series": e.id,
|
|
2614
2614
|
children: [/* @__PURE__ */ f("path", {
|
|
2615
|
-
d: N(t,
|
|
2616
|
-
fill: Et(
|
|
2615
|
+
d: N(t, l, h),
|
|
2616
|
+
fill: Et(te, e.id, g, r),
|
|
2617
2617
|
style: g === "solid" ? $t : void 0,
|
|
2618
2618
|
stroke: "none"
|
|
2619
2619
|
}), /* @__PURE__ */ f("path", {
|
|
2620
2620
|
d: T(t, h),
|
|
2621
2621
|
fill: "none",
|
|
2622
|
-
stroke:
|
|
2622
|
+
stroke: r,
|
|
2623
2623
|
strokeWidth: 2
|
|
2624
2624
|
})]
|
|
2625
2625
|
}, e.id);
|
|
@@ -2628,46 +2628,46 @@ function tn({ series: e, x: t, y: n, title: r, description: l, stacked: u = !1,
|
|
|
2628
2628
|
"data-series": e.id,
|
|
2629
2629
|
children: [
|
|
2630
2630
|
/* @__PURE__ */ f("path", {
|
|
2631
|
-
d: N(
|
|
2632
|
-
fill: Et(
|
|
2631
|
+
d: N(i, l, h),
|
|
2632
|
+
fill: Et(te, e.id, g, r),
|
|
2633
2633
|
style: g === "solid" ? $t : void 0,
|
|
2634
2634
|
stroke: "none"
|
|
2635
2635
|
}),
|
|
2636
2636
|
/* @__PURE__ */ f("path", {
|
|
2637
|
-
d: T(
|
|
2637
|
+
d: T(i, h),
|
|
2638
2638
|
fill: "none",
|
|
2639
|
-
stroke:
|
|
2639
|
+
stroke: r,
|
|
2640
2640
|
strokeWidth: 2
|
|
2641
2641
|
}),
|
|
2642
|
-
B &&
|
|
2642
|
+
B && i.map((t, n) => /* @__PURE__ */ f(St, {
|
|
2643
2643
|
x: t[0],
|
|
2644
2644
|
y: t[1] - 8,
|
|
2645
|
-
text: B.format(
|
|
2646
|
-
},
|
|
2645
|
+
text: B.format(X(e)(e.data[n]))
|
|
2646
|
+
}, n))
|
|
2647
2647
|
]
|
|
2648
2648
|
}, e.id);
|
|
2649
2649
|
}
|
|
2650
2650
|
}),
|
|
2651
2651
|
!E && /* @__PURE__ */ p(d, { children: [
|
|
2652
2652
|
/* @__PURE__ */ f($, {
|
|
2653
|
-
scale:
|
|
2653
|
+
scale: a,
|
|
2654
2654
|
orientation: "x",
|
|
2655
|
-
length:
|
|
2655
|
+
length: r,
|
|
2656
2656
|
tickCount: b,
|
|
2657
|
-
transform: `translate(0,${
|
|
2657
|
+
transform: `translate(0,${i})`
|
|
2658
2658
|
}),
|
|
2659
2659
|
/* @__PURE__ */ f($, {
|
|
2660
|
-
scale:
|
|
2660
|
+
scale: o,
|
|
2661
2661
|
orientation: "y",
|
|
2662
|
-
length:
|
|
2662
|
+
length: i,
|
|
2663
2663
|
tickCount: x
|
|
2664
2664
|
}),
|
|
2665
2665
|
q && /* @__PURE__ */ f($, {
|
|
2666
|
-
scale:
|
|
2666
|
+
scale: s,
|
|
2667
2667
|
orientation: "y",
|
|
2668
|
-
length:
|
|
2668
|
+
length: i,
|
|
2669
2669
|
tickCount: x,
|
|
2670
|
-
transform: `translate(${
|
|
2670
|
+
transform: `translate(${r},0)`,
|
|
2671
2671
|
...L?.format ? { format: (e) => L.format(Number(e)) } : {}
|
|
2672
2672
|
})
|
|
2673
2673
|
] })
|
|
@@ -2705,13 +2705,13 @@ function rn(e) {
|
|
|
2705
2705
|
}
|
|
2706
2706
|
function an({ series: e, x: t, y: n, title: r, description: a, orientation: c = "vertical", mode: l = "grouped", width: u, height: h, xTicks: _ = 5, yTicks: v = 5, xLabelEvery: y, legend: b, tooltip: x, tooltipFormat: S, className: C, plain: w, annotations: T, labels: E, onSelect: D, fill: O = "solid", patternKind: k }) {
|
|
2707
2707
|
o();
|
|
2708
|
-
let A = s(), j = w ? null : xt(E), M = i(/* @__PURE__ */ new Set()), N = w ? He :
|
|
2709
|
-
let t = F(e.map((e) => e.data.map((
|
|
2708
|
+
let A = s(), j = w ? null : xt(E), M = i(/* @__PURE__ */ new Set()), N = w ? He : Ve, P = h ?? (w ? 48 : 300), I = w ? !1 : b ?? e.length > 1, L = (e) => e.y ?? n, R = (e[0]?.data ?? []).map((e) => t(e)), ee = e.flatMap((e) => e.data.map((t) => L(e)(t))), te = R.length > 0, z = l === "stacked" || l === "percent", B = R.map((t, n) => e.reduce((e, t) => e + L(t)(t.data[n]), 0)), V = () => {
|
|
2709
|
+
let t = F(e.map((e) => e.data.map((t) => L(e)(t))));
|
|
2710
2710
|
return l === "percent" ? t.map((e) => e.map(([e, t], n) => {
|
|
2711
|
-
let r =
|
|
2711
|
+
let r = B[n] || 1;
|
|
2712
2712
|
return [e / r, t / r];
|
|
2713
2713
|
})) : t;
|
|
2714
|
-
},
|
|
2714
|
+
}, H = z ? 0 : Math.min(0, ...ee), U = te ? Math.max(...B) : 1, W = l === "percent" ? 1 : l === "stacked" ? U : Math.max(1, ...ee), G = l === "percent" ? (e) => `${Math.round(Number(e) * 100)}%` : void 0;
|
|
2715
2715
|
return /* @__PURE__ */ p("div", {
|
|
2716
2716
|
style: {
|
|
2717
2717
|
display: "flex",
|
|
@@ -2726,54 +2726,54 @@ function an({ series: e, x: t, y: n, title: r, description: a, orientation: c =
|
|
|
2726
2726
|
fallback: /* @__PURE__ */ p("table", { children: [
|
|
2727
2727
|
/* @__PURE__ */ f("caption", { children: r }),
|
|
2728
2728
|
/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [/* @__PURE__ */ f("th", { children: "Category" }), e.map((e) => /* @__PURE__ */ f("th", { children: e.label }, e.id))] }) }),
|
|
2729
|
-
/* @__PURE__ */ f("tbody", { children:
|
|
2729
|
+
/* @__PURE__ */ f("tbody", { children: R.map((t, n) => /* @__PURE__ */ p("tr", { children: [/* @__PURE__ */ f("td", { children: t }), e.map((e) => /* @__PURE__ */ f("td", { children: e.data[n] == null ? "" : L(e)(e.data[n]) }, e.id))] }, t)) })
|
|
2730
2730
|
] }),
|
|
2731
2731
|
className: C,
|
|
2732
2732
|
"data-state": te ? void 0 : "empty",
|
|
2733
2733
|
plain: w,
|
|
2734
|
-
tooltip: x && te ? ({ width:
|
|
2734
|
+
tooltip: x && te ? ({ width: n, height: r }) => {
|
|
2735
2735
|
if (!x || !te) return;
|
|
2736
|
-
let
|
|
2737
|
-
|
|
2738
|
-
let
|
|
2739
|
-
let
|
|
2736
|
+
let i = n - N.left - N.right, a = r - N.top - N.bottom, o = c === "vertical", s = g(R, o ? [0, i] : [0, a], .2), u = m([H, W], o ? [a, 0] : [0, i]), d = e.filter((e) => !M.value.has(e.id)), f = [];
|
|
2737
|
+
z && (f = V());
|
|
2738
|
+
let p = z && !S, h = R.map((t, n) => {
|
|
2739
|
+
let r = d.map((t) => ({
|
|
2740
2740
|
label: t.label,
|
|
2741
|
-
value:
|
|
2741
|
+
value: L(t)(t.data[n]),
|
|
2742
2742
|
color: t.color ?? nn[e.indexOf(t) % nn.length]
|
|
2743
2743
|
}));
|
|
2744
2744
|
return {
|
|
2745
|
-
segs:
|
|
2746
|
-
total:
|
|
2745
|
+
segs: r,
|
|
2746
|
+
total: r.reduce((e, t) => e + t.value, 0)
|
|
2747
2747
|
};
|
|
2748
|
-
}),
|
|
2749
|
-
let
|
|
2750
|
-
return
|
|
2751
|
-
let c =
|
|
2752
|
-
if (
|
|
2753
|
-
let e =
|
|
2748
|
+
}), _ = d.flatMap((n) => {
|
|
2749
|
+
let r = e.indexOf(n), i = l === "grouped" ? s.bandwidth / d.length : s.bandwidth;
|
|
2750
|
+
return n.data.map((e, a) => {
|
|
2751
|
+
let c = s.map(t(e)) ?? 0, m, g;
|
|
2752
|
+
if (z && f[r]) {
|
|
2753
|
+
let e = f[r][a];
|
|
2754
2754
|
m = e[1], g = e[0];
|
|
2755
|
-
} else m = n(e), g =
|
|
2756
|
-
let
|
|
2755
|
+
} else m = L(n)(e), g = H;
|
|
2756
|
+
let _ = d.indexOf(n), v = c + (l === "grouped" ? _ * i : 0) + i / 2, y = (Math.min(u.map(m), u.map(g)) + Math.max(u.map(m), u.map(g))) / 2;
|
|
2757
2757
|
return {
|
|
2758
|
-
id: `${
|
|
2759
|
-
cx: N.left + (
|
|
2760
|
-
cy: N.top + (
|
|
2758
|
+
id: `${n.id}-${a}`,
|
|
2759
|
+
cx: N.left + (o ? v : y),
|
|
2760
|
+
cy: N.top + (o ? y : v),
|
|
2761
2761
|
label: t(e),
|
|
2762
|
-
value:
|
|
2763
|
-
seriesId:
|
|
2764
|
-
...
|
|
2762
|
+
value: p ? h[a].total : L(n)(e),
|
|
2763
|
+
seriesId: n.id,
|
|
2764
|
+
...p && { segments: h[a].segs }
|
|
2765
2765
|
};
|
|
2766
2766
|
});
|
|
2767
|
-
}),
|
|
2768
|
-
return
|
|
2769
|
-
points:
|
|
2770
|
-
format:
|
|
2771
|
-
} : { points:
|
|
2767
|
+
}), v = S ?? (p ? rn : void 0);
|
|
2768
|
+
return v ? {
|
|
2769
|
+
points: _,
|
|
2770
|
+
format: v
|
|
2771
|
+
} : { points: _ };
|
|
2772
2772
|
} : void 0,
|
|
2773
2773
|
onSelect: D,
|
|
2774
|
-
children: ({ width:
|
|
2775
|
-
let
|
|
2776
|
-
return
|
|
2774
|
+
children: ({ width: n, height: r }) => {
|
|
2775
|
+
let i = n - N.left - N.right, a = r - N.top - N.bottom, o = c === "vertical", s = g(R, o ? [0, i] : [0, a], .2), u = m([H, W], o ? [a, 0] : [0, i]), h = e.filter((e) => !M.value.has(e.id)), b = [];
|
|
2776
|
+
return z && (b = V()), /* @__PURE__ */ p("g", { children: [O !== "solid" && /* @__PURE__ */ f(Dt, {
|
|
2777
2777
|
prefix: A,
|
|
2778
2778
|
fill: O,
|
|
2779
2779
|
patternKind: k,
|
|
@@ -2784,44 +2784,44 @@ function an({ series: e, x: t, y: n, title: r, description: a, orientation: c =
|
|
|
2784
2784
|
}), /* @__PURE__ */ p("g", {
|
|
2785
2785
|
transform: `translate(${N.left},${N.top})`,
|
|
2786
2786
|
children: [
|
|
2787
|
-
!w &&
|
|
2788
|
-
scale:
|
|
2787
|
+
!w && o && /* @__PURE__ */ f(pt, {
|
|
2788
|
+
scale: u,
|
|
2789
2789
|
orientation: "y",
|
|
2790
|
-
length:
|
|
2790
|
+
length: i,
|
|
2791
2791
|
tickCount: v
|
|
2792
2792
|
}),
|
|
2793
|
-
!w && !
|
|
2794
|
-
scale:
|
|
2793
|
+
!w && !o && /* @__PURE__ */ f(pt, {
|
|
2794
|
+
scale: u,
|
|
2795
2795
|
orientation: "x",
|
|
2796
|
-
length:
|
|
2796
|
+
length: a,
|
|
2797
2797
|
tickCount: _
|
|
2798
2798
|
}),
|
|
2799
2799
|
!w && vt(T, {
|
|
2800
|
-
xScale:
|
|
2801
|
-
yScale:
|
|
2802
|
-
innerW:
|
|
2803
|
-
innerH:
|
|
2800
|
+
xScale: o ? s : u,
|
|
2801
|
+
yScale: o ? u : s,
|
|
2802
|
+
innerW: i,
|
|
2803
|
+
innerH: a
|
|
2804
2804
|
}),
|
|
2805
|
-
|
|
2806
|
-
let
|
|
2807
|
-
return
|
|
2808
|
-
let m =
|
|
2809
|
-
if (
|
|
2810
|
-
let e =
|
|
2811
|
-
|
|
2812
|
-
} else
|
|
2813
|
-
let
|
|
2805
|
+
h.map((n, r) => {
|
|
2806
|
+
let i = n.color ?? nn[e.indexOf(n) % nn.length], a = e.indexOf(n), c = l === "grouped" ? s.bandwidth / h.length : s.bandwidth;
|
|
2807
|
+
return n.data.map((e, d) => {
|
|
2808
|
+
let m = s.map(t(e)) ?? 0, h, g;
|
|
2809
|
+
if (z && b[a]) {
|
|
2810
|
+
let e = b[a][d];
|
|
2811
|
+
h = e[1], g = e[0];
|
|
2812
|
+
} else h = L(n)(e), g = H;
|
|
2813
|
+
let _ = m + (l === "grouped" ? r * c : 0), v = Math.min(u.map(h), u.map(g)), y = Math.abs(u.map(h) - u.map(g)), x = null;
|
|
2814
2814
|
if (j) {
|
|
2815
|
-
let t = j.format(n(e)), r =
|
|
2816
|
-
if (
|
|
2815
|
+
let t = j.format(L(n)(e)), r = _ + c / 2, i = z || y < 18 || v < 14;
|
|
2816
|
+
if (o) x = /* @__PURE__ */ f(St, {
|
|
2817
2817
|
x: r,
|
|
2818
|
-
y: i ?
|
|
2818
|
+
y: i ? v + 13 : v - 4,
|
|
2819
2819
|
text: t,
|
|
2820
2820
|
tone: i ? "muted" : "default"
|
|
2821
2821
|
});
|
|
2822
2822
|
else {
|
|
2823
|
-
let e =
|
|
2824
|
-
|
|
2823
|
+
let e = v + y;
|
|
2824
|
+
x = /* @__PURE__ */ f(St, {
|
|
2825
2825
|
x: i ? e - 4 : e + 4,
|
|
2826
2826
|
y: r + 4,
|
|
2827
2827
|
text: t,
|
|
@@ -2829,52 +2829,52 @@ function an({ series: e, x: t, y: n, title: r, description: a, orientation: c =
|
|
|
2829
2829
|
tone: i ? "muted" : "default"
|
|
2830
2830
|
});
|
|
2831
2831
|
}
|
|
2832
|
-
|
|
2832
|
+
z && y < 14 && (x = null);
|
|
2833
2833
|
}
|
|
2834
|
-
return /* @__PURE__ */ p("g", { children: [
|
|
2835
|
-
x:
|
|
2836
|
-
y,
|
|
2834
|
+
return /* @__PURE__ */ p("g", { children: [o ? /* @__PURE__ */ f("rect", {
|
|
2835
|
+
x: _,
|
|
2836
|
+
y: v,
|
|
2837
2837
|
width: c,
|
|
2838
|
-
height:
|
|
2839
|
-
fill: Et(A,
|
|
2838
|
+
height: y,
|
|
2839
|
+
fill: Et(A, n.id, O, i),
|
|
2840
2840
|
rx: 2,
|
|
2841
|
-
"data-series":
|
|
2841
|
+
"data-series": n.id
|
|
2842
2842
|
}) : /* @__PURE__ */ f("rect", {
|
|
2843
|
-
x:
|
|
2844
|
-
y:
|
|
2845
|
-
width:
|
|
2843
|
+
x: v,
|
|
2844
|
+
y: _,
|
|
2845
|
+
width: y,
|
|
2846
2846
|
height: c,
|
|
2847
|
-
fill: Et(A,
|
|
2847
|
+
fill: Et(A, n.id, O, i),
|
|
2848
2848
|
rx: 2,
|
|
2849
|
-
"data-series":
|
|
2850
|
-
}),
|
|
2849
|
+
"data-series": n.id
|
|
2850
|
+
}), x] }, `${n.id}-${d}`);
|
|
2851
2851
|
});
|
|
2852
2852
|
}),
|
|
2853
|
-
!w &&
|
|
2854
|
-
scale:
|
|
2853
|
+
!w && o && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f($, {
|
|
2854
|
+
scale: s,
|
|
2855
2855
|
orientation: "x",
|
|
2856
|
-
length:
|
|
2856
|
+
length: i,
|
|
2857
2857
|
tickCount: _,
|
|
2858
2858
|
labelEvery: y,
|
|
2859
|
-
transform: `translate(0,${
|
|
2859
|
+
transform: `translate(0,${a})`
|
|
2860
2860
|
}), /* @__PURE__ */ f($, {
|
|
2861
|
-
scale:
|
|
2861
|
+
scale: u,
|
|
2862
2862
|
orientation: "y",
|
|
2863
|
-
length:
|
|
2863
|
+
length: a,
|
|
2864
2864
|
tickCount: v,
|
|
2865
|
-
...
|
|
2865
|
+
...G && { format: G }
|
|
2866
2866
|
})] }),
|
|
2867
|
-
!w && !
|
|
2868
|
-
scale:
|
|
2867
|
+
!w && !o && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f($, {
|
|
2868
|
+
scale: u,
|
|
2869
2869
|
orientation: "x",
|
|
2870
|
-
length:
|
|
2870
|
+
length: i,
|
|
2871
2871
|
tickCount: _,
|
|
2872
|
-
...
|
|
2873
|
-
transform: `translate(0,${
|
|
2872
|
+
...G && { format: G },
|
|
2873
|
+
transform: `translate(0,${a})`
|
|
2874
2874
|
}), /* @__PURE__ */ f($, {
|
|
2875
|
-
scale:
|
|
2875
|
+
scale: s,
|
|
2876
2876
|
orientation: "y",
|
|
2877
|
-
length:
|
|
2877
|
+
length: a,
|
|
2878
2878
|
tickCount: v,
|
|
2879
2879
|
labelEvery: y
|
|
2880
2880
|
})] })
|
|
@@ -3027,10 +3027,10 @@ function cn({ data: e, title: t, description: n, donut: r = !1, width: a, height
|
|
|
3027
3027
|
var ln = Array.from({ length: 8 }, (e, t) => `var(--cascivo-chart-${t + 1})`);
|
|
3028
3028
|
function un({ series: e, title: t, description: n, r = 4, width: a, height: s, xTicks: c = 5, yTicks: l = 5, legend: u, tooltip: h, className: g, plain: _, annotations: v, onSelect: y, glyph: b, renderer: x = "svg", visualMap: S, toolbox: C }) {
|
|
3029
3029
|
o();
|
|
3030
|
-
let w = i(/* @__PURE__ */ new Set()), T = _ ? He :
|
|
3030
|
+
let w = i(/* @__PURE__ */ new Set()), T = _ ? He : Ve, E = s ?? (_ ? 48 : 300), D = _ ? !1 : u ?? e.length > 1, O = e.reduce((e, t) => e + t.data.length, 0), k = !S && (x === "canvas" || x === "auto" && O > 2e3), A = i([S?.min ?? 0, S?.max ?? 1]), j = i(/* @__PURE__ */ new Set()), M = (t, { width: n, height: i }) => {
|
|
3031
3031
|
let a = n - T.left - T.right, o = i - T.top - T.bottom;
|
|
3032
3032
|
if (a <= 0 || o <= 0) return;
|
|
3033
|
-
let s = m([I, L], [0, a]), c = m([
|
|
3033
|
+
let s = m([I, L], [0, a]), c = m([R, ee], [o, 0]);
|
|
3034
3034
|
e.forEach((e, n) => {
|
|
3035
3035
|
if (!w.value.has(e.id)) {
|
|
3036
3036
|
t.fillStyle = Je(t, e.color ?? ln[n % ln.length]), t.globalAlpha = .7;
|
|
@@ -3040,7 +3040,7 @@ function un({ series: e, title: t, description: n, r = 4, width: a, height: s, x
|
|
|
3040
3040
|
}
|
|
3041
3041
|
}
|
|
3042
3042
|
}), t.globalAlpha = 1;
|
|
3043
|
-
}, N = e.flatMap((e) => e.data.map((e) => e.x)), P = e.flatMap((e) => e.data.map((e) => e.y)), F = N.length > 0, I = F ? Math.min(...N) : 0, L = F ? Math.max(...N) : 1,
|
|
3043
|
+
}, N = e.flatMap((e) => e.data.map((e) => e.x)), P = e.flatMap((e) => e.data.map((e) => e.y)), F = N.length > 0, I = F ? Math.min(...N) : 0, L = F ? Math.max(...N) : 1, R = F ? Math.min(0, ...P) : 0, ee = F ? Math.max(...P) : 1;
|
|
3044
3044
|
return /* @__PURE__ */ p("div", {
|
|
3045
3045
|
style: {
|
|
3046
3046
|
display: "flex",
|
|
@@ -3071,7 +3071,7 @@ function un({ series: e, title: t, description: n, r = 4, width: a, height: s, x
|
|
|
3071
3071
|
plain: _,
|
|
3072
3072
|
tooltip: h !== !1 && F ? ({ width: t, height: n }) => {
|
|
3073
3073
|
if (h === !1 || !F) return;
|
|
3074
|
-
let r = t - T.left - T.right, i = n - T.top - T.bottom, a = m([I, L], [0, r]), o = m([
|
|
3074
|
+
let r = t - T.left - T.right, i = n - T.top - T.bottom, a = m([I, L], [0, r]), o = m([R, ee], [i, 0]);
|
|
3075
3075
|
return { points: e.flatMap((e) => w.value.has(e.id) ? [] : e.data.map((t, n) => ({
|
|
3076
3076
|
id: `${e.id}-${n}`,
|
|
3077
3077
|
cx: T.left + a.map(t.x),
|
|
@@ -3090,7 +3090,7 @@ function un({ series: e, title: t, description: n, r = 4, width: a, height: s, x
|
|
|
3090
3090
|
A.value = [S.min, S.max], j.value = /* @__PURE__ */ new Set();
|
|
3091
3091
|
} : void 0,
|
|
3092
3092
|
children: ({ width: t, height: n }) => {
|
|
3093
|
-
let i = t - T.left - T.right, a = n - T.top - T.bottom, o = m([I, L], [0, i]), s = m([
|
|
3093
|
+
let i = t - T.left - T.right, a = n - T.top - T.bottom, o = m([I, L], [0, i]), s = m([R, ee], [a, 0]);
|
|
3094
3094
|
return /* @__PURE__ */ f("g", { children: /* @__PURE__ */ p("g", {
|
|
3095
3095
|
transform: `translate(${T.left},${T.top})`,
|
|
3096
3096
|
children: [
|
|
@@ -3368,7 +3368,7 @@ function hn({ value: e, label: t, delta: n, deltaLabel: r, icon: i, sparkline: a
|
|
|
3368
3368
|
//#region src/charts/histogram/histogram.tsx
|
|
3369
3369
|
function gn({ data: e, bins: t, title: n, label: r, description: i, width: a, height: s, className: c, plain: l }) {
|
|
3370
3370
|
o();
|
|
3371
|
-
let u = l ? He :
|
|
3371
|
+
let u = l ? He : Ve, h = s ?? (l ? 48 : 300), g = V(e, t), _ = g.reduce((e, t) => Math.max(e, t.count), 0);
|
|
3372
3372
|
return /* @__PURE__ */ f(Q, {
|
|
3373
3373
|
title: n,
|
|
3374
3374
|
description: i,
|
|
@@ -3445,7 +3445,7 @@ function gn({ data: e, bins: t, title: n, label: r, description: i, width: a, he
|
|
|
3445
3445
|
var _n = Array.from({ length: 8 }, (e, t) => `var(--cascivo-chart-${t + 1})`);
|
|
3446
3446
|
function vn({ series: e, title: t, description: n, width: r, height: i, className: a, plain: s }) {
|
|
3447
3447
|
o();
|
|
3448
|
-
let c = s ? He :
|
|
3448
|
+
let c = s ? He : Ve, l = i ?? (s ? 48 : 320), u = e.map((e) => ({
|
|
3449
3449
|
...e,
|
|
3450
3450
|
stats: H(e.values)
|
|
3451
3451
|
})), h = e.flatMap((e) => e.values), [_, v] = h.length > 0 ? U(h) : [0, 1];
|
|
@@ -3587,7 +3587,7 @@ function vn({ series: e, title: t, description: n, width: r, height: i, classNam
|
|
|
3587
3587
|
var yn = Array.from({ length: 8 }, (e, t) => `var(--cascivo-chart-${t + 1})`), bn = 3, xn = 24;
|
|
3588
3588
|
function Sn({ series: e, title: t, description: n, width: r, height: a, tooltip: s, className: c, plain: l, glyph: u }) {
|
|
3589
3589
|
o();
|
|
3590
|
-
let h = i(null), g = l ? He :
|
|
3590
|
+
let h = i(null), g = l ? He : Ve, v = a ?? (l ? 48 : 320), y = e.flatMap((e) => e.data), [b, x] = y.length > 0 ? U(y.map((e) => e.x)) : [0, 1], [S, C] = y.length > 0 ? U(y.map((e) => e.y)) : [0, 1], [w, T] = y.length > 0 ? U(y.map((e) => e.size)) : [0, 1], E = _([w, T], [bn, xn]), D = y.length > 0;
|
|
3591
3591
|
return /* @__PURE__ */ f(Q, {
|
|
3592
3592
|
title: t,
|
|
3593
3593
|
description: n,
|
|
@@ -3696,8 +3696,8 @@ function Sn({ series: e, title: t, description: n, width: r, height: a, tooltip:
|
|
|
3696
3696
|
function Cn({ bars: e, line: t, title: n, description: r, secondAxis: i = !1, width: a, height: s, tooltip: c, className: l, plain: u, annotations: h }) {
|
|
3697
3697
|
o();
|
|
3698
3698
|
let _ = s ?? (u ? 48 : 320), v = u ? He : {
|
|
3699
|
-
...
|
|
3700
|
-
right: i ? 60 :
|
|
3699
|
+
...Ve,
|
|
3700
|
+
right: i ? 60 : Ve.right
|
|
3701
3701
|
}, y = e.reduce((e, t) => Math.max(e, t.value), 0) || 1, b = t.length > 0 ? Math.min(...t.map((e) => e.y)) : 0, x = t.length > 0 ? Math.max(...t.map((e) => e.y)) : 1, S = e.length > 0;
|
|
3702
3702
|
return /* @__PURE__ */ f(Q, {
|
|
3703
3703
|
title: n,
|
|
@@ -4246,7 +4246,7 @@ function Pn({ data: e, title: t, description: n, size: r, width: a, height: s, m
|
|
|
4246
4246
|
var Fn = Array.from({ length: 8 }, (e, t) => `var(--cascivo-chart-${t + 1})`);
|
|
4247
4247
|
function In({ data: e, title: t, description: n, width: r, height: i, showConversion: a = !1, tooltip: s, className: c, plain: l }) {
|
|
4248
4248
|
o();
|
|
4249
|
-
let u = l ? He :
|
|
4249
|
+
let u = l ? He : Ve, d = i ?? (l ? 48 : 320), h = e.length > 0, g = e[0]?.value ?? 0, _ = Math.max(1, ...e.map((e) => e.value));
|
|
4250
4250
|
return /* @__PURE__ */ f(Q, {
|
|
4251
4251
|
title: t,
|
|
4252
4252
|
description: n,
|
|
@@ -4318,7 +4318,7 @@ function In({ data: e, title: t, description: n, width: r, height: i, showConver
|
|
|
4318
4318
|
var Ln = Array.from({ length: 8 }, (e, t) => `var(--cascivo-chart-${t + 1})`);
|
|
4319
4319
|
function Rn({ series: e, categories: t, title: n, description: r, offset: a = "silhouette", curve: s = "basis", width: c, height: l, legend: u, tooltip: d, className: h, plain: _ }) {
|
|
4320
4320
|
o();
|
|
4321
|
-
let v = i(/* @__PURE__ */ new Set()), y = _ ? He :
|
|
4321
|
+
let v = i(/* @__PURE__ */ new Set()), y = _ ? He : Ve, b = l ?? (_ ? 48 : 300), x = _ ? !1 : u ?? e.length > 1, S = t.length > 0 && e.length > 0, C = ne(e.map((e) => e.values), a), [w, E] = J(C);
|
|
4322
4322
|
return /* @__PURE__ */ p("div", {
|
|
4323
4323
|
style: {
|
|
4324
4324
|
display: "flex",
|
|
@@ -4450,7 +4450,7 @@ function Bn({ data: e, title: t, description: n, size: r, width: i, height: a, t
|
|
|
4450
4450
|
var Vn = Array.from({ length: 8 }, (e, t) => `var(--cascivo-chart-${t + 1})`);
|
|
4451
4451
|
function Hn({ nodes: e, links: t, title: n, description: r, width: i, height: a, tooltip: s, className: c, plain: l }) {
|
|
4452
4452
|
o();
|
|
4453
|
-
let u = l ? He :
|
|
4453
|
+
let u = l ? He : Ve, d = a ?? (l ? 48 : 320), m = e.length > 0 && t.length > 0, h = (t, n) => e.find((e) => e.id === t)?.color ?? Vn[n % Vn.length];
|
|
4454
4454
|
return /* @__PURE__ */ f(Q, {
|
|
4455
4455
|
title: n,
|
|
4456
4456
|
description: r,
|
|
@@ -4474,7 +4474,7 @@ function Hn({ nodes: e, links: t, title: n, description: r, width: i, height: a,
|
|
|
4474
4474
|
plain: l,
|
|
4475
4475
|
tooltip: s && m ? ({ width: n, height: r }) => {
|
|
4476
4476
|
if (!s || !m) return;
|
|
4477
|
-
let { nodes: i } =
|
|
4477
|
+
let { nodes: i } = Z(e, t, {
|
|
4478
4478
|
width: n - u.left - u.right,
|
|
4479
4479
|
height: r - u.top - u.bottom
|
|
4480
4480
|
});
|
|
@@ -4490,14 +4490,14 @@ function Hn({ nodes: e, links: t, title: n, description: r, width: i, height: a,
|
|
|
4490
4490
|
children: ({ width: n, height: r }) => {
|
|
4491
4491
|
let i = n - u.left - u.right, a = r - u.top - u.bottom;
|
|
4492
4492
|
if (i <= 0 || !m) return null;
|
|
4493
|
-
let { nodes: o, links: s } =
|
|
4493
|
+
let { nodes: o, links: s } = Z(e, t, {
|
|
4494
4494
|
width: i,
|
|
4495
4495
|
height: a
|
|
4496
4496
|
});
|
|
4497
4497
|
return /* @__PURE__ */ p("g", {
|
|
4498
4498
|
transform: `translate(${u.left},${u.top})`,
|
|
4499
4499
|
children: [s.map((e, t) => /* @__PURE__ */ f("path", {
|
|
4500
|
-
d:
|
|
4500
|
+
d: ie(e),
|
|
4501
4501
|
fill: h(e.source.id, o.indexOf(e.source)),
|
|
4502
4502
|
fillOpacity: .32,
|
|
4503
4503
|
"data-link": ""
|
|
@@ -4607,7 +4607,7 @@ function qn({ data: e, title: t, description: n, from: r, to: a, width: s, heigh
|
|
|
4607
4607
|
//#region src/charts/candlestick/candlestick.tsx
|
|
4608
4608
|
function Jn({ data: e, title: t, description: n, width: r, height: s, yTicks: l = 5, upColor: u = "var(--cascivo-chart-2)", downColor: h = "var(--cascivo-chart-4)", volume: _, tooltip: v, className: y, plain: b, annotations: x, brush: S, dataZoom: C, zoom: w, syncId: T, tooltipMode: E }) {
|
|
4609
4609
|
o();
|
|
4610
|
-
let D = b ? He :
|
|
4610
|
+
let D = b ? He : Ve, O = s ?? (b ? 64 : 320), k = e.length, A = (S || C || w || T !== void 0) && k > 0, j = i([0, Math.max(0, k - 1)]), M = c(null);
|
|
4611
4611
|
T && !M.current && (M.current = st(T)), a(() => () => {
|
|
4612
4612
|
T && ct(T);
|
|
4613
4613
|
}), a(() => {
|
|
@@ -4621,7 +4621,7 @@ function Jn({ data: e, title: t, description: n, width: r, height: s, yTicks: l
|
|
|
4621
4621
|
let t = j.value, n = e.window.peek();
|
|
4622
4622
|
(!n || n[0] !== t[0] || n[1] !== t[1]) && (e.window.value = t);
|
|
4623
4623
|
});
|
|
4624
|
-
let N = A ? e.slice(j.value[0], j.value[1] + 1) : e, P = N.length > 0, F = P ? Math.min(...N.map((e) => e.low)) : 0, I = P ? Math.max(...N.map((e) => e.high)) : 1, L = P ? Math.max(1, ...N.map((e) => e.volume ?? 0)) : 1,
|
|
4624
|
+
let N = A ? e.slice(j.value[0], j.value[1] + 1) : e, P = N.length > 0, F = P ? Math.min(...N.map((e) => e.low)) : 0, I = P ? Math.max(...N.map((e) => e.high)) : 1, L = P ? Math.max(1, ...N.map((e) => e.volume ?? 0)) : 1, R = N.map((e) => e.t);
|
|
4625
4625
|
return /* @__PURE__ */ p("div", {
|
|
4626
4626
|
style: {
|
|
4627
4627
|
display: "flex",
|
|
@@ -4658,7 +4658,7 @@ function Jn({ data: e, title: t, description: n, width: r, height: s, yTicks: l
|
|
|
4658
4658
|
if (v === !1 || !P) return;
|
|
4659
4659
|
let n = e - D.left - D.right, r = t - D.top - D.bottom;
|
|
4660
4660
|
if (n <= 0) return;
|
|
4661
|
-
let i = g(
|
|
4661
|
+
let i = g(R, [0, n], .3), a = r - (_ ? Math.min(r * .2, 60) : 0), o = m([F, I], [a, 0]);
|
|
4662
4662
|
if (E === "axis") return {
|
|
4663
4663
|
points: N.map((e, t) => ({
|
|
4664
4664
|
id: `c-${t}`,
|
|
@@ -4716,7 +4716,7 @@ function Jn({ data: e, title: t, description: n, width: r, height: s, yTicks: l
|
|
|
4716
4716
|
children: ({ width: e, height: t }) => {
|
|
4717
4717
|
let n = e - D.left - D.right, r = t - D.top - D.bottom;
|
|
4718
4718
|
if (n <= 0 || !P) return null;
|
|
4719
|
-
let i = g(
|
|
4719
|
+
let i = g(R, [0, n], .3), a = m([F, I], [r, 0]), o = _ ? Math.min(r * .2, 60) : 0, s = r - o, c = m([F, I], [s, 0]), v = i.bandwidth;
|
|
4720
4720
|
return /* @__PURE__ */ p("g", {
|
|
4721
4721
|
transform: `translate(${D.left},${D.top})`,
|
|
4722
4722
|
children: [
|
|
@@ -4799,7 +4799,7 @@ function Jn({ data: e, title: t, description: n, width: r, height: s, yTicks: l
|
|
|
4799
4799
|
var Yn = Array.from({ length: 8 }, (e, t) => `var(--cascivo-chart-${t + 1})`);
|
|
4800
4800
|
function Xn({ data: e, title: t, description: n, mode: r = "bar", width: i, height: a, rings: s = 4, max: c, tooltip: l, className: u, plain: m }) {
|
|
4801
4801
|
o();
|
|
4802
|
-
let h = a ?? 320, g = e.length > 0, _ = e.map((e) => e.label), v = c ?? (g ? Math.max(1, ...e.map((e) => e.value)) : 1), y =
|
|
4802
|
+
let h = a ?? 320, g = e.length > 0, _ = e.map((e) => e.label), v = c ?? (g ? Math.max(1, ...e.map((e) => e.value)) : 1), y = be(_), b = /* @__PURE__ */ p("table", { children: [
|
|
4803
4803
|
/* @__PURE__ */ f("caption", { children: t }),
|
|
4804
4804
|
/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [/* @__PURE__ */ f("th", { children: "Category" }), /* @__PURE__ */ f("th", { children: "Value" })] }) }),
|
|
4805
4805
|
/* @__PURE__ */ f("tbody", { children: e.map((e, t) => /* @__PURE__ */ p("tr", { children: [/* @__PURE__ */ f("td", { children: e.label }), /* @__PURE__ */ f("td", { children: e.value })] }, t)) })
|
|
@@ -4809,7 +4809,7 @@ function Xn({ data: e, title: t, description: n, mode: r = "bar", width: i, heig
|
|
|
4809
4809
|
cx: n,
|
|
4810
4810
|
cy: r,
|
|
4811
4811
|
outerR: i,
|
|
4812
|
-
rScale:
|
|
4812
|
+
rScale: xe([0, v], [0, i])
|
|
4813
4813
|
};
|
|
4814
4814
|
};
|
|
4815
4815
|
return /* @__PURE__ */ f(Q, {
|
|
@@ -4826,7 +4826,7 @@ function Xn({ data: e, title: t, description: n, mode: r = "bar", width: i, heig
|
|
|
4826
4826
|
let { cx: r, cy: i, rScale: a } = x(t, n);
|
|
4827
4827
|
return {
|
|
4828
4828
|
points: e.map((e, t) => {
|
|
4829
|
-
let n = y.center(e.label) ?? 0, [o, s] =
|
|
4829
|
+
let n = y.center(e.label) ?? 0, [o, s] = ye(r, i, a.map(e.value), n);
|
|
4830
4830
|
return {
|
|
4831
4831
|
id: `p-${t}`,
|
|
4832
4832
|
cx: o,
|
|
@@ -4842,7 +4842,7 @@ function Xn({ data: e, title: t, description: n, mode: r = "bar", width: i, heig
|
|
|
4842
4842
|
if (!g) return null;
|
|
4843
4843
|
let { cx: i, cy: a, outerR: o, rScale: c } = x(t, n), l = Array.from({ length: s }, (e, t) => o * (t + 1) / s), u = e.map((e) => {
|
|
4844
4844
|
let t = y.center(e.label) ?? 0;
|
|
4845
|
-
return
|
|
4845
|
+
return ye(i, a, c.map(e.value), t);
|
|
4846
4846
|
});
|
|
4847
4847
|
return /* @__PURE__ */ p("g", { children: [
|
|
4848
4848
|
!m && l.map((e, t) => /* @__PURE__ */ f("circle", {
|
|
@@ -4879,7 +4879,7 @@ function Xn({ data: e, title: t, description: n, mode: r = "bar", width: i, heig
|
|
|
4879
4879
|
})] });
|
|
4880
4880
|
})(),
|
|
4881
4881
|
!m && e.map((e, t) => {
|
|
4882
|
-
let n = y.center(e.label) ?? 0, [r, s] =
|
|
4882
|
+
let n = y.center(e.label) ?? 0, [r, s] = ye(i, a, o + 12, n);
|
|
4883
4883
|
return /* @__PURE__ */ f("text", {
|
|
4884
4884
|
x: r,
|
|
4885
4885
|
y: s,
|
|
@@ -4934,7 +4934,7 @@ function Qn({ value: e, min: t = 0, max: n = 100, thresholds: r, unit: i = "", s
|
|
|
4934
4934
|
}, t);
|
|
4935
4935
|
}),
|
|
4936
4936
|
!h && T.map((e, t) => {
|
|
4937
|
-
let n = S(e), [r, i] =
|
|
4937
|
+
let n = S(e), [r, i] = ye(c, l, m - 2, n), [a, o] = ye(c, l, m - 8, n), [s, u] = ye(c, l, m - 18, n);
|
|
4938
4938
|
return /* @__PURE__ */ p("g", { children: [/* @__PURE__ */ f("line", {
|
|
4939
4939
|
x1: r,
|
|
4940
4940
|
y1: i,
|
|
@@ -4954,7 +4954,7 @@ function Qn({ value: e, min: t = 0, max: n = 100, thresholds: r, unit: i = "", s
|
|
|
4954
4954
|
})] }, t);
|
|
4955
4955
|
}),
|
|
4956
4956
|
(() => {
|
|
4957
|
-
let [e, t] =
|
|
4957
|
+
let [e, t] = ye(c, l, g, S(v));
|
|
4958
4958
|
return /* @__PURE__ */ f("line", {
|
|
4959
4959
|
x1: c,
|
|
4960
4960
|
y1: l,
|
|
@@ -4988,4 +4988,4 @@ function Qn({ value: e, min: t = 0, max: n = 100, thresholds: r, unit: i = "", s
|
|
|
4988
4988
|
});
|
|
4989
4989
|
}
|
|
4990
4990
|
//#endregion
|
|
4991
|
-
export { tn as AreaChart, $ as Axis, an as BarChart, vn as Boxplot, Pt as Brush, Sn as BubbleChart, Mn as Bullet, qn as Calendar, Jn as Candlestick, qe as CanvasLayer, Dt as ChartDefs, Q as ChartFrame, Cn as ComboChart,
|
|
4991
|
+
export { tn as AreaChart, $ as Axis, an as BarChart, vn as Boxplot, Pt as Brush, Sn as BubbleChart, Mn as Bullet, qn as Calendar, Jn as Candlestick, qe as CanvasLayer, Dt as ChartDefs, Q as ChartFrame, Cn as ComboChart, Ve as DEFAULT_MARGINS, St as DataLabel, Ft as DataZoom, In as Funnel, Qn as Gauge, kt as Glyph, pt as GridLines, wn as Heatmap, gn as Histogram, hn as Kpi, Kt as Legend, Qt as LineChart, pn as Meter, He as PLAIN_MARGINS, cn as PieChart, Xn as Polar, An as Radar, Pn as RadialBar, Hn as Sankey, un as ScatterChart, dn as Sparkline, Rn as Stream, Bn as Sunburst, Nt as Text, et as Toolbox, En as Treemap, Wt as VisualMap, lt as _syncGroupCount, Ee as aggregate, be as angleBand, yt as annotationSummary, P as arcPath, N as areaPath, g as bandScale, De as bin, V as binValues, ze as bindStream, H as boxStats, z as cellPath, Ie as decimate, he as divergingRamp, it as download, Me as encode, Ne as encodeCategory, U as extent, Et as fillFor, Se as filter, st as getSyncGroup, Ot as glyphPath, wt as gradientId, Qe as isZoomed, T as linePath, m as linearScale, ie as linkPath, v as logScale, Pe as lttb, Ht as mapVisual, X as maxDepth, Fe as minmax, L as nearestIndex, h as niceTicks, Ze as panWindow, re as partition, Tt as patternId, Vt as pieceIndex, ye as polarPoint, C as quantize, xe as radiusScale, ve as rampLightness, ge as rampOf, _e as rampStops, Ae as regression, ct as releaseSyncGroup, _t as renderAnnotation, vt as renderAnnotations, Je as resolveColor, xt as resolveLabels, Z as sankeyLayout, me as sequentialRamp, nt as serializeSvg, we as sort, w as splitDefined, _ as sqrtScale, q as squarify, F as stackSeries, J as streamExtent, ne as streamLayout, Y as sumValue, rt as svgToPngBlob, S as timeScale, I as toStackedSeries, Be as useChartSize, Re as useStreamSeries, Ut as visualVisible, te as voronoiCells, R as voronoiFind, Mt as wrapText, Xe as zoomWindow };
|