@cfasim-ui/charts 0.7.0 → 0.7.1
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 +7 -3
- package/dist/index.css +1 -1
- package/dist/index.js +530 -519
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, nextTick as f, normalizeClass as p, normalizeProps as m, normalizeStyle as h, onMounted as g, onUnmounted as ee, openBlock as _, ref as v, renderList as y, renderSlot as te, toDisplayString as b, toHandlers as ne, toRaw as
|
|
2
|
-
import { formatNumber as
|
|
3
|
-
import { DropdownMenuContent as
|
|
4
|
-
import { geoAlbersUsa as
|
|
5
|
-
import { zoom as
|
|
6
|
-
import { select as
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, nextTick as f, normalizeClass as p, normalizeProps as m, normalizeStyle as h, onMounted as g, onUnmounted as ee, openBlock as _, ref as v, renderList as y, renderSlot as te, toDisplayString as b, toHandlers as ne, toRaw as re, unref as x, useSlots as S, useTemplateRef as C, watch as w, withCtx as T } from "vue";
|
|
2
|
+
import { formatNumber as ie } from "@cfasim-ui/shared";
|
|
3
|
+
import { DropdownMenuContent as E, DropdownMenuItem as D, DropdownMenuPortal as ae, DropdownMenuRoot as O, DropdownMenuTrigger as k, PopoverAnchor as A, PopoverContent as oe, PopoverPortal as j, PopoverRoot as se } from "reka-ui";
|
|
4
|
+
import { geoAlbersUsa as M, geoMercator as ce, geoPath as N } from "d3-geo";
|
|
5
|
+
import { zoom as le, zoomIdentity as ue, zoomTransform as de } from "d3-zoom";
|
|
6
|
+
import { select as P } from "d3-selection";
|
|
7
7
|
import "d3-transition";
|
|
8
|
-
import { feature as
|
|
8
|
+
import { feature as fe, merge as pe, mesh as me } from "topojson-client";
|
|
9
9
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var F = ["aria-label"], he = /* @__PURE__ */ l({
|
|
11
11
|
__name: "ChartMenu",
|
|
12
12
|
props: {
|
|
13
13
|
items: {},
|
|
@@ -37,15 +37,15 @@ var me = ["aria-label"], he = /* @__PURE__ */ l({
|
|
|
37
37
|
"stroke-width": "1.75",
|
|
38
38
|
"stroke-linecap": "round",
|
|
39
39
|
"aria-hidden": "true"
|
|
40
|
-
}, [o("path", { d: "M4 4l8 8M12 4l-8 8" })], -1)]])) : u() ? (_(), r(
|
|
40
|
+
}, [o("path", { d: "M4 4l8 8M12 4l-8 8" })], -1)]])) : u() ? (_(), r(x(O), {
|
|
41
41
|
key: 2,
|
|
42
42
|
modal: !1
|
|
43
43
|
}, {
|
|
44
|
-
default:
|
|
44
|
+
default: T(() => [c(x(k), {
|
|
45
45
|
class: "chart-menu-button",
|
|
46
46
|
"aria-label": "Chart options"
|
|
47
47
|
}, {
|
|
48
|
-
default:
|
|
48
|
+
default: T(() => [...i[4] ||= [o("svg", {
|
|
49
49
|
width: "16",
|
|
50
50
|
height: "16",
|
|
51
51
|
viewBox: "0 0 16 16",
|
|
@@ -69,19 +69,19 @@ var me = ["aria-label"], he = /* @__PURE__ */ l({
|
|
|
69
69
|
})
|
|
70
70
|
], -1)]]),
|
|
71
71
|
_: 1
|
|
72
|
-
}), c(
|
|
73
|
-
default:
|
|
72
|
+
}), c(x(ae), null, {
|
|
73
|
+
default: T(() => [c(x(E), {
|
|
74
74
|
class: "chart-menu-content",
|
|
75
75
|
"side-offset": 4,
|
|
76
76
|
align: "end"
|
|
77
77
|
}, {
|
|
78
|
-
default:
|
|
78
|
+
default: T(() => [(_(!0), a(e, null, y(t.items, (e) => (_(), r(x(D), {
|
|
79
79
|
key: e.label,
|
|
80
80
|
class: "chart-menu-item",
|
|
81
81
|
"aria-pressed": e.ariaPressed,
|
|
82
82
|
onSelect: e.action
|
|
83
83
|
}, {
|
|
84
|
-
default:
|
|
84
|
+
default: T(() => [s(b(e.label), 1)]),
|
|
85
85
|
_: 2
|
|
86
86
|
}, 1032, ["aria-pressed", "onSelect"]))), 128))]),
|
|
87
87
|
_: 1
|
|
@@ -104,7 +104,7 @@ var me = ["aria-label"], he = /* @__PURE__ */ l({
|
|
|
104
104
|
"stroke-linecap": "round",
|
|
105
105
|
"stroke-linejoin": "round",
|
|
106
106
|
"aria-hidden": "true"
|
|
107
|
-
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8,
|
|
107
|
+
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, F))], 2));
|
|
108
108
|
}
|
|
109
109
|
}), I = (e, t) => {
|
|
110
110
|
let n = e.__vccOpts || e;
|
|
@@ -321,7 +321,7 @@ function Ne(e) {
|
|
|
321
321
|
clientY: r.clientY
|
|
322
322
|
}, e.onHover?.({ index: i }));
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
w([a, n], () => {
|
|
325
325
|
if (n.value === null || !a.value) {
|
|
326
326
|
o.value = null;
|
|
327
327
|
return;
|
|
@@ -742,11 +742,11 @@ var Xe = {
|
|
|
742
742
|
left: "start",
|
|
743
743
|
center: "middle",
|
|
744
744
|
right: "end"
|
|
745
|
-
}[t.align ?? (o > 0 ? "left" : o < 0 ? "right" : "center")], ne = t.text.split("\n").map(c),
|
|
746
|
-
if (a && r.bounds)
|
|
745
|
+
}[t.align ?? (o > 0 ? "left" : o < 0 ? "right" : "center")], ne = t.text.split("\n").map(c), re, x = "", S, C = !a && (t.arrow ?? !0);
|
|
746
|
+
if (a && r.bounds) re = u(i, n.x, n.y, r.bounds);
|
|
747
747
|
else {
|
|
748
748
|
let e = f(n.x, n.y, d, p, h, ne.length, i);
|
|
749
|
-
|
|
749
|
+
x = e.path, C && e.arrow && (S = e.arrow);
|
|
750
750
|
}
|
|
751
751
|
e.push({
|
|
752
752
|
lines: ne,
|
|
@@ -759,14 +759,14 @@ var Xe = {
|
|
|
759
759
|
color: m,
|
|
760
760
|
outlineColor: ee,
|
|
761
761
|
outlineWidth: _,
|
|
762
|
-
pointerPath:
|
|
762
|
+
pointerPath: x,
|
|
763
763
|
lineColor: v,
|
|
764
764
|
lineWidth: y,
|
|
765
765
|
lineDash: te,
|
|
766
|
-
arrow:
|
|
767
|
-
arrowTip:
|
|
768
|
-
arrowTransform:
|
|
769
|
-
rule:
|
|
766
|
+
arrow: C,
|
|
767
|
+
arrowTip: S,
|
|
768
|
+
arrowTransform: S ? `translate(${S.x} ${S.y}) rotate(${S.angle})` : "",
|
|
769
|
+
rule: re
|
|
770
770
|
});
|
|
771
771
|
}
|
|
772
772
|
return e;
|
|
@@ -945,7 +945,7 @@ function _t(e) {
|
|
|
945
945
|
width: () => g.value,
|
|
946
946
|
height: () => ee.value,
|
|
947
947
|
extraPadding: e.chartPadding
|
|
948
|
-
}), { hoverIndex:
|
|
948
|
+
}), { hoverIndex: re, tooltipRef: x, tooltipPos: S, handlers: C } = Ne({
|
|
949
949
|
enabled: e.hasTooltipSlot,
|
|
950
950
|
trigger: e.tooltipTrigger,
|
|
951
951
|
clamp: () => e.tooltipClamp() ?? "chart",
|
|
@@ -965,10 +965,10 @@ function _t(e) {
|
|
|
965
965
|
innerW: te,
|
|
966
966
|
innerH: b,
|
|
967
967
|
bounds: ne,
|
|
968
|
-
hoverIndex:
|
|
969
|
-
tooltipRef:
|
|
970
|
-
tooltipPos:
|
|
971
|
-
tooltipHandlers:
|
|
968
|
+
hoverIndex: re,
|
|
969
|
+
tooltipRef: x,
|
|
970
|
+
tooltipPos: S,
|
|
971
|
+
tooltipHandlers: C,
|
|
972
972
|
menuItems: o,
|
|
973
973
|
downloadLinkText: s,
|
|
974
974
|
csvHref: c,
|
|
@@ -984,9 +984,9 @@ function _t(e) {
|
|
|
984
984
|
function vt(e, t) {
|
|
985
985
|
return (n) => {
|
|
986
986
|
let r = e();
|
|
987
|
-
if (r !== void 0) return
|
|
987
|
+
if (r !== void 0) return ie(n, r);
|
|
988
988
|
let i = t();
|
|
989
|
-
return i === void 0 ? z(n) :
|
|
989
|
+
return i === void 0 ? z(n) : ie(n, i);
|
|
990
990
|
};
|
|
991
991
|
}
|
|
992
992
|
//#endregion
|
|
@@ -1448,11 +1448,11 @@ var Jt = {
|
|
|
1448
1448
|
"fill",
|
|
1449
1449
|
"fill-opacity",
|
|
1450
1450
|
"stroke"
|
|
1451
|
-
],
|
|
1451
|
+
], hn = [
|
|
1452
1452
|
"d",
|
|
1453
1453
|
"fill",
|
|
1454
1454
|
"fill-opacity"
|
|
1455
|
-
],
|
|
1455
|
+
], $ = [
|
|
1456
1456
|
"d",
|
|
1457
1457
|
"stroke",
|
|
1458
1458
|
"stroke-width",
|
|
@@ -1572,20 +1572,20 @@ var Jt = {
|
|
|
1572
1572
|
emits: ["hover"],
|
|
1573
1573
|
setup(c, { emit: l }) {
|
|
1574
1574
|
let f = c, p = n(() => f.ariaLabel ?? f.title), g = n(() => f.role ?? (p.value ? "img" : void 0)), ee = l, v = [];
|
|
1575
|
-
function*
|
|
1575
|
+
function* re(e) {
|
|
1576
1576
|
if (e.x && e.x.length > 0 && (yield e.x), e.series) for (let t of e.series) t.x && t.x.length > 0 && (yield t.x);
|
|
1577
1577
|
if (e.areas) for (let t of e.areas) t.x && t.x.length > 0 && (yield t.x);
|
|
1578
1578
|
}
|
|
1579
|
-
function
|
|
1579
|
+
function S(e, t, n) {
|
|
1580
1580
|
if (!e) return;
|
|
1581
1581
|
if (!t) return e;
|
|
1582
1582
|
let r = new Float64Array(e.length);
|
|
1583
1583
|
for (let t = 0; t < e.length; t++) r[t] = Ft(e[t], n) ?? NaN;
|
|
1584
1584
|
return r;
|
|
1585
1585
|
}
|
|
1586
|
-
let
|
|
1587
|
-
let e =
|
|
1588
|
-
for (let r of
|
|
1586
|
+
let C = vt(() => f.tooltipValueFormat, () => f.yTickFormat), w = n(() => f.timezone ?? "utc"), T = n(() => {
|
|
1587
|
+
let e = w.value, t = !1, n = !1;
|
|
1588
|
+
for (let r of re(f)) {
|
|
1589
1589
|
if (n = !0, !Lt(r, e)) {
|
|
1590
1590
|
t = !1;
|
|
1591
1591
|
break;
|
|
@@ -1596,44 +1596,44 @@ var Jt = {
|
|
|
1596
1596
|
let r = f.series && f.series.length > 0 ? f.series.map((n) => ({
|
|
1597
1597
|
...n,
|
|
1598
1598
|
data: n.y ?? n.data ?? v,
|
|
1599
|
-
x:
|
|
1599
|
+
x: S(n.x, t, e)
|
|
1600
1600
|
})) : (() => {
|
|
1601
1601
|
let n = f.y ?? f.data;
|
|
1602
1602
|
return n ? [{
|
|
1603
1603
|
data: n,
|
|
1604
|
-
x:
|
|
1604
|
+
x: S(f.x, t, e)
|
|
1605
1605
|
}] : [];
|
|
1606
1606
|
})(), i = (f.areas ?? []).map((n) => ({
|
|
1607
1607
|
...n,
|
|
1608
|
-
x:
|
|
1608
|
+
x: S(n.x, t, e)
|
|
1609
1609
|
}));
|
|
1610
1610
|
return {
|
|
1611
1611
|
isDate: t,
|
|
1612
1612
|
series: r,
|
|
1613
1613
|
areas: i
|
|
1614
1614
|
};
|
|
1615
|
-
}),
|
|
1615
|
+
}), E = n(() => T.value.isDate), D = n(() => T.value.series), ae = n(() => T.value.areas), O = n(() => {
|
|
1616
1616
|
let e = 0;
|
|
1617
|
-
for (let t of
|
|
1618
|
-
for (let t of
|
|
1617
|
+
for (let t of D.value) t.data.length > e && (e = t.data.length);
|
|
1618
|
+
for (let t of ae.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
|
|
1619
1619
|
return e;
|
|
1620
|
-
}),
|
|
1621
|
-
function
|
|
1620
|
+
}), k = n(() => D.value.some((e) => e.x != null) || ae.value.some((e) => e.x != null));
|
|
1621
|
+
function A(e, t) {
|
|
1622
1622
|
return e.x ? Number(e.x[t]) : t;
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1624
|
+
function oe(e, t) {
|
|
1625
1625
|
return e.x ? Number(e.x[t]) : t;
|
|
1626
1626
|
}
|
|
1627
|
-
let
|
|
1627
|
+
let j = n(() => k.value ? 0 : f.xMin ?? 0), se = n(() => {
|
|
1628
1628
|
let e = Infinity, t = -Infinity;
|
|
1629
|
-
for (let n of
|
|
1630
|
-
let i =
|
|
1629
|
+
for (let n of D.value) for (let r = 0; r < n.data.length; r++) {
|
|
1630
|
+
let i = A(n, r);
|
|
1631
1631
|
isFinite(i) && (i < e && (e = i), i > t && (t = i));
|
|
1632
1632
|
}
|
|
1633
|
-
for (let n of
|
|
1633
|
+
for (let n of ae.value) {
|
|
1634
1634
|
let r = Math.max(n.upper.length, n.lower.length);
|
|
1635
1635
|
for (let i = 0; i < r; i++) {
|
|
1636
|
-
let r =
|
|
1636
|
+
let r = oe(n, i);
|
|
1637
1637
|
isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
1638
1638
|
}
|
|
1639
1639
|
}
|
|
@@ -1645,16 +1645,16 @@ var Jt = {
|
|
|
1645
1645
|
max: 0
|
|
1646
1646
|
};
|
|
1647
1647
|
});
|
|
1648
|
-
function
|
|
1649
|
-
let { min: t, max: n } =
|
|
1648
|
+
function M(e) {
|
|
1649
|
+
let { min: t, max: n } = se.value, r = n - t || 1;
|
|
1650
1650
|
return U.value.left + (e - t) / r * G.value;
|
|
1651
1651
|
}
|
|
1652
|
-
let
|
|
1652
|
+
let ce = n(() => {
|
|
1653
1653
|
let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
|
|
1654
1654
|
isFinite(r) && (r < e && (e = r), r > t && (t = r), r > 0 && r < n && (n = r));
|
|
1655
1655
|
};
|
|
1656
|
-
for (let e of
|
|
1657
|
-
for (let e of
|
|
1656
|
+
for (let e of D.value) for (let t of e.data) r(t);
|
|
1657
|
+
for (let e of ae.value) {
|
|
1658
1658
|
for (let t of e.upper) r(t);
|
|
1659
1659
|
for (let t of e.lower) r(t);
|
|
1660
1660
|
}
|
|
@@ -1671,70 +1671,70 @@ var Jt = {
|
|
|
1671
1671
|
range: i.max - i.min || 1
|
|
1672
1672
|
};
|
|
1673
1673
|
});
|
|
1674
|
-
function
|
|
1675
|
-
let { min: t, max: n } =
|
|
1674
|
+
function N(e) {
|
|
1675
|
+
let { min: t, max: n } = ce.value;
|
|
1676
1676
|
return U.value.top + K.value - be(e, t, n, f.yScaleType) * K.value;
|
|
1677
1677
|
}
|
|
1678
|
-
function
|
|
1678
|
+
function le(e) {
|
|
1679
1679
|
let t = e.data;
|
|
1680
1680
|
if (t.length === 0) return "";
|
|
1681
1681
|
let n = "", r = !1;
|
|
1682
1682
|
for (let i = 0; i < t.length; i++) {
|
|
1683
|
-
let a =
|
|
1683
|
+
let a = A(e, i);
|
|
1684
1684
|
if (!isFinite(t[i]) || !isFinite(a)) {
|
|
1685
1685
|
r = !1;
|
|
1686
1686
|
continue;
|
|
1687
1687
|
}
|
|
1688
|
-
let o =
|
|
1688
|
+
let o = M(a), s = N(t[i]);
|
|
1689
1689
|
n += r ? `L${o},${s}` : `M${o},${s}`, r = !0;
|
|
1690
1690
|
}
|
|
1691
1691
|
return n;
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function ue(e) {
|
|
1694
1694
|
let t = e.data, n = [];
|
|
1695
1695
|
for (let r = 0; r < t.length; r++) {
|
|
1696
|
-
let i =
|
|
1696
|
+
let i = A(e, r);
|
|
1697
1697
|
!isFinite(t[r]) || !isFinite(i) || n.push({
|
|
1698
|
-
x:
|
|
1699
|
-
y:
|
|
1698
|
+
x: M(i),
|
|
1699
|
+
y: N(t[r])
|
|
1700
1700
|
});
|
|
1701
1701
|
}
|
|
1702
1702
|
return n;
|
|
1703
1703
|
}
|
|
1704
|
-
function
|
|
1704
|
+
function de(e) {
|
|
1705
1705
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
1706
1706
|
if (t === 0) return "";
|
|
1707
1707
|
let n = [], r = [];
|
|
1708
|
-
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(
|
|
1708
|
+
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(oe(e, i)) ? r.push(i) : r.length && (n.push(r), r = []);
|
|
1709
1709
|
r.length && n.push(r);
|
|
1710
1710
|
let i = "";
|
|
1711
1711
|
for (let t of n) {
|
|
1712
|
-
i += `M${
|
|
1713
|
-
for (let n = 1; n < t.length; n++) i += `L${
|
|
1714
|
-
for (let n = t.length - 1; n >= 0; n--) i += `L${
|
|
1712
|
+
i += `M${M(oe(e, t[0]))},${N(e.upper[t[0]])}`;
|
|
1713
|
+
for (let n = 1; n < t.length; n++) i += `L${M(oe(e, t[n]))},${N(e.upper[t[n]])}`;
|
|
1714
|
+
for (let n = t.length - 1; n >= 0; n--) i += `L${M(oe(e, t[n]))},${N(e.lower[t[n]])}`;
|
|
1715
1715
|
i += "Z";
|
|
1716
1716
|
}
|
|
1717
1717
|
return i;
|
|
1718
1718
|
}
|
|
1719
|
-
function
|
|
1720
|
-
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null &&
|
|
1721
|
-
return
|
|
1719
|
+
function P(e, t) {
|
|
1720
|
+
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && D.value[e.seriesIndex] || D.value[0];
|
|
1721
|
+
return M(r ? A(r, n) : n);
|
|
1722
1722
|
}
|
|
1723
|
-
function
|
|
1723
|
+
function fe(e, t = !0) {
|
|
1724
1724
|
let n = U.value.top + K.value;
|
|
1725
1725
|
if (e.seriesIndex == null) {
|
|
1726
|
-
let t =
|
|
1726
|
+
let t = P(e, "start"), r = P(e, "end");
|
|
1727
1727
|
return t > r ? "" : `M${t},${U.value.top}L${r},${U.value.top}L${r},${n}L${t},${n}Z`;
|
|
1728
1728
|
}
|
|
1729
|
-
let r =
|
|
1729
|
+
let r = D.value[e.seriesIndex];
|
|
1730
1730
|
if (!r) return "";
|
|
1731
1731
|
let i = Math.max(0, e.startIndex), a = Math.min(r.data.length - 1, e.endIndex);
|
|
1732
1732
|
if (i > a) return "";
|
|
1733
|
-
let o = `M${
|
|
1734
|
-
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${
|
|
1735
|
-
return t && (o += `L${
|
|
1733
|
+
let o = `M${M(A(r, i))},${N(r.data[i])}`;
|
|
1734
|
+
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${M(A(r, e))},${N(r.data[e])}`);
|
|
1735
|
+
return t && (o += `L${M(A(r, a))},${n}`, o += `L${M(A(r, i))},${n}`, o += "Z"), o;
|
|
1736
1736
|
}
|
|
1737
|
-
let
|
|
1737
|
+
let pe = n(() => {
|
|
1738
1738
|
let e = f.areaSections;
|
|
1739
1739
|
if (!e?.length) return {
|
|
1740
1740
|
labels: [],
|
|
@@ -1743,7 +1743,7 @@ var Jt = {
|
|
|
1743
1743
|
let t = [], n = U.value.left + G.value;
|
|
1744
1744
|
for (let r of e) {
|
|
1745
1745
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
1746
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * jn, o =
|
|
1746
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * jn, o = P(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : D.value[r.seriesIndex]?.color ?? "currentColor"), u = Te({
|
|
1747
1747
|
color: l,
|
|
1748
1748
|
fontWeight: 600,
|
|
1749
1749
|
...r.inlineLabelStyle
|
|
@@ -1779,9 +1779,9 @@ var Jt = {
|
|
|
1779
1779
|
labels: t,
|
|
1780
1780
|
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * kn + An
|
|
1781
1781
|
};
|
|
1782
|
-
}),
|
|
1782
|
+
}), me = n(() => {
|
|
1783
1783
|
let e = [];
|
|
1784
|
-
for (let t of
|
|
1784
|
+
for (let t of D.value) !t.legend || t.showInLegend === !1 || e.push({
|
|
1785
1785
|
label: t.legend,
|
|
1786
1786
|
color: t.color ?? "currentColor",
|
|
1787
1787
|
type: "series",
|
|
@@ -1790,7 +1790,7 @@ var Jt = {
|
|
|
1790
1790
|
let t = f.areaSections;
|
|
1791
1791
|
if (t) for (let n of t) {
|
|
1792
1792
|
if (n.legend !== "inline" || !n.label && !n.description) continue;
|
|
1793
|
-
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" :
|
|
1793
|
+
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : D.value[n.seriesIndex]?.color ?? "currentColor");
|
|
1794
1794
|
e.push({
|
|
1795
1795
|
label: t,
|
|
1796
1796
|
color: r,
|
|
@@ -1799,8 +1799,8 @@ var Jt = {
|
|
|
1799
1799
|
});
|
|
1800
1800
|
}
|
|
1801
1801
|
return e;
|
|
1802
|
-
}),
|
|
1803
|
-
let { min: e, max: t } =
|
|
1802
|
+
}), F = n(() => me.value.map((e) => e.label)), he = n(() => Pe.value + pe.value.extraHeight), I = n(() => U.value.top + K.value + U.value.bottom + An), _e = n(() => {
|
|
1803
|
+
let { min: e, max: t } = ce.value, n = (e) => f.yTickFormat === void 0 ? z(e) : ie(e, f.yTickFormat);
|
|
1804
1804
|
return e === t ? [{
|
|
1805
1805
|
value: n(e),
|
|
1806
1806
|
y: L(U.value.top + K.value / 2)
|
|
@@ -1815,27 +1815,27 @@ var Jt = {
|
|
|
1815
1815
|
targetTickCount: K.value / 50
|
|
1816
1816
|
})).map((e) => ({
|
|
1817
1817
|
value: n(e),
|
|
1818
|
-
y: L(
|
|
1818
|
+
y: L(N(e))
|
|
1819
1819
|
}));
|
|
1820
1820
|
});
|
|
1821
1821
|
function ve(e, t, n) {
|
|
1822
1822
|
let r = f.xTickFormat;
|
|
1823
|
-
if (
|
|
1824
|
-
let i = e +
|
|
1825
|
-
return r === void 0 ? !
|
|
1823
|
+
if (E.value) return typeof r == "function" ? r(e, t) : qt(e, r, w.value, n);
|
|
1824
|
+
let i = e + j.value;
|
|
1825
|
+
return r === void 0 ? !k.value && f.xLabels && Number.isInteger(e) && e >= 0 && e < f.xLabels.length ? f.xLabels[e] : z(i) : typeof r == "function" ? r(i, t) : ie(i, r);
|
|
1826
1826
|
}
|
|
1827
1827
|
let R = n(() => {
|
|
1828
|
-
let { min: e, max: t } =
|
|
1828
|
+
let { min: e, max: t } = se.value;
|
|
1829
1829
|
if (e === t) return [];
|
|
1830
|
-
let n =
|
|
1830
|
+
let n = E.value, r = n ? 0 : j.value, i = O.value, a = G.value / 80, o, s;
|
|
1831
1831
|
if (n) {
|
|
1832
|
-
let n = Vt(e, t, a,
|
|
1832
|
+
let n = Vt(e, t, a, w.value);
|
|
1833
1833
|
s = n.unit, o = ye({
|
|
1834
1834
|
min: e,
|
|
1835
1835
|
max: t,
|
|
1836
1836
|
ticks: n.values
|
|
1837
1837
|
});
|
|
1838
|
-
} else if (f.xTicks == null && !
|
|
1838
|
+
} else if (f.xTicks == null && !k.value && f.xLabels && f.xLabels.length === i) {
|
|
1839
1839
|
let e = Math.max(3, Math.floor(a)), t = Math.max(1, Math.round((i - 1) / e));
|
|
1840
1840
|
o = [];
|
|
1841
1841
|
for (let e = 0; e < i; e += t) o.push(e);
|
|
@@ -1848,7 +1848,7 @@ var Jt = {
|
|
|
1848
1848
|
});
|
|
1849
1849
|
let c = U.value.left, l = U.value.left + G.value;
|
|
1850
1850
|
return o.map((e, t) => {
|
|
1851
|
-
let n = L(
|
|
1851
|
+
let n = L(M(e)), r = "middle";
|
|
1852
1852
|
return n - c <= 1 ? r = "start" : l - n <= 1 && (r = "end"), {
|
|
1853
1853
|
value: ve(e, t, s),
|
|
1854
1854
|
x: n,
|
|
@@ -1857,18 +1857,18 @@ var Jt = {
|
|
|
1857
1857
|
});
|
|
1858
1858
|
});
|
|
1859
1859
|
function Ce() {
|
|
1860
|
-
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv : J(
|
|
1860
|
+
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv : J(D.value);
|
|
1861
1861
|
}
|
|
1862
1862
|
let B = n(() => !!f.tooltipData || !!f.tooltipTrigger), Ee = n(() => {
|
|
1863
|
-
let e = Le.value, t =
|
|
1864
|
-
return e === null || !t ? null :
|
|
1865
|
-
}), De = n(() => Ee.value === null ? 0 :
|
|
1863
|
+
let e = Le.value, t = D.value[0];
|
|
1864
|
+
return e === null || !t ? null : A(t, e);
|
|
1865
|
+
}), De = n(() => Ee.value === null ? 0 : M(Ee.value));
|
|
1866
1866
|
function Oe(e, t) {
|
|
1867
1867
|
let n = e.data.length;
|
|
1868
1868
|
if (n === 0) return null;
|
|
1869
1869
|
let r = 0, i = Infinity;
|
|
1870
1870
|
for (let a = 0; a < n; a++) {
|
|
1871
|
-
let n =
|
|
1871
|
+
let n = A(e, a);
|
|
1872
1872
|
if (!isFinite(n)) continue;
|
|
1873
1873
|
let o = Math.abs(n - t);
|
|
1874
1874
|
o < i && (i = o, r = a);
|
|
@@ -1879,14 +1879,14 @@ var Jt = {
|
|
|
1879
1879
|
let e = Ee.value;
|
|
1880
1880
|
if (e === null) return [];
|
|
1881
1881
|
let t = [];
|
|
1882
|
-
for (let n of
|
|
1882
|
+
for (let n of D.value) {
|
|
1883
1883
|
if (n.showInTooltip === !1) continue;
|
|
1884
1884
|
let r = Oe(n, e);
|
|
1885
1885
|
if (r === null) continue;
|
|
1886
1886
|
let i = n.data[r];
|
|
1887
1887
|
isFinite(i) && t.push({
|
|
1888
|
-
x:
|
|
1889
|
-
y:
|
|
1888
|
+
x: M(A(n, r)),
|
|
1889
|
+
y: N(i),
|
|
1890
1890
|
color: n.color ?? "currentColor"
|
|
1891
1891
|
});
|
|
1892
1892
|
}
|
|
@@ -1894,7 +1894,7 @@ var Jt = {
|
|
|
1894
1894
|
}), V = n(() => {
|
|
1895
1895
|
let e = Le.value, t = Ee.value;
|
|
1896
1896
|
if (e === null || t === null) return null;
|
|
1897
|
-
let n = ve(t, e), r =
|
|
1897
|
+
let n = ve(t, e), r = D.value, i = [];
|
|
1898
1898
|
for (let e = 0; e < r.length; e++) {
|
|
1899
1899
|
let n = r[e];
|
|
1900
1900
|
if (n.showInTooltip === !1) continue;
|
|
@@ -1914,16 +1914,16 @@ var Jt = {
|
|
|
1914
1914
|
});
|
|
1915
1915
|
function Ae(e, t) {
|
|
1916
1916
|
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1917
|
-
x:
|
|
1918
|
-
y:
|
|
1917
|
+
x: M(e - j.value),
|
|
1918
|
+
y: N(t)
|
|
1919
1919
|
};
|
|
1920
1920
|
}
|
|
1921
1921
|
function je(e) {
|
|
1922
1922
|
let t = Me.value?.getBoundingClientRect();
|
|
1923
1923
|
if (!t) return null;
|
|
1924
|
-
let n =
|
|
1924
|
+
let n = D.value[0];
|
|
1925
1925
|
if (!n || n.data.length === 0) return null;
|
|
1926
|
-
let { min: r, max: i } =
|
|
1926
|
+
let { min: r, max: i } = se.value, a = i - r || 1;
|
|
1927
1927
|
return Oe(n, r + (e - t.left - U.value.left) / G.value * a);
|
|
1928
1928
|
}
|
|
1929
1929
|
let { containerRef: Me, svgRef: H, width: Ne, height: Pe, padding: U, legendY: W, inlineLegendLayout: Fe, innerW: G, innerH: K, bounds: Ie, hoverIndex: Le, tooltipRef: Re, tooltipPos: ze, tooltipHandlers: Be, menuItems: Ve, downloadLinkText: He, csvHref: Ue, downloadButtonText: q, triggerCsvDownload: We, menuFilename: Ge, isFullscreen: Ke, fullscreenStyle: qe, teleportTarget: Je, exitFullscreen: Ye } = _t({
|
|
@@ -1942,12 +1942,12 @@ var Jt = {
|
|
|
1942
1942
|
downloadButton: () => f.downloadButton,
|
|
1943
1943
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
1944
1944
|
chartPadding: () => f.chartPadding,
|
|
1945
|
-
inlineLegendLabels: () =>
|
|
1945
|
+
inlineLegendLabels: () => F.value,
|
|
1946
1946
|
hasTooltipSlot: () => B.value,
|
|
1947
1947
|
getCsv: Ce,
|
|
1948
1948
|
pointerToIndex: je,
|
|
1949
1949
|
onHover: (e) => ee("hover", e),
|
|
1950
|
-
extraBelowHeight: () =>
|
|
1950
|
+
extraBelowHeight: () => pe.value.extraHeight
|
|
1951
1951
|
}), Xe = n(() => Te(f.axisLabelStyle, { fontSize: 13 })), Y = n(() => Te(f.tickLabelStyle, {
|
|
1952
1952
|
fontSize: 10,
|
|
1953
1953
|
fillOpacity: we
|
|
@@ -1964,7 +1964,7 @@ var Jt = {
|
|
|
1964
1964
|
};
|
|
1965
1965
|
}), Qe = n(() => {
|
|
1966
1966
|
let e = Fe.value.positions, t = U.value.left, n = W.value;
|
|
1967
|
-
return
|
|
1967
|
+
return me.value.map((r, i) => {
|
|
1968
1968
|
let a = e[i];
|
|
1969
1969
|
return {
|
|
1970
1970
|
...r,
|
|
@@ -1974,30 +1974,30 @@ var Jt = {
|
|
|
1974
1974
|
});
|
|
1975
1975
|
});
|
|
1976
1976
|
return (n, l) => (_(), r(t, {
|
|
1977
|
-
to:
|
|
1978
|
-
disabled: !
|
|
1977
|
+
to: x(Je),
|
|
1978
|
+
disabled: !x(Ke)
|
|
1979
1979
|
}, [o("div", d({
|
|
1980
1980
|
ref_key: "containerRef",
|
|
1981
1981
|
ref: Me
|
|
1982
1982
|
}, n.$attrs, {
|
|
1983
|
-
class: ["line-chart-wrapper", { "is-fullscreen":
|
|
1984
|
-
style:
|
|
1983
|
+
class: ["line-chart-wrapper", { "is-fullscreen": x(Ke) }],
|
|
1984
|
+
style: x(qe)
|
|
1985
1985
|
}), [
|
|
1986
1986
|
c.menu ? (_(), r(ge, {
|
|
1987
1987
|
key: 0,
|
|
1988
|
-
items:
|
|
1989
|
-
"is-fullscreen":
|
|
1990
|
-
onClose:
|
|
1988
|
+
items: x(Ve),
|
|
1989
|
+
"is-fullscreen": x(Ke),
|
|
1990
|
+
onClose: x(Ye)
|
|
1991
1991
|
}, null, 8, [
|
|
1992
1992
|
"items",
|
|
1993
1993
|
"is-fullscreen",
|
|
1994
1994
|
"onClose"
|
|
1995
1995
|
])) : i("", !0),
|
|
1996
|
-
o("div", Jt, b(
|
|
1996
|
+
o("div", Jt, b(x(Ke) ? "Chart expanded to fill window" : ""), 1),
|
|
1997
1997
|
(_(), a("svg", {
|
|
1998
1998
|
ref_key: "svgRef",
|
|
1999
1999
|
ref: H,
|
|
2000
|
-
width:
|
|
2000
|
+
width: x(Ne),
|
|
2001
2001
|
height: he.value,
|
|
2002
2002
|
role: g.value || void 0,
|
|
2003
2003
|
"aria-label": p.value || void 0
|
|
@@ -2041,26 +2041,26 @@ var Jt = {
|
|
|
2041
2041
|
"font-weight": Ze.value.fontWeight
|
|
2042
2042
|
}, b(t.label), 9, tn)], 64))), 128))])) : i("", !0),
|
|
2043
2043
|
o("line", {
|
|
2044
|
-
x1:
|
|
2045
|
-
y1:
|
|
2046
|
-
x2:
|
|
2047
|
-
y2:
|
|
2044
|
+
x1: x(L)(x(U).left),
|
|
2045
|
+
y1: x(L)(x(U).top),
|
|
2046
|
+
x2: x(L)(x(U).left),
|
|
2047
|
+
y2: x(L)(x(U).top + x(K)),
|
|
2048
2048
|
stroke: "currentColor",
|
|
2049
2049
|
"stroke-opacity": "0.3"
|
|
2050
2050
|
}, null, 8, nn),
|
|
2051
2051
|
o("line", {
|
|
2052
|
-
x1:
|
|
2053
|
-
y1:
|
|
2054
|
-
x2:
|
|
2055
|
-
y2:
|
|
2052
|
+
x1: x(L)(x(U).left),
|
|
2053
|
+
y1: x(L)(x(U).top + x(K)),
|
|
2054
|
+
x2: x(L)(x(U).left + x(G)),
|
|
2055
|
+
y2: x(L)(x(U).top + x(K)),
|
|
2056
2056
|
stroke: "currentColor",
|
|
2057
2057
|
"stroke-opacity": "0.3"
|
|
2058
2058
|
}, null, 8, rn),
|
|
2059
2059
|
c.yGrid ? (_(!0), a(e, { key: 2 }, y(_e.value, (e, t) => (_(), a("line", {
|
|
2060
2060
|
key: "yg" + t,
|
|
2061
|
-
x1:
|
|
2061
|
+
x1: x(U).left,
|
|
2062
2062
|
y1: e.y,
|
|
2063
|
-
x2:
|
|
2063
|
+
x2: x(U).left + x(G),
|
|
2064
2064
|
y2: e.y,
|
|
2065
2065
|
stroke: "currentColor",
|
|
2066
2066
|
"stroke-opacity": "0.1"
|
|
@@ -2068,16 +2068,16 @@ var Jt = {
|
|
|
2068
2068
|
c.xGrid ? (_(!0), a(e, { key: 3 }, y(R.value, (e, t) => (_(), a("line", {
|
|
2069
2069
|
key: "xg" + t,
|
|
2070
2070
|
x1: e.x,
|
|
2071
|
-
y1:
|
|
2071
|
+
y1: x(U).top,
|
|
2072
2072
|
x2: e.x,
|
|
2073
|
-
y2:
|
|
2073
|
+
y2: x(U).top + x(K),
|
|
2074
2074
|
stroke: "currentColor",
|
|
2075
2075
|
"stroke-opacity": "0.1"
|
|
2076
2076
|
}, null, 8, on))), 128)) : i("", !0),
|
|
2077
2077
|
(_(!0), a(e, null, y(_e.value, (e, t) => (_(), a("text", {
|
|
2078
2078
|
key: "y" + t,
|
|
2079
2079
|
"data-testid": "y-tick",
|
|
2080
|
-
x:
|
|
2080
|
+
x: x(U).left - 6,
|
|
2081
2081
|
y: e.y,
|
|
2082
2082
|
"text-anchor": "end",
|
|
2083
2083
|
"dominant-baseline": "middle",
|
|
@@ -2090,7 +2090,7 @@ var Jt = {
|
|
|
2090
2090
|
key: 4,
|
|
2091
2091
|
x: 0,
|
|
2092
2092
|
y: 0,
|
|
2093
|
-
transform: `translate(14, ${
|
|
2093
|
+
transform: `translate(14, ${x(U).top + x(K) / 2}) rotate(-90)`,
|
|
2094
2094
|
"text-anchor": "middle",
|
|
2095
2095
|
"font-size": Xe.value.fontSize,
|
|
2096
2096
|
fill: Xe.value.fill,
|
|
@@ -2100,7 +2100,7 @@ var Jt = {
|
|
|
2100
2100
|
key: "x" + t,
|
|
2101
2101
|
"data-testid": "x-tick",
|
|
2102
2102
|
x: e.x,
|
|
2103
|
-
y:
|
|
2103
|
+
y: x(U).top + x(K) + 16,
|
|
2104
2104
|
"text-anchor": e.anchor,
|
|
2105
2105
|
"font-size": Y.value.fontSize,
|
|
2106
2106
|
fill: Y.value.fill,
|
|
@@ -2109,25 +2109,25 @@ var Jt = {
|
|
|
2109
2109
|
}, b(e.value), 9, ln))), 128)),
|
|
2110
2110
|
c.xLabel ? (_(), a("text", {
|
|
2111
2111
|
key: 5,
|
|
2112
|
-
x:
|
|
2113
|
-
y:
|
|
2112
|
+
x: x(U).left + x(G) / 2,
|
|
2113
|
+
y: x(Pe) - 4,
|
|
2114
2114
|
"text-anchor": "middle",
|
|
2115
2115
|
"font-size": Xe.value.fontSize,
|
|
2116
2116
|
fill: Xe.value.fill,
|
|
2117
2117
|
"font-weight": Xe.value.fontWeight
|
|
2118
2118
|
}, b(c.xLabel), 9, un)) : i("", !0),
|
|
2119
|
-
(_(!0), a(e, null, y(
|
|
2119
|
+
(_(!0), a(e, null, y(ae.value, (e, t) => (_(), a("path", {
|
|
2120
2120
|
key: "area" + t,
|
|
2121
|
-
d:
|
|
2121
|
+
d: de(e),
|
|
2122
2122
|
fill: e.color ?? "currentColor",
|
|
2123
2123
|
"fill-opacity": e.opacity ?? .2,
|
|
2124
2124
|
stroke: "none",
|
|
2125
2125
|
style: h(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
2126
2126
|
}, null, 12, dn))), 128)),
|
|
2127
|
-
(_(!0), a(e, null, y(
|
|
2127
|
+
(_(!0), a(e, null, y(D.value, (t, n) => (_(), a(e, { key: n }, [
|
|
2128
2128
|
t.line !== !1 && t.outline ? (_(), a("path", {
|
|
2129
2129
|
key: 0,
|
|
2130
|
-
d:
|
|
2130
|
+
d: le(t),
|
|
2131
2131
|
fill: "none",
|
|
2132
2132
|
stroke: t.outlineColor ?? "var(--color-bg-0, #fff)",
|
|
2133
2133
|
"stroke-width": (t.strokeWidth ?? 1.5) + (t.outlineWidth ?? 4),
|
|
@@ -2137,7 +2137,7 @@ var Jt = {
|
|
|
2137
2137
|
}, null, 8, fn)) : i("", !0),
|
|
2138
2138
|
t.line === !1 ? i("", !0) : (_(), a("path", {
|
|
2139
2139
|
key: 1,
|
|
2140
|
-
d:
|
|
2140
|
+
d: le(t),
|
|
2141
2141
|
fill: "none",
|
|
2142
2142
|
stroke: t.color ?? "currentColor",
|
|
2143
2143
|
"stroke-width": t.strokeWidth ?? 1.5,
|
|
@@ -2145,7 +2145,7 @@ var Jt = {
|
|
|
2145
2145
|
"stroke-dasharray": t.dashed ? "6 3" : void 0,
|
|
2146
2146
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2147
2147
|
}, null, 12, pn)),
|
|
2148
|
-
t.dots ? (_(!0), a(e, { key: 2 }, y(
|
|
2148
|
+
t.dots ? (_(!0), a(e, { key: 2 }, y(ue(t), (e, n) => (_(), a("circle", {
|
|
2149
2149
|
key: n,
|
|
2150
2150
|
cx: e.x,
|
|
2151
2151
|
cy: e.y,
|
|
@@ -2158,59 +2158,59 @@ var Jt = {
|
|
|
2158
2158
|
], 64))), 128)),
|
|
2159
2159
|
(_(!0), a(e, null, y(c.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
2160
2160
|
o("path", {
|
|
2161
|
-
d:
|
|
2162
|
-
fill: t.color ?? (t.seriesIndex == null ? "#999" :
|
|
2161
|
+
d: fe(t),
|
|
2162
|
+
fill: t.color ?? (t.seriesIndex == null ? "#999" : D.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
2163
2163
|
"fill-opacity": t.opacity ?? .15,
|
|
2164
2164
|
stroke: "none"
|
|
2165
|
-
}, null, 8,
|
|
2165
|
+
}, null, 8, hn),
|
|
2166
2166
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
2167
2167
|
key: 0,
|
|
2168
|
-
d:
|
|
2168
|
+
d: fe(t, !1),
|
|
2169
2169
|
fill: "none",
|
|
2170
|
-
stroke: t.color ??
|
|
2170
|
+
stroke: t.color ?? D.value[t.seriesIndex]?.color ?? "currentColor",
|
|
2171
2171
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2172
2172
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2173
|
-
}, null, 8,
|
|
2173
|
+
}, null, 8, $)),
|
|
2174
2174
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
2175
|
-
x1:
|
|
2176
|
-
y1:
|
|
2177
|
-
x2:
|
|
2178
|
-
y2:
|
|
2175
|
+
x1: x(L)(P(t, "start")),
|
|
2176
|
+
y1: x(U).top,
|
|
2177
|
+
x2: x(L)(P(t, "start")),
|
|
2178
|
+
y2: x(U).top + x(K),
|
|
2179
2179
|
stroke: t.color ?? "#999",
|
|
2180
2180
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2181
2181
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2182
2182
|
}, null, 8, gn), o("line", {
|
|
2183
|
-
x1:
|
|
2184
|
-
y1:
|
|
2185
|
-
x2:
|
|
2186
|
-
y2:
|
|
2183
|
+
x1: x(L)(P(t, "end")),
|
|
2184
|
+
y1: x(U).top,
|
|
2185
|
+
x2: x(L)(P(t, "end")),
|
|
2186
|
+
y2: x(U).top + x(K),
|
|
2187
2187
|
stroke: t.color ?? "#999",
|
|
2188
2188
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2189
2189
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2190
2190
|
}, null, 8, _n)], 64)) : i("", !0),
|
|
2191
2191
|
o("line", {
|
|
2192
|
-
x1:
|
|
2193
|
-
y1:
|
|
2194
|
-
x2:
|
|
2195
|
-
y2:
|
|
2192
|
+
x1: x(L)(P(t, "start")),
|
|
2193
|
+
y1: x(U).top + x(K) - 4,
|
|
2194
|
+
x2: x(L)(P(t, "start")),
|
|
2195
|
+
y2: x(U).top + x(K) + 4,
|
|
2196
2196
|
stroke: "currentColor",
|
|
2197
2197
|
"stroke-opacity": "0.4"
|
|
2198
2198
|
}, null, 8, vn),
|
|
2199
2199
|
o("line", {
|
|
2200
|
-
x1:
|
|
2201
|
-
y1:
|
|
2202
|
-
x2:
|
|
2203
|
-
y2:
|
|
2200
|
+
x1: x(L)(P(t, "end")),
|
|
2201
|
+
y1: x(U).top + x(K) - 4,
|
|
2202
|
+
x2: x(L)(P(t, "end")),
|
|
2203
|
+
y2: x(U).top + x(K) + 4,
|
|
2204
2204
|
stroke: "currentColor",
|
|
2205
2205
|
"stroke-opacity": "0.4"
|
|
2206
2206
|
}, null, 8, yn)
|
|
2207
2207
|
], 64))), 128)),
|
|
2208
|
-
B.value &&
|
|
2208
|
+
B.value && x(Le) !== null ? (_(), a("line", {
|
|
2209
2209
|
key: 6,
|
|
2210
|
-
x1:
|
|
2211
|
-
y1:
|
|
2212
|
-
x2:
|
|
2213
|
-
y2:
|
|
2210
|
+
x1: x(L)(De.value),
|
|
2211
|
+
y1: x(U).top,
|
|
2212
|
+
x2: x(L)(De.value),
|
|
2213
|
+
y2: x(U).top + x(K),
|
|
2214
2214
|
stroke: "currentColor",
|
|
2215
2215
|
"stroke-opacity": "0.3",
|
|
2216
2216
|
"stroke-dasharray": "4 2",
|
|
@@ -2228,23 +2228,23 @@ var Jt = {
|
|
|
2228
2228
|
}, null, 8, xn))), 128)),
|
|
2229
2229
|
B.value ? (_(), a("rect", d({
|
|
2230
2230
|
key: 7,
|
|
2231
|
-
x:
|
|
2232
|
-
y:
|
|
2233
|
-
width:
|
|
2234
|
-
height:
|
|
2231
|
+
x: x(U).left,
|
|
2232
|
+
y: x(U).top,
|
|
2233
|
+
width: x(G),
|
|
2234
|
+
height: x(K),
|
|
2235
2235
|
fill: "transparent",
|
|
2236
2236
|
style: {
|
|
2237
2237
|
cursor: "crosshair",
|
|
2238
2238
|
"touch-action": "pan-y"
|
|
2239
2239
|
}
|
|
2240
|
-
}, ne(
|
|
2241
|
-
c.annotations && c.annotations.length > 0 ? (_(), r(
|
|
2240
|
+
}, ne(x(Be), !0)), null, 16, Sn)) : i("", !0),
|
|
2241
|
+
c.annotations && c.annotations.length > 0 ? (_(), r(x(mt), {
|
|
2242
2242
|
key: 8,
|
|
2243
2243
|
annotations: c.annotations,
|
|
2244
2244
|
project: Ae,
|
|
2245
|
-
bounds:
|
|
2245
|
+
bounds: x(Ie)
|
|
2246
2246
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
2247
|
-
(_(!0), a(e, null, y(
|
|
2247
|
+
(_(!0), a(e, null, y(pe.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
2248
2248
|
o("circle", {
|
|
2249
2249
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
2250
2250
|
cy: I.value + e.row * kn + 4,
|
|
@@ -2273,7 +2273,7 @@ var Jt = {
|
|
|
2273
2273
|
}, b(e.descText), 9, Tn)) : i("", !0)
|
|
2274
2274
|
]))), 128))
|
|
2275
2275
|
], 8, Yt)),
|
|
2276
|
-
B.value &&
|
|
2276
|
+
B.value && x(Le) !== null && V.value ? (_(), a("div", {
|
|
2277
2277
|
key: 1,
|
|
2278
2278
|
ref_key: "tooltipRef",
|
|
2279
2279
|
ref: Re,
|
|
@@ -2283,8 +2283,8 @@ var Jt = {
|
|
|
2283
2283
|
top: "0",
|
|
2284
2284
|
left: "0",
|
|
2285
2285
|
willChange: "transform",
|
|
2286
|
-
transform:
|
|
2287
|
-
visibility:
|
|
2286
|
+
transform: x(ze) ? `translate3d(${x(ze).left}px, ${x(ze).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2287
|
+
visibility: x(ze) ? "visible" : "hidden"
|
|
2288
2288
|
})
|
|
2289
2289
|
}, [te(n.$slots, "tooltip", m(u(V.value)), () => [o("div", En, [V.value.xLabel ? (_(), a("div", Dn, b(V.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(V.value.values, (e) => (_(), a("div", {
|
|
2290
2290
|
key: e.seriesIndex,
|
|
@@ -2292,19 +2292,19 @@ var Jt = {
|
|
|
2292
2292
|
}, [o("span", {
|
|
2293
2293
|
class: "line-chart-tooltip-swatch",
|
|
2294
2294
|
style: h({ background: e.color })
|
|
2295
|
-
}, null, 4), s(" " + b(isFinite(e.value) ?
|
|
2296
|
-
|
|
2295
|
+
}, null, 4), s(" " + b(isFinite(e.value) ? x(C)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2296
|
+
x(He) ? (_(), a("a", {
|
|
2297
2297
|
key: 2,
|
|
2298
2298
|
class: "line-chart-download-link",
|
|
2299
|
-
href:
|
|
2300
|
-
download: `${
|
|
2301
|
-
}, b(
|
|
2302
|
-
|
|
2299
|
+
href: x(Ue),
|
|
2300
|
+
download: `${x(Ge)()}.csv`
|
|
2301
|
+
}, b(x(He)), 9, On)) : i("", !0),
|
|
2302
|
+
x(q) ? (_(), a("button", {
|
|
2303
2303
|
key: 3,
|
|
2304
2304
|
type: "button",
|
|
2305
2305
|
class: "line-chart-download-button",
|
|
2306
|
-
onClick: l[0] ||= (...e) =>
|
|
2307
|
-
}, b(
|
|
2306
|
+
onClick: l[0] ||= (...e) => x(We) && x(We)(...e)
|
|
2307
|
+
}, b(x(q)), 1)) : i("", !0)
|
|
2308
2308
|
], 16)], 8, ["to", "disabled"]));
|
|
2309
2309
|
}
|
|
2310
2310
|
}), [["__scopeId", "data-v-a3132bed"]]), Pn = {
|
|
@@ -2505,7 +2505,7 @@ var Jt = {
|
|
|
2505
2505
|
emits: ["hover"],
|
|
2506
2506
|
setup(c, { emit: l }) {
|
|
2507
2507
|
let f = c, p = n(() => f.ariaLabel ?? f.title), g = n(() => f.role ?? (p.value ? "img" : void 0)), ee = l, v = [];
|
|
2508
|
-
function
|
|
2508
|
+
function re(e) {
|
|
2509
2509
|
return {
|
|
2510
2510
|
data: e.y ?? e.data ?? v,
|
|
2511
2511
|
color: e.color,
|
|
@@ -2516,43 +2516,43 @@ var Jt = {
|
|
|
2516
2516
|
showInTooltip: e.showInTooltip
|
|
2517
2517
|
};
|
|
2518
2518
|
}
|
|
2519
|
-
let
|
|
2520
|
-
if (f.series && f.series.length > 0) return f.series.map(
|
|
2519
|
+
let S = n(() => {
|
|
2520
|
+
if (f.series && f.series.length > 0) return f.series.map(re);
|
|
2521
2521
|
let e = f.y ?? f.data;
|
|
2522
2522
|
return e ? [{ data: e }] : [];
|
|
2523
|
-
}),
|
|
2523
|
+
}), C = n(() => {
|
|
2524
2524
|
let e = f.categories?.length ?? 0;
|
|
2525
|
-
for (let t of
|
|
2525
|
+
for (let t of S.value) t.data.length > e && (e = t.data.length);
|
|
2526
2526
|
return e;
|
|
2527
|
-
}),
|
|
2528
|
-
let e =
|
|
2527
|
+
}), w = n(() => {
|
|
2528
|
+
let e = C.value, t = Array(e);
|
|
2529
2529
|
for (let n = 0; n < e; n++) {
|
|
2530
2530
|
let e = f.categories?.[n];
|
|
2531
2531
|
e instanceof Date ? t[n] = e.toISOString().slice(0, 10) : t[n] = e ?? String(n);
|
|
2532
2532
|
}
|
|
2533
2533
|
return t;
|
|
2534
|
-
}),
|
|
2534
|
+
}), T = n(() => {
|
|
2535
2535
|
let e = f.categories;
|
|
2536
2536
|
if (!e || e.length === 0 || !Lt(e, "utc")) return null;
|
|
2537
2537
|
let t = Array(e.length);
|
|
2538
2538
|
for (let n = 0; n < e.length; n++) t[n] = Ft(e[n], "utc") ?? NaN;
|
|
2539
2539
|
return t;
|
|
2540
|
-
}),
|
|
2540
|
+
}), E = n(() => f.orientation === "vertical"), D = n(() => {
|
|
2541
2541
|
let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
|
|
2542
2542
|
e > 0 && e < n && (n = e);
|
|
2543
2543
|
};
|
|
2544
2544
|
if (f.layout === "stacked") {
|
|
2545
|
-
let n =
|
|
2545
|
+
let n = C.value;
|
|
2546
2546
|
for (let i = 0; i < n; i++) {
|
|
2547
2547
|
let n = 0, a = 0;
|
|
2548
|
-
for (let e of
|
|
2548
|
+
for (let e of S.value) {
|
|
2549
2549
|
if (i >= e.data.length) continue;
|
|
2550
2550
|
let t = Number(e.data[i]);
|
|
2551
2551
|
isFinite(t) && (r(t), t >= 0 ? n += t : a += t);
|
|
2552
2552
|
}
|
|
2553
2553
|
n > t && (t = n), a < e && (e = a);
|
|
2554
2554
|
}
|
|
2555
|
-
} else for (let n of
|
|
2555
|
+
} else for (let n of S.value) for (let i of n.data) {
|
|
2556
2556
|
let n = Number(i);
|
|
2557
2557
|
isFinite(n) && (r(n), n < e && (e = n), n > t && (t = n));
|
|
2558
2558
|
}
|
|
@@ -2565,30 +2565,30 @@ var Jt = {
|
|
|
2565
2565
|
max: a.max,
|
|
2566
2566
|
range: a.max - a.min || 1
|
|
2567
2567
|
};
|
|
2568
|
-
}),
|
|
2569
|
-
let e =
|
|
2570
|
-
return e > 0 ?
|
|
2571
|
-
}),
|
|
2572
|
-
let e =
|
|
2568
|
+
}), ae = n(() => E.value ? U.value : W.value), O = n(() => E.value ? W.value : U.value), k = n(() => {
|
|
2569
|
+
let e = C.value;
|
|
2570
|
+
return e > 0 ? ae.value / e : 0;
|
|
2571
|
+
}), A = n(() => k.value * (1 - f.barPadding)), oe = n(() => {
|
|
2572
|
+
let e = S.value.length;
|
|
2573
2573
|
if (e === 0) return 0;
|
|
2574
|
-
if (f.layout === "stacked" || e === 1) return
|
|
2574
|
+
if (f.layout === "stacked" || e === 1) return A.value;
|
|
2575
2575
|
let t = f.groupGap * (e - 1);
|
|
2576
|
-
return Math.max(1, (
|
|
2576
|
+
return Math.max(1, (A.value - t) / e);
|
|
2577
2577
|
});
|
|
2578
|
-
function
|
|
2579
|
-
return (
|
|
2578
|
+
function j(e) {
|
|
2579
|
+
return (E.value ? H.value.left : H.value.top) + e * k.value;
|
|
2580
2580
|
}
|
|
2581
|
-
let
|
|
2582
|
-
let { min: e, max: t } =
|
|
2583
|
-
return
|
|
2581
|
+
let se = n(() => {
|
|
2582
|
+
let { min: e, max: t } = D.value, n = f.valueMin ?? 0;
|
|
2583
|
+
return M(Math.max(e, Math.min(t, n)));
|
|
2584
2584
|
});
|
|
2585
|
-
function
|
|
2586
|
-
let { min: t, max: n } =
|
|
2587
|
-
return
|
|
2585
|
+
function M(e) {
|
|
2586
|
+
let { min: t, max: n } = D.value, r = be(e, t, n, f.valueScaleType);
|
|
2587
|
+
return E.value ? H.value.top + W.value - r * W.value : H.value.left + r * U.value;
|
|
2588
2588
|
}
|
|
2589
|
-
function
|
|
2589
|
+
function ce(e, t, n, r, i, a, o, s, c, l) {
|
|
2590
2590
|
let u = Math.min(e, t), d = Math.abs(e - t);
|
|
2591
|
-
return
|
|
2591
|
+
return E.value ? {
|
|
2592
2592
|
x: n,
|
|
2593
2593
|
y: u,
|
|
2594
2594
|
w: r,
|
|
@@ -2612,34 +2612,34 @@ var Jt = {
|
|
|
2612
2612
|
seriesIndex: l
|
|
2613
2613
|
};
|
|
2614
2614
|
}
|
|
2615
|
-
let
|
|
2616
|
-
let e = [], t =
|
|
2615
|
+
let N = n(() => {
|
|
2616
|
+
let e = [], t = S.value, n = t.length;
|
|
2617
2617
|
if (n === 0) return e;
|
|
2618
|
-
let r =
|
|
2618
|
+
let r = C.value, i = k.value, a = A.value, o = oe.value, s = (i - a) / 2, c = se.value;
|
|
2619
2619
|
for (let i = 0; i < r; i++) {
|
|
2620
|
-
let r =
|
|
2620
|
+
let r = j(i) + s;
|
|
2621
2621
|
if (f.layout === "stacked") {
|
|
2622
2622
|
let o = 0, s = 0;
|
|
2623
2623
|
for (let c = 0; c < n; c++) {
|
|
2624
2624
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
2625
2625
|
if (!isFinite(l)) continue;
|
|
2626
2626
|
let u = l >= 0 ? o : s, d = u + l;
|
|
2627
|
-
e.push(
|
|
2627
|
+
e.push(ce(M(u), M(d), r, a, n.color ?? F(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
|
|
2628
2628
|
}
|
|
2629
2629
|
} else if (f.layout === "overlay") for (let o = 0; o < n; o++) {
|
|
2630
2630
|
let n = t[o], s = Number(n.data[i] ?? NaN);
|
|
2631
|
-
isFinite(s) && e.push(
|
|
2631
|
+
isFinite(s) && e.push(ce(c, M(s), r, a, n.color ?? F(o), n.opacity ?? 1, n.blendMode, s, i, o));
|
|
2632
2632
|
}
|
|
2633
2633
|
else for (let a = 0; a < n; a++) {
|
|
2634
2634
|
let s = t[a], l = Number(s.data[i] ?? NaN);
|
|
2635
2635
|
if (!isFinite(l)) continue;
|
|
2636
2636
|
let u = r + (n === 1 ? 0 : a * (o + f.groupGap));
|
|
2637
|
-
e.push(
|
|
2637
|
+
e.push(ce(c, M(l), u, o, s.color ?? F(a), s.opacity ?? 1, s.blendMode, l, i, a));
|
|
2638
2638
|
}
|
|
2639
2639
|
}
|
|
2640
2640
|
return e;
|
|
2641
2641
|
});
|
|
2642
|
-
function
|
|
2642
|
+
function le(e) {
|
|
2643
2643
|
let t = Infinity, n = -Infinity;
|
|
2644
2644
|
for (let r of e.data) {
|
|
2645
2645
|
let e = Number(r);
|
|
@@ -2650,9 +2650,9 @@ var Jt = {
|
|
|
2650
2650
|
max: n
|
|
2651
2651
|
};
|
|
2652
2652
|
}
|
|
2653
|
-
function
|
|
2654
|
-
let r = (
|
|
2655
|
-
return
|
|
2653
|
+
function ue(e, t, n) {
|
|
2654
|
+
let r = (E.value ? H.value.left : H.value.top) + (e + .5) * k.value, i = n.max - n.min || 1, a = (t - n.min) / i;
|
|
2655
|
+
return E.value ? {
|
|
2656
2656
|
x: r,
|
|
2657
2657
|
y: H.value.top + W.value - a * W.value
|
|
2658
2658
|
} : {
|
|
@@ -2660,23 +2660,23 @@ var Jt = {
|
|
|
2660
2660
|
y: r
|
|
2661
2661
|
};
|
|
2662
2662
|
}
|
|
2663
|
-
let
|
|
2663
|
+
let de = n(() => {
|
|
2664
2664
|
let e = f.summaryLines;
|
|
2665
2665
|
return !e || e.length === 0 ? [] : e.map((e, t) => ({
|
|
2666
2666
|
data: e.data ?? v,
|
|
2667
2667
|
x: e.x,
|
|
2668
|
-
color: e.color ??
|
|
2668
|
+
color: e.color ?? pe(t),
|
|
2669
2669
|
strokeWidth: e.strokeWidth ?? 2,
|
|
2670
2670
|
dashed: e.dashed ?? !1,
|
|
2671
2671
|
opacity: e.opacity ?? 1,
|
|
2672
2672
|
blendMode: e.blendMode,
|
|
2673
2673
|
dots: e.dots ?? !1,
|
|
2674
2674
|
dotRadius: e.dotRadius ?? (e.strokeWidth ?? 2) + 1,
|
|
2675
|
-
extent:
|
|
2675
|
+
extent: le(e),
|
|
2676
2676
|
legend: e.legend,
|
|
2677
2677
|
showInLegend: e.showInLegend !== !1
|
|
2678
2678
|
}));
|
|
2679
|
-
}),
|
|
2679
|
+
}), P = n(() => k.value === 0 ? [] : de.value.map((e) => {
|
|
2680
2680
|
let t = [], n = "", r = !1;
|
|
2681
2681
|
for (let i = 0; i < e.data.length; i++) {
|
|
2682
2682
|
let a = Number(e.data[i]), o = e.x ? Number(e.x[i]) : i;
|
|
@@ -2684,7 +2684,7 @@ var Jt = {
|
|
|
2684
2684
|
r = !1;
|
|
2685
2685
|
continue;
|
|
2686
2686
|
}
|
|
2687
|
-
let s =
|
|
2687
|
+
let s = ue(o, a, e.extent);
|
|
2688
2688
|
t.push(s), n += r ? `L${s.x},${s.y}` : `M${s.x},${s.y}`, r = !0;
|
|
2689
2689
|
}
|
|
2690
2690
|
return {
|
|
@@ -2692,16 +2692,16 @@ var Jt = {
|
|
|
2692
2692
|
pathD: n,
|
|
2693
2693
|
points: t
|
|
2694
2694
|
};
|
|
2695
|
-
})),
|
|
2695
|
+
})), fe = [
|
|
2696
2696
|
"var(--color-fg-1, #111)",
|
|
2697
2697
|
"var(--color-danger, #ef4444)",
|
|
2698
2698
|
"var(--color-success, #10b981)",
|
|
2699
2699
|
"var(--color-info, #6366f1)"
|
|
2700
2700
|
];
|
|
2701
|
-
function
|
|
2702
|
-
return
|
|
2701
|
+
function pe(e) {
|
|
2702
|
+
return fe[e % fe.length];
|
|
2703
2703
|
}
|
|
2704
|
-
let
|
|
2704
|
+
let me = [
|
|
2705
2705
|
"var(--color-primary, #3b82f6)",
|
|
2706
2706
|
"var(--color-accent, #f59e0b)",
|
|
2707
2707
|
"var(--color-success, #10b981)",
|
|
@@ -2709,16 +2709,16 @@ var Jt = {
|
|
|
2709
2709
|
"var(--color-info, #6366f1)",
|
|
2710
2710
|
"var(--color-warning, #d97706)"
|
|
2711
2711
|
];
|
|
2712
|
-
function
|
|
2713
|
-
return
|
|
2712
|
+
function F(e) {
|
|
2713
|
+
return me[e % me.length];
|
|
2714
2714
|
}
|
|
2715
2715
|
let he = vt(() => f.tooltipValueFormat, () => f.valueTickFormat), I = n(() => {
|
|
2716
|
-
let { min: e, max: t } =
|
|
2716
|
+
let { min: e, max: t } = D.value, n = (e) => f.valueTickFormat === void 0 ? z(e) : ie(e, f.valueTickFormat);
|
|
2717
2717
|
if (e === t) return [{
|
|
2718
2718
|
value: n(e),
|
|
2719
|
-
pos: L(
|
|
2719
|
+
pos: L(M(e))
|
|
2720
2720
|
}];
|
|
2721
|
-
let r =
|
|
2721
|
+
let r = E.value ? 50 : 80;
|
|
2722
2722
|
return (f.valueScaleType === "log" ? Se({
|
|
2723
2723
|
min: e,
|
|
2724
2724
|
max: t,
|
|
@@ -2727,18 +2727,18 @@ var Jt = {
|
|
|
2727
2727
|
min: e,
|
|
2728
2728
|
max: t,
|
|
2729
2729
|
ticks: f.valueTicks,
|
|
2730
|
-
targetTickCount:
|
|
2730
|
+
targetTickCount: O.value / r
|
|
2731
2731
|
})).map((e) => ({
|
|
2732
2732
|
value: n(e),
|
|
2733
|
-
pos: L(
|
|
2733
|
+
pos: L(M(e))
|
|
2734
2734
|
}));
|
|
2735
2735
|
}), _e = n(() => {
|
|
2736
|
-
let e =
|
|
2736
|
+
let e = C.value, t = T.value;
|
|
2737
2737
|
if (t && t.length > 0) {
|
|
2738
2738
|
let e = Infinity, n = -Infinity;
|
|
2739
2739
|
for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
|
|
2740
2740
|
if (!Number.isFinite(e) || e === n) return [];
|
|
2741
|
-
let r =
|
|
2741
|
+
let r = E.value ? U.value : W.value, i = Math.max(2, Math.floor(r / 80)), a = Vt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
|
|
2742
2742
|
for (let e of a.values) {
|
|
2743
2743
|
let n = -1, r = Infinity;
|
|
2744
2744
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -2747,7 +2747,7 @@ var Jt = {
|
|
|
2747
2747
|
}
|
|
2748
2748
|
if (n < 0 || c.has(n)) continue;
|
|
2749
2749
|
c.add(n);
|
|
2750
|
-
let i =
|
|
2750
|
+
let i = j(n) + k.value / 2, a = f.categoryFormat ? f.categoryFormat(w.value[n], n) : qt(t[n], f.dateFormat, "utc", o);
|
|
2751
2751
|
s.push({
|
|
2752
2752
|
label: a,
|
|
2753
2753
|
pos: i,
|
|
@@ -2757,10 +2757,10 @@ var Jt = {
|
|
|
2757
2757
|
return s;
|
|
2758
2758
|
}
|
|
2759
2759
|
let n = [], r = (e, t) => f.categoryFormat ? f.categoryFormat(e, t) : e, i = Array(e), a = 0;
|
|
2760
|
-
for (let t = 0; t < e; t++) i[t] = r(
|
|
2761
|
-
let o = f.tickLabelStyle?.fontSize ?? 10, s =
|
|
2760
|
+
for (let t = 0; t < e; t++) i[t] = r(w.value[t], t), i[t].length > a && (a = i[t].length);
|
|
2761
|
+
let o = f.tickLabelStyle?.fontSize ?? 10, s = E.value ? a * o * .6 + 8 : o * 1.2 + 8, c = k.value > 0 ? Math.max(1, Math.ceil(s / k.value)) : 1;
|
|
2762
2762
|
for (let t = 0; t < e; t += c) {
|
|
2763
|
-
let e =
|
|
2763
|
+
let e = j(t) + k.value / 2;
|
|
2764
2764
|
n.push({
|
|
2765
2765
|
label: i[t],
|
|
2766
2766
|
pos: e,
|
|
@@ -2770,13 +2770,13 @@ var Jt = {
|
|
|
2770
2770
|
return n;
|
|
2771
2771
|
}), ve = n(() => {
|
|
2772
2772
|
let e = [];
|
|
2773
|
-
return
|
|
2773
|
+
return S.value.forEach((t, n) => {
|
|
2774
2774
|
!t.legend || t.showInLegend === !1 || e.push({
|
|
2775
2775
|
label: t.legend,
|
|
2776
|
-
color: t.color ??
|
|
2776
|
+
color: t.color ?? F(n),
|
|
2777
2777
|
kind: "bar"
|
|
2778
2778
|
});
|
|
2779
|
-
}),
|
|
2779
|
+
}), de.value.forEach((t) => {
|
|
2780
2780
|
!t.legend || !t.showInLegend || e.push({
|
|
2781
2781
|
label: t.legend,
|
|
2782
2782
|
color: t.color,
|
|
@@ -2788,17 +2788,17 @@ var Jt = {
|
|
|
2788
2788
|
function Ce() {
|
|
2789
2789
|
if (typeof f.csv == "function") return f.csv();
|
|
2790
2790
|
if (typeof f.csv == "string") return f.csv;
|
|
2791
|
-
let e =
|
|
2791
|
+
let e = S.value.map((e) => ({
|
|
2792
2792
|
label: e.legend,
|
|
2793
2793
|
data: e.data
|
|
2794
2794
|
}));
|
|
2795
|
-
return Je(
|
|
2795
|
+
return Je(w.value, e);
|
|
2796
2796
|
}
|
|
2797
2797
|
let B = n(() => !!f.tooltipData || !!f.tooltipTrigger);
|
|
2798
2798
|
function Ee(e, t) {
|
|
2799
|
-
if (!isFinite(e) || !isFinite(t) ||
|
|
2800
|
-
let n = (
|
|
2801
|
-
return
|
|
2799
|
+
if (!isFinite(e) || !isFinite(t) || k.value === 0) return null;
|
|
2800
|
+
let n = (E.value ? H.value.left : H.value.top) + (e + .5) * k.value, r = M(t);
|
|
2801
|
+
return E.value ? {
|
|
2802
2802
|
x: n,
|
|
2803
2803
|
y: r
|
|
2804
2804
|
} : {
|
|
@@ -2809,10 +2809,10 @@ var Jt = {
|
|
|
2809
2809
|
function De(e, t) {
|
|
2810
2810
|
let n = V.value?.getBoundingClientRect();
|
|
2811
2811
|
if (!n) return null;
|
|
2812
|
-
let r =
|
|
2813
|
-
if (r === 0 ||
|
|
2814
|
-
let i =
|
|
2815
|
-
return Math.max(0, Math.min(r - 1, Math.floor(i /
|
|
2812
|
+
let r = C.value;
|
|
2813
|
+
if (r === 0 || k.value === 0) return null;
|
|
2814
|
+
let i = E.value ? e - n.left - H.value.left : t - n.top - H.value.top;
|
|
2815
|
+
return Math.max(0, Math.min(r - 1, Math.floor(i / k.value)));
|
|
2816
2816
|
}
|
|
2817
2817
|
let Oe = n(() => !!(f.categoryHeader || f.valueHeader)), ke = n(() => {
|
|
2818
2818
|
let e = Oe.value ? sr : 0, t = f.chartPadding;
|
|
@@ -2845,12 +2845,12 @@ var Jt = {
|
|
|
2845
2845
|
hasTooltipSlot: () => B.value,
|
|
2846
2846
|
getCsv: Ce,
|
|
2847
2847
|
pointerToIndex: De,
|
|
2848
|
-
scrubAxis: () =>
|
|
2848
|
+
scrubAxis: () => E.value ? "x" : "y",
|
|
2849
2849
|
onHover: (e) => ee("hover", e)
|
|
2850
2850
|
}), qe = n(() => Te(f.axisLabelStyle, { fontSize: 13 })), J = n(() => Te(f.tickLabelStyle, {
|
|
2851
2851
|
fontSize: 10,
|
|
2852
2852
|
fillOpacity: we
|
|
2853
|
-
})), Ye = n(() => Te(f.legendStyle, { fontSize: 11 })), Xe = n(() => f.categoryAlign === "start" && !
|
|
2853
|
+
})), Ye = n(() => Te(f.legendStyle, { fontSize: 11 })), Xe = n(() => f.categoryAlign === "start" && !E.value ? cr : H.value.left), Y = n(() => {
|
|
2854
2854
|
let e = f.titleStyle, t = e?.align ?? "left", n = Fe.value, r = t === "left" ? Xe.value : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
2855
2855
|
return {
|
|
2856
2856
|
lines: (f.title ?? "").split("\n"),
|
|
@@ -2864,40 +2864,40 @@ var Jt = {
|
|
|
2864
2864
|
}), Ze = n(() => {
|
|
2865
2865
|
let e = G.value;
|
|
2866
2866
|
if (e === null) return;
|
|
2867
|
-
let t =
|
|
2868
|
-
return t && Number.isFinite(t[e]) ? qt(t[e], f.dateFormat, "utc") :
|
|
2867
|
+
let t = T.value;
|
|
2868
|
+
return t && Number.isFinite(t[e]) ? qt(t[e], f.dateFormat, "utc") : w.value[e];
|
|
2869
2869
|
}), X = n(() => {
|
|
2870
2870
|
let e = G.value;
|
|
2871
2871
|
if (e === null) return null;
|
|
2872
|
-
let t =
|
|
2872
|
+
let t = S.value, n = [];
|
|
2873
2873
|
for (let r = 0; r < t.length; r++) {
|
|
2874
2874
|
let i = t[r];
|
|
2875
2875
|
i.showInTooltip !== !1 && n.push({
|
|
2876
2876
|
value: Number(i.data[e] ?? NaN),
|
|
2877
|
-
color: i.color ??
|
|
2877
|
+
color: i.color ?? F(r),
|
|
2878
2878
|
seriesIndex: r
|
|
2879
2879
|
});
|
|
2880
2880
|
}
|
|
2881
2881
|
return {
|
|
2882
2882
|
index: e,
|
|
2883
|
-
category:
|
|
2883
|
+
category: w.value[e] ?? String(e),
|
|
2884
2884
|
values: n,
|
|
2885
2885
|
data: f.tooltipData?.[e] ?? null
|
|
2886
2886
|
};
|
|
2887
2887
|
}), Qe = n(() => {
|
|
2888
2888
|
let e = G.value;
|
|
2889
2889
|
if (e === null) return null;
|
|
2890
|
-
let t =
|
|
2891
|
-
return
|
|
2890
|
+
let t = j(e);
|
|
2891
|
+
return E.value ? {
|
|
2892
2892
|
x: t,
|
|
2893
2893
|
y: H.value.top,
|
|
2894
|
-
w:
|
|
2894
|
+
w: k.value,
|
|
2895
2895
|
h: W.value
|
|
2896
2896
|
} : {
|
|
2897
2897
|
x: H.value.left,
|
|
2898
2898
|
y: t,
|
|
2899
2899
|
w: U.value,
|
|
2900
|
-
h:
|
|
2900
|
+
h: k.value
|
|
2901
2901
|
};
|
|
2902
2902
|
}), $e = n(() => {
|
|
2903
2903
|
let e = Pe.value.positions, t = Xe.value, n = Ne.value;
|
|
@@ -2926,11 +2926,11 @@ var Jt = {
|
|
|
2926
2926
|
});
|
|
2927
2927
|
function tt(e, t) {
|
|
2928
2928
|
let n = et.value?.format;
|
|
2929
|
-
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ? z(e) :
|
|
2929
|
+
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ? z(e) : ie(e, f.valueTickFormat) : ie(e, n);
|
|
2930
2930
|
}
|
|
2931
2931
|
function nt(e, t, n) {
|
|
2932
|
-
for (let r =
|
|
2933
|
-
let i =
|
|
2932
|
+
for (let r = N.value.length - 1; r >= 0; r--) {
|
|
2933
|
+
let i = N.value[r];
|
|
2934
2934
|
if (i.categoryIndex === e && t >= i.x && t <= i.x + i.w && n >= i.y && n <= i.y + i.h) return i.color;
|
|
2935
2935
|
}
|
|
2936
2936
|
return null;
|
|
@@ -2938,13 +2938,13 @@ var Jt = {
|
|
|
2938
2938
|
let rt = n(() => {
|
|
2939
2939
|
let e = et.value;
|
|
2940
2940
|
if (!e) return [];
|
|
2941
|
-
let t =
|
|
2942
|
-
for (let i of
|
|
2941
|
+
let t = E.value, n = e.fontSize, r = [];
|
|
2942
|
+
for (let i of N.value) {
|
|
2943
2943
|
let a = tt(i.value, {
|
|
2944
2944
|
value: i.value,
|
|
2945
2945
|
categoryIndex: i.categoryIndex,
|
|
2946
2946
|
seriesIndex: i.seriesIndex,
|
|
2947
|
-
category:
|
|
2947
|
+
category: w.value[i.categoryIndex] ?? String(i.categoryIndex)
|
|
2948
2948
|
});
|
|
2949
2949
|
if (!a) continue;
|
|
2950
2950
|
let o = t ? i.h : i.w, s = a.length * n * ur, c = o >= s + 2 * dr && o >= e.minSize, l = e.placement === "inside" ? !0 : e.placement === "outside" ? !1 : c, u, d, f, p = "middle", m = t ? -i.y : i.x + i.w, h = t ? -(i.y + i.h) : i.x, g = t ? n : s;
|
|
@@ -3040,7 +3040,7 @@ var Jt = {
|
|
|
3040
3040
|
y: t,
|
|
3041
3041
|
anchor: "start"
|
|
3042
3042
|
}), f.categoryHeader) {
|
|
3043
|
-
let n = !
|
|
3043
|
+
let n = !E.value, r = it.value;
|
|
3044
3044
|
e.push({
|
|
3045
3045
|
key: "ch",
|
|
3046
3046
|
text: f.categoryHeader,
|
|
@@ -3052,31 +3052,31 @@ var Jt = {
|
|
|
3052
3052
|
return e;
|
|
3053
3053
|
});
|
|
3054
3054
|
return (n, l) => (_(), r(t, {
|
|
3055
|
-
to:
|
|
3056
|
-
disabled: !
|
|
3055
|
+
to: x(Ge),
|
|
3056
|
+
disabled: !x(q)
|
|
3057
3057
|
}, [o("div", d({
|
|
3058
3058
|
ref_key: "containerRef",
|
|
3059
3059
|
ref: V
|
|
3060
3060
|
}, n.$attrs, {
|
|
3061
|
-
class: ["bar-chart-wrapper", { "is-fullscreen":
|
|
3062
|
-
style:
|
|
3061
|
+
class: ["bar-chart-wrapper", { "is-fullscreen": x(q) }],
|
|
3062
|
+
style: x(We)
|
|
3063
3063
|
}), [
|
|
3064
3064
|
c.menu ? (_(), r(ge, {
|
|
3065
3065
|
key: 0,
|
|
3066
|
-
items:
|
|
3067
|
-
"is-fullscreen":
|
|
3068
|
-
onClose:
|
|
3066
|
+
items: x(Re),
|
|
3067
|
+
"is-fullscreen": x(q),
|
|
3068
|
+
onClose: x(Ke)
|
|
3069
3069
|
}, null, 8, [
|
|
3070
3070
|
"items",
|
|
3071
3071
|
"is-fullscreen",
|
|
3072
3072
|
"onClose"
|
|
3073
3073
|
])) : i("", !0),
|
|
3074
|
-
o("div", Pn, b(
|
|
3074
|
+
o("div", Pn, b(x(q) ? "Chart expanded to fill window" : ""), 1),
|
|
3075
3075
|
(_(), a("svg", {
|
|
3076
3076
|
ref_key: "svgRef",
|
|
3077
3077
|
ref: Ae,
|
|
3078
|
-
width:
|
|
3079
|
-
height:
|
|
3078
|
+
width: x(je),
|
|
3079
|
+
height: x(Me),
|
|
3080
3080
|
role: g.value || void 0,
|
|
3081
3081
|
"aria-label": p.value || void 0
|
|
3082
3082
|
}, [
|
|
@@ -3126,30 +3126,30 @@ var Jt = {
|
|
|
3126
3126
|
fill: Ye.value.fill,
|
|
3127
3127
|
"font-weight": Ye.value.fontWeight
|
|
3128
3128
|
}, b(t.label), 9, Hn)], 64))), 128))])) : i("", !0),
|
|
3129
|
-
!
|
|
3129
|
+
!E.value || c.valueAxis ? (_(), a("line", {
|
|
3130
3130
|
key: 2,
|
|
3131
|
-
x1:
|
|
3132
|
-
y1:
|
|
3133
|
-
x2:
|
|
3134
|
-
y2:
|
|
3131
|
+
x1: x(L)(x(H).left),
|
|
3132
|
+
y1: x(L)(x(H).top),
|
|
3133
|
+
x2: x(L)(x(H).left),
|
|
3134
|
+
y2: x(L)(x(H).top + x(W)),
|
|
3135
3135
|
stroke: "currentColor",
|
|
3136
3136
|
"stroke-opacity": "0.3"
|
|
3137
3137
|
}, null, 8, Un)) : i("", !0),
|
|
3138
|
-
|
|
3138
|
+
E.value || c.valueAxis ? (_(), a("line", {
|
|
3139
3139
|
key: 3,
|
|
3140
|
-
x1:
|
|
3141
|
-
y1:
|
|
3142
|
-
x2:
|
|
3143
|
-
y2:
|
|
3140
|
+
x1: x(L)(x(H).left),
|
|
3141
|
+
y1: x(L)(x(H).top + x(W)),
|
|
3142
|
+
x2: x(L)(x(H).left + x(U)),
|
|
3143
|
+
y2: x(L)(x(H).top + x(W)),
|
|
3144
3144
|
stroke: "currentColor",
|
|
3145
3145
|
"stroke-opacity": "0.3"
|
|
3146
3146
|
}, null, 8, Wn)) : i("", !0),
|
|
3147
3147
|
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(I.value, (e, t) => (_(), a("line", {
|
|
3148
3148
|
key: "vg" + t,
|
|
3149
|
-
x1:
|
|
3150
|
-
y1:
|
|
3151
|
-
x2:
|
|
3152
|
-
y2:
|
|
3149
|
+
x1: E.value ? x(H).left : e.pos,
|
|
3150
|
+
y1: E.value ? e.pos : x(H).top,
|
|
3151
|
+
x2: E.value ? x(H).left + x(U) : e.pos,
|
|
3152
|
+
y2: E.value ? e.pos : x(H).top + x(W),
|
|
3153
3153
|
stroke: "currentColor",
|
|
3154
3154
|
"stroke-opacity": "0.1"
|
|
3155
3155
|
}, null, 8, Gn))), 128)) : i("", !0),
|
|
@@ -3163,10 +3163,10 @@ var Jt = {
|
|
|
3163
3163
|
"fill-opacity": "0.06",
|
|
3164
3164
|
"pointer-events": "none"
|
|
3165
3165
|
}, null, 8, Kn)) : i("", !0),
|
|
3166
|
-
c.valueAxis &&
|
|
3166
|
+
c.valueAxis && E.value ? (_(!0), a(e, { key: 6 }, y(I.value, (e, t) => (_(), a("text", {
|
|
3167
3167
|
key: "vt" + t,
|
|
3168
3168
|
"data-testid": "value-tick",
|
|
3169
|
-
x:
|
|
3169
|
+
x: x(H).left - 6,
|
|
3170
3170
|
y: e.pos,
|
|
3171
3171
|
"text-anchor": "end",
|
|
3172
3172
|
"dominant-baseline": "middle",
|
|
@@ -3178,7 +3178,7 @@ var Jt = {
|
|
|
3178
3178
|
key: "vt" + t,
|
|
3179
3179
|
"data-testid": "value-tick",
|
|
3180
3180
|
x: e.pos,
|
|
3181
|
-
y:
|
|
3181
|
+
y: x(H).top + x(W) + 16,
|
|
3182
3182
|
"text-anchor": "middle",
|
|
3183
3183
|
"font-size": J.value.fontSize,
|
|
3184
3184
|
fill: J.value.fill,
|
|
@@ -3189,17 +3189,17 @@ var Jt = {
|
|
|
3189
3189
|
key: 8,
|
|
3190
3190
|
x: 0,
|
|
3191
3191
|
y: 0,
|
|
3192
|
-
transform: `translate(14, ${
|
|
3192
|
+
transform: `translate(14, ${x(H).top + x(W) / 2}) rotate(-90)`,
|
|
3193
3193
|
"text-anchor": "middle",
|
|
3194
3194
|
"font-size": qe.value.fontSize,
|
|
3195
3195
|
fill: qe.value.fill,
|
|
3196
3196
|
"font-weight": qe.value.fontWeight
|
|
3197
3197
|
}, b(c.yLabel), 9, Yn)) : i("", !0),
|
|
3198
|
-
|
|
3198
|
+
E.value ? (_(!0), a(e, { key: 9 }, y(_e.value, (e, t) => (_(), a("text", {
|
|
3199
3199
|
key: "ct" + t,
|
|
3200
3200
|
"data-testid": "category-tick",
|
|
3201
3201
|
x: e.pos,
|
|
3202
|
-
y:
|
|
3202
|
+
y: x(H).top + x(W) + 16,
|
|
3203
3203
|
"text-anchor": e.anchor,
|
|
3204
3204
|
"font-size": J.value.fontSize,
|
|
3205
3205
|
fill: J.value.fill,
|
|
@@ -3219,14 +3219,14 @@ var Jt = {
|
|
|
3219
3219
|
}, b(e.label), 9, Zn))), 128)),
|
|
3220
3220
|
c.xLabel ? (_(), a("text", {
|
|
3221
3221
|
key: 11,
|
|
3222
|
-
x:
|
|
3223
|
-
y:
|
|
3222
|
+
x: x(H).left + x(U) / 2,
|
|
3223
|
+
y: x(Me) - 4,
|
|
3224
3224
|
"text-anchor": "middle",
|
|
3225
3225
|
"font-size": qe.value.fontSize,
|
|
3226
3226
|
fill: qe.value.fill,
|
|
3227
3227
|
"font-weight": qe.value.fontWeight
|
|
3228
3228
|
}, b(c.xLabel), 9, Qn)) : i("", !0),
|
|
3229
|
-
(_(!0), a(e, null, y(
|
|
3229
|
+
(_(!0), a(e, null, y(N.value, (e, t) => (_(), a("rect", {
|
|
3230
3230
|
key: "bar" + t,
|
|
3231
3231
|
"data-testid": "bar",
|
|
3232
3232
|
"data-category": e.categoryIndex,
|
|
@@ -3251,7 +3251,7 @@ var Jt = {
|
|
|
3251
3251
|
fill: e.fill,
|
|
3252
3252
|
"pointer-events": "none"
|
|
3253
3253
|
}, b(e.text), 9, er))), 128)),
|
|
3254
|
-
(_(!0), a(e, null, y(
|
|
3254
|
+
(_(!0), a(e, null, y(P.value, (t, n) => (_(), a(e, { key: "sl" + n }, [t.pathD ? (_(), a("path", {
|
|
3255
3255
|
key: 0,
|
|
3256
3256
|
"data-testid": "summary-line",
|
|
3257
3257
|
d: t.pathD,
|
|
@@ -3274,21 +3274,21 @@ var Jt = {
|
|
|
3274
3274
|
}, null, 12, nr))), 128)) : i("", !0)], 64))), 128)),
|
|
3275
3275
|
B.value ? (_(), a("rect", d({
|
|
3276
3276
|
key: 12,
|
|
3277
|
-
x:
|
|
3278
|
-
y:
|
|
3279
|
-
width:
|
|
3280
|
-
height:
|
|
3277
|
+
x: x(H).left,
|
|
3278
|
+
y: x(H).top,
|
|
3279
|
+
width: x(U),
|
|
3280
|
+
height: x(W),
|
|
3281
3281
|
fill: "transparent",
|
|
3282
|
-
style: `cursor: crosshair; touch-action: ${
|
|
3283
|
-
}, ne(
|
|
3284
|
-
c.annotations && c.annotations.length > 0 ? (_(), r(
|
|
3282
|
+
style: `cursor: crosshair; touch-action: ${E.value ? "pan-y" : "pan-x"}`
|
|
3283
|
+
}, ne(x(Le), !0)), null, 16, rr)) : i("", !0),
|
|
3284
|
+
c.annotations && c.annotations.length > 0 ? (_(), r(x(mt), {
|
|
3285
3285
|
key: 13,
|
|
3286
3286
|
annotations: c.annotations,
|
|
3287
3287
|
project: Ee,
|
|
3288
|
-
bounds:
|
|
3288
|
+
bounds: x(Fe)
|
|
3289
3289
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
3290
3290
|
], 8, Fn)),
|
|
3291
|
-
B.value &&
|
|
3291
|
+
B.value && x(G) !== null && X.value ? (_(), a("div", {
|
|
3292
3292
|
key: 1,
|
|
3293
3293
|
ref_key: "tooltipRef",
|
|
3294
3294
|
ref: K,
|
|
@@ -3298,8 +3298,8 @@ var Jt = {
|
|
|
3298
3298
|
top: "0",
|
|
3299
3299
|
left: "0",
|
|
3300
3300
|
willChange: "transform",
|
|
3301
|
-
transform:
|
|
3302
|
-
visibility:
|
|
3301
|
+
transform: x(Ie) ? `translate3d(${x(Ie).left}px, ${x(Ie).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
3302
|
+
visibility: x(Ie) ? "visible" : "hidden"
|
|
3303
3303
|
})
|
|
3304
3304
|
}, [te(n.$slots, "tooltip", m(u(X.value)), () => [o("div", ir, [Ze.value ? (_(), a("div", ar, b(Ze.value), 1)) : i("", !0), (_(!0), a(e, null, y(X.value.values, (e) => (_(), a("div", {
|
|
3305
3305
|
key: e.seriesIndex,
|
|
@@ -3307,19 +3307,19 @@ var Jt = {
|
|
|
3307
3307
|
}, [o("span", {
|
|
3308
3308
|
class: "bar-chart-tooltip-swatch",
|
|
3309
3309
|
style: h({ background: e.color })
|
|
3310
|
-
}, null, 4), s(" " + b(isFinite(e.value) ?
|
|
3311
|
-
|
|
3310
|
+
}, null, 4), s(" " + b(isFinite(e.value) ? x(he)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
3311
|
+
x(ze) ? (_(), a("a", {
|
|
3312
3312
|
key: 2,
|
|
3313
3313
|
class: "bar-chart-download-link",
|
|
3314
|
-
href:
|
|
3315
|
-
download: `${
|
|
3316
|
-
}, b(
|
|
3317
|
-
|
|
3314
|
+
href: x(Be),
|
|
3315
|
+
download: `${x(Ue)()}.csv`
|
|
3316
|
+
}, b(x(ze)), 9, or)) : i("", !0),
|
|
3317
|
+
x(Ve) ? (_(), a("button", {
|
|
3318
3318
|
key: 3,
|
|
3319
3319
|
type: "button",
|
|
3320
3320
|
class: "bar-chart-download-button",
|
|
3321
|
-
onClick: l[0] ||= (...e) =>
|
|
3322
|
-
}, b(
|
|
3321
|
+
onClick: l[0] ||= (...e) => x(He) && x(He)(...e)
|
|
3322
|
+
}, b(x(Ve)), 1)) : i("", !0)
|
|
3323
3323
|
], 16)], 8, ["to", "disabled"]));
|
|
3324
3324
|
}
|
|
3325
3325
|
}), [["__scopeId", "data-v-251f7945"]]), mr = {
|
|
@@ -3337,7 +3337,7 @@ var Jt = {
|
|
|
3337
3337
|
}, hr = /* @__PURE__ */ l({
|
|
3338
3338
|
__name: "ChoroplethTooltip",
|
|
3339
3339
|
setup(e, { expose: n }) {
|
|
3340
|
-
let a = v(null), s =
|
|
3340
|
+
let a = v(null), s = C("root");
|
|
3341
3341
|
return n({
|
|
3342
3342
|
setData(e) {
|
|
3343
3343
|
a.value = e;
|
|
@@ -3362,7 +3362,7 @@ var Jt = {
|
|
|
3362
3362
|
}, xr = { class: "choropleth-legend-ticks" }, Sr = {
|
|
3363
3363
|
key: 2,
|
|
3364
3364
|
class: "choropleth-zoom-hint"
|
|
3365
|
-
}, Cr = ["viewBox"], wr = ["innerHTML"], Tr = "http://www.w3.org/2000/svg", Er = 10, Dr = 600, Or = 250, kr = 450, Ar = 2, jr = 2, Mr = 1e3, Nr = 12, Pr = /* @__PURE__ */ I(/* @__PURE__ */ l({
|
|
3365
|
+
}, Cr = ["viewBox"], wr = ["innerHTML"], Tr = "http://www.w3.org/2000/svg", Er = 10, Dr = 600, Or = 250, kr = 450, Ar = 2, jr = 2, Mr = 1e3, Nr = 12, Pr = "light-dark(#000, #fff)", Fr = /* @__PURE__ */ I(/* @__PURE__ */ l({
|
|
3366
3366
|
inheritAttrs: !1,
|
|
3367
3367
|
__name: "ChoroplethMap",
|
|
3368
3368
|
props: {
|
|
@@ -3422,7 +3422,7 @@ var Jt = {
|
|
|
3422
3422
|
"update:focus"
|
|
3423
3423
|
],
|
|
3424
3424
|
setup(c, { emit: l }) {
|
|
3425
|
-
let p = c, ne = n(() => p.ariaLabel ?? p.title),
|
|
3425
|
+
let p = c, ne = n(() => p.ariaLabel ?? p.title), C = n(() => p.role ?? (ne.value ? "figure" : void 0)), E = l, D = (e) => e, ae = v(null), O = v(null), k = v(null), A = v(null), oe = v(null), j = v(null), se = S(), F = n(() => !!p.tooltipTrigger || !!p.tooltipFormat || !!se.tooltip), he = n(() => {
|
|
3426
3426
|
let e = p.legendStyle, t = {};
|
|
3427
3427
|
return e?.fontSize != null && (t["font-size"] = `${e.fontSize}px`), e?.fontWeight != null && (t["font-weight"] = String(e.fontWeight)), e?.color != null && (t.color = e.color), t;
|
|
3428
3428
|
}), I = n(() => {
|
|
@@ -3439,22 +3439,22 @@ var Jt = {
|
|
|
3439
3439
|
height: 0
|
|
3440
3440
|
}, Ce = null, we = !1, B = null, Te = v(!1), Ee = v(1), De = v(1), Oe = v(!1), ke = v(!1), V = n(() => Oe.value || ke.value), Ae = n(() => p.zoomMode === "scroll"), je = n(() => p.zoom && (Ae.value || !p.touchExpand && V.value)), Me = 0, Ne = 0, Pe = 0, U = null, W = 0;
|
|
3441
3441
|
function Fe() {
|
|
3442
|
-
let e =
|
|
3443
|
-
!e || !t || (e.addEventListener("touchstart",
|
|
3442
|
+
let e = O.value, t = k.value;
|
|
3443
|
+
!e || !t || (e.addEventListener("touchstart", en, { passive: !0 }), e.addEventListener("touchend", tn), e.addEventListener("touchcancel", nn, { passive: !0 }), !q() && (t.addEventListener("click", Zt), t.addEventListener("mouseover", Zt), t.addEventListener("mousemove", Qt), t.addEventListener("mouseout", $t)));
|
|
3444
3444
|
}
|
|
3445
3445
|
function G() {
|
|
3446
|
-
let e =
|
|
3447
|
-
e && (e.removeEventListener("touchstart",
|
|
3446
|
+
let e = O.value, t = k.value;
|
|
3447
|
+
e && (e.removeEventListener("touchstart", en), e.removeEventListener("touchend", tn), e.removeEventListener("touchcancel", nn)), t && (t.removeEventListener("click", Zt), t.removeEventListener("mouseover", Zt), t.removeEventListener("mousemove", Qt), t.removeEventListener("mouseout", $t));
|
|
3448
3448
|
}
|
|
3449
3449
|
function Le() {
|
|
3450
|
-
|
|
3450
|
+
Jt();
|
|
3451
3451
|
}
|
|
3452
3452
|
let Re = null;
|
|
3453
3453
|
g(() => {
|
|
3454
|
-
ze(), Fe(),
|
|
3454
|
+
ze(), Fe(), an(), Ge(), Lt(), O.value && typeof ResizeObserver < "u" && (Re = new ResizeObserver((e) => {
|
|
3455
3455
|
let t = e[0]?.contentRect.width;
|
|
3456
|
-
t && (De.value = t / Mr,
|
|
3457
|
-
}), Re.observe(
|
|
3456
|
+
t && (De.value = t / Mr, Wt());
|
|
3457
|
+
}), Re.observe(O.value)), window.addEventListener("scroll", Le, {
|
|
3458
3458
|
passive: !0,
|
|
3459
3459
|
capture: !0
|
|
3460
3460
|
}), window.addEventListener("resize", Le, { passive: !0 });
|
|
@@ -3462,14 +3462,14 @@ var Jt = {
|
|
|
3462
3462
|
xe?.disconnect(), Re?.disconnect(), Pe && cancelAnimationFrame(Pe), window.clearTimeout(W), Be(), G(), window.removeEventListener("scroll", Le, { capture: !0 }), window.removeEventListener("resize", Le);
|
|
3463
3463
|
});
|
|
3464
3464
|
function ze() {
|
|
3465
|
-
if (!
|
|
3466
|
-
let e =
|
|
3467
|
-
B =
|
|
3468
|
-
be = !0,
|
|
3465
|
+
if (!O.value || !k.value) return;
|
|
3466
|
+
let e = P(O.value);
|
|
3467
|
+
B = le().scaleExtent([1, Je.value]).on("start", () => {
|
|
3468
|
+
be = !0, Jt();
|
|
3469
3469
|
}).on("zoom", (e) => {
|
|
3470
|
-
|
|
3470
|
+
k.value && k.value.setAttribute("transform", e.transform);
|
|
3471
3471
|
let t = e.transform;
|
|
3472
|
-
Ee.value = t.k,
|
|
3472
|
+
Ee.value = t.k, Wt(), Te.value = t.k !== 1 || t.x !== 0 || t.y !== 0, Te.value && (Oe.value = !0);
|
|
3473
3473
|
}).on("end", () => {
|
|
3474
3474
|
be = !1;
|
|
3475
3475
|
}), B.filter((e) => {
|
|
@@ -3495,7 +3495,7 @@ var Jt = {
|
|
|
3495
3495
|
}), e.call(B);
|
|
3496
3496
|
}
|
|
3497
3497
|
function Be() {
|
|
3498
|
-
|
|
3498
|
+
O.value && B && (P(O.value).on(".zoom", null), B = null);
|
|
3499
3499
|
}
|
|
3500
3500
|
function Ve(e) {
|
|
3501
3501
|
let t = St.value, n = vt.value, r = [];
|
|
@@ -3523,33 +3523,36 @@ var Jt = {
|
|
|
3523
3523
|
}
|
|
3524
3524
|
let We = !1;
|
|
3525
3525
|
function Ge() {
|
|
3526
|
-
if (!
|
|
3526
|
+
if (!O.value || !B) return;
|
|
3527
3527
|
let e = Ve(xt.value), t = e.filter((e) => e.geoType === p.geoType), n = e.filter((e) => e.geoType !== p.geoType), r = /* @__PURE__ */ new Map();
|
|
3528
3528
|
for (let e of t) {
|
|
3529
3529
|
let t = L.get(String(e.feature.id));
|
|
3530
|
-
t && r.set(t, e.item
|
|
3530
|
+
t && r.set(t, e.item);
|
|
3531
|
+
}
|
|
3532
|
+
for (let [e] of z) r.has(e) || e === R || Kt(e);
|
|
3533
|
+
for (let [e, t] of r) {
|
|
3534
|
+
let n = z.get(e);
|
|
3535
|
+
n != null && n.style === t.style && n.stroke === t.stroke && n.strokeWidth === t.strokeWidth && e !== R || e !== R && Gt(e, t);
|
|
3531
3536
|
}
|
|
3532
|
-
for (let [e] of z) r.has(e) || e === R || Gt(e);
|
|
3533
|
-
for (let [e, t] of r) z.get(e) === t && e !== R || e !== R && Wt(e, t);
|
|
3534
3537
|
z.clear();
|
|
3535
3538
|
for (let [e, t] of r) z.set(e, t);
|
|
3536
3539
|
if (Ke(n), e.length === 0) {
|
|
3537
|
-
We = !0,
|
|
3540
|
+
We = !0, Jt();
|
|
3538
3541
|
return;
|
|
3539
3542
|
}
|
|
3540
3543
|
if (p.focusZoom === !1) {
|
|
3541
3544
|
We = !0;
|
|
3542
3545
|
return;
|
|
3543
3546
|
}
|
|
3544
|
-
let i =
|
|
3547
|
+
let i = P(O.value);
|
|
3545
3548
|
i.interrupt();
|
|
3546
3549
|
let a = We;
|
|
3547
3550
|
We = !0;
|
|
3548
3551
|
let [[o, s], [c, l]] = gt.value.bounds({
|
|
3549
3552
|
type: "FeatureCollection",
|
|
3550
3553
|
features: e.map((e) => e.feature)
|
|
3551
|
-
}), u = (o + c) / 2, d = (s + l) / 2, f = p.focusZoomLevel, m =
|
|
3552
|
-
if (!
|
|
3554
|
+
}), u = (o + c) / 2, d = (s + l) / 2, f = p.focusZoomLevel, m = ue.translate(it.value / 2 - f * u, at.value / 2 - f * d).scale(f), h = t[0]?.feature ?? null, g = () => {
|
|
3555
|
+
if (!F.value || !h) return;
|
|
3553
3556
|
let e = String(h.id), t = L.get(e);
|
|
3554
3557
|
if (!t) return;
|
|
3555
3558
|
let n = t.getBoundingClientRect();
|
|
@@ -3558,22 +3561,27 @@ var Jt = {
|
|
|
3558
3561
|
a ? (Vt(), i.transition().duration(kr).call(B.transform, m).on("end", g)) : (B.transform(i, m), g());
|
|
3559
3562
|
}
|
|
3560
3563
|
function Ke(e) {
|
|
3561
|
-
let t =
|
|
3564
|
+
let t = oe.value;
|
|
3562
3565
|
if (!t) return;
|
|
3563
3566
|
let n = new Set(e.map((e) => e.key));
|
|
3564
|
-
for (let [e, t] of ye) n.has(e) || (t.remove(), ye.delete(e));
|
|
3567
|
+
for (let [e, t] of ye) n.has(e) || (t.el.remove(), ye.delete(e));
|
|
3565
3568
|
let r = gt.value;
|
|
3566
3569
|
for (let { item: n, feature: i, key: a } of e) {
|
|
3567
3570
|
let e = ye.get(a);
|
|
3568
|
-
|
|
3571
|
+
if (!e) {
|
|
3572
|
+
let n = document.createElementNS(Tr, "path");
|
|
3573
|
+
n.setAttribute("d", r(i) ?? ""), n.setAttribute("fill", "none"), n.setAttribute("pointer-events", "none"), n.setAttribute("stroke-linejoin", "round"), n.setAttribute("class", "focus-overlay"), t.appendChild(n), e = { el: n }, ye.set(a, e);
|
|
3574
|
+
}
|
|
3575
|
+
e.strokeWidth = n.strokeWidth, e.el.setAttribute("stroke", n.stroke ?? "#fff"), Ht(e.el, n.style);
|
|
3569
3576
|
}
|
|
3577
|
+
Wt();
|
|
3570
3578
|
}
|
|
3571
3579
|
function J() {
|
|
3572
|
-
if (!
|
|
3573
|
-
xt.value.length > 0 &&
|
|
3574
|
-
let e =
|
|
3580
|
+
if (!O.value || !B) return;
|
|
3581
|
+
xt.value.length > 0 && E("update:focus", null);
|
|
3582
|
+
let e = P(O.value);
|
|
3575
3583
|
e.interrupt(), Vt();
|
|
3576
|
-
let t = q() && !$.isFullscreen.value && !Ae.value, n = e.transition().duration(kr).call(B.transform,
|
|
3584
|
+
let t = q() && !$.isFullscreen.value && !Ae.value, n = e.transition().duration(kr).call(B.transform, ue);
|
|
3577
3585
|
t && n.on("end", () => {
|
|
3578
3586
|
Oe.value = !1, ke.value = !1;
|
|
3579
3587
|
});
|
|
@@ -3583,12 +3591,12 @@ var Jt = {
|
|
|
3583
3591
|
return ($.isFullscreen.value || je.value) && (e["touch-action"] = "none"), (V.value || $.isFullscreen.value || p.zoom && Ae.value) && (e["will-change"] = "transform"), Object.keys(e).length ? e : void 0;
|
|
3584
3592
|
});
|
|
3585
3593
|
function Qe(e) {
|
|
3586
|
-
if (!
|
|
3587
|
-
let t =
|
|
3594
|
+
if (!O.value || !B) return;
|
|
3595
|
+
let t = P(O.value);
|
|
3588
3596
|
t.interrupt(), Vt(), t.transition().duration(250).call(B.scaleBy, e);
|
|
3589
3597
|
}
|
|
3590
3598
|
function $e(e, t) {
|
|
3591
|
-
let n =
|
|
3599
|
+
let n = O.value, r = jr, i = it.value / 2, a = at.value / 2, o = null;
|
|
3592
3600
|
try {
|
|
3593
3601
|
o = n.getScreenCTM();
|
|
3594
3602
|
} catch {
|
|
@@ -3596,34 +3604,34 @@ var Jt = {
|
|
|
3596
3604
|
}
|
|
3597
3605
|
if (o) {
|
|
3598
3606
|
let r = o.inverse(), s = r.a * e + r.c * t + r.e, c = r.b * e + r.d * t + r.f;
|
|
3599
|
-
[i, a] =
|
|
3607
|
+
[i, a] = de(n).invert([s, c]);
|
|
3600
3608
|
}
|
|
3601
|
-
return
|
|
3609
|
+
return ue.translate(it.value / 2 - r * i, at.value / 2 - r * a).scale(r);
|
|
3602
3610
|
}
|
|
3603
3611
|
function et(e) {
|
|
3604
|
-
if (!
|
|
3605
|
-
let t =
|
|
3612
|
+
if (!O.value || !B) return;
|
|
3613
|
+
let t = P(O.value);
|
|
3606
3614
|
t.interrupt(), t.transition().duration(kr).call(B.transform, e);
|
|
3607
3615
|
}
|
|
3608
3616
|
function tt(e, t) {
|
|
3609
|
-
if (!
|
|
3617
|
+
if (!O.value || !B) return;
|
|
3610
3618
|
let n = $e(e, t);
|
|
3611
3619
|
$.enter(), f(() => et(n));
|
|
3612
3620
|
}
|
|
3613
3621
|
function nt(e, t) {
|
|
3614
|
-
!
|
|
3622
|
+
!O.value || !B || et($e(e, t));
|
|
3615
3623
|
}
|
|
3616
|
-
|
|
3624
|
+
w(() => p.focusZoomLevel, () => {
|
|
3617
3625
|
B && B.scaleExtent([1, Je.value]), Ge();
|
|
3618
|
-
}),
|
|
3619
|
-
if (!
|
|
3620
|
-
let e =
|
|
3621
|
-
e.interrupt(), B.transform(e,
|
|
3626
|
+
}), w(() => p.state, () => {
|
|
3627
|
+
if (!O.value || !B) return;
|
|
3628
|
+
let e = P(O.value);
|
|
3629
|
+
e.interrupt(), B.transform(e, ue);
|
|
3622
3630
|
});
|
|
3623
3631
|
let rt = n(() => p.width && p.height ? p.height / p.width : .625), it = n(() => Mr), at = n(() => Mr * rt.value), ot = n(() => {
|
|
3624
|
-
let e =
|
|
3632
|
+
let e = re(p.topology), t = e?.objects?.states;
|
|
3625
3633
|
if (!t) return [];
|
|
3626
|
-
let n =
|
|
3634
|
+
let n = fe(e, t);
|
|
3627
3635
|
return n.type === "FeatureCollection" ? n.features : [n];
|
|
3628
3636
|
}), st = n(() => {
|
|
3629
3637
|
let e = p.state?.trim();
|
|
@@ -3635,14 +3643,14 @@ var Jt = {
|
|
|
3635
3643
|
let e = st.value;
|
|
3636
3644
|
return e ? ot.value.find((t) => String(t.id).padStart(2, "0") === e) ?? null : null;
|
|
3637
3645
|
});
|
|
3638
|
-
|
|
3646
|
+
w(() => [p.state, st.value], ([e, t]) => {
|
|
3639
3647
|
e && e.trim() && !t && console.warn(`[ChoroplethMap] state="${e}" matched no state name or FIPS code; rendering the full map.`);
|
|
3640
3648
|
}, { immediate: !0 });
|
|
3641
3649
|
let lt = v(null), ut = null;
|
|
3642
3650
|
function dt() {
|
|
3643
3651
|
return ut ||= import("./hsaMapping-BahYDmea.js").then((e) => e.n).then((e) => (lt.value = e, e)), ut;
|
|
3644
3652
|
}
|
|
3645
|
-
|
|
3653
|
+
w(() => {
|
|
3646
3654
|
if (p.geoType === "hsas" || p.dataGeoType === "hsas") return !0;
|
|
3647
3655
|
let e = p.focus;
|
|
3648
3656
|
return e ? (Array.isArray(e) ? e : [e]).some((e) => typeof e != "string" && e.geoType === "hsas") : !1;
|
|
@@ -3655,7 +3663,7 @@ var Jt = {
|
|
|
3655
3663
|
type: "FeatureCollection",
|
|
3656
3664
|
features: []
|
|
3657
3665
|
};
|
|
3658
|
-
let { fipsToHsa: t, hsaNames: n } = e, r =
|
|
3666
|
+
let { fipsToHsa: t, hsaNames: n } = e, r = re(p.topology), i = r.objects.counties.geometries, a = st.value, o = /* @__PURE__ */ new Map();
|
|
3659
3667
|
for (let e of i) {
|
|
3660
3668
|
let n = String(e.id).padStart(5, "0");
|
|
3661
3669
|
if (a && n.slice(0, 2) !== a) continue;
|
|
@@ -3667,7 +3675,7 @@ var Jt = {
|
|
|
3667
3675
|
type: "Feature",
|
|
3668
3676
|
id: e,
|
|
3669
3677
|
properties: { name: n[e] ?? e },
|
|
3670
|
-
geometry:
|
|
3678
|
+
geometry: pe(r, t)
|
|
3671
3679
|
});
|
|
3672
3680
|
return {
|
|
3673
3681
|
type: "FeatureCollection",
|
|
@@ -3677,13 +3685,13 @@ var Jt = {
|
|
|
3677
3685
|
if (p.geoType === "hsas") return ft.value;
|
|
3678
3686
|
let e = st.value;
|
|
3679
3687
|
if (p.geoType === "counties") {
|
|
3680
|
-
let t =
|
|
3688
|
+
let t = re(p.topology), n = fe(t, t.objects.counties);
|
|
3681
3689
|
return e ? {
|
|
3682
3690
|
type: "FeatureCollection",
|
|
3683
3691
|
features: n.features.filter((t) => String(t.id).padStart(5, "0").slice(0, 2) === e)
|
|
3684
3692
|
} : n;
|
|
3685
3693
|
}
|
|
3686
|
-
let t =
|
|
3694
|
+
let t = re(p.topology), n = fe(t, t.objects.states);
|
|
3687
3695
|
return e ? {
|
|
3688
3696
|
type: "FeatureCollection",
|
|
3689
3697
|
features: n.features.filter((t) => String(t.id).padStart(2, "0") === e)
|
|
@@ -3691,16 +3699,16 @@ var Jt = {
|
|
|
3691
3699
|
}), mt = n(() => {
|
|
3692
3700
|
if (p.geoType !== "counties" && p.geoType !== "hsas") return null;
|
|
3693
3701
|
if (st.value) return ct.value;
|
|
3694
|
-
let e =
|
|
3695
|
-
return
|
|
3702
|
+
let e = re(p.topology);
|
|
3703
|
+
return me(e, e.objects.states, (e, t) => e !== t);
|
|
3696
3704
|
}), ht = n(() => {
|
|
3697
3705
|
let e = ct.value;
|
|
3698
3706
|
if (st.value && e) {
|
|
3699
|
-
let t = [[Nr, Nr], [it.value - Nr, at.value - Nr]], n =
|
|
3700
|
-
return Number.isFinite(r[0]) && Number.isFinite(r[1]) ? n :
|
|
3707
|
+
let t = [[Nr, Nr], [it.value - Nr, at.value - Nr]], n = M().fitExtent(t, e), r = N(n).centroid(e);
|
|
3708
|
+
return Number.isFinite(r[0]) && Number.isFinite(r[1]) ? n : ce().fitExtent(t, e);
|
|
3701
3709
|
}
|
|
3702
|
-
return
|
|
3703
|
-
}), gt = n(() =>
|
|
3710
|
+
return M().fitExtent([[0, 0], [it.value, at.value]], pt.value);
|
|
3711
|
+
}), gt = n(() => N(ht.value)), _t = n(() => p.geoType === "counties" || p.geoType === "hsas" ? p.strokeWidth * .5 : p.strokeWidth), vt = n(() => {
|
|
3704
3712
|
let e = /* @__PURE__ */ new Map();
|
|
3705
3713
|
for (let [t, n] of St.value) {
|
|
3706
3714
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3725,7 +3733,7 @@ var Jt = {
|
|
|
3725
3733
|
}), St = n(() => {
|
|
3726
3734
|
let e = /* @__PURE__ */ new Map();
|
|
3727
3735
|
e.set(p.geoType, bt.value);
|
|
3728
|
-
let t =
|
|
3736
|
+
let t = re(p.topology), n = t?.objects;
|
|
3729
3737
|
if (!n) return e;
|
|
3730
3738
|
let r = (e) => {
|
|
3731
3739
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3733,11 +3741,11 @@ var Jt = {
|
|
|
3733
3741
|
return t;
|
|
3734
3742
|
};
|
|
3735
3743
|
if (!e.has("states") && n.states) {
|
|
3736
|
-
let i =
|
|
3744
|
+
let i = fe(t, n.states);
|
|
3737
3745
|
e.set("states", r(i.features));
|
|
3738
3746
|
}
|
|
3739
3747
|
if (!e.has("counties") && n.counties) {
|
|
3740
|
-
let i =
|
|
3748
|
+
let i = fe(t, n.counties);
|
|
3741
3749
|
e.set("counties", r(i.features));
|
|
3742
3750
|
}
|
|
3743
3751
|
return !e.has("hsas") && n.counties && e.set("hsas", r(ft.value.features)), e;
|
|
@@ -3807,13 +3815,13 @@ var Jt = {
|
|
|
3807
3815
|
}
|
|
3808
3816
|
let Pt = (e) => e.properties?.name ?? String(e.id);
|
|
3809
3817
|
function Ft(e) {
|
|
3810
|
-
return e == null ? "" : typeof e == "number" && p.tooltipValueFormat !== void 0 ?
|
|
3818
|
+
return e == null ? "" : typeof e == "number" && p.tooltipValueFormat !== void 0 ? ie(e, p.tooltipValueFormat) : String(e);
|
|
3811
3819
|
}
|
|
3812
3820
|
function It(e, t) {
|
|
3813
3821
|
return t == null ? e : `${e}: ${Ft(t)}`;
|
|
3814
3822
|
}
|
|
3815
3823
|
function Lt() {
|
|
3816
|
-
let e =
|
|
3824
|
+
let e = j.value?.getEl();
|
|
3817
3825
|
if (!e) return;
|
|
3818
3826
|
xe?.disconnect();
|
|
3819
3827
|
let t = !1;
|
|
@@ -3823,15 +3831,15 @@ var Jt = {
|
|
|
3823
3831
|
}), xe.observe(e);
|
|
3824
3832
|
}
|
|
3825
3833
|
function Rt(e, t) {
|
|
3826
|
-
let n =
|
|
3834
|
+
let n = j.value?.getEl();
|
|
3827
3835
|
if (!n) return;
|
|
3828
|
-
let r =
|
|
3836
|
+
let r = ae.value?.getBoundingClientRect(), { left: i, top: a } = H(e, t, Se.width, Se.height, p.tooltipClamp, r);
|
|
3829
3837
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
3830
3838
|
}
|
|
3831
3839
|
function zt(e, t, n) {
|
|
3832
3840
|
let r = _e.get(e);
|
|
3833
3841
|
if (!r) return;
|
|
3834
|
-
let i =
|
|
3842
|
+
let i = j.value, a = i?.getEl();
|
|
3835
3843
|
!i || !a || (i.setData(r), Ce = {
|
|
3836
3844
|
x: t,
|
|
3837
3845
|
y: n
|
|
@@ -3840,7 +3848,7 @@ var Jt = {
|
|
|
3840
3848
|
function Bt(e, t) {
|
|
3841
3849
|
we && (Me = e, Ne = t, !Pe && (Pe = requestAnimationFrame(() => {
|
|
3842
3850
|
Pe = 0;
|
|
3843
|
-
let e =
|
|
3851
|
+
let e = j.value?.getEl();
|
|
3844
3852
|
!e || !we || (Ce = {
|
|
3845
3853
|
x: Me,
|
|
3846
3854
|
y: Ne
|
|
@@ -3850,7 +3858,7 @@ var Jt = {
|
|
|
3850
3858
|
function Vt() {
|
|
3851
3859
|
if (!we) return;
|
|
3852
3860
|
we = !1, Ce = null;
|
|
3853
|
-
let e =
|
|
3861
|
+
let e = j.value?.getEl();
|
|
3854
3862
|
e && (e.style.visibility = "hidden");
|
|
3855
3863
|
}
|
|
3856
3864
|
function Ht(e, t) {
|
|
@@ -3859,44 +3867,47 @@ var Jt = {
|
|
|
3859
3867
|
function Ut() {
|
|
3860
3868
|
return Ee.value * De.value || 1;
|
|
3861
3869
|
}
|
|
3862
|
-
function Q() {
|
|
3863
|
-
|
|
3864
|
-
j.value?.setAttribute("stroke-width", String(t / e)), ve?.setAttribute("stroke-width", String(1 / e)), ae.value?.setAttribute("stroke-width", String((t + 1.5) / e));
|
|
3865
|
-
let n = String((t + 1) / e);
|
|
3866
|
-
for (let [e] of z) e.setAttribute("stroke-width", n);
|
|
3867
|
-
R && R.setAttribute("stroke-width", n);
|
|
3870
|
+
function Q(e) {
|
|
3871
|
+
return e?.strokeWidth ?? _t.value + 1;
|
|
3868
3872
|
}
|
|
3869
|
-
function Wt(
|
|
3870
|
-
|
|
3873
|
+
function Wt() {
|
|
3874
|
+
let e = Ut(), t = _t.value;
|
|
3875
|
+
A.value?.setAttribute("stroke-width", String(t / e)), ve?.setAttribute("stroke-width", String(1 / e)), oe.value?.setAttribute("stroke-width", String((t + 1.5) / e));
|
|
3876
|
+
for (let { el: t, strokeWidth: n } of ye.values()) n == null ? t.removeAttribute("stroke-width") : t.setAttribute("stroke-width", String(n / e));
|
|
3877
|
+
for (let [t, n] of z) t.setAttribute("stroke-width", String(Q(n) / e));
|
|
3878
|
+
R && !z.has(R) && R.setAttribute("stroke-width", String(Q() / e));
|
|
3871
3879
|
}
|
|
3872
|
-
function Gt(e) {
|
|
3873
|
-
e.
|
|
3880
|
+
function Gt(e, t) {
|
|
3881
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Q(t) / Ut())), e.style.stroke = t?.stroke ?? Pr, Ht(e, t?.style);
|
|
3874
3882
|
}
|
|
3875
3883
|
function Kt(e) {
|
|
3876
|
-
|
|
3884
|
+
e.removeAttribute("stroke-width"), e.style.stroke = "", e.setAttribute("stroke", p.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
3885
|
+
}
|
|
3886
|
+
function qt(e) {
|
|
3887
|
+
R !== e && (R && !z.has(R) && Kt(R), R = e, Gt(e, z.get(e)));
|
|
3877
3888
|
}
|
|
3878
|
-
function
|
|
3889
|
+
function Jt() {
|
|
3879
3890
|
if (R) {
|
|
3880
3891
|
let e = z.get(R);
|
|
3881
|
-
e == null ?
|
|
3892
|
+
e == null ? Kt(R) : Gt(R, e), R = null, E("stateHover", null);
|
|
3882
3893
|
}
|
|
3883
3894
|
Vt();
|
|
3884
3895
|
}
|
|
3885
|
-
function
|
|
3896
|
+
function Yt(e) {
|
|
3886
3897
|
let t = e;
|
|
3887
3898
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
3888
3899
|
return t ? t.dataset.featId ?? null : null;
|
|
3889
3900
|
}
|
|
3890
|
-
function
|
|
3891
|
-
p.zoom && (ke.value = !0),
|
|
3901
|
+
function Xt(e) {
|
|
3902
|
+
p.zoom && (ke.value = !0), E("stateClick", {
|
|
3892
3903
|
id: e.id,
|
|
3893
3904
|
name: e.name,
|
|
3894
3905
|
value: e.value
|
|
3895
|
-
}),
|
|
3906
|
+
}), E("update:focus", Ue(xt.value).has(e.id) ? null : e.id);
|
|
3896
3907
|
}
|
|
3897
|
-
function
|
|
3908
|
+
function Zt(e) {
|
|
3898
3909
|
if (be) return;
|
|
3899
|
-
let t = e, n =
|
|
3910
|
+
let t = e, n = Yt(t.target);
|
|
3900
3911
|
if (!n) return;
|
|
3901
3912
|
let r = _e.get(n);
|
|
3902
3913
|
if (!r) return;
|
|
@@ -3906,17 +3917,17 @@ var Jt = {
|
|
|
3906
3917
|
value: r.value
|
|
3907
3918
|
};
|
|
3908
3919
|
e.type === "click" ? p.zoom ? (window.clearTimeout(W), W = 0, t.detail <= 1 && (W = window.setTimeout(() => {
|
|
3909
|
-
W = 0,
|
|
3910
|
-
}, Or))) :
|
|
3920
|
+
W = 0, Xt(r);
|
|
3921
|
+
}, Or))) : Xt(r) : e.type === "mouseover" && (qt(L.get(n)), F.value && zt(n, t.clientX, t.clientY), E("stateHover", i));
|
|
3911
3922
|
}
|
|
3912
|
-
function
|
|
3923
|
+
function Qt(e) {
|
|
3913
3924
|
be || Bt(e.clientX, e.clientY);
|
|
3914
3925
|
}
|
|
3915
|
-
function
|
|
3926
|
+
function $t(e) {
|
|
3916
3927
|
let t = e.relatedTarget;
|
|
3917
|
-
t &&
|
|
3928
|
+
t && k.value?.contains(t) || Jt();
|
|
3918
3929
|
}
|
|
3919
|
-
function
|
|
3930
|
+
function en(e) {
|
|
3920
3931
|
if (e.touches.length !== 1) {
|
|
3921
3932
|
U = null;
|
|
3922
3933
|
return;
|
|
@@ -3926,10 +3937,10 @@ var Jt = {
|
|
|
3926
3937
|
x: t.clientX,
|
|
3927
3938
|
y: t.clientY,
|
|
3928
3939
|
time: e.timeStamp,
|
|
3929
|
-
featId:
|
|
3940
|
+
featId: Yt(e.target)
|
|
3930
3941
|
};
|
|
3931
3942
|
}
|
|
3932
|
-
function
|
|
3943
|
+
function tn(e) {
|
|
3933
3944
|
let t = U;
|
|
3934
3945
|
if (U = null, !t || e.touches.length > 0) return;
|
|
3935
3946
|
let n = e.changedTouches[0];
|
|
@@ -3946,26 +3957,26 @@ var Jt = {
|
|
|
3946
3957
|
}
|
|
3947
3958
|
if (!t.featId) return;
|
|
3948
3959
|
let r = _e.get(t.featId);
|
|
3949
|
-
r && (e.preventDefault(),
|
|
3960
|
+
r && (e.preventDefault(), Xt(r));
|
|
3950
3961
|
}
|
|
3951
|
-
function
|
|
3962
|
+
function nn() {
|
|
3952
3963
|
U = null;
|
|
3953
3964
|
}
|
|
3954
|
-
function
|
|
3965
|
+
function rn(e) {
|
|
3955
3966
|
let t = document.createElementNS(Tr, "path");
|
|
3956
3967
|
return e && t.setAttribute("d", e), t;
|
|
3957
3968
|
}
|
|
3958
|
-
function
|
|
3959
|
-
let e =
|
|
3969
|
+
function an() {
|
|
3970
|
+
let e = A.value, t = oe.value;
|
|
3960
3971
|
if (!e || !t) return;
|
|
3961
3972
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
3962
3973
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
3963
3974
|
L.clear(), _e.clear(), ve = null, R = null, z.clear(), ye.clear();
|
|
3964
3975
|
let n = gt.value, r = pt.value.features;
|
|
3965
3976
|
if (r.length === 0) return;
|
|
3966
|
-
let i = p.strokeColor, a = !
|
|
3977
|
+
let i = p.strokeColor, a = !F.value, o = document.createDocumentFragment();
|
|
3967
3978
|
for (let e of r) {
|
|
3968
|
-
let t = String(e.id), r = Pt(e), s = Mt(t), c =
|
|
3979
|
+
let t = String(e.id), r = Pt(e), s = Mt(t), c = rn(n(e));
|
|
3969
3980
|
if (c.setAttribute("class", "state-path"), c.setAttribute("data-feat-id", t), c.setAttribute("fill", Nt(t)), c.setAttribute("stroke", i), a) {
|
|
3970
3981
|
let e = document.createElementNS(Tr, "title");
|
|
3971
3982
|
e.textContent = It(r, s), c.appendChild(e);
|
|
@@ -3979,13 +3990,13 @@ var Jt = {
|
|
|
3979
3990
|
}
|
|
3980
3991
|
let s = mt.value;
|
|
3981
3992
|
if (s) {
|
|
3982
|
-
let e =
|
|
3993
|
+
let e = rn(n(s));
|
|
3983
3994
|
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), o.appendChild(e), ve = e;
|
|
3984
3995
|
}
|
|
3985
|
-
e.appendChild(o),
|
|
3996
|
+
e.appendChild(o), Wt();
|
|
3986
3997
|
}
|
|
3987
|
-
function
|
|
3988
|
-
let e = !
|
|
3998
|
+
function on() {
|
|
3999
|
+
let e = !F.value;
|
|
3989
4000
|
for (let [t, n] of L) {
|
|
3990
4001
|
let r = Mt(t), i = _e.get(t);
|
|
3991
4002
|
if (n.setAttribute("fill", Nt(t)), i && (i.value = r), e && i) {
|
|
@@ -3994,14 +4005,14 @@ var Jt = {
|
|
|
3994
4005
|
}
|
|
3995
4006
|
}
|
|
3996
4007
|
}
|
|
3997
|
-
function on() {
|
|
3998
|
-
for (let e of L.values()) e === R || z.has(e) || Gt(e);
|
|
3999
|
-
ve && ve.setAttribute("stroke", p.strokeColor), Q();
|
|
4000
|
-
}
|
|
4001
4008
|
function sn() {
|
|
4009
|
+
for (let e of L.values()) e === R || z.has(e) || Kt(e);
|
|
4010
|
+
ve && ve.setAttribute("stroke", p.strokeColor), Wt();
|
|
4011
|
+
}
|
|
4012
|
+
function cn() {
|
|
4002
4013
|
return typeof p.menu == "string" ? p.menu : "choropleth";
|
|
4003
4014
|
}
|
|
4004
|
-
let
|
|
4015
|
+
let ln = n(() => p.legend && (Et.value || Z.value || p.data)), un = n(() => p.colorScale.slice().sort((e, t) => e.min - t.min)), dn = n(() => {
|
|
4005
4016
|
let e = [];
|
|
4006
4017
|
for (let t = 0; t <= 10; t++) {
|
|
4007
4018
|
let n = t / 10;
|
|
@@ -4011,102 +4022,102 @@ var Jt = {
|
|
|
4011
4022
|
});
|
|
4012
4023
|
}
|
|
4013
4024
|
return e;
|
|
4014
|
-
}),
|
|
4025
|
+
}), fn = new Intl.NumberFormat("en-US", {
|
|
4015
4026
|
notation: "compact",
|
|
4016
4027
|
maximumFractionDigits: 1
|
|
4017
|
-
}),
|
|
4028
|
+
}), pn = n(() => {
|
|
4018
4029
|
let { min: e, max: t } = Tt.value, n = t - e, r = [];
|
|
4019
4030
|
for (let t = 1; t <= 3; t++) {
|
|
4020
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
4031
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? fn.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
4021
4032
|
r.push({
|
|
4022
4033
|
value: o,
|
|
4023
4034
|
pct: i * 100
|
|
4024
4035
|
});
|
|
4025
4036
|
}
|
|
4026
4037
|
return r;
|
|
4027
|
-
}),
|
|
4038
|
+
}), mn = n(() => {
|
|
4028
4039
|
let e = [];
|
|
4029
4040
|
if (Et.value) for (let t of p.colorScale) e.push({
|
|
4030
4041
|
key: t.value,
|
|
4031
4042
|
color: t.color,
|
|
4032
4043
|
label: t.value
|
|
4033
4044
|
});
|
|
4034
|
-
else if (Z.value) for (let t of
|
|
4045
|
+
else if (Z.value) for (let t of un.value) e.push({
|
|
4035
4046
|
key: String(t.min),
|
|
4036
4047
|
color: t.color,
|
|
4037
4048
|
label: t.label ?? String(t.min)
|
|
4038
4049
|
});
|
|
4039
4050
|
return e;
|
|
4040
|
-
}),
|
|
4041
|
-
let e =
|
|
4051
|
+
}), hn = n(() => `linear-gradient(to right, ${dn.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), $ = He({ target: () => p.fullscreenTarget }), gn = n(() => {
|
|
4052
|
+
let e = cn();
|
|
4042
4053
|
return [
|
|
4043
4054
|
$.menuItem.value,
|
|
4044
4055
|
{
|
|
4045
4056
|
label: "Save as SVG",
|
|
4046
4057
|
action: () => {
|
|
4047
|
-
|
|
4058
|
+
O.value && K(O.value, e);
|
|
4048
4059
|
}
|
|
4049
4060
|
},
|
|
4050
4061
|
{
|
|
4051
4062
|
label: "Save as PNG",
|
|
4052
4063
|
action: () => {
|
|
4053
|
-
|
|
4064
|
+
O.value && Ie(O.value, e);
|
|
4054
4065
|
}
|
|
4055
4066
|
}
|
|
4056
4067
|
];
|
|
4057
4068
|
});
|
|
4058
|
-
return
|
|
4069
|
+
return w(() => [
|
|
4059
4070
|
pt.value,
|
|
4060
4071
|
gt.value,
|
|
4061
|
-
|
|
4062
|
-
], () =>
|
|
4072
|
+
F.value
|
|
4073
|
+
], () => an()), w(() => [
|
|
4063
4074
|
wt.value,
|
|
4064
4075
|
p.colorScale,
|
|
4065
4076
|
p.noDataColor,
|
|
4066
4077
|
p.dataGeoType
|
|
4067
|
-
], () =>
|
|
4078
|
+
], () => on()), w(() => [p.strokeColor, _t.value], () => sn()), w(() => [
|
|
4068
4079
|
xt.value,
|
|
4069
4080
|
gt.value,
|
|
4070
4081
|
lt.value
|
|
4071
|
-
], () => Ge(), { flush: "post" }),
|
|
4072
|
-
if (e || !q() || !
|
|
4073
|
-
let t =
|
|
4074
|
-
t.interrupt(), B.transform(t,
|
|
4082
|
+
], () => Ge(), { flush: "post" }), w(() => $.isFullscreen.value, (e) => {
|
|
4083
|
+
if (e || !q() || !O.value || !B) return;
|
|
4084
|
+
let t = P(O.value);
|
|
4085
|
+
t.interrupt(), B.transform(t, ue);
|
|
4075
4086
|
}), (n, l) => (_(), r(t, {
|
|
4076
|
-
to:
|
|
4077
|
-
disabled: !
|
|
4087
|
+
to: x($).teleportTarget.value,
|
|
4088
|
+
disabled: !x($).isFullscreen.value
|
|
4078
4089
|
}, [o("div", d({
|
|
4079
4090
|
ref_key: "containerRef",
|
|
4080
|
-
ref:
|
|
4091
|
+
ref: ae
|
|
4081
4092
|
}, n.$attrs, {
|
|
4082
4093
|
class: ["choropleth-wrapper", {
|
|
4083
4094
|
pannable: Xe.value,
|
|
4084
|
-
"is-fullscreen":
|
|
4095
|
+
"is-fullscreen": x($).isFullscreen.value
|
|
4085
4096
|
}],
|
|
4086
|
-
style:
|
|
4087
|
-
role:
|
|
4097
|
+
style: x($).fullscreenStyle.value,
|
|
4098
|
+
role: C.value || void 0,
|
|
4088
4099
|
"aria-label": ne.value || void 0
|
|
4089
4100
|
}), [
|
|
4090
|
-
c.menu ||
|
|
4101
|
+
c.menu || x($).isFullscreen.value ? (_(), r(ge, {
|
|
4091
4102
|
key: 0,
|
|
4092
|
-
items:
|
|
4093
|
-
"is-fullscreen":
|
|
4094
|
-
onClose:
|
|
4103
|
+
items: gn.value,
|
|
4104
|
+
"is-fullscreen": x($).isFullscreen.value,
|
|
4105
|
+
onClose: x($).exit
|
|
4095
4106
|
}, null, 8, [
|
|
4096
4107
|
"items",
|
|
4097
4108
|
"is-fullscreen",
|
|
4098
4109
|
"onClose"
|
|
4099
4110
|
])) : i("", !0),
|
|
4100
|
-
o("div", _r, b(
|
|
4101
|
-
c.title ||
|
|
4111
|
+
o("div", _r, b(x($).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
|
|
4112
|
+
c.title || ln.value ? (_(), a("div", vr, [c.title ? (_(), a("div", {
|
|
4102
4113
|
key: 0,
|
|
4103
4114
|
class: "choropleth-title",
|
|
4104
4115
|
style: h(I.value)
|
|
4105
|
-
}, b(c.title), 5)) : i("", !0),
|
|
4116
|
+
}, b(c.title), 5)) : i("", !0), ln.value ? (_(), a("div", {
|
|
4106
4117
|
key: 1,
|
|
4107
4118
|
class: "choropleth-legend",
|
|
4108
4119
|
style: h(he.value)
|
|
4109
|
-
}, [c.legendTitle ? (_(), a("span", yr, b(c.legendTitle), 1)) : i("", !0), Et.value || Z.value ? (_(!0), a(e, { key: 1 }, y(
|
|
4120
|
+
}, [c.legendTitle ? (_(), a("span", yr, b(c.legendTitle), 1)) : i("", !0), Et.value || Z.value ? (_(!0), a(e, { key: 1 }, y(mn.value, (e) => (_(), a("span", {
|
|
4110
4121
|
key: e.key,
|
|
4111
4122
|
class: "choropleth-legend-item"
|
|
4112
4123
|
}, [o("span", {
|
|
@@ -4114,34 +4125,34 @@ var Jt = {
|
|
|
4114
4125
|
style: h({ background: e.color })
|
|
4115
4126
|
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", br, [o("div", {
|
|
4116
4127
|
class: "choropleth-legend-gradient",
|
|
4117
|
-
style: h({ background:
|
|
4118
|
-
}, null, 4), o("div", xr, [(_(!0), a(e, null, y(
|
|
4128
|
+
style: h({ background: hn.value })
|
|
4129
|
+
}, null, 4), o("div", xr, [(_(!0), a(e, null, y(pn.value, (e) => (_(), a("span", {
|
|
4119
4130
|
key: e.value,
|
|
4120
4131
|
style: h({ left: e.pct + "%" })
|
|
4121
4132
|
}, b(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
|
|
4122
4133
|
Y.value ? (_(), a("div", Sr, b(Ze.value), 1)) : i("", !0),
|
|
4123
4134
|
(_(), a("svg", {
|
|
4124
4135
|
ref_key: "svgRef",
|
|
4125
|
-
ref:
|
|
4136
|
+
ref: O,
|
|
4126
4137
|
viewBox: `0 0 ${it.value} ${at.value}`,
|
|
4127
4138
|
preserveAspectRatio: "xMidYMid meet",
|
|
4128
4139
|
style: h(X.value)
|
|
4129
4140
|
}, [o("g", {
|
|
4130
4141
|
ref_key: "mapGroupRef",
|
|
4131
|
-
ref:
|
|
4142
|
+
ref: k
|
|
4132
4143
|
}, [o("g", {
|
|
4133
4144
|
ref_key: "baseGroupRef",
|
|
4134
|
-
ref:
|
|
4145
|
+
ref: A
|
|
4135
4146
|
}, null, 512), o("g", {
|
|
4136
4147
|
ref_key: "overlayGroupRef",
|
|
4137
|
-
ref:
|
|
4148
|
+
ref: oe
|
|
4138
4149
|
}, null, 512)], 512)], 12, Cr)),
|
|
4139
|
-
Ye.value ? (_(), r(
|
|
4150
|
+
Ye.value ? (_(), r(x(qe), {
|
|
4140
4151
|
key: 3,
|
|
4141
4152
|
"can-zoom-in": Ee.value < Je.value,
|
|
4142
4153
|
"can-zoom-out": Ee.value > 1,
|
|
4143
4154
|
"can-reset": Te.value,
|
|
4144
|
-
"is-fullscreen":
|
|
4155
|
+
"is-fullscreen": x($).isFullscreen.value,
|
|
4145
4156
|
onZoomIn: l[0] ||= (e) => Qe(Ar),
|
|
4146
4157
|
onZoomOut: l[1] ||= (e) => Qe(1 / Ar),
|
|
4147
4158
|
onReset: J
|
|
@@ -4151,12 +4162,12 @@ var Jt = {
|
|
|
4151
4162
|
"can-reset",
|
|
4152
4163
|
"is-fullscreen"
|
|
4153
4164
|
])) : i("", !0),
|
|
4154
|
-
|
|
4165
|
+
F.value ? (_(), r(hr, {
|
|
4155
4166
|
key: 4,
|
|
4156
4167
|
ref_key: "tooltipChildRef",
|
|
4157
|
-
ref:
|
|
4168
|
+
ref: j
|
|
4158
4169
|
}, {
|
|
4159
|
-
default:
|
|
4170
|
+
default: T((t) => [te(n.$slots, "tooltip", m(u(D(t))), () => [c.tooltipFormat ? (_(), a("span", {
|
|
4160
4171
|
key: 0,
|
|
4161
4172
|
innerHTML: c.tooltipFormat(t)
|
|
4162
4173
|
}, null, 8, wr)) : t.value == null ? (_(), a(e, { key: 1 }, [s(b(t.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(t.name) + ": " + b(Ft(t.value)), 1)], 64))], !0)]),
|
|
@@ -4164,7 +4175,7 @@ var Jt = {
|
|
|
4164
4175
|
}, 512)) : i("", !0)
|
|
4165
4176
|
], 16, gr)], 8, ["to", "disabled"]));
|
|
4166
4177
|
}
|
|
4167
|
-
}), [["__scopeId", "data-v-
|
|
4178
|
+
}), [["__scopeId", "data-v-c62cdd12"]]), Ir = /* @__PURE__ */ I(/* @__PURE__ */ l({
|
|
4168
4179
|
__name: "ChartTooltip",
|
|
4169
4180
|
props: {
|
|
4170
4181
|
x: {},
|
|
@@ -4184,12 +4195,12 @@ var Jt = {
|
|
|
4184
4195
|
top: `${e.y}px`,
|
|
4185
4196
|
transform: "translateY(-50%)"
|
|
4186
4197
|
})
|
|
4187
|
-
}, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(
|
|
4198
|
+
}, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(x(se), {
|
|
4188
4199
|
key: 1,
|
|
4189
4200
|
open: e.open
|
|
4190
4201
|
}, {
|
|
4191
|
-
default:
|
|
4192
|
-
default:
|
|
4202
|
+
default: T(() => [c(x(A), { "as-child": "" }, {
|
|
4203
|
+
default: T(() => [o("div", {
|
|
4193
4204
|
class: "chart-tooltip-anchor",
|
|
4194
4205
|
style: h({
|
|
4195
4206
|
left: `${e.x}px`,
|
|
@@ -4197,8 +4208,8 @@ var Jt = {
|
|
|
4197
4208
|
})
|
|
4198
4209
|
}, null, 4)]),
|
|
4199
4210
|
_: 1
|
|
4200
|
-
}), c(
|
|
4201
|
-
default:
|
|
4211
|
+
}), c(x(j), null, {
|
|
4212
|
+
default: T(() => [e.open ? (_(), r(x(oe), {
|
|
4202
4213
|
key: 0,
|
|
4203
4214
|
class: "chart-tooltip-content",
|
|
4204
4215
|
side: "right",
|
|
@@ -4207,7 +4218,7 @@ var Jt = {
|
|
|
4207
4218
|
onPointerDownOutside: n[0] ||= (e) => t.$emit("close"),
|
|
4208
4219
|
onEscapeKeyDown: n[1] ||= (e) => t.$emit("close")
|
|
4209
4220
|
}, {
|
|
4210
|
-
default:
|
|
4221
|
+
default: T(() => [te(t.$slots, "default", {}, void 0, !0)]),
|
|
4211
4222
|
_: 3
|
|
4212
4223
|
}, 8, ["side-offset"])) : i("", !0)]),
|
|
4213
4224
|
_: 3
|
|
@@ -4215,7 +4226,7 @@ var Jt = {
|
|
|
4215
4226
|
_: 3
|
|
4216
4227
|
}, 8, ["open"])) : i("", !0);
|
|
4217
4228
|
}
|
|
4218
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
4229
|
+
}), [["__scopeId", "data-v-44377f70"]]), Lr = { class: "TableWrapper" }, Rr = ["href", "download"], zr = /* @__PURE__ */ I(/* @__PURE__ */ l({
|
|
4219
4230
|
__name: "DataTable",
|
|
4220
4231
|
props: {
|
|
4221
4232
|
data: {},
|
|
@@ -4299,14 +4310,14 @@ var Jt = {
|
|
|
4299
4310
|
let r = c.columnConfig?.[e.name]?.format;
|
|
4300
4311
|
if (r !== void 0) {
|
|
4301
4312
|
if (typeof r == "function") return r(n, t);
|
|
4302
|
-
if (typeof n == "number") return
|
|
4313
|
+
if (typeof n == "number") return ie(n, r);
|
|
4303
4314
|
}
|
|
4304
4315
|
return e.enumLabels && typeof n == "number" ? e.enumLabels[n] ?? String(n) : typeof n == "number" ? Number.isInteger(n) ? n.toString() : n.toFixed(4) : typeof n == "boolean" ? n ? "true" : "false" : String(n);
|
|
4305
4316
|
}
|
|
4306
|
-
function
|
|
4317
|
+
function re() {
|
|
4307
4318
|
return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
|
|
4308
4319
|
}
|
|
4309
|
-
function
|
|
4320
|
+
function x() {
|
|
4310
4321
|
if (typeof c.csv == "function") return c.csv();
|
|
4311
4322
|
if (typeof c.csv == "string") return c.csv;
|
|
4312
4323
|
let e = v.value, t = te.value, n = [e.map((e) => Ye(l(e.name))).join(",")];
|
|
@@ -4316,27 +4327,27 @@ var Jt = {
|
|
|
4316
4327
|
}
|
|
4317
4328
|
return n.join("\n");
|
|
4318
4329
|
}
|
|
4319
|
-
function
|
|
4320
|
-
Le(
|
|
4330
|
+
function S() {
|
|
4331
|
+
Le(x(), re());
|
|
4321
4332
|
}
|
|
4322
|
-
let
|
|
4333
|
+
let C = n(() => c.downloadButton || c.downloadLink ? [] : [{
|
|
4323
4334
|
label: c.downloadMenuLink,
|
|
4324
|
-
action:
|
|
4325
|
-
}]),
|
|
4335
|
+
action: S
|
|
4336
|
+
}]), w = n(() => {
|
|
4326
4337
|
if (c.downloadButton) return null;
|
|
4327
4338
|
let e = c.downloadLink;
|
|
4328
4339
|
return e ? typeof e == "string" ? e : "Download data (CSV)" : null;
|
|
4329
|
-
}),
|
|
4340
|
+
}), T = n(() => w.value ? `data:text/csv;charset=utf-8,${encodeURIComponent(x())}` : null), E = n(() => !!c.menu && C.value.length > 0);
|
|
4330
4341
|
return (n, s) => (_(), a("div", { class: p(["TableOuter", {
|
|
4331
4342
|
"full-width": t.fullWidth,
|
|
4332
|
-
"has-menu":
|
|
4343
|
+
"has-menu": E.value
|
|
4333
4344
|
}]) }, [
|
|
4334
|
-
|
|
4345
|
+
E.value ? (_(), r(ge, {
|
|
4335
4346
|
key: 0,
|
|
4336
|
-
items:
|
|
4347
|
+
items: C.value,
|
|
4337
4348
|
"force-dropdown": ""
|
|
4338
4349
|
}, null, 8, ["items"])) : i("", !0),
|
|
4339
|
-
o("div",
|
|
4350
|
+
o("div", Lr, [o("table", { class: p(["Table", { "full-width": t.fullWidth }]) }, [
|
|
4340
4351
|
o("colgroup", null, [(_(!0), a(e, null, y(v.value, (e) => (_(), a("col", {
|
|
4341
4352
|
key: e.name,
|
|
4342
4353
|
style: h(u(e.name))
|
|
@@ -4356,15 +4367,15 @@ var Jt = {
|
|
|
4356
4367
|
key: 1,
|
|
4357
4368
|
type: "button",
|
|
4358
4369
|
class: "data-table-download-button",
|
|
4359
|
-
onClick:
|
|
4360
|
-
}, b(t.downloadMenuLink), 1)) :
|
|
4370
|
+
onClick: S
|
|
4371
|
+
}, b(t.downloadMenuLink), 1)) : w.value ? (_(), a("a", {
|
|
4361
4372
|
key: 2,
|
|
4362
4373
|
class: "data-table-download-link",
|
|
4363
|
-
href:
|
|
4364
|
-
download: `${
|
|
4365
|
-
}, b(
|
|
4374
|
+
href: T.value,
|
|
4375
|
+
download: `${re()}.csv`
|
|
4376
|
+
}, b(w.value), 9, Rr)) : i("", !0)
|
|
4366
4377
|
], 2));
|
|
4367
4378
|
}
|
|
4368
4379
|
}), [["__scopeId", "data-v-9b1b6a76"]]);
|
|
4369
4380
|
//#endregion
|
|
4370
|
-
export { pr as BarChart,
|
|
4381
|
+
export { pr as BarChart, Ir as ChartTooltip, Fr as ChoroplethMap, zr as DataTable, Nn as LineChart };
|