@cfasim-ui/charts 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChoroplethMap/ChoroplethMap.d.ts +15 -0
- package/dist/_shared/chartProps.d.ts +15 -0
- package/dist/index.css +1 -1
- package/dist/index.js +708 -686
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as b, toDisplayString as x, toHandlers as ee, toRaw as S, unref as C, useSlots 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, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as b, toDisplayString as x, toHandlers as ee, toRaw as S, unref as C, useSlots as te, useTemplateRef as w, watch as T, withCtx as E } from "vue";
|
|
2
|
+
import { formatNumber as ne } from "@cfasim-ui/shared";
|
|
3
|
+
import { DropdownMenuContent as D, DropdownMenuItem as O, DropdownMenuPortal as k, DropdownMenuRoot as A, DropdownMenuTrigger as re, PopoverAnchor as j, PopoverContent as M, PopoverPortal as N, PopoverRoot as ie } from "reka-ui";
|
|
4
|
+
import { geoAlbersUsa as ae, geoMercator as P, geoPath as oe } from "d3-geo";
|
|
5
|
+
import { zoom as F, zoomIdentity as se } from "d3-zoom";
|
|
6
|
+
import { select as ce } from "d3-selection";
|
|
7
7
|
import "d3-transition";
|
|
8
|
-
import { feature as
|
|
8
|
+
import { feature as le, merge as I, mesh as ue } from "topojson-client";
|
|
9
9
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var de = ["aria-label"], fe = /* @__PURE__ */ l({
|
|
11
11
|
__name: "ChartMenu",
|
|
@@ -37,15 +37,15 @@ var de = ["aria-label"], fe = /* @__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(C(
|
|
40
|
+
}, [o("path", { d: "M4 4l8 8M12 4l-8 8" })], -1)]])) : u() ? (_(), r(C(A), {
|
|
41
41
|
key: 2,
|
|
42
42
|
modal: !1
|
|
43
43
|
}, {
|
|
44
|
-
default:
|
|
44
|
+
default: E(() => [c(C(re), {
|
|
45
45
|
class: "chart-menu-button",
|
|
46
46
|
"aria-label": "Chart options"
|
|
47
47
|
}, {
|
|
48
|
-
default:
|
|
48
|
+
default: E(() => [...i[4] ||= [o("svg", {
|
|
49
49
|
width: "16",
|
|
50
50
|
height: "16",
|
|
51
51
|
viewBox: "0 0 16 16",
|
|
@@ -69,19 +69,19 @@ var de = ["aria-label"], fe = /* @__PURE__ */ l({
|
|
|
69
69
|
})
|
|
70
70
|
], -1)]]),
|
|
71
71
|
_: 1
|
|
72
|
-
}), c(C(
|
|
73
|
-
default:
|
|
72
|
+
}), c(C(k), null, {
|
|
73
|
+
default: E(() => [c(C(D), {
|
|
74
74
|
class: "chart-menu-content",
|
|
75
75
|
"side-offset": 4,
|
|
76
76
|
align: "end"
|
|
77
77
|
}, {
|
|
78
|
-
default:
|
|
78
|
+
default: E(() => [(_(!0), a(e, null, y(t.items, (e) => (_(), r(C(O), {
|
|
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: E(() => [s(x(e.label), 1)]),
|
|
85
85
|
_: 2
|
|
86
86
|
}, 1032, ["aria-pressed", "onSelect"]))), 128))]),
|
|
87
87
|
_: 1
|
|
@@ -116,19 +116,19 @@ var de = ["aria-label"], fe = /* @__PURE__ */ l({
|
|
|
116
116
|
function R(e) {
|
|
117
117
|
return Math.round(e) + .5;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function me(e, t) {
|
|
120
120
|
let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
|
|
121
121
|
return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function he(e, t, n) {
|
|
124
124
|
if (!(n > 0) || !isFinite(n)) return [];
|
|
125
125
|
let r = [], i = Math.ceil(e / n) * n;
|
|
126
126
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
127
127
|
return r;
|
|
128
128
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
return Math.abs(e) >= 1e3 ?
|
|
129
|
+
var z = new Intl.NumberFormat();
|
|
130
|
+
function B(e) {
|
|
131
|
+
return Math.abs(e) >= 1e3 ? z.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/_shared/computeTicks.ts
|
|
@@ -137,9 +137,9 @@ function ge(e) {
|
|
|
137
137
|
if (t === n) return [];
|
|
138
138
|
let i = e.displayOffset ?? 0;
|
|
139
139
|
if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
|
|
140
|
-
if (typeof r == "number") return
|
|
141
|
-
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o =
|
|
142
|
-
return
|
|
140
|
+
if (typeof r == "number") return he(t + i, n + i, r).map((e) => e - i);
|
|
141
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = me(n - t, a);
|
|
142
|
+
return he(t + i, n + i, o).map((e) => e - i);
|
|
143
143
|
}
|
|
144
144
|
function _e(e, t, n, r) {
|
|
145
145
|
if (r === "log") {
|
|
@@ -192,8 +192,8 @@ function be(e = {}) {
|
|
|
192
192
|
measuredHeight: r
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
var
|
|
196
|
-
function
|
|
195
|
+
var xe = .6, Se = 8;
|
|
196
|
+
function V(e, t) {
|
|
197
197
|
return {
|
|
198
198
|
fontSize: e?.fontSize ?? t.fontSize,
|
|
199
199
|
fill: e?.color ?? "currentColor",
|
|
@@ -252,7 +252,7 @@ function Oe(e) {
|
|
|
252
252
|
let t = e.title();
|
|
253
253
|
if (!t) return 10;
|
|
254
254
|
let n = e.titleStyle?.()?.lineHeight ?? 18;
|
|
255
|
-
return t.split("\n").length * n +
|
|
255
|
+
return t.split("\n").length * n + Se;
|
|
256
256
|
}), o = n(() => {
|
|
257
257
|
let n = Ee(e.extraPadding?.()), r = i.value.rowCount;
|
|
258
258
|
return {
|
|
@@ -284,7 +284,7 @@ function Oe(e) {
|
|
|
284
284
|
//#endregion
|
|
285
285
|
//#region src/tooltip-position.ts
|
|
286
286
|
var ke = 16, Ae = 8;
|
|
287
|
-
function
|
|
287
|
+
function je(e, t, n, r, i, a) {
|
|
288
288
|
if (i === "none") return {
|
|
289
289
|
left: e + ke,
|
|
290
290
|
top: t
|
|
@@ -307,7 +307,7 @@ function H(e, t, n, r, i, a) {
|
|
|
307
307
|
}
|
|
308
308
|
//#endregion
|
|
309
309
|
//#region src/_shared/useChartTooltip.ts
|
|
310
|
-
function
|
|
310
|
+
function Me(e) {
|
|
311
311
|
let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null), s = null, c = "pending";
|
|
312
312
|
function l(e) {
|
|
313
313
|
return "touches" in e ? e.touches[0] ?? null : e;
|
|
@@ -321,14 +321,14 @@ function je(e) {
|
|
|
321
321
|
clientY: r.clientY
|
|
322
322
|
}, e.onHover?.({ index: i }));
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
T([a, n], () => {
|
|
325
325
|
if (n.value === null || !a.value) {
|
|
326
326
|
o.value = null;
|
|
327
327
|
return;
|
|
328
328
|
}
|
|
329
329
|
let s = i.value, c = e.containerRef.value;
|
|
330
330
|
if (!s || !c) return;
|
|
331
|
-
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } =
|
|
331
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = je(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
|
|
332
332
|
o.value = {
|
|
333
333
|
left: f - l.left,
|
|
334
334
|
top: p - l.top
|
|
@@ -395,55 +395,55 @@ function je(e) {
|
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/ChartMenu/download.ts
|
|
398
|
-
function
|
|
398
|
+
function H(e, t) {
|
|
399
399
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
400
400
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
401
401
|
}
|
|
402
|
-
var
|
|
402
|
+
var Ne = [
|
|
403
403
|
"color",
|
|
404
404
|
"font-family",
|
|
405
405
|
"font-size",
|
|
406
406
|
"font-weight"
|
|
407
|
-
],
|
|
408
|
-
function
|
|
407
|
+
], Pe = ["fill", "stroke"];
|
|
408
|
+
function U(e) {
|
|
409
409
|
let t = e.match(/^\s*var\(\s*(--[\w-]+)\s*(?:,\s*([^)]*?)\s*)?\)\s*$/);
|
|
410
410
|
if (!t) return e;
|
|
411
411
|
let [, n, r] = t;
|
|
412
412
|
return window.getComputedStyle(document.documentElement).getPropertyValue(n).trim() || (r ? r.trim() : e);
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function W(e) {
|
|
415
415
|
let t = e.cloneNode(!0);
|
|
416
416
|
t.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
417
417
|
let n = window.getComputedStyle(e), r = [];
|
|
418
|
-
for (let e of
|
|
418
|
+
for (let e of Ne) {
|
|
419
419
|
let t = n.getPropertyValue(e);
|
|
420
420
|
t && r.push(`${e}: ${t}`);
|
|
421
421
|
}
|
|
422
422
|
let i = t.getAttribute("style") ?? "";
|
|
423
423
|
t.setAttribute("style", [i, ...r].filter(Boolean).join("; "));
|
|
424
|
-
for (let e of t.querySelectorAll("*")) for (let t of
|
|
424
|
+
for (let e of t.querySelectorAll("*")) for (let t of Pe) {
|
|
425
425
|
let n = e.getAttribute(t);
|
|
426
|
-
!n || !n.includes("var(") || e.setAttribute(t,
|
|
426
|
+
!n || !n.includes("var(") || e.setAttribute(t, U(n));
|
|
427
427
|
}
|
|
428
428
|
return t;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
let n =
|
|
432
|
-
|
|
430
|
+
function Fe(e, t) {
|
|
431
|
+
let n = W(e), r = new XMLSerializer().serializeToString(n);
|
|
432
|
+
H(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
let n =
|
|
434
|
+
function G(e, t) {
|
|
435
|
+
let n = W(e), r = new XMLSerializer().serializeToString(n), i = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(i), o = new Image(), s = e.width.baseVal.value || e.clientWidth, c = e.height.baseVal.value || e.clientHeight;
|
|
436
436
|
o.onload = () => {
|
|
437
437
|
let e = document.createElement("canvas");
|
|
438
438
|
e.width = s * 2, e.height = c * 2;
|
|
439
439
|
let n = e.getContext("2d");
|
|
440
440
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
441
|
-
e &&
|
|
441
|
+
e && H(e, `${t}.png`);
|
|
442
442
|
}), URL.revokeObjectURL(a);
|
|
443
443
|
}, o.src = a;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
|
|
445
|
+
function K(e, t) {
|
|
446
|
+
H(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
447
447
|
}
|
|
448
448
|
//#endregion
|
|
449
449
|
//#region src/_shared/useChartFullscreen.ts
|
|
@@ -517,18 +517,18 @@ function Ve(e) {
|
|
|
517
517
|
i && a.push(i.menuItem.value), a.push({
|
|
518
518
|
label: "Save as SVG",
|
|
519
519
|
action: () => {
|
|
520
|
-
t.value &&
|
|
520
|
+
t.value && Fe(t.value, n);
|
|
521
521
|
}
|
|
522
522
|
}, {
|
|
523
523
|
label: "Save as PNG",
|
|
524
524
|
action: () => {
|
|
525
|
-
t.value &&
|
|
525
|
+
t.value && G(t.value, n);
|
|
526
526
|
}
|
|
527
527
|
});
|
|
528
528
|
let o = e.downloadButton?.();
|
|
529
529
|
return !e.downloadLink() && !o && a.push({
|
|
530
530
|
label: "Download CSV",
|
|
531
|
-
action: () =>
|
|
531
|
+
action: () => K(e.getCsv(), n)
|
|
532
532
|
}), a;
|
|
533
533
|
}), o = n(() => {
|
|
534
534
|
if (e.downloadButton?.()) return null;
|
|
@@ -539,7 +539,7 @@ function Ve(e) {
|
|
|
539
539
|
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
540
540
|
});
|
|
541
541
|
function l() {
|
|
542
|
-
|
|
542
|
+
K(e.getCsv(), r());
|
|
543
543
|
}
|
|
544
544
|
return {
|
|
545
545
|
svgRef: t,
|
|
@@ -591,21 +591,21 @@ var Ge = {
|
|
|
591
591
|
"d",
|
|
592
592
|
"stroke",
|
|
593
593
|
"stroke-width"
|
|
594
|
-
],
|
|
594
|
+
], Je = [
|
|
595
595
|
"fill",
|
|
596
596
|
"stroke",
|
|
597
597
|
"stroke-width",
|
|
598
598
|
"transform"
|
|
599
|
-
],
|
|
599
|
+
], Ye = [
|
|
600
600
|
"stroke",
|
|
601
601
|
"stroke-width",
|
|
602
602
|
"stroke-dasharray"
|
|
603
|
-
],
|
|
603
|
+
], q = [
|
|
604
604
|
"d",
|
|
605
605
|
"stroke",
|
|
606
606
|
"stroke-width",
|
|
607
607
|
"stroke-dasharray"
|
|
608
|
-
],
|
|
608
|
+
], Xe = ["fill", "transform"], J = [
|
|
609
609
|
"x",
|
|
610
610
|
"y",
|
|
611
611
|
"text-anchor",
|
|
@@ -614,7 +614,7 @@ var Ge = {
|
|
|
614
614
|
"fill",
|
|
615
615
|
"stroke",
|
|
616
616
|
"stroke-width"
|
|
617
|
-
],
|
|
617
|
+
], Y = ["x", "dy"], Ze = ["font-weight", "font-style"], X = 13, Z = "normal", Qe = 700, $e = "var(--color-bg-0, #fff)", et = 3, tt = 1, nt = 4, rt = 6, it = 1.2, at = .35, ot = /* @__PURE__ */ l({
|
|
618
618
|
__name: "ChartAnnotations",
|
|
619
619
|
props: {
|
|
620
620
|
annotations: { default: () => [] },
|
|
@@ -651,18 +651,18 @@ var Ge = {
|
|
|
651
651
|
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
652
652
|
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
653
653
|
if (a && !r.bounds) continue;
|
|
654
|
-
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ??
|
|
654
|
+
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? X, g = t.fontWeight ?? Z, _ = t.outlineColor ?? $e, v = t.outlineWidth ?? et, y = t.lineColor ?? m, b = t.lineWidth ?? tt, x = s(t.lineDash), ee = {
|
|
655
655
|
left: "start",
|
|
656
656
|
center: "middle",
|
|
657
657
|
right: "end"
|
|
658
|
-
}[t.align ?? (o > 0 ? "left" : o < 0 ? "right" : "center")], S, C = "", w, T = !a && (t.arrow ?? !0);
|
|
659
|
-
if (a && r.bounds)
|
|
658
|
+
}[t.align ?? (o > 0 ? "left" : o < 0 ? "right" : "center")], S = t.text.split("\n").map(c), C, te = "", w, T = !a && (t.arrow ?? !0);
|
|
659
|
+
if (a && r.bounds) C = u(i, n.x, n.y, r.bounds);
|
|
660
660
|
else {
|
|
661
|
-
let e = f(n.x, n.y, d, p, h, i);
|
|
662
|
-
|
|
661
|
+
let e = f(n.x, n.y, d, p, h, S.length, i);
|
|
662
|
+
te = e.path, T && e.arrow && (w = e.arrow);
|
|
663
663
|
}
|
|
664
664
|
e.push({
|
|
665
|
-
lines:
|
|
665
|
+
lines: S,
|
|
666
666
|
textX: d,
|
|
667
667
|
textY: p,
|
|
668
668
|
textAnchor: ee,
|
|
@@ -672,14 +672,14 @@ var Ge = {
|
|
|
672
672
|
color: m,
|
|
673
673
|
outlineColor: _,
|
|
674
674
|
outlineWidth: v,
|
|
675
|
-
pointerPath:
|
|
675
|
+
pointerPath: te,
|
|
676
676
|
lineColor: y,
|
|
677
677
|
lineWidth: b,
|
|
678
678
|
lineDash: x,
|
|
679
679
|
arrow: T,
|
|
680
680
|
arrowTip: w,
|
|
681
681
|
arrowTransform: w ? `translate(${w.x} ${w.y}) rotate(${w.angle})` : "",
|
|
682
|
-
rule:
|
|
682
|
+
rule: C
|
|
683
683
|
});
|
|
684
684
|
}
|
|
685
685
|
return e;
|
|
@@ -730,13 +730,13 @@ var Ge = {
|
|
|
730
730
|
};
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
function f(e, t, n, r, i, a) {
|
|
734
|
-
if (
|
|
735
|
-
let
|
|
736
|
-
if (
|
|
737
|
-
let i =
|
|
738
|
-
if (
|
|
739
|
-
let
|
|
733
|
+
function f(e, t, n, r, i, a, o) {
|
|
734
|
+
if (o === "none") return { path: "" };
|
|
735
|
+
let s = n - e, c = r - t, l = i * it, u = (c < 0 ? r + (a - 1) * l : r) - i * at;
|
|
736
|
+
if (s === 0 || c === 0 || o === "straight") {
|
|
737
|
+
let i = c === 0 ? r : u, a = n - e, o = i - t, s = Math.hypot(a, o);
|
|
738
|
+
if (s <= 10) return { path: "" };
|
|
739
|
+
let l = a / s, d = o / s, f = e + l * nt, p = t + d * nt, m = n - l * rt, h = i - d * rt, g = Math.atan2(-d, -l) * 180 / Math.PI;
|
|
740
740
|
return {
|
|
741
741
|
path: `M${f},${p} L${m},${h}`,
|
|
742
742
|
arrow: {
|
|
@@ -746,15 +746,15 @@ var Ge = {
|
|
|
746
746
|
}
|
|
747
747
|
};
|
|
748
748
|
}
|
|
749
|
-
let
|
|
750
|
-
if (Math.abs(
|
|
751
|
-
let
|
|
749
|
+
let d = u - t;
|
|
750
|
+
if (Math.abs(d) <= nt || Math.abs(s) <= rt) return { path: "" };
|
|
751
|
+
let f = Math.sign(s), p = Math.sign(d), m = e, h = t + p * nt, g = n - f * rt, _ = u, v = p > 0 ? -90 : 90;
|
|
752
752
|
return {
|
|
753
|
-
path: `M${
|
|
753
|
+
path: `M${m},${h} Q${m},${u} ${g},${_}`,
|
|
754
754
|
arrow: {
|
|
755
|
-
x:
|
|
756
|
-
y:
|
|
757
|
-
angle:
|
|
755
|
+
x: m,
|
|
756
|
+
y: h,
|
|
757
|
+
angle: v
|
|
758
758
|
}
|
|
759
759
|
};
|
|
760
760
|
}
|
|
@@ -786,7 +786,7 @@ var Ge = {
|
|
|
786
786
|
"stroke-width": t.outlineWidth,
|
|
787
787
|
"stroke-linejoin": "round",
|
|
788
788
|
transform: t.arrowTransform
|
|
789
|
-
}, null, 8,
|
|
789
|
+
}, null, 8, Je)) : i("", !0),
|
|
790
790
|
t.rule ? (_(), a("line", d({
|
|
791
791
|
key: 3,
|
|
792
792
|
ref_for: !0
|
|
@@ -795,7 +795,7 @@ var Ge = {
|
|
|
795
795
|
"stroke-width": t.lineWidth,
|
|
796
796
|
"stroke-dasharray": t.lineDash,
|
|
797
797
|
"stroke-linecap": "round"
|
|
798
|
-
}), null, 16,
|
|
798
|
+
}), null, 16, Ye)) : i("", !0),
|
|
799
799
|
t.pointerPath ? (_(), a("path", {
|
|
800
800
|
key: 4,
|
|
801
801
|
d: t.pointerPath,
|
|
@@ -804,13 +804,13 @@ var Ge = {
|
|
|
804
804
|
"stroke-width": t.lineWidth,
|
|
805
805
|
"stroke-dasharray": t.lineDash,
|
|
806
806
|
"stroke-linecap": "round"
|
|
807
|
-
}, null, 8,
|
|
807
|
+
}, null, 8, q)) : i("", !0),
|
|
808
808
|
t.arrowTip ? (_(), a("polygon", {
|
|
809
809
|
key: 5,
|
|
810
810
|
points: "0,0 -6,-3 -6,3",
|
|
811
811
|
fill: t.lineColor,
|
|
812
812
|
transform: t.arrowTransform
|
|
813
|
-
}, null, 8,
|
|
813
|
+
}, null, 8, Xe)) : i("", !0),
|
|
814
814
|
o("text", {
|
|
815
815
|
x: t.textX,
|
|
816
816
|
y: t.textY,
|
|
@@ -830,7 +830,7 @@ var Ge = {
|
|
|
830
830
|
key: t,
|
|
831
831
|
"font-weight": e.bold ? Qe : void 0,
|
|
832
832
|
"font-style": e.italic ? "italic" : void 0
|
|
833
|
-
}, x(e.text), 9,
|
|
833
|
+
}, x(e.text), 9, Ze))), 128))], 8, Y))), 128))], 8, J)
|
|
834
834
|
], 64))), 128))]));
|
|
835
835
|
}
|
|
836
836
|
}), st = 400, ct = 200;
|
|
@@ -858,7 +858,7 @@ function lt(e) {
|
|
|
858
858
|
width: () => g.value,
|
|
859
859
|
height: () => _.value,
|
|
860
860
|
extraPadding: e.chartPadding
|
|
861
|
-
}), { hoverIndex: C, tooltipRef:
|
|
861
|
+
}), { hoverIndex: C, tooltipRef: te, tooltipPos: w, handlers: T } = Me({
|
|
862
862
|
enabled: e.hasTooltipSlot,
|
|
863
863
|
trigger: e.tooltipTrigger,
|
|
864
864
|
clamp: () => e.tooltipClamp() ?? "chart",
|
|
@@ -879,9 +879,9 @@ function lt(e) {
|
|
|
879
879
|
innerH: ee,
|
|
880
880
|
bounds: S,
|
|
881
881
|
hoverIndex: C,
|
|
882
|
-
tooltipRef:
|
|
883
|
-
tooltipPos:
|
|
884
|
-
tooltipHandlers:
|
|
882
|
+
tooltipRef: te,
|
|
883
|
+
tooltipPos: w,
|
|
884
|
+
tooltipHandlers: T,
|
|
885
885
|
menuItems: o,
|
|
886
886
|
downloadLinkText: s,
|
|
887
887
|
csvHref: c,
|
|
@@ -898,9 +898,9 @@ function lt(e) {
|
|
|
898
898
|
function ut(e, t) {
|
|
899
899
|
return (n) => {
|
|
900
900
|
let r = e();
|
|
901
|
-
if (r !== void 0) return
|
|
901
|
+
if (r !== void 0) return ne(n, r);
|
|
902
902
|
let i = t();
|
|
903
|
-
return i === void 0 ?
|
|
903
|
+
return i === void 0 ? B(n) : ne(n, i);
|
|
904
904
|
};
|
|
905
905
|
}
|
|
906
906
|
//#endregion
|
|
@@ -955,46 +955,46 @@ function gt(e, t = "#ffffff", n = "#1a1a1a") {
|
|
|
955
955
|
}
|
|
956
956
|
//#endregion
|
|
957
957
|
//#region src/_shared/dateAxis.ts
|
|
958
|
-
var _t = /^(\d{4})-(\d{2})-(\d{2})$/, vt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/,
|
|
958
|
+
var _t = /^(\d{4})-(\d{2})-(\d{2})$/, vt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, yt = 1e3, Q = 60 * yt, bt = 60 * Q, xt = 24 * bt, St = 7 * xt, Ct = 30 * xt, wt = 365 * xt, Tt = [
|
|
959
959
|
{
|
|
960
960
|
unit: "second",
|
|
961
961
|
step: 1,
|
|
962
|
-
ms: 1 *
|
|
962
|
+
ms: 1 * yt
|
|
963
963
|
},
|
|
964
964
|
{
|
|
965
965
|
unit: "second",
|
|
966
966
|
step: 5,
|
|
967
|
-
ms: 5 *
|
|
967
|
+
ms: 5 * yt
|
|
968
968
|
},
|
|
969
969
|
{
|
|
970
970
|
unit: "second",
|
|
971
971
|
step: 15,
|
|
972
|
-
ms: 15 *
|
|
972
|
+
ms: 15 * yt
|
|
973
973
|
},
|
|
974
974
|
{
|
|
975
975
|
unit: "second",
|
|
976
976
|
step: 30,
|
|
977
|
-
ms: 30 *
|
|
977
|
+
ms: 30 * yt
|
|
978
978
|
},
|
|
979
979
|
{
|
|
980
980
|
unit: "minute",
|
|
981
981
|
step: 1,
|
|
982
|
-
ms: 1 *
|
|
982
|
+
ms: 1 * Q
|
|
983
983
|
},
|
|
984
984
|
{
|
|
985
985
|
unit: "minute",
|
|
986
986
|
step: 5,
|
|
987
|
-
ms: 5 *
|
|
987
|
+
ms: 5 * Q
|
|
988
988
|
},
|
|
989
989
|
{
|
|
990
990
|
unit: "minute",
|
|
991
991
|
step: 15,
|
|
992
|
-
ms: 15 *
|
|
992
|
+
ms: 15 * Q
|
|
993
993
|
},
|
|
994
994
|
{
|
|
995
995
|
unit: "minute",
|
|
996
996
|
step: 30,
|
|
997
|
-
ms: 30 *
|
|
997
|
+
ms: 30 * Q
|
|
998
998
|
},
|
|
999
999
|
{
|
|
1000
1000
|
unit: "hour",
|
|
@@ -1098,7 +1098,7 @@ function Dt(e, t) {
|
|
|
1098
1098
|
let e = +r[1], n = r[2] - 1, i = +r[3], a = +r[4], o = +r[5], s = r[6] ? +r[6] : 0, c = r[7] ? Number("0." + r[7]) * 1e3 : 0, l = r[8];
|
|
1099
1099
|
if (l) {
|
|
1100
1100
|
if (l === "Z" || l === "z") return Date.UTC(e, n, i, a, o, s, c);
|
|
1101
|
-
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) *
|
|
1101
|
+
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * Q;
|
|
1102
1102
|
return Date.UTC(e, n, i, a, o, s, c) - d;
|
|
1103
1103
|
}
|
|
1104
1104
|
return t === "utc" ? Date.UTC(e, n, i, a, o, s, c) : new Date(e, n, i, a, o, s, c).getTime();
|
|
@@ -1124,8 +1124,8 @@ function At(e, t) {
|
|
|
1124
1124
|
function jt(e, t, n) {
|
|
1125
1125
|
let r = new Date(e);
|
|
1126
1126
|
if (n === "utc") switch (t) {
|
|
1127
|
-
case "second": return Math.floor(e /
|
|
1128
|
-
case "minute": return Math.floor(e /
|
|
1127
|
+
case "second": return Math.floor(e / yt) * yt;
|
|
1128
|
+
case "minute": return Math.floor(e / Q) * Q;
|
|
1129
1129
|
case "hour": return Math.floor(e / bt) * bt;
|
|
1130
1130
|
case "day": return Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate());
|
|
1131
1131
|
case "week": {
|
|
@@ -1136,8 +1136,8 @@ function jt(e, t, n) {
|
|
|
1136
1136
|
case "year": return Date.UTC(r.getUTCFullYear(), 0, 1);
|
|
1137
1137
|
}
|
|
1138
1138
|
switch (t) {
|
|
1139
|
-
case "second": return Math.floor(e /
|
|
1140
|
-
case "minute": return Math.floor(e /
|
|
1139
|
+
case "second": return Math.floor(e / yt) * yt;
|
|
1140
|
+
case "minute": return Math.floor(e / Q) * Q;
|
|
1141
1141
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
|
|
1142
1142
|
case "day": return new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime();
|
|
1143
1143
|
case "week": {
|
|
@@ -1149,8 +1149,8 @@ function jt(e, t, n) {
|
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
1151
|
function Mt(e, t, n, r) {
|
|
1152
|
-
if (t === "second") return e + n *
|
|
1153
|
-
if (t === "minute") return e + n *
|
|
1152
|
+
if (t === "second") return e + n * yt;
|
|
1153
|
+
if (t === "minute") return e + n * Q;
|
|
1154
1154
|
if (t === "hour" && r === "utc") return e + n * bt;
|
|
1155
1155
|
if (t === "week" && r === "utc") return e + n * St;
|
|
1156
1156
|
let i = new Date(e);
|
|
@@ -1264,7 +1264,12 @@ function zt(e, t, n, r) {
|
|
|
1264
1264
|
var Bt = {
|
|
1265
1265
|
class: "chart-sr-only",
|
|
1266
1266
|
"aria-live": "polite"
|
|
1267
|
-
}, Vt = [
|
|
1267
|
+
}, Vt = [
|
|
1268
|
+
"width",
|
|
1269
|
+
"height",
|
|
1270
|
+
"role",
|
|
1271
|
+
"aria-label"
|
|
1272
|
+
], Ht = [
|
|
1268
1273
|
"x",
|
|
1269
1274
|
"y",
|
|
1270
1275
|
"text-anchor",
|
|
@@ -1454,6 +1459,8 @@ var Bt = {
|
|
|
1454
1459
|
height: {},
|
|
1455
1460
|
title: {},
|
|
1456
1461
|
titleStyle: {},
|
|
1462
|
+
role: {},
|
|
1463
|
+
ariaLabel: {},
|
|
1457
1464
|
axisLabelStyle: {},
|
|
1458
1465
|
tickLabelStyle: {},
|
|
1459
1466
|
legendStyle: {},
|
|
@@ -1478,21 +1485,21 @@ var Bt = {
|
|
|
1478
1485
|
},
|
|
1479
1486
|
emits: ["hover"],
|
|
1480
1487
|
setup(c, { emit: l }) {
|
|
1481
|
-
let f = c, h =
|
|
1482
|
-
function*
|
|
1488
|
+
let f = c, h = n(() => f.ariaLabel ?? f.title), g = n(() => f.role ?? (h.value ? "img" : void 0)), v = l, S = [];
|
|
1489
|
+
function* te(e) {
|
|
1483
1490
|
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);
|
|
1484
1491
|
if (e.areas) for (let t of e.areas) t.x && t.x.length > 0 && (yield t.x);
|
|
1485
1492
|
}
|
|
1486
|
-
function
|
|
1493
|
+
function w(e, t, n) {
|
|
1487
1494
|
if (!e) return;
|
|
1488
1495
|
if (!t) return e;
|
|
1489
1496
|
let r = new Float64Array(e.length);
|
|
1490
1497
|
for (let t = 0; t < e.length; t++) r[t] = Dt(e[t], n) ?? NaN;
|
|
1491
1498
|
return r;
|
|
1492
1499
|
}
|
|
1493
|
-
let
|
|
1494
|
-
let e =
|
|
1495
|
-
for (let r of
|
|
1500
|
+
let T = ut(() => f.tooltipValueFormat, () => f.yTickFormat), E = n(() => f.timezone ?? "utc"), D = n(() => {
|
|
1501
|
+
let e = E.value, t = !1, n = !1;
|
|
1502
|
+
for (let r of te(f)) {
|
|
1496
1503
|
if (n = !0, !kt(r, e)) {
|
|
1497
1504
|
t = !1;
|
|
1498
1505
|
break;
|
|
@@ -1502,42 +1509,42 @@ var Bt = {
|
|
|
1502
1509
|
n || (t = !1);
|
|
1503
1510
|
let r = f.series && f.series.length > 0 ? f.series.map((n) => ({
|
|
1504
1511
|
...n,
|
|
1505
|
-
data: n.y ?? n.data ??
|
|
1506
|
-
x:
|
|
1512
|
+
data: n.y ?? n.data ?? S,
|
|
1513
|
+
x: w(n.x, t, e)
|
|
1507
1514
|
})) : (() => {
|
|
1508
1515
|
let n = f.y ?? f.data;
|
|
1509
1516
|
return n ? [{
|
|
1510
1517
|
data: n,
|
|
1511
|
-
x:
|
|
1518
|
+
x: w(f.x, t, e)
|
|
1512
1519
|
}] : [];
|
|
1513
1520
|
})(), i = (f.areas ?? []).map((n) => ({
|
|
1514
1521
|
...n,
|
|
1515
|
-
x:
|
|
1522
|
+
x: w(n.x, t, e)
|
|
1516
1523
|
}));
|
|
1517
1524
|
return {
|
|
1518
1525
|
isDate: t,
|
|
1519
1526
|
series: r,
|
|
1520
1527
|
areas: i
|
|
1521
1528
|
};
|
|
1522
|
-
}),
|
|
1529
|
+
}), O = n(() => D.value.isDate), k = n(() => D.value.series), A = n(() => D.value.areas), re = n(() => {
|
|
1523
1530
|
let e = 0;
|
|
1524
|
-
for (let t of
|
|
1525
|
-
for (let t of
|
|
1531
|
+
for (let t of k.value) t.data.length > e && (e = t.data.length);
|
|
1532
|
+
for (let t of A.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
|
|
1526
1533
|
return e;
|
|
1527
|
-
}), j = n(() =>
|
|
1534
|
+
}), j = n(() => k.value.some((e) => e.x != null) || A.value.some((e) => e.x != null));
|
|
1528
1535
|
function M(e, t) {
|
|
1529
1536
|
return e.x ? Number(e.x[t]) : t;
|
|
1530
1537
|
}
|
|
1531
1538
|
function N(e, t) {
|
|
1532
1539
|
return e.x ? Number(e.x[t]) : t;
|
|
1533
1540
|
}
|
|
1534
|
-
let
|
|
1541
|
+
let ie = n(() => j.value ? 0 : f.xMin ?? 0), ae = n(() => {
|
|
1535
1542
|
let e = Infinity, t = -Infinity;
|
|
1536
|
-
for (let n of
|
|
1543
|
+
for (let n of k.value) for (let r = 0; r < n.data.length; r++) {
|
|
1537
1544
|
let i = M(n, r);
|
|
1538
1545
|
isFinite(i) && (i < e && (e = i), i > t && (t = i));
|
|
1539
1546
|
}
|
|
1540
|
-
for (let n of
|
|
1547
|
+
for (let n of A.value) {
|
|
1541
1548
|
let r = Math.max(n.upper.length, n.lower.length);
|
|
1542
1549
|
for (let i = 0; i < r; i++) {
|
|
1543
1550
|
let r = N(n, i);
|
|
@@ -1553,15 +1560,15 @@ var Bt = {
|
|
|
1553
1560
|
};
|
|
1554
1561
|
});
|
|
1555
1562
|
function P(e) {
|
|
1556
|
-
let { min: t, max: n } =
|
|
1563
|
+
let { min: t, max: n } = ae.value, r = n - t || 1;
|
|
1557
1564
|
return U.value.left + (e - t) / r * G.value;
|
|
1558
1565
|
}
|
|
1559
|
-
let
|
|
1566
|
+
let oe = n(() => {
|
|
1560
1567
|
let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
|
|
1561
1568
|
isFinite(r) && (r < e && (e = r), r > t && (t = r), r > 0 && r < n && (n = r));
|
|
1562
1569
|
};
|
|
1563
|
-
for (let e of
|
|
1564
|
-
for (let e of
|
|
1570
|
+
for (let e of k.value) for (let t of e.data) r(t);
|
|
1571
|
+
for (let e of A.value) {
|
|
1565
1572
|
for (let t of e.upper) r(t);
|
|
1566
1573
|
for (let t of e.lower) r(t);
|
|
1567
1574
|
}
|
|
@@ -1579,10 +1586,10 @@ var Bt = {
|
|
|
1579
1586
|
};
|
|
1580
1587
|
});
|
|
1581
1588
|
function F(e) {
|
|
1582
|
-
let { min: t, max: n } =
|
|
1589
|
+
let { min: t, max: n } = oe.value;
|
|
1583
1590
|
return U.value.top + K.value - _e(e, t, n, f.yScaleType) * K.value;
|
|
1584
1591
|
}
|
|
1585
|
-
function
|
|
1592
|
+
function se(e) {
|
|
1586
1593
|
let t = e.data;
|
|
1587
1594
|
if (t.length === 0) return "";
|
|
1588
1595
|
let n = "", r = !1;
|
|
@@ -1597,7 +1604,7 @@ var Bt = {
|
|
|
1597
1604
|
}
|
|
1598
1605
|
return n;
|
|
1599
1606
|
}
|
|
1600
|
-
function
|
|
1607
|
+
function ce(e) {
|
|
1601
1608
|
let t = e.data, n = [];
|
|
1602
1609
|
for (let r = 0; r < t.length; r++) {
|
|
1603
1610
|
let i = M(e, r);
|
|
@@ -1608,7 +1615,7 @@ var Bt = {
|
|
|
1608
1615
|
}
|
|
1609
1616
|
return n;
|
|
1610
1617
|
}
|
|
1611
|
-
function
|
|
1618
|
+
function le(e) {
|
|
1612
1619
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
1613
1620
|
if (t === 0) return "";
|
|
1614
1621
|
let n = [], r = [];
|
|
@@ -1624,16 +1631,16 @@ var Bt = {
|
|
|
1624
1631
|
return i;
|
|
1625
1632
|
}
|
|
1626
1633
|
function I(e, t) {
|
|
1627
|
-
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null &&
|
|
1634
|
+
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && k.value[e.seriesIndex] || k.value[0];
|
|
1628
1635
|
return P(r ? M(r, n) : n);
|
|
1629
1636
|
}
|
|
1630
|
-
function
|
|
1637
|
+
function ue(e, t = !0) {
|
|
1631
1638
|
let n = U.value.top + K.value;
|
|
1632
1639
|
if (e.seriesIndex == null) {
|
|
1633
1640
|
let t = I(e, "start"), r = I(e, "end");
|
|
1634
1641
|
return t > r ? "" : `M${t},${U.value.top}L${r},${U.value.top}L${r},${n}L${t},${n}Z`;
|
|
1635
1642
|
}
|
|
1636
|
-
let r =
|
|
1643
|
+
let r = k.value[e.seriesIndex];
|
|
1637
1644
|
if (!r) return "";
|
|
1638
1645
|
let i = Math.max(0, e.startIndex), a = Math.min(r.data.length - 1, e.endIndex);
|
|
1639
1646
|
if (i > a) return "";
|
|
@@ -1641,7 +1648,7 @@ var Bt = {
|
|
|
1641
1648
|
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${P(M(r, e))},${F(r.data[e])}`);
|
|
1642
1649
|
return t && (o += `L${P(M(r, a))},${n}`, o += `L${P(M(r, i))},${n}`, o += "Z"), o;
|
|
1643
1650
|
}
|
|
1644
|
-
let
|
|
1651
|
+
let de = n(() => {
|
|
1645
1652
|
let e = f.areaSections;
|
|
1646
1653
|
if (!e?.length) return {
|
|
1647
1654
|
labels: [],
|
|
@@ -1650,11 +1657,11 @@ var Bt = {
|
|
|
1650
1657
|
let t = [], n = U.value.left + G.value;
|
|
1651
1658
|
for (let r of e) {
|
|
1652
1659
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
1653
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * wn, o = I(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" :
|
|
1660
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * wn, o = I(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : k.value[r.seriesIndex]?.color ?? "currentColor"), u = V({
|
|
1654
1661
|
color: l,
|
|
1655
1662
|
fontWeight: 600,
|
|
1656
1663
|
...r.inlineLabelStyle
|
|
1657
|
-
}, { fontSize: 11 }), d =
|
|
1664
|
+
}, { fontSize: 11 }), d = V(r.inlineDescriptionStyle, {
|
|
1658
1665
|
fontSize: 11,
|
|
1659
1666
|
fillOpacity: .6
|
|
1660
1667
|
});
|
|
@@ -1686,9 +1693,9 @@ var Bt = {
|
|
|
1686
1693
|
labels: t,
|
|
1687
1694
|
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Sn + Cn
|
|
1688
1695
|
};
|
|
1689
|
-
}),
|
|
1696
|
+
}), fe = n(() => {
|
|
1690
1697
|
let e = [];
|
|
1691
|
-
for (let t of
|
|
1698
|
+
for (let t of k.value) !t.legend || t.showInLegend === !1 || e.push({
|
|
1692
1699
|
label: t.legend,
|
|
1693
1700
|
color: t.color ?? "currentColor",
|
|
1694
1701
|
type: "series",
|
|
@@ -1697,7 +1704,7 @@ var Bt = {
|
|
|
1697
1704
|
let t = f.areaSections;
|
|
1698
1705
|
if (t) for (let n of t) {
|
|
1699
1706
|
if (n.legend !== "inline" || !n.label && !n.description) continue;
|
|
1700
|
-
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" :
|
|
1707
|
+
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : k.value[n.seriesIndex]?.color ?? "currentColor");
|
|
1701
1708
|
e.push({
|
|
1702
1709
|
label: t,
|
|
1703
1710
|
color: r,
|
|
@@ -1706,8 +1713,8 @@ var Bt = {
|
|
|
1706
1713
|
});
|
|
1707
1714
|
}
|
|
1708
1715
|
return e;
|
|
1709
|
-
}),
|
|
1710
|
-
let { min: e, max: t } =
|
|
1716
|
+
}), L = n(() => fe.value.map((e) => e.label)), me = n(() => Pe.value + de.value.extraHeight), he = n(() => U.value.top + K.value + U.value.bottom + Cn), z = n(() => {
|
|
1717
|
+
let { min: e, max: t } = oe.value, n = (e) => f.yTickFormat === void 0 ? B(e) : ne(e, f.yTickFormat);
|
|
1711
1718
|
return e === t ? [{
|
|
1712
1719
|
value: n(e),
|
|
1713
1720
|
y: R(U.value.top + K.value / 2)
|
|
@@ -1725,18 +1732,18 @@ var Bt = {
|
|
|
1725
1732
|
y: R(F(e))
|
|
1726
1733
|
}));
|
|
1727
1734
|
});
|
|
1728
|
-
function
|
|
1735
|
+
function be(e, t, n) {
|
|
1729
1736
|
let r = f.xTickFormat;
|
|
1730
|
-
if (
|
|
1731
|
-
let i = e +
|
|
1732
|
-
return r === void 0 ? !j.value && f.xLabels && Number.isInteger(e) && e >= 0 && e < f.xLabels.length ? f.xLabels[e] :
|
|
1737
|
+
if (O.value) return typeof r == "function" ? r(e, t) : zt(e, r, E.value, n);
|
|
1738
|
+
let i = e + ie.value;
|
|
1739
|
+
return r === void 0 ? !j.value && f.xLabels && Number.isInteger(e) && e >= 0 && e < f.xLabels.length ? f.xLabels[e] : B(i) : typeof r == "function" ? r(i, t) : ne(i, r);
|
|
1733
1740
|
}
|
|
1734
|
-
let
|
|
1735
|
-
let { min: e, max: t } =
|
|
1741
|
+
let Se = n(() => {
|
|
1742
|
+
let { min: e, max: t } = ae.value;
|
|
1736
1743
|
if (e === t) return [];
|
|
1737
|
-
let n =
|
|
1744
|
+
let n = O.value, r = n ? 0 : ie.value, i = re.value, a = G.value / 80, o, s;
|
|
1738
1745
|
if (n) {
|
|
1739
|
-
let n = Nt(e, t, a,
|
|
1746
|
+
let n = Nt(e, t, a, E.value);
|
|
1740
1747
|
s = n.unit, o = ge({
|
|
1741
1748
|
min: e,
|
|
1742
1749
|
max: t,
|
|
@@ -1757,20 +1764,20 @@ var Bt = {
|
|
|
1757
1764
|
return o.map((e, t) => {
|
|
1758
1765
|
let n = R(P(e)), r = "middle";
|
|
1759
1766
|
return n - c <= 1 ? r = "start" : l - n <= 1 && (r = "end"), {
|
|
1760
|
-
value:
|
|
1767
|
+
value: be(e, t, s),
|
|
1761
1768
|
x: n,
|
|
1762
1769
|
anchor: r
|
|
1763
1770
|
};
|
|
1764
1771
|
});
|
|
1765
1772
|
});
|
|
1766
|
-
function
|
|
1767
|
-
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv : He(
|
|
1773
|
+
function Ce() {
|
|
1774
|
+
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv : He(k.value);
|
|
1768
1775
|
}
|
|
1769
|
-
let
|
|
1770
|
-
let e =
|
|
1776
|
+
let we = n(() => !!f.tooltipData || !!f.tooltipTrigger), Te = n(() => {
|
|
1777
|
+
let e = Le.value, t = k.value[0];
|
|
1771
1778
|
return e === null || !t ? null : M(t, e);
|
|
1772
|
-
}),
|
|
1773
|
-
function
|
|
1779
|
+
}), Ee = n(() => Te.value === null ? 0 : P(Te.value));
|
|
1780
|
+
function De(e, t) {
|
|
1774
1781
|
let n = e.data.length;
|
|
1775
1782
|
if (n === 0) return null;
|
|
1776
1783
|
let r = 0, i = Infinity;
|
|
@@ -1782,13 +1789,13 @@ var Bt = {
|
|
|
1782
1789
|
}
|
|
1783
1790
|
return i === Infinity ? null : r;
|
|
1784
1791
|
}
|
|
1785
|
-
let
|
|
1786
|
-
let e =
|
|
1792
|
+
let Oe = n(() => {
|
|
1793
|
+
let e = Te.value;
|
|
1787
1794
|
if (e === null) return [];
|
|
1788
1795
|
let t = [];
|
|
1789
|
-
for (let n of
|
|
1796
|
+
for (let n of k.value) {
|
|
1790
1797
|
if (n.showInTooltip === !1) continue;
|
|
1791
|
-
let r =
|
|
1798
|
+
let r = De(n, e);
|
|
1792
1799
|
if (r === null) continue;
|
|
1793
1800
|
let i = n.data[r];
|
|
1794
1801
|
isFinite(i) && t.push({
|
|
@@ -1798,14 +1805,14 @@ var Bt = {
|
|
|
1798
1805
|
});
|
|
1799
1806
|
}
|
|
1800
1807
|
return t;
|
|
1801
|
-
}),
|
|
1802
|
-
let e =
|
|
1808
|
+
}), ke = n(() => {
|
|
1809
|
+
let e = Le.value, t = Te.value;
|
|
1803
1810
|
if (e === null || t === null) return null;
|
|
1804
|
-
let n =
|
|
1811
|
+
let n = be(t, e), r = k.value, i = [];
|
|
1805
1812
|
for (let e = 0; e < r.length; e++) {
|
|
1806
1813
|
let n = r[e];
|
|
1807
1814
|
if (n.showInTooltip === !1) continue;
|
|
1808
|
-
let a =
|
|
1815
|
+
let a = De(n, t);
|
|
1809
1816
|
i.push({
|
|
1810
1817
|
value: a === null ? NaN : Number(n.data[a]),
|
|
1811
1818
|
color: n.color ?? "currentColor",
|
|
@@ -1819,21 +1826,21 @@ var Bt = {
|
|
|
1819
1826
|
data: f.tooltipData?.[e] ?? null
|
|
1820
1827
|
};
|
|
1821
1828
|
});
|
|
1822
|
-
function
|
|
1829
|
+
function Ae(e, t) {
|
|
1823
1830
|
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1824
|
-
x: P(e -
|
|
1831
|
+
x: P(e - ie.value),
|
|
1825
1832
|
y: F(t)
|
|
1826
1833
|
};
|
|
1827
1834
|
}
|
|
1828
|
-
function
|
|
1829
|
-
let t =
|
|
1835
|
+
function je(e) {
|
|
1836
|
+
let t = Me.value?.getBoundingClientRect();
|
|
1830
1837
|
if (!t) return null;
|
|
1831
|
-
let n =
|
|
1838
|
+
let n = k.value[0];
|
|
1832
1839
|
if (!n || n.data.length === 0) return null;
|
|
1833
|
-
let { min: r, max: i } =
|
|
1834
|
-
return
|
|
1840
|
+
let { min: r, max: i } = ae.value, a = i - r || 1;
|
|
1841
|
+
return De(n, r + (e - t.left - U.value.left) / G.value * a);
|
|
1835
1842
|
}
|
|
1836
|
-
let { containerRef:
|
|
1843
|
+
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: Ue, csvHref: We, downloadButtonText: Ge, triggerCsvDownload: Ke, menuFilename: qe, isFullscreen: Je, fullscreenStyle: Ye, teleportTarget: q, exitFullscreen: Xe } = lt({
|
|
1837
1844
|
width: () => f.width,
|
|
1838
1845
|
height: () => f.height,
|
|
1839
1846
|
title: () => f.title,
|
|
@@ -1849,17 +1856,17 @@ var Bt = {
|
|
|
1849
1856
|
downloadButton: () => f.downloadButton,
|
|
1850
1857
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
1851
1858
|
chartPadding: () => f.chartPadding,
|
|
1852
|
-
inlineLegendLabels: () =>
|
|
1853
|
-
hasTooltipSlot: () =>
|
|
1854
|
-
getCsv:
|
|
1855
|
-
pointerToIndex:
|
|
1856
|
-
onHover: (e) =>
|
|
1857
|
-
extraBelowHeight: () =>
|
|
1858
|
-
}), J = n(() =>
|
|
1859
|
+
inlineLegendLabels: () => L.value,
|
|
1860
|
+
hasTooltipSlot: () => we.value,
|
|
1861
|
+
getCsv: Ce,
|
|
1862
|
+
pointerToIndex: je,
|
|
1863
|
+
onHover: (e) => v("hover", e),
|
|
1864
|
+
extraBelowHeight: () => de.value.extraHeight
|
|
1865
|
+
}), J = n(() => V(f.axisLabelStyle, { fontSize: 13 })), Y = n(() => V(f.tickLabelStyle, {
|
|
1859
1866
|
fontSize: 10,
|
|
1860
|
-
fillOpacity:
|
|
1861
|
-
})),
|
|
1862
|
-
let e = f.titleStyle, t = e?.align ?? "left", n =
|
|
1867
|
+
fillOpacity: xe
|
|
1868
|
+
})), Ze = n(() => V(f.legendStyle, { fontSize: 11 })), X = n(() => {
|
|
1869
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = Ie.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
1863
1870
|
return {
|
|
1864
1871
|
lines: (f.title ?? "").split("\n"),
|
|
1865
1872
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -1870,8 +1877,8 @@ var Bt = {
|
|
|
1870
1877
|
anchor: i
|
|
1871
1878
|
};
|
|
1872
1879
|
}), Z = n(() => {
|
|
1873
|
-
let e =
|
|
1874
|
-
return
|
|
1880
|
+
let e = Fe.value.positions, t = U.value.left, n = W.value;
|
|
1881
|
+
return fe.value.map((r, i) => {
|
|
1875
1882
|
let a = e[i];
|
|
1876
1883
|
return {
|
|
1877
1884
|
...r,
|
|
@@ -1882,30 +1889,32 @@ var Bt = {
|
|
|
1882
1889
|
});
|
|
1883
1890
|
return (n, l) => (_(), r(t, {
|
|
1884
1891
|
to: C(q),
|
|
1885
|
-
disabled: !C(
|
|
1892
|
+
disabled: !C(Je)
|
|
1886
1893
|
}, [o("div", d({
|
|
1887
1894
|
ref_key: "containerRef",
|
|
1888
|
-
ref:
|
|
1895
|
+
ref: Me
|
|
1889
1896
|
}, n.$attrs, {
|
|
1890
|
-
class: ["line-chart-wrapper", { "is-fullscreen": C(
|
|
1891
|
-
style: C(
|
|
1897
|
+
class: ["line-chart-wrapper", { "is-fullscreen": C(Je) }],
|
|
1898
|
+
style: C(Ye)
|
|
1892
1899
|
}), [
|
|
1893
1900
|
c.menu ? (_(), r(pe, {
|
|
1894
1901
|
key: 0,
|
|
1895
|
-
items: C(
|
|
1896
|
-
"is-fullscreen": C(
|
|
1897
|
-
onClose: C(
|
|
1902
|
+
items: C(Ve),
|
|
1903
|
+
"is-fullscreen": C(Je),
|
|
1904
|
+
onClose: C(Xe)
|
|
1898
1905
|
}, null, 8, [
|
|
1899
1906
|
"items",
|
|
1900
1907
|
"is-fullscreen",
|
|
1901
1908
|
"onClose"
|
|
1902
1909
|
])) : i("", !0),
|
|
1903
|
-
o("div", Bt, x(C(
|
|
1910
|
+
o("div", Bt, x(C(Je) ? "Chart expanded to fill window" : ""), 1),
|
|
1904
1911
|
(_(), a("svg", {
|
|
1905
1912
|
ref_key: "svgRef",
|
|
1906
1913
|
ref: H,
|
|
1907
|
-
width: C(
|
|
1908
|
-
height:
|
|
1914
|
+
width: C(Ne),
|
|
1915
|
+
height: me.value,
|
|
1916
|
+
role: g.value || void 0,
|
|
1917
|
+
"aria-label": h.value || void 0
|
|
1909
1918
|
}, [
|
|
1910
1919
|
c.title ? (_(), a("text", {
|
|
1911
1920
|
key: 0,
|
|
@@ -1941,9 +1950,9 @@ var Bt = {
|
|
|
1941
1950
|
}, null, 8, Kt)), o("text", {
|
|
1942
1951
|
x: t.x + 18,
|
|
1943
1952
|
y: t.y + 4,
|
|
1944
|
-
"font-size":
|
|
1945
|
-
fill:
|
|
1946
|
-
"font-weight":
|
|
1953
|
+
"font-size": Ze.value.fontSize,
|
|
1954
|
+
fill: Ze.value.fill,
|
|
1955
|
+
"font-weight": Ze.value.fontWeight
|
|
1947
1956
|
}, x(t.label), 9, qt)], 64))), 128))])) : i("", !0),
|
|
1948
1957
|
o("line", {
|
|
1949
1958
|
x1: C(R)(C(U).left),
|
|
@@ -1970,7 +1979,7 @@ var Bt = {
|
|
|
1970
1979
|
stroke: "currentColor",
|
|
1971
1980
|
"stroke-opacity": "0.1"
|
|
1972
1981
|
}, null, 8, Xt))), 128)) : i("", !0),
|
|
1973
|
-
c.xGrid ? (_(!0), a(e, { key: 3 }, y(
|
|
1982
|
+
c.xGrid ? (_(!0), a(e, { key: 3 }, y(Se.value, (e, t) => (_(), a("line", {
|
|
1974
1983
|
key: "xg" + t,
|
|
1975
1984
|
x1: e.x,
|
|
1976
1985
|
y1: C(U).top,
|
|
@@ -2001,7 +2010,7 @@ var Bt = {
|
|
|
2001
2010
|
fill: J.value.fill,
|
|
2002
2011
|
"font-weight": J.value.fontWeight
|
|
2003
2012
|
}, x(c.yLabel), 9, $t)) : i("", !0),
|
|
2004
|
-
(_(!0), a(e, null, y(
|
|
2013
|
+
(_(!0), a(e, null, y(Se.value, (e, t) => (_(), a("text", {
|
|
2005
2014
|
key: "x" + t,
|
|
2006
2015
|
"data-testid": "x-tick",
|
|
2007
2016
|
x: e.x,
|
|
@@ -2015,24 +2024,24 @@ var Bt = {
|
|
|
2015
2024
|
c.xLabel ? (_(), a("text", {
|
|
2016
2025
|
key: 5,
|
|
2017
2026
|
x: C(U).left + C(G) / 2,
|
|
2018
|
-
y: C(
|
|
2027
|
+
y: C(Pe) - 4,
|
|
2019
2028
|
"text-anchor": "middle",
|
|
2020
2029
|
"font-size": J.value.fontSize,
|
|
2021
2030
|
fill: J.value.fill,
|
|
2022
2031
|
"font-weight": J.value.fontWeight
|
|
2023
2032
|
}, x(c.xLabel), 9, tn)) : i("", !0),
|
|
2024
|
-
(_(!0), a(e, null, y(
|
|
2033
|
+
(_(!0), a(e, null, y(A.value, (e, t) => (_(), a("path", {
|
|
2025
2034
|
key: "area" + t,
|
|
2026
|
-
d:
|
|
2035
|
+
d: le(e),
|
|
2027
2036
|
fill: e.color ?? "currentColor",
|
|
2028
2037
|
"fill-opacity": e.opacity ?? .2,
|
|
2029
2038
|
stroke: "none",
|
|
2030
2039
|
style: m(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
2031
2040
|
}, null, 12, nn))), 128)),
|
|
2032
|
-
(_(!0), a(e, null, y(
|
|
2041
|
+
(_(!0), a(e, null, y(k.value, (t, n) => (_(), a(e, { key: n }, [
|
|
2033
2042
|
t.line !== !1 && t.outline ? (_(), a("path", {
|
|
2034
2043
|
key: 0,
|
|
2035
|
-
d:
|
|
2044
|
+
d: se(t),
|
|
2036
2045
|
fill: "none",
|
|
2037
2046
|
stroke: t.outlineColor ?? "var(--color-bg-0, #fff)",
|
|
2038
2047
|
"stroke-width": (t.strokeWidth ?? 1.5) + (t.outlineWidth ?? 4),
|
|
@@ -2042,7 +2051,7 @@ var Bt = {
|
|
|
2042
2051
|
}, null, 8, rn)) : i("", !0),
|
|
2043
2052
|
t.line === !1 ? i("", !0) : (_(), a("path", {
|
|
2044
2053
|
key: 1,
|
|
2045
|
-
d:
|
|
2054
|
+
d: se(t),
|
|
2046
2055
|
fill: "none",
|
|
2047
2056
|
stroke: t.color ?? "currentColor",
|
|
2048
2057
|
"stroke-width": t.strokeWidth ?? 1.5,
|
|
@@ -2050,7 +2059,7 @@ var Bt = {
|
|
|
2050
2059
|
"stroke-dasharray": t.dashed ? "6 3" : void 0,
|
|
2051
2060
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2052
2061
|
}, null, 12, an)),
|
|
2053
|
-
t.dots ? (_(!0), a(e, { key: 2 }, y(
|
|
2062
|
+
t.dots ? (_(!0), a(e, { key: 2 }, y(ce(t), (e, n) => (_(), a("circle", {
|
|
2054
2063
|
key: n,
|
|
2055
2064
|
cx: e.x,
|
|
2056
2065
|
cy: e.y,
|
|
@@ -2063,16 +2072,16 @@ var Bt = {
|
|
|
2063
2072
|
], 64))), 128)),
|
|
2064
2073
|
(_(!0), a(e, null, y(c.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
2065
2074
|
o("path", {
|
|
2066
|
-
d:
|
|
2067
|
-
fill: t.color ?? (t.seriesIndex == null ? "#999" :
|
|
2075
|
+
d: ue(t),
|
|
2076
|
+
fill: t.color ?? (t.seriesIndex == null ? "#999" : k.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
2068
2077
|
"fill-opacity": t.opacity ?? .15,
|
|
2069
2078
|
stroke: "none"
|
|
2070
2079
|
}, null, 8, sn),
|
|
2071
2080
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
2072
2081
|
key: 0,
|
|
2073
|
-
d:
|
|
2082
|
+
d: ue(t, !1),
|
|
2074
2083
|
fill: "none",
|
|
2075
|
-
stroke: t.color ??
|
|
2084
|
+
stroke: t.color ?? k.value[t.seriesIndex]?.color ?? "currentColor",
|
|
2076
2085
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2077
2086
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2078
2087
|
}, null, 8, cn)),
|
|
@@ -2110,18 +2119,18 @@ var Bt = {
|
|
|
2110
2119
|
"stroke-opacity": "0.4"
|
|
2111
2120
|
}, null, 8, fn)
|
|
2112
2121
|
], 64))), 128)),
|
|
2113
|
-
|
|
2122
|
+
we.value && C(Le) !== null ? (_(), a("line", {
|
|
2114
2123
|
key: 6,
|
|
2115
|
-
x1: C(R)(
|
|
2124
|
+
x1: C(R)(Ee.value),
|
|
2116
2125
|
y1: C(U).top,
|
|
2117
|
-
x2: C(R)(
|
|
2126
|
+
x2: C(R)(Ee.value),
|
|
2118
2127
|
y2: C(U).top + C(K),
|
|
2119
2128
|
stroke: "currentColor",
|
|
2120
2129
|
"stroke-opacity": "0.3",
|
|
2121
2130
|
"stroke-dasharray": "4 2",
|
|
2122
2131
|
"pointer-events": "none"
|
|
2123
2132
|
}, null, 8, pn)) : i("", !0),
|
|
2124
|
-
(_(!0), a(e, null, y(
|
|
2133
|
+
(_(!0), a(e, null, y(Oe.value, (e, t) => (_(), a("circle", {
|
|
2125
2134
|
key: "hd" + t,
|
|
2126
2135
|
cx: e.x,
|
|
2127
2136
|
cy: e.y,
|
|
@@ -2131,7 +2140,7 @@ var Bt = {
|
|
|
2131
2140
|
"stroke-width": "2",
|
|
2132
2141
|
"pointer-events": "none"
|
|
2133
2142
|
}, null, 8, mn))), 128)),
|
|
2134
|
-
|
|
2143
|
+
we.value ? (_(), a("rect", d({
|
|
2135
2144
|
key: 7,
|
|
2136
2145
|
x: C(U).left,
|
|
2137
2146
|
y: C(U).top,
|
|
@@ -2142,17 +2151,17 @@ var Bt = {
|
|
|
2142
2151
|
cursor: "crosshair",
|
|
2143
2152
|
"touch-action": "pan-y"
|
|
2144
2153
|
}
|
|
2145
|
-
}, ee(C(
|
|
2154
|
+
}, ee(C(Be), !0)), null, 16, hn)) : i("", !0),
|
|
2146
2155
|
c.annotations && c.annotations.length > 0 ? (_(), r(C(ot), {
|
|
2147
2156
|
key: 8,
|
|
2148
2157
|
annotations: c.annotations,
|
|
2149
|
-
project:
|
|
2150
|
-
bounds: C(
|
|
2158
|
+
project: Ae,
|
|
2159
|
+
bounds: C(Ie)
|
|
2151
2160
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
2152
|
-
(_(!0), a(e, null, y(
|
|
2161
|
+
(_(!0), a(e, null, y(de.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
2153
2162
|
o("circle", {
|
|
2154
2163
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
2155
|
-
cy:
|
|
2164
|
+
cy: he.value + e.row * Sn + 4,
|
|
2156
2165
|
r: "4",
|
|
2157
2166
|
fill: e.color,
|
|
2158
2167
|
"fill-opacity": e.fillOpacity,
|
|
@@ -2162,7 +2171,7 @@ var Bt = {
|
|
|
2162
2171
|
e.labelText ? (_(), a("text", {
|
|
2163
2172
|
key: 0,
|
|
2164
2173
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2165
|
-
y:
|
|
2174
|
+
y: he.value + e.row * Sn + 8,
|
|
2166
2175
|
"font-size": e.labelStyle.fontSize,
|
|
2167
2176
|
"font-weight": e.labelStyle.fontWeight,
|
|
2168
2177
|
fill: e.labelStyle.fill
|
|
@@ -2170,7 +2179,7 @@ var Bt = {
|
|
|
2170
2179
|
e.descText ? (_(), a("text", {
|
|
2171
2180
|
key: 1,
|
|
2172
2181
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2173
|
-
y:
|
|
2182
|
+
y: he.value + e.row * Sn + 22,
|
|
2174
2183
|
"font-size": e.descStyle.fontSize,
|
|
2175
2184
|
"font-weight": e.descStyle.fontWeight,
|
|
2176
2185
|
fill: e.descStyle.fill,
|
|
@@ -2178,44 +2187,49 @@ var Bt = {
|
|
|
2178
2187
|
}, x(e.descText), 9, vn)) : i("", !0)
|
|
2179
2188
|
]))), 128))
|
|
2180
2189
|
], 8, Vt)),
|
|
2181
|
-
|
|
2190
|
+
we.value && C(Le) !== null && ke.value ? (_(), a("div", {
|
|
2182
2191
|
key: 1,
|
|
2183
2192
|
ref_key: "tooltipRef",
|
|
2184
|
-
ref:
|
|
2193
|
+
ref: Re,
|
|
2185
2194
|
class: "chart-tooltip-content",
|
|
2186
2195
|
style: m({
|
|
2187
2196
|
position: "absolute",
|
|
2188
2197
|
top: "0",
|
|
2189
2198
|
left: "0",
|
|
2190
2199
|
willChange: "transform",
|
|
2191
|
-
transform: C(
|
|
2192
|
-
visibility: C(
|
|
2200
|
+
transform: C(ze) ? `translate3d(${C(ze).left}px, ${C(ze).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2201
|
+
visibility: C(ze) ? "visible" : "hidden"
|
|
2193
2202
|
})
|
|
2194
|
-
}, [b(n.$slots, "tooltip", p(u(
|
|
2203
|
+
}, [b(n.$slots, "tooltip", p(u(ke.value)), () => [o("div", yn, [ke.value.xLabel ? (_(), a("div", bn, x(ke.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(ke.value.values, (e) => (_(), a("div", {
|
|
2195
2204
|
key: e.seriesIndex,
|
|
2196
2205
|
class: "line-chart-tooltip-row"
|
|
2197
2206
|
}, [o("span", {
|
|
2198
2207
|
class: "line-chart-tooltip-swatch",
|
|
2199
2208
|
style: m({ background: e.color })
|
|
2200
|
-
}, null, 4), s(" " + x(isFinite(e.value) ? C(
|
|
2201
|
-
C(
|
|
2209
|
+
}, null, 4), s(" " + x(isFinite(e.value) ? C(T)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2210
|
+
C(Ue) ? (_(), a("a", {
|
|
2202
2211
|
key: 2,
|
|
2203
2212
|
class: "line-chart-download-link",
|
|
2204
|
-
href: C(
|
|
2205
|
-
download: `${C(
|
|
2206
|
-
}, x(C(
|
|
2207
|
-
C(
|
|
2213
|
+
href: C(We),
|
|
2214
|
+
download: `${C(qe)()}.csv`
|
|
2215
|
+
}, x(C(Ue)), 9, xn)) : i("", !0),
|
|
2216
|
+
C(Ge) ? (_(), a("button", {
|
|
2208
2217
|
key: 3,
|
|
2209
2218
|
type: "button",
|
|
2210
2219
|
class: "line-chart-download-button",
|
|
2211
|
-
onClick: l[0] ||= (...e) => C(
|
|
2212
|
-
}, x(C(
|
|
2220
|
+
onClick: l[0] ||= (...e) => C(Ke) && C(Ke)(...e)
|
|
2221
|
+
}, x(C(Ge)), 1)) : i("", !0)
|
|
2213
2222
|
], 16)], 8, ["to", "disabled"]));
|
|
2214
2223
|
}
|
|
2215
|
-
}), [["__scopeId", "data-v-
|
|
2224
|
+
}), [["__scopeId", "data-v-a3132bed"]]), Dn = {
|
|
2216
2225
|
class: "chart-sr-only",
|
|
2217
2226
|
"aria-live": "polite"
|
|
2218
|
-
}, On = [
|
|
2227
|
+
}, On = [
|
|
2228
|
+
"width",
|
|
2229
|
+
"height",
|
|
2230
|
+
"role",
|
|
2231
|
+
"aria-label"
|
|
2232
|
+
], kn = [
|
|
2219
2233
|
"x",
|
|
2220
2234
|
"y",
|
|
2221
2235
|
"text-anchor",
|
|
@@ -2378,6 +2392,8 @@ var Bt = {
|
|
|
2378
2392
|
height: {},
|
|
2379
2393
|
title: {},
|
|
2380
2394
|
titleStyle: {},
|
|
2395
|
+
role: {},
|
|
2396
|
+
ariaLabel: {},
|
|
2381
2397
|
axisLabelStyle: {},
|
|
2382
2398
|
tickLabelStyle: {},
|
|
2383
2399
|
legendStyle: {},
|
|
@@ -2402,10 +2418,10 @@ var Bt = {
|
|
|
2402
2418
|
},
|
|
2403
2419
|
emits: ["hover"],
|
|
2404
2420
|
setup(c, { emit: l }) {
|
|
2405
|
-
let f = c, h =
|
|
2406
|
-
function
|
|
2421
|
+
let f = c, h = n(() => f.ariaLabel ?? f.title), g = n(() => f.role ?? (h.value ? "img" : void 0)), v = l, S = [];
|
|
2422
|
+
function te(e) {
|
|
2407
2423
|
return {
|
|
2408
|
-
data: e.y ?? e.data ??
|
|
2424
|
+
data: e.y ?? e.data ?? S,
|
|
2409
2425
|
color: e.color,
|
|
2410
2426
|
opacity: e.opacity,
|
|
2411
2427
|
blendMode: e.blendMode,
|
|
@@ -2414,43 +2430,43 @@ var Bt = {
|
|
|
2414
2430
|
showInTooltip: e.showInTooltip
|
|
2415
2431
|
};
|
|
2416
2432
|
}
|
|
2417
|
-
let
|
|
2418
|
-
if (f.series && f.series.length > 0) return f.series.map(
|
|
2433
|
+
let w = n(() => {
|
|
2434
|
+
if (f.series && f.series.length > 0) return f.series.map(te);
|
|
2419
2435
|
let e = f.y ?? f.data;
|
|
2420
2436
|
return e ? [{ data: e }] : [];
|
|
2421
|
-
}),
|
|
2437
|
+
}), T = n(() => {
|
|
2422
2438
|
let e = f.categories?.length ?? 0;
|
|
2423
|
-
for (let t of
|
|
2439
|
+
for (let t of w.value) t.data.length > e && (e = t.data.length);
|
|
2424
2440
|
return e;
|
|
2425
|
-
}),
|
|
2426
|
-
let e =
|
|
2441
|
+
}), E = n(() => {
|
|
2442
|
+
let e = T.value, t = Array(e);
|
|
2427
2443
|
for (let n = 0; n < e; n++) {
|
|
2428
2444
|
let e = f.categories?.[n];
|
|
2429
2445
|
e instanceof Date ? t[n] = e.toISOString().slice(0, 10) : t[n] = e ?? String(n);
|
|
2430
2446
|
}
|
|
2431
2447
|
return t;
|
|
2432
|
-
}),
|
|
2448
|
+
}), D = n(() => {
|
|
2433
2449
|
let e = f.categories;
|
|
2434
2450
|
if (!e || e.length === 0 || !kt(e, "utc")) return null;
|
|
2435
2451
|
let t = Array(e.length);
|
|
2436
2452
|
for (let n = 0; n < e.length; n++) t[n] = Dt(e[n], "utc") ?? NaN;
|
|
2437
2453
|
return t;
|
|
2438
|
-
}),
|
|
2454
|
+
}), O = n(() => f.orientation === "vertical"), k = n(() => {
|
|
2439
2455
|
let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
|
|
2440
2456
|
e > 0 && e < n && (n = e);
|
|
2441
2457
|
};
|
|
2442
2458
|
if (f.layout === "stacked") {
|
|
2443
|
-
let n =
|
|
2459
|
+
let n = T.value;
|
|
2444
2460
|
for (let i = 0; i < n; i++) {
|
|
2445
2461
|
let n = 0, a = 0;
|
|
2446
|
-
for (let e of
|
|
2462
|
+
for (let e of w.value) {
|
|
2447
2463
|
if (i >= e.data.length) continue;
|
|
2448
2464
|
let t = Number(e.data[i]);
|
|
2449
2465
|
isFinite(t) && (r(t), t >= 0 ? n += t : a += t);
|
|
2450
2466
|
}
|
|
2451
2467
|
n > t && (t = n), a < e && (e = a);
|
|
2452
2468
|
}
|
|
2453
|
-
} else for (let n of
|
|
2469
|
+
} else for (let n of w.value) for (let i of n.data) {
|
|
2454
2470
|
let n = Number(i);
|
|
2455
2471
|
isFinite(n) && (r(n), n < e && (e = n), n > t && (t = n));
|
|
2456
2472
|
}
|
|
@@ -2463,30 +2479,30 @@ var Bt = {
|
|
|
2463
2479
|
max: a.max,
|
|
2464
2480
|
range: a.max - a.min || 1
|
|
2465
2481
|
};
|
|
2466
|
-
}),
|
|
2467
|
-
let e =
|
|
2468
|
-
return e > 0 ?
|
|
2482
|
+
}), A = n(() => O.value ? U.value : W.value), re = n(() => O.value ? W.value : U.value), j = n(() => {
|
|
2483
|
+
let e = T.value;
|
|
2484
|
+
return e > 0 ? A.value / e : 0;
|
|
2469
2485
|
}), M = n(() => j.value * (1 - f.barPadding)), N = n(() => {
|
|
2470
|
-
let e =
|
|
2486
|
+
let e = w.value.length;
|
|
2471
2487
|
if (e === 0) return 0;
|
|
2472
2488
|
if (f.layout === "stacked" || e === 1) return M.value;
|
|
2473
2489
|
let t = f.groupGap * (e - 1);
|
|
2474
2490
|
return Math.max(1, (M.value - t) / e);
|
|
2475
2491
|
});
|
|
2476
|
-
function
|
|
2477
|
-
return (
|
|
2492
|
+
function ie(e) {
|
|
2493
|
+
return (O.value ? H.value.left : H.value.top) + e * j.value;
|
|
2478
2494
|
}
|
|
2479
|
-
let
|
|
2480
|
-
let { min: e, max: t } =
|
|
2495
|
+
let ae = n(() => {
|
|
2496
|
+
let { min: e, max: t } = k.value, n = f.valueMin ?? 0;
|
|
2481
2497
|
return P(Math.max(e, Math.min(t, n)));
|
|
2482
2498
|
});
|
|
2483
2499
|
function P(e) {
|
|
2484
|
-
let { min: t, max: n } =
|
|
2485
|
-
return
|
|
2500
|
+
let { min: t, max: n } = k.value, r = _e(e, t, n, f.valueScaleType);
|
|
2501
|
+
return O.value ? H.value.top + W.value - r * W.value : H.value.left + r * U.value;
|
|
2486
2502
|
}
|
|
2487
|
-
function
|
|
2503
|
+
function oe(e, t, n, r, i, a, o, s, c, l) {
|
|
2488
2504
|
let u = Math.min(e, t), d = Math.abs(e - t);
|
|
2489
|
-
return
|
|
2505
|
+
return O.value ? {
|
|
2490
2506
|
x: n,
|
|
2491
2507
|
y: u,
|
|
2492
2508
|
w: r,
|
|
@@ -2511,33 +2527,33 @@ var Bt = {
|
|
|
2511
2527
|
};
|
|
2512
2528
|
}
|
|
2513
2529
|
let F = n(() => {
|
|
2514
|
-
let e = [], t =
|
|
2530
|
+
let e = [], t = w.value, n = t.length;
|
|
2515
2531
|
if (n === 0) return e;
|
|
2516
|
-
let r =
|
|
2532
|
+
let r = T.value, i = j.value, a = M.value, o = N.value, s = (i - a) / 2, c = ae.value;
|
|
2517
2533
|
for (let i = 0; i < r; i++) {
|
|
2518
|
-
let r =
|
|
2534
|
+
let r = ie(i) + s;
|
|
2519
2535
|
if (f.layout === "stacked") {
|
|
2520
2536
|
let o = 0, s = 0;
|
|
2521
2537
|
for (let c = 0; c < n; c++) {
|
|
2522
2538
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
2523
2539
|
if (!isFinite(l)) continue;
|
|
2524
2540
|
let u = l >= 0 ? o : s, d = u + l;
|
|
2525
|
-
e.push(
|
|
2541
|
+
e.push(oe(P(u), P(d), r, a, n.color ?? L(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
|
|
2526
2542
|
}
|
|
2527
2543
|
} else if (f.layout === "overlay") for (let o = 0; o < n; o++) {
|
|
2528
2544
|
let n = t[o], s = Number(n.data[i] ?? NaN);
|
|
2529
|
-
isFinite(s) && e.push(
|
|
2545
|
+
isFinite(s) && e.push(oe(c, P(s), r, a, n.color ?? L(o), n.opacity ?? 1, n.blendMode, s, i, o));
|
|
2530
2546
|
}
|
|
2531
2547
|
else for (let a = 0; a < n; a++) {
|
|
2532
2548
|
let s = t[a], l = Number(s.data[i] ?? NaN);
|
|
2533
2549
|
if (!isFinite(l)) continue;
|
|
2534
2550
|
let u = r + (n === 1 ? 0 : a * (o + f.groupGap));
|
|
2535
|
-
e.push(
|
|
2551
|
+
e.push(oe(c, P(l), u, o, s.color ?? L(a), s.opacity ?? 1, s.blendMode, l, i, a));
|
|
2536
2552
|
}
|
|
2537
2553
|
}
|
|
2538
2554
|
return e;
|
|
2539
2555
|
});
|
|
2540
|
-
function
|
|
2556
|
+
function se(e) {
|
|
2541
2557
|
let t = Infinity, n = -Infinity;
|
|
2542
2558
|
for (let r of e.data) {
|
|
2543
2559
|
let e = Number(r);
|
|
@@ -2548,9 +2564,9 @@ var Bt = {
|
|
|
2548
2564
|
max: n
|
|
2549
2565
|
};
|
|
2550
2566
|
}
|
|
2551
|
-
function
|
|
2552
|
-
let r = (
|
|
2553
|
-
return
|
|
2567
|
+
function ce(e, t, n) {
|
|
2568
|
+
let r = (O.value ? H.value.left : H.value.top) + (e + .5) * j.value, i = n.max - n.min || 1, a = (t - n.min) / i;
|
|
2569
|
+
return O.value ? {
|
|
2554
2570
|
x: r,
|
|
2555
2571
|
y: H.value.top + W.value - a * W.value
|
|
2556
2572
|
} : {
|
|
@@ -2558,23 +2574,23 @@ var Bt = {
|
|
|
2558
2574
|
y: r
|
|
2559
2575
|
};
|
|
2560
2576
|
}
|
|
2561
|
-
let
|
|
2577
|
+
let le = n(() => {
|
|
2562
2578
|
let e = f.summaryLines;
|
|
2563
2579
|
return !e || e.length === 0 ? [] : e.map((e, t) => ({
|
|
2564
|
-
data: e.data ??
|
|
2580
|
+
data: e.data ?? S,
|
|
2565
2581
|
x: e.x,
|
|
2566
|
-
color: e.color ??
|
|
2582
|
+
color: e.color ?? de(t),
|
|
2567
2583
|
strokeWidth: e.strokeWidth ?? 2,
|
|
2568
2584
|
dashed: e.dashed ?? !1,
|
|
2569
2585
|
opacity: e.opacity ?? 1,
|
|
2570
2586
|
blendMode: e.blendMode,
|
|
2571
2587
|
dots: e.dots ?? !1,
|
|
2572
2588
|
dotRadius: e.dotRadius ?? (e.strokeWidth ?? 2) + 1,
|
|
2573
|
-
extent:
|
|
2589
|
+
extent: se(e),
|
|
2574
2590
|
legend: e.legend,
|
|
2575
2591
|
showInLegend: e.showInLegend !== !1
|
|
2576
2592
|
}));
|
|
2577
|
-
}), I = n(() => j.value === 0 ? [] :
|
|
2593
|
+
}), I = n(() => j.value === 0 ? [] : le.value.map((e) => {
|
|
2578
2594
|
let t = [], n = "", r = !1;
|
|
2579
2595
|
for (let i = 0; i < e.data.length; i++) {
|
|
2580
2596
|
let a = Number(e.data[i]), o = e.x ? Number(e.x[i]) : i;
|
|
@@ -2582,7 +2598,7 @@ var Bt = {
|
|
|
2582
2598
|
r = !1;
|
|
2583
2599
|
continue;
|
|
2584
2600
|
}
|
|
2585
|
-
let s =
|
|
2601
|
+
let s = ce(o, a, e.extent);
|
|
2586
2602
|
t.push(s), n += r ? `L${s.x},${s.y}` : `M${s.x},${s.y}`, r = !0;
|
|
2587
2603
|
}
|
|
2588
2604
|
return {
|
|
@@ -2590,16 +2606,16 @@ var Bt = {
|
|
|
2590
2606
|
pathD: n,
|
|
2591
2607
|
points: t
|
|
2592
2608
|
};
|
|
2593
|
-
})),
|
|
2609
|
+
})), ue = [
|
|
2594
2610
|
"var(--color-fg-1, #111)",
|
|
2595
2611
|
"var(--color-danger, #ef4444)",
|
|
2596
2612
|
"var(--color-success, #10b981)",
|
|
2597
2613
|
"var(--color-info, #6366f1)"
|
|
2598
2614
|
];
|
|
2599
|
-
function
|
|
2600
|
-
return
|
|
2615
|
+
function de(e) {
|
|
2616
|
+
return ue[e % ue.length];
|
|
2601
2617
|
}
|
|
2602
|
-
let
|
|
2618
|
+
let fe = [
|
|
2603
2619
|
"var(--color-primary, #3b82f6)",
|
|
2604
2620
|
"var(--color-accent, #f59e0b)",
|
|
2605
2621
|
"var(--color-success, #10b981)",
|
|
@@ -2607,16 +2623,16 @@ var Bt = {
|
|
|
2607
2623
|
"var(--color-info, #6366f1)",
|
|
2608
2624
|
"var(--color-warning, #d97706)"
|
|
2609
2625
|
];
|
|
2610
|
-
function
|
|
2611
|
-
return
|
|
2626
|
+
function L(e) {
|
|
2627
|
+
return fe[e % fe.length];
|
|
2612
2628
|
}
|
|
2613
|
-
let
|
|
2614
|
-
let { min: e, max: t } =
|
|
2629
|
+
let me = ut(() => f.tooltipValueFormat, () => f.valueTickFormat), he = n(() => {
|
|
2630
|
+
let { min: e, max: t } = k.value, n = (e) => f.valueTickFormat === void 0 ? B(e) : ne(e, f.valueTickFormat);
|
|
2615
2631
|
if (e === t) return [{
|
|
2616
2632
|
value: n(e),
|
|
2617
2633
|
pos: R(P(e))
|
|
2618
2634
|
}];
|
|
2619
|
-
let r =
|
|
2635
|
+
let r = O.value ? 50 : 80;
|
|
2620
2636
|
return (f.valueScaleType === "log" ? ye({
|
|
2621
2637
|
min: e,
|
|
2622
2638
|
max: t,
|
|
@@ -2625,18 +2641,18 @@ var Bt = {
|
|
|
2625
2641
|
min: e,
|
|
2626
2642
|
max: t,
|
|
2627
2643
|
ticks: f.valueTicks,
|
|
2628
|
-
targetTickCount:
|
|
2644
|
+
targetTickCount: re.value / r
|
|
2629
2645
|
})).map((e) => ({
|
|
2630
2646
|
value: n(e),
|
|
2631
2647
|
pos: R(P(e))
|
|
2632
2648
|
}));
|
|
2633
2649
|
}), z = n(() => {
|
|
2634
|
-
let e =
|
|
2650
|
+
let e = T.value, t = D.value;
|
|
2635
2651
|
if (t && t.length > 0) {
|
|
2636
2652
|
let e = Infinity, n = -Infinity;
|
|
2637
2653
|
for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
|
|
2638
2654
|
if (!Number.isFinite(e) || e === n) return [];
|
|
2639
|
-
let r =
|
|
2655
|
+
let r = O.value ? U.value : W.value, i = Math.max(2, Math.floor(r / 80)), a = Nt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
|
|
2640
2656
|
for (let e of a.values) {
|
|
2641
2657
|
let n = -1, r = Infinity;
|
|
2642
2658
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -2645,7 +2661,7 @@ var Bt = {
|
|
|
2645
2661
|
}
|
|
2646
2662
|
if (n < 0 || c.has(n)) continue;
|
|
2647
2663
|
c.add(n);
|
|
2648
|
-
let i =
|
|
2664
|
+
let i = ie(n) + j.value / 2, a = f.categoryFormat ? f.categoryFormat(E.value[n], n) : zt(t[n], f.dateFormat, "utc", o);
|
|
2649
2665
|
s.push({
|
|
2650
2666
|
label: a,
|
|
2651
2667
|
pos: i,
|
|
@@ -2655,10 +2671,10 @@ var Bt = {
|
|
|
2655
2671
|
return s;
|
|
2656
2672
|
}
|
|
2657
2673
|
let n = [], r = (e, t) => f.categoryFormat ? f.categoryFormat(e, t) : e, i = Array(e), a = 0;
|
|
2658
|
-
for (let t = 0; t < e; t++) i[t] = r(
|
|
2659
|
-
let o = f.tickLabelStyle?.fontSize ?? 10, s =
|
|
2674
|
+
for (let t = 0; t < e; t++) i[t] = r(E.value[t], t), i[t].length > a && (a = i[t].length);
|
|
2675
|
+
let o = f.tickLabelStyle?.fontSize ?? 10, s = O.value ? a * o * .6 + 8 : o * 1.2 + 8, c = j.value > 0 ? Math.max(1, Math.ceil(s / j.value)) : 1;
|
|
2660
2676
|
for (let t = 0; t < e; t += c) {
|
|
2661
|
-
let e =
|
|
2677
|
+
let e = ie(t) + j.value / 2;
|
|
2662
2678
|
n.push({
|
|
2663
2679
|
label: i[t],
|
|
2664
2680
|
pos: e,
|
|
@@ -2666,15 +2682,15 @@ var Bt = {
|
|
|
2666
2682
|
});
|
|
2667
2683
|
}
|
|
2668
2684
|
return n;
|
|
2669
|
-
}),
|
|
2685
|
+
}), be = n(() => {
|
|
2670
2686
|
let e = [];
|
|
2671
|
-
return
|
|
2687
|
+
return w.value.forEach((t, n) => {
|
|
2672
2688
|
!t.legend || t.showInLegend === !1 || e.push({
|
|
2673
2689
|
label: t.legend,
|
|
2674
|
-
color: t.color ??
|
|
2690
|
+
color: t.color ?? L(n),
|
|
2675
2691
|
kind: "bar"
|
|
2676
2692
|
});
|
|
2677
|
-
}),
|
|
2693
|
+
}), le.value.forEach((t) => {
|
|
2678
2694
|
!t.legend || !t.showInLegend || e.push({
|
|
2679
2695
|
label: t.legend,
|
|
2680
2696
|
color: t.color,
|
|
@@ -2682,21 +2698,21 @@ var Bt = {
|
|
|
2682
2698
|
dashed: t.dashed
|
|
2683
2699
|
});
|
|
2684
2700
|
}), e;
|
|
2685
|
-
}),
|
|
2686
|
-
function
|
|
2701
|
+
}), Se = n(() => be.value.map((e) => e.label));
|
|
2702
|
+
function Ce() {
|
|
2687
2703
|
if (typeof f.csv == "function") return f.csv();
|
|
2688
2704
|
if (typeof f.csv == "string") return f.csv;
|
|
2689
|
-
let e =
|
|
2705
|
+
let e = w.value.map((e) => ({
|
|
2690
2706
|
label: e.legend,
|
|
2691
2707
|
data: e.data
|
|
2692
2708
|
}));
|
|
2693
|
-
return Ue(
|
|
2709
|
+
return Ue(E.value, e);
|
|
2694
2710
|
}
|
|
2695
|
-
let
|
|
2696
|
-
function
|
|
2711
|
+
let we = n(() => !!f.tooltipData || !!f.tooltipTrigger);
|
|
2712
|
+
function Te(e, t) {
|
|
2697
2713
|
if (!isFinite(e) || !isFinite(t) || j.value === 0) return null;
|
|
2698
|
-
let n = (
|
|
2699
|
-
return
|
|
2714
|
+
let n = (O.value ? H.value.left : H.value.top) + (e + .5) * j.value, r = P(t);
|
|
2715
|
+
return O.value ? {
|
|
2700
2716
|
x: n,
|
|
2701
2717
|
y: r
|
|
2702
2718
|
} : {
|
|
@@ -2704,16 +2720,16 @@ var Bt = {
|
|
|
2704
2720
|
y: n
|
|
2705
2721
|
};
|
|
2706
2722
|
}
|
|
2707
|
-
function
|
|
2708
|
-
let n =
|
|
2723
|
+
function Ee(e, t) {
|
|
2724
|
+
let n = ke.value?.getBoundingClientRect();
|
|
2709
2725
|
if (!n) return null;
|
|
2710
|
-
let r =
|
|
2726
|
+
let r = T.value;
|
|
2711
2727
|
if (r === 0 || j.value === 0) return null;
|
|
2712
|
-
let i =
|
|
2728
|
+
let i = O.value ? e - n.left - H.value.left : t - n.top - H.value.top;
|
|
2713
2729
|
return Math.max(0, Math.min(r - 1, Math.floor(i / j.value)));
|
|
2714
2730
|
}
|
|
2715
|
-
let
|
|
2716
|
-
let e =
|
|
2731
|
+
let De = n(() => !!(f.categoryHeader || f.valueHeader)), Oe = n(() => {
|
|
2732
|
+
let e = De.value ? er : 0, t = f.chartPadding;
|
|
2717
2733
|
return e ? t == null ? { top: e } : typeof t == "number" ? {
|
|
2718
2734
|
top: t + e,
|
|
2719
2735
|
right: t,
|
|
@@ -2723,7 +2739,7 @@ var Bt = {
|
|
|
2723
2739
|
...t,
|
|
2724
2740
|
top: (t.top ?? 0) + e
|
|
2725
2741
|
} : t;
|
|
2726
|
-
}), { containerRef:
|
|
2742
|
+
}), { containerRef: ke, svgRef: Ae, width: je, height: Me, padding: H, legendY: Ne, inlineLegendLayout: Pe, innerW: U, innerH: W, bounds: Fe, hoverIndex: G, tooltipRef: K, tooltipPos: Ie, tooltipHandlers: Le, menuItems: Re, downloadLinkText: ze, csvHref: Be, downloadButtonText: Ve, triggerCsvDownload: He, menuFilename: We, isFullscreen: Ge, fullscreenStyle: Ke, teleportTarget: qe, exitFullscreen: Je } = lt({
|
|
2727
2743
|
width: () => f.width,
|
|
2728
2744
|
height: () => f.height,
|
|
2729
2745
|
title: () => f.title,
|
|
@@ -2738,18 +2754,18 @@ var Bt = {
|
|
|
2738
2754
|
downloadLink: () => f.downloadLink,
|
|
2739
2755
|
downloadButton: () => f.downloadButton,
|
|
2740
2756
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
2741
|
-
chartPadding: () =>
|
|
2742
|
-
inlineLegendLabels: () =>
|
|
2743
|
-
hasTooltipSlot: () =>
|
|
2744
|
-
getCsv:
|
|
2745
|
-
pointerToIndex:
|
|
2746
|
-
scrubAxis: () =>
|
|
2747
|
-
onHover: (e) =>
|
|
2748
|
-
}),
|
|
2757
|
+
chartPadding: () => Oe.value,
|
|
2758
|
+
inlineLegendLabels: () => Se.value,
|
|
2759
|
+
hasTooltipSlot: () => we.value,
|
|
2760
|
+
getCsv: Ce,
|
|
2761
|
+
pointerToIndex: Ee,
|
|
2762
|
+
scrubAxis: () => O.value ? "x" : "y",
|
|
2763
|
+
onHover: (e) => v("hover", e)
|
|
2764
|
+
}), Ye = n(() => V(f.axisLabelStyle, { fontSize: 13 })), q = n(() => V(f.tickLabelStyle, {
|
|
2749
2765
|
fontSize: 10,
|
|
2750
|
-
fillOpacity:
|
|
2751
|
-
})),
|
|
2752
|
-
let e = f.titleStyle, t = e?.align ?? "left", n =
|
|
2766
|
+
fillOpacity: xe
|
|
2767
|
+
})), Xe = n(() => V(f.legendStyle, { fontSize: 11 })), J = n(() => f.categoryAlign === "start" && !O.value ? tr : H.value.left), Y = n(() => {
|
|
2768
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = Fe.value, r = t === "left" ? J.value : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
2753
2769
|
return {
|
|
2754
2770
|
lines: (f.title ?? "").split("\n"),
|
|
2755
2771
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -2759,34 +2775,34 @@ var Bt = {
|
|
|
2759
2775
|
x: r,
|
|
2760
2776
|
anchor: i
|
|
2761
2777
|
};
|
|
2762
|
-
}),
|
|
2778
|
+
}), Ze = n(() => {
|
|
2763
2779
|
let e = G.value;
|
|
2764
2780
|
if (e === null) return;
|
|
2765
|
-
let t =
|
|
2766
|
-
return t && Number.isFinite(t[e]) ? zt(t[e], f.dateFormat, "utc") :
|
|
2781
|
+
let t = D.value;
|
|
2782
|
+
return t && Number.isFinite(t[e]) ? zt(t[e], f.dateFormat, "utc") : E.value[e];
|
|
2767
2783
|
}), X = n(() => {
|
|
2768
2784
|
let e = G.value;
|
|
2769
2785
|
if (e === null) return null;
|
|
2770
|
-
let t =
|
|
2786
|
+
let t = w.value, n = [];
|
|
2771
2787
|
for (let r = 0; r < t.length; r++) {
|
|
2772
2788
|
let i = t[r];
|
|
2773
2789
|
i.showInTooltip !== !1 && n.push({
|
|
2774
2790
|
value: Number(i.data[e] ?? NaN),
|
|
2775
|
-
color: i.color ??
|
|
2791
|
+
color: i.color ?? L(r),
|
|
2776
2792
|
seriesIndex: r
|
|
2777
2793
|
});
|
|
2778
2794
|
}
|
|
2779
2795
|
return {
|
|
2780
2796
|
index: e,
|
|
2781
|
-
category:
|
|
2797
|
+
category: E.value[e] ?? String(e),
|
|
2782
2798
|
values: n,
|
|
2783
2799
|
data: f.tooltipData?.[e] ?? null
|
|
2784
2800
|
};
|
|
2785
2801
|
}), Z = n(() => {
|
|
2786
2802
|
let e = G.value;
|
|
2787
2803
|
if (e === null) return null;
|
|
2788
|
-
let t =
|
|
2789
|
-
return
|
|
2804
|
+
let t = ie(e);
|
|
2805
|
+
return O.value ? {
|
|
2790
2806
|
x: t,
|
|
2791
2807
|
y: H.value.top,
|
|
2792
2808
|
w: j.value,
|
|
@@ -2797,9 +2813,9 @@ var Bt = {
|
|
|
2797
2813
|
w: U.value,
|
|
2798
2814
|
h: j.value
|
|
2799
2815
|
};
|
|
2800
|
-
}),
|
|
2801
|
-
let e =
|
|
2802
|
-
return
|
|
2816
|
+
}), Qe = n(() => {
|
|
2817
|
+
let e = Pe.value.positions, t = J.value, n = Ne.value;
|
|
2818
|
+
return be.value.map((r, i) => {
|
|
2803
2819
|
let a = e[i];
|
|
2804
2820
|
return {
|
|
2805
2821
|
...r,
|
|
@@ -2807,7 +2823,7 @@ var Bt = {
|
|
|
2807
2823
|
y: n + a.row * 20
|
|
2808
2824
|
};
|
|
2809
2825
|
});
|
|
2810
|
-
}),
|
|
2826
|
+
}), $e = n(() => {
|
|
2811
2827
|
let e = f.barLabels;
|
|
2812
2828
|
if (!e) return null;
|
|
2813
2829
|
let t = e === !0 ? {} : e;
|
|
@@ -2822,27 +2838,27 @@ var Bt = {
|
|
|
2822
2838
|
fontWeight: t.fontWeight
|
|
2823
2839
|
};
|
|
2824
2840
|
});
|
|
2825
|
-
function
|
|
2826
|
-
let n =
|
|
2827
|
-
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ?
|
|
2841
|
+
function et(e, t) {
|
|
2842
|
+
let n = $e.value?.format;
|
|
2843
|
+
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ? B(e) : ne(e, f.valueTickFormat) : ne(e, n);
|
|
2828
2844
|
}
|
|
2829
|
-
function
|
|
2845
|
+
function tt(e, t, n) {
|
|
2830
2846
|
for (let r = F.value.length - 1; r >= 0; r--) {
|
|
2831
2847
|
let i = F.value[r];
|
|
2832
2848
|
if (i.categoryIndex === e && t >= i.x && t <= i.x + i.w && n >= i.y && n <= i.y + i.h) return i.color;
|
|
2833
2849
|
}
|
|
2834
2850
|
return null;
|
|
2835
2851
|
}
|
|
2836
|
-
let
|
|
2837
|
-
let e =
|
|
2852
|
+
let nt = n(() => {
|
|
2853
|
+
let e = $e.value;
|
|
2838
2854
|
if (!e) return [];
|
|
2839
|
-
let t =
|
|
2855
|
+
let t = O.value, n = e.fontSize, r = [];
|
|
2840
2856
|
for (let i of F.value) {
|
|
2841
|
-
let a =
|
|
2857
|
+
let a = et(i.value, {
|
|
2842
2858
|
value: i.value,
|
|
2843
2859
|
categoryIndex: i.categoryIndex,
|
|
2844
2860
|
seriesIndex: i.seriesIndex,
|
|
2845
|
-
category:
|
|
2861
|
+
category: E.value[i.categoryIndex] ?? String(i.categoryIndex)
|
|
2846
2862
|
});
|
|
2847
2863
|
if (!a) continue;
|
|
2848
2864
|
let o = t ? i.h : i.w, s = a.length * n * rr, c = o >= s + 2 * ir && 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;
|
|
@@ -2865,7 +2881,7 @@ var Bt = {
|
|
|
2865
2881
|
hidden: !1
|
|
2866
2882
|
});
|
|
2867
2883
|
}
|
|
2868
|
-
let i = t ? -H.value.top :
|
|
2884
|
+
let i = t ? -H.value.top : je.value - 2, a = /* @__PURE__ */ new Map();
|
|
2869
2885
|
for (let e of r) {
|
|
2870
2886
|
let t = a.get(e.bar.categoryIndex);
|
|
2871
2887
|
t ? t.push(e) : a.set(e.bar.categoryIndex, [e]);
|
|
@@ -2898,7 +2914,7 @@ var Bt = {
|
|
|
2898
2914
|
if (!o) l = e.color;
|
|
2899
2915
|
else if (i.inside) l = gt(i.bar.color);
|
|
2900
2916
|
else {
|
|
2901
|
-
let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r =
|
|
2917
|
+
let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r = tt(i.bar.categoryIndex, e, n);
|
|
2902
2918
|
l = r ? gt(r) : "currentColor";
|
|
2903
2919
|
}
|
|
2904
2920
|
s.push({
|
|
@@ -2913,7 +2929,7 @@ var Bt = {
|
|
|
2913
2929
|
});
|
|
2914
2930
|
}
|
|
2915
2931
|
return s;
|
|
2916
|
-
}),
|
|
2932
|
+
}), rt = n(() => {
|
|
2917
2933
|
let e = H.value.left - 6;
|
|
2918
2934
|
switch (f.categoryAlign ?? "end") {
|
|
2919
2935
|
case "start": return {
|
|
@@ -2929,7 +2945,7 @@ var Bt = {
|
|
|
2929
2945
|
x: e
|
|
2930
2946
|
};
|
|
2931
2947
|
}
|
|
2932
|
-
}),
|
|
2948
|
+
}), it = n(() => {
|
|
2933
2949
|
let e = [], t = H.value.top - 7;
|
|
2934
2950
|
if (f.valueHeader && e.push({
|
|
2935
2951
|
key: "vh",
|
|
@@ -2938,7 +2954,7 @@ var Bt = {
|
|
|
2938
2954
|
y: t,
|
|
2939
2955
|
anchor: "start"
|
|
2940
2956
|
}), f.categoryHeader) {
|
|
2941
|
-
let n = !
|
|
2957
|
+
let n = !O.value, r = rt.value;
|
|
2942
2958
|
e.push({
|
|
2943
2959
|
key: "ch",
|
|
2944
2960
|
text: f.categoryHeader,
|
|
@@ -2950,31 +2966,33 @@ var Bt = {
|
|
|
2950
2966
|
return e;
|
|
2951
2967
|
});
|
|
2952
2968
|
return (n, l) => (_(), r(t, {
|
|
2953
|
-
to: C(
|
|
2954
|
-
disabled: !C(
|
|
2969
|
+
to: C(qe),
|
|
2970
|
+
disabled: !C(Ge)
|
|
2955
2971
|
}, [o("div", d({
|
|
2956
2972
|
ref_key: "containerRef",
|
|
2957
|
-
ref:
|
|
2973
|
+
ref: ke
|
|
2958
2974
|
}, n.$attrs, {
|
|
2959
|
-
class: ["bar-chart-wrapper", { "is-fullscreen": C(
|
|
2960
|
-
style: C(
|
|
2975
|
+
class: ["bar-chart-wrapper", { "is-fullscreen": C(Ge) }],
|
|
2976
|
+
style: C(Ke)
|
|
2961
2977
|
}), [
|
|
2962
2978
|
c.menu ? (_(), r(pe, {
|
|
2963
2979
|
key: 0,
|
|
2964
|
-
items: C(
|
|
2965
|
-
"is-fullscreen": C(
|
|
2966
|
-
onClose: C(
|
|
2980
|
+
items: C(Re),
|
|
2981
|
+
"is-fullscreen": C(Ge),
|
|
2982
|
+
onClose: C(Je)
|
|
2967
2983
|
}, null, 8, [
|
|
2968
2984
|
"items",
|
|
2969
2985
|
"is-fullscreen",
|
|
2970
2986
|
"onClose"
|
|
2971
2987
|
])) : i("", !0),
|
|
2972
|
-
o("div", Dn, x(C(
|
|
2988
|
+
o("div", Dn, x(C(Ge) ? "Chart expanded to fill window" : ""), 1),
|
|
2973
2989
|
(_(), a("svg", {
|
|
2974
2990
|
ref_key: "svgRef",
|
|
2975
|
-
ref:
|
|
2976
|
-
width: C(
|
|
2977
|
-
height: C(
|
|
2991
|
+
ref: Ae,
|
|
2992
|
+
width: C(je),
|
|
2993
|
+
height: C(Me),
|
|
2994
|
+
role: g.value || void 0,
|
|
2995
|
+
"aria-label": h.value || void 0
|
|
2978
2996
|
}, [
|
|
2979
2997
|
c.title ? (_(), a("text", {
|
|
2980
2998
|
key: 0,
|
|
@@ -2989,17 +3007,17 @@ var Bt = {
|
|
|
2989
3007
|
x: Y.value.x,
|
|
2990
3008
|
dy: t === 0 ? 0 : Y.value.lineHeight
|
|
2991
3009
|
}, x(e), 9, An))), 128))], 8, kn)) : i("", !0),
|
|
2992
|
-
(_(!0), a(e, null, y(
|
|
3010
|
+
(_(!0), a(e, null, y(it.value, (e) => (_(), a("text", {
|
|
2993
3011
|
key: e.key,
|
|
2994
3012
|
"data-testid": e.key === "ch" ? "category-header" : "value-header",
|
|
2995
3013
|
x: e.x,
|
|
2996
3014
|
y: e.y,
|
|
2997
3015
|
"text-anchor": e.anchor,
|
|
2998
|
-
"font-size":
|
|
2999
|
-
fill:
|
|
3016
|
+
"font-size": Ye.value.fontSize,
|
|
3017
|
+
fill: Ye.value.fill,
|
|
3000
3018
|
"font-weight": "600"
|
|
3001
3019
|
}, x(e.text), 9, jn))), 128)),
|
|
3002
|
-
|
|
3020
|
+
Qe.value.length > 0 ? (_(), a("g", Mn, [(_(!0), a(e, null, y(Qe.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.kind === "bar" ? (_(), a("rect", {
|
|
3003
3021
|
key: 0,
|
|
3004
3022
|
x: t.x,
|
|
3005
3023
|
y: t.y - 5,
|
|
@@ -3018,11 +3036,11 @@ var Bt = {
|
|
|
3018
3036
|
}, null, 8, Pn)), o("text", {
|
|
3019
3037
|
x: t.x + 18,
|
|
3020
3038
|
y: t.y + 4,
|
|
3021
|
-
"font-size":
|
|
3022
|
-
fill:
|
|
3023
|
-
"font-weight":
|
|
3039
|
+
"font-size": Xe.value.fontSize,
|
|
3040
|
+
fill: Xe.value.fill,
|
|
3041
|
+
"font-weight": Xe.value.fontWeight
|
|
3024
3042
|
}, x(t.label), 9, Fn)], 64))), 128))])) : i("", !0),
|
|
3025
|
-
!
|
|
3043
|
+
!O.value || c.valueAxis ? (_(), a("line", {
|
|
3026
3044
|
key: 2,
|
|
3027
3045
|
x1: C(R)(C(H).left),
|
|
3028
3046
|
y1: C(R)(C(H).top),
|
|
@@ -3031,7 +3049,7 @@ var Bt = {
|
|
|
3031
3049
|
stroke: "currentColor",
|
|
3032
3050
|
"stroke-opacity": "0.3"
|
|
3033
3051
|
}, null, 8, In)) : i("", !0),
|
|
3034
|
-
|
|
3052
|
+
O.value || c.valueAxis ? (_(), a("line", {
|
|
3035
3053
|
key: 3,
|
|
3036
3054
|
x1: C(R)(C(H).left),
|
|
3037
3055
|
y1: C(R)(C(H).top + C(W)),
|
|
@@ -3040,16 +3058,16 @@ var Bt = {
|
|
|
3040
3058
|
stroke: "currentColor",
|
|
3041
3059
|
"stroke-opacity": "0.3"
|
|
3042
3060
|
}, null, 8, Ln)) : i("", !0),
|
|
3043
|
-
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(
|
|
3061
|
+
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(he.value, (e, t) => (_(), a("line", {
|
|
3044
3062
|
key: "vg" + t,
|
|
3045
|
-
x1:
|
|
3046
|
-
y1:
|
|
3047
|
-
x2:
|
|
3048
|
-
y2:
|
|
3063
|
+
x1: O.value ? C(H).left : e.pos,
|
|
3064
|
+
y1: O.value ? e.pos : C(H).top,
|
|
3065
|
+
x2: O.value ? C(H).left + C(U) : e.pos,
|
|
3066
|
+
y2: O.value ? e.pos : C(H).top + C(W),
|
|
3049
3067
|
stroke: "currentColor",
|
|
3050
3068
|
"stroke-opacity": "0.1"
|
|
3051
3069
|
}, null, 8, Rn))), 128)) : i("", !0),
|
|
3052
|
-
Z.value &&
|
|
3070
|
+
Z.value && we.value ? (_(), a("rect", {
|
|
3053
3071
|
key: 5,
|
|
3054
3072
|
x: Z.value.x,
|
|
3055
3073
|
y: Z.value.y,
|
|
@@ -3059,7 +3077,7 @@ var Bt = {
|
|
|
3059
3077
|
"fill-opacity": "0.06",
|
|
3060
3078
|
"pointer-events": "none"
|
|
3061
3079
|
}, null, 8, zn)) : i("", !0),
|
|
3062
|
-
c.valueAxis &&
|
|
3080
|
+
c.valueAxis && O.value ? (_(!0), a(e, { key: 6 }, y(he.value, (e, t) => (_(), a("text", {
|
|
3063
3081
|
key: "vt" + t,
|
|
3064
3082
|
"data-testid": "value-tick",
|
|
3065
3083
|
x: C(H).left - 6,
|
|
@@ -3070,7 +3088,7 @@ var Bt = {
|
|
|
3070
3088
|
fill: q.value.fill,
|
|
3071
3089
|
"font-weight": q.value.fontWeight,
|
|
3072
3090
|
"fill-opacity": q.value.fillOpacity
|
|
3073
|
-
}, x(e.value), 9, Bn))), 128)) : c.valueAxis ? (_(!0), a(e, { key: 7 }, y(
|
|
3091
|
+
}, x(e.value), 9, Bn))), 128)) : c.valueAxis ? (_(!0), a(e, { key: 7 }, y(he.value, (e, t) => (_(), a("text", {
|
|
3074
3092
|
key: "vt" + t,
|
|
3075
3093
|
"data-testid": "value-tick",
|
|
3076
3094
|
x: e.pos,
|
|
@@ -3087,11 +3105,11 @@ var Bt = {
|
|
|
3087
3105
|
y: 0,
|
|
3088
3106
|
transform: `translate(14, ${C(H).top + C(W) / 2}) rotate(-90)`,
|
|
3089
3107
|
"text-anchor": "middle",
|
|
3090
|
-
"font-size":
|
|
3091
|
-
fill:
|
|
3092
|
-
"font-weight":
|
|
3108
|
+
"font-size": Ye.value.fontSize,
|
|
3109
|
+
fill: Ye.value.fill,
|
|
3110
|
+
"font-weight": Ye.value.fontWeight
|
|
3093
3111
|
}, x(c.yLabel), 9, Hn)) : i("", !0),
|
|
3094
|
-
|
|
3112
|
+
O.value ? (_(!0), a(e, { key: 9 }, y(z.value, (e, t) => (_(), a("text", {
|
|
3095
3113
|
key: "ct" + t,
|
|
3096
3114
|
"data-testid": "category-tick",
|
|
3097
3115
|
x: e.pos,
|
|
@@ -3104,9 +3122,9 @@ var Bt = {
|
|
|
3104
3122
|
}, x(e.label), 9, Un))), 128)) : (_(!0), a(e, { key: 10 }, y(z.value, (e, t) => (_(), a("text", {
|
|
3105
3123
|
key: "ct" + t,
|
|
3106
3124
|
"data-testid": "category-tick",
|
|
3107
|
-
x:
|
|
3125
|
+
x: rt.value.x,
|
|
3108
3126
|
y: e.pos,
|
|
3109
|
-
"text-anchor":
|
|
3127
|
+
"text-anchor": rt.value.anchor,
|
|
3110
3128
|
"dominant-baseline": "middle",
|
|
3111
3129
|
"font-size": q.value.fontSize,
|
|
3112
3130
|
fill: q.value.fill,
|
|
@@ -3116,11 +3134,11 @@ var Bt = {
|
|
|
3116
3134
|
c.xLabel ? (_(), a("text", {
|
|
3117
3135
|
key: 11,
|
|
3118
3136
|
x: C(H).left + C(U) / 2,
|
|
3119
|
-
y: C(
|
|
3137
|
+
y: C(Me) - 4,
|
|
3120
3138
|
"text-anchor": "middle",
|
|
3121
|
-
"font-size":
|
|
3122
|
-
fill:
|
|
3123
|
-
"font-weight":
|
|
3139
|
+
"font-size": Ye.value.fontSize,
|
|
3140
|
+
fill: Ye.value.fill,
|
|
3141
|
+
"font-weight": Ye.value.fontWeight
|
|
3124
3142
|
}, x(c.xLabel), 9, Gn)) : i("", !0),
|
|
3125
3143
|
(_(!0), a(e, null, y(F.value, (e, t) => (_(), a("rect", {
|
|
3126
3144
|
key: "bar" + t,
|
|
@@ -3135,7 +3153,7 @@ var Bt = {
|
|
|
3135
3153
|
"fill-opacity": e.opacity,
|
|
3136
3154
|
style: m(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
3137
3155
|
}, null, 12, Kn))), 128)),
|
|
3138
|
-
(_(!0), a(e, null, y(
|
|
3156
|
+
(_(!0), a(e, null, y(nt.value, (e) => (_(), a("text", {
|
|
3139
3157
|
key: "blbl" + e.key,
|
|
3140
3158
|
"data-testid": "bar-label",
|
|
3141
3159
|
x: e.x,
|
|
@@ -3168,23 +3186,23 @@ var Bt = {
|
|
|
3168
3186
|
"fill-opacity": t.opacity,
|
|
3169
3187
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3170
3188
|
}, null, 12, Yn))), 128)) : i("", !0)], 64))), 128)),
|
|
3171
|
-
|
|
3189
|
+
we.value ? (_(), a("rect", d({
|
|
3172
3190
|
key: 12,
|
|
3173
3191
|
x: C(H).left,
|
|
3174
3192
|
y: C(H).top,
|
|
3175
3193
|
width: C(U),
|
|
3176
3194
|
height: C(W),
|
|
3177
3195
|
fill: "transparent",
|
|
3178
|
-
style: `cursor: crosshair; touch-action: ${
|
|
3179
|
-
}, ee(C(
|
|
3196
|
+
style: `cursor: crosshair; touch-action: ${O.value ? "pan-y" : "pan-x"}`
|
|
3197
|
+
}, ee(C(Le), !0)), null, 16, Xn)) : i("", !0),
|
|
3180
3198
|
c.annotations && c.annotations.length > 0 ? (_(), r(C(ot), {
|
|
3181
3199
|
key: 13,
|
|
3182
3200
|
annotations: c.annotations,
|
|
3183
|
-
project:
|
|
3184
|
-
bounds: C(
|
|
3201
|
+
project: Te,
|
|
3202
|
+
bounds: C(Fe)
|
|
3185
3203
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
3186
3204
|
], 8, On)),
|
|
3187
|
-
|
|
3205
|
+
we.value && C(G) !== null && X.value ? (_(), a("div", {
|
|
3188
3206
|
key: 1,
|
|
3189
3207
|
ref_key: "tooltipRef",
|
|
3190
3208
|
ref: K,
|
|
@@ -3194,31 +3212,31 @@ var Bt = {
|
|
|
3194
3212
|
top: "0",
|
|
3195
3213
|
left: "0",
|
|
3196
3214
|
willChange: "transform",
|
|
3197
|
-
transform: C(
|
|
3198
|
-
visibility: C(
|
|
3215
|
+
transform: C(Ie) ? `translate3d(${C(Ie).left}px, ${C(Ie).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
3216
|
+
visibility: C(Ie) ? "visible" : "hidden"
|
|
3199
3217
|
})
|
|
3200
|
-
}, [b(n.$slots, "tooltip", p(u(X.value)), () => [o("div", Zn, [
|
|
3218
|
+
}, [b(n.$slots, "tooltip", p(u(X.value)), () => [o("div", Zn, [Ze.value ? (_(), a("div", Qn, x(Ze.value), 1)) : i("", !0), (_(!0), a(e, null, y(X.value.values, (e) => (_(), a("div", {
|
|
3201
3219
|
key: e.seriesIndex,
|
|
3202
3220
|
class: "bar-chart-tooltip-row"
|
|
3203
3221
|
}, [o("span", {
|
|
3204
3222
|
class: "bar-chart-tooltip-swatch",
|
|
3205
3223
|
style: m({ background: e.color })
|
|
3206
|
-
}, null, 4), s(" " + x(isFinite(e.value) ? C(
|
|
3207
|
-
C(
|
|
3224
|
+
}, null, 4), s(" " + x(isFinite(e.value) ? C(me)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
3225
|
+
C(ze) ? (_(), a("a", {
|
|
3208
3226
|
key: 2,
|
|
3209
3227
|
class: "bar-chart-download-link",
|
|
3210
|
-
href: C(
|
|
3211
|
-
download: `${C(
|
|
3212
|
-
}, x(C(
|
|
3213
|
-
C(
|
|
3228
|
+
href: C(Be),
|
|
3229
|
+
download: `${C(We)()}.csv`
|
|
3230
|
+
}, x(C(ze)), 9, $n)) : i("", !0),
|
|
3231
|
+
C(Ve) ? (_(), a("button", {
|
|
3214
3232
|
key: 3,
|
|
3215
3233
|
type: "button",
|
|
3216
3234
|
class: "bar-chart-download-button",
|
|
3217
|
-
onClick: l[0] ||= (...e) => C(
|
|
3218
|
-
}, x(C(
|
|
3235
|
+
onClick: l[0] ||= (...e) => C(He) && C(He)(...e)
|
|
3236
|
+
}, x(C(Ve)), 1)) : i("", !0)
|
|
3219
3237
|
], 16)], 8, ["to", "disabled"]));
|
|
3220
3238
|
}
|
|
3221
|
-
}), [["__scopeId", "data-v-
|
|
3239
|
+
}), [["__scopeId", "data-v-251f7945"]]), sr = {
|
|
3222
3240
|
ref: "root",
|
|
3223
3241
|
class: "chart-tooltip-content",
|
|
3224
3242
|
style: {
|
|
@@ -3233,7 +3251,7 @@ var Bt = {
|
|
|
3233
3251
|
}, cr = /* @__PURE__ */ l({
|
|
3234
3252
|
__name: "ChoroplethTooltip",
|
|
3235
3253
|
setup(e, { expose: n }) {
|
|
3236
|
-
let a = v(null), s =
|
|
3254
|
+
let a = v(null), s = w("root");
|
|
3237
3255
|
return n({
|
|
3238
3256
|
setData(e) {
|
|
3239
3257
|
a.value = e;
|
|
@@ -3243,19 +3261,19 @@ var Bt = {
|
|
|
3243
3261
|
}
|
|
3244
3262
|
}), (e, n) => (_(), r(t, { to: "body" }, [o("div", sr, [a.value ? b(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
|
|
3245
3263
|
}
|
|
3246
|
-
}), lr = {
|
|
3264
|
+
}), lr = ["role", "aria-label"], ur = {
|
|
3247
3265
|
class: "chart-sr-only",
|
|
3248
3266
|
"aria-live": "polite"
|
|
3249
|
-
},
|
|
3267
|
+
}, dr = {
|
|
3250
3268
|
key: 1,
|
|
3251
3269
|
class: "choropleth-header"
|
|
3252
|
-
},
|
|
3270
|
+
}, fr = {
|
|
3253
3271
|
key: 0,
|
|
3254
3272
|
class: "choropleth-legend-title"
|
|
3255
|
-
},
|
|
3273
|
+
}, pr = {
|
|
3256
3274
|
key: 2,
|
|
3257
3275
|
class: "choropleth-legend-continuous"
|
|
3258
|
-
},
|
|
3276
|
+
}, mr = { class: "choropleth-legend-ticks" }, hr = ["viewBox"], gr = ["innerHTML"], _r = "http://www.w3.org/2000/svg", vr = 10, yr = 600, br = 450, xr = 1e3, Sr = 12, Cr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3259
3277
|
inheritAttrs: !1,
|
|
3260
3278
|
__name: "ChoroplethMap",
|
|
3261
3279
|
props: {
|
|
@@ -3269,6 +3287,8 @@ var Bt = {
|
|
|
3269
3287
|
colorScale: {},
|
|
3270
3288
|
title: {},
|
|
3271
3289
|
titleStyle: {},
|
|
3290
|
+
role: {},
|
|
3291
|
+
ariaLabel: {},
|
|
3272
3292
|
legendStyle: {},
|
|
3273
3293
|
noDataColor: { default: "#ddd" },
|
|
3274
3294
|
strokeColor: { default: "#fff" },
|
|
@@ -3312,10 +3332,10 @@ var Bt = {
|
|
|
3312
3332
|
"update:focus"
|
|
3313
3333
|
],
|
|
3314
3334
|
setup(c, { emit: l }) {
|
|
3315
|
-
let f = c, ee = l,
|
|
3335
|
+
let f = c, ee = n(() => f.ariaLabel ?? f.title), w = n(() => f.role ?? (ee.value ? "figure" : void 0)), D = l, O = (e) => e, k = v(null), A = v(null), re = v(null), j = v(null), M = v(null), N = v(null), ie = te(), de = n(() => !!f.tooltipTrigger || !!f.tooltipFormat || !!ie.tooltip), fe = n(() => {
|
|
3316
3336
|
let e = f.legendStyle, t = {};
|
|
3317
3337
|
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;
|
|
3318
|
-
}),
|
|
3338
|
+
}), L = n(() => {
|
|
3319
3339
|
let e = f.titleStyle, t = {
|
|
3320
3340
|
"font-size": `${e?.fontSize ?? 14}px`,
|
|
3321
3341
|
"line-height": `${e?.lineHeight ?? 18}px`,
|
|
@@ -3324,40 +3344,40 @@ var Bt = {
|
|
|
3324
3344
|
width: "100%"
|
|
3325
3345
|
};
|
|
3326
3346
|
return e?.color && (t.color = e.color), t;
|
|
3327
|
-
}),
|
|
3347
|
+
}), R = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map(), he = null, z = null, B = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(), _e = !1, ve = typeof window < "u" && "ontouchstart" in window, ye = null, be = {
|
|
3328
3348
|
width: 0,
|
|
3329
3349
|
height: 0
|
|
3330
|
-
},
|
|
3331
|
-
function
|
|
3332
|
-
let e =
|
|
3333
|
-
e && (e.addEventListener("touchstart",
|
|
3350
|
+
}, xe = null, Se = !1, V = null, Ce = v(!1), we = 0, Te = 0, Ee = 0, De = null;
|
|
3351
|
+
function Oe() {
|
|
3352
|
+
let e = re.value;
|
|
3353
|
+
e && (e.addEventListener("touchstart", Ot, { passive: !0 }), e.addEventListener("touchend", kt), e.addEventListener("touchcancel", At, { passive: !0 }), !ve && (e.addEventListener("click", Tt), e.addEventListener("mouseover", Tt), e.addEventListener("mousemove", Et), e.addEventListener("mouseout", Dt)));
|
|
3334
3354
|
}
|
|
3335
|
-
function
|
|
3336
|
-
let e =
|
|
3337
|
-
e && (e.removeEventListener("touchstart",
|
|
3355
|
+
function ke() {
|
|
3356
|
+
let e = re.value;
|
|
3357
|
+
e && (e.removeEventListener("touchstart", Ot), e.removeEventListener("touchend", kt), e.removeEventListener("touchcancel", At), e.removeEventListener("click", Tt), e.removeEventListener("mouseover", Tt), e.removeEventListener("mousemove", Et), e.removeEventListener("mouseout", Dt));
|
|
3338
3358
|
}
|
|
3339
|
-
function
|
|
3340
|
-
|
|
3359
|
+
function Ae() {
|
|
3360
|
+
St();
|
|
3341
3361
|
}
|
|
3342
3362
|
h(() => {
|
|
3343
|
-
|
|
3363
|
+
Me(), Oe(), Mt(), W(), mt(), window.addEventListener("scroll", Ae, {
|
|
3344
3364
|
passive: !0,
|
|
3345
3365
|
capture: !0
|
|
3346
|
-
}), window.addEventListener("resize",
|
|
3366
|
+
}), window.addEventListener("resize", Ae, { passive: !0 });
|
|
3347
3367
|
}), g(() => {
|
|
3348
|
-
|
|
3368
|
+
ye?.disconnect(), Ee && cancelAnimationFrame(Ee), H(), ke(), window.removeEventListener("scroll", Ae, { capture: !0 }), window.removeEventListener("resize", Ae);
|
|
3349
3369
|
});
|
|
3350
|
-
function
|
|
3351
|
-
if (!
|
|
3352
|
-
let e =
|
|
3353
|
-
V =
|
|
3354
|
-
|
|
3370
|
+
function Me() {
|
|
3371
|
+
if (!A.value || !re.value) return;
|
|
3372
|
+
let e = ce(A.value), t = Math.max(12, f.focusZoomLevel);
|
|
3373
|
+
V = F().scaleExtent([1, t]).on("start", () => {
|
|
3374
|
+
_e = !0, St();
|
|
3355
3375
|
}).on("zoom", (e) => {
|
|
3356
|
-
|
|
3376
|
+
re.value && re.value.setAttribute("transform", e.transform);
|
|
3357
3377
|
let t = e.transform;
|
|
3358
|
-
|
|
3378
|
+
Ce.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
3359
3379
|
}).on("end", () => {
|
|
3360
|
-
|
|
3380
|
+
_e = !1;
|
|
3361
3381
|
}), V.filter((e) => {
|
|
3362
3382
|
let t = Z.value.length > 0 && f.focusZoom !== !1, n = !!f.zoom || t, r = !!f.pan || t;
|
|
3363
3383
|
if (e.type === "wheel" || e.type === "dblclick") {
|
|
@@ -3368,11 +3388,11 @@ var Bt = {
|
|
|
3368
3388
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
3369
3389
|
}), e.call(V);
|
|
3370
3390
|
}
|
|
3371
|
-
function
|
|
3372
|
-
|
|
3391
|
+
function H() {
|
|
3392
|
+
A.value && V && (ce(A.value).on(".zoom", null), V = null);
|
|
3373
3393
|
}
|
|
3374
|
-
function
|
|
3375
|
-
let t =
|
|
3394
|
+
function Ne(e) {
|
|
3395
|
+
let t = Qe.value, n = Y.value, r = [];
|
|
3376
3396
|
for (let i of e) {
|
|
3377
3397
|
let e = i.geoType ?? f.geoType, a = t.get(e);
|
|
3378
3398
|
if (!a) continue;
|
|
@@ -3390,107 +3410,107 @@ var Bt = {
|
|
|
3390
3410
|
}
|
|
3391
3411
|
return r;
|
|
3392
3412
|
}
|
|
3393
|
-
function
|
|
3413
|
+
function Pe(e) {
|
|
3394
3414
|
let t = /* @__PURE__ */ new Set();
|
|
3395
|
-
for (let n of
|
|
3415
|
+
for (let n of Ne(e)) n.geoType === f.geoType && t.add(String(n.feature.id));
|
|
3396
3416
|
return t;
|
|
3397
3417
|
}
|
|
3398
3418
|
let U = !1;
|
|
3399
3419
|
function W() {
|
|
3400
|
-
if (!
|
|
3401
|
-
let e =
|
|
3420
|
+
if (!A.value || !V) return;
|
|
3421
|
+
let e = Ne(Z.value), t = e.filter((e) => e.geoType === f.geoType), n = e.filter((e) => e.geoType !== f.geoType), r = /* @__PURE__ */ new Map();
|
|
3402
3422
|
for (let e of t) {
|
|
3403
|
-
let t =
|
|
3423
|
+
let t = R.get(String(e.feature.id));
|
|
3404
3424
|
t && r.set(t, e.item.style ?? "solid");
|
|
3405
3425
|
}
|
|
3406
|
-
for (let [e] of B) r.has(e) || e === z ||
|
|
3407
|
-
for (let [e, t] of r) B.get(e) === t && e !== z || e !== z &&
|
|
3426
|
+
for (let [e] of B) r.has(e) || e === z || bt(e);
|
|
3427
|
+
for (let [e, t] of r) B.get(e) === t && e !== z || e !== z && Q(e, t);
|
|
3408
3428
|
B.clear();
|
|
3409
3429
|
for (let [e, t] of r) B.set(e, t);
|
|
3410
|
-
if (
|
|
3411
|
-
U = !0,
|
|
3430
|
+
if (K(n), e.length === 0) {
|
|
3431
|
+
U = !0, St();
|
|
3412
3432
|
return;
|
|
3413
3433
|
}
|
|
3414
3434
|
if (f.focusZoom === !1) {
|
|
3415
3435
|
U = !0;
|
|
3416
3436
|
return;
|
|
3417
3437
|
}
|
|
3418
|
-
let i =
|
|
3438
|
+
let i = ce(A.value);
|
|
3419
3439
|
i.interrupt();
|
|
3420
3440
|
let a = U;
|
|
3421
3441
|
U = !0;
|
|
3422
|
-
let [[o, s], [c, l]] =
|
|
3442
|
+
let [[o, s], [c, l]] = Xe.value.bounds({
|
|
3423
3443
|
type: "FeatureCollection",
|
|
3424
3444
|
features: e.map((e) => e.feature)
|
|
3425
|
-
}), u = (o + c) / 2, d = (s + l) / 2, p = f.focusZoomLevel, m = se.translate(
|
|
3426
|
-
if (!
|
|
3427
|
-
let e = String(h.id), t =
|
|
3445
|
+
}), u = (o + c) / 2, d = (s + l) / 2, p = f.focusZoomLevel, m = se.translate(Re.value / 2 - p * u, ze.value / 2 - p * d).scale(p), h = t[0]?.feature ?? null, g = () => {
|
|
3446
|
+
if (!de.value || !h) return;
|
|
3447
|
+
let e = String(h.id), t = R.get(e);
|
|
3428
3448
|
if (!t) return;
|
|
3429
3449
|
let n = t.getBoundingClientRect();
|
|
3430
|
-
|
|
3450
|
+
gt(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
3431
3451
|
};
|
|
3432
|
-
a ? (
|
|
3452
|
+
a ? (vt(), i.transition().duration(br).call(V.transform, m).on("end", g)) : (V.transform(i, m), g());
|
|
3433
3453
|
}
|
|
3434
|
-
function
|
|
3454
|
+
function K(e) {
|
|
3435
3455
|
let t = M.value;
|
|
3436
3456
|
if (!t) return;
|
|
3437
3457
|
let n = new Set(e.map((e) => e.key));
|
|
3438
|
-
for (let [e, t] of
|
|
3439
|
-
let r =
|
|
3458
|
+
for (let [e, t] of ge) n.has(e) || (t.remove(), ge.delete(e));
|
|
3459
|
+
let r = Xe.value, i = J.value + 1.5;
|
|
3440
3460
|
for (let { item: n, feature: a, key: o } of e) {
|
|
3441
|
-
let e =
|
|
3442
|
-
e || (e = document.createElementNS(
|
|
3461
|
+
let e = ge.get(o);
|
|
3462
|
+
e || (e = document.createElementNS(_r, "path"), e.setAttribute("d", r(a) ?? ""), e.setAttribute("fill", "none"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("class", "focus-overlay"), t.appendChild(e), ge.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), yt(e, n.style);
|
|
3443
3463
|
}
|
|
3444
3464
|
}
|
|
3445
|
-
function
|
|
3446
|
-
if (!
|
|
3447
|
-
Z.value.length > 0 &&
|
|
3448
|
-
let e =
|
|
3449
|
-
e.interrupt(),
|
|
3465
|
+
function Ie() {
|
|
3466
|
+
if (!A.value || !V) return;
|
|
3467
|
+
Z.value.length > 0 && D("update:focus", null);
|
|
3468
|
+
let e = ce(A.value);
|
|
3469
|
+
e.interrupt(), vt(), e.transition().duration(br).call(V.transform, se);
|
|
3450
3470
|
}
|
|
3451
|
-
|
|
3471
|
+
T(() => f.focusZoomLevel, () => {
|
|
3452
3472
|
V && V.scaleExtent([1, Math.max(12, f.focusZoomLevel)]), W();
|
|
3453
|
-
}),
|
|
3454
|
-
if (!
|
|
3455
|
-
let e =
|
|
3473
|
+
}), T(() => f.state, () => {
|
|
3474
|
+
if (!A.value || !V) return;
|
|
3475
|
+
let e = ce(A.value);
|
|
3456
3476
|
e.interrupt(), V.transform(e, se);
|
|
3457
3477
|
});
|
|
3458
|
-
let
|
|
3478
|
+
let Le = n(() => f.width && f.height ? f.height / f.width : .625), Re = n(() => xr), ze = n(() => xr * Le.value), Ve = n(() => {
|
|
3459
3479
|
let e = S(f.topology), t = e?.objects?.states;
|
|
3460
3480
|
if (!t) return [];
|
|
3461
|
-
let n =
|
|
3481
|
+
let n = le(e, t);
|
|
3462
3482
|
return n.type === "FeatureCollection" ? n.features : [n];
|
|
3463
|
-
}),
|
|
3483
|
+
}), He = n(() => {
|
|
3464
3484
|
let e = f.state?.trim();
|
|
3465
3485
|
if (!e) return null;
|
|
3466
3486
|
if (/^\d{1,2}$/.test(e)) return e.padStart(2, "0");
|
|
3467
|
-
let t =
|
|
3487
|
+
let t = Ve.value.find((t) => t.properties?.name === e);
|
|
3468
3488
|
return t?.id == null ? null : String(t.id).padStart(2, "0");
|
|
3469
|
-
}),
|
|
3470
|
-
let e =
|
|
3471
|
-
return e ?
|
|
3489
|
+
}), Ue = n(() => {
|
|
3490
|
+
let e = He.value;
|
|
3491
|
+
return e ? Ve.value.find((t) => String(t.id).padStart(2, "0") === e) ?? null : null;
|
|
3472
3492
|
});
|
|
3473
|
-
|
|
3493
|
+
T(() => [f.state, He.value], ([e, t]) => {
|
|
3474
3494
|
e && e.trim() && !t && console.warn(`[ChoroplethMap] state="${e}" matched no state name or FIPS code; rendering the full map.`);
|
|
3475
3495
|
}, { immediate: !0 });
|
|
3476
|
-
let
|
|
3477
|
-
function
|
|
3478
|
-
return
|
|
3496
|
+
let We = v(null), Ge = null;
|
|
3497
|
+
function Ke() {
|
|
3498
|
+
return Ge ||= import("./hsaMapping-BahYDmea.js").then((e) => e.n).then((e) => (We.value = e, e)), Ge;
|
|
3479
3499
|
}
|
|
3480
|
-
|
|
3500
|
+
T(() => {
|
|
3481
3501
|
if (f.geoType === "hsas" || f.dataGeoType === "hsas") return !0;
|
|
3482
3502
|
let e = f.focus;
|
|
3483
3503
|
return e ? (Array.isArray(e) ? e : [e]).some((e) => typeof e != "string" && e.geoType === "hsas") : !1;
|
|
3484
3504
|
}, (e) => {
|
|
3485
|
-
e &&
|
|
3505
|
+
e && Ke();
|
|
3486
3506
|
}, { immediate: !0 });
|
|
3487
|
-
let
|
|
3488
|
-
let e =
|
|
3507
|
+
let qe = n(() => {
|
|
3508
|
+
let e = We.value;
|
|
3489
3509
|
if (!e) return {
|
|
3490
3510
|
type: "FeatureCollection",
|
|
3491
3511
|
features: []
|
|
3492
3512
|
};
|
|
3493
|
-
let { fipsToHsa: t, hsaNames: n } = e, r = S(f.topology), i = r.objects.counties.geometries, a =
|
|
3513
|
+
let { fipsToHsa: t, hsaNames: n } = e, r = S(f.topology), i = r.objects.counties.geometries, a = He.value, o = /* @__PURE__ */ new Map();
|
|
3494
3514
|
for (let e of i) {
|
|
3495
3515
|
let n = String(e.id).padStart(5, "0");
|
|
3496
3516
|
if (a && n.slice(0, 2) !== a) continue;
|
|
@@ -3502,62 +3522,62 @@ var Bt = {
|
|
|
3502
3522
|
type: "Feature",
|
|
3503
3523
|
id: e,
|
|
3504
3524
|
properties: { name: n[e] ?? e },
|
|
3505
|
-
geometry:
|
|
3525
|
+
geometry: I(r, t)
|
|
3506
3526
|
});
|
|
3507
3527
|
return {
|
|
3508
3528
|
type: "FeatureCollection",
|
|
3509
3529
|
features: s
|
|
3510
3530
|
};
|
|
3511
|
-
}),
|
|
3512
|
-
if (f.geoType === "hsas") return
|
|
3513
|
-
let e =
|
|
3531
|
+
}), Je = n(() => {
|
|
3532
|
+
if (f.geoType === "hsas") return qe.value;
|
|
3533
|
+
let e = He.value;
|
|
3514
3534
|
if (f.geoType === "counties") {
|
|
3515
|
-
let t = S(f.topology), n =
|
|
3535
|
+
let t = S(f.topology), n = le(t, t.objects.counties);
|
|
3516
3536
|
return e ? {
|
|
3517
3537
|
type: "FeatureCollection",
|
|
3518
3538
|
features: n.features.filter((t) => String(t.id).padStart(5, "0").slice(0, 2) === e)
|
|
3519
3539
|
} : n;
|
|
3520
3540
|
}
|
|
3521
|
-
let t = S(f.topology), n =
|
|
3541
|
+
let t = S(f.topology), n = le(t, t.objects.states);
|
|
3522
3542
|
return e ? {
|
|
3523
3543
|
type: "FeatureCollection",
|
|
3524
3544
|
features: n.features.filter((t) => String(t.id).padStart(2, "0") === e)
|
|
3525
3545
|
} : n;
|
|
3526
|
-
}),
|
|
3546
|
+
}), Ye = n(() => {
|
|
3527
3547
|
if (f.geoType !== "counties" && f.geoType !== "hsas") return null;
|
|
3528
|
-
if (
|
|
3548
|
+
if (He.value) return Ue.value;
|
|
3529
3549
|
let e = S(f.topology);
|
|
3530
3550
|
return ue(e, e.objects.states, (e, t) => e !== t);
|
|
3531
3551
|
}), q = n(() => {
|
|
3532
|
-
let e =
|
|
3533
|
-
if (
|
|
3534
|
-
let t = [[
|
|
3535
|
-
return Number.isFinite(r[0]) && Number.isFinite(r[1]) ? n :
|
|
3552
|
+
let e = Ue.value;
|
|
3553
|
+
if (He.value && e) {
|
|
3554
|
+
let t = [[Sr, Sr], [Re.value - Sr, ze.value - Sr]], n = ae().fitExtent(t, e), r = oe(n).centroid(e);
|
|
3555
|
+
return Number.isFinite(r[0]) && Number.isFinite(r[1]) ? n : P().fitExtent(t, e);
|
|
3536
3556
|
}
|
|
3537
|
-
return
|
|
3538
|
-
}),
|
|
3557
|
+
return ae().fitExtent([[0, 0], [Re.value, ze.value]], Je.value);
|
|
3558
|
+
}), Xe = n(() => oe(q.value)), J = n(() => f.geoType === "counties" || f.geoType === "hsas" ? f.strokeWidth * .5 : f.strokeWidth), Y = n(() => {
|
|
3539
3559
|
let e = /* @__PURE__ */ new Map();
|
|
3540
|
-
for (let [t, n] of
|
|
3560
|
+
for (let [t, n] of Qe.value) {
|
|
3541
3561
|
let r = /* @__PURE__ */ new Map();
|
|
3542
3562
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
3543
3563
|
e.set(t, r);
|
|
3544
3564
|
}
|
|
3545
3565
|
return e;
|
|
3546
3566
|
});
|
|
3547
|
-
function
|
|
3567
|
+
function Ze(e) {
|
|
3548
3568
|
let t = f.dataGeoType;
|
|
3549
3569
|
if (!t || t === f.geoType) return e;
|
|
3550
|
-
if (f.geoType === "counties" && t === "hsas") return
|
|
3570
|
+
if (f.geoType === "counties" && t === "hsas") return We.value?.fipsToHsa[e];
|
|
3551
3571
|
if (f.geoType === "counties" && t === "states" || f.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
3552
3572
|
}
|
|
3553
3573
|
let X = n(() => {
|
|
3554
3574
|
let e = /* @__PURE__ */ new Map();
|
|
3555
|
-
for (let t of
|
|
3575
|
+
for (let t of Je.value.features) t.id != null && e.set(String(t.id), t);
|
|
3556
3576
|
return e;
|
|
3557
3577
|
}), Z = n(() => {
|
|
3558
3578
|
let e = f.focus;
|
|
3559
3579
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
3560
|
-
}),
|
|
3580
|
+
}), Qe = n(() => {
|
|
3561
3581
|
let e = /* @__PURE__ */ new Map();
|
|
3562
3582
|
e.set(f.geoType, X.value);
|
|
3563
3583
|
let t = S(f.topology), n = t?.objects;
|
|
@@ -3568,15 +3588,15 @@ var Bt = {
|
|
|
3568
3588
|
return t;
|
|
3569
3589
|
};
|
|
3570
3590
|
if (!e.has("states") && n.states) {
|
|
3571
|
-
let i =
|
|
3591
|
+
let i = le(t, n.states);
|
|
3572
3592
|
e.set("states", r(i.features));
|
|
3573
3593
|
}
|
|
3574
3594
|
if (!e.has("counties") && n.counties) {
|
|
3575
|
-
let i =
|
|
3595
|
+
let i = le(t, n.counties);
|
|
3576
3596
|
e.set("counties", r(i.features));
|
|
3577
3597
|
}
|
|
3578
|
-
return !e.has("hsas") && n.counties && e.set("hsas", r(
|
|
3579
|
-
}),
|
|
3598
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(qe.value.features)), e;
|
|
3599
|
+
}), $e = n(() => {
|
|
3580
3600
|
let e = /* @__PURE__ */ new Map();
|
|
3581
3601
|
if (!f.data) return e;
|
|
3582
3602
|
let t = f.dataGeoType ?? f.geoType, n = Y.value.get(t);
|
|
@@ -3586,7 +3606,7 @@ var Bt = {
|
|
|
3586
3606
|
r && e.set(r, t.value);
|
|
3587
3607
|
}
|
|
3588
3608
|
return e;
|
|
3589
|
-
}),
|
|
3609
|
+
}), et = n(() => {
|
|
3590
3610
|
if (!f.data || f.data.length === 0) return {
|
|
3591
3611
|
min: 0,
|
|
3592
3612
|
max: 1
|
|
@@ -3603,8 +3623,8 @@ var Bt = {
|
|
|
3603
3623
|
min: 0,
|
|
3604
3624
|
max: 1
|
|
3605
3625
|
};
|
|
3606
|
-
}),
|
|
3607
|
-
function
|
|
3626
|
+
}), tt = n(() => Array.isArray(f.colorScale) && f.colorScale.length > 0 && "value" in f.colorScale[0]), nt = n(() => Array.isArray(f.colorScale) && !tt.value), rt = n(() => nt.value ? "" : f.colorScale?.min ?? "#e5f0fa"), it = n(() => nt.value ? "" : f.colorScale?.max ?? "#08519c");
|
|
3627
|
+
function at(e) {
|
|
3608
3628
|
let t = e.replace("#", "");
|
|
3609
3629
|
return [
|
|
3610
3630
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -3612,354 +3632,356 @@ var Bt = {
|
|
|
3612
3632
|
parseInt(t.slice(4, 6), 16)
|
|
3613
3633
|
];
|
|
3614
3634
|
}
|
|
3615
|
-
function
|
|
3616
|
-
let [t, n, r] = rt
|
|
3635
|
+
function ot(e) {
|
|
3636
|
+
let [t, n, r] = at(rt.value), [i, a, o] = at(it.value);
|
|
3617
3637
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
3618
3638
|
}
|
|
3619
|
-
let
|
|
3620
|
-
if (
|
|
3639
|
+
let st = n(() => nt.value ? f.colorScale.slice().sort((e, t) => t.min - e.min) : null), ct = n(() => {
|
|
3640
|
+
if (!tt.value) return null;
|
|
3621
3641
|
let e = /* @__PURE__ */ new Map();
|
|
3622
3642
|
for (let t of f.colorScale) e.set(t.value, t.color);
|
|
3623
3643
|
return e;
|
|
3624
3644
|
});
|
|
3625
|
-
function
|
|
3626
|
-
let t =
|
|
3627
|
-
return t == null ? void 0 :
|
|
3645
|
+
function lt(e) {
|
|
3646
|
+
let t = Ze(e);
|
|
3647
|
+
return t == null ? void 0 : $e.value.get(t);
|
|
3628
3648
|
}
|
|
3629
|
-
function
|
|
3630
|
-
let t =
|
|
3649
|
+
function ut(e) {
|
|
3650
|
+
let t = lt(e), n = f.noDataColor;
|
|
3631
3651
|
if (t == null) return n;
|
|
3632
|
-
let r =
|
|
3652
|
+
let r = ct.value;
|
|
3633
3653
|
if (r) return r.get(String(t)) ?? n;
|
|
3634
|
-
let i =
|
|
3654
|
+
let i = st.value;
|
|
3635
3655
|
if (i) {
|
|
3636
3656
|
let e = t;
|
|
3637
3657
|
for (let t of i) if (e >= t.min) return t.color;
|
|
3638
3658
|
return n;
|
|
3639
3659
|
}
|
|
3640
|
-
let { min: a, max: o } =
|
|
3641
|
-
return
|
|
3660
|
+
let { min: a, max: o } = et.value;
|
|
3661
|
+
return ot((t - a) / (o - a));
|
|
3642
3662
|
}
|
|
3643
|
-
let
|
|
3644
|
-
function
|
|
3645
|
-
return e == null ? "" : typeof e == "number" && f.tooltipValueFormat !== void 0 ?
|
|
3663
|
+
let dt = (e) => e.properties?.name ?? String(e.id);
|
|
3664
|
+
function ft(e) {
|
|
3665
|
+
return e == null ? "" : typeof e == "number" && f.tooltipValueFormat !== void 0 ? ne(e, f.tooltipValueFormat) : String(e);
|
|
3646
3666
|
}
|
|
3647
|
-
function
|
|
3648
|
-
return t == null ? e : `${e}: ${
|
|
3667
|
+
function pt(e, t) {
|
|
3668
|
+
return t == null ? e : `${e}: ${ft(t)}`;
|
|
3649
3669
|
}
|
|
3650
|
-
function
|
|
3670
|
+
function mt() {
|
|
3651
3671
|
let e = N.value?.getEl();
|
|
3652
3672
|
if (!e) return;
|
|
3653
|
-
|
|
3673
|
+
ye?.disconnect();
|
|
3654
3674
|
let t = !1;
|
|
3655
|
-
|
|
3675
|
+
ye = new ResizeObserver((e) => {
|
|
3656
3676
|
let n = e[0]?.contentRect;
|
|
3657
|
-
n && (
|
|
3658
|
-
}),
|
|
3677
|
+
n && (be.width = n.width, be.height = n.height, !t && Se && xe ? (t = !0, ht(xe.x, xe.y)) : t = !0);
|
|
3678
|
+
}), ye.observe(e);
|
|
3659
3679
|
}
|
|
3660
|
-
function
|
|
3680
|
+
function ht(e, t) {
|
|
3661
3681
|
let n = N.value?.getEl();
|
|
3662
3682
|
if (!n) return;
|
|
3663
|
-
let r =
|
|
3683
|
+
let r = k.value?.getBoundingClientRect(), { left: i, top: a } = je(e, t, be.width, be.height, f.tooltipClamp, r);
|
|
3664
3684
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
3665
3685
|
}
|
|
3666
|
-
function
|
|
3667
|
-
let r =
|
|
3686
|
+
function gt(e, t, n) {
|
|
3687
|
+
let r = me.get(e);
|
|
3668
3688
|
if (!r) return;
|
|
3669
3689
|
let i = N.value, a = i?.getEl();
|
|
3670
|
-
!i || !a || (i.setData(r),
|
|
3690
|
+
!i || !a || (i.setData(r), xe = {
|
|
3671
3691
|
x: t,
|
|
3672
3692
|
y: n
|
|
3673
|
-
},
|
|
3693
|
+
}, Se = !0, ht(t, n), a.style.visibility = "visible");
|
|
3674
3694
|
}
|
|
3675
|
-
function
|
|
3676
|
-
|
|
3677
|
-
|
|
3695
|
+
function _t(e, t) {
|
|
3696
|
+
Se && (we = e, Te = t, !Ee && (Ee = requestAnimationFrame(() => {
|
|
3697
|
+
Ee = 0;
|
|
3678
3698
|
let e = N.value?.getEl();
|
|
3679
|
-
!e || !
|
|
3680
|
-
x:
|
|
3681
|
-
y:
|
|
3682
|
-
}, e.style.transform = `translate3d(${
|
|
3699
|
+
!e || !Se || (xe = {
|
|
3700
|
+
x: we,
|
|
3701
|
+
y: Te
|
|
3702
|
+
}, e.style.transform = `translate3d(${we + 16}px, ${Te}px, 0) translateY(-50%)`);
|
|
3683
3703
|
})));
|
|
3684
3704
|
}
|
|
3685
|
-
function
|
|
3686
|
-
if (!
|
|
3687
|
-
|
|
3705
|
+
function vt() {
|
|
3706
|
+
if (!Se) return;
|
|
3707
|
+
Se = !1, xe = null;
|
|
3688
3708
|
let e = N.value?.getEl();
|
|
3689
3709
|
e && (e.style.visibility = "hidden");
|
|
3690
3710
|
}
|
|
3691
|
-
function
|
|
3711
|
+
function yt(e, t) {
|
|
3692
3712
|
t === "dashed" ? (e.setAttribute("stroke-dasharray", "8 4"), e.removeAttribute("stroke-linecap")) : t === "dotted" ? (e.setAttribute("stroke-dasharray", "0 5"), e.setAttribute("stroke-linecap", "round")) : (e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap"));
|
|
3693
3713
|
}
|
|
3694
|
-
function
|
|
3695
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(J.value + 1)), e.setAttribute("stroke", "#555"),
|
|
3714
|
+
function Q(e, t = "solid") {
|
|
3715
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(J.value + 1)), e.setAttribute("stroke", "#555"), yt(e, t);
|
|
3696
3716
|
}
|
|
3697
|
-
function
|
|
3717
|
+
function bt(e) {
|
|
3698
3718
|
e.setAttribute("stroke-width", String(J.value)), e.setAttribute("stroke", f.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
3699
3719
|
}
|
|
3700
|
-
function
|
|
3701
|
-
z !== e && (z && !B.has(z) &&
|
|
3720
|
+
function xt(e) {
|
|
3721
|
+
z !== e && (z && !B.has(z) && bt(z), z = e, Q(e, B.get(e) ?? "solid"));
|
|
3702
3722
|
}
|
|
3703
|
-
function
|
|
3723
|
+
function St() {
|
|
3704
3724
|
if (z) {
|
|
3705
3725
|
let e = B.get(z);
|
|
3706
|
-
e == null ?
|
|
3726
|
+
e == null ? bt(z) : Q(z, e), z = null, D("stateHover", null);
|
|
3707
3727
|
}
|
|
3708
|
-
|
|
3728
|
+
vt();
|
|
3709
3729
|
}
|
|
3710
|
-
function
|
|
3730
|
+
function Ct(e) {
|
|
3711
3731
|
let t = e;
|
|
3712
3732
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
3713
3733
|
return t ? t.dataset.featId ?? null : null;
|
|
3714
3734
|
}
|
|
3715
|
-
function
|
|
3716
|
-
|
|
3735
|
+
function wt(e) {
|
|
3736
|
+
D("stateClick", {
|
|
3717
3737
|
id: e.id,
|
|
3718
3738
|
name: e.name,
|
|
3719
3739
|
value: e.value
|
|
3720
|
-
}),
|
|
3740
|
+
}), D("update:focus", Pe(Z.value).has(e.id) ? null : e.id);
|
|
3721
3741
|
}
|
|
3722
|
-
function
|
|
3723
|
-
if (
|
|
3724
|
-
let t = e, n =
|
|
3742
|
+
function Tt(e) {
|
|
3743
|
+
if (_e) return;
|
|
3744
|
+
let t = e, n = Ct(t.target);
|
|
3725
3745
|
if (!n) return;
|
|
3726
|
-
let r =
|
|
3746
|
+
let r = me.get(n);
|
|
3727
3747
|
if (!r) return;
|
|
3728
3748
|
let i = {
|
|
3729
3749
|
id: r.id,
|
|
3730
3750
|
name: r.name,
|
|
3731
3751
|
value: r.value
|
|
3732
3752
|
};
|
|
3733
|
-
e.type === "click" ?
|
|
3753
|
+
e.type === "click" ? wt(r) : e.type === "mouseover" && (xt(R.get(n)), de.value && gt(n, t.clientX, t.clientY), D("stateHover", i));
|
|
3734
3754
|
}
|
|
3735
|
-
function
|
|
3736
|
-
|
|
3755
|
+
function Et(e) {
|
|
3756
|
+
_e || _t(e.clientX, e.clientY);
|
|
3737
3757
|
}
|
|
3738
|
-
function
|
|
3758
|
+
function Dt(e) {
|
|
3739
3759
|
let t = e.relatedTarget;
|
|
3740
|
-
t &&
|
|
3760
|
+
t && re.value?.contains(t) || St();
|
|
3741
3761
|
}
|
|
3742
|
-
function
|
|
3762
|
+
function Ot(e) {
|
|
3743
3763
|
if (e.touches.length !== 1) {
|
|
3744
|
-
|
|
3764
|
+
De = null;
|
|
3745
3765
|
return;
|
|
3746
3766
|
}
|
|
3747
3767
|
let t = e.touches[0];
|
|
3748
|
-
|
|
3768
|
+
De = {
|
|
3749
3769
|
x: t.clientX,
|
|
3750
3770
|
y: t.clientY,
|
|
3751
3771
|
time: e.timeStamp,
|
|
3752
|
-
featId:
|
|
3772
|
+
featId: Ct(e.target)
|
|
3753
3773
|
};
|
|
3754
3774
|
}
|
|
3755
|
-
function
|
|
3756
|
-
let t =
|
|
3757
|
-
if (
|
|
3775
|
+
function kt(e) {
|
|
3776
|
+
let t = De;
|
|
3777
|
+
if (De = null, !t || !t.featId || e.touches.length > 0) return;
|
|
3758
3778
|
let n = e.changedTouches[0];
|
|
3759
|
-
if (!n || Math.abs(n.clientX - t.x) >
|
|
3760
|
-
let r =
|
|
3761
|
-
r && (e.preventDefault(),
|
|
3779
|
+
if (!n || Math.abs(n.clientX - t.x) > vr || Math.abs(n.clientY - t.y) > vr || e.timeStamp - t.time > yr) return;
|
|
3780
|
+
let r = me.get(t.featId);
|
|
3781
|
+
r && (e.preventDefault(), wt(r));
|
|
3762
3782
|
}
|
|
3763
|
-
function
|
|
3764
|
-
|
|
3783
|
+
function At() {
|
|
3784
|
+
De = null;
|
|
3765
3785
|
}
|
|
3766
|
-
function
|
|
3767
|
-
let t = document.createElementNS(
|
|
3786
|
+
function jt(e) {
|
|
3787
|
+
let t = document.createElementNS(_r, "path");
|
|
3768
3788
|
return e && t.setAttribute("d", e), t;
|
|
3769
3789
|
}
|
|
3770
|
-
function
|
|
3790
|
+
function Mt() {
|
|
3771
3791
|
let e = j.value, t = M.value;
|
|
3772
3792
|
if (!e || !t) return;
|
|
3773
3793
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
3774
3794
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
3775
|
-
|
|
3776
|
-
let n =
|
|
3795
|
+
R.clear(), me.clear(), he = null, z = null, B.clear(), ge.clear();
|
|
3796
|
+
let n = Xe.value, r = Je.value.features, i = f.strokeColor, a = String(J.value), o = !de.value, s = document.createDocumentFragment();
|
|
3777
3797
|
for (let e of r) {
|
|
3778
|
-
let t = String(e.id), r =
|
|
3779
|
-
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill",
|
|
3780
|
-
let e = document.createElementNS(
|
|
3781
|
-
e.textContent =
|
|
3798
|
+
let t = String(e.id), r = dt(e), c = lt(t), l = jt(n(e));
|
|
3799
|
+
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", ut(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
|
|
3800
|
+
let e = document.createElementNS(_r, "title");
|
|
3801
|
+
e.textContent = pt(r, c), l.appendChild(e);
|
|
3782
3802
|
}
|
|
3783
|
-
s.appendChild(l),
|
|
3803
|
+
s.appendChild(l), R.set(t, l), me.set(t, {
|
|
3784
3804
|
id: t,
|
|
3785
3805
|
name: r,
|
|
3786
3806
|
value: c,
|
|
3787
3807
|
feature: e
|
|
3788
3808
|
});
|
|
3789
3809
|
}
|
|
3790
|
-
let c =
|
|
3810
|
+
let c = Ye.value;
|
|
3791
3811
|
if (c) {
|
|
3792
|
-
let e =
|
|
3793
|
-
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e),
|
|
3812
|
+
let e = jt(n(c));
|
|
3813
|
+
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e), he = e;
|
|
3794
3814
|
}
|
|
3795
3815
|
e.appendChild(s);
|
|
3796
3816
|
}
|
|
3797
|
-
function
|
|
3798
|
-
let e = !
|
|
3799
|
-
for (let [t, n] of
|
|
3800
|
-
let r =
|
|
3801
|
-
if (n.setAttribute("fill",
|
|
3817
|
+
function Nt() {
|
|
3818
|
+
let e = !de.value;
|
|
3819
|
+
for (let [t, n] of R) {
|
|
3820
|
+
let r = lt(t), i = me.get(t);
|
|
3821
|
+
if (n.setAttribute("fill", ut(t)), i && (i.value = r), e && i) {
|
|
3802
3822
|
let e = n.firstElementChild;
|
|
3803
|
-
e && (e.textContent =
|
|
3823
|
+
e && (e.textContent = pt(i.name, r));
|
|
3804
3824
|
}
|
|
3805
3825
|
}
|
|
3806
3826
|
}
|
|
3807
|
-
function
|
|
3808
|
-
for (let e of
|
|
3809
|
-
|
|
3827
|
+
function Pt() {
|
|
3828
|
+
for (let e of R.values()) e === z || B.has(e) || bt(e);
|
|
3829
|
+
he && he.setAttribute("stroke", f.strokeColor);
|
|
3810
3830
|
}
|
|
3811
|
-
function
|
|
3831
|
+
function Ft() {
|
|
3812
3832
|
return typeof f.menu == "string" ? f.menu : "choropleth";
|
|
3813
3833
|
}
|
|
3814
|
-
let
|
|
3834
|
+
let $ = n(() => f.legend && (tt.value || nt.value || f.data)), It = n(() => f.colorScale.slice().sort((e, t) => e.min - t.min)), Lt = n(() => {
|
|
3815
3835
|
let e = [];
|
|
3816
3836
|
for (let t = 0; t <= 10; t++) {
|
|
3817
3837
|
let n = t / 10;
|
|
3818
3838
|
e.push({
|
|
3819
3839
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
3820
|
-
color:
|
|
3840
|
+
color: ot(n)
|
|
3821
3841
|
});
|
|
3822
3842
|
}
|
|
3823
3843
|
return e;
|
|
3824
|
-
}),
|
|
3844
|
+
}), Rt = new Intl.NumberFormat("en-US", {
|
|
3825
3845
|
notation: "compact",
|
|
3826
3846
|
maximumFractionDigits: 1
|
|
3827
|
-
}),
|
|
3828
|
-
let { min: e, max: t } =
|
|
3847
|
+
}), zt = n(() => {
|
|
3848
|
+
let { min: e, max: t } = et.value, n = t - e, r = [];
|
|
3829
3849
|
for (let t = 1; t <= 3; t++) {
|
|
3830
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
3850
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? Rt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
3831
3851
|
r.push({
|
|
3832
3852
|
value: o,
|
|
3833
3853
|
pct: i * 100
|
|
3834
3854
|
});
|
|
3835
3855
|
}
|
|
3836
3856
|
return r;
|
|
3837
|
-
}),
|
|
3857
|
+
}), Bt = n(() => {
|
|
3838
3858
|
let e = [];
|
|
3839
|
-
if (
|
|
3859
|
+
if (tt.value) for (let t of f.colorScale) e.push({
|
|
3840
3860
|
key: t.value,
|
|
3841
3861
|
color: t.color,
|
|
3842
3862
|
label: t.value
|
|
3843
3863
|
});
|
|
3844
|
-
else if (
|
|
3864
|
+
else if (nt.value) for (let t of It.value) e.push({
|
|
3845
3865
|
key: String(t.min),
|
|
3846
3866
|
color: t.color,
|
|
3847
3867
|
label: t.label ?? String(t.min)
|
|
3848
3868
|
});
|
|
3849
3869
|
return e;
|
|
3850
|
-
}),
|
|
3851
|
-
let e =
|
|
3870
|
+
}), Vt = n(() => `linear-gradient(to right, ${Lt.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), Ht = Be({ target: () => f.fullscreenTarget }), Ut = n(() => {
|
|
3871
|
+
let e = Ft();
|
|
3852
3872
|
return [
|
|
3853
|
-
|
|
3873
|
+
Ht.menuItem.value,
|
|
3854
3874
|
{
|
|
3855
3875
|
label: "Save as SVG",
|
|
3856
3876
|
action: () => {
|
|
3857
|
-
|
|
3877
|
+
A.value && Fe(A.value, e);
|
|
3858
3878
|
}
|
|
3859
3879
|
},
|
|
3860
3880
|
{
|
|
3861
3881
|
label: "Save as PNG",
|
|
3862
3882
|
action: () => {
|
|
3863
|
-
|
|
3883
|
+
A.value && G(A.value, e);
|
|
3864
3884
|
}
|
|
3865
3885
|
}
|
|
3866
3886
|
];
|
|
3867
3887
|
});
|
|
3868
|
-
return
|
|
3869
|
-
Ke.value,
|
|
3888
|
+
return T(() => [
|
|
3870
3889
|
Je.value,
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3890
|
+
Xe.value,
|
|
3891
|
+
de.value
|
|
3892
|
+
], () => Mt()), T(() => [
|
|
3893
|
+
$e.value,
|
|
3874
3894
|
f.colorScale,
|
|
3875
3895
|
f.noDataColor,
|
|
3876
3896
|
f.dataGeoType
|
|
3877
|
-
], () =>
|
|
3897
|
+
], () => Nt()), T(() => [f.strokeColor, J.value], () => Pt()), T(() => [
|
|
3878
3898
|
Z.value,
|
|
3879
|
-
|
|
3880
|
-
|
|
3899
|
+
Xe.value,
|
|
3900
|
+
We.value
|
|
3881
3901
|
], () => W(), { flush: "post" }), (n, l) => (_(), r(t, {
|
|
3882
|
-
to: C(
|
|
3883
|
-
disabled: !C(
|
|
3902
|
+
to: C(Ht).teleportTarget.value,
|
|
3903
|
+
disabled: !C(Ht).isFullscreen.value
|
|
3884
3904
|
}, [o("div", d({
|
|
3885
3905
|
ref_key: "containerRef",
|
|
3886
|
-
ref:
|
|
3906
|
+
ref: k
|
|
3887
3907
|
}, n.$attrs, {
|
|
3888
3908
|
class: ["choropleth-wrapper", {
|
|
3889
3909
|
pannable: c.pan,
|
|
3890
|
-
"is-fullscreen": C(
|
|
3910
|
+
"is-fullscreen": C(Ht).isFullscreen.value
|
|
3891
3911
|
}],
|
|
3892
|
-
style: C(
|
|
3912
|
+
style: C(Ht).fullscreenStyle.value,
|
|
3913
|
+
role: w.value || void 0,
|
|
3914
|
+
"aria-label": ee.value || void 0
|
|
3893
3915
|
}), [
|
|
3894
3916
|
c.menu ? (_(), r(pe, {
|
|
3895
3917
|
key: 0,
|
|
3896
|
-
items:
|
|
3897
|
-
"is-fullscreen": C(
|
|
3898
|
-
onClose: C(
|
|
3918
|
+
items: Ut.value,
|
|
3919
|
+
"is-fullscreen": C(Ht).isFullscreen.value,
|
|
3920
|
+
onClose: C(Ht).exit
|
|
3899
3921
|
}, null, 8, [
|
|
3900
3922
|
"items",
|
|
3901
3923
|
"is-fullscreen",
|
|
3902
3924
|
"onClose"
|
|
3903
3925
|
])) : i("", !0),
|
|
3904
|
-
o("div",
|
|
3905
|
-
c.title ||
|
|
3926
|
+
o("div", ur, x(C(Ht).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
|
|
3927
|
+
c.title || $.value ? (_(), a("div", dr, [c.title ? (_(), a("div", {
|
|
3906
3928
|
key: 0,
|
|
3907
3929
|
class: "choropleth-title",
|
|
3908
|
-
style: m(
|
|
3909
|
-
}, x(c.title), 5)) : i("", !0),
|
|
3930
|
+
style: m(L.value)
|
|
3931
|
+
}, x(c.title), 5)) : i("", !0), $.value ? (_(), a("div", {
|
|
3910
3932
|
key: 1,
|
|
3911
3933
|
class: "choropleth-legend",
|
|
3912
|
-
style: m(
|
|
3913
|
-
}, [c.legendTitle ? (_(), a("span",
|
|
3934
|
+
style: m(fe.value)
|
|
3935
|
+
}, [c.legendTitle ? (_(), a("span", fr, x(c.legendTitle), 1)) : i("", !0), tt.value || nt.value ? (_(!0), a(e, { key: 1 }, y(Bt.value, (e) => (_(), a("span", {
|
|
3914
3936
|
key: e.key,
|
|
3915
3937
|
class: "choropleth-legend-item"
|
|
3916
3938
|
}, [o("span", {
|
|
3917
3939
|
class: "choropleth-legend-swatch",
|
|
3918
3940
|
style: m({ background: e.color })
|
|
3919
|
-
}, null, 4), s(" " + x(e.label), 1)]))), 128)) : (_(), a("div",
|
|
3941
|
+
}, null, 4), s(" " + x(e.label), 1)]))), 128)) : (_(), a("div", pr, [o("div", {
|
|
3920
3942
|
class: "choropleth-legend-gradient",
|
|
3921
|
-
style: m({ background:
|
|
3922
|
-
}, null, 4), o("div",
|
|
3943
|
+
style: m({ background: Vt.value })
|
|
3944
|
+
}, null, 4), o("div", mr, [(_(!0), a(e, null, y(zt.value, (e) => (_(), a("span", {
|
|
3923
3945
|
key: e.value,
|
|
3924
3946
|
style: m({ left: e.pct + "%" })
|
|
3925
3947
|
}, x(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
|
|
3926
3948
|
(_(), a("svg", {
|
|
3927
3949
|
ref_key: "svgRef",
|
|
3928
|
-
ref:
|
|
3929
|
-
viewBox: `0 0 ${
|
|
3950
|
+
ref: A,
|
|
3951
|
+
viewBox: `0 0 ${Re.value} ${ze.value}`,
|
|
3930
3952
|
preserveAspectRatio: "xMidYMid meet",
|
|
3931
3953
|
style: m(c.twoFingerPan ? { touchAction: "pan-y" } : void 0)
|
|
3932
3954
|
}, [o("g", {
|
|
3933
3955
|
ref_key: "mapGroupRef",
|
|
3934
|
-
ref:
|
|
3956
|
+
ref: re
|
|
3935
3957
|
}, [o("g", {
|
|
3936
3958
|
ref_key: "baseGroupRef",
|
|
3937
3959
|
ref: j
|
|
3938
3960
|
}, null, 512), o("g", {
|
|
3939
3961
|
ref_key: "overlayGroupRef",
|
|
3940
3962
|
ref: M
|
|
3941
|
-
}, null, 512)], 512)], 12,
|
|
3942
|
-
|
|
3963
|
+
}, null, 512)], 512)], 12, hr)),
|
|
3964
|
+
Ce.value ? (_(), a("button", {
|
|
3943
3965
|
key: 2,
|
|
3944
3966
|
type: "button",
|
|
3945
3967
|
class: "choropleth-reset",
|
|
3946
3968
|
"aria-label": "Reset zoom",
|
|
3947
|
-
onClick:
|
|
3969
|
+
onClick: Ie
|
|
3948
3970
|
}, " Reset ")) : i("", !0),
|
|
3949
|
-
|
|
3971
|
+
de.value ? (_(), r(cr, {
|
|
3950
3972
|
key: 3,
|
|
3951
3973
|
ref_key: "tooltipChildRef",
|
|
3952
3974
|
ref: N
|
|
3953
3975
|
}, {
|
|
3954
|
-
default:
|
|
3976
|
+
default: E((t) => [b(n.$slots, "tooltip", p(u(O(t))), () => [c.tooltipFormat ? (_(), a("span", {
|
|
3955
3977
|
key: 0,
|
|
3956
3978
|
innerHTML: c.tooltipFormat(t)
|
|
3957
|
-
}, null, 8,
|
|
3979
|
+
}, null, 8, gr)) : t.value == null ? (_(), a(e, { key: 1 }, [s(x(t.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(x(t.name) + ": " + x(ft(t.value)), 1)], 64))], !0)]),
|
|
3958
3980
|
_: 3
|
|
3959
3981
|
}, 512)) : i("", !0)
|
|
3960
|
-
], 16)], 8, ["to", "disabled"]));
|
|
3982
|
+
], 16, lr)], 8, ["to", "disabled"]));
|
|
3961
3983
|
}
|
|
3962
|
-
}), [["__scopeId", "data-v-
|
|
3984
|
+
}), [["__scopeId", "data-v-7bd9e073"]]), wr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3963
3985
|
__name: "ChartTooltip",
|
|
3964
3986
|
props: {
|
|
3965
3987
|
x: {},
|
|
@@ -3979,12 +4001,12 @@ var Bt = {
|
|
|
3979
4001
|
top: `${e.y}px`,
|
|
3980
4002
|
transform: "translateY(-50%)"
|
|
3981
4003
|
})
|
|
3982
|
-
}, [b(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(C(
|
|
4004
|
+
}, [b(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(C(ie), {
|
|
3983
4005
|
key: 1,
|
|
3984
4006
|
open: e.open
|
|
3985
4007
|
}, {
|
|
3986
|
-
default:
|
|
3987
|
-
default:
|
|
4008
|
+
default: E(() => [c(C(j), { "as-child": "" }, {
|
|
4009
|
+
default: E(() => [o("div", {
|
|
3988
4010
|
class: "chart-tooltip-anchor",
|
|
3989
4011
|
style: m({
|
|
3990
4012
|
left: `${e.x}px`,
|
|
@@ -3992,8 +4014,8 @@ var Bt = {
|
|
|
3992
4014
|
})
|
|
3993
4015
|
}, null, 4)]),
|
|
3994
4016
|
_: 1
|
|
3995
|
-
}), c(C(
|
|
3996
|
-
default:
|
|
4017
|
+
}), c(C(N), null, {
|
|
4018
|
+
default: E(() => [e.open ? (_(), r(C(M), {
|
|
3997
4019
|
key: 0,
|
|
3998
4020
|
class: "chart-tooltip-content",
|
|
3999
4021
|
side: "right",
|
|
@@ -4002,7 +4024,7 @@ var Bt = {
|
|
|
4002
4024
|
onPointerDownOutside: n[0] ||= (e) => t.$emit("close"),
|
|
4003
4025
|
onEscapeKeyDown: n[1] ||= (e) => t.$emit("close")
|
|
4004
4026
|
}, {
|
|
4005
|
-
default:
|
|
4027
|
+
default: E(() => [b(t.$slots, "default", {}, void 0, !0)]),
|
|
4006
4028
|
_: 3
|
|
4007
4029
|
}, 8, ["side-offset"])) : i("", !0)]),
|
|
4008
4030
|
_: 3
|
|
@@ -4010,7 +4032,7 @@ var Bt = {
|
|
|
4010
4032
|
_: 3
|
|
4011
4033
|
}, 8, ["open"])) : i("", !0);
|
|
4012
4034
|
}
|
|
4013
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
4035
|
+
}), [["__scopeId", "data-v-44377f70"]]), Tr = { class: "TableWrapper" }, Er = ["href", "download"], Dr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
4014
4036
|
__name: "DataTable",
|
|
4015
4037
|
props: {
|
|
4016
4038
|
data: {},
|
|
@@ -4094,47 +4116,47 @@ var Bt = {
|
|
|
4094
4116
|
let r = c.columnConfig?.[e.name]?.format;
|
|
4095
4117
|
if (r !== void 0) {
|
|
4096
4118
|
if (typeof r == "function") return r(n, t);
|
|
4097
|
-
if (typeof n == "number") return
|
|
4119
|
+
if (typeof n == "number") return ne(n, r);
|
|
4098
4120
|
}
|
|
4099
4121
|
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);
|
|
4100
4122
|
}
|
|
4101
4123
|
function C() {
|
|
4102
4124
|
return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
|
|
4103
4125
|
}
|
|
4104
|
-
function
|
|
4126
|
+
function te(e) {
|
|
4105
4127
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
4106
4128
|
}
|
|
4107
|
-
function
|
|
4129
|
+
function w() {
|
|
4108
4130
|
if (typeof c.csv == "function") return c.csv();
|
|
4109
4131
|
if (typeof c.csv == "string") return c.csv;
|
|
4110
|
-
let e = b.value, t = ee.value, n = [e.map((e) =>
|
|
4132
|
+
let e = b.value, t = ee.value, n = [e.map((e) => te(l(e.name))).join(",")];
|
|
4111
4133
|
for (let r = 0; r < t; r++) {
|
|
4112
|
-
let t = e.map((e) =>
|
|
4134
|
+
let t = e.map((e) => te(S(e, r)));
|
|
4113
4135
|
n.push(t.join(","));
|
|
4114
4136
|
}
|
|
4115
4137
|
return n.join("\n");
|
|
4116
4138
|
}
|
|
4117
|
-
function
|
|
4118
|
-
|
|
4139
|
+
function T() {
|
|
4140
|
+
K(w(), C());
|
|
4119
4141
|
}
|
|
4120
|
-
let
|
|
4142
|
+
let E = n(() => c.downloadButton || c.downloadLink ? [] : [{
|
|
4121
4143
|
label: c.downloadMenuLink,
|
|
4122
|
-
action:
|
|
4123
|
-
}]),
|
|
4144
|
+
action: T
|
|
4145
|
+
}]), D = n(() => {
|
|
4124
4146
|
if (c.downloadButton) return null;
|
|
4125
4147
|
let e = c.downloadLink;
|
|
4126
4148
|
return e ? typeof e == "string" ? e : "Download data (CSV)" : null;
|
|
4127
|
-
}),
|
|
4149
|
+
}), O = n(() => D.value ? `data:text/csv;charset=utf-8,${encodeURIComponent(w())}` : null), k = n(() => !!c.menu && E.value.length > 0);
|
|
4128
4150
|
return (n, s) => (_(), a("div", { class: f(["TableOuter", {
|
|
4129
4151
|
"full-width": t.fullWidth,
|
|
4130
|
-
"has-menu":
|
|
4152
|
+
"has-menu": k.value
|
|
4131
4153
|
}]) }, [
|
|
4132
|
-
|
|
4154
|
+
k.value ? (_(), r(pe, {
|
|
4133
4155
|
key: 0,
|
|
4134
|
-
items:
|
|
4156
|
+
items: E.value,
|
|
4135
4157
|
"force-dropdown": ""
|
|
4136
4158
|
}, null, 8, ["items"])) : i("", !0),
|
|
4137
|
-
o("div",
|
|
4159
|
+
o("div", Tr, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
|
|
4138
4160
|
o("colgroup", null, [(_(!0), a(e, null, y(b.value, (e) => (_(), a("col", {
|
|
4139
4161
|
key: e.name,
|
|
4140
4162
|
style: m(u(e.name))
|
|
@@ -4154,15 +4176,15 @@ var Bt = {
|
|
|
4154
4176
|
key: 1,
|
|
4155
4177
|
type: "button",
|
|
4156
4178
|
class: "data-table-download-button",
|
|
4157
|
-
onClick:
|
|
4158
|
-
}, x(t.downloadMenuLink), 1)) :
|
|
4179
|
+
onClick: T
|
|
4180
|
+
}, x(t.downloadMenuLink), 1)) : D.value ? (_(), a("a", {
|
|
4159
4181
|
key: 2,
|
|
4160
4182
|
class: "data-table-download-link",
|
|
4161
|
-
href:
|
|
4183
|
+
href: O.value,
|
|
4162
4184
|
download: `${C()}.csv`
|
|
4163
|
-
}, x(
|
|
4185
|
+
}, x(D.value), 9, Er)) : i("", !0)
|
|
4164
4186
|
], 2));
|
|
4165
4187
|
}
|
|
4166
4188
|
}), [["__scopeId", "data-v-21721f41"]]);
|
|
4167
4189
|
//#endregion
|
|
4168
|
-
export { or as BarChart,
|
|
4190
|
+
export { or as BarChart, wr as ChartTooltip, Cr as ChoroplethMap, Dr as DataTable, En as LineChart };
|