@cfasim-ui/charts 0.4.2 → 0.4.4
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/dist/ChoroplethMap/ChoroplethMap.d.ts +15 -0
- package/dist/index.css +1 -1
- package/dist/index.js +317 -241
- package/package.json +5 -3
package/dist/index.js
CHANGED
|
@@ -3,9 +3,10 @@ import { DropdownMenuContent as T, DropdownMenuItem as E, DropdownMenuPortal as
|
|
|
3
3
|
import { geoAlbersUsa as P, geoPath as ie } from "d3-geo";
|
|
4
4
|
import { zoom as F, zoomIdentity as I } from "d3-zoom";
|
|
5
5
|
import { select as ae } from "d3-selection";
|
|
6
|
+
import "d3-transition";
|
|
6
7
|
import { feature as L, merge as oe, mesh as R } from "topojson-client";
|
|
7
8
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var z = { class: "chart-menu-trigger-area" }, B = ["aria-label"], V = /* @__PURE__ */ l({
|
|
9
10
|
__name: "ChartMenu",
|
|
10
11
|
props: {
|
|
11
12
|
items: {},
|
|
@@ -16,7 +17,7 @@ var se = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PUR
|
|
|
16
17
|
},
|
|
17
18
|
setup(t) {
|
|
18
19
|
let n = t, i = () => n.forceDropdown || n.items.length > 1;
|
|
19
|
-
return (n, l) => (g(), a("div",
|
|
20
|
+
return (n, l) => (g(), a("div", z, [i() ? (g(), r(x(O), {
|
|
20
21
|
key: 1,
|
|
21
22
|
modal: !1
|
|
22
23
|
}, {
|
|
@@ -82,42 +83,42 @@ var se = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PUR
|
|
|
82
83
|
"stroke-linecap": "round",
|
|
83
84
|
"stroke-linejoin": "round",
|
|
84
85
|
"aria-hidden": "true"
|
|
85
|
-
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8,
|
|
86
|
+
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, B))]));
|
|
86
87
|
}
|
|
87
|
-
}),
|
|
88
|
+
}), H = (e, t) => {
|
|
88
89
|
let n = e.__vccOpts || e;
|
|
89
90
|
for (let [e, r] of t) n[e] = r;
|
|
90
91
|
return n;
|
|
91
|
-
},
|
|
92
|
+
}, se = /* @__PURE__ */ H(V, [["__scopeId", "data-v-b3c563e8"]]);
|
|
92
93
|
//#endregion
|
|
93
94
|
//#region src/_shared/axes.ts
|
|
94
|
-
function
|
|
95
|
+
function U(e) {
|
|
95
96
|
return Math.round(e) + .5;
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function W(e, t) {
|
|
98
99
|
let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
|
|
99
100
|
return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
+
function G(e, t, n) {
|
|
102
103
|
if (!(n > 0) || !isFinite(n)) return [];
|
|
103
104
|
let r = [], i = Math.ceil(e / n) * n;
|
|
104
105
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
105
106
|
return r;
|
|
106
107
|
}
|
|
107
|
-
var
|
|
108
|
-
function
|
|
109
|
-
return Math.abs(e) >= 1e3 ?
|
|
108
|
+
var ce = new Intl.NumberFormat();
|
|
109
|
+
function K(e) {
|
|
110
|
+
return Math.abs(e) >= 1e3 ? ce.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
|
|
110
111
|
}
|
|
111
112
|
//#endregion
|
|
112
113
|
//#region src/_shared/computeTicks.ts
|
|
113
|
-
function
|
|
114
|
+
function le(e) {
|
|
114
115
|
let { min: t, max: n, ticks: r } = e;
|
|
115
116
|
if (t === n) return [];
|
|
116
117
|
let i = e.displayOffset ?? 0;
|
|
117
118
|
if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
|
|
118
|
-
if (typeof r == "number") return
|
|
119
|
-
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o =
|
|
120
|
-
return
|
|
119
|
+
if (typeof r == "number") return G(t + i, n + i, r).map((e) => e - i);
|
|
120
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = W(n - t, a);
|
|
121
|
+
return G(t + i, n + i, o).map((e) => e - i);
|
|
121
122
|
}
|
|
122
123
|
//#endregion
|
|
123
124
|
//#region src/_shared/useChartSize.ts
|
|
@@ -337,14 +338,14 @@ function Q(e) {
|
|
|
337
338
|
}
|
|
338
339
|
//#endregion
|
|
339
340
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
340
|
-
var ve = ["width", "height"], ye = ["x"], be = { key: 1 },
|
|
341
|
+
var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
341
342
|
"x1",
|
|
342
343
|
"y1",
|
|
343
344
|
"x2",
|
|
344
345
|
"y2",
|
|
345
346
|
"stroke",
|
|
346
347
|
"stroke-dasharray"
|
|
347
|
-
],
|
|
348
|
+
], $ = [
|
|
348
349
|
"cx",
|
|
349
350
|
"cy",
|
|
350
351
|
"fill",
|
|
@@ -453,7 +454,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
453
454
|
], Ge = ["x", "y"], Ke = { class: "line-chart-tooltip" }, qe = {
|
|
454
455
|
key: 0,
|
|
455
456
|
class: "line-chart-tooltip-label"
|
|
456
|
-
}, Je = ["href", "download"], Ye = 36, Xe = 12, Ze = 7, Qe = 16, $e = /* @__PURE__ */
|
|
457
|
+
}, Je = ["href", "download"], Ye = 36, Xe = 12, Ze = 7, Qe = 16, $e = /* @__PURE__ */ H(/* @__PURE__ */ l({
|
|
457
458
|
__name: "LineChart",
|
|
458
459
|
props: {
|
|
459
460
|
y: {},
|
|
@@ -507,7 +508,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
507
508
|
};
|
|
508
509
|
}
|
|
509
510
|
function D(e) {
|
|
510
|
-
return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.yTickFormat ? l.yTickFormat(e) :
|
|
511
|
+
return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.yTickFormat ? l.yTickFormat(e) : K(e);
|
|
511
512
|
}
|
|
512
513
|
let O = n(() => {
|
|
513
514
|
if (l.series && l.series.length > 0) return l.series.map(E);
|
|
@@ -615,7 +616,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
615
616
|
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && O.value[e.seriesIndex] || O.value[0];
|
|
616
617
|
return F(r ? M(r, n) : n);
|
|
617
618
|
}
|
|
618
|
-
function
|
|
619
|
+
function z(e, t = !0) {
|
|
619
620
|
let n = S.value.top + w.value;
|
|
620
621
|
if (e.seriesIndex == null) {
|
|
621
622
|
let t = R(e, "start"), r = R(e, "end");
|
|
@@ -629,7 +630,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
629
630
|
for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${F(M(r, e))},${s(r.data[e])}`);
|
|
630
631
|
return t && (u += `L${F(M(r, l))},${n}`, u += `L${F(M(r, c))},${n}`, u += "Z"), u;
|
|
631
632
|
}
|
|
632
|
-
let
|
|
633
|
+
let B = n(() => {
|
|
633
634
|
let e = l.areaSections;
|
|
634
635
|
if (!e?.length) return {
|
|
635
636
|
labels: [],
|
|
@@ -665,7 +666,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
665
666
|
labels: t,
|
|
666
667
|
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Ye + Xe
|
|
667
668
|
};
|
|
668
|
-
}),
|
|
669
|
+
}), V = n(() => {
|
|
669
670
|
let e = [];
|
|
670
671
|
for (let t of O.value) t.legend && e.push({
|
|
671
672
|
label: t.legend,
|
|
@@ -685,12 +686,12 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
685
686
|
});
|
|
686
687
|
}
|
|
687
688
|
return e;
|
|
688
|
-
}),
|
|
689
|
-
let { min: e, max: t } = I.value, n = (t) =>
|
|
689
|
+
}), H = n(() => b.value + B.value.extraHeight), W = n(() => S.value.top + w.value + S.value.bottom + Xe), G = n(() => {
|
|
690
|
+
let { min: e, max: t } = I.value, n = (t) => U(S.value.top + w.value - (t - e) / I.value.range * w.value), r = (e) => l.yTickFormat ? l.yTickFormat(e) : K(e);
|
|
690
691
|
return e === t ? [{
|
|
691
692
|
value: r(e),
|
|
692
|
-
y:
|
|
693
|
-
}] :
|
|
693
|
+
y: U(S.value.top + w.value / 2)
|
|
694
|
+
}] : le({
|
|
694
695
|
min: e,
|
|
695
696
|
max: t,
|
|
696
697
|
ticks: l.yTicks,
|
|
@@ -699,18 +700,18 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
699
700
|
value: r(e),
|
|
700
701
|
y: n(e)
|
|
701
702
|
}));
|
|
702
|
-
}),
|
|
703
|
+
}), ce = n(() => {
|
|
703
704
|
let { min: e, max: t } = ie.value;
|
|
704
705
|
if (e === t) return [];
|
|
705
706
|
let n = P.value, r = A.value, i = (e, t) => {
|
|
706
707
|
let r = e + n;
|
|
707
|
-
return l.xTickFormat ? l.xTickFormat(r, t) : !j.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] :
|
|
708
|
+
return l.xTickFormat ? l.xTickFormat(r, t) : !j.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : K(r);
|
|
708
709
|
}, a;
|
|
709
710
|
if (l.xTicks == null && !j.value && l.xLabels && l.xLabels.length === r) {
|
|
710
711
|
let e = Math.max(3, Math.floor(C.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
|
|
711
712
|
a = [];
|
|
712
713
|
for (let e = 0; e < r; e += t) a.push(e);
|
|
713
|
-
} else a =
|
|
714
|
+
} else a = le({
|
|
714
715
|
min: e,
|
|
715
716
|
max: t,
|
|
716
717
|
ticks: l.xTicks,
|
|
@@ -719,7 +720,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
719
720
|
});
|
|
720
721
|
let o = S.value.left, s = S.value.left + C.value;
|
|
721
722
|
return a.map((e, t) => {
|
|
722
|
-
let n =
|
|
723
|
+
let n = U(F(e)), r = "middle";
|
|
723
724
|
return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
|
|
724
725
|
value: i(e, t),
|
|
725
726
|
x: n,
|
|
@@ -765,7 +766,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
765
766
|
let e = Q.value, t = Y.value;
|
|
766
767
|
if (e === null || t === null) return null;
|
|
767
768
|
let n = t + P.value, r;
|
|
768
|
-
return r = l.xTickFormat ? l.xTickFormat(n, e) : j.value ?
|
|
769
|
+
return r = l.xTickFormat ? l.xTickFormat(n, e) : j.value ? K(n) : l.xLabels?.[e], {
|
|
769
770
|
index: e,
|
|
770
771
|
xLabel: r,
|
|
771
772
|
values: O.value.map((e, n) => {
|
|
@@ -805,7 +806,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
805
806
|
ref: h,
|
|
806
807
|
class: "line-chart-wrapper"
|
|
807
808
|
}, [
|
|
808
|
-
t.menu ? (g(), r(
|
|
809
|
+
t.menu ? (g(), r(se, {
|
|
809
810
|
key: 0,
|
|
810
811
|
items: x(rt)
|
|
811
812
|
}, null, 8, ["items"])) : i("", !0),
|
|
@@ -813,7 +814,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
813
814
|
ref_key: "svgRef",
|
|
814
815
|
ref: nt,
|
|
815
816
|
width: _.value,
|
|
816
|
-
height:
|
|
817
|
+
height: H.value
|
|
817
818
|
}, [
|
|
818
819
|
t.title ? (g(), a("text", {
|
|
819
820
|
key: 0,
|
|
@@ -824,7 +825,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
824
825
|
"font-weight": "600",
|
|
825
826
|
fill: "currentColor"
|
|
826
827
|
}, y(t.title), 9, ye)) : i("", !0),
|
|
827
|
-
|
|
828
|
+
V.value.length > 0 ? (g(), a("g", be, [(g(!0), a(e, null, v(V.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [t.type === "series" ? (g(), a("line", {
|
|
828
829
|
key: 0,
|
|
829
830
|
x1: x(S).left + n * 120,
|
|
830
831
|
y1: x(S).top - x(20) / 2,
|
|
@@ -833,7 +834,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
833
834
|
stroke: t.color,
|
|
834
835
|
"stroke-width": "2",
|
|
835
836
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
836
|
-
}, null, 8,
|
|
837
|
+
}, null, 8, xe)) : (g(), a("circle", {
|
|
837
838
|
key: 1,
|
|
838
839
|
cx: x(S).left + n * 120 + 4,
|
|
839
840
|
cy: x(S).top - x(20) / 2,
|
|
@@ -842,29 +843,29 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
842
843
|
"fill-opacity": t.fillOpacity,
|
|
843
844
|
stroke: t.color,
|
|
844
845
|
"stroke-width": "1.5"
|
|
845
|
-
}, null, 8,
|
|
846
|
+
}, null, 8, $)), o("text", {
|
|
846
847
|
x: x(S).left + n * 120 + 18,
|
|
847
848
|
y: x(S).top - x(20) / 2 + 4,
|
|
848
849
|
"font-size": "11",
|
|
849
850
|
fill: "currentColor"
|
|
850
851
|
}, y(t.label), 9, Se)], 64))), 128))])) : i("", !0),
|
|
851
852
|
o("line", {
|
|
852
|
-
x1: x(
|
|
853
|
-
y1: x(
|
|
854
|
-
x2: x(
|
|
855
|
-
y2: x(
|
|
853
|
+
x1: x(U)(x(S).left),
|
|
854
|
+
y1: x(U)(x(S).top),
|
|
855
|
+
x2: x(U)(x(S).left),
|
|
856
|
+
y2: x(U)(x(S).top + x(w)),
|
|
856
857
|
stroke: "currentColor",
|
|
857
858
|
"stroke-opacity": "0.3"
|
|
858
859
|
}, null, 8, Ce),
|
|
859
860
|
o("line", {
|
|
860
|
-
x1: x(
|
|
861
|
-
y1: x(
|
|
862
|
-
x2: x(
|
|
863
|
-
y2: x(
|
|
861
|
+
x1: x(U)(x(S).left),
|
|
862
|
+
y1: x(U)(x(S).top + x(w)),
|
|
863
|
+
x2: x(U)(x(S).left + x(C)),
|
|
864
|
+
y2: x(U)(x(S).top + x(w)),
|
|
864
865
|
stroke: "currentColor",
|
|
865
866
|
"stroke-opacity": "0.3"
|
|
866
867
|
}, null, 8, we),
|
|
867
|
-
t.yGrid ? (g(!0), a(e, { key: 2 }, v(
|
|
868
|
+
t.yGrid ? (g(!0), a(e, { key: 2 }, v(G.value, (e, t) => (g(), a("line", {
|
|
868
869
|
key: "yg" + t,
|
|
869
870
|
x1: x(S).left,
|
|
870
871
|
y1: e.y,
|
|
@@ -873,7 +874,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
873
874
|
stroke: "currentColor",
|
|
874
875
|
"stroke-opacity": "0.1"
|
|
875
876
|
}, null, 8, Te))), 128)) : i("", !0),
|
|
876
|
-
t.xGrid ? (g(!0), a(e, { key: 3 }, v(
|
|
877
|
+
t.xGrid ? (g(!0), a(e, { key: 3 }, v(ce.value, (e, t) => (g(), a("line", {
|
|
877
878
|
key: "xg" + t,
|
|
878
879
|
x1: e.x,
|
|
879
880
|
y1: x(S).top,
|
|
@@ -882,7 +883,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
882
883
|
stroke: "currentColor",
|
|
883
884
|
"stroke-opacity": "0.1"
|
|
884
885
|
}, null, 8, Ee))), 128)) : i("", !0),
|
|
885
|
-
(g(!0), a(e, null, v(
|
|
886
|
+
(g(!0), a(e, null, v(G.value, (e, t) => (g(), a("text", {
|
|
886
887
|
key: "y" + t,
|
|
887
888
|
"data-testid": "y-tick",
|
|
888
889
|
x: x(S).left - 6,
|
|
@@ -902,7 +903,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
902
903
|
"font-size": "13",
|
|
903
904
|
fill: "currentColor"
|
|
904
905
|
}, y(t.yLabel), 9, Oe)) : i("", !0),
|
|
905
|
-
(g(!0), a(e, null, v(
|
|
906
|
+
(g(!0), a(e, null, v(ce.value, (e, t) => (g(), a("text", {
|
|
906
907
|
key: "x" + t,
|
|
907
908
|
"data-testid": "x-tick",
|
|
908
909
|
x: e.x,
|
|
@@ -946,48 +947,48 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
946
947
|
}, null, 8, Ne))), 128)) : i("", !0)], 64))), 128)),
|
|
947
948
|
(g(!0), a(e, null, v(t.areaSections ?? [], (t, n) => (g(), a(e, { key: "areasec" + n }, [
|
|
948
949
|
o("path", {
|
|
949
|
-
d:
|
|
950
|
+
d: z(t),
|
|
950
951
|
fill: t.color ?? (t.seriesIndex == null ? "#999" : O.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
951
952
|
"fill-opacity": t.opacity ?? .15,
|
|
952
953
|
stroke: "none"
|
|
953
954
|
}, null, 8, Pe),
|
|
954
955
|
t.seriesIndex == null ? i("", !0) : (g(), a("path", {
|
|
955
956
|
key: 0,
|
|
956
|
-
d:
|
|
957
|
+
d: z(t, !1),
|
|
957
958
|
fill: "none",
|
|
958
959
|
stroke: t.color ?? O.value[t.seriesIndex]?.color ?? "currentColor",
|
|
959
960
|
"stroke-width": t.strokeWidth ?? 2,
|
|
960
961
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
961
962
|
}, null, 8, Fe)),
|
|
962
963
|
t.seriesIndex == null ? (g(), a(e, { key: 1 }, [o("line", {
|
|
963
|
-
x1: x(
|
|
964
|
+
x1: x(U)(R(t, "start")),
|
|
964
965
|
y1: x(S).top,
|
|
965
|
-
x2: x(
|
|
966
|
+
x2: x(U)(R(t, "start")),
|
|
966
967
|
y2: x(S).top + x(w),
|
|
967
968
|
stroke: t.color ?? "#999",
|
|
968
969
|
"stroke-width": t.strokeWidth ?? 2,
|
|
969
970
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
970
971
|
}, null, 8, Ie), o("line", {
|
|
971
|
-
x1: x(
|
|
972
|
+
x1: x(U)(R(t, "end")),
|
|
972
973
|
y1: x(S).top,
|
|
973
|
-
x2: x(
|
|
974
|
+
x2: x(U)(R(t, "end")),
|
|
974
975
|
y2: x(S).top + x(w),
|
|
975
976
|
stroke: t.color ?? "#999",
|
|
976
977
|
"stroke-width": t.strokeWidth ?? 2,
|
|
977
978
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
978
979
|
}, null, 8, Le)], 64)) : i("", !0),
|
|
979
980
|
o("line", {
|
|
980
|
-
x1: x(
|
|
981
|
+
x1: x(U)(R(t, "start")),
|
|
981
982
|
y1: x(S).top + x(w) - 4,
|
|
982
|
-
x2: x(
|
|
983
|
+
x2: x(U)(R(t, "start")),
|
|
983
984
|
y2: x(S).top + x(w) + 4,
|
|
984
985
|
stroke: "currentColor",
|
|
985
986
|
"stroke-opacity": "0.4"
|
|
986
987
|
}, null, 8, Re),
|
|
987
988
|
o("line", {
|
|
988
|
-
x1: x(
|
|
989
|
+
x1: x(U)(R(t, "end")),
|
|
989
990
|
y1: x(S).top + x(w) - 4,
|
|
990
|
-
x2: x(
|
|
991
|
+
x2: x(U)(R(t, "end")),
|
|
991
992
|
y2: x(S).top + x(w) + 4,
|
|
992
993
|
stroke: "currentColor",
|
|
993
994
|
"stroke-opacity": "0.4"
|
|
@@ -995,9 +996,9 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
995
996
|
], 64))), 128)),
|
|
996
997
|
J.value && x(Q) !== null ? (g(), a("line", {
|
|
997
998
|
key: 6,
|
|
998
|
-
x1: x(
|
|
999
|
+
x1: x(U)(pe.value),
|
|
999
1000
|
y1: x(S).top,
|
|
1000
|
-
x2: x(
|
|
1001
|
+
x2: x(U)(pe.value),
|
|
1001
1002
|
y2: x(S).top + x(w),
|
|
1002
1003
|
stroke: "currentColor",
|
|
1003
1004
|
"stroke-opacity": "0.3",
|
|
@@ -1026,10 +1027,10 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1026
1027
|
"touch-action": "none"
|
|
1027
1028
|
}
|
|
1028
1029
|
}, ne(x(tt), !0)), null, 16, He)) : i("", !0),
|
|
1029
|
-
(g(!0), a(e, null, v(
|
|
1030
|
+
(g(!0), a(e, null, v(B.value.labels, (e, t) => (g(), a("g", { key: "seclab" + t }, [
|
|
1030
1031
|
o("circle", {
|
|
1031
1032
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
1032
|
-
cy:
|
|
1033
|
+
cy: W.value + e.row * Ye + 4,
|
|
1033
1034
|
r: "4",
|
|
1034
1035
|
fill: e.color,
|
|
1035
1036
|
"fill-opacity": e.fillOpacity,
|
|
@@ -1039,7 +1040,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1039
1040
|
e.labelText ? (g(), a("text", {
|
|
1040
1041
|
key: 0,
|
|
1041
1042
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1042
|
-
y:
|
|
1043
|
+
y: W.value + e.row * Ye + 8,
|
|
1043
1044
|
"font-size": "11",
|
|
1044
1045
|
"font-weight": "600",
|
|
1045
1046
|
fill: e.color
|
|
@@ -1047,7 +1048,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1047
1048
|
e.descText ? (g(), a("text", {
|
|
1048
1049
|
key: 1,
|
|
1049
1050
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1050
|
-
y:
|
|
1051
|
+
y: W.value + e.row * Ye + 22,
|
|
1051
1052
|
"font-size": "11",
|
|
1052
1053
|
fill: "currentColor",
|
|
1053
1054
|
"fill-opacity": "0.6"
|
|
@@ -1127,7 +1128,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1127
1128
|
], _t = { class: "bar-chart-tooltip" }, vt = {
|
|
1128
1129
|
key: 0,
|
|
1129
1130
|
class: "bar-chart-tooltip-label"
|
|
1130
|
-
}, yt = ["href", "download"], bt = /* @__PURE__ */
|
|
1131
|
+
}, yt = ["href", "download"], bt = /* @__PURE__ */ H(/* @__PURE__ */ l({
|
|
1131
1132
|
__name: "BarChart",
|
|
1132
1133
|
props: {
|
|
1133
1134
|
data: {},
|
|
@@ -1277,17 +1278,17 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1277
1278
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
1278
1279
|
if (!isFinite(l)) continue;
|
|
1279
1280
|
let u = l >= 0 ? o : s, d = u + l;
|
|
1280
|
-
e.push(oe(L(u), L(d), r, a, n.color ??
|
|
1281
|
+
e.push(oe(L(u), L(d), r, a, n.color ?? B(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
|
|
1281
1282
|
}
|
|
1282
1283
|
} else for (let a = 0; a < n; a++) {
|
|
1283
1284
|
let s = t[a], u = Number(s.data[i] ?? NaN);
|
|
1284
1285
|
if (!isFinite(u)) continue;
|
|
1285
1286
|
let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
|
|
1286
|
-
e.push(oe(c, L(u), d, o, s.color ??
|
|
1287
|
+
e.push(oe(c, L(u), d, o, s.color ?? B(a), s.opacity ?? 1, u, i, a));
|
|
1287
1288
|
}
|
|
1288
1289
|
}
|
|
1289
1290
|
return e;
|
|
1290
|
-
}),
|
|
1291
|
+
}), z = [
|
|
1291
1292
|
"var(--color-primary, #3b82f6)",
|
|
1292
1293
|
"var(--color-accent, #f59e0b)",
|
|
1293
1294
|
"var(--color-success, #10b981)",
|
|
@@ -1295,29 +1296,29 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1295
1296
|
"var(--color-info, #6366f1)",
|
|
1296
1297
|
"var(--color-warning, #d97706)"
|
|
1297
1298
|
];
|
|
1298
|
-
function z(e) {
|
|
1299
|
-
return se[e % se.length];
|
|
1300
|
-
}
|
|
1301
1299
|
function B(e) {
|
|
1302
|
-
return
|
|
1300
|
+
return z[e % z.length];
|
|
1303
1301
|
}
|
|
1304
|
-
|
|
1305
|
-
|
|
1302
|
+
function V(e) {
|
|
1303
|
+
return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.valueTickFormat ? l.valueTickFormat(e) : K(e);
|
|
1304
|
+
}
|
|
1305
|
+
let H = n(() => {
|
|
1306
|
+
let { min: e, max: t } = j.value, n = (e) => l.valueTickFormat ? l.valueTickFormat(e) : K(e);
|
|
1306
1307
|
if (e === t) return [{
|
|
1307
1308
|
value: n(e),
|
|
1308
|
-
pos:
|
|
1309
|
+
pos: U(L(e))
|
|
1309
1310
|
}];
|
|
1310
1311
|
let r = A.value ? 50 : 80;
|
|
1311
|
-
return
|
|
1312
|
+
return le({
|
|
1312
1313
|
min: e,
|
|
1313
1314
|
max: t,
|
|
1314
1315
|
ticks: l.valueTicks,
|
|
1315
1316
|
targetTickCount: N.value / r
|
|
1316
1317
|
}).map((e) => ({
|
|
1317
1318
|
value: n(e),
|
|
1318
|
-
pos:
|
|
1319
|
+
pos: U(L(e))
|
|
1319
1320
|
}));
|
|
1320
|
-
}),
|
|
1321
|
+
}), W = n(() => {
|
|
1321
1322
|
let e = [], t = O.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
|
|
1322
1323
|
for (let r = 0; r < t; r++) {
|
|
1323
1324
|
let t = I(r) + P.value / 2;
|
|
@@ -1328,16 +1329,16 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1328
1329
|
});
|
|
1329
1330
|
}
|
|
1330
1331
|
return e;
|
|
1331
|
-
}),
|
|
1332
|
+
}), G = n(() => {
|
|
1332
1333
|
let e = [];
|
|
1333
1334
|
return D.value.forEach((t, n) => {
|
|
1334
1335
|
t.legend && e.push({
|
|
1335
1336
|
label: t.legend,
|
|
1336
|
-
color: t.color ??
|
|
1337
|
+
color: t.color ?? B(n)
|
|
1337
1338
|
});
|
|
1338
1339
|
}), e;
|
|
1339
1340
|
});
|
|
1340
|
-
function
|
|
1341
|
+
function ce() {
|
|
1341
1342
|
if (typeof l.csv == "function") return l.csv();
|
|
1342
1343
|
if (typeof l.csv == "string") return l.csv;
|
|
1343
1344
|
let e = D.value.map((e) => ({
|
|
@@ -1365,24 +1366,24 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1365
1366
|
}), { svgRef: Z, items: ge, downloadLinkText: Q, csvHref: ve, resolvedFilename: ye } = he({
|
|
1366
1367
|
filename: () => l.filename,
|
|
1367
1368
|
legacyMenuLabel: () => l.menu,
|
|
1368
|
-
getCsv:
|
|
1369
|
+
getCsv: ce,
|
|
1369
1370
|
downloadLink: () => l.downloadLink
|
|
1370
1371
|
}), be = n(() => {
|
|
1371
1372
|
let e = Y.value;
|
|
1372
1373
|
if (e !== null) return k.value[e];
|
|
1373
|
-
}),
|
|
1374
|
+
}), xe = n(() => {
|
|
1374
1375
|
let e = Y.value;
|
|
1375
1376
|
return e === null ? null : {
|
|
1376
1377
|
index: e,
|
|
1377
1378
|
category: k.value[e] ?? String(e),
|
|
1378
1379
|
values: D.value.map((t, n) => ({
|
|
1379
1380
|
value: Number(t.data[e] ?? NaN),
|
|
1380
|
-
color: t.color ??
|
|
1381
|
+
color: t.color ?? B(n),
|
|
1381
1382
|
seriesIndex: n
|
|
1382
1383
|
})),
|
|
1383
1384
|
data: l.tooltipData?.[e] ?? null
|
|
1384
1385
|
};
|
|
1385
|
-
}),
|
|
1386
|
+
}), $ = n(() => {
|
|
1386
1387
|
let e = Y.value;
|
|
1387
1388
|
if (e === null) return null;
|
|
1388
1389
|
let t = I(e);
|
|
@@ -1403,7 +1404,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1403
1404
|
ref: h,
|
|
1404
1405
|
class: "bar-chart-wrapper"
|
|
1405
1406
|
}, [
|
|
1406
|
-
t.menu ? (g(), r(
|
|
1407
|
+
t.menu ? (g(), r(se, {
|
|
1407
1408
|
key: 0,
|
|
1408
1409
|
items: x(ge)
|
|
1409
1410
|
}, null, 8, ["items"])) : i("", !0),
|
|
@@ -1422,7 +1423,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1422
1423
|
"font-weight": "600",
|
|
1423
1424
|
fill: "currentColor"
|
|
1424
1425
|
}, y(t.title), 9, tt)) : i("", !0),
|
|
1425
|
-
|
|
1426
|
+
G.value.length > 0 ? (g(), a("g", nt, [(g(!0), a(e, null, v(G.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [o("rect", {
|
|
1426
1427
|
x: x(S).left + n * 120,
|
|
1427
1428
|
y: x(S).top - x(20) / 2 - 5,
|
|
1428
1429
|
width: "12",
|
|
@@ -1435,22 +1436,22 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1435
1436
|
fill: "currentColor"
|
|
1436
1437
|
}, y(t.label), 9, it)], 64))), 128))])) : i("", !0),
|
|
1437
1438
|
o("line", {
|
|
1438
|
-
x1: x(
|
|
1439
|
-
y1: x(
|
|
1440
|
-
x2: x(
|
|
1441
|
-
y2: x(
|
|
1439
|
+
x1: x(U)(x(S).left),
|
|
1440
|
+
y1: x(U)(x(S).top),
|
|
1441
|
+
x2: x(U)(x(S).left),
|
|
1442
|
+
y2: x(U)(x(S).top + x(w)),
|
|
1442
1443
|
stroke: "currentColor",
|
|
1443
1444
|
"stroke-opacity": "0.3"
|
|
1444
1445
|
}, null, 8, at),
|
|
1445
1446
|
o("line", {
|
|
1446
|
-
x1: x(
|
|
1447
|
-
y1: x(
|
|
1448
|
-
x2: x(
|
|
1449
|
-
y2: x(
|
|
1447
|
+
x1: x(U)(x(S).left),
|
|
1448
|
+
y1: x(U)(x(S).top + x(w)),
|
|
1449
|
+
x2: x(U)(x(S).left + x(C)),
|
|
1450
|
+
y2: x(U)(x(S).top + x(w)),
|
|
1450
1451
|
stroke: "currentColor",
|
|
1451
1452
|
"stroke-opacity": "0.3"
|
|
1452
1453
|
}, null, 8, ot),
|
|
1453
|
-
t.valueGrid ? (g(!0), a(e, { key: 2 }, v(
|
|
1454
|
+
t.valueGrid ? (g(!0), a(e, { key: 2 }, v(H.value, (e, t) => (g(), a("line", {
|
|
1454
1455
|
key: "vg" + t,
|
|
1455
1456
|
x1: A.value ? x(S).left : e.pos,
|
|
1456
1457
|
y1: A.value ? e.pos : x(S).top,
|
|
@@ -1459,17 +1460,17 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1459
1460
|
stroke: "currentColor",
|
|
1460
1461
|
"stroke-opacity": "0.1"
|
|
1461
1462
|
}, null, 8, st))), 128)) : i("", !0),
|
|
1462
|
-
|
|
1463
|
+
$.value && q.value ? (g(), a("rect", {
|
|
1463
1464
|
key: 3,
|
|
1464
|
-
x:
|
|
1465
|
-
y:
|
|
1466
|
-
width:
|
|
1467
|
-
height:
|
|
1465
|
+
x: $.value.x,
|
|
1466
|
+
y: $.value.y,
|
|
1467
|
+
width: $.value.w,
|
|
1468
|
+
height: $.value.h,
|
|
1468
1469
|
fill: "currentColor",
|
|
1469
1470
|
"fill-opacity": "0.06",
|
|
1470
1471
|
"pointer-events": "none"
|
|
1471
1472
|
}, null, 8, ct)) : i("", !0),
|
|
1472
|
-
A.value ? (g(!0), a(e, { key: 4 }, v(
|
|
1473
|
+
A.value ? (g(!0), a(e, { key: 4 }, v(H.value, (e, t) => (g(), a("text", {
|
|
1473
1474
|
key: "vt" + t,
|
|
1474
1475
|
"data-testid": "value-tick",
|
|
1475
1476
|
x: x(S).left - 6,
|
|
@@ -1479,7 +1480,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1479
1480
|
"font-size": "10",
|
|
1480
1481
|
fill: "currentColor",
|
|
1481
1482
|
"fill-opacity": "0.6"
|
|
1482
|
-
}, y(e.value), 9, lt))), 128)) : (g(!0), a(e, { key: 5 }, v(
|
|
1483
|
+
}, y(e.value), 9, lt))), 128)) : (g(!0), a(e, { key: 5 }, v(H.value, (e, t) => (g(), a("text", {
|
|
1483
1484
|
key: "vt" + t,
|
|
1484
1485
|
"data-testid": "value-tick",
|
|
1485
1486
|
x: e.pos,
|
|
@@ -1498,7 +1499,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1498
1499
|
"font-size": "13",
|
|
1499
1500
|
fill: "currentColor"
|
|
1500
1501
|
}, y(t.yLabel), 9, dt)) : i("", !0),
|
|
1501
|
-
A.value ? (g(!0), a(e, { key: 7 }, v(
|
|
1502
|
+
A.value ? (g(!0), a(e, { key: 7 }, v(W.value, (e, t) => (g(), a("text", {
|
|
1502
1503
|
key: "ct" + t,
|
|
1503
1504
|
"data-testid": "category-tick",
|
|
1504
1505
|
x: e.pos,
|
|
@@ -1507,7 +1508,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1507
1508
|
"font-size": "10",
|
|
1508
1509
|
fill: "currentColor",
|
|
1509
1510
|
"fill-opacity": "0.6"
|
|
1510
|
-
}, y(e.label), 9, ft))), 128)) : (g(!0), a(e, { key: 8 }, v(
|
|
1511
|
+
}, y(e.label), 9, ft))), 128)) : (g(!0), a(e, { key: 8 }, v(W.value, (e, t) => (g(), a("text", {
|
|
1511
1512
|
key: "ct" + t,
|
|
1512
1513
|
"data-testid": "category-tick",
|
|
1513
1514
|
x: x(S).left - 6,
|
|
@@ -1551,7 +1552,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1551
1552
|
}
|
|
1552
1553
|
}, ne(x(me), !0)), null, 16, gt)) : i("", !0)
|
|
1553
1554
|
], 8, et)),
|
|
1554
|
-
q.value && x(Y) !== null &&
|
|
1555
|
+
q.value && x(Y) !== null && xe.value ? (g(), a("div", {
|
|
1555
1556
|
key: 1,
|
|
1556
1557
|
ref_key: "tooltipRef",
|
|
1557
1558
|
ref: pe,
|
|
@@ -1564,13 +1565,13 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
1564
1565
|
transform: x(X) ? `translate3d(${x(X).left}px, ${x(X).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
1565
1566
|
visibility: x(X) ? "visible" : "hidden"
|
|
1566
1567
|
})
|
|
1567
|
-
}, [te(n.$slots, "tooltip", p(u(
|
|
1568
|
+
}, [te(n.$slots, "tooltip", p(u(xe.value)), () => [o("div", _t, [be.value ? (g(), a("div", vt, y(be.value), 1)) : i("", !0), (g(!0), a(e, null, v(xe.value.values, (e) => (g(), a("div", {
|
|
1568
1569
|
key: e.seriesIndex,
|
|
1569
1570
|
class: "bar-chart-tooltip-row"
|
|
1570
1571
|
}, [o("span", {
|
|
1571
1572
|
class: "bar-chart-tooltip-swatch",
|
|
1572
1573
|
style: m({ background: e.color })
|
|
1573
|
-
}, null, 4), s(" " + y(isFinite(e.value) ?
|
|
1574
|
+
}, null, 4), s(" " + y(isFinite(e.value) ? V(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1574
1575
|
x(Q) ? (g(), a("a", {
|
|
1575
1576
|
key: 2,
|
|
1576
1577
|
class: "bar-chart-download-link",
|
|
@@ -5730,7 +5731,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
5730
5731
|
}, kt = {
|
|
5731
5732
|
key: 2,
|
|
5732
5733
|
class: "choropleth-legend-continuous"
|
|
5733
|
-
}, At = { class: "choropleth-legend-ticks" }, jt = ["viewBox"], Mt = ["innerHTML"], Nt = "http://www.w3.org/2000/svg", Pt =
|
|
5734
|
+
}, At = { class: "choropleth-legend-ticks" }, jt = ["viewBox"], Mt = ["innerHTML"], Nt = "http://www.w3.org/2000/svg", Pt = 450, Ft = 1e3, It = /* @__PURE__ */ H(/* @__PURE__ */ l({
|
|
5734
5735
|
__name: "ChoroplethMap",
|
|
5735
5736
|
props: {
|
|
5736
5737
|
topology: {},
|
|
@@ -5763,57 +5764,120 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
5763
5764
|
tooltipTrigger: {},
|
|
5764
5765
|
tooltipFormat: {},
|
|
5765
5766
|
tooltipValueFormat: {},
|
|
5766
|
-
tooltipClamp: { default: "chart" }
|
|
5767
|
+
tooltipClamp: { default: "chart" },
|
|
5768
|
+
focus: {},
|
|
5769
|
+
focusZoomLevel: { default: 4 }
|
|
5767
5770
|
},
|
|
5768
|
-
emits: [
|
|
5771
|
+
emits: [
|
|
5772
|
+
"stateClick",
|
|
5773
|
+
"stateHover",
|
|
5774
|
+
"update:focus"
|
|
5775
|
+
],
|
|
5769
5776
|
setup(t, { emit: c }) {
|
|
5770
|
-
let l = t, d = c, ne = (e) => e, x = _(null), S = _(null), T = _(null), E = _(null), D = re(), O = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!D.tooltip), k = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), j = null, M = null, N = !1,
|
|
5777
|
+
let l = t, d = c, ne = (e) => e, x = _(null), S = _(null), T = _(null), E = _(null), D = re(), O = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!D.tooltip), k = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), j = null, M = null, N = /* @__PURE__ */ new Set(), z = !1, B = typeof window < "u" && "ontouchstart" in window, V = null, H = {
|
|
5771
5778
|
width: 0,
|
|
5772
5779
|
height: 0
|
|
5773
|
-
},
|
|
5774
|
-
function ue() {
|
|
5775
|
-
if (se) return;
|
|
5776
|
-
let e = T.value;
|
|
5777
|
-
e && (e.addEventListener("click", We), e.addEventListener("mouseover", We), e.addEventListener("mousemove", Ge), e.addEventListener("mouseout", Ke));
|
|
5778
|
-
}
|
|
5780
|
+
}, U = null, W = !1, G = null, ce = _(!1), K = 0, le = 0, ue = 0;
|
|
5779
5781
|
function de() {
|
|
5782
|
+
if (B) return;
|
|
5780
5783
|
let e = T.value;
|
|
5781
|
-
e && (e.
|
|
5784
|
+
e && (e.addEventListener("click", $e), e.addEventListener("mouseover", $e), e.addEventListener("mousemove", et), e.addEventListener("mouseout", tt));
|
|
5782
5785
|
}
|
|
5783
5786
|
function q() {
|
|
5784
|
-
|
|
5787
|
+
let e = T.value;
|
|
5788
|
+
e && (e.removeEventListener("click", $e), e.removeEventListener("mouseover", $e), e.removeEventListener("mousemove", et), e.removeEventListener("mouseout", tt));
|
|
5789
|
+
}
|
|
5790
|
+
function J() {
|
|
5791
|
+
Ze();
|
|
5785
5792
|
}
|
|
5786
5793
|
h(() => {
|
|
5787
|
-
|
|
5794
|
+
fe(), de(), rt(), _e(), Ue(), window.addEventListener("scroll", J, {
|
|
5788
5795
|
passive: !0,
|
|
5789
5796
|
capture: !0
|
|
5790
|
-
}), window.addEventListener("resize",
|
|
5797
|
+
}), window.addEventListener("resize", J, { passive: !0 });
|
|
5791
5798
|
}), ee(() => {
|
|
5792
|
-
|
|
5799
|
+
V?.disconnect(), ue && cancelAnimationFrame(ue), pe(), q(), window.removeEventListener("scroll", J, { capture: !0 }), window.removeEventListener("resize", J);
|
|
5793
5800
|
});
|
|
5794
|
-
function
|
|
5795
|
-
if (!S.value || !T.value
|
|
5796
|
-
let e = ae(S.value);
|
|
5797
|
-
|
|
5798
|
-
|
|
5801
|
+
function fe() {
|
|
5802
|
+
if (!S.value || !T.value) return;
|
|
5803
|
+
let e = ae(S.value), t = Math.max(12, l.focusZoomLevel);
|
|
5804
|
+
G = F().scaleExtent([1, t]).on("start", () => {
|
|
5805
|
+
z = !0, Ze();
|
|
5799
5806
|
}).on("zoom", (e) => {
|
|
5800
5807
|
T.value && T.value.setAttribute("transform", e.transform);
|
|
5801
5808
|
let t = e.transform;
|
|
5802
|
-
|
|
5809
|
+
ce.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
5803
5810
|
}).on("end", () => {
|
|
5804
|
-
|
|
5805
|
-
}),
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5811
|
+
z = !1;
|
|
5812
|
+
}), G.filter((e) => {
|
|
5813
|
+
let t = Oe.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
|
|
5814
|
+
if (e.type === "wheel" || e.type === "dblclick") {
|
|
5815
|
+
if (!n) return !1;
|
|
5816
|
+
} else if (e.type === "mousedown" || e.type === "touchstart") {
|
|
5817
|
+
if (!r) return !1;
|
|
5818
|
+
} else if (!n && !r) return !1;
|
|
5819
|
+
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
5820
|
+
}), e.call(G);
|
|
5809
5821
|
}
|
|
5810
5822
|
function pe() {
|
|
5811
|
-
|
|
5823
|
+
S.value && G && (ae(S.value).on(".zoom", null), G = null);
|
|
5812
5824
|
}
|
|
5813
|
-
|
|
5814
|
-
|
|
5825
|
+
function Z(e) {
|
|
5826
|
+
let t = De.value, n = Ee.value, r = /* @__PURE__ */ new Set();
|
|
5827
|
+
for (let i of e) {
|
|
5828
|
+
let e = t.has(i) ? i : n.get(i);
|
|
5829
|
+
e != null && r.add(e);
|
|
5830
|
+
}
|
|
5831
|
+
return r;
|
|
5832
|
+
}
|
|
5833
|
+
function he(e) {
|
|
5834
|
+
let t = De.value, n = [];
|
|
5835
|
+
for (let r of Z(e)) {
|
|
5836
|
+
let e = t.get(r);
|
|
5837
|
+
e && n.push(e);
|
|
5838
|
+
}
|
|
5839
|
+
return n;
|
|
5840
|
+
}
|
|
5841
|
+
let ge = !1;
|
|
5842
|
+
function _e() {
|
|
5843
|
+
if (!S.value || !G) return;
|
|
5844
|
+
let e = Oe.value, t = e.length > 0 ? he(e) : [], n = /* @__PURE__ */ new Set();
|
|
5845
|
+
for (let e of t) {
|
|
5846
|
+
let t = k.get(String(e.id));
|
|
5847
|
+
t && n.add(t);
|
|
5848
|
+
}
|
|
5849
|
+
for (let e of N) n.has(e) || e === M || Ye(e);
|
|
5850
|
+
for (let e of n) !N.has(e) && e !== M && Je(e);
|
|
5851
|
+
N.clear();
|
|
5852
|
+
for (let e of n) N.add(e);
|
|
5853
|
+
let r = ae(S.value);
|
|
5854
|
+
r.interrupt();
|
|
5855
|
+
let i = ge && t.length > 0;
|
|
5856
|
+
if (ge = !0, t.length === 0) {
|
|
5857
|
+
G.transform(r, I), Ze();
|
|
5858
|
+
return;
|
|
5859
|
+
}
|
|
5860
|
+
let [[a, o], [s, c]] = we.value.bounds({
|
|
5861
|
+
type: "FeatureCollection",
|
|
5862
|
+
features: t
|
|
5863
|
+
}), u = (a + s) / 2, d = (o + c) / 2, f = l.focusZoomLevel, p = I.translate(ye.value / 2 - f * u, be.value / 2 - f * d).scale(f), m = () => {
|
|
5864
|
+
if (!O.value) return;
|
|
5865
|
+
let e = String(t[0].id), n = k.get(e);
|
|
5866
|
+
if (!n) return;
|
|
5867
|
+
let r = n.getBoundingClientRect();
|
|
5868
|
+
Ge(e, r.left + r.width / 2, r.top + r.height / 2);
|
|
5869
|
+
};
|
|
5870
|
+
i ? (qe(), r.transition().duration(Pt).call(G.transform, p).on("end", m)) : (G.transform(r, p), m());
|
|
5871
|
+
}
|
|
5872
|
+
function Q() {
|
|
5873
|
+
if (!S.value || !G) return;
|
|
5874
|
+
let e = ae(S.value);
|
|
5875
|
+
e.interrupt(), G.transform(e, I), Oe.value.length > 0 && d("update:focus", null);
|
|
5876
|
+
}
|
|
5877
|
+
C(() => l.focusZoomLevel, () => {
|
|
5878
|
+
G && G.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), _e();
|
|
5815
5879
|
});
|
|
5816
|
-
let
|
|
5880
|
+
let ve = n(() => l.width && l.height ? l.height / l.width : .625), ye = n(() => Ft), be = n(() => Ft * ve.value), xe = n(() => {
|
|
5817
5881
|
let e = b(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
|
|
5818
5882
|
for (let e of t) {
|
|
5819
5883
|
let t = xt[String(e.id).padStart(5, "0")];
|
|
@@ -5830,33 +5894,40 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
5830
5894
|
type: "FeatureCollection",
|
|
5831
5895
|
features: r
|
|
5832
5896
|
};
|
|
5833
|
-
}),
|
|
5834
|
-
if (l.geoType === "hsas") return
|
|
5897
|
+
}), $ = n(() => {
|
|
5898
|
+
if (l.geoType === "hsas") return xe.value;
|
|
5835
5899
|
if (l.geoType === "counties") {
|
|
5836
5900
|
let e = b(l.topology);
|
|
5837
5901
|
return L(e, e.objects.counties);
|
|
5838
5902
|
}
|
|
5839
5903
|
let e = b(l.topology);
|
|
5840
5904
|
return L(e, e.objects.states);
|
|
5841
|
-
}),
|
|
5905
|
+
}), Se = n(() => {
|
|
5842
5906
|
if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
|
|
5843
5907
|
let e = b(l.topology);
|
|
5844
5908
|
return R(e, e.objects.states, (e, t) => e !== t);
|
|
5845
|
-
}),
|
|
5909
|
+
}), Ce = n(() => P().fitExtent([[0, 0], [ye.value, be.value]], $.value)), we = n(() => ie(Ce.value)), Te = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), Ee = n(() => {
|
|
5846
5910
|
let e = /* @__PURE__ */ new Map();
|
|
5847
|
-
for (let t of
|
|
5911
|
+
for (let t of $.value.features) t.properties?.name != null && t.id != null && e.set(t.properties.name, String(t.id));
|
|
5848
5912
|
return e;
|
|
5849
|
-
}),
|
|
5913
|
+
}), De = n(() => {
|
|
5914
|
+
let e = /* @__PURE__ */ new Map();
|
|
5915
|
+
for (let t of $.value.features) t.id != null && e.set(String(t.id), t);
|
|
5916
|
+
return e;
|
|
5917
|
+
}), Oe = n(() => {
|
|
5918
|
+
let e = l.focus;
|
|
5919
|
+
return e == null ? [] : Array.isArray(e) ? e : [e];
|
|
5920
|
+
}), ke = n(() => {
|
|
5850
5921
|
let e = /* @__PURE__ */ new Map();
|
|
5851
5922
|
if (!l.data) return e;
|
|
5852
|
-
let t =
|
|
5923
|
+
let t = Ee.value;
|
|
5853
5924
|
for (let n of l.data) {
|
|
5854
5925
|
e.set(n.id, n.value);
|
|
5855
5926
|
let r = t.get(n.id);
|
|
5856
5927
|
r && e.set(r, n.value);
|
|
5857
5928
|
}
|
|
5858
5929
|
return e;
|
|
5859
|
-
}),
|
|
5930
|
+
}), Ae = n(() => {
|
|
5860
5931
|
if (!l.data || l.data.length === 0) return {
|
|
5861
5932
|
min: 0,
|
|
5862
5933
|
max: 1
|
|
@@ -5873,8 +5944,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
5873
5944
|
min: 0,
|
|
5874
5945
|
max: 1
|
|
5875
5946
|
};
|
|
5876
|
-
}),
|
|
5877
|
-
function
|
|
5947
|
+
}), je = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Me = n(() => Array.isArray(l.colorScale) && !je.value), Ne = n(() => Me.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Pe = n(() => Me.value ? "" : l.colorScale?.max ?? "#08519c");
|
|
5948
|
+
function Fe(e) {
|
|
5878
5949
|
let t = e.replace("#", "");
|
|
5879
5950
|
return [
|
|
5880
5951
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -5882,92 +5953,98 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
5882
5953
|
parseInt(t.slice(4, 6), 16)
|
|
5883
5954
|
];
|
|
5884
5955
|
}
|
|
5885
|
-
function
|
|
5886
|
-
let [t, n, r] =
|
|
5956
|
+
function Ie(e) {
|
|
5957
|
+
let [t, n, r] = Fe(Ne.value), [i, a, o] = Fe(Pe.value);
|
|
5887
5958
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
5888
5959
|
}
|
|
5889
|
-
let
|
|
5890
|
-
if (!
|
|
5960
|
+
let Le = n(() => Me.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), Re = n(() => {
|
|
5961
|
+
if (!je.value) return null;
|
|
5891
5962
|
let e = /* @__PURE__ */ new Map();
|
|
5892
5963
|
for (let t of l.colorScale) e.set(t.value, t.color);
|
|
5893
5964
|
return e;
|
|
5894
5965
|
});
|
|
5895
|
-
function
|
|
5896
|
-
let t =
|
|
5966
|
+
function ze(e) {
|
|
5967
|
+
let t = ke.value.get(e), n = l.noDataColor;
|
|
5897
5968
|
if (t == null) return n;
|
|
5898
|
-
let r =
|
|
5969
|
+
let r = Re.value;
|
|
5899
5970
|
if (r) return r.get(String(t)) ?? n;
|
|
5900
|
-
let i =
|
|
5971
|
+
let i = Le.value;
|
|
5901
5972
|
if (i) {
|
|
5902
5973
|
let e = t;
|
|
5903
5974
|
for (let t of i) if (e >= t.min) return t.color;
|
|
5904
5975
|
return n;
|
|
5905
5976
|
}
|
|
5906
|
-
let { min: a, max: o } =
|
|
5907
|
-
return
|
|
5977
|
+
let { min: a, max: o } = Ae.value;
|
|
5978
|
+
return Ie((t - a) / (o - a));
|
|
5908
5979
|
}
|
|
5909
|
-
let
|
|
5910
|
-
function
|
|
5980
|
+
let Be = (e) => e.properties?.name ?? String(e.id);
|
|
5981
|
+
function Ve(e) {
|
|
5911
5982
|
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat ? l.tooltipValueFormat(e) : String(e);
|
|
5912
5983
|
}
|
|
5913
|
-
function
|
|
5914
|
-
return t == null ? e : `${e}: ${
|
|
5984
|
+
function He(e, t) {
|
|
5985
|
+
return t == null ? e : `${e}: ${Ve(t)}`;
|
|
5915
5986
|
}
|
|
5916
|
-
function
|
|
5987
|
+
function Ue() {
|
|
5917
5988
|
let e = E.value?.getEl();
|
|
5918
5989
|
if (!e) return;
|
|
5919
|
-
|
|
5990
|
+
V?.disconnect();
|
|
5920
5991
|
let t = !1;
|
|
5921
|
-
|
|
5992
|
+
V = new ResizeObserver((e) => {
|
|
5922
5993
|
let n = e[0]?.contentRect;
|
|
5923
|
-
n && (
|
|
5924
|
-
}),
|
|
5994
|
+
n && (H.width = n.width, H.height = n.height, !t && W && U ? (t = !0, We(U.x, U.y)) : t = !0);
|
|
5995
|
+
}), V.observe(e);
|
|
5925
5996
|
}
|
|
5926
|
-
function
|
|
5997
|
+
function We(e, t) {
|
|
5927
5998
|
let n = E.value?.getEl();
|
|
5928
5999
|
if (!n) return;
|
|
5929
|
-
let r = x.value?.getBoundingClientRect(), { left: i, top: a } = Y(e, t,
|
|
6000
|
+
let r = x.value?.getBoundingClientRect(), { left: i, top: a } = Y(e, t, H.width, H.height, l.tooltipClamp, r);
|
|
5930
6001
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
5931
6002
|
}
|
|
5932
|
-
function
|
|
6003
|
+
function Ge(e, t, n) {
|
|
5933
6004
|
let r = A.get(e);
|
|
5934
6005
|
if (!r) return;
|
|
5935
6006
|
let i = E.value, a = i?.getEl();
|
|
5936
|
-
!i || !a || (i.setData(r),
|
|
6007
|
+
!i || !a || (i.setData(r), U = {
|
|
5937
6008
|
x: t,
|
|
5938
6009
|
y: n
|
|
5939
|
-
},
|
|
6010
|
+
}, W = !0, We(t, n), a.style.visibility = "visible");
|
|
5940
6011
|
}
|
|
5941
|
-
function
|
|
5942
|
-
|
|
5943
|
-
|
|
6012
|
+
function Ke(e, t) {
|
|
6013
|
+
W && (K = e, le = t, !ue && (ue = requestAnimationFrame(() => {
|
|
6014
|
+
ue = 0;
|
|
5944
6015
|
let e = E.value?.getEl();
|
|
5945
|
-
!e || !
|
|
5946
|
-
x:
|
|
5947
|
-
y:
|
|
5948
|
-
}, e.style.transform = `translate3d(${
|
|
6016
|
+
!e || !W || (U = {
|
|
6017
|
+
x: K,
|
|
6018
|
+
y: le
|
|
6019
|
+
}, e.style.transform = `translate3d(${K + 16}px, ${le}px, 0) translateY(-50%)`);
|
|
5949
6020
|
})));
|
|
5950
6021
|
}
|
|
5951
|
-
function
|
|
5952
|
-
if (!
|
|
5953
|
-
|
|
6022
|
+
function qe() {
|
|
6023
|
+
if (!W) return;
|
|
6024
|
+
W = !1, U = null;
|
|
5954
6025
|
let e = E.value?.getEl();
|
|
5955
6026
|
e && (e.style.visibility = "hidden");
|
|
5956
6027
|
}
|
|
5957
|
-
function
|
|
5958
|
-
|
|
6028
|
+
function Je(e) {
|
|
6029
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Te.value + 1)), e.setAttribute("stroke", "#555");
|
|
6030
|
+
}
|
|
6031
|
+
function Ye(e) {
|
|
6032
|
+
e.setAttribute("stroke-width", String(Te.value)), e.setAttribute("stroke", l.strokeColor);
|
|
5959
6033
|
}
|
|
5960
|
-
function
|
|
5961
|
-
M && (M.
|
|
6034
|
+
function Xe(e) {
|
|
6035
|
+
M !== e && (M && !N.has(M) && Ye(M), M = e, Je(e));
|
|
5962
6036
|
}
|
|
5963
|
-
function
|
|
6037
|
+
function Ze() {
|
|
6038
|
+
M && (N.has(M) || Ye(M), M = null, d("stateHover", null)), qe();
|
|
6039
|
+
}
|
|
6040
|
+
function Qe(e) {
|
|
5964
6041
|
let t = e;
|
|
5965
6042
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
5966
6043
|
return t ? t.dataset.featId ?? null : null;
|
|
5967
6044
|
}
|
|
5968
|
-
function
|
|
5969
|
-
if (
|
|
5970
|
-
let t = e, n =
|
|
6045
|
+
function $e(e) {
|
|
6046
|
+
if (z) return;
|
|
6047
|
+
let t = e, n = Qe(t.target);
|
|
5971
6048
|
if (!n) return;
|
|
5972
6049
|
let r = A.get(n);
|
|
5973
6050
|
if (!r) return;
|
|
@@ -5976,30 +6053,30 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
5976
6053
|
name: r.name,
|
|
5977
6054
|
value: r.value
|
|
5978
6055
|
};
|
|
5979
|
-
e.type === "click" ? d("stateClick", i) : e.type === "mouseover" && (
|
|
6056
|
+
e.type === "click" ? (d("stateClick", i), d("update:focus", Z(Oe.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (Xe(k.get(n)), O.value && Ge(n, t.clientX, t.clientY), d("stateHover", i));
|
|
5980
6057
|
}
|
|
5981
|
-
function
|
|
5982
|
-
|
|
6058
|
+
function et(e) {
|
|
6059
|
+
z || Ke(e.clientX, e.clientY);
|
|
5983
6060
|
}
|
|
5984
|
-
function
|
|
6061
|
+
function tt(e) {
|
|
5985
6062
|
let t = e.relatedTarget;
|
|
5986
|
-
t && T.value?.contains(t) ||
|
|
6063
|
+
t && T.value?.contains(t) || Ze();
|
|
5987
6064
|
}
|
|
5988
|
-
function
|
|
6065
|
+
function nt(e) {
|
|
5989
6066
|
let t = document.createElementNS(Nt, "path");
|
|
5990
6067
|
return e && t.setAttribute("d", e), t;
|
|
5991
6068
|
}
|
|
5992
|
-
function
|
|
6069
|
+
function rt() {
|
|
5993
6070
|
let e = T.value;
|
|
5994
6071
|
if (!e) return;
|
|
5995
6072
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
5996
|
-
k.clear(), A.clear(), j = null, M = null;
|
|
5997
|
-
let t =
|
|
6073
|
+
k.clear(), A.clear(), j = null, M = null, N.clear();
|
|
6074
|
+
let t = we.value, n = $.value.features, r = l.strokeColor, i = String(Te.value), a = !O.value, o = document.createDocumentFragment();
|
|
5998
6075
|
for (let e of n) {
|
|
5999
|
-
let n = String(e.id), s =
|
|
6000
|
-
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", n), l.setAttribute("fill",
|
|
6076
|
+
let n = String(e.id), s = Be(e), c = ke.value.get(n), l = nt(t(e));
|
|
6077
|
+
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", n), l.setAttribute("fill", ze(n)), l.setAttribute("stroke", r), l.setAttribute("stroke-width", i), l.setAttribute("vector-effect", "non-scaling-stroke"), a) {
|
|
6001
6078
|
let e = document.createElementNS(Nt, "title");
|
|
6002
|
-
e.textContent =
|
|
6079
|
+
e.textContent = He(s, c), l.appendChild(e);
|
|
6003
6080
|
}
|
|
6004
6081
|
o.appendChild(l), k.set(n, l), A.set(n, {
|
|
6005
6082
|
id: n,
|
|
@@ -6008,69 +6085,68 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
6008
6085
|
feature: e
|
|
6009
6086
|
});
|
|
6010
6087
|
}
|
|
6011
|
-
let s =
|
|
6088
|
+
let s = Se.value;
|
|
6012
6089
|
if (s) {
|
|
6013
|
-
let e =
|
|
6090
|
+
let e = nt(t(s));
|
|
6014
6091
|
e.setAttribute("fill", "none"), e.setAttribute("stroke", r), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), o.appendChild(e), j = e;
|
|
6015
6092
|
}
|
|
6016
6093
|
e.appendChild(o);
|
|
6017
6094
|
}
|
|
6018
|
-
function
|
|
6095
|
+
function it() {
|
|
6019
6096
|
let e = !O.value;
|
|
6020
6097
|
for (let [t, n] of k) {
|
|
6021
|
-
let r =
|
|
6022
|
-
if (n.setAttribute("fill",
|
|
6098
|
+
let r = ke.value.get(t), i = A.get(t);
|
|
6099
|
+
if (n.setAttribute("fill", ze(t)), i && (i.value = r), e && i) {
|
|
6023
6100
|
let e = n.firstElementChild;
|
|
6024
|
-
e && (e.textContent =
|
|
6101
|
+
e && (e.textContent = He(i.name, r));
|
|
6025
6102
|
}
|
|
6026
6103
|
}
|
|
6027
6104
|
}
|
|
6028
|
-
function
|
|
6029
|
-
let e
|
|
6030
|
-
|
|
6031
|
-
j && j.setAttribute("stroke", e);
|
|
6105
|
+
function at() {
|
|
6106
|
+
for (let e of k.values()) e === M || N.has(e) || Ye(e);
|
|
6107
|
+
j && j.setAttribute("stroke", l.strokeColor);
|
|
6032
6108
|
}
|
|
6033
|
-
function
|
|
6109
|
+
function ot() {
|
|
6034
6110
|
return typeof l.menu == "string" ? l.menu : "choropleth";
|
|
6035
6111
|
}
|
|
6036
|
-
let
|
|
6112
|
+
let st = n(() => l.legend && (je.value || Me.value || l.data)), ct = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), lt = n(() => {
|
|
6037
6113
|
let e = [];
|
|
6038
6114
|
for (let t = 0; t <= 10; t++) {
|
|
6039
6115
|
let n = t / 10;
|
|
6040
6116
|
e.push({
|
|
6041
6117
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
6042
|
-
color:
|
|
6118
|
+
color: Ie(n)
|
|
6043
6119
|
});
|
|
6044
6120
|
}
|
|
6045
6121
|
return e;
|
|
6046
|
-
}),
|
|
6122
|
+
}), ut = new Intl.NumberFormat("en-US", {
|
|
6047
6123
|
notation: "compact",
|
|
6048
6124
|
maximumFractionDigits: 1
|
|
6049
|
-
}),
|
|
6050
|
-
let { min: e, max: t } =
|
|
6125
|
+
}), dt = n(() => {
|
|
6126
|
+
let { min: e, max: t } = Ae.value, n = t - e, r = [];
|
|
6051
6127
|
for (let t = 1; t <= 3; t++) {
|
|
6052
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
6128
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? ut.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
6053
6129
|
r.push({
|
|
6054
6130
|
value: o,
|
|
6055
6131
|
pct: i * 100
|
|
6056
6132
|
});
|
|
6057
6133
|
}
|
|
6058
6134
|
return r;
|
|
6059
|
-
}),
|
|
6135
|
+
}), ft = n(() => {
|
|
6060
6136
|
let e = [];
|
|
6061
|
-
if (
|
|
6137
|
+
if (je.value) for (let t of l.colorScale) e.push({
|
|
6062
6138
|
key: t.value,
|
|
6063
6139
|
color: t.color,
|
|
6064
6140
|
label: t.value
|
|
6065
6141
|
});
|
|
6066
|
-
else if (
|
|
6142
|
+
else if (Me.value) for (let t of ct.value) e.push({
|
|
6067
6143
|
key: String(t.min),
|
|
6068
6144
|
color: t.color,
|
|
6069
6145
|
label: t.label ?? String(t.min)
|
|
6070
6146
|
});
|
|
6071
6147
|
return e;
|
|
6072
|
-
}),
|
|
6073
|
-
let e =
|
|
6148
|
+
}), pt = n(() => `linear-gradient(to right, ${lt.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), mt = n(() => {
|
|
6149
|
+
let e = ot();
|
|
6074
6150
|
return [{
|
|
6075
6151
|
label: "Save as SVG",
|
|
6076
6152
|
action: () => {
|
|
@@ -6083,20 +6159,20 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
6083
6159
|
}
|
|
6084
6160
|
}];
|
|
6085
6161
|
});
|
|
6086
|
-
return C(() => [
|
|
6087
|
-
|
|
6162
|
+
return C(() => [we.value, O.value], () => rt()), C(() => [
|
|
6163
|
+
ke.value,
|
|
6088
6164
|
l.colorScale,
|
|
6089
6165
|
l.noDataColor
|
|
6090
|
-
], () =>
|
|
6166
|
+
], () => it()), C(() => [l.strokeColor, Te.value], () => at()), C(() => [Oe.value, we.value], () => _e(), { flush: "post" }), (n, c) => (g(), a("div", {
|
|
6091
6167
|
ref_key: "containerRef",
|
|
6092
6168
|
ref: x,
|
|
6093
6169
|
class: f(["choropleth-wrapper", { pannable: t.pan }])
|
|
6094
6170
|
}, [
|
|
6095
|
-
t.menu ? (g(), r(
|
|
6171
|
+
t.menu ? (g(), r(se, {
|
|
6096
6172
|
key: 0,
|
|
6097
|
-
items:
|
|
6173
|
+
items: mt.value
|
|
6098
6174
|
}, null, 8, ["items"])) : i("", !0),
|
|
6099
|
-
t.title ||
|
|
6175
|
+
t.title || st.value ? (g(), a("div", Tt, [t.title ? (g(), a("div", Et, y(t.title), 1)) : i("", !0), st.value ? (g(), a("div", Dt, [t.legendTitle ? (g(), a("span", Ot, y(t.legendTitle), 1)) : i("", !0), je.value || Me.value ? (g(!0), a(e, { key: 1 }, v(ft.value, (e) => (g(), a("span", {
|
|
6100
6176
|
key: e.key,
|
|
6101
6177
|
class: "choropleth-legend-item"
|
|
6102
6178
|
}, [o("span", {
|
|
@@ -6104,26 +6180,26 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
6104
6180
|
style: m({ background: e.color })
|
|
6105
6181
|
}, null, 4), s(" " + y(e.label), 1)]))), 128)) : (g(), a("div", kt, [o("div", {
|
|
6106
6182
|
class: "choropleth-legend-gradient",
|
|
6107
|
-
style: m({ background:
|
|
6108
|
-
}, null, 4), o("div", At, [(g(!0), a(e, null, v(
|
|
6183
|
+
style: m({ background: pt.value })
|
|
6184
|
+
}, null, 4), o("div", At, [(g(!0), a(e, null, v(dt.value, (e) => (g(), a("span", {
|
|
6109
6185
|
key: e.value,
|
|
6110
6186
|
style: m({ left: e.pct + "%" })
|
|
6111
6187
|
}, y(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
|
|
6112
6188
|
(g(), a("svg", {
|
|
6113
6189
|
ref_key: "svgRef",
|
|
6114
6190
|
ref: S,
|
|
6115
|
-
viewBox: `0 0 ${
|
|
6191
|
+
viewBox: `0 0 ${ye.value} ${be.value}`,
|
|
6116
6192
|
preserveAspectRatio: "xMidYMid meet"
|
|
6117
6193
|
}, [o("g", {
|
|
6118
6194
|
ref_key: "mapGroupRef",
|
|
6119
6195
|
ref: T
|
|
6120
6196
|
}, null, 512)], 8, jt)),
|
|
6121
|
-
|
|
6197
|
+
ce.value ? (g(), a("button", {
|
|
6122
6198
|
key: 2,
|
|
6123
6199
|
type: "button",
|
|
6124
6200
|
class: "choropleth-reset",
|
|
6125
6201
|
"aria-label": "Reset zoom",
|
|
6126
|
-
onClick:
|
|
6202
|
+
onClick: Q
|
|
6127
6203
|
}, " Reset ")) : i("", !0),
|
|
6128
6204
|
O.value ? (g(), r(wt, {
|
|
6129
6205
|
key: 3,
|
|
@@ -6133,12 +6209,12 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
6133
6209
|
default: w((r) => [te(n.$slots, "tooltip", p(u(ne(r))), () => [t.tooltipFormat ? (g(), a("span", {
|
|
6134
6210
|
key: 0,
|
|
6135
6211
|
innerHTML: t.tooltipFormat(r)
|
|
6136
|
-
}, null, 8, Mt)) : r.value == null ? (g(), a(e, { key: 1 }, [s(y(r.name), 1)], 64)) : (g(), a(e, { key: 2 }, [s(y(r.name) + ": " + y(
|
|
6212
|
+
}, null, 8, Mt)) : r.value == null ? (g(), a(e, { key: 1 }, [s(y(r.name), 1)], 64)) : (g(), a(e, { key: 2 }, [s(y(r.name) + ": " + y(Ve(r.value)), 1)], 64))], !0)]),
|
|
6137
6213
|
_: 3
|
|
6138
6214
|
}, 512)) : i("", !0)
|
|
6139
6215
|
], 2));
|
|
6140
6216
|
}
|
|
6141
|
-
}), [["__scopeId", "data-v-
|
|
6217
|
+
}), [["__scopeId", "data-v-62648243"]]), Lt = /* @__PURE__ */ H(/* @__PURE__ */ l({
|
|
6142
6218
|
__name: "ChartTooltip",
|
|
6143
6219
|
props: {
|
|
6144
6220
|
x: {},
|
|
@@ -6189,7 +6265,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
6189
6265
|
_: 3
|
|
6190
6266
|
}, 8, ["open"])) : i("", !0);
|
|
6191
6267
|
}
|
|
6192
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
6268
|
+
}), [["__scopeId", "data-v-44377f70"]]), Rt = { class: "TableWrapper" }, zt = /* @__PURE__ */ H(/* @__PURE__ */ l({
|
|
6193
6269
|
__name: "DataTable",
|
|
6194
6270
|
props: {
|
|
6195
6271
|
data: {},
|
|
@@ -6279,11 +6355,11 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
6279
6355
|
return (n, s) => (g(), a("div", { class: f(["TableOuter", {
|
|
6280
6356
|
"full-width": t.fullWidth,
|
|
6281
6357
|
"has-menu": re.value
|
|
6282
|
-
}]) }, [re.value ? (g(), r(
|
|
6358
|
+
}]) }, [re.value ? (g(), r(se, {
|
|
6283
6359
|
key: 0,
|
|
6284
6360
|
items: x.value,
|
|
6285
6361
|
"force-dropdown": ""
|
|
6286
|
-
}, null, 8, ["items"])) : i("", !0), o("div",
|
|
6362
|
+
}, null, 8, ["items"])) : i("", !0), o("div", Rt, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
|
|
6287
6363
|
o("colgroup", null, [(g(!0), a(e, null, v(h.value, (e) => (g(), a("col", {
|
|
6288
6364
|
key: e.name,
|
|
6289
6365
|
style: m(u(e.name))
|
|
@@ -6301,4 +6377,4 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
|
6301
6377
|
}
|
|
6302
6378
|
}), [["__scopeId", "data-v-d5c290dc"]]);
|
|
6303
6379
|
//#endregion
|
|
6304
|
-
export { bt as BarChart,
|
|
6380
|
+
export { bt as BarChart, Lt as ChartTooltip, It as ChoroplethMap, zt as DataTable, $e as LineChart };
|