@cfasim-ui/charts 0.4.16 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hsa-mapping.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1175 -915
- package/dist/{BarChart → src/BarChart}/BarChart.d.ts +96 -1
- package/dist/{ChoroplethMap → src/ChoroplethMap}/ChoroplethMap.d.ts +8 -8
- package/dist/{DataTable → src/DataTable}/DataTable.d.ts +15 -0
- package/dist/src/_shared/contrast.d.ts +30 -0
- package/dist/{_shared → src/_shared}/index.d.ts +1 -0
- package/dist/src/_shared/seriesCsv.test.d.ts +1 -0
- package/package.json +2 -2
- /package/dist/{hsaMapping-Devrp7Rk.js → hsaMapping-BahYDmea.js} +0 -0
- /package/dist/{BarChart → src/BarChart}/BarChart.spec.d.ts +0 -0
- /package/dist/{BarChart → src/BarChart}/BarChart.test.d.ts +0 -0
- /package/dist/{ChartMenu → src/ChartMenu}/ChartMenu.d.ts +0 -0
- /package/dist/{ChartMenu → src/ChartMenu}/download.d.ts +0 -0
- /package/dist/{ChartMenu → src/ChartMenu}/download.test.d.ts +0 -0
- /package/dist/{ChartTooltip → src/ChartTooltip}/ChartTooltip.d.ts +0 -0
- /package/dist/{ChartTooltip → src/ChartTooltip}/ChartTooltip.test.d.ts +0 -0
- /package/dist/{ChoroplethMap → src/ChoroplethMap}/ChoroplethMap.test.d.ts +0 -0
- /package/dist/{ChoroplethMap → src/ChoroplethMap}/ChoroplethTooltip.d.ts +0 -0
- /package/dist/{ChoroplethMap → src/ChoroplethMap}/hsaMapping.d.ts +0 -0
- /package/dist/{DataTable → src/DataTable}/DataTable.test.d.ts +0 -0
- /package/dist/{LineChart → src/LineChart}/LineChart.d.ts +0 -0
- /package/dist/{LineChart → src/LineChart}/LineChart.spec.d.ts +0 -0
- /package/dist/{LineChart → src/LineChart}/LineChart.test.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/ChartAnnotations.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/annotations.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/axes.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/axes.test.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/chartProps.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/computeTicks.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/computeTicks.test.d.ts +0 -0
- /package/dist/{_shared/dateAxis.test.d.ts → src/_shared/contrast.test.d.ts} +0 -0
- /package/dist/{_shared → src/_shared}/dateAxis.d.ts +0 -0
- /package/dist/{_shared/scale.test.d.ts → src/_shared/dateAxis.test.d.ts} +0 -0
- /package/dist/{_shared → src/_shared}/scale.d.ts +0 -0
- /package/dist/{_shared/seriesCsv.test.d.ts → src/_shared/scale.test.d.ts} +0 -0
- /package/dist/{_shared → src/_shared}/seriesCsv.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/useChartFoundation.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/useChartFullscreen.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/useChartMenu.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/useChartPadding.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/useChartSize.d.ts +0 -0
- /package/dist/{_shared → src/_shared}/useChartTooltip.d.ts +0 -0
- /package/dist/{hsa-mapping.d.ts → src/hsa-mapping.d.ts} +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{tooltip-position.d.ts → src/tooltip-position.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, 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
|
|
2
|
-
import { formatNumber as
|
|
3
|
-
import { DropdownMenuContent as
|
|
4
|
-
import { geoAlbersUsa as
|
|
5
|
-
import { zoom as
|
|
6
|
-
import { select as
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as b, toDisplayString as x, toHandlers as ee, toRaw as S, unref as C, useSlots as w, useTemplateRef as T, watch as E, withCtx as D } from "vue";
|
|
2
|
+
import { formatNumber as te } from "@cfasim-ui/shared";
|
|
3
|
+
import { DropdownMenuContent as O, DropdownMenuItem as k, DropdownMenuPortal as ne, DropdownMenuRoot as A, DropdownMenuTrigger as j, PopoverAnchor as re, PopoverContent as M, PopoverPortal as ie, PopoverRoot as N } from "reka-ui";
|
|
4
|
+
import { geoAlbersUsa as ae, geoPath as P } from "d3-geo";
|
|
5
|
+
import { zoom as oe, zoomIdentity as se } from "d3-zoom";
|
|
6
|
+
import { select as ce } from "d3-selection";
|
|
7
7
|
import "d3-transition";
|
|
8
|
-
import { feature as
|
|
8
|
+
import { feature as F, merge as le, mesh as ue } from "topojson-client";
|
|
9
9
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var I = { class: "chart-menu-trigger-area" }, de = ["aria-label"], fe = /* @__PURE__ */ l({
|
|
11
11
|
__name: "ChartMenu",
|
|
12
12
|
props: {
|
|
13
13
|
items: {},
|
|
@@ -18,15 +18,15 @@ var F = { class: "chart-menu-trigger-area" }, I = ["aria-label"], fe = /* @__PUR
|
|
|
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", I, [i() ? (_(), r(C(A), {
|
|
22
22
|
key: 1,
|
|
23
23
|
modal: !1
|
|
24
24
|
}, {
|
|
25
|
-
default:
|
|
25
|
+
default: D(() => [c(C(j), {
|
|
26
26
|
class: "chart-menu-button",
|
|
27
27
|
"aria-label": "Chart options"
|
|
28
28
|
}, {
|
|
29
|
-
default:
|
|
29
|
+
default: D(() => [...l[2] ||= [o("svg", {
|
|
30
30
|
width: "16",
|
|
31
31
|
height: "16",
|
|
32
32
|
viewBox: "0 0 16 16",
|
|
@@ -50,19 +50,19 @@ var F = { class: "chart-menu-trigger-area" }, I = ["aria-label"], fe = /* @__PUR
|
|
|
50
50
|
})
|
|
51
51
|
], -1)]]),
|
|
52
52
|
_: 1
|
|
53
|
-
}), c(
|
|
54
|
-
default:
|
|
53
|
+
}), c(C(ne), null, {
|
|
54
|
+
default: D(() => [c(C(O), {
|
|
55
55
|
class: "chart-menu-content",
|
|
56
56
|
"side-offset": 4,
|
|
57
57
|
align: "end"
|
|
58
58
|
}, {
|
|
59
|
-
default:
|
|
59
|
+
default: D(() => [(_(!0), a(e, null, y(t.items, (e) => (_(), r(C(k), {
|
|
60
60
|
key: e.label,
|
|
61
61
|
class: "chart-menu-item",
|
|
62
62
|
"aria-pressed": e.ariaPressed,
|
|
63
63
|
onSelect: e.action
|
|
64
64
|
}, {
|
|
65
|
-
default:
|
|
65
|
+
default: D(() => [s(x(e.label), 1)]),
|
|
66
66
|
_: 2
|
|
67
67
|
}, 1032, ["aria-pressed", "onSelect"]))), 128))]),
|
|
68
68
|
_: 1
|
|
@@ -85,7 +85,7 @@ var F = { class: "chart-menu-trigger-area" }, I = ["aria-label"], fe = /* @__PUR
|
|
|
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, de))]));
|
|
89
89
|
}
|
|
90
90
|
}), L = (e, t) => {
|
|
91
91
|
let n = e.__vccOpts || e;
|
|
@@ -264,10 +264,10 @@ function Oe(e) {
|
|
|
264
264
|
}
|
|
265
265
|
//#endregion
|
|
266
266
|
//#region src/tooltip-position.ts
|
|
267
|
-
var
|
|
268
|
-
function
|
|
267
|
+
var ke = 16, Ae = 8;
|
|
268
|
+
function H(e, t, n, r, i, a) {
|
|
269
269
|
if (i === "none") return {
|
|
270
|
-
left: e +
|
|
270
|
+
left: e + ke,
|
|
271
271
|
top: t
|
|
272
272
|
};
|
|
273
273
|
let o = i === "chart" && a ? {
|
|
@@ -280,15 +280,15 @@ function Ae(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 + ke + n > o.right - Ae ? e - ke - n : e + ke, 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 + Ae + c), o.bottom - Ae - c)
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
289
|
//#endregion
|
|
290
290
|
//#region src/_shared/useChartTooltip.ts
|
|
291
|
-
function
|
|
291
|
+
function je(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;
|
|
@@ -302,14 +302,14 @@ function U(e) {
|
|
|
302
302
|
clientY: r.clientY
|
|
303
303
|
}, e.onHover?.({ index: i }));
|
|
304
304
|
}
|
|
305
|
-
|
|
305
|
+
E([a, n], () => {
|
|
306
306
|
if (n.value === null || !a.value) {
|
|
307
307
|
o.value = null;
|
|
308
308
|
return;
|
|
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 } = H(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 U(e) {
|
|
|
355
355
|
}
|
|
356
356
|
//#endregion
|
|
357
357
|
//#region src/ChartMenu/download.ts
|
|
358
|
-
function
|
|
358
|
+
function Me(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 U = [
|
|
363
363
|
"color",
|
|
364
364
|
"font-family",
|
|
365
365
|
"font-size",
|
|
366
366
|
"font-weight"
|
|
367
|
-
],
|
|
368
|
-
function
|
|
367
|
+
], W = ["fill", "stroke"];
|
|
368
|
+
function Ne(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 G(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 U) {
|
|
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 W) {
|
|
385
385
|
let n = e.getAttribute(t);
|
|
386
|
-
!n || !n.includes("var(") || e.setAttribute(t,
|
|
386
|
+
!n || !n.includes("var(") || e.setAttribute(t, Ne(n));
|
|
387
387
|
}
|
|
388
388
|
return t;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
let n =
|
|
392
|
-
|
|
390
|
+
function K(e, t) {
|
|
391
|
+
let n = G(e), r = new XMLSerializer().serializeToString(n);
|
|
392
|
+
Me(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
let n =
|
|
394
|
+
function Pe(e, t) {
|
|
395
|
+
let n = G(e), r = new XMLSerializer().serializeToString(n), i = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(i), o = new Image(), s = e.width.baseVal.value || e.clientWidth, c = e.height.baseVal.value || e.clientHeight;
|
|
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 && Me(e, `${t}.png`);
|
|
402
402
|
}), URL.revokeObjectURL(a);
|
|
403
403
|
}, o.src = a;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
|
|
405
|
+
function Fe(e, t) {
|
|
406
|
+
Me(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 Ie = 0, Le = "";
|
|
411
|
+
function Re() {
|
|
412
|
+
typeof document > "u" || (Ie === 0 && (Le = document.body.style.overflow, document.body.style.overflow = "hidden"), Ie++);
|
|
413
413
|
}
|
|
414
|
-
function
|
|
415
|
-
typeof document > "u" ||
|
|
414
|
+
function ze() {
|
|
415
|
+
typeof document > "u" || Ie !== 0 && (Ie--, Ie === 0 && (document.body.style.overflow = Le));
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function Be() {
|
|
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 ? (Re(), t = !0) : !n && t && (ze(), t = !1));
|
|
421
421
|
}
|
|
422
422
|
function i(t) {
|
|
423
423
|
if (t.key !== "Escape" || !e.value) return;
|
|
@@ -436,7 +436,7 @@ function Re() {
|
|
|
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 &&= (ze(), !1));
|
|
440
440
|
}), {
|
|
441
441
|
isFullscreen: e,
|
|
442
442
|
toggle: s,
|
|
@@ -451,7 +451,7 @@ function Re() {
|
|
|
451
451
|
}
|
|
452
452
|
//#endregion
|
|
453
453
|
//#region src/_shared/useChartMenu.ts
|
|
454
|
-
function
|
|
454
|
+
function Ve(e) {
|
|
455
455
|
let t = v(null);
|
|
456
456
|
function r() {
|
|
457
457
|
let t = e.filename();
|
|
@@ -459,23 +459,23 @@ 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 ? Be() : null, a = n(() => {
|
|
463
463
|
let n = r(), a = [];
|
|
464
464
|
i && a.push(i.menuItem.value), a.push({
|
|
465
465
|
label: "Save as SVG",
|
|
466
466
|
action: () => {
|
|
467
|
-
t.value &&
|
|
467
|
+
t.value && K(t.value, n);
|
|
468
468
|
}
|
|
469
469
|
}, {
|
|
470
470
|
label: "Save as PNG",
|
|
471
471
|
action: () => {
|
|
472
|
-
t.value &&
|
|
472
|
+
t.value && Pe(t.value, n);
|
|
473
473
|
}
|
|
474
474
|
});
|
|
475
475
|
let o = e.downloadButton?.();
|
|
476
476
|
return !e.downloadLink() && !o && a.push({
|
|
477
477
|
label: "Download CSV",
|
|
478
|
-
action: () =>
|
|
478
|
+
action: () => Fe(e.getCsv(), n)
|
|
479
479
|
}), a;
|
|
480
480
|
}), o = n(() => {
|
|
481
481
|
if (e.downloadButton?.()) return null;
|
|
@@ -486,7 +486,7 @@ function ze(e) {
|
|
|
486
486
|
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
487
487
|
});
|
|
488
488
|
function l() {
|
|
489
|
-
|
|
489
|
+
Fe(e.getCsv(), r());
|
|
490
490
|
}
|
|
491
491
|
return {
|
|
492
492
|
svgRef: t,
|
|
@@ -501,7 +501,7 @@ function ze(e) {
|
|
|
501
501
|
}
|
|
502
502
|
//#endregion
|
|
503
503
|
//#region src/_shared/seriesCsv.ts
|
|
504
|
-
function
|
|
504
|
+
function He(e) {
|
|
505
505
|
if (e.length === 0) return "";
|
|
506
506
|
let t = 0;
|
|
507
507
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -513,43 +513,43 @@ function Y(e) {
|
|
|
513
513
|
}
|
|
514
514
|
return i.join("\n");
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Ue(e, t, n = "category") {
|
|
517
517
|
if (t.length === 0 || e.length === 0) return "";
|
|
518
518
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
519
519
|
for (let n = 0; n < e.length; n++) {
|
|
520
|
-
let i = [
|
|
520
|
+
let i = [q(e[n])];
|
|
521
521
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
522
522
|
r.push(i.join(","));
|
|
523
523
|
}
|
|
524
524
|
return r.join("\n");
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function q(e) {
|
|
527
527
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
528
528
|
}
|
|
529
529
|
//#endregion
|
|
530
530
|
//#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
|
|
531
|
-
var
|
|
531
|
+
var J = {
|
|
532
532
|
class: "chart-annotations",
|
|
533
533
|
"pointer-events": "none"
|
|
534
|
-
},
|
|
534
|
+
}, We = ["stroke", "stroke-width"], Ge = [
|
|
535
535
|
"d",
|
|
536
536
|
"stroke",
|
|
537
537
|
"stroke-width"
|
|
538
|
-
],
|
|
538
|
+
], Y = [
|
|
539
539
|
"fill",
|
|
540
540
|
"stroke",
|
|
541
541
|
"stroke-width",
|
|
542
542
|
"transform"
|
|
543
|
-
],
|
|
543
|
+
], Ke = [
|
|
544
544
|
"stroke",
|
|
545
545
|
"stroke-width",
|
|
546
546
|
"stroke-dasharray"
|
|
547
|
-
],
|
|
547
|
+
], X = [
|
|
548
548
|
"d",
|
|
549
549
|
"stroke",
|
|
550
550
|
"stroke-width",
|
|
551
551
|
"stroke-dasharray"
|
|
552
|
-
],
|
|
552
|
+
], qe = ["fill", "transform"], Je = [
|
|
553
553
|
"x",
|
|
554
554
|
"y",
|
|
555
555
|
"text-anchor",
|
|
@@ -558,7 +558,7 @@ var X = {
|
|
|
558
558
|
"fill",
|
|
559
559
|
"stroke",
|
|
560
560
|
"stroke-width"
|
|
561
|
-
],
|
|
561
|
+
], Ye = ["x", "dy"], Xe = ["font-weight", "font-style"], Ze = 13, Qe = "normal", $e = 700, et = "var(--color-bg-0, #fff)", tt = 3, nt = 1, rt = 4, it = 6, at = 1.2, ot = .35, st = /* @__PURE__ */ l({
|
|
562
562
|
__name: "ChartAnnotations",
|
|
563
563
|
props: {
|
|
564
564
|
annotations: { default: () => [] },
|
|
@@ -595,35 +595,35 @@ var X = {
|
|
|
595
595
|
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
596
596
|
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
597
597
|
if (a && !r.bounds) continue;
|
|
598
|
-
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 ?? Ze, g = t.fontWeight ?? Qe, _ = t.outlineColor ?? et, v = t.outlineWidth ?? tt, y = t.lineColor ?? m, b = t.lineWidth ?? nt, x = s(t.lineDash), ee = {
|
|
599
599
|
left: "start",
|
|
600
600
|
center: "middle",
|
|
601
601
|
right: "end"
|
|
602
|
-
}[t.align ?? (o > 0 ? "left" : o < 0 ? "right" : "center")],
|
|
603
|
-
if (a && r.bounds)
|
|
602
|
+
}[t.align ?? (o > 0 ? "left" : o < 0 ? "right" : "center")], S, C = "", w, T = !a && (t.arrow ?? !0);
|
|
603
|
+
if (a && r.bounds) S = u(i, n.x, n.y, r.bounds);
|
|
604
604
|
else {
|
|
605
605
|
let e = f(n.x, n.y, d, p, h, i);
|
|
606
|
-
|
|
606
|
+
C = e.path, T && e.arrow && (w = e.arrow);
|
|
607
607
|
}
|
|
608
608
|
e.push({
|
|
609
609
|
lines: t.text.split("\n").map(c),
|
|
610
610
|
textX: d,
|
|
611
611
|
textY: p,
|
|
612
|
-
textAnchor:
|
|
613
|
-
dy: h *
|
|
612
|
+
textAnchor: ee,
|
|
613
|
+
dy: h * at,
|
|
614
614
|
fontSize: h,
|
|
615
615
|
fontWeight: g,
|
|
616
616
|
color: m,
|
|
617
617
|
outlineColor: _,
|
|
618
618
|
outlineWidth: v,
|
|
619
|
-
pointerPath:
|
|
619
|
+
pointerPath: C,
|
|
620
620
|
lineColor: y,
|
|
621
|
-
lineWidth:
|
|
622
|
-
lineDash:
|
|
623
|
-
arrow:
|
|
624
|
-
arrowTip:
|
|
625
|
-
arrowTransform:
|
|
626
|
-
rule:
|
|
621
|
+
lineWidth: b,
|
|
622
|
+
lineDash: x,
|
|
623
|
+
arrow: T,
|
|
624
|
+
arrowTip: w,
|
|
625
|
+
arrowTransform: w ? `translate(${w.x} ${w.y}) rotate(${w.angle})` : "",
|
|
626
|
+
rule: S
|
|
627
627
|
});
|
|
628
628
|
}
|
|
629
629
|
return e;
|
|
@@ -676,11 +676,11 @@ var X = {
|
|
|
676
676
|
}
|
|
677
677
|
function f(e, t, n, r, i, a) {
|
|
678
678
|
if (a === "none") return { path: "" };
|
|
679
|
-
let o = n - e, s = r - t, c = r - i *
|
|
679
|
+
let o = n - e, s = r - t, c = r - i * ot;
|
|
680
680
|
if (o === 0 || s === 0 || a === "straight") {
|
|
681
681
|
let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
|
|
682
|
-
if (l <=
|
|
683
|
-
let u = a / l, d = o / l, f = e + u *
|
|
682
|
+
if (l <= 10) return { path: "" };
|
|
683
|
+
let u = a / l, d = o / l, f = e + u * rt, p = t + d * rt, m = n - u * it, h = i - d * it, g = Math.atan2(-d, -u) * 180 / Math.PI;
|
|
684
684
|
return {
|
|
685
685
|
path: `M${f},${p} L${m},${h}`,
|
|
686
686
|
arrow: {
|
|
@@ -691,8 +691,8 @@ var X = {
|
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
693
|
let l = c - t;
|
|
694
|
-
if (Math.abs(l) <=
|
|
695
|
-
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d *
|
|
694
|
+
if (Math.abs(l) <= rt || Math.abs(o) <= it) return { path: "" };
|
|
695
|
+
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d * rt, m = n - u * it, h = c, g = d > 0 ? -90 : 90;
|
|
696
696
|
return {
|
|
697
697
|
path: `M${f},${p} Q${f},${c} ${m},${h}`,
|
|
698
698
|
arrow: {
|
|
@@ -702,7 +702,7 @@ var X = {
|
|
|
702
702
|
}
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
|
-
return (t, n) => (_(), a("g",
|
|
705
|
+
return (t, n) => (_(), a("g", J, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
706
706
|
t.rule && t.outlineWidth > 0 ? (_(), a("line", d({
|
|
707
707
|
key: 0,
|
|
708
708
|
ref_for: !0
|
|
@@ -711,7 +711,7 @@ var X = {
|
|
|
711
711
|
stroke: t.outlineColor,
|
|
712
712
|
"stroke-width": t.lineWidth + t.outlineWidth,
|
|
713
713
|
"stroke-linecap": "round"
|
|
714
|
-
}), null, 16,
|
|
714
|
+
}), null, 16, We)) : i("", !0),
|
|
715
715
|
t.pointerPath && t.outlineWidth > 0 ? (_(), a("path", {
|
|
716
716
|
key: 1,
|
|
717
717
|
d: t.pointerPath,
|
|
@@ -720,7 +720,7 @@ var X = {
|
|
|
720
720
|
stroke: t.outlineColor,
|
|
721
721
|
"stroke-width": t.lineWidth + t.outlineWidth,
|
|
722
722
|
"stroke-linecap": "round"
|
|
723
|
-
}, null, 8,
|
|
723
|
+
}, null, 8, Ge)) : i("", !0),
|
|
724
724
|
t.arrowTip && t.outlineWidth > 0 ? (_(), a("polygon", {
|
|
725
725
|
key: 2,
|
|
726
726
|
points: "0,0 -6,-3 -6,3",
|
|
@@ -730,7 +730,7 @@ var X = {
|
|
|
730
730
|
"stroke-width": t.outlineWidth,
|
|
731
731
|
"stroke-linejoin": "round",
|
|
732
732
|
transform: t.arrowTransform
|
|
733
|
-
}, null, 8,
|
|
733
|
+
}, null, 8, Y)) : i("", !0),
|
|
734
734
|
t.rule ? (_(), a("line", d({
|
|
735
735
|
key: 3,
|
|
736
736
|
ref_for: !0
|
|
@@ -739,7 +739,7 @@ var X = {
|
|
|
739
739
|
"stroke-width": t.lineWidth,
|
|
740
740
|
"stroke-dasharray": t.lineDash,
|
|
741
741
|
"stroke-linecap": "round"
|
|
742
|
-
}), null, 16,
|
|
742
|
+
}), null, 16, Ke)) : i("", !0),
|
|
743
743
|
t.pointerPath ? (_(), a("path", {
|
|
744
744
|
key: 4,
|
|
745
745
|
d: t.pointerPath,
|
|
@@ -748,13 +748,13 @@ var X = {
|
|
|
748
748
|
"stroke-width": t.lineWidth,
|
|
749
749
|
"stroke-dasharray": t.lineDash,
|
|
750
750
|
"stroke-linecap": "round"
|
|
751
|
-
}, null, 8,
|
|
751
|
+
}, null, 8, X)) : i("", !0),
|
|
752
752
|
t.arrowTip ? (_(), a("polygon", {
|
|
753
753
|
key: 5,
|
|
754
754
|
points: "0,0 -6,-3 -6,3",
|
|
755
755
|
fill: t.lineColor,
|
|
756
756
|
transform: t.arrowTransform
|
|
757
|
-
}, null, 8,
|
|
757
|
+
}, null, 8, qe)) : i("", !0),
|
|
758
758
|
o("text", {
|
|
759
759
|
x: t.textX,
|
|
760
760
|
y: t.textY,
|
|
@@ -772,27 +772,27 @@ var X = {
|
|
|
772
772
|
dy: r === 0 ? 0 : t.dy
|
|
773
773
|
}, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
|
|
774
774
|
key: t,
|
|
775
|
-
"font-weight": e.bold ?
|
|
775
|
+
"font-weight": e.bold ? $e : void 0,
|
|
776
776
|
"font-style": e.italic ? "italic" : void 0
|
|
777
|
-
},
|
|
777
|
+
}, x(e.text), 9, Xe))), 128))], 8, Ye))), 128))], 8, Je)
|
|
778
778
|
], 64))), 128))]));
|
|
779
779
|
}
|
|
780
|
-
}),
|
|
781
|
-
function
|
|
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 } =
|
|
780
|
+
}), ct = 400, lt = 200;
|
|
781
|
+
function ut(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 } = Ve({
|
|
783
783
|
filename: e.filename,
|
|
784
784
|
legacyMenuLabel: e.menu,
|
|
785
785
|
getCsv: e.getCsv,
|
|
786
786
|
downloadLink: e.downloadLink,
|
|
787
787
|
downloadButton: e.downloadButton,
|
|
788
788
|
fullscreen: !0
|
|
789
|
-
}), p = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value ||
|
|
789
|
+
}), p = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value || ct)), m = n(() => {
|
|
790
790
|
if (f.value && i.value > 0) {
|
|
791
791
|
let t = e.extraBelowHeight?.() ?? 0;
|
|
792
792
|
return i.value - t;
|
|
793
793
|
}
|
|
794
|
-
return e.height() ??
|
|
795
|
-
}), { padding: h, legendY: g, inlineLegendLayout: _, innerW: v, innerH: y, bounds:
|
|
794
|
+
return e.height() ?? lt;
|
|
795
|
+
}), { padding: h, legendY: g, inlineLegendLayout: _, innerW: v, innerH: y, bounds: b } = Oe({
|
|
796
796
|
title: e.title,
|
|
797
797
|
titleStyle: e.titleStyle,
|
|
798
798
|
xLabel: e.xLabel,
|
|
@@ -801,7 +801,7 @@ function lt(e) {
|
|
|
801
801
|
width: () => p.value,
|
|
802
802
|
height: () => m.value,
|
|
803
803
|
extraPadding: e.chartPadding
|
|
804
|
-
}), { hoverIndex:
|
|
804
|
+
}), { hoverIndex: x, tooltipRef: ee, tooltipPos: S, handlers: C } = je({
|
|
805
805
|
enabled: e.hasTooltipSlot,
|
|
806
806
|
trigger: e.tooltipTrigger,
|
|
807
807
|
clamp: () => e.tooltipClamp() ?? "chart",
|
|
@@ -819,11 +819,11 @@ function lt(e) {
|
|
|
819
819
|
inlineLegendLayout: _,
|
|
820
820
|
innerW: v,
|
|
821
821
|
innerH: y,
|
|
822
|
-
bounds:
|
|
823
|
-
hoverIndex:
|
|
824
|
-
tooltipRef:
|
|
825
|
-
tooltipPos:
|
|
826
|
-
tooltipHandlers:
|
|
822
|
+
bounds: b,
|
|
823
|
+
hoverIndex: x,
|
|
824
|
+
tooltipRef: ee,
|
|
825
|
+
tooltipPos: S,
|
|
826
|
+
tooltipHandlers: C,
|
|
827
827
|
menuItems: o,
|
|
828
828
|
downloadLinkText: s,
|
|
829
829
|
csvHref: c,
|
|
@@ -834,188 +834,238 @@ function lt(e) {
|
|
|
834
834
|
measuredHeight: i
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function dt(e, t) {
|
|
838
838
|
return (n) => {
|
|
839
839
|
let r = e();
|
|
840
|
-
if (r !== void 0) return
|
|
840
|
+
if (r !== void 0) return te(n, r);
|
|
841
841
|
let i = t();
|
|
842
|
-
return i === void 0 ? _e(n) :
|
|
842
|
+
return i === void 0 ? _e(n) : te(n, i);
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
//#endregion
|
|
846
|
+
//#region src/_shared/contrast.ts
|
|
847
|
+
function ft(e) {
|
|
848
|
+
let t = e.trim();
|
|
849
|
+
if (t.startsWith("#")) {
|
|
850
|
+
let e = t.slice(1);
|
|
851
|
+
if (e.length === 3 || e.length === 4) e = e.slice(0, 3).split("").map((e) => e + e).join("");
|
|
852
|
+
else if (e.length === 6 || e.length === 8) e = e.slice(0, 6);
|
|
853
|
+
else return null;
|
|
854
|
+
let n = Number.parseInt(e, 16);
|
|
855
|
+
return Number.isNaN(n) ? null : [
|
|
856
|
+
n >> 16 & 255,
|
|
857
|
+
n >> 8 & 255,
|
|
858
|
+
n & 255
|
|
859
|
+
];
|
|
860
|
+
}
|
|
861
|
+
let n = t.match(/^rgba?\(([^)]+)\)$/i);
|
|
862
|
+
if (n) {
|
|
863
|
+
let e = n[1].split(/[,/\s]+/).filter(Boolean);
|
|
864
|
+
if (e.length < 3) return null;
|
|
865
|
+
let t = e.slice(0, 3).map((e) => e.endsWith("%") ? Math.round(parseFloat(e) / 100 * 255) : Math.round(parseFloat(e)));
|
|
866
|
+
return t.some((e) => Number.isNaN(e)) ? null : [
|
|
867
|
+
t[0],
|
|
868
|
+
t[1],
|
|
869
|
+
t[2]
|
|
870
|
+
];
|
|
871
|
+
}
|
|
872
|
+
return null;
|
|
873
|
+
}
|
|
874
|
+
function pt([e, t, n]) {
|
|
875
|
+
let r = (e) => {
|
|
876
|
+
let t = e / 255;
|
|
877
|
+
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
843
878
|
};
|
|
879
|
+
return .2126 * r(e) + .7152 * r(t) + .0722 * r(n);
|
|
880
|
+
}
|
|
881
|
+
var mt = null, ht = /* @__PURE__ */ new Map();
|
|
882
|
+
function gt(e) {
|
|
883
|
+
let t = ft(e);
|
|
884
|
+
if (t) return t;
|
|
885
|
+
if (ht.has(e)) return ht.get(e) ?? null;
|
|
886
|
+
if (typeof document > "u") return null;
|
|
887
|
+
mt || (mt = document.createElement("span"), mt.style.cssText = "position:absolute;width:0;height:0;visibility:hidden;pointer-events:none", document.body.appendChild(mt)), mt.style.color = "", mt.style.color = e;
|
|
888
|
+
let n = getComputedStyle(mt).color, r = ft(n);
|
|
889
|
+
return ht.set(e, r), r;
|
|
890
|
+
}
|
|
891
|
+
function _t(e, t = "#ffffff", n = "#1a1a1a") {
|
|
892
|
+
let r = gt(e);
|
|
893
|
+
return r && pt(r) > .179 ? n : t;
|
|
844
894
|
}
|
|
845
895
|
//#endregion
|
|
846
896
|
//#region src/_shared/dateAxis.ts
|
|
847
|
-
var
|
|
897
|
+
var vt = /^(\d{4})-(\d{2})-(\d{2})$/, yt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, Z = 1e3, Q = 60 * Z, bt = 60 * Q, xt = 24 * bt, St = 7 * xt, Ct = 30 * xt, wt = 365 * xt, Tt = [
|
|
848
898
|
{
|
|
849
899
|
unit: "second",
|
|
850
900
|
step: 1,
|
|
851
|
-
ms: 1 *
|
|
901
|
+
ms: 1 * Z
|
|
852
902
|
},
|
|
853
903
|
{
|
|
854
904
|
unit: "second",
|
|
855
905
|
step: 5,
|
|
856
|
-
ms: 5 *
|
|
906
|
+
ms: 5 * Z
|
|
857
907
|
},
|
|
858
908
|
{
|
|
859
909
|
unit: "second",
|
|
860
910
|
step: 15,
|
|
861
|
-
ms: 15 *
|
|
911
|
+
ms: 15 * Z
|
|
862
912
|
},
|
|
863
913
|
{
|
|
864
914
|
unit: "second",
|
|
865
915
|
step: 30,
|
|
866
|
-
ms: 30 *
|
|
916
|
+
ms: 30 * Z
|
|
867
917
|
},
|
|
868
918
|
{
|
|
869
919
|
unit: "minute",
|
|
870
920
|
step: 1,
|
|
871
|
-
ms: 1 *
|
|
921
|
+
ms: 1 * Q
|
|
872
922
|
},
|
|
873
923
|
{
|
|
874
924
|
unit: "minute",
|
|
875
925
|
step: 5,
|
|
876
|
-
ms: 5 *
|
|
926
|
+
ms: 5 * Q
|
|
877
927
|
},
|
|
878
928
|
{
|
|
879
929
|
unit: "minute",
|
|
880
930
|
step: 15,
|
|
881
|
-
ms: 15 *
|
|
931
|
+
ms: 15 * Q
|
|
882
932
|
},
|
|
883
933
|
{
|
|
884
934
|
unit: "minute",
|
|
885
935
|
step: 30,
|
|
886
|
-
ms: 30 *
|
|
936
|
+
ms: 30 * Q
|
|
887
937
|
},
|
|
888
938
|
{
|
|
889
939
|
unit: "hour",
|
|
890
940
|
step: 1,
|
|
891
|
-
ms: 1 *
|
|
941
|
+
ms: 1 * bt
|
|
892
942
|
},
|
|
893
943
|
{
|
|
894
944
|
unit: "hour",
|
|
895
945
|
step: 3,
|
|
896
|
-
ms: 3 *
|
|
946
|
+
ms: 3 * bt
|
|
897
947
|
},
|
|
898
948
|
{
|
|
899
949
|
unit: "hour",
|
|
900
950
|
step: 6,
|
|
901
|
-
ms: 6 *
|
|
951
|
+
ms: 6 * bt
|
|
902
952
|
},
|
|
903
953
|
{
|
|
904
954
|
unit: "hour",
|
|
905
955
|
step: 12,
|
|
906
|
-
ms: 12 *
|
|
956
|
+
ms: 12 * bt
|
|
907
957
|
},
|
|
908
958
|
{
|
|
909
959
|
unit: "day",
|
|
910
960
|
step: 1,
|
|
911
|
-
ms: 1 *
|
|
961
|
+
ms: 1 * xt
|
|
912
962
|
},
|
|
913
963
|
{
|
|
914
964
|
unit: "day",
|
|
915
965
|
step: 2,
|
|
916
|
-
ms: 2 *
|
|
966
|
+
ms: 2 * xt
|
|
917
967
|
},
|
|
918
968
|
{
|
|
919
969
|
unit: "week",
|
|
920
970
|
step: 1,
|
|
921
|
-
ms: 1 *
|
|
971
|
+
ms: 1 * St
|
|
922
972
|
},
|
|
923
973
|
{
|
|
924
974
|
unit: "month",
|
|
925
975
|
step: 1,
|
|
926
|
-
ms: 1 *
|
|
976
|
+
ms: 1 * Ct
|
|
927
977
|
},
|
|
928
978
|
{
|
|
929
979
|
unit: "month",
|
|
930
980
|
step: 3,
|
|
931
|
-
ms: 3 *
|
|
981
|
+
ms: 3 * Ct
|
|
932
982
|
},
|
|
933
983
|
{
|
|
934
984
|
unit: "month",
|
|
935
985
|
step: 6,
|
|
936
|
-
ms: 6 *
|
|
986
|
+
ms: 6 * Ct
|
|
937
987
|
},
|
|
938
988
|
{
|
|
939
989
|
unit: "year",
|
|
940
990
|
step: 1,
|
|
941
|
-
ms: 1 *
|
|
991
|
+
ms: 1 * wt
|
|
942
992
|
},
|
|
943
993
|
{
|
|
944
994
|
unit: "year",
|
|
945
995
|
step: 2,
|
|
946
|
-
ms: 2 *
|
|
996
|
+
ms: 2 * wt
|
|
947
997
|
},
|
|
948
998
|
{
|
|
949
999
|
unit: "year",
|
|
950
1000
|
step: 5,
|
|
951
|
-
ms: 5 *
|
|
1001
|
+
ms: 5 * wt
|
|
952
1002
|
},
|
|
953
1003
|
{
|
|
954
1004
|
unit: "year",
|
|
955
1005
|
step: 10,
|
|
956
|
-
ms: 10 *
|
|
1006
|
+
ms: 10 * wt
|
|
957
1007
|
},
|
|
958
1008
|
{
|
|
959
1009
|
unit: "year",
|
|
960
1010
|
step: 25,
|
|
961
|
-
ms: 25 *
|
|
1011
|
+
ms: 25 * wt
|
|
962
1012
|
},
|
|
963
1013
|
{
|
|
964
1014
|
unit: "year",
|
|
965
1015
|
step: 50,
|
|
966
|
-
ms: 50 *
|
|
1016
|
+
ms: 50 * wt
|
|
967
1017
|
},
|
|
968
1018
|
{
|
|
969
1019
|
unit: "year",
|
|
970
1020
|
step: 100,
|
|
971
|
-
ms: 100 *
|
|
1021
|
+
ms: 100 * wt
|
|
972
1022
|
}
|
|
973
|
-
],
|
|
974
|
-
function
|
|
1023
|
+
], Et = 1e3;
|
|
1024
|
+
function Dt(e, t) {
|
|
975
1025
|
if (e instanceof Date) {
|
|
976
1026
|
let t = e.getTime();
|
|
977
1027
|
return Number.isFinite(t) ? t : null;
|
|
978
1028
|
}
|
|
979
1029
|
if (typeof e != "string") return null;
|
|
980
|
-
let n =
|
|
1030
|
+
let n = vt.exec(e);
|
|
981
1031
|
if (n) {
|
|
982
1032
|
let e = +n[1], r = n[2] - 1, i = +n[3];
|
|
983
1033
|
return t === "utc" ? Date.UTC(e, r, i) : new Date(e, r, i).getTime();
|
|
984
1034
|
}
|
|
985
|
-
let r =
|
|
1035
|
+
let r = yt.exec(e);
|
|
986
1036
|
if (r) {
|
|
987
1037
|
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];
|
|
988
1038
|
if (l) {
|
|
989
1039
|
if (l === "Z" || l === "z") return Date.UTC(e, n, i, a, o, s, c);
|
|
990
|
-
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) *
|
|
1040
|
+
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * Q;
|
|
991
1041
|
return Date.UTC(e, n, i, a, o, s, c) - d;
|
|
992
1042
|
}
|
|
993
1043
|
return t === "utc" ? Date.UTC(e, n, i, a, o, s, c) : new Date(e, n, i, a, o, s, c).getTime();
|
|
994
1044
|
}
|
|
995
1045
|
return null;
|
|
996
1046
|
}
|
|
997
|
-
function
|
|
998
|
-
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ?
|
|
1047
|
+
function Ot(e) {
|
|
1048
|
+
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? vt.test(e) || yt.test(e) : !1;
|
|
999
1049
|
}
|
|
1000
|
-
function
|
|
1050
|
+
function kt(e, t) {
|
|
1001
1051
|
if (e.length === 0) return !1;
|
|
1002
1052
|
for (let n = 0; n < e.length; n++) {
|
|
1003
1053
|
let r = e[n];
|
|
1004
|
-
if (!
|
|
1054
|
+
if (!Ot(r) || Dt(r, t) === null) return !1;
|
|
1005
1055
|
}
|
|
1006
1056
|
return !0;
|
|
1007
1057
|
}
|
|
1008
|
-
function
|
|
1058
|
+
function At(e, t) {
|
|
1009
1059
|
let n = e / Math.max(1, t);
|
|
1010
|
-
for (let e of
|
|
1011
|
-
return
|
|
1060
|
+
for (let e of Tt) if (n <= e.ms) return e;
|
|
1061
|
+
return Tt[Tt.length - 1];
|
|
1012
1062
|
}
|
|
1013
|
-
function
|
|
1063
|
+
function jt(e, t, n) {
|
|
1014
1064
|
let r = new Date(e);
|
|
1015
1065
|
if (n === "utc") switch (t) {
|
|
1016
|
-
case "second": return Math.floor(e /
|
|
1017
|
-
case "minute": return Math.floor(e /
|
|
1018
|
-
case "hour": return Math.floor(e /
|
|
1066
|
+
case "second": return Math.floor(e / Z) * Z;
|
|
1067
|
+
case "minute": return Math.floor(e / Q) * Q;
|
|
1068
|
+
case "hour": return Math.floor(e / bt) * bt;
|
|
1019
1069
|
case "day": return Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate());
|
|
1020
1070
|
case "week": {
|
|
1021
1071
|
let e = (r.getUTCDay() + 6) % 7;
|
|
@@ -1025,8 +1075,8 @@ function Tt(e, t, n) {
|
|
|
1025
1075
|
case "year": return Date.UTC(r.getUTCFullYear(), 0, 1);
|
|
1026
1076
|
}
|
|
1027
1077
|
switch (t) {
|
|
1028
|
-
case "second": return Math.floor(e /
|
|
1029
|
-
case "minute": return Math.floor(e /
|
|
1078
|
+
case "second": return Math.floor(e / Z) * Z;
|
|
1079
|
+
case "minute": return Math.floor(e / Q) * Q;
|
|
1030
1080
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
|
|
1031
1081
|
case "day": return new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime();
|
|
1032
1082
|
case "week": {
|
|
@@ -1037,11 +1087,11 @@ function Tt(e, t, n) {
|
|
|
1037
1087
|
case "year": return new Date(r.getFullYear(), 0, 1).getTime();
|
|
1038
1088
|
}
|
|
1039
1089
|
}
|
|
1040
|
-
function
|
|
1041
|
-
if (t === "second") return e + n *
|
|
1042
|
-
if (t === "minute") return e + n *
|
|
1043
|
-
if (t === "hour" && r === "utc") return e + n *
|
|
1044
|
-
if (t === "week" && r === "utc") return e + n *
|
|
1090
|
+
function Mt(e, t, n, r) {
|
|
1091
|
+
if (t === "second") return e + n * Z;
|
|
1092
|
+
if (t === "minute") return e + n * Q;
|
|
1093
|
+
if (t === "hour" && r === "utc") return e + n * bt;
|
|
1094
|
+
if (t === "week" && r === "utc") return e + n * St;
|
|
1045
1095
|
let i = new Date(e);
|
|
1046
1096
|
if (r === "utc") switch (t) {
|
|
1047
1097
|
case "day": return Date.UTC(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate() + n, i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds());
|
|
@@ -1057,21 +1107,21 @@ function Et(e, t, n, r) {
|
|
|
1057
1107
|
}
|
|
1058
1108
|
return e;
|
|
1059
1109
|
}
|
|
1060
|
-
function
|
|
1110
|
+
function Nt(e, t, n, r) {
|
|
1061
1111
|
if (!Number.isFinite(e) || !Number.isFinite(t) || e >= t || n < 1) return {
|
|
1062
1112
|
values: [],
|
|
1063
1113
|
unit: "day"
|
|
1064
1114
|
};
|
|
1065
|
-
let { unit: i, step: a } =
|
|
1066
|
-
for (; o < e && s <
|
|
1115
|
+
let { unit: i, step: a } = At(t - e, n), o = jt(e, i, r), s = 0;
|
|
1116
|
+
for (; o < e && s < Et;) o = Mt(o, i, a, r), s++;
|
|
1067
1117
|
let c = [];
|
|
1068
|
-
for (let e = 0; e <
|
|
1118
|
+
for (let e = 0; e < Et && o <= t; e++) c.push(o), o = Mt(o, i, a, r);
|
|
1069
1119
|
return {
|
|
1070
1120
|
values: c,
|
|
1071
1121
|
unit: i
|
|
1072
1122
|
};
|
|
1073
1123
|
}
|
|
1074
|
-
var
|
|
1124
|
+
var Pt = {
|
|
1075
1125
|
iso: {
|
|
1076
1126
|
year: "numeric",
|
|
1077
1127
|
month: "2-digit",
|
|
@@ -1109,7 +1159,7 @@ var Ot = {
|
|
|
1109
1159
|
hourCycle: "h23"
|
|
1110
1160
|
},
|
|
1111
1161
|
medium: { dateStyle: "medium" }
|
|
1112
|
-
},
|
|
1162
|
+
}, Ft = {
|
|
1113
1163
|
year: "year",
|
|
1114
1164
|
month: "month-year",
|
|
1115
1165
|
week: "month-day",
|
|
@@ -1121,27 +1171,27 @@ var Ot = {
|
|
|
1121
1171
|
function $(e) {
|
|
1122
1172
|
return e < 10 ? "0" + e : String(e);
|
|
1123
1173
|
}
|
|
1124
|
-
function
|
|
1174
|
+
function It(e, t) {
|
|
1125
1175
|
let n = new Date(e);
|
|
1126
1176
|
return t === "utc" ? `${n.getUTCFullYear()}-${$(n.getUTCMonth() + 1)}-${$(n.getUTCDate())}` : `${n.getFullYear()}-${$(n.getMonth() + 1)}-${$(n.getDate())}`;
|
|
1127
1177
|
}
|
|
1128
|
-
function
|
|
1178
|
+
function Lt(e, t) {
|
|
1129
1179
|
let n = new Date(e);
|
|
1130
1180
|
return t === "utc" ? `${n.getUTCFullYear()}-${$(n.getUTCMonth() + 1)}-${$(n.getUTCDate())}T${$(n.getUTCHours())}:${$(n.getUTCMinutes())}:${$(n.getUTCSeconds())}Z` : `${n.getFullYear()}-${$(n.getMonth() + 1)}-${$(n.getDate())}T${$(n.getHours())}:${$(n.getMinutes())}:${$(n.getSeconds())}`;
|
|
1131
1181
|
}
|
|
1132
|
-
function
|
|
1133
|
-
return e in
|
|
1182
|
+
function Rt(e) {
|
|
1183
|
+
return e in Pt;
|
|
1134
1184
|
}
|
|
1135
|
-
function
|
|
1185
|
+
function zt(e, t, n, r) {
|
|
1136
1186
|
if (typeof t == "function") return t(e, r);
|
|
1137
1187
|
let i = null, a;
|
|
1138
|
-
if (t === void 0) i = r ?
|
|
1188
|
+
if (t === void 0) i = r ? Ft[r] : "iso", a = Pt[i];
|
|
1139
1189
|
else if (typeof t == "string") {
|
|
1140
|
-
if (!
|
|
1141
|
-
i = t, a =
|
|
1190
|
+
if (!Rt(t)) throw Error(`Unknown date format preset: "${t}"`);
|
|
1191
|
+
i = t, a = Pt[i];
|
|
1142
1192
|
} else a = t;
|
|
1143
|
-
if (i === "iso") return
|
|
1144
|
-
if (i === "iso-datetime") return
|
|
1193
|
+
if (i === "iso") return It(e, n);
|
|
1194
|
+
if (i === "iso-datetime") return Lt(e, n);
|
|
1145
1195
|
let o = n === "utc" ? {
|
|
1146
1196
|
...a,
|
|
1147
1197
|
timeZone: "UTC"
|
|
@@ -1150,68 +1200,68 @@ function Nt(e, t, n, r) {
|
|
|
1150
1200
|
}
|
|
1151
1201
|
//#endregion
|
|
1152
1202
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
1153
|
-
var
|
|
1203
|
+
var Bt = {
|
|
1154
1204
|
class: "chart-sr-only",
|
|
1155
1205
|
"aria-live": "polite"
|
|
1156
|
-
},
|
|
1206
|
+
}, Vt = ["width", "height"], Ht = [
|
|
1157
1207
|
"x",
|
|
1158
1208
|
"y",
|
|
1159
1209
|
"text-anchor",
|
|
1160
1210
|
"font-size",
|
|
1161
1211
|
"font-weight",
|
|
1162
1212
|
"fill"
|
|
1163
|
-
],
|
|
1213
|
+
], Ut = ["x", "dy"], Wt = { key: 1 }, Gt = [
|
|
1164
1214
|
"x1",
|
|
1165
1215
|
"y1",
|
|
1166
1216
|
"x2",
|
|
1167
1217
|
"y2",
|
|
1168
1218
|
"stroke",
|
|
1169
1219
|
"stroke-dasharray"
|
|
1170
|
-
],
|
|
1220
|
+
], Kt = [
|
|
1171
1221
|
"cx",
|
|
1172
1222
|
"cy",
|
|
1173
1223
|
"fill",
|
|
1174
1224
|
"fill-opacity",
|
|
1175
1225
|
"stroke"
|
|
1176
|
-
],
|
|
1226
|
+
], qt = [
|
|
1177
1227
|
"x",
|
|
1178
1228
|
"y",
|
|
1179
1229
|
"font-size",
|
|
1180
1230
|
"fill",
|
|
1181
1231
|
"font-weight"
|
|
1182
|
-
],
|
|
1232
|
+
], Jt = [
|
|
1183
1233
|
"x1",
|
|
1184
1234
|
"y1",
|
|
1185
1235
|
"x2",
|
|
1186
1236
|
"y2"
|
|
1187
|
-
],
|
|
1237
|
+
], Yt = [
|
|
1188
1238
|
"x1",
|
|
1189
1239
|
"y1",
|
|
1190
1240
|
"x2",
|
|
1191
1241
|
"y2"
|
|
1192
|
-
],
|
|
1242
|
+
], Xt = [
|
|
1193
1243
|
"x1",
|
|
1194
1244
|
"y1",
|
|
1195
1245
|
"x2",
|
|
1196
1246
|
"y2"
|
|
1197
|
-
],
|
|
1247
|
+
], Zt = [
|
|
1198
1248
|
"x1",
|
|
1199
1249
|
"y1",
|
|
1200
1250
|
"x2",
|
|
1201
1251
|
"y2"
|
|
1202
|
-
],
|
|
1252
|
+
], Qt = [
|
|
1203
1253
|
"x",
|
|
1204
1254
|
"y",
|
|
1205
1255
|
"font-size",
|
|
1206
1256
|
"fill",
|
|
1207
1257
|
"font-weight",
|
|
1208
1258
|
"fill-opacity"
|
|
1209
|
-
],
|
|
1259
|
+
], $t = [
|
|
1210
1260
|
"transform",
|
|
1211
1261
|
"font-size",
|
|
1212
1262
|
"fill",
|
|
1213
1263
|
"font-weight"
|
|
1214
|
-
],
|
|
1264
|
+
], en = [
|
|
1215
1265
|
"x",
|
|
1216
1266
|
"y",
|
|
1217
1267
|
"text-anchor",
|
|
@@ -1219,39 +1269,39 @@ var Pt = {
|
|
|
1219
1269
|
"fill",
|
|
1220
1270
|
"font-weight",
|
|
1221
1271
|
"fill-opacity"
|
|
1222
|
-
],
|
|
1272
|
+
], tn = [
|
|
1223
1273
|
"x",
|
|
1224
1274
|
"y",
|
|
1225
1275
|
"font-size",
|
|
1226
1276
|
"fill",
|
|
1227
1277
|
"font-weight"
|
|
1228
|
-
],
|
|
1278
|
+
], nn = [
|
|
1229
1279
|
"d",
|
|
1230
1280
|
"fill",
|
|
1231
1281
|
"fill-opacity"
|
|
1232
|
-
],
|
|
1282
|
+
], rn = ["d", "stroke-width"], an = [
|
|
1233
1283
|
"d",
|
|
1234
1284
|
"stroke",
|
|
1235
1285
|
"stroke-width",
|
|
1236
1286
|
"stroke-opacity",
|
|
1237
1287
|
"stroke-dasharray"
|
|
1238
|
-
],
|
|
1288
|
+
], on = [
|
|
1239
1289
|
"cx",
|
|
1240
1290
|
"cy",
|
|
1241
1291
|
"r",
|
|
1242
1292
|
"fill",
|
|
1243
1293
|
"fill-opacity",
|
|
1244
1294
|
"stroke"
|
|
1245
|
-
],
|
|
1295
|
+
], sn = [
|
|
1246
1296
|
"d",
|
|
1247
1297
|
"fill",
|
|
1248
1298
|
"fill-opacity"
|
|
1249
|
-
],
|
|
1299
|
+
], cn = [
|
|
1250
1300
|
"d",
|
|
1251
1301
|
"stroke",
|
|
1252
1302
|
"stroke-width",
|
|
1253
1303
|
"stroke-dasharray"
|
|
1254
|
-
],
|
|
1304
|
+
], ln = [
|
|
1255
1305
|
"x1",
|
|
1256
1306
|
"y1",
|
|
1257
1307
|
"x2",
|
|
@@ -1259,7 +1309,7 @@ var Pt = {
|
|
|
1259
1309
|
"stroke",
|
|
1260
1310
|
"stroke-width",
|
|
1261
1311
|
"stroke-dasharray"
|
|
1262
|
-
],
|
|
1312
|
+
], un = [
|
|
1263
1313
|
"x1",
|
|
1264
1314
|
"y1",
|
|
1265
1315
|
"x2",
|
|
@@ -1267,53 +1317,53 @@ var Pt = {
|
|
|
1267
1317
|
"stroke",
|
|
1268
1318
|
"stroke-width",
|
|
1269
1319
|
"stroke-dasharray"
|
|
1270
|
-
],
|
|
1320
|
+
], dn = [
|
|
1271
1321
|
"x1",
|
|
1272
1322
|
"y1",
|
|
1273
1323
|
"x2",
|
|
1274
1324
|
"y2"
|
|
1275
|
-
],
|
|
1325
|
+
], fn = [
|
|
1276
1326
|
"x1",
|
|
1277
1327
|
"y1",
|
|
1278
1328
|
"x2",
|
|
1279
1329
|
"y2"
|
|
1280
|
-
],
|
|
1330
|
+
], pn = [
|
|
1281
1331
|
"x1",
|
|
1282
1332
|
"y1",
|
|
1283
1333
|
"x2",
|
|
1284
1334
|
"y2"
|
|
1285
|
-
],
|
|
1335
|
+
], mn = [
|
|
1286
1336
|
"cx",
|
|
1287
1337
|
"cy",
|
|
1288
1338
|
"fill"
|
|
1289
|
-
],
|
|
1339
|
+
], hn = [
|
|
1290
1340
|
"x",
|
|
1291
1341
|
"y",
|
|
1292
1342
|
"width",
|
|
1293
1343
|
"height"
|
|
1294
|
-
],
|
|
1344
|
+
], gn = [
|
|
1295
1345
|
"cx",
|
|
1296
1346
|
"cy",
|
|
1297
1347
|
"fill",
|
|
1298
1348
|
"fill-opacity",
|
|
1299
1349
|
"stroke"
|
|
1300
|
-
],
|
|
1350
|
+
], _n = [
|
|
1301
1351
|
"x",
|
|
1302
1352
|
"y",
|
|
1303
1353
|
"font-size",
|
|
1304
1354
|
"font-weight",
|
|
1305
1355
|
"fill"
|
|
1306
|
-
],
|
|
1356
|
+
], vn = [
|
|
1307
1357
|
"x",
|
|
1308
1358
|
"y",
|
|
1309
1359
|
"font-size",
|
|
1310
1360
|
"font-weight",
|
|
1311
1361
|
"fill",
|
|
1312
1362
|
"fill-opacity"
|
|
1313
|
-
],
|
|
1363
|
+
], yn = { class: "line-chart-tooltip" }, bn = {
|
|
1314
1364
|
key: 0,
|
|
1315
1365
|
class: "line-chart-tooltip-label"
|
|
1316
|
-
},
|
|
1366
|
+
}, xn = ["href", "download"], Sn = 36, Cn = 12, wn = 7, Tn = 16, En = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
1317
1367
|
__name: "LineChart",
|
|
1318
1368
|
props: {
|
|
1319
1369
|
y: {},
|
|
@@ -1366,17 +1416,17 @@ var Pt = {
|
|
|
1366
1416
|
if (e.x && e.x.length > 0 && (yield e.x), e.series) for (let t of e.series) t.x && t.x.length > 0 && (yield t.x);
|
|
1367
1417
|
if (e.areas) for (let t of e.areas) t.x && t.x.length > 0 && (yield t.x);
|
|
1368
1418
|
}
|
|
1369
|
-
function
|
|
1419
|
+
function S(e, t, n) {
|
|
1370
1420
|
if (!e) return;
|
|
1371
1421
|
if (!t) return e;
|
|
1372
1422
|
let r = new Float64Array(e.length);
|
|
1373
|
-
for (let t = 0; t < e.length; t++) r[t] =
|
|
1423
|
+
for (let t = 0; t < e.length; t++) r[t] = Dt(e[t], n) ?? NaN;
|
|
1374
1424
|
return r;
|
|
1375
1425
|
}
|
|
1376
|
-
let
|
|
1377
|
-
let e =
|
|
1426
|
+
let w = dt(() => l.tooltipValueFormat, () => l.yTickFormat), T = n(() => l.timezone ?? "utc"), E = n(() => {
|
|
1427
|
+
let e = T.value, t = !1, n = !1;
|
|
1378
1428
|
for (let r of v(l)) {
|
|
1379
|
-
if (n = !0, !
|
|
1429
|
+
if (n = !0, !kt(r, e)) {
|
|
1380
1430
|
t = !1;
|
|
1381
1431
|
break;
|
|
1382
1432
|
}
|
|
@@ -1386,44 +1436,44 @@ var Pt = {
|
|
|
1386
1436
|
let r = l.series && l.series.length > 0 ? l.series.map((n) => ({
|
|
1387
1437
|
...n,
|
|
1388
1438
|
data: n.y ?? n.data ?? g,
|
|
1389
|
-
x:
|
|
1439
|
+
x: S(n.x, t, e)
|
|
1390
1440
|
})) : (() => {
|
|
1391
1441
|
let n = l.y ?? l.data;
|
|
1392
1442
|
return n ? [{
|
|
1393
1443
|
data: n,
|
|
1394
|
-
x:
|
|
1444
|
+
x: S(l.x, t, e)
|
|
1395
1445
|
}] : [];
|
|
1396
1446
|
})(), i = (l.areas ?? []).map((n) => ({
|
|
1397
1447
|
...n,
|
|
1398
|
-
x:
|
|
1448
|
+
x: S(n.x, t, e)
|
|
1399
1449
|
}));
|
|
1400
1450
|
return {
|
|
1401
1451
|
isDate: t,
|
|
1402
1452
|
series: r,
|
|
1403
1453
|
areas: i
|
|
1404
1454
|
};
|
|
1405
|
-
}),
|
|
1455
|
+
}), D = n(() => E.value.isDate), O = n(() => E.value.series), k = n(() => E.value.areas), ne = n(() => {
|
|
1406
1456
|
let e = 0;
|
|
1407
|
-
for (let t of
|
|
1408
|
-
for (let t of
|
|
1457
|
+
for (let t of O.value) t.data.length > e && (e = t.data.length);
|
|
1458
|
+
for (let t of k.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
|
|
1409
1459
|
return e;
|
|
1410
|
-
}),
|
|
1411
|
-
function
|
|
1460
|
+
}), A = n(() => O.value.some((e) => e.x != null) || k.value.some((e) => e.x != null));
|
|
1461
|
+
function j(e, t) {
|
|
1412
1462
|
return e.x ? Number(e.x[t]) : t;
|
|
1413
1463
|
}
|
|
1414
|
-
function
|
|
1464
|
+
function re(e, t) {
|
|
1415
1465
|
return e.x ? Number(e.x[t]) : t;
|
|
1416
1466
|
}
|
|
1417
|
-
let
|
|
1467
|
+
let M = n(() => A.value ? 0 : l.xMin ?? 0), ie = n(() => {
|
|
1418
1468
|
let e = Infinity, t = -Infinity;
|
|
1419
|
-
for (let n of
|
|
1420
|
-
let i =
|
|
1469
|
+
for (let n of O.value) for (let r = 0; r < n.data.length; r++) {
|
|
1470
|
+
let i = j(n, r);
|
|
1421
1471
|
isFinite(i) && (i < e && (e = i), i > t && (t = i));
|
|
1422
1472
|
}
|
|
1423
|
-
for (let n of
|
|
1473
|
+
for (let n of k.value) {
|
|
1424
1474
|
let r = Math.max(n.upper.length, n.lower.length);
|
|
1425
1475
|
for (let i = 0; i < r; i++) {
|
|
1426
|
-
let r =
|
|
1476
|
+
let r = re(n, i);
|
|
1427
1477
|
isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
1428
1478
|
}
|
|
1429
1479
|
}
|
|
@@ -1435,16 +1485,16 @@ var Pt = {
|
|
|
1435
1485
|
max: 0
|
|
1436
1486
|
};
|
|
1437
1487
|
});
|
|
1438
|
-
function
|
|
1439
|
-
let { min: t, max: n } =
|
|
1440
|
-
return
|
|
1488
|
+
function N(e) {
|
|
1489
|
+
let { min: t, max: n } = ie.value, r = n - t || 1;
|
|
1490
|
+
return U.value.left + (e - t) / r * G.value;
|
|
1441
1491
|
}
|
|
1442
|
-
let
|
|
1492
|
+
let ae = n(() => {
|
|
1443
1493
|
let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
|
|
1444
1494
|
isFinite(r) && (r < e && (e = r), r > t && (t = r), r > 0 && r < n && (n = r));
|
|
1445
1495
|
};
|
|
1446
|
-
for (let e of
|
|
1447
|
-
for (let e of
|
|
1496
|
+
for (let e of O.value) for (let t of e.data) r(t);
|
|
1497
|
+
for (let e of k.value) {
|
|
1448
1498
|
for (let t of e.upper) r(t);
|
|
1449
1499
|
for (let t of e.lower) r(t);
|
|
1450
1500
|
}
|
|
@@ -1461,79 +1511,79 @@ var Pt = {
|
|
|
1461
1511
|
range: i.max - i.min || 1
|
|
1462
1512
|
};
|
|
1463
1513
|
});
|
|
1464
|
-
function
|
|
1465
|
-
let { min: t, max: n } =
|
|
1466
|
-
return
|
|
1514
|
+
function P(e) {
|
|
1515
|
+
let { min: t, max: n } = ae.value;
|
|
1516
|
+
return U.value.top + K.value - ye(e, t, n, l.yScaleType) * K.value;
|
|
1467
1517
|
}
|
|
1468
|
-
function
|
|
1518
|
+
function oe(e) {
|
|
1469
1519
|
let t = e.data;
|
|
1470
1520
|
if (t.length === 0) return "";
|
|
1471
1521
|
let n = "", r = !1;
|
|
1472
1522
|
for (let i = 0; i < t.length; i++) {
|
|
1473
|
-
let a =
|
|
1523
|
+
let a = j(e, i);
|
|
1474
1524
|
if (!isFinite(t[i]) || !isFinite(a)) {
|
|
1475
1525
|
r = !1;
|
|
1476
1526
|
continue;
|
|
1477
1527
|
}
|
|
1478
|
-
let o =
|
|
1528
|
+
let o = N(a), s = P(t[i]);
|
|
1479
1529
|
n += r ? `L${o},${s}` : `M${o},${s}`, r = !0;
|
|
1480
1530
|
}
|
|
1481
1531
|
return n;
|
|
1482
1532
|
}
|
|
1483
|
-
function
|
|
1533
|
+
function se(e) {
|
|
1484
1534
|
let t = e.data, n = [];
|
|
1485
1535
|
for (let r = 0; r < t.length; r++) {
|
|
1486
|
-
let i =
|
|
1536
|
+
let i = j(e, r);
|
|
1487
1537
|
!isFinite(t[r]) || !isFinite(i) || n.push({
|
|
1488
|
-
x:
|
|
1489
|
-
y:
|
|
1538
|
+
x: N(i),
|
|
1539
|
+
y: P(t[r])
|
|
1490
1540
|
});
|
|
1491
1541
|
}
|
|
1492
1542
|
return n;
|
|
1493
1543
|
}
|
|
1494
|
-
function
|
|
1544
|
+
function ce(e) {
|
|
1495
1545
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
1496
1546
|
if (t === 0) return "";
|
|
1497
1547
|
let n = [], r = [];
|
|
1498
|
-
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(
|
|
1548
|
+
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(re(e, i)) ? r.push(i) : r.length && (n.push(r), r = []);
|
|
1499
1549
|
r.length && n.push(r);
|
|
1500
1550
|
let i = "";
|
|
1501
1551
|
for (let t of n) {
|
|
1502
|
-
i += `M${
|
|
1503
|
-
for (let n = 1; n < t.length; n++) i += `L${
|
|
1504
|
-
for (let n = t.length - 1; n >= 0; n--) i += `L${
|
|
1552
|
+
i += `M${N(re(e, t[0]))},${P(e.upper[t[0]])}`;
|
|
1553
|
+
for (let n = 1; n < t.length; n++) i += `L${N(re(e, t[n]))},${P(e.upper[t[n]])}`;
|
|
1554
|
+
for (let n = t.length - 1; n >= 0; n--) i += `L${N(re(e, t[n]))},${P(e.lower[t[n]])}`;
|
|
1505
1555
|
i += "Z";
|
|
1506
1556
|
}
|
|
1507
1557
|
return i;
|
|
1508
1558
|
}
|
|
1509
|
-
function
|
|
1510
|
-
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null &&
|
|
1511
|
-
return
|
|
1559
|
+
function F(e, t) {
|
|
1560
|
+
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && O.value[e.seriesIndex] || O.value[0];
|
|
1561
|
+
return N(r ? j(r, n) : n);
|
|
1512
1562
|
}
|
|
1513
|
-
function
|
|
1514
|
-
let n =
|
|
1563
|
+
function le(e, t = !0) {
|
|
1564
|
+
let n = U.value.top + K.value;
|
|
1515
1565
|
if (e.seriesIndex == null) {
|
|
1516
|
-
let t =
|
|
1517
|
-
return t > r ? "" : `M${t},${
|
|
1566
|
+
let t = F(e, "start"), r = F(e, "end");
|
|
1567
|
+
return t > r ? "" : `M${t},${U.value.top}L${r},${U.value.top}L${r},${n}L${t},${n}Z`;
|
|
1518
1568
|
}
|
|
1519
|
-
let r =
|
|
1569
|
+
let r = O.value[e.seriesIndex];
|
|
1520
1570
|
if (!r) return "";
|
|
1521
1571
|
let i = Math.max(0, e.startIndex), a = Math.min(r.data.length - 1, e.endIndex);
|
|
1522
1572
|
if (i > a) return "";
|
|
1523
|
-
let o = `M${
|
|
1524
|
-
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${
|
|
1525
|
-
return t && (o += `L${
|
|
1573
|
+
let o = `M${N(j(r, i))},${P(r.data[i])}`;
|
|
1574
|
+
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${N(j(r, e))},${P(r.data[e])}`);
|
|
1575
|
+
return t && (o += `L${N(j(r, a))},${n}`, o += `L${N(j(r, i))},${n}`, o += "Z"), o;
|
|
1526
1576
|
}
|
|
1527
|
-
let
|
|
1577
|
+
let ue = n(() => {
|
|
1528
1578
|
let e = l.areaSections;
|
|
1529
1579
|
if (!e?.length) return {
|
|
1530
1580
|
labels: [],
|
|
1531
1581
|
extraHeight: 0
|
|
1532
1582
|
};
|
|
1533
|
-
let t = [], n =
|
|
1583
|
+
let t = [], n = U.value.left + G.value;
|
|
1534
1584
|
for (let r of e) {
|
|
1535
1585
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
1536
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) *
|
|
1586
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * wn, o = F(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : O.value[r.seriesIndex]?.color ?? "currentColor"), u = V({
|
|
1537
1587
|
color: l,
|
|
1538
1588
|
fontWeight: 600,
|
|
1539
1589
|
...r.inlineLabelStyle
|
|
@@ -1557,7 +1607,7 @@ var Pt = {
|
|
|
1557
1607
|
let r = [];
|
|
1558
1608
|
for (let e of t) {
|
|
1559
1609
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
1560
|
-
for (; n < r.length && !(t >= r[n] +
|
|
1610
|
+
for (; n < r.length && !(t >= r[n] + Tn);) n++;
|
|
1561
1611
|
e.row = n;
|
|
1562
1612
|
let i = e.cx + e.textWidth / 2;
|
|
1563
1613
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -1567,11 +1617,11 @@ var Pt = {
|
|
|
1567
1617
|
extraHeight: 0
|
|
1568
1618
|
} : {
|
|
1569
1619
|
labels: t,
|
|
1570
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
1620
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Sn + Cn
|
|
1571
1621
|
};
|
|
1572
|
-
}),
|
|
1622
|
+
}), I = n(() => {
|
|
1573
1623
|
let e = [];
|
|
1574
|
-
for (let t of
|
|
1624
|
+
for (let t of O.value) !t.legend || t.showInLegend === !1 || e.push({
|
|
1575
1625
|
label: t.legend,
|
|
1576
1626
|
color: t.color ?? "currentColor",
|
|
1577
1627
|
type: "series",
|
|
@@ -1580,7 +1630,7 @@ var Pt = {
|
|
|
1580
1630
|
let t = l.areaSections;
|
|
1581
1631
|
if (t) for (let n of t) {
|
|
1582
1632
|
if (n.legend !== "inline" || !n.label && !n.description) continue;
|
|
1583
|
-
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" :
|
|
1633
|
+
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : O.value[n.seriesIndex]?.color ?? "currentColor");
|
|
1584
1634
|
e.push({
|
|
1585
1635
|
label: t,
|
|
1586
1636
|
color: r,
|
|
@@ -1589,11 +1639,11 @@ var Pt = {
|
|
|
1589
1639
|
});
|
|
1590
1640
|
}
|
|
1591
1641
|
return e;
|
|
1592
|
-
}),
|
|
1593
|
-
let { min: e, max: t } =
|
|
1642
|
+
}), de = n(() => I.value.map((e) => e.label)), fe = n(() => Me.value + ue.value.extraHeight), L = n(() => U.value.top + K.value + U.value.bottom + Cn), me = n(() => {
|
|
1643
|
+
let { min: e, max: t } = ae.value, n = (e) => l.yTickFormat === void 0 ? _e(e) : te(e, l.yTickFormat);
|
|
1594
1644
|
return e === t ? [{
|
|
1595
1645
|
value: n(e),
|
|
1596
|
-
y: R(
|
|
1646
|
+
y: R(U.value.top + K.value / 2)
|
|
1597
1647
|
}] : (l.yScaleType === "log" ? z({
|
|
1598
1648
|
min: e,
|
|
1599
1649
|
max: t,
|
|
@@ -1602,30 +1652,30 @@ var Pt = {
|
|
|
1602
1652
|
min: e,
|
|
1603
1653
|
max: t,
|
|
1604
1654
|
ticks: l.yTicks,
|
|
1605
|
-
targetTickCount:
|
|
1655
|
+
targetTickCount: K.value / 50
|
|
1606
1656
|
})).map((e) => ({
|
|
1607
1657
|
value: n(e),
|
|
1608
|
-
y: R(
|
|
1658
|
+
y: R(P(e))
|
|
1609
1659
|
}));
|
|
1610
1660
|
});
|
|
1611
1661
|
function he(e, t, n) {
|
|
1612
1662
|
let r = l.xTickFormat;
|
|
1613
|
-
if (
|
|
1614
|
-
let i = e +
|
|
1615
|
-
return r === void 0 ? !
|
|
1663
|
+
if (D.value) return typeof r == "function" ? r(e, t) : zt(e, r, T.value, n);
|
|
1664
|
+
let i = e + M.value;
|
|
1665
|
+
return r === void 0 ? !A.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : _e(i) : typeof r == "function" ? r(i, t) : te(i, r);
|
|
1616
1666
|
}
|
|
1617
1667
|
let ge = n(() => {
|
|
1618
|
-
let { min: e, max: t } =
|
|
1668
|
+
let { min: e, max: t } = ie.value;
|
|
1619
1669
|
if (e === t) return [];
|
|
1620
|
-
let n =
|
|
1670
|
+
let n = D.value, r = n ? 0 : M.value, i = ne.value, a = G.value / 80, o, s;
|
|
1621
1671
|
if (n) {
|
|
1622
|
-
let n =
|
|
1672
|
+
let n = Nt(e, t, a, T.value);
|
|
1623
1673
|
s = n.unit, o = ve({
|
|
1624
1674
|
min: e,
|
|
1625
1675
|
max: t,
|
|
1626
1676
|
ticks: n.values
|
|
1627
1677
|
});
|
|
1628
|
-
} else if (l.xTicks == null && !
|
|
1678
|
+
} else if (l.xTicks == null && !A.value && l.xLabels && l.xLabels.length === i) {
|
|
1629
1679
|
let e = Math.max(3, Math.floor(a)), t = Math.max(1, Math.round((i - 1) / e));
|
|
1630
1680
|
o = [];
|
|
1631
1681
|
for (let e = 0; e < i; e += t) o.push(e);
|
|
@@ -1636,9 +1686,9 @@ var Pt = {
|
|
|
1636
1686
|
targetTickCount: a,
|
|
1637
1687
|
displayOffset: r
|
|
1638
1688
|
});
|
|
1639
|
-
let c =
|
|
1689
|
+
let c = U.value.left, u = U.value.left + G.value;
|
|
1640
1690
|
return o.map((e, t) => {
|
|
1641
|
-
let n = R(
|
|
1691
|
+
let n = R(N(e)), r = "middle";
|
|
1642
1692
|
return n - c <= 1 ? r = "start" : u - n <= 1 && (r = "end"), {
|
|
1643
1693
|
value: he(e, t, s),
|
|
1644
1694
|
x: n,
|
|
@@ -1647,18 +1697,18 @@ var Pt = {
|
|
|
1647
1697
|
});
|
|
1648
1698
|
});
|
|
1649
1699
|
function xe() {
|
|
1650
|
-
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv :
|
|
1700
|
+
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : He(O.value);
|
|
1651
1701
|
}
|
|
1652
1702
|
let B = n(() => !!l.tooltipData || !!l.tooltipTrigger), Ce = n(() => {
|
|
1653
|
-
let e =
|
|
1654
|
-
return e === null || !t ? null :
|
|
1655
|
-
}), we = n(() => Ce.value === null ? 0 :
|
|
1703
|
+
let e = Fe.value, t = O.value[0];
|
|
1704
|
+
return e === null || !t ? null : j(t, e);
|
|
1705
|
+
}), we = n(() => Ce.value === null ? 0 : N(Ce.value));
|
|
1656
1706
|
function Te(e, t) {
|
|
1657
1707
|
let n = e.data.length;
|
|
1658
1708
|
if (n === 0) return null;
|
|
1659
1709
|
let r = 0, i = Infinity;
|
|
1660
1710
|
for (let a = 0; a < n; a++) {
|
|
1661
|
-
let n =
|
|
1711
|
+
let n = j(e, a);
|
|
1662
1712
|
if (!isFinite(n)) continue;
|
|
1663
1713
|
let o = Math.abs(n - t);
|
|
1664
1714
|
o < i && (i = o, r = a);
|
|
@@ -1669,22 +1719,22 @@ var Pt = {
|
|
|
1669
1719
|
let e = Ce.value;
|
|
1670
1720
|
if (e === null) return [];
|
|
1671
1721
|
let t = [];
|
|
1672
|
-
for (let n of
|
|
1722
|
+
for (let n of O.value) {
|
|
1673
1723
|
if (n.showInTooltip === !1) continue;
|
|
1674
1724
|
let r = Te(n, e);
|
|
1675
1725
|
if (r === null) continue;
|
|
1676
1726
|
let i = n.data[r];
|
|
1677
1727
|
isFinite(i) && t.push({
|
|
1678
|
-
x:
|
|
1679
|
-
y:
|
|
1728
|
+
x: N(j(n, r)),
|
|
1729
|
+
y: P(i),
|
|
1680
1730
|
color: n.color ?? "currentColor"
|
|
1681
1731
|
});
|
|
1682
1732
|
}
|
|
1683
1733
|
return t;
|
|
1684
1734
|
}), De = n(() => {
|
|
1685
|
-
let e =
|
|
1735
|
+
let e = Fe.value, t = Ce.value;
|
|
1686
1736
|
if (e === null || t === null) return null;
|
|
1687
|
-
let n = he(t, e), r =
|
|
1737
|
+
let n = he(t, e), r = O.value, i = [];
|
|
1688
1738
|
for (let e = 0; e < r.length; e++) {
|
|
1689
1739
|
let n = r[e];
|
|
1690
1740
|
if (n.showInTooltip === !1) continue;
|
|
@@ -1704,19 +1754,19 @@ var Pt = {
|
|
|
1704
1754
|
});
|
|
1705
1755
|
function Oe(e, t) {
|
|
1706
1756
|
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1707
|
-
x:
|
|
1708
|
-
y:
|
|
1757
|
+
x: N(e - M.value),
|
|
1758
|
+
y: P(t)
|
|
1709
1759
|
};
|
|
1710
1760
|
}
|
|
1711
|
-
function
|
|
1712
|
-
let t =
|
|
1761
|
+
function ke(e) {
|
|
1762
|
+
let t = Ae.value?.getBoundingClientRect();
|
|
1713
1763
|
if (!t) return null;
|
|
1714
|
-
let n =
|
|
1764
|
+
let n = O.value[0];
|
|
1715
1765
|
if (!n || n.data.length === 0) return null;
|
|
1716
|
-
let { min: r, max: i } =
|
|
1717
|
-
return Te(n, r + (e - t.left -
|
|
1766
|
+
let { min: r, max: i } = ie.value, a = i - r || 1;
|
|
1767
|
+
return Te(n, r + (e - t.left - U.value.left) / G.value * a);
|
|
1718
1768
|
}
|
|
1719
|
-
let { containerRef:
|
|
1769
|
+
let { containerRef: Ae, svgRef: H, width: je, height: Me, padding: U, legendY: W, inlineLegendLayout: Ne, innerW: G, innerH: K, bounds: Pe, hoverIndex: Fe, tooltipRef: Ie, tooltipPos: Le, tooltipHandlers: Re, menuItems: ze, downloadLinkText: Be, csvHref: Ve, downloadButtonText: Ue, triggerCsvDownload: q, menuFilename: J, isFullscreen: We } = ut({
|
|
1720
1770
|
width: () => l.width,
|
|
1721
1771
|
height: () => l.height,
|
|
1722
1772
|
title: () => l.title,
|
|
@@ -1731,17 +1781,17 @@ var Pt = {
|
|
|
1731
1781
|
downloadLink: () => l.downloadLink,
|
|
1732
1782
|
downloadButton: () => l.downloadButton,
|
|
1733
1783
|
chartPadding: () => l.chartPadding,
|
|
1734
|
-
inlineLegendLabels: () =>
|
|
1784
|
+
inlineLegendLabels: () => de.value,
|
|
1735
1785
|
hasTooltipSlot: () => B.value,
|
|
1736
1786
|
getCsv: xe,
|
|
1737
|
-
pointerToIndex:
|
|
1787
|
+
pointerToIndex: ke,
|
|
1738
1788
|
onHover: (e) => h("hover", e),
|
|
1739
|
-
extraBelowHeight: () =>
|
|
1740
|
-
}),
|
|
1789
|
+
extraBelowHeight: () => ue.value.extraHeight
|
|
1790
|
+
}), Ge = n(() => V(l.axisLabelStyle, { fontSize: 13 })), Y = n(() => V(l.tickLabelStyle, {
|
|
1741
1791
|
fontSize: 10,
|
|
1742
1792
|
fillOpacity: Se
|
|
1743
|
-
})),
|
|
1744
|
-
let e = l.titleStyle, t = e?.align ?? "left", n =
|
|
1793
|
+
})), Ke = n(() => V(l.legendStyle, { fontSize: 11 })), X = n(() => {
|
|
1794
|
+
let e = l.titleStyle, t = e?.align ?? "left", n = Pe.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
1745
1795
|
return {
|
|
1746
1796
|
lines: (l.title ?? "").split("\n"),
|
|
1747
1797
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -1751,9 +1801,9 @@ var Pt = {
|
|
|
1751
1801
|
x: r,
|
|
1752
1802
|
anchor: i
|
|
1753
1803
|
};
|
|
1754
|
-
}),
|
|
1755
|
-
let e =
|
|
1756
|
-
return
|
|
1804
|
+
}), qe = n(() => {
|
|
1805
|
+
let e = Ne.value.positions, t = U.value.left, n = W.value;
|
|
1806
|
+
return I.value.map((r, i) => {
|
|
1757
1807
|
let a = e[i];
|
|
1758
1808
|
return {
|
|
1759
1809
|
...r,
|
|
@@ -1764,34 +1814,34 @@ var Pt = {
|
|
|
1764
1814
|
});
|
|
1765
1815
|
return (n, c) => (_(), a("div", {
|
|
1766
1816
|
ref_key: "containerRef",
|
|
1767
|
-
ref:
|
|
1768
|
-
class: f(["line-chart-wrapper", { "is-fullscreen":
|
|
1817
|
+
ref: Ae,
|
|
1818
|
+
class: f(["line-chart-wrapper", { "is-fullscreen": C(We) }])
|
|
1769
1819
|
}, [
|
|
1770
1820
|
t.menu ? (_(), r(pe, {
|
|
1771
1821
|
key: 0,
|
|
1772
|
-
items:
|
|
1822
|
+
items: C(ze)
|
|
1773
1823
|
}, null, 8, ["items"])) : i("", !0),
|
|
1774
|
-
o("div",
|
|
1824
|
+
o("div", Bt, x(C(We) ? "Chart expanded to fill window" : ""), 1),
|
|
1775
1825
|
(_(), a("svg", {
|
|
1776
1826
|
ref_key: "svgRef",
|
|
1777
|
-
ref:
|
|
1778
|
-
width:
|
|
1827
|
+
ref: H,
|
|
1828
|
+
width: C(je),
|
|
1779
1829
|
height: fe.value
|
|
1780
1830
|
}, [
|
|
1781
1831
|
t.title ? (_(), a("text", {
|
|
1782
1832
|
key: 0,
|
|
1783
|
-
x:
|
|
1784
|
-
y:
|
|
1785
|
-
"text-anchor":
|
|
1786
|
-
"font-size":
|
|
1787
|
-
"font-weight":
|
|
1788
|
-
fill:
|
|
1789
|
-
}, [(_(!0), a(e, null, y(
|
|
1833
|
+
x: X.value.x,
|
|
1834
|
+
y: X.value.lineHeight,
|
|
1835
|
+
"text-anchor": X.value.anchor,
|
|
1836
|
+
"font-size": X.value.fontSize,
|
|
1837
|
+
"font-weight": X.value.fontWeight,
|
|
1838
|
+
fill: X.value.color
|
|
1839
|
+
}, [(_(!0), a(e, null, y(X.value.lines, (e, t) => (_(), a("tspan", {
|
|
1790
1840
|
key: t,
|
|
1791
|
-
x:
|
|
1792
|
-
dy: t === 0 ? 0 :
|
|
1793
|
-
},
|
|
1794
|
-
|
|
1841
|
+
x: X.value.x,
|
|
1842
|
+
dy: t === 0 ? 0 : X.value.lineHeight
|
|
1843
|
+
}, x(e), 9, Ut))), 128))], 8, Ht)) : i("", !0),
|
|
1844
|
+
qe.value.length > 0 ? (_(), a("g", Wt, [(_(!0), a(e, null, y(qe.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
|
|
1795
1845
|
key: 0,
|
|
1796
1846
|
x1: t.x,
|
|
1797
1847
|
y1: t.y,
|
|
@@ -1800,7 +1850,7 @@ var Pt = {
|
|
|
1800
1850
|
stroke: t.color,
|
|
1801
1851
|
"stroke-width": "2",
|
|
1802
1852
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
1803
|
-
}, null, 8,
|
|
1853
|
+
}, null, 8, Gt)) : (_(), a("circle", {
|
|
1804
1854
|
key: 1,
|
|
1805
1855
|
cx: t.x + 4,
|
|
1806
1856
|
cy: t.y,
|
|
@@ -1809,118 +1859,118 @@ var Pt = {
|
|
|
1809
1859
|
"fill-opacity": t.fillOpacity,
|
|
1810
1860
|
stroke: t.color,
|
|
1811
1861
|
"stroke-width": "1.5"
|
|
1812
|
-
}, null, 8,
|
|
1862
|
+
}, null, 8, Kt)), o("text", {
|
|
1813
1863
|
x: t.x + 18,
|
|
1814
1864
|
y: t.y + 4,
|
|
1815
|
-
"font-size":
|
|
1816
|
-
fill:
|
|
1817
|
-
"font-weight":
|
|
1818
|
-
},
|
|
1865
|
+
"font-size": Ke.value.fontSize,
|
|
1866
|
+
fill: Ke.value.fill,
|
|
1867
|
+
"font-weight": Ke.value.fontWeight
|
|
1868
|
+
}, x(t.label), 9, qt)], 64))), 128))])) : i("", !0),
|
|
1819
1869
|
o("line", {
|
|
1820
|
-
x1:
|
|
1821
|
-
y1:
|
|
1822
|
-
x2:
|
|
1823
|
-
y2:
|
|
1870
|
+
x1: C(R)(C(U).left),
|
|
1871
|
+
y1: C(R)(C(U).top),
|
|
1872
|
+
x2: C(R)(C(U).left),
|
|
1873
|
+
y2: C(R)(C(U).top + C(K)),
|
|
1824
1874
|
stroke: "currentColor",
|
|
1825
1875
|
"stroke-opacity": "0.3"
|
|
1826
|
-
}, null, 8,
|
|
1876
|
+
}, null, 8, Jt),
|
|
1827
1877
|
o("line", {
|
|
1828
|
-
x1:
|
|
1829
|
-
y1:
|
|
1830
|
-
x2:
|
|
1831
|
-
y2:
|
|
1878
|
+
x1: C(R)(C(U).left),
|
|
1879
|
+
y1: C(R)(C(U).top + C(K)),
|
|
1880
|
+
x2: C(R)(C(U).left + C(G)),
|
|
1881
|
+
y2: C(R)(C(U).top + C(K)),
|
|
1832
1882
|
stroke: "currentColor",
|
|
1833
1883
|
"stroke-opacity": "0.3"
|
|
1834
|
-
}, null, 8,
|
|
1884
|
+
}, null, 8, Yt),
|
|
1835
1885
|
t.yGrid ? (_(!0), a(e, { key: 2 }, y(me.value, (e, t) => (_(), a("line", {
|
|
1836
1886
|
key: "yg" + t,
|
|
1837
|
-
x1:
|
|
1887
|
+
x1: C(U).left,
|
|
1838
1888
|
y1: e.y,
|
|
1839
|
-
x2:
|
|
1889
|
+
x2: C(U).left + C(G),
|
|
1840
1890
|
y2: e.y,
|
|
1841
1891
|
stroke: "currentColor",
|
|
1842
1892
|
"stroke-opacity": "0.1"
|
|
1843
|
-
}, null, 8,
|
|
1893
|
+
}, null, 8, Xt))), 128)) : i("", !0),
|
|
1844
1894
|
t.xGrid ? (_(!0), a(e, { key: 3 }, y(ge.value, (e, t) => (_(), a("line", {
|
|
1845
1895
|
key: "xg" + t,
|
|
1846
1896
|
x1: e.x,
|
|
1847
|
-
y1:
|
|
1897
|
+
y1: C(U).top,
|
|
1848
1898
|
x2: e.x,
|
|
1849
|
-
y2:
|
|
1899
|
+
y2: C(U).top + C(K),
|
|
1850
1900
|
stroke: "currentColor",
|
|
1851
1901
|
"stroke-opacity": "0.1"
|
|
1852
|
-
}, null, 8,
|
|
1902
|
+
}, null, 8, Zt))), 128)) : i("", !0),
|
|
1853
1903
|
(_(!0), a(e, null, y(me.value, (e, t) => (_(), a("text", {
|
|
1854
1904
|
key: "y" + t,
|
|
1855
1905
|
"data-testid": "y-tick",
|
|
1856
|
-
x:
|
|
1906
|
+
x: C(U).left - 6,
|
|
1857
1907
|
y: e.y,
|
|
1858
1908
|
"text-anchor": "end",
|
|
1859
1909
|
"dominant-baseline": "middle",
|
|
1860
|
-
"font-size":
|
|
1861
|
-
fill:
|
|
1862
|
-
"font-weight":
|
|
1863
|
-
"fill-opacity":
|
|
1864
|
-
},
|
|
1910
|
+
"font-size": Y.value.fontSize,
|
|
1911
|
+
fill: Y.value.fill,
|
|
1912
|
+
"font-weight": Y.value.fontWeight,
|
|
1913
|
+
"fill-opacity": Y.value.fillOpacity
|
|
1914
|
+
}, x(e.value), 9, Qt))), 128)),
|
|
1865
1915
|
t.yLabel ? (_(), a("text", {
|
|
1866
1916
|
key: 4,
|
|
1867
1917
|
x: 0,
|
|
1868
1918
|
y: 0,
|
|
1869
|
-
transform: `translate(14, ${
|
|
1919
|
+
transform: `translate(14, ${C(U).top + C(K) / 2}) rotate(-90)`,
|
|
1870
1920
|
"text-anchor": "middle",
|
|
1871
|
-
"font-size":
|
|
1872
|
-
fill:
|
|
1873
|
-
"font-weight":
|
|
1874
|
-
},
|
|
1921
|
+
"font-size": Ge.value.fontSize,
|
|
1922
|
+
fill: Ge.value.fill,
|
|
1923
|
+
"font-weight": Ge.value.fontWeight
|
|
1924
|
+
}, x(t.yLabel), 9, $t)) : i("", !0),
|
|
1875
1925
|
(_(!0), a(e, null, y(ge.value, (e, t) => (_(), a("text", {
|
|
1876
1926
|
key: "x" + t,
|
|
1877
1927
|
"data-testid": "x-tick",
|
|
1878
1928
|
x: e.x,
|
|
1879
|
-
y:
|
|
1929
|
+
y: C(U).top + C(K) + 16,
|
|
1880
1930
|
"text-anchor": e.anchor,
|
|
1881
|
-
"font-size":
|
|
1882
|
-
fill:
|
|
1883
|
-
"font-weight":
|
|
1884
|
-
"fill-opacity":
|
|
1885
|
-
},
|
|
1931
|
+
"font-size": Y.value.fontSize,
|
|
1932
|
+
fill: Y.value.fill,
|
|
1933
|
+
"font-weight": Y.value.fontWeight,
|
|
1934
|
+
"fill-opacity": Y.value.fillOpacity
|
|
1935
|
+
}, x(e.value), 9, en))), 128)),
|
|
1886
1936
|
t.xLabel ? (_(), a("text", {
|
|
1887
1937
|
key: 5,
|
|
1888
|
-
x:
|
|
1889
|
-
y:
|
|
1938
|
+
x: C(U).left + C(G) / 2,
|
|
1939
|
+
y: C(Me) - 4,
|
|
1890
1940
|
"text-anchor": "middle",
|
|
1891
|
-
"font-size":
|
|
1892
|
-
fill:
|
|
1893
|
-
"font-weight":
|
|
1894
|
-
},
|
|
1895
|
-
(_(!0), a(e, null, y(
|
|
1941
|
+
"font-size": Ge.value.fontSize,
|
|
1942
|
+
fill: Ge.value.fill,
|
|
1943
|
+
"font-weight": Ge.value.fontWeight
|
|
1944
|
+
}, x(t.xLabel), 9, tn)) : i("", !0),
|
|
1945
|
+
(_(!0), a(e, null, y(k.value, (e, t) => (_(), a("path", {
|
|
1896
1946
|
key: "area" + t,
|
|
1897
|
-
d:
|
|
1947
|
+
d: ce(e),
|
|
1898
1948
|
fill: e.color ?? "currentColor",
|
|
1899
1949
|
"fill-opacity": e.opacity ?? .2,
|
|
1900
1950
|
stroke: "none"
|
|
1901
|
-
}, null, 8,
|
|
1902
|
-
(_(!0), a(e, null, y(
|
|
1951
|
+
}, null, 8, nn))), 128)),
|
|
1952
|
+
(_(!0), a(e, null, y(O.value, (n, r) => (_(), a(e, { key: r }, [
|
|
1903
1953
|
n.line !== !1 && n.outline ? (_(), a("path", {
|
|
1904
1954
|
key: 0,
|
|
1905
|
-
d:
|
|
1955
|
+
d: oe(n),
|
|
1906
1956
|
fill: "none",
|
|
1907
1957
|
stroke: "var(--color-bg-0, #fff)",
|
|
1908
1958
|
"stroke-width": (n.strokeWidth ?? 1.5) + 4,
|
|
1909
1959
|
"stroke-linecap": "round",
|
|
1910
1960
|
"stroke-linejoin": "round",
|
|
1911
1961
|
"data-testid": "line-outline"
|
|
1912
|
-
}, null, 8,
|
|
1962
|
+
}, null, 8, rn)) : i("", !0),
|
|
1913
1963
|
n.line === !1 ? i("", !0) : (_(), a("path", {
|
|
1914
1964
|
key: 1,
|
|
1915
|
-
d:
|
|
1965
|
+
d: oe(n),
|
|
1916
1966
|
fill: "none",
|
|
1917
1967
|
stroke: n.color ?? "currentColor",
|
|
1918
1968
|
"stroke-width": n.strokeWidth ?? 1.5,
|
|
1919
1969
|
"stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
|
|
1920
1970
|
"stroke-dasharray": n.dashed ? "6 3" : void 0,
|
|
1921
1971
|
style: m(n.blendMode ? { mixBlendMode: n.blendMode } : void 0)
|
|
1922
|
-
}, null, 12,
|
|
1923
|
-
n.dots ? (_(!0), a(e, { key: 2 }, y(
|
|
1972
|
+
}, null, 12, an)),
|
|
1973
|
+
n.dots ? (_(!0), a(e, { key: 2 }, y(se(n), (e, r) => (_(), a("circle", {
|
|
1924
1974
|
key: r,
|
|
1925
1975
|
cx: e.x,
|
|
1926
1976
|
cy: e.y,
|
|
@@ -1929,68 +1979,68 @@ var Pt = {
|
|
|
1929
1979
|
"fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
|
|
1930
1980
|
stroke: n.dotStroke ?? "none",
|
|
1931
1981
|
style: m(n.blendMode ? { mixBlendMode: n.blendMode } : void 0)
|
|
1932
|
-
}, null, 12,
|
|
1982
|
+
}, null, 12, on))), 128)) : i("", !0)
|
|
1933
1983
|
], 64))), 128)),
|
|
1934
1984
|
(_(!0), a(e, null, y(t.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
1935
1985
|
o("path", {
|
|
1936
|
-
d:
|
|
1937
|
-
fill: t.color ?? (t.seriesIndex == null ? "#999" :
|
|
1986
|
+
d: le(t),
|
|
1987
|
+
fill: t.color ?? (t.seriesIndex == null ? "#999" : O.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
1938
1988
|
"fill-opacity": t.opacity ?? .15,
|
|
1939
1989
|
stroke: "none"
|
|
1940
|
-
}, null, 8,
|
|
1990
|
+
}, null, 8, sn),
|
|
1941
1991
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
1942
1992
|
key: 0,
|
|
1943
|
-
d:
|
|
1993
|
+
d: le(t, !1),
|
|
1944
1994
|
fill: "none",
|
|
1945
|
-
stroke: t.color ??
|
|
1995
|
+
stroke: t.color ?? O.value[t.seriesIndex]?.color ?? "currentColor",
|
|
1946
1996
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1947
1997
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1948
|
-
}, null, 8,
|
|
1998
|
+
}, null, 8, cn)),
|
|
1949
1999
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
1950
|
-
x1:
|
|
1951
|
-
y1:
|
|
1952
|
-
x2:
|
|
1953
|
-
y2:
|
|
2000
|
+
x1: C(R)(F(t, "start")),
|
|
2001
|
+
y1: C(U).top,
|
|
2002
|
+
x2: C(R)(F(t, "start")),
|
|
2003
|
+
y2: C(U).top + C(K),
|
|
1954
2004
|
stroke: t.color ?? "#999",
|
|
1955
2005
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1956
2006
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1957
|
-
}, null, 8,
|
|
1958
|
-
x1:
|
|
1959
|
-
y1:
|
|
1960
|
-
x2:
|
|
1961
|
-
y2:
|
|
2007
|
+
}, null, 8, ln), o("line", {
|
|
2008
|
+
x1: C(R)(F(t, "end")),
|
|
2009
|
+
y1: C(U).top,
|
|
2010
|
+
x2: C(R)(F(t, "end")),
|
|
2011
|
+
y2: C(U).top + C(K),
|
|
1962
2012
|
stroke: t.color ?? "#999",
|
|
1963
2013
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1964
2014
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1965
|
-
}, null, 8,
|
|
2015
|
+
}, null, 8, un)], 64)) : i("", !0),
|
|
1966
2016
|
o("line", {
|
|
1967
|
-
x1:
|
|
1968
|
-
y1:
|
|
1969
|
-
x2:
|
|
1970
|
-
y2:
|
|
2017
|
+
x1: C(R)(F(t, "start")),
|
|
2018
|
+
y1: C(U).top + C(K) - 4,
|
|
2019
|
+
x2: C(R)(F(t, "start")),
|
|
2020
|
+
y2: C(U).top + C(K) + 4,
|
|
1971
2021
|
stroke: "currentColor",
|
|
1972
2022
|
"stroke-opacity": "0.4"
|
|
1973
|
-
}, null, 8,
|
|
2023
|
+
}, null, 8, dn),
|
|
1974
2024
|
o("line", {
|
|
1975
|
-
x1:
|
|
1976
|
-
y1:
|
|
1977
|
-
x2:
|
|
1978
|
-
y2:
|
|
2025
|
+
x1: C(R)(F(t, "end")),
|
|
2026
|
+
y1: C(U).top + C(K) - 4,
|
|
2027
|
+
x2: C(R)(F(t, "end")),
|
|
2028
|
+
y2: C(U).top + C(K) + 4,
|
|
1979
2029
|
stroke: "currentColor",
|
|
1980
2030
|
"stroke-opacity": "0.4"
|
|
1981
|
-
}, null, 8,
|
|
2031
|
+
}, null, 8, fn)
|
|
1982
2032
|
], 64))), 128)),
|
|
1983
|
-
B.value &&
|
|
2033
|
+
B.value && C(Fe) !== null ? (_(), a("line", {
|
|
1984
2034
|
key: 6,
|
|
1985
|
-
x1:
|
|
1986
|
-
y1:
|
|
1987
|
-
x2:
|
|
1988
|
-
y2:
|
|
2035
|
+
x1: C(R)(we.value),
|
|
2036
|
+
y1: C(U).top,
|
|
2037
|
+
x2: C(R)(we.value),
|
|
2038
|
+
y2: C(U).top + C(K),
|
|
1989
2039
|
stroke: "currentColor",
|
|
1990
2040
|
"stroke-opacity": "0.3",
|
|
1991
2041
|
"stroke-dasharray": "4 2",
|
|
1992
2042
|
"pointer-events": "none"
|
|
1993
|
-
}, null, 8,
|
|
2043
|
+
}, null, 8, pn)) : i("", !0),
|
|
1994
2044
|
(_(!0), a(e, null, y(Ee.value, (e, t) => (_(), a("circle", {
|
|
1995
2045
|
key: "hd" + t,
|
|
1996
2046
|
cx: e.x,
|
|
@@ -2000,155 +2050,162 @@ var Pt = {
|
|
|
2000
2050
|
stroke: "var(--color-bg-0, #fff)",
|
|
2001
2051
|
"stroke-width": "2",
|
|
2002
2052
|
"pointer-events": "none"
|
|
2003
|
-
}, null, 8,
|
|
2053
|
+
}, null, 8, mn))), 128)),
|
|
2004
2054
|
B.value ? (_(), a("rect", d({
|
|
2005
2055
|
key: 7,
|
|
2006
|
-
x:
|
|
2007
|
-
y:
|
|
2008
|
-
width:
|
|
2009
|
-
height:
|
|
2056
|
+
x: C(U).left,
|
|
2057
|
+
y: C(U).top,
|
|
2058
|
+
width: C(G),
|
|
2059
|
+
height: C(K),
|
|
2010
2060
|
fill: "transparent",
|
|
2011
2061
|
style: {
|
|
2012
2062
|
cursor: "crosshair",
|
|
2013
2063
|
"touch-action": "none"
|
|
2014
2064
|
}
|
|
2015
|
-
},
|
|
2016
|
-
t.annotations && t.annotations.length > 0 ? (_(), r(
|
|
2065
|
+
}, ee(C(Re), !0)), null, 16, hn)) : i("", !0),
|
|
2066
|
+
t.annotations && t.annotations.length > 0 ? (_(), r(C(st), {
|
|
2017
2067
|
key: 8,
|
|
2018
2068
|
annotations: t.annotations,
|
|
2019
2069
|
project: Oe,
|
|
2020
|
-
bounds:
|
|
2070
|
+
bounds: C(Pe)
|
|
2021
2071
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
2022
|
-
(_(!0), a(e, null, y(
|
|
2072
|
+
(_(!0), a(e, null, y(ue.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
2023
2073
|
o("circle", {
|
|
2024
2074
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
2025
|
-
cy: L.value + e.row *
|
|
2075
|
+
cy: L.value + e.row * Sn + 4,
|
|
2026
2076
|
r: "4",
|
|
2027
2077
|
fill: e.color,
|
|
2028
2078
|
"fill-opacity": e.fillOpacity,
|
|
2029
2079
|
stroke: e.color,
|
|
2030
2080
|
"stroke-width": "1.5"
|
|
2031
|
-
}, null, 8,
|
|
2081
|
+
}, null, 8, gn),
|
|
2032
2082
|
e.labelText ? (_(), a("text", {
|
|
2033
2083
|
key: 0,
|
|
2034
2084
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2035
|
-
y: L.value + e.row *
|
|
2085
|
+
y: L.value + e.row * Sn + 8,
|
|
2036
2086
|
"font-size": e.labelStyle.fontSize,
|
|
2037
2087
|
"font-weight": e.labelStyle.fontWeight,
|
|
2038
2088
|
fill: e.labelStyle.fill
|
|
2039
|
-
},
|
|
2089
|
+
}, x(e.labelText), 9, _n)) : i("", !0),
|
|
2040
2090
|
e.descText ? (_(), a("text", {
|
|
2041
2091
|
key: 1,
|
|
2042
2092
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2043
|
-
y: L.value + e.row *
|
|
2093
|
+
y: L.value + e.row * Sn + 22,
|
|
2044
2094
|
"font-size": e.descStyle.fontSize,
|
|
2045
2095
|
"font-weight": e.descStyle.fontWeight,
|
|
2046
2096
|
fill: e.descStyle.fill,
|
|
2047
2097
|
"fill-opacity": e.descStyle.fillOpacity
|
|
2048
|
-
},
|
|
2098
|
+
}, x(e.descText), 9, vn)) : i("", !0)
|
|
2049
2099
|
]))), 128))
|
|
2050
|
-
], 8,
|
|
2051
|
-
B.value &&
|
|
2100
|
+
], 8, Vt)),
|
|
2101
|
+
B.value && C(Fe) !== null && De.value ? (_(), a("div", {
|
|
2052
2102
|
key: 1,
|
|
2053
2103
|
ref_key: "tooltipRef",
|
|
2054
|
-
ref:
|
|
2104
|
+
ref: Ie,
|
|
2055
2105
|
class: "chart-tooltip-content",
|
|
2056
2106
|
style: m({
|
|
2057
2107
|
position: "absolute",
|
|
2058
2108
|
top: "0",
|
|
2059
2109
|
left: "0",
|
|
2060
2110
|
willChange: "transform",
|
|
2061
|
-
transform:
|
|
2062
|
-
visibility:
|
|
2111
|
+
transform: C(Le) ? `translate3d(${C(Le).left}px, ${C(Le).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2112
|
+
visibility: C(Le) ? "visible" : "hidden"
|
|
2063
2113
|
})
|
|
2064
|
-
}, [
|
|
2114
|
+
}, [b(n.$slots, "tooltip", p(u(De.value)), () => [o("div", yn, [De.value.xLabel ? (_(), a("div", bn, x(De.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(De.value.values, (e) => (_(), a("div", {
|
|
2065
2115
|
key: e.seriesIndex,
|
|
2066
2116
|
class: "line-chart-tooltip-row"
|
|
2067
2117
|
}, [o("span", {
|
|
2068
2118
|
class: "line-chart-tooltip-swatch",
|
|
2069
2119
|
style: m({ background: e.color })
|
|
2070
|
-
}, null, 4), s(" " +
|
|
2071
|
-
|
|
2120
|
+
}, null, 4), s(" " + x(isFinite(e.value) ? C(w)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2121
|
+
C(Be) ? (_(), a("a", {
|
|
2072
2122
|
key: 2,
|
|
2073
2123
|
class: "line-chart-download-link",
|
|
2074
|
-
href:
|
|
2075
|
-
download: `${
|
|
2076
|
-
},
|
|
2077
|
-
|
|
2124
|
+
href: C(Ve),
|
|
2125
|
+
download: `${C(J)()}.csv`
|
|
2126
|
+
}, x(C(Be)), 9, xn)) : i("", !0),
|
|
2127
|
+
C(Ue) ? (_(), a("button", {
|
|
2078
2128
|
key: 3,
|
|
2079
2129
|
type: "button",
|
|
2080
2130
|
class: "line-chart-download-button",
|
|
2081
|
-
onClick: c[0] ||= (...e) =>
|
|
2082
|
-
},
|
|
2131
|
+
onClick: c[0] ||= (...e) => C(q) && C(q)(...e)
|
|
2132
|
+
}, x(C(Ue)), 1)) : i("", !0)
|
|
2083
2133
|
], 2));
|
|
2084
2134
|
}
|
|
2085
|
-
}), [["__scopeId", "data-v-0d24242d"]]),
|
|
2135
|
+
}), [["__scopeId", "data-v-0d24242d"]]), Dn = {
|
|
2086
2136
|
class: "chart-sr-only",
|
|
2087
2137
|
"aria-live": "polite"
|
|
2088
|
-
},
|
|
2138
|
+
}, On = ["width", "height"], kn = [
|
|
2089
2139
|
"x",
|
|
2090
2140
|
"y",
|
|
2091
2141
|
"text-anchor",
|
|
2092
2142
|
"font-size",
|
|
2093
2143
|
"font-weight",
|
|
2094
2144
|
"fill"
|
|
2095
|
-
],
|
|
2145
|
+
], An = ["x", "dy"], jn = [
|
|
2146
|
+
"data-testid",
|
|
2147
|
+
"x",
|
|
2148
|
+
"y",
|
|
2149
|
+
"text-anchor",
|
|
2150
|
+
"font-size",
|
|
2151
|
+
"fill"
|
|
2152
|
+
], Mn = { key: 1 }, Nn = [
|
|
2096
2153
|
"x",
|
|
2097
2154
|
"y",
|
|
2098
2155
|
"fill"
|
|
2099
|
-
],
|
|
2156
|
+
], Pn = [
|
|
2100
2157
|
"x1",
|
|
2101
2158
|
"y1",
|
|
2102
2159
|
"x2",
|
|
2103
2160
|
"y2",
|
|
2104
2161
|
"stroke",
|
|
2105
2162
|
"stroke-dasharray"
|
|
2106
|
-
],
|
|
2163
|
+
], Fn = [
|
|
2107
2164
|
"x",
|
|
2108
2165
|
"y",
|
|
2109
2166
|
"font-size",
|
|
2110
2167
|
"fill",
|
|
2111
2168
|
"font-weight"
|
|
2112
|
-
],
|
|
2169
|
+
], In = [
|
|
2113
2170
|
"x1",
|
|
2114
2171
|
"y1",
|
|
2115
2172
|
"x2",
|
|
2116
2173
|
"y2"
|
|
2117
|
-
],
|
|
2174
|
+
], Ln = [
|
|
2118
2175
|
"x1",
|
|
2119
2176
|
"y1",
|
|
2120
2177
|
"x2",
|
|
2121
2178
|
"y2"
|
|
2122
|
-
],
|
|
2179
|
+
], Rn = [
|
|
2123
2180
|
"x1",
|
|
2124
2181
|
"y1",
|
|
2125
2182
|
"x2",
|
|
2126
2183
|
"y2"
|
|
2127
|
-
],
|
|
2184
|
+
], zn = [
|
|
2128
2185
|
"x",
|
|
2129
2186
|
"y",
|
|
2130
2187
|
"width",
|
|
2131
2188
|
"height"
|
|
2132
|
-
],
|
|
2189
|
+
], Bn = [
|
|
2133
2190
|
"x",
|
|
2134
2191
|
"y",
|
|
2135
2192
|
"font-size",
|
|
2136
2193
|
"fill",
|
|
2137
2194
|
"font-weight",
|
|
2138
2195
|
"fill-opacity"
|
|
2139
|
-
],
|
|
2196
|
+
], Vn = [
|
|
2140
2197
|
"x",
|
|
2141
2198
|
"y",
|
|
2142
2199
|
"font-size",
|
|
2143
2200
|
"fill",
|
|
2144
2201
|
"font-weight",
|
|
2145
2202
|
"fill-opacity"
|
|
2146
|
-
],
|
|
2203
|
+
], Hn = [
|
|
2147
2204
|
"transform",
|
|
2148
2205
|
"font-size",
|
|
2149
2206
|
"fill",
|
|
2150
2207
|
"font-weight"
|
|
2151
|
-
],
|
|
2208
|
+
], Un = [
|
|
2152
2209
|
"x",
|
|
2153
2210
|
"y",
|
|
2154
2211
|
"text-anchor",
|
|
@@ -2156,20 +2213,21 @@ var Pt = {
|
|
|
2156
2213
|
"fill",
|
|
2157
2214
|
"font-weight",
|
|
2158
2215
|
"fill-opacity"
|
|
2159
|
-
],
|
|
2216
|
+
], Wn = [
|
|
2160
2217
|
"x",
|
|
2161
2218
|
"y",
|
|
2219
|
+
"text-anchor",
|
|
2162
2220
|
"font-size",
|
|
2163
2221
|
"fill",
|
|
2164
2222
|
"font-weight",
|
|
2165
2223
|
"fill-opacity"
|
|
2166
|
-
],
|
|
2224
|
+
], Gn = [
|
|
2167
2225
|
"x",
|
|
2168
2226
|
"y",
|
|
2169
2227
|
"font-size",
|
|
2170
2228
|
"fill",
|
|
2171
2229
|
"font-weight"
|
|
2172
|
-
],
|
|
2230
|
+
], Kn = [
|
|
2173
2231
|
"data-category",
|
|
2174
2232
|
"data-series",
|
|
2175
2233
|
"x",
|
|
@@ -2178,27 +2236,34 @@ var Pt = {
|
|
|
2178
2236
|
"height",
|
|
2179
2237
|
"fill",
|
|
2180
2238
|
"fill-opacity"
|
|
2181
|
-
],
|
|
2239
|
+
], qn = [
|
|
2240
|
+
"x",
|
|
2241
|
+
"y",
|
|
2242
|
+
"text-anchor",
|
|
2243
|
+
"font-size",
|
|
2244
|
+
"font-weight",
|
|
2245
|
+
"fill"
|
|
2246
|
+
], Jn = [
|
|
2182
2247
|
"d",
|
|
2183
2248
|
"stroke",
|
|
2184
2249
|
"stroke-width",
|
|
2185
2250
|
"stroke-opacity",
|
|
2186
2251
|
"stroke-dasharray"
|
|
2187
|
-
],
|
|
2252
|
+
], Yn = [
|
|
2188
2253
|
"cx",
|
|
2189
2254
|
"cy",
|
|
2190
2255
|
"r",
|
|
2191
2256
|
"fill",
|
|
2192
2257
|
"fill-opacity"
|
|
2193
|
-
],
|
|
2258
|
+
], Xn = [
|
|
2194
2259
|
"x",
|
|
2195
2260
|
"y",
|
|
2196
2261
|
"width",
|
|
2197
2262
|
"height"
|
|
2198
|
-
],
|
|
2263
|
+
], Zn = { class: "bar-chart-tooltip" }, Qn = {
|
|
2199
2264
|
key: 0,
|
|
2200
2265
|
class: "bar-chart-tooltip-label"
|
|
2201
|
-
},
|
|
2266
|
+
}, $n = ["href", "download"], er = 22, tr = 2, nr = 11, rr = .6, ir = 4, ar = 4, or = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
2202
2267
|
__name: "BarChart",
|
|
2203
2268
|
props: {
|
|
2204
2269
|
data: {},
|
|
@@ -2213,6 +2278,7 @@ var Pt = {
|
|
|
2213
2278
|
valueTicks: {},
|
|
2214
2279
|
valueTickFormat: {},
|
|
2215
2280
|
categoryFormat: {},
|
|
2281
|
+
categoryAlign: {},
|
|
2216
2282
|
dateFormat: {},
|
|
2217
2283
|
barPadding: { default: .2 },
|
|
2218
2284
|
groupGap: { default: 1 },
|
|
@@ -2220,6 +2286,13 @@ var Pt = {
|
|
|
2220
2286
|
type: Boolean,
|
|
2221
2287
|
default: !0
|
|
2222
2288
|
},
|
|
2289
|
+
valueAxis: {
|
|
2290
|
+
type: Boolean,
|
|
2291
|
+
default: !0
|
|
2292
|
+
},
|
|
2293
|
+
barLabels: { type: [Boolean, Object] },
|
|
2294
|
+
categoryHeader: {},
|
|
2295
|
+
valueHeader: {},
|
|
2223
2296
|
width: {},
|
|
2224
2297
|
height: {},
|
|
2225
2298
|
title: {},
|
|
@@ -2259,43 +2332,43 @@ var Pt = {
|
|
|
2259
2332
|
showInTooltip: e.showInTooltip
|
|
2260
2333
|
};
|
|
2261
2334
|
}
|
|
2262
|
-
let
|
|
2335
|
+
let S = n(() => {
|
|
2263
2336
|
if (l.series && l.series.length > 0) return l.series.map(v);
|
|
2264
2337
|
let e = l.y ?? l.data;
|
|
2265
2338
|
return e ? [{ data: e }] : [];
|
|
2266
|
-
}),
|
|
2339
|
+
}), w = n(() => {
|
|
2267
2340
|
let e = l.categories?.length ?? 0;
|
|
2268
|
-
for (let t of
|
|
2341
|
+
for (let t of S.value) t.data.length > e && (e = t.data.length);
|
|
2269
2342
|
return e;
|
|
2270
|
-
}),
|
|
2271
|
-
let e =
|
|
2343
|
+
}), T = n(() => {
|
|
2344
|
+
let e = w.value, t = Array(e);
|
|
2272
2345
|
for (let n = 0; n < e; n++) {
|
|
2273
2346
|
let e = l.categories?.[n];
|
|
2274
2347
|
e instanceof Date ? t[n] = e.toISOString().slice(0, 10) : t[n] = e ?? String(n);
|
|
2275
2348
|
}
|
|
2276
2349
|
return t;
|
|
2277
|
-
}),
|
|
2350
|
+
}), E = n(() => {
|
|
2278
2351
|
let e = l.categories;
|
|
2279
|
-
if (!e || e.length === 0 || !
|
|
2352
|
+
if (!e || e.length === 0 || !kt(e, "utc")) return null;
|
|
2280
2353
|
let t = Array(e.length);
|
|
2281
|
-
for (let n = 0; n < e.length; n++) t[n] =
|
|
2354
|
+
for (let n = 0; n < e.length; n++) t[n] = Dt(e[n], "utc") ?? NaN;
|
|
2282
2355
|
return t;
|
|
2283
|
-
}),
|
|
2356
|
+
}), D = n(() => l.orientation === "vertical"), O = n(() => {
|
|
2284
2357
|
let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
|
|
2285
2358
|
e > 0 && e < n && (n = e);
|
|
2286
2359
|
};
|
|
2287
2360
|
if (l.layout === "stacked") {
|
|
2288
|
-
let n =
|
|
2361
|
+
let n = w.value;
|
|
2289
2362
|
for (let i = 0; i < n; i++) {
|
|
2290
2363
|
let n = 0, a = 0;
|
|
2291
|
-
for (let e of
|
|
2364
|
+
for (let e of S.value) {
|
|
2292
2365
|
if (i >= e.data.length) continue;
|
|
2293
2366
|
let t = Number(e.data[i]);
|
|
2294
2367
|
isFinite(t) && (r(t), t >= 0 ? n += t : a += t);
|
|
2295
2368
|
}
|
|
2296
2369
|
n > t && (t = n), a < e && (e = a);
|
|
2297
2370
|
}
|
|
2298
|
-
} else for (let n of
|
|
2371
|
+
} else for (let n of S.value) for (let i of n.data) {
|
|
2299
2372
|
let n = Number(i);
|
|
2300
2373
|
isFinite(n) && (r(n), n < e && (e = n), n > t && (t = n));
|
|
2301
2374
|
}
|
|
@@ -2308,30 +2381,30 @@ var Pt = {
|
|
|
2308
2381
|
max: a.max,
|
|
2309
2382
|
range: a.max - a.min || 1
|
|
2310
2383
|
};
|
|
2311
|
-
}),
|
|
2312
|
-
let e =
|
|
2313
|
-
return e > 0 ?
|
|
2314
|
-
}),
|
|
2315
|
-
let e =
|
|
2384
|
+
}), k = n(() => D.value ? U.value : W.value), ne = n(() => D.value ? W.value : U.value), A = n(() => {
|
|
2385
|
+
let e = w.value;
|
|
2386
|
+
return e > 0 ? k.value / e : 0;
|
|
2387
|
+
}), j = n(() => A.value * (1 - l.barPadding)), re = n(() => {
|
|
2388
|
+
let e = S.value.length;
|
|
2316
2389
|
if (e === 0) return 0;
|
|
2317
|
-
if (l.layout === "stacked" || e === 1) return
|
|
2390
|
+
if (l.layout === "stacked" || e === 1) return j.value;
|
|
2318
2391
|
let t = l.groupGap * (e - 1);
|
|
2319
|
-
return Math.max(1, (
|
|
2392
|
+
return Math.max(1, (j.value - t) / e);
|
|
2320
2393
|
});
|
|
2321
|
-
function
|
|
2322
|
-
return (
|
|
2394
|
+
function M(e) {
|
|
2395
|
+
return (D.value ? H.value.left : H.value.top) + e * A.value;
|
|
2323
2396
|
}
|
|
2324
|
-
let
|
|
2325
|
-
let { min: e, max: t } =
|
|
2326
|
-
return
|
|
2397
|
+
let ie = n(() => {
|
|
2398
|
+
let { min: e, max: t } = O.value, n = l.valueMin ?? 0;
|
|
2399
|
+
return N(Math.max(e, Math.min(t, n)));
|
|
2327
2400
|
});
|
|
2328
|
-
function
|
|
2329
|
-
let { min: t, max: n } =
|
|
2330
|
-
return
|
|
2401
|
+
function N(e) {
|
|
2402
|
+
let { min: t, max: n } = O.value, r = ye(e, t, n, l.valueScaleType);
|
|
2403
|
+
return D.value ? H.value.top + W.value - r * W.value : H.value.left + r * U.value;
|
|
2331
2404
|
}
|
|
2332
|
-
function
|
|
2405
|
+
function ae(e, t, n, r, i, a, o, s, c, l) {
|
|
2333
2406
|
let u = Math.min(e, t), d = Math.abs(e - t);
|
|
2334
|
-
return
|
|
2407
|
+
return D.value ? {
|
|
2335
2408
|
x: n,
|
|
2336
2409
|
y: u,
|
|
2337
2410
|
w: r,
|
|
@@ -2355,34 +2428,34 @@ var Pt = {
|
|
|
2355
2428
|
seriesIndex: l
|
|
2356
2429
|
};
|
|
2357
2430
|
}
|
|
2358
|
-
let
|
|
2359
|
-
let e = [], t =
|
|
2431
|
+
let P = n(() => {
|
|
2432
|
+
let e = [], t = S.value, n = t.length;
|
|
2360
2433
|
if (n === 0) return e;
|
|
2361
|
-
let r =
|
|
2434
|
+
let r = w.value, i = A.value, a = j.value, o = re.value, s = (i - a) / 2, c = ie.value;
|
|
2362
2435
|
for (let i = 0; i < r; i++) {
|
|
2363
|
-
let r =
|
|
2436
|
+
let r = M(i) + s;
|
|
2364
2437
|
if (l.layout === "stacked") {
|
|
2365
2438
|
let o = 0, s = 0;
|
|
2366
2439
|
for (let c = 0; c < n; c++) {
|
|
2367
2440
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
2368
2441
|
if (!isFinite(l)) continue;
|
|
2369
2442
|
let u = l >= 0 ? o : s, d = u + l;
|
|
2370
|
-
e.push(
|
|
2443
|
+
e.push(ae(N(u), N(d), r, a, n.color ?? de(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
|
|
2371
2444
|
}
|
|
2372
2445
|
} else if (l.layout === "overlay") for (let o = 0; o < n; o++) {
|
|
2373
2446
|
let n = t[o], s = Number(n.data[i] ?? NaN);
|
|
2374
|
-
isFinite(s) && e.push(
|
|
2447
|
+
isFinite(s) && e.push(ae(c, N(s), r, a, n.color ?? de(o), n.opacity ?? 1, n.blendMode, s, i, o));
|
|
2375
2448
|
}
|
|
2376
2449
|
else for (let a = 0; a < n; a++) {
|
|
2377
2450
|
let s = t[a], u = Number(s.data[i] ?? NaN);
|
|
2378
2451
|
if (!isFinite(u)) continue;
|
|
2379
2452
|
let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
|
|
2380
|
-
e.push(
|
|
2453
|
+
e.push(ae(c, N(u), d, o, s.color ?? de(a), s.opacity ?? 1, s.blendMode, u, i, a));
|
|
2381
2454
|
}
|
|
2382
2455
|
}
|
|
2383
2456
|
return e;
|
|
2384
2457
|
});
|
|
2385
|
-
function
|
|
2458
|
+
function oe(e) {
|
|
2386
2459
|
let t = Infinity, n = -Infinity;
|
|
2387
2460
|
for (let r of e.data) {
|
|
2388
2461
|
let e = Number(r);
|
|
@@ -2393,9 +2466,9 @@ var Pt = {
|
|
|
2393
2466
|
max: n
|
|
2394
2467
|
};
|
|
2395
2468
|
}
|
|
2396
|
-
function
|
|
2397
|
-
let r = (
|
|
2398
|
-
return
|
|
2469
|
+
function se(e, t, n) {
|
|
2470
|
+
let r = (D.value ? H.value.left : H.value.top) + (e + .5) * A.value, i = n.max - n.min || 1, a = (t - n.min) / i;
|
|
2471
|
+
return D.value ? {
|
|
2399
2472
|
x: r,
|
|
2400
2473
|
y: H.value.top + W.value - a * W.value
|
|
2401
2474
|
} : {
|
|
@@ -2403,23 +2476,23 @@ var Pt = {
|
|
|
2403
2476
|
y: r
|
|
2404
2477
|
};
|
|
2405
2478
|
}
|
|
2406
|
-
let
|
|
2479
|
+
let ce = n(() => {
|
|
2407
2480
|
let e = l.summaryLines;
|
|
2408
2481
|
return !e || e.length === 0 ? [] : e.map((e, t) => ({
|
|
2409
2482
|
data: e.data ?? g,
|
|
2410
2483
|
x: e.x,
|
|
2411
|
-
color: e.color ??
|
|
2484
|
+
color: e.color ?? ue(t),
|
|
2412
2485
|
strokeWidth: e.strokeWidth ?? 2,
|
|
2413
2486
|
dashed: e.dashed ?? !1,
|
|
2414
2487
|
opacity: e.opacity ?? 1,
|
|
2415
2488
|
blendMode: e.blendMode,
|
|
2416
2489
|
dots: e.dots ?? !1,
|
|
2417
2490
|
dotRadius: e.dotRadius ?? (e.strokeWidth ?? 2) + 1,
|
|
2418
|
-
extent:
|
|
2491
|
+
extent: oe(e),
|
|
2419
2492
|
legend: e.legend,
|
|
2420
2493
|
showInLegend: e.showInLegend !== !1
|
|
2421
2494
|
}));
|
|
2422
|
-
}),
|
|
2495
|
+
}), F = n(() => A.value === 0 ? [] : ce.value.map((e) => {
|
|
2423
2496
|
let t = [], n = "", r = !1;
|
|
2424
2497
|
for (let i = 0; i < e.data.length; i++) {
|
|
2425
2498
|
let a = Number(e.data[i]), o = e.x ? Number(e.x[i]) : i;
|
|
@@ -2427,7 +2500,7 @@ var Pt = {
|
|
|
2427
2500
|
r = !1;
|
|
2428
2501
|
continue;
|
|
2429
2502
|
}
|
|
2430
|
-
let s =
|
|
2503
|
+
let s = se(o, a, e.extent);
|
|
2431
2504
|
t.push(s), n += r ? `L${s.x},${s.y}` : `M${s.x},${s.y}`, r = !0;
|
|
2432
2505
|
}
|
|
2433
2506
|
return {
|
|
@@ -2435,16 +2508,16 @@ var Pt = {
|
|
|
2435
2508
|
pathD: n,
|
|
2436
2509
|
points: t
|
|
2437
2510
|
};
|
|
2438
|
-
})),
|
|
2511
|
+
})), le = [
|
|
2439
2512
|
"var(--color-fg-1, #111)",
|
|
2440
2513
|
"var(--color-danger, #ef4444)",
|
|
2441
2514
|
"var(--color-success, #10b981)",
|
|
2442
2515
|
"var(--color-info, #6366f1)"
|
|
2443
2516
|
];
|
|
2444
|
-
function
|
|
2445
|
-
return
|
|
2517
|
+
function ue(e) {
|
|
2518
|
+
return le[e % le.length];
|
|
2446
2519
|
}
|
|
2447
|
-
let
|
|
2520
|
+
let I = [
|
|
2448
2521
|
"var(--color-primary, #3b82f6)",
|
|
2449
2522
|
"var(--color-accent, #f59e0b)",
|
|
2450
2523
|
"var(--color-success, #10b981)",
|
|
@@ -2452,16 +2525,16 @@ var Pt = {
|
|
|
2452
2525
|
"var(--color-info, #6366f1)",
|
|
2453
2526
|
"var(--color-warning, #d97706)"
|
|
2454
2527
|
];
|
|
2455
|
-
function
|
|
2456
|
-
return
|
|
2528
|
+
function de(e) {
|
|
2529
|
+
return I[e % I.length];
|
|
2457
2530
|
}
|
|
2458
|
-
let fe =
|
|
2459
|
-
let { min: e, max: t } =
|
|
2531
|
+
let fe = dt(() => l.tooltipValueFormat, () => l.valueTickFormat), L = n(() => {
|
|
2532
|
+
let { min: e, max: t } = O.value, n = (e) => l.valueTickFormat === void 0 ? _e(e) : te(e, l.valueTickFormat);
|
|
2460
2533
|
if (e === t) return [{
|
|
2461
2534
|
value: n(e),
|
|
2462
|
-
pos: R(
|
|
2535
|
+
pos: R(N(e))
|
|
2463
2536
|
}];
|
|
2464
|
-
let r =
|
|
2537
|
+
let r = D.value ? 50 : 80;
|
|
2465
2538
|
return (l.valueScaleType === "log" ? z({
|
|
2466
2539
|
min: e,
|
|
2467
2540
|
max: t,
|
|
@@ -2470,18 +2543,18 @@ var Pt = {
|
|
|
2470
2543
|
min: e,
|
|
2471
2544
|
max: t,
|
|
2472
2545
|
ticks: l.valueTicks,
|
|
2473
|
-
targetTickCount:
|
|
2546
|
+
targetTickCount: ne.value / r
|
|
2474
2547
|
})).map((e) => ({
|
|
2475
2548
|
value: n(e),
|
|
2476
|
-
pos: R(
|
|
2549
|
+
pos: R(N(e))
|
|
2477
2550
|
}));
|
|
2478
2551
|
}), me = n(() => {
|
|
2479
|
-
let e =
|
|
2552
|
+
let e = w.value, t = E.value;
|
|
2480
2553
|
if (t && t.length > 0) {
|
|
2481
2554
|
let e = Infinity, n = -Infinity;
|
|
2482
2555
|
for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
|
|
2483
2556
|
if (!Number.isFinite(e) || e === n) return [];
|
|
2484
|
-
let r =
|
|
2557
|
+
let r = D.value ? U.value : W.value, i = Math.max(2, Math.floor(r / 80)), a = Nt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
|
|
2485
2558
|
for (let e of a.values) {
|
|
2486
2559
|
let n = -1, r = Infinity;
|
|
2487
2560
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -2490,7 +2563,7 @@ var Pt = {
|
|
|
2490
2563
|
}
|
|
2491
2564
|
if (n < 0 || c.has(n)) continue;
|
|
2492
2565
|
c.add(n);
|
|
2493
|
-
let i =
|
|
2566
|
+
let i = M(n) + A.value / 2, a = l.categoryFormat ? l.categoryFormat(T.value[n], n) : zt(t[n], l.dateFormat, "utc", o);
|
|
2494
2567
|
s.push({
|
|
2495
2568
|
label: a,
|
|
2496
2569
|
pos: i,
|
|
@@ -2500,10 +2573,10 @@ var Pt = {
|
|
|
2500
2573
|
return s;
|
|
2501
2574
|
}
|
|
2502
2575
|
let n = [], r = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e, i = Array(e), a = 0;
|
|
2503
|
-
for (let t = 0; t < e; t++) i[t] = r(
|
|
2504
|
-
let o = l.tickLabelStyle?.fontSize ?? 10, s =
|
|
2576
|
+
for (let t = 0; t < e; t++) i[t] = r(T.value[t], t), i[t].length > a && (a = i[t].length);
|
|
2577
|
+
let o = l.tickLabelStyle?.fontSize ?? 10, s = D.value ? a * o * .6 + 8 : o * 1.2 + 8, c = A.value > 0 ? Math.max(1, Math.ceil(s / A.value)) : 1;
|
|
2505
2578
|
for (let t = 0; t < e; t += c) {
|
|
2506
|
-
let e =
|
|
2579
|
+
let e = M(t) + A.value / 2;
|
|
2507
2580
|
n.push({
|
|
2508
2581
|
label: i[t],
|
|
2509
2582
|
pos: e,
|
|
@@ -2513,13 +2586,13 @@ var Pt = {
|
|
|
2513
2586
|
return n;
|
|
2514
2587
|
}), he = n(() => {
|
|
2515
2588
|
let e = [];
|
|
2516
|
-
return
|
|
2589
|
+
return S.value.forEach((t, n) => {
|
|
2517
2590
|
!t.legend || t.showInLegend === !1 || e.push({
|
|
2518
2591
|
label: t.legend,
|
|
2519
|
-
color: t.color ??
|
|
2592
|
+
color: t.color ?? de(n),
|
|
2520
2593
|
kind: "bar"
|
|
2521
2594
|
});
|
|
2522
|
-
}),
|
|
2595
|
+
}), ce.value.forEach((t) => {
|
|
2523
2596
|
!t.legend || !t.showInLegend || e.push({
|
|
2524
2597
|
label: t.legend,
|
|
2525
2598
|
color: t.color,
|
|
@@ -2531,17 +2604,17 @@ var Pt = {
|
|
|
2531
2604
|
function xe() {
|
|
2532
2605
|
if (typeof l.csv == "function") return l.csv();
|
|
2533
2606
|
if (typeof l.csv == "string") return l.csv;
|
|
2534
|
-
let e =
|
|
2607
|
+
let e = S.value.map((e) => ({
|
|
2535
2608
|
label: e.legend,
|
|
2536
2609
|
data: e.data
|
|
2537
2610
|
}));
|
|
2538
|
-
return
|
|
2611
|
+
return Ue(T.value, e);
|
|
2539
2612
|
}
|
|
2540
2613
|
let B = n(() => !!l.tooltipData || !!l.tooltipTrigger);
|
|
2541
2614
|
function Ce(e, t) {
|
|
2542
|
-
if (!isFinite(e) || !isFinite(t) ||
|
|
2543
|
-
let n = (
|
|
2544
|
-
return
|
|
2615
|
+
if (!isFinite(e) || !isFinite(t) || A.value === 0) return null;
|
|
2616
|
+
let n = (D.value ? H.value.left : H.value.top) + (e + .5) * A.value, r = N(t);
|
|
2617
|
+
return D.value ? {
|
|
2545
2618
|
x: n,
|
|
2546
2619
|
y: r
|
|
2547
2620
|
} : {
|
|
@@ -2550,14 +2623,25 @@ var Pt = {
|
|
|
2550
2623
|
};
|
|
2551
2624
|
}
|
|
2552
2625
|
function we(e, t) {
|
|
2553
|
-
let n =
|
|
2626
|
+
let n = De.value?.getBoundingClientRect();
|
|
2554
2627
|
if (!n) return null;
|
|
2555
|
-
let r =
|
|
2556
|
-
if (r === 0 ||
|
|
2557
|
-
let i =
|
|
2558
|
-
return Math.max(0, Math.min(r - 1, Math.floor(i /
|
|
2559
|
-
}
|
|
2560
|
-
let
|
|
2628
|
+
let r = w.value;
|
|
2629
|
+
if (r === 0 || A.value === 0) return null;
|
|
2630
|
+
let i = D.value ? e - n.left - H.value.left : t - n.top - H.value.top;
|
|
2631
|
+
return Math.max(0, Math.min(r - 1, Math.floor(i / A.value)));
|
|
2632
|
+
}
|
|
2633
|
+
let Te = n(() => !!(l.categoryHeader || l.valueHeader)), Ee = n(() => {
|
|
2634
|
+
let e = Te.value ? er : 0, t = l.chartPadding;
|
|
2635
|
+
return e ? t == null ? { top: e } : typeof t == "number" ? {
|
|
2636
|
+
top: t + e,
|
|
2637
|
+
right: t,
|
|
2638
|
+
bottom: t,
|
|
2639
|
+
left: t
|
|
2640
|
+
} : {
|
|
2641
|
+
...t,
|
|
2642
|
+
top: (t.top ?? 0) + e
|
|
2643
|
+
} : t;
|
|
2644
|
+
}), { containerRef: De, svgRef: Oe, width: ke, height: Ae, padding: H, legendY: je, inlineLegendLayout: Me, innerW: U, innerH: W, bounds: Ne, hoverIndex: G, tooltipRef: K, tooltipPos: Pe, tooltipHandlers: Fe, menuItems: Ie, downloadLinkText: Le, csvHref: Re, downloadButtonText: ze, triggerCsvDownload: Be, menuFilename: Ve, isFullscreen: He } = ut({
|
|
2561
2645
|
width: () => l.width,
|
|
2562
2646
|
height: () => l.height,
|
|
2563
2647
|
title: () => l.title,
|
|
@@ -2571,17 +2655,17 @@ var Pt = {
|
|
|
2571
2655
|
filename: () => l.filename,
|
|
2572
2656
|
downloadLink: () => l.downloadLink,
|
|
2573
2657
|
downloadButton: () => l.downloadButton,
|
|
2574
|
-
chartPadding: () =>
|
|
2658
|
+
chartPadding: () => Ee.value,
|
|
2575
2659
|
inlineLegendLabels: () => ge.value,
|
|
2576
2660
|
hasTooltipSlot: () => B.value,
|
|
2577
2661
|
getCsv: xe,
|
|
2578
2662
|
pointerToIndex: we,
|
|
2579
2663
|
onHover: (e) => h("hover", e)
|
|
2580
|
-
}),
|
|
2664
|
+
}), q = n(() => V(l.axisLabelStyle, { fontSize: 13 })), J = n(() => V(l.tickLabelStyle, {
|
|
2581
2665
|
fontSize: 10,
|
|
2582
2666
|
fillOpacity: Se
|
|
2583
|
-
})),
|
|
2584
|
-
let e = l.titleStyle, t = e?.align ?? "left", n =
|
|
2667
|
+
})), We = n(() => V(l.legendStyle, { fontSize: 11 })), Ge = n(() => l.categoryAlign === "start" && !D.value ? tr : H.value.left), Y = n(() => {
|
|
2668
|
+
let e = l.titleStyle, t = e?.align ?? "left", n = Ne.value, r = t === "left" ? Ge.value : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
2585
2669
|
return {
|
|
2586
2670
|
lines: (l.title ?? "").split("\n"),
|
|
2587
2671
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -2591,46 +2675,46 @@ var Pt = {
|
|
|
2591
2675
|
x: r,
|
|
2592
2676
|
anchor: i
|
|
2593
2677
|
};
|
|
2594
|
-
}),
|
|
2595
|
-
let e =
|
|
2678
|
+
}), Ke = n(() => {
|
|
2679
|
+
let e = G.value;
|
|
2596
2680
|
if (e === null) return;
|
|
2597
|
-
let t =
|
|
2598
|
-
return t && Number.isFinite(t[e]) ?
|
|
2599
|
-
}),
|
|
2600
|
-
let e =
|
|
2681
|
+
let t = E.value;
|
|
2682
|
+
return t && Number.isFinite(t[e]) ? zt(t[e], l.dateFormat, "utc") : T.value[e];
|
|
2683
|
+
}), X = n(() => {
|
|
2684
|
+
let e = G.value;
|
|
2601
2685
|
if (e === null) return null;
|
|
2602
|
-
let t =
|
|
2686
|
+
let t = S.value, n = [];
|
|
2603
2687
|
for (let r = 0; r < t.length; r++) {
|
|
2604
2688
|
let i = t[r];
|
|
2605
2689
|
i.showInTooltip !== !1 && n.push({
|
|
2606
2690
|
value: Number(i.data[e] ?? NaN),
|
|
2607
|
-
color: i.color ??
|
|
2691
|
+
color: i.color ?? de(r),
|
|
2608
2692
|
seriesIndex: r
|
|
2609
2693
|
});
|
|
2610
2694
|
}
|
|
2611
2695
|
return {
|
|
2612
2696
|
index: e,
|
|
2613
|
-
category:
|
|
2697
|
+
category: T.value[e] ?? String(e),
|
|
2614
2698
|
values: n,
|
|
2615
2699
|
data: l.tooltipData?.[e] ?? null
|
|
2616
2700
|
};
|
|
2617
|
-
}),
|
|
2618
|
-
let e =
|
|
2701
|
+
}), qe = n(() => {
|
|
2702
|
+
let e = G.value;
|
|
2619
2703
|
if (e === null) return null;
|
|
2620
|
-
let t =
|
|
2621
|
-
return
|
|
2704
|
+
let t = M(e);
|
|
2705
|
+
return D.value ? {
|
|
2622
2706
|
x: t,
|
|
2623
2707
|
y: H.value.top,
|
|
2624
|
-
w:
|
|
2708
|
+
w: A.value,
|
|
2625
2709
|
h: W.value
|
|
2626
2710
|
} : {
|
|
2627
2711
|
x: H.value.left,
|
|
2628
2712
|
y: t,
|
|
2629
2713
|
w: U.value,
|
|
2630
|
-
h:
|
|
2714
|
+
h: A.value
|
|
2631
2715
|
};
|
|
2632
|
-
}),
|
|
2633
|
-
let e =
|
|
2716
|
+
}), Je = n(() => {
|
|
2717
|
+
let e = Me.value.positions, t = Ge.value, n = je.value;
|
|
2634
2718
|
return he.value.map((r, i) => {
|
|
2635
2719
|
let a = e[i];
|
|
2636
2720
|
return {
|
|
@@ -2639,44 +2723,195 @@ var Pt = {
|
|
|
2639
2723
|
y: n + a.row * 20
|
|
2640
2724
|
};
|
|
2641
2725
|
});
|
|
2726
|
+
}), Ye = n(() => {
|
|
2727
|
+
let e = l.barLabels;
|
|
2728
|
+
if (!e) return null;
|
|
2729
|
+
let t = e === !0 ? {} : e;
|
|
2730
|
+
return {
|
|
2731
|
+
format: t.format,
|
|
2732
|
+
color: t.color ?? "auto",
|
|
2733
|
+
placement: t.placement ?? "auto",
|
|
2734
|
+
align: t.align ?? "center",
|
|
2735
|
+
overlap: t.overlap ?? "shift",
|
|
2736
|
+
minSize: t.minSize ?? 0,
|
|
2737
|
+
fontSize: t.fontSize ?? nr,
|
|
2738
|
+
fontWeight: t.fontWeight
|
|
2739
|
+
};
|
|
2740
|
+
});
|
|
2741
|
+
function Xe(e, t) {
|
|
2742
|
+
let n = Ye.value?.format;
|
|
2743
|
+
return typeof n == "function" ? n(e, t) : n === void 0 ? l.valueTickFormat === void 0 ? _e(e) : te(e, l.valueTickFormat) : te(e, n);
|
|
2744
|
+
}
|
|
2745
|
+
function Ze(e, t, n) {
|
|
2746
|
+
for (let r = P.value.length - 1; r >= 0; r--) {
|
|
2747
|
+
let i = P.value[r];
|
|
2748
|
+
if (i.categoryIndex === e && t >= i.x && t <= i.x + i.w && n >= i.y && n <= i.y + i.h) return i.color;
|
|
2749
|
+
}
|
|
2750
|
+
return null;
|
|
2751
|
+
}
|
|
2752
|
+
let Qe = n(() => {
|
|
2753
|
+
let e = Ye.value;
|
|
2754
|
+
if (!e) return [];
|
|
2755
|
+
let t = D.value, n = e.fontSize, r = [];
|
|
2756
|
+
for (let i of P.value) {
|
|
2757
|
+
let a = Xe(i.value, {
|
|
2758
|
+
value: i.value,
|
|
2759
|
+
categoryIndex: i.categoryIndex,
|
|
2760
|
+
seriesIndex: i.seriesIndex,
|
|
2761
|
+
category: T.value[i.categoryIndex] ?? String(i.categoryIndex)
|
|
2762
|
+
});
|
|
2763
|
+
if (!a) continue;
|
|
2764
|
+
let o = t ? i.h : i.w, s = a.length * n * rr, c = o >= s + 2 * ir && o >= e.minSize, l = e.placement === "inside" ? !0 : e.placement === "outside" ? !1 : c, u, d, f, p = "middle", m = t ? -i.y : i.x + i.w, h = t ? -(i.y + i.h) : i.x, g = t ? n : s;
|
|
2765
|
+
if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m + ir, d = u + g, p = "start";
|
|
2766
|
+
else if (e.align === "start") u = h + ir, d = u + g, p = "start";
|
|
2767
|
+
else if (e.align === "end") d = m - ir, u = d - g, p = "end";
|
|
2768
|
+
else {
|
|
2769
|
+
let e = (m + h) / 2;
|
|
2770
|
+
u = e - g / 2, d = e + g / 2, p = "middle";
|
|
2771
|
+
}
|
|
2772
|
+
r.push({
|
|
2773
|
+
bar: i,
|
|
2774
|
+
text: a,
|
|
2775
|
+
textLen: s,
|
|
2776
|
+
inside: l,
|
|
2777
|
+
cross: f,
|
|
2778
|
+
lo: u,
|
|
2779
|
+
hi: d,
|
|
2780
|
+
svgAnchor: p,
|
|
2781
|
+
hidden: !1
|
|
2782
|
+
});
|
|
2783
|
+
}
|
|
2784
|
+
let i = t ? -H.value.top : ke.value - 2, a = /* @__PURE__ */ new Map();
|
|
2785
|
+
for (let e of r) {
|
|
2786
|
+
let t = a.get(e.bar.categoryIndex);
|
|
2787
|
+
t ? t.push(e) : a.set(e.bar.categoryIndex, [e]);
|
|
2788
|
+
}
|
|
2789
|
+
for (let t of a.values()) {
|
|
2790
|
+
t.sort((e, t) => e.lo - t.lo);
|
|
2791
|
+
let n = -Infinity;
|
|
2792
|
+
for (let r of t) {
|
|
2793
|
+
if (r.lo < n + ar) {
|
|
2794
|
+
if (e.overlap === "hide") {
|
|
2795
|
+
r.hidden = !0;
|
|
2796
|
+
continue;
|
|
2797
|
+
}
|
|
2798
|
+
let t = n + ar - r.lo;
|
|
2799
|
+
r.lo += t, r.hi += t, r.inside = !1, r.svgAnchor = "start";
|
|
2800
|
+
}
|
|
2801
|
+
if (r.hi > i) {
|
|
2802
|
+
r.hidden = !0;
|
|
2803
|
+
continue;
|
|
2804
|
+
}
|
|
2805
|
+
n = r.hi;
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
let o = e.color === "auto", s = [];
|
|
2809
|
+
for (let i of r) {
|
|
2810
|
+
if (i.hidden) continue;
|
|
2811
|
+
let r, a, c;
|
|
2812
|
+
t ? (r = i.cross, a = -((i.lo + i.hi) / 2), c = "middle") : (c = i.svgAnchor, r = c === "start" ? i.lo : c === "end" ? i.hi : (i.lo + i.hi) / 2, a = i.cross);
|
|
2813
|
+
let l;
|
|
2814
|
+
if (!o) l = e.color;
|
|
2815
|
+
else if (i.inside) l = _t(i.bar.color);
|
|
2816
|
+
else {
|
|
2817
|
+
let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r = Ze(i.bar.categoryIndex, e, n);
|
|
2818
|
+
l = r ? _t(r) : "currentColor";
|
|
2819
|
+
}
|
|
2820
|
+
s.push({
|
|
2821
|
+
key: `${i.bar.categoryIndex}-${i.bar.seriesIndex}`,
|
|
2822
|
+
x: r,
|
|
2823
|
+
y: a,
|
|
2824
|
+
text: i.text,
|
|
2825
|
+
anchor: c,
|
|
2826
|
+
fill: l,
|
|
2827
|
+
fontSize: n,
|
|
2828
|
+
fontWeight: e.fontWeight
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
return s;
|
|
2832
|
+
}), $e = n(() => {
|
|
2833
|
+
let e = H.value.left - 6;
|
|
2834
|
+
switch (l.categoryAlign ?? "end") {
|
|
2835
|
+
case "start": return {
|
|
2836
|
+
anchor: "start",
|
|
2837
|
+
x: tr
|
|
2838
|
+
};
|
|
2839
|
+
case "center": return {
|
|
2840
|
+
anchor: "middle",
|
|
2841
|
+
x: (tr + e) / 2
|
|
2842
|
+
};
|
|
2843
|
+
default: return {
|
|
2844
|
+
anchor: "end",
|
|
2845
|
+
x: e
|
|
2846
|
+
};
|
|
2847
|
+
}
|
|
2848
|
+
}), et = n(() => {
|
|
2849
|
+
let e = [], t = H.value.top - 7;
|
|
2850
|
+
if (l.valueHeader && e.push({
|
|
2851
|
+
key: "vh",
|
|
2852
|
+
text: l.valueHeader,
|
|
2853
|
+
x: H.value.left,
|
|
2854
|
+
y: t,
|
|
2855
|
+
anchor: "start"
|
|
2856
|
+
}), l.categoryHeader) {
|
|
2857
|
+
let n = !D.value, r = $e.value;
|
|
2858
|
+
e.push({
|
|
2859
|
+
key: "ch",
|
|
2860
|
+
text: l.categoryHeader,
|
|
2861
|
+
x: n ? r.x : H.value.left,
|
|
2862
|
+
y: t,
|
|
2863
|
+
anchor: n ? r.anchor : "start"
|
|
2864
|
+
});
|
|
2865
|
+
}
|
|
2866
|
+
return e;
|
|
2642
2867
|
});
|
|
2643
2868
|
return (n, c) => (_(), a("div", {
|
|
2644
2869
|
ref_key: "containerRef",
|
|
2645
|
-
ref:
|
|
2646
|
-
class: f(["bar-chart-wrapper", { "is-fullscreen":
|
|
2870
|
+
ref: De,
|
|
2871
|
+
class: f(["bar-chart-wrapper", { "is-fullscreen": C(He) }])
|
|
2647
2872
|
}, [
|
|
2648
2873
|
t.menu ? (_(), r(pe, {
|
|
2649
2874
|
key: 0,
|
|
2650
|
-
items:
|
|
2875
|
+
items: C(Ie)
|
|
2651
2876
|
}, null, 8, ["items"])) : i("", !0),
|
|
2652
|
-
o("div",
|
|
2877
|
+
o("div", Dn, x(C(He) ? "Chart expanded to fill window" : ""), 1),
|
|
2653
2878
|
(_(), a("svg", {
|
|
2654
2879
|
ref_key: "svgRef",
|
|
2655
|
-
ref:
|
|
2656
|
-
width:
|
|
2657
|
-
height:
|
|
2880
|
+
ref: Oe,
|
|
2881
|
+
width: C(ke),
|
|
2882
|
+
height: C(Ae)
|
|
2658
2883
|
}, [
|
|
2659
2884
|
t.title ? (_(), a("text", {
|
|
2660
2885
|
key: 0,
|
|
2661
|
-
x:
|
|
2662
|
-
y:
|
|
2663
|
-
"text-anchor":
|
|
2664
|
-
"font-size":
|
|
2665
|
-
"font-weight":
|
|
2666
|
-
fill:
|
|
2667
|
-
}, [(_(!0), a(e, null, y(
|
|
2886
|
+
x: Y.value.x,
|
|
2887
|
+
y: Y.value.lineHeight,
|
|
2888
|
+
"text-anchor": Y.value.anchor,
|
|
2889
|
+
"font-size": Y.value.fontSize,
|
|
2890
|
+
"font-weight": Y.value.fontWeight,
|
|
2891
|
+
fill: Y.value.color
|
|
2892
|
+
}, [(_(!0), a(e, null, y(Y.value.lines, (e, t) => (_(), a("tspan", {
|
|
2668
2893
|
key: t,
|
|
2669
|
-
x:
|
|
2670
|
-
dy: t === 0 ? 0 :
|
|
2671
|
-
},
|
|
2672
|
-
|
|
2894
|
+
x: Y.value.x,
|
|
2895
|
+
dy: t === 0 ? 0 : Y.value.lineHeight
|
|
2896
|
+
}, x(e), 9, An))), 128))], 8, kn)) : i("", !0),
|
|
2897
|
+
(_(!0), a(e, null, y(et.value, (e) => (_(), a("text", {
|
|
2898
|
+
key: e.key,
|
|
2899
|
+
"data-testid": e.key === "ch" ? "category-header" : "value-header",
|
|
2900
|
+
x: e.x,
|
|
2901
|
+
y: e.y,
|
|
2902
|
+
"text-anchor": e.anchor,
|
|
2903
|
+
"font-size": q.value.fontSize,
|
|
2904
|
+
fill: q.value.fill,
|
|
2905
|
+
"font-weight": "600"
|
|
2906
|
+
}, x(e.text), 9, jn))), 128)),
|
|
2907
|
+
Je.value.length > 0 ? (_(), a("g", Mn, [(_(!0), a(e, null, y(Je.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.kind === "bar" ? (_(), a("rect", {
|
|
2673
2908
|
key: 0,
|
|
2674
2909
|
x: t.x,
|
|
2675
2910
|
y: t.y - 5,
|
|
2676
2911
|
width: "12",
|
|
2677
2912
|
height: "10",
|
|
2678
2913
|
fill: t.color
|
|
2679
|
-
}, null, 8,
|
|
2914
|
+
}, null, 8, Nn)) : (_(), a("line", {
|
|
2680
2915
|
key: 1,
|
|
2681
2916
|
x1: t.x,
|
|
2682
2917
|
y1: t.y,
|
|
@@ -2685,112 +2920,114 @@ var Pt = {
|
|
|
2685
2920
|
stroke: t.color,
|
|
2686
2921
|
"stroke-width": "2",
|
|
2687
2922
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
2688
|
-
}, null, 8,
|
|
2923
|
+
}, null, 8, Pn)), o("text", {
|
|
2689
2924
|
x: t.x + 18,
|
|
2690
2925
|
y: t.y + 4,
|
|
2691
|
-
"font-size":
|
|
2692
|
-
fill:
|
|
2693
|
-
"font-weight":
|
|
2694
|
-
},
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2926
|
+
"font-size": We.value.fontSize,
|
|
2927
|
+
fill: We.value.fill,
|
|
2928
|
+
"font-weight": We.value.fontWeight
|
|
2929
|
+
}, x(t.label), 9, Fn)], 64))), 128))])) : i("", !0),
|
|
2930
|
+
!D.value || t.valueAxis ? (_(), a("line", {
|
|
2931
|
+
key: 2,
|
|
2932
|
+
x1: C(R)(C(H).left),
|
|
2933
|
+
y1: C(R)(C(H).top),
|
|
2934
|
+
x2: C(R)(C(H).left),
|
|
2935
|
+
y2: C(R)(C(H).top + C(W)),
|
|
2700
2936
|
stroke: "currentColor",
|
|
2701
2937
|
"stroke-opacity": "0.3"
|
|
2702
|
-
}, null, 8,
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2938
|
+
}, null, 8, In)) : i("", !0),
|
|
2939
|
+
D.value || t.valueAxis ? (_(), a("line", {
|
|
2940
|
+
key: 3,
|
|
2941
|
+
x1: C(R)(C(H).left),
|
|
2942
|
+
y1: C(R)(C(H).top + C(W)),
|
|
2943
|
+
x2: C(R)(C(H).left + C(U)),
|
|
2944
|
+
y2: C(R)(C(H).top + C(W)),
|
|
2708
2945
|
stroke: "currentColor",
|
|
2709
2946
|
"stroke-opacity": "0.3"
|
|
2710
|
-
}, null, 8,
|
|
2711
|
-
t.valueGrid ? (_(!0), a(e, { key:
|
|
2947
|
+
}, null, 8, Ln)) : i("", !0),
|
|
2948
|
+
t.valueGrid && t.valueAxis ? (_(!0), a(e, { key: 4 }, y(L.value, (e, t) => (_(), a("line", {
|
|
2712
2949
|
key: "vg" + t,
|
|
2713
|
-
x1:
|
|
2714
|
-
y1:
|
|
2715
|
-
x2:
|
|
2716
|
-
y2:
|
|
2950
|
+
x1: D.value ? C(H).left : e.pos,
|
|
2951
|
+
y1: D.value ? e.pos : C(H).top,
|
|
2952
|
+
x2: D.value ? C(H).left + C(U) : e.pos,
|
|
2953
|
+
y2: D.value ? e.pos : C(H).top + C(W),
|
|
2717
2954
|
stroke: "currentColor",
|
|
2718
2955
|
"stroke-opacity": "0.1"
|
|
2719
|
-
}, null, 8,
|
|
2720
|
-
|
|
2721
|
-
key:
|
|
2722
|
-
x:
|
|
2723
|
-
y:
|
|
2724
|
-
width:
|
|
2725
|
-
height:
|
|
2956
|
+
}, null, 8, Rn))), 128)) : i("", !0),
|
|
2957
|
+
qe.value && B.value ? (_(), a("rect", {
|
|
2958
|
+
key: 5,
|
|
2959
|
+
x: qe.value.x,
|
|
2960
|
+
y: qe.value.y,
|
|
2961
|
+
width: qe.value.w,
|
|
2962
|
+
height: qe.value.h,
|
|
2726
2963
|
fill: "currentColor",
|
|
2727
2964
|
"fill-opacity": "0.06",
|
|
2728
2965
|
"pointer-events": "none"
|
|
2729
|
-
}, null, 8,
|
|
2730
|
-
|
|
2966
|
+
}, null, 8, zn)) : i("", !0),
|
|
2967
|
+
t.valueAxis && D.value ? (_(!0), a(e, { key: 6 }, y(L.value, (e, t) => (_(), a("text", {
|
|
2731
2968
|
key: "vt" + t,
|
|
2732
2969
|
"data-testid": "value-tick",
|
|
2733
|
-
x:
|
|
2970
|
+
x: C(H).left - 6,
|
|
2734
2971
|
y: e.pos,
|
|
2735
2972
|
"text-anchor": "end",
|
|
2736
2973
|
"dominant-baseline": "middle",
|
|
2737
|
-
"font-size":
|
|
2738
|
-
fill:
|
|
2739
|
-
"font-weight":
|
|
2740
|
-
"fill-opacity":
|
|
2741
|
-
},
|
|
2974
|
+
"font-size": J.value.fontSize,
|
|
2975
|
+
fill: J.value.fill,
|
|
2976
|
+
"font-weight": J.value.fontWeight,
|
|
2977
|
+
"fill-opacity": J.value.fillOpacity
|
|
2978
|
+
}, x(e.value), 9, Bn))), 128)) : t.valueAxis ? (_(!0), a(e, { key: 7 }, y(L.value, (e, t) => (_(), a("text", {
|
|
2742
2979
|
key: "vt" + t,
|
|
2743
2980
|
"data-testid": "value-tick",
|
|
2744
2981
|
x: e.pos,
|
|
2745
|
-
y:
|
|
2982
|
+
y: C(H).top + C(W) + 16,
|
|
2746
2983
|
"text-anchor": "middle",
|
|
2747
|
-
"font-size":
|
|
2748
|
-
fill:
|
|
2749
|
-
"font-weight":
|
|
2750
|
-
"fill-opacity":
|
|
2751
|
-
},
|
|
2984
|
+
"font-size": J.value.fontSize,
|
|
2985
|
+
fill: J.value.fill,
|
|
2986
|
+
"font-weight": J.value.fontWeight,
|
|
2987
|
+
"fill-opacity": J.value.fillOpacity
|
|
2988
|
+
}, x(e.value), 9, Vn))), 128)) : i("", !0),
|
|
2752
2989
|
t.yLabel ? (_(), a("text", {
|
|
2753
|
-
key:
|
|
2990
|
+
key: 8,
|
|
2754
2991
|
x: 0,
|
|
2755
2992
|
y: 0,
|
|
2756
|
-
transform: `translate(14, ${
|
|
2993
|
+
transform: `translate(14, ${C(H).top + C(W) / 2}) rotate(-90)`,
|
|
2757
2994
|
"text-anchor": "middle",
|
|
2758
|
-
"font-size":
|
|
2759
|
-
fill:
|
|
2760
|
-
"font-weight":
|
|
2761
|
-
},
|
|
2762
|
-
|
|
2995
|
+
"font-size": q.value.fontSize,
|
|
2996
|
+
fill: q.value.fill,
|
|
2997
|
+
"font-weight": q.value.fontWeight
|
|
2998
|
+
}, x(t.yLabel), 9, Hn)) : i("", !0),
|
|
2999
|
+
D.value ? (_(!0), a(e, { key: 9 }, y(me.value, (e, t) => (_(), a("text", {
|
|
2763
3000
|
key: "ct" + t,
|
|
2764
3001
|
"data-testid": "category-tick",
|
|
2765
3002
|
x: e.pos,
|
|
2766
|
-
y:
|
|
3003
|
+
y: C(H).top + C(W) + 16,
|
|
2767
3004
|
"text-anchor": e.anchor,
|
|
2768
|
-
"font-size":
|
|
2769
|
-
fill:
|
|
2770
|
-
"font-weight":
|
|
2771
|
-
"fill-opacity":
|
|
2772
|
-
},
|
|
3005
|
+
"font-size": J.value.fontSize,
|
|
3006
|
+
fill: J.value.fill,
|
|
3007
|
+
"font-weight": J.value.fontWeight,
|
|
3008
|
+
"fill-opacity": J.value.fillOpacity
|
|
3009
|
+
}, x(e.label), 9, Un))), 128)) : (_(!0), a(e, { key: 10 }, y(me.value, (e, t) => (_(), a("text", {
|
|
2773
3010
|
key: "ct" + t,
|
|
2774
3011
|
"data-testid": "category-tick",
|
|
2775
|
-
x:
|
|
3012
|
+
x: $e.value.x,
|
|
2776
3013
|
y: e.pos,
|
|
2777
|
-
"text-anchor":
|
|
3014
|
+
"text-anchor": $e.value.anchor,
|
|
2778
3015
|
"dominant-baseline": "middle",
|
|
2779
|
-
"font-size":
|
|
2780
|
-
fill:
|
|
2781
|
-
"font-weight":
|
|
2782
|
-
"fill-opacity":
|
|
2783
|
-
},
|
|
3016
|
+
"font-size": J.value.fontSize,
|
|
3017
|
+
fill: J.value.fill,
|
|
3018
|
+
"font-weight": J.value.fontWeight,
|
|
3019
|
+
"fill-opacity": J.value.fillOpacity
|
|
3020
|
+
}, x(e.label), 9, Wn))), 128)),
|
|
2784
3021
|
t.xLabel ? (_(), a("text", {
|
|
2785
|
-
key:
|
|
2786
|
-
x:
|
|
2787
|
-
y:
|
|
3022
|
+
key: 11,
|
|
3023
|
+
x: C(H).left + C(U) / 2,
|
|
3024
|
+
y: C(Ae) - 4,
|
|
2788
3025
|
"text-anchor": "middle",
|
|
2789
|
-
"font-size":
|
|
2790
|
-
fill:
|
|
2791
|
-
"font-weight":
|
|
2792
|
-
},
|
|
2793
|
-
(_(!0), a(e, null, y(
|
|
3026
|
+
"font-size": q.value.fontSize,
|
|
3027
|
+
fill: q.value.fill,
|
|
3028
|
+
"font-weight": q.value.fontWeight
|
|
3029
|
+
}, x(t.xLabel), 9, Gn)) : i("", !0),
|
|
3030
|
+
(_(!0), a(e, null, y(P.value, (e, t) => (_(), a("rect", {
|
|
2794
3031
|
key: "bar" + t,
|
|
2795
3032
|
"data-testid": "bar",
|
|
2796
3033
|
"data-category": e.categoryIndex,
|
|
@@ -2802,8 +3039,20 @@ var Pt = {
|
|
|
2802
3039
|
fill: e.color,
|
|
2803
3040
|
"fill-opacity": e.opacity,
|
|
2804
3041
|
style: m(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
2805
|
-
}, null, 12,
|
|
2806
|
-
(_(!0), a(e, null, y(
|
|
3042
|
+
}, null, 12, Kn))), 128)),
|
|
3043
|
+
(_(!0), a(e, null, y(Qe.value, (e) => (_(), a("text", {
|
|
3044
|
+
key: "blbl" + e.key,
|
|
3045
|
+
"data-testid": "bar-label",
|
|
3046
|
+
x: e.x,
|
|
3047
|
+
y: e.y,
|
|
3048
|
+
"text-anchor": e.anchor,
|
|
3049
|
+
"dominant-baseline": "middle",
|
|
3050
|
+
"font-size": e.fontSize,
|
|
3051
|
+
"font-weight": e.fontWeight,
|
|
3052
|
+
fill: e.fill,
|
|
3053
|
+
"pointer-events": "none"
|
|
3054
|
+
}, x(e.text), 9, qn))), 128)),
|
|
3055
|
+
(_(!0), a(e, null, y(F.value, (t, n) => (_(), a(e, { key: "sl" + n }, [t.pathD ? (_(), a("path", {
|
|
2807
3056
|
key: 0,
|
|
2808
3057
|
"data-testid": "summary-line",
|
|
2809
3058
|
d: t.pathD,
|
|
@@ -2815,7 +3064,7 @@ var Pt = {
|
|
|
2815
3064
|
"stroke-linecap": "round",
|
|
2816
3065
|
"stroke-linejoin": "round",
|
|
2817
3066
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2818
|
-
}, null, 12,
|
|
3067
|
+
}, null, 12, Jn)) : i("", !0), t.dots ? (_(!0), a(e, { key: 1 }, y(t.points, (e, r) => (_(), a("circle", {
|
|
2819
3068
|
key: "sld" + n + "-" + r,
|
|
2820
3069
|
cx: e.x,
|
|
2821
3070
|
cy: e.y,
|
|
@@ -2823,61 +3072,61 @@ var Pt = {
|
|
|
2823
3072
|
fill: t.color,
|
|
2824
3073
|
"fill-opacity": t.opacity,
|
|
2825
3074
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2826
|
-
}, null, 12,
|
|
3075
|
+
}, null, 12, Yn))), 128)) : i("", !0)], 64))), 128)),
|
|
2827
3076
|
B.value ? (_(), a("rect", d({
|
|
2828
|
-
key:
|
|
2829
|
-
x:
|
|
2830
|
-
y:
|
|
2831
|
-
width:
|
|
2832
|
-
height:
|
|
3077
|
+
key: 12,
|
|
3078
|
+
x: C(H).left,
|
|
3079
|
+
y: C(H).top,
|
|
3080
|
+
width: C(U),
|
|
3081
|
+
height: C(W),
|
|
2833
3082
|
fill: "transparent",
|
|
2834
3083
|
style: {
|
|
2835
3084
|
cursor: "crosshair",
|
|
2836
3085
|
"touch-action": "none"
|
|
2837
3086
|
}
|
|
2838
|
-
},
|
|
2839
|
-
t.annotations && t.annotations.length > 0 ? (_(), r(
|
|
2840
|
-
key:
|
|
3087
|
+
}, ee(C(Fe), !0)), null, 16, Xn)) : i("", !0),
|
|
3088
|
+
t.annotations && t.annotations.length > 0 ? (_(), r(C(st), {
|
|
3089
|
+
key: 13,
|
|
2841
3090
|
annotations: t.annotations,
|
|
2842
3091
|
project: Ce,
|
|
2843
|
-
bounds:
|
|
3092
|
+
bounds: C(Ne)
|
|
2844
3093
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
2845
|
-
], 8,
|
|
2846
|
-
B.value &&
|
|
3094
|
+
], 8, On)),
|
|
3095
|
+
B.value && C(G) !== null && X.value ? (_(), a("div", {
|
|
2847
3096
|
key: 1,
|
|
2848
3097
|
ref_key: "tooltipRef",
|
|
2849
|
-
ref:
|
|
3098
|
+
ref: K,
|
|
2850
3099
|
class: "chart-tooltip-content",
|
|
2851
3100
|
style: m({
|
|
2852
3101
|
position: "absolute",
|
|
2853
3102
|
top: "0",
|
|
2854
3103
|
left: "0",
|
|
2855
3104
|
willChange: "transform",
|
|
2856
|
-
transform:
|
|
2857
|
-
visibility:
|
|
3105
|
+
transform: C(Pe) ? `translate3d(${C(Pe).left}px, ${C(Pe).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
3106
|
+
visibility: C(Pe) ? "visible" : "hidden"
|
|
2858
3107
|
})
|
|
2859
|
-
}, [
|
|
3108
|
+
}, [b(n.$slots, "tooltip", p(u(X.value)), () => [o("div", Zn, [Ke.value ? (_(), a("div", Qn, x(Ke.value), 1)) : i("", !0), (_(!0), a(e, null, y(X.value.values, (e) => (_(), a("div", {
|
|
2860
3109
|
key: e.seriesIndex,
|
|
2861
3110
|
class: "bar-chart-tooltip-row"
|
|
2862
3111
|
}, [o("span", {
|
|
2863
3112
|
class: "bar-chart-tooltip-swatch",
|
|
2864
3113
|
style: m({ background: e.color })
|
|
2865
|
-
}, null, 4), s(" " +
|
|
2866
|
-
|
|
3114
|
+
}, null, 4), s(" " + x(isFinite(e.value) ? C(fe)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
3115
|
+
C(Le) ? (_(), a("a", {
|
|
2867
3116
|
key: 2,
|
|
2868
3117
|
class: "bar-chart-download-link",
|
|
2869
|
-
href:
|
|
2870
|
-
download: `${
|
|
2871
|
-
},
|
|
2872
|
-
|
|
3118
|
+
href: C(Re),
|
|
3119
|
+
download: `${C(Ve)()}.csv`
|
|
3120
|
+
}, x(C(Le)), 9, $n)) : i("", !0),
|
|
3121
|
+
C(ze) ? (_(), a("button", {
|
|
2873
3122
|
key: 3,
|
|
2874
3123
|
type: "button",
|
|
2875
3124
|
class: "bar-chart-download-button",
|
|
2876
|
-
onClick: c[0] ||= (...e) =>
|
|
2877
|
-
},
|
|
3125
|
+
onClick: c[0] ||= (...e) => C(Be) && C(Be)(...e)
|
|
3126
|
+
}, x(C(ze)), 1)) : i("", !0)
|
|
2878
3127
|
], 2));
|
|
2879
3128
|
}
|
|
2880
|
-
}), [["__scopeId", "data-v-
|
|
3129
|
+
}), [["__scopeId", "data-v-59c746d2"]]), sr = {
|
|
2881
3130
|
ref: "root",
|
|
2882
3131
|
class: "chart-tooltip-content",
|
|
2883
3132
|
style: {
|
|
@@ -2889,10 +3138,10 @@ var Pt = {
|
|
|
2889
3138
|
"pointer-events": "none",
|
|
2890
3139
|
transform: "translateY(-50%)"
|
|
2891
3140
|
}
|
|
2892
|
-
},
|
|
3141
|
+
}, cr = /* @__PURE__ */ l({
|
|
2893
3142
|
__name: "ChoroplethTooltip",
|
|
2894
3143
|
setup(e, { expose: n }) {
|
|
2895
|
-
let a = v(null), s =
|
|
3144
|
+
let a = v(null), s = T("root");
|
|
2896
3145
|
return n({
|
|
2897
3146
|
setData(e) {
|
|
2898
3147
|
a.value = e;
|
|
@@ -2900,21 +3149,21 @@ var Pt = {
|
|
|
2900
3149
|
getEl() {
|
|
2901
3150
|
return s.value;
|
|
2902
3151
|
}
|
|
2903
|
-
}), (e, n) => (_(), r(t, { to: "body" }, [o("div",
|
|
3152
|
+
}), (e, n) => (_(), r(t, { to: "body" }, [o("div", sr, [a.value ? b(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
|
|
2904
3153
|
}
|
|
2905
|
-
}),
|
|
3154
|
+
}), lr = {
|
|
2906
3155
|
class: "chart-sr-only",
|
|
2907
3156
|
"aria-live": "polite"
|
|
2908
|
-
},
|
|
3157
|
+
}, ur = {
|
|
2909
3158
|
key: 1,
|
|
2910
3159
|
class: "choropleth-header"
|
|
2911
|
-
},
|
|
3160
|
+
}, dr = {
|
|
2912
3161
|
key: 0,
|
|
2913
3162
|
class: "choropleth-legend-title"
|
|
2914
|
-
},
|
|
3163
|
+
}, fr = {
|
|
2915
3164
|
key: 2,
|
|
2916
3165
|
class: "choropleth-legend-continuous"
|
|
2917
|
-
},
|
|
3166
|
+
}, pr = { class: "choropleth-legend-ticks" }, mr = ["viewBox"], hr = ["innerHTML"], gr = "http://www.w3.org/2000/svg", _r = 450, vr = 1e3, yr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
2918
3167
|
__name: "ChoroplethMap",
|
|
2919
3168
|
props: {
|
|
2920
3169
|
topology: {},
|
|
@@ -2960,10 +3209,10 @@ var Pt = {
|
|
|
2960
3209
|
"update:focus"
|
|
2961
3210
|
],
|
|
2962
3211
|
setup(t, { emit: c }) {
|
|
2963
|
-
let l = t, d = c,
|
|
3212
|
+
let l = t, d = c, ee = (e) => e, T = v(null), O = v(null), k = v(null), ne = v(null), A = v(null), j = v(null), re = w(), M = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!re.tooltip), ie = n(() => {
|
|
2964
3213
|
let e = l.legendStyle, t = {};
|
|
2965
3214
|
return e?.fontSize != null && (t["font-size"] = `${e.fontSize}px`), e?.fontWeight != null && (t["font-weight"] = String(e.fontWeight)), e?.color != null && (t.color = e.color), t;
|
|
2966
|
-
}),
|
|
3215
|
+
}), N = n(() => {
|
|
2967
3216
|
let e = l.titleStyle, t = {
|
|
2968
3217
|
"font-size": `${e?.fontSize ?? 14}px`,
|
|
2969
3218
|
"line-height": `${e?.lineHeight ?? 18}px`,
|
|
@@ -2972,24 +3221,24 @@ var Pt = {
|
|
|
2972
3221
|
width: "100%"
|
|
2973
3222
|
};
|
|
2974
3223
|
return e?.color && (t.color = e.color), t;
|
|
2975
|
-
}),
|
|
3224
|
+
}), I = /* @__PURE__ */ new Map(), de = /* @__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 = {
|
|
2976
3225
|
width: 0,
|
|
2977
3226
|
height: 0
|
|
2978
3227
|
}, ye = null, be = !1, z = null, xe = v(!1), Se = 0, B = 0, V = 0;
|
|
2979
3228
|
function Ce() {
|
|
2980
3229
|
if (ge) return;
|
|
2981
|
-
let e =
|
|
2982
|
-
e && (e.addEventListener("click",
|
|
3230
|
+
let e = k.value;
|
|
3231
|
+
e && (e.addEventListener("click", vt), e.addEventListener("mouseover", vt), e.addEventListener("mousemove", yt), e.addEventListener("mouseout", Z));
|
|
2983
3232
|
}
|
|
2984
3233
|
function we() {
|
|
2985
|
-
let e =
|
|
2986
|
-
e && (e.removeEventListener("click",
|
|
3234
|
+
let e = k.value;
|
|
3235
|
+
e && (e.removeEventListener("click", vt), e.removeEventListener("mouseover", vt), e.removeEventListener("mousemove", yt), e.removeEventListener("mouseout", Z));
|
|
2987
3236
|
}
|
|
2988
3237
|
function Te() {
|
|
2989
|
-
|
|
3238
|
+
gt();
|
|
2990
3239
|
}
|
|
2991
3240
|
h(() => {
|
|
2992
|
-
Ee(), Ce(), bt(),
|
|
3241
|
+
Ee(), Ce(), bt(), je(), st(), window.addEventListener("scroll", Te, {
|
|
2993
3242
|
passive: !0,
|
|
2994
3243
|
capture: !0
|
|
2995
3244
|
}), window.addEventListener("resize", Te, { passive: !0 });
|
|
@@ -2997,18 +3246,18 @@ var Pt = {
|
|
|
2997
3246
|
_e?.disconnect(), V && cancelAnimationFrame(V), De(), we(), window.removeEventListener("scroll", Te, { capture: !0 }), window.removeEventListener("resize", Te);
|
|
2998
3247
|
});
|
|
2999
3248
|
function Ee() {
|
|
3000
|
-
if (!
|
|
3001
|
-
let e =
|
|
3002
|
-
z =
|
|
3003
|
-
he = !0,
|
|
3249
|
+
if (!O.value || !k.value) return;
|
|
3250
|
+
let e = ce(O.value), t = Math.max(12, l.focusZoomLevel);
|
|
3251
|
+
z = oe().scaleExtent([1, t]).on("start", () => {
|
|
3252
|
+
he = !0, gt();
|
|
3004
3253
|
}).on("zoom", (e) => {
|
|
3005
|
-
|
|
3254
|
+
k.value && k.value.setAttribute("transform", e.transform);
|
|
3006
3255
|
let t = e.transform;
|
|
3007
3256
|
xe.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
3008
3257
|
}).on("end", () => {
|
|
3009
3258
|
he = !1;
|
|
3010
3259
|
}), z.filter((e) => {
|
|
3011
|
-
let t =
|
|
3260
|
+
let t = Y.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
|
|
3012
3261
|
if (e.type === "wheel" || e.type === "dblclick") {
|
|
3013
3262
|
if (!n) return !1;
|
|
3014
3263
|
} else if (e.type === "mousedown" || e.type === "touchstart") {
|
|
@@ -3018,10 +3267,10 @@ var Pt = {
|
|
|
3018
3267
|
}), e.call(z);
|
|
3019
3268
|
}
|
|
3020
3269
|
function De() {
|
|
3021
|
-
|
|
3270
|
+
O.value && z && (ce(O.value).on(".zoom", null), z = null);
|
|
3022
3271
|
}
|
|
3023
3272
|
function Oe(e) {
|
|
3024
|
-
let t =
|
|
3273
|
+
let t = Ke.value, n = J.value, r = [];
|
|
3025
3274
|
for (let i of e) {
|
|
3026
3275
|
let e = i.geoType ?? l.geoType, a = t.get(e);
|
|
3027
3276
|
if (!a) continue;
|
|
@@ -3039,81 +3288,81 @@ var Pt = {
|
|
|
3039
3288
|
}
|
|
3040
3289
|
return r;
|
|
3041
3290
|
}
|
|
3042
|
-
function
|
|
3291
|
+
function ke(e) {
|
|
3043
3292
|
let t = /* @__PURE__ */ new Set();
|
|
3044
3293
|
for (let n of Oe(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
|
|
3045
3294
|
return t;
|
|
3046
3295
|
}
|
|
3047
|
-
let
|
|
3048
|
-
function
|
|
3049
|
-
if (!
|
|
3050
|
-
let e = Oe(
|
|
3296
|
+
let Ae = !1;
|
|
3297
|
+
function je() {
|
|
3298
|
+
if (!O.value || !z) return;
|
|
3299
|
+
let e = Oe(Y.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
|
|
3051
3300
|
for (let e of t) {
|
|
3052
|
-
let t =
|
|
3301
|
+
let t = I.get(String(e.feature.id));
|
|
3053
3302
|
t && r.set(t, e.item.style ?? "solid");
|
|
3054
3303
|
}
|
|
3055
|
-
for (let [e] of R) r.has(e) || e === L ||
|
|
3056
|
-
for (let [e, t] of r) R.get(e) === t && e !== L || e !== L &&
|
|
3304
|
+
for (let [e] of R) r.has(e) || e === L || mt(e);
|
|
3305
|
+
for (let [e, t] of r) R.get(e) === t && e !== L || e !== L && pt(e, t);
|
|
3057
3306
|
R.clear();
|
|
3058
3307
|
for (let [e, t] of r) R.set(e, t);
|
|
3059
|
-
if (
|
|
3060
|
-
|
|
3308
|
+
if (Me(n), e.length === 0) {
|
|
3309
|
+
Ae = !0, gt();
|
|
3061
3310
|
return;
|
|
3062
3311
|
}
|
|
3063
|
-
let i =
|
|
3312
|
+
let i = ce(O.value);
|
|
3064
3313
|
i.interrupt();
|
|
3065
|
-
let a =
|
|
3066
|
-
|
|
3067
|
-
let [[o, s], [c, u]] =
|
|
3314
|
+
let a = Ae;
|
|
3315
|
+
Ae = !0;
|
|
3316
|
+
let [[o, s], [c, u]] = Ue.value.bounds({
|
|
3068
3317
|
type: "FeatureCollection",
|
|
3069
3318
|
features: e.map((e) => e.feature)
|
|
3070
|
-
}), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m =
|
|
3071
|
-
if (!
|
|
3072
|
-
let e = String(h.id), t =
|
|
3319
|
+
}), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = se.translate(Ne.value / 2 - p * d, G.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, g = () => {
|
|
3320
|
+
if (!M.value || !h) return;
|
|
3321
|
+
let e = String(h.id), t = I.get(e);
|
|
3073
3322
|
if (!t) return;
|
|
3074
3323
|
let n = t.getBoundingClientRect();
|
|
3075
|
-
|
|
3324
|
+
lt(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
3076
3325
|
};
|
|
3077
|
-
a ? (
|
|
3326
|
+
a ? (dt(), i.transition().duration(_r).call(z.transform, m).on("end", g)) : (z.transform(i, m), g());
|
|
3078
3327
|
}
|
|
3079
|
-
function
|
|
3080
|
-
let t =
|
|
3328
|
+
function Me(e) {
|
|
3329
|
+
let t = A.value;
|
|
3081
3330
|
if (!t) return;
|
|
3082
3331
|
let n = new Set(e.map((e) => e.key));
|
|
3083
3332
|
for (let [e, t] of me) n.has(e) || (t.remove(), me.delete(e));
|
|
3084
|
-
let r =
|
|
3333
|
+
let r = Ue.value, i = q.value + 1.5;
|
|
3085
3334
|
for (let { item: n, feature: a, key: o } of e) {
|
|
3086
3335
|
let e = me.get(o);
|
|
3087
|
-
e || (e = document.createElementNS(
|
|
3336
|
+
e || (e = document.createElementNS(gr, "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)), ft(e, n.style);
|
|
3088
3337
|
}
|
|
3089
3338
|
}
|
|
3090
|
-
function
|
|
3091
|
-
if (!
|
|
3092
|
-
|
|
3093
|
-
let e =
|
|
3094
|
-
e.interrupt(),
|
|
3339
|
+
function U() {
|
|
3340
|
+
if (!O.value || !z) return;
|
|
3341
|
+
Y.value.length > 0 && d("update:focus", null);
|
|
3342
|
+
let e = ce(O.value);
|
|
3343
|
+
e.interrupt(), dt(), e.transition().duration(_r).call(z.transform, se);
|
|
3095
3344
|
}
|
|
3096
|
-
|
|
3097
|
-
z && z.scaleExtent([1, Math.max(12, l.focusZoomLevel)]),
|
|
3345
|
+
E(() => l.focusZoomLevel, () => {
|
|
3346
|
+
z && z.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), je();
|
|
3098
3347
|
});
|
|
3099
|
-
let
|
|
3100
|
-
function
|
|
3101
|
-
return
|
|
3348
|
+
let W = n(() => l.width && l.height ? l.height / l.width : .625), Ne = n(() => vr), G = n(() => vr * W.value), Fe = v(null), Ie = null;
|
|
3349
|
+
function Le() {
|
|
3350
|
+
return Ie ||= import("./hsaMapping-BahYDmea.js").then((e) => e.n).then((e) => (Fe.value = e, e)), Ie;
|
|
3102
3351
|
}
|
|
3103
|
-
|
|
3352
|
+
E(() => {
|
|
3104
3353
|
if (l.geoType === "hsas" || l.dataGeoType === "hsas") return !0;
|
|
3105
3354
|
let e = l.focus;
|
|
3106
3355
|
return e ? (Array.isArray(e) ? e : [e]).some((e) => typeof e != "string" && e.geoType === "hsas") : !1;
|
|
3107
3356
|
}, (e) => {
|
|
3108
|
-
e &&
|
|
3357
|
+
e && Le();
|
|
3109
3358
|
}, { immediate: !0 });
|
|
3110
|
-
let
|
|
3111
|
-
let e =
|
|
3359
|
+
let Re = n(() => {
|
|
3360
|
+
let e = Fe.value;
|
|
3112
3361
|
if (!e) return {
|
|
3113
3362
|
type: "FeatureCollection",
|
|
3114
3363
|
features: []
|
|
3115
3364
|
};
|
|
3116
|
-
let { fipsToHsa: t, hsaNames: n } = e, r =
|
|
3365
|
+
let { fipsToHsa: t, hsaNames: n } = e, r = S(l.topology), i = r.objects.counties.geometries, a = /* @__PURE__ */ new Map();
|
|
3117
3366
|
for (let e of i) {
|
|
3118
3367
|
let n = t[String(e.id).padStart(5, "0")];
|
|
3119
3368
|
n && (a.has(n) || a.set(n, []), a.get(n).push(e));
|
|
@@ -3123,50 +3372,50 @@ var Pt = {
|
|
|
3123
3372
|
type: "Feature",
|
|
3124
3373
|
id: e,
|
|
3125
3374
|
properties: { name: n[e] ?? e },
|
|
3126
|
-
geometry:
|
|
3375
|
+
geometry: le(r, t)
|
|
3127
3376
|
});
|
|
3128
3377
|
return {
|
|
3129
3378
|
type: "FeatureCollection",
|
|
3130
3379
|
features: o
|
|
3131
3380
|
};
|
|
3132
|
-
}),
|
|
3133
|
-
if (l.geoType === "hsas") return
|
|
3381
|
+
}), ze = n(() => {
|
|
3382
|
+
if (l.geoType === "hsas") return Re.value;
|
|
3134
3383
|
if (l.geoType === "counties") {
|
|
3135
|
-
let e =
|
|
3136
|
-
return
|
|
3384
|
+
let e = S(l.topology);
|
|
3385
|
+
return F(e, e.objects.counties);
|
|
3137
3386
|
}
|
|
3138
|
-
let e =
|
|
3139
|
-
return
|
|
3140
|
-
}),
|
|
3387
|
+
let e = S(l.topology);
|
|
3388
|
+
return F(e, e.objects.states);
|
|
3389
|
+
}), Ve = n(() => {
|
|
3141
3390
|
if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
|
|
3142
|
-
let e =
|
|
3143
|
-
return
|
|
3144
|
-
}),
|
|
3391
|
+
let e = S(l.topology);
|
|
3392
|
+
return ue(e, e.objects.states, (e, t) => e !== t);
|
|
3393
|
+
}), He = n(() => ae().fitExtent([[0, 0], [Ne.value, G.value]], ze.value)), Ue = n(() => P(He.value)), q = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), J = n(() => {
|
|
3145
3394
|
let e = /* @__PURE__ */ new Map();
|
|
3146
|
-
for (let [t, n] of
|
|
3395
|
+
for (let [t, n] of Ke.value) {
|
|
3147
3396
|
let r = /* @__PURE__ */ new Map();
|
|
3148
3397
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
3149
3398
|
e.set(t, r);
|
|
3150
3399
|
}
|
|
3151
3400
|
return e;
|
|
3152
3401
|
});
|
|
3153
|
-
function
|
|
3402
|
+
function We(e) {
|
|
3154
3403
|
let t = l.dataGeoType;
|
|
3155
3404
|
if (!t || t === l.geoType) return e;
|
|
3156
|
-
if (l.geoType === "counties" && t === "hsas") return
|
|
3405
|
+
if (l.geoType === "counties" && t === "hsas") return Fe.value?.fipsToHsa[e];
|
|
3157
3406
|
if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
3158
3407
|
}
|
|
3159
|
-
let
|
|
3408
|
+
let Ge = n(() => {
|
|
3160
3409
|
let e = /* @__PURE__ */ new Map();
|
|
3161
|
-
for (let t of
|
|
3410
|
+
for (let t of ze.value.features) t.id != null && e.set(String(t.id), t);
|
|
3162
3411
|
return e;
|
|
3163
|
-
}),
|
|
3412
|
+
}), Y = n(() => {
|
|
3164
3413
|
let e = l.focus;
|
|
3165
3414
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
3166
|
-
}),
|
|
3415
|
+
}), Ke = n(() => {
|
|
3167
3416
|
let e = /* @__PURE__ */ new Map();
|
|
3168
|
-
e.set(l.geoType,
|
|
3169
|
-
let t =
|
|
3417
|
+
e.set(l.geoType, Ge.value);
|
|
3418
|
+
let t = S(l.topology), n = t?.objects;
|
|
3170
3419
|
if (!n) return e;
|
|
3171
3420
|
let r = (e) => {
|
|
3172
3421
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3174,25 +3423,25 @@ var Pt = {
|
|
|
3174
3423
|
return t;
|
|
3175
3424
|
};
|
|
3176
3425
|
if (!e.has("states") && n.states) {
|
|
3177
|
-
let i =
|
|
3426
|
+
let i = F(t, n.states);
|
|
3178
3427
|
e.set("states", r(i.features));
|
|
3179
3428
|
}
|
|
3180
3429
|
if (!e.has("counties") && n.counties) {
|
|
3181
|
-
let i =
|
|
3430
|
+
let i = F(t, n.counties);
|
|
3182
3431
|
e.set("counties", r(i.features));
|
|
3183
3432
|
}
|
|
3184
|
-
return !e.has("hsas") && n.counties && e.set("hsas", r(
|
|
3185
|
-
}),
|
|
3433
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(Re.value.features)), e;
|
|
3434
|
+
}), X = n(() => {
|
|
3186
3435
|
let e = /* @__PURE__ */ new Map();
|
|
3187
3436
|
if (!l.data) return e;
|
|
3188
|
-
let t = l.dataGeoType ?? l.geoType, n =
|
|
3437
|
+
let t = l.dataGeoType ?? l.geoType, n = J.value.get(t);
|
|
3189
3438
|
for (let t of l.data) {
|
|
3190
3439
|
e.set(t.id, t.value);
|
|
3191
3440
|
let r = n?.get(t.id);
|
|
3192
3441
|
r && e.set(r, t.value);
|
|
3193
3442
|
}
|
|
3194
3443
|
return e;
|
|
3195
|
-
}),
|
|
3444
|
+
}), qe = n(() => {
|
|
3196
3445
|
if (!l.data || l.data.length === 0) return {
|
|
3197
3446
|
min: 0,
|
|
3198
3447
|
max: 1
|
|
@@ -3209,8 +3458,8 @@ var Pt = {
|
|
|
3209
3458
|
min: 0,
|
|
3210
3459
|
max: 1
|
|
3211
3460
|
};
|
|
3212
|
-
}),
|
|
3213
|
-
function
|
|
3461
|
+
}), Je = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Ye = n(() => Array.isArray(l.colorScale) && !Je.value), Xe = n(() => Ye.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Ze = n(() => Ye.value ? "" : l.colorScale?.max ?? "#08519c");
|
|
3462
|
+
function Qe(e) {
|
|
3214
3463
|
let t = e.replace("#", "");
|
|
3215
3464
|
return [
|
|
3216
3465
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -3218,181 +3467,181 @@ var Pt = {
|
|
|
3218
3467
|
parseInt(t.slice(4, 6), 16)
|
|
3219
3468
|
];
|
|
3220
3469
|
}
|
|
3221
|
-
function
|
|
3222
|
-
let [t, n, r] =
|
|
3470
|
+
function $e(e) {
|
|
3471
|
+
let [t, n, r] = Qe(Xe.value), [i, a, o] = Qe(Ze.value);
|
|
3223
3472
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
3224
3473
|
}
|
|
3225
|
-
let
|
|
3226
|
-
if (!
|
|
3474
|
+
let et = n(() => Ye.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), tt = n(() => {
|
|
3475
|
+
if (!Je.value) return null;
|
|
3227
3476
|
let e = /* @__PURE__ */ new Map();
|
|
3228
3477
|
for (let t of l.colorScale) e.set(t.value, t.color);
|
|
3229
3478
|
return e;
|
|
3230
3479
|
});
|
|
3231
|
-
function tt(e) {
|
|
3232
|
-
let t = He(e);
|
|
3233
|
-
return t == null ? void 0 : Ge.value.get(t);
|
|
3234
|
-
}
|
|
3235
3480
|
function nt(e) {
|
|
3236
|
-
let t =
|
|
3481
|
+
let t = We(e);
|
|
3482
|
+
return t == null ? void 0 : X.value.get(t);
|
|
3483
|
+
}
|
|
3484
|
+
function rt(e) {
|
|
3485
|
+
let t = nt(e), n = l.noDataColor;
|
|
3237
3486
|
if (t == null) return n;
|
|
3238
|
-
let r =
|
|
3487
|
+
let r = tt.value;
|
|
3239
3488
|
if (r) return r.get(String(t)) ?? n;
|
|
3240
|
-
let i =
|
|
3489
|
+
let i = et.value;
|
|
3241
3490
|
if (i) {
|
|
3242
3491
|
let e = t;
|
|
3243
3492
|
for (let t of i) if (e >= t.min) return t.color;
|
|
3244
3493
|
return n;
|
|
3245
3494
|
}
|
|
3246
|
-
let { min: a, max: o } =
|
|
3247
|
-
return
|
|
3495
|
+
let { min: a, max: o } = qe.value;
|
|
3496
|
+
return $e((t - a) / (o - a));
|
|
3248
3497
|
}
|
|
3249
|
-
let
|
|
3250
|
-
function
|
|
3251
|
-
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat !== void 0 ?
|
|
3498
|
+
let it = (e) => e.properties?.name ?? String(e.id);
|
|
3499
|
+
function at(e) {
|
|
3500
|
+
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat !== void 0 ? te(e, l.tooltipValueFormat) : String(e);
|
|
3252
3501
|
}
|
|
3253
|
-
function
|
|
3254
|
-
return t == null ? e : `${e}: ${
|
|
3502
|
+
function ot(e, t) {
|
|
3503
|
+
return t == null ? e : `${e}: ${at(t)}`;
|
|
3255
3504
|
}
|
|
3256
|
-
function
|
|
3257
|
-
let e =
|
|
3505
|
+
function st() {
|
|
3506
|
+
let e = j.value?.getEl();
|
|
3258
3507
|
if (!e) return;
|
|
3259
3508
|
_e?.disconnect();
|
|
3260
3509
|
let t = !1;
|
|
3261
3510
|
_e = new ResizeObserver((e) => {
|
|
3262
3511
|
let n = e[0]?.contentRect;
|
|
3263
|
-
n && (ve.width = n.width, ve.height = n.height, !t && be && ye ? (t = !0,
|
|
3512
|
+
n && (ve.width = n.width, ve.height = n.height, !t && be && ye ? (t = !0, ct(ye.x, ye.y)) : t = !0);
|
|
3264
3513
|
}), _e.observe(e);
|
|
3265
3514
|
}
|
|
3266
|
-
function
|
|
3267
|
-
let n =
|
|
3515
|
+
function ct(e, t) {
|
|
3516
|
+
let n = j.value?.getEl();
|
|
3268
3517
|
if (!n) return;
|
|
3269
|
-
let r =
|
|
3518
|
+
let r = T.value?.getBoundingClientRect(), { left: i, top: a } = H(e, t, ve.width, ve.height, l.tooltipClamp, r);
|
|
3270
3519
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
3271
3520
|
}
|
|
3272
|
-
function
|
|
3273
|
-
let r =
|
|
3521
|
+
function lt(e, t, n) {
|
|
3522
|
+
let r = de.get(e);
|
|
3274
3523
|
if (!r) return;
|
|
3275
|
-
let i =
|
|
3524
|
+
let i = j.value, a = i?.getEl();
|
|
3276
3525
|
!i || !a || (i.setData(r), ye = {
|
|
3277
3526
|
x: t,
|
|
3278
3527
|
y: n
|
|
3279
|
-
}, be = !0,
|
|
3528
|
+
}, be = !0, ct(t, n), a.style.visibility = "visible");
|
|
3280
3529
|
}
|
|
3281
|
-
function
|
|
3530
|
+
function ut(e, t) {
|
|
3282
3531
|
be && (Se = e, B = t, !V && (V = requestAnimationFrame(() => {
|
|
3283
3532
|
V = 0;
|
|
3284
|
-
let e =
|
|
3533
|
+
let e = j.value?.getEl();
|
|
3285
3534
|
!e || !be || (ye = {
|
|
3286
3535
|
x: Se,
|
|
3287
3536
|
y: B
|
|
3288
3537
|
}, e.style.transform = `translate3d(${Se + 16}px, ${B}px, 0) translateY(-50%)`);
|
|
3289
3538
|
})));
|
|
3290
3539
|
}
|
|
3291
|
-
function
|
|
3540
|
+
function dt() {
|
|
3292
3541
|
if (!be) return;
|
|
3293
3542
|
be = !1, ye = null;
|
|
3294
|
-
let e =
|
|
3543
|
+
let e = j.value?.getEl();
|
|
3295
3544
|
e && (e.style.visibility = "hidden");
|
|
3296
3545
|
}
|
|
3297
|
-
function
|
|
3546
|
+
function ft(e, t) {
|
|
3298
3547
|
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"));
|
|
3299
3548
|
}
|
|
3300
|
-
function
|
|
3301
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
3549
|
+
function pt(e, t = "solid") {
|
|
3550
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(q.value + 1)), e.setAttribute("stroke", "#555"), ft(e, t);
|
|
3302
3551
|
}
|
|
3303
|
-
function
|
|
3304
|
-
e.setAttribute("stroke-width", String(
|
|
3552
|
+
function mt(e) {
|
|
3553
|
+
e.setAttribute("stroke-width", String(q.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
3305
3554
|
}
|
|
3306
|
-
function
|
|
3307
|
-
L !== e && (L && !R.has(L) &&
|
|
3555
|
+
function ht(e) {
|
|
3556
|
+
L !== e && (L && !R.has(L) && mt(L), L = e, pt(e, R.get(e) ?? "solid"));
|
|
3308
3557
|
}
|
|
3309
|
-
function
|
|
3558
|
+
function gt() {
|
|
3310
3559
|
if (L) {
|
|
3311
3560
|
let e = R.get(L);
|
|
3312
|
-
e == null ?
|
|
3561
|
+
e == null ? mt(L) : pt(L, e), L = null, d("stateHover", null);
|
|
3313
3562
|
}
|
|
3314
|
-
|
|
3563
|
+
dt();
|
|
3315
3564
|
}
|
|
3316
|
-
function
|
|
3565
|
+
function _t(e) {
|
|
3317
3566
|
let t = e;
|
|
3318
3567
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
3319
3568
|
return t ? t.dataset.featId ?? null : null;
|
|
3320
3569
|
}
|
|
3321
|
-
function
|
|
3570
|
+
function vt(e) {
|
|
3322
3571
|
if (he) return;
|
|
3323
|
-
let t = e, n =
|
|
3572
|
+
let t = e, n = _t(t.target);
|
|
3324
3573
|
if (!n) return;
|
|
3325
|
-
let r =
|
|
3574
|
+
let r = de.get(n);
|
|
3326
3575
|
if (!r) return;
|
|
3327
3576
|
let i = {
|
|
3328
3577
|
id: r.id,
|
|
3329
3578
|
name: r.name,
|
|
3330
3579
|
value: r.value
|
|
3331
3580
|
};
|
|
3332
|
-
e.type === "click" ? (d("stateClick", i), d("update:focus",
|
|
3581
|
+
e.type === "click" ? (d("stateClick", i), d("update:focus", ke(Y.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (ht(I.get(n)), M.value && lt(n, t.clientX, t.clientY), d("stateHover", i));
|
|
3333
3582
|
}
|
|
3334
|
-
function
|
|
3335
|
-
he ||
|
|
3583
|
+
function yt(e) {
|
|
3584
|
+
he || ut(e.clientX, e.clientY);
|
|
3336
3585
|
}
|
|
3337
|
-
function
|
|
3586
|
+
function Z(e) {
|
|
3338
3587
|
let t = e.relatedTarget;
|
|
3339
|
-
t &&
|
|
3588
|
+
t && k.value?.contains(t) || gt();
|
|
3340
3589
|
}
|
|
3341
|
-
function
|
|
3342
|
-
let t = document.createElementNS(
|
|
3590
|
+
function Q(e) {
|
|
3591
|
+
let t = document.createElementNS(gr, "path");
|
|
3343
3592
|
return e && t.setAttribute("d", e), t;
|
|
3344
3593
|
}
|
|
3345
3594
|
function bt() {
|
|
3346
|
-
let e =
|
|
3595
|
+
let e = ne.value, t = A.value;
|
|
3347
3596
|
if (!e || !t) return;
|
|
3348
3597
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
3349
3598
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
3350
|
-
|
|
3351
|
-
let n =
|
|
3599
|
+
I.clear(), de.clear(), fe = null, L = null, R.clear(), me.clear();
|
|
3600
|
+
let n = Ue.value, r = ze.value.features, i = l.strokeColor, a = String(q.value), o = !M.value, s = document.createDocumentFragment();
|
|
3352
3601
|
for (let e of r) {
|
|
3353
|
-
let t = String(e.id), r =
|
|
3354
|
-
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill",
|
|
3355
|
-
let e = document.createElementNS(
|
|
3356
|
-
e.textContent =
|
|
3602
|
+
let t = String(e.id), r = it(e), c = nt(t), l = Q(n(e));
|
|
3603
|
+
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", rt(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
|
|
3604
|
+
let e = document.createElementNS(gr, "title");
|
|
3605
|
+
e.textContent = ot(r, c), l.appendChild(e);
|
|
3357
3606
|
}
|
|
3358
|
-
s.appendChild(l),
|
|
3607
|
+
s.appendChild(l), I.set(t, l), de.set(t, {
|
|
3359
3608
|
id: t,
|
|
3360
3609
|
name: r,
|
|
3361
3610
|
value: c,
|
|
3362
3611
|
feature: e
|
|
3363
3612
|
});
|
|
3364
3613
|
}
|
|
3365
|
-
let c =
|
|
3614
|
+
let c = Ve.value;
|
|
3366
3615
|
if (c) {
|
|
3367
|
-
let e =
|
|
3616
|
+
let e = Q(n(c));
|
|
3368
3617
|
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;
|
|
3369
3618
|
}
|
|
3370
3619
|
e.appendChild(s);
|
|
3371
3620
|
}
|
|
3372
3621
|
function xt() {
|
|
3373
|
-
let e = !
|
|
3374
|
-
for (let [t, n] of
|
|
3375
|
-
let r =
|
|
3376
|
-
if (n.setAttribute("fill",
|
|
3622
|
+
let e = !M.value;
|
|
3623
|
+
for (let [t, n] of I) {
|
|
3624
|
+
let r = nt(t), i = de.get(t);
|
|
3625
|
+
if (n.setAttribute("fill", rt(t)), i && (i.value = r), e && i) {
|
|
3377
3626
|
let e = n.firstElementChild;
|
|
3378
|
-
e && (e.textContent =
|
|
3627
|
+
e && (e.textContent = ot(i.name, r));
|
|
3379
3628
|
}
|
|
3380
3629
|
}
|
|
3381
3630
|
}
|
|
3382
3631
|
function St() {
|
|
3383
|
-
for (let e of
|
|
3632
|
+
for (let e of I.values()) e === L || R.has(e) || mt(e);
|
|
3384
3633
|
fe && fe.setAttribute("stroke", l.strokeColor);
|
|
3385
3634
|
}
|
|
3386
3635
|
function Ct() {
|
|
3387
3636
|
return typeof l.menu == "string" ? l.menu : "choropleth";
|
|
3388
3637
|
}
|
|
3389
|
-
let wt = n(() => l.legend && (
|
|
3638
|
+
let wt = n(() => l.legend && (Je.value || Ye.value || l.data)), Tt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), Et = n(() => {
|
|
3390
3639
|
let e = [];
|
|
3391
3640
|
for (let t = 0; t <= 10; t++) {
|
|
3392
3641
|
let n = t / 10;
|
|
3393
3642
|
e.push({
|
|
3394
3643
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
3395
|
-
color:
|
|
3644
|
+
color: $e(n)
|
|
3396
3645
|
});
|
|
3397
3646
|
}
|
|
3398
3647
|
return e;
|
|
@@ -3400,7 +3649,7 @@ var Pt = {
|
|
|
3400
3649
|
notation: "compact",
|
|
3401
3650
|
maximumFractionDigits: 1
|
|
3402
3651
|
}), Ot = n(() => {
|
|
3403
|
-
let { min: e, max: t } =
|
|
3652
|
+
let { min: e, max: t } = qe.value, n = t - e, r = [];
|
|
3404
3653
|
for (let t = 1; t <= 3; t++) {
|
|
3405
3654
|
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$/, "");
|
|
3406
3655
|
r.push({
|
|
@@ -3411,114 +3660,114 @@ var Pt = {
|
|
|
3411
3660
|
return r;
|
|
3412
3661
|
}), kt = n(() => {
|
|
3413
3662
|
let e = [];
|
|
3414
|
-
if (
|
|
3663
|
+
if (Je.value) for (let t of l.colorScale) e.push({
|
|
3415
3664
|
key: t.value,
|
|
3416
3665
|
color: t.color,
|
|
3417
3666
|
label: t.value
|
|
3418
3667
|
});
|
|
3419
|
-
else if (
|
|
3668
|
+
else if (Ye.value) for (let t of Tt.value) e.push({
|
|
3420
3669
|
key: String(t.min),
|
|
3421
3670
|
color: t.color,
|
|
3422
3671
|
label: t.label ?? String(t.min)
|
|
3423
3672
|
});
|
|
3424
3673
|
return e;
|
|
3425
|
-
}),
|
|
3674
|
+
}), At = n(() => `linear-gradient(to right, ${Et.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), jt = Be(), Mt = n(() => {
|
|
3426
3675
|
let e = Ct();
|
|
3427
3676
|
return [
|
|
3428
|
-
|
|
3677
|
+
jt.menuItem.value,
|
|
3429
3678
|
{
|
|
3430
3679
|
label: "Save as SVG",
|
|
3431
3680
|
action: () => {
|
|
3432
|
-
|
|
3681
|
+
O.value && K(O.value, e);
|
|
3433
3682
|
}
|
|
3434
3683
|
},
|
|
3435
3684
|
{
|
|
3436
3685
|
label: "Save as PNG",
|
|
3437
3686
|
action: () => {
|
|
3438
|
-
|
|
3687
|
+
O.value && Pe(O.value, e);
|
|
3439
3688
|
}
|
|
3440
3689
|
}
|
|
3441
3690
|
];
|
|
3442
3691
|
});
|
|
3443
|
-
return
|
|
3444
|
-
|
|
3692
|
+
return E(() => [Ue.value, M.value], () => bt()), E(() => [
|
|
3693
|
+
X.value,
|
|
3445
3694
|
l.colorScale,
|
|
3446
3695
|
l.noDataColor,
|
|
3447
3696
|
l.dataGeoType
|
|
3448
|
-
], () => xt()),
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
], () =>
|
|
3697
|
+
], () => xt()), E(() => [l.strokeColor, q.value], () => St()), E(() => [
|
|
3698
|
+
Y.value,
|
|
3699
|
+
Ue.value,
|
|
3700
|
+
Fe.value
|
|
3701
|
+
], () => je(), { flush: "post" }), (n, c) => (_(), a("div", {
|
|
3453
3702
|
ref_key: "containerRef",
|
|
3454
|
-
ref:
|
|
3703
|
+
ref: T,
|
|
3455
3704
|
class: f(["choropleth-wrapper", {
|
|
3456
3705
|
pannable: t.pan,
|
|
3457
|
-
"is-fullscreen":
|
|
3706
|
+
"is-fullscreen": C(jt).isFullscreen.value
|
|
3458
3707
|
}])
|
|
3459
3708
|
}, [
|
|
3460
3709
|
t.menu ? (_(), r(pe, {
|
|
3461
3710
|
key: 0,
|
|
3462
|
-
items:
|
|
3711
|
+
items: Mt.value
|
|
3463
3712
|
}, null, 8, ["items"])) : i("", !0),
|
|
3464
|
-
o("div",
|
|
3465
|
-
t.title || wt.value ? (_(), a("div",
|
|
3713
|
+
o("div", lr, x(C(jt).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
|
|
3714
|
+
t.title || wt.value ? (_(), a("div", ur, [t.title ? (_(), a("div", {
|
|
3466
3715
|
key: 0,
|
|
3467
3716
|
class: "choropleth-title",
|
|
3468
|
-
style: m(
|
|
3469
|
-
},
|
|
3717
|
+
style: m(N.value)
|
|
3718
|
+
}, x(t.title), 5)) : i("", !0), wt.value ? (_(), a("div", {
|
|
3470
3719
|
key: 1,
|
|
3471
3720
|
class: "choropleth-legend",
|
|
3472
|
-
style: m(
|
|
3473
|
-
}, [t.legendTitle ? (_(), a("span",
|
|
3721
|
+
style: m(ie.value)
|
|
3722
|
+
}, [t.legendTitle ? (_(), a("span", dr, x(t.legendTitle), 1)) : i("", !0), Je.value || Ye.value ? (_(!0), a(e, { key: 1 }, y(kt.value, (e) => (_(), a("span", {
|
|
3474
3723
|
key: e.key,
|
|
3475
3724
|
class: "choropleth-legend-item"
|
|
3476
3725
|
}, [o("span", {
|
|
3477
3726
|
class: "choropleth-legend-swatch",
|
|
3478
3727
|
style: m({ background: e.color })
|
|
3479
|
-
}, null, 4), s(" " +
|
|
3728
|
+
}, null, 4), s(" " + x(e.label), 1)]))), 128)) : (_(), a("div", fr, [o("div", {
|
|
3480
3729
|
class: "choropleth-legend-gradient",
|
|
3481
|
-
style: m({ background:
|
|
3482
|
-
}, null, 4), o("div",
|
|
3730
|
+
style: m({ background: At.value })
|
|
3731
|
+
}, null, 4), o("div", pr, [(_(!0), a(e, null, y(Ot.value, (e) => (_(), a("span", {
|
|
3483
3732
|
key: e.value,
|
|
3484
3733
|
style: m({ left: e.pct + "%" })
|
|
3485
|
-
},
|
|
3734
|
+
}, x(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
|
|
3486
3735
|
(_(), a("svg", {
|
|
3487
3736
|
ref_key: "svgRef",
|
|
3488
|
-
ref:
|
|
3489
|
-
viewBox: `0 0 ${
|
|
3737
|
+
ref: O,
|
|
3738
|
+
viewBox: `0 0 ${Ne.value} ${G.value}`,
|
|
3490
3739
|
preserveAspectRatio: "xMidYMid meet"
|
|
3491
3740
|
}, [o("g", {
|
|
3492
3741
|
ref_key: "mapGroupRef",
|
|
3493
|
-
ref:
|
|
3742
|
+
ref: k
|
|
3494
3743
|
}, [o("g", {
|
|
3495
3744
|
ref_key: "baseGroupRef",
|
|
3496
|
-
ref:
|
|
3745
|
+
ref: ne
|
|
3497
3746
|
}, null, 512), o("g", {
|
|
3498
3747
|
ref_key: "overlayGroupRef",
|
|
3499
|
-
ref:
|
|
3500
|
-
}, null, 512)], 512)], 8,
|
|
3748
|
+
ref: A
|
|
3749
|
+
}, null, 512)], 512)], 8, mr)),
|
|
3501
3750
|
xe.value ? (_(), a("button", {
|
|
3502
3751
|
key: 2,
|
|
3503
3752
|
type: "button",
|
|
3504
3753
|
class: "choropleth-reset",
|
|
3505
3754
|
"aria-label": "Reset zoom",
|
|
3506
|
-
onClick:
|
|
3755
|
+
onClick: U
|
|
3507
3756
|
}, " Reset ")) : i("", !0),
|
|
3508
|
-
|
|
3757
|
+
M.value ? (_(), r(cr, {
|
|
3509
3758
|
key: 3,
|
|
3510
3759
|
ref_key: "tooltipChildRef",
|
|
3511
|
-
ref:
|
|
3760
|
+
ref: j
|
|
3512
3761
|
}, {
|
|
3513
|
-
default:
|
|
3762
|
+
default: D((r) => [b(n.$slots, "tooltip", p(u(ee(r))), () => [t.tooltipFormat ? (_(), a("span", {
|
|
3514
3763
|
key: 0,
|
|
3515
3764
|
innerHTML: t.tooltipFormat(r)
|
|
3516
|
-
}, null, 8,
|
|
3765
|
+
}, null, 8, hr)) : r.value == null ? (_(), a(e, { key: 1 }, [s(x(r.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(x(r.name) + ": " + x(at(r.value)), 1)], 64))], !0)]),
|
|
3517
3766
|
_: 3
|
|
3518
3767
|
}, 512)) : i("", !0)
|
|
3519
3768
|
], 2));
|
|
3520
3769
|
}
|
|
3521
|
-
}), [["__scopeId", "data-v-b11a80ed"]]),
|
|
3770
|
+
}), [["__scopeId", "data-v-b11a80ed"]]), br = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3522
3771
|
__name: "ChartTooltip",
|
|
3523
3772
|
props: {
|
|
3524
3773
|
x: {},
|
|
@@ -3538,12 +3787,12 @@ var Pt = {
|
|
|
3538
3787
|
top: `${e.y}px`,
|
|
3539
3788
|
transform: "translateY(-50%)"
|
|
3540
3789
|
})
|
|
3541
|
-
}, [
|
|
3790
|
+
}, [b(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(C(N), {
|
|
3542
3791
|
key: 1,
|
|
3543
3792
|
open: e.open
|
|
3544
3793
|
}, {
|
|
3545
|
-
default:
|
|
3546
|
-
default:
|
|
3794
|
+
default: D(() => [c(C(re), { "as-child": "" }, {
|
|
3795
|
+
default: D(() => [o("div", {
|
|
3547
3796
|
class: "chart-tooltip-anchor",
|
|
3548
3797
|
style: m({
|
|
3549
3798
|
left: `${e.x}px`,
|
|
@@ -3551,8 +3800,8 @@ var Pt = {
|
|
|
3551
3800
|
})
|
|
3552
3801
|
}, null, 4)]),
|
|
3553
3802
|
_: 1
|
|
3554
|
-
}), c(
|
|
3555
|
-
default:
|
|
3803
|
+
}), c(C(ie), null, {
|
|
3804
|
+
default: D(() => [e.open ? (_(), r(C(M), {
|
|
3556
3805
|
key: 0,
|
|
3557
3806
|
class: "chart-tooltip-content",
|
|
3558
3807
|
side: "right",
|
|
@@ -3561,7 +3810,7 @@ var Pt = {
|
|
|
3561
3810
|
onPointerDownOutside: n[0] ||= (e) => t.$emit("close"),
|
|
3562
3811
|
onEscapeKeyDown: n[1] ||= (e) => t.$emit("close")
|
|
3563
3812
|
}, {
|
|
3564
|
-
default:
|
|
3813
|
+
default: D(() => [b(t.$slots, "default", {}, void 0, !0)]),
|
|
3565
3814
|
_: 3
|
|
3566
3815
|
}, 8, ["side-offset"])) : i("", !0)]),
|
|
3567
3816
|
_: 3
|
|
@@ -3569,7 +3818,7 @@ var Pt = {
|
|
|
3569
3818
|
_: 3
|
|
3570
3819
|
}, 8, ["open"])) : i("", !0);
|
|
3571
3820
|
}
|
|
3572
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
3821
|
+
}), [["__scopeId", "data-v-44377f70"]]), xr = { class: "TableWrapper" }, Sr = ["href", "download"], Cr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3573
3822
|
__name: "DataTable",
|
|
3574
3823
|
props: {
|
|
3575
3824
|
data: {},
|
|
@@ -3618,11 +3867,21 @@ var Pt = {
|
|
|
3618
3867
|
if (t) return { textAlign: t };
|
|
3619
3868
|
}
|
|
3620
3869
|
function p(e) {
|
|
3870
|
+
let t = c.columnConfig?.[e];
|
|
3871
|
+
return [t?.columnClass, t?.wrap ? "cell-wrap" : void 0];
|
|
3872
|
+
}
|
|
3873
|
+
function h(e) {
|
|
3874
|
+
return p(e);
|
|
3875
|
+
}
|
|
3876
|
+
function g(e) {
|
|
3877
|
+
return [...p(e), c.columnConfig?.[e]?.cellClass];
|
|
3878
|
+
}
|
|
3879
|
+
function v(e) {
|
|
3621
3880
|
return typeof e.column == "function";
|
|
3622
3881
|
}
|
|
3623
|
-
let
|
|
3882
|
+
let b = n(() => {
|
|
3624
3883
|
let e = c.data;
|
|
3625
|
-
return
|
|
3884
|
+
return v(e) ? e.columns.map((t) => ({
|
|
3626
3885
|
name: t.name,
|
|
3627
3886
|
values: e.column(t.name),
|
|
3628
3887
|
enumLabels: t.enumLabels
|
|
@@ -3630,87 +3889,88 @@ var Pt = {
|
|
|
3630
3889
|
name: e,
|
|
3631
3890
|
values: t
|
|
3632
3891
|
}));
|
|
3633
|
-
}),
|
|
3634
|
-
let e =
|
|
3892
|
+
}), ee = n(() => {
|
|
3893
|
+
let e = b.value;
|
|
3635
3894
|
if (e.length === 0) return 0;
|
|
3636
3895
|
let t = 0;
|
|
3637
3896
|
for (let n of e) t = Math.max(t, n.values.length);
|
|
3638
3897
|
return c.maxRows ? Math.min(t, c.maxRows) : t;
|
|
3639
3898
|
});
|
|
3640
|
-
function
|
|
3899
|
+
function S(e, t) {
|
|
3641
3900
|
let n = e.values[t];
|
|
3642
3901
|
if (n == null) return "";
|
|
3643
3902
|
let r = c.columnConfig?.[e.name]?.format;
|
|
3644
3903
|
if (r !== void 0) {
|
|
3645
3904
|
if (typeof r == "function") return r(n, t);
|
|
3646
|
-
if (typeof n == "number") return
|
|
3905
|
+
if (typeof n == "number") return te(n, r);
|
|
3647
3906
|
}
|
|
3648
3907
|
return e.enumLabels && typeof n == "number" ? e.enumLabels[n] ?? String(n) : typeof n == "number" ? Number.isInteger(n) ? n.toString() : n.toFixed(4) : typeof n == "boolean" ? n ? "true" : "false" : String(n);
|
|
3649
3908
|
}
|
|
3650
|
-
function
|
|
3909
|
+
function C() {
|
|
3651
3910
|
return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
|
|
3652
3911
|
}
|
|
3653
|
-
function
|
|
3912
|
+
function w(e) {
|
|
3654
3913
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
3655
3914
|
}
|
|
3656
|
-
function
|
|
3915
|
+
function T() {
|
|
3657
3916
|
if (typeof c.csv == "function") return c.csv();
|
|
3658
3917
|
if (typeof c.csv == "string") return c.csv;
|
|
3659
|
-
let e =
|
|
3918
|
+
let e = b.value, t = ee.value, n = [e.map((e) => w(l(e.name))).join(",")];
|
|
3660
3919
|
for (let r = 0; r < t; r++) {
|
|
3661
|
-
let t = e.map((e) =>
|
|
3920
|
+
let t = e.map((e) => w(S(e, r)));
|
|
3662
3921
|
n.push(t.join(","));
|
|
3663
3922
|
}
|
|
3664
3923
|
return n.join("\n");
|
|
3665
3924
|
}
|
|
3666
|
-
function
|
|
3667
|
-
|
|
3925
|
+
function E() {
|
|
3926
|
+
Fe(T(), C());
|
|
3668
3927
|
}
|
|
3669
|
-
let
|
|
3928
|
+
let D = n(() => c.downloadButton || c.downloadLink ? [] : [{
|
|
3670
3929
|
label: c.downloadMenuLink,
|
|
3671
|
-
action:
|
|
3672
|
-
}]),
|
|
3930
|
+
action: E
|
|
3931
|
+
}]), O = n(() => {
|
|
3673
3932
|
if (c.downloadButton) return null;
|
|
3674
3933
|
let e = c.downloadLink;
|
|
3675
3934
|
return e ? typeof e == "string" ? e : "Download data (CSV)" : null;
|
|
3676
|
-
}),
|
|
3935
|
+
}), k = n(() => O.value ? `data:text/csv;charset=utf-8,${encodeURIComponent(T())}` : null), ne = n(() => !!c.menu && D.value.length > 0);
|
|
3677
3936
|
return (n, s) => (_(), a("div", { class: f(["TableOuter", {
|
|
3678
3937
|
"full-width": t.fullWidth,
|
|
3679
|
-
"has-menu":
|
|
3938
|
+
"has-menu": ne.value
|
|
3680
3939
|
}]) }, [
|
|
3681
|
-
|
|
3940
|
+
ne.value ? (_(), r(pe, {
|
|
3682
3941
|
key: 0,
|
|
3683
|
-
items:
|
|
3942
|
+
items: D.value,
|
|
3684
3943
|
"force-dropdown": ""
|
|
3685
3944
|
}, null, 8, ["items"])) : i("", !0),
|
|
3686
|
-
o("div",
|
|
3687
|
-
o("colgroup", null, [(_(!0), a(e, null, y(
|
|
3945
|
+
o("div", xr, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
|
|
3946
|
+
o("colgroup", null, [(_(!0), a(e, null, y(b.value, (e) => (_(), a("col", {
|
|
3688
3947
|
key: e.name,
|
|
3689
3948
|
style: m(u(e.name))
|
|
3690
3949
|
}, null, 4))), 128))]),
|
|
3691
|
-
o("thead", null, [o("tr", null, [(_(!0), a(e, null, y(
|
|
3950
|
+
o("thead", null, [o("tr", null, [(_(!0), a(e, null, y(b.value, (e) => (_(), a("th", {
|
|
3692
3951
|
key: e.name,
|
|
3952
|
+
class: f(h(e.name)),
|
|
3693
3953
|
style: m(d(e.name))
|
|
3694
|
-
},
|
|
3695
|
-
o("tbody", null, [(_(!0), a(e, null, y(
|
|
3954
|
+
}, x(l(e.name)), 7))), 128))])]),
|
|
3955
|
+
o("tbody", null, [(_(!0), a(e, null, y(ee.value, (t) => (_(), a("tr", { key: t }, [(_(!0), a(e, null, y(b.value, (e) => (_(), a("td", {
|
|
3696
3956
|
key: e.name,
|
|
3697
|
-
class: f(
|
|
3957
|
+
class: f(g(e.name)),
|
|
3698
3958
|
style: m(d(e.name))
|
|
3699
|
-
},
|
|
3959
|
+
}, x(S(e, t - 1)), 7))), 128))]))), 128))])
|
|
3700
3960
|
], 2)]),
|
|
3701
3961
|
t.downloadButton ? (_(), a("button", {
|
|
3702
3962
|
key: 1,
|
|
3703
3963
|
type: "button",
|
|
3704
3964
|
class: "data-table-download-button",
|
|
3705
|
-
onClick:
|
|
3706
|
-
},
|
|
3965
|
+
onClick: E
|
|
3966
|
+
}, x(t.downloadMenuLink), 1)) : O.value ? (_(), a("a", {
|
|
3707
3967
|
key: 2,
|
|
3708
3968
|
class: "data-table-download-link",
|
|
3709
|
-
href:
|
|
3710
|
-
download: `${
|
|
3711
|
-
},
|
|
3969
|
+
href: k.value,
|
|
3970
|
+
download: `${C()}.csv`
|
|
3971
|
+
}, x(O.value), 9, Sr)) : i("", !0)
|
|
3712
3972
|
], 2));
|
|
3713
3973
|
}
|
|
3714
|
-
}), [["__scopeId", "data-v-
|
|
3974
|
+
}), [["__scopeId", "data-v-21721f41"]]);
|
|
3715
3975
|
//#endregion
|
|
3716
|
-
export {
|
|
3976
|
+
export { or as BarChart, br as ChartTooltip, yr as ChoroplethMap, Cr as DataTable, En as LineChart };
|