@cfasim-ui/charts 0.7.1 → 0.7.3
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 +18 -17
- package/dist/index.css +1 -1
- package/dist/index.js +1237 -1180
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, nextTick as f, normalizeClass as p, normalizeProps as m, normalizeStyle as h, onMounted as g, onUnmounted as ee, openBlock as _, ref as v, renderList as y, renderSlot as te, toDisplayString as b, toHandlers as ne, toRaw as
|
|
2
|
-
import { formatNumber as
|
|
3
|
-
import { DropdownMenuContent as
|
|
4
|
-
import { geoAlbersUsa as
|
|
5
|
-
import { zoom as
|
|
6
|
-
import { select as
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, nextTick as f, normalizeClass as p, normalizeProps as m, normalizeStyle as h, onMounted as g, onUnmounted as ee, openBlock as _, ref as v, renderList as y, renderSlot as te, toDisplayString as b, toHandlers as ne, toRaw as x, unref as S, useSlots as C, useTemplateRef as w, watch as T, withCtx as E } from "vue";
|
|
2
|
+
import { formatNumber as re } from "@cfasim-ui/shared";
|
|
3
|
+
import { DropdownMenuContent as D, DropdownMenuItem as O, DropdownMenuPortal as ie, DropdownMenuRoot as k, DropdownMenuTrigger as A, PopoverAnchor as j, PopoverContent as ae, PopoverPortal as M, PopoverRoot as oe } from "reka-ui";
|
|
4
|
+
import { geoAlbersUsa as N, geoMercator as se, geoPath as P } from "d3-geo";
|
|
5
|
+
import { zoom as ce, zoomIdentity as le, zoomTransform as ue } from "d3-zoom";
|
|
6
|
+
import { select as F } from "d3-selection";
|
|
7
7
|
import "d3-transition";
|
|
8
|
-
import { feature as
|
|
8
|
+
import { feature as de, merge as fe, mesh as pe } from "topojson-client";
|
|
9
9
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var I = ["aria-label"], me = /* @__PURE__ */ l({
|
|
11
11
|
__name: "ChartMenu",
|
|
12
12
|
props: {
|
|
13
13
|
items: {},
|
|
@@ -37,15 +37,15 @@ var F = ["aria-label"], he = /* @__PURE__ */ l({
|
|
|
37
37
|
"stroke-width": "1.75",
|
|
38
38
|
"stroke-linecap": "round",
|
|
39
39
|
"aria-hidden": "true"
|
|
40
|
-
}, [o("path", { d: "M4 4l8 8M12 4l-8 8" })], -1)]])) : u() ? (_(), r(
|
|
40
|
+
}, [o("path", { d: "M4 4l8 8M12 4l-8 8" })], -1)]])) : u() ? (_(), r(S(k), {
|
|
41
41
|
key: 2,
|
|
42
42
|
modal: !1
|
|
43
43
|
}, {
|
|
44
|
-
default:
|
|
44
|
+
default: E(() => [c(S(A), {
|
|
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 F = ["aria-label"], he = /* @__PURE__ */ l({
|
|
|
69
69
|
})
|
|
70
70
|
], -1)]]),
|
|
71
71
|
_: 1
|
|
72
|
-
}), c(
|
|
73
|
-
default:
|
|
72
|
+
}), c(S(ie), null, {
|
|
73
|
+
default: E(() => [c(S(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(S(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(b(e.label), 1)]),
|
|
85
85
|
_: 2
|
|
86
86
|
}, 1032, ["aria-pressed", "onSelect"]))), 128))]),
|
|
87
87
|
_: 1
|
|
@@ -104,44 +104,44 @@ var F = ["aria-label"], he = /* @__PURE__ */ l({
|
|
|
104
104
|
"stroke-linecap": "round",
|
|
105
105
|
"stroke-linejoin": "round",
|
|
106
106
|
"aria-hidden": "true"
|
|
107
|
-
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8,
|
|
107
|
+
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, I))], 2));
|
|
108
108
|
}
|
|
109
|
-
}),
|
|
109
|
+
}), L = (e, t) => {
|
|
110
110
|
let n = e.__vccOpts || e;
|
|
111
111
|
for (let [e, r] of t) n[e] = r;
|
|
112
112
|
return n;
|
|
113
|
-
},
|
|
113
|
+
}, he = /* @__PURE__ */ L(me, [["__scopeId", "data-v-f5743494"]]);
|
|
114
114
|
//#endregion
|
|
115
115
|
//#region src/_shared/axes.ts
|
|
116
|
-
function
|
|
116
|
+
function R(e) {
|
|
117
117
|
return Math.round(e) + .5;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function ge(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 _e(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
|
|
135
|
-
function
|
|
135
|
+
function ve(e) {
|
|
136
136
|
let { min: t, max: n, ticks: r } = 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 _e(t + i, n + i, r).map((e) => e - i);
|
|
141
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = ge(n - t, a);
|
|
142
|
+
return _e(t + i, n + i, o).map((e) => e - i);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function ye(e, t, n, r) {
|
|
145
145
|
if (r === "log") {
|
|
146
146
|
let r = Math.log10(t), i = Math.log10(n) - r || 1;
|
|
147
147
|
return (Math.log10(e > 0 ? e : t) - r) / i;
|
|
@@ -149,7 +149,7 @@ function be(e, t, n, r) {
|
|
|
149
149
|
let i = n - t || 1;
|
|
150
150
|
return (e - t) / i;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function be(e, t, n, r) {
|
|
153
153
|
if (n !== "log") return {
|
|
154
154
|
min: e,
|
|
155
155
|
max: t
|
|
@@ -160,7 +160,7 @@ function xe(e, t, n, r) {
|
|
|
160
160
|
max: t > 0 ? Math.max(t, i) : i
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function xe(e) {
|
|
164
164
|
let { min: t, max: n, ticks: r } = e;
|
|
165
165
|
if (!(t > 0) || !(n > 0) || t === n) return [];
|
|
166
166
|
if (Array.isArray(r)) return r.filter((e) => e > 0 && e >= t && e <= n);
|
|
@@ -173,7 +173,7 @@ function Se(e) {
|
|
|
173
173
|
}
|
|
174
174
|
//#endregion
|
|
175
175
|
//#region src/_shared/useChartSize.ts
|
|
176
|
-
function
|
|
176
|
+
function Se(e = {}) {
|
|
177
177
|
let t = v(null), n = v(0), r = v(0), i = null, a = null;
|
|
178
178
|
return g(() => {
|
|
179
179
|
t.value && (n.value = t.value.clientWidth, r.value = t.value.clientHeight, i = new ResizeObserver((t) => {
|
|
@@ -192,8 +192,8 @@ function Ce(e = {}) {
|
|
|
192
192
|
measuredHeight: r
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
var
|
|
196
|
-
function
|
|
195
|
+
var Ce = .6, V = 8;
|
|
196
|
+
function we(e, t) {
|
|
197
197
|
return {
|
|
198
198
|
fontSize: e?.fontSize ?? t.fontSize,
|
|
199
199
|
fill: e?.color ?? "currentColor",
|
|
@@ -201,8 +201,8 @@ function Te(e, t) {
|
|
|
201
201
|
fillOpacity: e?.color == null ? t.fillOpacity : void 0
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
var
|
|
205
|
-
function
|
|
204
|
+
var Te = 7, Ee = 18, De = 16;
|
|
205
|
+
function Oe(e) {
|
|
206
206
|
return e == null ? {
|
|
207
207
|
top: 0,
|
|
208
208
|
right: 0,
|
|
@@ -220,12 +220,12 @@ function ke(e) {
|
|
|
220
220
|
left: e.left ?? 0
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
return
|
|
223
|
+
function ke(e) {
|
|
224
|
+
return Ee + e.length * Te;
|
|
225
225
|
}
|
|
226
226
|
function Ae(e) {
|
|
227
227
|
let t = n(() => {
|
|
228
|
-
let t =
|
|
228
|
+
let t = Oe(e.extraPadding?.());
|
|
229
229
|
return {
|
|
230
230
|
left: (e.yLabel() ? 56 : 50) + t.left,
|
|
231
231
|
right: 10 + t.right
|
|
@@ -238,11 +238,11 @@ function Ae(e) {
|
|
|
238
238
|
};
|
|
239
239
|
let n = Math.max(0, r.value), i = [], a = 0, o = 0;
|
|
240
240
|
for (let e of t) {
|
|
241
|
-
let t =
|
|
241
|
+
let t = ke(e);
|
|
242
242
|
o > 0 && o + t > n && (a++, o = 0), i.push({
|
|
243
243
|
x: o,
|
|
244
244
|
row: a
|
|
245
|
-
}), o += t +
|
|
245
|
+
}), o += t + De;
|
|
246
246
|
}
|
|
247
247
|
return {
|
|
248
248
|
positions: i,
|
|
@@ -252,9 +252,9 @@ function Ae(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 + V;
|
|
256
256
|
}), o = n(() => {
|
|
257
|
-
let n =
|
|
257
|
+
let n = Oe(e.extraPadding?.()), r = i.value.rowCount;
|
|
258
258
|
return {
|
|
259
259
|
top: a.value + r * 20 + n.top,
|
|
260
260
|
bottom: (e.xLabel() ? 38 : 30) + n.bottom,
|
|
@@ -321,7 +321,7 @@ function Ne(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;
|
|
@@ -395,105 +395,145 @@ function Ne(e) {
|
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/ChartMenu/download.ts
|
|
398
|
-
function
|
|
398
|
+
function U(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 W = [
|
|
403
403
|
"color",
|
|
404
404
|
"font-family",
|
|
405
405
|
"font-size",
|
|
406
406
|
"font-weight"
|
|
407
|
-
],
|
|
408
|
-
function
|
|
407
|
+
], G = ["fill", "stroke"];
|
|
408
|
+
function Pe(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 K(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 W) {
|
|
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 G) {
|
|
425
425
|
let n = e.getAttribute(t);
|
|
426
|
-
!n || !n.includes("var(") || e.setAttribute(t,
|
|
426
|
+
!n || !n.includes("var(") || e.setAttribute(t, Pe(n));
|
|
427
427
|
}
|
|
428
428
|
return t;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
let n =
|
|
432
|
-
|
|
430
|
+
function q(e, t) {
|
|
431
|
+
let n = K(e), r = new XMLSerializer().serializeToString(n);
|
|
432
|
+
U(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
let n =
|
|
434
|
+
function Fe(e, t) {
|
|
435
|
+
let n = K(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 && U(e, `${t}.png`);
|
|
442
442
|
}), URL.revokeObjectURL(a);
|
|
443
443
|
}, o.src = a;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
|
|
445
|
+
function Ie(e, t) {
|
|
446
|
+
U(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
447
|
+
}
|
|
448
|
+
//#endregion
|
|
449
|
+
//#region src/_shared/touch.ts
|
|
450
|
+
function J() {
|
|
451
|
+
return typeof window < "u" && "ontouchstart" in window;
|
|
447
452
|
}
|
|
448
453
|
//#endregion
|
|
449
454
|
//#region src/_shared/useChartFullscreen.ts
|
|
450
|
-
var
|
|
455
|
+
var Le = 0, Re = "";
|
|
456
|
+
function ze() {
|
|
457
|
+
typeof document > "u" || (Le === 0 && (Re = document.body.style.overflow, document.body.style.overflow = "hidden"), Le++);
|
|
458
|
+
}
|
|
451
459
|
function Be() {
|
|
452
|
-
typeof document > "u" ||
|
|
460
|
+
typeof document > "u" || Le !== 0 && (Le--, Le === 0 && (document.body.style.overflow = Re));
|
|
461
|
+
}
|
|
462
|
+
var Ve = 0, Y = null;
|
|
463
|
+
function He() {
|
|
464
|
+
return document.querySelector("meta[name=\"viewport\"]");
|
|
465
|
+
}
|
|
466
|
+
function Ue() {
|
|
467
|
+
if (typeof document > "u" || !J()) return;
|
|
468
|
+
let e = He();
|
|
469
|
+
if (e) {
|
|
470
|
+
if (Ve === 0) {
|
|
471
|
+
Y = e.getAttribute("content");
|
|
472
|
+
let t = Y || "width=device-width, initial-scale=1";
|
|
473
|
+
e.setAttribute("content", `${t}, maximum-scale=1`);
|
|
474
|
+
}
|
|
475
|
+
Ve++;
|
|
476
|
+
}
|
|
453
477
|
}
|
|
454
|
-
function
|
|
455
|
-
typeof document > "u"
|
|
478
|
+
function We() {
|
|
479
|
+
if (!(typeof document > "u") && Ve !== 0 && (Ve--, Ve === 0)) {
|
|
480
|
+
let e = He();
|
|
481
|
+
e && Y != null && e.setAttribute("content", Y), Y = null;
|
|
482
|
+
}
|
|
456
483
|
}
|
|
457
|
-
function
|
|
458
|
-
let t = v(!1), r = !1;
|
|
459
|
-
function
|
|
460
|
-
e
|
|
484
|
+
function Ge(e = {}) {
|
|
485
|
+
let t = v(!1), r = !1, i = v(null);
|
|
486
|
+
function a() {
|
|
487
|
+
let e = typeof window < "u" ? window.visualViewport : null;
|
|
488
|
+
e && (i.value = {
|
|
489
|
+
top: `${e.offsetTop}px`,
|
|
490
|
+
left: `${e.offsetLeft}px`,
|
|
491
|
+
width: `${e.width}px`,
|
|
492
|
+
height: `${e.height}px`
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
function o(e) {
|
|
496
|
+
let t = typeof window < "u" ? window.visualViewport : null;
|
|
497
|
+
t && (e ? (t.addEventListener("resize", a), t.addEventListener("scroll", a), a()) : (t.removeEventListener("resize", a), t.removeEventListener("scroll", a), i.value = null));
|
|
461
498
|
}
|
|
462
|
-
function
|
|
499
|
+
function s(e) {
|
|
500
|
+
e !== t.value && (t.value = e, e && !r ? (ze(), Ue(), o(!0), r = !0) : !e && r && (Be(), We(), o(!1), r = !1));
|
|
501
|
+
}
|
|
502
|
+
function c(e) {
|
|
463
503
|
if (e.key !== "Escape" || !t.value) return;
|
|
464
504
|
let n = e.target;
|
|
465
|
-
n instanceof Element && n.closest("[role=\"menu\"], [role=\"dialog\"]") ||
|
|
505
|
+
n instanceof Element && n.closest("[role=\"menu\"], [role=\"dialog\"]") || s(!1);
|
|
466
506
|
}
|
|
467
|
-
function
|
|
468
|
-
|
|
507
|
+
function l() {
|
|
508
|
+
s(!0);
|
|
469
509
|
}
|
|
470
|
-
function
|
|
471
|
-
|
|
510
|
+
function u() {
|
|
511
|
+
s(!1);
|
|
472
512
|
}
|
|
473
|
-
function
|
|
474
|
-
|
|
513
|
+
function d() {
|
|
514
|
+
s(!t.value);
|
|
475
515
|
}
|
|
476
516
|
return g(() => {
|
|
477
|
-
typeof document > "u" || document.addEventListener("keydown",
|
|
517
|
+
typeof document > "u" || document.addEventListener("keydown", c);
|
|
478
518
|
}), ee(() => {
|
|
479
|
-
typeof document > "u" || (document.removeEventListener("keydown",
|
|
519
|
+
typeof document > "u" || (document.removeEventListener("keydown", c), r &&= (Be(), We(), o(!1), !1));
|
|
480
520
|
}), {
|
|
481
521
|
isFullscreen: t,
|
|
482
|
-
toggle:
|
|
483
|
-
enter:
|
|
484
|
-
exit:
|
|
522
|
+
toggle: d,
|
|
523
|
+
enter: l,
|
|
524
|
+
exit: u,
|
|
485
525
|
menuItem: n(() => ({
|
|
486
526
|
label: t.value ? "Collapse" : "Fullscreen",
|
|
487
|
-
action:
|
|
527
|
+
action: d,
|
|
488
528
|
ariaPressed: t.value
|
|
489
529
|
})),
|
|
490
530
|
fullscreenStyle: n(() => t.value ? {
|
|
491
531
|
position: "fixed",
|
|
492
|
-
inset: "0",
|
|
532
|
+
...i.value ?? { inset: "0" },
|
|
493
533
|
"z-index": "var(--cfasim-z-fullscreen, 1000)",
|
|
494
534
|
background: "var(--color-bg-0, #fff)",
|
|
495
535
|
color: "var(--color-text, inherit)",
|
|
496
|
-
padding: "2em",
|
|
536
|
+
padding: J() ? "0" : "2em",
|
|
497
537
|
"box-sizing": "border-box",
|
|
498
538
|
display: "flex",
|
|
499
539
|
"flex-direction": "column",
|
|
@@ -504,7 +544,7 @@ function He(e = {}) {
|
|
|
504
544
|
}
|
|
505
545
|
//#endregion
|
|
506
546
|
//#region src/_shared/useChartMenu.ts
|
|
507
|
-
function
|
|
547
|
+
function X(e) {
|
|
508
548
|
let t = v(null);
|
|
509
549
|
function r() {
|
|
510
550
|
let t = e.filename();
|
|
@@ -512,23 +552,23 @@ function Ue(e) {
|
|
|
512
552
|
let n = e.legacyMenuLabel();
|
|
513
553
|
return typeof n == "string" ? n : "chart";
|
|
514
554
|
}
|
|
515
|
-
let i = e.fullscreen ?
|
|
555
|
+
let i = e.fullscreen ? Ge({ target: e.fullscreenTarget }) : null, a = n(() => {
|
|
516
556
|
let n = r(), a = [];
|
|
517
557
|
i && a.push(i.menuItem.value), a.push({
|
|
518
558
|
label: "Save as SVG",
|
|
519
559
|
action: () => {
|
|
520
|
-
t.value &&
|
|
560
|
+
t.value && q(t.value, n);
|
|
521
561
|
}
|
|
522
562
|
}, {
|
|
523
563
|
label: "Save as PNG",
|
|
524
564
|
action: () => {
|
|
525
|
-
t.value &&
|
|
565
|
+
t.value && Fe(t.value, n);
|
|
526
566
|
}
|
|
527
567
|
});
|
|
528
568
|
let o = e.downloadButton?.();
|
|
529
569
|
return !e.downloadLink() && !o && a.push({
|
|
530
570
|
label: "Download CSV",
|
|
531
|
-
action: () =>
|
|
571
|
+
action: () => Ie(e.getCsv(), n)
|
|
532
572
|
}), a;
|
|
533
573
|
}), o = n(() => {
|
|
534
574
|
if (e.downloadButton?.()) return null;
|
|
@@ -539,7 +579,7 @@ function Ue(e) {
|
|
|
539
579
|
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
540
580
|
});
|
|
541
581
|
function l() {
|
|
542
|
-
|
|
582
|
+
Ie(e.getCsv(), r());
|
|
543
583
|
}
|
|
544
584
|
return {
|
|
545
585
|
svgRef: t,
|
|
@@ -556,13 +596,8 @@ function Ue(e) {
|
|
|
556
596
|
};
|
|
557
597
|
}
|
|
558
598
|
//#endregion
|
|
559
|
-
//#region src/_shared/touch.ts
|
|
560
|
-
function q() {
|
|
561
|
-
return typeof window < "u" && "ontouchstart" in window;
|
|
562
|
-
}
|
|
563
|
-
//#endregion
|
|
564
599
|
//#region src/_shared/ChartZoomControls.vue?vue&type=script&setup=true&lang.ts
|
|
565
|
-
var
|
|
600
|
+
var Ke = ["disabled"], qe = ["disabled"], Z = ["disabled"], Je = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
566
601
|
__name: "ChartZoomControls",
|
|
567
602
|
props: {
|
|
568
603
|
canZoomIn: {
|
|
@@ -605,7 +640,7 @@ var We = ["disabled"], Ge = ["disabled"], Ke = ["disabled"], qe = /* @__PURE__ *
|
|
|
605
640
|
"stroke-width": "1.5",
|
|
606
641
|
"stroke-linecap": "round",
|
|
607
642
|
"aria-hidden": "true"
|
|
608
|
-
}, [o("path", { d: "M7 2v10M2 7h10" })], -1)]], 8,
|
|
643
|
+
}, [o("path", { d: "M7 2v10M2 7h10" })], -1)]], 8, Ke),
|
|
609
644
|
o("button", {
|
|
610
645
|
type: "button",
|
|
611
646
|
class: "chart-zoom-button",
|
|
@@ -621,7 +656,7 @@ var We = ["disabled"], Ge = ["disabled"], Ke = ["disabled"], qe = /* @__PURE__ *
|
|
|
621
656
|
"stroke-width": "1.5",
|
|
622
657
|
"stroke-linecap": "round",
|
|
623
658
|
"aria-hidden": "true"
|
|
624
|
-
}, [o("path", { d: "M2 7h10" })], -1)]], 8,
|
|
659
|
+
}, [o("path", { d: "M2 7h10" })], -1)]], 8, qe),
|
|
625
660
|
o("button", {
|
|
626
661
|
type: "button",
|
|
627
662
|
class: "chart-zoom-button",
|
|
@@ -638,13 +673,13 @@ var We = ["disabled"], Ge = ["disabled"], Ke = ["disabled"], qe = /* @__PURE__ *
|
|
|
638
673
|
"stroke-linecap": "round",
|
|
639
674
|
"stroke-linejoin": "round",
|
|
640
675
|
"aria-hidden": "true"
|
|
641
|
-
}, [o("path", { d: "M1.75 7a5.25 5.25 0 1 0 5.25-5.25c-1.48 0-2.9.6-3.94 1.6L1.75 4.7" }), o("path", { d: "M1.75 1.75v2.95h2.95" })], -1)]], 8,
|
|
676
|
+
}, [o("path", { d: "M1.75 7a5.25 5.25 0 1 0 5.25-5.25c-1.48 0-2.9.6-3.94 1.6L1.75 4.7" }), o("path", { d: "M1.75 1.75v2.95h2.95" })], -1)]], 8, Z)
|
|
642
677
|
], 2));
|
|
643
678
|
}
|
|
644
679
|
}), [["__scopeId", "data-v-87ceeada"]]);
|
|
645
680
|
//#endregion
|
|
646
681
|
//#region src/_shared/seriesCsv.ts
|
|
647
|
-
function
|
|
682
|
+
function Ye(e) {
|
|
648
683
|
if (e.length === 0) return "";
|
|
649
684
|
let t = 0;
|
|
650
685
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -656,43 +691,43 @@ function J(e) {
|
|
|
656
691
|
}
|
|
657
692
|
return i.join("\n");
|
|
658
693
|
}
|
|
659
|
-
function
|
|
694
|
+
function Xe(e, t, n = "category") {
|
|
660
695
|
if (t.length === 0 || e.length === 0) return "";
|
|
661
696
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
662
697
|
for (let n = 0; n < e.length; n++) {
|
|
663
|
-
let i = [
|
|
698
|
+
let i = [Ze(e[n])];
|
|
664
699
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
665
700
|
r.push(i.join(","));
|
|
666
701
|
}
|
|
667
702
|
return r.join("\n");
|
|
668
703
|
}
|
|
669
|
-
function
|
|
704
|
+
function Ze(e) {
|
|
670
705
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
671
706
|
}
|
|
672
707
|
//#endregion
|
|
673
708
|
//#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
|
|
674
|
-
var
|
|
709
|
+
var Qe = {
|
|
675
710
|
class: "chart-annotations",
|
|
676
711
|
"pointer-events": "none"
|
|
677
|
-
},
|
|
712
|
+
}, $e = ["stroke", "stroke-width"], et = [
|
|
678
713
|
"d",
|
|
679
714
|
"stroke",
|
|
680
715
|
"stroke-width"
|
|
681
|
-
],
|
|
716
|
+
], tt = [
|
|
682
717
|
"fill",
|
|
683
718
|
"stroke",
|
|
684
719
|
"stroke-width",
|
|
685
720
|
"transform"
|
|
686
|
-
],
|
|
721
|
+
], nt = [
|
|
687
722
|
"stroke",
|
|
688
723
|
"stroke-width",
|
|
689
724
|
"stroke-dasharray"
|
|
690
|
-
],
|
|
725
|
+
], rt = [
|
|
691
726
|
"d",
|
|
692
727
|
"stroke",
|
|
693
728
|
"stroke-width",
|
|
694
729
|
"stroke-dasharray"
|
|
695
|
-
],
|
|
730
|
+
], it = ["fill", "transform"], at = [
|
|
696
731
|
"x",
|
|
697
732
|
"y",
|
|
698
733
|
"text-anchor",
|
|
@@ -701,7 +736,7 @@ var Xe = {
|
|
|
701
736
|
"fill",
|
|
702
737
|
"stroke",
|
|
703
738
|
"stroke-width"
|
|
704
|
-
],
|
|
739
|
+
], ot = ["x", "dy"], st = ["font-weight", "font-style"], ct = 13, lt = "normal", ut = 700, dt = "var(--color-bg-0, #fff)", ft = 3, pt = 1, mt = 4, ht = 6, gt = 1.2, _t = .35, vt = /* @__PURE__ */ l({
|
|
705
740
|
__name: "ChartAnnotations",
|
|
706
741
|
props: {
|
|
707
742
|
annotations: { default: () => [] },
|
|
@@ -738,35 +773,35 @@ var Xe = {
|
|
|
738
773
|
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
739
774
|
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
740
775
|
if (a && !r.bounds) continue;
|
|
741
|
-
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ??
|
|
776
|
+
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? ct, g = t.fontWeight ?? lt, ee = t.outlineColor ?? dt, _ = t.outlineWidth ?? ft, v = t.lineColor ?? m, y = t.lineWidth ?? pt, te = s(t.lineDash), b = {
|
|
742
777
|
left: "start",
|
|
743
778
|
center: "middle",
|
|
744
779
|
right: "end"
|
|
745
|
-
}[t.align ?? (o > 0 ? "left" : o < 0 ? "right" : "center")], ne = t.text.split("\n").map(c),
|
|
746
|
-
if (a && r.bounds)
|
|
780
|
+
}[t.align ?? (o > 0 ? "left" : o < 0 ? "right" : "center")], ne = t.text.split("\n").map(c), x, S = "", C, w = !a && (t.arrow ?? !0);
|
|
781
|
+
if (a && r.bounds) x = u(i, n.x, n.y, r.bounds);
|
|
747
782
|
else {
|
|
748
783
|
let e = f(n.x, n.y, d, p, h, ne.length, i);
|
|
749
|
-
|
|
784
|
+
S = e.path, w && e.arrow && (C = e.arrow);
|
|
750
785
|
}
|
|
751
786
|
e.push({
|
|
752
787
|
lines: ne,
|
|
753
788
|
textX: d,
|
|
754
789
|
textY: p,
|
|
755
790
|
textAnchor: b,
|
|
756
|
-
dy: h *
|
|
791
|
+
dy: h * gt,
|
|
757
792
|
fontSize: h,
|
|
758
793
|
fontWeight: g,
|
|
759
794
|
color: m,
|
|
760
795
|
outlineColor: ee,
|
|
761
796
|
outlineWidth: _,
|
|
762
|
-
pointerPath:
|
|
797
|
+
pointerPath: S,
|
|
763
798
|
lineColor: v,
|
|
764
799
|
lineWidth: y,
|
|
765
800
|
lineDash: te,
|
|
766
|
-
arrow:
|
|
767
|
-
arrowTip:
|
|
768
|
-
arrowTransform:
|
|
769
|
-
rule:
|
|
801
|
+
arrow: w,
|
|
802
|
+
arrowTip: C,
|
|
803
|
+
arrowTransform: C ? `translate(${C.x} ${C.y}) rotate(${C.angle})` : "",
|
|
804
|
+
rule: x
|
|
770
805
|
});
|
|
771
806
|
}
|
|
772
807
|
return e;
|
|
@@ -819,11 +854,11 @@ var Xe = {
|
|
|
819
854
|
}
|
|
820
855
|
function f(e, t, n, r, i, a, o) {
|
|
821
856
|
if (o === "none") return { path: "" };
|
|
822
|
-
let s = n - e, c = r - t, l = i *
|
|
857
|
+
let s = n - e, c = r - t, l = i * gt, u = (c < 0 ? r + (a - 1) * l : r) - i * _t;
|
|
823
858
|
if (s === 0 || c === 0 || o === "straight") {
|
|
824
859
|
let i = c === 0 ? r : u, a = n - e, o = i - t, s = Math.hypot(a, o);
|
|
825
860
|
if (s <= 10) return { path: "" };
|
|
826
|
-
let l = a / s, d = o / s, f = e + l *
|
|
861
|
+
let l = a / s, d = o / s, f = e + l * mt, p = t + d * mt, m = n - l * ht, h = i - d * ht, g = Math.atan2(-d, -l) * 180 / Math.PI;
|
|
827
862
|
return {
|
|
828
863
|
path: `M${f},${p} L${m},${h}`,
|
|
829
864
|
arrow: {
|
|
@@ -834,8 +869,8 @@ var Xe = {
|
|
|
834
869
|
};
|
|
835
870
|
}
|
|
836
871
|
let d = u - t;
|
|
837
|
-
if (Math.abs(d) <=
|
|
838
|
-
let f = Math.sign(s), p = Math.sign(d), m = e, h = t + p *
|
|
872
|
+
if (Math.abs(d) <= mt || Math.abs(s) <= ht) return { path: "" };
|
|
873
|
+
let f = Math.sign(s), p = Math.sign(d), m = e, h = t + p * mt, g = n - f * ht, ee = u, _ = p > 0 ? -90 : 90;
|
|
839
874
|
return {
|
|
840
875
|
path: `M${m},${h} Q${m},${u} ${g},${ee}`,
|
|
841
876
|
arrow: {
|
|
@@ -845,7 +880,7 @@ var Xe = {
|
|
|
845
880
|
}
|
|
846
881
|
};
|
|
847
882
|
}
|
|
848
|
-
return (t, n) => (_(), a("g",
|
|
883
|
+
return (t, n) => (_(), a("g", Qe, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
849
884
|
t.rule && t.outlineWidth > 0 ? (_(), a("line", d({
|
|
850
885
|
key: 0,
|
|
851
886
|
ref_for: !0
|
|
@@ -854,7 +889,7 @@ var Xe = {
|
|
|
854
889
|
stroke: t.outlineColor,
|
|
855
890
|
"stroke-width": t.lineWidth + t.outlineWidth,
|
|
856
891
|
"stroke-linecap": "round"
|
|
857
|
-
}), null, 16,
|
|
892
|
+
}), null, 16, $e)) : i("", !0),
|
|
858
893
|
t.pointerPath && t.outlineWidth > 0 ? (_(), a("path", {
|
|
859
894
|
key: 1,
|
|
860
895
|
d: t.pointerPath,
|
|
@@ -863,7 +898,7 @@ var Xe = {
|
|
|
863
898
|
stroke: t.outlineColor,
|
|
864
899
|
"stroke-width": t.lineWidth + t.outlineWidth,
|
|
865
900
|
"stroke-linecap": "round"
|
|
866
|
-
}, null, 8,
|
|
901
|
+
}, null, 8, et)) : i("", !0),
|
|
867
902
|
t.arrowTip && t.outlineWidth > 0 ? (_(), a("polygon", {
|
|
868
903
|
key: 2,
|
|
869
904
|
points: "0,0 -6,-3 -6,3",
|
|
@@ -873,7 +908,7 @@ var Xe = {
|
|
|
873
908
|
"stroke-width": t.outlineWidth,
|
|
874
909
|
"stroke-linejoin": "round",
|
|
875
910
|
transform: t.arrowTransform
|
|
876
|
-
}, null, 8,
|
|
911
|
+
}, null, 8, tt)) : i("", !0),
|
|
877
912
|
t.rule ? (_(), a("line", d({
|
|
878
913
|
key: 3,
|
|
879
914
|
ref_for: !0
|
|
@@ -882,7 +917,7 @@ var Xe = {
|
|
|
882
917
|
"stroke-width": t.lineWidth,
|
|
883
918
|
"stroke-dasharray": t.lineDash,
|
|
884
919
|
"stroke-linecap": "round"
|
|
885
|
-
}), null, 16,
|
|
920
|
+
}), null, 16, nt)) : i("", !0),
|
|
886
921
|
t.pointerPath ? (_(), a("path", {
|
|
887
922
|
key: 4,
|
|
888
923
|
d: t.pointerPath,
|
|
@@ -891,13 +926,13 @@ var Xe = {
|
|
|
891
926
|
"stroke-width": t.lineWidth,
|
|
892
927
|
"stroke-dasharray": t.lineDash,
|
|
893
928
|
"stroke-linecap": "round"
|
|
894
|
-
}, null, 8,
|
|
929
|
+
}, null, 8, rt)) : i("", !0),
|
|
895
930
|
t.arrowTip ? (_(), a("polygon", {
|
|
896
931
|
key: 5,
|
|
897
932
|
points: "0,0 -6,-3 -6,3",
|
|
898
933
|
fill: t.lineColor,
|
|
899
934
|
transform: t.arrowTransform
|
|
900
|
-
}, null, 8,
|
|
935
|
+
}, null, 8, it)) : i("", !0),
|
|
901
936
|
o("text", {
|
|
902
937
|
x: t.textX,
|
|
903
938
|
y: t.textY,
|
|
@@ -915,14 +950,14 @@ var Xe = {
|
|
|
915
950
|
dy: r === 0 ? 0 : t.dy
|
|
916
951
|
}, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
|
|
917
952
|
key: t,
|
|
918
|
-
"font-weight": e.bold ?
|
|
953
|
+
"font-weight": e.bold ? ut : void 0,
|
|
919
954
|
"font-style": e.italic ? "italic" : void 0
|
|
920
|
-
}, b(e.text), 9,
|
|
955
|
+
}, b(e.text), 9, st))), 128))], 8, ot))), 128))], 8, at)
|
|
921
956
|
], 64))), 128))]));
|
|
922
957
|
}
|
|
923
|
-
}),
|
|
924
|
-
function
|
|
925
|
-
let { containerRef: t, measuredWidth: r, measuredHeight: i } =
|
|
958
|
+
}), yt = 400, bt = 200;
|
|
959
|
+
function xt(e) {
|
|
960
|
+
let { containerRef: t, measuredWidth: r, measuredHeight: i } = Se({ debounce: e.debounce }), { svgRef: a, items: o, downloadLinkText: s, csvHref: c, downloadButtonText: l, triggerCsvDownload: u, resolvedFilename: d, isFullscreen: f, fullscreenStyle: p, teleportTarget: m, exitFullscreen: h } = X({
|
|
926
961
|
filename: e.filename,
|
|
927
962
|
legacyMenuLabel: e.menu,
|
|
928
963
|
getCsv: e.getCsv,
|
|
@@ -930,12 +965,12 @@ function _t(e) {
|
|
|
930
965
|
downloadButton: e.downloadButton,
|
|
931
966
|
fullscreen: !0,
|
|
932
967
|
fullscreenTarget: e.fullscreenTarget
|
|
933
|
-
}), g = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value ||
|
|
968
|
+
}), g = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value || yt)), ee = n(() => {
|
|
934
969
|
if (f.value && i.value > 0) {
|
|
935
970
|
let t = e.extraBelowHeight?.() ?? 0;
|
|
936
971
|
return i.value - t;
|
|
937
972
|
}
|
|
938
|
-
return e.height() ??
|
|
973
|
+
return e.height() ?? bt;
|
|
939
974
|
}), { padding: _, legendY: v, inlineLegendLayout: y, innerW: te, innerH: b, bounds: ne } = Ae({
|
|
940
975
|
title: e.title,
|
|
941
976
|
titleStyle: e.titleStyle,
|
|
@@ -945,7 +980,7 @@ function _t(e) {
|
|
|
945
980
|
width: () => g.value,
|
|
946
981
|
height: () => ee.value,
|
|
947
982
|
extraPadding: e.chartPadding
|
|
948
|
-
}), { hoverIndex:
|
|
983
|
+
}), { hoverIndex: x, tooltipRef: S, tooltipPos: C, handlers: w } = Ne({
|
|
949
984
|
enabled: e.hasTooltipSlot,
|
|
950
985
|
trigger: e.tooltipTrigger,
|
|
951
986
|
clamp: () => e.tooltipClamp() ?? "chart",
|
|
@@ -965,10 +1000,10 @@ function _t(e) {
|
|
|
965
1000
|
innerW: te,
|
|
966
1001
|
innerH: b,
|
|
967
1002
|
bounds: ne,
|
|
968
|
-
hoverIndex:
|
|
969
|
-
tooltipRef:
|
|
970
|
-
tooltipPos:
|
|
971
|
-
tooltipHandlers:
|
|
1003
|
+
hoverIndex: x,
|
|
1004
|
+
tooltipRef: S,
|
|
1005
|
+
tooltipPos: C,
|
|
1006
|
+
tooltipHandlers: w,
|
|
972
1007
|
menuItems: o,
|
|
973
1008
|
downloadLinkText: s,
|
|
974
1009
|
csvHref: c,
|
|
@@ -981,17 +1016,17 @@ function _t(e) {
|
|
|
981
1016
|
exitFullscreen: h
|
|
982
1017
|
};
|
|
983
1018
|
}
|
|
984
|
-
function
|
|
1019
|
+
function St(e, t) {
|
|
985
1020
|
return (n) => {
|
|
986
1021
|
let r = e();
|
|
987
|
-
if (r !== void 0) return
|
|
1022
|
+
if (r !== void 0) return re(n, r);
|
|
988
1023
|
let i = t();
|
|
989
|
-
return i === void 0 ?
|
|
1024
|
+
return i === void 0 ? B(n) : re(n, i);
|
|
990
1025
|
};
|
|
991
1026
|
}
|
|
992
1027
|
//#endregion
|
|
993
1028
|
//#region src/_shared/contrast.ts
|
|
994
|
-
function
|
|
1029
|
+
function Ct(e) {
|
|
995
1030
|
let t = e.trim();
|
|
996
1031
|
if (t.startsWith("#")) {
|
|
997
1032
|
let e = t.slice(1);
|
|
@@ -1018,201 +1053,201 @@ function yt(e) {
|
|
|
1018
1053
|
}
|
|
1019
1054
|
return null;
|
|
1020
1055
|
}
|
|
1021
|
-
function
|
|
1056
|
+
function wt([e, t, n]) {
|
|
1022
1057
|
let r = (e) => {
|
|
1023
1058
|
let t = e / 255;
|
|
1024
1059
|
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
1025
1060
|
};
|
|
1026
1061
|
return .2126 * r(e) + .7152 * r(t) + .0722 * r(n);
|
|
1027
1062
|
}
|
|
1028
|
-
var
|
|
1029
|
-
function
|
|
1030
|
-
let t =
|
|
1063
|
+
var Tt = null, Et = /* @__PURE__ */ new Map();
|
|
1064
|
+
function Dt(e) {
|
|
1065
|
+
let t = Ct(e);
|
|
1031
1066
|
if (t) return t;
|
|
1032
|
-
if (
|
|
1067
|
+
if (Et.has(e)) return Et.get(e) ?? null;
|
|
1033
1068
|
if (typeof document > "u") return null;
|
|
1034
|
-
|
|
1035
|
-
let n = getComputedStyle(
|
|
1036
|
-
return
|
|
1069
|
+
Tt || (Tt = document.createElement("span"), Tt.style.cssText = "position:absolute;width:0;height:0;visibility:hidden;pointer-events:none", document.body.appendChild(Tt)), Tt.style.color = "", Tt.style.color = e;
|
|
1070
|
+
let n = getComputedStyle(Tt).color, r = Ct(n);
|
|
1071
|
+
return Et.set(e, r), r;
|
|
1037
1072
|
}
|
|
1038
|
-
function
|
|
1039
|
-
let r =
|
|
1040
|
-
return r &&
|
|
1073
|
+
function Ot(e, t = "#ffffff", n = "#1a1a1a") {
|
|
1074
|
+
let r = Dt(e);
|
|
1075
|
+
return r && wt(r) > .179 ? n : t;
|
|
1041
1076
|
}
|
|
1042
1077
|
//#endregion
|
|
1043
1078
|
//#region src/_shared/dateAxis.ts
|
|
1044
|
-
var
|
|
1079
|
+
var kt = /^(\d{4})-(\d{2})-(\d{2})$/, At = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, jt = 1e3, Mt = 60 * jt, Nt = 60 * Mt, Pt = 24 * Nt, Ft = 7 * Pt, It = 30 * Pt, Lt = 365 * Pt, Rt = [
|
|
1045
1080
|
{
|
|
1046
1081
|
unit: "second",
|
|
1047
1082
|
step: 1,
|
|
1048
|
-
ms: 1 *
|
|
1083
|
+
ms: 1 * jt
|
|
1049
1084
|
},
|
|
1050
1085
|
{
|
|
1051
1086
|
unit: "second",
|
|
1052
1087
|
step: 5,
|
|
1053
|
-
ms: 5 *
|
|
1088
|
+
ms: 5 * jt
|
|
1054
1089
|
},
|
|
1055
1090
|
{
|
|
1056
1091
|
unit: "second",
|
|
1057
1092
|
step: 15,
|
|
1058
|
-
ms: 15 *
|
|
1093
|
+
ms: 15 * jt
|
|
1059
1094
|
},
|
|
1060
1095
|
{
|
|
1061
1096
|
unit: "second",
|
|
1062
1097
|
step: 30,
|
|
1063
|
-
ms: 30 *
|
|
1098
|
+
ms: 30 * jt
|
|
1064
1099
|
},
|
|
1065
1100
|
{
|
|
1066
1101
|
unit: "minute",
|
|
1067
1102
|
step: 1,
|
|
1068
|
-
ms: 1 *
|
|
1103
|
+
ms: 1 * Mt
|
|
1069
1104
|
},
|
|
1070
1105
|
{
|
|
1071
1106
|
unit: "minute",
|
|
1072
1107
|
step: 5,
|
|
1073
|
-
ms: 5 *
|
|
1108
|
+
ms: 5 * Mt
|
|
1074
1109
|
},
|
|
1075
1110
|
{
|
|
1076
1111
|
unit: "minute",
|
|
1077
1112
|
step: 15,
|
|
1078
|
-
ms: 15 *
|
|
1113
|
+
ms: 15 * Mt
|
|
1079
1114
|
},
|
|
1080
1115
|
{
|
|
1081
1116
|
unit: "minute",
|
|
1082
1117
|
step: 30,
|
|
1083
|
-
ms: 30 *
|
|
1118
|
+
ms: 30 * Mt
|
|
1084
1119
|
},
|
|
1085
1120
|
{
|
|
1086
1121
|
unit: "hour",
|
|
1087
1122
|
step: 1,
|
|
1088
|
-
ms: 1 *
|
|
1123
|
+
ms: 1 * Nt
|
|
1089
1124
|
},
|
|
1090
1125
|
{
|
|
1091
1126
|
unit: "hour",
|
|
1092
1127
|
step: 3,
|
|
1093
|
-
ms: 3 *
|
|
1128
|
+
ms: 3 * Nt
|
|
1094
1129
|
},
|
|
1095
1130
|
{
|
|
1096
1131
|
unit: "hour",
|
|
1097
1132
|
step: 6,
|
|
1098
|
-
ms: 6 *
|
|
1133
|
+
ms: 6 * Nt
|
|
1099
1134
|
},
|
|
1100
1135
|
{
|
|
1101
1136
|
unit: "hour",
|
|
1102
1137
|
step: 12,
|
|
1103
|
-
ms: 12 *
|
|
1138
|
+
ms: 12 * Nt
|
|
1104
1139
|
},
|
|
1105
1140
|
{
|
|
1106
1141
|
unit: "day",
|
|
1107
1142
|
step: 1,
|
|
1108
|
-
ms: 1 *
|
|
1143
|
+
ms: 1 * Pt
|
|
1109
1144
|
},
|
|
1110
1145
|
{
|
|
1111
1146
|
unit: "day",
|
|
1112
1147
|
step: 2,
|
|
1113
|
-
ms: 2 *
|
|
1148
|
+
ms: 2 * Pt
|
|
1114
1149
|
},
|
|
1115
1150
|
{
|
|
1116
1151
|
unit: "week",
|
|
1117
1152
|
step: 1,
|
|
1118
|
-
ms: 1 *
|
|
1153
|
+
ms: 1 * Ft
|
|
1119
1154
|
},
|
|
1120
1155
|
{
|
|
1121
1156
|
unit: "month",
|
|
1122
1157
|
step: 1,
|
|
1123
|
-
ms: 1 *
|
|
1158
|
+
ms: 1 * It
|
|
1124
1159
|
},
|
|
1125
1160
|
{
|
|
1126
1161
|
unit: "month",
|
|
1127
1162
|
step: 3,
|
|
1128
|
-
ms: 3 *
|
|
1163
|
+
ms: 3 * It
|
|
1129
1164
|
},
|
|
1130
1165
|
{
|
|
1131
1166
|
unit: "month",
|
|
1132
1167
|
step: 6,
|
|
1133
|
-
ms: 6 *
|
|
1168
|
+
ms: 6 * It
|
|
1134
1169
|
},
|
|
1135
1170
|
{
|
|
1136
1171
|
unit: "year",
|
|
1137
1172
|
step: 1,
|
|
1138
|
-
ms: 1 *
|
|
1173
|
+
ms: 1 * Lt
|
|
1139
1174
|
},
|
|
1140
1175
|
{
|
|
1141
1176
|
unit: "year",
|
|
1142
1177
|
step: 2,
|
|
1143
|
-
ms: 2 *
|
|
1178
|
+
ms: 2 * Lt
|
|
1144
1179
|
},
|
|
1145
1180
|
{
|
|
1146
1181
|
unit: "year",
|
|
1147
1182
|
step: 5,
|
|
1148
|
-
ms: 5 *
|
|
1183
|
+
ms: 5 * Lt
|
|
1149
1184
|
},
|
|
1150
1185
|
{
|
|
1151
1186
|
unit: "year",
|
|
1152
1187
|
step: 10,
|
|
1153
|
-
ms: 10 *
|
|
1188
|
+
ms: 10 * Lt
|
|
1154
1189
|
},
|
|
1155
1190
|
{
|
|
1156
1191
|
unit: "year",
|
|
1157
1192
|
step: 25,
|
|
1158
|
-
ms: 25 *
|
|
1193
|
+
ms: 25 * Lt
|
|
1159
1194
|
},
|
|
1160
1195
|
{
|
|
1161
1196
|
unit: "year",
|
|
1162
1197
|
step: 50,
|
|
1163
|
-
ms: 50 *
|
|
1198
|
+
ms: 50 * Lt
|
|
1164
1199
|
},
|
|
1165
1200
|
{
|
|
1166
1201
|
unit: "year",
|
|
1167
1202
|
step: 100,
|
|
1168
|
-
ms: 100 *
|
|
1203
|
+
ms: 100 * Lt
|
|
1169
1204
|
}
|
|
1170
|
-
],
|
|
1171
|
-
function
|
|
1205
|
+
], zt = 1e3;
|
|
1206
|
+
function Bt(e, t) {
|
|
1172
1207
|
if (e instanceof Date) {
|
|
1173
1208
|
let t = e.getTime();
|
|
1174
1209
|
return Number.isFinite(t) ? t : null;
|
|
1175
1210
|
}
|
|
1176
1211
|
if (typeof e != "string") return null;
|
|
1177
|
-
let n =
|
|
1212
|
+
let n = kt.exec(e);
|
|
1178
1213
|
if (n) {
|
|
1179
1214
|
let e = +n[1], r = n[2] - 1, i = +n[3];
|
|
1180
1215
|
return t === "utc" ? Date.UTC(e, r, i) : new Date(e, r, i).getTime();
|
|
1181
1216
|
}
|
|
1182
|
-
let r =
|
|
1217
|
+
let r = At.exec(e);
|
|
1183
1218
|
if (r) {
|
|
1184
1219
|
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];
|
|
1185
1220
|
if (l) {
|
|
1186
1221
|
if (l === "Z" || l === "z") return Date.UTC(e, n, i, a, o, s, c);
|
|
1187
|
-
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) *
|
|
1222
|
+
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * Mt;
|
|
1188
1223
|
return Date.UTC(e, n, i, a, o, s, c) - d;
|
|
1189
1224
|
}
|
|
1190
1225
|
return t === "utc" ? Date.UTC(e, n, i, a, o, s, c) : new Date(e, n, i, a, o, s, c).getTime();
|
|
1191
1226
|
}
|
|
1192
1227
|
return null;
|
|
1193
1228
|
}
|
|
1194
|
-
function
|
|
1195
|
-
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ?
|
|
1229
|
+
function Vt(e) {
|
|
1230
|
+
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? kt.test(e) || At.test(e) : !1;
|
|
1196
1231
|
}
|
|
1197
|
-
function
|
|
1232
|
+
function Ht(e, t) {
|
|
1198
1233
|
if (e.length === 0) return !1;
|
|
1199
1234
|
for (let n = 0; n < e.length; n++) {
|
|
1200
1235
|
let r = e[n];
|
|
1201
|
-
if (!
|
|
1236
|
+
if (!Vt(r) || Bt(r, t) === null) return !1;
|
|
1202
1237
|
}
|
|
1203
1238
|
return !0;
|
|
1204
1239
|
}
|
|
1205
|
-
function
|
|
1240
|
+
function Ut(e, t) {
|
|
1206
1241
|
let n = e / Math.max(1, t);
|
|
1207
|
-
for (let e of
|
|
1208
|
-
return
|
|
1242
|
+
for (let e of Rt) if (n <= e.ms) return e;
|
|
1243
|
+
return Rt[Rt.length - 1];
|
|
1209
1244
|
}
|
|
1210
|
-
function
|
|
1245
|
+
function Wt(e, t, n) {
|
|
1211
1246
|
let r = new Date(e);
|
|
1212
1247
|
if (n === "utc") switch (t) {
|
|
1213
|
-
case "second": return Math.floor(e /
|
|
1214
|
-
case "minute": return Math.floor(e /
|
|
1215
|
-
case "hour": return Math.floor(e /
|
|
1248
|
+
case "second": return Math.floor(e / jt) * jt;
|
|
1249
|
+
case "minute": return Math.floor(e / Mt) * Mt;
|
|
1250
|
+
case "hour": return Math.floor(e / Nt) * Nt;
|
|
1216
1251
|
case "day": return Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate());
|
|
1217
1252
|
case "week": {
|
|
1218
1253
|
let e = (r.getUTCDay() + 6) % 7;
|
|
@@ -1222,8 +1257,8 @@ function zt(e, t, n) {
|
|
|
1222
1257
|
case "year": return Date.UTC(r.getUTCFullYear(), 0, 1);
|
|
1223
1258
|
}
|
|
1224
1259
|
switch (t) {
|
|
1225
|
-
case "second": return Math.floor(e /
|
|
1226
|
-
case "minute": return Math.floor(e /
|
|
1260
|
+
case "second": return Math.floor(e / jt) * jt;
|
|
1261
|
+
case "minute": return Math.floor(e / Mt) * Mt;
|
|
1227
1262
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
|
|
1228
1263
|
case "day": return new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime();
|
|
1229
1264
|
case "week": {
|
|
@@ -1234,11 +1269,11 @@ function zt(e, t, n) {
|
|
|
1234
1269
|
case "year": return new Date(r.getFullYear(), 0, 1).getTime();
|
|
1235
1270
|
}
|
|
1236
1271
|
}
|
|
1237
|
-
function
|
|
1238
|
-
if (t === "second") return e + n *
|
|
1239
|
-
if (t === "minute") return e + n *
|
|
1240
|
-
if (t === "hour" && r === "utc") return e + n *
|
|
1241
|
-
if (t === "week" && r === "utc") return e + n *
|
|
1272
|
+
function Gt(e, t, n, r) {
|
|
1273
|
+
if (t === "second") return e + n * jt;
|
|
1274
|
+
if (t === "minute") return e + n * Mt;
|
|
1275
|
+
if (t === "hour" && r === "utc") return e + n * Nt;
|
|
1276
|
+
if (t === "week" && r === "utc") return e + n * Ft;
|
|
1242
1277
|
let i = new Date(e);
|
|
1243
1278
|
if (r === "utc") switch (t) {
|
|
1244
1279
|
case "day": return Date.UTC(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate() + n, i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds());
|
|
@@ -1254,21 +1289,21 @@ function Bt(e, t, n, r) {
|
|
|
1254
1289
|
}
|
|
1255
1290
|
return e;
|
|
1256
1291
|
}
|
|
1257
|
-
function
|
|
1292
|
+
function Kt(e, t, n, r) {
|
|
1258
1293
|
if (!Number.isFinite(e) || !Number.isFinite(t) || e >= t || n < 1) return {
|
|
1259
1294
|
values: [],
|
|
1260
1295
|
unit: "day"
|
|
1261
1296
|
};
|
|
1262
|
-
let { unit: i, step: a } =
|
|
1263
|
-
for (; o < e && s <
|
|
1297
|
+
let { unit: i, step: a } = Ut(t - e, n), o = Wt(e, i, r), s = 0;
|
|
1298
|
+
for (; o < e && s < zt;) o = Gt(o, i, a, r), s++;
|
|
1264
1299
|
let c = [];
|
|
1265
|
-
for (let e = 0; e <
|
|
1300
|
+
for (let e = 0; e < zt && o <= t; e++) c.push(o), o = Gt(o, i, a, r);
|
|
1266
1301
|
return {
|
|
1267
1302
|
values: c,
|
|
1268
1303
|
unit: i
|
|
1269
1304
|
};
|
|
1270
1305
|
}
|
|
1271
|
-
var
|
|
1306
|
+
var qt = {
|
|
1272
1307
|
iso: {
|
|
1273
1308
|
year: "numeric",
|
|
1274
1309
|
month: "2-digit",
|
|
@@ -1306,7 +1341,7 @@ var Ht = {
|
|
|
1306
1341
|
hourCycle: "h23"
|
|
1307
1342
|
},
|
|
1308
1343
|
medium: { dateStyle: "medium" }
|
|
1309
|
-
},
|
|
1344
|
+
}, Jt = {
|
|
1310
1345
|
year: "year",
|
|
1311
1346
|
month: "month-year",
|
|
1312
1347
|
week: "month-day",
|
|
@@ -1318,27 +1353,27 @@ var Ht = {
|
|
|
1318
1353
|
function Q(e) {
|
|
1319
1354
|
return e < 10 ? "0" + e : String(e);
|
|
1320
1355
|
}
|
|
1321
|
-
function
|
|
1356
|
+
function Yt(e, t) {
|
|
1322
1357
|
let n = new Date(e);
|
|
1323
1358
|
return t === "utc" ? `${n.getUTCFullYear()}-${Q(n.getUTCMonth() + 1)}-${Q(n.getUTCDate())}` : `${n.getFullYear()}-${Q(n.getMonth() + 1)}-${Q(n.getDate())}`;
|
|
1324
1359
|
}
|
|
1325
|
-
function
|
|
1360
|
+
function Xt(e, t) {
|
|
1326
1361
|
let n = new Date(e);
|
|
1327
1362
|
return t === "utc" ? `${n.getUTCFullYear()}-${Q(n.getUTCMonth() + 1)}-${Q(n.getUTCDate())}T${Q(n.getUTCHours())}:${Q(n.getUTCMinutes())}:${Q(n.getUTCSeconds())}Z` : `${n.getFullYear()}-${Q(n.getMonth() + 1)}-${Q(n.getDate())}T${Q(n.getHours())}:${Q(n.getMinutes())}:${Q(n.getSeconds())}`;
|
|
1328
1363
|
}
|
|
1329
|
-
function
|
|
1330
|
-
return e in
|
|
1364
|
+
function Zt(e) {
|
|
1365
|
+
return e in qt;
|
|
1331
1366
|
}
|
|
1332
|
-
function
|
|
1367
|
+
function Qt(e, t, n, r) {
|
|
1333
1368
|
if (typeof t == "function") return t(e, r);
|
|
1334
1369
|
let i = null, a;
|
|
1335
|
-
if (t === void 0) i = r ?
|
|
1370
|
+
if (t === void 0) i = r ? Jt[r] : "iso", a = qt[i];
|
|
1336
1371
|
else if (typeof t == "string") {
|
|
1337
|
-
if (!
|
|
1338
|
-
i = t, a =
|
|
1372
|
+
if (!Zt(t)) throw Error(`Unknown date format preset: "${t}"`);
|
|
1373
|
+
i = t, a = qt[i];
|
|
1339
1374
|
} else a = t;
|
|
1340
|
-
if (i === "iso") return
|
|
1341
|
-
if (i === "iso-datetime") return
|
|
1375
|
+
if (i === "iso") return Yt(e, n);
|
|
1376
|
+
if (i === "iso-datetime") return Xt(e, n);
|
|
1342
1377
|
let o = n === "utc" ? {
|
|
1343
1378
|
...a,
|
|
1344
1379
|
timeZone: "UTC"
|
|
@@ -1347,73 +1382,73 @@ function qt(e, t, n, r) {
|
|
|
1347
1382
|
}
|
|
1348
1383
|
//#endregion
|
|
1349
1384
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
1350
|
-
var
|
|
1385
|
+
var $t = {
|
|
1351
1386
|
class: "chart-sr-only",
|
|
1352
1387
|
"aria-live": "polite"
|
|
1353
|
-
},
|
|
1388
|
+
}, en = [
|
|
1354
1389
|
"width",
|
|
1355
1390
|
"height",
|
|
1356
1391
|
"role",
|
|
1357
1392
|
"aria-label"
|
|
1358
|
-
],
|
|
1393
|
+
], tn = [
|
|
1359
1394
|
"x",
|
|
1360
1395
|
"y",
|
|
1361
1396
|
"text-anchor",
|
|
1362
1397
|
"font-size",
|
|
1363
1398
|
"font-weight",
|
|
1364
1399
|
"fill"
|
|
1365
|
-
],
|
|
1400
|
+
], nn = ["x", "dy"], rn = { key: 1 }, an = [
|
|
1366
1401
|
"x1",
|
|
1367
1402
|
"y1",
|
|
1368
1403
|
"x2",
|
|
1369
1404
|
"y2",
|
|
1370
1405
|
"stroke",
|
|
1371
1406
|
"stroke-dasharray"
|
|
1372
|
-
],
|
|
1407
|
+
], on = [
|
|
1373
1408
|
"cx",
|
|
1374
1409
|
"cy",
|
|
1375
1410
|
"fill",
|
|
1376
1411
|
"fill-opacity",
|
|
1377
1412
|
"stroke"
|
|
1378
|
-
],
|
|
1413
|
+
], sn = [
|
|
1379
1414
|
"x",
|
|
1380
1415
|
"y",
|
|
1381
1416
|
"font-size",
|
|
1382
1417
|
"fill",
|
|
1383
1418
|
"font-weight"
|
|
1384
|
-
],
|
|
1419
|
+
], cn = [
|
|
1385
1420
|
"x1",
|
|
1386
1421
|
"y1",
|
|
1387
1422
|
"x2",
|
|
1388
1423
|
"y2"
|
|
1389
|
-
],
|
|
1424
|
+
], ln = [
|
|
1390
1425
|
"x1",
|
|
1391
1426
|
"y1",
|
|
1392
1427
|
"x2",
|
|
1393
1428
|
"y2"
|
|
1394
|
-
],
|
|
1429
|
+
], un = [
|
|
1395
1430
|
"x1",
|
|
1396
1431
|
"y1",
|
|
1397
1432
|
"x2",
|
|
1398
1433
|
"y2"
|
|
1399
|
-
],
|
|
1434
|
+
], dn = [
|
|
1400
1435
|
"x1",
|
|
1401
1436
|
"y1",
|
|
1402
1437
|
"x2",
|
|
1403
1438
|
"y2"
|
|
1404
|
-
],
|
|
1439
|
+
], fn = [
|
|
1405
1440
|
"x",
|
|
1406
1441
|
"y",
|
|
1407
1442
|
"font-size",
|
|
1408
1443
|
"fill",
|
|
1409
1444
|
"font-weight",
|
|
1410
1445
|
"fill-opacity"
|
|
1411
|
-
],
|
|
1446
|
+
], pn = [
|
|
1412
1447
|
"transform",
|
|
1413
1448
|
"font-size",
|
|
1414
1449
|
"fill",
|
|
1415
1450
|
"font-weight"
|
|
1416
|
-
],
|
|
1451
|
+
], mn = [
|
|
1417
1452
|
"x",
|
|
1418
1453
|
"y",
|
|
1419
1454
|
"text-anchor",
|
|
@@ -1421,43 +1456,43 @@ var Jt = {
|
|
|
1421
1456
|
"fill",
|
|
1422
1457
|
"font-weight",
|
|
1423
1458
|
"fill-opacity"
|
|
1424
|
-
],
|
|
1459
|
+
], hn = [
|
|
1425
1460
|
"x",
|
|
1426
1461
|
"y",
|
|
1427
1462
|
"font-size",
|
|
1428
1463
|
"fill",
|
|
1429
1464
|
"font-weight"
|
|
1430
|
-
],
|
|
1465
|
+
], $ = [
|
|
1431
1466
|
"d",
|
|
1432
1467
|
"fill",
|
|
1433
1468
|
"fill-opacity"
|
|
1434
|
-
],
|
|
1469
|
+
], gn = [
|
|
1435
1470
|
"d",
|
|
1436
1471
|
"stroke",
|
|
1437
1472
|
"stroke-width"
|
|
1438
|
-
],
|
|
1473
|
+
], _n = [
|
|
1439
1474
|
"d",
|
|
1440
1475
|
"stroke",
|
|
1441
1476
|
"stroke-width",
|
|
1442
1477
|
"stroke-opacity",
|
|
1443
1478
|
"stroke-dasharray"
|
|
1444
|
-
],
|
|
1479
|
+
], vn = [
|
|
1445
1480
|
"cx",
|
|
1446
1481
|
"cy",
|
|
1447
1482
|
"r",
|
|
1448
1483
|
"fill",
|
|
1449
1484
|
"fill-opacity",
|
|
1450
1485
|
"stroke"
|
|
1451
|
-
],
|
|
1486
|
+
], yn = [
|
|
1452
1487
|
"d",
|
|
1453
1488
|
"fill",
|
|
1454
1489
|
"fill-opacity"
|
|
1455
|
-
],
|
|
1490
|
+
], bn = [
|
|
1456
1491
|
"d",
|
|
1457
1492
|
"stroke",
|
|
1458
1493
|
"stroke-width",
|
|
1459
1494
|
"stroke-dasharray"
|
|
1460
|
-
],
|
|
1495
|
+
], xn = [
|
|
1461
1496
|
"x1",
|
|
1462
1497
|
"y1",
|
|
1463
1498
|
"x2",
|
|
@@ -1465,7 +1500,7 @@ var Jt = {
|
|
|
1465
1500
|
"stroke",
|
|
1466
1501
|
"stroke-width",
|
|
1467
1502
|
"stroke-dasharray"
|
|
1468
|
-
],
|
|
1503
|
+
], Sn = [
|
|
1469
1504
|
"x1",
|
|
1470
1505
|
"y1",
|
|
1471
1506
|
"x2",
|
|
@@ -1473,53 +1508,53 @@ var Jt = {
|
|
|
1473
1508
|
"stroke",
|
|
1474
1509
|
"stroke-width",
|
|
1475
1510
|
"stroke-dasharray"
|
|
1476
|
-
],
|
|
1511
|
+
], Cn = [
|
|
1477
1512
|
"x1",
|
|
1478
1513
|
"y1",
|
|
1479
1514
|
"x2",
|
|
1480
1515
|
"y2"
|
|
1481
|
-
],
|
|
1516
|
+
], wn = [
|
|
1482
1517
|
"x1",
|
|
1483
1518
|
"y1",
|
|
1484
1519
|
"x2",
|
|
1485
1520
|
"y2"
|
|
1486
|
-
],
|
|
1521
|
+
], Tn = [
|
|
1487
1522
|
"x1",
|
|
1488
1523
|
"y1",
|
|
1489
1524
|
"x2",
|
|
1490
1525
|
"y2"
|
|
1491
|
-
],
|
|
1526
|
+
], En = [
|
|
1492
1527
|
"cx",
|
|
1493
1528
|
"cy",
|
|
1494
1529
|
"fill"
|
|
1495
|
-
],
|
|
1530
|
+
], Dn = [
|
|
1496
1531
|
"x",
|
|
1497
1532
|
"y",
|
|
1498
1533
|
"width",
|
|
1499
1534
|
"height"
|
|
1500
|
-
],
|
|
1535
|
+
], On = [
|
|
1501
1536
|
"cx",
|
|
1502
1537
|
"cy",
|
|
1503
1538
|
"fill",
|
|
1504
1539
|
"fill-opacity",
|
|
1505
1540
|
"stroke"
|
|
1506
|
-
],
|
|
1541
|
+
], kn = [
|
|
1507
1542
|
"x",
|
|
1508
1543
|
"y",
|
|
1509
1544
|
"font-size",
|
|
1510
1545
|
"font-weight",
|
|
1511
1546
|
"fill"
|
|
1512
|
-
],
|
|
1547
|
+
], An = [
|
|
1513
1548
|
"x",
|
|
1514
1549
|
"y",
|
|
1515
1550
|
"font-size",
|
|
1516
1551
|
"font-weight",
|
|
1517
1552
|
"fill",
|
|
1518
1553
|
"fill-opacity"
|
|
1519
|
-
],
|
|
1554
|
+
], jn = { class: "line-chart-tooltip" }, Mn = {
|
|
1520
1555
|
key: 0,
|
|
1521
1556
|
class: "line-chart-tooltip-label"
|
|
1522
|
-
},
|
|
1557
|
+
}, Nn = ["href", "download"], Pn = 36, Fn = 12, In = 7, Ln = 16, Rn = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
1523
1558
|
inheritAttrs: !1,
|
|
1524
1559
|
__name: "LineChart",
|
|
1525
1560
|
props: {
|
|
@@ -1572,21 +1607,21 @@ var Jt = {
|
|
|
1572
1607
|
emits: ["hover"],
|
|
1573
1608
|
setup(c, { emit: l }) {
|
|
1574
1609
|
let f = c, p = n(() => f.ariaLabel ?? f.title), g = n(() => f.role ?? (p.value ? "img" : void 0)), ee = l, v = [];
|
|
1575
|
-
function*
|
|
1610
|
+
function* x(e) {
|
|
1576
1611
|
if (e.x && e.x.length > 0 && (yield e.x), e.series) for (let t of e.series) t.x && t.x.length > 0 && (yield t.x);
|
|
1577
1612
|
if (e.areas) for (let t of e.areas) t.x && t.x.length > 0 && (yield t.x);
|
|
1578
1613
|
}
|
|
1579
|
-
function
|
|
1614
|
+
function C(e, t, n) {
|
|
1580
1615
|
if (!e) return;
|
|
1581
1616
|
if (!t) return e;
|
|
1582
1617
|
let r = new Float64Array(e.length);
|
|
1583
|
-
for (let t = 0; t < e.length; t++) r[t] =
|
|
1618
|
+
for (let t = 0; t < e.length; t++) r[t] = Bt(e[t], n) ?? NaN;
|
|
1584
1619
|
return r;
|
|
1585
1620
|
}
|
|
1586
|
-
let
|
|
1587
|
-
let e =
|
|
1588
|
-
for (let r of
|
|
1589
|
-
if (n = !0, !
|
|
1621
|
+
let w = St(() => f.tooltipValueFormat, () => f.yTickFormat), T = n(() => f.timezone ?? "utc"), E = n(() => {
|
|
1622
|
+
let e = T.value, t = !1, n = !1;
|
|
1623
|
+
for (let r of x(f)) {
|
|
1624
|
+
if (n = !0, !Ht(r, e)) {
|
|
1590
1625
|
t = !1;
|
|
1591
1626
|
break;
|
|
1592
1627
|
}
|
|
@@ -1596,44 +1631,44 @@ var Jt = {
|
|
|
1596
1631
|
let r = f.series && f.series.length > 0 ? f.series.map((n) => ({
|
|
1597
1632
|
...n,
|
|
1598
1633
|
data: n.y ?? n.data ?? v,
|
|
1599
|
-
x:
|
|
1634
|
+
x: C(n.x, t, e)
|
|
1600
1635
|
})) : (() => {
|
|
1601
1636
|
let n = f.y ?? f.data;
|
|
1602
1637
|
return n ? [{
|
|
1603
1638
|
data: n,
|
|
1604
|
-
x:
|
|
1639
|
+
x: C(f.x, t, e)
|
|
1605
1640
|
}] : [];
|
|
1606
1641
|
})(), i = (f.areas ?? []).map((n) => ({
|
|
1607
1642
|
...n,
|
|
1608
|
-
x:
|
|
1643
|
+
x: C(n.x, t, e)
|
|
1609
1644
|
}));
|
|
1610
1645
|
return {
|
|
1611
1646
|
isDate: t,
|
|
1612
1647
|
series: r,
|
|
1613
1648
|
areas: i
|
|
1614
1649
|
};
|
|
1615
|
-
}),
|
|
1650
|
+
}), D = n(() => E.value.isDate), O = n(() => E.value.series), ie = n(() => E.value.areas), k = n(() => {
|
|
1616
1651
|
let e = 0;
|
|
1617
|
-
for (let t of
|
|
1618
|
-
for (let t of
|
|
1652
|
+
for (let t of O.value) t.data.length > e && (e = t.data.length);
|
|
1653
|
+
for (let t of ie.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
|
|
1619
1654
|
return e;
|
|
1620
|
-
}),
|
|
1621
|
-
function
|
|
1655
|
+
}), A = n(() => O.value.some((e) => e.x != null) || ie.value.some((e) => e.x != null));
|
|
1656
|
+
function j(e, t) {
|
|
1622
1657
|
return e.x ? Number(e.x[t]) : t;
|
|
1623
1658
|
}
|
|
1624
|
-
function
|
|
1659
|
+
function ae(e, t) {
|
|
1625
1660
|
return e.x ? Number(e.x[t]) : t;
|
|
1626
1661
|
}
|
|
1627
|
-
let
|
|
1662
|
+
let M = n(() => A.value ? 0 : f.xMin ?? 0), oe = n(() => {
|
|
1628
1663
|
let e = Infinity, t = -Infinity;
|
|
1629
|
-
for (let n of
|
|
1630
|
-
let i =
|
|
1664
|
+
for (let n of O.value) for (let r = 0; r < n.data.length; r++) {
|
|
1665
|
+
let i = j(n, r);
|
|
1631
1666
|
isFinite(i) && (i < e && (e = i), i > t && (t = i));
|
|
1632
1667
|
}
|
|
1633
|
-
for (let n of
|
|
1668
|
+
for (let n of ie.value) {
|
|
1634
1669
|
let r = Math.max(n.upper.length, n.lower.length);
|
|
1635
1670
|
for (let i = 0; i < r; i++) {
|
|
1636
|
-
let r =
|
|
1671
|
+
let r = ae(n, i);
|
|
1637
1672
|
isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
1638
1673
|
}
|
|
1639
1674
|
}
|
|
@@ -1645,16 +1680,16 @@ var Jt = {
|
|
|
1645
1680
|
max: 0
|
|
1646
1681
|
};
|
|
1647
1682
|
});
|
|
1648
|
-
function
|
|
1649
|
-
let { min: t, max: n } =
|
|
1650
|
-
return
|
|
1683
|
+
function N(e) {
|
|
1684
|
+
let { min: t, max: n } = oe.value, r = n - t || 1;
|
|
1685
|
+
return W.value.left + (e - t) / r * K.value;
|
|
1651
1686
|
}
|
|
1652
|
-
let
|
|
1687
|
+
let se = n(() => {
|
|
1653
1688
|
let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
|
|
1654
1689
|
isFinite(r) && (r < e && (e = r), r > t && (t = r), r > 0 && r < n && (n = r));
|
|
1655
1690
|
};
|
|
1656
|
-
for (let e of
|
|
1657
|
-
for (let e of
|
|
1691
|
+
for (let e of O.value) for (let t of e.data) r(t);
|
|
1692
|
+
for (let e of ie.value) {
|
|
1658
1693
|
for (let t of e.upper) r(t);
|
|
1659
1694
|
for (let t of e.lower) r(t);
|
|
1660
1695
|
}
|
|
@@ -1664,90 +1699,90 @@ var Jt = {
|
|
|
1664
1699
|
range: 1
|
|
1665
1700
|
};
|
|
1666
1701
|
f.yMin != null && f.yMin < e && (e = f.yMin);
|
|
1667
|
-
let i =
|
|
1702
|
+
let i = be(e, t, f.yScaleType, n);
|
|
1668
1703
|
return {
|
|
1669
1704
|
min: i.min,
|
|
1670
1705
|
max: i.max,
|
|
1671
1706
|
range: i.max - i.min || 1
|
|
1672
1707
|
};
|
|
1673
1708
|
});
|
|
1674
|
-
function
|
|
1675
|
-
let { min: t, max: n } =
|
|
1676
|
-
return
|
|
1709
|
+
function P(e) {
|
|
1710
|
+
let { min: t, max: n } = se.value;
|
|
1711
|
+
return W.value.top + q.value - ye(e, t, n, f.yScaleType) * q.value;
|
|
1677
1712
|
}
|
|
1678
|
-
function
|
|
1713
|
+
function ce(e) {
|
|
1679
1714
|
let t = e.data;
|
|
1680
1715
|
if (t.length === 0) return "";
|
|
1681
1716
|
let n = "", r = !1;
|
|
1682
1717
|
for (let i = 0; i < t.length; i++) {
|
|
1683
|
-
let a =
|
|
1718
|
+
let a = j(e, i);
|
|
1684
1719
|
if (!isFinite(t[i]) || !isFinite(a)) {
|
|
1685
1720
|
r = !1;
|
|
1686
1721
|
continue;
|
|
1687
1722
|
}
|
|
1688
|
-
let o =
|
|
1723
|
+
let o = N(a), s = P(t[i]);
|
|
1689
1724
|
n += r ? `L${o},${s}` : `M${o},${s}`, r = !0;
|
|
1690
1725
|
}
|
|
1691
1726
|
return n;
|
|
1692
1727
|
}
|
|
1693
|
-
function
|
|
1728
|
+
function le(e) {
|
|
1694
1729
|
let t = e.data, n = [];
|
|
1695
1730
|
for (let r = 0; r < t.length; r++) {
|
|
1696
|
-
let i =
|
|
1731
|
+
let i = j(e, r);
|
|
1697
1732
|
!isFinite(t[r]) || !isFinite(i) || n.push({
|
|
1698
|
-
x:
|
|
1699
|
-
y:
|
|
1733
|
+
x: N(i),
|
|
1734
|
+
y: P(t[r])
|
|
1700
1735
|
});
|
|
1701
1736
|
}
|
|
1702
1737
|
return n;
|
|
1703
1738
|
}
|
|
1704
|
-
function
|
|
1739
|
+
function ue(e) {
|
|
1705
1740
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
1706
1741
|
if (t === 0) return "";
|
|
1707
1742
|
let n = [], r = [];
|
|
1708
|
-
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(
|
|
1743
|
+
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(ae(e, i)) ? r.push(i) : r.length && (n.push(r), r = []);
|
|
1709
1744
|
r.length && n.push(r);
|
|
1710
1745
|
let i = "";
|
|
1711
1746
|
for (let t of n) {
|
|
1712
|
-
i += `M${
|
|
1713
|
-
for (let n = 1; n < t.length; n++) i += `L${
|
|
1714
|
-
for (let n = t.length - 1; n >= 0; n--) i += `L${
|
|
1747
|
+
i += `M${N(ae(e, t[0]))},${P(e.upper[t[0]])}`;
|
|
1748
|
+
for (let n = 1; n < t.length; n++) i += `L${N(ae(e, t[n]))},${P(e.upper[t[n]])}`;
|
|
1749
|
+
for (let n = t.length - 1; n >= 0; n--) i += `L${N(ae(e, t[n]))},${P(e.lower[t[n]])}`;
|
|
1715
1750
|
i += "Z";
|
|
1716
1751
|
}
|
|
1717
1752
|
return i;
|
|
1718
1753
|
}
|
|
1719
|
-
function
|
|
1720
|
-
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null &&
|
|
1721
|
-
return
|
|
1754
|
+
function F(e, t) {
|
|
1755
|
+
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && O.value[e.seriesIndex] || O.value[0];
|
|
1756
|
+
return N(r ? j(r, n) : n);
|
|
1722
1757
|
}
|
|
1723
|
-
function
|
|
1724
|
-
let n =
|
|
1758
|
+
function de(e, t = !0) {
|
|
1759
|
+
let n = W.value.top + q.value;
|
|
1725
1760
|
if (e.seriesIndex == null) {
|
|
1726
|
-
let t =
|
|
1727
|
-
return t > r ? "" : `M${t},${
|
|
1761
|
+
let t = F(e, "start"), r = F(e, "end");
|
|
1762
|
+
return t > r ? "" : `M${t},${W.value.top}L${r},${W.value.top}L${r},${n}L${t},${n}Z`;
|
|
1728
1763
|
}
|
|
1729
|
-
let r =
|
|
1764
|
+
let r = O.value[e.seriesIndex];
|
|
1730
1765
|
if (!r) return "";
|
|
1731
1766
|
let i = Math.max(0, e.startIndex), a = Math.min(r.data.length - 1, e.endIndex);
|
|
1732
1767
|
if (i > a) return "";
|
|
1733
|
-
let o = `M${
|
|
1734
|
-
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${
|
|
1735
|
-
return t && (o += `L${
|
|
1768
|
+
let o = `M${N(j(r, i))},${P(r.data[i])}`;
|
|
1769
|
+
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${N(j(r, e))},${P(r.data[e])}`);
|
|
1770
|
+
return t && (o += `L${N(j(r, a))},${n}`, o += `L${N(j(r, i))},${n}`, o += "Z"), o;
|
|
1736
1771
|
}
|
|
1737
|
-
let
|
|
1772
|
+
let fe = n(() => {
|
|
1738
1773
|
let e = f.areaSections;
|
|
1739
1774
|
if (!e?.length) return {
|
|
1740
1775
|
labels: [],
|
|
1741
1776
|
extraHeight: 0
|
|
1742
1777
|
};
|
|
1743
|
-
let t = [], n =
|
|
1778
|
+
let t = [], n = W.value.left + K.value;
|
|
1744
1779
|
for (let r of e) {
|
|
1745
1780
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
1746
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) *
|
|
1781
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * In, o = F(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : O.value[r.seriesIndex]?.color ?? "currentColor"), u = we({
|
|
1747
1782
|
color: l,
|
|
1748
1783
|
fontWeight: 600,
|
|
1749
1784
|
...r.inlineLabelStyle
|
|
1750
|
-
}, { fontSize: 11 }), d =
|
|
1785
|
+
}, { fontSize: 11 }), d = we(r.inlineDescriptionStyle, {
|
|
1751
1786
|
fontSize: 11,
|
|
1752
1787
|
fillOpacity: .6
|
|
1753
1788
|
});
|
|
@@ -1767,7 +1802,7 @@ var Jt = {
|
|
|
1767
1802
|
let r = [];
|
|
1768
1803
|
for (let e of t) {
|
|
1769
1804
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
1770
|
-
for (; n < r.length && !(t >= r[n] +
|
|
1805
|
+
for (; n < r.length && !(t >= r[n] + Ln);) n++;
|
|
1771
1806
|
e.row = n;
|
|
1772
1807
|
let i = e.cx + e.textWidth / 2;
|
|
1773
1808
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -1777,11 +1812,11 @@ var Jt = {
|
|
|
1777
1812
|
extraHeight: 0
|
|
1778
1813
|
} : {
|
|
1779
1814
|
labels: t,
|
|
1780
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
1815
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Pn + Fn
|
|
1781
1816
|
};
|
|
1782
|
-
}),
|
|
1817
|
+
}), pe = n(() => {
|
|
1783
1818
|
let e = [];
|
|
1784
|
-
for (let t of
|
|
1819
|
+
for (let t of O.value) !t.legend || t.showInLegend === !1 || e.push({
|
|
1785
1820
|
label: t.legend,
|
|
1786
1821
|
color: t.color ?? "currentColor",
|
|
1787
1822
|
type: "series",
|
|
@@ -1790,7 +1825,7 @@ var Jt = {
|
|
|
1790
1825
|
let t = f.areaSections;
|
|
1791
1826
|
if (t) for (let n of t) {
|
|
1792
1827
|
if (n.legend !== "inline" || !n.label && !n.description) continue;
|
|
1793
|
-
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" :
|
|
1828
|
+
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : O.value[n.seriesIndex]?.color ?? "currentColor");
|
|
1794
1829
|
e.push({
|
|
1795
1830
|
label: t,
|
|
1796
1831
|
color: r,
|
|
@@ -1799,106 +1834,106 @@ var Jt = {
|
|
|
1799
1834
|
});
|
|
1800
1835
|
}
|
|
1801
1836
|
return e;
|
|
1802
|
-
}),
|
|
1803
|
-
let { min: e, max: t } =
|
|
1837
|
+
}), I = n(() => pe.value.map((e) => e.label)), me = n(() => U.value + fe.value.extraHeight), L = n(() => W.value.top + q.value + W.value.bottom + Fn), ge = n(() => {
|
|
1838
|
+
let { min: e, max: t } = se.value, n = (e) => f.yTickFormat === void 0 ? B(e) : re(e, f.yTickFormat);
|
|
1804
1839
|
return e === t ? [{
|
|
1805
1840
|
value: n(e),
|
|
1806
|
-
y:
|
|
1807
|
-
}] : (f.yScaleType === "log" ?
|
|
1841
|
+
y: R(W.value.top + q.value / 2)
|
|
1842
|
+
}] : (f.yScaleType === "log" ? xe({
|
|
1808
1843
|
min: e,
|
|
1809
1844
|
max: t,
|
|
1810
1845
|
ticks: f.yTicks
|
|
1811
|
-
}) :
|
|
1846
|
+
}) : ve({
|
|
1812
1847
|
min: e,
|
|
1813
1848
|
max: t,
|
|
1814
1849
|
ticks: f.yTicks,
|
|
1815
|
-
targetTickCount:
|
|
1850
|
+
targetTickCount: q.value / 50
|
|
1816
1851
|
})).map((e) => ({
|
|
1817
1852
|
value: n(e),
|
|
1818
|
-
y:
|
|
1853
|
+
y: R(P(e))
|
|
1819
1854
|
}));
|
|
1820
1855
|
});
|
|
1821
|
-
function
|
|
1856
|
+
function _e(e, t, n) {
|
|
1822
1857
|
let r = f.xTickFormat;
|
|
1823
|
-
if (
|
|
1824
|
-
let i = e +
|
|
1825
|
-
return r === void 0 ? !
|
|
1858
|
+
if (D.value) return typeof r == "function" ? r(e, t) : Qt(e, r, T.value, n);
|
|
1859
|
+
let i = e + M.value;
|
|
1860
|
+
return r === void 0 ? !A.value && f.xLabels && Number.isInteger(e) && e >= 0 && e < f.xLabels.length ? f.xLabels[e] : B(i) : typeof r == "function" ? r(i, t) : re(i, r);
|
|
1826
1861
|
}
|
|
1827
|
-
let
|
|
1828
|
-
let { min: e, max: t } =
|
|
1862
|
+
let z = n(() => {
|
|
1863
|
+
let { min: e, max: t } = oe.value;
|
|
1829
1864
|
if (e === t) return [];
|
|
1830
|
-
let n =
|
|
1865
|
+
let n = D.value, r = n ? 0 : M.value, i = k.value, a = K.value / 80, o, s;
|
|
1831
1866
|
if (n) {
|
|
1832
|
-
let n =
|
|
1833
|
-
s = n.unit, o =
|
|
1867
|
+
let n = Kt(e, t, a, T.value);
|
|
1868
|
+
s = n.unit, o = ve({
|
|
1834
1869
|
min: e,
|
|
1835
1870
|
max: t,
|
|
1836
1871
|
ticks: n.values
|
|
1837
1872
|
});
|
|
1838
|
-
} else if (f.xTicks == null && !
|
|
1873
|
+
} else if (f.xTicks == null && !A.value && f.xLabels && f.xLabels.length === i) {
|
|
1839
1874
|
let e = Math.max(3, Math.floor(a)), t = Math.max(1, Math.round((i - 1) / e));
|
|
1840
1875
|
o = [];
|
|
1841
1876
|
for (let e = 0; e < i; e += t) o.push(e);
|
|
1842
|
-
} else o =
|
|
1877
|
+
} else o = ve({
|
|
1843
1878
|
min: e,
|
|
1844
1879
|
max: t,
|
|
1845
1880
|
ticks: f.xTicks,
|
|
1846
1881
|
targetTickCount: a,
|
|
1847
1882
|
displayOffset: r
|
|
1848
1883
|
});
|
|
1849
|
-
let c =
|
|
1884
|
+
let c = W.value.left, l = W.value.left + K.value;
|
|
1850
1885
|
return o.map((e, t) => {
|
|
1851
|
-
let n =
|
|
1886
|
+
let n = R(N(e)), r = "middle";
|
|
1852
1887
|
return n - c <= 1 ? r = "start" : l - n <= 1 && (r = "end"), {
|
|
1853
|
-
value:
|
|
1888
|
+
value: _e(e, t, s),
|
|
1854
1889
|
x: n,
|
|
1855
1890
|
anchor: r
|
|
1856
1891
|
};
|
|
1857
1892
|
});
|
|
1858
1893
|
});
|
|
1859
|
-
function
|
|
1860
|
-
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv :
|
|
1894
|
+
function Se() {
|
|
1895
|
+
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv : Ye(O.value);
|
|
1861
1896
|
}
|
|
1862
|
-
let
|
|
1863
|
-
let e =
|
|
1864
|
-
return e === null || !t ? null :
|
|
1865
|
-
}),
|
|
1866
|
-
function
|
|
1897
|
+
let V = n(() => !!f.tooltipData || !!f.tooltipTrigger), Te = n(() => {
|
|
1898
|
+
let e = Ie.value, t = O.value[0];
|
|
1899
|
+
return e === null || !t ? null : j(t, e);
|
|
1900
|
+
}), Ee = n(() => Te.value === null ? 0 : N(Te.value));
|
|
1901
|
+
function De(e, t) {
|
|
1867
1902
|
let n = e.data.length;
|
|
1868
1903
|
if (n === 0) return null;
|
|
1869
1904
|
let r = 0, i = Infinity;
|
|
1870
1905
|
for (let a = 0; a < n; a++) {
|
|
1871
|
-
let n =
|
|
1906
|
+
let n = j(e, a);
|
|
1872
1907
|
if (!isFinite(n)) continue;
|
|
1873
1908
|
let o = Math.abs(n - t);
|
|
1874
1909
|
o < i && (i = o, r = a);
|
|
1875
1910
|
}
|
|
1876
1911
|
return i === Infinity ? null : r;
|
|
1877
1912
|
}
|
|
1878
|
-
let
|
|
1879
|
-
let e =
|
|
1913
|
+
let Oe = n(() => {
|
|
1914
|
+
let e = Te.value;
|
|
1880
1915
|
if (e === null) return [];
|
|
1881
1916
|
let t = [];
|
|
1882
|
-
for (let n of
|
|
1917
|
+
for (let n of O.value) {
|
|
1883
1918
|
if (n.showInTooltip === !1) continue;
|
|
1884
|
-
let r =
|
|
1919
|
+
let r = De(n, e);
|
|
1885
1920
|
if (r === null) continue;
|
|
1886
1921
|
let i = n.data[r];
|
|
1887
1922
|
isFinite(i) && t.push({
|
|
1888
|
-
x:
|
|
1889
|
-
y:
|
|
1923
|
+
x: N(j(n, r)),
|
|
1924
|
+
y: P(i),
|
|
1890
1925
|
color: n.color ?? "currentColor"
|
|
1891
1926
|
});
|
|
1892
1927
|
}
|
|
1893
1928
|
return t;
|
|
1894
|
-
}),
|
|
1895
|
-
let e =
|
|
1929
|
+
}), ke = n(() => {
|
|
1930
|
+
let e = Ie.value, t = Te.value;
|
|
1896
1931
|
if (e === null || t === null) return null;
|
|
1897
|
-
let n =
|
|
1932
|
+
let n = _e(t, e), r = O.value, i = [];
|
|
1898
1933
|
for (let e = 0; e < r.length; e++) {
|
|
1899
1934
|
let n = r[e];
|
|
1900
1935
|
if (n.showInTooltip === !1) continue;
|
|
1901
|
-
let a =
|
|
1936
|
+
let a = De(n, t);
|
|
1902
1937
|
i.push({
|
|
1903
1938
|
value: a === null ? NaN : Number(n.data[a]),
|
|
1904
1939
|
color: n.color ?? "currentColor",
|
|
@@ -1914,19 +1949,19 @@ var Jt = {
|
|
|
1914
1949
|
});
|
|
1915
1950
|
function Ae(e, t) {
|
|
1916
1951
|
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1917
|
-
x:
|
|
1918
|
-
y:
|
|
1952
|
+
x: N(e - M.value),
|
|
1953
|
+
y: P(t)
|
|
1919
1954
|
};
|
|
1920
1955
|
}
|
|
1921
1956
|
function je(e) {
|
|
1922
1957
|
let t = Me.value?.getBoundingClientRect();
|
|
1923
1958
|
if (!t) return null;
|
|
1924
|
-
let n =
|
|
1959
|
+
let n = O.value[0];
|
|
1925
1960
|
if (!n || n.data.length === 0) return null;
|
|
1926
|
-
let { min: r, max: i } =
|
|
1927
|
-
return
|
|
1961
|
+
let { min: r, max: i } = oe.value, a = i - r || 1;
|
|
1962
|
+
return De(n, r + (e - t.left - W.value.left) / K.value * a);
|
|
1928
1963
|
}
|
|
1929
|
-
let { containerRef: Me, svgRef: H, width: Ne, height:
|
|
1964
|
+
let { containerRef: Me, svgRef: H, width: Ne, height: U, padding: W, legendY: G, inlineLegendLayout: Pe, innerW: K, innerH: q, bounds: Fe, hoverIndex: Ie, tooltipRef: J, tooltipPos: Le, tooltipHandlers: Re, menuItems: ze, downloadLinkText: Be, csvHref: Ve, downloadButtonText: Y, triggerCsvDownload: He, menuFilename: Ue, isFullscreen: We, fullscreenStyle: Ge, teleportTarget: X, exitFullscreen: Ke } = xt({
|
|
1930
1965
|
width: () => f.width,
|
|
1931
1966
|
height: () => f.height,
|
|
1932
1967
|
title: () => f.title,
|
|
@@ -1942,17 +1977,17 @@ var Jt = {
|
|
|
1942
1977
|
downloadButton: () => f.downloadButton,
|
|
1943
1978
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
1944
1979
|
chartPadding: () => f.chartPadding,
|
|
1945
|
-
inlineLegendLabels: () =>
|
|
1946
|
-
hasTooltipSlot: () =>
|
|
1947
|
-
getCsv:
|
|
1980
|
+
inlineLegendLabels: () => I.value,
|
|
1981
|
+
hasTooltipSlot: () => V.value,
|
|
1982
|
+
getCsv: Se,
|
|
1948
1983
|
pointerToIndex: je,
|
|
1949
1984
|
onHover: (e) => ee("hover", e),
|
|
1950
|
-
extraBelowHeight: () =>
|
|
1951
|
-
}),
|
|
1985
|
+
extraBelowHeight: () => fe.value.extraHeight
|
|
1986
|
+
}), qe = n(() => we(f.axisLabelStyle, { fontSize: 13 })), Z = n(() => we(f.tickLabelStyle, {
|
|
1952
1987
|
fontSize: 10,
|
|
1953
|
-
fillOpacity:
|
|
1954
|
-
})),
|
|
1955
|
-
let e = f.titleStyle, t = e?.align ?? "left", n =
|
|
1988
|
+
fillOpacity: Ce
|
|
1989
|
+
})), Je = n(() => we(f.legendStyle, { fontSize: 11 })), Xe = n(() => {
|
|
1990
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = Fe.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
1956
1991
|
return {
|
|
1957
1992
|
lines: (f.title ?? "").split("\n"),
|
|
1958
1993
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -1962,9 +1997,9 @@ var Jt = {
|
|
|
1962
1997
|
x: r,
|
|
1963
1998
|
anchor: i
|
|
1964
1999
|
};
|
|
1965
|
-
}),
|
|
1966
|
-
let e =
|
|
1967
|
-
return
|
|
2000
|
+
}), Ze = n(() => {
|
|
2001
|
+
let e = Pe.value.positions, t = W.value.left, n = G.value;
|
|
2002
|
+
return pe.value.map((r, i) => {
|
|
1968
2003
|
let a = e[i];
|
|
1969
2004
|
return {
|
|
1970
2005
|
...r,
|
|
@@ -1974,48 +2009,48 @@ var Jt = {
|
|
|
1974
2009
|
});
|
|
1975
2010
|
});
|
|
1976
2011
|
return (n, l) => (_(), r(t, {
|
|
1977
|
-
to:
|
|
1978
|
-
disabled: !
|
|
2012
|
+
to: S(X),
|
|
2013
|
+
disabled: !S(We)
|
|
1979
2014
|
}, [o("div", d({
|
|
1980
2015
|
ref_key: "containerRef",
|
|
1981
2016
|
ref: Me
|
|
1982
2017
|
}, n.$attrs, {
|
|
1983
|
-
class: ["line-chart-wrapper", { "is-fullscreen":
|
|
1984
|
-
style:
|
|
2018
|
+
class: ["line-chart-wrapper", { "is-fullscreen": S(We) }],
|
|
2019
|
+
style: S(Ge)
|
|
1985
2020
|
}), [
|
|
1986
|
-
c.menu ? (_(), r(
|
|
2021
|
+
c.menu ? (_(), r(he, {
|
|
1987
2022
|
key: 0,
|
|
1988
|
-
items:
|
|
1989
|
-
"is-fullscreen":
|
|
1990
|
-
onClose:
|
|
2023
|
+
items: S(ze),
|
|
2024
|
+
"is-fullscreen": S(We),
|
|
2025
|
+
onClose: S(Ke)
|
|
1991
2026
|
}, null, 8, [
|
|
1992
2027
|
"items",
|
|
1993
2028
|
"is-fullscreen",
|
|
1994
2029
|
"onClose"
|
|
1995
2030
|
])) : i("", !0),
|
|
1996
|
-
o("div",
|
|
2031
|
+
o("div", $t, b(S(We) ? "Chart expanded to fill window" : ""), 1),
|
|
1997
2032
|
(_(), a("svg", {
|
|
1998
2033
|
ref_key: "svgRef",
|
|
1999
2034
|
ref: H,
|
|
2000
|
-
width:
|
|
2001
|
-
height:
|
|
2035
|
+
width: S(Ne),
|
|
2036
|
+
height: me.value,
|
|
2002
2037
|
role: g.value || void 0,
|
|
2003
2038
|
"aria-label": p.value || void 0
|
|
2004
2039
|
}, [
|
|
2005
2040
|
c.title ? (_(), a("text", {
|
|
2006
2041
|
key: 0,
|
|
2007
|
-
x:
|
|
2008
|
-
y:
|
|
2009
|
-
"text-anchor":
|
|
2010
|
-
"font-size":
|
|
2011
|
-
"font-weight":
|
|
2012
|
-
fill:
|
|
2013
|
-
}, [(_(!0), a(e, null, y(
|
|
2042
|
+
x: Xe.value.x,
|
|
2043
|
+
y: Xe.value.lineHeight,
|
|
2044
|
+
"text-anchor": Xe.value.anchor,
|
|
2045
|
+
"font-size": Xe.value.fontSize,
|
|
2046
|
+
"font-weight": Xe.value.fontWeight,
|
|
2047
|
+
fill: Xe.value.color
|
|
2048
|
+
}, [(_(!0), a(e, null, y(Xe.value.lines, (e, t) => (_(), a("tspan", {
|
|
2014
2049
|
key: t,
|
|
2015
|
-
x:
|
|
2016
|
-
dy: t === 0 ? 0 :
|
|
2017
|
-
}, b(e), 9,
|
|
2018
|
-
|
|
2050
|
+
x: Xe.value.x,
|
|
2051
|
+
dy: t === 0 ? 0 : Xe.value.lineHeight
|
|
2052
|
+
}, b(e), 9, nn))), 128))], 8, tn)) : i("", !0),
|
|
2053
|
+
Ze.value.length > 0 ? (_(), a("g", rn, [(_(!0), a(e, null, y(Ze.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
|
|
2019
2054
|
key: 0,
|
|
2020
2055
|
x1: t.x,
|
|
2021
2056
|
y1: t.y,
|
|
@@ -2024,7 +2059,7 @@ var Jt = {
|
|
|
2024
2059
|
stroke: t.color,
|
|
2025
2060
|
"stroke-width": "2",
|
|
2026
2061
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
2027
|
-
}, null, 8,
|
|
2062
|
+
}, null, 8, an)) : (_(), a("circle", {
|
|
2028
2063
|
key: 1,
|
|
2029
2064
|
cx: t.x + 4,
|
|
2030
2065
|
cy: t.y,
|
|
@@ -2033,119 +2068,119 @@ var Jt = {
|
|
|
2033
2068
|
"fill-opacity": t.fillOpacity,
|
|
2034
2069
|
stroke: t.color,
|
|
2035
2070
|
"stroke-width": "1.5"
|
|
2036
|
-
}, null, 8,
|
|
2071
|
+
}, null, 8, on)), o("text", {
|
|
2037
2072
|
x: t.x + 18,
|
|
2038
2073
|
y: t.y + 4,
|
|
2039
|
-
"font-size":
|
|
2040
|
-
fill:
|
|
2041
|
-
"font-weight":
|
|
2042
|
-
}, b(t.label), 9,
|
|
2074
|
+
"font-size": Je.value.fontSize,
|
|
2075
|
+
fill: Je.value.fill,
|
|
2076
|
+
"font-weight": Je.value.fontWeight
|
|
2077
|
+
}, b(t.label), 9, sn)], 64))), 128))])) : i("", !0),
|
|
2043
2078
|
o("line", {
|
|
2044
|
-
x1:
|
|
2045
|
-
y1:
|
|
2046
|
-
x2:
|
|
2047
|
-
y2:
|
|
2079
|
+
x1: S(R)(S(W).left),
|
|
2080
|
+
y1: S(R)(S(W).top),
|
|
2081
|
+
x2: S(R)(S(W).left),
|
|
2082
|
+
y2: S(R)(S(W).top + S(q)),
|
|
2048
2083
|
stroke: "currentColor",
|
|
2049
2084
|
"stroke-opacity": "0.3"
|
|
2050
|
-
}, null, 8,
|
|
2085
|
+
}, null, 8, cn),
|
|
2051
2086
|
o("line", {
|
|
2052
|
-
x1:
|
|
2053
|
-
y1:
|
|
2054
|
-
x2:
|
|
2055
|
-
y2:
|
|
2087
|
+
x1: S(R)(S(W).left),
|
|
2088
|
+
y1: S(R)(S(W).top + S(q)),
|
|
2089
|
+
x2: S(R)(S(W).left + S(K)),
|
|
2090
|
+
y2: S(R)(S(W).top + S(q)),
|
|
2056
2091
|
stroke: "currentColor",
|
|
2057
2092
|
"stroke-opacity": "0.3"
|
|
2058
|
-
}, null, 8,
|
|
2059
|
-
c.yGrid ? (_(!0), a(e, { key: 2 }, y(
|
|
2093
|
+
}, null, 8, ln),
|
|
2094
|
+
c.yGrid ? (_(!0), a(e, { key: 2 }, y(ge.value, (e, t) => (_(), a("line", {
|
|
2060
2095
|
key: "yg" + t,
|
|
2061
|
-
x1:
|
|
2096
|
+
x1: S(W).left,
|
|
2062
2097
|
y1: e.y,
|
|
2063
|
-
x2:
|
|
2098
|
+
x2: S(W).left + S(K),
|
|
2064
2099
|
y2: e.y,
|
|
2065
2100
|
stroke: "currentColor",
|
|
2066
2101
|
"stroke-opacity": "0.1"
|
|
2067
|
-
}, null, 8,
|
|
2068
|
-
c.xGrid ? (_(!0), a(e, { key: 3 }, y(
|
|
2102
|
+
}, null, 8, un))), 128)) : i("", !0),
|
|
2103
|
+
c.xGrid ? (_(!0), a(e, { key: 3 }, y(z.value, (e, t) => (_(), a("line", {
|
|
2069
2104
|
key: "xg" + t,
|
|
2070
2105
|
x1: e.x,
|
|
2071
|
-
y1:
|
|
2106
|
+
y1: S(W).top,
|
|
2072
2107
|
x2: e.x,
|
|
2073
|
-
y2:
|
|
2108
|
+
y2: S(W).top + S(q),
|
|
2074
2109
|
stroke: "currentColor",
|
|
2075
2110
|
"stroke-opacity": "0.1"
|
|
2076
|
-
}, null, 8,
|
|
2077
|
-
(_(!0), a(e, null, y(
|
|
2111
|
+
}, null, 8, dn))), 128)) : i("", !0),
|
|
2112
|
+
(_(!0), a(e, null, y(ge.value, (e, t) => (_(), a("text", {
|
|
2078
2113
|
key: "y" + t,
|
|
2079
2114
|
"data-testid": "y-tick",
|
|
2080
|
-
x:
|
|
2115
|
+
x: S(W).left - 6,
|
|
2081
2116
|
y: e.y,
|
|
2082
2117
|
"text-anchor": "end",
|
|
2083
2118
|
"dominant-baseline": "middle",
|
|
2084
|
-
"font-size":
|
|
2085
|
-
fill:
|
|
2086
|
-
"font-weight":
|
|
2087
|
-
"fill-opacity":
|
|
2088
|
-
}, b(e.value), 9,
|
|
2119
|
+
"font-size": Z.value.fontSize,
|
|
2120
|
+
fill: Z.value.fill,
|
|
2121
|
+
"font-weight": Z.value.fontWeight,
|
|
2122
|
+
"fill-opacity": Z.value.fillOpacity
|
|
2123
|
+
}, b(e.value), 9, fn))), 128)),
|
|
2089
2124
|
c.yLabel ? (_(), a("text", {
|
|
2090
2125
|
key: 4,
|
|
2091
2126
|
x: 0,
|
|
2092
2127
|
y: 0,
|
|
2093
|
-
transform: `translate(14, ${
|
|
2128
|
+
transform: `translate(14, ${S(W).top + S(q) / 2}) rotate(-90)`,
|
|
2094
2129
|
"text-anchor": "middle",
|
|
2095
|
-
"font-size":
|
|
2096
|
-
fill:
|
|
2097
|
-
"font-weight":
|
|
2098
|
-
}, b(c.yLabel), 9,
|
|
2099
|
-
(_(!0), a(e, null, y(
|
|
2130
|
+
"font-size": qe.value.fontSize,
|
|
2131
|
+
fill: qe.value.fill,
|
|
2132
|
+
"font-weight": qe.value.fontWeight
|
|
2133
|
+
}, b(c.yLabel), 9, pn)) : i("", !0),
|
|
2134
|
+
(_(!0), a(e, null, y(z.value, (e, t) => (_(), a("text", {
|
|
2100
2135
|
key: "x" + t,
|
|
2101
2136
|
"data-testid": "x-tick",
|
|
2102
2137
|
x: e.x,
|
|
2103
|
-
y:
|
|
2138
|
+
y: S(W).top + S(q) + 16,
|
|
2104
2139
|
"text-anchor": e.anchor,
|
|
2105
|
-
"font-size":
|
|
2106
|
-
fill:
|
|
2107
|
-
"font-weight":
|
|
2108
|
-
"fill-opacity":
|
|
2109
|
-
}, b(e.value), 9,
|
|
2140
|
+
"font-size": Z.value.fontSize,
|
|
2141
|
+
fill: Z.value.fill,
|
|
2142
|
+
"font-weight": Z.value.fontWeight,
|
|
2143
|
+
"fill-opacity": Z.value.fillOpacity
|
|
2144
|
+
}, b(e.value), 9, mn))), 128)),
|
|
2110
2145
|
c.xLabel ? (_(), a("text", {
|
|
2111
2146
|
key: 5,
|
|
2112
|
-
x:
|
|
2113
|
-
y:
|
|
2147
|
+
x: S(W).left + S(K) / 2,
|
|
2148
|
+
y: S(U) - 4,
|
|
2114
2149
|
"text-anchor": "middle",
|
|
2115
|
-
"font-size":
|
|
2116
|
-
fill:
|
|
2117
|
-
"font-weight":
|
|
2118
|
-
}, b(c.xLabel), 9,
|
|
2119
|
-
(_(!0), a(e, null, y(
|
|
2150
|
+
"font-size": qe.value.fontSize,
|
|
2151
|
+
fill: qe.value.fill,
|
|
2152
|
+
"font-weight": qe.value.fontWeight
|
|
2153
|
+
}, b(c.xLabel), 9, hn)) : i("", !0),
|
|
2154
|
+
(_(!0), a(e, null, y(ie.value, (e, t) => (_(), a("path", {
|
|
2120
2155
|
key: "area" + t,
|
|
2121
|
-
d:
|
|
2156
|
+
d: ue(e),
|
|
2122
2157
|
fill: e.color ?? "currentColor",
|
|
2123
2158
|
"fill-opacity": e.opacity ?? .2,
|
|
2124
2159
|
stroke: "none",
|
|
2125
2160
|
style: h(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
2126
|
-
}, null, 12,
|
|
2127
|
-
(_(!0), a(e, null, y(
|
|
2161
|
+
}, null, 12, $))), 128)),
|
|
2162
|
+
(_(!0), a(e, null, y(O.value, (t, n) => (_(), a(e, { key: n }, [
|
|
2128
2163
|
t.line !== !1 && t.outline ? (_(), a("path", {
|
|
2129
2164
|
key: 0,
|
|
2130
|
-
d:
|
|
2165
|
+
d: ce(t),
|
|
2131
2166
|
fill: "none",
|
|
2132
2167
|
stroke: t.outlineColor ?? "var(--color-bg-0, #fff)",
|
|
2133
2168
|
"stroke-width": (t.strokeWidth ?? 1.5) + (t.outlineWidth ?? 4),
|
|
2134
2169
|
"stroke-linecap": "round",
|
|
2135
2170
|
"stroke-linejoin": "round",
|
|
2136
2171
|
"data-testid": "line-outline"
|
|
2137
|
-
}, null, 8,
|
|
2172
|
+
}, null, 8, gn)) : i("", !0),
|
|
2138
2173
|
t.line === !1 ? i("", !0) : (_(), a("path", {
|
|
2139
2174
|
key: 1,
|
|
2140
|
-
d:
|
|
2175
|
+
d: ce(t),
|
|
2141
2176
|
fill: "none",
|
|
2142
2177
|
stroke: t.color ?? "currentColor",
|
|
2143
2178
|
"stroke-width": t.strokeWidth ?? 1.5,
|
|
2144
2179
|
"stroke-opacity": t.lineOpacity ?? t.opacity ?? c.lineOpacity,
|
|
2145
2180
|
"stroke-dasharray": t.dashed ? "6 3" : void 0,
|
|
2146
2181
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2147
|
-
}, null, 12,
|
|
2148
|
-
t.dots ? (_(!0), a(e, { key: 2 }, y(
|
|
2182
|
+
}, null, 12, _n)),
|
|
2183
|
+
t.dots ? (_(!0), a(e, { key: 2 }, y(le(t), (e, n) => (_(), a("circle", {
|
|
2149
2184
|
key: n,
|
|
2150
2185
|
cx: e.x,
|
|
2151
2186
|
cy: e.y,
|
|
@@ -2154,69 +2189,69 @@ var Jt = {
|
|
|
2154
2189
|
"fill-opacity": t.dotOpacity ?? t.opacity ?? c.lineOpacity,
|
|
2155
2190
|
stroke: t.dotStroke ?? "none",
|
|
2156
2191
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2157
|
-
}, null, 12,
|
|
2192
|
+
}, null, 12, vn))), 128)) : i("", !0)
|
|
2158
2193
|
], 64))), 128)),
|
|
2159
2194
|
(_(!0), a(e, null, y(c.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
2160
2195
|
o("path", {
|
|
2161
|
-
d:
|
|
2162
|
-
fill: t.color ?? (t.seriesIndex == null ? "#999" :
|
|
2196
|
+
d: de(t),
|
|
2197
|
+
fill: t.color ?? (t.seriesIndex == null ? "#999" : O.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
2163
2198
|
"fill-opacity": t.opacity ?? .15,
|
|
2164
2199
|
stroke: "none"
|
|
2165
|
-
}, null, 8,
|
|
2200
|
+
}, null, 8, yn),
|
|
2166
2201
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
2167
2202
|
key: 0,
|
|
2168
|
-
d:
|
|
2203
|
+
d: de(t, !1),
|
|
2169
2204
|
fill: "none",
|
|
2170
|
-
stroke: t.color ??
|
|
2205
|
+
stroke: t.color ?? O.value[t.seriesIndex]?.color ?? "currentColor",
|
|
2171
2206
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2172
2207
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2173
|
-
}, null, 8,
|
|
2208
|
+
}, null, 8, bn)),
|
|
2174
2209
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
2175
|
-
x1:
|
|
2176
|
-
y1:
|
|
2177
|
-
x2:
|
|
2178
|
-
y2:
|
|
2210
|
+
x1: S(R)(F(t, "start")),
|
|
2211
|
+
y1: S(W).top,
|
|
2212
|
+
x2: S(R)(F(t, "start")),
|
|
2213
|
+
y2: S(W).top + S(q),
|
|
2179
2214
|
stroke: t.color ?? "#999",
|
|
2180
2215
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2181
2216
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2182
|
-
}, null, 8,
|
|
2183
|
-
x1:
|
|
2184
|
-
y1:
|
|
2185
|
-
x2:
|
|
2186
|
-
y2:
|
|
2217
|
+
}, null, 8, xn), o("line", {
|
|
2218
|
+
x1: S(R)(F(t, "end")),
|
|
2219
|
+
y1: S(W).top,
|
|
2220
|
+
x2: S(R)(F(t, "end")),
|
|
2221
|
+
y2: S(W).top + S(q),
|
|
2187
2222
|
stroke: t.color ?? "#999",
|
|
2188
2223
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2189
2224
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2190
|
-
}, null, 8,
|
|
2225
|
+
}, null, 8, Sn)], 64)) : i("", !0),
|
|
2191
2226
|
o("line", {
|
|
2192
|
-
x1:
|
|
2193
|
-
y1:
|
|
2194
|
-
x2:
|
|
2195
|
-
y2:
|
|
2227
|
+
x1: S(R)(F(t, "start")),
|
|
2228
|
+
y1: S(W).top + S(q) - 4,
|
|
2229
|
+
x2: S(R)(F(t, "start")),
|
|
2230
|
+
y2: S(W).top + S(q) + 4,
|
|
2196
2231
|
stroke: "currentColor",
|
|
2197
2232
|
"stroke-opacity": "0.4"
|
|
2198
|
-
}, null, 8,
|
|
2233
|
+
}, null, 8, Cn),
|
|
2199
2234
|
o("line", {
|
|
2200
|
-
x1:
|
|
2201
|
-
y1:
|
|
2202
|
-
x2:
|
|
2203
|
-
y2:
|
|
2235
|
+
x1: S(R)(F(t, "end")),
|
|
2236
|
+
y1: S(W).top + S(q) - 4,
|
|
2237
|
+
x2: S(R)(F(t, "end")),
|
|
2238
|
+
y2: S(W).top + S(q) + 4,
|
|
2204
2239
|
stroke: "currentColor",
|
|
2205
2240
|
"stroke-opacity": "0.4"
|
|
2206
|
-
}, null, 8,
|
|
2241
|
+
}, null, 8, wn)
|
|
2207
2242
|
], 64))), 128)),
|
|
2208
|
-
|
|
2243
|
+
V.value && S(Ie) !== null ? (_(), a("line", {
|
|
2209
2244
|
key: 6,
|
|
2210
|
-
x1:
|
|
2211
|
-
y1:
|
|
2212
|
-
x2:
|
|
2213
|
-
y2:
|
|
2245
|
+
x1: S(R)(Ee.value),
|
|
2246
|
+
y1: S(W).top,
|
|
2247
|
+
x2: S(R)(Ee.value),
|
|
2248
|
+
y2: S(W).top + S(q),
|
|
2214
2249
|
stroke: "currentColor",
|
|
2215
2250
|
"stroke-opacity": "0.3",
|
|
2216
2251
|
"stroke-dasharray": "4 2",
|
|
2217
2252
|
"pointer-events": "none"
|
|
2218
|
-
}, null, 8,
|
|
2219
|
-
(_(!0), a(e, null, y(
|
|
2253
|
+
}, null, 8, Tn)) : i("", !0),
|
|
2254
|
+
(_(!0), a(e, null, y(Oe.value, (e, t) => (_(), a("circle", {
|
|
2220
2255
|
key: "hd" + t,
|
|
2221
2256
|
cx: e.x,
|
|
2222
2257
|
cy: e.y,
|
|
@@ -2225,167 +2260,167 @@ var Jt = {
|
|
|
2225
2260
|
stroke: "var(--color-bg-0, #fff)",
|
|
2226
2261
|
"stroke-width": "2",
|
|
2227
2262
|
"pointer-events": "none"
|
|
2228
|
-
}, null, 8,
|
|
2229
|
-
|
|
2263
|
+
}, null, 8, En))), 128)),
|
|
2264
|
+
V.value ? (_(), a("rect", d({
|
|
2230
2265
|
key: 7,
|
|
2231
|
-
x:
|
|
2232
|
-
y:
|
|
2233
|
-
width:
|
|
2234
|
-
height:
|
|
2266
|
+
x: S(W).left,
|
|
2267
|
+
y: S(W).top,
|
|
2268
|
+
width: S(K),
|
|
2269
|
+
height: S(q),
|
|
2235
2270
|
fill: "transparent",
|
|
2236
2271
|
style: {
|
|
2237
2272
|
cursor: "crosshair",
|
|
2238
2273
|
"touch-action": "pan-y"
|
|
2239
2274
|
}
|
|
2240
|
-
}, ne(
|
|
2241
|
-
c.annotations && c.annotations.length > 0 ? (_(), r(
|
|
2275
|
+
}, ne(S(Re), !0)), null, 16, Dn)) : i("", !0),
|
|
2276
|
+
c.annotations && c.annotations.length > 0 ? (_(), r(S(vt), {
|
|
2242
2277
|
key: 8,
|
|
2243
2278
|
annotations: c.annotations,
|
|
2244
2279
|
project: Ae,
|
|
2245
|
-
bounds:
|
|
2280
|
+
bounds: S(Fe)
|
|
2246
2281
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
2247
|
-
(_(!0), a(e, null, y(
|
|
2282
|
+
(_(!0), a(e, null, y(fe.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
2248
2283
|
o("circle", {
|
|
2249
2284
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
2250
|
-
cy:
|
|
2285
|
+
cy: L.value + e.row * Pn + 4,
|
|
2251
2286
|
r: "4",
|
|
2252
2287
|
fill: e.color,
|
|
2253
2288
|
"fill-opacity": e.fillOpacity,
|
|
2254
2289
|
stroke: e.color,
|
|
2255
2290
|
"stroke-width": "1.5"
|
|
2256
|
-
}, null, 8,
|
|
2291
|
+
}, null, 8, On),
|
|
2257
2292
|
e.labelText ? (_(), a("text", {
|
|
2258
2293
|
key: 0,
|
|
2259
2294
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2260
|
-
y:
|
|
2295
|
+
y: L.value + e.row * Pn + 8,
|
|
2261
2296
|
"font-size": e.labelStyle.fontSize,
|
|
2262
2297
|
"font-weight": e.labelStyle.fontWeight,
|
|
2263
2298
|
fill: e.labelStyle.fill
|
|
2264
|
-
}, b(e.labelText), 9,
|
|
2299
|
+
}, b(e.labelText), 9, kn)) : i("", !0),
|
|
2265
2300
|
e.descText ? (_(), a("text", {
|
|
2266
2301
|
key: 1,
|
|
2267
2302
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2268
|
-
y:
|
|
2303
|
+
y: L.value + e.row * Pn + 22,
|
|
2269
2304
|
"font-size": e.descStyle.fontSize,
|
|
2270
2305
|
"font-weight": e.descStyle.fontWeight,
|
|
2271
2306
|
fill: e.descStyle.fill,
|
|
2272
2307
|
"fill-opacity": e.descStyle.fillOpacity
|
|
2273
|
-
}, b(e.descText), 9,
|
|
2308
|
+
}, b(e.descText), 9, An)) : i("", !0)
|
|
2274
2309
|
]))), 128))
|
|
2275
|
-
], 8,
|
|
2276
|
-
|
|
2310
|
+
], 8, en)),
|
|
2311
|
+
V.value && S(Ie) !== null && ke.value ? (_(), a("div", {
|
|
2277
2312
|
key: 1,
|
|
2278
2313
|
ref_key: "tooltipRef",
|
|
2279
|
-
ref:
|
|
2314
|
+
ref: J,
|
|
2280
2315
|
class: "chart-tooltip-content",
|
|
2281
2316
|
style: h({
|
|
2282
2317
|
position: "absolute",
|
|
2283
2318
|
top: "0",
|
|
2284
2319
|
left: "0",
|
|
2285
2320
|
willChange: "transform",
|
|
2286
|
-
transform:
|
|
2287
|
-
visibility:
|
|
2321
|
+
transform: S(Le) ? `translate3d(${S(Le).left}px, ${S(Le).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2322
|
+
visibility: S(Le) ? "visible" : "hidden"
|
|
2288
2323
|
})
|
|
2289
|
-
}, [te(n.$slots, "tooltip", m(u(
|
|
2324
|
+
}, [te(n.$slots, "tooltip", m(u(ke.value)), () => [o("div", jn, [ke.value.xLabel ? (_(), a("div", Mn, b(ke.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(ke.value.values, (e) => (_(), a("div", {
|
|
2290
2325
|
key: e.seriesIndex,
|
|
2291
2326
|
class: "line-chart-tooltip-row"
|
|
2292
2327
|
}, [o("span", {
|
|
2293
2328
|
class: "line-chart-tooltip-swatch",
|
|
2294
2329
|
style: h({ background: e.color })
|
|
2295
|
-
}, null, 4), s(" " + b(isFinite(e.value) ?
|
|
2296
|
-
|
|
2330
|
+
}, null, 4), s(" " + b(isFinite(e.value) ? S(w)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2331
|
+
S(Be) ? (_(), a("a", {
|
|
2297
2332
|
key: 2,
|
|
2298
2333
|
class: "line-chart-download-link",
|
|
2299
|
-
href:
|
|
2300
|
-
download: `${
|
|
2301
|
-
}, b(
|
|
2302
|
-
|
|
2334
|
+
href: S(Ve),
|
|
2335
|
+
download: `${S(Ue)()}.csv`
|
|
2336
|
+
}, b(S(Be)), 9, Nn)) : i("", !0),
|
|
2337
|
+
S(Y) ? (_(), a("button", {
|
|
2303
2338
|
key: 3,
|
|
2304
2339
|
type: "button",
|
|
2305
2340
|
class: "line-chart-download-button",
|
|
2306
|
-
onClick: l[0] ||= (...e) =>
|
|
2307
|
-
}, b(
|
|
2341
|
+
onClick: l[0] ||= (...e) => S(He) && S(He)(...e)
|
|
2342
|
+
}, b(S(Y)), 1)) : i("", !0)
|
|
2308
2343
|
], 16)], 8, ["to", "disabled"]));
|
|
2309
2344
|
}
|
|
2310
|
-
}), [["__scopeId", "data-v-a3132bed"]]),
|
|
2345
|
+
}), [["__scopeId", "data-v-a3132bed"]]), zn = {
|
|
2311
2346
|
class: "chart-sr-only",
|
|
2312
2347
|
"aria-live": "polite"
|
|
2313
|
-
},
|
|
2348
|
+
}, Bn = [
|
|
2314
2349
|
"width",
|
|
2315
2350
|
"height",
|
|
2316
2351
|
"role",
|
|
2317
2352
|
"aria-label"
|
|
2318
|
-
],
|
|
2353
|
+
], Vn = [
|
|
2319
2354
|
"x",
|
|
2320
2355
|
"y",
|
|
2321
2356
|
"text-anchor",
|
|
2322
2357
|
"font-size",
|
|
2323
2358
|
"font-weight",
|
|
2324
2359
|
"fill"
|
|
2325
|
-
],
|
|
2360
|
+
], Hn = ["x", "dy"], Un = [
|
|
2326
2361
|
"data-testid",
|
|
2327
2362
|
"x",
|
|
2328
2363
|
"y",
|
|
2329
2364
|
"text-anchor",
|
|
2330
2365
|
"font-size",
|
|
2331
2366
|
"fill"
|
|
2332
|
-
],
|
|
2367
|
+
], Wn = { key: 1 }, Gn = [
|
|
2333
2368
|
"x",
|
|
2334
2369
|
"y",
|
|
2335
2370
|
"fill"
|
|
2336
|
-
],
|
|
2371
|
+
], Kn = [
|
|
2337
2372
|
"x1",
|
|
2338
2373
|
"y1",
|
|
2339
2374
|
"x2",
|
|
2340
2375
|
"y2",
|
|
2341
2376
|
"stroke",
|
|
2342
2377
|
"stroke-dasharray"
|
|
2343
|
-
],
|
|
2378
|
+
], qn = [
|
|
2344
2379
|
"x",
|
|
2345
2380
|
"y",
|
|
2346
2381
|
"font-size",
|
|
2347
2382
|
"fill",
|
|
2348
2383
|
"font-weight"
|
|
2349
|
-
],
|
|
2384
|
+
], Jn = [
|
|
2350
2385
|
"x1",
|
|
2351
2386
|
"y1",
|
|
2352
2387
|
"x2",
|
|
2353
2388
|
"y2"
|
|
2354
|
-
],
|
|
2389
|
+
], Yn = [
|
|
2355
2390
|
"x1",
|
|
2356
2391
|
"y1",
|
|
2357
2392
|
"x2",
|
|
2358
2393
|
"y2"
|
|
2359
|
-
],
|
|
2394
|
+
], Xn = [
|
|
2360
2395
|
"x1",
|
|
2361
2396
|
"y1",
|
|
2362
2397
|
"x2",
|
|
2363
2398
|
"y2"
|
|
2364
|
-
],
|
|
2399
|
+
], Zn = [
|
|
2365
2400
|
"x",
|
|
2366
2401
|
"y",
|
|
2367
2402
|
"width",
|
|
2368
2403
|
"height"
|
|
2369
|
-
],
|
|
2404
|
+
], Qn = [
|
|
2370
2405
|
"x",
|
|
2371
2406
|
"y",
|
|
2372
2407
|
"font-size",
|
|
2373
2408
|
"fill",
|
|
2374
2409
|
"font-weight",
|
|
2375
2410
|
"fill-opacity"
|
|
2376
|
-
],
|
|
2411
|
+
], $n = [
|
|
2377
2412
|
"x",
|
|
2378
2413
|
"y",
|
|
2379
2414
|
"font-size",
|
|
2380
2415
|
"fill",
|
|
2381
2416
|
"font-weight",
|
|
2382
2417
|
"fill-opacity"
|
|
2383
|
-
],
|
|
2418
|
+
], er = [
|
|
2384
2419
|
"transform",
|
|
2385
2420
|
"font-size",
|
|
2386
2421
|
"fill",
|
|
2387
2422
|
"font-weight"
|
|
2388
|
-
],
|
|
2423
|
+
], tr = [
|
|
2389
2424
|
"x",
|
|
2390
2425
|
"y",
|
|
2391
2426
|
"text-anchor",
|
|
@@ -2393,7 +2428,7 @@ var Jt = {
|
|
|
2393
2428
|
"fill",
|
|
2394
2429
|
"font-weight",
|
|
2395
2430
|
"fill-opacity"
|
|
2396
|
-
],
|
|
2431
|
+
], nr = [
|
|
2397
2432
|
"x",
|
|
2398
2433
|
"y",
|
|
2399
2434
|
"text-anchor",
|
|
@@ -2401,13 +2436,13 @@ var Jt = {
|
|
|
2401
2436
|
"fill",
|
|
2402
2437
|
"font-weight",
|
|
2403
2438
|
"fill-opacity"
|
|
2404
|
-
],
|
|
2439
|
+
], rr = [
|
|
2405
2440
|
"x",
|
|
2406
2441
|
"y",
|
|
2407
2442
|
"font-size",
|
|
2408
2443
|
"fill",
|
|
2409
2444
|
"font-weight"
|
|
2410
|
-
],
|
|
2445
|
+
], ir = [
|
|
2411
2446
|
"data-category",
|
|
2412
2447
|
"data-series",
|
|
2413
2448
|
"x",
|
|
@@ -2416,34 +2451,34 @@ var Jt = {
|
|
|
2416
2451
|
"height",
|
|
2417
2452
|
"fill",
|
|
2418
2453
|
"fill-opacity"
|
|
2419
|
-
],
|
|
2454
|
+
], ar = [
|
|
2420
2455
|
"x",
|
|
2421
2456
|
"y",
|
|
2422
2457
|
"text-anchor",
|
|
2423
2458
|
"font-size",
|
|
2424
2459
|
"font-weight",
|
|
2425
2460
|
"fill"
|
|
2426
|
-
],
|
|
2461
|
+
], or = [
|
|
2427
2462
|
"d",
|
|
2428
2463
|
"stroke",
|
|
2429
2464
|
"stroke-width",
|
|
2430
2465
|
"stroke-opacity",
|
|
2431
2466
|
"stroke-dasharray"
|
|
2432
|
-
],
|
|
2467
|
+
], sr = [
|
|
2433
2468
|
"cx",
|
|
2434
2469
|
"cy",
|
|
2435
2470
|
"r",
|
|
2436
2471
|
"fill",
|
|
2437
2472
|
"fill-opacity"
|
|
2438
|
-
],
|
|
2473
|
+
], cr = [
|
|
2439
2474
|
"x",
|
|
2440
2475
|
"y",
|
|
2441
2476
|
"width",
|
|
2442
2477
|
"height"
|
|
2443
|
-
],
|
|
2478
|
+
], lr = { class: "bar-chart-tooltip" }, ur = {
|
|
2444
2479
|
key: 0,
|
|
2445
2480
|
class: "bar-chart-tooltip-label"
|
|
2446
|
-
},
|
|
2481
|
+
}, dr = ["href", "download"], fr = 22, pr = 2, mr = 11, hr = .6, gr = 4, _r = 4, vr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
2447
2482
|
inheritAttrs: !1,
|
|
2448
2483
|
__name: "BarChart",
|
|
2449
2484
|
props: {
|
|
@@ -2505,7 +2540,7 @@ var Jt = {
|
|
|
2505
2540
|
emits: ["hover"],
|
|
2506
2541
|
setup(c, { emit: l }) {
|
|
2507
2542
|
let f = c, p = n(() => f.ariaLabel ?? f.title), g = n(() => f.role ?? (p.value ? "img" : void 0)), ee = l, v = [];
|
|
2508
|
-
function
|
|
2543
|
+
function x(e) {
|
|
2509
2544
|
return {
|
|
2510
2545
|
data: e.y ?? e.data ?? v,
|
|
2511
2546
|
color: e.color,
|
|
@@ -2516,79 +2551,79 @@ var Jt = {
|
|
|
2516
2551
|
showInTooltip: e.showInTooltip
|
|
2517
2552
|
};
|
|
2518
2553
|
}
|
|
2519
|
-
let
|
|
2520
|
-
if (f.series && f.series.length > 0) return f.series.map(
|
|
2554
|
+
let C = n(() => {
|
|
2555
|
+
if (f.series && f.series.length > 0) return f.series.map(x);
|
|
2521
2556
|
let e = f.y ?? f.data;
|
|
2522
2557
|
return e ? [{ data: e }] : [];
|
|
2523
|
-
}),
|
|
2558
|
+
}), w = n(() => {
|
|
2524
2559
|
let e = f.categories?.length ?? 0;
|
|
2525
|
-
for (let t of
|
|
2560
|
+
for (let t of C.value) t.data.length > e && (e = t.data.length);
|
|
2526
2561
|
return e;
|
|
2527
|
-
}),
|
|
2528
|
-
let e =
|
|
2562
|
+
}), T = n(() => {
|
|
2563
|
+
let e = w.value, t = Array(e);
|
|
2529
2564
|
for (let n = 0; n < e; n++) {
|
|
2530
2565
|
let e = f.categories?.[n];
|
|
2531
2566
|
e instanceof Date ? t[n] = e.toISOString().slice(0, 10) : t[n] = e ?? String(n);
|
|
2532
2567
|
}
|
|
2533
2568
|
return t;
|
|
2534
|
-
}),
|
|
2569
|
+
}), E = n(() => {
|
|
2535
2570
|
let e = f.categories;
|
|
2536
|
-
if (!e || e.length === 0 || !
|
|
2571
|
+
if (!e || e.length === 0 || !Ht(e, "utc")) return null;
|
|
2537
2572
|
let t = Array(e.length);
|
|
2538
|
-
for (let n = 0; n < e.length; n++) t[n] =
|
|
2573
|
+
for (let n = 0; n < e.length; n++) t[n] = Bt(e[n], "utc") ?? NaN;
|
|
2539
2574
|
return t;
|
|
2540
|
-
}),
|
|
2575
|
+
}), D = n(() => f.orientation === "vertical"), O = n(() => {
|
|
2541
2576
|
let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
|
|
2542
2577
|
e > 0 && e < n && (n = e);
|
|
2543
2578
|
};
|
|
2544
2579
|
if (f.layout === "stacked") {
|
|
2545
|
-
let n =
|
|
2580
|
+
let n = w.value;
|
|
2546
2581
|
for (let i = 0; i < n; i++) {
|
|
2547
2582
|
let n = 0, a = 0;
|
|
2548
|
-
for (let e of
|
|
2583
|
+
for (let e of C.value) {
|
|
2549
2584
|
if (i >= e.data.length) continue;
|
|
2550
2585
|
let t = Number(e.data[i]);
|
|
2551
2586
|
isFinite(t) && (r(t), t >= 0 ? n += t : a += t);
|
|
2552
2587
|
}
|
|
2553
2588
|
n > t && (t = n), a < e && (e = a);
|
|
2554
2589
|
}
|
|
2555
|
-
} else for (let n of
|
|
2590
|
+
} else for (let n of C.value) for (let i of n.data) {
|
|
2556
2591
|
let n = Number(i);
|
|
2557
2592
|
isFinite(n) && (r(n), n < e && (e = n), n > t && (t = n));
|
|
2558
2593
|
}
|
|
2559
2594
|
isFinite(e) || (e = 0), isFinite(t) || (t = 0);
|
|
2560
2595
|
let i = f.valueMin ?? 0;
|
|
2561
2596
|
f.valueScaleType === "log" ? i > 0 && i < e && (e = i) : i < e && (e = i);
|
|
2562
|
-
let a =
|
|
2597
|
+
let a = be(e, t, f.valueScaleType, n);
|
|
2563
2598
|
return {
|
|
2564
2599
|
min: a.min,
|
|
2565
2600
|
max: a.max,
|
|
2566
2601
|
range: a.max - a.min || 1
|
|
2567
2602
|
};
|
|
2568
|
-
}),
|
|
2569
|
-
let e =
|
|
2570
|
-
return e > 0 ?
|
|
2571
|
-
}),
|
|
2572
|
-
let e =
|
|
2603
|
+
}), ie = n(() => D.value ? W.value : G.value), k = n(() => D.value ? G.value : W.value), A = n(() => {
|
|
2604
|
+
let e = w.value;
|
|
2605
|
+
return e > 0 ? ie.value / e : 0;
|
|
2606
|
+
}), j = n(() => A.value * (1 - f.barPadding)), ae = n(() => {
|
|
2607
|
+
let e = C.value.length;
|
|
2573
2608
|
if (e === 0) return 0;
|
|
2574
|
-
if (f.layout === "stacked" || e === 1) return
|
|
2609
|
+
if (f.layout === "stacked" || e === 1) return j.value;
|
|
2575
2610
|
let t = f.groupGap * (e - 1);
|
|
2576
|
-
return Math.max(1, (
|
|
2611
|
+
return Math.max(1, (j.value - t) / e);
|
|
2577
2612
|
});
|
|
2578
|
-
function
|
|
2579
|
-
return (
|
|
2613
|
+
function M(e) {
|
|
2614
|
+
return (D.value ? H.value.left : H.value.top) + e * A.value;
|
|
2580
2615
|
}
|
|
2581
|
-
let
|
|
2582
|
-
let { min: e, max: t } =
|
|
2583
|
-
return
|
|
2616
|
+
let oe = n(() => {
|
|
2617
|
+
let { min: e, max: t } = O.value, n = f.valueMin ?? 0;
|
|
2618
|
+
return N(Math.max(e, Math.min(t, n)));
|
|
2584
2619
|
});
|
|
2585
|
-
function
|
|
2586
|
-
let { min: t, max: n } =
|
|
2587
|
-
return
|
|
2620
|
+
function N(e) {
|
|
2621
|
+
let { min: t, max: n } = O.value, r = ye(e, t, n, f.valueScaleType);
|
|
2622
|
+
return D.value ? H.value.top + G.value - r * G.value : H.value.left + r * W.value;
|
|
2588
2623
|
}
|
|
2589
|
-
function
|
|
2624
|
+
function se(e, t, n, r, i, a, o, s, c, l) {
|
|
2590
2625
|
let u = Math.min(e, t), d = Math.abs(e - t);
|
|
2591
|
-
return
|
|
2626
|
+
return D.value ? {
|
|
2592
2627
|
x: n,
|
|
2593
2628
|
y: u,
|
|
2594
2629
|
w: r,
|
|
@@ -2612,34 +2647,34 @@ var Jt = {
|
|
|
2612
2647
|
seriesIndex: l
|
|
2613
2648
|
};
|
|
2614
2649
|
}
|
|
2615
|
-
let
|
|
2616
|
-
let e = [], t =
|
|
2650
|
+
let P = n(() => {
|
|
2651
|
+
let e = [], t = C.value, n = t.length;
|
|
2617
2652
|
if (n === 0) return e;
|
|
2618
|
-
let r =
|
|
2653
|
+
let r = w.value, i = A.value, a = j.value, o = ae.value, s = (i - a) / 2, c = oe.value;
|
|
2619
2654
|
for (let i = 0; i < r; i++) {
|
|
2620
|
-
let r =
|
|
2655
|
+
let r = M(i) + s;
|
|
2621
2656
|
if (f.layout === "stacked") {
|
|
2622
2657
|
let o = 0, s = 0;
|
|
2623
2658
|
for (let c = 0; c < n; c++) {
|
|
2624
2659
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
2625
2660
|
if (!isFinite(l)) continue;
|
|
2626
2661
|
let u = l >= 0 ? o : s, d = u + l;
|
|
2627
|
-
e.push(
|
|
2662
|
+
e.push(se(N(u), N(d), r, a, n.color ?? I(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
|
|
2628
2663
|
}
|
|
2629
2664
|
} else if (f.layout === "overlay") for (let o = 0; o < n; o++) {
|
|
2630
2665
|
let n = t[o], s = Number(n.data[i] ?? NaN);
|
|
2631
|
-
isFinite(s) && e.push(
|
|
2666
|
+
isFinite(s) && e.push(se(c, N(s), r, a, n.color ?? I(o), n.opacity ?? 1, n.blendMode, s, i, o));
|
|
2632
2667
|
}
|
|
2633
2668
|
else for (let a = 0; a < n; a++) {
|
|
2634
2669
|
let s = t[a], l = Number(s.data[i] ?? NaN);
|
|
2635
2670
|
if (!isFinite(l)) continue;
|
|
2636
2671
|
let u = r + (n === 1 ? 0 : a * (o + f.groupGap));
|
|
2637
|
-
e.push(
|
|
2672
|
+
e.push(se(c, N(l), u, o, s.color ?? I(a), s.opacity ?? 1, s.blendMode, l, i, a));
|
|
2638
2673
|
}
|
|
2639
2674
|
}
|
|
2640
2675
|
return e;
|
|
2641
2676
|
});
|
|
2642
|
-
function
|
|
2677
|
+
function ce(e) {
|
|
2643
2678
|
let t = Infinity, n = -Infinity;
|
|
2644
2679
|
for (let r of e.data) {
|
|
2645
2680
|
let e = Number(r);
|
|
@@ -2650,33 +2685,33 @@ var Jt = {
|
|
|
2650
2685
|
max: n
|
|
2651
2686
|
};
|
|
2652
2687
|
}
|
|
2653
|
-
function
|
|
2654
|
-
let r = (
|
|
2655
|
-
return
|
|
2688
|
+
function le(e, t, n) {
|
|
2689
|
+
let r = (D.value ? H.value.left : H.value.top) + (e + .5) * A.value, i = n.max - n.min || 1, a = (t - n.min) / i;
|
|
2690
|
+
return D.value ? {
|
|
2656
2691
|
x: r,
|
|
2657
|
-
y: H.value.top +
|
|
2692
|
+
y: H.value.top + G.value - a * G.value
|
|
2658
2693
|
} : {
|
|
2659
|
-
x: H.value.left + a *
|
|
2694
|
+
x: H.value.left + a * W.value,
|
|
2660
2695
|
y: r
|
|
2661
2696
|
};
|
|
2662
2697
|
}
|
|
2663
|
-
let
|
|
2698
|
+
let ue = n(() => {
|
|
2664
2699
|
let e = f.summaryLines;
|
|
2665
2700
|
return !e || e.length === 0 ? [] : e.map((e, t) => ({
|
|
2666
2701
|
data: e.data ?? v,
|
|
2667
2702
|
x: e.x,
|
|
2668
|
-
color: e.color ??
|
|
2703
|
+
color: e.color ?? fe(t),
|
|
2669
2704
|
strokeWidth: e.strokeWidth ?? 2,
|
|
2670
2705
|
dashed: e.dashed ?? !1,
|
|
2671
2706
|
opacity: e.opacity ?? 1,
|
|
2672
2707
|
blendMode: e.blendMode,
|
|
2673
2708
|
dots: e.dots ?? !1,
|
|
2674
2709
|
dotRadius: e.dotRadius ?? (e.strokeWidth ?? 2) + 1,
|
|
2675
|
-
extent:
|
|
2710
|
+
extent: ce(e),
|
|
2676
2711
|
legend: e.legend,
|
|
2677
2712
|
showInLegend: e.showInLegend !== !1
|
|
2678
2713
|
}));
|
|
2679
|
-
}),
|
|
2714
|
+
}), F = n(() => A.value === 0 ? [] : ue.value.map((e) => {
|
|
2680
2715
|
let t = [], n = "", r = !1;
|
|
2681
2716
|
for (let i = 0; i < e.data.length; i++) {
|
|
2682
2717
|
let a = Number(e.data[i]), o = e.x ? Number(e.x[i]) : i;
|
|
@@ -2684,7 +2719,7 @@ var Jt = {
|
|
|
2684
2719
|
r = !1;
|
|
2685
2720
|
continue;
|
|
2686
2721
|
}
|
|
2687
|
-
let s =
|
|
2722
|
+
let s = le(o, a, e.extent);
|
|
2688
2723
|
t.push(s), n += r ? `L${s.x},${s.y}` : `M${s.x},${s.y}`, r = !0;
|
|
2689
2724
|
}
|
|
2690
2725
|
return {
|
|
@@ -2692,16 +2727,16 @@ var Jt = {
|
|
|
2692
2727
|
pathD: n,
|
|
2693
2728
|
points: t
|
|
2694
2729
|
};
|
|
2695
|
-
})),
|
|
2730
|
+
})), de = [
|
|
2696
2731
|
"var(--color-fg-1, #111)",
|
|
2697
2732
|
"var(--color-danger, #ef4444)",
|
|
2698
2733
|
"var(--color-success, #10b981)",
|
|
2699
2734
|
"var(--color-info, #6366f1)"
|
|
2700
2735
|
];
|
|
2701
|
-
function
|
|
2702
|
-
return
|
|
2736
|
+
function fe(e) {
|
|
2737
|
+
return de[e % de.length];
|
|
2703
2738
|
}
|
|
2704
|
-
let
|
|
2739
|
+
let pe = [
|
|
2705
2740
|
"var(--color-primary, #3b82f6)",
|
|
2706
2741
|
"var(--color-accent, #f59e0b)",
|
|
2707
2742
|
"var(--color-success, #10b981)",
|
|
@@ -2709,36 +2744,36 @@ var Jt = {
|
|
|
2709
2744
|
"var(--color-info, #6366f1)",
|
|
2710
2745
|
"var(--color-warning, #d97706)"
|
|
2711
2746
|
];
|
|
2712
|
-
function
|
|
2713
|
-
return
|
|
2747
|
+
function I(e) {
|
|
2748
|
+
return pe[e % pe.length];
|
|
2714
2749
|
}
|
|
2715
|
-
let
|
|
2716
|
-
let { min: e, max: t } =
|
|
2750
|
+
let me = St(() => f.tooltipValueFormat, () => f.valueTickFormat), L = n(() => {
|
|
2751
|
+
let { min: e, max: t } = O.value, n = (e) => f.valueTickFormat === void 0 ? B(e) : re(e, f.valueTickFormat);
|
|
2717
2752
|
if (e === t) return [{
|
|
2718
2753
|
value: n(e),
|
|
2719
|
-
pos:
|
|
2754
|
+
pos: R(N(e))
|
|
2720
2755
|
}];
|
|
2721
|
-
let r =
|
|
2722
|
-
return (f.valueScaleType === "log" ?
|
|
2756
|
+
let r = D.value ? 50 : 80;
|
|
2757
|
+
return (f.valueScaleType === "log" ? xe({
|
|
2723
2758
|
min: e,
|
|
2724
2759
|
max: t,
|
|
2725
2760
|
ticks: f.valueTicks
|
|
2726
|
-
}) :
|
|
2761
|
+
}) : ve({
|
|
2727
2762
|
min: e,
|
|
2728
2763
|
max: t,
|
|
2729
2764
|
ticks: f.valueTicks,
|
|
2730
|
-
targetTickCount:
|
|
2765
|
+
targetTickCount: k.value / r
|
|
2731
2766
|
})).map((e) => ({
|
|
2732
2767
|
value: n(e),
|
|
2733
|
-
pos:
|
|
2768
|
+
pos: R(N(e))
|
|
2734
2769
|
}));
|
|
2735
|
-
}),
|
|
2736
|
-
let e =
|
|
2770
|
+
}), ge = n(() => {
|
|
2771
|
+
let e = w.value, t = E.value;
|
|
2737
2772
|
if (t && t.length > 0) {
|
|
2738
2773
|
let e = Infinity, n = -Infinity;
|
|
2739
2774
|
for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
|
|
2740
2775
|
if (!Number.isFinite(e) || e === n) return [];
|
|
2741
|
-
let r =
|
|
2776
|
+
let r = D.value ? W.value : G.value, i = Math.max(2, Math.floor(r / 80)), a = Kt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
|
|
2742
2777
|
for (let e of a.values) {
|
|
2743
2778
|
let n = -1, r = Infinity;
|
|
2744
2779
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -2747,7 +2782,7 @@ var Jt = {
|
|
|
2747
2782
|
}
|
|
2748
2783
|
if (n < 0 || c.has(n)) continue;
|
|
2749
2784
|
c.add(n);
|
|
2750
|
-
let i =
|
|
2785
|
+
let i = M(n) + A.value / 2, a = f.categoryFormat ? f.categoryFormat(T.value[n], n) : Qt(t[n], f.dateFormat, "utc", o);
|
|
2751
2786
|
s.push({
|
|
2752
2787
|
label: a,
|
|
2753
2788
|
pos: i,
|
|
@@ -2757,10 +2792,10 @@ var Jt = {
|
|
|
2757
2792
|
return s;
|
|
2758
2793
|
}
|
|
2759
2794
|
let n = [], r = (e, t) => f.categoryFormat ? f.categoryFormat(e, t) : e, i = Array(e), a = 0;
|
|
2760
|
-
for (let t = 0; t < e; t++) i[t] = r(
|
|
2761
|
-
let o = f.tickLabelStyle?.fontSize ?? 10, s =
|
|
2795
|
+
for (let t = 0; t < e; t++) i[t] = r(T.value[t], t), i[t].length > a && (a = i[t].length);
|
|
2796
|
+
let o = f.tickLabelStyle?.fontSize ?? 10, s = D.value ? a * o * .6 + 8 : o * 1.2 + 8, c = A.value > 0 ? Math.max(1, Math.ceil(s / A.value)) : 1;
|
|
2762
2797
|
for (let t = 0; t < e; t += c) {
|
|
2763
|
-
let e =
|
|
2798
|
+
let e = M(t) + A.value / 2;
|
|
2764
2799
|
n.push({
|
|
2765
2800
|
label: i[t],
|
|
2766
2801
|
pos: e,
|
|
@@ -2768,15 +2803,15 @@ var Jt = {
|
|
|
2768
2803
|
});
|
|
2769
2804
|
}
|
|
2770
2805
|
return n;
|
|
2771
|
-
}),
|
|
2806
|
+
}), _e = n(() => {
|
|
2772
2807
|
let e = [];
|
|
2773
|
-
return
|
|
2808
|
+
return C.value.forEach((t, n) => {
|
|
2774
2809
|
!t.legend || t.showInLegend === !1 || e.push({
|
|
2775
2810
|
label: t.legend,
|
|
2776
|
-
color: t.color ??
|
|
2811
|
+
color: t.color ?? I(n),
|
|
2777
2812
|
kind: "bar"
|
|
2778
2813
|
});
|
|
2779
|
-
}),
|
|
2814
|
+
}), ue.value.forEach((t) => {
|
|
2780
2815
|
!t.legend || !t.showInLegend || e.push({
|
|
2781
2816
|
label: t.legend,
|
|
2782
2817
|
color: t.color,
|
|
@@ -2784,21 +2819,21 @@ var Jt = {
|
|
|
2784
2819
|
dashed: t.dashed
|
|
2785
2820
|
});
|
|
2786
2821
|
}), e;
|
|
2787
|
-
}),
|
|
2788
|
-
function
|
|
2822
|
+
}), z = n(() => _e.value.map((e) => e.label));
|
|
2823
|
+
function Se() {
|
|
2789
2824
|
if (typeof f.csv == "function") return f.csv();
|
|
2790
2825
|
if (typeof f.csv == "string") return f.csv;
|
|
2791
|
-
let e =
|
|
2826
|
+
let e = C.value.map((e) => ({
|
|
2792
2827
|
label: e.legend,
|
|
2793
2828
|
data: e.data
|
|
2794
2829
|
}));
|
|
2795
|
-
return
|
|
2830
|
+
return Xe(T.value, e);
|
|
2796
2831
|
}
|
|
2797
|
-
let
|
|
2798
|
-
function
|
|
2799
|
-
if (!isFinite(e) || !isFinite(t) ||
|
|
2800
|
-
let n = (
|
|
2801
|
-
return
|
|
2832
|
+
let V = n(() => !!f.tooltipData || !!f.tooltipTrigger);
|
|
2833
|
+
function Te(e, t) {
|
|
2834
|
+
if (!isFinite(e) || !isFinite(t) || A.value === 0) return null;
|
|
2835
|
+
let n = (D.value ? H.value.left : H.value.top) + (e + .5) * A.value, r = N(t);
|
|
2836
|
+
return D.value ? {
|
|
2802
2837
|
x: n,
|
|
2803
2838
|
y: r
|
|
2804
2839
|
} : {
|
|
@@ -2806,16 +2841,16 @@ var Jt = {
|
|
|
2806
2841
|
y: n
|
|
2807
2842
|
};
|
|
2808
2843
|
}
|
|
2809
|
-
function
|
|
2810
|
-
let n =
|
|
2844
|
+
function Ee(e, t) {
|
|
2845
|
+
let n = ke.value?.getBoundingClientRect();
|
|
2811
2846
|
if (!n) return null;
|
|
2812
|
-
let r =
|
|
2813
|
-
if (r === 0 ||
|
|
2814
|
-
let i =
|
|
2815
|
-
return Math.max(0, Math.min(r - 1, Math.floor(i /
|
|
2847
|
+
let r = w.value;
|
|
2848
|
+
if (r === 0 || A.value === 0) return null;
|
|
2849
|
+
let i = D.value ? e - n.left - H.value.left : t - n.top - H.value.top;
|
|
2850
|
+
return Math.max(0, Math.min(r - 1, Math.floor(i / A.value)));
|
|
2816
2851
|
}
|
|
2817
|
-
let
|
|
2818
|
-
let e =
|
|
2852
|
+
let De = n(() => !!(f.categoryHeader || f.valueHeader)), Oe = n(() => {
|
|
2853
|
+
let e = De.value ? fr : 0, t = f.chartPadding;
|
|
2819
2854
|
return e ? t == null ? { top: e } : typeof t == "number" ? {
|
|
2820
2855
|
top: t + e,
|
|
2821
2856
|
right: t,
|
|
@@ -2825,7 +2860,7 @@ var Jt = {
|
|
|
2825
2860
|
...t,
|
|
2826
2861
|
top: (t.top ?? 0) + e
|
|
2827
2862
|
} : t;
|
|
2828
|
-
}), { containerRef:
|
|
2863
|
+
}), { containerRef: ke, svgRef: Ae, width: je, height: Me, padding: H, legendY: Ne, inlineLegendLayout: U, innerW: W, innerH: G, bounds: Pe, hoverIndex: K, tooltipRef: q, tooltipPos: Fe, tooltipHandlers: Ie, menuItems: J, downloadLinkText: Le, csvHref: Re, downloadButtonText: ze, triggerCsvDownload: Be, menuFilename: Ve, isFullscreen: Y, fullscreenStyle: He, teleportTarget: Ue, exitFullscreen: We } = xt({
|
|
2829
2864
|
width: () => f.width,
|
|
2830
2865
|
height: () => f.height,
|
|
2831
2866
|
title: () => f.title,
|
|
@@ -2840,18 +2875,18 @@ var Jt = {
|
|
|
2840
2875
|
downloadLink: () => f.downloadLink,
|
|
2841
2876
|
downloadButton: () => f.downloadButton,
|
|
2842
2877
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
2843
|
-
chartPadding: () =>
|
|
2844
|
-
inlineLegendLabels: () =>
|
|
2845
|
-
hasTooltipSlot: () =>
|
|
2846
|
-
getCsv:
|
|
2847
|
-
pointerToIndex:
|
|
2848
|
-
scrubAxis: () =>
|
|
2878
|
+
chartPadding: () => Oe.value,
|
|
2879
|
+
inlineLegendLabels: () => z.value,
|
|
2880
|
+
hasTooltipSlot: () => V.value,
|
|
2881
|
+
getCsv: Se,
|
|
2882
|
+
pointerToIndex: Ee,
|
|
2883
|
+
scrubAxis: () => D.value ? "x" : "y",
|
|
2849
2884
|
onHover: (e) => ee("hover", e)
|
|
2850
|
-
}),
|
|
2885
|
+
}), Ge = n(() => we(f.axisLabelStyle, { fontSize: 13 })), X = n(() => we(f.tickLabelStyle, {
|
|
2851
2886
|
fontSize: 10,
|
|
2852
|
-
fillOpacity:
|
|
2853
|
-
})),
|
|
2854
|
-
let e = f.titleStyle, t = e?.align ?? "left", n =
|
|
2887
|
+
fillOpacity: Ce
|
|
2888
|
+
})), Ke = n(() => we(f.legendStyle, { fontSize: 11 })), qe = n(() => f.categoryAlign === "start" && !D.value ? pr : H.value.left), Z = n(() => {
|
|
2889
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = Pe.value, r = t === "left" ? qe.value : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
2855
2890
|
return {
|
|
2856
2891
|
lines: (f.title ?? "").split("\n"),
|
|
2857
2892
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -2861,47 +2896,47 @@ var Jt = {
|
|
|
2861
2896
|
x: r,
|
|
2862
2897
|
anchor: i
|
|
2863
2898
|
};
|
|
2864
|
-
}),
|
|
2865
|
-
let e =
|
|
2899
|
+
}), Je = n(() => {
|
|
2900
|
+
let e = K.value;
|
|
2866
2901
|
if (e === null) return;
|
|
2867
|
-
let t =
|
|
2868
|
-
return t && Number.isFinite(t[e]) ?
|
|
2869
|
-
}),
|
|
2870
|
-
let e =
|
|
2902
|
+
let t = E.value;
|
|
2903
|
+
return t && Number.isFinite(t[e]) ? Qt(t[e], f.dateFormat, "utc") : T.value[e];
|
|
2904
|
+
}), Ye = n(() => {
|
|
2905
|
+
let e = K.value;
|
|
2871
2906
|
if (e === null) return null;
|
|
2872
|
-
let t =
|
|
2907
|
+
let t = C.value, n = [];
|
|
2873
2908
|
for (let r = 0; r < t.length; r++) {
|
|
2874
2909
|
let i = t[r];
|
|
2875
2910
|
i.showInTooltip !== !1 && n.push({
|
|
2876
2911
|
value: Number(i.data[e] ?? NaN),
|
|
2877
|
-
color: i.color ??
|
|
2912
|
+
color: i.color ?? I(r),
|
|
2878
2913
|
seriesIndex: r
|
|
2879
2914
|
});
|
|
2880
2915
|
}
|
|
2881
2916
|
return {
|
|
2882
2917
|
index: e,
|
|
2883
|
-
category:
|
|
2918
|
+
category: T.value[e] ?? String(e),
|
|
2884
2919
|
values: n,
|
|
2885
2920
|
data: f.tooltipData?.[e] ?? null
|
|
2886
2921
|
};
|
|
2887
|
-
}),
|
|
2888
|
-
let e =
|
|
2922
|
+
}), Ze = n(() => {
|
|
2923
|
+
let e = K.value;
|
|
2889
2924
|
if (e === null) return null;
|
|
2890
|
-
let t =
|
|
2891
|
-
return
|
|
2925
|
+
let t = M(e);
|
|
2926
|
+
return D.value ? {
|
|
2892
2927
|
x: t,
|
|
2893
2928
|
y: H.value.top,
|
|
2894
|
-
w:
|
|
2895
|
-
h:
|
|
2929
|
+
w: A.value,
|
|
2930
|
+
h: G.value
|
|
2896
2931
|
} : {
|
|
2897
2932
|
x: H.value.left,
|
|
2898
2933
|
y: t,
|
|
2899
|
-
w:
|
|
2900
|
-
h:
|
|
2934
|
+
w: W.value,
|
|
2935
|
+
h: A.value
|
|
2901
2936
|
};
|
|
2902
|
-
}),
|
|
2903
|
-
let e =
|
|
2904
|
-
return
|
|
2937
|
+
}), Qe = n(() => {
|
|
2938
|
+
let e = U.value.positions, t = qe.value, n = Ne.value;
|
|
2939
|
+
return _e.value.map((r, i) => {
|
|
2905
2940
|
let a = e[i];
|
|
2906
2941
|
return {
|
|
2907
2942
|
...r,
|
|
@@ -2909,7 +2944,7 @@ var Jt = {
|
|
|
2909
2944
|
y: n + a.row * 20
|
|
2910
2945
|
};
|
|
2911
2946
|
});
|
|
2912
|
-
}),
|
|
2947
|
+
}), $e = n(() => {
|
|
2913
2948
|
let e = f.barLabels;
|
|
2914
2949
|
if (!e) return null;
|
|
2915
2950
|
let t = e === !0 ? {} : e;
|
|
@@ -2920,37 +2955,37 @@ var Jt = {
|
|
|
2920
2955
|
align: t.align ?? "center",
|
|
2921
2956
|
overlap: t.overlap ?? "shift",
|
|
2922
2957
|
minSize: t.minSize ?? 0,
|
|
2923
|
-
fontSize: t.fontSize ??
|
|
2958
|
+
fontSize: t.fontSize ?? mr,
|
|
2924
2959
|
fontWeight: t.fontWeight
|
|
2925
2960
|
};
|
|
2926
2961
|
});
|
|
2927
|
-
function
|
|
2928
|
-
let n =
|
|
2929
|
-
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ?
|
|
2962
|
+
function et(e, t) {
|
|
2963
|
+
let n = $e.value?.format;
|
|
2964
|
+
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ? B(e) : re(e, f.valueTickFormat) : re(e, n);
|
|
2930
2965
|
}
|
|
2931
|
-
function
|
|
2932
|
-
for (let r =
|
|
2933
|
-
let i =
|
|
2966
|
+
function tt(e, t, n) {
|
|
2967
|
+
for (let r = P.value.length - 1; r >= 0; r--) {
|
|
2968
|
+
let i = P.value[r];
|
|
2934
2969
|
if (i.categoryIndex === e && t >= i.x && t <= i.x + i.w && n >= i.y && n <= i.y + i.h) return i.color;
|
|
2935
2970
|
}
|
|
2936
2971
|
return null;
|
|
2937
2972
|
}
|
|
2938
|
-
let
|
|
2939
|
-
let e =
|
|
2973
|
+
let nt = n(() => {
|
|
2974
|
+
let e = $e.value;
|
|
2940
2975
|
if (!e) return [];
|
|
2941
|
-
let t =
|
|
2942
|
-
for (let i of
|
|
2943
|
-
let a =
|
|
2976
|
+
let t = D.value, n = e.fontSize, r = [];
|
|
2977
|
+
for (let i of P.value) {
|
|
2978
|
+
let a = et(i.value, {
|
|
2944
2979
|
value: i.value,
|
|
2945
2980
|
categoryIndex: i.categoryIndex,
|
|
2946
2981
|
seriesIndex: i.seriesIndex,
|
|
2947
|
-
category:
|
|
2982
|
+
category: T.value[i.categoryIndex] ?? String(i.categoryIndex)
|
|
2948
2983
|
});
|
|
2949
2984
|
if (!a) continue;
|
|
2950
|
-
let o = t ? i.h : i.w, s = a.length * n *
|
|
2951
|
-
if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m +
|
|
2952
|
-
else if (e.align === "start") u = h +
|
|
2953
|
-
else if (e.align === "end") d = m -
|
|
2985
|
+
let o = t ? i.h : i.w, s = a.length * n * hr, c = o >= s + 2 * gr && 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;
|
|
2986
|
+
if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m + gr, d = u + g, p = "start";
|
|
2987
|
+
else if (e.align === "start") u = h + gr, d = u + g, p = "start";
|
|
2988
|
+
else if (e.align === "end") d = m - gr, u = d - g, p = "end";
|
|
2954
2989
|
else {
|
|
2955
2990
|
let e = (m + h) / 2;
|
|
2956
2991
|
u = e - g / 2, d = e + g / 2, p = "middle";
|
|
@@ -2976,12 +3011,12 @@ var Jt = {
|
|
|
2976
3011
|
t.sort((e, t) => e.lo - t.lo);
|
|
2977
3012
|
let n = -Infinity;
|
|
2978
3013
|
for (let r of t) {
|
|
2979
|
-
if (r.lo < n +
|
|
3014
|
+
if (r.lo < n + _r) {
|
|
2980
3015
|
if (e.overlap === "hide") {
|
|
2981
3016
|
r.hidden = !0;
|
|
2982
3017
|
continue;
|
|
2983
3018
|
}
|
|
2984
|
-
let t = n +
|
|
3019
|
+
let t = n + _r - r.lo;
|
|
2985
3020
|
r.lo += t, r.hi += t, r.inside = !1, r.svgAnchor = "start";
|
|
2986
3021
|
}
|
|
2987
3022
|
if (r.hi > i) {
|
|
@@ -2998,10 +3033,10 @@ var Jt = {
|
|
|
2998
3033
|
t ? (r = i.cross, a = -((i.lo + i.hi) / 2), c = "middle") : (c = i.svgAnchor, r = c === "start" ? i.lo : c === "end" ? i.hi : (i.lo + i.hi) / 2, a = i.cross);
|
|
2999
3034
|
let l;
|
|
3000
3035
|
if (!o) l = e.color;
|
|
3001
|
-
else if (i.inside) l =
|
|
3036
|
+
else if (i.inside) l = Ot(i.bar.color);
|
|
3002
3037
|
else {
|
|
3003
|
-
let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r =
|
|
3004
|
-
l = r ?
|
|
3038
|
+
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);
|
|
3039
|
+
l = r ? Ot(r) : "currentColor";
|
|
3005
3040
|
}
|
|
3006
3041
|
s.push({
|
|
3007
3042
|
key: `${i.bar.categoryIndex}-${i.bar.seriesIndex}`,
|
|
@@ -3015,23 +3050,23 @@ var Jt = {
|
|
|
3015
3050
|
});
|
|
3016
3051
|
}
|
|
3017
3052
|
return s;
|
|
3018
|
-
}),
|
|
3053
|
+
}), rt = n(() => {
|
|
3019
3054
|
let e = H.value.left - 6;
|
|
3020
3055
|
switch (f.categoryAlign ?? "end") {
|
|
3021
3056
|
case "start": return {
|
|
3022
3057
|
anchor: "start",
|
|
3023
|
-
x:
|
|
3058
|
+
x: pr
|
|
3024
3059
|
};
|
|
3025
3060
|
case "center": return {
|
|
3026
3061
|
anchor: "middle",
|
|
3027
|
-
x: (
|
|
3062
|
+
x: (pr + e) / 2
|
|
3028
3063
|
};
|
|
3029
3064
|
default: return {
|
|
3030
3065
|
anchor: "end",
|
|
3031
3066
|
x: e
|
|
3032
3067
|
};
|
|
3033
3068
|
}
|
|
3034
|
-
}),
|
|
3069
|
+
}), it = n(() => {
|
|
3035
3070
|
let e = [], t = H.value.top - 7;
|
|
3036
3071
|
if (f.valueHeader && e.push({
|
|
3037
3072
|
key: "vh",
|
|
@@ -3040,7 +3075,7 @@ var Jt = {
|
|
|
3040
3075
|
y: t,
|
|
3041
3076
|
anchor: "start"
|
|
3042
3077
|
}), f.categoryHeader) {
|
|
3043
|
-
let n = !
|
|
3078
|
+
let n = !D.value, r = rt.value;
|
|
3044
3079
|
e.push({
|
|
3045
3080
|
key: "ch",
|
|
3046
3081
|
text: f.categoryHeader,
|
|
@@ -3052,65 +3087,65 @@ var Jt = {
|
|
|
3052
3087
|
return e;
|
|
3053
3088
|
});
|
|
3054
3089
|
return (n, l) => (_(), r(t, {
|
|
3055
|
-
to:
|
|
3056
|
-
disabled: !
|
|
3090
|
+
to: S(Ue),
|
|
3091
|
+
disabled: !S(Y)
|
|
3057
3092
|
}, [o("div", d({
|
|
3058
3093
|
ref_key: "containerRef",
|
|
3059
|
-
ref:
|
|
3094
|
+
ref: ke
|
|
3060
3095
|
}, n.$attrs, {
|
|
3061
|
-
class: ["bar-chart-wrapper", { "is-fullscreen":
|
|
3062
|
-
style:
|
|
3096
|
+
class: ["bar-chart-wrapper", { "is-fullscreen": S(Y) }],
|
|
3097
|
+
style: S(He)
|
|
3063
3098
|
}), [
|
|
3064
|
-
c.menu ? (_(), r(
|
|
3099
|
+
c.menu ? (_(), r(he, {
|
|
3065
3100
|
key: 0,
|
|
3066
|
-
items:
|
|
3067
|
-
"is-fullscreen":
|
|
3068
|
-
onClose:
|
|
3101
|
+
items: S(J),
|
|
3102
|
+
"is-fullscreen": S(Y),
|
|
3103
|
+
onClose: S(We)
|
|
3069
3104
|
}, null, 8, [
|
|
3070
3105
|
"items",
|
|
3071
3106
|
"is-fullscreen",
|
|
3072
3107
|
"onClose"
|
|
3073
3108
|
])) : i("", !0),
|
|
3074
|
-
o("div",
|
|
3109
|
+
o("div", zn, b(S(Y) ? "Chart expanded to fill window" : ""), 1),
|
|
3075
3110
|
(_(), a("svg", {
|
|
3076
3111
|
ref_key: "svgRef",
|
|
3077
3112
|
ref: Ae,
|
|
3078
|
-
width:
|
|
3079
|
-
height:
|
|
3113
|
+
width: S(je),
|
|
3114
|
+
height: S(Me),
|
|
3080
3115
|
role: g.value || void 0,
|
|
3081
3116
|
"aria-label": p.value || void 0
|
|
3082
3117
|
}, [
|
|
3083
3118
|
c.title ? (_(), a("text", {
|
|
3084
3119
|
key: 0,
|
|
3085
|
-
x:
|
|
3086
|
-
y:
|
|
3087
|
-
"text-anchor":
|
|
3088
|
-
"font-size":
|
|
3089
|
-
"font-weight":
|
|
3090
|
-
fill:
|
|
3091
|
-
}, [(_(!0), a(e, null, y(
|
|
3120
|
+
x: Z.value.x,
|
|
3121
|
+
y: Z.value.lineHeight,
|
|
3122
|
+
"text-anchor": Z.value.anchor,
|
|
3123
|
+
"font-size": Z.value.fontSize,
|
|
3124
|
+
"font-weight": Z.value.fontWeight,
|
|
3125
|
+
fill: Z.value.color
|
|
3126
|
+
}, [(_(!0), a(e, null, y(Z.value.lines, (e, t) => (_(), a("tspan", {
|
|
3092
3127
|
key: t,
|
|
3093
|
-
x:
|
|
3094
|
-
dy: t === 0 ? 0 :
|
|
3095
|
-
}, b(e), 9,
|
|
3096
|
-
(_(!0), a(e, null, y(
|
|
3128
|
+
x: Z.value.x,
|
|
3129
|
+
dy: t === 0 ? 0 : Z.value.lineHeight
|
|
3130
|
+
}, b(e), 9, Hn))), 128))], 8, Vn)) : i("", !0),
|
|
3131
|
+
(_(!0), a(e, null, y(it.value, (e) => (_(), a("text", {
|
|
3097
3132
|
key: e.key,
|
|
3098
3133
|
"data-testid": e.key === "ch" ? "category-header" : "value-header",
|
|
3099
3134
|
x: e.x,
|
|
3100
3135
|
y: e.y,
|
|
3101
3136
|
"text-anchor": e.anchor,
|
|
3102
|
-
"font-size":
|
|
3103
|
-
fill:
|
|
3137
|
+
"font-size": Ge.value.fontSize,
|
|
3138
|
+
fill: Ge.value.fill,
|
|
3104
3139
|
"font-weight": "600"
|
|
3105
|
-
}, b(e.text), 9,
|
|
3106
|
-
|
|
3140
|
+
}, b(e.text), 9, Un))), 128)),
|
|
3141
|
+
Qe.value.length > 0 ? (_(), a("g", Wn, [(_(!0), a(e, null, y(Qe.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.kind === "bar" ? (_(), a("rect", {
|
|
3107
3142
|
key: 0,
|
|
3108
3143
|
x: t.x,
|
|
3109
3144
|
y: t.y - 5,
|
|
3110
3145
|
width: "12",
|
|
3111
3146
|
height: "10",
|
|
3112
3147
|
fill: t.color
|
|
3113
|
-
}, null, 8,
|
|
3148
|
+
}, null, 8, Gn)) : (_(), a("line", {
|
|
3114
3149
|
key: 1,
|
|
3115
3150
|
x1: t.x,
|
|
3116
3151
|
y1: t.y,
|
|
@@ -3119,114 +3154,114 @@ var Jt = {
|
|
|
3119
3154
|
stroke: t.color,
|
|
3120
3155
|
"stroke-width": "2",
|
|
3121
3156
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
3122
|
-
}, null, 8,
|
|
3157
|
+
}, null, 8, Kn)), o("text", {
|
|
3123
3158
|
x: t.x + 18,
|
|
3124
3159
|
y: t.y + 4,
|
|
3125
|
-
"font-size":
|
|
3126
|
-
fill:
|
|
3127
|
-
"font-weight":
|
|
3128
|
-
}, b(t.label), 9,
|
|
3129
|
-
!
|
|
3160
|
+
"font-size": Ke.value.fontSize,
|
|
3161
|
+
fill: Ke.value.fill,
|
|
3162
|
+
"font-weight": Ke.value.fontWeight
|
|
3163
|
+
}, b(t.label), 9, qn)], 64))), 128))])) : i("", !0),
|
|
3164
|
+
!D.value || c.valueAxis ? (_(), a("line", {
|
|
3130
3165
|
key: 2,
|
|
3131
|
-
x1:
|
|
3132
|
-
y1:
|
|
3133
|
-
x2:
|
|
3134
|
-
y2:
|
|
3166
|
+
x1: S(R)(S(H).left),
|
|
3167
|
+
y1: S(R)(S(H).top),
|
|
3168
|
+
x2: S(R)(S(H).left),
|
|
3169
|
+
y2: S(R)(S(H).top + S(G)),
|
|
3135
3170
|
stroke: "currentColor",
|
|
3136
3171
|
"stroke-opacity": "0.3"
|
|
3137
|
-
}, null, 8,
|
|
3138
|
-
|
|
3172
|
+
}, null, 8, Jn)) : i("", !0),
|
|
3173
|
+
D.value || c.valueAxis ? (_(), a("line", {
|
|
3139
3174
|
key: 3,
|
|
3140
|
-
x1:
|
|
3141
|
-
y1:
|
|
3142
|
-
x2:
|
|
3143
|
-
y2:
|
|
3175
|
+
x1: S(R)(S(H).left),
|
|
3176
|
+
y1: S(R)(S(H).top + S(G)),
|
|
3177
|
+
x2: S(R)(S(H).left + S(W)),
|
|
3178
|
+
y2: S(R)(S(H).top + S(G)),
|
|
3144
3179
|
stroke: "currentColor",
|
|
3145
3180
|
"stroke-opacity": "0.3"
|
|
3146
|
-
}, null, 8,
|
|
3147
|
-
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(
|
|
3181
|
+
}, null, 8, Yn)) : i("", !0),
|
|
3182
|
+
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(L.value, (e, t) => (_(), a("line", {
|
|
3148
3183
|
key: "vg" + t,
|
|
3149
|
-
x1:
|
|
3150
|
-
y1:
|
|
3151
|
-
x2:
|
|
3152
|
-
y2:
|
|
3184
|
+
x1: D.value ? S(H).left : e.pos,
|
|
3185
|
+
y1: D.value ? e.pos : S(H).top,
|
|
3186
|
+
x2: D.value ? S(H).left + S(W) : e.pos,
|
|
3187
|
+
y2: D.value ? e.pos : S(H).top + S(G),
|
|
3153
3188
|
stroke: "currentColor",
|
|
3154
3189
|
"stroke-opacity": "0.1"
|
|
3155
|
-
}, null, 8,
|
|
3156
|
-
|
|
3190
|
+
}, null, 8, Xn))), 128)) : i("", !0),
|
|
3191
|
+
Ze.value && V.value ? (_(), a("rect", {
|
|
3157
3192
|
key: 5,
|
|
3158
|
-
x:
|
|
3159
|
-
y:
|
|
3160
|
-
width:
|
|
3161
|
-
height:
|
|
3193
|
+
x: Ze.value.x,
|
|
3194
|
+
y: Ze.value.y,
|
|
3195
|
+
width: Ze.value.w,
|
|
3196
|
+
height: Ze.value.h,
|
|
3162
3197
|
fill: "currentColor",
|
|
3163
3198
|
"fill-opacity": "0.06",
|
|
3164
3199
|
"pointer-events": "none"
|
|
3165
|
-
}, null, 8,
|
|
3166
|
-
c.valueAxis &&
|
|
3200
|
+
}, null, 8, Zn)) : i("", !0),
|
|
3201
|
+
c.valueAxis && D.value ? (_(!0), a(e, { key: 6 }, y(L.value, (e, t) => (_(), a("text", {
|
|
3167
3202
|
key: "vt" + t,
|
|
3168
3203
|
"data-testid": "value-tick",
|
|
3169
|
-
x:
|
|
3204
|
+
x: S(H).left - 6,
|
|
3170
3205
|
y: e.pos,
|
|
3171
3206
|
"text-anchor": "end",
|
|
3172
3207
|
"dominant-baseline": "middle",
|
|
3173
|
-
"font-size":
|
|
3174
|
-
fill:
|
|
3175
|
-
"font-weight":
|
|
3176
|
-
"fill-opacity":
|
|
3177
|
-
}, b(e.value), 9,
|
|
3208
|
+
"font-size": X.value.fontSize,
|
|
3209
|
+
fill: X.value.fill,
|
|
3210
|
+
"font-weight": X.value.fontWeight,
|
|
3211
|
+
"fill-opacity": X.value.fillOpacity
|
|
3212
|
+
}, b(e.value), 9, Qn))), 128)) : c.valueAxis ? (_(!0), a(e, { key: 7 }, y(L.value, (e, t) => (_(), a("text", {
|
|
3178
3213
|
key: "vt" + t,
|
|
3179
3214
|
"data-testid": "value-tick",
|
|
3180
3215
|
x: e.pos,
|
|
3181
|
-
y:
|
|
3216
|
+
y: S(H).top + S(G) + 16,
|
|
3182
3217
|
"text-anchor": "middle",
|
|
3183
|
-
"font-size":
|
|
3184
|
-
fill:
|
|
3185
|
-
"font-weight":
|
|
3186
|
-
"fill-opacity":
|
|
3187
|
-
}, b(e.value), 9,
|
|
3218
|
+
"font-size": X.value.fontSize,
|
|
3219
|
+
fill: X.value.fill,
|
|
3220
|
+
"font-weight": X.value.fontWeight,
|
|
3221
|
+
"fill-opacity": X.value.fillOpacity
|
|
3222
|
+
}, b(e.value), 9, $n))), 128)) : i("", !0),
|
|
3188
3223
|
c.yLabel ? (_(), a("text", {
|
|
3189
3224
|
key: 8,
|
|
3190
3225
|
x: 0,
|
|
3191
3226
|
y: 0,
|
|
3192
|
-
transform: `translate(14, ${
|
|
3227
|
+
transform: `translate(14, ${S(H).top + S(G) / 2}) rotate(-90)`,
|
|
3193
3228
|
"text-anchor": "middle",
|
|
3194
|
-
"font-size":
|
|
3195
|
-
fill:
|
|
3196
|
-
"font-weight":
|
|
3197
|
-
}, b(c.yLabel), 9,
|
|
3198
|
-
|
|
3229
|
+
"font-size": Ge.value.fontSize,
|
|
3230
|
+
fill: Ge.value.fill,
|
|
3231
|
+
"font-weight": Ge.value.fontWeight
|
|
3232
|
+
}, b(c.yLabel), 9, er)) : i("", !0),
|
|
3233
|
+
D.value ? (_(!0), a(e, { key: 9 }, y(ge.value, (e, t) => (_(), a("text", {
|
|
3199
3234
|
key: "ct" + t,
|
|
3200
3235
|
"data-testid": "category-tick",
|
|
3201
3236
|
x: e.pos,
|
|
3202
|
-
y:
|
|
3237
|
+
y: S(H).top + S(G) + 16,
|
|
3203
3238
|
"text-anchor": e.anchor,
|
|
3204
|
-
"font-size":
|
|
3205
|
-
fill:
|
|
3206
|
-
"font-weight":
|
|
3207
|
-
"fill-opacity":
|
|
3208
|
-
}, b(e.label), 9,
|
|
3239
|
+
"font-size": X.value.fontSize,
|
|
3240
|
+
fill: X.value.fill,
|
|
3241
|
+
"font-weight": X.value.fontWeight,
|
|
3242
|
+
"fill-opacity": X.value.fillOpacity
|
|
3243
|
+
}, b(e.label), 9, tr))), 128)) : (_(!0), a(e, { key: 10 }, y(ge.value, (e, t) => (_(), a("text", {
|
|
3209
3244
|
key: "ct" + t,
|
|
3210
3245
|
"data-testid": "category-tick",
|
|
3211
|
-
x:
|
|
3246
|
+
x: rt.value.x,
|
|
3212
3247
|
y: e.pos,
|
|
3213
|
-
"text-anchor":
|
|
3248
|
+
"text-anchor": rt.value.anchor,
|
|
3214
3249
|
"dominant-baseline": "middle",
|
|
3215
|
-
"font-size":
|
|
3216
|
-
fill:
|
|
3217
|
-
"font-weight":
|
|
3218
|
-
"fill-opacity":
|
|
3219
|
-
}, b(e.label), 9,
|
|
3250
|
+
"font-size": X.value.fontSize,
|
|
3251
|
+
fill: X.value.fill,
|
|
3252
|
+
"font-weight": X.value.fontWeight,
|
|
3253
|
+
"fill-opacity": X.value.fillOpacity
|
|
3254
|
+
}, b(e.label), 9, nr))), 128)),
|
|
3220
3255
|
c.xLabel ? (_(), a("text", {
|
|
3221
3256
|
key: 11,
|
|
3222
|
-
x:
|
|
3223
|
-
y:
|
|
3257
|
+
x: S(H).left + S(W) / 2,
|
|
3258
|
+
y: S(Me) - 4,
|
|
3224
3259
|
"text-anchor": "middle",
|
|
3225
|
-
"font-size":
|
|
3226
|
-
fill:
|
|
3227
|
-
"font-weight":
|
|
3228
|
-
}, b(c.xLabel), 9,
|
|
3229
|
-
(_(!0), a(e, null, y(
|
|
3260
|
+
"font-size": Ge.value.fontSize,
|
|
3261
|
+
fill: Ge.value.fill,
|
|
3262
|
+
"font-weight": Ge.value.fontWeight
|
|
3263
|
+
}, b(c.xLabel), 9, rr)) : i("", !0),
|
|
3264
|
+
(_(!0), a(e, null, y(P.value, (e, t) => (_(), a("rect", {
|
|
3230
3265
|
key: "bar" + t,
|
|
3231
3266
|
"data-testid": "bar",
|
|
3232
3267
|
"data-category": e.categoryIndex,
|
|
@@ -3238,8 +3273,8 @@ var Jt = {
|
|
|
3238
3273
|
fill: e.color,
|
|
3239
3274
|
"fill-opacity": e.opacity,
|
|
3240
3275
|
style: h(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
3241
|
-
}, null, 12,
|
|
3242
|
-
(_(!0), a(e, null, y(
|
|
3276
|
+
}, null, 12, ir))), 128)),
|
|
3277
|
+
(_(!0), a(e, null, y(nt.value, (e) => (_(), a("text", {
|
|
3243
3278
|
key: "blbl" + e.key,
|
|
3244
3279
|
"data-testid": "bar-label",
|
|
3245
3280
|
x: e.x,
|
|
@@ -3250,8 +3285,8 @@ var Jt = {
|
|
|
3250
3285
|
"font-weight": e.fontWeight,
|
|
3251
3286
|
fill: e.fill,
|
|
3252
3287
|
"pointer-events": "none"
|
|
3253
|
-
}, b(e.text), 9,
|
|
3254
|
-
(_(!0), a(e, null, y(
|
|
3288
|
+
}, b(e.text), 9, ar))), 128)),
|
|
3289
|
+
(_(!0), a(e, null, y(F.value, (t, n) => (_(), a(e, { key: "sl" + n }, [t.pathD ? (_(), a("path", {
|
|
3255
3290
|
key: 0,
|
|
3256
3291
|
"data-testid": "summary-line",
|
|
3257
3292
|
d: t.pathD,
|
|
@@ -3263,7 +3298,7 @@ var Jt = {
|
|
|
3263
3298
|
"stroke-linecap": "round",
|
|
3264
3299
|
"stroke-linejoin": "round",
|
|
3265
3300
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3266
|
-
}, null, 12,
|
|
3301
|
+
}, null, 12, or)) : i("", !0), t.dots ? (_(!0), a(e, { key: 1 }, y(t.points, (e, r) => (_(), a("circle", {
|
|
3267
3302
|
key: "sld" + n + "-" + r,
|
|
3268
3303
|
cx: e.x,
|
|
3269
3304
|
cy: e.y,
|
|
@@ -3271,58 +3306,58 @@ var Jt = {
|
|
|
3271
3306
|
fill: t.color,
|
|
3272
3307
|
"fill-opacity": t.opacity,
|
|
3273
3308
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3274
|
-
}, null, 12,
|
|
3275
|
-
|
|
3309
|
+
}, null, 12, sr))), 128)) : i("", !0)], 64))), 128)),
|
|
3310
|
+
V.value ? (_(), a("rect", d({
|
|
3276
3311
|
key: 12,
|
|
3277
|
-
x:
|
|
3278
|
-
y:
|
|
3279
|
-
width:
|
|
3280
|
-
height:
|
|
3312
|
+
x: S(H).left,
|
|
3313
|
+
y: S(H).top,
|
|
3314
|
+
width: S(W),
|
|
3315
|
+
height: S(G),
|
|
3281
3316
|
fill: "transparent",
|
|
3282
|
-
style: `cursor: crosshair; touch-action: ${
|
|
3283
|
-
}, ne(
|
|
3284
|
-
c.annotations && c.annotations.length > 0 ? (_(), r(
|
|
3317
|
+
style: `cursor: crosshair; touch-action: ${D.value ? "pan-y" : "pan-x"}`
|
|
3318
|
+
}, ne(S(Ie), !0)), null, 16, cr)) : i("", !0),
|
|
3319
|
+
c.annotations && c.annotations.length > 0 ? (_(), r(S(vt), {
|
|
3285
3320
|
key: 13,
|
|
3286
3321
|
annotations: c.annotations,
|
|
3287
|
-
project:
|
|
3288
|
-
bounds:
|
|
3322
|
+
project: Te,
|
|
3323
|
+
bounds: S(Pe)
|
|
3289
3324
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
3290
|
-
], 8,
|
|
3291
|
-
|
|
3325
|
+
], 8, Bn)),
|
|
3326
|
+
V.value && S(K) !== null && Ye.value ? (_(), a("div", {
|
|
3292
3327
|
key: 1,
|
|
3293
3328
|
ref_key: "tooltipRef",
|
|
3294
|
-
ref:
|
|
3329
|
+
ref: q,
|
|
3295
3330
|
class: "chart-tooltip-content",
|
|
3296
3331
|
style: h({
|
|
3297
3332
|
position: "absolute",
|
|
3298
3333
|
top: "0",
|
|
3299
3334
|
left: "0",
|
|
3300
3335
|
willChange: "transform",
|
|
3301
|
-
transform:
|
|
3302
|
-
visibility:
|
|
3336
|
+
transform: S(Fe) ? `translate3d(${S(Fe).left}px, ${S(Fe).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
3337
|
+
visibility: S(Fe) ? "visible" : "hidden"
|
|
3303
3338
|
})
|
|
3304
|
-
}, [te(n.$slots, "tooltip", m(u(
|
|
3339
|
+
}, [te(n.$slots, "tooltip", m(u(Ye.value)), () => [o("div", lr, [Je.value ? (_(), a("div", ur, b(Je.value), 1)) : i("", !0), (_(!0), a(e, null, y(Ye.value.values, (e) => (_(), a("div", {
|
|
3305
3340
|
key: e.seriesIndex,
|
|
3306
3341
|
class: "bar-chart-tooltip-row"
|
|
3307
3342
|
}, [o("span", {
|
|
3308
3343
|
class: "bar-chart-tooltip-swatch",
|
|
3309
3344
|
style: h({ background: e.color })
|
|
3310
|
-
}, null, 4), s(" " + b(isFinite(e.value) ?
|
|
3311
|
-
|
|
3345
|
+
}, null, 4), s(" " + b(isFinite(e.value) ? S(me)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
3346
|
+
S(Le) ? (_(), a("a", {
|
|
3312
3347
|
key: 2,
|
|
3313
3348
|
class: "bar-chart-download-link",
|
|
3314
|
-
href:
|
|
3315
|
-
download: `${
|
|
3316
|
-
}, b(
|
|
3317
|
-
|
|
3349
|
+
href: S(Re),
|
|
3350
|
+
download: `${S(Ve)()}.csv`
|
|
3351
|
+
}, b(S(Le)), 9, dr)) : i("", !0),
|
|
3352
|
+
S(ze) ? (_(), a("button", {
|
|
3318
3353
|
key: 3,
|
|
3319
3354
|
type: "button",
|
|
3320
3355
|
class: "bar-chart-download-button",
|
|
3321
|
-
onClick: l[0] ||= (...e) =>
|
|
3322
|
-
}, b(
|
|
3356
|
+
onClick: l[0] ||= (...e) => S(Be) && S(Be)(...e)
|
|
3357
|
+
}, b(S(ze)), 1)) : i("", !0)
|
|
3323
3358
|
], 16)], 8, ["to", "disabled"]));
|
|
3324
3359
|
}
|
|
3325
|
-
}), [["__scopeId", "data-v-251f7945"]]),
|
|
3360
|
+
}), [["__scopeId", "data-v-251f7945"]]), yr = {
|
|
3326
3361
|
ref: "root",
|
|
3327
3362
|
class: "chart-tooltip-content",
|
|
3328
3363
|
style: {
|
|
@@ -3334,10 +3369,10 @@ var Jt = {
|
|
|
3334
3369
|
"pointer-events": "none",
|
|
3335
3370
|
transform: "translateY(-50%)"
|
|
3336
3371
|
}
|
|
3337
|
-
},
|
|
3372
|
+
}, br = /* @__PURE__ */ l({
|
|
3338
3373
|
__name: "ChoroplethTooltip",
|
|
3339
3374
|
setup(e, { expose: n }) {
|
|
3340
|
-
let a = v(null), s =
|
|
3375
|
+
let a = v(null), s = w("root");
|
|
3341
3376
|
return n({
|
|
3342
3377
|
setData(e) {
|
|
3343
3378
|
a.value = e;
|
|
@@ -3345,24 +3380,24 @@ var Jt = {
|
|
|
3345
3380
|
getEl() {
|
|
3346
3381
|
return s.value;
|
|
3347
3382
|
}
|
|
3348
|
-
}), (e, n) => (_(), r(t, { to: "body" }, [o("div",
|
|
3383
|
+
}), (e, n) => (_(), r(t, { to: "body" }, [o("div", yr, [a.value ? te(e.$slots, "default", m(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
|
|
3349
3384
|
}
|
|
3350
|
-
}),
|
|
3385
|
+
}), xr = ["role", "aria-label"], Sr = {
|
|
3351
3386
|
class: "chart-sr-only",
|
|
3352
3387
|
"aria-live": "polite"
|
|
3353
|
-
},
|
|
3388
|
+
}, Cr = {
|
|
3354
3389
|
key: 1,
|
|
3355
3390
|
class: "choropleth-header"
|
|
3356
|
-
},
|
|
3391
|
+
}, wr = {
|
|
3357
3392
|
key: 0,
|
|
3358
3393
|
class: "choropleth-legend-title"
|
|
3359
|
-
},
|
|
3394
|
+
}, Tr = {
|
|
3360
3395
|
key: 2,
|
|
3361
3396
|
class: "choropleth-legend-continuous"
|
|
3362
|
-
},
|
|
3397
|
+
}, Er = { class: "choropleth-legend-ticks" }, Dr = {
|
|
3363
3398
|
key: 2,
|
|
3364
3399
|
class: "choropleth-zoom-hint"
|
|
3365
|
-
},
|
|
3400
|
+
}, Or = ["viewBox"], kr = ["innerHTML"], Ar = "http://www.w3.org/2000/svg", jr = 10, Mr = 600, Nr = 250, Pr = 30, Fr = 450, Ir = 2, Lr = 2, Rr = 1e3, zr = 12, Br = "light-dark(#000, #fff)", Vr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3366
3401
|
inheritAttrs: !1,
|
|
3367
3402
|
__name: "ChoroplethMap",
|
|
3368
3403
|
props: {
|
|
@@ -3422,10 +3457,10 @@ var Jt = {
|
|
|
3422
3457
|
"update:focus"
|
|
3423
3458
|
],
|
|
3424
3459
|
setup(c, { emit: l }) {
|
|
3425
|
-
let p = c, ne = n(() => p.ariaLabel ?? p.title),
|
|
3460
|
+
let p = c, ne = n(() => p.ariaLabel ?? p.title), w = n(() => p.role ?? (ne.value ? "figure" : void 0)), D = l, O = (e) => e, ie = v(null), k = v(null), A = v(null), j = v(null), ae = v(null), M = v(null), oe = C(), I = n(() => !!p.tooltipTrigger || !!p.tooltipFormat || !!oe.tooltip), me = n(() => {
|
|
3426
3461
|
let e = p.legendStyle, t = {};
|
|
3427
3462
|
return e?.fontSize != null && (t["font-size"] = `${e.fontSize}px`), e?.fontWeight != null && (t["font-weight"] = String(e.fontWeight)), e?.color != null && (t.color = e.color), t;
|
|
3428
|
-
}),
|
|
3463
|
+
}), L = n(() => {
|
|
3429
3464
|
let e = p.titleStyle, t = {
|
|
3430
3465
|
"font-size": `${e?.fontSize ?? 14}px`,
|
|
3431
3466
|
"line-height": `${e?.lineHeight ?? 18}px`,
|
|
@@ -3434,71 +3469,71 @@ var Jt = {
|
|
|
3434
3469
|
width: "100%"
|
|
3435
3470
|
};
|
|
3436
3471
|
return e?.color && (t.color = e.color), t;
|
|
3437
|
-
}),
|
|
3472
|
+
}), R = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(), _e = null, z = null, B = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ye = !1, be = null, xe = {
|
|
3438
3473
|
width: 0,
|
|
3439
3474
|
height: 0
|
|
3440
|
-
},
|
|
3441
|
-
function Fe() {
|
|
3442
|
-
let e = O.value, t = k.value;
|
|
3443
|
-
!e || !t || (e.addEventListener("touchstart", en, { passive: !0 }), e.addEventListener("touchend", tn), e.addEventListener("touchcancel", nn, { passive: !0 }), !q() && (t.addEventListener("click", Zt), t.addEventListener("mouseover", Zt), t.addEventListener("mousemove", Qt), t.addEventListener("mouseout", $t)));
|
|
3444
|
-
}
|
|
3475
|
+
}, Se = null, Ce = !1, V = null, we = v(!1), Te = v(1), Ee = v(1), De = v(!1), Oe = n(() => p.zoomMode === "scroll"), ke = n(() => p.zoom && (Oe.value || !p.touchExpand && De.value)), Ae = 0, je = 0, Me = 0, Ne = null, U = 0, W = null;
|
|
3445
3476
|
function G() {
|
|
3446
|
-
let e =
|
|
3447
|
-
e
|
|
3477
|
+
let e = k.value, t = A.value;
|
|
3478
|
+
!e || !t || (e.addEventListener("touchstart", $t, { passive: !0 }), e.addEventListener("touchend", en), e.addEventListener("touchcancel", nn, { passive: !0 }), !J() && (t.addEventListener("click", Xt), t.addEventListener("mouseover", Xt), t.addEventListener("mousemove", Zt), t.addEventListener("mouseout", Qt)));
|
|
3448
3479
|
}
|
|
3449
|
-
function
|
|
3480
|
+
function Pe() {
|
|
3481
|
+
let e = k.value, t = A.value;
|
|
3482
|
+
e && (e.removeEventListener("touchstart", $t), e.removeEventListener("touchend", en), e.removeEventListener("touchcancel", nn)), t && (t.removeEventListener("click", Xt), t.removeEventListener("mouseover", Xt), t.removeEventListener("mousemove", Zt), t.removeEventListener("mouseout", Qt));
|
|
3483
|
+
}
|
|
3484
|
+
function K() {
|
|
3450
3485
|
Jt();
|
|
3451
3486
|
}
|
|
3452
|
-
let
|
|
3487
|
+
let Ie = null;
|
|
3453
3488
|
g(() => {
|
|
3454
|
-
|
|
3489
|
+
Le(), G(), an(), Y(), It(), k.value && typeof ResizeObserver < "u" && (Ie = new ResizeObserver((e) => {
|
|
3455
3490
|
let t = e[0]?.contentRect.width;
|
|
3456
|
-
t && (
|
|
3457
|
-
}),
|
|
3491
|
+
t && (Ee.value = t / Rr, Wt());
|
|
3492
|
+
}), Ie.observe(k.value)), window.addEventListener("scroll", K, {
|
|
3458
3493
|
passive: !0,
|
|
3459
3494
|
capture: !0
|
|
3460
|
-
}), window.addEventListener("resize",
|
|
3495
|
+
}), window.addEventListener("resize", K, { passive: !0 });
|
|
3461
3496
|
}), ee(() => {
|
|
3462
|
-
|
|
3497
|
+
be?.disconnect(), Ie?.disconnect(), Me && cancelAnimationFrame(Me), window.clearTimeout(U), Re(), Pe(), window.removeEventListener("scroll", K, { capture: !0 }), window.removeEventListener("resize", K);
|
|
3463
3498
|
});
|
|
3464
|
-
function
|
|
3465
|
-
if (!
|
|
3466
|
-
let e =
|
|
3467
|
-
|
|
3468
|
-
|
|
3499
|
+
function Le() {
|
|
3500
|
+
if (!k.value || !A.value) return;
|
|
3501
|
+
let e = F(k.value);
|
|
3502
|
+
V = ce().scaleExtent([1, We.value]).clickDistance(6).on("start", () => {
|
|
3503
|
+
ye = !0;
|
|
3469
3504
|
}).on("zoom", (e) => {
|
|
3470
|
-
|
|
3505
|
+
Jt(), A.value && A.value.setAttribute("transform", e.transform);
|
|
3471
3506
|
let t = e.transform;
|
|
3472
|
-
|
|
3507
|
+
Te.value = t.k, Wt(), we.value = t.k !== 1 || t.x !== 0 || t.y !== 0, we.value && (De.value = !0);
|
|
3473
3508
|
}).on("end", () => {
|
|
3474
|
-
|
|
3475
|
-
}),
|
|
3509
|
+
ye = !1;
|
|
3510
|
+
}), V.filter((e) => {
|
|
3476
3511
|
if (!p.zoom) return !1;
|
|
3477
|
-
if (!
|
|
3512
|
+
if (!Oe.value) {
|
|
3478
3513
|
let t = $.isFullscreen.value;
|
|
3479
3514
|
switch (e.type) {
|
|
3480
3515
|
case "wheel":
|
|
3481
3516
|
if (!t) return !1;
|
|
3482
3517
|
break;
|
|
3483
3518
|
case "dblclick":
|
|
3484
|
-
if (
|
|
3519
|
+
if (J()) return !1;
|
|
3485
3520
|
break;
|
|
3486
3521
|
case "mousedown":
|
|
3487
|
-
if (!t && !
|
|
3522
|
+
if (!t && !De.value) return !1;
|
|
3488
3523
|
break;
|
|
3489
3524
|
case "touchstart":
|
|
3490
|
-
if (!t && !
|
|
3525
|
+
if (!t && !ke.value && !(!p.touchExpand && p.zoomMode !== "scroll" && e.touches.length >= 2)) return !1;
|
|
3491
3526
|
break;
|
|
3492
3527
|
}
|
|
3493
3528
|
}
|
|
3494
3529
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
3495
|
-
}), e.call(
|
|
3530
|
+
}), e.call(V);
|
|
3496
3531
|
}
|
|
3497
|
-
function
|
|
3498
|
-
|
|
3532
|
+
function Re() {
|
|
3533
|
+
k.value && V && (F(k.value).on(".zoom", null), V = null);
|
|
3499
3534
|
}
|
|
3500
|
-
function
|
|
3501
|
-
let t =
|
|
3535
|
+
function ze(e) {
|
|
3536
|
+
let t = bt.value, n = gt.value, r = [];
|
|
3502
3537
|
for (let i of e) {
|
|
3503
3538
|
let e = i.geoType ?? p.geoType, a = t.get(e);
|
|
3504
3539
|
if (!a) continue;
|
|
@@ -3516,87 +3551,87 @@ var Jt = {
|
|
|
3516
3551
|
}
|
|
3517
3552
|
return r;
|
|
3518
3553
|
}
|
|
3519
|
-
function
|
|
3554
|
+
function Be(e) {
|
|
3520
3555
|
let t = /* @__PURE__ */ new Set();
|
|
3521
|
-
for (let n of
|
|
3556
|
+
for (let n of ze(e)) n.geoType === p.geoType && t.add(String(n.feature.id));
|
|
3522
3557
|
return t;
|
|
3523
3558
|
}
|
|
3524
|
-
let
|
|
3525
|
-
function
|
|
3526
|
-
if (!
|
|
3527
|
-
let e =
|
|
3559
|
+
let Ve = !1;
|
|
3560
|
+
function Y() {
|
|
3561
|
+
if (!k.value || !V) return;
|
|
3562
|
+
let e = ze(yt.value), t = e.filter((e) => e.geoType === p.geoType), n = e.filter((e) => e.geoType !== p.geoType), r = /* @__PURE__ */ new Map();
|
|
3528
3563
|
for (let e of t) {
|
|
3529
|
-
let t =
|
|
3564
|
+
let t = R.get(String(e.feature.id));
|
|
3530
3565
|
t && r.set(t, e.item);
|
|
3531
3566
|
}
|
|
3532
|
-
for (let [e] of
|
|
3567
|
+
for (let [e] of B) r.has(e) || e === z || Kt(e);
|
|
3533
3568
|
for (let [e, t] of r) {
|
|
3534
|
-
let n =
|
|
3535
|
-
n != null && n.style === t.style && n.stroke === t.stroke && n.strokeWidth === t.strokeWidth && e !==
|
|
3569
|
+
let n = B.get(e);
|
|
3570
|
+
n != null && n.style === t.style && n.stroke === t.stroke && n.strokeWidth === t.strokeWidth && e !== z || e !== z && Gt(e, t);
|
|
3536
3571
|
}
|
|
3537
|
-
|
|
3538
|
-
for (let [e, t] of r)
|
|
3539
|
-
if (
|
|
3540
|
-
|
|
3572
|
+
B.clear();
|
|
3573
|
+
for (let [e, t] of r) B.set(e, t);
|
|
3574
|
+
if (He(n), e.length === 0) {
|
|
3575
|
+
Ve = !0, Jt();
|
|
3541
3576
|
return;
|
|
3542
3577
|
}
|
|
3543
3578
|
if (p.focusZoom === !1) {
|
|
3544
|
-
|
|
3579
|
+
Ve = !0;
|
|
3545
3580
|
return;
|
|
3546
3581
|
}
|
|
3547
|
-
let i =
|
|
3582
|
+
let i = F(k.value);
|
|
3548
3583
|
i.interrupt();
|
|
3549
|
-
let a =
|
|
3550
|
-
|
|
3551
|
-
let [[o, s], [c, l]] =
|
|
3584
|
+
let a = Ve;
|
|
3585
|
+
Ve = !0;
|
|
3586
|
+
let [[o, s], [c, l]] = mt.value.bounds({
|
|
3552
3587
|
type: "FeatureCollection",
|
|
3553
3588
|
features: e.map((e) => e.feature)
|
|
3554
|
-
}), u = (o + c) / 2, d = (s + l) / 2, f = p.focusZoomLevel, m =
|
|
3555
|
-
if (!
|
|
3556
|
-
let e = String(h.id), t =
|
|
3589
|
+
}), u = (o + c) / 2, d = (s + l) / 2, f = p.focusZoomLevel, m = le.translate(nt.value / 2 - f * u, rt.value / 2 - f * d).scale(f), h = t[0]?.feature ?? null, g = () => {
|
|
3590
|
+
if (!I.value || !h) return;
|
|
3591
|
+
let e = String(h.id), t = R.get(e);
|
|
3557
3592
|
if (!t) return;
|
|
3558
3593
|
let n = t.getBoundingClientRect();
|
|
3559
|
-
|
|
3594
|
+
Rt(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
3560
3595
|
};
|
|
3561
|
-
a ? (
|
|
3596
|
+
a ? (Bt(), i.transition().duration(Fr).call(V.transform, m).on("end", g)) : (V.transform(i, m), g());
|
|
3562
3597
|
}
|
|
3563
|
-
function
|
|
3564
|
-
let t =
|
|
3598
|
+
function He(e) {
|
|
3599
|
+
let t = ae.value;
|
|
3565
3600
|
if (!t) return;
|
|
3566
3601
|
let n = new Set(e.map((e) => e.key));
|
|
3567
|
-
for (let [e, t] of
|
|
3568
|
-
let r =
|
|
3602
|
+
for (let [e, t] of ve) n.has(e) || (t.el.remove(), ve.delete(e));
|
|
3603
|
+
let r = mt.value;
|
|
3569
3604
|
for (let { item: n, feature: i, key: a } of e) {
|
|
3570
|
-
let e =
|
|
3605
|
+
let e = ve.get(a);
|
|
3571
3606
|
if (!e) {
|
|
3572
|
-
let n = document.createElementNS(
|
|
3573
|
-
n.setAttribute("d", r(i) ?? ""), n.setAttribute("fill", "none"), n.setAttribute("pointer-events", "none"), n.setAttribute("stroke-linejoin", "round"), n.setAttribute("class", "focus-overlay"), t.appendChild(n), e = { el: n },
|
|
3607
|
+
let n = document.createElementNS(Ar, "path");
|
|
3608
|
+
n.setAttribute("d", r(i) ?? ""), n.setAttribute("fill", "none"), n.setAttribute("pointer-events", "none"), n.setAttribute("stroke-linejoin", "round"), n.setAttribute("class", "focus-overlay"), t.appendChild(n), e = { el: n }, ve.set(a, e);
|
|
3574
3609
|
}
|
|
3575
|
-
e.strokeWidth = n.strokeWidth, e.el.setAttribute("stroke", n.stroke ?? "#fff"),
|
|
3610
|
+
e.strokeWidth = n.strokeWidth, e.el.setAttribute("stroke", n.stroke ?? "#fff"), Vt(e.el, n.style);
|
|
3576
3611
|
}
|
|
3577
3612
|
Wt();
|
|
3578
3613
|
}
|
|
3579
|
-
function
|
|
3580
|
-
if (!
|
|
3581
|
-
|
|
3582
|
-
let e =
|
|
3583
|
-
e.interrupt(),
|
|
3584
|
-
let t =
|
|
3614
|
+
function Ue() {
|
|
3615
|
+
if (!k.value || !V) return;
|
|
3616
|
+
yt.value.length > 0 && D("update:focus", null);
|
|
3617
|
+
let e = F(k.value);
|
|
3618
|
+
e.interrupt(), Bt();
|
|
3619
|
+
let t = J() && !$.isFullscreen.value && !Oe.value, n = e.transition().duration(Fr).call(V.transform, le);
|
|
3585
3620
|
t && n.on("end", () => {
|
|
3586
|
-
|
|
3621
|
+
De.value = !1;
|
|
3587
3622
|
});
|
|
3588
3623
|
}
|
|
3589
|
-
let
|
|
3624
|
+
let We = n(() => Math.max(12, p.focusZoomLevel)), X = n(() => p.zoom && (J() ? $.isFullscreen.value || Oe.value || !p.touchExpand : !0)), Ke = n(() => p.zoom && !J() && (Oe.value || De.value || $.isFullscreen.value)), qe = n(() => p.zoom && p.zoomHint && !Oe.value && !$.isFullscreen.value && (J() && p.touchExpand || !De.value)), Z = n(() => J() ? "Double tap to zoom" : "Double click to zoom"), Ye = n(() => {
|
|
3590
3625
|
let e = {};
|
|
3591
|
-
return
|
|
3626
|
+
return $.isFullscreen.value || ke.value ? e["touch-action"] = "none" : p.zoom && !Oe.value && J() && (e["touch-action"] = p.touchExpand ? "manipulation" : "pan-x pan-y"), (De.value || $.isFullscreen.value || p.zoom && Oe.value) && (e["will-change"] = "transform"), Object.keys(e).length ? e : void 0;
|
|
3592
3627
|
});
|
|
3593
|
-
function
|
|
3594
|
-
if (!
|
|
3595
|
-
let t =
|
|
3596
|
-
t.interrupt(),
|
|
3628
|
+
function Xe(e) {
|
|
3629
|
+
if (!k.value || !V) return;
|
|
3630
|
+
let t = F(k.value);
|
|
3631
|
+
t.interrupt(), Bt(), t.transition().duration(250).call(V.scaleBy, e);
|
|
3597
3632
|
}
|
|
3598
|
-
function
|
|
3599
|
-
let n =
|
|
3633
|
+
function Ze(e, t) {
|
|
3634
|
+
let n = k.value, r = Lr, i = nt.value / 2, a = rt.value / 2, o = null;
|
|
3600
3635
|
try {
|
|
3601
3636
|
o = n.getScreenCTM();
|
|
3602
3637
|
} catch {
|
|
@@ -3604,66 +3639,66 @@ var Jt = {
|
|
|
3604
3639
|
}
|
|
3605
3640
|
if (o) {
|
|
3606
3641
|
let r = o.inverse(), s = r.a * e + r.c * t + r.e, c = r.b * e + r.d * t + r.f;
|
|
3607
|
-
[i, a] =
|
|
3642
|
+
[i, a] = ue(n).invert([s, c]);
|
|
3608
3643
|
}
|
|
3609
|
-
return
|
|
3644
|
+
return le.translate(nt.value / 2 - r * i, rt.value / 2 - r * a).scale(r);
|
|
3610
3645
|
}
|
|
3611
|
-
function
|
|
3612
|
-
if (!
|
|
3613
|
-
let t =
|
|
3614
|
-
t.interrupt(), t.transition().duration(
|
|
3646
|
+
function Qe(e) {
|
|
3647
|
+
if (!k.value || !V) return;
|
|
3648
|
+
let t = F(k.value);
|
|
3649
|
+
t.interrupt(), t.transition().duration(Fr).call(V.transform, e);
|
|
3615
3650
|
}
|
|
3616
|
-
function
|
|
3617
|
-
if (!
|
|
3618
|
-
let n =
|
|
3619
|
-
$.enter(), f(() =>
|
|
3651
|
+
function $e(e, t) {
|
|
3652
|
+
if (!k.value || !V) return;
|
|
3653
|
+
let n = Ze(e, t);
|
|
3654
|
+
$.enter(), f(() => Qe(n));
|
|
3620
3655
|
}
|
|
3621
|
-
function
|
|
3622
|
-
!
|
|
3656
|
+
function et(e, t) {
|
|
3657
|
+
!k.value || !V || Qe(Ze(e, t));
|
|
3623
3658
|
}
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
}),
|
|
3627
|
-
if (!
|
|
3628
|
-
let e =
|
|
3629
|
-
e.interrupt(),
|
|
3659
|
+
T(() => p.focusZoomLevel, () => {
|
|
3660
|
+
V && V.scaleExtent([1, We.value]), Y();
|
|
3661
|
+
}), T(() => p.state, () => {
|
|
3662
|
+
if (!k.value || !V) return;
|
|
3663
|
+
let e = F(k.value);
|
|
3664
|
+
e.interrupt(), V.transform(e, le);
|
|
3630
3665
|
});
|
|
3631
|
-
let
|
|
3632
|
-
let e =
|
|
3666
|
+
let tt = n(() => p.width && p.height ? p.height / p.width : .625), nt = n(() => Rr), rt = n(() => Rr * tt.value), it = n(() => {
|
|
3667
|
+
let e = x(p.topology), t = e?.objects?.states;
|
|
3633
3668
|
if (!t) return [];
|
|
3634
|
-
let n =
|
|
3669
|
+
let n = de(e, t);
|
|
3635
3670
|
return n.type === "FeatureCollection" ? n.features : [n];
|
|
3636
|
-
}),
|
|
3671
|
+
}), at = n(() => {
|
|
3637
3672
|
let e = p.state?.trim();
|
|
3638
3673
|
if (!e) return null;
|
|
3639
3674
|
if (/^\d{1,2}$/.test(e)) return e.padStart(2, "0");
|
|
3640
|
-
let t =
|
|
3675
|
+
let t = it.value.find((t) => t.properties?.name === e);
|
|
3641
3676
|
return t?.id == null ? null : String(t.id).padStart(2, "0");
|
|
3642
|
-
}),
|
|
3643
|
-
let e =
|
|
3644
|
-
return e ?
|
|
3677
|
+
}), ot = n(() => {
|
|
3678
|
+
let e = at.value;
|
|
3679
|
+
return e ? it.value.find((t) => String(t.id).padStart(2, "0") === e) ?? null : null;
|
|
3645
3680
|
});
|
|
3646
|
-
|
|
3681
|
+
T(() => [p.state, at.value], ([e, t]) => {
|
|
3647
3682
|
e && e.trim() && !t && console.warn(`[ChoroplethMap] state="${e}" matched no state name or FIPS code; rendering the full map.`);
|
|
3648
3683
|
}, { immediate: !0 });
|
|
3649
|
-
let
|
|
3650
|
-
function
|
|
3651
|
-
return
|
|
3684
|
+
let st = v(null), ct = null;
|
|
3685
|
+
function lt() {
|
|
3686
|
+
return ct ||= import("./hsaMapping-BahYDmea.js").then((e) => e.n).then((e) => (st.value = e, e)), ct;
|
|
3652
3687
|
}
|
|
3653
|
-
|
|
3688
|
+
T(() => {
|
|
3654
3689
|
if (p.geoType === "hsas" || p.dataGeoType === "hsas") return !0;
|
|
3655
3690
|
let e = p.focus;
|
|
3656
3691
|
return e ? (Array.isArray(e) ? e : [e]).some((e) => typeof e != "string" && e.geoType === "hsas") : !1;
|
|
3657
3692
|
}, (e) => {
|
|
3658
|
-
e &&
|
|
3693
|
+
e && lt();
|
|
3659
3694
|
}, { immediate: !0 });
|
|
3660
|
-
let
|
|
3661
|
-
let e =
|
|
3695
|
+
let ut = n(() => {
|
|
3696
|
+
let e = st.value;
|
|
3662
3697
|
if (!e) return {
|
|
3663
3698
|
type: "FeatureCollection",
|
|
3664
3699
|
features: []
|
|
3665
3700
|
};
|
|
3666
|
-
let { fipsToHsa: t, hsaNames: n } = e, r =
|
|
3701
|
+
let { fipsToHsa: t, hsaNames: n } = e, r = x(p.topology), i = r.objects.counties.geometries, a = at.value, o = /* @__PURE__ */ new Map();
|
|
3667
3702
|
for (let e of i) {
|
|
3668
3703
|
let n = String(e.id).padStart(5, "0");
|
|
3669
3704
|
if (a && n.slice(0, 2) !== a) continue;
|
|
@@ -3675,65 +3710,65 @@ var Jt = {
|
|
|
3675
3710
|
type: "Feature",
|
|
3676
3711
|
id: e,
|
|
3677
3712
|
properties: { name: n[e] ?? e },
|
|
3678
|
-
geometry:
|
|
3713
|
+
geometry: fe(r, t)
|
|
3679
3714
|
});
|
|
3680
3715
|
return {
|
|
3681
3716
|
type: "FeatureCollection",
|
|
3682
3717
|
features: s
|
|
3683
3718
|
};
|
|
3684
|
-
}),
|
|
3685
|
-
if (p.geoType === "hsas") return
|
|
3686
|
-
let e =
|
|
3719
|
+
}), dt = n(() => {
|
|
3720
|
+
if (p.geoType === "hsas") return ut.value;
|
|
3721
|
+
let e = at.value;
|
|
3687
3722
|
if (p.geoType === "counties") {
|
|
3688
|
-
let t =
|
|
3723
|
+
let t = x(p.topology), n = de(t, t.objects.counties);
|
|
3689
3724
|
return e ? {
|
|
3690
3725
|
type: "FeatureCollection",
|
|
3691
3726
|
features: n.features.filter((t) => String(t.id).padStart(5, "0").slice(0, 2) === e)
|
|
3692
3727
|
} : n;
|
|
3693
3728
|
}
|
|
3694
|
-
let t =
|
|
3729
|
+
let t = x(p.topology), n = de(t, t.objects.states);
|
|
3695
3730
|
return e ? {
|
|
3696
3731
|
type: "FeatureCollection",
|
|
3697
3732
|
features: n.features.filter((t) => String(t.id).padStart(2, "0") === e)
|
|
3698
3733
|
} : n;
|
|
3699
|
-
}),
|
|
3734
|
+
}), ft = n(() => {
|
|
3700
3735
|
if (p.geoType !== "counties" && p.geoType !== "hsas") return null;
|
|
3701
|
-
if (
|
|
3702
|
-
let e =
|
|
3703
|
-
return
|
|
3704
|
-
}),
|
|
3705
|
-
let e =
|
|
3706
|
-
if (
|
|
3707
|
-
let t = [[
|
|
3708
|
-
return Number.isFinite(r[0]) && Number.isFinite(r[1]) ? n :
|
|
3736
|
+
if (at.value) return ot.value;
|
|
3737
|
+
let e = x(p.topology);
|
|
3738
|
+
return pe(e, e.objects.states, (e, t) => e !== t);
|
|
3739
|
+
}), pt = n(() => {
|
|
3740
|
+
let e = ot.value;
|
|
3741
|
+
if (at.value && e) {
|
|
3742
|
+
let t = [[zr, zr], [nt.value - zr, rt.value - zr]], n = N().fitExtent(t, e), r = P(n).centroid(e);
|
|
3743
|
+
return Number.isFinite(r[0]) && Number.isFinite(r[1]) ? n : se().fitExtent(t, e);
|
|
3709
3744
|
}
|
|
3710
|
-
return
|
|
3711
|
-
}),
|
|
3745
|
+
return N().fitExtent([[0, 0], [nt.value, rt.value]], dt.value);
|
|
3746
|
+
}), mt = n(() => P(pt.value)), ht = n(() => p.geoType === "counties" || p.geoType === "hsas" ? p.strokeWidth * .5 : p.strokeWidth), gt = n(() => {
|
|
3712
3747
|
let e = /* @__PURE__ */ new Map();
|
|
3713
|
-
for (let [t, n] of
|
|
3748
|
+
for (let [t, n] of bt.value) {
|
|
3714
3749
|
let r = /* @__PURE__ */ new Map();
|
|
3715
3750
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
3716
3751
|
e.set(t, r);
|
|
3717
3752
|
}
|
|
3718
3753
|
return e;
|
|
3719
3754
|
});
|
|
3720
|
-
function
|
|
3755
|
+
function _t(e) {
|
|
3721
3756
|
let t = p.dataGeoType;
|
|
3722
3757
|
if (!t || t === p.geoType) return e;
|
|
3723
|
-
if (p.geoType === "counties" && t === "hsas") return
|
|
3758
|
+
if (p.geoType === "counties" && t === "hsas") return st.value?.fipsToHsa[e];
|
|
3724
3759
|
if (p.geoType === "counties" && t === "states" || p.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
3725
3760
|
}
|
|
3726
|
-
let
|
|
3761
|
+
let vt = n(() => {
|
|
3727
3762
|
let e = /* @__PURE__ */ new Map();
|
|
3728
|
-
for (let t of
|
|
3763
|
+
for (let t of dt.value.features) t.id != null && e.set(String(t.id), t);
|
|
3729
3764
|
return e;
|
|
3730
|
-
}),
|
|
3765
|
+
}), yt = n(() => {
|
|
3731
3766
|
let e = p.focus;
|
|
3732
3767
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
3733
|
-
}),
|
|
3768
|
+
}), bt = n(() => {
|
|
3734
3769
|
let e = /* @__PURE__ */ new Map();
|
|
3735
|
-
e.set(p.geoType,
|
|
3736
|
-
let t =
|
|
3770
|
+
e.set(p.geoType, vt.value);
|
|
3771
|
+
let t = x(p.topology), n = t?.objects;
|
|
3737
3772
|
if (!n) return e;
|
|
3738
3773
|
let r = (e) => {
|
|
3739
3774
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3741,25 +3776,25 @@ var Jt = {
|
|
|
3741
3776
|
return t;
|
|
3742
3777
|
};
|
|
3743
3778
|
if (!e.has("states") && n.states) {
|
|
3744
|
-
let i =
|
|
3779
|
+
let i = de(t, n.states);
|
|
3745
3780
|
e.set("states", r(i.features));
|
|
3746
3781
|
}
|
|
3747
3782
|
if (!e.has("counties") && n.counties) {
|
|
3748
|
-
let i =
|
|
3783
|
+
let i = de(t, n.counties);
|
|
3749
3784
|
e.set("counties", r(i.features));
|
|
3750
3785
|
}
|
|
3751
|
-
return !e.has("hsas") && n.counties && e.set("hsas", r(
|
|
3752
|
-
}),
|
|
3786
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(ut.value.features)), e;
|
|
3787
|
+
}), xt = n(() => {
|
|
3753
3788
|
let e = /* @__PURE__ */ new Map();
|
|
3754
3789
|
if (!p.data) return e;
|
|
3755
|
-
let t = p.dataGeoType ?? p.geoType, n =
|
|
3790
|
+
let t = p.dataGeoType ?? p.geoType, n = gt.value.get(t);
|
|
3756
3791
|
for (let t of p.data) {
|
|
3757
3792
|
e.set(t.id, t.value);
|
|
3758
3793
|
let r = n?.get(t.id);
|
|
3759
3794
|
r && e.set(r, t.value);
|
|
3760
3795
|
}
|
|
3761
3796
|
return e;
|
|
3762
|
-
}),
|
|
3797
|
+
}), St = n(() => {
|
|
3763
3798
|
if (!p.data || p.data.length === 0) return {
|
|
3764
3799
|
min: 0,
|
|
3765
3800
|
max: 1
|
|
@@ -3776,249 +3811,271 @@ var Jt = {
|
|
|
3776
3811
|
min: 0,
|
|
3777
3812
|
max: 1
|
|
3778
3813
|
};
|
|
3779
|
-
}),
|
|
3780
|
-
function
|
|
3781
|
-
let [t, n, r] =
|
|
3814
|
+
}), Ct = n(() => Array.isArray(p.colorScale) && p.colorScale.length > 0 && "value" in p.colorScale[0]), wt = n(() => Array.isArray(p.colorScale) && !Ct.value), Tt = n(() => wt.value ? "" : p.colorScale?.min ?? "#e5f0fa"), Et = n(() => wt.value ? "" : p.colorScale?.max ?? "#08519c");
|
|
3815
|
+
function Ot(e) {
|
|
3816
|
+
let [t, n, r] = Dt(Tt.value) ?? [
|
|
3782
3817
|
229,
|
|
3783
3818
|
240,
|
|
3784
3819
|
250
|
|
3785
|
-
], [i, a, o] =
|
|
3820
|
+
], [i, a, o] = Dt(Et.value) ?? [
|
|
3786
3821
|
8,
|
|
3787
3822
|
81,
|
|
3788
3823
|
156
|
|
3789
3824
|
];
|
|
3790
3825
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
3791
3826
|
}
|
|
3792
|
-
let
|
|
3793
|
-
if (!
|
|
3827
|
+
let kt = n(() => wt.value ? p.colorScale.slice().sort((e, t) => t.min - e.min) : null), At = n(() => {
|
|
3828
|
+
if (!Ct.value) return null;
|
|
3794
3829
|
let e = /* @__PURE__ */ new Map();
|
|
3795
3830
|
for (let t of p.colorScale) e.set(t.value, t.color);
|
|
3796
3831
|
return e;
|
|
3797
3832
|
});
|
|
3798
|
-
function
|
|
3799
|
-
let t =
|
|
3800
|
-
return t == null ? void 0 :
|
|
3833
|
+
function jt(e) {
|
|
3834
|
+
let t = _t(e);
|
|
3835
|
+
return t == null ? void 0 : xt.value.get(t);
|
|
3801
3836
|
}
|
|
3802
|
-
function
|
|
3803
|
-
let t =
|
|
3837
|
+
function Mt(e) {
|
|
3838
|
+
let t = jt(e), n = p.noDataColor;
|
|
3804
3839
|
if (t == null) return n;
|
|
3805
|
-
let r =
|
|
3840
|
+
let r = At.value;
|
|
3806
3841
|
if (r) return r.get(String(t)) ?? n;
|
|
3807
|
-
let i =
|
|
3842
|
+
let i = kt.value;
|
|
3808
3843
|
if (i) {
|
|
3809
3844
|
let e = t;
|
|
3810
3845
|
for (let t of i) if (e >= t.min) return t.color;
|
|
3811
3846
|
return n;
|
|
3812
3847
|
}
|
|
3813
|
-
let { min: a, max: o } =
|
|
3814
|
-
return
|
|
3848
|
+
let { min: a, max: o } = St.value;
|
|
3849
|
+
return Ot((t - a) / (o - a));
|
|
3815
3850
|
}
|
|
3816
|
-
let
|
|
3817
|
-
function
|
|
3818
|
-
return e == null ? "" : typeof e == "number" && p.tooltipValueFormat !== void 0 ?
|
|
3851
|
+
let Nt = (e) => e.properties?.name ?? String(e.id);
|
|
3852
|
+
function Pt(e) {
|
|
3853
|
+
return e == null ? "" : typeof e == "number" && p.tooltipValueFormat !== void 0 ? re(e, p.tooltipValueFormat) : String(e);
|
|
3819
3854
|
}
|
|
3820
|
-
function
|
|
3821
|
-
return t == null ? e : `${e}: ${
|
|
3855
|
+
function Ft(e, t) {
|
|
3856
|
+
return t == null ? e : `${e}: ${Pt(t)}`;
|
|
3822
3857
|
}
|
|
3823
|
-
function
|
|
3824
|
-
let e =
|
|
3858
|
+
function It() {
|
|
3859
|
+
let e = M.value?.getEl();
|
|
3825
3860
|
if (!e) return;
|
|
3826
|
-
|
|
3861
|
+
be?.disconnect();
|
|
3827
3862
|
let t = !1;
|
|
3828
|
-
|
|
3863
|
+
be = new ResizeObserver((e) => {
|
|
3829
3864
|
let n = e[0]?.contentRect;
|
|
3830
|
-
n && (
|
|
3831
|
-
}),
|
|
3865
|
+
n && (xe.width = n.width, xe.height = n.height, !t && Ce && Se ? (t = !0, Lt(Se.x, Se.y)) : t = !0);
|
|
3866
|
+
}), be.observe(e);
|
|
3832
3867
|
}
|
|
3833
|
-
function
|
|
3834
|
-
let n =
|
|
3868
|
+
function Lt(e, t) {
|
|
3869
|
+
let n = M.value?.getEl();
|
|
3835
3870
|
if (!n) return;
|
|
3836
|
-
let r =
|
|
3871
|
+
let r = ie.value?.getBoundingClientRect(), { left: i, top: a } = H(e, t, xe.width, xe.height, p.tooltipClamp, r);
|
|
3837
3872
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
3838
3873
|
}
|
|
3839
|
-
function
|
|
3840
|
-
let r =
|
|
3874
|
+
function Rt(e, t, n) {
|
|
3875
|
+
let r = ge.get(e);
|
|
3841
3876
|
if (!r) return;
|
|
3842
|
-
let i =
|
|
3843
|
-
!i || !a || (i.setData(r),
|
|
3877
|
+
let i = M.value, a = i?.getEl();
|
|
3878
|
+
!i || !a || (i.setData(r), Se = {
|
|
3844
3879
|
x: t,
|
|
3845
3880
|
y: n
|
|
3846
|
-
},
|
|
3881
|
+
}, Ce = !0, Lt(t, n), a.style.visibility = "visible");
|
|
3847
3882
|
}
|
|
3848
|
-
function
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
let e =
|
|
3852
|
-
!e || !
|
|
3853
|
-
x:
|
|
3854
|
-
y:
|
|
3855
|
-
}, e.style.transform = `translate3d(${
|
|
3883
|
+
function zt(e, t) {
|
|
3884
|
+
Ce && (Ae = e, je = t, !Me && (Me = requestAnimationFrame(() => {
|
|
3885
|
+
Me = 0;
|
|
3886
|
+
let e = M.value?.getEl();
|
|
3887
|
+
!e || !Ce || (Se = {
|
|
3888
|
+
x: Ae,
|
|
3889
|
+
y: je
|
|
3890
|
+
}, e.style.transform = `translate3d(${Ae + 16}px, ${je}px, 0) translateY(-50%)`);
|
|
3856
3891
|
})));
|
|
3857
3892
|
}
|
|
3858
|
-
function
|
|
3859
|
-
if (!
|
|
3860
|
-
|
|
3861
|
-
let e =
|
|
3893
|
+
function Bt() {
|
|
3894
|
+
if (!Ce) return;
|
|
3895
|
+
Ce = !1, Se = null;
|
|
3896
|
+
let e = M.value?.getEl();
|
|
3862
3897
|
e && (e.style.visibility = "hidden");
|
|
3863
3898
|
}
|
|
3864
|
-
function
|
|
3899
|
+
function Vt(e, t) {
|
|
3865
3900
|
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"));
|
|
3866
3901
|
}
|
|
3867
|
-
function
|
|
3868
|
-
return
|
|
3902
|
+
function Ht() {
|
|
3903
|
+
return Te.value * Ee.value || 1;
|
|
3869
3904
|
}
|
|
3870
|
-
function
|
|
3871
|
-
return e?.strokeWidth ??
|
|
3905
|
+
function Ut(e) {
|
|
3906
|
+
return e?.strokeWidth ?? ht.value + 1;
|
|
3872
3907
|
}
|
|
3873
3908
|
function Wt() {
|
|
3874
|
-
let e =
|
|
3875
|
-
|
|
3876
|
-
for (let { el: t, strokeWidth: n } of
|
|
3877
|
-
for (let [t, n] of
|
|
3878
|
-
|
|
3909
|
+
let e = Ht(), t = ht.value;
|
|
3910
|
+
j.value?.setAttribute("stroke-width", String(t / e)), _e?.setAttribute("stroke-width", String(1 / e)), ae.value?.setAttribute("stroke-width", String((t + 1.5) / e));
|
|
3911
|
+
for (let { el: t, strokeWidth: n } of ve.values()) n == null ? t.removeAttribute("stroke-width") : t.setAttribute("stroke-width", String(n / e));
|
|
3912
|
+
for (let [t, n] of B) t.setAttribute("stroke-width", String(Ut(n) / e));
|
|
3913
|
+
z && !B.has(z) && z.setAttribute("stroke-width", String(Ut() / e));
|
|
3879
3914
|
}
|
|
3880
3915
|
function Gt(e, t) {
|
|
3881
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
3916
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Ut(t) / Ht())), e.style.stroke = t?.stroke ?? Br, Vt(e, t?.style);
|
|
3882
3917
|
}
|
|
3883
3918
|
function Kt(e) {
|
|
3884
3919
|
e.removeAttribute("stroke-width"), e.style.stroke = "", e.setAttribute("stroke", p.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
3885
3920
|
}
|
|
3886
3921
|
function qt(e) {
|
|
3887
|
-
|
|
3922
|
+
z !== e && (z && !B.has(z) && Kt(z), z = e, Gt(e, B.get(e)));
|
|
3888
3923
|
}
|
|
3889
3924
|
function Jt() {
|
|
3890
|
-
if (
|
|
3891
|
-
let e =
|
|
3892
|
-
e == null ? Kt(
|
|
3925
|
+
if (z) {
|
|
3926
|
+
let e = B.get(z);
|
|
3927
|
+
e == null ? Kt(z) : Gt(z, e), z = null, D("stateHover", null);
|
|
3893
3928
|
}
|
|
3894
|
-
|
|
3929
|
+
Bt();
|
|
3895
3930
|
}
|
|
3896
|
-
function
|
|
3931
|
+
function Q(e) {
|
|
3897
3932
|
let t = e;
|
|
3898
3933
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
3899
3934
|
return t ? t.dataset.featId ?? null : null;
|
|
3900
3935
|
}
|
|
3901
|
-
function
|
|
3902
|
-
|
|
3936
|
+
function Yt(e) {
|
|
3937
|
+
D("stateClick", {
|
|
3903
3938
|
id: e.id,
|
|
3904
3939
|
name: e.name,
|
|
3905
3940
|
value: e.value
|
|
3906
|
-
}),
|
|
3941
|
+
}), D("update:focus", Be(yt.value).has(e.id) ? null : e.id);
|
|
3907
3942
|
}
|
|
3908
|
-
function
|
|
3909
|
-
if (
|
|
3910
|
-
let t = e, n =
|
|
3943
|
+
function Xt(e) {
|
|
3944
|
+
if (e.type === "mouseover" && ye) return;
|
|
3945
|
+
let t = e, n = Q(t.target);
|
|
3911
3946
|
if (!n) return;
|
|
3912
|
-
let r =
|
|
3947
|
+
let r = ge.get(n);
|
|
3913
3948
|
if (!r) return;
|
|
3914
3949
|
let i = {
|
|
3915
3950
|
id: r.id,
|
|
3916
3951
|
name: r.name,
|
|
3917
3952
|
value: r.value
|
|
3918
3953
|
};
|
|
3919
|
-
e.type === "click" ? p.zoom ? (window.clearTimeout(
|
|
3920
|
-
|
|
3921
|
-
},
|
|
3954
|
+
e.type === "click" ? p.zoom ? (window.clearTimeout(U), U = 0, t.detail <= 1 && (U = window.setTimeout(() => {
|
|
3955
|
+
U = 0, Yt(r);
|
|
3956
|
+
}, Nr))) : Yt(r) : e.type === "mouseover" && (qt(R.get(n)), I.value && Rt(n, t.clientX, t.clientY), D("stateHover", i));
|
|
3922
3957
|
}
|
|
3923
|
-
function
|
|
3924
|
-
|
|
3958
|
+
function Zt(e) {
|
|
3959
|
+
ye || zt(e.clientX, e.clientY);
|
|
3925
3960
|
}
|
|
3926
|
-
function
|
|
3961
|
+
function Qt(e) {
|
|
3927
3962
|
let t = e.relatedTarget;
|
|
3928
|
-
t &&
|
|
3963
|
+
t && A.value?.contains(t) || Jt();
|
|
3929
3964
|
}
|
|
3930
|
-
function
|
|
3965
|
+
function $t(e) {
|
|
3931
3966
|
if (e.touches.length !== 1) {
|
|
3932
|
-
|
|
3967
|
+
Ne = null;
|
|
3933
3968
|
return;
|
|
3934
3969
|
}
|
|
3935
3970
|
let t = e.touches[0];
|
|
3936
|
-
|
|
3971
|
+
Ne = {
|
|
3937
3972
|
x: t.clientX,
|
|
3938
3973
|
y: t.clientY,
|
|
3939
3974
|
time: e.timeStamp,
|
|
3940
|
-
featId:
|
|
3975
|
+
featId: Q(e.target)
|
|
3941
3976
|
};
|
|
3942
3977
|
}
|
|
3943
|
-
function
|
|
3944
|
-
let t =
|
|
3945
|
-
if (
|
|
3978
|
+
function en(e) {
|
|
3979
|
+
let t = Ne;
|
|
3980
|
+
if (Ne = null, !t || e.touches.length > 0) return;
|
|
3946
3981
|
let n = e.changedTouches[0];
|
|
3947
|
-
if (!n || Math.abs(n.clientX - t.x) >
|
|
3948
|
-
if (p.zoom && !
|
|
3949
|
-
|
|
3950
|
-
|
|
3982
|
+
if (!n || Math.abs(n.clientX - t.x) > jr || Math.abs(n.clientY - t.y) > jr || e.timeStamp - t.time > Mr) return;
|
|
3983
|
+
if (p.zoom && !Oe.value && J() && !$.isFullscreen.value) {
|
|
3984
|
+
e.preventDefault();
|
|
3985
|
+
let r = W;
|
|
3986
|
+
if (W = {
|
|
3987
|
+
x: n.clientX,
|
|
3988
|
+
y: n.clientY,
|
|
3989
|
+
time: e.timeStamp
|
|
3990
|
+
}, r != null && e.timeStamp - r.time <= Nr && Math.abs(n.clientX - r.x) <= Pr && Math.abs(n.clientY - r.y) <= Pr) {
|
|
3991
|
+
W = null, window.clearTimeout(U), U = 0, p.touchExpand ? $e(n.clientX, n.clientY) : et(n.clientX, n.clientY);
|
|
3951
3992
|
return;
|
|
3952
3993
|
}
|
|
3953
|
-
|
|
3954
|
-
|
|
3994
|
+
let i = t.featId ? ge.get(t.featId) : void 0;
|
|
3995
|
+
if (!i) {
|
|
3996
|
+
Jt();
|
|
3955
3997
|
return;
|
|
3956
3998
|
}
|
|
3999
|
+
tn(i, n.clientX, n.clientY), window.clearTimeout(U), U = window.setTimeout(() => {
|
|
4000
|
+
U = 0, Yt(i);
|
|
4001
|
+
}, Nr);
|
|
4002
|
+
return;
|
|
3957
4003
|
}
|
|
3958
|
-
if (!t.featId)
|
|
3959
|
-
|
|
3960
|
-
|
|
4004
|
+
if (!t.featId) {
|
|
4005
|
+
Jt();
|
|
4006
|
+
return;
|
|
4007
|
+
}
|
|
4008
|
+
let r = ge.get(t.featId);
|
|
4009
|
+
r && (e.preventDefault(), tn(r, n.clientX, n.clientY), Yt(r));
|
|
4010
|
+
}
|
|
4011
|
+
function tn(e, t, n) {
|
|
4012
|
+
let r = R.get(e.id);
|
|
4013
|
+
r && qt(r), D("stateHover", {
|
|
4014
|
+
id: e.id,
|
|
4015
|
+
name: e.name,
|
|
4016
|
+
value: e.value
|
|
4017
|
+
}), I.value && Rt(e.id, t, n);
|
|
3961
4018
|
}
|
|
3962
4019
|
function nn() {
|
|
3963
|
-
|
|
4020
|
+
Ne = null;
|
|
3964
4021
|
}
|
|
3965
4022
|
function rn(e) {
|
|
3966
|
-
let t = document.createElementNS(
|
|
4023
|
+
let t = document.createElementNS(Ar, "path");
|
|
3967
4024
|
return e && t.setAttribute("d", e), t;
|
|
3968
4025
|
}
|
|
3969
4026
|
function an() {
|
|
3970
|
-
let e =
|
|
4027
|
+
let e = j.value, t = ae.value;
|
|
3971
4028
|
if (!e || !t) return;
|
|
3972
4029
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
3973
4030
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
3974
|
-
|
|
3975
|
-
let n =
|
|
4031
|
+
R.clear(), ge.clear(), _e = null, z = null, B.clear(), ve.clear();
|
|
4032
|
+
let n = mt.value, r = dt.value.features;
|
|
3976
4033
|
if (r.length === 0) return;
|
|
3977
|
-
let i = p.strokeColor, a = !
|
|
4034
|
+
let i = p.strokeColor, a = !I.value, o = document.createDocumentFragment();
|
|
3978
4035
|
for (let e of r) {
|
|
3979
|
-
let t = String(e.id), r =
|
|
3980
|
-
if (c.setAttribute("class", "state-path"), c.setAttribute("data-feat-id", t), c.setAttribute("fill",
|
|
3981
|
-
let e = document.createElementNS(
|
|
3982
|
-
e.textContent =
|
|
4036
|
+
let t = String(e.id), r = Nt(e), s = jt(t), c = rn(n(e));
|
|
4037
|
+
if (c.setAttribute("class", "state-path"), c.setAttribute("data-feat-id", t), c.setAttribute("fill", Mt(t)), c.setAttribute("stroke", i), a) {
|
|
4038
|
+
let e = document.createElementNS(Ar, "title");
|
|
4039
|
+
e.textContent = Ft(r, s), c.appendChild(e);
|
|
3983
4040
|
}
|
|
3984
|
-
o.appendChild(c),
|
|
4041
|
+
o.appendChild(c), R.set(t, c), ge.set(t, {
|
|
3985
4042
|
id: t,
|
|
3986
4043
|
name: r,
|
|
3987
4044
|
value: s,
|
|
3988
4045
|
feature: e
|
|
3989
4046
|
});
|
|
3990
4047
|
}
|
|
3991
|
-
let s =
|
|
4048
|
+
let s = ft.value;
|
|
3992
4049
|
if (s) {
|
|
3993
4050
|
let e = rn(n(s));
|
|
3994
|
-
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), o.appendChild(e),
|
|
4051
|
+
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), o.appendChild(e), _e = e;
|
|
3995
4052
|
}
|
|
3996
4053
|
e.appendChild(o), Wt();
|
|
3997
4054
|
}
|
|
3998
4055
|
function on() {
|
|
3999
|
-
let e = !
|
|
4000
|
-
for (let [t, n] of
|
|
4001
|
-
let r =
|
|
4002
|
-
if (n.setAttribute("fill",
|
|
4056
|
+
let e = !I.value;
|
|
4057
|
+
for (let [t, n] of R) {
|
|
4058
|
+
let r = jt(t), i = ge.get(t);
|
|
4059
|
+
if (n.setAttribute("fill", Mt(t)), i && (i.value = r), e && i) {
|
|
4003
4060
|
let e = n.firstElementChild;
|
|
4004
|
-
e && (e.textContent =
|
|
4061
|
+
e && (e.textContent = Ft(i.name, r));
|
|
4005
4062
|
}
|
|
4006
4063
|
}
|
|
4007
4064
|
}
|
|
4008
4065
|
function sn() {
|
|
4009
|
-
for (let e of
|
|
4010
|
-
|
|
4066
|
+
for (let e of R.values()) e === z || B.has(e) || Kt(e);
|
|
4067
|
+
_e && _e.setAttribute("stroke", p.strokeColor), Wt();
|
|
4011
4068
|
}
|
|
4012
4069
|
function cn() {
|
|
4013
4070
|
return typeof p.menu == "string" ? p.menu : "choropleth";
|
|
4014
4071
|
}
|
|
4015
|
-
let ln = n(() => p.legend && (
|
|
4072
|
+
let ln = n(() => p.legend && (Ct.value || wt.value || p.data)), un = n(() => p.colorScale.slice().sort((e, t) => e.min - t.min)), dn = n(() => {
|
|
4016
4073
|
let e = [];
|
|
4017
4074
|
for (let t = 0; t <= 10; t++) {
|
|
4018
4075
|
let n = t / 10;
|
|
4019
4076
|
e.push({
|
|
4020
4077
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
4021
|
-
color:
|
|
4078
|
+
color: Ot(n)
|
|
4022
4079
|
});
|
|
4023
4080
|
}
|
|
4024
4081
|
return e;
|
|
@@ -4026,7 +4083,7 @@ var Jt = {
|
|
|
4026
4083
|
notation: "compact",
|
|
4027
4084
|
maximumFractionDigits: 1
|
|
4028
4085
|
}), pn = n(() => {
|
|
4029
|
-
let { min: e, max: t } =
|
|
4086
|
+
let { min: e, max: t } = St.value, n = t - e, r = [];
|
|
4030
4087
|
for (let t = 1; t <= 3; t++) {
|
|
4031
4088
|
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? fn.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
4032
4089
|
r.push({
|
|
@@ -4037,145 +4094,145 @@ var Jt = {
|
|
|
4037
4094
|
return r;
|
|
4038
4095
|
}), mn = n(() => {
|
|
4039
4096
|
let e = [];
|
|
4040
|
-
if (
|
|
4097
|
+
if (Ct.value) for (let t of p.colorScale) e.push({
|
|
4041
4098
|
key: t.value,
|
|
4042
4099
|
color: t.color,
|
|
4043
4100
|
label: t.value
|
|
4044
4101
|
});
|
|
4045
|
-
else if (
|
|
4102
|
+
else if (wt.value) for (let t of un.value) e.push({
|
|
4046
4103
|
key: String(t.min),
|
|
4047
4104
|
color: t.color,
|
|
4048
4105
|
label: t.label ?? String(t.min)
|
|
4049
4106
|
});
|
|
4050
4107
|
return e;
|
|
4051
|
-
}), hn = n(() => `linear-gradient(to right, ${dn.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), $ =
|
|
4108
|
+
}), hn = n(() => `linear-gradient(to right, ${dn.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), $ = Ge({ target: () => p.fullscreenTarget }), gn = n(() => {
|
|
4052
4109
|
let e = cn();
|
|
4053
4110
|
return [
|
|
4054
4111
|
$.menuItem.value,
|
|
4055
4112
|
{
|
|
4056
4113
|
label: "Save as SVG",
|
|
4057
4114
|
action: () => {
|
|
4058
|
-
|
|
4115
|
+
k.value && q(k.value, e);
|
|
4059
4116
|
}
|
|
4060
4117
|
},
|
|
4061
4118
|
{
|
|
4062
4119
|
label: "Save as PNG",
|
|
4063
4120
|
action: () => {
|
|
4064
|
-
|
|
4121
|
+
k.value && Fe(k.value, e);
|
|
4065
4122
|
}
|
|
4066
4123
|
}
|
|
4067
4124
|
];
|
|
4068
4125
|
});
|
|
4069
|
-
return
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
], () => an()),
|
|
4074
|
-
|
|
4126
|
+
return T(() => [
|
|
4127
|
+
dt.value,
|
|
4128
|
+
mt.value,
|
|
4129
|
+
I.value
|
|
4130
|
+
], () => an()), T(() => [
|
|
4131
|
+
xt.value,
|
|
4075
4132
|
p.colorScale,
|
|
4076
4133
|
p.noDataColor,
|
|
4077
4134
|
p.dataGeoType
|
|
4078
|
-
], () => on()),
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
], () =>
|
|
4083
|
-
if (e || !
|
|
4084
|
-
let t =
|
|
4085
|
-
t.interrupt(),
|
|
4135
|
+
], () => on()), T(() => [p.strokeColor, ht.value], () => sn()), T(() => [
|
|
4136
|
+
yt.value,
|
|
4137
|
+
mt.value,
|
|
4138
|
+
st.value
|
|
4139
|
+
], () => Y(), { flush: "post" }), T(() => $.isFullscreen.value, (e) => {
|
|
4140
|
+
if (e || !J() || !k.value || !V) return;
|
|
4141
|
+
let t = F(k.value);
|
|
4142
|
+
t.interrupt(), V.transform(t, le);
|
|
4086
4143
|
}), (n, l) => (_(), r(t, {
|
|
4087
|
-
to:
|
|
4088
|
-
disabled: !
|
|
4144
|
+
to: S($).teleportTarget.value,
|
|
4145
|
+
disabled: !S($).isFullscreen.value
|
|
4089
4146
|
}, [o("div", d({
|
|
4090
4147
|
ref_key: "containerRef",
|
|
4091
|
-
ref:
|
|
4148
|
+
ref: ie
|
|
4092
4149
|
}, n.$attrs, {
|
|
4093
4150
|
class: ["choropleth-wrapper", {
|
|
4094
|
-
pannable:
|
|
4095
|
-
"is-fullscreen":
|
|
4151
|
+
pannable: Ke.value,
|
|
4152
|
+
"is-fullscreen": S($).isFullscreen.value
|
|
4096
4153
|
}],
|
|
4097
|
-
style:
|
|
4098
|
-
role:
|
|
4154
|
+
style: S($).fullscreenStyle.value,
|
|
4155
|
+
role: w.value || void 0,
|
|
4099
4156
|
"aria-label": ne.value || void 0
|
|
4100
4157
|
}), [
|
|
4101
|
-
c.menu ||
|
|
4158
|
+
c.menu || S($).isFullscreen.value ? (_(), r(he, {
|
|
4102
4159
|
key: 0,
|
|
4103
4160
|
items: gn.value,
|
|
4104
|
-
"is-fullscreen":
|
|
4105
|
-
onClose:
|
|
4161
|
+
"is-fullscreen": S($).isFullscreen.value,
|
|
4162
|
+
onClose: S($).exit
|
|
4106
4163
|
}, null, 8, [
|
|
4107
4164
|
"items",
|
|
4108
4165
|
"is-fullscreen",
|
|
4109
4166
|
"onClose"
|
|
4110
4167
|
])) : i("", !0),
|
|
4111
|
-
o("div",
|
|
4112
|
-
c.title || ln.value ? (_(), a("div",
|
|
4168
|
+
o("div", Sr, b(S($).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
|
|
4169
|
+
c.title || ln.value ? (_(), a("div", Cr, [c.title ? (_(), a("div", {
|
|
4113
4170
|
key: 0,
|
|
4114
4171
|
class: "choropleth-title",
|
|
4115
|
-
style: h(
|
|
4172
|
+
style: h(L.value)
|
|
4116
4173
|
}, b(c.title), 5)) : i("", !0), ln.value ? (_(), a("div", {
|
|
4117
4174
|
key: 1,
|
|
4118
4175
|
class: "choropleth-legend",
|
|
4119
|
-
style: h(
|
|
4120
|
-
}, [c.legendTitle ? (_(), a("span",
|
|
4176
|
+
style: h(me.value)
|
|
4177
|
+
}, [c.legendTitle ? (_(), a("span", wr, b(c.legendTitle), 1)) : i("", !0), Ct.value || wt.value ? (_(!0), a(e, { key: 1 }, y(mn.value, (e) => (_(), a("span", {
|
|
4121
4178
|
key: e.key,
|
|
4122
4179
|
class: "choropleth-legend-item"
|
|
4123
4180
|
}, [o("span", {
|
|
4124
4181
|
class: "choropleth-legend-swatch",
|
|
4125
4182
|
style: h({ background: e.color })
|
|
4126
|
-
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div",
|
|
4183
|
+
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", Tr, [o("div", {
|
|
4127
4184
|
class: "choropleth-legend-gradient",
|
|
4128
4185
|
style: h({ background: hn.value })
|
|
4129
|
-
}, null, 4), o("div",
|
|
4186
|
+
}, null, 4), o("div", Er, [(_(!0), a(e, null, y(pn.value, (e) => (_(), a("span", {
|
|
4130
4187
|
key: e.value,
|
|
4131
4188
|
style: h({ left: e.pct + "%" })
|
|
4132
4189
|
}, b(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
|
|
4133
|
-
|
|
4190
|
+
qe.value ? (_(), a("div", Dr, b(Z.value), 1)) : i("", !0),
|
|
4134
4191
|
(_(), a("svg", {
|
|
4135
4192
|
ref_key: "svgRef",
|
|
4136
|
-
ref:
|
|
4137
|
-
viewBox: `0 0 ${
|
|
4193
|
+
ref: k,
|
|
4194
|
+
viewBox: `0 0 ${nt.value} ${rt.value}`,
|
|
4138
4195
|
preserveAspectRatio: "xMidYMid meet",
|
|
4139
|
-
style: h(
|
|
4196
|
+
style: h(Ye.value)
|
|
4140
4197
|
}, [o("g", {
|
|
4141
4198
|
ref_key: "mapGroupRef",
|
|
4142
|
-
ref:
|
|
4199
|
+
ref: A
|
|
4143
4200
|
}, [o("g", {
|
|
4144
4201
|
ref_key: "baseGroupRef",
|
|
4145
|
-
ref:
|
|
4202
|
+
ref: j
|
|
4146
4203
|
}, null, 512), o("g", {
|
|
4147
4204
|
ref_key: "overlayGroupRef",
|
|
4148
|
-
ref:
|
|
4149
|
-
}, null, 512)], 512)], 12,
|
|
4150
|
-
|
|
4205
|
+
ref: ae
|
|
4206
|
+
}, null, 512)], 512)], 12, Or)),
|
|
4207
|
+
X.value ? (_(), r(S(Je), {
|
|
4151
4208
|
key: 3,
|
|
4152
|
-
"can-zoom-in":
|
|
4153
|
-
"can-zoom-out":
|
|
4154
|
-
"can-reset":
|
|
4155
|
-
"is-fullscreen":
|
|
4156
|
-
onZoomIn: l[0] ||= (e) =>
|
|
4157
|
-
onZoomOut: l[1] ||= (e) =>
|
|
4158
|
-
onReset:
|
|
4209
|
+
"can-zoom-in": Te.value < We.value,
|
|
4210
|
+
"can-zoom-out": Te.value > 1,
|
|
4211
|
+
"can-reset": we.value,
|
|
4212
|
+
"is-fullscreen": S($).isFullscreen.value,
|
|
4213
|
+
onZoomIn: l[0] ||= (e) => Xe(Ir),
|
|
4214
|
+
onZoomOut: l[1] ||= (e) => Xe(1 / Ir),
|
|
4215
|
+
onReset: Ue
|
|
4159
4216
|
}, null, 8, [
|
|
4160
4217
|
"can-zoom-in",
|
|
4161
4218
|
"can-zoom-out",
|
|
4162
4219
|
"can-reset",
|
|
4163
4220
|
"is-fullscreen"
|
|
4164
4221
|
])) : i("", !0),
|
|
4165
|
-
|
|
4222
|
+
I.value ? (_(), r(br, {
|
|
4166
4223
|
key: 4,
|
|
4167
4224
|
ref_key: "tooltipChildRef",
|
|
4168
|
-
ref:
|
|
4225
|
+
ref: M
|
|
4169
4226
|
}, {
|
|
4170
|
-
default:
|
|
4227
|
+
default: E((t) => [te(n.$slots, "tooltip", m(u(O(t))), () => [c.tooltipFormat ? (_(), a("span", {
|
|
4171
4228
|
key: 0,
|
|
4172
4229
|
innerHTML: c.tooltipFormat(t)
|
|
4173
|
-
}, null, 8,
|
|
4230
|
+
}, null, 8, kr)) : t.value == null ? (_(), a(e, { key: 1 }, [s(b(t.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(t.name) + ": " + b(Pt(t.value)), 1)], 64))], !0)]),
|
|
4174
4231
|
_: 3
|
|
4175
4232
|
}, 512)) : i("", !0)
|
|
4176
|
-
], 16,
|
|
4233
|
+
], 16, xr)], 8, ["to", "disabled"]));
|
|
4177
4234
|
}
|
|
4178
|
-
}), [["__scopeId", "data-v-
|
|
4235
|
+
}), [["__scopeId", "data-v-75643edc"]]), Hr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
4179
4236
|
__name: "ChartTooltip",
|
|
4180
4237
|
props: {
|
|
4181
4238
|
x: {},
|
|
@@ -4195,12 +4252,12 @@ var Jt = {
|
|
|
4195
4252
|
top: `${e.y}px`,
|
|
4196
4253
|
transform: "translateY(-50%)"
|
|
4197
4254
|
})
|
|
4198
|
-
}, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(
|
|
4255
|
+
}, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(S(oe), {
|
|
4199
4256
|
key: 1,
|
|
4200
4257
|
open: e.open
|
|
4201
4258
|
}, {
|
|
4202
|
-
default:
|
|
4203
|
-
default:
|
|
4259
|
+
default: E(() => [c(S(j), { "as-child": "" }, {
|
|
4260
|
+
default: E(() => [o("div", {
|
|
4204
4261
|
class: "chart-tooltip-anchor",
|
|
4205
4262
|
style: h({
|
|
4206
4263
|
left: `${e.x}px`,
|
|
@@ -4208,8 +4265,8 @@ var Jt = {
|
|
|
4208
4265
|
})
|
|
4209
4266
|
}, null, 4)]),
|
|
4210
4267
|
_: 1
|
|
4211
|
-
}), c(
|
|
4212
|
-
default:
|
|
4268
|
+
}), c(S(M), null, {
|
|
4269
|
+
default: E(() => [e.open ? (_(), r(S(ae), {
|
|
4213
4270
|
key: 0,
|
|
4214
4271
|
class: "chart-tooltip-content",
|
|
4215
4272
|
side: "right",
|
|
@@ -4218,7 +4275,7 @@ var Jt = {
|
|
|
4218
4275
|
onPointerDownOutside: n[0] ||= (e) => t.$emit("close"),
|
|
4219
4276
|
onEscapeKeyDown: n[1] ||= (e) => t.$emit("close")
|
|
4220
4277
|
}, {
|
|
4221
|
-
default:
|
|
4278
|
+
default: E(() => [te(t.$slots, "default", {}, void 0, !0)]),
|
|
4222
4279
|
_: 3
|
|
4223
4280
|
}, 8, ["side-offset"])) : i("", !0)]),
|
|
4224
4281
|
_: 3
|
|
@@ -4226,7 +4283,7 @@ var Jt = {
|
|
|
4226
4283
|
_: 3
|
|
4227
4284
|
}, 8, ["open"])) : i("", !0);
|
|
4228
4285
|
}
|
|
4229
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
4286
|
+
}), [["__scopeId", "data-v-44377f70"]]), Ur = { class: "TableWrapper" }, Wr = ["href", "download"], Gr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
4230
4287
|
__name: "DataTable",
|
|
4231
4288
|
props: {
|
|
4232
4289
|
data: {},
|
|
@@ -4310,44 +4367,44 @@ var Jt = {
|
|
|
4310
4367
|
let r = c.columnConfig?.[e.name]?.format;
|
|
4311
4368
|
if (r !== void 0) {
|
|
4312
4369
|
if (typeof r == "function") return r(n, t);
|
|
4313
|
-
if (typeof n == "number") return
|
|
4370
|
+
if (typeof n == "number") return re(n, r);
|
|
4314
4371
|
}
|
|
4315
4372
|
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);
|
|
4316
4373
|
}
|
|
4317
|
-
function
|
|
4374
|
+
function x() {
|
|
4318
4375
|
return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
|
|
4319
4376
|
}
|
|
4320
|
-
function
|
|
4377
|
+
function S() {
|
|
4321
4378
|
if (typeof c.csv == "function") return c.csv();
|
|
4322
4379
|
if (typeof c.csv == "string") return c.csv;
|
|
4323
|
-
let e = v.value, t = te.value, n = [e.map((e) =>
|
|
4380
|
+
let e = v.value, t = te.value, n = [e.map((e) => Ze(l(e.name))).join(",")];
|
|
4324
4381
|
for (let r = 0; r < t; r++) {
|
|
4325
|
-
let t = e.map((e) =>
|
|
4382
|
+
let t = e.map((e) => Ze(ne(e, r)));
|
|
4326
4383
|
n.push(t.join(","));
|
|
4327
4384
|
}
|
|
4328
4385
|
return n.join("\n");
|
|
4329
4386
|
}
|
|
4330
|
-
function
|
|
4331
|
-
|
|
4387
|
+
function C() {
|
|
4388
|
+
Ie(S(), x());
|
|
4332
4389
|
}
|
|
4333
|
-
let
|
|
4390
|
+
let w = n(() => c.downloadButton || c.downloadLink ? [] : [{
|
|
4334
4391
|
label: c.downloadMenuLink,
|
|
4335
|
-
action:
|
|
4336
|
-
}]),
|
|
4392
|
+
action: C
|
|
4393
|
+
}]), T = n(() => {
|
|
4337
4394
|
if (c.downloadButton) return null;
|
|
4338
4395
|
let e = c.downloadLink;
|
|
4339
4396
|
return e ? typeof e == "string" ? e : "Download data (CSV)" : null;
|
|
4340
|
-
}),
|
|
4397
|
+
}), E = n(() => T.value ? `data:text/csv;charset=utf-8,${encodeURIComponent(S())}` : null), D = n(() => !!c.menu && w.value.length > 0);
|
|
4341
4398
|
return (n, s) => (_(), a("div", { class: p(["TableOuter", {
|
|
4342
4399
|
"full-width": t.fullWidth,
|
|
4343
|
-
"has-menu":
|
|
4400
|
+
"has-menu": D.value
|
|
4344
4401
|
}]) }, [
|
|
4345
|
-
|
|
4402
|
+
D.value ? (_(), r(he, {
|
|
4346
4403
|
key: 0,
|
|
4347
|
-
items:
|
|
4404
|
+
items: w.value,
|
|
4348
4405
|
"force-dropdown": ""
|
|
4349
4406
|
}, null, 8, ["items"])) : i("", !0),
|
|
4350
|
-
o("div",
|
|
4407
|
+
o("div", Ur, [o("table", { class: p(["Table", { "full-width": t.fullWidth }]) }, [
|
|
4351
4408
|
o("colgroup", null, [(_(!0), a(e, null, y(v.value, (e) => (_(), a("col", {
|
|
4352
4409
|
key: e.name,
|
|
4353
4410
|
style: h(u(e.name))
|
|
@@ -4367,15 +4424,15 @@ var Jt = {
|
|
|
4367
4424
|
key: 1,
|
|
4368
4425
|
type: "button",
|
|
4369
4426
|
class: "data-table-download-button",
|
|
4370
|
-
onClick:
|
|
4371
|
-
}, b(t.downloadMenuLink), 1)) :
|
|
4427
|
+
onClick: C
|
|
4428
|
+
}, b(t.downloadMenuLink), 1)) : T.value ? (_(), a("a", {
|
|
4372
4429
|
key: 2,
|
|
4373
4430
|
class: "data-table-download-link",
|
|
4374
|
-
href:
|
|
4375
|
-
download: `${
|
|
4376
|
-
}, b(
|
|
4431
|
+
href: E.value,
|
|
4432
|
+
download: `${x()}.csv`
|
|
4433
|
+
}, b(T.value), 9, Wr)) : i("", !0)
|
|
4377
4434
|
], 2));
|
|
4378
4435
|
}
|
|
4379
4436
|
}), [["__scopeId", "data-v-9b1b6a76"]]);
|
|
4380
4437
|
//#endregion
|
|
4381
|
-
export {
|
|
4438
|
+
export { vr as BarChart, Hr as ChartTooltip, Vr as ChoroplethMap, Gr as DataTable, Rn as LineChart };
|