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