@cfasim-ui/charts 0.7.7 → 0.7.8
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/canvasLayer.d.ts +8 -1
- package/dist/index.css +1 -1
- package/dist/index.js +659 -625
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -192,8 +192,8 @@ function Ee(e = {}) {
|
|
|
192
192
|
measuredHeight: r
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
var
|
|
196
|
-
function
|
|
195
|
+
var L = .6, De = 8;
|
|
196
|
+
function Oe(e, t) {
|
|
197
197
|
return {
|
|
198
198
|
fontSize: e?.fontSize ?? t.fontSize,
|
|
199
199
|
fill: e?.color ?? "currentColor",
|
|
@@ -201,8 +201,8 @@ function ke(e, t) {
|
|
|
201
201
|
fillOpacity: e?.color == null ? t.fillOpacity : void 0
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
var
|
|
205
|
-
function
|
|
204
|
+
var R = 7, ke = 18, Ae = 16;
|
|
205
|
+
function je(e) {
|
|
206
206
|
return e == null ? {
|
|
207
207
|
top: 0,
|
|
208
208
|
right: 0,
|
|
@@ -220,12 +220,12 @@ function Me(e) {
|
|
|
220
220
|
left: e.left ?? 0
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
return
|
|
223
|
+
function Me(e) {
|
|
224
|
+
return ke + e.length * R;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function Ne(e) {
|
|
227
227
|
let t = n(() => {
|
|
228
|
-
let t =
|
|
228
|
+
let t = je(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 Pe(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 = Me(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 + Ae;
|
|
246
246
|
}
|
|
247
247
|
return {
|
|
248
248
|
positions: i,
|
|
@@ -252,9 +252,9 @@ function Pe(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 + De;
|
|
256
256
|
}), o = n(() => {
|
|
257
|
-
let n =
|
|
257
|
+
let n = je(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 Pe(e) {
|
|
|
283
283
|
}
|
|
284
284
|
//#endregion
|
|
285
285
|
//#region src/tooltip-position.ts
|
|
286
|
-
var
|
|
287
|
-
function
|
|
286
|
+
var Pe = 16, z = 8;
|
|
287
|
+
function B(e, t, n, r, i, a) {
|
|
288
288
|
if (i === "none") return {
|
|
289
|
-
left: e +
|
|
289
|
+
left: e + Pe,
|
|
290
290
|
top: t
|
|
291
291
|
};
|
|
292
292
|
let o = i === "chart" && a ? {
|
|
@@ -299,15 +299,15 @@ function z(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 + Pe + n > o.right - z ? e - Pe - n : e + Pe, c = Math.max(o.left + z, o.right - z - n), l = Math.min(Math.max(s, o.left + z), c), u = r / 2;
|
|
303
303
|
return {
|
|
304
304
|
left: l,
|
|
305
|
-
top: Math.min(Math.max(t, o.top +
|
|
305
|
+
top: Math.min(Math.max(t, o.top + z + u), o.bottom - z - u)
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
//#endregion
|
|
309
309
|
//#region src/_shared/useChartTooltip.ts
|
|
310
|
-
function
|
|
310
|
+
function Fe(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 Ie(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?.() ?? "window", { left: f, top: p } =
|
|
331
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "window", { left: f, top: p } = B(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,81 +395,81 @@ function Ie(e) {
|
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/ChartMenu/download.ts
|
|
398
|
-
function
|
|
398
|
+
function Ie(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 V = [
|
|
403
403
|
"color",
|
|
404
404
|
"font-family",
|
|
405
405
|
"font-size",
|
|
406
406
|
"font-weight"
|
|
407
|
-
],
|
|
408
|
-
function
|
|
407
|
+
], H = ["fill", "stroke"];
|
|
408
|
+
function U(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 W(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 V) {
|
|
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 H) {
|
|
425
425
|
let n = e.getAttribute(t);
|
|
426
|
-
!n || !n.includes("var(") || e.setAttribute(t,
|
|
426
|
+
!n || !n.includes("var(") || e.setAttribute(t, U(n));
|
|
427
427
|
}
|
|
428
428
|
return t;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
let n =
|
|
432
|
-
|
|
430
|
+
function G(e, t) {
|
|
431
|
+
let n = W(e), r = new XMLSerializer().serializeToString(n);
|
|
432
|
+
Ie(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
let n =
|
|
434
|
+
function Le(e, t) {
|
|
435
|
+
let n = W(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 && Ie(e, `${t}.png`);
|
|
442
442
|
}), URL.revokeObjectURL(a);
|
|
443
443
|
}, o.src = a;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function Re(e, t) {
|
|
446
446
|
e.toBlob((e) => {
|
|
447
|
-
e &&
|
|
447
|
+
e && Ie(e, `${t}.png`);
|
|
448
448
|
}, "image/png");
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
|
|
450
|
+
function ze(e, t) {
|
|
451
|
+
Ie(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
452
452
|
}
|
|
453
453
|
//#endregion
|
|
454
454
|
//#region src/_shared/touch.ts
|
|
455
|
-
function
|
|
455
|
+
function K() {
|
|
456
456
|
return typeof window < "u" && "ontouchstart" in window;
|
|
457
457
|
}
|
|
458
458
|
//#endregion
|
|
459
459
|
//#region src/_shared/useChartFullscreen.ts
|
|
460
|
-
var
|
|
461
|
-
function
|
|
462
|
-
typeof document > "u" || (
|
|
460
|
+
var Be = 0, Ve = "";
|
|
461
|
+
function He() {
|
|
462
|
+
typeof document > "u" || (Be === 0 && (Ve = document.body.style.overflow, document.body.style.overflow = "hidden"), Be++);
|
|
463
463
|
}
|
|
464
464
|
function Ue() {
|
|
465
|
-
typeof document > "u" ||
|
|
465
|
+
typeof document > "u" || Be !== 0 && (Be--, Be === 0 && (document.body.style.overflow = Ve));
|
|
466
466
|
}
|
|
467
467
|
var We = 0, Ge = null;
|
|
468
468
|
function Ke() {
|
|
469
469
|
return document.querySelector("meta[name=\"viewport\"]");
|
|
470
470
|
}
|
|
471
471
|
function qe() {
|
|
472
|
-
if (typeof document > "u" || !
|
|
472
|
+
if (typeof document > "u" || !K()) return;
|
|
473
473
|
let e = Ke();
|
|
474
474
|
if (e) {
|
|
475
475
|
if (We === 0) {
|
|
@@ -502,7 +502,7 @@ function J(e = {}) {
|
|
|
502
502
|
t && (e ? (t.addEventListener("resize", a), t.addEventListener("scroll", a), a()) : (t.removeEventListener("resize", a), t.removeEventListener("scroll", a), i.value = null));
|
|
503
503
|
}
|
|
504
504
|
function s(e) {
|
|
505
|
-
e !== t.value && (t.value = e, e && !r ? (
|
|
505
|
+
e !== t.value && (t.value = e, e && !r ? (He(), qe(), o(!0), r = !0) : !e && r && (Ue(), q(), o(!1), r = !1));
|
|
506
506
|
}
|
|
507
507
|
function c(e) {
|
|
508
508
|
if (e.key !== "Escape" || !t.value) return;
|
|
@@ -538,7 +538,7 @@ function J(e = {}) {
|
|
|
538
538
|
"z-index": "var(--cfasim-z-fullscreen, 1000)",
|
|
539
539
|
background: "var(--color-bg-0, #fff)",
|
|
540
540
|
color: "var(--color-text, inherit)",
|
|
541
|
-
padding:
|
|
541
|
+
padding: K() ? "0" : "2em",
|
|
542
542
|
"box-sizing": "border-box",
|
|
543
543
|
display: "flex",
|
|
544
544
|
"flex-direction": "column",
|
|
@@ -562,18 +562,18 @@ function Je(e) {
|
|
|
562
562
|
i && a.push(i.menuItem.value), a.push({
|
|
563
563
|
label: "Save as SVG",
|
|
564
564
|
action: () => {
|
|
565
|
-
t.value &&
|
|
565
|
+
t.value && G(t.value, n);
|
|
566
566
|
}
|
|
567
567
|
}, {
|
|
568
568
|
label: "Save as PNG",
|
|
569
569
|
action: () => {
|
|
570
|
-
t.value &&
|
|
570
|
+
t.value && Le(t.value, n);
|
|
571
571
|
}
|
|
572
572
|
});
|
|
573
573
|
let o = e.downloadButton?.();
|
|
574
574
|
return !e.downloadLink() && !o && a.push({
|
|
575
575
|
label: "Download CSV",
|
|
576
|
-
action: () =>
|
|
576
|
+
action: () => ze(e.getCsv(), n)
|
|
577
577
|
}), a;
|
|
578
578
|
}), o = n(() => {
|
|
579
579
|
if (e.downloadButton?.()) return null;
|
|
@@ -584,7 +584,7 @@ function Je(e) {
|
|
|
584
584
|
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
585
585
|
});
|
|
586
586
|
function l() {
|
|
587
|
-
|
|
587
|
+
ze(e.getCsv(), r());
|
|
588
588
|
}
|
|
589
589
|
return {
|
|
590
590
|
svgRef: t,
|
|
@@ -976,7 +976,7 @@ function wt(e) {
|
|
|
976
976
|
return i.value - t;
|
|
977
977
|
}
|
|
978
978
|
return e.height() ?? Ct;
|
|
979
|
-
}), { padding: _, legendY: v, inlineLegendLayout: y, innerW: te, innerH: b, bounds: ne } =
|
|
979
|
+
}), { padding: _, legendY: v, inlineLegendLayout: y, innerW: te, innerH: b, bounds: ne } = Ne({
|
|
980
980
|
title: e.title,
|
|
981
981
|
titleStyle: e.titleStyle,
|
|
982
982
|
xLabel: e.xLabel,
|
|
@@ -985,7 +985,7 @@ function wt(e) {
|
|
|
985
985
|
width: () => g.value,
|
|
986
986
|
height: () => ee.value,
|
|
987
987
|
extraPadding: e.chartPadding
|
|
988
|
-
}), { hoverIndex: re, tooltipRef: x, tooltipPos: S, handlers: ie } =
|
|
988
|
+
}), { hoverIndex: re, tooltipRef: x, tooltipPos: S, handlers: ie } = Fe({
|
|
989
989
|
enabled: e.hasTooltipSlot,
|
|
990
990
|
trigger: e.tooltipTrigger,
|
|
991
991
|
clamp: () => e.tooltipClamp() ?? "window",
|
|
@@ -1081,7 +1081,7 @@ function jt(e, t = "#ffffff", n = "#1a1a1a") {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
//#endregion
|
|
1083
1083
|
//#region src/_shared/dateAxis.ts
|
|
1084
|
-
var Mt = /^(\d{4})-(\d{2})-(\d{2})$/, Nt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, Pt = 1e3,
|
|
1084
|
+
var Mt = /^(\d{4})-(\d{2})-(\d{2})$/, Nt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, Pt = 1e3, Ft = 60 * Pt, X = 60 * Ft, It = 24 * X, Lt = 7 * It, Rt = 30 * It, zt = 365 * It, Bt = [
|
|
1085
1085
|
{
|
|
1086
1086
|
unit: "second",
|
|
1087
1087
|
step: 1,
|
|
@@ -1105,110 +1105,110 @@ var Mt = /^(\d{4})-(\d{2})-(\d{2})$/, Nt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2})
|
|
|
1105
1105
|
{
|
|
1106
1106
|
unit: "minute",
|
|
1107
1107
|
step: 1,
|
|
1108
|
-
ms: 1 *
|
|
1108
|
+
ms: 1 * Ft
|
|
1109
1109
|
},
|
|
1110
1110
|
{
|
|
1111
1111
|
unit: "minute",
|
|
1112
1112
|
step: 5,
|
|
1113
|
-
ms: 5 *
|
|
1113
|
+
ms: 5 * Ft
|
|
1114
1114
|
},
|
|
1115
1115
|
{
|
|
1116
1116
|
unit: "minute",
|
|
1117
1117
|
step: 15,
|
|
1118
|
-
ms: 15 *
|
|
1118
|
+
ms: 15 * Ft
|
|
1119
1119
|
},
|
|
1120
1120
|
{
|
|
1121
1121
|
unit: "minute",
|
|
1122
1122
|
step: 30,
|
|
1123
|
-
ms: 30 *
|
|
1123
|
+
ms: 30 * Ft
|
|
1124
1124
|
},
|
|
1125
1125
|
{
|
|
1126
1126
|
unit: "hour",
|
|
1127
1127
|
step: 1,
|
|
1128
|
-
ms: 1 *
|
|
1128
|
+
ms: 1 * X
|
|
1129
1129
|
},
|
|
1130
1130
|
{
|
|
1131
1131
|
unit: "hour",
|
|
1132
1132
|
step: 3,
|
|
1133
|
-
ms: 3 *
|
|
1133
|
+
ms: 3 * X
|
|
1134
1134
|
},
|
|
1135
1135
|
{
|
|
1136
1136
|
unit: "hour",
|
|
1137
1137
|
step: 6,
|
|
1138
|
-
ms: 6 *
|
|
1138
|
+
ms: 6 * X
|
|
1139
1139
|
},
|
|
1140
1140
|
{
|
|
1141
1141
|
unit: "hour",
|
|
1142
1142
|
step: 12,
|
|
1143
|
-
ms: 12 *
|
|
1143
|
+
ms: 12 * X
|
|
1144
1144
|
},
|
|
1145
1145
|
{
|
|
1146
1146
|
unit: "day",
|
|
1147
1147
|
step: 1,
|
|
1148
|
-
ms: 1 *
|
|
1148
|
+
ms: 1 * It
|
|
1149
1149
|
},
|
|
1150
1150
|
{
|
|
1151
1151
|
unit: "day",
|
|
1152
1152
|
step: 2,
|
|
1153
|
-
ms: 2 *
|
|
1153
|
+
ms: 2 * It
|
|
1154
1154
|
},
|
|
1155
1155
|
{
|
|
1156
1156
|
unit: "week",
|
|
1157
1157
|
step: 1,
|
|
1158
|
-
ms: 1 *
|
|
1158
|
+
ms: 1 * Lt
|
|
1159
1159
|
},
|
|
1160
1160
|
{
|
|
1161
1161
|
unit: "month",
|
|
1162
1162
|
step: 1,
|
|
1163
|
-
ms: 1 *
|
|
1163
|
+
ms: 1 * Rt
|
|
1164
1164
|
},
|
|
1165
1165
|
{
|
|
1166
1166
|
unit: "month",
|
|
1167
1167
|
step: 3,
|
|
1168
|
-
ms: 3 *
|
|
1168
|
+
ms: 3 * Rt
|
|
1169
1169
|
},
|
|
1170
1170
|
{
|
|
1171
1171
|
unit: "month",
|
|
1172
1172
|
step: 6,
|
|
1173
|
-
ms: 6 *
|
|
1173
|
+
ms: 6 * Rt
|
|
1174
1174
|
},
|
|
1175
1175
|
{
|
|
1176
1176
|
unit: "year",
|
|
1177
1177
|
step: 1,
|
|
1178
|
-
ms: 1 *
|
|
1178
|
+
ms: 1 * zt
|
|
1179
1179
|
},
|
|
1180
1180
|
{
|
|
1181
1181
|
unit: "year",
|
|
1182
1182
|
step: 2,
|
|
1183
|
-
ms: 2 *
|
|
1183
|
+
ms: 2 * zt
|
|
1184
1184
|
},
|
|
1185
1185
|
{
|
|
1186
1186
|
unit: "year",
|
|
1187
1187
|
step: 5,
|
|
1188
|
-
ms: 5 *
|
|
1188
|
+
ms: 5 * zt
|
|
1189
1189
|
},
|
|
1190
1190
|
{
|
|
1191
1191
|
unit: "year",
|
|
1192
1192
|
step: 10,
|
|
1193
|
-
ms: 10 *
|
|
1193
|
+
ms: 10 * zt
|
|
1194
1194
|
},
|
|
1195
1195
|
{
|
|
1196
1196
|
unit: "year",
|
|
1197
1197
|
step: 25,
|
|
1198
|
-
ms: 25 *
|
|
1198
|
+
ms: 25 * zt
|
|
1199
1199
|
},
|
|
1200
1200
|
{
|
|
1201
1201
|
unit: "year",
|
|
1202
1202
|
step: 50,
|
|
1203
|
-
ms: 50 *
|
|
1203
|
+
ms: 50 * zt
|
|
1204
1204
|
},
|
|
1205
1205
|
{
|
|
1206
1206
|
unit: "year",
|
|
1207
1207
|
step: 100,
|
|
1208
|
-
ms: 100 *
|
|
1208
|
+
ms: 100 * zt
|
|
1209
1209
|
}
|
|
1210
|
-
],
|
|
1211
|
-
function
|
|
1210
|
+
], Vt = 1e3;
|
|
1211
|
+
function Ht(e, t) {
|
|
1212
1212
|
if (e instanceof Date) {
|
|
1213
1213
|
let t = e.getTime();
|
|
1214
1214
|
return Number.isFinite(t) ? t : null;
|
|
@@ -1224,35 +1224,35 @@ function Vt(e, t) {
|
|
|
1224
1224
|
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];
|
|
1225
1225
|
if (l) {
|
|
1226
1226
|
if (l === "Z" || l === "z") return Date.UTC(e, n, i, a, o, s, c);
|
|
1227
|
-
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) *
|
|
1227
|
+
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * Ft;
|
|
1228
1228
|
return Date.UTC(e, n, i, a, o, s, c) - d;
|
|
1229
1229
|
}
|
|
1230
1230
|
return t === "utc" ? Date.UTC(e, n, i, a, o, s, c) : new Date(e, n, i, a, o, s, c).getTime();
|
|
1231
1231
|
}
|
|
1232
1232
|
return null;
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1234
|
+
function Ut(e) {
|
|
1235
1235
|
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? Mt.test(e) || Nt.test(e) : !1;
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1237
|
+
function Wt(e, t) {
|
|
1238
1238
|
if (e.length === 0) return !1;
|
|
1239
1239
|
for (let n = 0; n < e.length; n++) {
|
|
1240
1240
|
let r = e[n];
|
|
1241
|
-
if (!
|
|
1241
|
+
if (!Ut(r) || Ht(r, t) === null) return !1;
|
|
1242
1242
|
}
|
|
1243
1243
|
return !0;
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function Gt(e, t) {
|
|
1246
1246
|
let n = e / Math.max(1, t);
|
|
1247
|
-
for (let e of
|
|
1248
|
-
return
|
|
1247
|
+
for (let e of Bt) if (n <= e.ms) return e;
|
|
1248
|
+
return Bt[Bt.length - 1];
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1250
|
+
function Kt(e, t, n) {
|
|
1251
1251
|
let r = new Date(e);
|
|
1252
1252
|
if (n === "utc") switch (t) {
|
|
1253
1253
|
case "second": return Math.floor(e / Pt) * Pt;
|
|
1254
|
-
case "minute": return Math.floor(e /
|
|
1255
|
-
case "hour": return Math.floor(e /
|
|
1254
|
+
case "minute": return Math.floor(e / Ft) * Ft;
|
|
1255
|
+
case "hour": return Math.floor(e / X) * X;
|
|
1256
1256
|
case "day": return Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate());
|
|
1257
1257
|
case "week": {
|
|
1258
1258
|
let e = (r.getUTCDay() + 6) % 7;
|
|
@@ -1263,7 +1263,7 @@ function Gt(e, t, n) {
|
|
|
1263
1263
|
}
|
|
1264
1264
|
switch (t) {
|
|
1265
1265
|
case "second": return Math.floor(e / Pt) * Pt;
|
|
1266
|
-
case "minute": return Math.floor(e /
|
|
1266
|
+
case "minute": return Math.floor(e / Ft) * Ft;
|
|
1267
1267
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
|
|
1268
1268
|
case "day": return new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime();
|
|
1269
1269
|
case "week": {
|
|
@@ -1274,11 +1274,11 @@ function Gt(e, t, n) {
|
|
|
1274
1274
|
case "year": return new Date(r.getFullYear(), 0, 1).getTime();
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1277
|
+
function qt(e, t, n, r) {
|
|
1278
1278
|
if (t === "second") return e + n * Pt;
|
|
1279
|
-
if (t === "minute") return e + n *
|
|
1280
|
-
if (t === "hour" && r === "utc") return e + n *
|
|
1281
|
-
if (t === "week" && r === "utc") return e + n *
|
|
1279
|
+
if (t === "minute") return e + n * Ft;
|
|
1280
|
+
if (t === "hour" && r === "utc") return e + n * X;
|
|
1281
|
+
if (t === "week" && r === "utc") return e + n * Lt;
|
|
1282
1282
|
let i = new Date(e);
|
|
1283
1283
|
if (r === "utc") switch (t) {
|
|
1284
1284
|
case "day": return Date.UTC(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate() + n, i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds());
|
|
@@ -1294,21 +1294,21 @@ function Kt(e, t, n, r) {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
return e;
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function Jt(e, t, n, r) {
|
|
1298
1298
|
if (!Number.isFinite(e) || !Number.isFinite(t) || e >= t || n < 1) return {
|
|
1299
1299
|
values: [],
|
|
1300
1300
|
unit: "day"
|
|
1301
1301
|
};
|
|
1302
|
-
let { unit: i, step: a } =
|
|
1303
|
-
for (; o < e && s <
|
|
1302
|
+
let { unit: i, step: a } = Gt(t - e, n), o = Kt(e, i, r), s = 0;
|
|
1303
|
+
for (; o < e && s < Vt;) o = qt(o, i, a, r), s++;
|
|
1304
1304
|
let c = [];
|
|
1305
|
-
for (let e = 0; e <
|
|
1305
|
+
for (let e = 0; e < Vt && o <= t; e++) c.push(o), o = qt(o, i, a, r);
|
|
1306
1306
|
return {
|
|
1307
1307
|
values: c,
|
|
1308
1308
|
unit: i
|
|
1309
1309
|
};
|
|
1310
1310
|
}
|
|
1311
|
-
var
|
|
1311
|
+
var Yt = {
|
|
1312
1312
|
iso: {
|
|
1313
1313
|
year: "numeric",
|
|
1314
1314
|
month: "2-digit",
|
|
@@ -1346,7 +1346,7 @@ var Jt = {
|
|
|
1346
1346
|
hourCycle: "h23"
|
|
1347
1347
|
},
|
|
1348
1348
|
medium: { dateStyle: "medium" }
|
|
1349
|
-
},
|
|
1349
|
+
}, Xt = {
|
|
1350
1350
|
year: "year",
|
|
1351
1351
|
month: "month-year",
|
|
1352
1352
|
week: "month-day",
|
|
@@ -1355,30 +1355,30 @@ var Jt = {
|
|
|
1355
1355
|
minute: "time",
|
|
1356
1356
|
second: "time"
|
|
1357
1357
|
};
|
|
1358
|
-
function
|
|
1358
|
+
function Z(e) {
|
|
1359
1359
|
return e < 10 ? "0" + e : String(e);
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1361
|
+
function Zt(e, t) {
|
|
1362
1362
|
let n = new Date(e);
|
|
1363
|
-
return t === "utc" ? `${n.getUTCFullYear()}-${
|
|
1363
|
+
return t === "utc" ? `${n.getUTCFullYear()}-${Z(n.getUTCMonth() + 1)}-${Z(n.getUTCDate())}` : `${n.getFullYear()}-${Z(n.getMonth() + 1)}-${Z(n.getDate())}`;
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1365
|
+
function Qt(e, t) {
|
|
1366
1366
|
let n = new Date(e);
|
|
1367
|
-
return t === "utc" ? `${n.getUTCFullYear()}-${
|
|
1367
|
+
return t === "utc" ? `${n.getUTCFullYear()}-${Z(n.getUTCMonth() + 1)}-${Z(n.getUTCDate())}T${Z(n.getUTCHours())}:${Z(n.getUTCMinutes())}:${Z(n.getUTCSeconds())}Z` : `${n.getFullYear()}-${Z(n.getMonth() + 1)}-${Z(n.getDate())}T${Z(n.getHours())}:${Z(n.getMinutes())}:${Z(n.getSeconds())}`;
|
|
1368
1368
|
}
|
|
1369
|
-
function
|
|
1370
|
-
return e in
|
|
1369
|
+
function $t(e) {
|
|
1370
|
+
return e in Yt;
|
|
1371
1371
|
}
|
|
1372
|
-
function
|
|
1372
|
+
function en(e, t, n, r) {
|
|
1373
1373
|
if (typeof t == "function") return t(e, r);
|
|
1374
1374
|
let i = null, a;
|
|
1375
|
-
if (t === void 0) i = r ?
|
|
1375
|
+
if (t === void 0) i = r ? Xt[r] : "iso", a = Yt[i];
|
|
1376
1376
|
else if (typeof t == "string") {
|
|
1377
|
-
if (
|
|
1378
|
-
i = t, a =
|
|
1377
|
+
if (!$t(t)) throw Error(`Unknown date format preset: "${t}"`);
|
|
1378
|
+
i = t, a = Yt[i];
|
|
1379
1379
|
} else a = t;
|
|
1380
|
-
if (i === "iso") return
|
|
1381
|
-
if (i === "iso-datetime") return
|
|
1380
|
+
if (i === "iso") return Zt(e, n);
|
|
1381
|
+
if (i === "iso-datetime") return Qt(e, n);
|
|
1382
1382
|
let o = n === "utc" ? {
|
|
1383
1383
|
...a,
|
|
1384
1384
|
timeZone: "UTC"
|
|
@@ -1387,51 +1387,46 @@ function $t(e, t, n, r) {
|
|
|
1387
1387
|
}
|
|
1388
1388
|
//#endregion
|
|
1389
1389
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
1390
|
-
var
|
|
1390
|
+
var tn = {
|
|
1391
1391
|
class: "chart-sr-only",
|
|
1392
1392
|
"aria-live": "polite"
|
|
1393
|
-
},
|
|
1393
|
+
}, nn = [
|
|
1394
1394
|
"width",
|
|
1395
1395
|
"height",
|
|
1396
1396
|
"role",
|
|
1397
1397
|
"aria-label"
|
|
1398
|
-
],
|
|
1398
|
+
], rn = [
|
|
1399
1399
|
"x",
|
|
1400
1400
|
"y",
|
|
1401
1401
|
"text-anchor",
|
|
1402
1402
|
"font-size",
|
|
1403
1403
|
"font-weight",
|
|
1404
1404
|
"fill"
|
|
1405
|
-
],
|
|
1405
|
+
], an = ["x", "dy"], on = { key: 1 }, sn = [
|
|
1406
1406
|
"x1",
|
|
1407
1407
|
"y1",
|
|
1408
1408
|
"x2",
|
|
1409
1409
|
"y2",
|
|
1410
1410
|
"stroke",
|
|
1411
1411
|
"stroke-dasharray"
|
|
1412
|
-
],
|
|
1412
|
+
], cn = [
|
|
1413
1413
|
"x",
|
|
1414
1414
|
"y",
|
|
1415
1415
|
"fill",
|
|
1416
1416
|
"fill-opacity",
|
|
1417
1417
|
"stroke"
|
|
1418
|
-
],
|
|
1418
|
+
], ln = [
|
|
1419
1419
|
"cx",
|
|
1420
1420
|
"cy",
|
|
1421
1421
|
"fill",
|
|
1422
1422
|
"fill-opacity",
|
|
1423
1423
|
"stroke"
|
|
1424
|
-
],
|
|
1424
|
+
], un = [
|
|
1425
1425
|
"x",
|
|
1426
1426
|
"y",
|
|
1427
1427
|
"font-size",
|
|
1428
1428
|
"fill",
|
|
1429
1429
|
"font-weight"
|
|
1430
|
-
], un = [
|
|
1431
|
-
"x1",
|
|
1432
|
-
"y1",
|
|
1433
|
-
"x2",
|
|
1434
|
-
"y2"
|
|
1435
1430
|
], dn = [
|
|
1436
1431
|
"x1",
|
|
1437
1432
|
"y1",
|
|
@@ -1448,18 +1443,23 @@ var en = {
|
|
|
1448
1443
|
"x2",
|
|
1449
1444
|
"y2"
|
|
1450
1445
|
], mn = [
|
|
1446
|
+
"x1",
|
|
1447
|
+
"y1",
|
|
1448
|
+
"x2",
|
|
1449
|
+
"y2"
|
|
1450
|
+
], hn = [
|
|
1451
1451
|
"x",
|
|
1452
1452
|
"y",
|
|
1453
1453
|
"font-size",
|
|
1454
1454
|
"fill",
|
|
1455
1455
|
"font-weight",
|
|
1456
1456
|
"fill-opacity"
|
|
1457
|
-
],
|
|
1457
|
+
], gn = [
|
|
1458
1458
|
"transform",
|
|
1459
1459
|
"font-size",
|
|
1460
1460
|
"fill",
|
|
1461
1461
|
"font-weight"
|
|
1462
|
-
],
|
|
1462
|
+
], _n = [
|
|
1463
1463
|
"x",
|
|
1464
1464
|
"y",
|
|
1465
1465
|
"text-anchor",
|
|
@@ -1467,17 +1467,17 @@ var en = {
|
|
|
1467
1467
|
"fill",
|
|
1468
1468
|
"font-weight",
|
|
1469
1469
|
"fill-opacity"
|
|
1470
|
-
],
|
|
1470
|
+
], vn = [
|
|
1471
1471
|
"x",
|
|
1472
1472
|
"y",
|
|
1473
1473
|
"font-size",
|
|
1474
1474
|
"fill",
|
|
1475
1475
|
"font-weight"
|
|
1476
|
-
],
|
|
1476
|
+
], yn = [
|
|
1477
1477
|
"d",
|
|
1478
1478
|
"fill",
|
|
1479
1479
|
"fill-opacity"
|
|
1480
|
-
],
|
|
1480
|
+
], Q = [
|
|
1481
1481
|
"d",
|
|
1482
1482
|
"stroke",
|
|
1483
1483
|
"stroke-width"
|
|
@@ -1626,13 +1626,13 @@ var en = {
|
|
|
1626
1626
|
if (!e) return;
|
|
1627
1627
|
if (!t) return e;
|
|
1628
1628
|
let r = new Float64Array(e.length);
|
|
1629
|
-
for (let t = 0; t < e.length; t++) r[t] =
|
|
1629
|
+
for (let t = 0; t < e.length; t++) r[t] = Ht(e[t], n) ?? NaN;
|
|
1630
1630
|
return r;
|
|
1631
1631
|
}
|
|
1632
1632
|
let ie = Tt(() => f.tooltipValueFormat, () => f.yTickFormat), C = n(() => f.timezone ?? "utc"), w = n(() => {
|
|
1633
1633
|
let e = C.value, t = !1, n = !1;
|
|
1634
1634
|
for (let r of re(f)) {
|
|
1635
|
-
if (n = !0, !
|
|
1635
|
+
if (n = !0, !Wt(r, e)) {
|
|
1636
1636
|
t = !1;
|
|
1637
1637
|
break;
|
|
1638
1638
|
}
|
|
@@ -1693,7 +1693,7 @@ var en = {
|
|
|
1693
1693
|
});
|
|
1694
1694
|
function A(e) {
|
|
1695
1695
|
let { min: t, max: n } = le.value, r = n - t || 1;
|
|
1696
|
-
return
|
|
1696
|
+
return V.value.left + (e - t) / r * W.value;
|
|
1697
1697
|
}
|
|
1698
1698
|
let ue = n(() => {
|
|
1699
1699
|
let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
|
|
@@ -1719,7 +1719,7 @@ var en = {
|
|
|
1719
1719
|
});
|
|
1720
1720
|
function j(e) {
|
|
1721
1721
|
let { min: t, max: n } = ue.value;
|
|
1722
|
-
return
|
|
1722
|
+
return V.value.top + G.value - we(e, t, n, f.yScaleType) * G.value;
|
|
1723
1723
|
}
|
|
1724
1724
|
function de(e) {
|
|
1725
1725
|
let t = e.data;
|
|
@@ -1767,10 +1767,10 @@ var en = {
|
|
|
1767
1767
|
return A(r ? k(r, n) : n);
|
|
1768
1768
|
}
|
|
1769
1769
|
function me(e, t = !0) {
|
|
1770
|
-
let n =
|
|
1770
|
+
let n = V.value.top + G.value;
|
|
1771
1771
|
if (e.seriesIndex == null) {
|
|
1772
1772
|
let t = M(e, "start"), r = M(e, "end");
|
|
1773
|
-
return t > r ? "" : `M${t},${
|
|
1773
|
+
return t > r ? "" : `M${t},${V.value.top}L${r},${V.value.top}L${r},${n}L${t},${n}Z`;
|
|
1774
1774
|
}
|
|
1775
1775
|
let r = E.value[e.seriesIndex];
|
|
1776
1776
|
if (!r) return "";
|
|
@@ -1786,14 +1786,14 @@ var en = {
|
|
|
1786
1786
|
labels: [],
|
|
1787
1787
|
extraHeight: 0
|
|
1788
1788
|
};
|
|
1789
|
-
let t = [], n =
|
|
1789
|
+
let t = [], n = V.value.left + W.value;
|
|
1790
1790
|
for (let r of e) {
|
|
1791
1791
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
1792
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * zn, o = M(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : E.value[r.seriesIndex]?.color ?? "currentColor"), u =
|
|
1792
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * zn, o = M(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : E.value[r.seriesIndex]?.color ?? "currentColor"), u = Oe({
|
|
1793
1793
|
color: l,
|
|
1794
1794
|
fontWeight: 600,
|
|
1795
1795
|
...r.inlineLabelStyle
|
|
1796
|
-
}, { fontSize: 11 }), d =
|
|
1796
|
+
}, { fontSize: 11 }), d = Oe(r.inlineDescriptionStyle, {
|
|
1797
1797
|
fontSize: 11,
|
|
1798
1798
|
fillOpacity: .6
|
|
1799
1799
|
});
|
|
@@ -1851,11 +1851,11 @@ var en = {
|
|
|
1851
1851
|
});
|
|
1852
1852
|
}
|
|
1853
1853
|
return e;
|
|
1854
|
-
}), _e = n(() => ge.value.map((e) => e.label)), ve = n(() =>
|
|
1854
|
+
}), _e = n(() => ge.value.map((e) => e.label)), ve = n(() => Ie.value + he.value.extraHeight), N = n(() => V.value.top + G.value + V.value.bottom + Rn), be = n(() => {
|
|
1855
1855
|
let { min: e, max: t } = ue.value, n = (e) => f.yTickFormat === void 0 ? Ce(e) : ae(e, f.yTickFormat);
|
|
1856
1856
|
return e === t ? [{
|
|
1857
1857
|
value: n(e),
|
|
1858
|
-
y: P(
|
|
1858
|
+
y: P(V.value.top + G.value / 2)
|
|
1859
1859
|
}] : (f.yScaleType === "log" ? I({
|
|
1860
1860
|
min: e,
|
|
1861
1861
|
max: t,
|
|
@@ -1864,7 +1864,7 @@ var en = {
|
|
|
1864
1864
|
min: e,
|
|
1865
1865
|
max: t,
|
|
1866
1866
|
ticks: f.yTicks,
|
|
1867
|
-
targetTickCount:
|
|
1867
|
+
targetTickCount: G.value / 50
|
|
1868
1868
|
})).map((e) => ({
|
|
1869
1869
|
value: n(e),
|
|
1870
1870
|
y: P(j(e))
|
|
@@ -1872,16 +1872,16 @@ var en = {
|
|
|
1872
1872
|
});
|
|
1873
1873
|
function xe(e, t, n) {
|
|
1874
1874
|
let r = f.xTickFormat;
|
|
1875
|
-
if (T.value) return typeof r == "function" ? r(e, t) :
|
|
1875
|
+
if (T.value) return typeof r == "function" ? r(e, t) : en(e, r, C.value, n);
|
|
1876
1876
|
let i = e + ce.value;
|
|
1877
1877
|
return r === void 0 ? !O.value && f.xLabels && Number.isInteger(e) && e >= 0 && e < f.xLabels.length ? f.xLabels[e] : Ce(i) : typeof r == "function" ? r(i, t) : ae(i, r);
|
|
1878
1878
|
}
|
|
1879
1879
|
let Se = n(() => {
|
|
1880
1880
|
let { min: e, max: t } = le.value;
|
|
1881
1881
|
if (e === t) return [];
|
|
1882
|
-
let n = T.value, r = n ? 0 : ce.value, i = D.value, a =
|
|
1882
|
+
let n = T.value, r = n ? 0 : ce.value, i = D.value, a = W.value / 80, o, s;
|
|
1883
1883
|
if (n) {
|
|
1884
|
-
let n =
|
|
1884
|
+
let n = Jt(e, t, a, C.value);
|
|
1885
1885
|
s = n.unit, o = F({
|
|
1886
1886
|
min: e,
|
|
1887
1887
|
max: t,
|
|
@@ -1898,7 +1898,7 @@ var en = {
|
|
|
1898
1898
|
targetTickCount: a,
|
|
1899
1899
|
displayOffset: r
|
|
1900
1900
|
});
|
|
1901
|
-
let c =
|
|
1901
|
+
let c = V.value.left, l = V.value.left + W.value;
|
|
1902
1902
|
return o.map((e, t) => {
|
|
1903
1903
|
let n = P(A(e)), r = "middle";
|
|
1904
1904
|
return n - c <= 1 ? r = "start" : l - n <= 1 && (r = "end"), {
|
|
@@ -1911,11 +1911,11 @@ var en = {
|
|
|
1911
1911
|
function Ee() {
|
|
1912
1912
|
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv : Qe(E.value);
|
|
1913
1913
|
}
|
|
1914
|
-
let
|
|
1915
|
-
let e =
|
|
1914
|
+
let De = n(() => !!f.tooltipData || !!f.tooltipTrigger), R = n(() => {
|
|
1915
|
+
let e = Re.value, t = E.value[0];
|
|
1916
1916
|
return e === null || !t ? null : k(t, e);
|
|
1917
|
-
}),
|
|
1918
|
-
function
|
|
1917
|
+
}), ke = n(() => R.value === null ? 0 : A(R.value));
|
|
1918
|
+
function Ae(e, t) {
|
|
1919
1919
|
let n = e.data.length;
|
|
1920
1920
|
if (n === 0) return null;
|
|
1921
1921
|
let r = 0, i = Infinity;
|
|
@@ -1927,13 +1927,13 @@ var en = {
|
|
|
1927
1927
|
}
|
|
1928
1928
|
return i === Infinity ? null : r;
|
|
1929
1929
|
}
|
|
1930
|
-
let
|
|
1931
|
-
let e =
|
|
1930
|
+
let je = n(() => {
|
|
1931
|
+
let e = R.value;
|
|
1932
1932
|
if (e === null) return [];
|
|
1933
1933
|
let t = [];
|
|
1934
1934
|
for (let n of E.value) {
|
|
1935
1935
|
if (n.showInTooltip === !1) continue;
|
|
1936
|
-
let r =
|
|
1936
|
+
let r = Ae(n, e);
|
|
1937
1937
|
if (r === null) continue;
|
|
1938
1938
|
let i = n.data[r];
|
|
1939
1939
|
isFinite(i) && t.push({
|
|
@@ -1943,14 +1943,14 @@ var en = {
|
|
|
1943
1943
|
});
|
|
1944
1944
|
}
|
|
1945
1945
|
return t;
|
|
1946
|
-
}),
|
|
1947
|
-
let e =
|
|
1946
|
+
}), Me = n(() => {
|
|
1947
|
+
let e = Re.value, t = R.value;
|
|
1948
1948
|
if (e === null || t === null) return null;
|
|
1949
1949
|
let n = xe(t, e), r = E.value, i = [];
|
|
1950
1950
|
for (let e = 0; e < r.length; e++) {
|
|
1951
1951
|
let n = r[e];
|
|
1952
1952
|
if (n.showInTooltip === !1) continue;
|
|
1953
|
-
let a =
|
|
1953
|
+
let a = Ae(n, t);
|
|
1954
1954
|
i.push({
|
|
1955
1955
|
value: a === null ? NaN : Number(n.data[a]),
|
|
1956
1956
|
color: n.color ?? "currentColor",
|
|
@@ -1964,21 +1964,21 @@ var en = {
|
|
|
1964
1964
|
data: f.tooltipData?.[e] ?? null
|
|
1965
1965
|
};
|
|
1966
1966
|
});
|
|
1967
|
-
function
|
|
1967
|
+
function Ne(e, t) {
|
|
1968
1968
|
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1969
1969
|
x: A(e - ce.value),
|
|
1970
1970
|
y: j(t)
|
|
1971
1971
|
};
|
|
1972
1972
|
}
|
|
1973
|
-
function
|
|
1974
|
-
let t =
|
|
1973
|
+
function Pe(e) {
|
|
1974
|
+
let t = z.value?.getBoundingClientRect();
|
|
1975
1975
|
if (!t) return null;
|
|
1976
1976
|
let n = E.value[0];
|
|
1977
1977
|
if (!n || n.data.length === 0) return null;
|
|
1978
1978
|
let { min: r, max: i } = le.value, a = i - r || 1;
|
|
1979
|
-
return
|
|
1979
|
+
return Ae(n, r + (e - t.left - V.value.left) / W.value * a);
|
|
1980
1980
|
}
|
|
1981
|
-
let { containerRef:
|
|
1981
|
+
let { containerRef: z, svgRef: B, width: Fe, height: Ie, padding: V, legendY: H, inlineLegendLayout: U, innerW: W, innerH: G, bounds: Le, hoverIndex: Re, tooltipRef: ze, tooltipPos: K, tooltipHandlers: Be, menuItems: Ve, downloadLinkText: He, csvHref: Ue, downloadButtonText: We, triggerCsvDownload: Ge, menuFilename: Ke, isFullscreen: qe, fullscreenStyle: q, teleportTarget: J, exitFullscreen: Je } = wt({
|
|
1982
1982
|
width: () => f.width,
|
|
1983
1983
|
height: () => f.height,
|
|
1984
1984
|
title: () => f.title,
|
|
@@ -1995,16 +1995,16 @@ var en = {
|
|
|
1995
1995
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
1996
1996
|
chartPadding: () => f.chartPadding,
|
|
1997
1997
|
inlineLegendLabels: () => _e.value,
|
|
1998
|
-
hasTooltipSlot: () =>
|
|
1998
|
+
hasTooltipSlot: () => De.value,
|
|
1999
1999
|
getCsv: Ee,
|
|
2000
|
-
pointerToIndex:
|
|
2000
|
+
pointerToIndex: Pe,
|
|
2001
2001
|
onHover: (e) => ee("hover", e),
|
|
2002
2002
|
extraBelowHeight: () => he.value.extraHeight
|
|
2003
|
-
}), Ye = n(() =>
|
|
2003
|
+
}), Ye = n(() => Oe(f.axisLabelStyle, { fontSize: 13 })), Y = n(() => Oe(f.tickLabelStyle, {
|
|
2004
2004
|
fontSize: 10,
|
|
2005
|
-
fillOpacity:
|
|
2006
|
-
})), Xe = n(() =>
|
|
2007
|
-
let e = f.titleStyle, t = e?.align ?? "left", n =
|
|
2005
|
+
fillOpacity: L
|
|
2006
|
+
})), Xe = n(() => Oe(f.legendStyle, { fontSize: 11 })), Ze = n(() => {
|
|
2007
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = Le.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
2008
2008
|
return {
|
|
2009
2009
|
lines: (f.title ?? "").split("\n"),
|
|
2010
2010
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -2015,7 +2015,7 @@ var en = {
|
|
|
2015
2015
|
anchor: i
|
|
2016
2016
|
};
|
|
2017
2017
|
}), $e = n(() => {
|
|
2018
|
-
let e =
|
|
2018
|
+
let e = U.value.positions, t = V.value.left, n = H.value;
|
|
2019
2019
|
return ge.value.map((r, i) => {
|
|
2020
2020
|
let a = e[i];
|
|
2021
2021
|
return {
|
|
@@ -2030,14 +2030,14 @@ var en = {
|
|
|
2030
2030
|
disabled: !x(qe)
|
|
2031
2031
|
}, [o("div", d({
|
|
2032
2032
|
ref_key: "containerRef",
|
|
2033
|
-
ref:
|
|
2033
|
+
ref: z
|
|
2034
2034
|
}, n.$attrs, {
|
|
2035
2035
|
class: ["line-chart-wrapper", { "is-fullscreen": x(qe) }],
|
|
2036
2036
|
style: x(q)
|
|
2037
2037
|
}), [
|
|
2038
2038
|
c.menu ? (_(), r(ye, {
|
|
2039
2039
|
key: 0,
|
|
2040
|
-
items: x(
|
|
2040
|
+
items: x(Ve),
|
|
2041
2041
|
"is-fullscreen": x(qe),
|
|
2042
2042
|
onClose: x(Je)
|
|
2043
2043
|
}, null, 8, [
|
|
@@ -2045,11 +2045,11 @@ var en = {
|
|
|
2045
2045
|
"is-fullscreen",
|
|
2046
2046
|
"onClose"
|
|
2047
2047
|
])) : i("", !0),
|
|
2048
|
-
o("div",
|
|
2048
|
+
o("div", tn, b(x(qe) ? "Chart expanded to fill window" : ""), 1),
|
|
2049
2049
|
(_(), a("svg", {
|
|
2050
2050
|
ref_key: "svgRef",
|
|
2051
|
-
ref:
|
|
2052
|
-
width: x(
|
|
2051
|
+
ref: B,
|
|
2052
|
+
width: x(Fe),
|
|
2053
2053
|
height: ve.value,
|
|
2054
2054
|
role: g.value || void 0,
|
|
2055
2055
|
"aria-label": p.value || void 0
|
|
@@ -2066,8 +2066,8 @@ var en = {
|
|
|
2066
2066
|
key: t,
|
|
2067
2067
|
x: Ze.value.x,
|
|
2068
2068
|
dy: t === 0 ? 0 : Ze.value.lineHeight
|
|
2069
|
-
}, b(e), 9,
|
|
2070
|
-
$e.value.length > 0 ? (_(), a("g",
|
|
2069
|
+
}, b(e), 9, an))), 128))], 8, rn)) : i("", !0),
|
|
2070
|
+
$e.value.length > 0 ? (_(), a("g", on, [(_(!0), a(e, null, y($e.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
|
|
2071
2071
|
key: 0,
|
|
2072
2072
|
x1: t.x,
|
|
2073
2073
|
y1: t.y,
|
|
@@ -2076,7 +2076,7 @@ var en = {
|
|
|
2076
2076
|
stroke: t.color,
|
|
2077
2077
|
"stroke-width": "2",
|
|
2078
2078
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
2079
|
-
}, null, 8,
|
|
2079
|
+
}, null, 8, sn)) : t.type === "area" ? (_(), a("rect", {
|
|
2080
2080
|
key: 1,
|
|
2081
2081
|
x: t.x,
|
|
2082
2082
|
y: t.y - 4,
|
|
@@ -2086,7 +2086,7 @@ var en = {
|
|
|
2086
2086
|
"fill-opacity": t.fillOpacity,
|
|
2087
2087
|
stroke: t.color,
|
|
2088
2088
|
"stroke-width": "1.5"
|
|
2089
|
-
}, null, 8,
|
|
2089
|
+
}, null, 8, cn)) : (_(), a("circle", {
|
|
2090
2090
|
key: 2,
|
|
2091
2091
|
cx: t.x + 4,
|
|
2092
2092
|
cy: t.y,
|
|
@@ -2095,51 +2095,51 @@ var en = {
|
|
|
2095
2095
|
"fill-opacity": t.fillOpacity,
|
|
2096
2096
|
stroke: t.color,
|
|
2097
2097
|
"stroke-width": "1.5"
|
|
2098
|
-
}, null, 8,
|
|
2098
|
+
}, null, 8, ln)), o("text", {
|
|
2099
2099
|
x: t.x + 18,
|
|
2100
2100
|
y: t.y + 4,
|
|
2101
2101
|
"font-size": Xe.value.fontSize,
|
|
2102
2102
|
fill: Xe.value.fill,
|
|
2103
2103
|
"font-weight": Xe.value.fontWeight
|
|
2104
|
-
}, b(t.label), 9,
|
|
2104
|
+
}, b(t.label), 9, un)], 64))), 128))])) : i("", !0),
|
|
2105
2105
|
o("line", {
|
|
2106
|
-
x1: x(P)(x(
|
|
2107
|
-
y1: x(P)(x(
|
|
2108
|
-
x2: x(P)(x(
|
|
2109
|
-
y2: x(P)(x(
|
|
2106
|
+
x1: x(P)(x(V).left),
|
|
2107
|
+
y1: x(P)(x(V).top),
|
|
2108
|
+
x2: x(P)(x(V).left),
|
|
2109
|
+
y2: x(P)(x(V).top + x(G)),
|
|
2110
2110
|
stroke: "currentColor",
|
|
2111
2111
|
"stroke-opacity": "0.3"
|
|
2112
|
-
}, null, 8,
|
|
2112
|
+
}, null, 8, dn),
|
|
2113
2113
|
o("line", {
|
|
2114
|
-
x1: x(P)(x(
|
|
2115
|
-
y1: x(P)(x(
|
|
2116
|
-
x2: x(P)(x(
|
|
2117
|
-
y2: x(P)(x(
|
|
2114
|
+
x1: x(P)(x(V).left),
|
|
2115
|
+
y1: x(P)(x(V).top + x(G)),
|
|
2116
|
+
x2: x(P)(x(V).left + x(W)),
|
|
2117
|
+
y2: x(P)(x(V).top + x(G)),
|
|
2118
2118
|
stroke: "currentColor",
|
|
2119
2119
|
"stroke-opacity": "0.3"
|
|
2120
|
-
}, null, 8,
|
|
2120
|
+
}, null, 8, fn),
|
|
2121
2121
|
c.yGrid ? (_(!0), a(e, { key: 2 }, y(be.value, (e, t) => (_(), a("line", {
|
|
2122
2122
|
key: "yg" + t,
|
|
2123
|
-
x1: x(
|
|
2123
|
+
x1: x(V).left,
|
|
2124
2124
|
y1: e.y,
|
|
2125
|
-
x2: x(
|
|
2125
|
+
x2: x(V).left + x(W),
|
|
2126
2126
|
y2: e.y,
|
|
2127
2127
|
stroke: "currentColor",
|
|
2128
2128
|
"stroke-opacity": "0.1"
|
|
2129
|
-
}, null, 8,
|
|
2129
|
+
}, null, 8, pn))), 128)) : i("", !0),
|
|
2130
2130
|
c.xGrid ? (_(!0), a(e, { key: 3 }, y(Se.value, (e, t) => (_(), a("line", {
|
|
2131
2131
|
key: "xg" + t,
|
|
2132
2132
|
x1: e.x,
|
|
2133
|
-
y1: x(
|
|
2133
|
+
y1: x(V).top,
|
|
2134
2134
|
x2: e.x,
|
|
2135
|
-
y2: x(
|
|
2135
|
+
y2: x(V).top + x(G),
|
|
2136
2136
|
stroke: "currentColor",
|
|
2137
2137
|
"stroke-opacity": "0.1"
|
|
2138
|
-
}, null, 8,
|
|
2138
|
+
}, null, 8, mn))), 128)) : i("", !0),
|
|
2139
2139
|
(_(!0), a(e, null, y(be.value, (e, t) => (_(), a("text", {
|
|
2140
2140
|
key: "y" + t,
|
|
2141
2141
|
"data-testid": "y-tick",
|
|
2142
|
-
x: x(
|
|
2142
|
+
x: x(V).left - 6,
|
|
2143
2143
|
y: e.y,
|
|
2144
2144
|
"text-anchor": "end",
|
|
2145
2145
|
"dominant-baseline": "middle",
|
|
@@ -2147,37 +2147,37 @@ var en = {
|
|
|
2147
2147
|
fill: Y.value.fill,
|
|
2148
2148
|
"font-weight": Y.value.fontWeight,
|
|
2149
2149
|
"fill-opacity": Y.value.fillOpacity
|
|
2150
|
-
}, b(e.value), 9,
|
|
2150
|
+
}, b(e.value), 9, hn))), 128)),
|
|
2151
2151
|
c.yLabel ? (_(), a("text", {
|
|
2152
2152
|
key: 4,
|
|
2153
2153
|
x: 0,
|
|
2154
2154
|
y: 0,
|
|
2155
|
-
transform: `translate(14, ${x(
|
|
2155
|
+
transform: `translate(14, ${x(V).top + x(G) / 2}) rotate(-90)`,
|
|
2156
2156
|
"text-anchor": "middle",
|
|
2157
2157
|
"font-size": Ye.value.fontSize,
|
|
2158
2158
|
fill: Ye.value.fill,
|
|
2159
2159
|
"font-weight": Ye.value.fontWeight
|
|
2160
|
-
}, b(c.yLabel), 9,
|
|
2160
|
+
}, b(c.yLabel), 9, gn)) : i("", !0),
|
|
2161
2161
|
(_(!0), a(e, null, y(Se.value, (e, t) => (_(), a("text", {
|
|
2162
2162
|
key: "x" + t,
|
|
2163
2163
|
"data-testid": "x-tick",
|
|
2164
2164
|
x: e.x,
|
|
2165
|
-
y: x(
|
|
2165
|
+
y: x(V).top + x(G) + 16,
|
|
2166
2166
|
"text-anchor": e.anchor,
|
|
2167
2167
|
"font-size": Y.value.fontSize,
|
|
2168
2168
|
fill: Y.value.fill,
|
|
2169
2169
|
"font-weight": Y.value.fontWeight,
|
|
2170
2170
|
"fill-opacity": Y.value.fillOpacity
|
|
2171
|
-
}, b(e.value), 9,
|
|
2171
|
+
}, b(e.value), 9, _n))), 128)),
|
|
2172
2172
|
c.xLabel ? (_(), a("text", {
|
|
2173
2173
|
key: 5,
|
|
2174
|
-
x: x(
|
|
2175
|
-
y: x(
|
|
2174
|
+
x: x(V).left + x(W) / 2,
|
|
2175
|
+
y: x(Ie) - 4,
|
|
2176
2176
|
"text-anchor": "middle",
|
|
2177
2177
|
"font-size": Ye.value.fontSize,
|
|
2178
2178
|
fill: Ye.value.fill,
|
|
2179
2179
|
"font-weight": Ye.value.fontWeight
|
|
2180
|
-
}, b(c.xLabel), 9,
|
|
2180
|
+
}, b(c.xLabel), 9, vn)) : i("", !0),
|
|
2181
2181
|
(_(!0), a(e, null, y(oe.value, (e, t) => (_(), a("path", {
|
|
2182
2182
|
key: "area" + t,
|
|
2183
2183
|
d: pe(e),
|
|
@@ -2185,7 +2185,7 @@ var en = {
|
|
|
2185
2185
|
"fill-opacity": e.opacity ?? .2,
|
|
2186
2186
|
stroke: "none",
|
|
2187
2187
|
style: h(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
2188
|
-
}, null, 12,
|
|
2188
|
+
}, null, 12, yn))), 128)),
|
|
2189
2189
|
(_(!0), a(e, null, y(E.value, (t, n) => (_(), a(e, { key: n }, [
|
|
2190
2190
|
t.line !== !1 && t.outline ? (_(), a("path", {
|
|
2191
2191
|
key: 0,
|
|
@@ -2196,7 +2196,7 @@ var en = {
|
|
|
2196
2196
|
"stroke-linecap": "round",
|
|
2197
2197
|
"stroke-linejoin": "round",
|
|
2198
2198
|
"data-testid": "line-outline"
|
|
2199
|
-
}, null, 8,
|
|
2199
|
+
}, null, 8, Q)) : i("", !0),
|
|
2200
2200
|
t.line === !1 ? i("", !0) : (_(), a("path", {
|
|
2201
2201
|
key: 1,
|
|
2202
2202
|
d: de(t),
|
|
@@ -2235,50 +2235,50 @@ var en = {
|
|
|
2235
2235
|
}, null, 8, Cn)),
|
|
2236
2236
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
2237
2237
|
x1: x(P)(M(t, "start")),
|
|
2238
|
-
y1: x(
|
|
2238
|
+
y1: x(V).top,
|
|
2239
2239
|
x2: x(P)(M(t, "start")),
|
|
2240
|
-
y2: x(
|
|
2240
|
+
y2: x(V).top + x(G),
|
|
2241
2241
|
stroke: t.color ?? "#999",
|
|
2242
2242
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2243
2243
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2244
2244
|
}, null, 8, wn), o("line", {
|
|
2245
2245
|
x1: x(P)(M(t, "end")),
|
|
2246
|
-
y1: x(
|
|
2246
|
+
y1: x(V).top,
|
|
2247
2247
|
x2: x(P)(M(t, "end")),
|
|
2248
|
-
y2: x(
|
|
2248
|
+
y2: x(V).top + x(G),
|
|
2249
2249
|
stroke: t.color ?? "#999",
|
|
2250
2250
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2251
2251
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2252
2252
|
}, null, 8, Tn)], 64)) : i("", !0),
|
|
2253
2253
|
o("line", {
|
|
2254
2254
|
x1: x(P)(M(t, "start")),
|
|
2255
|
-
y1: x(
|
|
2255
|
+
y1: x(V).top + x(G) - 4,
|
|
2256
2256
|
x2: x(P)(M(t, "start")),
|
|
2257
|
-
y2: x(
|
|
2257
|
+
y2: x(V).top + x(G) + 4,
|
|
2258
2258
|
stroke: "currentColor",
|
|
2259
2259
|
"stroke-opacity": "0.4"
|
|
2260
2260
|
}, null, 8, En),
|
|
2261
2261
|
o("line", {
|
|
2262
2262
|
x1: x(P)(M(t, "end")),
|
|
2263
|
-
y1: x(
|
|
2263
|
+
y1: x(V).top + x(G) - 4,
|
|
2264
2264
|
x2: x(P)(M(t, "end")),
|
|
2265
|
-
y2: x(
|
|
2265
|
+
y2: x(V).top + x(G) + 4,
|
|
2266
2266
|
stroke: "currentColor",
|
|
2267
2267
|
"stroke-opacity": "0.4"
|
|
2268
2268
|
}, null, 8, Dn)
|
|
2269
2269
|
], 64))), 128)),
|
|
2270
|
-
|
|
2270
|
+
De.value && x(Re) !== null ? (_(), a("line", {
|
|
2271
2271
|
key: 6,
|
|
2272
|
-
x1: x(P)(
|
|
2273
|
-
y1: x(
|
|
2274
|
-
x2: x(P)(
|
|
2275
|
-
y2: x(
|
|
2272
|
+
x1: x(P)(ke.value),
|
|
2273
|
+
y1: x(V).top,
|
|
2274
|
+
x2: x(P)(ke.value),
|
|
2275
|
+
y2: x(V).top + x(G),
|
|
2276
2276
|
stroke: "currentColor",
|
|
2277
2277
|
"stroke-opacity": "0.3",
|
|
2278
2278
|
"stroke-dasharray": "4 2",
|
|
2279
2279
|
"pointer-events": "none"
|
|
2280
2280
|
}, null, 8, On)) : i("", !0),
|
|
2281
|
-
(_(!0), a(e, null, y(
|
|
2281
|
+
(_(!0), a(e, null, y(je.value, (e, t) => (_(), a("circle", {
|
|
2282
2282
|
key: "hd" + t,
|
|
2283
2283
|
cx: e.x,
|
|
2284
2284
|
cy: e.y,
|
|
@@ -2288,23 +2288,23 @@ var en = {
|
|
|
2288
2288
|
"stroke-width": "2",
|
|
2289
2289
|
"pointer-events": "none"
|
|
2290
2290
|
}, null, 8, kn))), 128)),
|
|
2291
|
-
|
|
2291
|
+
De.value ? (_(), a("rect", d({
|
|
2292
2292
|
key: 7,
|
|
2293
|
-
x: x(
|
|
2294
|
-
y: x(
|
|
2295
|
-
width: x(
|
|
2296
|
-
height: x(
|
|
2293
|
+
x: x(V).left,
|
|
2294
|
+
y: x(V).top,
|
|
2295
|
+
width: x(W),
|
|
2296
|
+
height: x(G),
|
|
2297
2297
|
fill: "transparent",
|
|
2298
2298
|
style: {
|
|
2299
2299
|
cursor: "crosshair",
|
|
2300
2300
|
"touch-action": "pan-y"
|
|
2301
2301
|
}
|
|
2302
|
-
}, ne(x(
|
|
2302
|
+
}, ne(x(Be), !0)), null, 16, An)) : i("", !0),
|
|
2303
2303
|
c.annotations && c.annotations.length > 0 ? (_(), r(x(xt), {
|
|
2304
2304
|
key: 8,
|
|
2305
2305
|
annotations: c.annotations,
|
|
2306
|
-
project:
|
|
2307
|
-
bounds: x(
|
|
2306
|
+
project: Ne,
|
|
2307
|
+
bounds: x(Le)
|
|
2308
2308
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
2309
2309
|
(_(!0), a(e, null, y(he.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
2310
2310
|
o("circle", {
|
|
@@ -2334,33 +2334,33 @@ var en = {
|
|
|
2334
2334
|
"fill-opacity": e.descStyle.fillOpacity
|
|
2335
2335
|
}, b(e.descText), 9, Nn)) : i("", !0)
|
|
2336
2336
|
]))), 128))
|
|
2337
|
-
], 8,
|
|
2338
|
-
|
|
2337
|
+
], 8, nn)),
|
|
2338
|
+
De.value && x(Re) !== null && Me.value ? (_(), a("div", {
|
|
2339
2339
|
key: 1,
|
|
2340
2340
|
ref_key: "tooltipRef",
|
|
2341
|
-
ref:
|
|
2341
|
+
ref: ze,
|
|
2342
2342
|
class: "chart-tooltip-content",
|
|
2343
2343
|
style: h({
|
|
2344
2344
|
position: "absolute",
|
|
2345
2345
|
top: "0",
|
|
2346
2346
|
left: "0",
|
|
2347
2347
|
willChange: "transform",
|
|
2348
|
-
transform: x(
|
|
2349
|
-
visibility: x(
|
|
2348
|
+
transform: x(K) ? `translate3d(${x(K).left}px, ${x(K).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2349
|
+
visibility: x(K) ? "visible" : "hidden"
|
|
2350
2350
|
})
|
|
2351
|
-
}, [te(n.$slots, "tooltip", m(u(
|
|
2351
|
+
}, [te(n.$slots, "tooltip", m(u(Me.value)), () => [o("div", Pn, [Me.value.xLabel ? (_(), a("div", Fn, b(Me.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(Me.value.values, (e) => (_(), a("div", {
|
|
2352
2352
|
key: e.seriesIndex,
|
|
2353
2353
|
class: "line-chart-tooltip-row"
|
|
2354
2354
|
}, [o("span", {
|
|
2355
2355
|
class: "line-chart-tooltip-swatch",
|
|
2356
2356
|
style: h({ background: e.color })
|
|
2357
2357
|
}, null, 4), s(" " + b(isFinite(e.value) ? x(ie)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2358
|
-
x(
|
|
2358
|
+
x(He) ? (_(), a("a", {
|
|
2359
2359
|
key: 2,
|
|
2360
2360
|
class: "line-chart-download-link",
|
|
2361
2361
|
href: x(Ue),
|
|
2362
2362
|
download: `${x(Ke)()}.csv`
|
|
2363
|
-
}, b(x(
|
|
2363
|
+
}, b(x(He)), 9, In)) : i("", !0),
|
|
2364
2364
|
x(We) ? (_(), a("button", {
|
|
2365
2365
|
key: 3,
|
|
2366
2366
|
type: "button",
|
|
@@ -2463,13 +2463,13 @@ var en = {
|
|
|
2463
2463
|
"fill",
|
|
2464
2464
|
"font-weight",
|
|
2465
2465
|
"fill-opacity"
|
|
2466
|
-
],
|
|
2466
|
+
], or = [
|
|
2467
2467
|
"x",
|
|
2468
2468
|
"y",
|
|
2469
2469
|
"font-size",
|
|
2470
2470
|
"fill",
|
|
2471
2471
|
"font-weight"
|
|
2472
|
-
],
|
|
2472
|
+
], sr = [
|
|
2473
2473
|
"data-category",
|
|
2474
2474
|
"data-series",
|
|
2475
2475
|
"x",
|
|
@@ -2478,34 +2478,34 @@ var en = {
|
|
|
2478
2478
|
"height",
|
|
2479
2479
|
"fill",
|
|
2480
2480
|
"fill-opacity"
|
|
2481
|
-
],
|
|
2481
|
+
], cr = [
|
|
2482
2482
|
"x",
|
|
2483
2483
|
"y",
|
|
2484
2484
|
"text-anchor",
|
|
2485
2485
|
"font-size",
|
|
2486
2486
|
"font-weight",
|
|
2487
2487
|
"fill"
|
|
2488
|
-
],
|
|
2488
|
+
], lr = [
|
|
2489
2489
|
"d",
|
|
2490
2490
|
"stroke",
|
|
2491
2491
|
"stroke-width",
|
|
2492
2492
|
"stroke-opacity",
|
|
2493
2493
|
"stroke-dasharray"
|
|
2494
|
-
],
|
|
2494
|
+
], ur = [
|
|
2495
2495
|
"cx",
|
|
2496
2496
|
"cy",
|
|
2497
2497
|
"r",
|
|
2498
2498
|
"fill",
|
|
2499
2499
|
"fill-opacity"
|
|
2500
|
-
],
|
|
2500
|
+
], dr = [
|
|
2501
2501
|
"x",
|
|
2502
2502
|
"y",
|
|
2503
2503
|
"width",
|
|
2504
2504
|
"height"
|
|
2505
|
-
],
|
|
2505
|
+
], fr = { class: "bar-chart-tooltip" }, pr = {
|
|
2506
2506
|
key: 0,
|
|
2507
2507
|
class: "bar-chart-tooltip-label"
|
|
2508
|
-
},
|
|
2508
|
+
}, $ = ["href", "download"], mr = 22, hr = 2, gr = 11, _r = .6, vr = 4, yr = 4, br = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
2509
2509
|
inheritAttrs: !1,
|
|
2510
2510
|
__name: "BarChart",
|
|
2511
2511
|
props: {
|
|
@@ -2595,9 +2595,9 @@ var en = {
|
|
|
2595
2595
|
return t;
|
|
2596
2596
|
}), w = n(() => {
|
|
2597
2597
|
let e = f.categories;
|
|
2598
|
-
if (!e || e.length === 0 || !
|
|
2598
|
+
if (!e || e.length === 0 || !Wt(e, "utc")) return null;
|
|
2599
2599
|
let t = Array(e.length);
|
|
2600
|
-
for (let n = 0; n < e.length; n++) t[n] =
|
|
2600
|
+
for (let n = 0; n < e.length; n++) t[n] = Ht(e[n], "utc") ?? NaN;
|
|
2601
2601
|
return t;
|
|
2602
2602
|
}), T = n(() => f.orientation === "vertical"), E = n(() => {
|
|
2603
2603
|
let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
|
|
@@ -2627,7 +2627,7 @@ var en = {
|
|
|
2627
2627
|
max: a.max,
|
|
2628
2628
|
range: a.max - a.min || 1
|
|
2629
2629
|
};
|
|
2630
|
-
}), oe = n(() => T.value ?
|
|
2630
|
+
}), oe = n(() => T.value ? V.value : H.value), D = n(() => T.value ? H.value : V.value), O = n(() => {
|
|
2631
2631
|
let e = ie.value;
|
|
2632
2632
|
return e > 0 ? oe.value / e : 0;
|
|
2633
2633
|
}), k = n(() => O.value * (1 - f.barPadding)), se = n(() => {
|
|
@@ -2638,7 +2638,7 @@ var en = {
|
|
|
2638
2638
|
return Math.max(1, (k.value - t) / e);
|
|
2639
2639
|
});
|
|
2640
2640
|
function ce(e) {
|
|
2641
|
-
return (T.value ?
|
|
2641
|
+
return (T.value ? B.value.left : B.value.top) + e * O.value;
|
|
2642
2642
|
}
|
|
2643
2643
|
let le = n(() => {
|
|
2644
2644
|
let { min: e, max: t } = E.value, n = f.valueMin ?? 0;
|
|
@@ -2646,7 +2646,7 @@ var en = {
|
|
|
2646
2646
|
});
|
|
2647
2647
|
function A(e) {
|
|
2648
2648
|
let { min: t, max: n } = E.value, r = we(e, t, n, f.valueScaleType);
|
|
2649
|
-
return T.value ?
|
|
2649
|
+
return T.value ? B.value.top + H.value - r * H.value : B.value.left + r * V.value;
|
|
2650
2650
|
}
|
|
2651
2651
|
function ue(e, t, n, r, i, a, o, s, c, l) {
|
|
2652
2652
|
let u = Math.min(e, t), d = Math.abs(e - t);
|
|
@@ -2713,12 +2713,12 @@ var en = {
|
|
|
2713
2713
|
};
|
|
2714
2714
|
}
|
|
2715
2715
|
function fe(e, t, n) {
|
|
2716
|
-
let r = (T.value ?
|
|
2716
|
+
let r = (T.value ? B.value.left : B.value.top) + (e + .5) * O.value, i = n.max - n.min || 1, a = (t - n.min) / i;
|
|
2717
2717
|
return T.value ? {
|
|
2718
2718
|
x: r,
|
|
2719
|
-
y:
|
|
2719
|
+
y: B.value.top + H.value - a * H.value
|
|
2720
2720
|
} : {
|
|
2721
|
-
x:
|
|
2721
|
+
x: B.value.left + a * V.value,
|
|
2722
2722
|
y: r
|
|
2723
2723
|
};
|
|
2724
2724
|
}
|
|
@@ -2800,7 +2800,7 @@ var en = {
|
|
|
2800
2800
|
let e = Infinity, n = -Infinity;
|
|
2801
2801
|
for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
|
|
2802
2802
|
if (!Number.isFinite(e) || e === n) return [];
|
|
2803
|
-
let r = T.value ?
|
|
2803
|
+
let r = T.value ? V.value : H.value, i = Math.max(2, Math.floor(r / 80)), a = Jt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
|
|
2804
2804
|
for (let e of a.values) {
|
|
2805
2805
|
let n = -1, r = Infinity;
|
|
2806
2806
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -2809,7 +2809,7 @@ var en = {
|
|
|
2809
2809
|
}
|
|
2810
2810
|
if (n < 0 || c.has(n)) continue;
|
|
2811
2811
|
c.add(n);
|
|
2812
|
-
let i = ce(n) + O.value / 2, a = f.categoryFormat ? f.categoryFormat(C.value[n], n) :
|
|
2812
|
+
let i = ce(n) + O.value / 2, a = f.categoryFormat ? f.categoryFormat(C.value[n], n) : en(t[n], f.dateFormat, "utc", o);
|
|
2813
2813
|
s.push({
|
|
2814
2814
|
label: a,
|
|
2815
2815
|
pos: i,
|
|
@@ -2856,10 +2856,10 @@ var en = {
|
|
|
2856
2856
|
}));
|
|
2857
2857
|
return $e(C.value, e);
|
|
2858
2858
|
}
|
|
2859
|
-
let
|
|
2860
|
-
function
|
|
2859
|
+
let De = n(() => !!f.tooltipData || !!f.tooltipTrigger);
|
|
2860
|
+
function R(e, t) {
|
|
2861
2861
|
if (!isFinite(e) || !isFinite(t) || O.value === 0) return null;
|
|
2862
|
-
let n = (T.value ?
|
|
2862
|
+
let n = (T.value ? B.value.left : B.value.top) + (e + .5) * O.value, r = A(t);
|
|
2863
2863
|
return T.value ? {
|
|
2864
2864
|
x: n,
|
|
2865
2865
|
y: r
|
|
@@ -2868,16 +2868,16 @@ var en = {
|
|
|
2868
2868
|
y: n
|
|
2869
2869
|
};
|
|
2870
2870
|
}
|
|
2871
|
-
function
|
|
2872
|
-
let n =
|
|
2871
|
+
function ke(e, t) {
|
|
2872
|
+
let n = Me.value?.getBoundingClientRect();
|
|
2873
2873
|
if (!n) return null;
|
|
2874
2874
|
let r = ie.value;
|
|
2875
2875
|
if (r === 0 || O.value === 0) return null;
|
|
2876
|
-
let i = T.value ? e - n.left -
|
|
2876
|
+
let i = T.value ? e - n.left - B.value.left : t - n.top - B.value.top;
|
|
2877
2877
|
return Math.max(0, Math.min(r - 1, Math.floor(i / O.value)));
|
|
2878
2878
|
}
|
|
2879
|
-
let
|
|
2880
|
-
let e =
|
|
2879
|
+
let Ae = n(() => !!(f.categoryHeader || f.valueHeader)), je = n(() => {
|
|
2880
|
+
let e = Ae.value ? mr : 0, t = f.chartPadding;
|
|
2881
2881
|
return e ? t == null ? { top: e } : typeof t == "number" ? {
|
|
2882
2882
|
top: t + e,
|
|
2883
2883
|
right: t,
|
|
@@ -2887,7 +2887,7 @@ var en = {
|
|
|
2887
2887
|
...t,
|
|
2888
2888
|
top: (t.top ?? 0) + e
|
|
2889
2889
|
} : t;
|
|
2890
|
-
}), { containerRef:
|
|
2890
|
+
}), { containerRef: Me, svgRef: Ne, width: Pe, height: z, padding: B, legendY: Fe, inlineLegendLayout: Ie, innerW: V, innerH: H, bounds: U, hoverIndex: W, tooltipRef: G, tooltipPos: Le, tooltipHandlers: Re, menuItems: ze, downloadLinkText: K, csvHref: Be, downloadButtonText: Ve, triggerCsvDownload: He, menuFilename: Ue, isFullscreen: We, fullscreenStyle: Ge, teleportTarget: Ke, exitFullscreen: qe } = wt({
|
|
2891
2891
|
width: () => f.width,
|
|
2892
2892
|
height: () => f.height,
|
|
2893
2893
|
title: () => f.title,
|
|
@@ -2902,18 +2902,18 @@ var en = {
|
|
|
2902
2902
|
downloadLink: () => f.downloadLink,
|
|
2903
2903
|
downloadButton: () => f.downloadButton,
|
|
2904
2904
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
2905
|
-
chartPadding: () =>
|
|
2905
|
+
chartPadding: () => je.value,
|
|
2906
2906
|
inlineLegendLabels: () => Se.value,
|
|
2907
|
-
hasTooltipSlot: () =>
|
|
2907
|
+
hasTooltipSlot: () => De.value,
|
|
2908
2908
|
getCsv: Ee,
|
|
2909
|
-
pointerToIndex:
|
|
2909
|
+
pointerToIndex: ke,
|
|
2910
2910
|
scrubAxis: () => T.value ? "x" : "y",
|
|
2911
2911
|
onHover: (e) => ee("hover", e)
|
|
2912
|
-
}), q = n(() =>
|
|
2912
|
+
}), q = n(() => Oe(f.axisLabelStyle, { fontSize: 13 })), J = n(() => Oe(f.tickLabelStyle, {
|
|
2913
2913
|
fontSize: 10,
|
|
2914
|
-
fillOpacity:
|
|
2915
|
-
})), Je = n(() =>
|
|
2916
|
-
let e = f.titleStyle, t = e?.align ?? "left", n =
|
|
2914
|
+
fillOpacity: L
|
|
2915
|
+
})), Je = n(() => Oe(f.legendStyle, { fontSize: 11 })), Ye = n(() => f.categoryAlign === "start" && !T.value ? hr : B.value.left), Y = n(() => {
|
|
2916
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = U.value, r = t === "left" ? Ye.value : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
2917
2917
|
return {
|
|
2918
2918
|
lines: (f.title ?? "").split("\n"),
|
|
2919
2919
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -2924,12 +2924,12 @@ var en = {
|
|
|
2924
2924
|
anchor: i
|
|
2925
2925
|
};
|
|
2926
2926
|
}), Xe = n(() => {
|
|
2927
|
-
let e =
|
|
2927
|
+
let e = W.value;
|
|
2928
2928
|
if (e === null) return;
|
|
2929
2929
|
let t = w.value;
|
|
2930
|
-
return t && Number.isFinite(t[e]) ?
|
|
2930
|
+
return t && Number.isFinite(t[e]) ? en(t[e], f.dateFormat, "utc") : C.value[e];
|
|
2931
2931
|
}), Ze = n(() => {
|
|
2932
|
-
let e =
|
|
2932
|
+
let e = W.value;
|
|
2933
2933
|
if (e === null) return null;
|
|
2934
2934
|
let t = S.value, n = [];
|
|
2935
2935
|
for (let r = 0; r < t.length; r++) {
|
|
@@ -2947,22 +2947,22 @@ var en = {
|
|
|
2947
2947
|
data: f.tooltipData?.[e] ?? null
|
|
2948
2948
|
};
|
|
2949
2949
|
}), Qe = n(() => {
|
|
2950
|
-
let e =
|
|
2950
|
+
let e = W.value;
|
|
2951
2951
|
if (e === null) return null;
|
|
2952
2952
|
let t = ce(e);
|
|
2953
2953
|
return T.value ? {
|
|
2954
2954
|
x: t,
|
|
2955
|
-
y:
|
|
2955
|
+
y: B.value.top,
|
|
2956
2956
|
w: O.value,
|
|
2957
|
-
h:
|
|
2957
|
+
h: H.value
|
|
2958
2958
|
} : {
|
|
2959
|
-
x:
|
|
2959
|
+
x: B.value.left,
|
|
2960
2960
|
y: t,
|
|
2961
|
-
w:
|
|
2961
|
+
w: V.value,
|
|
2962
2962
|
h: O.value
|
|
2963
2963
|
};
|
|
2964
2964
|
}), et = n(() => {
|
|
2965
|
-
let e =
|
|
2965
|
+
let e = Ie.value.positions, t = Ye.value, n = Fe.value;
|
|
2966
2966
|
return xe.value.map((r, i) => {
|
|
2967
2967
|
let a = e[i];
|
|
2968
2968
|
return {
|
|
@@ -3029,7 +3029,7 @@ var en = {
|
|
|
3029
3029
|
hidden: !1
|
|
3030
3030
|
});
|
|
3031
3031
|
}
|
|
3032
|
-
let i = t ? -
|
|
3032
|
+
let i = t ? -B.value.top : Pe.value - 2, a = /* @__PURE__ */ new Map();
|
|
3033
3033
|
for (let e of r) {
|
|
3034
3034
|
let t = a.get(e.bar.categoryIndex);
|
|
3035
3035
|
t ? t.push(e) : a.set(e.bar.categoryIndex, [e]);
|
|
@@ -3078,7 +3078,7 @@ var en = {
|
|
|
3078
3078
|
}
|
|
3079
3079
|
return s;
|
|
3080
3080
|
}), at = n(() => {
|
|
3081
|
-
let e =
|
|
3081
|
+
let e = B.value.left - 6;
|
|
3082
3082
|
switch (f.categoryAlign ?? "end") {
|
|
3083
3083
|
case "start": return {
|
|
3084
3084
|
anchor: "start",
|
|
@@ -3094,11 +3094,11 @@ var en = {
|
|
|
3094
3094
|
};
|
|
3095
3095
|
}
|
|
3096
3096
|
}), ot = n(() => {
|
|
3097
|
-
let e = [], t =
|
|
3097
|
+
let e = [], t = B.value.top - 7;
|
|
3098
3098
|
if (f.valueHeader && e.push({
|
|
3099
3099
|
key: "vh",
|
|
3100
3100
|
text: f.valueHeader,
|
|
3101
|
-
x:
|
|
3101
|
+
x: B.value.left,
|
|
3102
3102
|
y: t,
|
|
3103
3103
|
anchor: "start"
|
|
3104
3104
|
}), f.categoryHeader) {
|
|
@@ -3106,7 +3106,7 @@ var en = {
|
|
|
3106
3106
|
e.push({
|
|
3107
3107
|
key: "ch",
|
|
3108
3108
|
text: f.categoryHeader,
|
|
3109
|
-
x: n ? r.x :
|
|
3109
|
+
x: n ? r.x : B.value.left,
|
|
3110
3110
|
y: t,
|
|
3111
3111
|
anchor: n ? r.anchor : "start"
|
|
3112
3112
|
});
|
|
@@ -3118,14 +3118,14 @@ var en = {
|
|
|
3118
3118
|
disabled: !x(We)
|
|
3119
3119
|
}, [o("div", d({
|
|
3120
3120
|
ref_key: "containerRef",
|
|
3121
|
-
ref:
|
|
3121
|
+
ref: Me
|
|
3122
3122
|
}, n.$attrs, {
|
|
3123
3123
|
class: ["bar-chart-wrapper", { "is-fullscreen": x(We) }],
|
|
3124
3124
|
style: x(Ge)
|
|
3125
3125
|
}), [
|
|
3126
3126
|
c.menu ? (_(), r(ye, {
|
|
3127
3127
|
key: 0,
|
|
3128
|
-
items: x(
|
|
3128
|
+
items: x(ze),
|
|
3129
3129
|
"is-fullscreen": x(We),
|
|
3130
3130
|
onClose: x(qe)
|
|
3131
3131
|
}, null, 8, [
|
|
@@ -3136,9 +3136,9 @@ var en = {
|
|
|
3136
3136
|
o("div", Hn, b(x(We) ? "Chart expanded to fill window" : ""), 1),
|
|
3137
3137
|
(_(), a("svg", {
|
|
3138
3138
|
ref_key: "svgRef",
|
|
3139
|
-
ref:
|
|
3140
|
-
width: x(
|
|
3141
|
-
height: x(
|
|
3139
|
+
ref: Ne,
|
|
3140
|
+
width: x(Pe),
|
|
3141
|
+
height: x(z),
|
|
3142
3142
|
role: g.value || void 0,
|
|
3143
3143
|
"aria-label": p.value || void 0
|
|
3144
3144
|
}, [
|
|
@@ -3190,32 +3190,32 @@ var en = {
|
|
|
3190
3190
|
}, b(t.label), 9, Xn)], 64))), 128))])) : i("", !0),
|
|
3191
3191
|
!T.value || c.valueAxis ? (_(), a("line", {
|
|
3192
3192
|
key: 2,
|
|
3193
|
-
x1: x(P)(x(
|
|
3194
|
-
y1: x(P)(x(
|
|
3195
|
-
x2: x(P)(x(
|
|
3196
|
-
y2: x(P)(x(
|
|
3193
|
+
x1: x(P)(x(B).left),
|
|
3194
|
+
y1: x(P)(x(B).top),
|
|
3195
|
+
x2: x(P)(x(B).left),
|
|
3196
|
+
y2: x(P)(x(B).top + x(H)),
|
|
3197
3197
|
stroke: "currentColor",
|
|
3198
3198
|
"stroke-opacity": "0.3"
|
|
3199
3199
|
}, null, 8, Zn)) : i("", !0),
|
|
3200
3200
|
T.value || c.valueAxis ? (_(), a("line", {
|
|
3201
3201
|
key: 3,
|
|
3202
|
-
x1: x(P)(x(
|
|
3203
|
-
y1: x(P)(x(
|
|
3204
|
-
x2: x(P)(x(
|
|
3205
|
-
y2: x(P)(x(
|
|
3202
|
+
x1: x(P)(x(B).left),
|
|
3203
|
+
y1: x(P)(x(B).top + x(H)),
|
|
3204
|
+
x2: x(P)(x(B).left + x(V)),
|
|
3205
|
+
y2: x(P)(x(B).top + x(H)),
|
|
3206
3206
|
stroke: "currentColor",
|
|
3207
3207
|
"stroke-opacity": "0.3"
|
|
3208
3208
|
}, null, 8, Qn)) : i("", !0),
|
|
3209
3209
|
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(N.value, (e, t) => (_(), a("line", {
|
|
3210
3210
|
key: "vg" + t,
|
|
3211
|
-
x1: T.value ? x(
|
|
3212
|
-
y1: T.value ? e.pos : x(
|
|
3213
|
-
x2: T.value ? x(
|
|
3214
|
-
y2: T.value ? e.pos : x(
|
|
3211
|
+
x1: T.value ? x(B).left : e.pos,
|
|
3212
|
+
y1: T.value ? e.pos : x(B).top,
|
|
3213
|
+
x2: T.value ? x(B).left + x(V) : e.pos,
|
|
3214
|
+
y2: T.value ? e.pos : x(B).top + x(H),
|
|
3215
3215
|
stroke: "currentColor",
|
|
3216
3216
|
"stroke-opacity": "0.1"
|
|
3217
3217
|
}, null, 8, $n))), 128)) : i("", !0),
|
|
3218
|
-
Qe.value &&
|
|
3218
|
+
Qe.value && De.value ? (_(), a("rect", {
|
|
3219
3219
|
key: 5,
|
|
3220
3220
|
x: Qe.value.x,
|
|
3221
3221
|
y: Qe.value.y,
|
|
@@ -3228,7 +3228,7 @@ var en = {
|
|
|
3228
3228
|
c.valueAxis && T.value ? (_(!0), a(e, { key: 6 }, y(N.value, (e, t) => (_(), a("text", {
|
|
3229
3229
|
key: "vt" + t,
|
|
3230
3230
|
"data-testid": "value-tick",
|
|
3231
|
-
x: x(
|
|
3231
|
+
x: x(B).left - 6,
|
|
3232
3232
|
y: e.pos,
|
|
3233
3233
|
"text-anchor": "end",
|
|
3234
3234
|
"dominant-baseline": "middle",
|
|
@@ -3240,7 +3240,7 @@ var en = {
|
|
|
3240
3240
|
key: "vt" + t,
|
|
3241
3241
|
"data-testid": "value-tick",
|
|
3242
3242
|
x: e.pos,
|
|
3243
|
-
y: x(
|
|
3243
|
+
y: x(B).top + x(H) + 16,
|
|
3244
3244
|
"text-anchor": "middle",
|
|
3245
3245
|
"font-size": J.value.fontSize,
|
|
3246
3246
|
fill: J.value.fill,
|
|
@@ -3251,7 +3251,7 @@ var en = {
|
|
|
3251
3251
|
key: 8,
|
|
3252
3252
|
x: 0,
|
|
3253
3253
|
y: 0,
|
|
3254
|
-
transform: `translate(14, ${x(
|
|
3254
|
+
transform: `translate(14, ${x(B).top + x(H) / 2}) rotate(-90)`,
|
|
3255
3255
|
"text-anchor": "middle",
|
|
3256
3256
|
"font-size": q.value.fontSize,
|
|
3257
3257
|
fill: q.value.fill,
|
|
@@ -3261,7 +3261,7 @@ var en = {
|
|
|
3261
3261
|
key: "ct" + t,
|
|
3262
3262
|
"data-testid": "category-tick",
|
|
3263
3263
|
x: e.pos,
|
|
3264
|
-
y: x(
|
|
3264
|
+
y: x(B).top + x(H) + 16,
|
|
3265
3265
|
"text-anchor": e.anchor,
|
|
3266
3266
|
"font-size": J.value.fontSize,
|
|
3267
3267
|
fill: J.value.fill,
|
|
@@ -3281,13 +3281,13 @@ var en = {
|
|
|
3281
3281
|
}, b(e.label), 9, ar))), 128)),
|
|
3282
3282
|
c.xLabel ? (_(), a("text", {
|
|
3283
3283
|
key: 11,
|
|
3284
|
-
x: x(
|
|
3285
|
-
y: x(
|
|
3284
|
+
x: x(B).left + x(V) / 2,
|
|
3285
|
+
y: x(z) - 4,
|
|
3286
3286
|
"text-anchor": "middle",
|
|
3287
3287
|
"font-size": q.value.fontSize,
|
|
3288
3288
|
fill: q.value.fill,
|
|
3289
3289
|
"font-weight": q.value.fontWeight
|
|
3290
|
-
}, b(c.xLabel), 9,
|
|
3290
|
+
}, b(c.xLabel), 9, or)) : i("", !0),
|
|
3291
3291
|
(_(!0), a(e, null, y(j.value, (e, t) => (_(), a("rect", {
|
|
3292
3292
|
key: "bar" + t,
|
|
3293
3293
|
"data-testid": "bar",
|
|
@@ -3300,7 +3300,7 @@ var en = {
|
|
|
3300
3300
|
fill: e.color,
|
|
3301
3301
|
"fill-opacity": e.opacity,
|
|
3302
3302
|
style: h(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
3303
|
-
}, null, 12,
|
|
3303
|
+
}, null, 12, sr))), 128)),
|
|
3304
3304
|
(_(!0), a(e, null, y(it.value, (e) => (_(), a("text", {
|
|
3305
3305
|
key: "blbl" + e.key,
|
|
3306
3306
|
"data-testid": "bar-label",
|
|
@@ -3312,7 +3312,7 @@ var en = {
|
|
|
3312
3312
|
"font-weight": e.fontWeight,
|
|
3313
3313
|
fill: e.fill,
|
|
3314
3314
|
"pointer-events": "none"
|
|
3315
|
-
}, b(e.text), 9,
|
|
3315
|
+
}, b(e.text), 9, cr))), 128)),
|
|
3316
3316
|
(_(!0), a(e, null, y(M.value, (t, n) => (_(), a(e, { key: "sl" + n }, [t.pathD ? (_(), a("path", {
|
|
3317
3317
|
key: 0,
|
|
3318
3318
|
"data-testid": "summary-line",
|
|
@@ -3325,7 +3325,7 @@ var en = {
|
|
|
3325
3325
|
"stroke-linecap": "round",
|
|
3326
3326
|
"stroke-linejoin": "round",
|
|
3327
3327
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3328
|
-
}, null, 12,
|
|
3328
|
+
}, null, 12, lr)) : i("", !0), t.dots ? (_(!0), a(e, { key: 1 }, y(t.points, (e, r) => (_(), a("circle", {
|
|
3329
3329
|
key: "sld" + n + "-" + r,
|
|
3330
3330
|
cx: e.x,
|
|
3331
3331
|
cy: e.y,
|
|
@@ -3333,55 +3333,55 @@ var en = {
|
|
|
3333
3333
|
fill: t.color,
|
|
3334
3334
|
"fill-opacity": t.opacity,
|
|
3335
3335
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3336
|
-
}, null, 12,
|
|
3337
|
-
|
|
3336
|
+
}, null, 12, ur))), 128)) : i("", !0)], 64))), 128)),
|
|
3337
|
+
De.value ? (_(), a("rect", d({
|
|
3338
3338
|
key: 12,
|
|
3339
|
-
x: x(
|
|
3340
|
-
y: x(
|
|
3341
|
-
width: x(
|
|
3342
|
-
height: x(
|
|
3339
|
+
x: x(B).left,
|
|
3340
|
+
y: x(B).top,
|
|
3341
|
+
width: x(V),
|
|
3342
|
+
height: x(H),
|
|
3343
3343
|
fill: "transparent",
|
|
3344
3344
|
style: `cursor: crosshair; touch-action: ${T.value ? "pan-y" : "pan-x"}`
|
|
3345
|
-
}, ne(x(
|
|
3345
|
+
}, ne(x(Re), !0)), null, 16, dr)) : i("", !0),
|
|
3346
3346
|
c.annotations && c.annotations.length > 0 ? (_(), r(x(xt), {
|
|
3347
3347
|
key: 13,
|
|
3348
3348
|
annotations: c.annotations,
|
|
3349
|
-
project:
|
|
3350
|
-
bounds: x(
|
|
3349
|
+
project: R,
|
|
3350
|
+
bounds: x(U)
|
|
3351
3351
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
3352
3352
|
], 8, Un)),
|
|
3353
|
-
|
|
3353
|
+
De.value && x(W) !== null && Ze.value ? (_(), a("div", {
|
|
3354
3354
|
key: 1,
|
|
3355
3355
|
ref_key: "tooltipRef",
|
|
3356
|
-
ref:
|
|
3356
|
+
ref: G,
|
|
3357
3357
|
class: "chart-tooltip-content",
|
|
3358
3358
|
style: h({
|
|
3359
3359
|
position: "absolute",
|
|
3360
3360
|
top: "0",
|
|
3361
3361
|
left: "0",
|
|
3362
3362
|
willChange: "transform",
|
|
3363
|
-
transform: x(
|
|
3364
|
-
visibility: x(
|
|
3363
|
+
transform: x(Le) ? `translate3d(${x(Le).left}px, ${x(Le).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
3364
|
+
visibility: x(Le) ? "visible" : "hidden"
|
|
3365
3365
|
})
|
|
3366
|
-
}, [te(n.$slots, "tooltip", m(u(Ze.value)), () => [o("div",
|
|
3366
|
+
}, [te(n.$slots, "tooltip", m(u(Ze.value)), () => [o("div", fr, [Xe.value ? (_(), a("div", pr, b(Xe.value), 1)) : i("", !0), (_(!0), a(e, null, y(Ze.value.values, (e) => (_(), a("div", {
|
|
3367
3367
|
key: e.seriesIndex,
|
|
3368
3368
|
class: "bar-chart-tooltip-row"
|
|
3369
3369
|
}, [o("span", {
|
|
3370
3370
|
class: "bar-chart-tooltip-swatch",
|
|
3371
3371
|
style: h({ background: e.color })
|
|
3372
3372
|
}, null, 4), s(" " + b(isFinite(e.value) ? x(ve)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
3373
|
-
x(
|
|
3373
|
+
x(K) ? (_(), a("a", {
|
|
3374
3374
|
key: 2,
|
|
3375
3375
|
class: "bar-chart-download-link",
|
|
3376
|
-
href: x(
|
|
3376
|
+
href: x(Be),
|
|
3377
3377
|
download: `${x(Ue)()}.csv`
|
|
3378
|
-
}, b(x(
|
|
3379
|
-
x(
|
|
3378
|
+
}, b(x(K)), 9, $)) : i("", !0),
|
|
3379
|
+
x(Ve) ? (_(), a("button", {
|
|
3380
3380
|
key: 3,
|
|
3381
3381
|
type: "button",
|
|
3382
3382
|
class: "bar-chart-download-button",
|
|
3383
|
-
onClick: l[0] ||= (...e) => x(
|
|
3384
|
-
}, b(x(
|
|
3383
|
+
onClick: l[0] ||= (...e) => x(He) && x(He)(...e)
|
|
3384
|
+
}, b(x(Ve)), 1)) : i("", !0)
|
|
3385
3385
|
], 16)], 8, ["to", "disabled"]));
|
|
3386
3386
|
}
|
|
3387
3387
|
}), [["__scopeId", "data-v-32872fa4"]]);
|
|
@@ -3443,7 +3443,7 @@ function kr(e, t, n, r, i) {
|
|
|
3443
3443
|
!i || r.focused.has(i) || (xr(e, n), e.lineJoin = "round", Tr(e, t, Sr(n), r, i), e.setLineDash([]), e.setTransform(1, 0, 0, 1, 0, 0));
|
|
3444
3444
|
}
|
|
3445
3445
|
function Ar(e, t, n, r) {
|
|
3446
|
-
Er(e, n), Dr(e, t, 0, t.items.length), Or(e, t, n, r)
|
|
3446
|
+
Er(e, n), Dr(e, t, 0, t.items.length), Or(e, t, n, r);
|
|
3447
3447
|
}
|
|
3448
3448
|
function jr(e) {
|
|
3449
3449
|
let t = e + 1;
|
|
@@ -3641,7 +3641,7 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
3641
3641
|
}, Xr = { class: "choropleth-legend-ticks" }, Zr = {
|
|
3642
3642
|
key: 2,
|
|
3643
3643
|
class: "choropleth-zoom-hint"
|
|
3644
|
-
}, Qr = ["viewBox"], $r = ["viewBox"], ei = ["innerHTML"], ti = "http://www.w3.org/2000/svg", ni = 10, ri = 600, ii = 250, ai = 30, oi = 450, si = 2, ci = 2, li = 1e3, ui = 12, di = "light-dark(#000, #fff)", fi = 24, pi = 350, mi =
|
|
3644
|
+
}, Qr = ["viewBox"], $r = ["viewBox"], ei = ["innerHTML"], ti = "http://www.w3.org/2000/svg", ni = 10, ri = 600, ii = 250, ai = 30, oi = 450, si = 2, ci = 2, li = 1e3, ui = 12, di = "light-dark(#000, #fff)", fi = 24, pi = 350, mi = 120, hi = 11, gi = 2.4, _i = 3, vi = .9, yi = 2.6, bi = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
3645
3645
|
inheritAttrs: !1,
|
|
3646
3646
|
__name: "ChoroplethMap",
|
|
3647
3647
|
props: {
|
|
@@ -3720,73 +3720,65 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
3720
3720
|
width: "100%"
|
|
3721
3721
|
};
|
|
3722
3722
|
return e?.color && (t.color = e.color), t;
|
|
3723
|
-
}), xe = /* @__PURE__ */ new Map(), Se = /* @__PURE__ */ new Map(), Ce = null, F = null, we = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), I = n(() => p.renderer === "canvas"), Ee = v(null),
|
|
3723
|
+
}), xe = /* @__PURE__ */ new Map(), Se = /* @__PURE__ */ new Map(), Ce = null, F = null, we = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), I = n(() => p.renderer === "canvas"), Ee = v(null), L = null, De = null, Oe = null, R = null, ke = /* @__PURE__ */ new Map(), Ae = [], je = 0, Me = 0, Ne = 0, Pe = 0, z = !1, Fe = null, Ie = {
|
|
3724
3724
|
width: 0,
|
|
3725
3725
|
height: 0
|
|
3726
|
-
},
|
|
3726
|
+
}, V = null, H = !1, U = null, W = v(!1), ze = v(1), Be = v(1), Ve = v(!1), He = n(() => p.zoomMode === "scroll"), Ue = n(() => p.zoom && (He.value || !p.touchExpand && Ve.value)), We = 0, Ge = 0, Ke = 0, qe = null, q = 0, Je = null;
|
|
3727
3727
|
function Ye() {
|
|
3728
3728
|
let e = D.value, t = O.value;
|
|
3729
|
-
if (!(!e || !t) && (e.addEventListener("touchstart",
|
|
3729
|
+
if (!(!e || !t) && (e.addEventListener("touchstart", Yn, { passive: !0 }), e.addEventListener("touchend", Xn), e.addEventListener("touchcancel", Qn, { passive: !0 }), !K())) {
|
|
3730
3730
|
if (I.value) {
|
|
3731
|
-
e.addEventListener("click",
|
|
3731
|
+
e.addEventListener("click", Un), e.addEventListener("mousemove", Kn), e.addEventListener("mouseleave", qn);
|
|
3732
3732
|
return;
|
|
3733
3733
|
}
|
|
3734
|
-
t.addEventListener("click",
|
|
3734
|
+
t.addEventListener("click", Un), t.addEventListener("mouseover", Un), t.addEventListener("mousemove", Wn), t.addEventListener("mouseout", Gn);
|
|
3735
3735
|
}
|
|
3736
3736
|
}
|
|
3737
3737
|
function Y() {
|
|
3738
3738
|
let e = D.value, t = O.value;
|
|
3739
|
-
e && (e.removeEventListener("touchstart",
|
|
3739
|
+
e && (e.removeEventListener("touchstart", Yn), e.removeEventListener("touchend", Xn), e.removeEventListener("touchcancel", Qn), e.removeEventListener("click", Un), e.removeEventListener("mousemove", Kn), e.removeEventListener("mouseleave", qn)), t && (t.removeEventListener("click", Un), t.removeEventListener("mouseover", Un), t.removeEventListener("mousemove", Wn), t.removeEventListener("mouseout", Gn));
|
|
3740
3740
|
}
|
|
3741
3741
|
function Xe() {
|
|
3742
|
-
|
|
3742
|
+
Bn();
|
|
3743
3743
|
}
|
|
3744
3744
|
let Qe = null;
|
|
3745
3745
|
g(() => {
|
|
3746
|
-
Ye(), $e(),
|
|
3746
|
+
Ye(), $e(), rr(), it(), nr(), tn(), D.value && typeof ResizeObserver < "u" && (Qe = new ResizeObserver((e) => {
|
|
3747
3747
|
let t = e[0]?.contentRect;
|
|
3748
3748
|
if (!t?.width) return;
|
|
3749
3749
|
let n = t.height ? Math.min(t.width / bt.value, t.height / xt.value) : t.width / bt.value;
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
if (e) {
|
|
3753
|
-
Kn(e);
|
|
3754
|
-
let n = typeof window < "u" && window.devicePixelRatio || 1;
|
|
3755
|
-
e.width = Math.max(1, Math.round(t.width * n)), e.height = Math.max(1, Math.round(t.height * n));
|
|
3756
|
-
}
|
|
3757
|
-
wn();
|
|
3758
|
-
} else Dn();
|
|
3759
|
-
}), Qe.observe(D.value)), I.value && _n(), window.addEventListener("scroll", Xe, {
|
|
3750
|
+
Be.value = n, Ne = (t.width - n * bt.value) / 2, Pe = t.height ? (t.height - n * xt.value) / 2 : 0, I.value ? Mn(t.width, t.height) : Fn();
|
|
3751
|
+
}), Qe.observe(D.value)), I.value && vn(), window.addEventListener("scroll", Xe, {
|
|
3760
3752
|
passive: !0,
|
|
3761
3753
|
capture: !0
|
|
3762
3754
|
}), window.addEventListener("resize", Xe, { passive: !0 });
|
|
3763
3755
|
}), ee(() => {
|
|
3764
|
-
|
|
3756
|
+
Fe?.disconnect(), Qe?.disconnect(), _n?.removeEventListener("change", yn), Ke && cancelAnimationFrame(Ke), je && cancelAnimationFrame(je), Me && cancelAnimationFrame(Me), window.clearTimeout(q), Cn && window.clearTimeout(Cn), et(), Y(), window.removeEventListener("scroll", Xe, { capture: !0 }), window.removeEventListener("resize", Xe);
|
|
3765
3757
|
});
|
|
3766
3758
|
function $e() {
|
|
3767
3759
|
if (!D.value || !O.value) return;
|
|
3768
3760
|
let e = M(D.value);
|
|
3769
|
-
|
|
3770
|
-
|
|
3761
|
+
U = de().scaleExtent([1, st.value]).clickDistance(6).on("start", () => {
|
|
3762
|
+
z = !0;
|
|
3771
3763
|
}).on("zoom", (e) => {
|
|
3772
|
-
|
|
3764
|
+
Bn(), I.value ? kn() : O.value && O.value.setAttribute("transform", e.transform);
|
|
3773
3765
|
let t = e.transform;
|
|
3774
|
-
|
|
3766
|
+
ze.value = t.k, Fn(), p.cities?.length && nr(), W.value = t.k !== 1 || t.x !== 0 || t.y !== 0, W.value && (Ve.value = !0);
|
|
3775
3767
|
}).on("end", () => {
|
|
3776
|
-
|
|
3777
|
-
}),
|
|
3768
|
+
z = !1, I.value && kn();
|
|
3769
|
+
}), U.filter((e) => {
|
|
3778
3770
|
if (!p.zoom) return !1;
|
|
3779
|
-
if (!
|
|
3771
|
+
if (!He.value) {
|
|
3780
3772
|
let t = $.isFullscreen.value;
|
|
3781
3773
|
switch (e.type) {
|
|
3782
3774
|
case "wheel":
|
|
3783
3775
|
if (!t) return !1;
|
|
3784
3776
|
break;
|
|
3785
3777
|
case "dblclick":
|
|
3786
|
-
if (
|
|
3778
|
+
if (K()) return !1;
|
|
3787
3779
|
break;
|
|
3788
3780
|
case "mousedown":
|
|
3789
|
-
if (!t && !
|
|
3781
|
+
if (!t && !Ve.value) return !1;
|
|
3790
3782
|
break;
|
|
3791
3783
|
case "touchstart":
|
|
3792
3784
|
if (!t && !Ue.value && !(!p.touchExpand && p.zoomMode !== "scroll" && e.touches.length >= 2)) return !1;
|
|
@@ -3794,13 +3786,13 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
3794
3786
|
}
|
|
3795
3787
|
}
|
|
3796
3788
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
3797
|
-
}), e.call(
|
|
3789
|
+
}), e.call(U);
|
|
3798
3790
|
}
|
|
3799
3791
|
function et() {
|
|
3800
|
-
D.value &&
|
|
3792
|
+
D.value && U && (M(D.value).on(".zoom", null), U = null);
|
|
3801
3793
|
}
|
|
3802
3794
|
function tt(e) {
|
|
3803
|
-
let t =
|
|
3795
|
+
let t = Vt.value, n = Lt.value, r = [];
|
|
3804
3796
|
for (let i of e) {
|
|
3805
3797
|
let e = i.geoType ?? p.geoType, a = t.get(e);
|
|
3806
3798
|
if (!a) continue;
|
|
@@ -3825,13 +3817,13 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
3825
3817
|
}
|
|
3826
3818
|
let rt = !1;
|
|
3827
3819
|
function it() {
|
|
3828
|
-
if (!D.value || !
|
|
3829
|
-
let e = tt(
|
|
3820
|
+
if (!D.value || !U) return;
|
|
3821
|
+
let e = tt(Bt.value), t = e.filter((e) => e.geoType === p.geoType), n = e.filter((e) => e.geoType !== p.geoType);
|
|
3830
3822
|
if (I.value) {
|
|
3831
|
-
|
|
3832
|
-
for (let e of t)
|
|
3833
|
-
let e =
|
|
3834
|
-
|
|
3823
|
+
ke.clear();
|
|
3824
|
+
for (let e of t) ke.set(String(e.feature.id), e.item);
|
|
3825
|
+
let e = X.value;
|
|
3826
|
+
Ae = n.flatMap((t) => {
|
|
3835
3827
|
let n = e(t.feature);
|
|
3836
3828
|
return n ? [{
|
|
3837
3829
|
path: new Path2D(n),
|
|
@@ -3839,24 +3831,24 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
3839
3831
|
strokeWidth: t.item.strokeWidth,
|
|
3840
3832
|
style: t.item.style
|
|
3841
3833
|
}] : [];
|
|
3842
|
-
}), wn();
|
|
3834
|
+
}), wn(), kn();
|
|
3843
3835
|
} else {
|
|
3844
3836
|
let e = /* @__PURE__ */ new Map();
|
|
3845
3837
|
for (let n of t) {
|
|
3846
3838
|
let t = xe.get(String(n.feature.id));
|
|
3847
3839
|
t && e.set(t, n.item);
|
|
3848
3840
|
}
|
|
3849
|
-
for (let [t] of we) e.has(t) || t === F ||
|
|
3841
|
+
for (let [t] of we) e.has(t) || t === F || Ln(t);
|
|
3850
3842
|
for (let [t, n] of e) {
|
|
3851
3843
|
let e = we.get(t);
|
|
3852
|
-
e != null && e.style === n.style && e.stroke === n.stroke && e.strokeWidth === n.strokeWidth && t !== F || t !== F &&
|
|
3844
|
+
e != null && e.style === n.style && e.stroke === n.stroke && e.strokeWidth === n.strokeWidth && t !== F || t !== F && In(t, n);
|
|
3853
3845
|
}
|
|
3854
3846
|
we.clear();
|
|
3855
3847
|
for (let [t, n] of e) we.set(t, n);
|
|
3856
3848
|
at(n);
|
|
3857
3849
|
}
|
|
3858
3850
|
if (e.length === 0) {
|
|
3859
|
-
rt = !0,
|
|
3851
|
+
rt = !0, Bn();
|
|
3860
3852
|
return;
|
|
3861
3853
|
}
|
|
3862
3854
|
if (p.focusZoom === !1) {
|
|
@@ -3867,58 +3859,58 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
3867
3859
|
r.interrupt();
|
|
3868
3860
|
let i = rt;
|
|
3869
3861
|
rt = !0;
|
|
3870
|
-
let [[a, o], [s, c]] =
|
|
3862
|
+
let [[a, o], [s, c]] = X.value.bounds({
|
|
3871
3863
|
type: "FeatureCollection",
|
|
3872
3864
|
features: e.map((e) => e.feature)
|
|
3873
3865
|
}), l = (a + s) / 2, u = (o + c) / 2, d = p.focusZoomLevel, f = fe.translate(bt.value / 2 - d * l, xt.value / 2 - d * u).scale(d), m = t[0]?.feature ?? null, h = () => {
|
|
3874
3866
|
if (!N.value || !m) return;
|
|
3875
3867
|
let e = String(m.id);
|
|
3876
3868
|
if (I.value) {
|
|
3877
|
-
let t =
|
|
3878
|
-
t &&
|
|
3869
|
+
let t = Pn(e);
|
|
3870
|
+
t && an(e, t.x, t.y);
|
|
3879
3871
|
return;
|
|
3880
3872
|
}
|
|
3881
3873
|
let t = xe.get(e);
|
|
3882
3874
|
if (!t) return;
|
|
3883
3875
|
let n = t.getBoundingClientRect();
|
|
3884
|
-
|
|
3876
|
+
an(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
3885
3877
|
};
|
|
3886
|
-
i ? (
|
|
3878
|
+
i ? (sn(), r.transition().duration(oi).call(U.transform, f).on("end", h)) : (U.transform(r, f), h());
|
|
3887
3879
|
}
|
|
3888
3880
|
function at(e) {
|
|
3889
3881
|
let t = se.value;
|
|
3890
3882
|
if (!t) return;
|
|
3891
3883
|
let n = new Set(e.map((e) => e.key));
|
|
3892
3884
|
for (let [e, t] of Te) n.has(e) || (t.el.remove(), Te.delete(e));
|
|
3893
|
-
let r =
|
|
3885
|
+
let r = X.value;
|
|
3894
3886
|
for (let { item: n, feature: i, key: a } of e) {
|
|
3895
3887
|
let e = Te.get(a);
|
|
3896
3888
|
if (!e) {
|
|
3897
3889
|
let n = document.createElementNS(ti, "path");
|
|
3898
3890
|
n.setAttribute("d", r(i) ?? ""), n.setAttribute("fill", "none"), n.setAttribute("pointer-events", "none"), n.setAttribute("stroke-linejoin", "round"), n.setAttribute("class", "focus-overlay"), t.appendChild(n), e = { el: n }, Te.set(a, e);
|
|
3899
3891
|
}
|
|
3900
|
-
e.strokeWidth = n.strokeWidth, e.el.setAttribute("stroke", n.stroke ?? "#fff"),
|
|
3892
|
+
e.strokeWidth = n.strokeWidth, e.el.setAttribute("stroke", n.stroke ?? "#fff"), cn(e.el, n.style);
|
|
3901
3893
|
}
|
|
3902
|
-
|
|
3894
|
+
Fn();
|
|
3903
3895
|
}
|
|
3904
3896
|
function ot() {
|
|
3905
|
-
if (!D.value || !
|
|
3906
|
-
|
|
3897
|
+
if (!D.value || !U) return;
|
|
3898
|
+
Bt.value.length > 0 && T("update:focus", null);
|
|
3907
3899
|
let e = M(D.value);
|
|
3908
|
-
e.interrupt(),
|
|
3909
|
-
let t =
|
|
3900
|
+
e.interrupt(), sn();
|
|
3901
|
+
let t = K() && !$.isFullscreen.value && !He.value, n = e.transition().duration(oi).call(U.transform, fe);
|
|
3910
3902
|
t && n.on("end", () => {
|
|
3911
|
-
|
|
3903
|
+
Ve.value = !1;
|
|
3912
3904
|
});
|
|
3913
3905
|
}
|
|
3914
|
-
let st = n(() => Math.max(12, p.focusZoomLevel)), ct = n(() => p.zoom && (
|
|
3906
|
+
let st = n(() => Math.max(12, p.focusZoomLevel)), ct = n(() => p.zoom && (K() ? $.isFullscreen.value || He.value || !p.touchExpand : !0)), lt = n(() => p.zoom && !K() && (He.value || Ve.value || $.isFullscreen.value)), ut = n(() => p.zoom && p.zoomHint && !He.value && !$.isFullscreen.value && (K() && p.touchExpand || !Ve.value)), dt = n(() => K() ? "Double tap to zoom" : "Double click to zoom"), ft = n(() => {
|
|
3915
3907
|
let e = {};
|
|
3916
|
-
return $.isFullscreen.value || Ue.value ? e["touch-action"] = "none" : p.zoom && !
|
|
3908
|
+
return $.isFullscreen.value || Ue.value ? e["touch-action"] = "none" : p.zoom && !He.value && K() && (e["touch-action"] = p.touchExpand ? "manipulation" : "pan-x pan-y"), (Ve.value || $.isFullscreen.value || p.zoom && (He.value || K())) && (e["will-change"] = "transform"), Object.keys(e).length ? e : void 0;
|
|
3917
3909
|
});
|
|
3918
3910
|
function pt(e) {
|
|
3919
|
-
if (!D.value || !
|
|
3911
|
+
if (!D.value || !U) return;
|
|
3920
3912
|
let t = M(D.value);
|
|
3921
|
-
t.interrupt(),
|
|
3913
|
+
t.interrupt(), sn(), t.transition().duration(250).call(U.scaleBy, e);
|
|
3922
3914
|
}
|
|
3923
3915
|
function mt(e, t) {
|
|
3924
3916
|
let n = D.value;
|
|
@@ -3941,24 +3933,24 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
3941
3933
|
return o && ([i, a] = pe(n).invert(o)), fe.translate(bt.value / 2 - r * i, xt.value / 2 - r * a).scale(r);
|
|
3942
3934
|
}
|
|
3943
3935
|
function gt(e) {
|
|
3944
|
-
if (!D.value || !
|
|
3936
|
+
if (!D.value || !U) return;
|
|
3945
3937
|
let t = M(D.value);
|
|
3946
|
-
t.interrupt(), t.transition().duration(oi).call(
|
|
3938
|
+
t.interrupt(), t.transition().duration(oi).call(U.transform, e);
|
|
3947
3939
|
}
|
|
3948
3940
|
function _t(e, t) {
|
|
3949
|
-
if (!D.value || !
|
|
3941
|
+
if (!D.value || !U) return;
|
|
3950
3942
|
let n = ht(e, t);
|
|
3951
3943
|
$.enter(), f(() => gt(n));
|
|
3952
3944
|
}
|
|
3953
3945
|
function vt(e, t) {
|
|
3954
|
-
!D.value || !
|
|
3946
|
+
!D.value || !U || gt(ht(e, t));
|
|
3955
3947
|
}
|
|
3956
3948
|
C(() => p.focusZoomLevel, () => {
|
|
3957
|
-
|
|
3949
|
+
U && U.scaleExtent([1, st.value]), it();
|
|
3958
3950
|
}), C(() => p.state, () => {
|
|
3959
|
-
if (!D.value || !
|
|
3951
|
+
if (!D.value || !U) return;
|
|
3960
3952
|
let e = M(D.value);
|
|
3961
|
-
e.interrupt(),
|
|
3953
|
+
e.interrupt(), U.transform(e, fe);
|
|
3962
3954
|
});
|
|
3963
3955
|
let yt = n(() => p.width && p.height ? p.height / p.width : .625), bt = n(() => li), xt = n(() => li * yt.value), St = n(() => {
|
|
3964
3956
|
let e = re(p.topology), t = e?.objects?.states;
|
|
@@ -4061,7 +4053,7 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4061
4053
|
type: "FeatureCollection",
|
|
4062
4054
|
features: n
|
|
4063
4055
|
};
|
|
4064
|
-
}),
|
|
4056
|
+
}), Ft = n(() => {
|
|
4065
4057
|
let e = wt.value;
|
|
4066
4058
|
if (Ct.value && e) {
|
|
4067
4059
|
let t = [[ui, ui], [bt.value - ui, xt.value - ui]], n = A().fitExtent(t, e), r = j(n).centroid(e);
|
|
@@ -4071,31 +4063,31 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4071
4063
|
if (!r) return n;
|
|
4072
4064
|
let i = A().fitExtent(t, r), a = Mt.value, o = (e, t) => e + (t - e) * a, [s, c] = n.translate(), [l, u] = i.translate();
|
|
4073
4065
|
return A().scale(o(n.scale(), i.scale())).translate([o(s, l), o(c, u)]);
|
|
4074
|
-
}),
|
|
4066
|
+
}), X = n(() => j(Ft.value)), It = n(() => p.geoType === "counties" || p.geoType === "hsas" ? p.strokeWidth * .5 : p.strokeWidth), Lt = n(() => {
|
|
4075
4067
|
let e = /* @__PURE__ */ new Map();
|
|
4076
|
-
for (let [t, n] of
|
|
4068
|
+
for (let [t, n] of Vt.value) {
|
|
4077
4069
|
let r = /* @__PURE__ */ new Map();
|
|
4078
4070
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
4079
4071
|
e.set(t, r);
|
|
4080
4072
|
}
|
|
4081
4073
|
return e;
|
|
4082
4074
|
});
|
|
4083
|
-
function
|
|
4075
|
+
function Rt(e) {
|
|
4084
4076
|
let t = p.dataGeoType;
|
|
4085
4077
|
if (!t || t === p.geoType) return e;
|
|
4086
4078
|
if (p.geoType === "counties" && t === "hsas") return Tt.value?.fipsToHsa[e];
|
|
4087
4079
|
if (p.geoType === "counties" && t === "states" || p.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
4088
4080
|
}
|
|
4089
|
-
let
|
|
4081
|
+
let zt = n(() => {
|
|
4090
4082
|
let e = /* @__PURE__ */ new Map();
|
|
4091
4083
|
for (let t of kt.value.features) t.id != null && e.set(String(t.id), t);
|
|
4092
4084
|
return e;
|
|
4093
|
-
}),
|
|
4085
|
+
}), Bt = n(() => {
|
|
4094
4086
|
let e = p.focus;
|
|
4095
4087
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
4096
|
-
}),
|
|
4088
|
+
}), Vt = n(() => {
|
|
4097
4089
|
let e = /* @__PURE__ */ new Map();
|
|
4098
|
-
e.set(p.geoType,
|
|
4090
|
+
e.set(p.geoType, zt.value);
|
|
4099
4091
|
let t = re(p.topology), n = t?.objects;
|
|
4100
4092
|
if (!n) return e;
|
|
4101
4093
|
let r = (e) => {
|
|
@@ -4112,17 +4104,17 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4112
4104
|
e.set("counties", r(i.features));
|
|
4113
4105
|
}
|
|
4114
4106
|
return !e.has("hsas") && n.counties && e.set("hsas", r(Ot.value.features)), e;
|
|
4115
|
-
}),
|
|
4107
|
+
}), Ht = n(() => {
|
|
4116
4108
|
let e = /* @__PURE__ */ new Map();
|
|
4117
4109
|
if (!p.data) return e;
|
|
4118
|
-
let t = p.dataGeoType ?? p.geoType, n =
|
|
4110
|
+
let t = p.dataGeoType ?? p.geoType, n = Lt.value.get(t);
|
|
4119
4111
|
for (let t of p.data) {
|
|
4120
4112
|
e.set(t.id, t.value);
|
|
4121
4113
|
let r = n?.get(t.id);
|
|
4122
4114
|
r && e.set(r, t.value);
|
|
4123
4115
|
}
|
|
4124
4116
|
return e;
|
|
4125
|
-
}),
|
|
4117
|
+
}), Ut = n(() => {
|
|
4126
4118
|
if (!p.data || p.data.length === 0) return {
|
|
4127
4119
|
min: 0,
|
|
4128
4120
|
max: 1
|
|
@@ -4139,119 +4131,119 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4139
4131
|
min: 0,
|
|
4140
4132
|
max: 1
|
|
4141
4133
|
};
|
|
4142
|
-
}),
|
|
4143
|
-
function
|
|
4144
|
-
let [t, n, r] = At(
|
|
4134
|
+
}), Wt = n(() => Array.isArray(p.colorScale) && p.colorScale.length > 0 && "value" in p.colorScale[0]), Gt = n(() => Array.isArray(p.colorScale) && !Wt.value), Kt = n(() => Gt.value ? "" : p.colorScale?.min ?? "#e5f0fa"), qt = n(() => Gt.value ? "" : p.colorScale?.max ?? "#08519c");
|
|
4135
|
+
function Jt(e) {
|
|
4136
|
+
let [t, n, r] = At(Kt.value) ?? [
|
|
4145
4137
|
229,
|
|
4146
4138
|
240,
|
|
4147
4139
|
250
|
|
4148
|
-
], [i, a, o] = At(
|
|
4140
|
+
], [i, a, o] = At(qt.value) ?? [
|
|
4149
4141
|
8,
|
|
4150
4142
|
81,
|
|
4151
4143
|
156
|
|
4152
4144
|
];
|
|
4153
4145
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
4154
4146
|
}
|
|
4155
|
-
let
|
|
4156
|
-
if (!
|
|
4147
|
+
let Yt = n(() => Gt.value ? p.colorScale.slice().sort((e, t) => t.min - e.min) : null), Xt = n(() => {
|
|
4148
|
+
if (!Wt.value) return null;
|
|
4157
4149
|
let e = /* @__PURE__ */ new Map();
|
|
4158
4150
|
for (let t of p.colorScale) e.set(t.value, t.color);
|
|
4159
4151
|
return e;
|
|
4160
4152
|
});
|
|
4161
|
-
function
|
|
4162
|
-
let t =
|
|
4163
|
-
return t == null ? void 0 :
|
|
4153
|
+
function Z(e) {
|
|
4154
|
+
let t = Rt(e);
|
|
4155
|
+
return t == null ? void 0 : Ht.value.get(t);
|
|
4164
4156
|
}
|
|
4165
|
-
function
|
|
4166
|
-
let t =
|
|
4157
|
+
function Zt(e) {
|
|
4158
|
+
let t = Z(e), n = p.noDataColor;
|
|
4167
4159
|
if (t == null) return n;
|
|
4168
|
-
let r =
|
|
4160
|
+
let r = Xt.value;
|
|
4169
4161
|
if (r) return r.get(String(t)) ?? n;
|
|
4170
|
-
let i =
|
|
4162
|
+
let i = Yt.value;
|
|
4171
4163
|
if (i) {
|
|
4172
4164
|
let e = t;
|
|
4173
4165
|
for (let t of i) if (e >= t.min) return t.color;
|
|
4174
4166
|
return n;
|
|
4175
4167
|
}
|
|
4176
|
-
let { min: a, max: o } =
|
|
4177
|
-
return
|
|
4168
|
+
let { min: a, max: o } = Ut.value;
|
|
4169
|
+
return Jt((t - a) / (o - a));
|
|
4178
4170
|
}
|
|
4179
|
-
let
|
|
4180
|
-
function
|
|
4171
|
+
let Qt = (e) => e.properties?.name ?? String(e.id);
|
|
4172
|
+
function $t(e) {
|
|
4181
4173
|
return e == null ? "" : typeof e == "number" && p.tooltipValueFormat !== void 0 ? ae(e, p.tooltipValueFormat) : String(e);
|
|
4182
4174
|
}
|
|
4183
|
-
function
|
|
4184
|
-
return t == null ? e : `${e}: ${
|
|
4175
|
+
function en(e, t) {
|
|
4176
|
+
return t == null ? e : `${e}: ${$t(t)}`;
|
|
4185
4177
|
}
|
|
4186
|
-
function
|
|
4178
|
+
function tn() {
|
|
4187
4179
|
let e = _e.value?.getEl();
|
|
4188
|
-
e && (
|
|
4180
|
+
e && (Fe?.disconnect(), Fe = new ResizeObserver((e) => {
|
|
4189
4181
|
let t = e[0];
|
|
4190
4182
|
if (!t) return;
|
|
4191
4183
|
let n = t.borderBoxSize?.[0];
|
|
4192
|
-
|
|
4193
|
-
}),
|
|
4184
|
+
Ie.width = n ? n.inlineSize : t.contentRect.width, Ie.height = n ? n.blockSize : t.contentRect.height, H && V && nn(V.x, V.y);
|
|
4185
|
+
}), Fe.observe(e));
|
|
4194
4186
|
}
|
|
4195
|
-
function
|
|
4187
|
+
function nn(e, t) {
|
|
4196
4188
|
let n = _e.value?.getEl();
|
|
4197
4189
|
if (!n) return;
|
|
4198
|
-
let r = oe.value?.getBoundingClientRect(), { left: i, top: a } =
|
|
4190
|
+
let r = oe.value?.getBoundingClientRect(), { left: i, top: a } = B(e, t, Ie.width, Ie.height, p.tooltipClamp, r);
|
|
4199
4191
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
4200
4192
|
let o = typeof window < "u" ? window.visualViewport : null;
|
|
4201
4193
|
if (!o || o.scale <= 1.01 && o.offsetTop < 1 && o.offsetLeft < 1) return;
|
|
4202
4194
|
let s = n.getBoundingClientRect(), c = s.left - i, l = s.top + s.height / 2 - a;
|
|
4203
4195
|
(Math.abs(c) > 1 || Math.abs(l) > 1) && (n.style.transform = `translate3d(${i - c}px, ${a - l}px, 0) translateY(-50%)`);
|
|
4204
4196
|
}
|
|
4205
|
-
let
|
|
4206
|
-
function
|
|
4197
|
+
let rn = n(() => $.isFullscreen.value && K() ? "sheet" : "float");
|
|
4198
|
+
function an(e, t, n) {
|
|
4207
4199
|
let r = Se.get(e);
|
|
4208
4200
|
if (!r) return;
|
|
4209
4201
|
let i = _e.value;
|
|
4210
4202
|
if (!i) return;
|
|
4211
|
-
if (i.setData(r),
|
|
4203
|
+
if (i.setData(r), H = !0, rn.value === "sheet") {
|
|
4212
4204
|
i.setOpen(!0);
|
|
4213
4205
|
return;
|
|
4214
4206
|
}
|
|
4215
4207
|
let a = i.getEl();
|
|
4216
|
-
a && (
|
|
4208
|
+
a && (V = {
|
|
4217
4209
|
x: t,
|
|
4218
4210
|
y: n
|
|
4219
|
-
},
|
|
4211
|
+
}, nn(t, n), a.style.visibility = "visible");
|
|
4220
4212
|
}
|
|
4221
|
-
function
|
|
4222
|
-
!
|
|
4223
|
-
Ke = 0,
|
|
4213
|
+
function on(e, t) {
|
|
4214
|
+
!H || rn.value === "sheet" || (We = e, Ge = t, !Ke && (Ke = requestAnimationFrame(() => {
|
|
4215
|
+
Ke = 0, H && (V = {
|
|
4224
4216
|
x: We,
|
|
4225
4217
|
y: Ge
|
|
4226
|
-
},
|
|
4218
|
+
}, nn(We, Ge));
|
|
4227
4219
|
})));
|
|
4228
4220
|
}
|
|
4229
|
-
function
|
|
4230
|
-
if (!
|
|
4231
|
-
|
|
4221
|
+
function sn() {
|
|
4222
|
+
if (!H) return;
|
|
4223
|
+
H = !1, V = null, _e.value?.setOpen(!1);
|
|
4232
4224
|
let e = _e.value?.getEl();
|
|
4233
4225
|
e && (e.style.visibility = "hidden");
|
|
4234
4226
|
}
|
|
4235
|
-
function
|
|
4227
|
+
function cn(e, t) {
|
|
4236
4228
|
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"));
|
|
4237
4229
|
}
|
|
4238
|
-
function
|
|
4239
|
-
return
|
|
4230
|
+
function ln() {
|
|
4231
|
+
return ze.value * Be.value || 1;
|
|
4240
4232
|
}
|
|
4241
|
-
function
|
|
4242
|
-
return e?.strokeWidth ??
|
|
4233
|
+
function un(e) {
|
|
4234
|
+
return e?.strokeWidth ?? It.value + 1;
|
|
4243
4235
|
}
|
|
4244
|
-
function
|
|
4236
|
+
function dn() {
|
|
4245
4237
|
let e = At(di);
|
|
4246
4238
|
return e ? `rgb(${e[0]},${e[1]},${e[2]})` : "#000";
|
|
4247
4239
|
}
|
|
4248
|
-
function
|
|
4240
|
+
function fn() {
|
|
4249
4241
|
let e = pe(D.value);
|
|
4250
4242
|
return {
|
|
4251
4243
|
dpr: typeof window < "u" && window.devicePixelRatio || 1,
|
|
4252
|
-
meetScale:
|
|
4253
|
-
offsetX:
|
|
4254
|
-
offsetY:
|
|
4244
|
+
meetScale: Be.value,
|
|
4245
|
+
offsetX: Ne,
|
|
4246
|
+
offsetY: Pe,
|
|
4255
4247
|
zoom: {
|
|
4256
4248
|
k: e.k,
|
|
4257
4249
|
x: e.x,
|
|
@@ -4259,22 +4251,22 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4259
4251
|
}
|
|
4260
4252
|
};
|
|
4261
4253
|
}
|
|
4262
|
-
function
|
|
4254
|
+
function pn() {
|
|
4263
4255
|
return {
|
|
4264
4256
|
strokeColor: p.strokeColor,
|
|
4265
|
-
strokeWidth:
|
|
4266
|
-
highlightStroke:
|
|
4267
|
-
hoveredId:
|
|
4268
|
-
focused:
|
|
4269
|
-
overlays:
|
|
4257
|
+
strokeWidth: It.value,
|
|
4258
|
+
highlightStroke: dn(),
|
|
4259
|
+
hoveredId: R,
|
|
4260
|
+
focused: ke,
|
|
4261
|
+
overlays: Ae
|
|
4270
4262
|
};
|
|
4271
4263
|
}
|
|
4272
|
-
let
|
|
4273
|
-
function _n() {
|
|
4274
|
-
typeof window > "u" || typeof window.matchMedia != "function" || (gn?.removeEventListener("change", vn), gn = window.matchMedia(`(resolution: ${window.devicePixelRatio || 1}dppx)`), gn.addEventListener("change", vn));
|
|
4275
|
-
}
|
|
4264
|
+
let mn = 0, hn = 0, gn = !1, _n = null;
|
|
4276
4265
|
function vn() {
|
|
4277
|
-
_n();
|
|
4266
|
+
typeof window > "u" || typeof window.matchMedia != "function" || (_n?.removeEventListener("change", yn), _n = window.matchMedia(`(resolution: ${window.devicePixelRatio || 1}dppx)`), _n.addEventListener("change", yn));
|
|
4267
|
+
}
|
|
4268
|
+
function yn() {
|
|
4269
|
+
vn();
|
|
4278
4270
|
let e = Ee.value, t = D.value;
|
|
4279
4271
|
if (!I.value || !e || !t) return;
|
|
4280
4272
|
let n = t.getBoundingClientRect();
|
|
@@ -4282,50 +4274,92 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4282
4274
|
let t = window.devicePixelRatio || 1;
|
|
4283
4275
|
e.width = Math.max(1, Math.round(n.width * t)), e.height = Math.max(1, Math.round(n.height * t));
|
|
4284
4276
|
}
|
|
4285
|
-
|
|
4277
|
+
An();
|
|
4278
|
+
}
|
|
4279
|
+
let Q = null, bn = null, xn = 0, Sn = !0, Cn = 0;
|
|
4280
|
+
function wn() {
|
|
4281
|
+
Sn = !0;
|
|
4286
4282
|
}
|
|
4287
|
-
|
|
4288
|
-
|
|
4283
|
+
function Tn(e, t) {
|
|
4284
|
+
return e.dpr === t.dpr && e.meetScale === t.meetScale && e.offsetX === t.offsetX && e.offsetY === t.offsetY && e.zoom.k === t.zoom.k && e.zoom.x === t.zoom.x && e.zoom.y === t.zoom.y;
|
|
4285
|
+
}
|
|
4286
|
+
function En(e, t, n, r) {
|
|
4289
4287
|
let i = (e, t) => e.dpr * ((t === "x" ? e.offsetX : e.offsetY) + e.meetScale * (t === "x" ? e.zoom.x : e.zoom.y)), a = t.dpr * t.meetScale * t.zoom.k / (r.dpr * r.meetScale * r.zoom.k);
|
|
4290
4288
|
e.setTransform(a, 0, 0, a, i(t, "x") - a * i(r, "x"), i(t, "y") - a * i(r, "y")), e.drawImage(n, 0, 0), e.setTransform(1, 0, 0, 1, 0, 0);
|
|
4291
4289
|
}
|
|
4292
|
-
function
|
|
4290
|
+
function Dn(e, t) {
|
|
4291
|
+
if (typeof document > "u") {
|
|
4292
|
+
bn = null;
|
|
4293
|
+
return;
|
|
4294
|
+
}
|
|
4295
|
+
Q ||= document.createElement("canvas"), Q.width !== e.width && (Q.width = e.width), Q.height !== e.height && (Q.height = e.height);
|
|
4296
|
+
let n = Q.getContext("2d");
|
|
4297
|
+
n && typeof n.drawImage == "function" ? (n.setTransform(1, 0, 0, 1, 0, 0), n.clearRect(0, 0, Q.width, Q.height), n.drawImage(e, 0, 0), bn = t) : bn = null;
|
|
4298
|
+
}
|
|
4299
|
+
function On() {
|
|
4293
4300
|
let e = Ee.value;
|
|
4294
4301
|
if (!e) return;
|
|
4295
4302
|
let t = e.getContext("2d");
|
|
4296
4303
|
if (!t) return;
|
|
4297
4304
|
let n = () => typeof performance < "u" ? performance.now() : 0;
|
|
4298
|
-
if (
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4305
|
+
if (!L) {
|
|
4306
|
+
t.setTransform(1, 0, 0, 1, 0, 0), t.clearRect(0, 0, e.width, e.height);
|
|
4307
|
+
return;
|
|
4308
|
+
}
|
|
4309
|
+
let r = fn(), i = typeof t.drawImage == "function";
|
|
4310
|
+
if (!Sn && i && Q && bn && Q.width === e.width && Q.height === e.height && Tn(r, bn)) {
|
|
4311
|
+
t.setTransform(1, 0, 0, 1, 0, 0), t.clearRect(0, 0, e.width, e.height), t.drawImage(Q, 0, 0), R && kr(t, L, r, pn(), R);
|
|
4312
|
+
return;
|
|
4313
|
+
}
|
|
4314
|
+
if (!Sn && gn && z && i && Q && bn && n() - xn < pi) {
|
|
4315
|
+
t.setTransform(1, 0, 0, 1, 0, 0), t.clearRect(0, 0, e.width, e.height), En(t, r, Q, bn), R && kr(t, L, r, pn(), R);
|
|
4302
4316
|
return;
|
|
4303
4317
|
}
|
|
4304
|
-
let
|
|
4305
|
-
Ar(t,
|
|
4306
|
-
let
|
|
4307
|
-
|
|
4308
|
-
yn ||= document.createElement("canvas"), yn.width !== e.width && (yn.width = e.width), yn.height !== e.height && (yn.height = e.height);
|
|
4309
|
-
let o = yn.getContext("2d");
|
|
4310
|
-
o && typeof o.drawImage == "function" ? (o.setTransform(1, 0, 0, 1, 0, 0), o.clearRect(0, 0, yn.width, yn.height), o.drawImage(e, 0, 0), bn = r) : bn = null;
|
|
4318
|
+
let a = n();
|
|
4319
|
+
Ar(t, L, r, pn());
|
|
4320
|
+
let o = n() - a;
|
|
4321
|
+
xn = a + o, Sn = !1, o > fi ? (hn = 0, ++mn >= 2 && (gn = !0)) : (mn = 0, ++hn >= 2 && (gn = !1)), Dn(e, r), R && kr(t, L, r, pn(), R);
|
|
4311
4322
|
}
|
|
4312
|
-
function
|
|
4313
|
-
!I.value ||
|
|
4314
|
-
|
|
4323
|
+
function kn() {
|
|
4324
|
+
!I.value || je || (je = requestAnimationFrame(() => {
|
|
4325
|
+
je = 0, On();
|
|
4315
4326
|
}));
|
|
4316
4327
|
}
|
|
4317
|
-
function
|
|
4328
|
+
function An() {
|
|
4329
|
+
I.value && (je &&= (cancelAnimationFrame(je), 0), On());
|
|
4330
|
+
}
|
|
4331
|
+
function jn() {
|
|
4332
|
+
typeof window > "u" || (Cn && window.clearTimeout(Cn), Cn = window.setTimeout(() => {
|
|
4333
|
+
Cn = 0, kn();
|
|
4334
|
+
}, mi));
|
|
4335
|
+
}
|
|
4336
|
+
function Mn(e, t) {
|
|
4337
|
+
let n = Ee.value;
|
|
4338
|
+
if (!n) return;
|
|
4339
|
+
er(n);
|
|
4340
|
+
let r = typeof window < "u" && window.devicePixelRatio || 1;
|
|
4341
|
+
if (n.width = Math.max(1, Math.round(e * r)), n.height = Math.max(1, Math.round(t * r)), gn && !Sn && L && Q && bn && typeof document < "u") {
|
|
4342
|
+
let e = n.getContext("2d");
|
|
4343
|
+
if (e && typeof e.drawImage == "function") {
|
|
4344
|
+
let t = fn();
|
|
4345
|
+
e.setTransform(1, 0, 0, 1, 0, 0), e.clearRect(0, 0, n.width, n.height), En(e, t, Q, bn), R && kr(e, L, t, pn(), R), jn();
|
|
4346
|
+
return;
|
|
4347
|
+
}
|
|
4348
|
+
}
|
|
4349
|
+
An();
|
|
4350
|
+
}
|
|
4351
|
+
function Nn(e, t) {
|
|
4318
4352
|
let n = D.value;
|
|
4319
|
-
if (!n || !
|
|
4353
|
+
if (!n || !L || !Oe) return null;
|
|
4320
4354
|
let r = mt(e, t);
|
|
4321
4355
|
if (!r) return null;
|
|
4322
|
-
let [i, a] = pe(n).invert(r), o = Nr(
|
|
4323
|
-
return o == null ? null :
|
|
4356
|
+
let [i, a] = pe(n).invert(r), o = Nr(Oe, L, i, a);
|
|
4357
|
+
return o == null ? null : L.items[o].id;
|
|
4324
4358
|
}
|
|
4325
|
-
function
|
|
4326
|
-
let t = D.value, n =
|
|
4359
|
+
function Pn(e) {
|
|
4360
|
+
let t = D.value, n = zt.value.get(e);
|
|
4327
4361
|
if (!t || !n) return null;
|
|
4328
|
-
let [[r, i], [a, o]] =
|
|
4362
|
+
let [[r, i], [a, o]] = X.value.bounds(n), [s, c] = pe(t).apply([(r + a) / 2, (i + o) / 2]), l = null;
|
|
4329
4363
|
try {
|
|
4330
4364
|
l = t.getScreenCTM();
|
|
4331
4365
|
} catch {
|
|
@@ -4336,58 +4370,58 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4336
4370
|
y: l.b * s + l.d * c + l.f
|
|
4337
4371
|
} : null;
|
|
4338
4372
|
}
|
|
4339
|
-
function
|
|
4373
|
+
function Fn() {
|
|
4340
4374
|
if (I.value) return;
|
|
4341
|
-
let e =
|
|
4375
|
+
let e = ln(), t = It.value;
|
|
4342
4376
|
k.value?.setAttribute("stroke-width", String(t / e)), Ce?.setAttribute("stroke-width", String(1 / e)), se.value?.setAttribute("stroke-width", String((t + 1.5) / e));
|
|
4343
4377
|
for (let { el: t, strokeWidth: n } of Te.values()) n == null ? t.removeAttribute("stroke-width") : t.setAttribute("stroke-width", String(n / e));
|
|
4344
|
-
for (let [t, n] of we) t.setAttribute("stroke-width", String(
|
|
4345
|
-
F && !we.has(F) && F.setAttribute("stroke-width", String(
|
|
4378
|
+
for (let [t, n] of we) t.setAttribute("stroke-width", String(un(n) / e));
|
|
4379
|
+
F && !we.has(F) && F.setAttribute("stroke-width", String(un() / e));
|
|
4346
4380
|
}
|
|
4347
|
-
function
|
|
4348
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
4381
|
+
function In(e, t) {
|
|
4382
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(un(t) / ln())), e.style.stroke = t?.stroke ?? di, cn(e, t?.style);
|
|
4349
4383
|
}
|
|
4350
|
-
function
|
|
4384
|
+
function Ln(e) {
|
|
4351
4385
|
e.removeAttribute("stroke-width"), e.style.stroke = "", e.setAttribute("stroke", p.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
4352
4386
|
}
|
|
4353
|
-
function
|
|
4354
|
-
F !== e && (F && !we.has(F) &&
|
|
4387
|
+
function Rn(e) {
|
|
4388
|
+
F !== e && (F && !we.has(F) && Ln(F), F = e, In(e, we.get(e)));
|
|
4355
4389
|
}
|
|
4356
|
-
function
|
|
4390
|
+
function zn(e) {
|
|
4357
4391
|
if (I.value) {
|
|
4358
|
-
if (
|
|
4359
|
-
|
|
4392
|
+
if (R === e) return;
|
|
4393
|
+
R = e, kn();
|
|
4360
4394
|
return;
|
|
4361
4395
|
}
|
|
4362
4396
|
let t = xe.get(e);
|
|
4363
|
-
t &&
|
|
4397
|
+
t && Rn(t);
|
|
4364
4398
|
}
|
|
4365
|
-
function
|
|
4399
|
+
function Bn() {
|
|
4366
4400
|
if (I.value) {
|
|
4367
|
-
|
|
4401
|
+
R != null && (R = null, kn(), T("stateHover", null)), sn();
|
|
4368
4402
|
return;
|
|
4369
4403
|
}
|
|
4370
4404
|
if (F) {
|
|
4371
4405
|
let e = we.get(F);
|
|
4372
|
-
e == null ?
|
|
4406
|
+
e == null ? Ln(F) : In(F, e), F = null, T("stateHover", null);
|
|
4373
4407
|
}
|
|
4374
|
-
|
|
4408
|
+
sn();
|
|
4375
4409
|
}
|
|
4376
|
-
function
|
|
4410
|
+
function Vn(e) {
|
|
4377
4411
|
let t = e;
|
|
4378
4412
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
4379
4413
|
return t ? t.dataset.featId ?? null : null;
|
|
4380
4414
|
}
|
|
4381
|
-
function
|
|
4415
|
+
function Hn(e) {
|
|
4382
4416
|
T("stateClick", {
|
|
4383
4417
|
id: e.id,
|
|
4384
4418
|
name: e.name,
|
|
4385
4419
|
value: e.value
|
|
4386
|
-
}), T("update:focus", nt(
|
|
4420
|
+
}), T("update:focus", nt(Bt.value).has(e.id) ? null : e.id);
|
|
4387
4421
|
}
|
|
4388
|
-
function
|
|
4389
|
-
if (e.type === "mouseover" &&
|
|
4390
|
-
let t = e, n =
|
|
4422
|
+
function Un(e) {
|
|
4423
|
+
if (e.type === "mouseover" && z) return;
|
|
4424
|
+
let t = e, n = Jn(t.target, t.clientX, t.clientY);
|
|
4391
4425
|
if (!n) return;
|
|
4392
4426
|
let r = Se.get(n);
|
|
4393
4427
|
if (!r) return;
|
|
@@ -4397,41 +4431,41 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4397
4431
|
value: r.value
|
|
4398
4432
|
};
|
|
4399
4433
|
e.type === "click" ? p.zoom ? (window.clearTimeout(q), q = 0, t.detail <= 1 && (q = window.setTimeout(() => {
|
|
4400
|
-
q = 0,
|
|
4401
|
-
}, ii))) :
|
|
4434
|
+
q = 0, Hn(r);
|
|
4435
|
+
}, ii))) : Hn(r) : e.type === "mouseover" && (zn(n), N.value && an(n, t.clientX, t.clientY), T("stateHover", i));
|
|
4402
4436
|
}
|
|
4403
|
-
function
|
|
4404
|
-
|
|
4437
|
+
function Wn(e) {
|
|
4438
|
+
z || on(e.clientX, e.clientY);
|
|
4405
4439
|
}
|
|
4406
|
-
function
|
|
4440
|
+
function Gn(e) {
|
|
4407
4441
|
let t = e.relatedTarget;
|
|
4408
|
-
t && O.value?.contains(t) ||
|
|
4442
|
+
t && O.value?.contains(t) || Bn();
|
|
4409
4443
|
}
|
|
4410
|
-
function
|
|
4411
|
-
if (
|
|
4412
|
-
let t =
|
|
4413
|
-
if (t ===
|
|
4414
|
-
t &&
|
|
4444
|
+
function Kn(e) {
|
|
4445
|
+
if (z) return;
|
|
4446
|
+
let t = Nn(e.clientX, e.clientY);
|
|
4447
|
+
if (t === R) {
|
|
4448
|
+
t && on(e.clientX, e.clientY);
|
|
4415
4449
|
return;
|
|
4416
4450
|
}
|
|
4417
4451
|
if (!t) {
|
|
4418
|
-
|
|
4452
|
+
Bn();
|
|
4419
4453
|
return;
|
|
4420
4454
|
}
|
|
4421
4455
|
let n = Se.get(t);
|
|
4422
|
-
n && (
|
|
4456
|
+
n && (zn(t), T("stateHover", {
|
|
4423
4457
|
id: n.id,
|
|
4424
4458
|
name: n.name,
|
|
4425
4459
|
value: n.value
|
|
4426
|
-
}), N.value &&
|
|
4460
|
+
}), N.value && an(t, e.clientX, e.clientY));
|
|
4427
4461
|
}
|
|
4428
|
-
function
|
|
4429
|
-
|
|
4462
|
+
function qn() {
|
|
4463
|
+
Bn();
|
|
4430
4464
|
}
|
|
4431
|
-
function
|
|
4432
|
-
return I.value ?
|
|
4465
|
+
function Jn(e, t, n) {
|
|
4466
|
+
return I.value ? Nn(t, n) : Vn(e);
|
|
4433
4467
|
}
|
|
4434
|
-
function
|
|
4468
|
+
function Yn(e) {
|
|
4435
4469
|
if (e.touches.length !== 1) {
|
|
4436
4470
|
qe = null;
|
|
4437
4471
|
return;
|
|
@@ -4441,15 +4475,15 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4441
4475
|
x: t.clientX,
|
|
4442
4476
|
y: t.clientY,
|
|
4443
4477
|
time: e.timeStamp,
|
|
4444
|
-
featId:
|
|
4478
|
+
featId: Jn(e.target, t.clientX, t.clientY)
|
|
4445
4479
|
};
|
|
4446
4480
|
}
|
|
4447
|
-
function
|
|
4481
|
+
function Xn(e) {
|
|
4448
4482
|
let t = qe;
|
|
4449
4483
|
if (qe = null, !t || e.touches.length > 0) return;
|
|
4450
4484
|
let n = e.changedTouches[0];
|
|
4451
4485
|
if (!n || Math.abs(n.clientX - t.x) > ni || Math.abs(n.clientY - t.y) > ni || e.timeStamp - t.time > ri) return;
|
|
4452
|
-
if (p.zoom && !
|
|
4486
|
+
if (p.zoom && !He.value && K() && !$.isFullscreen.value) {
|
|
4453
4487
|
e.cancelable && e.preventDefault();
|
|
4454
4488
|
let r = Je;
|
|
4455
4489
|
if (Je = {
|
|
@@ -4462,60 +4496,60 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4462
4496
|
}
|
|
4463
4497
|
let i = t.featId ? Se.get(t.featId) : void 0;
|
|
4464
4498
|
if (!i) {
|
|
4465
|
-
|
|
4499
|
+
Bn();
|
|
4466
4500
|
return;
|
|
4467
4501
|
}
|
|
4468
|
-
|
|
4469
|
-
q = 0,
|
|
4502
|
+
Zn(i, n.clientX, n.clientY), window.clearTimeout(q), q = window.setTimeout(() => {
|
|
4503
|
+
q = 0, Hn(i);
|
|
4470
4504
|
}, ii);
|
|
4471
4505
|
return;
|
|
4472
4506
|
}
|
|
4473
4507
|
if (!t.featId) {
|
|
4474
|
-
|
|
4508
|
+
Bn();
|
|
4475
4509
|
return;
|
|
4476
4510
|
}
|
|
4477
4511
|
let r = Se.get(t.featId);
|
|
4478
|
-
r && (e.cancelable && e.preventDefault(),
|
|
4512
|
+
r && (e.cancelable && e.preventDefault(), Zn(r, n.clientX, n.clientY), Hn(r));
|
|
4479
4513
|
}
|
|
4480
|
-
function
|
|
4481
|
-
if (
|
|
4514
|
+
function Zn(e, t, n) {
|
|
4515
|
+
if (zn(e.id), T("stateHover", {
|
|
4482
4516
|
id: e.id,
|
|
4483
4517
|
name: e.name,
|
|
4484
4518
|
value: e.value
|
|
4485
4519
|
}), !N.value) return;
|
|
4486
4520
|
if (I.value) {
|
|
4487
|
-
let r =
|
|
4488
|
-
r ?
|
|
4521
|
+
let r = Pn(e.id);
|
|
4522
|
+
r ? an(e.id, r.x, r.y) : an(e.id, t, n);
|
|
4489
4523
|
return;
|
|
4490
4524
|
}
|
|
4491
4525
|
let r = xe.get(e.id);
|
|
4492
4526
|
if (r) {
|
|
4493
4527
|
let t = r.getBoundingClientRect();
|
|
4494
|
-
|
|
4495
|
-
} else
|
|
4528
|
+
an(e.id, t.left + t.width / 2, t.top + t.height / 2);
|
|
4529
|
+
} else an(e.id, t, n);
|
|
4496
4530
|
}
|
|
4497
|
-
function
|
|
4531
|
+
function Qn() {
|
|
4498
4532
|
qe = null;
|
|
4499
4533
|
}
|
|
4500
|
-
function
|
|
4534
|
+
function $n(e) {
|
|
4501
4535
|
let t = document.createElementNS(ti, "path");
|
|
4502
4536
|
return e && t.setAttribute("d", e), t;
|
|
4503
4537
|
}
|
|
4504
|
-
function
|
|
4538
|
+
function er(e) {
|
|
4505
4539
|
let t = D.value, n = oe.value?.getBoundingClientRect();
|
|
4506
4540
|
if (!e || !t || !n) return;
|
|
4507
4541
|
let r = t.getBoundingClientRect();
|
|
4508
4542
|
e.style.top = `${r.top - n.top}px`, e.style.left = `${r.left - n.left}px`, e.style.width = `${r.width}px`, e.style.height = `${r.height}px`;
|
|
4509
4543
|
}
|
|
4510
|
-
function
|
|
4544
|
+
function tr() {
|
|
4511
4545
|
let e = ce.value;
|
|
4512
4546
|
if (!e) return;
|
|
4513
|
-
let t = p.cities, n =
|
|
4547
|
+
let t = p.cities, n = Ft.value;
|
|
4514
4548
|
if (!t || t.length === 0 || !n) {
|
|
4515
4549
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
4516
4550
|
return;
|
|
4517
4551
|
}
|
|
4518
|
-
for (
|
|
4552
|
+
for (er(le.value); e.firstChild;) e.removeChild(e.firstChild);
|
|
4519
4553
|
let r = D.value ? pe(D.value) : {
|
|
4520
4554
|
k: 1,
|
|
4521
4555
|
x: 0,
|
|
@@ -4529,12 +4563,12 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4529
4563
|
}, {
|
|
4530
4564
|
width: bt.value,
|
|
4531
4565
|
height: xt.value,
|
|
4532
|
-
viewScale:
|
|
4533
|
-
labelPx:
|
|
4534
|
-
dotPx:
|
|
4535
|
-
gapPx:
|
|
4566
|
+
viewScale: Be.value,
|
|
4567
|
+
labelPx: hi,
|
|
4568
|
+
dotPx: gi,
|
|
4569
|
+
gapPx: _i,
|
|
4536
4570
|
margin: 4
|
|
4537
|
-
}), o =
|
|
4571
|
+
}), o = Be.value || 1, s = hi / o, c = vi / o, l = yi / o, u = document.createDocumentFragment();
|
|
4538
4572
|
for (let e of a) {
|
|
4539
4573
|
let t = document.createElementNS(ti, "circle");
|
|
4540
4574
|
if (t.setAttribute("cx", String(e.x)), t.setAttribute("cy", String(e.y)), t.setAttribute("r", String(e.radius)), t.setAttribute("class", "choropleth-city-dot"), t.setAttribute("stroke-width", String(c)), u.appendChild(t), e.label) {
|
|
@@ -4544,20 +4578,20 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4544
4578
|
}
|
|
4545
4579
|
e.appendChild(u);
|
|
4546
4580
|
}
|
|
4547
|
-
function
|
|
4548
|
-
|
|
4549
|
-
|
|
4581
|
+
function nr() {
|
|
4582
|
+
Me ||= requestAnimationFrame(() => {
|
|
4583
|
+
Me = 0, tr();
|
|
4550
4584
|
});
|
|
4551
4585
|
}
|
|
4552
|
-
function
|
|
4586
|
+
function rr() {
|
|
4553
4587
|
let e = k.value, t = se.value;
|
|
4554
4588
|
if (!e || !t) return;
|
|
4555
4589
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
4556
4590
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
4557
|
-
xe.clear(), Se.clear(), Ce = null, F = null, we.clear(), Te.clear(),
|
|
4558
|
-
let n =
|
|
4591
|
+
xe.clear(), Se.clear(), Ce = null, F = null, we.clear(), Te.clear(), R = null, ke.clear(), Ae = [];
|
|
4592
|
+
let n = X.value, r = kt.value.features;
|
|
4559
4593
|
if (r.length === 0) {
|
|
4560
|
-
|
|
4594
|
+
L = null, Oe = null, bn = null, wn(), kn();
|
|
4561
4595
|
return;
|
|
4562
4596
|
}
|
|
4563
4597
|
if (I.value) {
|
|
@@ -4565,21 +4599,21 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4565
4599
|
let t = String(e.id);
|
|
4566
4600
|
Se.set(t, {
|
|
4567
4601
|
id: t,
|
|
4568
|
-
name:
|
|
4569
|
-
value:
|
|
4602
|
+
name: Qt(e),
|
|
4603
|
+
value: Z(t),
|
|
4570
4604
|
feature: e
|
|
4571
4605
|
});
|
|
4572
4606
|
}
|
|
4573
4607
|
let e = jt.value;
|
|
4574
|
-
|
|
4608
|
+
L = wr(r, n, Zt, e ? n(e) : null), !De && typeof document < "u" && (De = document.createElement("canvas")), Oe = De ? Mr(L, bt.value, xt.value, De) : null, wn(), kn();
|
|
4575
4609
|
return;
|
|
4576
4610
|
}
|
|
4577
4611
|
let i = p.strokeColor, a = !N.value, o = document.createDocumentFragment();
|
|
4578
4612
|
for (let e of r) {
|
|
4579
|
-
let t = String(e.id), r =
|
|
4580
|
-
if (c.setAttribute("class", "state-path"), c.setAttribute("data-feat-id", t), c.setAttribute("fill",
|
|
4613
|
+
let t = String(e.id), r = Qt(e), s = Z(t), c = $n(n(e));
|
|
4614
|
+
if (c.setAttribute("class", "state-path"), c.setAttribute("data-feat-id", t), c.setAttribute("fill", Zt(t)), c.setAttribute("stroke", i), a) {
|
|
4581
4615
|
let e = document.createElementNS(ti, "title");
|
|
4582
|
-
e.textContent =
|
|
4616
|
+
e.textContent = en(r, s), c.appendChild(e);
|
|
4583
4617
|
}
|
|
4584
4618
|
o.appendChild(c), xe.set(t, c), Se.set(t, {
|
|
4585
4619
|
id: t,
|
|
@@ -4590,123 +4624,123 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4590
4624
|
}
|
|
4591
4625
|
let s = jt.value;
|
|
4592
4626
|
if (s) {
|
|
4593
|
-
let e =
|
|
4627
|
+
let e = $n(n(s));
|
|
4594
4628
|
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), o.appendChild(e), Ce = e;
|
|
4595
4629
|
}
|
|
4596
|
-
e.appendChild(o),
|
|
4630
|
+
e.appendChild(o), Fn();
|
|
4597
4631
|
}
|
|
4598
|
-
function
|
|
4632
|
+
function ir() {
|
|
4599
4633
|
if (I.value) {
|
|
4600
|
-
if (
|
|
4601
|
-
for (let [e, t] of Se) t.value =
|
|
4602
|
-
wn();
|
|
4634
|
+
if (L) for (let e of L.items) e.fill = Zt(e.id);
|
|
4635
|
+
for (let [e, t] of Se) t.value = Z(e);
|
|
4636
|
+
wn(), kn();
|
|
4603
4637
|
return;
|
|
4604
4638
|
}
|
|
4605
4639
|
let e = !N.value;
|
|
4606
4640
|
for (let [t, n] of xe) {
|
|
4607
|
-
let r =
|
|
4608
|
-
if (n.setAttribute("fill",
|
|
4641
|
+
let r = Z(t), i = Se.get(t);
|
|
4642
|
+
if (n.setAttribute("fill", Zt(t)), i && (i.value = r), e && i) {
|
|
4609
4643
|
let e = n.firstElementChild;
|
|
4610
|
-
e && (e.textContent =
|
|
4644
|
+
e && (e.textContent = en(i.name, r));
|
|
4611
4645
|
}
|
|
4612
4646
|
}
|
|
4613
4647
|
}
|
|
4614
|
-
function
|
|
4648
|
+
function ar() {
|
|
4615
4649
|
if (I.value) {
|
|
4616
|
-
wn();
|
|
4650
|
+
wn(), kn();
|
|
4617
4651
|
return;
|
|
4618
4652
|
}
|
|
4619
|
-
for (let e of xe.values()) e === F || we.has(e) ||
|
|
4620
|
-
Ce && Ce.setAttribute("stroke", p.strokeColor),
|
|
4653
|
+
for (let e of xe.values()) e === F || we.has(e) || Ln(e);
|
|
4654
|
+
Ce && Ce.setAttribute("stroke", p.strokeColor), Fn();
|
|
4621
4655
|
}
|
|
4622
|
-
function
|
|
4656
|
+
function or() {
|
|
4623
4657
|
return typeof p.menu == "string" ? p.menu : "choropleth";
|
|
4624
4658
|
}
|
|
4625
|
-
let
|
|
4659
|
+
let sr = n(() => p.legend && (Wt.value || Gt.value || p.data)), cr = n(() => p.colorScale.slice().sort((e, t) => e.min - t.min)), lr = n(() => {
|
|
4626
4660
|
let e = [];
|
|
4627
4661
|
for (let t = 0; t <= 10; t++) {
|
|
4628
4662
|
let n = t / 10;
|
|
4629
4663
|
e.push({
|
|
4630
4664
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
4631
|
-
color:
|
|
4665
|
+
color: Jt(n)
|
|
4632
4666
|
});
|
|
4633
4667
|
}
|
|
4634
4668
|
return e;
|
|
4635
|
-
}),
|
|
4669
|
+
}), ur = new Intl.NumberFormat("en-US", {
|
|
4636
4670
|
notation: "compact",
|
|
4637
4671
|
maximumFractionDigits: 1
|
|
4638
|
-
}),
|
|
4639
|
-
let { min: e, max: t } =
|
|
4672
|
+
}), dr = n(() => {
|
|
4673
|
+
let { min: e, max: t } = Ut.value, n = t - e, r = [];
|
|
4640
4674
|
for (let t = 1; t <= 3; t++) {
|
|
4641
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
4675
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? ur.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
4642
4676
|
r.push({
|
|
4643
4677
|
value: o,
|
|
4644
4678
|
pct: i * 100
|
|
4645
4679
|
});
|
|
4646
4680
|
}
|
|
4647
4681
|
return r;
|
|
4648
|
-
}),
|
|
4682
|
+
}), fr = n(() => {
|
|
4649
4683
|
let e = [];
|
|
4650
|
-
if (
|
|
4684
|
+
if (Wt.value) for (let t of p.colorScale) e.push({
|
|
4651
4685
|
key: t.value,
|
|
4652
4686
|
color: t.color,
|
|
4653
4687
|
label: t.value
|
|
4654
4688
|
});
|
|
4655
|
-
else if (
|
|
4689
|
+
else if (Gt.value) for (let t of cr.value) e.push({
|
|
4656
4690
|
key: String(t.min),
|
|
4657
4691
|
color: t.color,
|
|
4658
4692
|
label: t.label ?? String(t.min)
|
|
4659
4693
|
});
|
|
4660
4694
|
return e;
|
|
4661
|
-
}),
|
|
4662
|
-
let e =
|
|
4695
|
+
}), pr = n(() => `linear-gradient(to right, ${lr.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), $ = J({ target: () => p.fullscreenTarget }), mr = n(() => {
|
|
4696
|
+
let e = or();
|
|
4663
4697
|
return I.value ? [$.menuItem.value, {
|
|
4664
4698
|
label: "Save as PNG",
|
|
4665
4699
|
action: () => {
|
|
4666
|
-
Ee.value &&
|
|
4700
|
+
Ee.value && Re(Ee.value, e);
|
|
4667
4701
|
}
|
|
4668
4702
|
}] : [
|
|
4669
4703
|
$.menuItem.value,
|
|
4670
4704
|
{
|
|
4671
4705
|
label: "Save as SVG",
|
|
4672
4706
|
action: () => {
|
|
4673
|
-
D.value &&
|
|
4707
|
+
D.value && G(D.value, e);
|
|
4674
4708
|
}
|
|
4675
4709
|
},
|
|
4676
4710
|
{
|
|
4677
4711
|
label: "Save as PNG",
|
|
4678
4712
|
action: () => {
|
|
4679
|
-
D.value &&
|
|
4713
|
+
D.value && Le(D.value, e);
|
|
4680
4714
|
}
|
|
4681
4715
|
}
|
|
4682
4716
|
];
|
|
4683
4717
|
});
|
|
4684
4718
|
return C(() => [
|
|
4685
4719
|
kt.value,
|
|
4686
|
-
|
|
4720
|
+
X.value,
|
|
4687
4721
|
N.value
|
|
4688
|
-
], () =>
|
|
4689
|
-
|
|
4722
|
+
], () => rr()), C(() => [
|
|
4723
|
+
Ht.value,
|
|
4690
4724
|
p.colorScale,
|
|
4691
4725
|
p.noDataColor,
|
|
4692
4726
|
p.dataGeoType
|
|
4693
|
-
], () =>
|
|
4694
|
-
|
|
4695
|
-
|
|
4727
|
+
], () => ir()), C(() => [p.strokeColor, It.value], () => ar()), C(() => [
|
|
4728
|
+
Bt.value,
|
|
4729
|
+
X.value,
|
|
4696
4730
|
Tt.value
|
|
4697
4731
|
], () => it(), { flush: "post" }), C(() => [
|
|
4698
4732
|
p.cities,
|
|
4699
|
-
|
|
4700
|
-
|
|
4733
|
+
Ft.value,
|
|
4734
|
+
Be.value,
|
|
4701
4735
|
p.citiesMinZoom,
|
|
4702
4736
|
p.zoom,
|
|
4703
4737
|
p.title,
|
|
4704
4738
|
p.legend,
|
|
4705
4739
|
p.legendTitle
|
|
4706
|
-
], () =>
|
|
4707
|
-
if (
|
|
4740
|
+
], () => nr(), { flush: "post" }), C(() => $.isFullscreen.value, (e) => {
|
|
4741
|
+
if (sn(), e || !K() || !D.value || !U) return;
|
|
4708
4742
|
let t = M(D.value);
|
|
4709
|
-
t.interrupt(),
|
|
4743
|
+
t.interrupt(), U.transform(t, fe);
|
|
4710
4744
|
}), (n, l) => (_(), r(t, {
|
|
4711
4745
|
to: x($).teleportTarget.value,
|
|
4712
4746
|
disabled: !x($).isFullscreen.value
|
|
@@ -4724,7 +4758,7 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4724
4758
|
}), [
|
|
4725
4759
|
c.menu || x($).isFullscreen.value ? (_(), r(ye, {
|
|
4726
4760
|
key: 0,
|
|
4727
|
-
items:
|
|
4761
|
+
items: mr.value,
|
|
4728
4762
|
"is-fullscreen": x($).isFullscreen.value,
|
|
4729
4763
|
onClose: x($).exit
|
|
4730
4764
|
}, null, 8, [
|
|
@@ -4733,15 +4767,15 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4733
4767
|
"onClose"
|
|
4734
4768
|
])) : i("", !0),
|
|
4735
4769
|
o("div", Kr, b(x($).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
|
|
4736
|
-
c.title ||
|
|
4770
|
+
c.title || sr.value ? (_(), a("div", qr, [c.title ? (_(), a("div", {
|
|
4737
4771
|
key: 0,
|
|
4738
4772
|
class: "choropleth-title",
|
|
4739
4773
|
style: h(be.value)
|
|
4740
|
-
}, b(c.title), 5)) : i("", !0),
|
|
4774
|
+
}, b(c.title), 5)) : i("", !0), sr.value ? (_(), a("div", {
|
|
4741
4775
|
key: 1,
|
|
4742
4776
|
class: "choropleth-legend",
|
|
4743
4777
|
style: h(P.value)
|
|
4744
|
-
}, [c.legendTitle ? (_(), a("span", Jr, b(c.legendTitle), 1)) : i("", !0),
|
|
4778
|
+
}, [c.legendTitle ? (_(), a("span", Jr, b(c.legendTitle), 1)) : i("", !0), Wt.value || Gt.value ? (_(!0), a(e, { key: 1 }, y(fr.value, (e) => (_(), a("span", {
|
|
4745
4779
|
key: e.key,
|
|
4746
4780
|
class: "choropleth-legend-item"
|
|
4747
4781
|
}, [o("span", {
|
|
@@ -4749,8 +4783,8 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4749
4783
|
style: h({ background: e.color })
|
|
4750
4784
|
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", Yr, [o("div", {
|
|
4751
4785
|
class: "choropleth-legend-gradient",
|
|
4752
|
-
style: h({ background:
|
|
4753
|
-
}, null, 4), o("div", Xr, [(_(!0), a(e, null, y(
|
|
4786
|
+
style: h({ background: pr.value })
|
|
4787
|
+
}, null, 4), o("div", Xr, [(_(!0), a(e, null, y(dr.value, (e) => (_(), a("span", {
|
|
4754
4788
|
key: e.value,
|
|
4755
4789
|
style: h({ left: e.pct + "%" })
|
|
4756
4790
|
}, b(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
|
|
@@ -4793,9 +4827,9 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4793
4827
|
}, null, 512)], 8, $r)) : i("", !0),
|
|
4794
4828
|
ct.value ? (_(), r(x(Ze), {
|
|
4795
4829
|
key: 5,
|
|
4796
|
-
"can-zoom-in":
|
|
4797
|
-
"can-zoom-out":
|
|
4798
|
-
"can-reset":
|
|
4830
|
+
"can-zoom-in": ze.value < st.value,
|
|
4831
|
+
"can-zoom-out": ze.value > 1,
|
|
4832
|
+
"can-reset": W.value,
|
|
4799
4833
|
"is-fullscreen": x($).isFullscreen.value,
|
|
4800
4834
|
onZoomIn: l[0] ||= (e) => pt(si),
|
|
4801
4835
|
onZoomOut: l[1] ||= (e) => pt(1 / si),
|
|
@@ -4810,17 +4844,17 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4810
4844
|
key: 6,
|
|
4811
4845
|
ref_key: "tooltipChildRef",
|
|
4812
4846
|
ref: _e,
|
|
4813
|
-
mode:
|
|
4847
|
+
mode: rn.value
|
|
4814
4848
|
}, {
|
|
4815
4849
|
default: w((t) => [te(n.$slots, "tooltip", m(u(E(t))), () => [c.tooltipFormat ? (_(), a("span", {
|
|
4816
4850
|
key: 0,
|
|
4817
4851
|
innerHTML: c.tooltipFormat(t)
|
|
4818
|
-
}, null, 8, ei)) : t.value == null ? (_(), a(e, { key: 1 }, [s(b(t.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(t.name) + ": " + b(
|
|
4852
|
+
}, null, 8, ei)) : t.value == null ? (_(), a(e, { key: 1 }, [s(b(t.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(t.name) + ": " + b($t(t.value)), 1)], 64))], !0)]),
|
|
4819
4853
|
_: 3
|
|
4820
4854
|
}, 8, ["mode"])) : i("", !0)
|
|
4821
4855
|
], 16, Gr)], 8, ["to", "disabled"]));
|
|
4822
4856
|
}
|
|
4823
|
-
}), [["__scopeId", "data-v-
|
|
4857
|
+
}), [["__scopeId", "data-v-529f8dad"]]), xi = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
4824
4858
|
__name: "ChartTooltip",
|
|
4825
4859
|
props: {
|
|
4826
4860
|
x: {},
|
|
@@ -4871,7 +4905,7 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4871
4905
|
_: 3
|
|
4872
4906
|
}, 8, ["open"])) : i("", !0);
|
|
4873
4907
|
}
|
|
4874
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
4908
|
+
}), [["__scopeId", "data-v-44377f70"]]), Si = { class: "TableWrapper" }, Ci = ["href", "download"], wi = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
4875
4909
|
__name: "DataTable",
|
|
4876
4910
|
props: {
|
|
4877
4911
|
data: {},
|
|
@@ -4973,7 +5007,7 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4973
5007
|
return n.join("\n");
|
|
4974
5008
|
}
|
|
4975
5009
|
function S() {
|
|
4976
|
-
|
|
5010
|
+
ze(x(), re());
|
|
4977
5011
|
}
|
|
4978
5012
|
let ie = n(() => c.downloadButton || c.downloadLink ? [] : [{
|
|
4979
5013
|
label: c.downloadMenuLink,
|
|
@@ -4992,7 +5026,7 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
4992
5026
|
items: ie.value,
|
|
4993
5027
|
"force-dropdown": ""
|
|
4994
5028
|
}, null, 8, ["items"])) : i("", !0),
|
|
4995
|
-
o("div",
|
|
5029
|
+
o("div", Si, [o("table", { class: p(["Table", { "full-width": t.fullWidth }]) }, [
|
|
4996
5030
|
o("colgroup", null, [(_(!0), a(e, null, y(v.value, (e) => (_(), a("col", {
|
|
4997
5031
|
key: e.name,
|
|
4998
5032
|
style: h(u(e.name))
|
|
@@ -5018,9 +5052,9 @@ var Gr = ["role", "aria-label"], Kr = {
|
|
|
5018
5052
|
class: "data-table-download-link",
|
|
5019
5053
|
href: w.value,
|
|
5020
5054
|
download: `${re()}.csv`
|
|
5021
|
-
}, b(C.value), 9,
|
|
5055
|
+
}, b(C.value), 9, Ci)) : i("", !0)
|
|
5022
5056
|
], 2));
|
|
5023
5057
|
}
|
|
5024
5058
|
}), [["__scopeId", "data-v-9b1b6a76"]]);
|
|
5025
5059
|
//#endregion
|
|
5026
|
-
export { br as BarChart,
|
|
5060
|
+
export { br as BarChart, xi as ChartTooltip, bi as ChoroplethMap, wi as DataTable, Vn as LineChart };
|