@cfasim-ui/charts 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChoroplethMap/ChoroplethMap.d.ts +27 -0
- package/dist/LineChart/LineChart.d.ts +7 -1
- package/dist/index.css +1 -1
- package/dist/index.js +919 -861
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as 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
2
|
import { formatNumber as te } from "@cfasim-ui/shared";
|
|
3
|
-
import { DropdownMenuContent as O, DropdownMenuItem as k, DropdownMenuPortal as
|
|
4
|
-
import { geoAlbersUsa as
|
|
3
|
+
import { DropdownMenuContent as O, DropdownMenuItem as k, DropdownMenuPortal as A, DropdownMenuRoot as j, DropdownMenuTrigger as M, PopoverAnchor as N, PopoverContent as ne, PopoverPortal as re, PopoverRoot as P } from "reka-ui";
|
|
4
|
+
import { geoAlbersUsa as ie, geoMercator as F, geoPath as ae } from "d3-geo";
|
|
5
5
|
import { zoom as oe, zoomIdentity as se } from "d3-zoom";
|
|
6
|
-
import { select as
|
|
6
|
+
import { select as I } from "d3-selection";
|
|
7
7
|
import "d3-transition";
|
|
8
|
-
import { feature as
|
|
8
|
+
import { feature as ce, 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 de = ["aria-label"],
|
|
10
|
+
var de = ["aria-label"], fe = /* @__PURE__ */ l({
|
|
11
11
|
__name: "ChartMenu",
|
|
12
12
|
props: {
|
|
13
13
|
items: {},
|
|
@@ -37,11 +37,11 @@ var de = ["aria-label"], I = /* @__PURE__ */ l({
|
|
|
37
37
|
"stroke-width": "1.75",
|
|
38
38
|
"stroke-linecap": "round",
|
|
39
39
|
"aria-hidden": "true"
|
|
40
|
-
}, [o("path", { d: "M4 4l8 8M12 4l-8 8" })], -1)]])) : u() ? (_(), r(C(
|
|
40
|
+
}, [o("path", { d: "M4 4l8 8M12 4l-8 8" })], -1)]])) : u() ? (_(), r(C(j), {
|
|
41
41
|
key: 2,
|
|
42
42
|
modal: !1
|
|
43
43
|
}, {
|
|
44
|
-
default: D(() => [c(C(
|
|
44
|
+
default: D(() => [c(C(M), {
|
|
45
45
|
class: "chart-menu-button",
|
|
46
46
|
"aria-label": "Chart options"
|
|
47
47
|
}, {
|
|
@@ -69,7 +69,7 @@ var de = ["aria-label"], I = /* @__PURE__ */ l({
|
|
|
69
69
|
})
|
|
70
70
|
], -1)]]),
|
|
71
71
|
_: 1
|
|
72
|
-
}), c(C(
|
|
72
|
+
}), c(C(A), null, {
|
|
73
73
|
default: D(() => [c(C(O), {
|
|
74
74
|
class: "chart-menu-content",
|
|
75
75
|
"side-offset": 4,
|
|
@@ -110,7 +110,7 @@ var de = ["aria-label"], I = /* @__PURE__ */ l({
|
|
|
110
110
|
let n = e.__vccOpts || e;
|
|
111
111
|
for (let [e, r] of t) n[e] = r;
|
|
112
112
|
return n;
|
|
113
|
-
},
|
|
113
|
+
}, pe = /* @__PURE__ */ L(fe, [["__scopeId", "data-v-f5743494"]]);
|
|
114
114
|
//#endregion
|
|
115
115
|
//#region src/_shared/axes.ts
|
|
116
116
|
function R(e) {
|
|
@@ -126,13 +126,13 @@ function B(e, t, n) {
|
|
|
126
126
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
127
127
|
return r;
|
|
128
128
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
return Math.abs(e) >= 1e3 ?
|
|
129
|
+
var me = new Intl.NumberFormat();
|
|
130
|
+
function he(e) {
|
|
131
|
+
return Math.abs(e) >= 1e3 ? me.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/_shared/computeTicks.ts
|
|
135
|
-
function
|
|
135
|
+
function ge(e) {
|
|
136
136
|
let { min: t, max: n, ticks: r } = e;
|
|
137
137
|
if (t === n) return [];
|
|
138
138
|
let i = e.displayOffset ?? 0;
|
|
@@ -141,7 +141,7 @@ function he(e) {
|
|
|
141
141
|
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = z(n - t, a);
|
|
142
142
|
return B(t + i, n + i, o).map((e) => e - i);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function _e(e, t, n, r) {
|
|
145
145
|
if (r === "log") {
|
|
146
146
|
let r = Math.log10(t), i = Math.log10(n) - r || 1;
|
|
147
147
|
return (Math.log10(e > 0 ? e : t) - r) / i;
|
|
@@ -149,7 +149,7 @@ function ge(e, t, n, r) {
|
|
|
149
149
|
let i = n - t || 1;
|
|
150
150
|
return (e - t) / i;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function ve(e, t, n, r) {
|
|
153
153
|
if (n !== "log") return {
|
|
154
154
|
min: e,
|
|
155
155
|
max: t
|
|
@@ -160,7 +160,7 @@ function _e(e, t, n, r) {
|
|
|
160
160
|
max: t > 0 ? Math.max(t, i) : i
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function ye(e) {
|
|
164
164
|
let { min: t, max: n, ticks: r } = e;
|
|
165
165
|
if (!(t > 0) || !(n > 0) || t === n) return [];
|
|
166
166
|
if (Array.isArray(r)) return r.filter((e) => e > 0 && e >= t && e <= n);
|
|
@@ -173,7 +173,7 @@ function ve(e) {
|
|
|
173
173
|
}
|
|
174
174
|
//#endregion
|
|
175
175
|
//#region src/_shared/useChartSize.ts
|
|
176
|
-
function
|
|
176
|
+
function be(e = {}) {
|
|
177
177
|
let t = v(null), n = v(0), r = v(0), i = null, a = null;
|
|
178
178
|
return h(() => {
|
|
179
179
|
t.value && (n.value = t.value.clientWidth, r.value = t.value.clientHeight, i = new ResizeObserver((t) => {
|
|
@@ -192,8 +192,8 @@ function ye(e = {}) {
|
|
|
192
192
|
measuredHeight: r
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
var V = .6,
|
|
196
|
-
function
|
|
195
|
+
var V = .6, xe = 8;
|
|
196
|
+
function Se(e, t) {
|
|
197
197
|
return {
|
|
198
198
|
fontSize: e?.fontSize ?? t.fontSize,
|
|
199
199
|
fill: e?.color ?? "currentColor",
|
|
@@ -201,8 +201,8 @@ function xe(e, t) {
|
|
|
201
201
|
fillOpacity: e?.color == null ? t.fillOpacity : void 0
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
var
|
|
205
|
-
function
|
|
204
|
+
var Ce = 7, we = 18, Te = 16;
|
|
205
|
+
function Ee(e) {
|
|
206
206
|
return e == null ? {
|
|
207
207
|
top: 0,
|
|
208
208
|
right: 0,
|
|
@@ -220,12 +220,12 @@ function Te(e) {
|
|
|
220
220
|
left: e.left ?? 0
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
function Ee(e) {
|
|
224
|
-
return Ce + e.length * Se;
|
|
225
|
-
}
|
|
226
223
|
function De(e) {
|
|
224
|
+
return we + e.length * Ce;
|
|
225
|
+
}
|
|
226
|
+
function Oe(e) {
|
|
227
227
|
let t = n(() => {
|
|
228
|
-
let t =
|
|
228
|
+
let t = Ee(e.extraPadding?.());
|
|
229
229
|
return {
|
|
230
230
|
left: (e.yLabel() ? 56 : 50) + t.left,
|
|
231
231
|
right: 10 + t.right
|
|
@@ -238,11 +238,11 @@ function De(e) {
|
|
|
238
238
|
};
|
|
239
239
|
let n = Math.max(0, r.value), i = [], a = 0, o = 0;
|
|
240
240
|
for (let e of t) {
|
|
241
|
-
let t =
|
|
241
|
+
let t = De(e);
|
|
242
242
|
o > 0 && o + t > n && (a++, o = 0), i.push({
|
|
243
243
|
x: o,
|
|
244
244
|
row: a
|
|
245
|
-
}), o += t +
|
|
245
|
+
}), o += t + Te;
|
|
246
246
|
}
|
|
247
247
|
return {
|
|
248
248
|
positions: i,
|
|
@@ -252,9 +252,9 @@ function De(e) {
|
|
|
252
252
|
let t = e.title();
|
|
253
253
|
if (!t) return 10;
|
|
254
254
|
let n = e.titleStyle?.()?.lineHeight ?? 18;
|
|
255
|
-
return t.split("\n").length * n +
|
|
255
|
+
return t.split("\n").length * n + xe;
|
|
256
256
|
}), o = n(() => {
|
|
257
|
-
let n =
|
|
257
|
+
let n = Ee(e.extraPadding?.()), r = i.value.rowCount;
|
|
258
258
|
return {
|
|
259
259
|
top: a.value + r * 20 + n.top,
|
|
260
260
|
bottom: (e.xLabel() ? 38 : 30) + n.bottom,
|
|
@@ -283,10 +283,10 @@ function De(e) {
|
|
|
283
283
|
}
|
|
284
284
|
//#endregion
|
|
285
285
|
//#region src/tooltip-position.ts
|
|
286
|
-
var
|
|
287
|
-
function
|
|
286
|
+
var ke = 16, Ae = 8;
|
|
287
|
+
function H(e, t, n, r, i, a) {
|
|
288
288
|
if (i === "none") return {
|
|
289
|
-
left: e +
|
|
289
|
+
left: e + ke,
|
|
290
290
|
top: t
|
|
291
291
|
};
|
|
292
292
|
let o = i === "chart" && a ? {
|
|
@@ -299,15 +299,15 @@ function Ae(e, t, n, r, i, a) {
|
|
|
299
299
|
right: window.innerWidth,
|
|
300
300
|
top: 0,
|
|
301
301
|
bottom: window.innerHeight
|
|
302
|
-
}, s = e +
|
|
302
|
+
}, s = e + ke + n > o.right - Ae ? e - ke - n : e + ke, c = r / 2;
|
|
303
303
|
return {
|
|
304
304
|
left: s,
|
|
305
|
-
top: Math.min(Math.max(t, o.top +
|
|
305
|
+
top: Math.min(Math.max(t, o.top + Ae + c), o.bottom - Ae - c)
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
//#endregion
|
|
309
309
|
//#region src/_shared/useChartTooltip.ts
|
|
310
|
-
function
|
|
310
|
+
function je(e) {
|
|
311
311
|
let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null), s = null, c = "pending";
|
|
312
312
|
function l(e) {
|
|
313
313
|
return "touches" in e ? e.touches[0] ?? null : e;
|
|
@@ -328,7 +328,7 @@ function H(e) {
|
|
|
328
328
|
}
|
|
329
329
|
let s = i.value, c = e.containerRef.value;
|
|
330
330
|
if (!s || !c) return;
|
|
331
|
-
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } =
|
|
331
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = H(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
|
|
332
332
|
o.value = {
|
|
333
333
|
left: f - l.left,
|
|
334
334
|
top: p - l.top
|
|
@@ -395,69 +395,69 @@ function H(e) {
|
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/ChartMenu/download.ts
|
|
398
|
-
function
|
|
398
|
+
function Me(e, t) {
|
|
399
399
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
400
400
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
401
401
|
}
|
|
402
|
-
var
|
|
402
|
+
var U = [
|
|
403
403
|
"color",
|
|
404
404
|
"font-family",
|
|
405
405
|
"font-size",
|
|
406
406
|
"font-weight"
|
|
407
|
-
],
|
|
408
|
-
function
|
|
407
|
+
], W = ["fill", "stroke"];
|
|
408
|
+
function Ne(e) {
|
|
409
409
|
let t = e.match(/^\s*var\(\s*(--[\w-]+)\s*(?:,\s*([^)]*?)\s*)?\)\s*$/);
|
|
410
410
|
if (!t) return e;
|
|
411
411
|
let [, n, r] = t;
|
|
412
412
|
return window.getComputedStyle(document.documentElement).getPropertyValue(n).trim() || (r ? r.trim() : e);
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function G(e) {
|
|
415
415
|
let t = e.cloneNode(!0);
|
|
416
416
|
t.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
417
417
|
let n = window.getComputedStyle(e), r = [];
|
|
418
|
-
for (let e of
|
|
418
|
+
for (let e of U) {
|
|
419
419
|
let t = n.getPropertyValue(e);
|
|
420
420
|
t && r.push(`${e}: ${t}`);
|
|
421
421
|
}
|
|
422
422
|
let i = t.getAttribute("style") ?? "";
|
|
423
423
|
t.setAttribute("style", [i, ...r].filter(Boolean).join("; "));
|
|
424
|
-
for (let e of t.querySelectorAll("*")) for (let t of
|
|
424
|
+
for (let e of t.querySelectorAll("*")) for (let t of W) {
|
|
425
425
|
let n = e.getAttribute(t);
|
|
426
|
-
!n || !n.includes("var(") || e.setAttribute(t,
|
|
426
|
+
!n || !n.includes("var(") || e.setAttribute(t, Ne(n));
|
|
427
427
|
}
|
|
428
428
|
return t;
|
|
429
429
|
}
|
|
430
|
-
function G(e, t) {
|
|
431
|
-
let n = Ne(e), r = new XMLSerializer().serializeToString(n);
|
|
432
|
-
je(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
433
|
-
}
|
|
434
430
|
function K(e, t) {
|
|
435
|
-
let n =
|
|
431
|
+
let n = G(e), r = new XMLSerializer().serializeToString(n);
|
|
432
|
+
Me(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
433
|
+
}
|
|
434
|
+
function Pe(e, t) {
|
|
435
|
+
let n = G(e), r = new XMLSerializer().serializeToString(n), i = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(i), o = new Image(), s = e.width.baseVal.value || e.clientWidth, c = e.height.baseVal.value || e.clientHeight;
|
|
436
436
|
o.onload = () => {
|
|
437
437
|
let e = document.createElement("canvas");
|
|
438
438
|
e.width = s * 2, e.height = c * 2;
|
|
439
439
|
let n = e.getContext("2d");
|
|
440
440
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
441
|
-
e &&
|
|
441
|
+
e && Me(e, `${t}.png`);
|
|
442
442
|
}), URL.revokeObjectURL(a);
|
|
443
443
|
}, o.src = a;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
|
|
445
|
+
function Fe(e, t) {
|
|
446
|
+
Me(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
447
447
|
}
|
|
448
448
|
//#endregion
|
|
449
449
|
//#region src/_shared/useChartFullscreen.ts
|
|
450
|
-
var
|
|
451
|
-
function
|
|
452
|
-
typeof document > "u" || (
|
|
450
|
+
var Ie = 0, Le = "";
|
|
451
|
+
function Re() {
|
|
452
|
+
typeof document > "u" || (Ie === 0 && (Le = document.body.style.overflow, document.body.style.overflow = "hidden"), Ie++);
|
|
453
453
|
}
|
|
454
|
-
function
|
|
455
|
-
typeof document > "u" ||
|
|
454
|
+
function ze() {
|
|
455
|
+
typeof document > "u" || Ie !== 0 && (Ie--, Ie === 0 && (document.body.style.overflow = Le));
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Be(e = {}) {
|
|
458
458
|
let t = v(!1), r = !1;
|
|
459
459
|
function i(e) {
|
|
460
|
-
e !== t.value && (t.value = e, e && !r ? (
|
|
460
|
+
e !== t.value && (t.value = e, e && !r ? (Re(), r = !0) : !e && r && (ze(), r = !1));
|
|
461
461
|
}
|
|
462
462
|
function a(e) {
|
|
463
463
|
if (e.key !== "Escape" || !t.value) return;
|
|
@@ -476,7 +476,7 @@ function Re(e = {}) {
|
|
|
476
476
|
return h(() => {
|
|
477
477
|
typeof document > "u" || document.addEventListener("keydown", a);
|
|
478
478
|
}), g(() => {
|
|
479
|
-
typeof document > "u" || (document.removeEventListener("keydown", a), r &&= (
|
|
479
|
+
typeof document > "u" || (document.removeEventListener("keydown", a), r &&= (ze(), !1));
|
|
480
480
|
}), {
|
|
481
481
|
isFullscreen: t,
|
|
482
482
|
toggle: c,
|
|
@@ -504,7 +504,7 @@ function Re(e = {}) {
|
|
|
504
504
|
}
|
|
505
505
|
//#endregion
|
|
506
506
|
//#region src/_shared/useChartMenu.ts
|
|
507
|
-
function
|
|
507
|
+
function Ve(e) {
|
|
508
508
|
let t = v(null);
|
|
509
509
|
function r() {
|
|
510
510
|
let t = e.filename();
|
|
@@ -512,23 +512,23 @@ function ze(e) {
|
|
|
512
512
|
let n = e.legacyMenuLabel();
|
|
513
513
|
return typeof n == "string" ? n : "chart";
|
|
514
514
|
}
|
|
515
|
-
let i = e.fullscreen ?
|
|
515
|
+
let i = e.fullscreen ? Be({ target: e.fullscreenTarget }) : null, a = n(() => {
|
|
516
516
|
let n = r(), a = [];
|
|
517
517
|
i && a.push(i.menuItem.value), a.push({
|
|
518
518
|
label: "Save as SVG",
|
|
519
519
|
action: () => {
|
|
520
|
-
t.value &&
|
|
520
|
+
t.value && K(t.value, n);
|
|
521
521
|
}
|
|
522
522
|
}, {
|
|
523
523
|
label: "Save as PNG",
|
|
524
524
|
action: () => {
|
|
525
|
-
t.value &&
|
|
525
|
+
t.value && Pe(t.value, n);
|
|
526
526
|
}
|
|
527
527
|
});
|
|
528
528
|
let o = e.downloadButton?.();
|
|
529
529
|
return !e.downloadLink() && !o && a.push({
|
|
530
530
|
label: "Download CSV",
|
|
531
|
-
action: () =>
|
|
531
|
+
action: () => Fe(e.getCsv(), n)
|
|
532
532
|
}), a;
|
|
533
533
|
}), o = n(() => {
|
|
534
534
|
if (e.downloadButton?.()) return null;
|
|
@@ -539,7 +539,7 @@ function ze(e) {
|
|
|
539
539
|
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
540
540
|
});
|
|
541
541
|
function l() {
|
|
542
|
-
|
|
542
|
+
Fe(e.getCsv(), r());
|
|
543
543
|
}
|
|
544
544
|
return {
|
|
545
545
|
svgRef: t,
|
|
@@ -557,7 +557,7 @@ function ze(e) {
|
|
|
557
557
|
}
|
|
558
558
|
//#endregion
|
|
559
559
|
//#region src/_shared/seriesCsv.ts
|
|
560
|
-
function
|
|
560
|
+
function He(e) {
|
|
561
561
|
if (e.length === 0) return "";
|
|
562
562
|
let t = 0;
|
|
563
563
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -569,43 +569,43 @@ function Be(e) {
|
|
|
569
569
|
}
|
|
570
570
|
return i.join("\n");
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function Ue(e, t, n = "category") {
|
|
573
573
|
if (t.length === 0 || e.length === 0) return "";
|
|
574
574
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
575
575
|
for (let n = 0; n < e.length; n++) {
|
|
576
|
-
let i = [
|
|
576
|
+
let i = [We(e[n])];
|
|
577
577
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
578
578
|
r.push(i.join(","));
|
|
579
579
|
}
|
|
580
580
|
return r.join("\n");
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function We(e) {
|
|
583
583
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
584
584
|
}
|
|
585
585
|
//#endregion
|
|
586
586
|
//#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
|
|
587
|
-
var
|
|
587
|
+
var Ge = {
|
|
588
588
|
class: "chart-annotations",
|
|
589
589
|
"pointer-events": "none"
|
|
590
|
-
},
|
|
590
|
+
}, Ke = ["stroke", "stroke-width"], qe = [
|
|
591
591
|
"d",
|
|
592
592
|
"stroke",
|
|
593
593
|
"stroke-width"
|
|
594
|
-
],
|
|
594
|
+
], q = [
|
|
595
595
|
"fill",
|
|
596
596
|
"stroke",
|
|
597
597
|
"stroke-width",
|
|
598
598
|
"transform"
|
|
599
|
-
],
|
|
599
|
+
], Je = [
|
|
600
600
|
"stroke",
|
|
601
601
|
"stroke-width",
|
|
602
602
|
"stroke-dasharray"
|
|
603
|
-
],
|
|
603
|
+
], J = [
|
|
604
604
|
"d",
|
|
605
605
|
"stroke",
|
|
606
606
|
"stroke-width",
|
|
607
607
|
"stroke-dasharray"
|
|
608
|
-
], Y = ["fill", "transform"],
|
|
608
|
+
], Y = ["fill", "transform"], Ye = [
|
|
609
609
|
"x",
|
|
610
610
|
"y",
|
|
611
611
|
"text-anchor",
|
|
@@ -614,7 +614,7 @@ var Ue = {
|
|
|
614
614
|
"fill",
|
|
615
615
|
"stroke",
|
|
616
616
|
"stroke-width"
|
|
617
|
-
],
|
|
617
|
+
], X = ["x", "dy"], Z = ["font-weight", "font-style"], Xe = 13, Ze = "normal", Qe = 700, $e = "var(--color-bg-0, #fff)", et = 3, tt = 1, nt = 4, rt = 6, it = 1.2, at = .35, ot = /* @__PURE__ */ l({
|
|
618
618
|
__name: "ChartAnnotations",
|
|
619
619
|
props: {
|
|
620
620
|
annotations: { default: () => [] },
|
|
@@ -651,7 +651,7 @@ var Ue = {
|
|
|
651
651
|
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
652
652
|
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
653
653
|
if (a && !r.bounds) continue;
|
|
654
|
-
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ??
|
|
654
|
+
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? Xe, g = t.fontWeight ?? Ze, _ = t.outlineColor ?? $e, v = t.outlineWidth ?? et, y = t.lineColor ?? m, b = t.lineWidth ?? tt, x = s(t.lineDash), ee = {
|
|
655
655
|
left: "start",
|
|
656
656
|
center: "middle",
|
|
657
657
|
right: "end"
|
|
@@ -666,7 +666,7 @@ var Ue = {
|
|
|
666
666
|
textX: d,
|
|
667
667
|
textY: p,
|
|
668
668
|
textAnchor: ee,
|
|
669
|
-
dy: h *
|
|
669
|
+
dy: h * it,
|
|
670
670
|
fontSize: h,
|
|
671
671
|
fontWeight: g,
|
|
672
672
|
color: m,
|
|
@@ -732,11 +732,11 @@ var Ue = {
|
|
|
732
732
|
}
|
|
733
733
|
function f(e, t, n, r, i, a) {
|
|
734
734
|
if (a === "none") return { path: "" };
|
|
735
|
-
let o = n - e, s = r - t, c = r - i *
|
|
735
|
+
let o = n - e, s = r - t, c = r - i * at;
|
|
736
736
|
if (o === 0 || s === 0 || a === "straight") {
|
|
737
737
|
let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
|
|
738
738
|
if (l <= 10) return { path: "" };
|
|
739
|
-
let u = a / l, d = o / l, f = e + u *
|
|
739
|
+
let u = a / l, d = o / l, f = e + u * nt, p = t + d * nt, m = n - u * rt, h = i - d * rt, g = Math.atan2(-d, -u) * 180 / Math.PI;
|
|
740
740
|
return {
|
|
741
741
|
path: `M${f},${p} L${m},${h}`,
|
|
742
742
|
arrow: {
|
|
@@ -747,8 +747,8 @@ var Ue = {
|
|
|
747
747
|
};
|
|
748
748
|
}
|
|
749
749
|
let l = c - t;
|
|
750
|
-
if (Math.abs(l) <=
|
|
751
|
-
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d *
|
|
750
|
+
if (Math.abs(l) <= nt || Math.abs(o) <= rt) return { path: "" };
|
|
751
|
+
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d * nt, m = n - u * rt, h = c, g = d > 0 ? -90 : 90;
|
|
752
752
|
return {
|
|
753
753
|
path: `M${f},${p} Q${f},${c} ${m},${h}`,
|
|
754
754
|
arrow: {
|
|
@@ -758,7 +758,7 @@ var Ue = {
|
|
|
758
758
|
}
|
|
759
759
|
};
|
|
760
760
|
}
|
|
761
|
-
return (t, n) => (_(), a("g",
|
|
761
|
+
return (t, n) => (_(), a("g", Ge, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
762
762
|
t.rule && t.outlineWidth > 0 ? (_(), a("line", d({
|
|
763
763
|
key: 0,
|
|
764
764
|
ref_for: !0
|
|
@@ -767,7 +767,7 @@ var Ue = {
|
|
|
767
767
|
stroke: t.outlineColor,
|
|
768
768
|
"stroke-width": t.lineWidth + t.outlineWidth,
|
|
769
769
|
"stroke-linecap": "round"
|
|
770
|
-
}), null, 16,
|
|
770
|
+
}), null, 16, Ke)) : i("", !0),
|
|
771
771
|
t.pointerPath && t.outlineWidth > 0 ? (_(), a("path", {
|
|
772
772
|
key: 1,
|
|
773
773
|
d: t.pointerPath,
|
|
@@ -776,7 +776,7 @@ var Ue = {
|
|
|
776
776
|
stroke: t.outlineColor,
|
|
777
777
|
"stroke-width": t.lineWidth + t.outlineWidth,
|
|
778
778
|
"stroke-linecap": "round"
|
|
779
|
-
}, null, 8,
|
|
779
|
+
}, null, 8, qe)) : i("", !0),
|
|
780
780
|
t.arrowTip && t.outlineWidth > 0 ? (_(), a("polygon", {
|
|
781
781
|
key: 2,
|
|
782
782
|
points: "0,0 -6,-3 -6,3",
|
|
@@ -786,7 +786,7 @@ var Ue = {
|
|
|
786
786
|
"stroke-width": t.outlineWidth,
|
|
787
787
|
"stroke-linejoin": "round",
|
|
788
788
|
transform: t.arrowTransform
|
|
789
|
-
}, null, 8,
|
|
789
|
+
}, null, 8, q)) : i("", !0),
|
|
790
790
|
t.rule ? (_(), a("line", d({
|
|
791
791
|
key: 3,
|
|
792
792
|
ref_for: !0
|
|
@@ -795,7 +795,7 @@ var Ue = {
|
|
|
795
795
|
"stroke-width": t.lineWidth,
|
|
796
796
|
"stroke-dasharray": t.lineDash,
|
|
797
797
|
"stroke-linecap": "round"
|
|
798
|
-
}), null, 16,
|
|
798
|
+
}), null, 16, Je)) : i("", !0),
|
|
799
799
|
t.pointerPath ? (_(), a("path", {
|
|
800
800
|
key: 4,
|
|
801
801
|
d: t.pointerPath,
|
|
@@ -804,7 +804,7 @@ var Ue = {
|
|
|
804
804
|
"stroke-width": t.lineWidth,
|
|
805
805
|
"stroke-dasharray": t.lineDash,
|
|
806
806
|
"stroke-linecap": "round"
|
|
807
|
-
}, null, 8,
|
|
807
|
+
}, null, 8, J)) : i("", !0),
|
|
808
808
|
t.arrowTip ? (_(), a("polygon", {
|
|
809
809
|
key: 5,
|
|
810
810
|
points: "0,0 -6,-3 -6,3",
|
|
@@ -828,14 +828,14 @@ var Ue = {
|
|
|
828
828
|
dy: r === 0 ? 0 : t.dy
|
|
829
829
|
}, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
|
|
830
830
|
key: t,
|
|
831
|
-
"font-weight": e.bold ?
|
|
831
|
+
"font-weight": e.bold ? Qe : void 0,
|
|
832
832
|
"font-style": e.italic ? "italic" : void 0
|
|
833
|
-
}, x(e.text), 9, Z))), 128))], 8,
|
|
833
|
+
}, x(e.text), 9, Z))), 128))], 8, X))), 128))], 8, Ye)
|
|
834
834
|
], 64))), 128))]));
|
|
835
835
|
}
|
|
836
|
-
}),
|
|
837
|
-
function
|
|
838
|
-
let { containerRef: t, measuredWidth: r, measuredHeight: i } =
|
|
836
|
+
}), st = 400, ct = 200;
|
|
837
|
+
function lt(e) {
|
|
838
|
+
let { containerRef: t, measuredWidth: r, measuredHeight: i } = be({ debounce: e.debounce }), { svgRef: a, items: o, downloadLinkText: s, csvHref: c, downloadButtonText: l, triggerCsvDownload: u, resolvedFilename: d, isFullscreen: f, fullscreenStyle: p, teleportTarget: m, exitFullscreen: h } = Ve({
|
|
839
839
|
filename: e.filename,
|
|
840
840
|
legacyMenuLabel: e.menu,
|
|
841
841
|
getCsv: e.getCsv,
|
|
@@ -843,13 +843,13 @@ function st(e) {
|
|
|
843
843
|
downloadButton: e.downloadButton,
|
|
844
844
|
fullscreen: !0,
|
|
845
845
|
fullscreenTarget: e.fullscreenTarget
|
|
846
|
-
}), g = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value ||
|
|
846
|
+
}), g = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value || st)), _ = n(() => {
|
|
847
847
|
if (f.value && i.value > 0) {
|
|
848
848
|
let t = e.extraBelowHeight?.() ?? 0;
|
|
849
849
|
return i.value - t;
|
|
850
850
|
}
|
|
851
|
-
return e.height() ??
|
|
852
|
-
}), { padding: v, legendY: y, inlineLegendLayout: b, innerW: x, innerH: ee, bounds: S } =
|
|
851
|
+
return e.height() ?? ct;
|
|
852
|
+
}), { padding: v, legendY: y, inlineLegendLayout: b, innerW: x, innerH: ee, bounds: S } = Oe({
|
|
853
853
|
title: e.title,
|
|
854
854
|
titleStyle: e.titleStyle,
|
|
855
855
|
xLabel: e.xLabel,
|
|
@@ -858,7 +858,7 @@ function st(e) {
|
|
|
858
858
|
width: () => g.value,
|
|
859
859
|
height: () => _.value,
|
|
860
860
|
extraPadding: e.chartPadding
|
|
861
|
-
}), { hoverIndex: C, tooltipRef: w, tooltipPos: T, handlers: E } =
|
|
861
|
+
}), { hoverIndex: C, tooltipRef: w, tooltipPos: T, handlers: E } = je({
|
|
862
862
|
enabled: e.hasTooltipSlot,
|
|
863
863
|
trigger: e.tooltipTrigger,
|
|
864
864
|
clamp: () => e.tooltipClamp() ?? "chart",
|
|
@@ -895,17 +895,17 @@ function st(e) {
|
|
|
895
895
|
measuredHeight: i
|
|
896
896
|
};
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function ut(e, t) {
|
|
899
899
|
return (n) => {
|
|
900
900
|
let r = e();
|
|
901
901
|
if (r !== void 0) return te(n, r);
|
|
902
902
|
let i = t();
|
|
903
|
-
return i === void 0 ?
|
|
903
|
+
return i === void 0 ? he(n) : te(n, i);
|
|
904
904
|
};
|
|
905
905
|
}
|
|
906
906
|
//#endregion
|
|
907
907
|
//#region src/_shared/contrast.ts
|
|
908
|
-
function
|
|
908
|
+
function dt(e) {
|
|
909
909
|
let t = e.trim();
|
|
910
910
|
if (t.startsWith("#")) {
|
|
911
911
|
let e = t.slice(1);
|
|
@@ -932,201 +932,201 @@ function lt(e) {
|
|
|
932
932
|
}
|
|
933
933
|
return null;
|
|
934
934
|
}
|
|
935
|
-
function
|
|
935
|
+
function ft([e, t, n]) {
|
|
936
936
|
let r = (e) => {
|
|
937
937
|
let t = e / 255;
|
|
938
938
|
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
939
939
|
};
|
|
940
940
|
return .2126 * r(e) + .7152 * r(t) + .0722 * r(n);
|
|
941
941
|
}
|
|
942
|
-
var
|
|
943
|
-
function
|
|
944
|
-
let t =
|
|
942
|
+
var pt = null, mt = /* @__PURE__ */ new Map();
|
|
943
|
+
function ht(e) {
|
|
944
|
+
let t = dt(e);
|
|
945
945
|
if (t) return t;
|
|
946
|
-
if (
|
|
946
|
+
if (mt.has(e)) return mt.get(e) ?? null;
|
|
947
947
|
if (typeof document > "u") return null;
|
|
948
|
-
|
|
949
|
-
let n = getComputedStyle(
|
|
950
|
-
return
|
|
948
|
+
pt || (pt = document.createElement("span"), pt.style.cssText = "position:absolute;width:0;height:0;visibility:hidden;pointer-events:none", document.body.appendChild(pt)), pt.style.color = "", pt.style.color = e;
|
|
949
|
+
let n = getComputedStyle(pt).color, r = dt(n);
|
|
950
|
+
return mt.set(e, r), r;
|
|
951
951
|
}
|
|
952
|
-
function
|
|
953
|
-
let r =
|
|
954
|
-
return r &&
|
|
952
|
+
function gt(e, t = "#ffffff", n = "#1a1a1a") {
|
|
953
|
+
let r = ht(e);
|
|
954
|
+
return r && ft(r) > .179 ? n : t;
|
|
955
955
|
}
|
|
956
956
|
//#endregion
|
|
957
957
|
//#region src/_shared/dateAxis.ts
|
|
958
|
-
var
|
|
958
|
+
var _t = /^(\d{4})-(\d{2})-(\d{2})$/, vt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, Q = 1e3, yt = 60 * Q, bt = 60 * yt, xt = 24 * bt, St = 7 * xt, Ct = 30 * xt, wt = 365 * xt, Tt = [
|
|
959
959
|
{
|
|
960
960
|
unit: "second",
|
|
961
961
|
step: 1,
|
|
962
|
-
ms: 1 *
|
|
962
|
+
ms: 1 * Q
|
|
963
963
|
},
|
|
964
964
|
{
|
|
965
965
|
unit: "second",
|
|
966
966
|
step: 5,
|
|
967
|
-
ms: 5 *
|
|
967
|
+
ms: 5 * Q
|
|
968
968
|
},
|
|
969
969
|
{
|
|
970
970
|
unit: "second",
|
|
971
971
|
step: 15,
|
|
972
|
-
ms: 15 *
|
|
972
|
+
ms: 15 * Q
|
|
973
973
|
},
|
|
974
974
|
{
|
|
975
975
|
unit: "second",
|
|
976
976
|
step: 30,
|
|
977
|
-
ms: 30 *
|
|
977
|
+
ms: 30 * Q
|
|
978
978
|
},
|
|
979
979
|
{
|
|
980
980
|
unit: "minute",
|
|
981
981
|
step: 1,
|
|
982
|
-
ms: 1 *
|
|
982
|
+
ms: 1 * yt
|
|
983
983
|
},
|
|
984
984
|
{
|
|
985
985
|
unit: "minute",
|
|
986
986
|
step: 5,
|
|
987
|
-
ms: 5 *
|
|
987
|
+
ms: 5 * yt
|
|
988
988
|
},
|
|
989
989
|
{
|
|
990
990
|
unit: "minute",
|
|
991
991
|
step: 15,
|
|
992
|
-
ms: 15 *
|
|
992
|
+
ms: 15 * yt
|
|
993
993
|
},
|
|
994
994
|
{
|
|
995
995
|
unit: "minute",
|
|
996
996
|
step: 30,
|
|
997
|
-
ms: 30 *
|
|
997
|
+
ms: 30 * yt
|
|
998
998
|
},
|
|
999
999
|
{
|
|
1000
1000
|
unit: "hour",
|
|
1001
1001
|
step: 1,
|
|
1002
|
-
ms: 1 *
|
|
1002
|
+
ms: 1 * bt
|
|
1003
1003
|
},
|
|
1004
1004
|
{
|
|
1005
1005
|
unit: "hour",
|
|
1006
1006
|
step: 3,
|
|
1007
|
-
ms: 3 *
|
|
1007
|
+
ms: 3 * bt
|
|
1008
1008
|
},
|
|
1009
1009
|
{
|
|
1010
1010
|
unit: "hour",
|
|
1011
1011
|
step: 6,
|
|
1012
|
-
ms: 6 *
|
|
1012
|
+
ms: 6 * bt
|
|
1013
1013
|
},
|
|
1014
1014
|
{
|
|
1015
1015
|
unit: "hour",
|
|
1016
1016
|
step: 12,
|
|
1017
|
-
ms: 12 *
|
|
1017
|
+
ms: 12 * bt
|
|
1018
1018
|
},
|
|
1019
1019
|
{
|
|
1020
1020
|
unit: "day",
|
|
1021
1021
|
step: 1,
|
|
1022
|
-
ms: 1 *
|
|
1022
|
+
ms: 1 * xt
|
|
1023
1023
|
},
|
|
1024
1024
|
{
|
|
1025
1025
|
unit: "day",
|
|
1026
1026
|
step: 2,
|
|
1027
|
-
ms: 2 *
|
|
1027
|
+
ms: 2 * xt
|
|
1028
1028
|
},
|
|
1029
1029
|
{
|
|
1030
1030
|
unit: "week",
|
|
1031
1031
|
step: 1,
|
|
1032
|
-
ms: 1 *
|
|
1032
|
+
ms: 1 * St
|
|
1033
1033
|
},
|
|
1034
1034
|
{
|
|
1035
1035
|
unit: "month",
|
|
1036
1036
|
step: 1,
|
|
1037
|
-
ms: 1 *
|
|
1037
|
+
ms: 1 * Ct
|
|
1038
1038
|
},
|
|
1039
1039
|
{
|
|
1040
1040
|
unit: "month",
|
|
1041
1041
|
step: 3,
|
|
1042
|
-
ms: 3 *
|
|
1042
|
+
ms: 3 * Ct
|
|
1043
1043
|
},
|
|
1044
1044
|
{
|
|
1045
1045
|
unit: "month",
|
|
1046
1046
|
step: 6,
|
|
1047
|
-
ms: 6 *
|
|
1047
|
+
ms: 6 * Ct
|
|
1048
1048
|
},
|
|
1049
1049
|
{
|
|
1050
1050
|
unit: "year",
|
|
1051
1051
|
step: 1,
|
|
1052
|
-
ms: 1 *
|
|
1052
|
+
ms: 1 * wt
|
|
1053
1053
|
},
|
|
1054
1054
|
{
|
|
1055
1055
|
unit: "year",
|
|
1056
1056
|
step: 2,
|
|
1057
|
-
ms: 2 *
|
|
1057
|
+
ms: 2 * wt
|
|
1058
1058
|
},
|
|
1059
1059
|
{
|
|
1060
1060
|
unit: "year",
|
|
1061
1061
|
step: 5,
|
|
1062
|
-
ms: 5 *
|
|
1062
|
+
ms: 5 * wt
|
|
1063
1063
|
},
|
|
1064
1064
|
{
|
|
1065
1065
|
unit: "year",
|
|
1066
1066
|
step: 10,
|
|
1067
|
-
ms: 10 *
|
|
1067
|
+
ms: 10 * wt
|
|
1068
1068
|
},
|
|
1069
1069
|
{
|
|
1070
1070
|
unit: "year",
|
|
1071
1071
|
step: 25,
|
|
1072
|
-
ms: 25 *
|
|
1072
|
+
ms: 25 * wt
|
|
1073
1073
|
},
|
|
1074
1074
|
{
|
|
1075
1075
|
unit: "year",
|
|
1076
1076
|
step: 50,
|
|
1077
|
-
ms: 50 *
|
|
1077
|
+
ms: 50 * wt
|
|
1078
1078
|
},
|
|
1079
1079
|
{
|
|
1080
1080
|
unit: "year",
|
|
1081
1081
|
step: 100,
|
|
1082
|
-
ms: 100 *
|
|
1082
|
+
ms: 100 * wt
|
|
1083
1083
|
}
|
|
1084
|
-
],
|
|
1085
|
-
function
|
|
1084
|
+
], Et = 1e3;
|
|
1085
|
+
function Dt(e, t) {
|
|
1086
1086
|
if (e instanceof Date) {
|
|
1087
1087
|
let t = e.getTime();
|
|
1088
1088
|
return Number.isFinite(t) ? t : null;
|
|
1089
1089
|
}
|
|
1090
1090
|
if (typeof e != "string") return null;
|
|
1091
|
-
let n =
|
|
1091
|
+
let n = _t.exec(e);
|
|
1092
1092
|
if (n) {
|
|
1093
1093
|
let e = +n[1], r = n[2] - 1, i = +n[3];
|
|
1094
1094
|
return t === "utc" ? Date.UTC(e, r, i) : new Date(e, r, i).getTime();
|
|
1095
1095
|
}
|
|
1096
|
-
let r =
|
|
1096
|
+
let r = vt.exec(e);
|
|
1097
1097
|
if (r) {
|
|
1098
1098
|
let e = +r[1], n = r[2] - 1, i = +r[3], a = +r[4], o = +r[5], s = r[6] ? +r[6] : 0, c = r[7] ? Number("0." + r[7]) * 1e3 : 0, l = r[8];
|
|
1099
1099
|
if (l) {
|
|
1100
1100
|
if (l === "Z" || l === "z") return Date.UTC(e, n, i, a, o, s, c);
|
|
1101
|
-
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) *
|
|
1101
|
+
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * yt;
|
|
1102
1102
|
return Date.UTC(e, n, i, a, o, s, c) - d;
|
|
1103
1103
|
}
|
|
1104
1104
|
return t === "utc" ? Date.UTC(e, n, i, a, o, s, c) : new Date(e, n, i, a, o, s, c).getTime();
|
|
1105
1105
|
}
|
|
1106
1106
|
return null;
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1109
|
-
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ?
|
|
1108
|
+
function Ot(e) {
|
|
1109
|
+
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? _t.test(e) || vt.test(e) : !1;
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function kt(e, t) {
|
|
1112
1112
|
if (e.length === 0) return !1;
|
|
1113
1113
|
for (let n = 0; n < e.length; n++) {
|
|
1114
1114
|
let r = e[n];
|
|
1115
|
-
if (!
|
|
1115
|
+
if (!Ot(r) || Dt(r, t) === null) return !1;
|
|
1116
1116
|
}
|
|
1117
1117
|
return !0;
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function At(e, t) {
|
|
1120
1120
|
let n = e / Math.max(1, t);
|
|
1121
|
-
for (let e of
|
|
1122
|
-
return
|
|
1121
|
+
for (let e of Tt) if (n <= e.ms) return e;
|
|
1122
|
+
return Tt[Tt.length - 1];
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function jt(e, t, n) {
|
|
1125
1125
|
let r = new Date(e);
|
|
1126
1126
|
if (n === "utc") switch (t) {
|
|
1127
|
-
case "second": return Math.floor(e /
|
|
1128
|
-
case "minute": return Math.floor(e /
|
|
1129
|
-
case "hour": return Math.floor(e /
|
|
1127
|
+
case "second": return Math.floor(e / Q) * Q;
|
|
1128
|
+
case "minute": return Math.floor(e / yt) * yt;
|
|
1129
|
+
case "hour": return Math.floor(e / bt) * bt;
|
|
1130
1130
|
case "day": return Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate());
|
|
1131
1131
|
case "week": {
|
|
1132
1132
|
let e = (r.getUTCDay() + 6) % 7;
|
|
@@ -1136,8 +1136,8 @@ function At(e, t, n) {
|
|
|
1136
1136
|
case "year": return Date.UTC(r.getUTCFullYear(), 0, 1);
|
|
1137
1137
|
}
|
|
1138
1138
|
switch (t) {
|
|
1139
|
-
case "second": return Math.floor(e /
|
|
1140
|
-
case "minute": return Math.floor(e /
|
|
1139
|
+
case "second": return Math.floor(e / Q) * Q;
|
|
1140
|
+
case "minute": return Math.floor(e / yt) * yt;
|
|
1141
1141
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
|
|
1142
1142
|
case "day": return new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime();
|
|
1143
1143
|
case "week": {
|
|
@@ -1148,11 +1148,11 @@ function At(e, t, n) {
|
|
|
1148
1148
|
case "year": return new Date(r.getFullYear(), 0, 1).getTime();
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1152
|
-
if (t === "second") return e + n *
|
|
1153
|
-
if (t === "minute") return e + n *
|
|
1154
|
-
if (t === "hour" && r === "utc") return e + n *
|
|
1155
|
-
if (t === "week" && r === "utc") return e + n *
|
|
1151
|
+
function Mt(e, t, n, r) {
|
|
1152
|
+
if (t === "second") return e + n * Q;
|
|
1153
|
+
if (t === "minute") return e + n * yt;
|
|
1154
|
+
if (t === "hour" && r === "utc") return e + n * bt;
|
|
1155
|
+
if (t === "week" && r === "utc") return e + n * St;
|
|
1156
1156
|
let i = new Date(e);
|
|
1157
1157
|
if (r === "utc") switch (t) {
|
|
1158
1158
|
case "day": return Date.UTC(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate() + n, i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds());
|
|
@@ -1168,21 +1168,21 @@ function jt(e, t, n, r) {
|
|
|
1168
1168
|
}
|
|
1169
1169
|
return e;
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function Nt(e, t, n, r) {
|
|
1172
1172
|
if (!Number.isFinite(e) || !Number.isFinite(t) || e >= t || n < 1) return {
|
|
1173
1173
|
values: [],
|
|
1174
1174
|
unit: "day"
|
|
1175
1175
|
};
|
|
1176
|
-
let { unit: i, step: a } =
|
|
1177
|
-
for (; o < e && s <
|
|
1176
|
+
let { unit: i, step: a } = At(t - e, n), o = jt(e, i, r), s = 0;
|
|
1177
|
+
for (; o < e && s < Et;) o = Mt(o, i, a, r), s++;
|
|
1178
1178
|
let c = [];
|
|
1179
|
-
for (let e = 0; e <
|
|
1179
|
+
for (let e = 0; e < Et && o <= t; e++) c.push(o), o = Mt(o, i, a, r);
|
|
1180
1180
|
return {
|
|
1181
1181
|
values: c,
|
|
1182
1182
|
unit: i
|
|
1183
1183
|
};
|
|
1184
1184
|
}
|
|
1185
|
-
var
|
|
1185
|
+
var Pt = {
|
|
1186
1186
|
iso: {
|
|
1187
1187
|
year: "numeric",
|
|
1188
1188
|
month: "2-digit",
|
|
@@ -1220,7 +1220,7 @@ var Nt = {
|
|
|
1220
1220
|
hourCycle: "h23"
|
|
1221
1221
|
},
|
|
1222
1222
|
medium: { dateStyle: "medium" }
|
|
1223
|
-
},
|
|
1223
|
+
}, Ft = {
|
|
1224
1224
|
year: "year",
|
|
1225
1225
|
month: "month-year",
|
|
1226
1226
|
week: "month-day",
|
|
@@ -1232,27 +1232,27 @@ var Nt = {
|
|
|
1232
1232
|
function $(e) {
|
|
1233
1233
|
return e < 10 ? "0" + e : String(e);
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function It(e, t) {
|
|
1236
1236
|
let n = new Date(e);
|
|
1237
1237
|
return t === "utc" ? `${n.getUTCFullYear()}-${$(n.getUTCMonth() + 1)}-${$(n.getUTCDate())}` : `${n.getFullYear()}-${$(n.getMonth() + 1)}-${$(n.getDate())}`;
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function Lt(e, t) {
|
|
1240
1240
|
let n = new Date(e);
|
|
1241
1241
|
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())}`;
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1244
|
-
return e in
|
|
1243
|
+
function Rt(e) {
|
|
1244
|
+
return e in Pt;
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1246
|
+
function zt(e, t, n, r) {
|
|
1247
1247
|
if (typeof t == "function") return t(e, r);
|
|
1248
1248
|
let i = null, a;
|
|
1249
|
-
if (t === void 0) i = r ?
|
|
1249
|
+
if (t === void 0) i = r ? Ft[r] : "iso", a = Pt[i];
|
|
1250
1250
|
else if (typeof t == "string") {
|
|
1251
|
-
if (!
|
|
1252
|
-
i = t, a =
|
|
1251
|
+
if (!Rt(t)) throw Error(`Unknown date format preset: "${t}"`);
|
|
1252
|
+
i = t, a = Pt[i];
|
|
1253
1253
|
} else a = t;
|
|
1254
|
-
if (i === "iso") return
|
|
1255
|
-
if (i === "iso-datetime") return
|
|
1254
|
+
if (i === "iso") return It(e, n);
|
|
1255
|
+
if (i === "iso-datetime") return Lt(e, n);
|
|
1256
1256
|
let o = n === "utc" ? {
|
|
1257
1257
|
...a,
|
|
1258
1258
|
timeZone: "UTC"
|
|
@@ -1261,40 +1261,35 @@ function Rt(e, t, n, r) {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
//#endregion
|
|
1263
1263
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
1264
|
-
var
|
|
1264
|
+
var Bt = {
|
|
1265
1265
|
class: "chart-sr-only",
|
|
1266
1266
|
"aria-live": "polite"
|
|
1267
|
-
},
|
|
1267
|
+
}, Vt = ["width", "height"], Ht = [
|
|
1268
1268
|
"x",
|
|
1269
1269
|
"y",
|
|
1270
1270
|
"text-anchor",
|
|
1271
1271
|
"font-size",
|
|
1272
1272
|
"font-weight",
|
|
1273
1273
|
"fill"
|
|
1274
|
-
],
|
|
1274
|
+
], Ut = ["x", "dy"], Wt = { key: 1 }, Gt = [
|
|
1275
1275
|
"x1",
|
|
1276
1276
|
"y1",
|
|
1277
1277
|
"x2",
|
|
1278
1278
|
"y2",
|
|
1279
1279
|
"stroke",
|
|
1280
1280
|
"stroke-dasharray"
|
|
1281
|
-
],
|
|
1281
|
+
], Kt = [
|
|
1282
1282
|
"cx",
|
|
1283
1283
|
"cy",
|
|
1284
1284
|
"fill",
|
|
1285
1285
|
"fill-opacity",
|
|
1286
1286
|
"stroke"
|
|
1287
|
-
],
|
|
1287
|
+
], qt = [
|
|
1288
1288
|
"x",
|
|
1289
1289
|
"y",
|
|
1290
1290
|
"font-size",
|
|
1291
1291
|
"fill",
|
|
1292
1292
|
"font-weight"
|
|
1293
|
-
], qt = [
|
|
1294
|
-
"x1",
|
|
1295
|
-
"y1",
|
|
1296
|
-
"x2",
|
|
1297
|
-
"y2"
|
|
1298
1293
|
], Jt = [
|
|
1299
1294
|
"x1",
|
|
1300
1295
|
"y1",
|
|
@@ -1311,18 +1306,23 @@ var zt = {
|
|
|
1311
1306
|
"x2",
|
|
1312
1307
|
"y2"
|
|
1313
1308
|
], Zt = [
|
|
1309
|
+
"x1",
|
|
1310
|
+
"y1",
|
|
1311
|
+
"x2",
|
|
1312
|
+
"y2"
|
|
1313
|
+
], Qt = [
|
|
1314
1314
|
"x",
|
|
1315
1315
|
"y",
|
|
1316
1316
|
"font-size",
|
|
1317
1317
|
"fill",
|
|
1318
1318
|
"font-weight",
|
|
1319
1319
|
"fill-opacity"
|
|
1320
|
-
],
|
|
1320
|
+
], $t = [
|
|
1321
1321
|
"transform",
|
|
1322
1322
|
"font-size",
|
|
1323
1323
|
"fill",
|
|
1324
1324
|
"font-weight"
|
|
1325
|
-
],
|
|
1325
|
+
], en = [
|
|
1326
1326
|
"x",
|
|
1327
1327
|
"y",
|
|
1328
1328
|
"text-anchor",
|
|
@@ -1330,43 +1330,43 @@ var zt = {
|
|
|
1330
1330
|
"fill",
|
|
1331
1331
|
"font-weight",
|
|
1332
1332
|
"fill-opacity"
|
|
1333
|
-
],
|
|
1333
|
+
], tn = [
|
|
1334
1334
|
"x",
|
|
1335
1335
|
"y",
|
|
1336
1336
|
"font-size",
|
|
1337
1337
|
"fill",
|
|
1338
1338
|
"font-weight"
|
|
1339
|
-
],
|
|
1339
|
+
], nn = [
|
|
1340
1340
|
"d",
|
|
1341
1341
|
"fill",
|
|
1342
1342
|
"fill-opacity"
|
|
1343
|
-
],
|
|
1343
|
+
], rn = [
|
|
1344
1344
|
"d",
|
|
1345
1345
|
"stroke",
|
|
1346
1346
|
"stroke-width"
|
|
1347
|
-
],
|
|
1347
|
+
], an = [
|
|
1348
1348
|
"d",
|
|
1349
1349
|
"stroke",
|
|
1350
1350
|
"stroke-width",
|
|
1351
1351
|
"stroke-opacity",
|
|
1352
1352
|
"stroke-dasharray"
|
|
1353
|
-
],
|
|
1353
|
+
], on = [
|
|
1354
1354
|
"cx",
|
|
1355
1355
|
"cy",
|
|
1356
1356
|
"r",
|
|
1357
1357
|
"fill",
|
|
1358
1358
|
"fill-opacity",
|
|
1359
1359
|
"stroke"
|
|
1360
|
-
],
|
|
1360
|
+
], sn = [
|
|
1361
1361
|
"d",
|
|
1362
1362
|
"fill",
|
|
1363
1363
|
"fill-opacity"
|
|
1364
|
-
],
|
|
1364
|
+
], cn = [
|
|
1365
1365
|
"d",
|
|
1366
1366
|
"stroke",
|
|
1367
1367
|
"stroke-width",
|
|
1368
1368
|
"stroke-dasharray"
|
|
1369
|
-
],
|
|
1369
|
+
], ln = [
|
|
1370
1370
|
"x1",
|
|
1371
1371
|
"y1",
|
|
1372
1372
|
"x2",
|
|
@@ -1374,7 +1374,7 @@ var zt = {
|
|
|
1374
1374
|
"stroke",
|
|
1375
1375
|
"stroke-width",
|
|
1376
1376
|
"stroke-dasharray"
|
|
1377
|
-
],
|
|
1377
|
+
], un = [
|
|
1378
1378
|
"x1",
|
|
1379
1379
|
"y1",
|
|
1380
1380
|
"x2",
|
|
@@ -1382,53 +1382,53 @@ var zt = {
|
|
|
1382
1382
|
"stroke",
|
|
1383
1383
|
"stroke-width",
|
|
1384
1384
|
"stroke-dasharray"
|
|
1385
|
-
],
|
|
1385
|
+
], dn = [
|
|
1386
1386
|
"x1",
|
|
1387
1387
|
"y1",
|
|
1388
1388
|
"x2",
|
|
1389
1389
|
"y2"
|
|
1390
|
-
],
|
|
1390
|
+
], fn = [
|
|
1391
1391
|
"x1",
|
|
1392
1392
|
"y1",
|
|
1393
1393
|
"x2",
|
|
1394
1394
|
"y2"
|
|
1395
|
-
],
|
|
1395
|
+
], pn = [
|
|
1396
1396
|
"x1",
|
|
1397
1397
|
"y1",
|
|
1398
1398
|
"x2",
|
|
1399
1399
|
"y2"
|
|
1400
|
-
],
|
|
1400
|
+
], mn = [
|
|
1401
1401
|
"cx",
|
|
1402
1402
|
"cy",
|
|
1403
1403
|
"fill"
|
|
1404
|
-
],
|
|
1404
|
+
], hn = [
|
|
1405
1405
|
"x",
|
|
1406
1406
|
"y",
|
|
1407
1407
|
"width",
|
|
1408
1408
|
"height"
|
|
1409
|
-
],
|
|
1409
|
+
], gn = [
|
|
1410
1410
|
"cx",
|
|
1411
1411
|
"cy",
|
|
1412
1412
|
"fill",
|
|
1413
1413
|
"fill-opacity",
|
|
1414
1414
|
"stroke"
|
|
1415
|
-
],
|
|
1415
|
+
], _n = [
|
|
1416
1416
|
"x",
|
|
1417
1417
|
"y",
|
|
1418
1418
|
"font-size",
|
|
1419
1419
|
"font-weight",
|
|
1420
1420
|
"fill"
|
|
1421
|
-
],
|
|
1421
|
+
], vn = [
|
|
1422
1422
|
"x",
|
|
1423
1423
|
"y",
|
|
1424
1424
|
"font-size",
|
|
1425
1425
|
"font-weight",
|
|
1426
1426
|
"fill",
|
|
1427
1427
|
"fill-opacity"
|
|
1428
|
-
],
|
|
1428
|
+
], yn = { class: "line-chart-tooltip" }, bn = {
|
|
1429
1429
|
key: 0,
|
|
1430
1430
|
class: "line-chart-tooltip-label"
|
|
1431
|
-
},
|
|
1431
|
+
}, xn = ["href", "download"], Sn = 36, Cn = 12, wn = 7, Tn = 16, En = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
1432
1432
|
inheritAttrs: !1,
|
|
1433
1433
|
__name: "LineChart",
|
|
1434
1434
|
props: {
|
|
@@ -1487,13 +1487,13 @@ var zt = {
|
|
|
1487
1487
|
if (!e) return;
|
|
1488
1488
|
if (!t) return e;
|
|
1489
1489
|
let r = new Float64Array(e.length);
|
|
1490
|
-
for (let t = 0; t < e.length; t++) r[t] =
|
|
1490
|
+
for (let t = 0; t < e.length; t++) r[t] = Dt(e[t], n) ?? NaN;
|
|
1491
1491
|
return r;
|
|
1492
1492
|
}
|
|
1493
|
-
let w =
|
|
1493
|
+
let w = ut(() => f.tooltipValueFormat, () => f.yTickFormat), T = n(() => f.timezone ?? "utc"), E = n(() => {
|
|
1494
1494
|
let e = T.value, t = !1, n = !1;
|
|
1495
1495
|
for (let r of v(f)) {
|
|
1496
|
-
if (n = !0, !
|
|
1496
|
+
if (n = !0, !kt(r, e)) {
|
|
1497
1497
|
t = !1;
|
|
1498
1498
|
break;
|
|
1499
1499
|
}
|
|
@@ -1519,28 +1519,28 @@ var zt = {
|
|
|
1519
1519
|
series: r,
|
|
1520
1520
|
areas: i
|
|
1521
1521
|
};
|
|
1522
|
-
}), D = n(() => E.value.isDate), O = n(() => E.value.series), k = n(() => E.value.areas),
|
|
1522
|
+
}), D = n(() => E.value.isDate), O = n(() => E.value.series), k = n(() => E.value.areas), A = n(() => {
|
|
1523
1523
|
let e = 0;
|
|
1524
1524
|
for (let t of O.value) t.data.length > e && (e = t.data.length);
|
|
1525
1525
|
for (let t of k.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
|
|
1526
1526
|
return e;
|
|
1527
|
-
}),
|
|
1528
|
-
function
|
|
1527
|
+
}), j = n(() => O.value.some((e) => e.x != null) || k.value.some((e) => e.x != null));
|
|
1528
|
+
function M(e, t) {
|
|
1529
1529
|
return e.x ? Number(e.x[t]) : t;
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1531
|
+
function N(e, t) {
|
|
1532
1532
|
return e.x ? Number(e.x[t]) : t;
|
|
1533
1533
|
}
|
|
1534
|
-
let
|
|
1534
|
+
let ne = n(() => j.value ? 0 : f.xMin ?? 0), re = n(() => {
|
|
1535
1535
|
let e = Infinity, t = -Infinity;
|
|
1536
1536
|
for (let n of O.value) for (let r = 0; r < n.data.length; r++) {
|
|
1537
|
-
let i =
|
|
1537
|
+
let i = M(n, r);
|
|
1538
1538
|
isFinite(i) && (i < e && (e = i), i > t && (t = i));
|
|
1539
1539
|
}
|
|
1540
1540
|
for (let n of k.value) {
|
|
1541
1541
|
let r = Math.max(n.upper.length, n.lower.length);
|
|
1542
1542
|
for (let i = 0; i < r; i++) {
|
|
1543
|
-
let r =
|
|
1543
|
+
let r = N(n, i);
|
|
1544
1544
|
isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
@@ -1552,11 +1552,11 @@ var zt = {
|
|
|
1552
1552
|
max: 0
|
|
1553
1553
|
};
|
|
1554
1554
|
});
|
|
1555
|
-
function
|
|
1556
|
-
let { min: t, max: n } =
|
|
1555
|
+
function P(e) {
|
|
1556
|
+
let { min: t, max: n } = re.value, r = n - t || 1;
|
|
1557
1557
|
return U.value.left + (e - t) / r * G.value;
|
|
1558
1558
|
}
|
|
1559
|
-
let
|
|
1559
|
+
let ie = n(() => {
|
|
1560
1560
|
let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
|
|
1561
1561
|
isFinite(r) && (r < e && (e = r), r > t && (t = r), r > 0 && r < n && (n = r));
|
|
1562
1562
|
};
|
|
@@ -1571,77 +1571,77 @@ var zt = {
|
|
|
1571
1571
|
range: 1
|
|
1572
1572
|
};
|
|
1573
1573
|
f.yMin != null && f.yMin < e && (e = f.yMin);
|
|
1574
|
-
let i =
|
|
1574
|
+
let i = ve(e, t, f.yScaleType, n);
|
|
1575
1575
|
return {
|
|
1576
1576
|
min: i.min,
|
|
1577
1577
|
max: i.max,
|
|
1578
1578
|
range: i.max - i.min || 1
|
|
1579
1579
|
};
|
|
1580
1580
|
});
|
|
1581
|
-
function
|
|
1582
|
-
let { min: t, max: n } =
|
|
1583
|
-
return U.value.top + K.value -
|
|
1581
|
+
function F(e) {
|
|
1582
|
+
let { min: t, max: n } = ie.value;
|
|
1583
|
+
return U.value.top + K.value - _e(e, t, n, f.yScaleType) * K.value;
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1585
|
+
function ae(e) {
|
|
1586
1586
|
let t = e.data;
|
|
1587
1587
|
if (t.length === 0) return "";
|
|
1588
1588
|
let n = "", r = !1;
|
|
1589
1589
|
for (let i = 0; i < t.length; i++) {
|
|
1590
|
-
let a =
|
|
1590
|
+
let a = M(e, i);
|
|
1591
1591
|
if (!isFinite(t[i]) || !isFinite(a)) {
|
|
1592
1592
|
r = !1;
|
|
1593
1593
|
continue;
|
|
1594
1594
|
}
|
|
1595
|
-
let o =
|
|
1595
|
+
let o = P(a), s = F(t[i]);
|
|
1596
1596
|
n += r ? `L${o},${s}` : `M${o},${s}`, r = !0;
|
|
1597
1597
|
}
|
|
1598
1598
|
return n;
|
|
1599
1599
|
}
|
|
1600
|
-
function
|
|
1600
|
+
function oe(e) {
|
|
1601
1601
|
let t = e.data, n = [];
|
|
1602
1602
|
for (let r = 0; r < t.length; r++) {
|
|
1603
|
-
let i =
|
|
1603
|
+
let i = M(e, r);
|
|
1604
1604
|
!isFinite(t[r]) || !isFinite(i) || n.push({
|
|
1605
|
-
x:
|
|
1606
|
-
y:
|
|
1605
|
+
x: P(i),
|
|
1606
|
+
y: F(t[r])
|
|
1607
1607
|
});
|
|
1608
1608
|
}
|
|
1609
1609
|
return n;
|
|
1610
1610
|
}
|
|
1611
|
-
function
|
|
1611
|
+
function se(e) {
|
|
1612
1612
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
1613
1613
|
if (t === 0) return "";
|
|
1614
1614
|
let n = [], r = [];
|
|
1615
|
-
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(
|
|
1615
|
+
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(N(e, i)) ? r.push(i) : r.length && (n.push(r), r = []);
|
|
1616
1616
|
r.length && n.push(r);
|
|
1617
1617
|
let i = "";
|
|
1618
1618
|
for (let t of n) {
|
|
1619
|
-
i += `M${N(
|
|
1620
|
-
for (let n = 1; n < t.length; n++) i += `L${N(
|
|
1621
|
-
for (let n = t.length - 1; n >= 0; n--) i += `L${N(
|
|
1619
|
+
i += `M${P(N(e, t[0]))},${F(e.upper[t[0]])}`;
|
|
1620
|
+
for (let n = 1; n < t.length; n++) i += `L${P(N(e, t[n]))},${F(e.upper[t[n]])}`;
|
|
1621
|
+
for (let n = t.length - 1; n >= 0; n--) i += `L${P(N(e, t[n]))},${F(e.lower[t[n]])}`;
|
|
1622
1622
|
i += "Z";
|
|
1623
1623
|
}
|
|
1624
1624
|
return i;
|
|
1625
1625
|
}
|
|
1626
|
-
function
|
|
1626
|
+
function I(e, t) {
|
|
1627
1627
|
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && O.value[e.seriesIndex] || O.value[0];
|
|
1628
|
-
return
|
|
1628
|
+
return P(r ? M(r, n) : n);
|
|
1629
1629
|
}
|
|
1630
|
-
function
|
|
1630
|
+
function ce(e, t = !0) {
|
|
1631
1631
|
let n = U.value.top + K.value;
|
|
1632
1632
|
if (e.seriesIndex == null) {
|
|
1633
|
-
let t =
|
|
1633
|
+
let t = I(e, "start"), r = I(e, "end");
|
|
1634
1634
|
return t > r ? "" : `M${t},${U.value.top}L${r},${U.value.top}L${r},${n}L${t},${n}Z`;
|
|
1635
1635
|
}
|
|
1636
1636
|
let r = O.value[e.seriesIndex];
|
|
1637
1637
|
if (!r) return "";
|
|
1638
1638
|
let i = Math.max(0, e.startIndex), a = Math.min(r.data.length - 1, e.endIndex);
|
|
1639
1639
|
if (i > a) return "";
|
|
1640
|
-
let o = `M${
|
|
1641
|
-
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${
|
|
1642
|
-
return t && (o += `L${
|
|
1640
|
+
let o = `M${P(M(r, i))},${F(r.data[i])}`;
|
|
1641
|
+
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${P(M(r, e))},${F(r.data[e])}`);
|
|
1642
|
+
return t && (o += `L${P(M(r, a))},${n}`, o += `L${P(M(r, i))},${n}`, o += "Z"), o;
|
|
1643
1643
|
}
|
|
1644
|
-
let
|
|
1644
|
+
let le = n(() => {
|
|
1645
1645
|
let e = f.areaSections;
|
|
1646
1646
|
if (!e?.length) return {
|
|
1647
1647
|
labels: [],
|
|
@@ -1650,11 +1650,11 @@ var zt = {
|
|
|
1650
1650
|
let t = [], n = U.value.left + G.value;
|
|
1651
1651
|
for (let r of e) {
|
|
1652
1652
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
1653
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) *
|
|
1653
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * wn, o = I(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : O.value[r.seriesIndex]?.color ?? "currentColor"), u = Se({
|
|
1654
1654
|
color: l,
|
|
1655
1655
|
fontWeight: 600,
|
|
1656
1656
|
...r.inlineLabelStyle
|
|
1657
|
-
}, { fontSize: 11 }), d =
|
|
1657
|
+
}, { fontSize: 11 }), d = Se(r.inlineDescriptionStyle, {
|
|
1658
1658
|
fontSize: 11,
|
|
1659
1659
|
fillOpacity: .6
|
|
1660
1660
|
});
|
|
@@ -1674,7 +1674,7 @@ var zt = {
|
|
|
1674
1674
|
let r = [];
|
|
1675
1675
|
for (let e of t) {
|
|
1676
1676
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
1677
|
-
for (; n < r.length && !(t >= r[n] +
|
|
1677
|
+
for (; n < r.length && !(t >= r[n] + Tn);) n++;
|
|
1678
1678
|
e.row = n;
|
|
1679
1679
|
let i = e.cx + e.textWidth / 2;
|
|
1680
1680
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -1684,9 +1684,9 @@ var zt = {
|
|
|
1684
1684
|
extraHeight: 0
|
|
1685
1685
|
} : {
|
|
1686
1686
|
labels: t,
|
|
1687
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
1687
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Sn + Cn
|
|
1688
1688
|
};
|
|
1689
|
-
}),
|
|
1689
|
+
}), ue = n(() => {
|
|
1690
1690
|
let e = [];
|
|
1691
1691
|
for (let t of O.value) !t.legend || t.showInLegend === !1 || e.push({
|
|
1692
1692
|
label: t.legend,
|
|
@@ -1706,47 +1706,47 @@ var zt = {
|
|
|
1706
1706
|
});
|
|
1707
1707
|
}
|
|
1708
1708
|
return e;
|
|
1709
|
-
}),
|
|
1710
|
-
let { min: e, max: t } =
|
|
1709
|
+
}), de = n(() => ue.value.map((e) => e.label)), fe = n(() => Me.value + le.value.extraHeight), L = n(() => U.value.top + K.value + U.value.bottom + Cn), z = n(() => {
|
|
1710
|
+
let { min: e, max: t } = ie.value, n = (e) => f.yTickFormat === void 0 ? he(e) : te(e, f.yTickFormat);
|
|
1711
1711
|
return e === t ? [{
|
|
1712
1712
|
value: n(e),
|
|
1713
1713
|
y: R(U.value.top + K.value / 2)
|
|
1714
|
-
}] : (f.yScaleType === "log" ?
|
|
1714
|
+
}] : (f.yScaleType === "log" ? ye({
|
|
1715
1715
|
min: e,
|
|
1716
1716
|
max: t,
|
|
1717
1717
|
ticks: f.yTicks
|
|
1718
|
-
}) :
|
|
1718
|
+
}) : ge({
|
|
1719
1719
|
min: e,
|
|
1720
1720
|
max: t,
|
|
1721
1721
|
ticks: f.yTicks,
|
|
1722
1722
|
targetTickCount: K.value / 50
|
|
1723
1723
|
})).map((e) => ({
|
|
1724
1724
|
value: n(e),
|
|
1725
|
-
y: R(
|
|
1725
|
+
y: R(F(e))
|
|
1726
1726
|
}));
|
|
1727
1727
|
});
|
|
1728
|
-
function
|
|
1728
|
+
function B(e, t, n) {
|
|
1729
1729
|
let r = f.xTickFormat;
|
|
1730
|
-
if (D.value) return typeof r == "function" ? r(e, t) :
|
|
1731
|
-
let i = e +
|
|
1732
|
-
return r === void 0 ? !
|
|
1730
|
+
if (D.value) return typeof r == "function" ? r(e, t) : zt(e, r, T.value, n);
|
|
1731
|
+
let i = e + ne.value;
|
|
1732
|
+
return r === void 0 ? !j.value && f.xLabels && Number.isInteger(e) && e >= 0 && e < f.xLabels.length ? f.xLabels[e] : he(i) : typeof r == "function" ? r(i, t) : te(i, r);
|
|
1733
1733
|
}
|
|
1734
|
-
let
|
|
1735
|
-
let { min: e, max: t } =
|
|
1734
|
+
let me = n(() => {
|
|
1735
|
+
let { min: e, max: t } = re.value;
|
|
1736
1736
|
if (e === t) return [];
|
|
1737
|
-
let n = D.value, r = n ? 0 :
|
|
1737
|
+
let n = D.value, r = n ? 0 : ne.value, i = A.value, a = G.value / 80, o, s;
|
|
1738
1738
|
if (n) {
|
|
1739
|
-
let n =
|
|
1740
|
-
s = n.unit, o =
|
|
1739
|
+
let n = Nt(e, t, a, T.value);
|
|
1740
|
+
s = n.unit, o = ge({
|
|
1741
1741
|
min: e,
|
|
1742
1742
|
max: t,
|
|
1743
1743
|
ticks: n.values
|
|
1744
1744
|
});
|
|
1745
|
-
} else if (f.xTicks == null && !
|
|
1745
|
+
} else if (f.xTicks == null && !j.value && f.xLabels && f.xLabels.length === i) {
|
|
1746
1746
|
let e = Math.max(3, Math.floor(a)), t = Math.max(1, Math.round((i - 1) / e));
|
|
1747
1747
|
o = [];
|
|
1748
1748
|
for (let e = 0; e < i; e += t) o.push(e);
|
|
1749
|
-
} else o =
|
|
1749
|
+
} else o = ge({
|
|
1750
1750
|
min: e,
|
|
1751
1751
|
max: t,
|
|
1752
1752
|
ticks: f.xTicks,
|
|
@@ -1755,27 +1755,27 @@ var zt = {
|
|
|
1755
1755
|
});
|
|
1756
1756
|
let c = U.value.left, l = U.value.left + G.value;
|
|
1757
1757
|
return o.map((e, t) => {
|
|
1758
|
-
let n = R(
|
|
1758
|
+
let n = R(P(e)), r = "middle";
|
|
1759
1759
|
return n - c <= 1 ? r = "start" : l - n <= 1 && (r = "end"), {
|
|
1760
|
-
value:
|
|
1760
|
+
value: B(e, t, s),
|
|
1761
1761
|
x: n,
|
|
1762
1762
|
anchor: r
|
|
1763
1763
|
};
|
|
1764
1764
|
});
|
|
1765
1765
|
});
|
|
1766
1766
|
function be() {
|
|
1767
|
-
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv :
|
|
1767
|
+
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv : He(O.value);
|
|
1768
1768
|
}
|
|
1769
|
-
let
|
|
1770
|
-
let e =
|
|
1771
|
-
return e === null || !t ? null :
|
|
1772
|
-
}), we = n(() => Ce.value === null ? 0 :
|
|
1769
|
+
let xe = n(() => !!f.tooltipData || !!f.tooltipTrigger), Ce = n(() => {
|
|
1770
|
+
let e = Fe.value, t = O.value[0];
|
|
1771
|
+
return e === null || !t ? null : M(t, e);
|
|
1772
|
+
}), we = n(() => Ce.value === null ? 0 : P(Ce.value));
|
|
1773
1773
|
function Te(e, t) {
|
|
1774
1774
|
let n = e.data.length;
|
|
1775
1775
|
if (n === 0) return null;
|
|
1776
1776
|
let r = 0, i = Infinity;
|
|
1777
1777
|
for (let a = 0; a < n; a++) {
|
|
1778
|
-
let n =
|
|
1778
|
+
let n = M(e, a);
|
|
1779
1779
|
if (!isFinite(n)) continue;
|
|
1780
1780
|
let o = Math.abs(n - t);
|
|
1781
1781
|
o < i && (i = o, r = a);
|
|
@@ -1792,16 +1792,16 @@ var zt = {
|
|
|
1792
1792
|
if (r === null) continue;
|
|
1793
1793
|
let i = n.data[r];
|
|
1794
1794
|
isFinite(i) && t.push({
|
|
1795
|
-
x:
|
|
1796
|
-
y:
|
|
1795
|
+
x: P(M(n, r)),
|
|
1796
|
+
y: F(i),
|
|
1797
1797
|
color: n.color ?? "currentColor"
|
|
1798
1798
|
});
|
|
1799
1799
|
}
|
|
1800
1800
|
return t;
|
|
1801
1801
|
}), De = n(() => {
|
|
1802
|
-
let e =
|
|
1802
|
+
let e = Fe.value, t = Ce.value;
|
|
1803
1803
|
if (e === null || t === null) return null;
|
|
1804
|
-
let n =
|
|
1804
|
+
let n = B(t, e), r = O.value, i = [];
|
|
1805
1805
|
for (let e = 0; e < r.length; e++) {
|
|
1806
1806
|
let n = r[e];
|
|
1807
1807
|
if (n.showInTooltip === !1) continue;
|
|
@@ -1821,8 +1821,8 @@ var zt = {
|
|
|
1821
1821
|
});
|
|
1822
1822
|
function Oe(e, t) {
|
|
1823
1823
|
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1824
|
-
x:
|
|
1825
|
-
y:
|
|
1824
|
+
x: P(e - ne.value),
|
|
1825
|
+
y: F(t)
|
|
1826
1826
|
};
|
|
1827
1827
|
}
|
|
1828
1828
|
function ke(e) {
|
|
@@ -1830,10 +1830,10 @@ var zt = {
|
|
|
1830
1830
|
if (!t) return null;
|
|
1831
1831
|
let n = O.value[0];
|
|
1832
1832
|
if (!n || n.data.length === 0) return null;
|
|
1833
|
-
let { min: r, max: i } =
|
|
1833
|
+
let { min: r, max: i } = re.value, a = i - r || 1;
|
|
1834
1834
|
return Te(n, r + (e - t.left - U.value.left) / G.value * a);
|
|
1835
1835
|
}
|
|
1836
|
-
let { containerRef: Ae, svgRef: H, width: je, height: Me, padding: U, legendY: W, inlineLegendLayout: Ne, innerW: G, innerH: K, bounds: Pe, hoverIndex:
|
|
1836
|
+
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: We, menuFilename: Ge, isFullscreen: Ke, fullscreenStyle: qe, teleportTarget: q, exitFullscreen: Je } = lt({
|
|
1837
1837
|
width: () => f.width,
|
|
1838
1838
|
height: () => f.height,
|
|
1839
1839
|
title: () => f.title,
|
|
@@ -1849,16 +1849,16 @@ var zt = {
|
|
|
1849
1849
|
downloadButton: () => f.downloadButton,
|
|
1850
1850
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
1851
1851
|
chartPadding: () => f.chartPadding,
|
|
1852
|
-
inlineLegendLabels: () =>
|
|
1853
|
-
hasTooltipSlot: () =>
|
|
1852
|
+
inlineLegendLabels: () => de.value,
|
|
1853
|
+
hasTooltipSlot: () => xe.value,
|
|
1854
1854
|
getCsv: be,
|
|
1855
1855
|
pointerToIndex: ke,
|
|
1856
1856
|
onHover: (e) => h("hover", e),
|
|
1857
|
-
extraBelowHeight: () =>
|
|
1858
|
-
}),
|
|
1857
|
+
extraBelowHeight: () => le.value.extraHeight
|
|
1858
|
+
}), J = n(() => Se(f.axisLabelStyle, { fontSize: 13 })), Y = n(() => Se(f.tickLabelStyle, {
|
|
1859
1859
|
fontSize: 10,
|
|
1860
1860
|
fillOpacity: V
|
|
1861
|
-
})),
|
|
1861
|
+
})), Ye = n(() => Se(f.legendStyle, { fontSize: 11 })), X = n(() => {
|
|
1862
1862
|
let e = f.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";
|
|
1863
1863
|
return {
|
|
1864
1864
|
lines: (f.title ?? "").split("\n"),
|
|
@@ -1869,9 +1869,9 @@ var zt = {
|
|
|
1869
1869
|
x: r,
|
|
1870
1870
|
anchor: i
|
|
1871
1871
|
};
|
|
1872
|
-
}),
|
|
1872
|
+
}), Z = n(() => {
|
|
1873
1873
|
let e = Ne.value.positions, t = U.value.left, n = W.value;
|
|
1874
|
-
return
|
|
1874
|
+
return ue.value.map((r, i) => {
|
|
1875
1875
|
let a = e[i];
|
|
1876
1876
|
return {
|
|
1877
1877
|
...r,
|
|
@@ -1881,46 +1881,46 @@ var zt = {
|
|
|
1881
1881
|
});
|
|
1882
1882
|
});
|
|
1883
1883
|
return (n, l) => (_(), r(t, {
|
|
1884
|
-
to: C(
|
|
1885
|
-
disabled: !C(
|
|
1884
|
+
to: C(q),
|
|
1885
|
+
disabled: !C(Ke)
|
|
1886
1886
|
}, [o("div", d({
|
|
1887
1887
|
ref_key: "containerRef",
|
|
1888
1888
|
ref: Ae
|
|
1889
1889
|
}, n.$attrs, {
|
|
1890
|
-
class: ["line-chart-wrapper", { "is-fullscreen": C(
|
|
1891
|
-
style: C(
|
|
1890
|
+
class: ["line-chart-wrapper", { "is-fullscreen": C(Ke) }],
|
|
1891
|
+
style: C(qe)
|
|
1892
1892
|
}), [
|
|
1893
|
-
c.menu ? (_(), r(
|
|
1893
|
+
c.menu ? (_(), r(pe, {
|
|
1894
1894
|
key: 0,
|
|
1895
|
-
items: C(
|
|
1896
|
-
"is-fullscreen": C(
|
|
1897
|
-
onClose: C(
|
|
1895
|
+
items: C(ze),
|
|
1896
|
+
"is-fullscreen": C(Ke),
|
|
1897
|
+
onClose: C(Je)
|
|
1898
1898
|
}, null, 8, [
|
|
1899
1899
|
"items",
|
|
1900
1900
|
"is-fullscreen",
|
|
1901
1901
|
"onClose"
|
|
1902
1902
|
])) : i("", !0),
|
|
1903
|
-
o("div",
|
|
1903
|
+
o("div", Bt, x(C(Ke) ? "Chart expanded to fill window" : ""), 1),
|
|
1904
1904
|
(_(), a("svg", {
|
|
1905
1905
|
ref_key: "svgRef",
|
|
1906
1906
|
ref: H,
|
|
1907
1907
|
width: C(je),
|
|
1908
|
-
height:
|
|
1908
|
+
height: fe.value
|
|
1909
1909
|
}, [
|
|
1910
1910
|
c.title ? (_(), a("text", {
|
|
1911
1911
|
key: 0,
|
|
1912
|
-
x:
|
|
1913
|
-
y:
|
|
1914
|
-
"text-anchor":
|
|
1915
|
-
"font-size":
|
|
1916
|
-
"font-weight":
|
|
1917
|
-
fill:
|
|
1918
|
-
}, [(_(!0), a(e, null, y(
|
|
1912
|
+
x: X.value.x,
|
|
1913
|
+
y: X.value.lineHeight,
|
|
1914
|
+
"text-anchor": X.value.anchor,
|
|
1915
|
+
"font-size": X.value.fontSize,
|
|
1916
|
+
"font-weight": X.value.fontWeight,
|
|
1917
|
+
fill: X.value.color
|
|
1918
|
+
}, [(_(!0), a(e, null, y(X.value.lines, (e, t) => (_(), a("tspan", {
|
|
1919
1919
|
key: t,
|
|
1920
|
-
x:
|
|
1921
|
-
dy: t === 0 ? 0 :
|
|
1922
|
-
}, x(e), 9,
|
|
1923
|
-
|
|
1920
|
+
x: X.value.x,
|
|
1921
|
+
dy: t === 0 ? 0 : X.value.lineHeight
|
|
1922
|
+
}, x(e), 9, Ut))), 128))], 8, Ht)) : i("", !0),
|
|
1923
|
+
Z.value.length > 0 ? (_(), a("g", Wt, [(_(!0), a(e, null, y(Z.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
|
|
1924
1924
|
key: 0,
|
|
1925
1925
|
x1: t.x,
|
|
1926
1926
|
y1: t.y,
|
|
@@ -1929,7 +1929,7 @@ var zt = {
|
|
|
1929
1929
|
stroke: t.color,
|
|
1930
1930
|
"stroke-width": "2",
|
|
1931
1931
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
1932
|
-
}, null, 8,
|
|
1932
|
+
}, null, 8, Gt)) : (_(), a("circle", {
|
|
1933
1933
|
key: 1,
|
|
1934
1934
|
cx: t.x + 4,
|
|
1935
1935
|
cy: t.y,
|
|
@@ -1938,13 +1938,13 @@ var zt = {
|
|
|
1938
1938
|
"fill-opacity": t.fillOpacity,
|
|
1939
1939
|
stroke: t.color,
|
|
1940
1940
|
"stroke-width": "1.5"
|
|
1941
|
-
}, null, 8,
|
|
1941
|
+
}, null, 8, Kt)), o("text", {
|
|
1942
1942
|
x: t.x + 18,
|
|
1943
1943
|
y: t.y + 4,
|
|
1944
|
-
"font-size":
|
|
1945
|
-
fill:
|
|
1946
|
-
"font-weight":
|
|
1947
|
-
}, x(t.label), 9,
|
|
1944
|
+
"font-size": Ye.value.fontSize,
|
|
1945
|
+
fill: Ye.value.fill,
|
|
1946
|
+
"font-weight": Ye.value.fontWeight
|
|
1947
|
+
}, x(t.label), 9, qt)], 64))), 128))])) : i("", !0),
|
|
1948
1948
|
o("line", {
|
|
1949
1949
|
x1: C(R)(C(U).left),
|
|
1950
1950
|
y1: C(R)(C(U).top),
|
|
@@ -1952,7 +1952,7 @@ var zt = {
|
|
|
1952
1952
|
y2: C(R)(C(U).top + C(K)),
|
|
1953
1953
|
stroke: "currentColor",
|
|
1954
1954
|
"stroke-opacity": "0.3"
|
|
1955
|
-
}, null, 8,
|
|
1955
|
+
}, null, 8, Jt),
|
|
1956
1956
|
o("line", {
|
|
1957
1957
|
x1: C(R)(C(U).left),
|
|
1958
1958
|
y1: C(R)(C(U).top + C(K)),
|
|
@@ -1960,8 +1960,8 @@ var zt = {
|
|
|
1960
1960
|
y2: C(R)(C(U).top + C(K)),
|
|
1961
1961
|
stroke: "currentColor",
|
|
1962
1962
|
"stroke-opacity": "0.3"
|
|
1963
|
-
}, null, 8,
|
|
1964
|
-
c.yGrid ? (_(!0), a(e, { key: 2 }, y(
|
|
1963
|
+
}, null, 8, Yt),
|
|
1964
|
+
c.yGrid ? (_(!0), a(e, { key: 2 }, y(z.value, (e, t) => (_(), a("line", {
|
|
1965
1965
|
key: "yg" + t,
|
|
1966
1966
|
x1: C(U).left,
|
|
1967
1967
|
y1: e.y,
|
|
@@ -1969,8 +1969,8 @@ var zt = {
|
|
|
1969
1969
|
y2: e.y,
|
|
1970
1970
|
stroke: "currentColor",
|
|
1971
1971
|
"stroke-opacity": "0.1"
|
|
1972
|
-
}, null, 8,
|
|
1973
|
-
c.xGrid ? (_(!0), a(e, { key: 3 }, y(
|
|
1972
|
+
}, null, 8, Xt))), 128)) : i("", !0),
|
|
1973
|
+
c.xGrid ? (_(!0), a(e, { key: 3 }, y(me.value, (e, t) => (_(), a("line", {
|
|
1974
1974
|
key: "xg" + t,
|
|
1975
1975
|
x1: e.x,
|
|
1976
1976
|
y1: C(U).top,
|
|
@@ -1978,78 +1978,79 @@ var zt = {
|
|
|
1978
1978
|
y2: C(U).top + C(K),
|
|
1979
1979
|
stroke: "currentColor",
|
|
1980
1980
|
"stroke-opacity": "0.1"
|
|
1981
|
-
}, null, 8,
|
|
1982
|
-
(_(!0), a(e, null, y(
|
|
1981
|
+
}, null, 8, Zt))), 128)) : i("", !0),
|
|
1982
|
+
(_(!0), a(e, null, y(z.value, (e, t) => (_(), a("text", {
|
|
1983
1983
|
key: "y" + t,
|
|
1984
1984
|
"data-testid": "y-tick",
|
|
1985
1985
|
x: C(U).left - 6,
|
|
1986
1986
|
y: e.y,
|
|
1987
1987
|
"text-anchor": "end",
|
|
1988
1988
|
"dominant-baseline": "middle",
|
|
1989
|
-
"font-size":
|
|
1990
|
-
fill:
|
|
1991
|
-
"font-weight":
|
|
1992
|
-
"fill-opacity":
|
|
1993
|
-
}, x(e.value), 9,
|
|
1989
|
+
"font-size": Y.value.fontSize,
|
|
1990
|
+
fill: Y.value.fill,
|
|
1991
|
+
"font-weight": Y.value.fontWeight,
|
|
1992
|
+
"fill-opacity": Y.value.fillOpacity
|
|
1993
|
+
}, x(e.value), 9, Qt))), 128)),
|
|
1994
1994
|
c.yLabel ? (_(), a("text", {
|
|
1995
1995
|
key: 4,
|
|
1996
1996
|
x: 0,
|
|
1997
1997
|
y: 0,
|
|
1998
1998
|
transform: `translate(14, ${C(U).top + C(K) / 2}) rotate(-90)`,
|
|
1999
1999
|
"text-anchor": "middle",
|
|
2000
|
-
"font-size":
|
|
2001
|
-
fill:
|
|
2002
|
-
"font-weight":
|
|
2003
|
-
}, x(c.yLabel), 9,
|
|
2004
|
-
(_(!0), a(e, null, y(
|
|
2000
|
+
"font-size": J.value.fontSize,
|
|
2001
|
+
fill: J.value.fill,
|
|
2002
|
+
"font-weight": J.value.fontWeight
|
|
2003
|
+
}, x(c.yLabel), 9, $t)) : i("", !0),
|
|
2004
|
+
(_(!0), a(e, null, y(me.value, (e, t) => (_(), a("text", {
|
|
2005
2005
|
key: "x" + t,
|
|
2006
2006
|
"data-testid": "x-tick",
|
|
2007
2007
|
x: e.x,
|
|
2008
2008
|
y: C(U).top + C(K) + 16,
|
|
2009
2009
|
"text-anchor": e.anchor,
|
|
2010
|
-
"font-size":
|
|
2011
|
-
fill:
|
|
2012
|
-
"font-weight":
|
|
2013
|
-
"fill-opacity":
|
|
2014
|
-
}, x(e.value), 9,
|
|
2010
|
+
"font-size": Y.value.fontSize,
|
|
2011
|
+
fill: Y.value.fill,
|
|
2012
|
+
"font-weight": Y.value.fontWeight,
|
|
2013
|
+
"fill-opacity": Y.value.fillOpacity
|
|
2014
|
+
}, x(e.value), 9, en))), 128)),
|
|
2015
2015
|
c.xLabel ? (_(), a("text", {
|
|
2016
2016
|
key: 5,
|
|
2017
2017
|
x: C(U).left + C(G) / 2,
|
|
2018
2018
|
y: C(Me) - 4,
|
|
2019
2019
|
"text-anchor": "middle",
|
|
2020
|
-
"font-size":
|
|
2021
|
-
fill:
|
|
2022
|
-
"font-weight":
|
|
2023
|
-
}, x(c.xLabel), 9,
|
|
2020
|
+
"font-size": J.value.fontSize,
|
|
2021
|
+
fill: J.value.fill,
|
|
2022
|
+
"font-weight": J.value.fontWeight
|
|
2023
|
+
}, x(c.xLabel), 9, tn)) : i("", !0),
|
|
2024
2024
|
(_(!0), a(e, null, y(k.value, (e, t) => (_(), a("path", {
|
|
2025
2025
|
key: "area" + t,
|
|
2026
|
-
d:
|
|
2026
|
+
d: se(e),
|
|
2027
2027
|
fill: e.color ?? "currentColor",
|
|
2028
2028
|
"fill-opacity": e.opacity ?? .2,
|
|
2029
|
-
stroke: "none"
|
|
2030
|
-
|
|
2029
|
+
stroke: "none",
|
|
2030
|
+
style: m(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
2031
|
+
}, null, 12, nn))), 128)),
|
|
2031
2032
|
(_(!0), a(e, null, y(O.value, (t, n) => (_(), a(e, { key: n }, [
|
|
2032
2033
|
t.line !== !1 && t.outline ? (_(), a("path", {
|
|
2033
2034
|
key: 0,
|
|
2034
|
-
d:
|
|
2035
|
+
d: ae(t),
|
|
2035
2036
|
fill: "none",
|
|
2036
2037
|
stroke: t.outlineColor ?? "var(--color-bg-0, #fff)",
|
|
2037
2038
|
"stroke-width": (t.strokeWidth ?? 1.5) + (t.outlineWidth ?? 4),
|
|
2038
2039
|
"stroke-linecap": "round",
|
|
2039
2040
|
"stroke-linejoin": "round",
|
|
2040
2041
|
"data-testid": "line-outline"
|
|
2041
|
-
}, null, 8,
|
|
2042
|
+
}, null, 8, rn)) : i("", !0),
|
|
2042
2043
|
t.line === !1 ? i("", !0) : (_(), a("path", {
|
|
2043
2044
|
key: 1,
|
|
2044
|
-
d:
|
|
2045
|
+
d: ae(t),
|
|
2045
2046
|
fill: "none",
|
|
2046
2047
|
stroke: t.color ?? "currentColor",
|
|
2047
2048
|
"stroke-width": t.strokeWidth ?? 1.5,
|
|
2048
2049
|
"stroke-opacity": t.lineOpacity ?? t.opacity ?? c.lineOpacity,
|
|
2049
2050
|
"stroke-dasharray": t.dashed ? "6 3" : void 0,
|
|
2050
2051
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2051
|
-
}, null, 12,
|
|
2052
|
-
t.dots ? (_(!0), a(e, { key: 2 }, y(
|
|
2052
|
+
}, null, 12, an)),
|
|
2053
|
+
t.dots ? (_(!0), a(e, { key: 2 }, y(oe(t), (e, n) => (_(), a("circle", {
|
|
2053
2054
|
key: n,
|
|
2054
2055
|
cx: e.x,
|
|
2055
2056
|
cy: e.y,
|
|
@@ -2058,58 +2059,58 @@ var zt = {
|
|
|
2058
2059
|
"fill-opacity": t.dotOpacity ?? t.opacity ?? c.lineOpacity,
|
|
2059
2060
|
stroke: t.dotStroke ?? "none",
|
|
2060
2061
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2061
|
-
}, null, 12,
|
|
2062
|
+
}, null, 12, on))), 128)) : i("", !0)
|
|
2062
2063
|
], 64))), 128)),
|
|
2063
2064
|
(_(!0), a(e, null, y(c.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
2064
2065
|
o("path", {
|
|
2065
|
-
d:
|
|
2066
|
+
d: ce(t),
|
|
2066
2067
|
fill: t.color ?? (t.seriesIndex == null ? "#999" : O.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
2067
2068
|
"fill-opacity": t.opacity ?? .15,
|
|
2068
2069
|
stroke: "none"
|
|
2069
|
-
}, null, 8,
|
|
2070
|
+
}, null, 8, sn),
|
|
2070
2071
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
2071
2072
|
key: 0,
|
|
2072
|
-
d:
|
|
2073
|
+
d: ce(t, !1),
|
|
2073
2074
|
fill: "none",
|
|
2074
2075
|
stroke: t.color ?? O.value[t.seriesIndex]?.color ?? "currentColor",
|
|
2075
2076
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2076
2077
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2077
|
-
}, null, 8,
|
|
2078
|
+
}, null, 8, cn)),
|
|
2078
2079
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
2079
|
-
x1: C(R)(
|
|
2080
|
+
x1: C(R)(I(t, "start")),
|
|
2080
2081
|
y1: C(U).top,
|
|
2081
|
-
x2: C(R)(
|
|
2082
|
+
x2: C(R)(I(t, "start")),
|
|
2082
2083
|
y2: C(U).top + C(K),
|
|
2083
2084
|
stroke: t.color ?? "#999",
|
|
2084
2085
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2085
2086
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2086
|
-
}, null, 8,
|
|
2087
|
-
x1: C(R)(
|
|
2087
|
+
}, null, 8, ln), o("line", {
|
|
2088
|
+
x1: C(R)(I(t, "end")),
|
|
2088
2089
|
y1: C(U).top,
|
|
2089
|
-
x2: C(R)(
|
|
2090
|
+
x2: C(R)(I(t, "end")),
|
|
2090
2091
|
y2: C(U).top + C(K),
|
|
2091
2092
|
stroke: t.color ?? "#999",
|
|
2092
2093
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2093
2094
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2094
|
-
}, null, 8,
|
|
2095
|
+
}, null, 8, un)], 64)) : i("", !0),
|
|
2095
2096
|
o("line", {
|
|
2096
|
-
x1: C(R)(
|
|
2097
|
+
x1: C(R)(I(t, "start")),
|
|
2097
2098
|
y1: C(U).top + C(K) - 4,
|
|
2098
|
-
x2: C(R)(
|
|
2099
|
+
x2: C(R)(I(t, "start")),
|
|
2099
2100
|
y2: C(U).top + C(K) + 4,
|
|
2100
2101
|
stroke: "currentColor",
|
|
2101
2102
|
"stroke-opacity": "0.4"
|
|
2102
|
-
}, null, 8,
|
|
2103
|
+
}, null, 8, dn),
|
|
2103
2104
|
o("line", {
|
|
2104
|
-
x1: C(R)(
|
|
2105
|
+
x1: C(R)(I(t, "end")),
|
|
2105
2106
|
y1: C(U).top + C(K) - 4,
|
|
2106
|
-
x2: C(R)(
|
|
2107
|
+
x2: C(R)(I(t, "end")),
|
|
2107
2108
|
y2: C(U).top + C(K) + 4,
|
|
2108
2109
|
stroke: "currentColor",
|
|
2109
2110
|
"stroke-opacity": "0.4"
|
|
2110
|
-
}, null, 8,
|
|
2111
|
+
}, null, 8, fn)
|
|
2111
2112
|
], 64))), 128)),
|
|
2112
|
-
|
|
2113
|
+
xe.value && C(Fe) !== null ? (_(), a("line", {
|
|
2113
2114
|
key: 6,
|
|
2114
2115
|
x1: C(R)(we.value),
|
|
2115
2116
|
y1: C(U).top,
|
|
@@ -2119,7 +2120,7 @@ var zt = {
|
|
|
2119
2120
|
"stroke-opacity": "0.3",
|
|
2120
2121
|
"stroke-dasharray": "4 2",
|
|
2121
2122
|
"pointer-events": "none"
|
|
2122
|
-
}, null, 8,
|
|
2123
|
+
}, null, 8, pn)) : i("", !0),
|
|
2123
2124
|
(_(!0), a(e, null, y(Ee.value, (e, t) => (_(), a("circle", {
|
|
2124
2125
|
key: "hd" + t,
|
|
2125
2126
|
cx: e.x,
|
|
@@ -2129,8 +2130,8 @@ var zt = {
|
|
|
2129
2130
|
stroke: "var(--color-bg-0, #fff)",
|
|
2130
2131
|
"stroke-width": "2",
|
|
2131
2132
|
"pointer-events": "none"
|
|
2132
|
-
}, null, 8,
|
|
2133
|
-
|
|
2133
|
+
}, null, 8, mn))), 128)),
|
|
2134
|
+
xe.value ? (_(), a("rect", d({
|
|
2134
2135
|
key: 7,
|
|
2135
2136
|
x: C(U).left,
|
|
2136
2137
|
y: C(U).top,
|
|
@@ -2141,150 +2142,150 @@ var zt = {
|
|
|
2141
2142
|
cursor: "crosshair",
|
|
2142
2143
|
"touch-action": "pan-y"
|
|
2143
2144
|
}
|
|
2144
|
-
}, ee(C(
|
|
2145
|
-
c.annotations && c.annotations.length > 0 ? (_(), r(C(
|
|
2145
|
+
}, ee(C(Re), !0)), null, 16, hn)) : i("", !0),
|
|
2146
|
+
c.annotations && c.annotations.length > 0 ? (_(), r(C(ot), {
|
|
2146
2147
|
key: 8,
|
|
2147
2148
|
annotations: c.annotations,
|
|
2148
2149
|
project: Oe,
|
|
2149
2150
|
bounds: C(Pe)
|
|
2150
2151
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
2151
|
-
(_(!0), a(e, null, y(
|
|
2152
|
+
(_(!0), a(e, null, y(le.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
2152
2153
|
o("circle", {
|
|
2153
2154
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
2154
|
-
cy:
|
|
2155
|
+
cy: L.value + e.row * Sn + 4,
|
|
2155
2156
|
r: "4",
|
|
2156
2157
|
fill: e.color,
|
|
2157
2158
|
"fill-opacity": e.fillOpacity,
|
|
2158
2159
|
stroke: e.color,
|
|
2159
2160
|
"stroke-width": "1.5"
|
|
2160
|
-
}, null, 8,
|
|
2161
|
+
}, null, 8, gn),
|
|
2161
2162
|
e.labelText ? (_(), a("text", {
|
|
2162
2163
|
key: 0,
|
|
2163
2164
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2164
|
-
y:
|
|
2165
|
+
y: L.value + e.row * Sn + 8,
|
|
2165
2166
|
"font-size": e.labelStyle.fontSize,
|
|
2166
2167
|
"font-weight": e.labelStyle.fontWeight,
|
|
2167
2168
|
fill: e.labelStyle.fill
|
|
2168
|
-
}, x(e.labelText), 9,
|
|
2169
|
+
}, x(e.labelText), 9, _n)) : i("", !0),
|
|
2169
2170
|
e.descText ? (_(), a("text", {
|
|
2170
2171
|
key: 1,
|
|
2171
2172
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2172
|
-
y:
|
|
2173
|
+
y: L.value + e.row * Sn + 22,
|
|
2173
2174
|
"font-size": e.descStyle.fontSize,
|
|
2174
2175
|
"font-weight": e.descStyle.fontWeight,
|
|
2175
2176
|
fill: e.descStyle.fill,
|
|
2176
2177
|
"fill-opacity": e.descStyle.fillOpacity
|
|
2177
|
-
}, x(e.descText), 9,
|
|
2178
|
+
}, x(e.descText), 9, vn)) : i("", !0)
|
|
2178
2179
|
]))), 128))
|
|
2179
|
-
], 8,
|
|
2180
|
-
|
|
2180
|
+
], 8, Vt)),
|
|
2181
|
+
xe.value && C(Fe) !== null && De.value ? (_(), a("div", {
|
|
2181
2182
|
key: 1,
|
|
2182
2183
|
ref_key: "tooltipRef",
|
|
2183
|
-
ref:
|
|
2184
|
+
ref: Ie,
|
|
2184
2185
|
class: "chart-tooltip-content",
|
|
2185
2186
|
style: m({
|
|
2186
2187
|
position: "absolute",
|
|
2187
2188
|
top: "0",
|
|
2188
2189
|
left: "0",
|
|
2189
2190
|
willChange: "transform",
|
|
2190
|
-
transform: C(
|
|
2191
|
-
visibility: C(
|
|
2191
|
+
transform: C(Le) ? `translate3d(${C(Le).left}px, ${C(Le).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2192
|
+
visibility: C(Le) ? "visible" : "hidden"
|
|
2192
2193
|
})
|
|
2193
|
-
}, [b(n.$slots, "tooltip", p(u(De.value)), () => [o("div",
|
|
2194
|
+
}, [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", {
|
|
2194
2195
|
key: e.seriesIndex,
|
|
2195
2196
|
class: "line-chart-tooltip-row"
|
|
2196
2197
|
}, [o("span", {
|
|
2197
2198
|
class: "line-chart-tooltip-swatch",
|
|
2198
2199
|
style: m({ background: e.color })
|
|
2199
2200
|
}, null, 4), s(" " + x(isFinite(e.value) ? C(w)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2200
|
-
C(
|
|
2201
|
+
C(Be) ? (_(), a("a", {
|
|
2201
2202
|
key: 2,
|
|
2202
2203
|
class: "line-chart-download-link",
|
|
2203
2204
|
href: C(Ve),
|
|
2204
|
-
download: `${C(
|
|
2205
|
-
}, x(C(
|
|
2206
|
-
C(
|
|
2205
|
+
download: `${C(Ge)()}.csv`
|
|
2206
|
+
}, x(C(Be)), 9, xn)) : i("", !0),
|
|
2207
|
+
C(Ue) ? (_(), a("button", {
|
|
2207
2208
|
key: 3,
|
|
2208
2209
|
type: "button",
|
|
2209
2210
|
class: "line-chart-download-button",
|
|
2210
|
-
onClick: l[0] ||= (...e) => C(
|
|
2211
|
-
}, x(C(
|
|
2211
|
+
onClick: l[0] ||= (...e) => C(We) && C(We)(...e)
|
|
2212
|
+
}, x(C(Ue)), 1)) : i("", !0)
|
|
2212
2213
|
], 16)], 8, ["to", "disabled"]));
|
|
2213
2214
|
}
|
|
2214
|
-
}), [["__scopeId", "data-v-
|
|
2215
|
+
}), [["__scopeId", "data-v-e96123bd"]]), Dn = {
|
|
2215
2216
|
class: "chart-sr-only",
|
|
2216
2217
|
"aria-live": "polite"
|
|
2217
|
-
},
|
|
2218
|
+
}, On = ["width", "height"], kn = [
|
|
2218
2219
|
"x",
|
|
2219
2220
|
"y",
|
|
2220
2221
|
"text-anchor",
|
|
2221
2222
|
"font-size",
|
|
2222
2223
|
"font-weight",
|
|
2223
2224
|
"fill"
|
|
2224
|
-
],
|
|
2225
|
+
], An = ["x", "dy"], jn = [
|
|
2225
2226
|
"data-testid",
|
|
2226
2227
|
"x",
|
|
2227
2228
|
"y",
|
|
2228
2229
|
"text-anchor",
|
|
2229
2230
|
"font-size",
|
|
2230
2231
|
"fill"
|
|
2231
|
-
],
|
|
2232
|
+
], Mn = { key: 1 }, Nn = [
|
|
2232
2233
|
"x",
|
|
2233
2234
|
"y",
|
|
2234
2235
|
"fill"
|
|
2235
|
-
],
|
|
2236
|
+
], Pn = [
|
|
2236
2237
|
"x1",
|
|
2237
2238
|
"y1",
|
|
2238
2239
|
"x2",
|
|
2239
2240
|
"y2",
|
|
2240
2241
|
"stroke",
|
|
2241
2242
|
"stroke-dasharray"
|
|
2242
|
-
],
|
|
2243
|
+
], Fn = [
|
|
2243
2244
|
"x",
|
|
2244
2245
|
"y",
|
|
2245
2246
|
"font-size",
|
|
2246
2247
|
"fill",
|
|
2247
2248
|
"font-weight"
|
|
2248
|
-
],
|
|
2249
|
+
], In = [
|
|
2249
2250
|
"x1",
|
|
2250
2251
|
"y1",
|
|
2251
2252
|
"x2",
|
|
2252
2253
|
"y2"
|
|
2253
|
-
],
|
|
2254
|
+
], Ln = [
|
|
2254
2255
|
"x1",
|
|
2255
2256
|
"y1",
|
|
2256
2257
|
"x2",
|
|
2257
2258
|
"y2"
|
|
2258
|
-
],
|
|
2259
|
+
], Rn = [
|
|
2259
2260
|
"x1",
|
|
2260
2261
|
"y1",
|
|
2261
2262
|
"x2",
|
|
2262
2263
|
"y2"
|
|
2263
|
-
],
|
|
2264
|
+
], zn = [
|
|
2264
2265
|
"x",
|
|
2265
2266
|
"y",
|
|
2266
2267
|
"width",
|
|
2267
2268
|
"height"
|
|
2268
|
-
],
|
|
2269
|
+
], Bn = [
|
|
2269
2270
|
"x",
|
|
2270
2271
|
"y",
|
|
2271
2272
|
"font-size",
|
|
2272
2273
|
"fill",
|
|
2273
2274
|
"font-weight",
|
|
2274
2275
|
"fill-opacity"
|
|
2275
|
-
],
|
|
2276
|
+
], Vn = [
|
|
2276
2277
|
"x",
|
|
2277
2278
|
"y",
|
|
2278
2279
|
"font-size",
|
|
2279
2280
|
"fill",
|
|
2280
2281
|
"font-weight",
|
|
2281
2282
|
"fill-opacity"
|
|
2282
|
-
],
|
|
2283
|
+
], Hn = [
|
|
2283
2284
|
"transform",
|
|
2284
2285
|
"font-size",
|
|
2285
2286
|
"fill",
|
|
2286
2287
|
"font-weight"
|
|
2287
|
-
],
|
|
2288
|
+
], Un = [
|
|
2288
2289
|
"x",
|
|
2289
2290
|
"y",
|
|
2290
2291
|
"text-anchor",
|
|
@@ -2292,7 +2293,7 @@ var zt = {
|
|
|
2292
2293
|
"fill",
|
|
2293
2294
|
"font-weight",
|
|
2294
2295
|
"fill-opacity"
|
|
2295
|
-
],
|
|
2296
|
+
], Wn = [
|
|
2296
2297
|
"x",
|
|
2297
2298
|
"y",
|
|
2298
2299
|
"text-anchor",
|
|
@@ -2300,13 +2301,13 @@ var zt = {
|
|
|
2300
2301
|
"fill",
|
|
2301
2302
|
"font-weight",
|
|
2302
2303
|
"fill-opacity"
|
|
2303
|
-
],
|
|
2304
|
+
], Gn = [
|
|
2304
2305
|
"x",
|
|
2305
2306
|
"y",
|
|
2306
2307
|
"font-size",
|
|
2307
2308
|
"fill",
|
|
2308
2309
|
"font-weight"
|
|
2309
|
-
],
|
|
2310
|
+
], Kn = [
|
|
2310
2311
|
"data-category",
|
|
2311
2312
|
"data-series",
|
|
2312
2313
|
"x",
|
|
@@ -2315,34 +2316,34 @@ var zt = {
|
|
|
2315
2316
|
"height",
|
|
2316
2317
|
"fill",
|
|
2317
2318
|
"fill-opacity"
|
|
2318
|
-
],
|
|
2319
|
+
], qn = [
|
|
2319
2320
|
"x",
|
|
2320
2321
|
"y",
|
|
2321
2322
|
"text-anchor",
|
|
2322
2323
|
"font-size",
|
|
2323
2324
|
"font-weight",
|
|
2324
2325
|
"fill"
|
|
2325
|
-
],
|
|
2326
|
+
], Jn = [
|
|
2326
2327
|
"d",
|
|
2327
2328
|
"stroke",
|
|
2328
2329
|
"stroke-width",
|
|
2329
2330
|
"stroke-opacity",
|
|
2330
2331
|
"stroke-dasharray"
|
|
2331
|
-
],
|
|
2332
|
+
], Yn = [
|
|
2332
2333
|
"cx",
|
|
2333
2334
|
"cy",
|
|
2334
2335
|
"r",
|
|
2335
2336
|
"fill",
|
|
2336
2337
|
"fill-opacity"
|
|
2337
|
-
],
|
|
2338
|
+
], Xn = [
|
|
2338
2339
|
"x",
|
|
2339
2340
|
"y",
|
|
2340
2341
|
"width",
|
|
2341
2342
|
"height"
|
|
2342
|
-
],
|
|
2343
|
+
], Zn = { class: "bar-chart-tooltip" }, Qn = {
|
|
2343
2344
|
key: 0,
|
|
2344
2345
|
class: "bar-chart-tooltip-label"
|
|
2345
|
-
},
|
|
2346
|
+
}, $n = ["href", "download"], er = 22, tr = 2, nr = 11, rr = .6, ir = 4, ar = 4, or = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
2346
2347
|
inheritAttrs: !1,
|
|
2347
2348
|
__name: "BarChart",
|
|
2348
2349
|
props: {
|
|
@@ -2430,9 +2431,9 @@ var zt = {
|
|
|
2430
2431
|
return t;
|
|
2431
2432
|
}), E = n(() => {
|
|
2432
2433
|
let e = f.categories;
|
|
2433
|
-
if (!e || e.length === 0 || !
|
|
2434
|
+
if (!e || e.length === 0 || !kt(e, "utc")) return null;
|
|
2434
2435
|
let t = Array(e.length);
|
|
2435
|
-
for (let n = 0; n < e.length; n++) t[n] =
|
|
2436
|
+
for (let n = 0; n < e.length; n++) t[n] = Dt(e[n], "utc") ?? NaN;
|
|
2436
2437
|
return t;
|
|
2437
2438
|
}), D = n(() => f.orientation === "vertical"), O = n(() => {
|
|
2438
2439
|
let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
|
|
@@ -2456,34 +2457,34 @@ var zt = {
|
|
|
2456
2457
|
isFinite(e) || (e = 0), isFinite(t) || (t = 0);
|
|
2457
2458
|
let i = f.valueMin ?? 0;
|
|
2458
2459
|
f.valueScaleType === "log" ? i > 0 && i < e && (e = i) : i < e && (e = i);
|
|
2459
|
-
let a =
|
|
2460
|
+
let a = ve(e, t, f.valueScaleType, n);
|
|
2460
2461
|
return {
|
|
2461
2462
|
min: a.min,
|
|
2462
2463
|
max: a.max,
|
|
2463
2464
|
range: a.max - a.min || 1
|
|
2464
2465
|
};
|
|
2465
|
-
}), k = n(() => D.value ? U.value : W.value),
|
|
2466
|
+
}), k = n(() => D.value ? U.value : W.value), A = n(() => D.value ? W.value : U.value), j = n(() => {
|
|
2466
2467
|
let e = w.value;
|
|
2467
2468
|
return e > 0 ? k.value / e : 0;
|
|
2468
|
-
}),
|
|
2469
|
+
}), M = n(() => j.value * (1 - f.barPadding)), N = n(() => {
|
|
2469
2470
|
let e = S.value.length;
|
|
2470
2471
|
if (e === 0) return 0;
|
|
2471
|
-
if (f.layout === "stacked" || e === 1) return
|
|
2472
|
+
if (f.layout === "stacked" || e === 1) return M.value;
|
|
2472
2473
|
let t = f.groupGap * (e - 1);
|
|
2473
|
-
return Math.max(1, (
|
|
2474
|
+
return Math.max(1, (M.value - t) / e);
|
|
2474
2475
|
});
|
|
2475
|
-
function
|
|
2476
|
-
return (D.value ? H.value.left : H.value.top) + e *
|
|
2476
|
+
function ne(e) {
|
|
2477
|
+
return (D.value ? H.value.left : H.value.top) + e * j.value;
|
|
2477
2478
|
}
|
|
2478
|
-
let
|
|
2479
|
+
let re = n(() => {
|
|
2479
2480
|
let { min: e, max: t } = O.value, n = f.valueMin ?? 0;
|
|
2480
|
-
return
|
|
2481
|
+
return P(Math.max(e, Math.min(t, n)));
|
|
2481
2482
|
});
|
|
2482
|
-
function
|
|
2483
|
-
let { min: t, max: n } = O.value, r =
|
|
2483
|
+
function P(e) {
|
|
2484
|
+
let { min: t, max: n } = O.value, r = _e(e, t, n, f.valueScaleType);
|
|
2484
2485
|
return D.value ? H.value.top + W.value - r * W.value : H.value.left + r * U.value;
|
|
2485
2486
|
}
|
|
2486
|
-
function
|
|
2487
|
+
function ie(e, t, n, r, i, a, o, s, c, l) {
|
|
2487
2488
|
let u = Math.min(e, t), d = Math.abs(e - t);
|
|
2488
2489
|
return D.value ? {
|
|
2489
2490
|
x: n,
|
|
@@ -2509,34 +2510,34 @@ var zt = {
|
|
|
2509
2510
|
seriesIndex: l
|
|
2510
2511
|
};
|
|
2511
2512
|
}
|
|
2512
|
-
let
|
|
2513
|
+
let F = n(() => {
|
|
2513
2514
|
let e = [], t = S.value, n = t.length;
|
|
2514
2515
|
if (n === 0) return e;
|
|
2515
|
-
let r = w.value, i =
|
|
2516
|
+
let r = w.value, i = j.value, a = M.value, o = N.value, s = (i - a) / 2, c = re.value;
|
|
2516
2517
|
for (let i = 0; i < r; i++) {
|
|
2517
|
-
let r =
|
|
2518
|
+
let r = ne(i) + s;
|
|
2518
2519
|
if (f.layout === "stacked") {
|
|
2519
2520
|
let o = 0, s = 0;
|
|
2520
2521
|
for (let c = 0; c < n; c++) {
|
|
2521
2522
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
2522
2523
|
if (!isFinite(l)) continue;
|
|
2523
2524
|
let u = l >= 0 ? o : s, d = u + l;
|
|
2524
|
-
e.push(
|
|
2525
|
+
e.push(ie(P(u), P(d), r, a, n.color ?? de(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
|
|
2525
2526
|
}
|
|
2526
2527
|
} else if (f.layout === "overlay") for (let o = 0; o < n; o++) {
|
|
2527
2528
|
let n = t[o], s = Number(n.data[i] ?? NaN);
|
|
2528
|
-
isFinite(s) && e.push(
|
|
2529
|
+
isFinite(s) && e.push(ie(c, P(s), r, a, n.color ?? de(o), n.opacity ?? 1, n.blendMode, s, i, o));
|
|
2529
2530
|
}
|
|
2530
2531
|
else for (let a = 0; a < n; a++) {
|
|
2531
2532
|
let s = t[a], l = Number(s.data[i] ?? NaN);
|
|
2532
2533
|
if (!isFinite(l)) continue;
|
|
2533
2534
|
let u = r + (n === 1 ? 0 : a * (o + f.groupGap));
|
|
2534
|
-
e.push(
|
|
2535
|
+
e.push(ie(c, P(l), u, o, s.color ?? de(a), s.opacity ?? 1, s.blendMode, l, i, a));
|
|
2535
2536
|
}
|
|
2536
2537
|
}
|
|
2537
2538
|
return e;
|
|
2538
2539
|
});
|
|
2539
|
-
function
|
|
2540
|
+
function ae(e) {
|
|
2540
2541
|
let t = Infinity, n = -Infinity;
|
|
2541
2542
|
for (let r of e.data) {
|
|
2542
2543
|
let e = Number(r);
|
|
@@ -2547,8 +2548,8 @@ var zt = {
|
|
|
2547
2548
|
max: n
|
|
2548
2549
|
};
|
|
2549
2550
|
}
|
|
2550
|
-
function
|
|
2551
|
-
let r = (D.value ? H.value.left : H.value.top) + (e + .5) *
|
|
2551
|
+
function oe(e, t, n) {
|
|
2552
|
+
let r = (D.value ? H.value.left : H.value.top) + (e + .5) * j.value, i = n.max - n.min || 1, a = (t - n.min) / i;
|
|
2552
2553
|
return D.value ? {
|
|
2553
2554
|
x: r,
|
|
2554
2555
|
y: H.value.top + W.value - a * W.value
|
|
@@ -2557,23 +2558,23 @@ var zt = {
|
|
|
2557
2558
|
y: r
|
|
2558
2559
|
};
|
|
2559
2560
|
}
|
|
2560
|
-
let
|
|
2561
|
+
let se = n(() => {
|
|
2561
2562
|
let e = f.summaryLines;
|
|
2562
2563
|
return !e || e.length === 0 ? [] : e.map((e, t) => ({
|
|
2563
2564
|
data: e.data ?? g,
|
|
2564
2565
|
x: e.x,
|
|
2565
|
-
color: e.color ??
|
|
2566
|
+
color: e.color ?? le(t),
|
|
2566
2567
|
strokeWidth: e.strokeWidth ?? 2,
|
|
2567
2568
|
dashed: e.dashed ?? !1,
|
|
2568
2569
|
opacity: e.opacity ?? 1,
|
|
2569
2570
|
blendMode: e.blendMode,
|
|
2570
2571
|
dots: e.dots ?? !1,
|
|
2571
2572
|
dotRadius: e.dotRadius ?? (e.strokeWidth ?? 2) + 1,
|
|
2572
|
-
extent:
|
|
2573
|
+
extent: ae(e),
|
|
2573
2574
|
legend: e.legend,
|
|
2574
2575
|
showInLegend: e.showInLegend !== !1
|
|
2575
2576
|
}));
|
|
2576
|
-
}),
|
|
2577
|
+
}), I = n(() => j.value === 0 ? [] : se.value.map((e) => {
|
|
2577
2578
|
let t = [], n = "", r = !1;
|
|
2578
2579
|
for (let i = 0; i < e.data.length; i++) {
|
|
2579
2580
|
let a = Number(e.data[i]), o = e.x ? Number(e.x[i]) : i;
|
|
@@ -2581,7 +2582,7 @@ var zt = {
|
|
|
2581
2582
|
r = !1;
|
|
2582
2583
|
continue;
|
|
2583
2584
|
}
|
|
2584
|
-
let s =
|
|
2585
|
+
let s = oe(o, a, e.extent);
|
|
2585
2586
|
t.push(s), n += r ? `L${s.x},${s.y}` : `M${s.x},${s.y}`, r = !0;
|
|
2586
2587
|
}
|
|
2587
2588
|
return {
|
|
@@ -2589,16 +2590,16 @@ var zt = {
|
|
|
2589
2590
|
pathD: n,
|
|
2590
2591
|
points: t
|
|
2591
2592
|
};
|
|
2592
|
-
})),
|
|
2593
|
+
})), ce = [
|
|
2593
2594
|
"var(--color-fg-1, #111)",
|
|
2594
2595
|
"var(--color-danger, #ef4444)",
|
|
2595
2596
|
"var(--color-success, #10b981)",
|
|
2596
2597
|
"var(--color-info, #6366f1)"
|
|
2597
2598
|
];
|
|
2598
|
-
function
|
|
2599
|
-
return
|
|
2599
|
+
function le(e) {
|
|
2600
|
+
return ce[e % ce.length];
|
|
2600
2601
|
}
|
|
2601
|
-
let
|
|
2602
|
+
let ue = [
|
|
2602
2603
|
"var(--color-primary, #3b82f6)",
|
|
2603
2604
|
"var(--color-accent, #f59e0b)",
|
|
2604
2605
|
"var(--color-success, #10b981)",
|
|
@@ -2606,36 +2607,36 @@ var zt = {
|
|
|
2606
2607
|
"var(--color-info, #6366f1)",
|
|
2607
2608
|
"var(--color-warning, #d97706)"
|
|
2608
2609
|
];
|
|
2609
|
-
function
|
|
2610
|
-
return
|
|
2610
|
+
function de(e) {
|
|
2611
|
+
return ue[e % ue.length];
|
|
2611
2612
|
}
|
|
2612
|
-
let
|
|
2613
|
-
let { min: e, max: t } = O.value, n = (e) => f.valueTickFormat === void 0 ?
|
|
2613
|
+
let fe = ut(() => f.tooltipValueFormat, () => f.valueTickFormat), L = n(() => {
|
|
2614
|
+
let { min: e, max: t } = O.value, n = (e) => f.valueTickFormat === void 0 ? he(e) : te(e, f.valueTickFormat);
|
|
2614
2615
|
if (e === t) return [{
|
|
2615
2616
|
value: n(e),
|
|
2616
|
-
pos: R(
|
|
2617
|
+
pos: R(P(e))
|
|
2617
2618
|
}];
|
|
2618
2619
|
let r = D.value ? 50 : 80;
|
|
2619
|
-
return (f.valueScaleType === "log" ?
|
|
2620
|
+
return (f.valueScaleType === "log" ? ye({
|
|
2620
2621
|
min: e,
|
|
2621
2622
|
max: t,
|
|
2622
2623
|
ticks: f.valueTicks
|
|
2623
|
-
}) :
|
|
2624
|
+
}) : ge({
|
|
2624
2625
|
min: e,
|
|
2625
2626
|
max: t,
|
|
2626
2627
|
ticks: f.valueTicks,
|
|
2627
|
-
targetTickCount:
|
|
2628
|
+
targetTickCount: A.value / r
|
|
2628
2629
|
})).map((e) => ({
|
|
2629
2630
|
value: n(e),
|
|
2630
|
-
pos: R(
|
|
2631
|
+
pos: R(P(e))
|
|
2631
2632
|
}));
|
|
2632
|
-
}),
|
|
2633
|
+
}), z = n(() => {
|
|
2633
2634
|
let e = w.value, t = E.value;
|
|
2634
2635
|
if (t && t.length > 0) {
|
|
2635
2636
|
let e = Infinity, n = -Infinity;
|
|
2636
2637
|
for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
|
|
2637
2638
|
if (!Number.isFinite(e) || e === n) return [];
|
|
2638
|
-
let r = D.value ? U.value : W.value, i = Math.max(2, Math.floor(r / 80)), a =
|
|
2639
|
+
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();
|
|
2639
2640
|
for (let e of a.values) {
|
|
2640
2641
|
let n = -1, r = Infinity;
|
|
2641
2642
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -2644,7 +2645,7 @@ var zt = {
|
|
|
2644
2645
|
}
|
|
2645
2646
|
if (n < 0 || c.has(n)) continue;
|
|
2646
2647
|
c.add(n);
|
|
2647
|
-
let i =
|
|
2648
|
+
let i = ne(n) + j.value / 2, a = f.categoryFormat ? f.categoryFormat(T.value[n], n) : zt(t[n], f.dateFormat, "utc", o);
|
|
2648
2649
|
s.push({
|
|
2649
2650
|
label: a,
|
|
2650
2651
|
pos: i,
|
|
@@ -2655,9 +2656,9 @@ var zt = {
|
|
|
2655
2656
|
}
|
|
2656
2657
|
let n = [], r = (e, t) => f.categoryFormat ? f.categoryFormat(e, t) : e, i = Array(e), a = 0;
|
|
2657
2658
|
for (let t = 0; t < e; t++) i[t] = r(T.value[t], t), i[t].length > a && (a = i[t].length);
|
|
2658
|
-
let o = f.tickLabelStyle?.fontSize ?? 10, s = D.value ? a * o * .6 + 8 : o * 1.2 + 8, c =
|
|
2659
|
+
let o = f.tickLabelStyle?.fontSize ?? 10, s = D.value ? a * o * .6 + 8 : o * 1.2 + 8, c = j.value > 0 ? Math.max(1, Math.ceil(s / j.value)) : 1;
|
|
2659
2660
|
for (let t = 0; t < e; t += c) {
|
|
2660
|
-
let e =
|
|
2661
|
+
let e = ne(t) + j.value / 2;
|
|
2661
2662
|
n.push({
|
|
2662
2663
|
label: i[t],
|
|
2663
2664
|
pos: e,
|
|
@@ -2665,15 +2666,15 @@ var zt = {
|
|
|
2665
2666
|
});
|
|
2666
2667
|
}
|
|
2667
2668
|
return n;
|
|
2668
|
-
}),
|
|
2669
|
+
}), B = n(() => {
|
|
2669
2670
|
let e = [];
|
|
2670
2671
|
return S.value.forEach((t, n) => {
|
|
2671
2672
|
!t.legend || t.showInLegend === !1 || e.push({
|
|
2672
2673
|
label: t.legend,
|
|
2673
|
-
color: t.color ??
|
|
2674
|
+
color: t.color ?? de(n),
|
|
2674
2675
|
kind: "bar"
|
|
2675
2676
|
});
|
|
2676
|
-
}),
|
|
2677
|
+
}), se.value.forEach((t) => {
|
|
2677
2678
|
!t.legend || !t.showInLegend || e.push({
|
|
2678
2679
|
label: t.legend,
|
|
2679
2680
|
color: t.color,
|
|
@@ -2681,7 +2682,7 @@ var zt = {
|
|
|
2681
2682
|
dashed: t.dashed
|
|
2682
2683
|
});
|
|
2683
2684
|
}), e;
|
|
2684
|
-
}),
|
|
2685
|
+
}), me = n(() => B.value.map((e) => e.label));
|
|
2685
2686
|
function be() {
|
|
2686
2687
|
if (typeof f.csv == "function") return f.csv();
|
|
2687
2688
|
if (typeof f.csv == "string") return f.csv;
|
|
@@ -2689,12 +2690,12 @@ var zt = {
|
|
|
2689
2690
|
label: e.legend,
|
|
2690
2691
|
data: e.data
|
|
2691
2692
|
}));
|
|
2692
|
-
return
|
|
2693
|
+
return Ue(T.value, e);
|
|
2693
2694
|
}
|
|
2694
|
-
let
|
|
2695
|
+
let xe = n(() => !!f.tooltipData || !!f.tooltipTrigger);
|
|
2695
2696
|
function Ce(e, t) {
|
|
2696
|
-
if (!isFinite(e) || !isFinite(t) ||
|
|
2697
|
-
let n = (D.value ? H.value.left : H.value.top) + (e + .5) *
|
|
2697
|
+
if (!isFinite(e) || !isFinite(t) || j.value === 0) return null;
|
|
2698
|
+
let n = (D.value ? H.value.left : H.value.top) + (e + .5) * j.value, r = P(t);
|
|
2698
2699
|
return D.value ? {
|
|
2699
2700
|
x: n,
|
|
2700
2701
|
y: r
|
|
@@ -2707,12 +2708,12 @@ var zt = {
|
|
|
2707
2708
|
let n = De.value?.getBoundingClientRect();
|
|
2708
2709
|
if (!n) return null;
|
|
2709
2710
|
let r = w.value;
|
|
2710
|
-
if (r === 0 ||
|
|
2711
|
+
if (r === 0 || j.value === 0) return null;
|
|
2711
2712
|
let i = D.value ? e - n.left - H.value.left : t - n.top - H.value.top;
|
|
2712
|
-
return Math.max(0, Math.min(r - 1, Math.floor(i /
|
|
2713
|
+
return Math.max(0, Math.min(r - 1, Math.floor(i / j.value)));
|
|
2713
2714
|
}
|
|
2714
2715
|
let Te = n(() => !!(f.categoryHeader || f.valueHeader)), Ee = n(() => {
|
|
2715
|
-
let e = Te.value ?
|
|
2716
|
+
let e = Te.value ? er : 0, t = f.chartPadding;
|
|
2716
2717
|
return e ? t == null ? { top: e } : typeof t == "number" ? {
|
|
2717
2718
|
top: t + e,
|
|
2718
2719
|
right: t,
|
|
@@ -2722,7 +2723,7 @@ var zt = {
|
|
|
2722
2723
|
...t,
|
|
2723
2724
|
top: (t.top ?? 0) + e
|
|
2724
2725
|
} : t;
|
|
2725
|
-
}), { 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:
|
|
2726
|
+
}), { 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, fullscreenStyle: We, teleportTarget: Ge, exitFullscreen: Ke } = lt({
|
|
2726
2727
|
width: () => f.width,
|
|
2727
2728
|
height: () => f.height,
|
|
2728
2729
|
title: () => f.title,
|
|
@@ -2738,17 +2739,17 @@ var zt = {
|
|
|
2738
2739
|
downloadButton: () => f.downloadButton,
|
|
2739
2740
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
2740
2741
|
chartPadding: () => Ee.value,
|
|
2741
|
-
inlineLegendLabels: () =>
|
|
2742
|
-
hasTooltipSlot: () =>
|
|
2742
|
+
inlineLegendLabels: () => me.value,
|
|
2743
|
+
hasTooltipSlot: () => xe.value,
|
|
2743
2744
|
getCsv: be,
|
|
2744
2745
|
pointerToIndex: we,
|
|
2745
2746
|
scrubAxis: () => D.value ? "x" : "y",
|
|
2746
2747
|
onHover: (e) => h("hover", e)
|
|
2747
|
-
}),
|
|
2748
|
+
}), qe = n(() => Se(f.axisLabelStyle, { fontSize: 13 })), q = n(() => Se(f.tickLabelStyle, {
|
|
2748
2749
|
fontSize: 10,
|
|
2749
2750
|
fillOpacity: V
|
|
2750
|
-
})),
|
|
2751
|
-
let e = f.titleStyle, t = e?.align ?? "left", n = Ne.value, r = t === "left" ?
|
|
2751
|
+
})), Je = n(() => Se(f.legendStyle, { fontSize: 11 })), J = n(() => f.categoryAlign === "start" && !D.value ? tr : H.value.left), Y = n(() => {
|
|
2752
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = Ne.value, r = t === "left" ? J.value : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
2752
2753
|
return {
|
|
2753
2754
|
lines: (f.title ?? "").split("\n"),
|
|
2754
2755
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -2758,12 +2759,12 @@ var zt = {
|
|
|
2758
2759
|
x: r,
|
|
2759
2760
|
anchor: i
|
|
2760
2761
|
};
|
|
2761
|
-
}),
|
|
2762
|
+
}), Ye = n(() => {
|
|
2762
2763
|
let e = G.value;
|
|
2763
2764
|
if (e === null) return;
|
|
2764
2765
|
let t = E.value;
|
|
2765
|
-
return t && Number.isFinite(t[e]) ?
|
|
2766
|
-
}),
|
|
2766
|
+
return t && Number.isFinite(t[e]) ? zt(t[e], f.dateFormat, "utc") : T.value[e];
|
|
2767
|
+
}), X = n(() => {
|
|
2767
2768
|
let e = G.value;
|
|
2768
2769
|
if (e === null) return null;
|
|
2769
2770
|
let t = S.value, n = [];
|
|
@@ -2771,7 +2772,7 @@ var zt = {
|
|
|
2771
2772
|
let i = t[r];
|
|
2772
2773
|
i.showInTooltip !== !1 && n.push({
|
|
2773
2774
|
value: Number(i.data[e] ?? NaN),
|
|
2774
|
-
color: i.color ??
|
|
2775
|
+
color: i.color ?? de(r),
|
|
2775
2776
|
seriesIndex: r
|
|
2776
2777
|
});
|
|
2777
2778
|
}
|
|
@@ -2781,24 +2782,24 @@ var zt = {
|
|
|
2781
2782
|
values: n,
|
|
2782
2783
|
data: f.tooltipData?.[e] ?? null
|
|
2783
2784
|
};
|
|
2784
|
-
}),
|
|
2785
|
+
}), Z = n(() => {
|
|
2785
2786
|
let e = G.value;
|
|
2786
2787
|
if (e === null) return null;
|
|
2787
|
-
let t =
|
|
2788
|
+
let t = ne(e);
|
|
2788
2789
|
return D.value ? {
|
|
2789
2790
|
x: t,
|
|
2790
2791
|
y: H.value.top,
|
|
2791
|
-
w:
|
|
2792
|
+
w: j.value,
|
|
2792
2793
|
h: W.value
|
|
2793
2794
|
} : {
|
|
2794
2795
|
x: H.value.left,
|
|
2795
2796
|
y: t,
|
|
2796
2797
|
w: U.value,
|
|
2797
|
-
h:
|
|
2798
|
+
h: j.value
|
|
2798
2799
|
};
|
|
2799
|
-
}),
|
|
2800
|
-
let e = Me.value.positions, t =
|
|
2801
|
-
return
|
|
2800
|
+
}), Xe = n(() => {
|
|
2801
|
+
let e = Me.value.positions, t = J.value, n = je.value;
|
|
2802
|
+
return B.value.map((r, i) => {
|
|
2802
2803
|
let a = e[i];
|
|
2803
2804
|
return {
|
|
2804
2805
|
...r,
|
|
@@ -2806,7 +2807,7 @@ var zt = {
|
|
|
2806
2807
|
y: n + a.row * 20
|
|
2807
2808
|
};
|
|
2808
2809
|
});
|
|
2809
|
-
}),
|
|
2810
|
+
}), Ze = n(() => {
|
|
2810
2811
|
let e = f.barLabels;
|
|
2811
2812
|
if (!e) return null;
|
|
2812
2813
|
let t = e === !0 ? {} : e;
|
|
@@ -2817,37 +2818,37 @@ var zt = {
|
|
|
2817
2818
|
align: t.align ?? "center",
|
|
2818
2819
|
overlap: t.overlap ?? "shift",
|
|
2819
2820
|
minSize: t.minSize ?? 0,
|
|
2820
|
-
fontSize: t.fontSize ??
|
|
2821
|
+
fontSize: t.fontSize ?? nr,
|
|
2821
2822
|
fontWeight: t.fontWeight
|
|
2822
2823
|
};
|
|
2823
2824
|
});
|
|
2824
|
-
function
|
|
2825
|
-
let n =
|
|
2826
|
-
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ?
|
|
2825
|
+
function Qe(e, t) {
|
|
2826
|
+
let n = Ze.value?.format;
|
|
2827
|
+
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ? he(e) : te(e, f.valueTickFormat) : te(e, n);
|
|
2827
2828
|
}
|
|
2828
|
-
function
|
|
2829
|
-
for (let r =
|
|
2830
|
-
let i =
|
|
2829
|
+
function $e(e, t, n) {
|
|
2830
|
+
for (let r = F.value.length - 1; r >= 0; r--) {
|
|
2831
|
+
let i = F.value[r];
|
|
2831
2832
|
if (i.categoryIndex === e && t >= i.x && t <= i.x + i.w && n >= i.y && n <= i.y + i.h) return i.color;
|
|
2832
2833
|
}
|
|
2833
2834
|
return null;
|
|
2834
2835
|
}
|
|
2835
|
-
let
|
|
2836
|
-
let e =
|
|
2836
|
+
let et = n(() => {
|
|
2837
|
+
let e = Ze.value;
|
|
2837
2838
|
if (!e) return [];
|
|
2838
2839
|
let t = D.value, n = e.fontSize, r = [];
|
|
2839
|
-
for (let i of
|
|
2840
|
-
let a =
|
|
2840
|
+
for (let i of F.value) {
|
|
2841
|
+
let a = Qe(i.value, {
|
|
2841
2842
|
value: i.value,
|
|
2842
2843
|
categoryIndex: i.categoryIndex,
|
|
2843
2844
|
seriesIndex: i.seriesIndex,
|
|
2844
2845
|
category: T.value[i.categoryIndex] ?? String(i.categoryIndex)
|
|
2845
2846
|
});
|
|
2846
2847
|
if (!a) continue;
|
|
2847
|
-
let o = t ? i.h : i.w, s = a.length * n *
|
|
2848
|
-
if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m +
|
|
2849
|
-
else if (e.align === "start") u = h +
|
|
2850
|
-
else if (e.align === "end") d = m -
|
|
2848
|
+
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;
|
|
2849
|
+
if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m + ir, d = u + g, p = "start";
|
|
2850
|
+
else if (e.align === "start") u = h + ir, d = u + g, p = "start";
|
|
2851
|
+
else if (e.align === "end") d = m - ir, u = d - g, p = "end";
|
|
2851
2852
|
else {
|
|
2852
2853
|
let e = (m + h) / 2;
|
|
2853
2854
|
u = e - g / 2, d = e + g / 2, p = "middle";
|
|
@@ -2873,12 +2874,12 @@ var zt = {
|
|
|
2873
2874
|
t.sort((e, t) => e.lo - t.lo);
|
|
2874
2875
|
let n = -Infinity;
|
|
2875
2876
|
for (let r of t) {
|
|
2876
|
-
if (r.lo < n +
|
|
2877
|
+
if (r.lo < n + ar) {
|
|
2877
2878
|
if (e.overlap === "hide") {
|
|
2878
2879
|
r.hidden = !0;
|
|
2879
2880
|
continue;
|
|
2880
2881
|
}
|
|
2881
|
-
let t = n +
|
|
2882
|
+
let t = n + ar - r.lo;
|
|
2882
2883
|
r.lo += t, r.hi += t, r.inside = !1, r.svgAnchor = "start";
|
|
2883
2884
|
}
|
|
2884
2885
|
if (r.hi > i) {
|
|
@@ -2895,10 +2896,10 @@ var zt = {
|
|
|
2895
2896
|
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);
|
|
2896
2897
|
let l;
|
|
2897
2898
|
if (!o) l = e.color;
|
|
2898
|
-
else if (i.inside) l =
|
|
2899
|
+
else if (i.inside) l = gt(i.bar.color);
|
|
2899
2900
|
else {
|
|
2900
|
-
let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r =
|
|
2901
|
-
l = r ?
|
|
2901
|
+
let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r = $e(i.bar.categoryIndex, e, n);
|
|
2902
|
+
l = r ? gt(r) : "currentColor";
|
|
2902
2903
|
}
|
|
2903
2904
|
s.push({
|
|
2904
2905
|
key: `${i.bar.categoryIndex}-${i.bar.seriesIndex}`,
|
|
@@ -2912,23 +2913,23 @@ var zt = {
|
|
|
2912
2913
|
});
|
|
2913
2914
|
}
|
|
2914
2915
|
return s;
|
|
2915
|
-
}),
|
|
2916
|
+
}), tt = n(() => {
|
|
2916
2917
|
let e = H.value.left - 6;
|
|
2917
2918
|
switch (f.categoryAlign ?? "end") {
|
|
2918
2919
|
case "start": return {
|
|
2919
2920
|
anchor: "start",
|
|
2920
|
-
x:
|
|
2921
|
+
x: tr
|
|
2921
2922
|
};
|
|
2922
2923
|
case "center": return {
|
|
2923
2924
|
anchor: "middle",
|
|
2924
|
-
x: (
|
|
2925
|
+
x: (tr + e) / 2
|
|
2925
2926
|
};
|
|
2926
2927
|
default: return {
|
|
2927
2928
|
anchor: "end",
|
|
2928
2929
|
x: e
|
|
2929
2930
|
};
|
|
2930
2931
|
}
|
|
2931
|
-
}),
|
|
2932
|
+
}), nt = n(() => {
|
|
2932
2933
|
let e = [], t = H.value.top - 7;
|
|
2933
2934
|
if (f.valueHeader && e.push({
|
|
2934
2935
|
key: "vh",
|
|
@@ -2937,7 +2938,7 @@ var zt = {
|
|
|
2937
2938
|
y: t,
|
|
2938
2939
|
anchor: "start"
|
|
2939
2940
|
}), f.categoryHeader) {
|
|
2940
|
-
let n = !D.value, r =
|
|
2941
|
+
let n = !D.value, r = tt.value;
|
|
2941
2942
|
e.push({
|
|
2942
2943
|
key: "ch",
|
|
2943
2944
|
text: f.categoryHeader,
|
|
@@ -2949,26 +2950,26 @@ var zt = {
|
|
|
2949
2950
|
return e;
|
|
2950
2951
|
});
|
|
2951
2952
|
return (n, l) => (_(), r(t, {
|
|
2952
|
-
to: C(
|
|
2953
|
+
to: C(Ge),
|
|
2953
2954
|
disabled: !C(He)
|
|
2954
2955
|
}, [o("div", d({
|
|
2955
2956
|
ref_key: "containerRef",
|
|
2956
2957
|
ref: De
|
|
2957
2958
|
}, n.$attrs, {
|
|
2958
2959
|
class: ["bar-chart-wrapper", { "is-fullscreen": C(He) }],
|
|
2959
|
-
style: C(
|
|
2960
|
+
style: C(We)
|
|
2960
2961
|
}), [
|
|
2961
|
-
c.menu ? (_(), r(
|
|
2962
|
+
c.menu ? (_(), r(pe, {
|
|
2962
2963
|
key: 0,
|
|
2963
|
-
items: C(
|
|
2964
|
+
items: C(Ie),
|
|
2964
2965
|
"is-fullscreen": C(He),
|
|
2965
|
-
onClose: C(
|
|
2966
|
+
onClose: C(Ke)
|
|
2966
2967
|
}, null, 8, [
|
|
2967
2968
|
"items",
|
|
2968
2969
|
"is-fullscreen",
|
|
2969
2970
|
"onClose"
|
|
2970
2971
|
])) : i("", !0),
|
|
2971
|
-
o("div",
|
|
2972
|
+
o("div", Dn, x(C(He) ? "Chart expanded to fill window" : ""), 1),
|
|
2972
2973
|
(_(), a("svg", {
|
|
2973
2974
|
ref_key: "svgRef",
|
|
2974
2975
|
ref: Oe,
|
|
@@ -2977,35 +2978,35 @@ var zt = {
|
|
|
2977
2978
|
}, [
|
|
2978
2979
|
c.title ? (_(), a("text", {
|
|
2979
2980
|
key: 0,
|
|
2980
|
-
x:
|
|
2981
|
-
y:
|
|
2982
|
-
"text-anchor":
|
|
2983
|
-
"font-size":
|
|
2984
|
-
"font-weight":
|
|
2985
|
-
fill:
|
|
2986
|
-
}, [(_(!0), a(e, null, y(
|
|
2981
|
+
x: Y.value.x,
|
|
2982
|
+
y: Y.value.lineHeight,
|
|
2983
|
+
"text-anchor": Y.value.anchor,
|
|
2984
|
+
"font-size": Y.value.fontSize,
|
|
2985
|
+
"font-weight": Y.value.fontWeight,
|
|
2986
|
+
fill: Y.value.color
|
|
2987
|
+
}, [(_(!0), a(e, null, y(Y.value.lines, (e, t) => (_(), a("tspan", {
|
|
2987
2988
|
key: t,
|
|
2988
|
-
x:
|
|
2989
|
-
dy: t === 0 ? 0 :
|
|
2990
|
-
}, x(e), 9,
|
|
2991
|
-
(_(!0), a(e, null, y(
|
|
2989
|
+
x: Y.value.x,
|
|
2990
|
+
dy: t === 0 ? 0 : Y.value.lineHeight
|
|
2991
|
+
}, x(e), 9, An))), 128))], 8, kn)) : i("", !0),
|
|
2992
|
+
(_(!0), a(e, null, y(nt.value, (e) => (_(), a("text", {
|
|
2992
2993
|
key: e.key,
|
|
2993
2994
|
"data-testid": e.key === "ch" ? "category-header" : "value-header",
|
|
2994
2995
|
x: e.x,
|
|
2995
2996
|
y: e.y,
|
|
2996
2997
|
"text-anchor": e.anchor,
|
|
2997
|
-
"font-size":
|
|
2998
|
-
fill:
|
|
2998
|
+
"font-size": qe.value.fontSize,
|
|
2999
|
+
fill: qe.value.fill,
|
|
2999
3000
|
"font-weight": "600"
|
|
3000
|
-
}, x(e.text), 9,
|
|
3001
|
-
|
|
3001
|
+
}, x(e.text), 9, jn))), 128)),
|
|
3002
|
+
Xe.value.length > 0 ? (_(), a("g", Mn, [(_(!0), a(e, null, y(Xe.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.kind === "bar" ? (_(), a("rect", {
|
|
3002
3003
|
key: 0,
|
|
3003
3004
|
x: t.x,
|
|
3004
3005
|
y: t.y - 5,
|
|
3005
3006
|
width: "12",
|
|
3006
3007
|
height: "10",
|
|
3007
3008
|
fill: t.color
|
|
3008
|
-
}, null, 8,
|
|
3009
|
+
}, null, 8, Nn)) : (_(), a("line", {
|
|
3009
3010
|
key: 1,
|
|
3010
3011
|
x1: t.x,
|
|
3011
3012
|
y1: t.y,
|
|
@@ -3014,13 +3015,13 @@ var zt = {
|
|
|
3014
3015
|
stroke: t.color,
|
|
3015
3016
|
"stroke-width": "2",
|
|
3016
3017
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
3017
|
-
}, null, 8,
|
|
3018
|
+
}, null, 8, Pn)), o("text", {
|
|
3018
3019
|
x: t.x + 18,
|
|
3019
3020
|
y: t.y + 4,
|
|
3020
|
-
"font-size":
|
|
3021
|
-
fill:
|
|
3022
|
-
"font-weight":
|
|
3023
|
-
}, x(t.label), 9,
|
|
3021
|
+
"font-size": Je.value.fontSize,
|
|
3022
|
+
fill: Je.value.fill,
|
|
3023
|
+
"font-weight": Je.value.fontWeight
|
|
3024
|
+
}, x(t.label), 9, Fn)], 64))), 128))])) : i("", !0),
|
|
3024
3025
|
!D.value || c.valueAxis ? (_(), a("line", {
|
|
3025
3026
|
key: 2,
|
|
3026
3027
|
x1: C(R)(C(H).left),
|
|
@@ -3029,7 +3030,7 @@ var zt = {
|
|
|
3029
3030
|
y2: C(R)(C(H).top + C(W)),
|
|
3030
3031
|
stroke: "currentColor",
|
|
3031
3032
|
"stroke-opacity": "0.3"
|
|
3032
|
-
}, null, 8,
|
|
3033
|
+
}, null, 8, In)) : i("", !0),
|
|
3033
3034
|
D.value || c.valueAxis ? (_(), a("line", {
|
|
3034
3035
|
key: 3,
|
|
3035
3036
|
x1: C(R)(C(H).left),
|
|
@@ -3038,8 +3039,8 @@ var zt = {
|
|
|
3038
3039
|
y2: C(R)(C(H).top + C(W)),
|
|
3039
3040
|
stroke: "currentColor",
|
|
3040
3041
|
"stroke-opacity": "0.3"
|
|
3041
|
-
}, null, 8,
|
|
3042
|
-
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(
|
|
3042
|
+
}, null, 8, Ln)) : i("", !0),
|
|
3043
|
+
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(L.value, (e, t) => (_(), a("line", {
|
|
3043
3044
|
key: "vg" + t,
|
|
3044
3045
|
x1: D.value ? C(H).left : e.pos,
|
|
3045
3046
|
y1: D.value ? e.pos : C(H).top,
|
|
@@ -3047,81 +3048,81 @@ var zt = {
|
|
|
3047
3048
|
y2: D.value ? e.pos : C(H).top + C(W),
|
|
3048
3049
|
stroke: "currentColor",
|
|
3049
3050
|
"stroke-opacity": "0.1"
|
|
3050
|
-
}, null, 8,
|
|
3051
|
-
|
|
3051
|
+
}, null, 8, Rn))), 128)) : i("", !0),
|
|
3052
|
+
Z.value && xe.value ? (_(), a("rect", {
|
|
3052
3053
|
key: 5,
|
|
3053
|
-
x:
|
|
3054
|
-
y:
|
|
3055
|
-
width:
|
|
3056
|
-
height:
|
|
3054
|
+
x: Z.value.x,
|
|
3055
|
+
y: Z.value.y,
|
|
3056
|
+
width: Z.value.w,
|
|
3057
|
+
height: Z.value.h,
|
|
3057
3058
|
fill: "currentColor",
|
|
3058
3059
|
"fill-opacity": "0.06",
|
|
3059
3060
|
"pointer-events": "none"
|
|
3060
|
-
}, null, 8,
|
|
3061
|
-
c.valueAxis && D.value ? (_(!0), a(e, { key: 6 }, y(
|
|
3061
|
+
}, null, 8, zn)) : i("", !0),
|
|
3062
|
+
c.valueAxis && D.value ? (_(!0), a(e, { key: 6 }, y(L.value, (e, t) => (_(), a("text", {
|
|
3062
3063
|
key: "vt" + t,
|
|
3063
3064
|
"data-testid": "value-tick",
|
|
3064
3065
|
x: C(H).left - 6,
|
|
3065
3066
|
y: e.pos,
|
|
3066
3067
|
"text-anchor": "end",
|
|
3067
3068
|
"dominant-baseline": "middle",
|
|
3068
|
-
"font-size":
|
|
3069
|
-
fill:
|
|
3070
|
-
"font-weight":
|
|
3071
|
-
"fill-opacity":
|
|
3072
|
-
}, x(e.value), 9,
|
|
3069
|
+
"font-size": q.value.fontSize,
|
|
3070
|
+
fill: q.value.fill,
|
|
3071
|
+
"font-weight": q.value.fontWeight,
|
|
3072
|
+
"fill-opacity": q.value.fillOpacity
|
|
3073
|
+
}, x(e.value), 9, Bn))), 128)) : c.valueAxis ? (_(!0), a(e, { key: 7 }, y(L.value, (e, t) => (_(), a("text", {
|
|
3073
3074
|
key: "vt" + t,
|
|
3074
3075
|
"data-testid": "value-tick",
|
|
3075
3076
|
x: e.pos,
|
|
3076
3077
|
y: C(H).top + C(W) + 16,
|
|
3077
3078
|
"text-anchor": "middle",
|
|
3078
|
-
"font-size":
|
|
3079
|
-
fill:
|
|
3080
|
-
"font-weight":
|
|
3081
|
-
"fill-opacity":
|
|
3082
|
-
}, x(e.value), 9,
|
|
3079
|
+
"font-size": q.value.fontSize,
|
|
3080
|
+
fill: q.value.fill,
|
|
3081
|
+
"font-weight": q.value.fontWeight,
|
|
3082
|
+
"fill-opacity": q.value.fillOpacity
|
|
3083
|
+
}, x(e.value), 9, Vn))), 128)) : i("", !0),
|
|
3083
3084
|
c.yLabel ? (_(), a("text", {
|
|
3084
3085
|
key: 8,
|
|
3085
3086
|
x: 0,
|
|
3086
3087
|
y: 0,
|
|
3087
3088
|
transform: `translate(14, ${C(H).top + C(W) / 2}) rotate(-90)`,
|
|
3088
3089
|
"text-anchor": "middle",
|
|
3089
|
-
"font-size":
|
|
3090
|
-
fill:
|
|
3091
|
-
"font-weight":
|
|
3092
|
-
}, x(c.yLabel), 9,
|
|
3093
|
-
D.value ? (_(!0), a(e, { key: 9 }, y(
|
|
3090
|
+
"font-size": qe.value.fontSize,
|
|
3091
|
+
fill: qe.value.fill,
|
|
3092
|
+
"font-weight": qe.value.fontWeight
|
|
3093
|
+
}, x(c.yLabel), 9, Hn)) : i("", !0),
|
|
3094
|
+
D.value ? (_(!0), a(e, { key: 9 }, y(z.value, (e, t) => (_(), a("text", {
|
|
3094
3095
|
key: "ct" + t,
|
|
3095
3096
|
"data-testid": "category-tick",
|
|
3096
3097
|
x: e.pos,
|
|
3097
3098
|
y: C(H).top + C(W) + 16,
|
|
3098
3099
|
"text-anchor": e.anchor,
|
|
3099
|
-
"font-size":
|
|
3100
|
-
fill:
|
|
3101
|
-
"font-weight":
|
|
3102
|
-
"fill-opacity":
|
|
3103
|
-
}, x(e.label), 9,
|
|
3100
|
+
"font-size": q.value.fontSize,
|
|
3101
|
+
fill: q.value.fill,
|
|
3102
|
+
"font-weight": q.value.fontWeight,
|
|
3103
|
+
"fill-opacity": q.value.fillOpacity
|
|
3104
|
+
}, x(e.label), 9, Un))), 128)) : (_(!0), a(e, { key: 10 }, y(z.value, (e, t) => (_(), a("text", {
|
|
3104
3105
|
key: "ct" + t,
|
|
3105
3106
|
"data-testid": "category-tick",
|
|
3106
|
-
x:
|
|
3107
|
+
x: tt.value.x,
|
|
3107
3108
|
y: e.pos,
|
|
3108
|
-
"text-anchor":
|
|
3109
|
+
"text-anchor": tt.value.anchor,
|
|
3109
3110
|
"dominant-baseline": "middle",
|
|
3110
|
-
"font-size":
|
|
3111
|
-
fill:
|
|
3112
|
-
"font-weight":
|
|
3113
|
-
"fill-opacity":
|
|
3114
|
-
}, x(e.label), 9,
|
|
3111
|
+
"font-size": q.value.fontSize,
|
|
3112
|
+
fill: q.value.fill,
|
|
3113
|
+
"font-weight": q.value.fontWeight,
|
|
3114
|
+
"fill-opacity": q.value.fillOpacity
|
|
3115
|
+
}, x(e.label), 9, Wn))), 128)),
|
|
3115
3116
|
c.xLabel ? (_(), a("text", {
|
|
3116
3117
|
key: 11,
|
|
3117
3118
|
x: C(H).left + C(U) / 2,
|
|
3118
3119
|
y: C(Ae) - 4,
|
|
3119
3120
|
"text-anchor": "middle",
|
|
3120
|
-
"font-size":
|
|
3121
|
-
fill:
|
|
3122
|
-
"font-weight":
|
|
3123
|
-
}, x(c.xLabel), 9,
|
|
3124
|
-
(_(!0), a(e, null, y(
|
|
3121
|
+
"font-size": qe.value.fontSize,
|
|
3122
|
+
fill: qe.value.fill,
|
|
3123
|
+
"font-weight": qe.value.fontWeight
|
|
3124
|
+
}, x(c.xLabel), 9, Gn)) : i("", !0),
|
|
3125
|
+
(_(!0), a(e, null, y(F.value, (e, t) => (_(), a("rect", {
|
|
3125
3126
|
key: "bar" + t,
|
|
3126
3127
|
"data-testid": "bar",
|
|
3127
3128
|
"data-category": e.categoryIndex,
|
|
@@ -3133,8 +3134,8 @@ var zt = {
|
|
|
3133
3134
|
fill: e.color,
|
|
3134
3135
|
"fill-opacity": e.opacity,
|
|
3135
3136
|
style: m(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
3136
|
-
}, null, 12,
|
|
3137
|
-
(_(!0), a(e, null, y(
|
|
3137
|
+
}, null, 12, Kn))), 128)),
|
|
3138
|
+
(_(!0), a(e, null, y(et.value, (e) => (_(), a("text", {
|
|
3138
3139
|
key: "blbl" + e.key,
|
|
3139
3140
|
"data-testid": "bar-label",
|
|
3140
3141
|
x: e.x,
|
|
@@ -3145,8 +3146,8 @@ var zt = {
|
|
|
3145
3146
|
"font-weight": e.fontWeight,
|
|
3146
3147
|
fill: e.fill,
|
|
3147
3148
|
"pointer-events": "none"
|
|
3148
|
-
}, x(e.text), 9,
|
|
3149
|
-
(_(!0), a(e, null, y(
|
|
3149
|
+
}, x(e.text), 9, qn))), 128)),
|
|
3150
|
+
(_(!0), a(e, null, y(I.value, (t, n) => (_(), a(e, { key: "sl" + n }, [t.pathD ? (_(), a("path", {
|
|
3150
3151
|
key: 0,
|
|
3151
3152
|
"data-testid": "summary-line",
|
|
3152
3153
|
d: t.pathD,
|
|
@@ -3158,7 +3159,7 @@ var zt = {
|
|
|
3158
3159
|
"stroke-linecap": "round",
|
|
3159
3160
|
"stroke-linejoin": "round",
|
|
3160
3161
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3161
|
-
}, null, 12,
|
|
3162
|
+
}, null, 12, Jn)) : i("", !0), t.dots ? (_(!0), a(e, { key: 1 }, y(t.points, (e, r) => (_(), a("circle", {
|
|
3162
3163
|
key: "sld" + n + "-" + r,
|
|
3163
3164
|
cx: e.x,
|
|
3164
3165
|
cy: e.y,
|
|
@@ -3166,8 +3167,8 @@ var zt = {
|
|
|
3166
3167
|
fill: t.color,
|
|
3167
3168
|
"fill-opacity": t.opacity,
|
|
3168
3169
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3169
|
-
}, null, 12,
|
|
3170
|
-
|
|
3170
|
+
}, null, 12, Yn))), 128)) : i("", !0)], 64))), 128)),
|
|
3171
|
+
xe.value ? (_(), a("rect", d({
|
|
3171
3172
|
key: 12,
|
|
3172
3173
|
x: C(H).left,
|
|
3173
3174
|
y: C(H).top,
|
|
@@ -3175,15 +3176,15 @@ var zt = {
|
|
|
3175
3176
|
height: C(W),
|
|
3176
3177
|
fill: "transparent",
|
|
3177
3178
|
style: `cursor: crosshair; touch-action: ${D.value ? "pan-y" : "pan-x"}`
|
|
3178
|
-
}, ee(C(
|
|
3179
|
-
c.annotations && c.annotations.length > 0 ? (_(), r(C(
|
|
3179
|
+
}, ee(C(Fe), !0)), null, 16, Xn)) : i("", !0),
|
|
3180
|
+
c.annotations && c.annotations.length > 0 ? (_(), r(C(ot), {
|
|
3180
3181
|
key: 13,
|
|
3181
3182
|
annotations: c.annotations,
|
|
3182
3183
|
project: Ce,
|
|
3183
3184
|
bounds: C(Ne)
|
|
3184
3185
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
3185
|
-
], 8,
|
|
3186
|
-
|
|
3186
|
+
], 8, On)),
|
|
3187
|
+
xe.value && C(G) !== null && X.value ? (_(), a("div", {
|
|
3187
3188
|
key: 1,
|
|
3188
3189
|
ref_key: "tooltipRef",
|
|
3189
3190
|
ref: K,
|
|
@@ -3196,28 +3197,28 @@ var zt = {
|
|
|
3196
3197
|
transform: C(Pe) ? `translate3d(${C(Pe).left}px, ${C(Pe).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
3197
3198
|
visibility: C(Pe) ? "visible" : "hidden"
|
|
3198
3199
|
})
|
|
3199
|
-
}, [b(n.$slots, "tooltip", p(u(
|
|
3200
|
+
}, [b(n.$slots, "tooltip", p(u(X.value)), () => [o("div", Zn, [Ye.value ? (_(), a("div", Qn, x(Ye.value), 1)) : i("", !0), (_(!0), a(e, null, y(X.value.values, (e) => (_(), a("div", {
|
|
3200
3201
|
key: e.seriesIndex,
|
|
3201
3202
|
class: "bar-chart-tooltip-row"
|
|
3202
3203
|
}, [o("span", {
|
|
3203
3204
|
class: "bar-chart-tooltip-swatch",
|
|
3204
3205
|
style: m({ background: e.color })
|
|
3205
|
-
}, null, 4), s(" " + x(isFinite(e.value) ? C(
|
|
3206
|
-
C(
|
|
3206
|
+
}, null, 4), s(" " + x(isFinite(e.value) ? C(fe)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
3207
|
+
C(Le) ? (_(), a("a", {
|
|
3207
3208
|
key: 2,
|
|
3208
3209
|
class: "bar-chart-download-link",
|
|
3209
|
-
href: C(
|
|
3210
|
-
download: `${C(
|
|
3211
|
-
}, x(C(
|
|
3212
|
-
C(
|
|
3210
|
+
href: C(Re),
|
|
3211
|
+
download: `${C(Ve)()}.csv`
|
|
3212
|
+
}, x(C(Le)), 9, $n)) : i("", !0),
|
|
3213
|
+
C(ze) ? (_(), a("button", {
|
|
3213
3214
|
key: 3,
|
|
3214
3215
|
type: "button",
|
|
3215
3216
|
class: "bar-chart-download-button",
|
|
3216
|
-
onClick: l[0] ||= (...e) => C(
|
|
3217
|
-
}, x(C(
|
|
3217
|
+
onClick: l[0] ||= (...e) => C(Be) && C(Be)(...e)
|
|
3218
|
+
}, x(C(ze)), 1)) : i("", !0)
|
|
3218
3219
|
], 16)], 8, ["to", "disabled"]));
|
|
3219
3220
|
}
|
|
3220
|
-
}), [["__scopeId", "data-v-67594e38"]]),
|
|
3221
|
+
}), [["__scopeId", "data-v-67594e38"]]), sr = {
|
|
3221
3222
|
ref: "root",
|
|
3222
3223
|
class: "chart-tooltip-content",
|
|
3223
3224
|
style: {
|
|
@@ -3229,7 +3230,7 @@ var zt = {
|
|
|
3229
3230
|
"pointer-events": "none",
|
|
3230
3231
|
transform: "translateY(-50%)"
|
|
3231
3232
|
}
|
|
3232
|
-
},
|
|
3233
|
+
}, cr = /* @__PURE__ */ l({
|
|
3233
3234
|
__name: "ChoroplethTooltip",
|
|
3234
3235
|
setup(e, { expose: n }) {
|
|
3235
3236
|
let a = v(null), s = T("root");
|
|
@@ -3240,21 +3241,21 @@ var zt = {
|
|
|
3240
3241
|
getEl() {
|
|
3241
3242
|
return s.value;
|
|
3242
3243
|
}
|
|
3243
|
-
}), (e, n) => (_(), r(t, { to: "body" }, [o("div",
|
|
3244
|
+
}), (e, n) => (_(), r(t, { to: "body" }, [o("div", sr, [a.value ? b(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
|
|
3244
3245
|
}
|
|
3245
|
-
}),
|
|
3246
|
+
}), lr = {
|
|
3246
3247
|
class: "chart-sr-only",
|
|
3247
3248
|
"aria-live": "polite"
|
|
3248
|
-
},
|
|
3249
|
+
}, ur = {
|
|
3249
3250
|
key: 1,
|
|
3250
3251
|
class: "choropleth-header"
|
|
3251
|
-
},
|
|
3252
|
+
}, dr = {
|
|
3252
3253
|
key: 0,
|
|
3253
3254
|
class: "choropleth-legend-title"
|
|
3254
|
-
},
|
|
3255
|
+
}, fr = {
|
|
3255
3256
|
key: 2,
|
|
3256
3257
|
class: "choropleth-legend-continuous"
|
|
3257
|
-
},
|
|
3258
|
+
}, pr = { class: "choropleth-legend-ticks" }, mr = ["viewBox"], hr = ["innerHTML"], gr = "http://www.w3.org/2000/svg", _r = 10, vr = 600, yr = 450, br = 1e3, xr = 12, Sr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3258
3259
|
inheritAttrs: !1,
|
|
3259
3260
|
__name: "ChoroplethMap",
|
|
3260
3261
|
props: {
|
|
@@ -3262,6 +3263,7 @@ var zt = {
|
|
|
3262
3263
|
data: {},
|
|
3263
3264
|
geoType: { default: "states" },
|
|
3264
3265
|
dataGeoType: {},
|
|
3266
|
+
state: {},
|
|
3265
3267
|
width: {},
|
|
3266
3268
|
height: {},
|
|
3267
3269
|
colorScale: {},
|
|
@@ -3288,12 +3290,20 @@ var zt = {
|
|
|
3288
3290
|
type: Boolean,
|
|
3289
3291
|
default: !1
|
|
3290
3292
|
},
|
|
3293
|
+
twoFingerPan: {
|
|
3294
|
+
type: Boolean,
|
|
3295
|
+
default: !1
|
|
3296
|
+
},
|
|
3291
3297
|
tooltipTrigger: {},
|
|
3292
3298
|
tooltipFormat: {},
|
|
3293
3299
|
tooltipValueFormat: {},
|
|
3294
3300
|
tooltipClamp: { default: "chart" },
|
|
3295
3301
|
focus: {},
|
|
3296
3302
|
focusZoomLevel: { default: 4 },
|
|
3303
|
+
focusZoom: {
|
|
3304
|
+
type: Boolean,
|
|
3305
|
+
default: !0
|
|
3306
|
+
},
|
|
3297
3307
|
fullscreenTarget: {}
|
|
3298
3308
|
},
|
|
3299
3309
|
emits: [
|
|
@@ -3302,7 +3312,7 @@ var zt = {
|
|
|
3302
3312
|
"update:focus"
|
|
3303
3313
|
],
|
|
3304
3314
|
setup(c, { emit: l }) {
|
|
3305
|
-
let f = c, ee = l, T = (e) => e, O = v(null), k = v(null),
|
|
3315
|
+
let f = c, ee = l, T = (e) => e, O = v(null), k = v(null), A = v(null), j = v(null), M = v(null), N = v(null), ne = w(), re = n(() => !!f.tooltipTrigger || !!f.tooltipFormat || !!ne.tooltip), P = n(() => {
|
|
3306
3316
|
let e = f.legendStyle, t = {};
|
|
3307
3317
|
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;
|
|
3308
3318
|
}), de = n(() => {
|
|
@@ -3314,55 +3324,55 @@ var zt = {
|
|
|
3314
3324
|
width: "100%"
|
|
3315
3325
|
};
|
|
3316
3326
|
return e?.color && (t.color = e.color), t;
|
|
3317
|
-
}),
|
|
3327
|
+
}), fe = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map(), R = null, z = null, B = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map(), he = !1, ge = typeof window < "u" && "ontouchstart" in window, _e = null, ve = {
|
|
3318
3328
|
width: 0,
|
|
3319
3329
|
height: 0
|
|
3320
|
-
},
|
|
3321
|
-
function Te() {
|
|
3322
|
-
let e = ne.value;
|
|
3323
|
-
e && (e.addEventListener("touchstart", St, { passive: !0 }), e.addEventListener("touchend", Ct), e.addEventListener("touchcancel", wt, { passive: !0 }), !he && (e.addEventListener("click", yt), e.addEventListener("mouseover", yt), e.addEventListener("mousemove", bt), e.addEventListener("mouseout", xt)));
|
|
3324
|
-
}
|
|
3330
|
+
}, ye = null, be = !1, V = null, xe = v(!1), Se = 0, Ce = 0, we = 0, Te = null;
|
|
3325
3331
|
function Ee() {
|
|
3326
|
-
let e =
|
|
3327
|
-
e && (e.
|
|
3332
|
+
let e = A.value;
|
|
3333
|
+
e && (e.addEventListener("touchstart", Et, { passive: !0 }), e.addEventListener("touchend", Dt), e.addEventListener("touchcancel", Ot, { passive: !0 }), !ge && (e.addEventListener("click", Ct), e.addEventListener("mouseover", Ct), e.addEventListener("mousemove", wt), e.addEventListener("mouseout", Tt)));
|
|
3328
3334
|
}
|
|
3329
3335
|
function De() {
|
|
3330
|
-
|
|
3336
|
+
let e = A.value;
|
|
3337
|
+
e && (e.removeEventListener("touchstart", Et), e.removeEventListener("touchend", Dt), e.removeEventListener("touchcancel", Ot), e.removeEventListener("click", Ct), e.removeEventListener("mouseover", Ct), e.removeEventListener("mousemove", wt), e.removeEventListener("mouseout", Tt));
|
|
3338
|
+
}
|
|
3339
|
+
function Oe() {
|
|
3340
|
+
bt();
|
|
3331
3341
|
}
|
|
3332
3342
|
h(() => {
|
|
3333
|
-
|
|
3343
|
+
ke(), Ee(), At(), W(), ft(), window.addEventListener("scroll", Oe, {
|
|
3334
3344
|
passive: !0,
|
|
3335
3345
|
capture: !0
|
|
3336
|
-
}), window.addEventListener("resize",
|
|
3346
|
+
}), window.addEventListener("resize", Oe, { passive: !0 });
|
|
3337
3347
|
}), g(() => {
|
|
3338
|
-
|
|
3348
|
+
_e?.disconnect(), we && cancelAnimationFrame(we), Ae(), De(), window.removeEventListener("scroll", Oe, { capture: !0 }), window.removeEventListener("resize", Oe);
|
|
3339
3349
|
});
|
|
3340
|
-
function
|
|
3341
|
-
if (!k.value || !
|
|
3342
|
-
let e =
|
|
3350
|
+
function ke() {
|
|
3351
|
+
if (!k.value || !A.value) return;
|
|
3352
|
+
let e = I(k.value), t = Math.max(12, f.focusZoomLevel);
|
|
3343
3353
|
V = oe().scaleExtent([1, t]).on("start", () => {
|
|
3344
|
-
|
|
3354
|
+
he = !0, bt();
|
|
3345
3355
|
}).on("zoom", (e) => {
|
|
3346
|
-
|
|
3356
|
+
A.value && A.value.setAttribute("transform", e.transform);
|
|
3347
3357
|
let t = e.transform;
|
|
3348
|
-
|
|
3358
|
+
xe.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
3349
3359
|
}).on("end", () => {
|
|
3350
|
-
|
|
3360
|
+
he = !1;
|
|
3351
3361
|
}), V.filter((e) => {
|
|
3352
|
-
let t =
|
|
3362
|
+
let t = Z.value.length > 0 && f.focusZoom !== !1, n = !!f.zoom || t, r = !!f.pan || t;
|
|
3353
3363
|
if (e.type === "wheel" || e.type === "dblclick") {
|
|
3354
3364
|
if (!n) return !1;
|
|
3355
3365
|
} else if (e.type === "mousedown" || e.type === "touchstart") {
|
|
3356
|
-
if (!r) return !1;
|
|
3366
|
+
if (!r || f.twoFingerPan && e.type === "touchstart" && e.touches.length < 2) return !1;
|
|
3357
3367
|
} else if (!n && !r) return !1;
|
|
3358
3368
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
3359
3369
|
}), e.call(V);
|
|
3360
3370
|
}
|
|
3361
|
-
function
|
|
3362
|
-
k.value && V && (
|
|
3371
|
+
function Ae() {
|
|
3372
|
+
k.value && V && (I(k.value).on(".zoom", null), V = null);
|
|
3363
3373
|
}
|
|
3364
|
-
function
|
|
3365
|
-
let t =
|
|
3374
|
+
function je(e) {
|
|
3375
|
+
let t = Xe.value, n = Y.value, r = [];
|
|
3366
3376
|
for (let i of e) {
|
|
3367
3377
|
let e = i.geoType ?? f.geoType, a = t.get(e);
|
|
3368
3378
|
if (!a) continue;
|
|
@@ -3380,87 +3390,115 @@ var zt = {
|
|
|
3380
3390
|
}
|
|
3381
3391
|
return r;
|
|
3382
3392
|
}
|
|
3383
|
-
function
|
|
3393
|
+
function Me(e) {
|
|
3384
3394
|
let t = /* @__PURE__ */ new Set();
|
|
3385
|
-
for (let n of
|
|
3395
|
+
for (let n of je(e)) n.geoType === f.geoType && t.add(String(n.feature.id));
|
|
3386
3396
|
return t;
|
|
3387
3397
|
}
|
|
3388
|
-
let
|
|
3389
|
-
function
|
|
3398
|
+
let U = !1;
|
|
3399
|
+
function W() {
|
|
3390
3400
|
if (!k.value || !V) return;
|
|
3391
|
-
let e =
|
|
3401
|
+
let e = je(Z.value), t = e.filter((e) => e.geoType === f.geoType), n = e.filter((e) => e.geoType !== f.geoType), r = /* @__PURE__ */ new Map();
|
|
3392
3402
|
for (let e of t) {
|
|
3393
|
-
let t =
|
|
3403
|
+
let t = fe.get(String(e.feature.id));
|
|
3394
3404
|
t && r.set(t, e.item.style ?? "solid");
|
|
3395
3405
|
}
|
|
3396
|
-
for (let [e] of B) r.has(e) || e === z ||
|
|
3397
|
-
for (let [e, t] of r) B.get(e) === t && e !== z || e !== z &&
|
|
3406
|
+
for (let [e] of B) r.has(e) || e === z || Q(e);
|
|
3407
|
+
for (let [e, t] of r) B.get(e) === t && e !== z || e !== z && vt(e, t);
|
|
3398
3408
|
B.clear();
|
|
3399
3409
|
for (let [e, t] of r) B.set(e, t);
|
|
3400
|
-
if (
|
|
3401
|
-
|
|
3410
|
+
if (Ne(n), e.length === 0) {
|
|
3411
|
+
U = !0, bt();
|
|
3412
|
+
return;
|
|
3413
|
+
}
|
|
3414
|
+
if (f.focusZoom === !1) {
|
|
3415
|
+
U = !0;
|
|
3402
3416
|
return;
|
|
3403
3417
|
}
|
|
3404
|
-
let i =
|
|
3418
|
+
let i = I(k.value);
|
|
3405
3419
|
i.interrupt();
|
|
3406
|
-
let a =
|
|
3407
|
-
|
|
3408
|
-
let [[o, s], [c, l]] =
|
|
3420
|
+
let a = U;
|
|
3421
|
+
U = !0;
|
|
3422
|
+
let [[o, s], [c, l]] = Je.value.bounds({
|
|
3409
3423
|
type: "FeatureCollection",
|
|
3410
3424
|
features: e.map((e) => e.feature)
|
|
3411
|
-
}), u = (o + c) / 2, d = (s + l) / 2, p = f.focusZoomLevel, m = se.translate(
|
|
3412
|
-
if (!
|
|
3413
|
-
let e = String(h.id), t =
|
|
3425
|
+
}), u = (o + c) / 2, d = (s + l) / 2, p = f.focusZoomLevel, m = se.translate(Ie.value / 2 - p * u, Le.value / 2 - p * d).scale(p), h = t[0]?.feature ?? null, g = () => {
|
|
3426
|
+
if (!re.value || !h) return;
|
|
3427
|
+
let e = String(h.id), t = fe.get(e);
|
|
3414
3428
|
if (!t) return;
|
|
3415
3429
|
let n = t.getBoundingClientRect();
|
|
3416
|
-
|
|
3430
|
+
mt(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
3417
3431
|
};
|
|
3418
|
-
a ? (
|
|
3432
|
+
a ? (gt(), i.transition().duration(yr).call(V.transform, m).on("end", g)) : (V.transform(i, m), g());
|
|
3419
3433
|
}
|
|
3420
|
-
function
|
|
3421
|
-
let t =
|
|
3434
|
+
function Ne(e) {
|
|
3435
|
+
let t = M.value;
|
|
3422
3436
|
if (!t) return;
|
|
3423
3437
|
let n = new Set(e.map((e) => e.key));
|
|
3424
|
-
for (let [e, t] of
|
|
3425
|
-
let r =
|
|
3438
|
+
for (let [e, t] of me) n.has(e) || (t.remove(), me.delete(e));
|
|
3439
|
+
let r = Je.value, i = J.value + 1.5;
|
|
3426
3440
|
for (let { item: n, feature: a, key: o } of e) {
|
|
3427
|
-
let e =
|
|
3428
|
-
e || (e = document.createElementNS(
|
|
3441
|
+
let e = me.get(o);
|
|
3442
|
+
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)), _t(e, n.style);
|
|
3429
3443
|
}
|
|
3430
3444
|
}
|
|
3431
|
-
function
|
|
3445
|
+
function G() {
|
|
3432
3446
|
if (!k.value || !V) return;
|
|
3433
|
-
|
|
3434
|
-
let e =
|
|
3435
|
-
e.interrupt(),
|
|
3447
|
+
Z.value.length > 0 && ee("update:focus", null);
|
|
3448
|
+
let e = I(k.value);
|
|
3449
|
+
e.interrupt(), gt(), e.transition().duration(yr).call(V.transform, se);
|
|
3436
3450
|
}
|
|
3437
3451
|
E(() => f.focusZoomLevel, () => {
|
|
3438
|
-
V && V.scaleExtent([1, Math.max(12, f.focusZoomLevel)]),
|
|
3452
|
+
V && V.scaleExtent([1, Math.max(12, f.focusZoomLevel)]), W();
|
|
3453
|
+
}), E(() => f.state, () => {
|
|
3454
|
+
if (!k.value || !V) return;
|
|
3455
|
+
let e = I(k.value);
|
|
3456
|
+
e.interrupt(), V.transform(e, se);
|
|
3439
3457
|
});
|
|
3440
|
-
let
|
|
3441
|
-
|
|
3442
|
-
|
|
3458
|
+
let Fe = n(() => f.width && f.height ? f.height / f.width : .625), Ie = n(() => br), Le = n(() => br * Fe.value), Re = n(() => {
|
|
3459
|
+
let e = S(f.topology), t = e?.objects?.states;
|
|
3460
|
+
if (!t) return [];
|
|
3461
|
+
let n = ce(e, t);
|
|
3462
|
+
return n.type === "FeatureCollection" ? n.features : [n];
|
|
3463
|
+
}), ze = n(() => {
|
|
3464
|
+
let e = f.state?.trim();
|
|
3465
|
+
if (!e) return null;
|
|
3466
|
+
if (/^\d{1,2}$/.test(e)) return e.padStart(2, "0");
|
|
3467
|
+
let t = Re.value.find((t) => t.properties?.name === e);
|
|
3468
|
+
return t?.id == null ? null : String(t.id).padStart(2, "0");
|
|
3469
|
+
}), Ve = n(() => {
|
|
3470
|
+
let e = ze.value;
|
|
3471
|
+
return e ? Re.value.find((t) => String(t.id).padStart(2, "0") === e) ?? null : null;
|
|
3472
|
+
});
|
|
3473
|
+
E(() => [f.state, ze.value], ([e, t]) => {
|
|
3474
|
+
e && e.trim() && !t && console.warn(`[ChoroplethMap] state="${e}" matched no state name or FIPS code; rendering the full map.`);
|
|
3475
|
+
}, { immediate: !0 });
|
|
3476
|
+
let He = v(null), Ue = null;
|
|
3477
|
+
function We() {
|
|
3478
|
+
return Ue ||= import("./hsaMapping-BahYDmea.js").then((e) => e.n).then((e) => (He.value = e, e)), Ue;
|
|
3443
3479
|
}
|
|
3444
3480
|
E(() => {
|
|
3445
3481
|
if (f.geoType === "hsas" || f.dataGeoType === "hsas") return !0;
|
|
3446
3482
|
let e = f.focus;
|
|
3447
3483
|
return e ? (Array.isArray(e) ? e : [e]).some((e) => typeof e != "string" && e.geoType === "hsas") : !1;
|
|
3448
3484
|
}, (e) => {
|
|
3449
|
-
e &&
|
|
3485
|
+
e && We();
|
|
3450
3486
|
}, { immediate: !0 });
|
|
3451
|
-
let
|
|
3452
|
-
let e =
|
|
3487
|
+
let Ge = n(() => {
|
|
3488
|
+
let e = He.value;
|
|
3453
3489
|
if (!e) return {
|
|
3454
3490
|
type: "FeatureCollection",
|
|
3455
3491
|
features: []
|
|
3456
3492
|
};
|
|
3457
|
-
let { fipsToHsa: t, hsaNames: n } = e, r = S(f.topology), i = r.objects.counties.geometries, a = /* @__PURE__ */ new Map();
|
|
3493
|
+
let { fipsToHsa: t, hsaNames: n } = e, r = S(f.topology), i = r.objects.counties.geometries, a = ze.value, o = /* @__PURE__ */ new Map();
|
|
3458
3494
|
for (let e of i) {
|
|
3459
|
-
let n =
|
|
3460
|
-
|
|
3495
|
+
let n = String(e.id).padStart(5, "0");
|
|
3496
|
+
if (a && n.slice(0, 2) !== a) continue;
|
|
3497
|
+
let r = t[n];
|
|
3498
|
+
r && (o.has(r) || o.set(r, []), o.get(r).push(e));
|
|
3461
3499
|
}
|
|
3462
|
-
let
|
|
3463
|
-
for (let [e, t] of
|
|
3500
|
+
let s = [];
|
|
3501
|
+
for (let [e, t] of o) s.push({
|
|
3464
3502
|
type: "Feature",
|
|
3465
3503
|
id: e,
|
|
3466
3504
|
properties: { name: n[e] ?? e },
|
|
@@ -3468,45 +3506,60 @@ var zt = {
|
|
|
3468
3506
|
});
|
|
3469
3507
|
return {
|
|
3470
3508
|
type: "FeatureCollection",
|
|
3471
|
-
features:
|
|
3509
|
+
features: s
|
|
3472
3510
|
};
|
|
3473
|
-
}),
|
|
3474
|
-
if (f.geoType === "hsas") return
|
|
3511
|
+
}), Ke = n(() => {
|
|
3512
|
+
if (f.geoType === "hsas") return Ge.value;
|
|
3513
|
+
let e = ze.value;
|
|
3475
3514
|
if (f.geoType === "counties") {
|
|
3476
|
-
let
|
|
3477
|
-
return
|
|
3515
|
+
let t = S(f.topology), n = ce(t, t.objects.counties);
|
|
3516
|
+
return e ? {
|
|
3517
|
+
type: "FeatureCollection",
|
|
3518
|
+
features: n.features.filter((t) => String(t.id).padStart(5, "0").slice(0, 2) === e)
|
|
3519
|
+
} : n;
|
|
3478
3520
|
}
|
|
3479
|
-
let
|
|
3480
|
-
return
|
|
3481
|
-
|
|
3521
|
+
let t = S(f.topology), n = ce(t, t.objects.states);
|
|
3522
|
+
return e ? {
|
|
3523
|
+
type: "FeatureCollection",
|
|
3524
|
+
features: n.features.filter((t) => String(t.id).padStart(2, "0") === e)
|
|
3525
|
+
} : n;
|
|
3526
|
+
}), qe = n(() => {
|
|
3482
3527
|
if (f.geoType !== "counties" && f.geoType !== "hsas") return null;
|
|
3528
|
+
if (ze.value) return Ve.value;
|
|
3483
3529
|
let e = S(f.topology);
|
|
3484
3530
|
return ue(e, e.objects.states, (e, t) => e !== t);
|
|
3485
|
-
}),
|
|
3531
|
+
}), q = n(() => {
|
|
3532
|
+
let e = Ve.value;
|
|
3533
|
+
if (ze.value && e) {
|
|
3534
|
+
let t = [[xr, xr], [Ie.value - xr, Le.value - xr]], n = ie().fitExtent(t, e), r = ae(n).centroid(e);
|
|
3535
|
+
return Number.isFinite(r[0]) && Number.isFinite(r[1]) ? n : F().fitExtent(t, e);
|
|
3536
|
+
}
|
|
3537
|
+
return ie().fitExtent([[0, 0], [Ie.value, Le.value]], Ke.value);
|
|
3538
|
+
}), Je = n(() => ae(q.value)), J = n(() => f.geoType === "counties" || f.geoType === "hsas" ? f.strokeWidth * .5 : f.strokeWidth), Y = n(() => {
|
|
3486
3539
|
let e = /* @__PURE__ */ new Map();
|
|
3487
|
-
for (let [t, n] of
|
|
3540
|
+
for (let [t, n] of Xe.value) {
|
|
3488
3541
|
let r = /* @__PURE__ */ new Map();
|
|
3489
3542
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
3490
3543
|
e.set(t, r);
|
|
3491
3544
|
}
|
|
3492
3545
|
return e;
|
|
3493
3546
|
});
|
|
3494
|
-
function
|
|
3547
|
+
function Ye(e) {
|
|
3495
3548
|
let t = f.dataGeoType;
|
|
3496
3549
|
if (!t || t === f.geoType) return e;
|
|
3497
|
-
if (f.geoType === "counties" && t === "hsas") return
|
|
3550
|
+
if (f.geoType === "counties" && t === "hsas") return He.value?.fipsToHsa[e];
|
|
3498
3551
|
if (f.geoType === "counties" && t === "states" || f.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
3499
3552
|
}
|
|
3500
|
-
let
|
|
3553
|
+
let X = n(() => {
|
|
3501
3554
|
let e = /* @__PURE__ */ new Map();
|
|
3502
|
-
for (let t of
|
|
3555
|
+
for (let t of Ke.value.features) t.id != null && e.set(String(t.id), t);
|
|
3503
3556
|
return e;
|
|
3504
|
-
}),
|
|
3557
|
+
}), Z = n(() => {
|
|
3505
3558
|
let e = f.focus;
|
|
3506
3559
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
3507
|
-
}),
|
|
3560
|
+
}), Xe = n(() => {
|
|
3508
3561
|
let e = /* @__PURE__ */ new Map();
|
|
3509
|
-
e.set(f.geoType,
|
|
3562
|
+
e.set(f.geoType, X.value);
|
|
3510
3563
|
let t = S(f.topology), n = t?.objects;
|
|
3511
3564
|
if (!n) return e;
|
|
3512
3565
|
let r = (e) => {
|
|
@@ -3515,25 +3568,25 @@ var zt = {
|
|
|
3515
3568
|
return t;
|
|
3516
3569
|
};
|
|
3517
3570
|
if (!e.has("states") && n.states) {
|
|
3518
|
-
let i =
|
|
3571
|
+
let i = ce(t, n.states);
|
|
3519
3572
|
e.set("states", r(i.features));
|
|
3520
3573
|
}
|
|
3521
3574
|
if (!e.has("counties") && n.counties) {
|
|
3522
|
-
let i =
|
|
3575
|
+
let i = ce(t, n.counties);
|
|
3523
3576
|
e.set("counties", r(i.features));
|
|
3524
3577
|
}
|
|
3525
|
-
return !e.has("hsas") && n.counties && e.set("hsas", r(
|
|
3526
|
-
}),
|
|
3578
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(Ge.value.features)), e;
|
|
3579
|
+
}), Ze = n(() => {
|
|
3527
3580
|
let e = /* @__PURE__ */ new Map();
|
|
3528
3581
|
if (!f.data) return e;
|
|
3529
|
-
let t = f.dataGeoType ?? f.geoType, n =
|
|
3582
|
+
let t = f.dataGeoType ?? f.geoType, n = Y.value.get(t);
|
|
3530
3583
|
for (let t of f.data) {
|
|
3531
3584
|
e.set(t.id, t.value);
|
|
3532
3585
|
let r = n?.get(t.id);
|
|
3533
3586
|
r && e.set(r, t.value);
|
|
3534
3587
|
}
|
|
3535
3588
|
return e;
|
|
3536
|
-
}),
|
|
3589
|
+
}), Qe = n(() => {
|
|
3537
3590
|
if (!f.data || f.data.length === 0) return {
|
|
3538
3591
|
min: 0,
|
|
3539
3592
|
max: 1
|
|
@@ -3550,8 +3603,8 @@ var zt = {
|
|
|
3550
3603
|
min: 0,
|
|
3551
3604
|
max: 1
|
|
3552
3605
|
};
|
|
3553
|
-
}),
|
|
3554
|
-
function
|
|
3606
|
+
}), $e = n(() => Array.isArray(f.colorScale) && f.colorScale.length > 0 && "value" in f.colorScale[0]), et = n(() => Array.isArray(f.colorScale) && !$e.value), tt = n(() => et.value ? "" : f.colorScale?.min ?? "#e5f0fa"), nt = n(() => et.value ? "" : f.colorScale?.max ?? "#08519c");
|
|
3607
|
+
function rt(e) {
|
|
3555
3608
|
let t = e.replace("#", "");
|
|
3556
3609
|
return [
|
|
3557
3610
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -3559,116 +3612,116 @@ var zt = {
|
|
|
3559
3612
|
parseInt(t.slice(4, 6), 16)
|
|
3560
3613
|
];
|
|
3561
3614
|
}
|
|
3562
|
-
function
|
|
3563
|
-
let [t, n, r] =
|
|
3615
|
+
function it(e) {
|
|
3616
|
+
let [t, n, r] = rt(tt.value), [i, a, o] = rt(nt.value);
|
|
3564
3617
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
3565
3618
|
}
|
|
3566
|
-
let
|
|
3567
|
-
if (
|
|
3619
|
+
let at = n(() => et.value ? f.colorScale.slice().sort((e, t) => t.min - e.min) : null), ot = n(() => {
|
|
3620
|
+
if (!$e.value) return null;
|
|
3568
3621
|
let e = /* @__PURE__ */ new Map();
|
|
3569
3622
|
for (let t of f.colorScale) e.set(t.value, t.color);
|
|
3570
3623
|
return e;
|
|
3571
3624
|
});
|
|
3572
|
-
function
|
|
3573
|
-
let t =
|
|
3574
|
-
return t == null ? void 0 :
|
|
3625
|
+
function st(e) {
|
|
3626
|
+
let t = Ye(e);
|
|
3627
|
+
return t == null ? void 0 : Ze.value.get(t);
|
|
3575
3628
|
}
|
|
3576
|
-
function
|
|
3577
|
-
let t =
|
|
3629
|
+
function ct(e) {
|
|
3630
|
+
let t = st(e), n = f.noDataColor;
|
|
3578
3631
|
if (t == null) return n;
|
|
3579
|
-
let r =
|
|
3632
|
+
let r = ot.value;
|
|
3580
3633
|
if (r) return r.get(String(t)) ?? n;
|
|
3581
|
-
let i =
|
|
3634
|
+
let i = at.value;
|
|
3582
3635
|
if (i) {
|
|
3583
3636
|
let e = t;
|
|
3584
3637
|
for (let t of i) if (e >= t.min) return t.color;
|
|
3585
3638
|
return n;
|
|
3586
3639
|
}
|
|
3587
|
-
let { min: a, max: o } =
|
|
3588
|
-
return
|
|
3640
|
+
let { min: a, max: o } = Qe.value;
|
|
3641
|
+
return it((t - a) / (o - a));
|
|
3589
3642
|
}
|
|
3590
|
-
let
|
|
3591
|
-
function
|
|
3643
|
+
let lt = (e) => e.properties?.name ?? String(e.id);
|
|
3644
|
+
function ut(e) {
|
|
3592
3645
|
return e == null ? "" : typeof e == "number" && f.tooltipValueFormat !== void 0 ? te(e, f.tooltipValueFormat) : String(e);
|
|
3593
3646
|
}
|
|
3594
|
-
function
|
|
3595
|
-
return t == null ? e : `${e}: ${
|
|
3647
|
+
function dt(e, t) {
|
|
3648
|
+
return t == null ? e : `${e}: ${ut(t)}`;
|
|
3596
3649
|
}
|
|
3597
|
-
function
|
|
3598
|
-
let e =
|
|
3650
|
+
function ft() {
|
|
3651
|
+
let e = N.value?.getEl();
|
|
3599
3652
|
if (!e) return;
|
|
3600
|
-
|
|
3653
|
+
_e?.disconnect();
|
|
3601
3654
|
let t = !1;
|
|
3602
|
-
|
|
3655
|
+
_e = new ResizeObserver((e) => {
|
|
3603
3656
|
let n = e[0]?.contentRect;
|
|
3604
|
-
n && (
|
|
3605
|
-
}),
|
|
3657
|
+
n && (ve.width = n.width, ve.height = n.height, !t && be && ye ? (t = !0, pt(ye.x, ye.y)) : t = !0);
|
|
3658
|
+
}), _e.observe(e);
|
|
3606
3659
|
}
|
|
3607
|
-
function
|
|
3608
|
-
let n =
|
|
3660
|
+
function pt(e, t) {
|
|
3661
|
+
let n = N.value?.getEl();
|
|
3609
3662
|
if (!n) return;
|
|
3610
|
-
let r = O.value?.getBoundingClientRect(), { left: i, top: a } =
|
|
3663
|
+
let r = O.value?.getBoundingClientRect(), { left: i, top: a } = H(e, t, ve.width, ve.height, f.tooltipClamp, r);
|
|
3611
3664
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
3612
3665
|
}
|
|
3613
|
-
function
|
|
3666
|
+
function mt(e, t, n) {
|
|
3614
3667
|
let r = L.get(e);
|
|
3615
3668
|
if (!r) return;
|
|
3616
|
-
let i =
|
|
3617
|
-
!i || !a || (i.setData(r),
|
|
3669
|
+
let i = N.value, a = i?.getEl();
|
|
3670
|
+
!i || !a || (i.setData(r), ye = {
|
|
3618
3671
|
x: t,
|
|
3619
3672
|
y: n
|
|
3620
|
-
},
|
|
3673
|
+
}, be = !0, pt(t, n), a.style.visibility = "visible");
|
|
3621
3674
|
}
|
|
3622
|
-
function
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
let e =
|
|
3626
|
-
!e || !
|
|
3627
|
-
x:
|
|
3628
|
-
y:
|
|
3629
|
-
}, e.style.transform = `translate3d(${
|
|
3675
|
+
function ht(e, t) {
|
|
3676
|
+
be && (Se = e, Ce = t, !we && (we = requestAnimationFrame(() => {
|
|
3677
|
+
we = 0;
|
|
3678
|
+
let e = N.value?.getEl();
|
|
3679
|
+
!e || !be || (ye = {
|
|
3680
|
+
x: Se,
|
|
3681
|
+
y: Ce
|
|
3682
|
+
}, e.style.transform = `translate3d(${Se + 16}px, ${Ce}px, 0) translateY(-50%)`);
|
|
3630
3683
|
})));
|
|
3631
3684
|
}
|
|
3632
|
-
function
|
|
3633
|
-
if (!
|
|
3634
|
-
|
|
3635
|
-
let e =
|
|
3685
|
+
function gt() {
|
|
3686
|
+
if (!be) return;
|
|
3687
|
+
be = !1, ye = null;
|
|
3688
|
+
let e = N.value?.getEl();
|
|
3636
3689
|
e && (e.style.visibility = "hidden");
|
|
3637
3690
|
}
|
|
3638
|
-
function
|
|
3691
|
+
function _t(e, t) {
|
|
3639
3692
|
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"));
|
|
3640
3693
|
}
|
|
3641
|
-
function
|
|
3642
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
3694
|
+
function vt(e, t = "solid") {
|
|
3695
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(J.value + 1)), e.setAttribute("stroke", "#555"), _t(e, t);
|
|
3643
3696
|
}
|
|
3644
|
-
function
|
|
3645
|
-
e.setAttribute("stroke-width", String(
|
|
3697
|
+
function Q(e) {
|
|
3698
|
+
e.setAttribute("stroke-width", String(J.value)), e.setAttribute("stroke", f.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
3646
3699
|
}
|
|
3647
|
-
function
|
|
3648
|
-
z !== e && (z && !B.has(z) &&
|
|
3700
|
+
function yt(e) {
|
|
3701
|
+
z !== e && (z && !B.has(z) && Q(z), z = e, vt(e, B.get(e) ?? "solid"));
|
|
3649
3702
|
}
|
|
3650
|
-
function
|
|
3703
|
+
function bt() {
|
|
3651
3704
|
if (z) {
|
|
3652
3705
|
let e = B.get(z);
|
|
3653
|
-
e == null ?
|
|
3706
|
+
e == null ? Q(z) : vt(z, e), z = null, ee("stateHover", null);
|
|
3654
3707
|
}
|
|
3655
|
-
|
|
3708
|
+
gt();
|
|
3656
3709
|
}
|
|
3657
|
-
function
|
|
3710
|
+
function xt(e) {
|
|
3658
3711
|
let t = e;
|
|
3659
3712
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
3660
3713
|
return t ? t.dataset.featId ?? null : null;
|
|
3661
3714
|
}
|
|
3662
|
-
function
|
|
3715
|
+
function St(e) {
|
|
3663
3716
|
ee("stateClick", {
|
|
3664
3717
|
id: e.id,
|
|
3665
3718
|
name: e.name,
|
|
3666
3719
|
value: e.value
|
|
3667
|
-
}), ee("update:focus",
|
|
3720
|
+
}), ee("update:focus", Me(Z.value).has(e.id) ? null : e.id);
|
|
3668
3721
|
}
|
|
3669
|
-
function
|
|
3670
|
-
if (
|
|
3671
|
-
let t = e, n =
|
|
3722
|
+
function Ct(e) {
|
|
3723
|
+
if (he) return;
|
|
3724
|
+
let t = e, n = xt(t.target);
|
|
3672
3725
|
if (!n) return;
|
|
3673
3726
|
let r = L.get(n);
|
|
3674
3727
|
if (!r) return;
|
|
@@ -3677,231 +3730,236 @@ var zt = {
|
|
|
3677
3730
|
name: r.name,
|
|
3678
3731
|
value: r.value
|
|
3679
3732
|
};
|
|
3680
|
-
e.type === "click" ?
|
|
3733
|
+
e.type === "click" ? St(r) : e.type === "mouseover" && (yt(fe.get(n)), re.value && mt(n, t.clientX, t.clientY), ee("stateHover", i));
|
|
3681
3734
|
}
|
|
3682
|
-
function
|
|
3683
|
-
|
|
3735
|
+
function wt(e) {
|
|
3736
|
+
he || ht(e.clientX, e.clientY);
|
|
3684
3737
|
}
|
|
3685
|
-
function
|
|
3738
|
+
function Tt(e) {
|
|
3686
3739
|
let t = e.relatedTarget;
|
|
3687
|
-
t &&
|
|
3740
|
+
t && A.value?.contains(t) || bt();
|
|
3688
3741
|
}
|
|
3689
|
-
function
|
|
3742
|
+
function Et(e) {
|
|
3690
3743
|
if (e.touches.length !== 1) {
|
|
3691
|
-
|
|
3744
|
+
Te = null;
|
|
3692
3745
|
return;
|
|
3693
3746
|
}
|
|
3694
3747
|
let t = e.touches[0];
|
|
3695
|
-
|
|
3748
|
+
Te = {
|
|
3696
3749
|
x: t.clientX,
|
|
3697
3750
|
y: t.clientY,
|
|
3698
3751
|
time: e.timeStamp,
|
|
3699
|
-
featId:
|
|
3752
|
+
featId: xt(e.target)
|
|
3700
3753
|
};
|
|
3701
3754
|
}
|
|
3702
|
-
function
|
|
3703
|
-
let t =
|
|
3704
|
-
if (
|
|
3755
|
+
function Dt(e) {
|
|
3756
|
+
let t = Te;
|
|
3757
|
+
if (Te = null, !t || !t.featId || e.touches.length > 0) return;
|
|
3705
3758
|
let n = e.changedTouches[0];
|
|
3706
|
-
if (!n || Math.abs(n.clientX - t.x) >
|
|
3759
|
+
if (!n || Math.abs(n.clientX - t.x) > _r || Math.abs(n.clientY - t.y) > _r || e.timeStamp - t.time > vr) return;
|
|
3707
3760
|
let r = L.get(t.featId);
|
|
3708
|
-
r && (e.preventDefault(),
|
|
3761
|
+
r && (e.preventDefault(), St(r));
|
|
3709
3762
|
}
|
|
3710
|
-
function
|
|
3711
|
-
|
|
3763
|
+
function Ot() {
|
|
3764
|
+
Te = null;
|
|
3712
3765
|
}
|
|
3713
|
-
function
|
|
3714
|
-
let t = document.createElementNS(
|
|
3766
|
+
function kt(e) {
|
|
3767
|
+
let t = document.createElementNS(gr, "path");
|
|
3715
3768
|
return e && t.setAttribute("d", e), t;
|
|
3716
3769
|
}
|
|
3717
|
-
function
|
|
3718
|
-
let e =
|
|
3770
|
+
function At() {
|
|
3771
|
+
let e = j.value, t = M.value;
|
|
3719
3772
|
if (!e || !t) return;
|
|
3720
3773
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
3721
3774
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
3722
|
-
|
|
3723
|
-
let n =
|
|
3775
|
+
fe.clear(), L.clear(), R = null, z = null, B.clear(), me.clear();
|
|
3776
|
+
let n = Je.value, r = Ke.value.features, i = f.strokeColor, a = String(J.value), o = !re.value, s = document.createDocumentFragment();
|
|
3724
3777
|
for (let e of r) {
|
|
3725
|
-
let t = String(e.id), r =
|
|
3726
|
-
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill",
|
|
3727
|
-
let e = document.createElementNS(
|
|
3728
|
-
e.textContent =
|
|
3778
|
+
let t = String(e.id), r = lt(e), c = st(t), l = kt(n(e));
|
|
3779
|
+
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", ct(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
|
|
3780
|
+
let e = document.createElementNS(gr, "title");
|
|
3781
|
+
e.textContent = dt(r, c), l.appendChild(e);
|
|
3729
3782
|
}
|
|
3730
|
-
s.appendChild(l),
|
|
3783
|
+
s.appendChild(l), fe.set(t, l), L.set(t, {
|
|
3731
3784
|
id: t,
|
|
3732
3785
|
name: r,
|
|
3733
3786
|
value: c,
|
|
3734
3787
|
feature: e
|
|
3735
3788
|
});
|
|
3736
3789
|
}
|
|
3737
|
-
let c =
|
|
3790
|
+
let c = qe.value;
|
|
3738
3791
|
if (c) {
|
|
3739
|
-
let e =
|
|
3792
|
+
let e = kt(n(c));
|
|
3740
3793
|
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e), R = e;
|
|
3741
3794
|
}
|
|
3742
3795
|
e.appendChild(s);
|
|
3743
3796
|
}
|
|
3744
|
-
function
|
|
3745
|
-
let e = !
|
|
3746
|
-
for (let [t, n] of
|
|
3747
|
-
let r =
|
|
3748
|
-
if (n.setAttribute("fill",
|
|
3797
|
+
function jt() {
|
|
3798
|
+
let e = !re.value;
|
|
3799
|
+
for (let [t, n] of fe) {
|
|
3800
|
+
let r = st(t), i = L.get(t);
|
|
3801
|
+
if (n.setAttribute("fill", ct(t)), i && (i.value = r), e && i) {
|
|
3749
3802
|
let e = n.firstElementChild;
|
|
3750
|
-
e && (e.textContent =
|
|
3803
|
+
e && (e.textContent = dt(i.name, r));
|
|
3751
3804
|
}
|
|
3752
3805
|
}
|
|
3753
3806
|
}
|
|
3754
|
-
function
|
|
3755
|
-
for (let e of
|
|
3807
|
+
function Mt() {
|
|
3808
|
+
for (let e of fe.values()) e === z || B.has(e) || Q(e);
|
|
3756
3809
|
R && R.setAttribute("stroke", f.strokeColor);
|
|
3757
3810
|
}
|
|
3758
|
-
function
|
|
3811
|
+
function Nt() {
|
|
3759
3812
|
return typeof f.menu == "string" ? f.menu : "choropleth";
|
|
3760
3813
|
}
|
|
3761
|
-
let
|
|
3814
|
+
let Pt = n(() => f.legend && ($e.value || et.value || f.data)), Ft = n(() => f.colorScale.slice().sort((e, t) => e.min - t.min)), $ = n(() => {
|
|
3762
3815
|
let e = [];
|
|
3763
3816
|
for (let t = 0; t <= 10; t++) {
|
|
3764
3817
|
let n = t / 10;
|
|
3765
3818
|
e.push({
|
|
3766
3819
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
3767
|
-
color:
|
|
3820
|
+
color: it(n)
|
|
3768
3821
|
});
|
|
3769
3822
|
}
|
|
3770
3823
|
return e;
|
|
3771
|
-
}),
|
|
3824
|
+
}), It = new Intl.NumberFormat("en-US", {
|
|
3772
3825
|
notation: "compact",
|
|
3773
3826
|
maximumFractionDigits: 1
|
|
3774
|
-
}),
|
|
3775
|
-
let { min: e, max: t } =
|
|
3827
|
+
}), Lt = n(() => {
|
|
3828
|
+
let { min: e, max: t } = Qe.value, n = t - e, r = [];
|
|
3776
3829
|
for (let t = 1; t <= 3; t++) {
|
|
3777
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
3830
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? It.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
3778
3831
|
r.push({
|
|
3779
3832
|
value: o,
|
|
3780
3833
|
pct: i * 100
|
|
3781
3834
|
});
|
|
3782
3835
|
}
|
|
3783
3836
|
return r;
|
|
3784
|
-
}),
|
|
3837
|
+
}), Rt = n(() => {
|
|
3785
3838
|
let e = [];
|
|
3786
|
-
if (
|
|
3839
|
+
if ($e.value) for (let t of f.colorScale) e.push({
|
|
3787
3840
|
key: t.value,
|
|
3788
3841
|
color: t.color,
|
|
3789
3842
|
label: t.value
|
|
3790
3843
|
});
|
|
3791
|
-
else if (
|
|
3844
|
+
else if (et.value) for (let t of Ft.value) e.push({
|
|
3792
3845
|
key: String(t.min),
|
|
3793
3846
|
color: t.color,
|
|
3794
3847
|
label: t.label ?? String(t.min)
|
|
3795
3848
|
});
|
|
3796
3849
|
return e;
|
|
3797
|
-
}),
|
|
3798
|
-
let e =
|
|
3850
|
+
}), zt = n(() => `linear-gradient(to right, ${$.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), Bt = Be({ target: () => f.fullscreenTarget }), Vt = n(() => {
|
|
3851
|
+
let e = Nt();
|
|
3799
3852
|
return [
|
|
3800
|
-
|
|
3853
|
+
Bt.menuItem.value,
|
|
3801
3854
|
{
|
|
3802
3855
|
label: "Save as SVG",
|
|
3803
3856
|
action: () => {
|
|
3804
|
-
k.value &&
|
|
3857
|
+
k.value && K(k.value, e);
|
|
3805
3858
|
}
|
|
3806
3859
|
},
|
|
3807
3860
|
{
|
|
3808
3861
|
label: "Save as PNG",
|
|
3809
3862
|
action: () => {
|
|
3810
|
-
k.value &&
|
|
3863
|
+
k.value && Pe(k.value, e);
|
|
3811
3864
|
}
|
|
3812
3865
|
}
|
|
3813
3866
|
];
|
|
3814
3867
|
});
|
|
3815
|
-
return E(() => [
|
|
3868
|
+
return E(() => [
|
|
3869
|
+
Ke.value,
|
|
3816
3870
|
Je.value,
|
|
3871
|
+
re.value
|
|
3872
|
+
], () => At()), E(() => [
|
|
3873
|
+
Ze.value,
|
|
3817
3874
|
f.colorScale,
|
|
3818
3875
|
f.noDataColor,
|
|
3819
3876
|
f.dataGeoType
|
|
3820
|
-
], () =>
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
], () =>
|
|
3825
|
-
to: C(
|
|
3826
|
-
disabled: !C(
|
|
3877
|
+
], () => jt()), E(() => [f.strokeColor, J.value], () => Mt()), E(() => [
|
|
3878
|
+
Z.value,
|
|
3879
|
+
Je.value,
|
|
3880
|
+
He.value
|
|
3881
|
+
], () => W(), { flush: "post" }), (n, l) => (_(), r(t, {
|
|
3882
|
+
to: C(Bt).teleportTarget.value,
|
|
3883
|
+
disabled: !C(Bt).isFullscreen.value
|
|
3827
3884
|
}, [o("div", d({
|
|
3828
3885
|
ref_key: "containerRef",
|
|
3829
3886
|
ref: O
|
|
3830
3887
|
}, n.$attrs, {
|
|
3831
3888
|
class: ["choropleth-wrapper", {
|
|
3832
3889
|
pannable: c.pan,
|
|
3833
|
-
"is-fullscreen": C(
|
|
3890
|
+
"is-fullscreen": C(Bt).isFullscreen.value
|
|
3834
3891
|
}],
|
|
3835
|
-
style: C(
|
|
3892
|
+
style: C(Bt).fullscreenStyle.value
|
|
3836
3893
|
}), [
|
|
3837
|
-
c.menu ? (_(), r(
|
|
3894
|
+
c.menu ? (_(), r(pe, {
|
|
3838
3895
|
key: 0,
|
|
3839
|
-
items:
|
|
3840
|
-
"is-fullscreen": C(
|
|
3841
|
-
onClose: C(
|
|
3896
|
+
items: Vt.value,
|
|
3897
|
+
"is-fullscreen": C(Bt).isFullscreen.value,
|
|
3898
|
+
onClose: C(Bt).exit
|
|
3842
3899
|
}, null, 8, [
|
|
3843
3900
|
"items",
|
|
3844
3901
|
"is-fullscreen",
|
|
3845
3902
|
"onClose"
|
|
3846
3903
|
])) : i("", !0),
|
|
3847
|
-
o("div",
|
|
3848
|
-
c.title ||
|
|
3904
|
+
o("div", lr, x(C(Bt).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
|
|
3905
|
+
c.title || Pt.value ? (_(), a("div", ur, [c.title ? (_(), a("div", {
|
|
3849
3906
|
key: 0,
|
|
3850
3907
|
class: "choropleth-title",
|
|
3851
3908
|
style: m(de.value)
|
|
3852
|
-
}, x(c.title), 5)) : i("", !0),
|
|
3909
|
+
}, x(c.title), 5)) : i("", !0), Pt.value ? (_(), a("div", {
|
|
3853
3910
|
key: 1,
|
|
3854
3911
|
class: "choropleth-legend",
|
|
3855
|
-
style: m(
|
|
3856
|
-
}, [c.legendTitle ? (_(), a("span",
|
|
3912
|
+
style: m(P.value)
|
|
3913
|
+
}, [c.legendTitle ? (_(), a("span", dr, x(c.legendTitle), 1)) : i("", !0), $e.value || et.value ? (_(!0), a(e, { key: 1 }, y(Rt.value, (e) => (_(), a("span", {
|
|
3857
3914
|
key: e.key,
|
|
3858
3915
|
class: "choropleth-legend-item"
|
|
3859
3916
|
}, [o("span", {
|
|
3860
3917
|
class: "choropleth-legend-swatch",
|
|
3861
3918
|
style: m({ background: e.color })
|
|
3862
|
-
}, null, 4), s(" " + x(e.label), 1)]))), 128)) : (_(), a("div",
|
|
3919
|
+
}, null, 4), s(" " + x(e.label), 1)]))), 128)) : (_(), a("div", fr, [o("div", {
|
|
3863
3920
|
class: "choropleth-legend-gradient",
|
|
3864
|
-
style: m({ background:
|
|
3865
|
-
}, null, 4), o("div",
|
|
3921
|
+
style: m({ background: zt.value })
|
|
3922
|
+
}, null, 4), o("div", pr, [(_(!0), a(e, null, y(Lt.value, (e) => (_(), a("span", {
|
|
3866
3923
|
key: e.value,
|
|
3867
3924
|
style: m({ left: e.pct + "%" })
|
|
3868
3925
|
}, x(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
|
|
3869
3926
|
(_(), a("svg", {
|
|
3870
3927
|
ref_key: "svgRef",
|
|
3871
3928
|
ref: k,
|
|
3872
|
-
viewBox: `0 0 ${
|
|
3873
|
-
preserveAspectRatio: "xMidYMid meet"
|
|
3929
|
+
viewBox: `0 0 ${Ie.value} ${Le.value}`,
|
|
3930
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3931
|
+
style: m(c.twoFingerPan ? { touchAction: "pan-y" } : void 0)
|
|
3874
3932
|
}, [o("g", {
|
|
3875
3933
|
ref_key: "mapGroupRef",
|
|
3876
|
-
ref:
|
|
3934
|
+
ref: A
|
|
3877
3935
|
}, [o("g", {
|
|
3878
3936
|
ref_key: "baseGroupRef",
|
|
3879
|
-
ref:
|
|
3937
|
+
ref: j
|
|
3880
3938
|
}, null, 512), o("g", {
|
|
3881
3939
|
ref_key: "overlayGroupRef",
|
|
3882
|
-
ref:
|
|
3883
|
-
}, null, 512)], 512)],
|
|
3884
|
-
|
|
3940
|
+
ref: M
|
|
3941
|
+
}, null, 512)], 512)], 12, mr)),
|
|
3942
|
+
xe.value ? (_(), a("button", {
|
|
3885
3943
|
key: 2,
|
|
3886
3944
|
type: "button",
|
|
3887
3945
|
class: "choropleth-reset",
|
|
3888
3946
|
"aria-label": "Reset zoom",
|
|
3889
|
-
onClick:
|
|
3947
|
+
onClick: G
|
|
3890
3948
|
}, " Reset ")) : i("", !0),
|
|
3891
|
-
|
|
3949
|
+
re.value ? (_(), r(cr, {
|
|
3892
3950
|
key: 3,
|
|
3893
3951
|
ref_key: "tooltipChildRef",
|
|
3894
|
-
ref:
|
|
3952
|
+
ref: N
|
|
3895
3953
|
}, {
|
|
3896
3954
|
default: D((t) => [b(n.$slots, "tooltip", p(u(T(t))), () => [c.tooltipFormat ? (_(), a("span", {
|
|
3897
3955
|
key: 0,
|
|
3898
3956
|
innerHTML: c.tooltipFormat(t)
|
|
3899
|
-
}, null, 8,
|
|
3957
|
+
}, null, 8, hr)) : t.value == null ? (_(), a(e, { key: 1 }, [s(x(t.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(x(t.name) + ": " + x(ut(t.value)), 1)], 64))], !0)]),
|
|
3900
3958
|
_: 3
|
|
3901
3959
|
}, 512)) : i("", !0)
|
|
3902
3960
|
], 16)], 8, ["to", "disabled"]));
|
|
3903
3961
|
}
|
|
3904
|
-
}), [["__scopeId", "data-v-
|
|
3962
|
+
}), [["__scopeId", "data-v-63f25207"]]), Cr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3905
3963
|
__name: "ChartTooltip",
|
|
3906
3964
|
props: {
|
|
3907
3965
|
x: {},
|
|
@@ -3921,11 +3979,11 @@ var zt = {
|
|
|
3921
3979
|
top: `${e.y}px`,
|
|
3922
3980
|
transform: "translateY(-50%)"
|
|
3923
3981
|
})
|
|
3924
|
-
}, [b(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(C(
|
|
3982
|
+
}, [b(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(C(P), {
|
|
3925
3983
|
key: 1,
|
|
3926
3984
|
open: e.open
|
|
3927
3985
|
}, {
|
|
3928
|
-
default: D(() => [c(C(
|
|
3986
|
+
default: D(() => [c(C(N), { "as-child": "" }, {
|
|
3929
3987
|
default: D(() => [o("div", {
|
|
3930
3988
|
class: "chart-tooltip-anchor",
|
|
3931
3989
|
style: m({
|
|
@@ -3934,8 +3992,8 @@ var zt = {
|
|
|
3934
3992
|
})
|
|
3935
3993
|
}, null, 4)]),
|
|
3936
3994
|
_: 1
|
|
3937
|
-
}), c(C(
|
|
3938
|
-
default: D(() => [e.open ? (_(), r(C(
|
|
3995
|
+
}), c(C(re), null, {
|
|
3996
|
+
default: D(() => [e.open ? (_(), r(C(ne), {
|
|
3939
3997
|
key: 0,
|
|
3940
3998
|
class: "chart-tooltip-content",
|
|
3941
3999
|
side: "right",
|
|
@@ -3952,7 +4010,7 @@ var zt = {
|
|
|
3952
4010
|
_: 3
|
|
3953
4011
|
}, 8, ["open"])) : i("", !0);
|
|
3954
4012
|
}
|
|
3955
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
4013
|
+
}), [["__scopeId", "data-v-44377f70"]]), wr = { class: "TableWrapper" }, Tr = ["href", "download"], Er = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3956
4014
|
__name: "DataTable",
|
|
3957
4015
|
props: {
|
|
3958
4016
|
data: {},
|
|
@@ -4057,7 +4115,7 @@ var zt = {
|
|
|
4057
4115
|
return n.join("\n");
|
|
4058
4116
|
}
|
|
4059
4117
|
function E() {
|
|
4060
|
-
|
|
4118
|
+
Fe(T(), C());
|
|
4061
4119
|
}
|
|
4062
4120
|
let D = n(() => c.downloadButton || c.downloadLink ? [] : [{
|
|
4063
4121
|
label: c.downloadMenuLink,
|
|
@@ -4066,17 +4124,17 @@ var zt = {
|
|
|
4066
4124
|
if (c.downloadButton) return null;
|
|
4067
4125
|
let e = c.downloadLink;
|
|
4068
4126
|
return e ? typeof e == "string" ? e : "Download data (CSV)" : null;
|
|
4069
|
-
}), k = n(() => O.value ? `data:text/csv;charset=utf-8,${encodeURIComponent(T())}` : null),
|
|
4127
|
+
}), k = n(() => O.value ? `data:text/csv;charset=utf-8,${encodeURIComponent(T())}` : null), A = n(() => !!c.menu && D.value.length > 0);
|
|
4070
4128
|
return (n, s) => (_(), a("div", { class: f(["TableOuter", {
|
|
4071
4129
|
"full-width": t.fullWidth,
|
|
4072
|
-
"has-menu":
|
|
4130
|
+
"has-menu": A.value
|
|
4073
4131
|
}]) }, [
|
|
4074
|
-
|
|
4132
|
+
A.value ? (_(), r(pe, {
|
|
4075
4133
|
key: 0,
|
|
4076
4134
|
items: D.value,
|
|
4077
4135
|
"force-dropdown": ""
|
|
4078
4136
|
}, null, 8, ["items"])) : i("", !0),
|
|
4079
|
-
o("div",
|
|
4137
|
+
o("div", wr, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
|
|
4080
4138
|
o("colgroup", null, [(_(!0), a(e, null, y(b.value, (e) => (_(), a("col", {
|
|
4081
4139
|
key: e.name,
|
|
4082
4140
|
style: m(u(e.name))
|
|
@@ -4102,9 +4160,9 @@ var zt = {
|
|
|
4102
4160
|
class: "data-table-download-link",
|
|
4103
4161
|
href: k.value,
|
|
4104
4162
|
download: `${C()}.csv`
|
|
4105
|
-
}, x(O.value), 9,
|
|
4163
|
+
}, x(O.value), 9, Tr)) : i("", !0)
|
|
4106
4164
|
], 2));
|
|
4107
4165
|
}
|
|
4108
4166
|
}), [["__scopeId", "data-v-21721f41"]]);
|
|
4109
4167
|
//#endregion
|
|
4110
|
-
export {
|
|
4168
|
+
export { or as BarChart, Cr as ChartTooltip, Sr as ChoroplethMap, Er as DataTable, En as LineChart };
|