@cfasim-ui/charts 0.4.15 → 0.4.16
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/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as ee, toDisplayString as b, toHandlers as te, toRaw as x, unref as S, useSlots as C, useTemplateRef as w, watch as T, withCtx as E } from "vue";
|
|
2
2
|
import { formatNumber as ne } from "@cfasim-ui/shared";
|
|
3
3
|
import { DropdownMenuContent as D, DropdownMenuItem as O, DropdownMenuPortal as re, DropdownMenuRoot as k, DropdownMenuTrigger as A, PopoverAnchor as ie, PopoverContent as j, PopoverPortal as ae, PopoverRoot as M } from "reka-ui";
|
|
4
|
-
import { geoAlbersUsa as oe, geoPath as
|
|
5
|
-
import { zoom as
|
|
6
|
-
import { select as
|
|
4
|
+
import { geoAlbersUsa as oe, geoPath as N } from "d3-geo";
|
|
5
|
+
import { zoom as se, zoomIdentity as ce } from "d3-zoom";
|
|
6
|
+
import { select as le } from "d3-selection";
|
|
7
7
|
import "d3-transition";
|
|
8
|
-
import { feature as
|
|
8
|
+
import { feature as P, merge as ue, mesh as de } from "topojson-client";
|
|
9
9
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var F = { class: "chart-menu-trigger-area" }, I = ["aria-label"], fe = /* @__PURE__ */ l({
|
|
11
11
|
__name: "ChartMenu",
|
|
12
12
|
props: {
|
|
13
13
|
items: {},
|
|
@@ -18,7 +18,7 @@ var P = { class: "chart-menu-trigger-area" }, pe = ["aria-label"], me = /* @__PU
|
|
|
18
18
|
},
|
|
19
19
|
setup(t) {
|
|
20
20
|
let n = t, i = () => n.forceDropdown || n.items.length > 1;
|
|
21
|
-
return (n, l) => (_(), a("div",
|
|
21
|
+
return (n, l) => (_(), a("div", F, [i() ? (_(), r(S(k), {
|
|
22
22
|
key: 1,
|
|
23
23
|
modal: !1
|
|
24
24
|
}, {
|
|
@@ -85,44 +85,44 @@ var P = { class: "chart-menu-trigger-area" }, pe = ["aria-label"], me = /* @__PU
|
|
|
85
85
|
"stroke-linecap": "round",
|
|
86
86
|
"stroke-linejoin": "round",
|
|
87
87
|
"aria-hidden": "true"
|
|
88
|
-
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8,
|
|
88
|
+
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, I))]));
|
|
89
89
|
}
|
|
90
|
-
}),
|
|
90
|
+
}), L = (e, t) => {
|
|
91
91
|
let n = e.__vccOpts || e;
|
|
92
92
|
for (let [e, r] of t) n[e] = r;
|
|
93
93
|
return n;
|
|
94
|
-
},
|
|
94
|
+
}, pe = /* @__PURE__ */ L(fe, [["__scopeId", "data-v-c74e2889"]]);
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region src/_shared/axes.ts
|
|
97
|
-
function
|
|
97
|
+
function R(e) {
|
|
98
98
|
return Math.round(e) + .5;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function me(e, t) {
|
|
101
101
|
let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
|
|
102
102
|
return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function he(e, t, n) {
|
|
105
105
|
if (!(n > 0) || !isFinite(n)) return [];
|
|
106
106
|
let r = [], i = Math.ceil(e / n) * n;
|
|
107
107
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
108
108
|
return r;
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
112
|
-
return Math.abs(e) >= 1e3 ?
|
|
110
|
+
var ge = new Intl.NumberFormat();
|
|
111
|
+
function _e(e) {
|
|
112
|
+
return Math.abs(e) >= 1e3 ? ge.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
|
|
113
113
|
}
|
|
114
114
|
//#endregion
|
|
115
115
|
//#region src/_shared/computeTicks.ts
|
|
116
|
-
function
|
|
116
|
+
function ve(e) {
|
|
117
117
|
let { min: t, max: n, ticks: r } = e;
|
|
118
118
|
if (t === n) return [];
|
|
119
119
|
let i = e.displayOffset ?? 0;
|
|
120
120
|
if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
|
|
121
|
-
if (typeof r == "number") return
|
|
122
|
-
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o =
|
|
123
|
-
return
|
|
121
|
+
if (typeof r == "number") return he(t + i, n + i, r).map((e) => e - i);
|
|
122
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = me(n - t, a);
|
|
123
|
+
return he(t + i, n + i, o).map((e) => e - i);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function ye(e, t, n, r) {
|
|
126
126
|
if (r === "log") {
|
|
127
127
|
let r = Math.log10(t), i = Math.log10(n) - r || 1;
|
|
128
128
|
return (Math.log10(e > 0 ? e : t) - r) / i;
|
|
@@ -130,7 +130,7 @@ function xe(e, t, n, r) {
|
|
|
130
130
|
let i = n - t || 1;
|
|
131
131
|
return (e - t) / i;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function be(e, t, n, r) {
|
|
134
134
|
if (n !== "log") return {
|
|
135
135
|
min: e,
|
|
136
136
|
max: t
|
|
@@ -141,7 +141,7 @@ function Se(e, t, n, r) {
|
|
|
141
141
|
max: t > 0 ? Math.max(t, i) : i
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function z(e) {
|
|
145
145
|
let { min: t, max: n, ticks: r } = e;
|
|
146
146
|
if (!(t > 0) || !(n > 0) || t === n) return [];
|
|
147
147
|
if (Array.isArray(r)) return r.filter((e) => e > 0 && e >= t && e <= n);
|
|
@@ -154,7 +154,7 @@ function L(e) {
|
|
|
154
154
|
}
|
|
155
155
|
//#endregion
|
|
156
156
|
//#region src/_shared/useChartSize.ts
|
|
157
|
-
function
|
|
157
|
+
function xe(e = {}) {
|
|
158
158
|
let t = v(null), n = v(0), r = v(0), i = null, a = null;
|
|
159
159
|
return h(() => {
|
|
160
160
|
t.value && (n.value = t.value.clientWidth, r.value = t.value.clientHeight, i = new ResizeObserver((t) => {
|
|
@@ -173,8 +173,8 @@ function Ce(e = {}) {
|
|
|
173
173
|
measuredHeight: r
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
var
|
|
177
|
-
function
|
|
176
|
+
var Se = .6, B = 8;
|
|
177
|
+
function V(e, t) {
|
|
178
178
|
return {
|
|
179
179
|
fontSize: e?.fontSize ?? t.fontSize,
|
|
180
180
|
fill: e?.color ?? "currentColor",
|
|
@@ -182,8 +182,8 @@ function z(e, t) {
|
|
|
182
182
|
fillOpacity: e?.color == null ? t.fillOpacity : void 0
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
var
|
|
186
|
-
function
|
|
185
|
+
var Ce = 7, we = 18, Te = 16;
|
|
186
|
+
function Ee(e) {
|
|
187
187
|
return e == null ? {
|
|
188
188
|
top: 0,
|
|
189
189
|
right: 0,
|
|
@@ -201,12 +201,12 @@ function Oe(e) {
|
|
|
201
201
|
left: e.left ?? 0
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
return
|
|
204
|
+
function De(e) {
|
|
205
|
+
return we + e.length * Ce;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Oe(e) {
|
|
208
208
|
let t = n(() => {
|
|
209
|
-
let t =
|
|
209
|
+
let t = Ee(e.extraPadding?.());
|
|
210
210
|
return {
|
|
211
211
|
left: (e.yLabel() ? 56 : 50) + t.left,
|
|
212
212
|
right: 10 + t.right
|
|
@@ -219,11 +219,11 @@ function Ae(e) {
|
|
|
219
219
|
};
|
|
220
220
|
let n = Math.max(0, r.value), i = [], a = 0, o = 0;
|
|
221
221
|
for (let e of t) {
|
|
222
|
-
let t =
|
|
222
|
+
let t = De(e);
|
|
223
223
|
o > 0 && o + t > n && (a++, o = 0), i.push({
|
|
224
224
|
x: o,
|
|
225
225
|
row: a
|
|
226
|
-
}), o += t +
|
|
226
|
+
}), o += t + Te;
|
|
227
227
|
}
|
|
228
228
|
return {
|
|
229
229
|
positions: i,
|
|
@@ -233,9 +233,9 @@ function Ae(e) {
|
|
|
233
233
|
let t = e.title();
|
|
234
234
|
if (!t) return 10;
|
|
235
235
|
let n = e.titleStyle?.()?.lineHeight ?? 18;
|
|
236
|
-
return t.split("\n").length * n +
|
|
236
|
+
return t.split("\n").length * n + B;
|
|
237
237
|
}), o = n(() => {
|
|
238
|
-
let n =
|
|
238
|
+
let n = Ee(e.extraPadding?.()), r = i.value.rowCount;
|
|
239
239
|
return {
|
|
240
240
|
top: a.value + r * 20 + n.top,
|
|
241
241
|
bottom: (e.xLabel() ? 38 : 30) + n.bottom,
|
|
@@ -264,10 +264,10 @@ function Ae(e) {
|
|
|
264
264
|
}
|
|
265
265
|
//#endregion
|
|
266
266
|
//#region src/tooltip-position.ts
|
|
267
|
-
var
|
|
268
|
-
function
|
|
267
|
+
var H = 16, ke = 8;
|
|
268
|
+
function Ae(e, t, n, r, i, a) {
|
|
269
269
|
if (i === "none") return {
|
|
270
|
-
left: e +
|
|
270
|
+
left: e + H,
|
|
271
271
|
top: t
|
|
272
272
|
};
|
|
273
273
|
let o = i === "chart" && a ? {
|
|
@@ -280,15 +280,15 @@ function Me(e, t, n, r, i, a) {
|
|
|
280
280
|
right: window.innerWidth,
|
|
281
281
|
top: 0,
|
|
282
282
|
bottom: window.innerHeight
|
|
283
|
-
}, s = e +
|
|
283
|
+
}, s = e + H + n > o.right - ke ? e - H - n : e + H, c = r / 2;
|
|
284
284
|
return {
|
|
285
285
|
left: s,
|
|
286
|
-
top: Math.min(Math.max(t, o.top +
|
|
286
|
+
top: Math.min(Math.max(t, o.top + ke + c), o.bottom - ke - c)
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
289
|
//#endregion
|
|
290
290
|
//#region src/_shared/useChartTooltip.ts
|
|
291
|
-
function
|
|
291
|
+
function U(e) {
|
|
292
292
|
let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null);
|
|
293
293
|
function s(e) {
|
|
294
294
|
return "touches" in e ? e.touches[0] ?? null : e;
|
|
@@ -309,7 +309,7 @@ function V(e) {
|
|
|
309
309
|
}
|
|
310
310
|
let s = i.value, c = e.containerRef.value;
|
|
311
311
|
if (!s || !c) return;
|
|
312
|
-
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } =
|
|
312
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = Ae(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
|
|
313
313
|
o.value = {
|
|
314
314
|
left: f - l.left,
|
|
315
315
|
top: p - l.top
|
|
@@ -355,69 +355,69 @@ function V(e) {
|
|
|
355
355
|
}
|
|
356
356
|
//#endregion
|
|
357
357
|
//#region src/ChartMenu/download.ts
|
|
358
|
-
function
|
|
358
|
+
function W(e, t) {
|
|
359
359
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
360
360
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
361
361
|
}
|
|
362
|
-
var
|
|
362
|
+
var G = [
|
|
363
363
|
"color",
|
|
364
364
|
"font-family",
|
|
365
365
|
"font-size",
|
|
366
366
|
"font-weight"
|
|
367
|
-
],
|
|
368
|
-
function
|
|
367
|
+
], je = ["fill", "stroke"];
|
|
368
|
+
function Me(e) {
|
|
369
369
|
let t = e.match(/^\s*var\(\s*(--[\w-]+)\s*(?:,\s*([^)]*?)\s*)?\)\s*$/);
|
|
370
370
|
if (!t) return e;
|
|
371
371
|
let [, n, r] = t;
|
|
372
372
|
return window.getComputedStyle(document.documentElement).getPropertyValue(n).trim() || (r ? r.trim() : e);
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function K(e) {
|
|
375
375
|
let t = e.cloneNode(!0);
|
|
376
376
|
t.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
377
377
|
let n = window.getComputedStyle(e), r = [];
|
|
378
|
-
for (let e of
|
|
378
|
+
for (let e of G) {
|
|
379
379
|
let t = n.getPropertyValue(e);
|
|
380
380
|
t && r.push(`${e}: ${t}`);
|
|
381
381
|
}
|
|
382
382
|
let i = t.getAttribute("style") ?? "";
|
|
383
383
|
t.setAttribute("style", [i, ...r].filter(Boolean).join("; "));
|
|
384
|
-
for (let e of t.querySelectorAll("*")) for (let t of
|
|
384
|
+
for (let e of t.querySelectorAll("*")) for (let t of je) {
|
|
385
385
|
let n = e.getAttribute(t);
|
|
386
|
-
!n || !n.includes("var(") || e.setAttribute(t,
|
|
386
|
+
!n || !n.includes("var(") || e.setAttribute(t, Me(n));
|
|
387
387
|
}
|
|
388
388
|
return t;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
let n =
|
|
392
|
-
|
|
390
|
+
function q(e, t) {
|
|
391
|
+
let n = K(e), r = new XMLSerializer().serializeToString(n);
|
|
392
|
+
W(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
let n =
|
|
394
|
+
function Ne(e, t) {
|
|
395
|
+
let n = K(e), r = new XMLSerializer().serializeToString(n), i = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(i), o = new Image(), s = e.width.baseVal.value || e.clientWidth, c = e.height.baseVal.value || e.clientHeight;
|
|
396
396
|
o.onload = () => {
|
|
397
397
|
let e = document.createElement("canvas");
|
|
398
398
|
e.width = s * 2, e.height = c * 2;
|
|
399
399
|
let n = e.getContext("2d");
|
|
400
400
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
401
|
-
e &&
|
|
401
|
+
e && W(e, `${t}.png`);
|
|
402
402
|
}), URL.revokeObjectURL(a);
|
|
403
403
|
}, o.src = a;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
|
|
405
|
+
function J(e, t) {
|
|
406
|
+
W(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
407
407
|
}
|
|
408
408
|
//#endregion
|
|
409
409
|
//#region src/_shared/useChartFullscreen.ts
|
|
410
|
-
var
|
|
411
|
-
function
|
|
412
|
-
typeof document > "u" || (
|
|
410
|
+
var Pe = 0, Fe = "";
|
|
411
|
+
function Ie() {
|
|
412
|
+
typeof document > "u" || (Pe === 0 && (Fe = document.body.style.overflow, document.body.style.overflow = "hidden"), Pe++);
|
|
413
413
|
}
|
|
414
|
-
function
|
|
415
|
-
typeof document > "u" ||
|
|
414
|
+
function Le() {
|
|
415
|
+
typeof document > "u" || Pe !== 0 && (Pe--, Pe === 0 && (document.body.style.overflow = Fe));
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function Re() {
|
|
418
418
|
let e = v(!1), t = !1;
|
|
419
419
|
function r(n) {
|
|
420
|
-
n !== e.value && (e.value = n, n && !t ? (
|
|
420
|
+
n !== e.value && (e.value = n, n && !t ? (Ie(), t = !0) : !n && t && (Le(), t = !1));
|
|
421
421
|
}
|
|
422
422
|
function i(t) {
|
|
423
423
|
if (t.key !== "Escape" || !e.value) return;
|
|
@@ -436,7 +436,7 @@ function J() {
|
|
|
436
436
|
return h(() => {
|
|
437
437
|
typeof document > "u" || document.addEventListener("keydown", i);
|
|
438
438
|
}), g(() => {
|
|
439
|
-
typeof document > "u" || (document.removeEventListener("keydown", i), t &&= (
|
|
439
|
+
typeof document > "u" || (document.removeEventListener("keydown", i), t &&= (Le(), !1));
|
|
440
440
|
}), {
|
|
441
441
|
isFullscreen: e,
|
|
442
442
|
toggle: s,
|
|
@@ -459,38 +459,49 @@ function ze(e) {
|
|
|
459
459
|
let n = e.legacyMenuLabel();
|
|
460
460
|
return typeof n == "string" ? n : "chart";
|
|
461
461
|
}
|
|
462
|
-
let i = e.fullscreen ?
|
|
462
|
+
let i = e.fullscreen ? Re() : null, a = n(() => {
|
|
463
|
+
let n = r(), a = [];
|
|
464
|
+
i && a.push(i.menuItem.value), a.push({
|
|
465
|
+
label: "Save as SVG",
|
|
466
|
+
action: () => {
|
|
467
|
+
t.value && q(t.value, n);
|
|
468
|
+
}
|
|
469
|
+
}, {
|
|
470
|
+
label: "Save as PNG",
|
|
471
|
+
action: () => {
|
|
472
|
+
t.value && Ne(t.value, n);
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
let o = e.downloadButton?.();
|
|
476
|
+
return !e.downloadLink() && !o && a.push({
|
|
477
|
+
label: "Download CSV",
|
|
478
|
+
action: () => J(e.getCsv(), n)
|
|
479
|
+
}), a;
|
|
480
|
+
}), o = n(() => {
|
|
481
|
+
if (e.downloadButton?.()) return null;
|
|
482
|
+
let t = e.downloadLink();
|
|
483
|
+
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
484
|
+
}), s = n(() => e.downloadButton?.() || !e.downloadLink() ? null : `data:text/csv;charset=utf-8,${encodeURIComponent(e.getCsv())}`), c = n(() => {
|
|
485
|
+
let t = e.downloadButton?.();
|
|
486
|
+
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
487
|
+
});
|
|
488
|
+
function l() {
|
|
489
|
+
J(e.getCsv(), r());
|
|
490
|
+
}
|
|
463
491
|
return {
|
|
464
492
|
svgRef: t,
|
|
465
|
-
items:
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
t.value && G(t.value, n);
|
|
471
|
-
}
|
|
472
|
-
}, {
|
|
473
|
-
label: "Save as PNG",
|
|
474
|
-
action: () => {
|
|
475
|
-
t.value && Fe(t.value, n);
|
|
476
|
-
}
|
|
477
|
-
}), e.downloadLink() || a.push({
|
|
478
|
-
label: "Download CSV",
|
|
479
|
-
action: () => K(e.getCsv(), n)
|
|
480
|
-
}), a;
|
|
481
|
-
}),
|
|
482
|
-
downloadLinkText: n(() => {
|
|
483
|
-
let t = e.downloadLink();
|
|
484
|
-
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
485
|
-
}),
|
|
486
|
-
csvHref: n(() => e.downloadLink() ? `data:text/csv;charset=utf-8,${encodeURIComponent(e.getCsv())}` : null),
|
|
493
|
+
items: a,
|
|
494
|
+
downloadLinkText: o,
|
|
495
|
+
csvHref: s,
|
|
496
|
+
downloadButtonText: c,
|
|
497
|
+
triggerCsvDownload: l,
|
|
487
498
|
resolvedFilename: r,
|
|
488
499
|
isFullscreen: i?.isFullscreen ?? v(!1)
|
|
489
500
|
};
|
|
490
501
|
}
|
|
491
502
|
//#endregion
|
|
492
503
|
//#region src/_shared/seriesCsv.ts
|
|
493
|
-
function
|
|
504
|
+
function Y(e) {
|
|
494
505
|
if (e.length === 0) return "";
|
|
495
506
|
let t = 0;
|
|
496
507
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -502,43 +513,43 @@ function Be(e) {
|
|
|
502
513
|
}
|
|
503
514
|
return i.join("\n");
|
|
504
515
|
}
|
|
505
|
-
function
|
|
516
|
+
function Be(e, t, n = "category") {
|
|
506
517
|
if (t.length === 0 || e.length === 0) return "";
|
|
507
518
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
508
519
|
for (let n = 0; n < e.length; n++) {
|
|
509
|
-
let i = [
|
|
520
|
+
let i = [Ve(e[n])];
|
|
510
521
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
511
522
|
r.push(i.join(","));
|
|
512
523
|
}
|
|
513
524
|
return r.join("\n");
|
|
514
525
|
}
|
|
515
|
-
function
|
|
526
|
+
function Ve(e) {
|
|
516
527
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
517
528
|
}
|
|
518
529
|
//#endregion
|
|
519
530
|
//#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
|
|
520
|
-
var
|
|
531
|
+
var X = {
|
|
521
532
|
class: "chart-annotations",
|
|
522
533
|
"pointer-events": "none"
|
|
523
|
-
},
|
|
534
|
+
}, He = ["stroke", "stroke-width"], Ue = [
|
|
524
535
|
"d",
|
|
525
536
|
"stroke",
|
|
526
537
|
"stroke-width"
|
|
527
|
-
],
|
|
538
|
+
], Z = [
|
|
528
539
|
"fill",
|
|
529
540
|
"stroke",
|
|
530
541
|
"stroke-width",
|
|
531
542
|
"transform"
|
|
532
|
-
],
|
|
543
|
+
], We = [
|
|
533
544
|
"stroke",
|
|
534
545
|
"stroke-width",
|
|
535
546
|
"stroke-dasharray"
|
|
536
|
-
],
|
|
547
|
+
], Ge = [
|
|
537
548
|
"d",
|
|
538
549
|
"stroke",
|
|
539
550
|
"stroke-width",
|
|
540
551
|
"stroke-dasharray"
|
|
541
|
-
],
|
|
552
|
+
], Ke = ["fill", "transform"], qe = [
|
|
542
553
|
"x",
|
|
543
554
|
"y",
|
|
544
555
|
"text-anchor",
|
|
@@ -547,7 +558,7 @@ var Ue = {
|
|
|
547
558
|
"fill",
|
|
548
559
|
"stroke",
|
|
549
560
|
"stroke-width"
|
|
550
|
-
],
|
|
561
|
+
], Je = ["x", "dy"], Ye = ["font-weight", "font-style"], Xe = 13, Ze = "normal", Qe = 700, $e = "var(--color-bg-0, #fff)", et = 3, tt = 1, nt = 4, rt = 6, it = 1.2, at = .35, ot = /* @__PURE__ */ l({
|
|
551
562
|
__name: "ChartAnnotations",
|
|
552
563
|
props: {
|
|
553
564
|
annotations: { default: () => [] },
|
|
@@ -584,7 +595,7 @@ var Ue = {
|
|
|
584
595
|
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
585
596
|
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
586
597
|
if (a && !r.bounds) continue;
|
|
587
|
-
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ??
|
|
598
|
+
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? Xe, g = t.fontWeight ?? Ze, _ = t.outlineColor ?? $e, v = t.outlineWidth ?? et, y = t.lineColor ?? m, ee = t.lineWidth ?? tt, b = s(t.lineDash), te = {
|
|
588
599
|
left: "start",
|
|
589
600
|
center: "middle",
|
|
590
601
|
right: "end"
|
|
@@ -599,7 +610,7 @@ var Ue = {
|
|
|
599
610
|
textX: d,
|
|
600
611
|
textY: p,
|
|
601
612
|
textAnchor: te,
|
|
602
|
-
dy: h *
|
|
613
|
+
dy: h * it,
|
|
603
614
|
fontSize: h,
|
|
604
615
|
fontWeight: g,
|
|
605
616
|
color: m,
|
|
@@ -665,11 +676,11 @@ var Ue = {
|
|
|
665
676
|
}
|
|
666
677
|
function f(e, t, n, r, i, a) {
|
|
667
678
|
if (a === "none") return { path: "" };
|
|
668
|
-
let o = n - e, s = r - t, c = r - i *
|
|
679
|
+
let o = n - e, s = r - t, c = r - i * at;
|
|
669
680
|
if (o === 0 || s === 0 || a === "straight") {
|
|
670
681
|
let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
|
|
671
|
-
if (l <=
|
|
672
|
-
let u = a / l, d = o / l, f = e + u *
|
|
682
|
+
if (l <= nt + rt) return { path: "" };
|
|
683
|
+
let u = a / l, d = o / l, f = e + u * nt, p = t + d * nt, m = n - u * rt, h = i - d * rt, g = Math.atan2(-d, -u) * 180 / Math.PI;
|
|
673
684
|
return {
|
|
674
685
|
path: `M${f},${p} L${m},${h}`,
|
|
675
686
|
arrow: {
|
|
@@ -680,8 +691,8 @@ var Ue = {
|
|
|
680
691
|
};
|
|
681
692
|
}
|
|
682
693
|
let l = c - t;
|
|
683
|
-
if (Math.abs(l) <=
|
|
684
|
-
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d *
|
|
694
|
+
if (Math.abs(l) <= nt || Math.abs(o) <= rt) return { path: "" };
|
|
695
|
+
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d * nt, m = n - u * rt, h = c, g = d > 0 ? -90 : 90;
|
|
685
696
|
return {
|
|
686
697
|
path: `M${f},${p} Q${f},${c} ${m},${h}`,
|
|
687
698
|
arrow: {
|
|
@@ -691,7 +702,7 @@ var Ue = {
|
|
|
691
702
|
}
|
|
692
703
|
};
|
|
693
704
|
}
|
|
694
|
-
return (t, n) => (_(), a("g",
|
|
705
|
+
return (t, n) => (_(), a("g", X, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
695
706
|
t.rule && t.outlineWidth > 0 ? (_(), a("line", d({
|
|
696
707
|
key: 0,
|
|
697
708
|
ref_for: !0
|
|
@@ -700,7 +711,7 @@ var Ue = {
|
|
|
700
711
|
stroke: t.outlineColor,
|
|
701
712
|
"stroke-width": t.lineWidth + t.outlineWidth,
|
|
702
713
|
"stroke-linecap": "round"
|
|
703
|
-
}), null, 16,
|
|
714
|
+
}), null, 16, He)) : i("", !0),
|
|
704
715
|
t.pointerPath && t.outlineWidth > 0 ? (_(), a("path", {
|
|
705
716
|
key: 1,
|
|
706
717
|
d: t.pointerPath,
|
|
@@ -709,7 +720,7 @@ var Ue = {
|
|
|
709
720
|
stroke: t.outlineColor,
|
|
710
721
|
"stroke-width": t.lineWidth + t.outlineWidth,
|
|
711
722
|
"stroke-linecap": "round"
|
|
712
|
-
}, null, 8,
|
|
723
|
+
}, null, 8, Ue)) : i("", !0),
|
|
713
724
|
t.arrowTip && t.outlineWidth > 0 ? (_(), a("polygon", {
|
|
714
725
|
key: 2,
|
|
715
726
|
points: "0,0 -6,-3 -6,3",
|
|
@@ -719,7 +730,7 @@ var Ue = {
|
|
|
719
730
|
"stroke-width": t.outlineWidth,
|
|
720
731
|
"stroke-linejoin": "round",
|
|
721
732
|
transform: t.arrowTransform
|
|
722
|
-
}, null, 8,
|
|
733
|
+
}, null, 8, Z)) : i("", !0),
|
|
723
734
|
t.rule ? (_(), a("line", d({
|
|
724
735
|
key: 3,
|
|
725
736
|
ref_for: !0
|
|
@@ -728,7 +739,7 @@ var Ue = {
|
|
|
728
739
|
"stroke-width": t.lineWidth,
|
|
729
740
|
"stroke-dasharray": t.lineDash,
|
|
730
741
|
"stroke-linecap": "round"
|
|
731
|
-
}), null, 16,
|
|
742
|
+
}), null, 16, We)) : i("", !0),
|
|
732
743
|
t.pointerPath ? (_(), a("path", {
|
|
733
744
|
key: 4,
|
|
734
745
|
d: t.pointerPath,
|
|
@@ -737,13 +748,13 @@ var Ue = {
|
|
|
737
748
|
"stroke-width": t.lineWidth,
|
|
738
749
|
"stroke-dasharray": t.lineDash,
|
|
739
750
|
"stroke-linecap": "round"
|
|
740
|
-
}, null, 8,
|
|
751
|
+
}, null, 8, Ge)) : i("", !0),
|
|
741
752
|
t.arrowTip ? (_(), a("polygon", {
|
|
742
753
|
key: 5,
|
|
743
754
|
points: "0,0 -6,-3 -6,3",
|
|
744
755
|
fill: t.lineColor,
|
|
745
756
|
transform: t.arrowTransform
|
|
746
|
-
}, null, 8,
|
|
757
|
+
}, null, 8, Ke)) : i("", !0),
|
|
747
758
|
o("text", {
|
|
748
759
|
x: t.textX,
|
|
749
760
|
y: t.textY,
|
|
@@ -761,35 +772,36 @@ var Ue = {
|
|
|
761
772
|
dy: r === 0 ? 0 : t.dy
|
|
762
773
|
}, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
|
|
763
774
|
key: t,
|
|
764
|
-
"font-weight": e.bold ?
|
|
775
|
+
"font-weight": e.bold ? Qe : void 0,
|
|
765
776
|
"font-style": e.italic ? "italic" : void 0
|
|
766
|
-
}, b(e.text), 9,
|
|
777
|
+
}, b(e.text), 9, Ye))), 128))], 8, Je))), 128))], 8, qe)
|
|
767
778
|
], 64))), 128))]));
|
|
768
779
|
}
|
|
769
|
-
}),
|
|
770
|
-
function
|
|
771
|
-
let { containerRef: t, measuredWidth: r, measuredHeight: i } =
|
|
780
|
+
}), st = 400, ct = 200;
|
|
781
|
+
function lt(e) {
|
|
782
|
+
let { containerRef: t, measuredWidth: r, measuredHeight: i } = xe({ debounce: e.debounce }), { svgRef: a, items: o, downloadLinkText: s, csvHref: c, downloadButtonText: l, triggerCsvDownload: u, resolvedFilename: d, isFullscreen: f } = ze({
|
|
772
783
|
filename: e.filename,
|
|
773
784
|
legacyMenuLabel: e.menu,
|
|
774
785
|
getCsv: e.getCsv,
|
|
775
786
|
downloadLink: e.downloadLink,
|
|
787
|
+
downloadButton: e.downloadButton,
|
|
776
788
|
fullscreen: !0
|
|
777
|
-
}),
|
|
778
|
-
if (
|
|
789
|
+
}), p = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value || st)), m = n(() => {
|
|
790
|
+
if (f.value && i.value > 0) {
|
|
779
791
|
let t = e.extraBelowHeight?.() ?? 0;
|
|
780
792
|
return i.value - t;
|
|
781
793
|
}
|
|
782
|
-
return e.height() ??
|
|
783
|
-
}), { padding:
|
|
794
|
+
return e.height() ?? ct;
|
|
795
|
+
}), { padding: h, legendY: g, inlineLegendLayout: _, innerW: v, innerH: y, bounds: ee } = Oe({
|
|
784
796
|
title: e.title,
|
|
785
797
|
titleStyle: e.titleStyle,
|
|
786
798
|
xLabel: e.xLabel,
|
|
787
799
|
yLabel: e.yLabel,
|
|
788
800
|
inlineLegendLabels: e.inlineLegendLabels,
|
|
789
|
-
width: () =>
|
|
790
|
-
height: () =>
|
|
801
|
+
width: () => p.value,
|
|
802
|
+
height: () => m.value,
|
|
791
803
|
extraPadding: e.chartPadding
|
|
792
|
-
}), { hoverIndex:
|
|
804
|
+
}), { hoverIndex: b, tooltipRef: te, tooltipPos: x, handlers: S } = U({
|
|
793
805
|
enabled: e.hasTooltipSlot,
|
|
794
806
|
trigger: e.tooltipTrigger,
|
|
795
807
|
clamp: () => e.tooltipClamp() ?? "chart",
|
|
@@ -800,96 +812,98 @@ function ut(e) {
|
|
|
800
812
|
return {
|
|
801
813
|
containerRef: t,
|
|
802
814
|
svgRef: a,
|
|
803
|
-
width:
|
|
804
|
-
height:
|
|
805
|
-
padding:
|
|
806
|
-
legendY:
|
|
807
|
-
inlineLegendLayout:
|
|
808
|
-
innerW:
|
|
809
|
-
innerH:
|
|
810
|
-
bounds:
|
|
811
|
-
hoverIndex:
|
|
812
|
-
tooltipRef:
|
|
813
|
-
tooltipPos:
|
|
814
|
-
tooltipHandlers:
|
|
815
|
+
width: p,
|
|
816
|
+
height: m,
|
|
817
|
+
padding: h,
|
|
818
|
+
legendY: g,
|
|
819
|
+
inlineLegendLayout: _,
|
|
820
|
+
innerW: v,
|
|
821
|
+
innerH: y,
|
|
822
|
+
bounds: ee,
|
|
823
|
+
hoverIndex: b,
|
|
824
|
+
tooltipRef: te,
|
|
825
|
+
tooltipPos: x,
|
|
826
|
+
tooltipHandlers: S,
|
|
815
827
|
menuItems: o,
|
|
816
828
|
downloadLinkText: s,
|
|
817
829
|
csvHref: c,
|
|
818
|
-
|
|
819
|
-
|
|
830
|
+
downloadButtonText: l,
|
|
831
|
+
triggerCsvDownload: u,
|
|
832
|
+
menuFilename: d,
|
|
833
|
+
isFullscreen: f,
|
|
820
834
|
measuredHeight: i
|
|
821
835
|
};
|
|
822
836
|
}
|
|
823
|
-
function
|
|
837
|
+
function ut(e, t) {
|
|
824
838
|
return (n) => {
|
|
825
839
|
let r = e();
|
|
826
840
|
if (r !== void 0) return ne(n, r);
|
|
827
841
|
let i = t();
|
|
828
|
-
return i === void 0 ?
|
|
842
|
+
return i === void 0 ? _e(n) : ne(n, i);
|
|
829
843
|
};
|
|
830
844
|
}
|
|
831
845
|
//#endregion
|
|
832
846
|
//#region src/_shared/dateAxis.ts
|
|
833
|
-
var
|
|
847
|
+
var dt = /^(\d{4})-(\d{2})-(\d{2})$/, ft = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, Q = 1e3, pt = 60 * Q, mt = 60 * pt, ht = 24 * mt, gt = 7 * ht, _t = 30 * ht, vt = 365 * ht, yt = [
|
|
834
848
|
{
|
|
835
849
|
unit: "second",
|
|
836
850
|
step: 1,
|
|
837
|
-
ms: 1 *
|
|
851
|
+
ms: 1 * Q
|
|
838
852
|
},
|
|
839
853
|
{
|
|
840
854
|
unit: "second",
|
|
841
855
|
step: 5,
|
|
842
|
-
ms: 5 *
|
|
856
|
+
ms: 5 * Q
|
|
843
857
|
},
|
|
844
858
|
{
|
|
845
859
|
unit: "second",
|
|
846
860
|
step: 15,
|
|
847
|
-
ms: 15 *
|
|
861
|
+
ms: 15 * Q
|
|
848
862
|
},
|
|
849
863
|
{
|
|
850
864
|
unit: "second",
|
|
851
865
|
step: 30,
|
|
852
|
-
ms: 30 *
|
|
866
|
+
ms: 30 * Q
|
|
853
867
|
},
|
|
854
868
|
{
|
|
855
869
|
unit: "minute",
|
|
856
870
|
step: 1,
|
|
857
|
-
ms: 1 *
|
|
871
|
+
ms: 1 * pt
|
|
858
872
|
},
|
|
859
873
|
{
|
|
860
874
|
unit: "minute",
|
|
861
875
|
step: 5,
|
|
862
|
-
ms: 5 *
|
|
876
|
+
ms: 5 * pt
|
|
863
877
|
},
|
|
864
878
|
{
|
|
865
879
|
unit: "minute",
|
|
866
880
|
step: 15,
|
|
867
|
-
ms: 15 *
|
|
881
|
+
ms: 15 * pt
|
|
868
882
|
},
|
|
869
883
|
{
|
|
870
884
|
unit: "minute",
|
|
871
885
|
step: 30,
|
|
872
|
-
ms: 30 *
|
|
886
|
+
ms: 30 * pt
|
|
873
887
|
},
|
|
874
888
|
{
|
|
875
889
|
unit: "hour",
|
|
876
890
|
step: 1,
|
|
877
|
-
ms: 1 *
|
|
891
|
+
ms: 1 * mt
|
|
878
892
|
},
|
|
879
893
|
{
|
|
880
894
|
unit: "hour",
|
|
881
895
|
step: 3,
|
|
882
|
-
ms: 3 *
|
|
896
|
+
ms: 3 * mt
|
|
883
897
|
},
|
|
884
898
|
{
|
|
885
899
|
unit: "hour",
|
|
886
900
|
step: 6,
|
|
887
|
-
ms: 6 *
|
|
901
|
+
ms: 6 * mt
|
|
888
902
|
},
|
|
889
903
|
{
|
|
890
904
|
unit: "hour",
|
|
891
905
|
step: 12,
|
|
892
|
-
ms: 12 *
|
|
906
|
+
ms: 12 * mt
|
|
893
907
|
},
|
|
894
908
|
{
|
|
895
909
|
unit: "day",
|
|
@@ -963,17 +977,17 @@ function xt(e, t) {
|
|
|
963
977
|
return Number.isFinite(t) ? t : null;
|
|
964
978
|
}
|
|
965
979
|
if (typeof e != "string") return null;
|
|
966
|
-
let n =
|
|
980
|
+
let n = dt.exec(e);
|
|
967
981
|
if (n) {
|
|
968
982
|
let e = +n[1], r = n[2] - 1, i = +n[3];
|
|
969
983
|
return t === "utc" ? Date.UTC(e, r, i) : new Date(e, r, i).getTime();
|
|
970
984
|
}
|
|
971
|
-
let r =
|
|
985
|
+
let r = ft.exec(e);
|
|
972
986
|
if (r) {
|
|
973
987
|
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];
|
|
974
988
|
if (l) {
|
|
975
989
|
if (l === "Z" || l === "z") return Date.UTC(e, n, i, a, o, s, c);
|
|
976
|
-
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) *
|
|
990
|
+
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * pt;
|
|
977
991
|
return Date.UTC(e, n, i, a, o, s, c) - d;
|
|
978
992
|
}
|
|
979
993
|
return t === "utc" ? Date.UTC(e, n, i, a, o, s, c) : new Date(e, n, i, a, o, s, c).getTime();
|
|
@@ -981,7 +995,7 @@ function xt(e, t) {
|
|
|
981
995
|
return null;
|
|
982
996
|
}
|
|
983
997
|
function St(e) {
|
|
984
|
-
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ?
|
|
998
|
+
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? dt.test(e) || ft.test(e) : !1;
|
|
985
999
|
}
|
|
986
1000
|
function Ct(e, t) {
|
|
987
1001
|
if (e.length === 0) return !1;
|
|
@@ -999,9 +1013,9 @@ function wt(e, t) {
|
|
|
999
1013
|
function Tt(e, t, n) {
|
|
1000
1014
|
let r = new Date(e);
|
|
1001
1015
|
if (n === "utc") switch (t) {
|
|
1002
|
-
case "second": return Math.floor(e /
|
|
1003
|
-
case "minute": return Math.floor(e /
|
|
1004
|
-
case "hour": return Math.floor(e /
|
|
1016
|
+
case "second": return Math.floor(e / Q) * Q;
|
|
1017
|
+
case "minute": return Math.floor(e / pt) * pt;
|
|
1018
|
+
case "hour": return Math.floor(e / mt) * mt;
|
|
1005
1019
|
case "day": return Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate());
|
|
1006
1020
|
case "week": {
|
|
1007
1021
|
let e = (r.getUTCDay() + 6) % 7;
|
|
@@ -1011,8 +1025,8 @@ function Tt(e, t, n) {
|
|
|
1011
1025
|
case "year": return Date.UTC(r.getUTCFullYear(), 0, 1);
|
|
1012
1026
|
}
|
|
1013
1027
|
switch (t) {
|
|
1014
|
-
case "second": return Math.floor(e /
|
|
1015
|
-
case "minute": return Math.floor(e /
|
|
1028
|
+
case "second": return Math.floor(e / Q) * Q;
|
|
1029
|
+
case "minute": return Math.floor(e / pt) * pt;
|
|
1016
1030
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
|
|
1017
1031
|
case "day": return new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime();
|
|
1018
1032
|
case "week": {
|
|
@@ -1024,9 +1038,9 @@ function Tt(e, t, n) {
|
|
|
1024
1038
|
}
|
|
1025
1039
|
}
|
|
1026
1040
|
function Et(e, t, n, r) {
|
|
1027
|
-
if (t === "second") return e + n *
|
|
1028
|
-
if (t === "minute") return e + n *
|
|
1029
|
-
if (t === "hour" && r === "utc") return e + n *
|
|
1041
|
+
if (t === "second") return e + n * Q;
|
|
1042
|
+
if (t === "minute") return e + n * pt;
|
|
1043
|
+
if (t === "hour" && r === "utc") return e + n * mt;
|
|
1030
1044
|
if (t === "week" && r === "utc") return e + n * gt;
|
|
1031
1045
|
let i = new Date(e);
|
|
1032
1046
|
if (r === "utc") switch (t) {
|
|
@@ -1299,7 +1313,7 @@ var Pt = {
|
|
|
1299
1313
|
], pn = { class: "line-chart-tooltip" }, mn = {
|
|
1300
1314
|
key: 0,
|
|
1301
1315
|
class: "line-chart-tooltip-label"
|
|
1302
|
-
}, hn = ["href", "download"], gn = 36, _n = 12, vn = 7, yn = 16, bn = /* @__PURE__ */
|
|
1316
|
+
}, hn = ["href", "download"], gn = 36, _n = 12, vn = 7, yn = 16, bn = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
1303
1317
|
__name: "LineChart",
|
|
1304
1318
|
props: {
|
|
1305
1319
|
y: {},
|
|
@@ -1341,6 +1355,7 @@ var Pt = {
|
|
|
1341
1355
|
csv: {},
|
|
1342
1356
|
filename: {},
|
|
1343
1357
|
downloadLink: { type: [Boolean, String] },
|
|
1358
|
+
downloadButton: { type: [Boolean, String] },
|
|
1344
1359
|
annotations: {},
|
|
1345
1360
|
chartPadding: {}
|
|
1346
1361
|
},
|
|
@@ -1358,7 +1373,7 @@ var Pt = {
|
|
|
1358
1373
|
for (let t = 0; t < e.length; t++) r[t] = xt(e[t], n) ?? NaN;
|
|
1359
1374
|
return r;
|
|
1360
1375
|
}
|
|
1361
|
-
let C =
|
|
1376
|
+
let C = ut(() => l.tooltipValueFormat, () => l.yTickFormat), w = n(() => l.timezone ?? "utc"), T = n(() => {
|
|
1362
1377
|
let e = w.value, t = !1, n = !1;
|
|
1363
1378
|
for (let r of v(l)) {
|
|
1364
1379
|
if (n = !0, !Ct(r, e)) {
|
|
@@ -1422,7 +1437,7 @@ var Pt = {
|
|
|
1422
1437
|
});
|
|
1423
1438
|
function M(e) {
|
|
1424
1439
|
let { min: t, max: n } = ae.value, r = n - t || 1;
|
|
1425
|
-
return
|
|
1440
|
+
return G.value.left + (e - t) / r * K.value;
|
|
1426
1441
|
}
|
|
1427
1442
|
let oe = n(() => {
|
|
1428
1443
|
let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
|
|
@@ -1439,18 +1454,18 @@ var Pt = {
|
|
|
1439
1454
|
range: 1
|
|
1440
1455
|
};
|
|
1441
1456
|
l.yMin != null && l.yMin < e && (e = l.yMin);
|
|
1442
|
-
let i =
|
|
1457
|
+
let i = be(e, t, l.yScaleType, n);
|
|
1443
1458
|
return {
|
|
1444
1459
|
min: i.min,
|
|
1445
1460
|
max: i.max,
|
|
1446
1461
|
range: i.max - i.min || 1
|
|
1447
1462
|
};
|
|
1448
1463
|
});
|
|
1449
|
-
function
|
|
1464
|
+
function N(e) {
|
|
1450
1465
|
let { min: t, max: n } = oe.value;
|
|
1451
|
-
return
|
|
1466
|
+
return G.value.top + q.value - ye(e, t, n, l.yScaleType) * q.value;
|
|
1452
1467
|
}
|
|
1453
|
-
function
|
|
1468
|
+
function se(e) {
|
|
1454
1469
|
let t = e.data;
|
|
1455
1470
|
if (t.length === 0) return "";
|
|
1456
1471
|
let n = "", r = !1;
|
|
@@ -1460,23 +1475,23 @@ var Pt = {
|
|
|
1460
1475
|
r = !1;
|
|
1461
1476
|
continue;
|
|
1462
1477
|
}
|
|
1463
|
-
let o = M(a), s =
|
|
1478
|
+
let o = M(a), s = N(t[i]);
|
|
1464
1479
|
n += r ? `L${o},${s}` : `M${o},${s}`, r = !0;
|
|
1465
1480
|
}
|
|
1466
1481
|
return n;
|
|
1467
1482
|
}
|
|
1468
|
-
function
|
|
1483
|
+
function ce(e) {
|
|
1469
1484
|
let t = e.data, n = [];
|
|
1470
1485
|
for (let r = 0; r < t.length; r++) {
|
|
1471
1486
|
let i = A(e, r);
|
|
1472
1487
|
!isFinite(t[r]) || !isFinite(i) || n.push({
|
|
1473
1488
|
x: M(i),
|
|
1474
|
-
y:
|
|
1489
|
+
y: N(t[r])
|
|
1475
1490
|
});
|
|
1476
1491
|
}
|
|
1477
1492
|
return n;
|
|
1478
1493
|
}
|
|
1479
|
-
function
|
|
1494
|
+
function le(e) {
|
|
1480
1495
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
1481
1496
|
if (t === 0) return "";
|
|
1482
1497
|
let n = [], r = [];
|
|
@@ -1484,45 +1499,45 @@ var Pt = {
|
|
|
1484
1499
|
r.length && n.push(r);
|
|
1485
1500
|
let i = "";
|
|
1486
1501
|
for (let t of n) {
|
|
1487
|
-
i += `M${M(ie(e, t[0]))},${
|
|
1488
|
-
for (let n = 1; n < t.length; n++) i += `L${M(ie(e, t[n]))},${
|
|
1489
|
-
for (let n = t.length - 1; n >= 0; n--) i += `L${M(ie(e, t[n]))},${
|
|
1502
|
+
i += `M${M(ie(e, t[0]))},${N(e.upper[t[0]])}`;
|
|
1503
|
+
for (let n = 1; n < t.length; n++) i += `L${M(ie(e, t[n]))},${N(e.upper[t[n]])}`;
|
|
1504
|
+
for (let n = t.length - 1; n >= 0; n--) i += `L${M(ie(e, t[n]))},${N(e.lower[t[n]])}`;
|
|
1490
1505
|
i += "Z";
|
|
1491
1506
|
}
|
|
1492
1507
|
return i;
|
|
1493
1508
|
}
|
|
1494
|
-
function
|
|
1509
|
+
function P(e, t) {
|
|
1495
1510
|
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && D.value[e.seriesIndex] || D.value[0];
|
|
1496
1511
|
return M(r ? A(r, n) : n);
|
|
1497
1512
|
}
|
|
1498
|
-
function
|
|
1499
|
-
let n =
|
|
1513
|
+
function ue(e, t = !0) {
|
|
1514
|
+
let n = G.value.top + q.value;
|
|
1500
1515
|
if (e.seriesIndex == null) {
|
|
1501
|
-
let t =
|
|
1502
|
-
return t > r ? "" : `M${t},${
|
|
1516
|
+
let t = P(e, "start"), r = P(e, "end");
|
|
1517
|
+
return t > r ? "" : `M${t},${G.value.top}L${r},${G.value.top}L${r},${n}L${t},${n}Z`;
|
|
1503
1518
|
}
|
|
1504
1519
|
let r = D.value[e.seriesIndex];
|
|
1505
1520
|
if (!r) return "";
|
|
1506
1521
|
let i = Math.max(0, e.startIndex), a = Math.min(r.data.length - 1, e.endIndex);
|
|
1507
1522
|
if (i > a) return "";
|
|
1508
|
-
let o = `M${M(A(r, i))},${
|
|
1509
|
-
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${M(A(r, e))},${
|
|
1523
|
+
let o = `M${M(A(r, i))},${N(r.data[i])}`;
|
|
1524
|
+
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${M(A(r, e))},${N(r.data[e])}`);
|
|
1510
1525
|
return t && (o += `L${M(A(r, a))},${n}`, o += `L${M(A(r, i))},${n}`, o += "Z"), o;
|
|
1511
1526
|
}
|
|
1512
|
-
let
|
|
1527
|
+
let de = n(() => {
|
|
1513
1528
|
let e = l.areaSections;
|
|
1514
1529
|
if (!e?.length) return {
|
|
1515
1530
|
labels: [],
|
|
1516
1531
|
extraHeight: 0
|
|
1517
1532
|
};
|
|
1518
|
-
let t = [], n =
|
|
1533
|
+
let t = [], n = G.value.left + K.value;
|
|
1519
1534
|
for (let r of e) {
|
|
1520
1535
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
1521
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * vn, o =
|
|
1536
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * vn, o = P(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : D.value[r.seriesIndex]?.color ?? "currentColor"), u = V({
|
|
1522
1537
|
color: l,
|
|
1523
1538
|
fontWeight: 600,
|
|
1524
1539
|
...r.inlineLabelStyle
|
|
1525
|
-
}, { fontSize: 11 }), d =
|
|
1540
|
+
}, { fontSize: 11 }), d = V(r.inlineDescriptionStyle, {
|
|
1526
1541
|
fontSize: 11,
|
|
1527
1542
|
fillOpacity: .6
|
|
1528
1543
|
});
|
|
@@ -1554,7 +1569,7 @@ var Pt = {
|
|
|
1554
1569
|
labels: t,
|
|
1555
1570
|
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * gn + _n
|
|
1556
1571
|
};
|
|
1557
|
-
}),
|
|
1572
|
+
}), F = n(() => {
|
|
1558
1573
|
let e = [];
|
|
1559
1574
|
for (let t of D.value) !t.legend || t.showInLegend === !1 || e.push({
|
|
1560
1575
|
label: t.legend,
|
|
@@ -1574,38 +1589,38 @@ var Pt = {
|
|
|
1574
1589
|
});
|
|
1575
1590
|
}
|
|
1576
1591
|
return e;
|
|
1577
|
-
}),
|
|
1578
|
-
let { min: e, max: t } = oe.value, n = (e) => l.yTickFormat === void 0 ?
|
|
1592
|
+
}), I = n(() => F.value.map((e) => e.label)), fe = n(() => W.value + de.value.extraHeight), L = n(() => G.value.top + q.value + G.value.bottom + _n), me = n(() => {
|
|
1593
|
+
let { min: e, max: t } = oe.value, n = (e) => l.yTickFormat === void 0 ? _e(e) : ne(e, l.yTickFormat);
|
|
1579
1594
|
return e === t ? [{
|
|
1580
1595
|
value: n(e),
|
|
1581
|
-
y:
|
|
1582
|
-
}] : (l.yScaleType === "log" ?
|
|
1596
|
+
y: R(G.value.top + q.value / 2)
|
|
1597
|
+
}] : (l.yScaleType === "log" ? z({
|
|
1583
1598
|
min: e,
|
|
1584
1599
|
max: t,
|
|
1585
1600
|
ticks: l.yTicks
|
|
1586
|
-
}) :
|
|
1601
|
+
}) : ve({
|
|
1587
1602
|
min: e,
|
|
1588
1603
|
max: t,
|
|
1589
1604
|
ticks: l.yTicks,
|
|
1590
|
-
targetTickCount:
|
|
1605
|
+
targetTickCount: q.value / 50
|
|
1591
1606
|
})).map((e) => ({
|
|
1592
1607
|
value: n(e),
|
|
1593
|
-
y:
|
|
1608
|
+
y: R(N(e))
|
|
1594
1609
|
}));
|
|
1595
1610
|
});
|
|
1596
|
-
function
|
|
1611
|
+
function he(e, t, n) {
|
|
1597
1612
|
let r = l.xTickFormat;
|
|
1598
1613
|
if (E.value) return typeof r == "function" ? r(e, t) : Nt(e, r, w.value, n);
|
|
1599
1614
|
let i = e + j.value;
|
|
1600
|
-
return r === void 0 ? !k.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] :
|
|
1615
|
+
return r === void 0 ? !k.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : _e(i) : typeof r == "function" ? r(i, t) : ne(i, r);
|
|
1601
1616
|
}
|
|
1602
|
-
let
|
|
1617
|
+
let ge = n(() => {
|
|
1603
1618
|
let { min: e, max: t } = ae.value;
|
|
1604
1619
|
if (e === t) return [];
|
|
1605
|
-
let n = E.value, r = n ? 0 : j.value, i = re.value, a =
|
|
1620
|
+
let n = E.value, r = n ? 0 : j.value, i = re.value, a = K.value / 80, o, s;
|
|
1606
1621
|
if (n) {
|
|
1607
1622
|
let n = Dt(e, t, a, w.value);
|
|
1608
|
-
s = n.unit, o =
|
|
1623
|
+
s = n.unit, o = ve({
|
|
1609
1624
|
min: e,
|
|
1610
1625
|
max: t,
|
|
1611
1626
|
ticks: n.values
|
|
@@ -1614,31 +1629,31 @@ var Pt = {
|
|
|
1614
1629
|
let e = Math.max(3, Math.floor(a)), t = Math.max(1, Math.round((i - 1) / e));
|
|
1615
1630
|
o = [];
|
|
1616
1631
|
for (let e = 0; e < i; e += t) o.push(e);
|
|
1617
|
-
} else o =
|
|
1632
|
+
} else o = ve({
|
|
1618
1633
|
min: e,
|
|
1619
1634
|
max: t,
|
|
1620
1635
|
ticks: l.xTicks,
|
|
1621
1636
|
targetTickCount: a,
|
|
1622
1637
|
displayOffset: r
|
|
1623
1638
|
});
|
|
1624
|
-
let c =
|
|
1639
|
+
let c = G.value.left, u = G.value.left + K.value;
|
|
1625
1640
|
return o.map((e, t) => {
|
|
1626
|
-
let n =
|
|
1641
|
+
let n = R(M(e)), r = "middle";
|
|
1627
1642
|
return n - c <= 1 ? r = "start" : u - n <= 1 && (r = "end"), {
|
|
1628
|
-
value:
|
|
1643
|
+
value: he(e, t, s),
|
|
1629
1644
|
x: n,
|
|
1630
1645
|
anchor: r
|
|
1631
1646
|
};
|
|
1632
1647
|
});
|
|
1633
1648
|
});
|
|
1634
|
-
function
|
|
1635
|
-
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv :
|
|
1649
|
+
function xe() {
|
|
1650
|
+
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : Y(D.value);
|
|
1636
1651
|
}
|
|
1637
|
-
let
|
|
1638
|
-
let e =
|
|
1652
|
+
let B = n(() => !!l.tooltipData || !!l.tooltipTrigger), Ce = n(() => {
|
|
1653
|
+
let e = J.value, t = D.value[0];
|
|
1639
1654
|
return e === null || !t ? null : A(t, e);
|
|
1640
|
-
}),
|
|
1641
|
-
function
|
|
1655
|
+
}), we = n(() => Ce.value === null ? 0 : M(Ce.value));
|
|
1656
|
+
function Te(e, t) {
|
|
1642
1657
|
let n = e.data.length;
|
|
1643
1658
|
if (n === 0) return null;
|
|
1644
1659
|
let r = 0, i = Infinity;
|
|
@@ -1650,30 +1665,30 @@ var Pt = {
|
|
|
1650
1665
|
}
|
|
1651
1666
|
return i === Infinity ? null : r;
|
|
1652
1667
|
}
|
|
1653
|
-
let
|
|
1654
|
-
let e =
|
|
1668
|
+
let Ee = n(() => {
|
|
1669
|
+
let e = Ce.value;
|
|
1655
1670
|
if (e === null) return [];
|
|
1656
1671
|
let t = [];
|
|
1657
1672
|
for (let n of D.value) {
|
|
1658
1673
|
if (n.showInTooltip === !1) continue;
|
|
1659
|
-
let r =
|
|
1674
|
+
let r = Te(n, e);
|
|
1660
1675
|
if (r === null) continue;
|
|
1661
1676
|
let i = n.data[r];
|
|
1662
1677
|
isFinite(i) && t.push({
|
|
1663
1678
|
x: M(A(n, r)),
|
|
1664
|
-
y:
|
|
1679
|
+
y: N(i),
|
|
1665
1680
|
color: n.color ?? "currentColor"
|
|
1666
1681
|
});
|
|
1667
1682
|
}
|
|
1668
1683
|
return t;
|
|
1669
|
-
}),
|
|
1670
|
-
let e =
|
|
1684
|
+
}), De = n(() => {
|
|
1685
|
+
let e = J.value, t = Ce.value;
|
|
1671
1686
|
if (e === null || t === null) return null;
|
|
1672
|
-
let n =
|
|
1687
|
+
let n = he(t, e), r = D.value, i = [];
|
|
1673
1688
|
for (let e = 0; e < r.length; e++) {
|
|
1674
1689
|
let n = r[e];
|
|
1675
1690
|
if (n.showInTooltip === !1) continue;
|
|
1676
|
-
let a =
|
|
1691
|
+
let a = Te(n, t);
|
|
1677
1692
|
i.push({
|
|
1678
1693
|
value: a === null ? NaN : Number(n.data[a]),
|
|
1679
1694
|
color: n.color ?? "currentColor",
|
|
@@ -1687,21 +1702,21 @@ var Pt = {
|
|
|
1687
1702
|
data: l.tooltipData?.[e] ?? null
|
|
1688
1703
|
};
|
|
1689
1704
|
});
|
|
1690
|
-
function
|
|
1705
|
+
function Oe(e, t) {
|
|
1691
1706
|
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1692
1707
|
x: M(e - j.value),
|
|
1693
|
-
y:
|
|
1708
|
+
y: N(t)
|
|
1694
1709
|
};
|
|
1695
1710
|
}
|
|
1696
|
-
function
|
|
1697
|
-
let t =
|
|
1711
|
+
function H(e) {
|
|
1712
|
+
let t = ke.value?.getBoundingClientRect();
|
|
1698
1713
|
if (!t) return null;
|
|
1699
1714
|
let n = D.value[0];
|
|
1700
1715
|
if (!n || n.data.length === 0) return null;
|
|
1701
1716
|
let { min: r, max: i } = ae.value, a = i - r || 1;
|
|
1702
|
-
return
|
|
1717
|
+
return Te(n, r + (e - t.left - G.value.left) / K.value * a);
|
|
1703
1718
|
}
|
|
1704
|
-
let { containerRef:
|
|
1719
|
+
let { containerRef: ke, svgRef: Ae, width: U, height: W, padding: G, legendY: je, inlineLegendLayout: Me, innerW: K, innerH: q, bounds: Ne, hoverIndex: J, tooltipRef: Pe, tooltipPos: Fe, tooltipHandlers: Ie, menuItems: Le, downloadLinkText: Re, csvHref: ze, downloadButtonText: Be, triggerCsvDownload: Ve, menuFilename: X, isFullscreen: He } = lt({
|
|
1705
1720
|
width: () => l.width,
|
|
1706
1721
|
height: () => l.height,
|
|
1707
1722
|
title: () => l.title,
|
|
@@ -1714,18 +1729,19 @@ var Pt = {
|
|
|
1714
1729
|
tooltipClamp: () => l.tooltipClamp,
|
|
1715
1730
|
filename: () => l.filename,
|
|
1716
1731
|
downloadLink: () => l.downloadLink,
|
|
1732
|
+
downloadButton: () => l.downloadButton,
|
|
1717
1733
|
chartPadding: () => l.chartPadding,
|
|
1718
|
-
inlineLegendLabels: () =>
|
|
1719
|
-
hasTooltipSlot: () =>
|
|
1720
|
-
getCsv:
|
|
1721
|
-
pointerToIndex:
|
|
1734
|
+
inlineLegendLabels: () => I.value,
|
|
1735
|
+
hasTooltipSlot: () => B.value,
|
|
1736
|
+
getCsv: xe,
|
|
1737
|
+
pointerToIndex: H,
|
|
1722
1738
|
onHover: (e) => h("hover", e),
|
|
1723
|
-
extraBelowHeight: () =>
|
|
1724
|
-
}), Ue = n(() =>
|
|
1739
|
+
extraBelowHeight: () => de.value.extraHeight
|
|
1740
|
+
}), Ue = n(() => V(l.axisLabelStyle, { fontSize: 13 })), Z = n(() => V(l.tickLabelStyle, {
|
|
1725
1741
|
fontSize: 10,
|
|
1726
|
-
fillOpacity:
|
|
1727
|
-
})), We = n(() =>
|
|
1728
|
-
let e = l.titleStyle, t = e?.align ?? "left", n =
|
|
1742
|
+
fillOpacity: Se
|
|
1743
|
+
})), We = n(() => V(l.legendStyle, { fontSize: 11 })), Ge = n(() => {
|
|
1744
|
+
let e = l.titleStyle, t = e?.align ?? "left", n = Ne.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
1729
1745
|
return {
|
|
1730
1746
|
lines: (l.title ?? "").split("\n"),
|
|
1731
1747
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -1735,9 +1751,9 @@ var Pt = {
|
|
|
1735
1751
|
x: r,
|
|
1736
1752
|
anchor: i
|
|
1737
1753
|
};
|
|
1738
|
-
}),
|
|
1739
|
-
let e =
|
|
1740
|
-
return
|
|
1754
|
+
}), Ke = n(() => {
|
|
1755
|
+
let e = Me.value.positions, t = G.value.left, n = je.value;
|
|
1756
|
+
return F.value.map((r, i) => {
|
|
1741
1757
|
let a = e[i];
|
|
1742
1758
|
return {
|
|
1743
1759
|
...r,
|
|
@@ -1748,34 +1764,34 @@ var Pt = {
|
|
|
1748
1764
|
});
|
|
1749
1765
|
return (n, c) => (_(), a("div", {
|
|
1750
1766
|
ref_key: "containerRef",
|
|
1751
|
-
ref:
|
|
1767
|
+
ref: ke,
|
|
1752
1768
|
class: f(["line-chart-wrapper", { "is-fullscreen": S(He) }])
|
|
1753
1769
|
}, [
|
|
1754
|
-
t.menu ? (_(), r(
|
|
1770
|
+
t.menu ? (_(), r(pe, {
|
|
1755
1771
|
key: 0,
|
|
1756
|
-
items: S(
|
|
1772
|
+
items: S(Le)
|
|
1757
1773
|
}, null, 8, ["items"])) : i("", !0),
|
|
1758
1774
|
o("div", Pt, b(S(He) ? "Chart expanded to fill window" : ""), 1),
|
|
1759
1775
|
(_(), a("svg", {
|
|
1760
1776
|
ref_key: "svgRef",
|
|
1761
|
-
ref:
|
|
1762
|
-
width: S(
|
|
1763
|
-
height:
|
|
1777
|
+
ref: Ae,
|
|
1778
|
+
width: S(U),
|
|
1779
|
+
height: fe.value
|
|
1764
1780
|
}, [
|
|
1765
1781
|
t.title ? (_(), a("text", {
|
|
1766
1782
|
key: 0,
|
|
1767
|
-
x:
|
|
1768
|
-
y:
|
|
1769
|
-
"text-anchor":
|
|
1770
|
-
"font-size":
|
|
1771
|
-
"font-weight":
|
|
1772
|
-
fill:
|
|
1773
|
-
}, [(_(!0), a(e, null, y(
|
|
1783
|
+
x: Ge.value.x,
|
|
1784
|
+
y: Ge.value.lineHeight,
|
|
1785
|
+
"text-anchor": Ge.value.anchor,
|
|
1786
|
+
"font-size": Ge.value.fontSize,
|
|
1787
|
+
"font-weight": Ge.value.fontWeight,
|
|
1788
|
+
fill: Ge.value.color
|
|
1789
|
+
}, [(_(!0), a(e, null, y(Ge.value.lines, (e, t) => (_(), a("tspan", {
|
|
1774
1790
|
key: t,
|
|
1775
|
-
x:
|
|
1776
|
-
dy: t === 0 ? 0 :
|
|
1791
|
+
x: Ge.value.x,
|
|
1792
|
+
dy: t === 0 ? 0 : Ge.value.lineHeight
|
|
1777
1793
|
}, b(e), 9, Lt))), 128))], 8, It)) : i("", !0),
|
|
1778
|
-
|
|
1794
|
+
Ke.value.length > 0 ? (_(), a("g", Rt, [(_(!0), a(e, null, y(Ke.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
|
|
1779
1795
|
key: 0,
|
|
1780
1796
|
x1: t.x,
|
|
1781
1797
|
y1: t.y,
|
|
@@ -1801,76 +1817,76 @@ var Pt = {
|
|
|
1801
1817
|
"font-weight": We.value.fontWeight
|
|
1802
1818
|
}, b(t.label), 9, Vt)], 64))), 128))])) : i("", !0),
|
|
1803
1819
|
o("line", {
|
|
1804
|
-
x1: S(
|
|
1805
|
-
y1: S(
|
|
1806
|
-
x2: S(
|
|
1807
|
-
y2: S(
|
|
1820
|
+
x1: S(R)(S(G).left),
|
|
1821
|
+
y1: S(R)(S(G).top),
|
|
1822
|
+
x2: S(R)(S(G).left),
|
|
1823
|
+
y2: S(R)(S(G).top + S(q)),
|
|
1808
1824
|
stroke: "currentColor",
|
|
1809
1825
|
"stroke-opacity": "0.3"
|
|
1810
1826
|
}, null, 8, Ht),
|
|
1811
1827
|
o("line", {
|
|
1812
|
-
x1: S(
|
|
1813
|
-
y1: S(
|
|
1814
|
-
x2: S(
|
|
1815
|
-
y2: S(
|
|
1828
|
+
x1: S(R)(S(G).left),
|
|
1829
|
+
y1: S(R)(S(G).top + S(q)),
|
|
1830
|
+
x2: S(R)(S(G).left + S(K)),
|
|
1831
|
+
y2: S(R)(S(G).top + S(q)),
|
|
1816
1832
|
stroke: "currentColor",
|
|
1817
1833
|
"stroke-opacity": "0.3"
|
|
1818
1834
|
}, null, 8, Ut),
|
|
1819
|
-
t.yGrid ? (_(!0), a(e, { key: 2 }, y(
|
|
1835
|
+
t.yGrid ? (_(!0), a(e, { key: 2 }, y(me.value, (e, t) => (_(), a("line", {
|
|
1820
1836
|
key: "yg" + t,
|
|
1821
|
-
x1: S(
|
|
1837
|
+
x1: S(G).left,
|
|
1822
1838
|
y1: e.y,
|
|
1823
|
-
x2: S(
|
|
1839
|
+
x2: S(G).left + S(K),
|
|
1824
1840
|
y2: e.y,
|
|
1825
1841
|
stroke: "currentColor",
|
|
1826
1842
|
"stroke-opacity": "0.1"
|
|
1827
1843
|
}, null, 8, Wt))), 128)) : i("", !0),
|
|
1828
|
-
t.xGrid ? (_(!0), a(e, { key: 3 }, y(
|
|
1844
|
+
t.xGrid ? (_(!0), a(e, { key: 3 }, y(ge.value, (e, t) => (_(), a("line", {
|
|
1829
1845
|
key: "xg" + t,
|
|
1830
1846
|
x1: e.x,
|
|
1831
|
-
y1: S(
|
|
1847
|
+
y1: S(G).top,
|
|
1832
1848
|
x2: e.x,
|
|
1833
|
-
y2: S(
|
|
1849
|
+
y2: S(G).top + S(q),
|
|
1834
1850
|
stroke: "currentColor",
|
|
1835
1851
|
"stroke-opacity": "0.1"
|
|
1836
1852
|
}, null, 8, Gt))), 128)) : i("", !0),
|
|
1837
|
-
(_(!0), a(e, null, y(
|
|
1853
|
+
(_(!0), a(e, null, y(me.value, (e, t) => (_(), a("text", {
|
|
1838
1854
|
key: "y" + t,
|
|
1839
1855
|
"data-testid": "y-tick",
|
|
1840
|
-
x: S(
|
|
1856
|
+
x: S(G).left - 6,
|
|
1841
1857
|
y: e.y,
|
|
1842
1858
|
"text-anchor": "end",
|
|
1843
1859
|
"dominant-baseline": "middle",
|
|
1844
|
-
"font-size":
|
|
1845
|
-
fill:
|
|
1846
|
-
"font-weight":
|
|
1847
|
-
"fill-opacity":
|
|
1860
|
+
"font-size": Z.value.fontSize,
|
|
1861
|
+
fill: Z.value.fill,
|
|
1862
|
+
"font-weight": Z.value.fontWeight,
|
|
1863
|
+
"fill-opacity": Z.value.fillOpacity
|
|
1848
1864
|
}, b(e.value), 9, Kt))), 128)),
|
|
1849
1865
|
t.yLabel ? (_(), a("text", {
|
|
1850
1866
|
key: 4,
|
|
1851
1867
|
x: 0,
|
|
1852
1868
|
y: 0,
|
|
1853
|
-
transform: `translate(14, ${S(
|
|
1869
|
+
transform: `translate(14, ${S(G).top + S(q) / 2}) rotate(-90)`,
|
|
1854
1870
|
"text-anchor": "middle",
|
|
1855
1871
|
"font-size": Ue.value.fontSize,
|
|
1856
1872
|
fill: Ue.value.fill,
|
|
1857
1873
|
"font-weight": Ue.value.fontWeight
|
|
1858
1874
|
}, b(t.yLabel), 9, qt)) : i("", !0),
|
|
1859
|
-
(_(!0), a(e, null, y(
|
|
1875
|
+
(_(!0), a(e, null, y(ge.value, (e, t) => (_(), a("text", {
|
|
1860
1876
|
key: "x" + t,
|
|
1861
1877
|
"data-testid": "x-tick",
|
|
1862
1878
|
x: e.x,
|
|
1863
|
-
y: S(
|
|
1879
|
+
y: S(G).top + S(q) + 16,
|
|
1864
1880
|
"text-anchor": e.anchor,
|
|
1865
|
-
"font-size":
|
|
1866
|
-
fill:
|
|
1867
|
-
"font-weight":
|
|
1868
|
-
"fill-opacity":
|
|
1881
|
+
"font-size": Z.value.fontSize,
|
|
1882
|
+
fill: Z.value.fill,
|
|
1883
|
+
"font-weight": Z.value.fontWeight,
|
|
1884
|
+
"fill-opacity": Z.value.fillOpacity
|
|
1869
1885
|
}, b(e.value), 9, Jt))), 128)),
|
|
1870
1886
|
t.xLabel ? (_(), a("text", {
|
|
1871
1887
|
key: 5,
|
|
1872
|
-
x: S(
|
|
1873
|
-
y: S(
|
|
1888
|
+
x: S(G).left + S(K) / 2,
|
|
1889
|
+
y: S(W) - 4,
|
|
1874
1890
|
"text-anchor": "middle",
|
|
1875
1891
|
"font-size": Ue.value.fontSize,
|
|
1876
1892
|
fill: Ue.value.fill,
|
|
@@ -1878,7 +1894,7 @@ var Pt = {
|
|
|
1878
1894
|
}, b(t.xLabel), 9, Yt)) : i("", !0),
|
|
1879
1895
|
(_(!0), a(e, null, y(O.value, (e, t) => (_(), a("path", {
|
|
1880
1896
|
key: "area" + t,
|
|
1881
|
-
d:
|
|
1897
|
+
d: le(e),
|
|
1882
1898
|
fill: e.color ?? "currentColor",
|
|
1883
1899
|
"fill-opacity": e.opacity ?? .2,
|
|
1884
1900
|
stroke: "none"
|
|
@@ -1886,7 +1902,7 @@ var Pt = {
|
|
|
1886
1902
|
(_(!0), a(e, null, y(D.value, (n, r) => (_(), a(e, { key: r }, [
|
|
1887
1903
|
n.line !== !1 && n.outline ? (_(), a("path", {
|
|
1888
1904
|
key: 0,
|
|
1889
|
-
d:
|
|
1905
|
+
d: se(n),
|
|
1890
1906
|
fill: "none",
|
|
1891
1907
|
stroke: "var(--color-bg-0, #fff)",
|
|
1892
1908
|
"stroke-width": (n.strokeWidth ?? 1.5) + 4,
|
|
@@ -1896,7 +1912,7 @@ var Pt = {
|
|
|
1896
1912
|
}, null, 8, Zt)) : i("", !0),
|
|
1897
1913
|
n.line === !1 ? i("", !0) : (_(), a("path", {
|
|
1898
1914
|
key: 1,
|
|
1899
|
-
d:
|
|
1915
|
+
d: se(n),
|
|
1900
1916
|
fill: "none",
|
|
1901
1917
|
stroke: n.color ?? "currentColor",
|
|
1902
1918
|
"stroke-width": n.strokeWidth ?? 1.5,
|
|
@@ -1904,7 +1920,7 @@ var Pt = {
|
|
|
1904
1920
|
"stroke-dasharray": n.dashed ? "6 3" : void 0,
|
|
1905
1921
|
style: m(n.blendMode ? { mixBlendMode: n.blendMode } : void 0)
|
|
1906
1922
|
}, null, 12, Qt)),
|
|
1907
|
-
n.dots ? (_(!0), a(e, { key: 2 }, y(
|
|
1923
|
+
n.dots ? (_(!0), a(e, { key: 2 }, y(ce(n), (e, r) => (_(), a("circle", {
|
|
1908
1924
|
key: r,
|
|
1909
1925
|
cx: e.x,
|
|
1910
1926
|
cy: e.y,
|
|
@@ -1917,65 +1933,65 @@ var Pt = {
|
|
|
1917
1933
|
], 64))), 128)),
|
|
1918
1934
|
(_(!0), a(e, null, y(t.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
1919
1935
|
o("path", {
|
|
1920
|
-
d:
|
|
1936
|
+
d: ue(t),
|
|
1921
1937
|
fill: t.color ?? (t.seriesIndex == null ? "#999" : D.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
1922
1938
|
"fill-opacity": t.opacity ?? .15,
|
|
1923
1939
|
stroke: "none"
|
|
1924
1940
|
}, null, 8, en),
|
|
1925
1941
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
1926
1942
|
key: 0,
|
|
1927
|
-
d:
|
|
1943
|
+
d: ue(t, !1),
|
|
1928
1944
|
fill: "none",
|
|
1929
1945
|
stroke: t.color ?? D.value[t.seriesIndex]?.color ?? "currentColor",
|
|
1930
1946
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1931
1947
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1932
1948
|
}, null, 8, tn)),
|
|
1933
1949
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
1934
|
-
x1: S(
|
|
1935
|
-
y1: S(
|
|
1936
|
-
x2: S(
|
|
1937
|
-
y2: S(
|
|
1950
|
+
x1: S(R)(P(t, "start")),
|
|
1951
|
+
y1: S(G).top,
|
|
1952
|
+
x2: S(R)(P(t, "start")),
|
|
1953
|
+
y2: S(G).top + S(q),
|
|
1938
1954
|
stroke: t.color ?? "#999",
|
|
1939
1955
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1940
1956
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1941
1957
|
}, null, 8, nn), o("line", {
|
|
1942
|
-
x1: S(
|
|
1943
|
-
y1: S(
|
|
1944
|
-
x2: S(
|
|
1945
|
-
y2: S(
|
|
1958
|
+
x1: S(R)(P(t, "end")),
|
|
1959
|
+
y1: S(G).top,
|
|
1960
|
+
x2: S(R)(P(t, "end")),
|
|
1961
|
+
y2: S(G).top + S(q),
|
|
1946
1962
|
stroke: t.color ?? "#999",
|
|
1947
1963
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1948
1964
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1949
1965
|
}, null, 8, rn)], 64)) : i("", !0),
|
|
1950
1966
|
o("line", {
|
|
1951
|
-
x1: S(
|
|
1952
|
-
y1: S(
|
|
1953
|
-
x2: S(
|
|
1954
|
-
y2: S(
|
|
1967
|
+
x1: S(R)(P(t, "start")),
|
|
1968
|
+
y1: S(G).top + S(q) - 4,
|
|
1969
|
+
x2: S(R)(P(t, "start")),
|
|
1970
|
+
y2: S(G).top + S(q) + 4,
|
|
1955
1971
|
stroke: "currentColor",
|
|
1956
1972
|
"stroke-opacity": "0.4"
|
|
1957
1973
|
}, null, 8, an),
|
|
1958
1974
|
o("line", {
|
|
1959
|
-
x1: S(
|
|
1960
|
-
y1: S(
|
|
1961
|
-
x2: S(
|
|
1962
|
-
y2: S(
|
|
1975
|
+
x1: S(R)(P(t, "end")),
|
|
1976
|
+
y1: S(G).top + S(q) - 4,
|
|
1977
|
+
x2: S(R)(P(t, "end")),
|
|
1978
|
+
y2: S(G).top + S(q) + 4,
|
|
1963
1979
|
stroke: "currentColor",
|
|
1964
1980
|
"stroke-opacity": "0.4"
|
|
1965
1981
|
}, null, 8, on)
|
|
1966
1982
|
], 64))), 128)),
|
|
1967
|
-
|
|
1983
|
+
B.value && S(J) !== null ? (_(), a("line", {
|
|
1968
1984
|
key: 6,
|
|
1969
|
-
x1: S(
|
|
1970
|
-
y1: S(
|
|
1971
|
-
x2: S(
|
|
1972
|
-
y2: S(
|
|
1985
|
+
x1: S(R)(we.value),
|
|
1986
|
+
y1: S(G).top,
|
|
1987
|
+
x2: S(R)(we.value),
|
|
1988
|
+
y2: S(G).top + S(q),
|
|
1973
1989
|
stroke: "currentColor",
|
|
1974
1990
|
"stroke-opacity": "0.3",
|
|
1975
1991
|
"stroke-dasharray": "4 2",
|
|
1976
1992
|
"pointer-events": "none"
|
|
1977
1993
|
}, null, 8, sn)) : i("", !0),
|
|
1978
|
-
(_(!0), a(e, null, y(
|
|
1994
|
+
(_(!0), a(e, null, y(Ee.value, (e, t) => (_(), a("circle", {
|
|
1979
1995
|
key: "hd" + t,
|
|
1980
1996
|
cx: e.x,
|
|
1981
1997
|
cy: e.y,
|
|
@@ -1985,28 +2001,28 @@ var Pt = {
|
|
|
1985
2001
|
"stroke-width": "2",
|
|
1986
2002
|
"pointer-events": "none"
|
|
1987
2003
|
}, null, 8, cn))), 128)),
|
|
1988
|
-
|
|
2004
|
+
B.value ? (_(), a("rect", d({
|
|
1989
2005
|
key: 7,
|
|
1990
|
-
x: S(
|
|
1991
|
-
y: S(
|
|
1992
|
-
width: S(
|
|
1993
|
-
height: S(
|
|
2006
|
+
x: S(G).left,
|
|
2007
|
+
y: S(G).top,
|
|
2008
|
+
width: S(K),
|
|
2009
|
+
height: S(q),
|
|
1994
2010
|
fill: "transparent",
|
|
1995
2011
|
style: {
|
|
1996
2012
|
cursor: "crosshair",
|
|
1997
2013
|
"touch-action": "none"
|
|
1998
2014
|
}
|
|
1999
|
-
}, te(S(
|
|
2000
|
-
t.annotations && t.annotations.length > 0 ? (_(), r(S(
|
|
2015
|
+
}, te(S(Ie), !0)), null, 16, ln)) : i("", !0),
|
|
2016
|
+
t.annotations && t.annotations.length > 0 ? (_(), r(S(ot), {
|
|
2001
2017
|
key: 8,
|
|
2002
2018
|
annotations: t.annotations,
|
|
2003
|
-
project:
|
|
2004
|
-
bounds: S(
|
|
2019
|
+
project: Oe,
|
|
2020
|
+
bounds: S(Ne)
|
|
2005
2021
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
2006
|
-
(_(!0), a(e, null, y(
|
|
2022
|
+
(_(!0), a(e, null, y(de.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
2007
2023
|
o("circle", {
|
|
2008
2024
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
2009
|
-
cy:
|
|
2025
|
+
cy: L.value + e.row * gn + 4,
|
|
2010
2026
|
r: "4",
|
|
2011
2027
|
fill: e.color,
|
|
2012
2028
|
"fill-opacity": e.fillOpacity,
|
|
@@ -2016,7 +2032,7 @@ var Pt = {
|
|
|
2016
2032
|
e.labelText ? (_(), a("text", {
|
|
2017
2033
|
key: 0,
|
|
2018
2034
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2019
|
-
y:
|
|
2035
|
+
y: L.value + e.row * gn + 8,
|
|
2020
2036
|
"font-size": e.labelStyle.fontSize,
|
|
2021
2037
|
"font-weight": e.labelStyle.fontWeight,
|
|
2022
2038
|
fill: e.labelStyle.fill
|
|
@@ -2024,7 +2040,7 @@ var Pt = {
|
|
|
2024
2040
|
e.descText ? (_(), a("text", {
|
|
2025
2041
|
key: 1,
|
|
2026
2042
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2027
|
-
y:
|
|
2043
|
+
y: L.value + e.row * gn + 22,
|
|
2028
2044
|
"font-size": e.descStyle.fontSize,
|
|
2029
2045
|
"font-weight": e.descStyle.fontWeight,
|
|
2030
2046
|
fill: e.descStyle.fill,
|
|
@@ -2032,35 +2048,41 @@ var Pt = {
|
|
|
2032
2048
|
}, b(e.descText), 9, fn)) : i("", !0)
|
|
2033
2049
|
]))), 128))
|
|
2034
2050
|
], 8, Ft)),
|
|
2035
|
-
|
|
2051
|
+
B.value && S(J) !== null && De.value ? (_(), a("div", {
|
|
2036
2052
|
key: 1,
|
|
2037
2053
|
ref_key: "tooltipRef",
|
|
2038
|
-
ref:
|
|
2054
|
+
ref: Pe,
|
|
2039
2055
|
class: "chart-tooltip-content",
|
|
2040
2056
|
style: m({
|
|
2041
2057
|
position: "absolute",
|
|
2042
2058
|
top: "0",
|
|
2043
2059
|
left: "0",
|
|
2044
2060
|
willChange: "transform",
|
|
2045
|
-
transform: S(
|
|
2046
|
-
visibility: S(
|
|
2061
|
+
transform: S(Fe) ? `translate3d(${S(Fe).left}px, ${S(Fe).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2062
|
+
visibility: S(Fe) ? "visible" : "hidden"
|
|
2047
2063
|
})
|
|
2048
|
-
}, [ee(n.$slots, "tooltip", p(u(
|
|
2064
|
+
}, [ee(n.$slots, "tooltip", p(u(De.value)), () => [o("div", pn, [De.value.xLabel ? (_(), a("div", mn, b(De.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(De.value.values, (e) => (_(), a("div", {
|
|
2049
2065
|
key: e.seriesIndex,
|
|
2050
2066
|
class: "line-chart-tooltip-row"
|
|
2051
2067
|
}, [o("span", {
|
|
2052
2068
|
class: "line-chart-tooltip-swatch",
|
|
2053
2069
|
style: m({ background: e.color })
|
|
2054
2070
|
}, null, 4), s(" " + b(isFinite(e.value) ? S(C)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2055
|
-
S(
|
|
2071
|
+
S(Re) ? (_(), a("a", {
|
|
2056
2072
|
key: 2,
|
|
2057
2073
|
class: "line-chart-download-link",
|
|
2058
2074
|
href: S(ze),
|
|
2059
|
-
download: `${S(
|
|
2060
|
-
}, b(S(
|
|
2075
|
+
download: `${S(X)()}.csv`
|
|
2076
|
+
}, b(S(Re)), 9, hn)) : i("", !0),
|
|
2077
|
+
S(Be) ? (_(), a("button", {
|
|
2078
|
+
key: 3,
|
|
2079
|
+
type: "button",
|
|
2080
|
+
class: "line-chart-download-button",
|
|
2081
|
+
onClick: c[0] ||= (...e) => S(Ve) && S(Ve)(...e)
|
|
2082
|
+
}, b(S(Be)), 1)) : i("", !0)
|
|
2061
2083
|
], 2));
|
|
2062
2084
|
}
|
|
2063
|
-
}), [["__scopeId", "data-v-
|
|
2085
|
+
}), [["__scopeId", "data-v-0d24242d"]]), xn = {
|
|
2064
2086
|
class: "chart-sr-only",
|
|
2065
2087
|
"aria-live": "polite"
|
|
2066
2088
|
}, Sn = ["width", "height"], Cn = [
|
|
@@ -2176,7 +2198,7 @@ var Pt = {
|
|
|
2176
2198
|
], Un = { class: "bar-chart-tooltip" }, Wn = {
|
|
2177
2199
|
key: 0,
|
|
2178
2200
|
class: "bar-chart-tooltip-label"
|
|
2179
|
-
}, Gn = ["href", "download"], Kn = /* @__PURE__ */
|
|
2201
|
+
}, Gn = ["href", "download"], Kn = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
2180
2202
|
__name: "BarChart",
|
|
2181
2203
|
props: {
|
|
2182
2204
|
data: {},
|
|
@@ -2219,6 +2241,7 @@ var Pt = {
|
|
|
2219
2241
|
csv: {},
|
|
2220
2242
|
filename: {},
|
|
2221
2243
|
downloadLink: { type: [Boolean, String] },
|
|
2244
|
+
downloadButton: { type: [Boolean, String] },
|
|
2222
2245
|
annotations: {},
|
|
2223
2246
|
chartPadding: {}
|
|
2224
2247
|
},
|
|
@@ -2279,13 +2302,13 @@ var Pt = {
|
|
|
2279
2302
|
isFinite(e) || (e = 0), isFinite(t) || (t = 0);
|
|
2280
2303
|
let i = l.valueMin ?? 0;
|
|
2281
2304
|
l.valueScaleType === "log" ? i > 0 && i < e && (e = i) : i < e && (e = i);
|
|
2282
|
-
let a =
|
|
2305
|
+
let a = be(e, t, l.valueScaleType, n);
|
|
2283
2306
|
return {
|
|
2284
2307
|
min: a.min,
|
|
2285
2308
|
max: a.max,
|
|
2286
2309
|
range: a.max - a.min || 1
|
|
2287
2310
|
};
|
|
2288
|
-
}), O = n(() => E.value ?
|
|
2311
|
+
}), O = n(() => E.value ? U.value : W.value), re = n(() => E.value ? W.value : U.value), k = n(() => {
|
|
2289
2312
|
let e = C.value;
|
|
2290
2313
|
return e > 0 ? O.value / e : 0;
|
|
2291
2314
|
}), A = n(() => k.value * (1 - l.barPadding)), ie = n(() => {
|
|
@@ -2296,15 +2319,15 @@ var Pt = {
|
|
|
2296
2319
|
return Math.max(1, (A.value - t) / e);
|
|
2297
2320
|
});
|
|
2298
2321
|
function j(e) {
|
|
2299
|
-
return (E.value ?
|
|
2322
|
+
return (E.value ? H.value.left : H.value.top) + e * k.value;
|
|
2300
2323
|
}
|
|
2301
2324
|
let ae = n(() => {
|
|
2302
2325
|
let { min: e, max: t } = D.value, n = l.valueMin ?? 0;
|
|
2303
2326
|
return M(Math.max(e, Math.min(t, n)));
|
|
2304
2327
|
});
|
|
2305
2328
|
function M(e) {
|
|
2306
|
-
let { min: t, max: n } = D.value, r =
|
|
2307
|
-
return E.value ?
|
|
2329
|
+
let { min: t, max: n } = D.value, r = ye(e, t, n, l.valueScaleType);
|
|
2330
|
+
return E.value ? H.value.top + W.value - r * W.value : H.value.left + r * U.value;
|
|
2308
2331
|
}
|
|
2309
2332
|
function oe(e, t, n, r, i, a, o, s, c, l) {
|
|
2310
2333
|
let u = Math.min(e, t), d = Math.abs(e - t);
|
|
@@ -2332,7 +2355,7 @@ var Pt = {
|
|
|
2332
2355
|
seriesIndex: l
|
|
2333
2356
|
};
|
|
2334
2357
|
}
|
|
2335
|
-
let
|
|
2358
|
+
let N = n(() => {
|
|
2336
2359
|
let e = [], t = x.value, n = t.length;
|
|
2337
2360
|
if (n === 0) return e;
|
|
2338
2361
|
let r = C.value, i = k.value, a = A.value, o = ie.value, s = (i - a) / 2, c = ae.value;
|
|
@@ -2344,22 +2367,22 @@ var Pt = {
|
|
|
2344
2367
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
2345
2368
|
if (!isFinite(l)) continue;
|
|
2346
2369
|
let u = l >= 0 ? o : s, d = u + l;
|
|
2347
|
-
e.push(oe(M(u), M(d), r, a, n.color ??
|
|
2370
|
+
e.push(oe(M(u), M(d), r, a, n.color ?? I(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
|
|
2348
2371
|
}
|
|
2349
2372
|
} else if (l.layout === "overlay") for (let o = 0; o < n; o++) {
|
|
2350
2373
|
let n = t[o], s = Number(n.data[i] ?? NaN);
|
|
2351
|
-
isFinite(s) && e.push(oe(c, M(s), r, a, n.color ??
|
|
2374
|
+
isFinite(s) && e.push(oe(c, M(s), r, a, n.color ?? I(o), n.opacity ?? 1, n.blendMode, s, i, o));
|
|
2352
2375
|
}
|
|
2353
2376
|
else for (let a = 0; a < n; a++) {
|
|
2354
2377
|
let s = t[a], u = Number(s.data[i] ?? NaN);
|
|
2355
2378
|
if (!isFinite(u)) continue;
|
|
2356
2379
|
let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
|
|
2357
|
-
e.push(oe(c, M(u), d, o, s.color ??
|
|
2380
|
+
e.push(oe(c, M(u), d, o, s.color ?? I(a), s.opacity ?? 1, s.blendMode, u, i, a));
|
|
2358
2381
|
}
|
|
2359
2382
|
}
|
|
2360
2383
|
return e;
|
|
2361
2384
|
});
|
|
2362
|
-
function
|
|
2385
|
+
function se(e) {
|
|
2363
2386
|
let t = Infinity, n = -Infinity;
|
|
2364
2387
|
for (let r of e.data) {
|
|
2365
2388
|
let e = Number(r);
|
|
@@ -2370,33 +2393,33 @@ var Pt = {
|
|
|
2370
2393
|
max: n
|
|
2371
2394
|
};
|
|
2372
2395
|
}
|
|
2373
|
-
function
|
|
2374
|
-
let r = (E.value ?
|
|
2396
|
+
function ce(e, t, n) {
|
|
2397
|
+
let r = (E.value ? H.value.left : H.value.top) + (e + .5) * k.value, i = n.max - n.min || 1, a = (t - n.min) / i;
|
|
2375
2398
|
return E.value ? {
|
|
2376
2399
|
x: r,
|
|
2377
|
-
y:
|
|
2400
|
+
y: H.value.top + W.value - a * W.value
|
|
2378
2401
|
} : {
|
|
2379
|
-
x:
|
|
2402
|
+
x: H.value.left + a * U.value,
|
|
2380
2403
|
y: r
|
|
2381
2404
|
};
|
|
2382
2405
|
}
|
|
2383
|
-
let
|
|
2406
|
+
let le = n(() => {
|
|
2384
2407
|
let e = l.summaryLines;
|
|
2385
2408
|
return !e || e.length === 0 ? [] : e.map((e, t) => ({
|
|
2386
2409
|
data: e.data ?? g,
|
|
2387
2410
|
x: e.x,
|
|
2388
|
-
color: e.color ??
|
|
2411
|
+
color: e.color ?? de(t),
|
|
2389
2412
|
strokeWidth: e.strokeWidth ?? 2,
|
|
2390
2413
|
dashed: e.dashed ?? !1,
|
|
2391
2414
|
opacity: e.opacity ?? 1,
|
|
2392
2415
|
blendMode: e.blendMode,
|
|
2393
2416
|
dots: e.dots ?? !1,
|
|
2394
2417
|
dotRadius: e.dotRadius ?? (e.strokeWidth ?? 2) + 1,
|
|
2395
|
-
extent:
|
|
2418
|
+
extent: se(e),
|
|
2396
2419
|
legend: e.legend,
|
|
2397
2420
|
showInLegend: e.showInLegend !== !1
|
|
2398
2421
|
}));
|
|
2399
|
-
}),
|
|
2422
|
+
}), P = n(() => k.value === 0 ? [] : le.value.map((e) => {
|
|
2400
2423
|
let t = [], n = "", r = !1;
|
|
2401
2424
|
for (let i = 0; i < e.data.length; i++) {
|
|
2402
2425
|
let a = Number(e.data[i]), o = e.x ? Number(e.x[i]) : i;
|
|
@@ -2404,7 +2427,7 @@ var Pt = {
|
|
|
2404
2427
|
r = !1;
|
|
2405
2428
|
continue;
|
|
2406
2429
|
}
|
|
2407
|
-
let s =
|
|
2430
|
+
let s = ce(o, a, e.extent);
|
|
2408
2431
|
t.push(s), n += r ? `L${s.x},${s.y}` : `M${s.x},${s.y}`, r = !0;
|
|
2409
2432
|
}
|
|
2410
2433
|
return {
|
|
@@ -2412,16 +2435,16 @@ var Pt = {
|
|
|
2412
2435
|
pathD: n,
|
|
2413
2436
|
points: t
|
|
2414
2437
|
};
|
|
2415
|
-
})),
|
|
2438
|
+
})), ue = [
|
|
2416
2439
|
"var(--color-fg-1, #111)",
|
|
2417
2440
|
"var(--color-danger, #ef4444)",
|
|
2418
2441
|
"var(--color-success, #10b981)",
|
|
2419
2442
|
"var(--color-info, #6366f1)"
|
|
2420
2443
|
];
|
|
2421
|
-
function
|
|
2422
|
-
return
|
|
2444
|
+
function de(e) {
|
|
2445
|
+
return ue[e % ue.length];
|
|
2423
2446
|
}
|
|
2424
|
-
let
|
|
2447
|
+
let F = [
|
|
2425
2448
|
"var(--color-primary, #3b82f6)",
|
|
2426
2449
|
"var(--color-accent, #f59e0b)",
|
|
2427
2450
|
"var(--color-success, #10b981)",
|
|
@@ -2429,36 +2452,36 @@ var Pt = {
|
|
|
2429
2452
|
"var(--color-info, #6366f1)",
|
|
2430
2453
|
"var(--color-warning, #d97706)"
|
|
2431
2454
|
];
|
|
2432
|
-
function
|
|
2433
|
-
return
|
|
2455
|
+
function I(e) {
|
|
2456
|
+
return F[e % F.length];
|
|
2434
2457
|
}
|
|
2435
|
-
let
|
|
2436
|
-
let { min: e, max: t } = D.value, n = (e) => l.valueTickFormat === void 0 ?
|
|
2458
|
+
let fe = ut(() => l.tooltipValueFormat, () => l.valueTickFormat), L = n(() => {
|
|
2459
|
+
let { min: e, max: t } = D.value, n = (e) => l.valueTickFormat === void 0 ? _e(e) : ne(e, l.valueTickFormat);
|
|
2437
2460
|
if (e === t) return [{
|
|
2438
2461
|
value: n(e),
|
|
2439
|
-
pos:
|
|
2462
|
+
pos: R(M(e))
|
|
2440
2463
|
}];
|
|
2441
2464
|
let r = E.value ? 50 : 80;
|
|
2442
|
-
return (l.valueScaleType === "log" ?
|
|
2465
|
+
return (l.valueScaleType === "log" ? z({
|
|
2443
2466
|
min: e,
|
|
2444
2467
|
max: t,
|
|
2445
2468
|
ticks: l.valueTicks
|
|
2446
|
-
}) :
|
|
2469
|
+
}) : ve({
|
|
2447
2470
|
min: e,
|
|
2448
2471
|
max: t,
|
|
2449
2472
|
ticks: l.valueTicks,
|
|
2450
2473
|
targetTickCount: re.value / r
|
|
2451
2474
|
})).map((e) => ({
|
|
2452
2475
|
value: n(e),
|
|
2453
|
-
pos:
|
|
2476
|
+
pos: R(M(e))
|
|
2454
2477
|
}));
|
|
2455
|
-
}),
|
|
2478
|
+
}), me = n(() => {
|
|
2456
2479
|
let e = C.value, t = T.value;
|
|
2457
2480
|
if (t && t.length > 0) {
|
|
2458
2481
|
let e = Infinity, n = -Infinity;
|
|
2459
2482
|
for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
|
|
2460
2483
|
if (!Number.isFinite(e) || e === n) return [];
|
|
2461
|
-
let r = E.value ?
|
|
2484
|
+
let r = E.value ? U.value : W.value, i = Math.max(2, Math.floor(r / 80)), a = Dt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
|
|
2462
2485
|
for (let e of a.values) {
|
|
2463
2486
|
let n = -1, r = Infinity;
|
|
2464
2487
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -2488,15 +2511,15 @@ var Pt = {
|
|
|
2488
2511
|
});
|
|
2489
2512
|
}
|
|
2490
2513
|
return n;
|
|
2491
|
-
}),
|
|
2514
|
+
}), he = n(() => {
|
|
2492
2515
|
let e = [];
|
|
2493
2516
|
return x.value.forEach((t, n) => {
|
|
2494
2517
|
!t.legend || t.showInLegend === !1 || e.push({
|
|
2495
2518
|
label: t.legend,
|
|
2496
|
-
color: t.color ??
|
|
2519
|
+
color: t.color ?? I(n),
|
|
2497
2520
|
kind: "bar"
|
|
2498
2521
|
});
|
|
2499
|
-
}),
|
|
2522
|
+
}), le.value.forEach((t) => {
|
|
2500
2523
|
!t.legend || !t.showInLegend || e.push({
|
|
2501
2524
|
label: t.legend,
|
|
2502
2525
|
color: t.color,
|
|
@@ -2504,20 +2527,20 @@ var Pt = {
|
|
|
2504
2527
|
dashed: t.dashed
|
|
2505
2528
|
});
|
|
2506
2529
|
}), e;
|
|
2507
|
-
}),
|
|
2508
|
-
function
|
|
2530
|
+
}), ge = n(() => he.value.map((e) => e.label));
|
|
2531
|
+
function xe() {
|
|
2509
2532
|
if (typeof l.csv == "function") return l.csv();
|
|
2510
2533
|
if (typeof l.csv == "string") return l.csv;
|
|
2511
2534
|
let e = x.value.map((e) => ({
|
|
2512
2535
|
label: e.legend,
|
|
2513
2536
|
data: e.data
|
|
2514
2537
|
}));
|
|
2515
|
-
return
|
|
2538
|
+
return Be(w.value, e);
|
|
2516
2539
|
}
|
|
2517
|
-
let
|
|
2518
|
-
function
|
|
2540
|
+
let B = n(() => !!l.tooltipData || !!l.tooltipTrigger);
|
|
2541
|
+
function Ce(e, t) {
|
|
2519
2542
|
if (!isFinite(e) || !isFinite(t) || k.value === 0) return null;
|
|
2520
|
-
let n = (E.value ?
|
|
2543
|
+
let n = (E.value ? H.value.left : H.value.top) + (e + .5) * k.value, r = M(t);
|
|
2521
2544
|
return E.value ? {
|
|
2522
2545
|
x: n,
|
|
2523
2546
|
y: r
|
|
@@ -2526,15 +2549,15 @@ var Pt = {
|
|
|
2526
2549
|
y: n
|
|
2527
2550
|
};
|
|
2528
2551
|
}
|
|
2529
|
-
function
|
|
2530
|
-
let n =
|
|
2552
|
+
function we(e, t) {
|
|
2553
|
+
let n = Te.value?.getBoundingClientRect();
|
|
2531
2554
|
if (!n) return null;
|
|
2532
2555
|
let r = C.value;
|
|
2533
2556
|
if (r === 0 || k.value === 0) return null;
|
|
2534
|
-
let i = E.value ? e - n.left -
|
|
2557
|
+
let i = E.value ? e - n.left - H.value.left : t - n.top - H.value.top;
|
|
2535
2558
|
return Math.max(0, Math.min(r - 1, Math.floor(i / k.value)));
|
|
2536
2559
|
}
|
|
2537
|
-
let { containerRef:
|
|
2560
|
+
let { containerRef: Te, svgRef: Ee, width: De, height: Oe, padding: H, legendY: ke, inlineLegendLayout: Ae, innerW: U, innerH: W, bounds: G, hoverIndex: je, tooltipRef: Me, tooltipPos: K, tooltipHandlers: q, menuItems: Ne, downloadLinkText: J, csvHref: Pe, downloadButtonText: Fe, triggerCsvDownload: Ie, menuFilename: Le, isFullscreen: Re } = lt({
|
|
2538
2561
|
width: () => l.width,
|
|
2539
2562
|
height: () => l.height,
|
|
2540
2563
|
title: () => l.title,
|
|
@@ -2547,17 +2570,18 @@ var Pt = {
|
|
|
2547
2570
|
tooltipClamp: () => l.tooltipClamp,
|
|
2548
2571
|
filename: () => l.filename,
|
|
2549
2572
|
downloadLink: () => l.downloadLink,
|
|
2573
|
+
downloadButton: () => l.downloadButton,
|
|
2550
2574
|
chartPadding: () => l.chartPadding,
|
|
2551
|
-
inlineLegendLabels: () =>
|
|
2552
|
-
hasTooltipSlot: () =>
|
|
2553
|
-
getCsv:
|
|
2554
|
-
pointerToIndex:
|
|
2575
|
+
inlineLegendLabels: () => ge.value,
|
|
2576
|
+
hasTooltipSlot: () => B.value,
|
|
2577
|
+
getCsv: xe,
|
|
2578
|
+
pointerToIndex: we,
|
|
2555
2579
|
onHover: (e) => h("hover", e)
|
|
2556
|
-
}),
|
|
2580
|
+
}), ze = n(() => V(l.axisLabelStyle, { fontSize: 13 })), Y = n(() => V(l.tickLabelStyle, {
|
|
2557
2581
|
fontSize: 10,
|
|
2558
|
-
fillOpacity:
|
|
2559
|
-
})),
|
|
2560
|
-
let e = l.titleStyle, t = e?.align ?? "left", n =
|
|
2582
|
+
fillOpacity: Se
|
|
2583
|
+
})), Ve = n(() => V(l.legendStyle, { fontSize: 11 })), X = n(() => {
|
|
2584
|
+
let e = l.titleStyle, t = e?.align ?? "left", n = G.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
2561
2585
|
return {
|
|
2562
2586
|
lines: (l.title ?? "").split("\n"),
|
|
2563
2587
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -2568,19 +2592,19 @@ var Pt = {
|
|
|
2568
2592
|
anchor: i
|
|
2569
2593
|
};
|
|
2570
2594
|
}), He = n(() => {
|
|
2571
|
-
let e =
|
|
2595
|
+
let e = je.value;
|
|
2572
2596
|
if (e === null) return;
|
|
2573
2597
|
let t = T.value;
|
|
2574
2598
|
return t && Number.isFinite(t[e]) ? Nt(t[e], l.dateFormat, "utc") : w.value[e];
|
|
2575
2599
|
}), Ue = n(() => {
|
|
2576
|
-
let e =
|
|
2600
|
+
let e = je.value;
|
|
2577
2601
|
if (e === null) return null;
|
|
2578
2602
|
let t = x.value, n = [];
|
|
2579
2603
|
for (let r = 0; r < t.length; r++) {
|
|
2580
2604
|
let i = t[r];
|
|
2581
2605
|
i.showInTooltip !== !1 && n.push({
|
|
2582
2606
|
value: Number(i.data[e] ?? NaN),
|
|
2583
|
-
color: i.color ??
|
|
2607
|
+
color: i.color ?? I(r),
|
|
2584
2608
|
seriesIndex: r
|
|
2585
2609
|
});
|
|
2586
2610
|
}
|
|
@@ -2590,24 +2614,24 @@ var Pt = {
|
|
|
2590
2614
|
values: n,
|
|
2591
2615
|
data: l.tooltipData?.[e] ?? null
|
|
2592
2616
|
};
|
|
2593
|
-
}),
|
|
2594
|
-
let e =
|
|
2617
|
+
}), Z = n(() => {
|
|
2618
|
+
let e = je.value;
|
|
2595
2619
|
if (e === null) return null;
|
|
2596
2620
|
let t = j(e);
|
|
2597
2621
|
return E.value ? {
|
|
2598
2622
|
x: t,
|
|
2599
|
-
y:
|
|
2623
|
+
y: H.value.top,
|
|
2600
2624
|
w: k.value,
|
|
2601
|
-
h:
|
|
2625
|
+
h: W.value
|
|
2602
2626
|
} : {
|
|
2603
|
-
x:
|
|
2627
|
+
x: H.value.left,
|
|
2604
2628
|
y: t,
|
|
2605
|
-
w:
|
|
2629
|
+
w: U.value,
|
|
2606
2630
|
h: k.value
|
|
2607
2631
|
};
|
|
2608
2632
|
}), We = n(() => {
|
|
2609
|
-
let e =
|
|
2610
|
-
return
|
|
2633
|
+
let e = Ae.value.positions, t = H.value.left, n = ke.value;
|
|
2634
|
+
return he.value.map((r, i) => {
|
|
2611
2635
|
let a = e[i];
|
|
2612
2636
|
return {
|
|
2613
2637
|
...r,
|
|
@@ -2618,32 +2642,32 @@ var Pt = {
|
|
|
2618
2642
|
});
|
|
2619
2643
|
return (n, c) => (_(), a("div", {
|
|
2620
2644
|
ref_key: "containerRef",
|
|
2621
|
-
ref:
|
|
2645
|
+
ref: Te,
|
|
2622
2646
|
class: f(["bar-chart-wrapper", { "is-fullscreen": S(Re) }])
|
|
2623
2647
|
}, [
|
|
2624
|
-
t.menu ? (_(), r(
|
|
2648
|
+
t.menu ? (_(), r(pe, {
|
|
2625
2649
|
key: 0,
|
|
2626
|
-
items: S(
|
|
2650
|
+
items: S(Ne)
|
|
2627
2651
|
}, null, 8, ["items"])) : i("", !0),
|
|
2628
2652
|
o("div", xn, b(S(Re) ? "Chart expanded to fill window" : ""), 1),
|
|
2629
2653
|
(_(), a("svg", {
|
|
2630
2654
|
ref_key: "svgRef",
|
|
2631
|
-
ref:
|
|
2632
|
-
width: S(
|
|
2633
|
-
height: S(
|
|
2655
|
+
ref: Ee,
|
|
2656
|
+
width: S(De),
|
|
2657
|
+
height: S(Oe)
|
|
2634
2658
|
}, [
|
|
2635
2659
|
t.title ? (_(), a("text", {
|
|
2636
2660
|
key: 0,
|
|
2637
|
-
x:
|
|
2638
|
-
y:
|
|
2639
|
-
"text-anchor":
|
|
2640
|
-
"font-size":
|
|
2641
|
-
"font-weight":
|
|
2642
|
-
fill:
|
|
2643
|
-
}, [(_(!0), a(e, null, y(
|
|
2661
|
+
x: X.value.x,
|
|
2662
|
+
y: X.value.lineHeight,
|
|
2663
|
+
"text-anchor": X.value.anchor,
|
|
2664
|
+
"font-size": X.value.fontSize,
|
|
2665
|
+
"font-weight": X.value.fontWeight,
|
|
2666
|
+
fill: X.value.color
|
|
2667
|
+
}, [(_(!0), a(e, null, y(X.value.lines, (e, t) => (_(), a("tspan", {
|
|
2644
2668
|
key: t,
|
|
2645
|
-
x:
|
|
2646
|
-
dy: t === 0 ? 0 :
|
|
2669
|
+
x: X.value.x,
|
|
2670
|
+
dy: t === 0 ? 0 : X.value.lineHeight
|
|
2647
2671
|
}, b(e), 9, wn))), 128))], 8, Cn)) : i("", !0),
|
|
2648
2672
|
We.value.length > 0 ? (_(), a("g", Tn, [(_(!0), a(e, null, y(We.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.kind === "bar" ? (_(), a("rect", {
|
|
2649
2673
|
key: 0,
|
|
@@ -2664,109 +2688,109 @@ var Pt = {
|
|
|
2664
2688
|
}, null, 8, Dn)), o("text", {
|
|
2665
2689
|
x: t.x + 18,
|
|
2666
2690
|
y: t.y + 4,
|
|
2667
|
-
"font-size":
|
|
2668
|
-
fill:
|
|
2669
|
-
"font-weight":
|
|
2691
|
+
"font-size": Ve.value.fontSize,
|
|
2692
|
+
fill: Ve.value.fill,
|
|
2693
|
+
"font-weight": Ve.value.fontWeight
|
|
2670
2694
|
}, b(t.label), 9, On)], 64))), 128))])) : i("", !0),
|
|
2671
2695
|
o("line", {
|
|
2672
|
-
x1: S(
|
|
2673
|
-
y1: S(
|
|
2674
|
-
x2: S(
|
|
2675
|
-
y2: S(
|
|
2696
|
+
x1: S(R)(S(H).left),
|
|
2697
|
+
y1: S(R)(S(H).top),
|
|
2698
|
+
x2: S(R)(S(H).left),
|
|
2699
|
+
y2: S(R)(S(H).top + S(W)),
|
|
2676
2700
|
stroke: "currentColor",
|
|
2677
2701
|
"stroke-opacity": "0.3"
|
|
2678
2702
|
}, null, 8, kn),
|
|
2679
2703
|
o("line", {
|
|
2680
|
-
x1: S(
|
|
2681
|
-
y1: S(
|
|
2682
|
-
x2: S(
|
|
2683
|
-
y2: S(
|
|
2704
|
+
x1: S(R)(S(H).left),
|
|
2705
|
+
y1: S(R)(S(H).top + S(W)),
|
|
2706
|
+
x2: S(R)(S(H).left + S(U)),
|
|
2707
|
+
y2: S(R)(S(H).top + S(W)),
|
|
2684
2708
|
stroke: "currentColor",
|
|
2685
2709
|
"stroke-opacity": "0.3"
|
|
2686
2710
|
}, null, 8, An),
|
|
2687
|
-
t.valueGrid ? (_(!0), a(e, { key: 2 }, y(
|
|
2711
|
+
t.valueGrid ? (_(!0), a(e, { key: 2 }, y(L.value, (e, t) => (_(), a("line", {
|
|
2688
2712
|
key: "vg" + t,
|
|
2689
|
-
x1: E.value ? S(
|
|
2690
|
-
y1: E.value ? e.pos : S(
|
|
2691
|
-
x2: E.value ? S(
|
|
2692
|
-
y2: E.value ? e.pos : S(
|
|
2713
|
+
x1: E.value ? S(H).left : e.pos,
|
|
2714
|
+
y1: E.value ? e.pos : S(H).top,
|
|
2715
|
+
x2: E.value ? S(H).left + S(U) : e.pos,
|
|
2716
|
+
y2: E.value ? e.pos : S(H).top + S(W),
|
|
2693
2717
|
stroke: "currentColor",
|
|
2694
2718
|
"stroke-opacity": "0.1"
|
|
2695
2719
|
}, null, 8, jn))), 128)) : i("", !0),
|
|
2696
|
-
|
|
2720
|
+
Z.value && B.value ? (_(), a("rect", {
|
|
2697
2721
|
key: 3,
|
|
2698
|
-
x:
|
|
2699
|
-
y:
|
|
2700
|
-
width:
|
|
2701
|
-
height:
|
|
2722
|
+
x: Z.value.x,
|
|
2723
|
+
y: Z.value.y,
|
|
2724
|
+
width: Z.value.w,
|
|
2725
|
+
height: Z.value.h,
|
|
2702
2726
|
fill: "currentColor",
|
|
2703
2727
|
"fill-opacity": "0.06",
|
|
2704
2728
|
"pointer-events": "none"
|
|
2705
2729
|
}, null, 8, Mn)) : i("", !0),
|
|
2706
|
-
E.value ? (_(!0), a(e, { key: 4 }, y(
|
|
2730
|
+
E.value ? (_(!0), a(e, { key: 4 }, y(L.value, (e, t) => (_(), a("text", {
|
|
2707
2731
|
key: "vt" + t,
|
|
2708
2732
|
"data-testid": "value-tick",
|
|
2709
|
-
x: S(
|
|
2733
|
+
x: S(H).left - 6,
|
|
2710
2734
|
y: e.pos,
|
|
2711
2735
|
"text-anchor": "end",
|
|
2712
2736
|
"dominant-baseline": "middle",
|
|
2713
|
-
"font-size":
|
|
2714
|
-
fill:
|
|
2715
|
-
"font-weight":
|
|
2716
|
-
"fill-opacity":
|
|
2717
|
-
}, b(e.value), 9, Nn))), 128)) : (_(!0), a(e, { key: 5 }, y(
|
|
2737
|
+
"font-size": Y.value.fontSize,
|
|
2738
|
+
fill: Y.value.fill,
|
|
2739
|
+
"font-weight": Y.value.fontWeight,
|
|
2740
|
+
"fill-opacity": Y.value.fillOpacity
|
|
2741
|
+
}, b(e.value), 9, Nn))), 128)) : (_(!0), a(e, { key: 5 }, y(L.value, (e, t) => (_(), a("text", {
|
|
2718
2742
|
key: "vt" + t,
|
|
2719
2743
|
"data-testid": "value-tick",
|
|
2720
2744
|
x: e.pos,
|
|
2721
|
-
y: S(
|
|
2745
|
+
y: S(H).top + S(W) + 16,
|
|
2722
2746
|
"text-anchor": "middle",
|
|
2723
|
-
"font-size":
|
|
2724
|
-
fill:
|
|
2725
|
-
"font-weight":
|
|
2726
|
-
"fill-opacity":
|
|
2747
|
+
"font-size": Y.value.fontSize,
|
|
2748
|
+
fill: Y.value.fill,
|
|
2749
|
+
"font-weight": Y.value.fontWeight,
|
|
2750
|
+
"fill-opacity": Y.value.fillOpacity
|
|
2727
2751
|
}, b(e.value), 9, Pn))), 128)),
|
|
2728
2752
|
t.yLabel ? (_(), a("text", {
|
|
2729
2753
|
key: 6,
|
|
2730
2754
|
x: 0,
|
|
2731
2755
|
y: 0,
|
|
2732
|
-
transform: `translate(14, ${S(
|
|
2756
|
+
transform: `translate(14, ${S(H).top + S(W) / 2}) rotate(-90)`,
|
|
2733
2757
|
"text-anchor": "middle",
|
|
2734
|
-
"font-size":
|
|
2735
|
-
fill:
|
|
2736
|
-
"font-weight":
|
|
2758
|
+
"font-size": ze.value.fontSize,
|
|
2759
|
+
fill: ze.value.fill,
|
|
2760
|
+
"font-weight": ze.value.fontWeight
|
|
2737
2761
|
}, b(t.yLabel), 9, Fn)) : i("", !0),
|
|
2738
|
-
E.value ? (_(!0), a(e, { key: 7 }, y(
|
|
2762
|
+
E.value ? (_(!0), a(e, { key: 7 }, y(me.value, (e, t) => (_(), a("text", {
|
|
2739
2763
|
key: "ct" + t,
|
|
2740
2764
|
"data-testid": "category-tick",
|
|
2741
2765
|
x: e.pos,
|
|
2742
|
-
y: S(
|
|
2766
|
+
y: S(H).top + S(W) + 16,
|
|
2743
2767
|
"text-anchor": e.anchor,
|
|
2744
|
-
"font-size":
|
|
2745
|
-
fill:
|
|
2746
|
-
"font-weight":
|
|
2747
|
-
"fill-opacity":
|
|
2748
|
-
}, b(e.label), 9, In))), 128)) : (_(!0), a(e, { key: 8 }, y(
|
|
2768
|
+
"font-size": Y.value.fontSize,
|
|
2769
|
+
fill: Y.value.fill,
|
|
2770
|
+
"font-weight": Y.value.fontWeight,
|
|
2771
|
+
"fill-opacity": Y.value.fillOpacity
|
|
2772
|
+
}, b(e.label), 9, In))), 128)) : (_(!0), a(e, { key: 8 }, y(me.value, (e, t) => (_(), a("text", {
|
|
2749
2773
|
key: "ct" + t,
|
|
2750
2774
|
"data-testid": "category-tick",
|
|
2751
|
-
x: S(
|
|
2775
|
+
x: S(H).left - 6,
|
|
2752
2776
|
y: e.pos,
|
|
2753
2777
|
"text-anchor": "end",
|
|
2754
2778
|
"dominant-baseline": "middle",
|
|
2755
|
-
"font-size":
|
|
2756
|
-
fill:
|
|
2757
|
-
"font-weight":
|
|
2758
|
-
"fill-opacity":
|
|
2779
|
+
"font-size": Y.value.fontSize,
|
|
2780
|
+
fill: Y.value.fill,
|
|
2781
|
+
"font-weight": Y.value.fontWeight,
|
|
2782
|
+
"fill-opacity": Y.value.fillOpacity
|
|
2759
2783
|
}, b(e.label), 9, Ln))), 128)),
|
|
2760
2784
|
t.xLabel ? (_(), a("text", {
|
|
2761
2785
|
key: 9,
|
|
2762
|
-
x: S(
|
|
2763
|
-
y: S(
|
|
2786
|
+
x: S(H).left + S(U) / 2,
|
|
2787
|
+
y: S(Oe) - 4,
|
|
2764
2788
|
"text-anchor": "middle",
|
|
2765
|
-
"font-size":
|
|
2766
|
-
fill:
|
|
2767
|
-
"font-weight":
|
|
2789
|
+
"font-size": ze.value.fontSize,
|
|
2790
|
+
fill: ze.value.fill,
|
|
2791
|
+
"font-weight": ze.value.fontWeight
|
|
2768
2792
|
}, b(t.xLabel), 9, Rn)) : i("", !0),
|
|
2769
|
-
(_(!0), a(e, null, y(
|
|
2793
|
+
(_(!0), a(e, null, y(N.value, (e, t) => (_(), a("rect", {
|
|
2770
2794
|
key: "bar" + t,
|
|
2771
2795
|
"data-testid": "bar",
|
|
2772
2796
|
"data-category": e.categoryIndex,
|
|
@@ -2779,7 +2803,7 @@ var Pt = {
|
|
|
2779
2803
|
"fill-opacity": e.opacity,
|
|
2780
2804
|
style: m(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
2781
2805
|
}, null, 12, zn))), 128)),
|
|
2782
|
-
(_(!0), a(e, null, y(
|
|
2806
|
+
(_(!0), a(e, null, y(P.value, (t, n) => (_(), a(e, { key: "sl" + n }, [t.pathD ? (_(), a("path", {
|
|
2783
2807
|
key: 0,
|
|
2784
2808
|
"data-testid": "summary-line",
|
|
2785
2809
|
d: t.pathD,
|
|
@@ -2800,37 +2824,37 @@ var Pt = {
|
|
|
2800
2824
|
"fill-opacity": t.opacity,
|
|
2801
2825
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2802
2826
|
}, null, 12, Vn))), 128)) : i("", !0)], 64))), 128)),
|
|
2803
|
-
|
|
2827
|
+
B.value ? (_(), a("rect", d({
|
|
2804
2828
|
key: 10,
|
|
2805
|
-
x: S(
|
|
2806
|
-
y: S(
|
|
2807
|
-
width: S(
|
|
2808
|
-
height: S(
|
|
2829
|
+
x: S(H).left,
|
|
2830
|
+
y: S(H).top,
|
|
2831
|
+
width: S(U),
|
|
2832
|
+
height: S(W),
|
|
2809
2833
|
fill: "transparent",
|
|
2810
2834
|
style: {
|
|
2811
2835
|
cursor: "crosshair",
|
|
2812
2836
|
"touch-action": "none"
|
|
2813
2837
|
}
|
|
2814
|
-
}, te(S(
|
|
2815
|
-
t.annotations && t.annotations.length > 0 ? (_(), r(S(
|
|
2838
|
+
}, te(S(q), !0)), null, 16, Hn)) : i("", !0),
|
|
2839
|
+
t.annotations && t.annotations.length > 0 ? (_(), r(S(ot), {
|
|
2816
2840
|
key: 11,
|
|
2817
2841
|
annotations: t.annotations,
|
|
2818
|
-
project:
|
|
2819
|
-
bounds: S(
|
|
2842
|
+
project: Ce,
|
|
2843
|
+
bounds: S(G)
|
|
2820
2844
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
2821
2845
|
], 8, Sn)),
|
|
2822
|
-
|
|
2846
|
+
B.value && S(je) !== null && Ue.value ? (_(), a("div", {
|
|
2823
2847
|
key: 1,
|
|
2824
2848
|
ref_key: "tooltipRef",
|
|
2825
|
-
ref:
|
|
2849
|
+
ref: Me,
|
|
2826
2850
|
class: "chart-tooltip-content",
|
|
2827
2851
|
style: m({
|
|
2828
2852
|
position: "absolute",
|
|
2829
2853
|
top: "0",
|
|
2830
2854
|
left: "0",
|
|
2831
2855
|
willChange: "transform",
|
|
2832
|
-
transform: S(
|
|
2833
|
-
visibility: S(
|
|
2856
|
+
transform: S(K) ? `translate3d(${S(K).left}px, ${S(K).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2857
|
+
visibility: S(K) ? "visible" : "hidden"
|
|
2834
2858
|
})
|
|
2835
2859
|
}, [ee(n.$slots, "tooltip", p(u(Ue.value)), () => [o("div", Un, [He.value ? (_(), a("div", Wn, b(He.value), 1)) : i("", !0), (_(!0), a(e, null, y(Ue.value.values, (e) => (_(), a("div", {
|
|
2836
2860
|
key: e.seriesIndex,
|
|
@@ -2838,16 +2862,22 @@ var Pt = {
|
|
|
2838
2862
|
}, [o("span", {
|
|
2839
2863
|
class: "bar-chart-tooltip-swatch",
|
|
2840
2864
|
style: m({ background: e.color })
|
|
2841
|
-
}, null, 4), s(" " + b(isFinite(e.value) ? S(
|
|
2842
|
-
S(
|
|
2865
|
+
}, null, 4), s(" " + b(isFinite(e.value) ? S(fe)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2866
|
+
S(J) ? (_(), a("a", {
|
|
2843
2867
|
key: 2,
|
|
2844
2868
|
class: "bar-chart-download-link",
|
|
2845
|
-
href: S(
|
|
2869
|
+
href: S(Pe),
|
|
2846
2870
|
download: `${S(Le)()}.csv`
|
|
2847
|
-
}, b(S(
|
|
2871
|
+
}, b(S(J)), 9, Gn)) : i("", !0),
|
|
2872
|
+
S(Fe) ? (_(), a("button", {
|
|
2873
|
+
key: 3,
|
|
2874
|
+
type: "button",
|
|
2875
|
+
class: "bar-chart-download-button",
|
|
2876
|
+
onClick: c[0] ||= (...e) => S(Ie) && S(Ie)(...e)
|
|
2877
|
+
}, b(S(Fe)), 1)) : i("", !0)
|
|
2848
2878
|
], 2));
|
|
2849
2879
|
}
|
|
2850
|
-
}), [["__scopeId", "data-v-
|
|
2880
|
+
}), [["__scopeId", "data-v-bce03a52"]]), qn = {
|
|
2851
2881
|
ref: "root",
|
|
2852
2882
|
class: "chart-tooltip-content",
|
|
2853
2883
|
style: {
|
|
@@ -2884,7 +2914,7 @@ var Pt = {
|
|
|
2884
2914
|
}, Qn = {
|
|
2885
2915
|
key: 2,
|
|
2886
2916
|
class: "choropleth-legend-continuous"
|
|
2887
|
-
}, $n = { class: "choropleth-legend-ticks" }, er = ["viewBox"], tr = ["innerHTML"], nr = "http://www.w3.org/2000/svg", rr = 450, ir = 1e3, ar = /* @__PURE__ */
|
|
2917
|
+
}, $n = { class: "choropleth-legend-ticks" }, er = ["viewBox"], tr = ["innerHTML"], nr = "http://www.w3.org/2000/svg", rr = 450, ir = 1e3, ar = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
2888
2918
|
__name: "ChoroplethMap",
|
|
2889
2919
|
props: {
|
|
2890
2920
|
topology: {},
|
|
@@ -2942,56 +2972,56 @@ var Pt = {
|
|
|
2942
2972
|
width: "100%"
|
|
2943
2973
|
};
|
|
2944
2974
|
return e?.color && (t.color = e.color), t;
|
|
2945
|
-
}),
|
|
2975
|
+
}), F = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), fe = null, L = null, R = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map(), he = !1, ge = typeof window < "u" && "ontouchstart" in window, _e = null, ve = {
|
|
2946
2976
|
width: 0,
|
|
2947
2977
|
height: 0
|
|
2948
|
-
},
|
|
2949
|
-
function
|
|
2950
|
-
if (
|
|
2978
|
+
}, ye = null, be = !1, z = null, xe = v(!1), Se = 0, B = 0, V = 0;
|
|
2979
|
+
function Ce() {
|
|
2980
|
+
if (ge) return;
|
|
2951
2981
|
let e = O.value;
|
|
2952
2982
|
e && (e.addEventListener("click", gt), e.addEventListener("mouseover", gt), e.addEventListener("mousemove", _t), e.addEventListener("mouseout", vt));
|
|
2953
2983
|
}
|
|
2954
|
-
function
|
|
2984
|
+
function we() {
|
|
2955
2985
|
let e = O.value;
|
|
2956
2986
|
e && (e.removeEventListener("click", gt), e.removeEventListener("mouseover", gt), e.removeEventListener("mousemove", _t), e.removeEventListener("mouseout", vt));
|
|
2957
2987
|
}
|
|
2958
|
-
function
|
|
2959
|
-
|
|
2988
|
+
function Te() {
|
|
2989
|
+
mt();
|
|
2960
2990
|
}
|
|
2961
2991
|
h(() => {
|
|
2962
|
-
|
|
2992
|
+
Ee(), Ce(), bt(), U(), ot(), window.addEventListener("scroll", Te, {
|
|
2963
2993
|
passive: !0,
|
|
2964
2994
|
capture: !0
|
|
2965
|
-
}), window.addEventListener("resize",
|
|
2995
|
+
}), window.addEventListener("resize", Te, { passive: !0 });
|
|
2966
2996
|
}), g(() => {
|
|
2967
|
-
|
|
2997
|
+
_e?.disconnect(), V && cancelAnimationFrame(V), De(), we(), window.removeEventListener("scroll", Te, { capture: !0 }), window.removeEventListener("resize", Te);
|
|
2968
2998
|
});
|
|
2969
|
-
function
|
|
2999
|
+
function Ee() {
|
|
2970
3000
|
if (!D.value || !O.value) return;
|
|
2971
|
-
let e =
|
|
2972
|
-
|
|
2973
|
-
|
|
3001
|
+
let e = le(D.value), t = Math.max(12, l.focusZoomLevel);
|
|
3002
|
+
z = se().scaleExtent([1, t]).on("start", () => {
|
|
3003
|
+
he = !0, mt();
|
|
2974
3004
|
}).on("zoom", (e) => {
|
|
2975
3005
|
O.value && O.value.setAttribute("transform", e.transform);
|
|
2976
3006
|
let t = e.transform;
|
|
2977
|
-
|
|
3007
|
+
xe.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
2978
3008
|
}).on("end", () => {
|
|
2979
|
-
|
|
2980
|
-
}),
|
|
2981
|
-
let t =
|
|
3009
|
+
he = !1;
|
|
3010
|
+
}), z.filter((e) => {
|
|
3011
|
+
let t = Z.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
|
|
2982
3012
|
if (e.type === "wheel" || e.type === "dblclick") {
|
|
2983
3013
|
if (!n) return !1;
|
|
2984
3014
|
} else if (e.type === "mousedown" || e.type === "touchstart") {
|
|
2985
3015
|
if (!r) return !1;
|
|
2986
3016
|
} else if (!n && !r) return !1;
|
|
2987
3017
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
2988
|
-
}), e.call(
|
|
3018
|
+
}), e.call(z);
|
|
2989
3019
|
}
|
|
2990
|
-
function
|
|
2991
|
-
D.value &&
|
|
3020
|
+
function De() {
|
|
3021
|
+
D.value && z && (le(D.value).on(".zoom", null), z = null);
|
|
2992
3022
|
}
|
|
2993
|
-
function
|
|
2994
|
-
let t =
|
|
3023
|
+
function Oe(e) {
|
|
3024
|
+
let t = We.value, n = X.value, r = [];
|
|
2995
3025
|
for (let i of e) {
|
|
2996
3026
|
let e = i.geoType ?? l.geoType, a = t.get(e);
|
|
2997
3027
|
if (!a) continue;
|
|
@@ -3009,76 +3039,76 @@ var Pt = {
|
|
|
3009
3039
|
}
|
|
3010
3040
|
return r;
|
|
3011
3041
|
}
|
|
3012
|
-
function
|
|
3042
|
+
function H(e) {
|
|
3013
3043
|
let t = /* @__PURE__ */ new Set();
|
|
3014
|
-
for (let n of
|
|
3044
|
+
for (let n of Oe(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
|
|
3015
3045
|
return t;
|
|
3016
3046
|
}
|
|
3017
|
-
let
|
|
3018
|
-
function
|
|
3019
|
-
if (!D.value || !
|
|
3020
|
-
let e =
|
|
3047
|
+
let ke = !1;
|
|
3048
|
+
function U() {
|
|
3049
|
+
if (!D.value || !z) return;
|
|
3050
|
+
let e = Oe(Z.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
|
|
3021
3051
|
for (let e of t) {
|
|
3022
|
-
let t =
|
|
3052
|
+
let t = F.get(String(e.feature.id));
|
|
3023
3053
|
t && r.set(t, e.item.style ?? "solid");
|
|
3024
3054
|
}
|
|
3025
|
-
for (let [e] of
|
|
3026
|
-
for (let [e, t] of r)
|
|
3027
|
-
|
|
3028
|
-
for (let [e, t] of r)
|
|
3029
|
-
if (
|
|
3030
|
-
|
|
3055
|
+
for (let [e] of R) r.has(e) || e === L || Q(e);
|
|
3056
|
+
for (let [e, t] of r) R.get(e) === t && e !== L || e !== L && ft(e, t);
|
|
3057
|
+
R.clear();
|
|
3058
|
+
for (let [e, t] of r) R.set(e, t);
|
|
3059
|
+
if (W(n), e.length === 0) {
|
|
3060
|
+
ke = !0, mt();
|
|
3031
3061
|
return;
|
|
3032
3062
|
}
|
|
3033
|
-
let i =
|
|
3063
|
+
let i = le(D.value);
|
|
3034
3064
|
i.interrupt();
|
|
3035
|
-
let a =
|
|
3036
|
-
|
|
3037
|
-
let [[o, s], [c, u]] =
|
|
3065
|
+
let a = ke;
|
|
3066
|
+
ke = !0;
|
|
3067
|
+
let [[o, s], [c, u]] = Be.value.bounds({
|
|
3038
3068
|
type: "FeatureCollection",
|
|
3039
3069
|
features: e.map((e) => e.feature)
|
|
3040
|
-
}), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m =
|
|
3070
|
+
}), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = ce.translate(Me.value / 2 - p * d, K.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, g = () => {
|
|
3041
3071
|
if (!j.value || !h) return;
|
|
3042
|
-
let e = String(h.id), t =
|
|
3072
|
+
let e = String(h.id), t = F.get(e);
|
|
3043
3073
|
if (!t) return;
|
|
3044
3074
|
let n = t.getBoundingClientRect();
|
|
3045
|
-
|
|
3075
|
+
ct(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
3046
3076
|
};
|
|
3047
|
-
a ? (
|
|
3077
|
+
a ? (ut(), i.transition().duration(rr).call(z.transform, m).on("end", g)) : (z.transform(i, m), g());
|
|
3048
3078
|
}
|
|
3049
|
-
function
|
|
3079
|
+
function W(e) {
|
|
3050
3080
|
let t = k.value;
|
|
3051
3081
|
if (!t) return;
|
|
3052
3082
|
let n = new Set(e.map((e) => e.key));
|
|
3053
|
-
for (let [e, t] of
|
|
3054
|
-
let r =
|
|
3083
|
+
for (let [e, t] of me) n.has(e) || (t.remove(), me.delete(e));
|
|
3084
|
+
let r = Be.value, i = Ve.value + 1.5;
|
|
3055
3085
|
for (let { item: n, feature: a, key: o } of e) {
|
|
3056
|
-
let e =
|
|
3057
|
-
e || (e = document.createElementNS(nr, "path"), e.setAttribute("d", r(a) ?? ""), e.setAttribute("fill", "none"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("class", "focus-overlay"), t.appendChild(e),
|
|
3086
|
+
let e = me.get(o);
|
|
3087
|
+
e || (e = document.createElementNS(nr, "path"), e.setAttribute("d", r(a) ?? ""), e.setAttribute("fill", "none"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("class", "focus-overlay"), t.appendChild(e), me.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), dt(e, n.style);
|
|
3058
3088
|
}
|
|
3059
3089
|
}
|
|
3060
|
-
function
|
|
3061
|
-
if (!D.value || !
|
|
3062
|
-
|
|
3063
|
-
let e =
|
|
3064
|
-
e.interrupt(),
|
|
3090
|
+
function G() {
|
|
3091
|
+
if (!D.value || !z) return;
|
|
3092
|
+
Z.value.length > 0 && d("update:focus", null);
|
|
3093
|
+
let e = le(D.value);
|
|
3094
|
+
e.interrupt(), ut(), e.transition().duration(rr).call(z.transform, ce);
|
|
3065
3095
|
}
|
|
3066
3096
|
T(() => l.focusZoomLevel, () => {
|
|
3067
|
-
|
|
3097
|
+
z && z.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), U();
|
|
3068
3098
|
});
|
|
3069
|
-
let
|
|
3070
|
-
function
|
|
3071
|
-
return
|
|
3099
|
+
let je = n(() => l.width && l.height ? l.height / l.width : .625), Me = n(() => ir), K = n(() => ir * je.value), J = v(null), Pe = null;
|
|
3100
|
+
function Fe() {
|
|
3101
|
+
return Pe ||= import("./hsaMapping-Devrp7Rk.js").then((e) => e.n).then((e) => (J.value = e, e)), Pe;
|
|
3072
3102
|
}
|
|
3073
3103
|
T(() => {
|
|
3074
3104
|
if (l.geoType === "hsas" || l.dataGeoType === "hsas") return !0;
|
|
3075
3105
|
let e = l.focus;
|
|
3076
3106
|
return e ? (Array.isArray(e) ? e : [e]).some((e) => typeof e != "string" && e.geoType === "hsas") : !1;
|
|
3077
3107
|
}, (e) => {
|
|
3078
|
-
e &&
|
|
3108
|
+
e && Fe();
|
|
3079
3109
|
}, { immediate: !0 });
|
|
3080
|
-
let
|
|
3081
|
-
let e =
|
|
3110
|
+
let Ie = n(() => {
|
|
3111
|
+
let e = J.value;
|
|
3082
3112
|
if (!e) return {
|
|
3083
3113
|
type: "FeatureCollection",
|
|
3084
3114
|
features: []
|
|
@@ -3093,49 +3123,49 @@ var Pt = {
|
|
|
3093
3123
|
type: "Feature",
|
|
3094
3124
|
id: e,
|
|
3095
3125
|
properties: { name: n[e] ?? e },
|
|
3096
|
-
geometry:
|
|
3126
|
+
geometry: ue(r, t)
|
|
3097
3127
|
});
|
|
3098
3128
|
return {
|
|
3099
3129
|
type: "FeatureCollection",
|
|
3100
3130
|
features: o
|
|
3101
3131
|
};
|
|
3102
|
-
}),
|
|
3103
|
-
if (l.geoType === "hsas") return
|
|
3132
|
+
}), Le = n(() => {
|
|
3133
|
+
if (l.geoType === "hsas") return Ie.value;
|
|
3104
3134
|
if (l.geoType === "counties") {
|
|
3105
3135
|
let e = x(l.topology);
|
|
3106
|
-
return
|
|
3136
|
+
return P(e, e.objects.counties);
|
|
3107
3137
|
}
|
|
3108
3138
|
let e = x(l.topology);
|
|
3109
|
-
return
|
|
3139
|
+
return P(e, e.objects.states);
|
|
3110
3140
|
}), ze = n(() => {
|
|
3111
3141
|
if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
|
|
3112
3142
|
let e = x(l.topology);
|
|
3113
|
-
return
|
|
3114
|
-
}),
|
|
3143
|
+
return de(e, e.objects.states, (e, t) => e !== t);
|
|
3144
|
+
}), Y = n(() => oe().fitExtent([[0, 0], [Me.value, K.value]], Le.value)), Be = n(() => N(Y.value)), Ve = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), X = n(() => {
|
|
3115
3145
|
let e = /* @__PURE__ */ new Map();
|
|
3116
|
-
for (let [t, n] of
|
|
3146
|
+
for (let [t, n] of We.value) {
|
|
3117
3147
|
let r = /* @__PURE__ */ new Map();
|
|
3118
3148
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
3119
3149
|
e.set(t, r);
|
|
3120
3150
|
}
|
|
3121
3151
|
return e;
|
|
3122
3152
|
});
|
|
3123
|
-
function
|
|
3153
|
+
function He(e) {
|
|
3124
3154
|
let t = l.dataGeoType;
|
|
3125
3155
|
if (!t || t === l.geoType) return e;
|
|
3126
|
-
if (l.geoType === "counties" && t === "hsas") return
|
|
3156
|
+
if (l.geoType === "counties" && t === "hsas") return J.value?.fipsToHsa[e];
|
|
3127
3157
|
if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
3128
3158
|
}
|
|
3129
|
-
let
|
|
3159
|
+
let Ue = n(() => {
|
|
3130
3160
|
let e = /* @__PURE__ */ new Map();
|
|
3131
|
-
for (let t of
|
|
3161
|
+
for (let t of Le.value.features) t.id != null && e.set(String(t.id), t);
|
|
3132
3162
|
return e;
|
|
3133
|
-
}),
|
|
3163
|
+
}), Z = n(() => {
|
|
3134
3164
|
let e = l.focus;
|
|
3135
3165
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
3136
|
-
}),
|
|
3166
|
+
}), We = n(() => {
|
|
3137
3167
|
let e = /* @__PURE__ */ new Map();
|
|
3138
|
-
e.set(l.geoType,
|
|
3168
|
+
e.set(l.geoType, Ue.value);
|
|
3139
3169
|
let t = x(l.topology), n = t?.objects;
|
|
3140
3170
|
if (!n) return e;
|
|
3141
3171
|
let r = (e) => {
|
|
@@ -3144,25 +3174,25 @@ var Pt = {
|
|
|
3144
3174
|
return t;
|
|
3145
3175
|
};
|
|
3146
3176
|
if (!e.has("states") && n.states) {
|
|
3147
|
-
let i =
|
|
3177
|
+
let i = P(t, n.states);
|
|
3148
3178
|
e.set("states", r(i.features));
|
|
3149
3179
|
}
|
|
3150
3180
|
if (!e.has("counties") && n.counties) {
|
|
3151
|
-
let i =
|
|
3181
|
+
let i = P(t, n.counties);
|
|
3152
3182
|
e.set("counties", r(i.features));
|
|
3153
3183
|
}
|
|
3154
|
-
return !e.has("hsas") && n.counties && e.set("hsas", r(
|
|
3155
|
-
}),
|
|
3184
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(Ie.value.features)), e;
|
|
3185
|
+
}), Ge = n(() => {
|
|
3156
3186
|
let e = /* @__PURE__ */ new Map();
|
|
3157
3187
|
if (!l.data) return e;
|
|
3158
|
-
let t = l.dataGeoType ?? l.geoType, n =
|
|
3188
|
+
let t = l.dataGeoType ?? l.geoType, n = X.value.get(t);
|
|
3159
3189
|
for (let t of l.data) {
|
|
3160
3190
|
e.set(t.id, t.value);
|
|
3161
3191
|
let r = n?.get(t.id);
|
|
3162
3192
|
r && e.set(r, t.value);
|
|
3163
3193
|
}
|
|
3164
3194
|
return e;
|
|
3165
|
-
}),
|
|
3195
|
+
}), Ke = n(() => {
|
|
3166
3196
|
if (!l.data || l.data.length === 0) return {
|
|
3167
3197
|
min: 0,
|
|
3168
3198
|
max: 1
|
|
@@ -3179,8 +3209,8 @@ var Pt = {
|
|
|
3179
3209
|
min: 0,
|
|
3180
3210
|
max: 1
|
|
3181
3211
|
};
|
|
3182
|
-
}),
|
|
3183
|
-
function
|
|
3212
|
+
}), qe = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Je = n(() => Array.isArray(l.colorScale) && !qe.value), Ye = n(() => Je.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Xe = n(() => Je.value ? "" : l.colorScale?.max ?? "#08519c");
|
|
3213
|
+
function Ze(e) {
|
|
3184
3214
|
let t = e.replace("#", "");
|
|
3185
3215
|
return [
|
|
3186
3216
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -3188,100 +3218,100 @@ var Pt = {
|
|
|
3188
3218
|
parseInt(t.slice(4, 6), 16)
|
|
3189
3219
|
];
|
|
3190
3220
|
}
|
|
3191
|
-
function
|
|
3192
|
-
let [t, n, r] =
|
|
3221
|
+
function Qe(e) {
|
|
3222
|
+
let [t, n, r] = Ze(Ye.value), [i, a, o] = Ze(Xe.value);
|
|
3193
3223
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
3194
3224
|
}
|
|
3195
|
-
let
|
|
3196
|
-
if (!
|
|
3225
|
+
let $e = n(() => Je.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), et = n(() => {
|
|
3226
|
+
if (!qe.value) return null;
|
|
3197
3227
|
let e = /* @__PURE__ */ new Map();
|
|
3198
3228
|
for (let t of l.colorScale) e.set(t.value, t.color);
|
|
3199
3229
|
return e;
|
|
3200
3230
|
});
|
|
3201
|
-
function
|
|
3202
|
-
let t =
|
|
3203
|
-
return t == null ? void 0 :
|
|
3231
|
+
function tt(e) {
|
|
3232
|
+
let t = He(e);
|
|
3233
|
+
return t == null ? void 0 : Ge.value.get(t);
|
|
3204
3234
|
}
|
|
3205
|
-
function
|
|
3206
|
-
let t =
|
|
3235
|
+
function nt(e) {
|
|
3236
|
+
let t = tt(e), n = l.noDataColor;
|
|
3207
3237
|
if (t == null) return n;
|
|
3208
|
-
let r =
|
|
3238
|
+
let r = et.value;
|
|
3209
3239
|
if (r) return r.get(String(t)) ?? n;
|
|
3210
|
-
let i =
|
|
3240
|
+
let i = $e.value;
|
|
3211
3241
|
if (i) {
|
|
3212
3242
|
let e = t;
|
|
3213
3243
|
for (let t of i) if (e >= t.min) return t.color;
|
|
3214
3244
|
return n;
|
|
3215
3245
|
}
|
|
3216
|
-
let { min: a, max: o } =
|
|
3217
|
-
return
|
|
3246
|
+
let { min: a, max: o } = Ke.value;
|
|
3247
|
+
return Qe((t - a) / (o - a));
|
|
3218
3248
|
}
|
|
3219
|
-
let
|
|
3220
|
-
function
|
|
3249
|
+
let rt = (e) => e.properties?.name ?? String(e.id);
|
|
3250
|
+
function it(e) {
|
|
3221
3251
|
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat !== void 0 ? ne(e, l.tooltipValueFormat) : String(e);
|
|
3222
3252
|
}
|
|
3223
|
-
function
|
|
3224
|
-
return t == null ? e : `${e}: ${
|
|
3253
|
+
function at(e, t) {
|
|
3254
|
+
return t == null ? e : `${e}: ${it(t)}`;
|
|
3225
3255
|
}
|
|
3226
|
-
function
|
|
3256
|
+
function ot() {
|
|
3227
3257
|
let e = A.value?.getEl();
|
|
3228
3258
|
if (!e) return;
|
|
3229
|
-
|
|
3259
|
+
_e?.disconnect();
|
|
3230
3260
|
let t = !1;
|
|
3231
|
-
|
|
3261
|
+
_e = new ResizeObserver((e) => {
|
|
3232
3262
|
let n = e[0]?.contentRect;
|
|
3233
|
-
n && (
|
|
3234
|
-
}),
|
|
3263
|
+
n && (ve.width = n.width, ve.height = n.height, !t && be && ye ? (t = !0, st(ye.x, ye.y)) : t = !0);
|
|
3264
|
+
}), _e.observe(e);
|
|
3235
3265
|
}
|
|
3236
|
-
function
|
|
3266
|
+
function st(e, t) {
|
|
3237
3267
|
let n = A.value?.getEl();
|
|
3238
3268
|
if (!n) return;
|
|
3239
|
-
let r = w.value?.getBoundingClientRect(), { left: i, top: a } =
|
|
3269
|
+
let r = w.value?.getBoundingClientRect(), { left: i, top: a } = Ae(e, t, ve.width, ve.height, l.tooltipClamp, r);
|
|
3240
3270
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
3241
3271
|
}
|
|
3242
|
-
function
|
|
3243
|
-
let r =
|
|
3272
|
+
function ct(e, t, n) {
|
|
3273
|
+
let r = I.get(e);
|
|
3244
3274
|
if (!r) return;
|
|
3245
3275
|
let i = A.value, a = i?.getEl();
|
|
3246
|
-
!i || !a || (i.setData(r),
|
|
3276
|
+
!i || !a || (i.setData(r), ye = {
|
|
3247
3277
|
x: t,
|
|
3248
3278
|
y: n
|
|
3249
|
-
},
|
|
3279
|
+
}, be = !0, st(t, n), a.style.visibility = "visible");
|
|
3250
3280
|
}
|
|
3251
|
-
function
|
|
3252
|
-
|
|
3253
|
-
|
|
3281
|
+
function lt(e, t) {
|
|
3282
|
+
be && (Se = e, B = t, !V && (V = requestAnimationFrame(() => {
|
|
3283
|
+
V = 0;
|
|
3254
3284
|
let e = A.value?.getEl();
|
|
3255
|
-
!e || !
|
|
3256
|
-
x:
|
|
3257
|
-
y:
|
|
3258
|
-
}, e.style.transform = `translate3d(${
|
|
3285
|
+
!e || !be || (ye = {
|
|
3286
|
+
x: Se,
|
|
3287
|
+
y: B
|
|
3288
|
+
}, e.style.transform = `translate3d(${Se + 16}px, ${B}px, 0) translateY(-50%)`);
|
|
3259
3289
|
})));
|
|
3260
3290
|
}
|
|
3261
|
-
function
|
|
3262
|
-
if (!
|
|
3263
|
-
|
|
3291
|
+
function ut() {
|
|
3292
|
+
if (!be) return;
|
|
3293
|
+
be = !1, ye = null;
|
|
3264
3294
|
let e = A.value?.getEl();
|
|
3265
3295
|
e && (e.style.visibility = "hidden");
|
|
3266
3296
|
}
|
|
3267
|
-
function
|
|
3297
|
+
function dt(e, t) {
|
|
3268
3298
|
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"));
|
|
3269
3299
|
}
|
|
3270
|
-
function
|
|
3271
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
3300
|
+
function ft(e, t = "solid") {
|
|
3301
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Ve.value + 1)), e.setAttribute("stroke", "#555"), dt(e, t);
|
|
3272
3302
|
}
|
|
3273
|
-
function
|
|
3274
|
-
e.setAttribute("stroke-width", String(
|
|
3303
|
+
function Q(e) {
|
|
3304
|
+
e.setAttribute("stroke-width", String(Ve.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
3275
3305
|
}
|
|
3276
|
-
function
|
|
3277
|
-
|
|
3306
|
+
function pt(e) {
|
|
3307
|
+
L !== e && (L && !R.has(L) && Q(L), L = e, ft(e, R.get(e) ?? "solid"));
|
|
3278
3308
|
}
|
|
3279
|
-
function
|
|
3280
|
-
if (
|
|
3281
|
-
let e =
|
|
3282
|
-
e == null ?
|
|
3309
|
+
function mt() {
|
|
3310
|
+
if (L) {
|
|
3311
|
+
let e = R.get(L);
|
|
3312
|
+
e == null ? Q(L) : ft(L, e), L = null, d("stateHover", null);
|
|
3283
3313
|
}
|
|
3284
|
-
|
|
3314
|
+
ut();
|
|
3285
3315
|
}
|
|
3286
3316
|
function ht(e) {
|
|
3287
3317
|
let t = e;
|
|
@@ -3289,24 +3319,24 @@ var Pt = {
|
|
|
3289
3319
|
return t ? t.dataset.featId ?? null : null;
|
|
3290
3320
|
}
|
|
3291
3321
|
function gt(e) {
|
|
3292
|
-
if (
|
|
3322
|
+
if (he) return;
|
|
3293
3323
|
let t = e, n = ht(t.target);
|
|
3294
3324
|
if (!n) return;
|
|
3295
|
-
let r =
|
|
3325
|
+
let r = I.get(n);
|
|
3296
3326
|
if (!r) return;
|
|
3297
3327
|
let i = {
|
|
3298
3328
|
id: r.id,
|
|
3299
3329
|
name: r.name,
|
|
3300
3330
|
value: r.value
|
|
3301
3331
|
};
|
|
3302
|
-
e.type === "click" ? (d("stateClick", i), d("update:focus",
|
|
3332
|
+
e.type === "click" ? (d("stateClick", i), d("update:focus", H(Z.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (pt(F.get(n)), j.value && ct(n, t.clientX, t.clientY), d("stateHover", i));
|
|
3303
3333
|
}
|
|
3304
3334
|
function _t(e) {
|
|
3305
|
-
|
|
3335
|
+
he || lt(e.clientX, e.clientY);
|
|
3306
3336
|
}
|
|
3307
3337
|
function vt(e) {
|
|
3308
3338
|
let t = e.relatedTarget;
|
|
3309
|
-
t && O.value?.contains(t) ||
|
|
3339
|
+
t && O.value?.contains(t) || mt();
|
|
3310
3340
|
}
|
|
3311
3341
|
function yt(e) {
|
|
3312
3342
|
let t = document.createElementNS(nr, "path");
|
|
@@ -3317,15 +3347,15 @@ var Pt = {
|
|
|
3317
3347
|
if (!e || !t) return;
|
|
3318
3348
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
3319
3349
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
3320
|
-
|
|
3321
|
-
let n =
|
|
3350
|
+
F.clear(), I.clear(), fe = null, L = null, R.clear(), me.clear();
|
|
3351
|
+
let n = Be.value, r = Le.value.features, i = l.strokeColor, a = String(Ve.value), o = !j.value, s = document.createDocumentFragment();
|
|
3322
3352
|
for (let e of r) {
|
|
3323
|
-
let t = String(e.id), r =
|
|
3324
|
-
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill",
|
|
3353
|
+
let t = String(e.id), r = rt(e), c = tt(t), l = yt(n(e));
|
|
3354
|
+
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", nt(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
|
|
3325
3355
|
let e = document.createElementNS(nr, "title");
|
|
3326
|
-
e.textContent =
|
|
3356
|
+
e.textContent = at(r, c), l.appendChild(e);
|
|
3327
3357
|
}
|
|
3328
|
-
s.appendChild(l),
|
|
3358
|
+
s.appendChild(l), F.set(t, l), I.set(t, {
|
|
3329
3359
|
id: t,
|
|
3330
3360
|
name: r,
|
|
3331
3361
|
value: c,
|
|
@@ -3335,34 +3365,34 @@ var Pt = {
|
|
|
3335
3365
|
let c = ze.value;
|
|
3336
3366
|
if (c) {
|
|
3337
3367
|
let e = yt(n(c));
|
|
3338
|
-
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e),
|
|
3368
|
+
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e), fe = e;
|
|
3339
3369
|
}
|
|
3340
3370
|
e.appendChild(s);
|
|
3341
3371
|
}
|
|
3342
3372
|
function xt() {
|
|
3343
3373
|
let e = !j.value;
|
|
3344
|
-
for (let [t, n] of
|
|
3345
|
-
let r =
|
|
3346
|
-
if (n.setAttribute("fill",
|
|
3374
|
+
for (let [t, n] of F) {
|
|
3375
|
+
let r = tt(t), i = I.get(t);
|
|
3376
|
+
if (n.setAttribute("fill", nt(t)), i && (i.value = r), e && i) {
|
|
3347
3377
|
let e = n.firstElementChild;
|
|
3348
|
-
e && (e.textContent =
|
|
3378
|
+
e && (e.textContent = at(i.name, r));
|
|
3349
3379
|
}
|
|
3350
3380
|
}
|
|
3351
3381
|
}
|
|
3352
3382
|
function St() {
|
|
3353
|
-
for (let e of
|
|
3354
|
-
|
|
3383
|
+
for (let e of F.values()) e === L || R.has(e) || Q(e);
|
|
3384
|
+
fe && fe.setAttribute("stroke", l.strokeColor);
|
|
3355
3385
|
}
|
|
3356
3386
|
function Ct() {
|
|
3357
3387
|
return typeof l.menu == "string" ? l.menu : "choropleth";
|
|
3358
3388
|
}
|
|
3359
|
-
let wt = n(() => l.legend && (
|
|
3389
|
+
let wt = n(() => l.legend && (qe.value || Je.value || l.data)), Tt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), Et = n(() => {
|
|
3360
3390
|
let e = [];
|
|
3361
3391
|
for (let t = 0; t <= 10; t++) {
|
|
3362
3392
|
let n = t / 10;
|
|
3363
3393
|
e.push({
|
|
3364
3394
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
3365
|
-
color:
|
|
3395
|
+
color: Qe(n)
|
|
3366
3396
|
});
|
|
3367
3397
|
}
|
|
3368
3398
|
return e;
|
|
@@ -3370,7 +3400,7 @@ var Pt = {
|
|
|
3370
3400
|
notation: "compact",
|
|
3371
3401
|
maximumFractionDigits: 1
|
|
3372
3402
|
}), Ot = n(() => {
|
|
3373
|
-
let { min: e, max: t } =
|
|
3403
|
+
let { min: e, max: t } = Ke.value, n = t - e, r = [];
|
|
3374
3404
|
for (let t = 1; t <= 3; t++) {
|
|
3375
3405
|
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? Dt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
3376
3406
|
r.push({
|
|
@@ -3381,45 +3411,45 @@ var Pt = {
|
|
|
3381
3411
|
return r;
|
|
3382
3412
|
}), kt = n(() => {
|
|
3383
3413
|
let e = [];
|
|
3384
|
-
if (
|
|
3414
|
+
if (qe.value) for (let t of l.colorScale) e.push({
|
|
3385
3415
|
key: t.value,
|
|
3386
3416
|
color: t.color,
|
|
3387
3417
|
label: t.value
|
|
3388
3418
|
});
|
|
3389
|
-
else if (
|
|
3419
|
+
else if (Je.value) for (let t of Tt.value) e.push({
|
|
3390
3420
|
key: String(t.min),
|
|
3391
3421
|
color: t.color,
|
|
3392
3422
|
label: t.label ?? String(t.min)
|
|
3393
3423
|
});
|
|
3394
3424
|
return e;
|
|
3395
|
-
}), $ = n(() => `linear-gradient(to right, ${Et.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), At =
|
|
3425
|
+
}), $ = n(() => `linear-gradient(to right, ${Et.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), At = Re(), jt = n(() => {
|
|
3396
3426
|
let e = Ct();
|
|
3397
3427
|
return [
|
|
3398
3428
|
At.menuItem.value,
|
|
3399
3429
|
{
|
|
3400
3430
|
label: "Save as SVG",
|
|
3401
3431
|
action: () => {
|
|
3402
|
-
D.value &&
|
|
3432
|
+
D.value && q(D.value, e);
|
|
3403
3433
|
}
|
|
3404
3434
|
},
|
|
3405
3435
|
{
|
|
3406
3436
|
label: "Save as PNG",
|
|
3407
3437
|
action: () => {
|
|
3408
|
-
D.value &&
|
|
3438
|
+
D.value && Ne(D.value, e);
|
|
3409
3439
|
}
|
|
3410
3440
|
}
|
|
3411
3441
|
];
|
|
3412
3442
|
});
|
|
3413
|
-
return T(() => [
|
|
3414
|
-
|
|
3443
|
+
return T(() => [Be.value, j.value], () => bt()), T(() => [
|
|
3444
|
+
Ge.value,
|
|
3415
3445
|
l.colorScale,
|
|
3416
3446
|
l.noDataColor,
|
|
3417
3447
|
l.dataGeoType
|
|
3418
|
-
], () => xt()), T(() => [l.strokeColor,
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
], () =>
|
|
3448
|
+
], () => xt()), T(() => [l.strokeColor, Ve.value], () => St()), T(() => [
|
|
3449
|
+
Z.value,
|
|
3450
|
+
Be.value,
|
|
3451
|
+
J.value
|
|
3452
|
+
], () => U(), { flush: "post" }), (n, c) => (_(), a("div", {
|
|
3423
3453
|
ref_key: "containerRef",
|
|
3424
3454
|
ref: w,
|
|
3425
3455
|
class: f(["choropleth-wrapper", {
|
|
@@ -3427,7 +3457,7 @@ var Pt = {
|
|
|
3427
3457
|
"is-fullscreen": S(At).isFullscreen.value
|
|
3428
3458
|
}])
|
|
3429
3459
|
}, [
|
|
3430
|
-
t.menu ? (_(), r(
|
|
3460
|
+
t.menu ? (_(), r(pe, {
|
|
3431
3461
|
key: 0,
|
|
3432
3462
|
items: jt.value
|
|
3433
3463
|
}, null, 8, ["items"])) : i("", !0),
|
|
@@ -3440,7 +3470,7 @@ var Pt = {
|
|
|
3440
3470
|
key: 1,
|
|
3441
3471
|
class: "choropleth-legend",
|
|
3442
3472
|
style: m(ae.value)
|
|
3443
|
-
}, [t.legendTitle ? (_(), a("span", Zn, b(t.legendTitle), 1)) : i("", !0),
|
|
3473
|
+
}, [t.legendTitle ? (_(), a("span", Zn, b(t.legendTitle), 1)) : i("", !0), qe.value || Je.value ? (_(!0), a(e, { key: 1 }, y(kt.value, (e) => (_(), a("span", {
|
|
3444
3474
|
key: e.key,
|
|
3445
3475
|
class: "choropleth-legend-item"
|
|
3446
3476
|
}, [o("span", {
|
|
@@ -3456,7 +3486,7 @@ var Pt = {
|
|
|
3456
3486
|
(_(), a("svg", {
|
|
3457
3487
|
ref_key: "svgRef",
|
|
3458
3488
|
ref: D,
|
|
3459
|
-
viewBox: `0 0 ${
|
|
3489
|
+
viewBox: `0 0 ${Me.value} ${K.value}`,
|
|
3460
3490
|
preserveAspectRatio: "xMidYMid meet"
|
|
3461
3491
|
}, [o("g", {
|
|
3462
3492
|
ref_key: "mapGroupRef",
|
|
@@ -3468,12 +3498,12 @@ var Pt = {
|
|
|
3468
3498
|
ref_key: "overlayGroupRef",
|
|
3469
3499
|
ref: k
|
|
3470
3500
|
}, null, 512)], 512)], 8, er)),
|
|
3471
|
-
|
|
3501
|
+
xe.value ? (_(), a("button", {
|
|
3472
3502
|
key: 2,
|
|
3473
3503
|
type: "button",
|
|
3474
3504
|
class: "choropleth-reset",
|
|
3475
3505
|
"aria-label": "Reset zoom",
|
|
3476
|
-
onClick:
|
|
3506
|
+
onClick: G
|
|
3477
3507
|
}, " Reset ")) : i("", !0),
|
|
3478
3508
|
j.value ? (_(), r(Jn, {
|
|
3479
3509
|
key: 3,
|
|
@@ -3483,12 +3513,12 @@ var Pt = {
|
|
|
3483
3513
|
default: E((r) => [ee(n.$slots, "tooltip", p(u(te(r))), () => [t.tooltipFormat ? (_(), a("span", {
|
|
3484
3514
|
key: 0,
|
|
3485
3515
|
innerHTML: t.tooltipFormat(r)
|
|
3486
|
-
}, null, 8, tr)) : r.value == null ? (_(), a(e, { key: 1 }, [s(b(r.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(r.name) + ": " + b(
|
|
3516
|
+
}, null, 8, tr)) : r.value == null ? (_(), a(e, { key: 1 }, [s(b(r.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(r.name) + ": " + b(it(r.value)), 1)], 64))], !0)]),
|
|
3487
3517
|
_: 3
|
|
3488
3518
|
}, 512)) : i("", !0)
|
|
3489
3519
|
], 2));
|
|
3490
3520
|
}
|
|
3491
|
-
}), [["__scopeId", "data-v-b11a80ed"]]), or = /* @__PURE__ */
|
|
3521
|
+
}), [["__scopeId", "data-v-b11a80ed"]]), or = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3492
3522
|
__name: "ChartTooltip",
|
|
3493
3523
|
props: {
|
|
3494
3524
|
x: {},
|
|
@@ -3539,7 +3569,7 @@ var Pt = {
|
|
|
3539
3569
|
_: 3
|
|
3540
3570
|
}, 8, ["open"])) : i("", !0);
|
|
3541
3571
|
}
|
|
3542
|
-
}), [["__scopeId", "data-v-44377f70"]]), sr = { class: "TableWrapper" }, cr = /* @__PURE__ */
|
|
3572
|
+
}), [["__scopeId", "data-v-44377f70"]]), sr = { class: "TableWrapper" }, cr = ["href", "download"], lr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3543
3573
|
__name: "DataTable",
|
|
3544
3574
|
props: {
|
|
3545
3575
|
data: {},
|
|
@@ -3552,6 +3582,11 @@ var Pt = {
|
|
|
3552
3582
|
csv: {},
|
|
3553
3583
|
filename: {},
|
|
3554
3584
|
downloadMenuLink: { default: "Download" },
|
|
3585
|
+
downloadButton: {
|
|
3586
|
+
type: Boolean,
|
|
3587
|
+
default: !1
|
|
3588
|
+
},
|
|
3589
|
+
downloadLink: { type: [Boolean, String] },
|
|
3555
3590
|
fullWidth: {
|
|
3556
3591
|
type: Boolean,
|
|
3557
3592
|
default: !1
|
|
@@ -3628,33 +3663,54 @@ var Pt = {
|
|
|
3628
3663
|
}
|
|
3629
3664
|
return n.join("\n");
|
|
3630
3665
|
}
|
|
3631
|
-
|
|
3666
|
+
function S() {
|
|
3667
|
+
J(x(), ee());
|
|
3668
|
+
}
|
|
3669
|
+
let C = n(() => c.downloadButton || c.downloadLink ? [] : [{
|
|
3632
3670
|
label: c.downloadMenuLink,
|
|
3633
|
-
action:
|
|
3634
|
-
}]),
|
|
3671
|
+
action: S
|
|
3672
|
+
}]), w = n(() => {
|
|
3673
|
+
if (c.downloadButton) return null;
|
|
3674
|
+
let e = c.downloadLink;
|
|
3675
|
+
return e ? typeof e == "string" ? e : "Download data (CSV)" : null;
|
|
3676
|
+
}), T = n(() => w.value ? `data:text/csv;charset=utf-8,${encodeURIComponent(x())}` : null), E = n(() => !!c.menu && C.value.length > 0);
|
|
3635
3677
|
return (n, s) => (_(), a("div", { class: f(["TableOuter", {
|
|
3636
3678
|
"full-width": t.fullWidth,
|
|
3637
|
-
"has-menu":
|
|
3638
|
-
}]) }, [
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3679
|
+
"has-menu": E.value
|
|
3680
|
+
}]) }, [
|
|
3681
|
+
E.value ? (_(), r(pe, {
|
|
3682
|
+
key: 0,
|
|
3683
|
+
items: C.value,
|
|
3684
|
+
"force-dropdown": ""
|
|
3685
|
+
}, null, 8, ["items"])) : i("", !0),
|
|
3686
|
+
o("div", sr, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
|
|
3687
|
+
o("colgroup", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("col", {
|
|
3688
|
+
key: e.name,
|
|
3689
|
+
style: m(u(e.name))
|
|
3690
|
+
}, null, 4))), 128))]),
|
|
3691
|
+
o("thead", null, [o("tr", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("th", {
|
|
3692
|
+
key: e.name,
|
|
3693
|
+
style: m(d(e.name))
|
|
3694
|
+
}, b(l(e.name)), 5))), 128))])]),
|
|
3695
|
+
o("tbody", null, [(_(!0), a(e, null, y(g.value, (n) => (_(), a("tr", { key: n }, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("td", {
|
|
3696
|
+
key: e.name,
|
|
3697
|
+
class: f(t.columnConfig?.[e.name]?.cellClass),
|
|
3698
|
+
style: m(d(e.name))
|
|
3699
|
+
}, b(v(e, n - 1)), 7))), 128))]))), 128))])
|
|
3700
|
+
], 2)]),
|
|
3701
|
+
t.downloadButton ? (_(), a("button", {
|
|
3702
|
+
key: 1,
|
|
3703
|
+
type: "button",
|
|
3704
|
+
class: "data-table-download-button",
|
|
3705
|
+
onClick: S
|
|
3706
|
+
}, b(t.downloadMenuLink), 1)) : w.value ? (_(), a("a", {
|
|
3707
|
+
key: 2,
|
|
3708
|
+
class: "data-table-download-link",
|
|
3709
|
+
href: T.value,
|
|
3710
|
+
download: `${ee()}.csv`
|
|
3711
|
+
}, b(w.value), 9, cr)) : i("", !0)
|
|
3712
|
+
], 2));
|
|
3657
3713
|
}
|
|
3658
|
-
}), [["__scopeId", "data-v-
|
|
3714
|
+
}), [["__scopeId", "data-v-20a55780"]]);
|
|
3659
3715
|
//#endregion
|
|
3660
|
-
export { Kn as BarChart, or as ChartTooltip, ar as ChoroplethMap,
|
|
3716
|
+
export { Kn as BarChart, or as ChartTooltip, ar as ChoroplethMap, lr as DataTable, bn as LineChart };
|