@cfasim-ui/charts 0.7.5 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChoroplethMap/ChoroplethMap.d.ts +41 -2
- package/dist/ChoroplethMap/cityLayout.d.ts +89 -0
- package/dist/ChoroplethMap/cityLayout.test.d.ts +1 -0
- package/dist/LineChart/LineChart.d.ts +7 -0
- package/dist/_shared/chartProps.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1418 -1170
- package/dist/tooltip-position.test.d.ts +1 -0
- package/dist/us-cities/data.d.ts +2 -0
- package/dist/us-cities/index.d.ts +51 -0
- package/dist/us-cities/us-cities.test.d.ts +1 -0
- package/dist/us-cities.d.ts +1 -0
- package/dist/us-cities.js +1396 -0
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, nextTick as f, normalizeClass as p, normalizeProps as m, normalizeStyle as h, onMounted as g, onUnmounted as ee, openBlock as _, ref as v, renderList as y, renderSlot as te, toDisplayString as b, toHandlers as ne, toRaw as re, unref as x, useSlots as S, useTemplateRef as ie, watch as C, withCtx as w } from "vue";
|
|
2
2
|
import { formatNumber as ae } from "@cfasim-ui/shared";
|
|
3
|
-
import { DropdownMenuContent as T, DropdownMenuItem as E, DropdownMenuPortal as oe, DropdownMenuRoot as D, DropdownMenuTrigger as O, PopoverAnchor as k, PopoverContent as se, PopoverPortal as
|
|
4
|
-
import { geoAlbersUsa as
|
|
5
|
-
import { zoom as
|
|
6
|
-
import { select as
|
|
3
|
+
import { DropdownMenuContent as T, DropdownMenuItem as E, DropdownMenuPortal as oe, DropdownMenuRoot as D, DropdownMenuTrigger as O, PopoverAnchor as k, PopoverContent as se, PopoverPortal as ce, PopoverRoot as le } from "reka-ui";
|
|
4
|
+
import { geoAlbersUsa as A, geoMercator as ue, geoPath as j } from "d3-geo";
|
|
5
|
+
import { zoom as de, zoomIdentity as fe, zoomTransform as pe } from "d3-zoom";
|
|
6
|
+
import { select as M } from "d3-selection";
|
|
7
7
|
import "d3-transition";
|
|
8
|
-
import { feature as
|
|
8
|
+
import { feature as me, merge as he, mesh as ge } from "topojson-client";
|
|
9
9
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var _e = ["aria-label"], ve = /* @__PURE__ */ l({
|
|
11
11
|
__name: "ChartMenu",
|
|
12
12
|
props: {
|
|
13
13
|
items: {},
|
|
@@ -104,44 +104,44 @@ var P = ["aria-label"], ge = /* @__PURE__ */ l({
|
|
|
104
104
|
"stroke-linecap": "round",
|
|
105
105
|
"stroke-linejoin": "round",
|
|
106
106
|
"aria-hidden": "true"
|
|
107
|
-
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8,
|
|
107
|
+
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, _e))], 2));
|
|
108
108
|
}
|
|
109
|
-
}),
|
|
109
|
+
}), N = (e, t) => {
|
|
110
110
|
let n = e.__vccOpts || e;
|
|
111
111
|
for (let [e, r] of t) n[e] = r;
|
|
112
112
|
return n;
|
|
113
|
-
},
|
|
113
|
+
}, ye = /* @__PURE__ */ N(ve, [["__scopeId", "data-v-f5743494"]]);
|
|
114
114
|
//#endregion
|
|
115
115
|
//#region src/_shared/axes.ts
|
|
116
|
-
function
|
|
116
|
+
function P(e) {
|
|
117
117
|
return Math.round(e) + .5;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function be(e, t) {
|
|
120
120
|
let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
|
|
121
121
|
return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function xe(e, t, n) {
|
|
124
124
|
if (!(n > 0) || !isFinite(n)) return [];
|
|
125
125
|
let r = [], i = Math.ceil(e / n) * n;
|
|
126
126
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
127
127
|
return r;
|
|
128
128
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
return Math.abs(e) >= 1e3 ?
|
|
129
|
+
var Se = new Intl.NumberFormat();
|
|
130
|
+
function Ce(e) {
|
|
131
|
+
return Math.abs(e) >= 1e3 ? Se.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/_shared/computeTicks.ts
|
|
135
|
-
function
|
|
135
|
+
function F(e) {
|
|
136
136
|
let { min: t, max: n, ticks: r } = e;
|
|
137
137
|
if (t === n) return [];
|
|
138
138
|
let i = e.displayOffset ?? 0;
|
|
139
139
|
if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
|
|
140
|
-
if (typeof r == "number") return
|
|
141
|
-
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o =
|
|
142
|
-
return
|
|
140
|
+
if (typeof r == "number") return xe(t + i, n + i, r).map((e) => e - i);
|
|
141
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = be(n - t, a);
|
|
142
|
+
return xe(t + i, n + i, o).map((e) => e - i);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function we(e, t, n, r) {
|
|
145
145
|
if (r === "log") {
|
|
146
146
|
let r = Math.log10(t), i = Math.log10(n) - r || 1;
|
|
147
147
|
return (Math.log10(e > 0 ? e : t) - r) / i;
|
|
@@ -149,7 +149,7 @@ function R(e, t, n, r) {
|
|
|
149
149
|
let i = n - t || 1;
|
|
150
150
|
return (e - t) / i;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function Te(e, t, n, r) {
|
|
153
153
|
if (n !== "log") return {
|
|
154
154
|
min: e,
|
|
155
155
|
max: t
|
|
@@ -160,7 +160,7 @@ function Se(e, t, n, r) {
|
|
|
160
160
|
max: t > 0 ? Math.max(t, i) : i
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function I(e) {
|
|
164
164
|
let { min: t, max: n, ticks: r } = e;
|
|
165
165
|
if (!(t > 0) || !(n > 0) || t === n) return [];
|
|
166
166
|
if (Array.isArray(r)) return r.filter((e) => e > 0 && e >= t && e <= n);
|
|
@@ -173,7 +173,7 @@ function Ce(e) {
|
|
|
173
173
|
}
|
|
174
174
|
//#endregion
|
|
175
175
|
//#region src/_shared/useChartSize.ts
|
|
176
|
-
function
|
|
176
|
+
function Ee(e = {}) {
|
|
177
177
|
let t = v(null), n = v(0), r = v(0), i = null, a = null;
|
|
178
178
|
return g(() => {
|
|
179
179
|
t.value && (n.value = t.value.clientWidth, r.value = t.value.clientHeight, i = new ResizeObserver((t) => {
|
|
@@ -192,8 +192,8 @@ function we(e = {}) {
|
|
|
192
192
|
measuredHeight: r
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
var
|
|
196
|
-
function
|
|
195
|
+
var De = .6, Oe = 8;
|
|
196
|
+
function ke(e, t) {
|
|
197
197
|
return {
|
|
198
198
|
fontSize: e?.fontSize ?? t.fontSize,
|
|
199
199
|
fill: e?.color ?? "currentColor",
|
|
@@ -201,8 +201,8 @@ function Ee(e, t) {
|
|
|
201
201
|
fillOpacity: e?.color == null ? t.fillOpacity : void 0
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
var
|
|
205
|
-
function
|
|
204
|
+
var L = 7, Ae = 18, je = 16;
|
|
205
|
+
function Me(e) {
|
|
206
206
|
return e == null ? {
|
|
207
207
|
top: 0,
|
|
208
208
|
right: 0,
|
|
@@ -220,12 +220,12 @@ function Ae(e) {
|
|
|
220
220
|
left: e.left ?? 0
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
return
|
|
223
|
+
function Ne(e) {
|
|
224
|
+
return Ae + e.length * L;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function Pe(e) {
|
|
227
227
|
let t = n(() => {
|
|
228
|
-
let t =
|
|
228
|
+
let t = Me(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 Me(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 = Ne(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 + je;
|
|
246
246
|
}
|
|
247
247
|
return {
|
|
248
248
|
positions: i,
|
|
@@ -252,9 +252,9 @@ function Me(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 + Oe;
|
|
256
256
|
}), o = n(() => {
|
|
257
|
-
let n =
|
|
257
|
+
let n = Me(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 Me(e) {
|
|
|
283
283
|
}
|
|
284
284
|
//#endregion
|
|
285
285
|
//#region src/tooltip-position.ts
|
|
286
|
-
var
|
|
287
|
-
function
|
|
286
|
+
var Fe = 16, R = 8;
|
|
287
|
+
function z(e, t, n, r, i, a) {
|
|
288
288
|
if (i === "none") return {
|
|
289
|
-
left: e +
|
|
289
|
+
left: e + Fe,
|
|
290
290
|
top: t
|
|
291
291
|
};
|
|
292
292
|
let o = i === "chart" && a ? {
|
|
@@ -299,15 +299,15 @@ function B(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 + Fe + n > o.right - R ? e - Fe - n : e + Fe, c = Math.max(o.left + R, o.right - R - n), l = Math.min(Math.max(s, o.left + R), c), u = r / 2;
|
|
303
303
|
return {
|
|
304
|
-
left:
|
|
305
|
-
top: Math.min(Math.max(t, o.top +
|
|
304
|
+
left: l,
|
|
305
|
+
top: Math.min(Math.max(t, o.top + R + u), o.bottom - R - u)
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
//#endregion
|
|
309
309
|
//#region src/_shared/useChartTooltip.ts
|
|
310
|
-
function
|
|
310
|
+
function Ie(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 Fe(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?.() ?? "
|
|
331
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "window", { left: f, top: p } = z(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,98 +395,98 @@ function Fe(e) {
|
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/ChartMenu/download.ts
|
|
398
|
-
function
|
|
398
|
+
function Le(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 B = [
|
|
403
403
|
"color",
|
|
404
404
|
"font-family",
|
|
405
405
|
"font-size",
|
|
406
406
|
"font-weight"
|
|
407
|
-
],
|
|
408
|
-
function
|
|
407
|
+
], V = ["fill", "stroke"];
|
|
408
|
+
function H(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 U(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 B) {
|
|
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 V) {
|
|
425
425
|
let n = e.getAttribute(t);
|
|
426
|
-
!n || !n.includes("var(") || e.setAttribute(t,
|
|
426
|
+
!n || !n.includes("var(") || e.setAttribute(t, H(n));
|
|
427
427
|
}
|
|
428
428
|
return t;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
let n =
|
|
432
|
-
|
|
430
|
+
function W(e, t) {
|
|
431
|
+
let n = U(e), r = new XMLSerializer().serializeToString(n);
|
|
432
|
+
Le(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
let n =
|
|
434
|
+
function Re(e, t) {
|
|
435
|
+
let n = U(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 && Le(e, `${t}.png`);
|
|
442
442
|
}), URL.revokeObjectURL(a);
|
|
443
443
|
}, o.src = a;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function ze(e, t) {
|
|
446
446
|
e.toBlob((e) => {
|
|
447
|
-
e &&
|
|
447
|
+
e && Le(e, `${t}.png`);
|
|
448
448
|
}, "image/png");
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
|
|
450
|
+
function Be(e, t) {
|
|
451
|
+
Le(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
452
452
|
}
|
|
453
453
|
//#endregion
|
|
454
454
|
//#region src/_shared/touch.ts
|
|
455
|
-
function
|
|
455
|
+
function G() {
|
|
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 Ve = 0, He = "";
|
|
461
|
+
function K() {
|
|
462
|
+
typeof document > "u" || (Ve === 0 && (He = document.body.style.overflow, document.body.style.overflow = "hidden"), Ve++);
|
|
463
463
|
}
|
|
464
464
|
function Ue() {
|
|
465
|
-
typeof document > "u" ||
|
|
465
|
+
typeof document > "u" || Ve !== 0 && (Ve--, Ve === 0 && (document.body.style.overflow = He));
|
|
466
466
|
}
|
|
467
|
-
var
|
|
468
|
-
function
|
|
467
|
+
var We = 0, Ge = null;
|
|
468
|
+
function Ke() {
|
|
469
469
|
return document.querySelector("meta[name=\"viewport\"]");
|
|
470
470
|
}
|
|
471
|
-
function
|
|
472
|
-
if (typeof document > "u" || !
|
|
473
|
-
let e =
|
|
471
|
+
function qe() {
|
|
472
|
+
if (typeof document > "u" || !G()) return;
|
|
473
|
+
let e = Ke();
|
|
474
474
|
if (e) {
|
|
475
|
-
if (
|
|
476
|
-
|
|
477
|
-
let t =
|
|
475
|
+
if (We === 0) {
|
|
476
|
+
Ge = e.getAttribute("content");
|
|
477
|
+
let t = Ge || "width=device-width, initial-scale=1";
|
|
478
478
|
e.setAttribute("content", `${t}, maximum-scale=1`);
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
We++;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
if (!(typeof document > "u") &&
|
|
485
|
-
let e =
|
|
486
|
-
e &&
|
|
483
|
+
function q() {
|
|
484
|
+
if (!(typeof document > "u") && We !== 0 && (We--, We === 0)) {
|
|
485
|
+
let e = Ke();
|
|
486
|
+
e && Ge != null && e.setAttribute("content", Ge), Ge = null;
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function J(e = {}) {
|
|
490
490
|
let t = v(!1), r = !1, i = v(null);
|
|
491
491
|
function a() {
|
|
492
492
|
let e = typeof window < "u" ? window.visualViewport : null;
|
|
@@ -502,7 +502,7 @@ function Y(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 ? (K(), 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;
|
|
@@ -521,7 +521,7 @@ function Y(e = {}) {
|
|
|
521
521
|
return g(() => {
|
|
522
522
|
typeof document > "u" || document.addEventListener("keydown", c);
|
|
523
523
|
}), ee(() => {
|
|
524
|
-
typeof document > "u" || (document.removeEventListener("keydown", c), r &&= (Ue(),
|
|
524
|
+
typeof document > "u" || (document.removeEventListener("keydown", c), r &&= (Ue(), q(), o(!1), !1));
|
|
525
525
|
}), {
|
|
526
526
|
isFullscreen: t,
|
|
527
527
|
toggle: d,
|
|
@@ -538,7 +538,7 @@ function Y(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: G() ? "0" : "2em",
|
|
542
542
|
"box-sizing": "border-box",
|
|
543
543
|
display: "flex",
|
|
544
544
|
"flex-direction": "column",
|
|
@@ -549,7 +549,7 @@ function Y(e = {}) {
|
|
|
549
549
|
}
|
|
550
550
|
//#endregion
|
|
551
551
|
//#region src/_shared/useChartMenu.ts
|
|
552
|
-
function
|
|
552
|
+
function Je(e) {
|
|
553
553
|
let t = v(null);
|
|
554
554
|
function r() {
|
|
555
555
|
let t = e.filename();
|
|
@@ -557,23 +557,23 @@ function qe(e) {
|
|
|
557
557
|
let n = e.legacyMenuLabel();
|
|
558
558
|
return typeof n == "string" ? n : "chart";
|
|
559
559
|
}
|
|
560
|
-
let i = e.fullscreen ?
|
|
560
|
+
let i = e.fullscreen ? J({ target: e.fullscreenTarget }) : null, a = n(() => {
|
|
561
561
|
let n = r(), a = [];
|
|
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 && W(t.value, n);
|
|
566
566
|
}
|
|
567
567
|
}, {
|
|
568
568
|
label: "Save as PNG",
|
|
569
569
|
action: () => {
|
|
570
|
-
t.value &&
|
|
570
|
+
t.value && Re(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: () => Be(e.getCsv(), n)
|
|
577
577
|
}), a;
|
|
578
578
|
}), o = n(() => {
|
|
579
579
|
if (e.downloadButton?.()) return null;
|
|
@@ -584,7 +584,7 @@ function qe(e) {
|
|
|
584
584
|
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
585
585
|
});
|
|
586
586
|
function l() {
|
|
587
|
-
|
|
587
|
+
Be(e.getCsv(), r());
|
|
588
588
|
}
|
|
589
589
|
return {
|
|
590
590
|
svgRef: t,
|
|
@@ -602,7 +602,7 @@ function qe(e) {
|
|
|
602
602
|
}
|
|
603
603
|
//#endregion
|
|
604
604
|
//#region src/_shared/ChartZoomControls.vue?vue&type=script&setup=true&lang.ts
|
|
605
|
-
var
|
|
605
|
+
var Ye = ["disabled"], Y = ["disabled"], Xe = ["disabled"], Ze = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
606
606
|
__name: "ChartZoomControls",
|
|
607
607
|
props: {
|
|
608
608
|
canZoomIn: {
|
|
@@ -645,7 +645,7 @@ var Je = ["disabled"], X = ["disabled"], Ye = ["disabled"], Xe = /* @__PURE__ */
|
|
|
645
645
|
"stroke-width": "1.5",
|
|
646
646
|
"stroke-linecap": "round",
|
|
647
647
|
"aria-hidden": "true"
|
|
648
|
-
}, [o("path", { d: "M7 2v10M2 7h10" })], -1)]], 8,
|
|
648
|
+
}, [o("path", { d: "M7 2v10M2 7h10" })], -1)]], 8, Ye),
|
|
649
649
|
o("button", {
|
|
650
650
|
type: "button",
|
|
651
651
|
class: "chart-zoom-button",
|
|
@@ -661,7 +661,7 @@ var Je = ["disabled"], X = ["disabled"], Ye = ["disabled"], Xe = /* @__PURE__ */
|
|
|
661
661
|
"stroke-width": "1.5",
|
|
662
662
|
"stroke-linecap": "round",
|
|
663
663
|
"aria-hidden": "true"
|
|
664
|
-
}, [o("path", { d: "M2 7h10" })], -1)]], 8,
|
|
664
|
+
}, [o("path", { d: "M2 7h10" })], -1)]], 8, Y),
|
|
665
665
|
o("button", {
|
|
666
666
|
type: "button",
|
|
667
667
|
class: "chart-zoom-button",
|
|
@@ -678,13 +678,13 @@ var Je = ["disabled"], X = ["disabled"], Ye = ["disabled"], Xe = /* @__PURE__ */
|
|
|
678
678
|
"stroke-linecap": "round",
|
|
679
679
|
"stroke-linejoin": "round",
|
|
680
680
|
"aria-hidden": "true"
|
|
681
|
-
}, [o("path", { d: "M1.75 7a5.25 5.25 0 1 0 5.25-5.25c-1.48 0-2.9.6-3.94 1.6L1.75 4.7" }), o("path", { d: "M1.75 1.75v2.95h2.95" })], -1)]], 8,
|
|
681
|
+
}, [o("path", { d: "M1.75 7a5.25 5.25 0 1 0 5.25-5.25c-1.48 0-2.9.6-3.94 1.6L1.75 4.7" }), o("path", { d: "M1.75 1.75v2.95h2.95" })], -1)]], 8, Xe)
|
|
682
682
|
], 2));
|
|
683
683
|
}
|
|
684
684
|
}), [["__scopeId", "data-v-87ceeada"]]);
|
|
685
685
|
//#endregion
|
|
686
686
|
//#region src/_shared/seriesCsv.ts
|
|
687
|
-
function
|
|
687
|
+
function Qe(e) {
|
|
688
688
|
if (e.length === 0) return "";
|
|
689
689
|
let t = 0;
|
|
690
690
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -696,43 +696,43 @@ function Ze(e) {
|
|
|
696
696
|
}
|
|
697
697
|
return i.join("\n");
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function $e(e, t, n = "category") {
|
|
700
700
|
if (t.length === 0 || e.length === 0) return "";
|
|
701
701
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
702
702
|
for (let n = 0; n < e.length; n++) {
|
|
703
|
-
let i = [
|
|
703
|
+
let i = [et(e[n])];
|
|
704
704
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
705
705
|
r.push(i.join(","));
|
|
706
706
|
}
|
|
707
707
|
return r.join("\n");
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function et(e) {
|
|
710
710
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
711
711
|
}
|
|
712
712
|
//#endregion
|
|
713
713
|
//#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
|
|
714
|
-
var
|
|
714
|
+
var tt = {
|
|
715
715
|
class: "chart-annotations",
|
|
716
716
|
"pointer-events": "none"
|
|
717
|
-
},
|
|
717
|
+
}, nt = ["stroke", "stroke-width"], rt = [
|
|
718
718
|
"d",
|
|
719
719
|
"stroke",
|
|
720
720
|
"stroke-width"
|
|
721
|
-
],
|
|
721
|
+
], it = [
|
|
722
722
|
"fill",
|
|
723
723
|
"stroke",
|
|
724
724
|
"stroke-width",
|
|
725
725
|
"transform"
|
|
726
|
-
],
|
|
726
|
+
], at = [
|
|
727
727
|
"stroke",
|
|
728
728
|
"stroke-width",
|
|
729
729
|
"stroke-dasharray"
|
|
730
|
-
],
|
|
730
|
+
], ot = [
|
|
731
731
|
"d",
|
|
732
732
|
"stroke",
|
|
733
733
|
"stroke-width",
|
|
734
734
|
"stroke-dasharray"
|
|
735
|
-
],
|
|
735
|
+
], st = ["fill", "transform"], ct = [
|
|
736
736
|
"x",
|
|
737
737
|
"y",
|
|
738
738
|
"text-anchor",
|
|
@@ -741,7 +741,7 @@ var et = {
|
|
|
741
741
|
"fill",
|
|
742
742
|
"stroke",
|
|
743
743
|
"stroke-width"
|
|
744
|
-
],
|
|
744
|
+
], lt = ["x", "dy"], ut = ["font-weight", "font-style"], dt = 13, ft = "normal", pt = 700, mt = "var(--color-bg-0, #fff)", ht = 3, gt = 1, _t = 4, vt = 6, yt = 1.2, bt = .35, xt = /* @__PURE__ */ l({
|
|
745
745
|
__name: "ChartAnnotations",
|
|
746
746
|
props: {
|
|
747
747
|
annotations: { default: () => [] },
|
|
@@ -778,7 +778,7 @@ var et = {
|
|
|
778
778
|
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
779
779
|
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
780
780
|
if (a && !r.bounds) continue;
|
|
781
|
-
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ??
|
|
781
|
+
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? dt, g = t.fontWeight ?? ft, ee = t.outlineColor ?? mt, _ = t.outlineWidth ?? ht, v = t.lineColor ?? m, y = t.lineWidth ?? gt, te = s(t.lineDash), b = {
|
|
782
782
|
left: "start",
|
|
783
783
|
center: "middle",
|
|
784
784
|
right: "end"
|
|
@@ -793,7 +793,7 @@ var et = {
|
|
|
793
793
|
textX: d,
|
|
794
794
|
textY: p,
|
|
795
795
|
textAnchor: b,
|
|
796
|
-
dy: h *
|
|
796
|
+
dy: h * yt,
|
|
797
797
|
fontSize: h,
|
|
798
798
|
fontWeight: g,
|
|
799
799
|
color: m,
|
|
@@ -859,11 +859,11 @@ var et = {
|
|
|
859
859
|
}
|
|
860
860
|
function f(e, t, n, r, i, a, o) {
|
|
861
861
|
if (o === "none") return { path: "" };
|
|
862
|
-
let s = n - e, c = r - t, l = i *
|
|
862
|
+
let s = n - e, c = r - t, l = i * yt, u = (c < 0 ? r + (a - 1) * l : r) - i * bt;
|
|
863
863
|
if (s === 0 || c === 0 || o === "straight") {
|
|
864
864
|
let i = c === 0 ? r : u, a = n - e, o = i - t, s = Math.hypot(a, o);
|
|
865
865
|
if (s <= 10) return { path: "" };
|
|
866
|
-
let l = a / s, d = o / s, f = e + l *
|
|
866
|
+
let l = a / s, d = o / s, f = e + l * _t, p = t + d * _t, m = n - l * vt, h = i - d * vt, g = Math.atan2(-d, -l) * 180 / Math.PI;
|
|
867
867
|
return {
|
|
868
868
|
path: `M${f},${p} L${m},${h}`,
|
|
869
869
|
arrow: {
|
|
@@ -874,8 +874,8 @@ var et = {
|
|
|
874
874
|
};
|
|
875
875
|
}
|
|
876
876
|
let d = u - t;
|
|
877
|
-
if (Math.abs(d) <=
|
|
878
|
-
let f = Math.sign(s), p = Math.sign(d), m = e, h = t + p *
|
|
877
|
+
if (Math.abs(d) <= _t || Math.abs(s) <= vt) return { path: "" };
|
|
878
|
+
let f = Math.sign(s), p = Math.sign(d), m = e, h = t + p * _t, g = n - f * vt, ee = u, _ = p > 0 ? -90 : 90;
|
|
879
879
|
return {
|
|
880
880
|
path: `M${m},${h} Q${m},${u} ${g},${ee}`,
|
|
881
881
|
arrow: {
|
|
@@ -885,7 +885,7 @@ var et = {
|
|
|
885
885
|
}
|
|
886
886
|
};
|
|
887
887
|
}
|
|
888
|
-
return (t, n) => (_(), a("g",
|
|
888
|
+
return (t, n) => (_(), a("g", tt, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
889
889
|
t.rule && t.outlineWidth > 0 ? (_(), a("line", d({
|
|
890
890
|
key: 0,
|
|
891
891
|
ref_for: !0
|
|
@@ -894,7 +894,7 @@ var et = {
|
|
|
894
894
|
stroke: t.outlineColor,
|
|
895
895
|
"stroke-width": t.lineWidth + t.outlineWidth,
|
|
896
896
|
"stroke-linecap": "round"
|
|
897
|
-
}), null, 16,
|
|
897
|
+
}), null, 16, nt)) : i("", !0),
|
|
898
898
|
t.pointerPath && t.outlineWidth > 0 ? (_(), a("path", {
|
|
899
899
|
key: 1,
|
|
900
900
|
d: t.pointerPath,
|
|
@@ -903,7 +903,7 @@ var et = {
|
|
|
903
903
|
stroke: t.outlineColor,
|
|
904
904
|
"stroke-width": t.lineWidth + t.outlineWidth,
|
|
905
905
|
"stroke-linecap": "round"
|
|
906
|
-
}, null, 8,
|
|
906
|
+
}, null, 8, rt)) : i("", !0),
|
|
907
907
|
t.arrowTip && t.outlineWidth > 0 ? (_(), a("polygon", {
|
|
908
908
|
key: 2,
|
|
909
909
|
points: "0,0 -6,-3 -6,3",
|
|
@@ -913,7 +913,7 @@ var et = {
|
|
|
913
913
|
"stroke-width": t.outlineWidth,
|
|
914
914
|
"stroke-linejoin": "round",
|
|
915
915
|
transform: t.arrowTransform
|
|
916
|
-
}, null, 8,
|
|
916
|
+
}, null, 8, it)) : i("", !0),
|
|
917
917
|
t.rule ? (_(), a("line", d({
|
|
918
918
|
key: 3,
|
|
919
919
|
ref_for: !0
|
|
@@ -922,7 +922,7 @@ var et = {
|
|
|
922
922
|
"stroke-width": t.lineWidth,
|
|
923
923
|
"stroke-dasharray": t.lineDash,
|
|
924
924
|
"stroke-linecap": "round"
|
|
925
|
-
}), null, 16,
|
|
925
|
+
}), null, 16, at)) : i("", !0),
|
|
926
926
|
t.pointerPath ? (_(), a("path", {
|
|
927
927
|
key: 4,
|
|
928
928
|
d: t.pointerPath,
|
|
@@ -931,13 +931,13 @@ var et = {
|
|
|
931
931
|
"stroke-width": t.lineWidth,
|
|
932
932
|
"stroke-dasharray": t.lineDash,
|
|
933
933
|
"stroke-linecap": "round"
|
|
934
|
-
}, null, 8,
|
|
934
|
+
}, null, 8, ot)) : i("", !0),
|
|
935
935
|
t.arrowTip ? (_(), a("polygon", {
|
|
936
936
|
key: 5,
|
|
937
937
|
points: "0,0 -6,-3 -6,3",
|
|
938
938
|
fill: t.lineColor,
|
|
939
939
|
transform: t.arrowTransform
|
|
940
|
-
}, null, 8,
|
|
940
|
+
}, null, 8, st)) : i("", !0),
|
|
941
941
|
o("text", {
|
|
942
942
|
x: t.textX,
|
|
943
943
|
y: t.textY,
|
|
@@ -955,14 +955,14 @@ var et = {
|
|
|
955
955
|
dy: r === 0 ? 0 : t.dy
|
|
956
956
|
}, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
|
|
957
957
|
key: t,
|
|
958
|
-
"font-weight": e.bold ?
|
|
958
|
+
"font-weight": e.bold ? pt : void 0,
|
|
959
959
|
"font-style": e.italic ? "italic" : void 0
|
|
960
|
-
}, b(e.text), 9,
|
|
960
|
+
}, b(e.text), 9, ut))), 128))], 8, lt))), 128))], 8, ct)
|
|
961
961
|
], 64))), 128))]));
|
|
962
962
|
}
|
|
963
|
-
}),
|
|
964
|
-
function
|
|
965
|
-
let { containerRef: t, measuredWidth: r, measuredHeight: i } =
|
|
963
|
+
}), St = 400, Ct = 200;
|
|
964
|
+
function wt(e) {
|
|
965
|
+
let { containerRef: t, measuredWidth: r, measuredHeight: i } = Ee({ debounce: e.debounce }), { svgRef: a, items: o, downloadLinkText: s, csvHref: c, downloadButtonText: l, triggerCsvDownload: u, resolvedFilename: d, isFullscreen: f, fullscreenStyle: p, teleportTarget: m, exitFullscreen: h } = Je({
|
|
966
966
|
filename: e.filename,
|
|
967
967
|
legacyMenuLabel: e.menu,
|
|
968
968
|
getCsv: e.getCsv,
|
|
@@ -970,13 +970,13 @@ function St(e) {
|
|
|
970
970
|
downloadButton: e.downloadButton,
|
|
971
971
|
fullscreen: !0,
|
|
972
972
|
fullscreenTarget: e.fullscreenTarget
|
|
973
|
-
}), g = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value ||
|
|
973
|
+
}), g = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value || St)), ee = n(() => {
|
|
974
974
|
if (f.value && i.value > 0) {
|
|
975
975
|
let t = e.extraBelowHeight?.() ?? 0;
|
|
976
976
|
return i.value - t;
|
|
977
977
|
}
|
|
978
|
-
return e.height() ??
|
|
979
|
-
}), { padding: _, legendY: v, inlineLegendLayout: y, innerW: te, innerH: b, bounds: ne } =
|
|
978
|
+
return e.height() ?? Ct;
|
|
979
|
+
}), { padding: _, legendY: v, inlineLegendLayout: y, innerW: te, innerH: b, bounds: ne } = Pe({
|
|
980
980
|
title: e.title,
|
|
981
981
|
titleStyle: e.titleStyle,
|
|
982
982
|
xLabel: e.xLabel,
|
|
@@ -985,10 +985,10 @@ function St(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 } = Ie({
|
|
989
989
|
enabled: e.hasTooltipSlot,
|
|
990
990
|
trigger: e.tooltipTrigger,
|
|
991
|
-
clamp: () => e.tooltipClamp() ?? "
|
|
991
|
+
clamp: () => e.tooltipClamp() ?? "window",
|
|
992
992
|
pointerToIndex: e.pointerToIndex,
|
|
993
993
|
containerRef: t,
|
|
994
994
|
scrubAxis: e.scrubAxis,
|
|
@@ -1021,17 +1021,17 @@ function St(e) {
|
|
|
1021
1021
|
exitFullscreen: h
|
|
1022
1022
|
};
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function Tt(e, t) {
|
|
1025
1025
|
return (n) => {
|
|
1026
1026
|
let r = e();
|
|
1027
1027
|
if (r !== void 0) return ae(n, r);
|
|
1028
1028
|
let i = t();
|
|
1029
|
-
return i === void 0 ?
|
|
1029
|
+
return i === void 0 ? Ce(n) : ae(n, i);
|
|
1030
1030
|
};
|
|
1031
1031
|
}
|
|
1032
1032
|
//#endregion
|
|
1033
1033
|
//#region src/_shared/contrast.ts
|
|
1034
|
-
function
|
|
1034
|
+
function Et(e) {
|
|
1035
1035
|
let t = e.trim();
|
|
1036
1036
|
if (t.startsWith("#")) {
|
|
1037
1037
|
let e = t.slice(1);
|
|
@@ -1058,89 +1058,89 @@ function wt(e) {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
return null;
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function Dt([e, t, n]) {
|
|
1062
1062
|
let r = (e) => {
|
|
1063
1063
|
let t = e / 255;
|
|
1064
1064
|
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
1065
1065
|
};
|
|
1066
1066
|
return .2126 * r(e) + .7152 * r(t) + .0722 * r(n);
|
|
1067
1067
|
}
|
|
1068
|
-
var
|
|
1069
|
-
function
|
|
1070
|
-
let t =
|
|
1068
|
+
var Ot = null, kt = /* @__PURE__ */ new Map();
|
|
1069
|
+
function At(e) {
|
|
1070
|
+
let t = Et(e);
|
|
1071
1071
|
if (t) return t;
|
|
1072
|
-
if (
|
|
1072
|
+
if (kt.has(e)) return kt.get(e) ?? null;
|
|
1073
1073
|
if (typeof document > "u") return null;
|
|
1074
|
-
|
|
1075
|
-
let n = getComputedStyle(
|
|
1076
|
-
return
|
|
1074
|
+
Ot || (Ot = document.createElement("span"), Ot.style.cssText = "position:absolute;width:0;height:0;visibility:hidden;pointer-events:none", document.body.appendChild(Ot)), Ot.style.color = "", Ot.style.color = e;
|
|
1075
|
+
let n = getComputedStyle(Ot).color, r = Et(n);
|
|
1076
|
+
return kt.set(e, r), r;
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1079
|
-
let r =
|
|
1080
|
-
return r &&
|
|
1078
|
+
function jt(e, t = "#ffffff", n = "#1a1a1a") {
|
|
1079
|
+
let r = At(e);
|
|
1080
|
+
return r && Dt(r) > .179 ? n : t;
|
|
1081
1081
|
}
|
|
1082
1082
|
//#endregion
|
|
1083
1083
|
//#region src/_shared/dateAxis.ts
|
|
1084
|
-
var
|
|
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, X = 60 * Pt, Z = 60 * X, Ft = 24 * Z, It = 7 * Ft, Lt = 30 * Ft, Rt = 365 * Ft, zt = [
|
|
1085
1085
|
{
|
|
1086
1086
|
unit: "second",
|
|
1087
1087
|
step: 1,
|
|
1088
|
-
ms: 1 *
|
|
1088
|
+
ms: 1 * Pt
|
|
1089
1089
|
},
|
|
1090
1090
|
{
|
|
1091
1091
|
unit: "second",
|
|
1092
1092
|
step: 5,
|
|
1093
|
-
ms: 5 *
|
|
1093
|
+
ms: 5 * Pt
|
|
1094
1094
|
},
|
|
1095
1095
|
{
|
|
1096
1096
|
unit: "second",
|
|
1097
1097
|
step: 15,
|
|
1098
|
-
ms: 15 *
|
|
1098
|
+
ms: 15 * Pt
|
|
1099
1099
|
},
|
|
1100
1100
|
{
|
|
1101
1101
|
unit: "second",
|
|
1102
1102
|
step: 30,
|
|
1103
|
-
ms: 30 *
|
|
1103
|
+
ms: 30 * Pt
|
|
1104
1104
|
},
|
|
1105
1105
|
{
|
|
1106
1106
|
unit: "minute",
|
|
1107
1107
|
step: 1,
|
|
1108
|
-
ms: 1 *
|
|
1108
|
+
ms: 1 * X
|
|
1109
1109
|
},
|
|
1110
1110
|
{
|
|
1111
1111
|
unit: "minute",
|
|
1112
1112
|
step: 5,
|
|
1113
|
-
ms: 5 *
|
|
1113
|
+
ms: 5 * X
|
|
1114
1114
|
},
|
|
1115
1115
|
{
|
|
1116
1116
|
unit: "minute",
|
|
1117
1117
|
step: 15,
|
|
1118
|
-
ms: 15 *
|
|
1118
|
+
ms: 15 * X
|
|
1119
1119
|
},
|
|
1120
1120
|
{
|
|
1121
1121
|
unit: "minute",
|
|
1122
1122
|
step: 30,
|
|
1123
|
-
ms: 30 *
|
|
1123
|
+
ms: 30 * X
|
|
1124
1124
|
},
|
|
1125
1125
|
{
|
|
1126
1126
|
unit: "hour",
|
|
1127
1127
|
step: 1,
|
|
1128
|
-
ms: 1 *
|
|
1128
|
+
ms: 1 * Z
|
|
1129
1129
|
},
|
|
1130
1130
|
{
|
|
1131
1131
|
unit: "hour",
|
|
1132
1132
|
step: 3,
|
|
1133
|
-
ms: 3 *
|
|
1133
|
+
ms: 3 * Z
|
|
1134
1134
|
},
|
|
1135
1135
|
{
|
|
1136
1136
|
unit: "hour",
|
|
1137
1137
|
step: 6,
|
|
1138
|
-
ms: 6 *
|
|
1138
|
+
ms: 6 * Z
|
|
1139
1139
|
},
|
|
1140
1140
|
{
|
|
1141
1141
|
unit: "hour",
|
|
1142
1142
|
step: 12,
|
|
1143
|
-
ms: 12 *
|
|
1143
|
+
ms: 12 * Z
|
|
1144
1144
|
},
|
|
1145
1145
|
{
|
|
1146
1146
|
unit: "day",
|
|
@@ -1214,17 +1214,17 @@ function Vt(e, t) {
|
|
|
1214
1214
|
return Number.isFinite(t) ? t : null;
|
|
1215
1215
|
}
|
|
1216
1216
|
if (typeof e != "string") return null;
|
|
1217
|
-
let n =
|
|
1217
|
+
let n = Mt.exec(e);
|
|
1218
1218
|
if (n) {
|
|
1219
1219
|
let e = +n[1], r = n[2] - 1, i = +n[3];
|
|
1220
1220
|
return t === "utc" ? Date.UTC(e, r, i) : new Date(e, r, i).getTime();
|
|
1221
1221
|
}
|
|
1222
|
-
let r =
|
|
1222
|
+
let r = Nt.exec(e);
|
|
1223
1223
|
if (r) {
|
|
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) * X;
|
|
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();
|
|
@@ -1232,7 +1232,7 @@ function Vt(e, t) {
|
|
|
1232
1232
|
return null;
|
|
1233
1233
|
}
|
|
1234
1234
|
function Ht(e) {
|
|
1235
|
-
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ?
|
|
1235
|
+
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? Mt.test(e) || Nt.test(e) : !1;
|
|
1236
1236
|
}
|
|
1237
1237
|
function Ut(e, t) {
|
|
1238
1238
|
if (e.length === 0) return !1;
|
|
@@ -1250,9 +1250,9 @@ function Wt(e, t) {
|
|
|
1250
1250
|
function Gt(e, t, n) {
|
|
1251
1251
|
let r = new Date(e);
|
|
1252
1252
|
if (n === "utc") switch (t) {
|
|
1253
|
-
case "second": return Math.floor(e /
|
|
1254
|
-
case "minute": return Math.floor(e /
|
|
1255
|
-
case "hour": return Math.floor(e /
|
|
1253
|
+
case "second": return Math.floor(e / Pt) * Pt;
|
|
1254
|
+
case "minute": return Math.floor(e / X) * X;
|
|
1255
|
+
case "hour": return Math.floor(e / Z) * Z;
|
|
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;
|
|
@@ -1262,8 +1262,8 @@ function Gt(e, t, n) {
|
|
|
1262
1262
|
case "year": return Date.UTC(r.getUTCFullYear(), 0, 1);
|
|
1263
1263
|
}
|
|
1264
1264
|
switch (t) {
|
|
1265
|
-
case "second": return Math.floor(e /
|
|
1266
|
-
case "minute": return Math.floor(e /
|
|
1265
|
+
case "second": return Math.floor(e / Pt) * Pt;
|
|
1266
|
+
case "minute": return Math.floor(e / X) * X;
|
|
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": {
|
|
@@ -1275,9 +1275,9 @@ function Gt(e, t, n) {
|
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
1277
|
function Kt(e, t, n, r) {
|
|
1278
|
-
if (t === "second") return e + n *
|
|
1279
|
-
if (t === "minute") return e + n *
|
|
1280
|
-
if (t === "hour" && r === "utc") return e + n *
|
|
1278
|
+
if (t === "second") return e + n * Pt;
|
|
1279
|
+
if (t === "minute") return e + n * X;
|
|
1280
|
+
if (t === "hour" && r === "utc") return e + n * Z;
|
|
1281
1281
|
if (t === "week" && r === "utc") return e + n * It;
|
|
1282
1282
|
let i = new Date(e);
|
|
1283
1283
|
if (r === "utc") switch (t) {
|
|
@@ -1410,22 +1410,23 @@ var en = {
|
|
|
1410
1410
|
"stroke",
|
|
1411
1411
|
"stroke-dasharray"
|
|
1412
1412
|
], sn = [
|
|
1413
|
+
"x",
|
|
1414
|
+
"y",
|
|
1415
|
+
"fill",
|
|
1416
|
+
"fill-opacity",
|
|
1417
|
+
"stroke"
|
|
1418
|
+
], cn = [
|
|
1413
1419
|
"cx",
|
|
1414
1420
|
"cy",
|
|
1415
1421
|
"fill",
|
|
1416
1422
|
"fill-opacity",
|
|
1417
1423
|
"stroke"
|
|
1418
|
-
],
|
|
1424
|
+
], ln = [
|
|
1419
1425
|
"x",
|
|
1420
1426
|
"y",
|
|
1421
1427
|
"font-size",
|
|
1422
1428
|
"fill",
|
|
1423
1429
|
"font-weight"
|
|
1424
|
-
], ln = [
|
|
1425
|
-
"x1",
|
|
1426
|
-
"y1",
|
|
1427
|
-
"x2",
|
|
1428
|
-
"y2"
|
|
1429
1430
|
], un = [
|
|
1430
1431
|
"x1",
|
|
1431
1432
|
"y1",
|
|
@@ -1442,18 +1443,23 @@ var en = {
|
|
|
1442
1443
|
"x2",
|
|
1443
1444
|
"y2"
|
|
1444
1445
|
], pn = [
|
|
1446
|
+
"x1",
|
|
1447
|
+
"y1",
|
|
1448
|
+
"x2",
|
|
1449
|
+
"y2"
|
|
1450
|
+
], mn = [
|
|
1445
1451
|
"x",
|
|
1446
1452
|
"y",
|
|
1447
1453
|
"font-size",
|
|
1448
1454
|
"fill",
|
|
1449
1455
|
"font-weight",
|
|
1450
1456
|
"fill-opacity"
|
|
1451
|
-
],
|
|
1457
|
+
], hn = [
|
|
1452
1458
|
"transform",
|
|
1453
1459
|
"font-size",
|
|
1454
1460
|
"fill",
|
|
1455
1461
|
"font-weight"
|
|
1456
|
-
],
|
|
1462
|
+
], gn = [
|
|
1457
1463
|
"x",
|
|
1458
1464
|
"y",
|
|
1459
1465
|
"text-anchor",
|
|
@@ -1461,43 +1467,43 @@ var en = {
|
|
|
1461
1467
|
"fill",
|
|
1462
1468
|
"font-weight",
|
|
1463
1469
|
"fill-opacity"
|
|
1464
|
-
],
|
|
1470
|
+
], _n = [
|
|
1465
1471
|
"x",
|
|
1466
1472
|
"y",
|
|
1467
1473
|
"font-size",
|
|
1468
1474
|
"fill",
|
|
1469
1475
|
"font-weight"
|
|
1470
|
-
],
|
|
1476
|
+
], vn = [
|
|
1471
1477
|
"d",
|
|
1472
1478
|
"fill",
|
|
1473
1479
|
"fill-opacity"
|
|
1474
|
-
],
|
|
1480
|
+
], yn = [
|
|
1475
1481
|
"d",
|
|
1476
1482
|
"stroke",
|
|
1477
1483
|
"stroke-width"
|
|
1478
|
-
],
|
|
1484
|
+
], bn = [
|
|
1479
1485
|
"d",
|
|
1480
1486
|
"stroke",
|
|
1481
1487
|
"stroke-width",
|
|
1482
1488
|
"stroke-opacity",
|
|
1483
1489
|
"stroke-dasharray"
|
|
1484
|
-
],
|
|
1490
|
+
], xn = [
|
|
1485
1491
|
"cx",
|
|
1486
1492
|
"cy",
|
|
1487
1493
|
"r",
|
|
1488
1494
|
"fill",
|
|
1489
1495
|
"fill-opacity",
|
|
1490
1496
|
"stroke"
|
|
1491
|
-
],
|
|
1497
|
+
], Sn = [
|
|
1492
1498
|
"d",
|
|
1493
1499
|
"fill",
|
|
1494
1500
|
"fill-opacity"
|
|
1495
|
-
],
|
|
1501
|
+
], Cn = [
|
|
1496
1502
|
"d",
|
|
1497
1503
|
"stroke",
|
|
1498
1504
|
"stroke-width",
|
|
1499
1505
|
"stroke-dasharray"
|
|
1500
|
-
],
|
|
1506
|
+
], wn = [
|
|
1501
1507
|
"x1",
|
|
1502
1508
|
"y1",
|
|
1503
1509
|
"x2",
|
|
@@ -1505,7 +1511,7 @@ var en = {
|
|
|
1505
1511
|
"stroke",
|
|
1506
1512
|
"stroke-width",
|
|
1507
1513
|
"stroke-dasharray"
|
|
1508
|
-
],
|
|
1514
|
+
], Tn = [
|
|
1509
1515
|
"x1",
|
|
1510
1516
|
"y1",
|
|
1511
1517
|
"x2",
|
|
@@ -1513,53 +1519,53 @@ var en = {
|
|
|
1513
1519
|
"stroke",
|
|
1514
1520
|
"stroke-width",
|
|
1515
1521
|
"stroke-dasharray"
|
|
1516
|
-
],
|
|
1522
|
+
], En = [
|
|
1517
1523
|
"x1",
|
|
1518
1524
|
"y1",
|
|
1519
1525
|
"x2",
|
|
1520
1526
|
"y2"
|
|
1521
|
-
],
|
|
1527
|
+
], Dn = [
|
|
1522
1528
|
"x1",
|
|
1523
1529
|
"y1",
|
|
1524
1530
|
"x2",
|
|
1525
1531
|
"y2"
|
|
1526
|
-
],
|
|
1532
|
+
], On = [
|
|
1527
1533
|
"x1",
|
|
1528
1534
|
"y1",
|
|
1529
1535
|
"x2",
|
|
1530
1536
|
"y2"
|
|
1531
|
-
],
|
|
1537
|
+
], kn = [
|
|
1532
1538
|
"cx",
|
|
1533
1539
|
"cy",
|
|
1534
1540
|
"fill"
|
|
1535
|
-
],
|
|
1541
|
+
], An = [
|
|
1536
1542
|
"x",
|
|
1537
1543
|
"y",
|
|
1538
1544
|
"width",
|
|
1539
1545
|
"height"
|
|
1540
|
-
],
|
|
1546
|
+
], jn = [
|
|
1541
1547
|
"cx",
|
|
1542
1548
|
"cy",
|
|
1543
1549
|
"fill",
|
|
1544
1550
|
"fill-opacity",
|
|
1545
1551
|
"stroke"
|
|
1546
|
-
],
|
|
1552
|
+
], Mn = [
|
|
1547
1553
|
"x",
|
|
1548
1554
|
"y",
|
|
1549
1555
|
"font-size",
|
|
1550
1556
|
"font-weight",
|
|
1551
1557
|
"fill"
|
|
1552
|
-
],
|
|
1558
|
+
], Nn = [
|
|
1553
1559
|
"x",
|
|
1554
1560
|
"y",
|
|
1555
1561
|
"font-size",
|
|
1556
1562
|
"font-weight",
|
|
1557
1563
|
"fill",
|
|
1558
1564
|
"fill-opacity"
|
|
1559
|
-
],
|
|
1565
|
+
], Pn = { class: "line-chart-tooltip" }, Fn = {
|
|
1560
1566
|
key: 0,
|
|
1561
1567
|
class: "line-chart-tooltip-label"
|
|
1562
|
-
},
|
|
1568
|
+
}, In = ["href", "download"], Ln = 36, Rn = 12, zn = 7, Bn = 16, Vn = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
1563
1569
|
inheritAttrs: !1,
|
|
1564
1570
|
__name: "LineChart",
|
|
1565
1571
|
props: {
|
|
@@ -1599,7 +1605,7 @@ var en = {
|
|
|
1599
1605
|
},
|
|
1600
1606
|
tooltipData: {},
|
|
1601
1607
|
tooltipTrigger: {},
|
|
1602
|
-
tooltipClamp: { default: "
|
|
1608
|
+
tooltipClamp: { default: "window" },
|
|
1603
1609
|
tooltipValueFormat: {},
|
|
1604
1610
|
csv: {},
|
|
1605
1611
|
filename: {},
|
|
@@ -1623,7 +1629,7 @@ var en = {
|
|
|
1623
1629
|
for (let t = 0; t < e.length; t++) r[t] = Vt(e[t], n) ?? NaN;
|
|
1624
1630
|
return r;
|
|
1625
1631
|
}
|
|
1626
|
-
let ie =
|
|
1632
|
+
let ie = Tt(() => f.tooltipValueFormat, () => f.yTickFormat), C = n(() => f.timezone ?? "utc"), w = n(() => {
|
|
1627
1633
|
let e = C.value, t = !1, n = !1;
|
|
1628
1634
|
for (let r of re(f)) {
|
|
1629
1635
|
if (n = !0, !Ut(r, e)) {
|
|
@@ -1664,7 +1670,7 @@ var en = {
|
|
|
1664
1670
|
function se(e, t) {
|
|
1665
1671
|
return e.x ? Number(e.x[t]) : t;
|
|
1666
1672
|
}
|
|
1667
|
-
let
|
|
1673
|
+
let ce = n(() => O.value ? 0 : f.xMin ?? 0), le = n(() => {
|
|
1668
1674
|
let e = Infinity, t = -Infinity;
|
|
1669
1675
|
for (let n of E.value) for (let r = 0; r < n.data.length; r++) {
|
|
1670
1676
|
let i = k(n, r);
|
|
@@ -1685,11 +1691,11 @@ var en = {
|
|
|
1685
1691
|
max: 0
|
|
1686
1692
|
};
|
|
1687
1693
|
});
|
|
1688
|
-
function
|
|
1689
|
-
let { min: t, max: n } =
|
|
1690
|
-
return
|
|
1694
|
+
function A(e) {
|
|
1695
|
+
let { min: t, max: n } = le.value, r = n - t || 1;
|
|
1696
|
+
return B.value.left + (e - t) / r * U.value;
|
|
1691
1697
|
}
|
|
1692
|
-
let
|
|
1698
|
+
let ue = n(() => {
|
|
1693
1699
|
let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
|
|
1694
1700
|
isFinite(r) && (r < e && (e = r), r > t && (t = r), r > 0 && r < n && (n = r));
|
|
1695
1701
|
};
|
|
@@ -1704,18 +1710,18 @@ var en = {
|
|
|
1704
1710
|
range: 1
|
|
1705
1711
|
};
|
|
1706
1712
|
f.yMin != null && f.yMin < e && (e = f.yMin);
|
|
1707
|
-
let i =
|
|
1713
|
+
let i = Te(e, t, f.yScaleType, n);
|
|
1708
1714
|
return {
|
|
1709
1715
|
min: i.min,
|
|
1710
1716
|
max: i.max,
|
|
1711
1717
|
range: i.max - i.min || 1
|
|
1712
1718
|
};
|
|
1713
1719
|
});
|
|
1714
|
-
function
|
|
1715
|
-
let { min: t, max: n } =
|
|
1716
|
-
return
|
|
1720
|
+
function j(e) {
|
|
1721
|
+
let { min: t, max: n } = ue.value;
|
|
1722
|
+
return B.value.top + W.value - we(e, t, n, f.yScaleType) * W.value;
|
|
1717
1723
|
}
|
|
1718
|
-
function
|
|
1724
|
+
function de(e) {
|
|
1719
1725
|
let t = e.data;
|
|
1720
1726
|
if (t.length === 0) return "";
|
|
1721
1727
|
let n = "", r = !1;
|
|
@@ -1725,23 +1731,23 @@ var en = {
|
|
|
1725
1731
|
r = !1;
|
|
1726
1732
|
continue;
|
|
1727
1733
|
}
|
|
1728
|
-
let o =
|
|
1734
|
+
let o = A(a), s = j(t[i]);
|
|
1729
1735
|
n += r ? `L${o},${s}` : `M${o},${s}`, r = !0;
|
|
1730
1736
|
}
|
|
1731
1737
|
return n;
|
|
1732
1738
|
}
|
|
1733
|
-
function
|
|
1739
|
+
function fe(e) {
|
|
1734
1740
|
let t = e.data, n = [];
|
|
1735
1741
|
for (let r = 0; r < t.length; r++) {
|
|
1736
1742
|
let i = k(e, r);
|
|
1737
1743
|
!isFinite(t[r]) || !isFinite(i) || n.push({
|
|
1738
|
-
x:
|
|
1739
|
-
y:
|
|
1744
|
+
x: A(i),
|
|
1745
|
+
y: j(t[r])
|
|
1740
1746
|
});
|
|
1741
1747
|
}
|
|
1742
1748
|
return n;
|
|
1743
1749
|
}
|
|
1744
|
-
function
|
|
1750
|
+
function pe(e) {
|
|
1745
1751
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
1746
1752
|
if (t === 0) return "";
|
|
1747
1753
|
let n = [], r = [];
|
|
@@ -1749,45 +1755,45 @@ var en = {
|
|
|
1749
1755
|
r.length && n.push(r);
|
|
1750
1756
|
let i = "";
|
|
1751
1757
|
for (let t of n) {
|
|
1752
|
-
i += `M${
|
|
1753
|
-
for (let n = 1; n < t.length; n++) i += `L${
|
|
1754
|
-
for (let n = t.length - 1; n >= 0; n--) i += `L${
|
|
1758
|
+
i += `M${A(se(e, t[0]))},${j(e.upper[t[0]])}`;
|
|
1759
|
+
for (let n = 1; n < t.length; n++) i += `L${A(se(e, t[n]))},${j(e.upper[t[n]])}`;
|
|
1760
|
+
for (let n = t.length - 1; n >= 0; n--) i += `L${A(se(e, t[n]))},${j(e.lower[t[n]])}`;
|
|
1755
1761
|
i += "Z";
|
|
1756
1762
|
}
|
|
1757
1763
|
return i;
|
|
1758
1764
|
}
|
|
1759
|
-
function
|
|
1765
|
+
function M(e, t) {
|
|
1760
1766
|
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && E.value[e.seriesIndex] || E.value[0];
|
|
1761
|
-
return
|
|
1767
|
+
return A(r ? k(r, n) : n);
|
|
1762
1768
|
}
|
|
1763
|
-
function
|
|
1764
|
-
let n =
|
|
1769
|
+
function me(e, t = !0) {
|
|
1770
|
+
let n = B.value.top + W.value;
|
|
1765
1771
|
if (e.seriesIndex == null) {
|
|
1766
|
-
let t =
|
|
1767
|
-
return t > r ? "" : `M${t},${
|
|
1772
|
+
let t = M(e, "start"), r = M(e, "end");
|
|
1773
|
+
return t > r ? "" : `M${t},${B.value.top}L${r},${B.value.top}L${r},${n}L${t},${n}Z`;
|
|
1768
1774
|
}
|
|
1769
1775
|
let r = E.value[e.seriesIndex];
|
|
1770
1776
|
if (!r) return "";
|
|
1771
1777
|
let i = Math.max(0, e.startIndex), a = Math.min(r.data.length - 1, e.endIndex);
|
|
1772
1778
|
if (i > a) return "";
|
|
1773
|
-
let o = `M${
|
|
1774
|
-
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${
|
|
1775
|
-
return t && (o += `L${
|
|
1779
|
+
let o = `M${A(k(r, i))},${j(r.data[i])}`;
|
|
1780
|
+
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${A(k(r, e))},${j(r.data[e])}`);
|
|
1781
|
+
return t && (o += `L${A(k(r, a))},${n}`, o += `L${A(k(r, i))},${n}`, o += "Z"), o;
|
|
1776
1782
|
}
|
|
1777
|
-
let
|
|
1783
|
+
let he = n(() => {
|
|
1778
1784
|
let e = f.areaSections;
|
|
1779
1785
|
if (!e?.length) return {
|
|
1780
1786
|
labels: [],
|
|
1781
1787
|
extraHeight: 0
|
|
1782
1788
|
};
|
|
1783
|
-
let t = [], n =
|
|
1789
|
+
let t = [], n = B.value.left + U.value;
|
|
1784
1790
|
for (let r of e) {
|
|
1785
1791
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
1786
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) *
|
|
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 = ke({
|
|
1787
1793
|
color: l,
|
|
1788
1794
|
fontWeight: 600,
|
|
1789
1795
|
...r.inlineLabelStyle
|
|
1790
|
-
}, { fontSize: 11 }), d =
|
|
1796
|
+
}, { fontSize: 11 }), d = ke(r.inlineDescriptionStyle, {
|
|
1791
1797
|
fontSize: 11,
|
|
1792
1798
|
fillOpacity: .6
|
|
1793
1799
|
});
|
|
@@ -1807,7 +1813,7 @@ var en = {
|
|
|
1807
1813
|
let r = [];
|
|
1808
1814
|
for (let e of t) {
|
|
1809
1815
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
1810
|
-
for (; n < r.length && !(t >= r[n] +
|
|
1816
|
+
for (; n < r.length && !(t >= r[n] + Bn);) n++;
|
|
1811
1817
|
e.row = n;
|
|
1812
1818
|
let i = e.cx + e.textWidth / 2;
|
|
1813
1819
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -1817,9 +1823,9 @@ var en = {
|
|
|
1817
1823
|
extraHeight: 0
|
|
1818
1824
|
} : {
|
|
1819
1825
|
labels: t,
|
|
1820
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
1826
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Ln + Rn
|
|
1821
1827
|
};
|
|
1822
|
-
}),
|
|
1828
|
+
}), ge = n(() => {
|
|
1823
1829
|
let e = [];
|
|
1824
1830
|
for (let t of E.value) !t.legend || t.showInLegend === !1 || e.push({
|
|
1825
1831
|
label: t.legend,
|
|
@@ -1827,6 +1833,12 @@ var en = {
|
|
|
1827
1833
|
type: "series",
|
|
1828
1834
|
dashed: t.dashed
|
|
1829
1835
|
});
|
|
1836
|
+
for (let t of oe.value) !t.legend || t.showInLegend === !1 || e.push({
|
|
1837
|
+
label: t.legend,
|
|
1838
|
+
color: t.color ?? "currentColor",
|
|
1839
|
+
type: "area",
|
|
1840
|
+
fillOpacity: t.opacity ?? .2
|
|
1841
|
+
});
|
|
1830
1842
|
let t = f.areaSections;
|
|
1831
1843
|
if (t) for (let n of t) {
|
|
1832
1844
|
if (n.legend !== "inline" || !n.label && !n.description) continue;
|
|
@@ -1839,38 +1851,38 @@ var en = {
|
|
|
1839
1851
|
});
|
|
1840
1852
|
}
|
|
1841
1853
|
return e;
|
|
1842
|
-
}),
|
|
1843
|
-
let { min: e, max: t } =
|
|
1854
|
+
}), _e = n(() => ge.value.map((e) => e.label)), ve = n(() => Le.value + he.value.extraHeight), N = n(() => B.value.top + W.value + B.value.bottom + Rn), be = n(() => {
|
|
1855
|
+
let { min: e, max: t } = ue.value, n = (e) => f.yTickFormat === void 0 ? Ce(e) : ae(e, f.yTickFormat);
|
|
1844
1856
|
return e === t ? [{
|
|
1845
1857
|
value: n(e),
|
|
1846
|
-
y:
|
|
1847
|
-
}] : (f.yScaleType === "log" ?
|
|
1858
|
+
y: P(B.value.top + W.value / 2)
|
|
1859
|
+
}] : (f.yScaleType === "log" ? I({
|
|
1848
1860
|
min: e,
|
|
1849
1861
|
max: t,
|
|
1850
1862
|
ticks: f.yTicks
|
|
1851
|
-
}) :
|
|
1863
|
+
}) : F({
|
|
1852
1864
|
min: e,
|
|
1853
1865
|
max: t,
|
|
1854
1866
|
ticks: f.yTicks,
|
|
1855
|
-
targetTickCount:
|
|
1867
|
+
targetTickCount: W.value / 50
|
|
1856
1868
|
})).map((e) => ({
|
|
1857
1869
|
value: n(e),
|
|
1858
|
-
y:
|
|
1870
|
+
y: P(j(e))
|
|
1859
1871
|
}));
|
|
1860
1872
|
});
|
|
1861
|
-
function
|
|
1873
|
+
function xe(e, t, n) {
|
|
1862
1874
|
let r = f.xTickFormat;
|
|
1863
1875
|
if (T.value) return typeof r == "function" ? r(e, t) : $t(e, r, C.value, n);
|
|
1864
|
-
let i = e +
|
|
1865
|
-
return r === void 0 ? !O.value && f.xLabels && Number.isInteger(e) && e >= 0 && e < f.xLabels.length ? f.xLabels[e] :
|
|
1876
|
+
let i = e + ce.value;
|
|
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);
|
|
1866
1878
|
}
|
|
1867
|
-
let
|
|
1868
|
-
let { min: e, max: t } =
|
|
1879
|
+
let Se = n(() => {
|
|
1880
|
+
let { min: e, max: t } = le.value;
|
|
1869
1881
|
if (e === t) return [];
|
|
1870
|
-
let n = T.value, r = n ? 0 :
|
|
1882
|
+
let n = T.value, r = n ? 0 : ce.value, i = D.value, a = U.value / 80, o, s;
|
|
1871
1883
|
if (n) {
|
|
1872
1884
|
let n = qt(e, t, a, C.value);
|
|
1873
|
-
s = n.unit, o =
|
|
1885
|
+
s = n.unit, o = F({
|
|
1874
1886
|
min: e,
|
|
1875
1887
|
max: t,
|
|
1876
1888
|
ticks: n.values
|
|
@@ -1879,31 +1891,31 @@ var en = {
|
|
|
1879
1891
|
let e = Math.max(3, Math.floor(a)), t = Math.max(1, Math.round((i - 1) / e));
|
|
1880
1892
|
o = [];
|
|
1881
1893
|
for (let e = 0; e < i; e += t) o.push(e);
|
|
1882
|
-
} else o =
|
|
1894
|
+
} else o = F({
|
|
1883
1895
|
min: e,
|
|
1884
1896
|
max: t,
|
|
1885
1897
|
ticks: f.xTicks,
|
|
1886
1898
|
targetTickCount: a,
|
|
1887
1899
|
displayOffset: r
|
|
1888
1900
|
});
|
|
1889
|
-
let c =
|
|
1901
|
+
let c = B.value.left, l = B.value.left + U.value;
|
|
1890
1902
|
return o.map((e, t) => {
|
|
1891
|
-
let n =
|
|
1903
|
+
let n = P(A(e)), r = "middle";
|
|
1892
1904
|
return n - c <= 1 ? r = "start" : l - n <= 1 && (r = "end"), {
|
|
1893
|
-
value:
|
|
1905
|
+
value: xe(e, t, s),
|
|
1894
1906
|
x: n,
|
|
1895
1907
|
anchor: r
|
|
1896
1908
|
};
|
|
1897
1909
|
});
|
|
1898
1910
|
});
|
|
1899
|
-
function
|
|
1900
|
-
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv :
|
|
1911
|
+
function Ee() {
|
|
1912
|
+
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv : Qe(E.value);
|
|
1901
1913
|
}
|
|
1902
|
-
let
|
|
1903
|
-
let e =
|
|
1914
|
+
let Oe = n(() => !!f.tooltipData || !!f.tooltipTrigger), L = n(() => {
|
|
1915
|
+
let e = ze.value, t = E.value[0];
|
|
1904
1916
|
return e === null || !t ? null : k(t, e);
|
|
1905
|
-
}),
|
|
1906
|
-
function
|
|
1917
|
+
}), Ae = n(() => L.value === null ? 0 : A(L.value));
|
|
1918
|
+
function je(e, t) {
|
|
1907
1919
|
let n = e.data.length;
|
|
1908
1920
|
if (n === 0) return null;
|
|
1909
1921
|
let r = 0, i = Infinity;
|
|
@@ -1915,30 +1927,30 @@ var en = {
|
|
|
1915
1927
|
}
|
|
1916
1928
|
return i === Infinity ? null : r;
|
|
1917
1929
|
}
|
|
1918
|
-
let
|
|
1919
|
-
let e =
|
|
1930
|
+
let Me = n(() => {
|
|
1931
|
+
let e = L.value;
|
|
1920
1932
|
if (e === null) return [];
|
|
1921
1933
|
let t = [];
|
|
1922
1934
|
for (let n of E.value) {
|
|
1923
1935
|
if (n.showInTooltip === !1) continue;
|
|
1924
|
-
let r =
|
|
1936
|
+
let r = je(n, e);
|
|
1925
1937
|
if (r === null) continue;
|
|
1926
1938
|
let i = n.data[r];
|
|
1927
1939
|
isFinite(i) && t.push({
|
|
1928
|
-
x:
|
|
1929
|
-
y:
|
|
1940
|
+
x: A(k(n, r)),
|
|
1941
|
+
y: j(i),
|
|
1930
1942
|
color: n.color ?? "currentColor"
|
|
1931
1943
|
});
|
|
1932
1944
|
}
|
|
1933
1945
|
return t;
|
|
1934
|
-
}),
|
|
1935
|
-
let e =
|
|
1946
|
+
}), Ne = n(() => {
|
|
1947
|
+
let e = ze.value, t = L.value;
|
|
1936
1948
|
if (e === null || t === null) return null;
|
|
1937
|
-
let n =
|
|
1949
|
+
let n = xe(t, e), r = E.value, i = [];
|
|
1938
1950
|
for (let e = 0; e < r.length; e++) {
|
|
1939
1951
|
let n = r[e];
|
|
1940
1952
|
if (n.showInTooltip === !1) continue;
|
|
1941
|
-
let a =
|
|
1953
|
+
let a = je(n, t);
|
|
1942
1954
|
i.push({
|
|
1943
1955
|
value: a === null ? NaN : Number(n.data[a]),
|
|
1944
1956
|
color: n.color ?? "currentColor",
|
|
@@ -1952,21 +1964,21 @@ var en = {
|
|
|
1952
1964
|
data: f.tooltipData?.[e] ?? null
|
|
1953
1965
|
};
|
|
1954
1966
|
});
|
|
1955
|
-
function
|
|
1967
|
+
function Pe(e, t) {
|
|
1956
1968
|
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1957
|
-
x:
|
|
1958
|
-
y:
|
|
1969
|
+
x: A(e - ce.value),
|
|
1970
|
+
y: j(t)
|
|
1959
1971
|
};
|
|
1960
1972
|
}
|
|
1961
|
-
function
|
|
1962
|
-
let t =
|
|
1973
|
+
function Fe(e) {
|
|
1974
|
+
let t = R.value?.getBoundingClientRect();
|
|
1963
1975
|
if (!t) return null;
|
|
1964
1976
|
let n = E.value[0];
|
|
1965
1977
|
if (!n || n.data.length === 0) return null;
|
|
1966
|
-
let { min: r, max: i } =
|
|
1967
|
-
return
|
|
1978
|
+
let { min: r, max: i } = le.value, a = i - r || 1;
|
|
1979
|
+
return je(n, r + (e - t.left - B.value.left) / U.value * a);
|
|
1968
1980
|
}
|
|
1969
|
-
let { containerRef:
|
|
1981
|
+
let { containerRef: R, svgRef: z, width: Ie, height: Le, padding: B, legendY: V, inlineLegendLayout: H, innerW: U, innerH: W, bounds: Re, hoverIndex: ze, tooltipRef: Be, tooltipPos: G, tooltipHandlers: Ve, menuItems: He, downloadLinkText: K, csvHref: Ue, downloadButtonText: We, triggerCsvDownload: Ge, menuFilename: Ke, isFullscreen: qe, fullscreenStyle: q, teleportTarget: J, exitFullscreen: Je } = wt({
|
|
1970
1982
|
width: () => f.width,
|
|
1971
1983
|
height: () => f.height,
|
|
1972
1984
|
title: () => f.title,
|
|
@@ -1982,17 +1994,17 @@ var en = {
|
|
|
1982
1994
|
downloadButton: () => f.downloadButton,
|
|
1983
1995
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
1984
1996
|
chartPadding: () => f.chartPadding,
|
|
1985
|
-
inlineLegendLabels: () =>
|
|
1986
|
-
hasTooltipSlot: () =>
|
|
1987
|
-
getCsv:
|
|
1988
|
-
pointerToIndex:
|
|
1997
|
+
inlineLegendLabels: () => _e.value,
|
|
1998
|
+
hasTooltipSlot: () => Oe.value,
|
|
1999
|
+
getCsv: Ee,
|
|
2000
|
+
pointerToIndex: Fe,
|
|
1989
2001
|
onHover: (e) => ee("hover", e),
|
|
1990
|
-
extraBelowHeight: () =>
|
|
1991
|
-
}),
|
|
2002
|
+
extraBelowHeight: () => he.value.extraHeight
|
|
2003
|
+
}), Ye = n(() => ke(f.axisLabelStyle, { fontSize: 13 })), Y = n(() => ke(f.tickLabelStyle, {
|
|
1992
2004
|
fontSize: 10,
|
|
1993
|
-
fillOpacity:
|
|
1994
|
-
})),
|
|
1995
|
-
let e = f.titleStyle, t = e?.align ?? "left", n =
|
|
2005
|
+
fillOpacity: De
|
|
2006
|
+
})), Xe = n(() => ke(f.legendStyle, { fontSize: 11 })), Ze = n(() => {
|
|
2007
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = Re.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
1996
2008
|
return {
|
|
1997
2009
|
lines: (f.title ?? "").split("\n"),
|
|
1998
2010
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -2002,9 +2014,9 @@ var en = {
|
|
|
2002
2014
|
x: r,
|
|
2003
2015
|
anchor: i
|
|
2004
2016
|
};
|
|
2005
|
-
}),
|
|
2006
|
-
let e =
|
|
2007
|
-
return
|
|
2017
|
+
}), $e = n(() => {
|
|
2018
|
+
let e = H.value.positions, t = B.value.left, n = V.value;
|
|
2019
|
+
return ge.value.map((r, i) => {
|
|
2008
2020
|
let a = e[i];
|
|
2009
2021
|
return {
|
|
2010
2022
|
...r,
|
|
@@ -2014,48 +2026,48 @@ var en = {
|
|
|
2014
2026
|
});
|
|
2015
2027
|
});
|
|
2016
2028
|
return (n, l) => (_(), r(t, {
|
|
2017
|
-
to: x(
|
|
2018
|
-
disabled: !x(
|
|
2029
|
+
to: x(J),
|
|
2030
|
+
disabled: !x(qe)
|
|
2019
2031
|
}, [o("div", d({
|
|
2020
2032
|
ref_key: "containerRef",
|
|
2021
|
-
ref:
|
|
2033
|
+
ref: R
|
|
2022
2034
|
}, n.$attrs, {
|
|
2023
|
-
class: ["line-chart-wrapper", { "is-fullscreen": x(
|
|
2024
|
-
style: x(
|
|
2035
|
+
class: ["line-chart-wrapper", { "is-fullscreen": x(qe) }],
|
|
2036
|
+
style: x(q)
|
|
2025
2037
|
}), [
|
|
2026
|
-
c.menu ? (_(), r(
|
|
2038
|
+
c.menu ? (_(), r(ye, {
|
|
2027
2039
|
key: 0,
|
|
2028
|
-
items: x(
|
|
2029
|
-
"is-fullscreen": x(
|
|
2030
|
-
onClose: x(
|
|
2040
|
+
items: x(He),
|
|
2041
|
+
"is-fullscreen": x(qe),
|
|
2042
|
+
onClose: x(Je)
|
|
2031
2043
|
}, null, 8, [
|
|
2032
2044
|
"items",
|
|
2033
2045
|
"is-fullscreen",
|
|
2034
2046
|
"onClose"
|
|
2035
2047
|
])) : i("", !0),
|
|
2036
|
-
o("div", en, b(x(
|
|
2048
|
+
o("div", en, b(x(qe) ? "Chart expanded to fill window" : ""), 1),
|
|
2037
2049
|
(_(), a("svg", {
|
|
2038
2050
|
ref_key: "svgRef",
|
|
2039
|
-
ref:
|
|
2040
|
-
width: x(
|
|
2041
|
-
height:
|
|
2051
|
+
ref: z,
|
|
2052
|
+
width: x(Ie),
|
|
2053
|
+
height: ve.value,
|
|
2042
2054
|
role: g.value || void 0,
|
|
2043
2055
|
"aria-label": p.value || void 0
|
|
2044
2056
|
}, [
|
|
2045
2057
|
c.title ? (_(), a("text", {
|
|
2046
2058
|
key: 0,
|
|
2047
|
-
x:
|
|
2048
|
-
y:
|
|
2049
|
-
"text-anchor":
|
|
2050
|
-
"font-size":
|
|
2051
|
-
"font-weight":
|
|
2052
|
-
fill:
|
|
2053
|
-
}, [(_(!0), a(e, null, y(
|
|
2059
|
+
x: Ze.value.x,
|
|
2060
|
+
y: Ze.value.lineHeight,
|
|
2061
|
+
"text-anchor": Ze.value.anchor,
|
|
2062
|
+
"font-size": Ze.value.fontSize,
|
|
2063
|
+
"font-weight": Ze.value.fontWeight,
|
|
2064
|
+
fill: Ze.value.color
|
|
2065
|
+
}, [(_(!0), a(e, null, y(Ze.value.lines, (e, t) => (_(), a("tspan", {
|
|
2054
2066
|
key: t,
|
|
2055
|
-
x:
|
|
2056
|
-
dy: t === 0 ? 0 :
|
|
2067
|
+
x: Ze.value.x,
|
|
2068
|
+
dy: t === 0 ? 0 : Ze.value.lineHeight
|
|
2057
2069
|
}, b(e), 9, rn))), 128))], 8, nn)) : i("", !0),
|
|
2058
|
-
|
|
2070
|
+
$e.value.length > 0 ? (_(), a("g", an, [(_(!0), a(e, null, y($e.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
|
|
2059
2071
|
key: 0,
|
|
2060
2072
|
x1: t.x,
|
|
2061
2073
|
y1: t.y,
|
|
@@ -2064,8 +2076,18 @@ var en = {
|
|
|
2064
2076
|
stroke: t.color,
|
|
2065
2077
|
"stroke-width": "2",
|
|
2066
2078
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
2067
|
-
}, null, 8, on)) : (_(), a("
|
|
2079
|
+
}, null, 8, on)) : t.type === "area" ? (_(), a("rect", {
|
|
2068
2080
|
key: 1,
|
|
2081
|
+
x: t.x,
|
|
2082
|
+
y: t.y - 4,
|
|
2083
|
+
width: "12",
|
|
2084
|
+
height: "8",
|
|
2085
|
+
fill: t.color,
|
|
2086
|
+
"fill-opacity": t.fillOpacity,
|
|
2087
|
+
stroke: t.color,
|
|
2088
|
+
"stroke-width": "1.5"
|
|
2089
|
+
}, null, 8, sn)) : (_(), a("circle", {
|
|
2090
|
+
key: 2,
|
|
2069
2091
|
cx: t.x + 4,
|
|
2070
2092
|
cy: t.y,
|
|
2071
2093
|
r: "4",
|
|
@@ -2073,119 +2095,119 @@ var en = {
|
|
|
2073
2095
|
"fill-opacity": t.fillOpacity,
|
|
2074
2096
|
stroke: t.color,
|
|
2075
2097
|
"stroke-width": "1.5"
|
|
2076
|
-
}, null, 8,
|
|
2098
|
+
}, null, 8, cn)), o("text", {
|
|
2077
2099
|
x: t.x + 18,
|
|
2078
2100
|
y: t.y + 4,
|
|
2079
|
-
"font-size":
|
|
2080
|
-
fill:
|
|
2081
|
-
"font-weight":
|
|
2082
|
-
}, b(t.label), 9,
|
|
2101
|
+
"font-size": Xe.value.fontSize,
|
|
2102
|
+
fill: Xe.value.fill,
|
|
2103
|
+
"font-weight": Xe.value.fontWeight
|
|
2104
|
+
}, b(t.label), 9, ln)], 64))), 128))])) : i("", !0),
|
|
2083
2105
|
o("line", {
|
|
2084
|
-
x1: x(
|
|
2085
|
-
y1: x(
|
|
2086
|
-
x2: x(
|
|
2087
|
-
y2: x(
|
|
2106
|
+
x1: x(P)(x(B).left),
|
|
2107
|
+
y1: x(P)(x(B).top),
|
|
2108
|
+
x2: x(P)(x(B).left),
|
|
2109
|
+
y2: x(P)(x(B).top + x(W)),
|
|
2088
2110
|
stroke: "currentColor",
|
|
2089
2111
|
"stroke-opacity": "0.3"
|
|
2090
|
-
}, null, 8,
|
|
2112
|
+
}, null, 8, un),
|
|
2091
2113
|
o("line", {
|
|
2092
|
-
x1: x(
|
|
2093
|
-
y1: x(
|
|
2094
|
-
x2: x(
|
|
2095
|
-
y2: x(
|
|
2114
|
+
x1: x(P)(x(B).left),
|
|
2115
|
+
y1: x(P)(x(B).top + x(W)),
|
|
2116
|
+
x2: x(P)(x(B).left + x(U)),
|
|
2117
|
+
y2: x(P)(x(B).top + x(W)),
|
|
2096
2118
|
stroke: "currentColor",
|
|
2097
2119
|
"stroke-opacity": "0.3"
|
|
2098
|
-
}, null, 8,
|
|
2099
|
-
c.yGrid ? (_(!0), a(e, { key: 2 }, y(
|
|
2120
|
+
}, null, 8, dn),
|
|
2121
|
+
c.yGrid ? (_(!0), a(e, { key: 2 }, y(be.value, (e, t) => (_(), a("line", {
|
|
2100
2122
|
key: "yg" + t,
|
|
2101
|
-
x1: x(
|
|
2123
|
+
x1: x(B).left,
|
|
2102
2124
|
y1: e.y,
|
|
2103
|
-
x2: x(
|
|
2125
|
+
x2: x(B).left + x(U),
|
|
2104
2126
|
y2: e.y,
|
|
2105
2127
|
stroke: "currentColor",
|
|
2106
2128
|
"stroke-opacity": "0.1"
|
|
2107
|
-
}, null, 8,
|
|
2108
|
-
c.xGrid ? (_(!0), a(e, { key: 3 }, y(
|
|
2129
|
+
}, null, 8, fn))), 128)) : i("", !0),
|
|
2130
|
+
c.xGrid ? (_(!0), a(e, { key: 3 }, y(Se.value, (e, t) => (_(), a("line", {
|
|
2109
2131
|
key: "xg" + t,
|
|
2110
2132
|
x1: e.x,
|
|
2111
|
-
y1: x(
|
|
2133
|
+
y1: x(B).top,
|
|
2112
2134
|
x2: e.x,
|
|
2113
|
-
y2: x(
|
|
2135
|
+
y2: x(B).top + x(W),
|
|
2114
2136
|
stroke: "currentColor",
|
|
2115
2137
|
"stroke-opacity": "0.1"
|
|
2116
|
-
}, null, 8,
|
|
2117
|
-
(_(!0), a(e, null, y(
|
|
2138
|
+
}, null, 8, pn))), 128)) : i("", !0),
|
|
2139
|
+
(_(!0), a(e, null, y(be.value, (e, t) => (_(), a("text", {
|
|
2118
2140
|
key: "y" + t,
|
|
2119
2141
|
"data-testid": "y-tick",
|
|
2120
|
-
x: x(
|
|
2142
|
+
x: x(B).left - 6,
|
|
2121
2143
|
y: e.y,
|
|
2122
2144
|
"text-anchor": "end",
|
|
2123
2145
|
"dominant-baseline": "middle",
|
|
2124
|
-
"font-size":
|
|
2125
|
-
fill:
|
|
2126
|
-
"font-weight":
|
|
2127
|
-
"fill-opacity":
|
|
2128
|
-
}, b(e.value), 9,
|
|
2146
|
+
"font-size": Y.value.fontSize,
|
|
2147
|
+
fill: Y.value.fill,
|
|
2148
|
+
"font-weight": Y.value.fontWeight,
|
|
2149
|
+
"fill-opacity": Y.value.fillOpacity
|
|
2150
|
+
}, b(e.value), 9, mn))), 128)),
|
|
2129
2151
|
c.yLabel ? (_(), a("text", {
|
|
2130
2152
|
key: 4,
|
|
2131
2153
|
x: 0,
|
|
2132
2154
|
y: 0,
|
|
2133
|
-
transform: `translate(14, ${x(
|
|
2155
|
+
transform: `translate(14, ${x(B).top + x(W) / 2}) rotate(-90)`,
|
|
2134
2156
|
"text-anchor": "middle",
|
|
2135
|
-
"font-size":
|
|
2136
|
-
fill:
|
|
2137
|
-
"font-weight":
|
|
2138
|
-
}, b(c.yLabel), 9,
|
|
2139
|
-
(_(!0), a(e, null, y(
|
|
2157
|
+
"font-size": Ye.value.fontSize,
|
|
2158
|
+
fill: Ye.value.fill,
|
|
2159
|
+
"font-weight": Ye.value.fontWeight
|
|
2160
|
+
}, b(c.yLabel), 9, hn)) : i("", !0),
|
|
2161
|
+
(_(!0), a(e, null, y(Se.value, (e, t) => (_(), a("text", {
|
|
2140
2162
|
key: "x" + t,
|
|
2141
2163
|
"data-testid": "x-tick",
|
|
2142
2164
|
x: e.x,
|
|
2143
|
-
y: x(
|
|
2165
|
+
y: x(B).top + x(W) + 16,
|
|
2144
2166
|
"text-anchor": e.anchor,
|
|
2145
|
-
"font-size":
|
|
2146
|
-
fill:
|
|
2147
|
-
"font-weight":
|
|
2148
|
-
"fill-opacity":
|
|
2149
|
-
}, b(e.value), 9,
|
|
2167
|
+
"font-size": Y.value.fontSize,
|
|
2168
|
+
fill: Y.value.fill,
|
|
2169
|
+
"font-weight": Y.value.fontWeight,
|
|
2170
|
+
"fill-opacity": Y.value.fillOpacity
|
|
2171
|
+
}, b(e.value), 9, gn))), 128)),
|
|
2150
2172
|
c.xLabel ? (_(), a("text", {
|
|
2151
2173
|
key: 5,
|
|
2152
|
-
x: x(
|
|
2153
|
-
y: x(
|
|
2174
|
+
x: x(B).left + x(U) / 2,
|
|
2175
|
+
y: x(Le) - 4,
|
|
2154
2176
|
"text-anchor": "middle",
|
|
2155
|
-
"font-size":
|
|
2156
|
-
fill:
|
|
2157
|
-
"font-weight":
|
|
2158
|
-
}, b(c.xLabel), 9,
|
|
2177
|
+
"font-size": Ye.value.fontSize,
|
|
2178
|
+
fill: Ye.value.fill,
|
|
2179
|
+
"font-weight": Ye.value.fontWeight
|
|
2180
|
+
}, b(c.xLabel), 9, _n)) : i("", !0),
|
|
2159
2181
|
(_(!0), a(e, null, y(oe.value, (e, t) => (_(), a("path", {
|
|
2160
2182
|
key: "area" + t,
|
|
2161
|
-
d:
|
|
2183
|
+
d: pe(e),
|
|
2162
2184
|
fill: e.color ?? "currentColor",
|
|
2163
2185
|
"fill-opacity": e.opacity ?? .2,
|
|
2164
2186
|
stroke: "none",
|
|
2165
2187
|
style: h(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
2166
|
-
}, null, 12,
|
|
2188
|
+
}, null, 12, vn))), 128)),
|
|
2167
2189
|
(_(!0), a(e, null, y(E.value, (t, n) => (_(), a(e, { key: n }, [
|
|
2168
2190
|
t.line !== !1 && t.outline ? (_(), a("path", {
|
|
2169
2191
|
key: 0,
|
|
2170
|
-
d:
|
|
2192
|
+
d: de(t),
|
|
2171
2193
|
fill: "none",
|
|
2172
2194
|
stroke: t.outlineColor ?? "var(--color-bg-0, #fff)",
|
|
2173
2195
|
"stroke-width": (t.strokeWidth ?? 1.5) + (t.outlineWidth ?? 4),
|
|
2174
2196
|
"stroke-linecap": "round",
|
|
2175
2197
|
"stroke-linejoin": "round",
|
|
2176
2198
|
"data-testid": "line-outline"
|
|
2177
|
-
}, null, 8,
|
|
2199
|
+
}, null, 8, yn)) : i("", !0),
|
|
2178
2200
|
t.line === !1 ? i("", !0) : (_(), a("path", {
|
|
2179
2201
|
key: 1,
|
|
2180
|
-
d:
|
|
2202
|
+
d: de(t),
|
|
2181
2203
|
fill: "none",
|
|
2182
2204
|
stroke: t.color ?? "currentColor",
|
|
2183
2205
|
"stroke-width": t.strokeWidth ?? 1.5,
|
|
2184
2206
|
"stroke-opacity": t.lineOpacity ?? t.opacity ?? c.lineOpacity,
|
|
2185
2207
|
"stroke-dasharray": t.dashed ? "6 3" : void 0,
|
|
2186
2208
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2187
|
-
}, null, 12,
|
|
2188
|
-
t.dots ? (_(!0), a(e, { key: 2 }, y(
|
|
2209
|
+
}, null, 12, bn)),
|
|
2210
|
+
t.dots ? (_(!0), a(e, { key: 2 }, y(fe(t), (e, n) => (_(), a("circle", {
|
|
2189
2211
|
key: n,
|
|
2190
2212
|
cx: e.x,
|
|
2191
2213
|
cy: e.y,
|
|
@@ -2194,69 +2216,69 @@ var en = {
|
|
|
2194
2216
|
"fill-opacity": t.dotOpacity ?? t.opacity ?? c.lineOpacity,
|
|
2195
2217
|
stroke: t.dotStroke ?? "none",
|
|
2196
2218
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2197
|
-
}, null, 12,
|
|
2219
|
+
}, null, 12, xn))), 128)) : i("", !0)
|
|
2198
2220
|
], 64))), 128)),
|
|
2199
2221
|
(_(!0), a(e, null, y(c.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
2200
2222
|
o("path", {
|
|
2201
|
-
d:
|
|
2223
|
+
d: me(t),
|
|
2202
2224
|
fill: t.color ?? (t.seriesIndex == null ? "#999" : E.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
2203
2225
|
"fill-opacity": t.opacity ?? .15,
|
|
2204
2226
|
stroke: "none"
|
|
2205
|
-
}, null, 8,
|
|
2227
|
+
}, null, 8, Sn),
|
|
2206
2228
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
2207
2229
|
key: 0,
|
|
2208
|
-
d:
|
|
2230
|
+
d: me(t, !1),
|
|
2209
2231
|
fill: "none",
|
|
2210
2232
|
stroke: t.color ?? E.value[t.seriesIndex]?.color ?? "currentColor",
|
|
2211
2233
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2212
2234
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2213
|
-
}, null, 8,
|
|
2235
|
+
}, null, 8, Cn)),
|
|
2214
2236
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
2215
|
-
x1: x(
|
|
2216
|
-
y1: x(
|
|
2217
|
-
x2: x(
|
|
2218
|
-
y2: x(
|
|
2237
|
+
x1: x(P)(M(t, "start")),
|
|
2238
|
+
y1: x(B).top,
|
|
2239
|
+
x2: x(P)(M(t, "start")),
|
|
2240
|
+
y2: x(B).top + x(W),
|
|
2219
2241
|
stroke: t.color ?? "#999",
|
|
2220
2242
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2221
2243
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2222
|
-
}, null, 8,
|
|
2223
|
-
x1: x(
|
|
2224
|
-
y1: x(
|
|
2225
|
-
x2: x(
|
|
2226
|
-
y2: x(
|
|
2244
|
+
}, null, 8, wn), o("line", {
|
|
2245
|
+
x1: x(P)(M(t, "end")),
|
|
2246
|
+
y1: x(B).top,
|
|
2247
|
+
x2: x(P)(M(t, "end")),
|
|
2248
|
+
y2: x(B).top + x(W),
|
|
2227
2249
|
stroke: t.color ?? "#999",
|
|
2228
2250
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2229
2251
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2230
|
-
}, null, 8,
|
|
2252
|
+
}, null, 8, Tn)], 64)) : i("", !0),
|
|
2231
2253
|
o("line", {
|
|
2232
|
-
x1: x(
|
|
2233
|
-
y1: x(
|
|
2234
|
-
x2: x(
|
|
2235
|
-
y2: x(
|
|
2254
|
+
x1: x(P)(M(t, "start")),
|
|
2255
|
+
y1: x(B).top + x(W) - 4,
|
|
2256
|
+
x2: x(P)(M(t, "start")),
|
|
2257
|
+
y2: x(B).top + x(W) + 4,
|
|
2236
2258
|
stroke: "currentColor",
|
|
2237
2259
|
"stroke-opacity": "0.4"
|
|
2238
|
-
}, null, 8,
|
|
2260
|
+
}, null, 8, En),
|
|
2239
2261
|
o("line", {
|
|
2240
|
-
x1: x(
|
|
2241
|
-
y1: x(
|
|
2242
|
-
x2: x(
|
|
2243
|
-
y2: x(
|
|
2262
|
+
x1: x(P)(M(t, "end")),
|
|
2263
|
+
y1: x(B).top + x(W) - 4,
|
|
2264
|
+
x2: x(P)(M(t, "end")),
|
|
2265
|
+
y2: x(B).top + x(W) + 4,
|
|
2244
2266
|
stroke: "currentColor",
|
|
2245
2267
|
"stroke-opacity": "0.4"
|
|
2246
|
-
}, null, 8,
|
|
2268
|
+
}, null, 8, Dn)
|
|
2247
2269
|
], 64))), 128)),
|
|
2248
|
-
|
|
2270
|
+
Oe.value && x(ze) !== null ? (_(), a("line", {
|
|
2249
2271
|
key: 6,
|
|
2250
|
-
x1: x(
|
|
2251
|
-
y1: x(
|
|
2252
|
-
x2: x(
|
|
2253
|
-
y2: x(
|
|
2272
|
+
x1: x(P)(Ae.value),
|
|
2273
|
+
y1: x(B).top,
|
|
2274
|
+
x2: x(P)(Ae.value),
|
|
2275
|
+
y2: x(B).top + x(W),
|
|
2254
2276
|
stroke: "currentColor",
|
|
2255
2277
|
"stroke-opacity": "0.3",
|
|
2256
2278
|
"stroke-dasharray": "4 2",
|
|
2257
2279
|
"pointer-events": "none"
|
|
2258
|
-
}, null, 8,
|
|
2259
|
-
(_(!0), a(e, null, y(
|
|
2280
|
+
}, null, 8, On)) : i("", !0),
|
|
2281
|
+
(_(!0), a(e, null, y(Me.value, (e, t) => (_(), a("circle", {
|
|
2260
2282
|
key: "hd" + t,
|
|
2261
2283
|
cx: e.x,
|
|
2262
2284
|
cy: e.y,
|
|
@@ -2265,167 +2287,167 @@ var en = {
|
|
|
2265
2287
|
stroke: "var(--color-bg-0, #fff)",
|
|
2266
2288
|
"stroke-width": "2",
|
|
2267
2289
|
"pointer-events": "none"
|
|
2268
|
-
}, null, 8,
|
|
2269
|
-
|
|
2290
|
+
}, null, 8, kn))), 128)),
|
|
2291
|
+
Oe.value ? (_(), a("rect", d({
|
|
2270
2292
|
key: 7,
|
|
2271
|
-
x: x(
|
|
2272
|
-
y: x(
|
|
2273
|
-
width: x(
|
|
2274
|
-
height: x(
|
|
2293
|
+
x: x(B).left,
|
|
2294
|
+
y: x(B).top,
|
|
2295
|
+
width: x(U),
|
|
2296
|
+
height: x(W),
|
|
2275
2297
|
fill: "transparent",
|
|
2276
2298
|
style: {
|
|
2277
2299
|
cursor: "crosshair",
|
|
2278
2300
|
"touch-action": "pan-y"
|
|
2279
2301
|
}
|
|
2280
|
-
}, ne(x(
|
|
2281
|
-
c.annotations && c.annotations.length > 0 ? (_(), r(x(
|
|
2302
|
+
}, ne(x(Ve), !0)), null, 16, An)) : i("", !0),
|
|
2303
|
+
c.annotations && c.annotations.length > 0 ? (_(), r(x(xt), {
|
|
2282
2304
|
key: 8,
|
|
2283
2305
|
annotations: c.annotations,
|
|
2284
|
-
project:
|
|
2285
|
-
bounds: x(
|
|
2306
|
+
project: Pe,
|
|
2307
|
+
bounds: x(Re)
|
|
2286
2308
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
2287
|
-
(_(!0), a(e, null, y(
|
|
2309
|
+
(_(!0), a(e, null, y(he.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
2288
2310
|
o("circle", {
|
|
2289
2311
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
2290
|
-
cy:
|
|
2312
|
+
cy: N.value + e.row * Ln + 4,
|
|
2291
2313
|
r: "4",
|
|
2292
2314
|
fill: e.color,
|
|
2293
2315
|
"fill-opacity": e.fillOpacity,
|
|
2294
2316
|
stroke: e.color,
|
|
2295
2317
|
"stroke-width": "1.5"
|
|
2296
|
-
}, null, 8,
|
|
2318
|
+
}, null, 8, jn),
|
|
2297
2319
|
e.labelText ? (_(), a("text", {
|
|
2298
2320
|
key: 0,
|
|
2299
2321
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2300
|
-
y:
|
|
2322
|
+
y: N.value + e.row * Ln + 8,
|
|
2301
2323
|
"font-size": e.labelStyle.fontSize,
|
|
2302
2324
|
"font-weight": e.labelStyle.fontWeight,
|
|
2303
2325
|
fill: e.labelStyle.fill
|
|
2304
|
-
}, b(e.labelText), 9,
|
|
2326
|
+
}, b(e.labelText), 9, Mn)) : i("", !0),
|
|
2305
2327
|
e.descText ? (_(), a("text", {
|
|
2306
2328
|
key: 1,
|
|
2307
2329
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2308
|
-
y:
|
|
2330
|
+
y: N.value + e.row * Ln + 22,
|
|
2309
2331
|
"font-size": e.descStyle.fontSize,
|
|
2310
2332
|
"font-weight": e.descStyle.fontWeight,
|
|
2311
2333
|
fill: e.descStyle.fill,
|
|
2312
2334
|
"fill-opacity": e.descStyle.fillOpacity
|
|
2313
|
-
}, b(e.descText), 9,
|
|
2335
|
+
}, b(e.descText), 9, Nn)) : i("", !0)
|
|
2314
2336
|
]))), 128))
|
|
2315
2337
|
], 8, tn)),
|
|
2316
|
-
|
|
2338
|
+
Oe.value && x(ze) !== null && Ne.value ? (_(), a("div", {
|
|
2317
2339
|
key: 1,
|
|
2318
2340
|
ref_key: "tooltipRef",
|
|
2319
|
-
ref:
|
|
2341
|
+
ref: Be,
|
|
2320
2342
|
class: "chart-tooltip-content",
|
|
2321
2343
|
style: h({
|
|
2322
2344
|
position: "absolute",
|
|
2323
2345
|
top: "0",
|
|
2324
2346
|
left: "0",
|
|
2325
2347
|
willChange: "transform",
|
|
2326
|
-
transform: x(
|
|
2327
|
-
visibility: x(
|
|
2348
|
+
transform: x(G) ? `translate3d(${x(G).left}px, ${x(G).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2349
|
+
visibility: x(G) ? "visible" : "hidden"
|
|
2328
2350
|
})
|
|
2329
|
-
}, [te(n.$slots, "tooltip", m(u(
|
|
2351
|
+
}, [te(n.$slots, "tooltip", m(u(Ne.value)), () => [o("div", Pn, [Ne.value.xLabel ? (_(), a("div", Fn, b(Ne.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(Ne.value.values, (e) => (_(), a("div", {
|
|
2330
2352
|
key: e.seriesIndex,
|
|
2331
2353
|
class: "line-chart-tooltip-row"
|
|
2332
2354
|
}, [o("span", {
|
|
2333
2355
|
class: "line-chart-tooltip-swatch",
|
|
2334
2356
|
style: h({ background: e.color })
|
|
2335
2357
|
}, null, 4), s(" " + b(isFinite(e.value) ? x(ie)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2336
|
-
x(
|
|
2358
|
+
x(K) ? (_(), a("a", {
|
|
2337
2359
|
key: 2,
|
|
2338
2360
|
class: "line-chart-download-link",
|
|
2339
2361
|
href: x(Ue),
|
|
2340
|
-
download: `${x(
|
|
2341
|
-
}, b(x(
|
|
2342
|
-
x(
|
|
2362
|
+
download: `${x(Ke)()}.csv`
|
|
2363
|
+
}, b(x(K)), 9, In)) : i("", !0),
|
|
2364
|
+
x(We) ? (_(), a("button", {
|
|
2343
2365
|
key: 3,
|
|
2344
2366
|
type: "button",
|
|
2345
2367
|
class: "line-chart-download-button",
|
|
2346
|
-
onClick: l[0] ||= (...e) => x(
|
|
2347
|
-
}, b(x(
|
|
2368
|
+
onClick: l[0] ||= (...e) => x(Ge) && x(Ge)(...e)
|
|
2369
|
+
}, b(x(We)), 1)) : i("", !0)
|
|
2348
2370
|
], 16)], 8, ["to", "disabled"]));
|
|
2349
2371
|
}
|
|
2350
|
-
}), [["__scopeId", "data-v-
|
|
2372
|
+
}), [["__scopeId", "data-v-a11696bb"]]), Hn = {
|
|
2351
2373
|
class: "chart-sr-only",
|
|
2352
2374
|
"aria-live": "polite"
|
|
2353
|
-
},
|
|
2375
|
+
}, Un = [
|
|
2354
2376
|
"width",
|
|
2355
2377
|
"height",
|
|
2356
2378
|
"role",
|
|
2357
2379
|
"aria-label"
|
|
2358
|
-
],
|
|
2380
|
+
], Wn = [
|
|
2359
2381
|
"x",
|
|
2360
2382
|
"y",
|
|
2361
2383
|
"text-anchor",
|
|
2362
2384
|
"font-size",
|
|
2363
2385
|
"font-weight",
|
|
2364
2386
|
"fill"
|
|
2365
|
-
],
|
|
2387
|
+
], Gn = ["x", "dy"], Kn = [
|
|
2366
2388
|
"data-testid",
|
|
2367
2389
|
"x",
|
|
2368
2390
|
"y",
|
|
2369
2391
|
"text-anchor",
|
|
2370
2392
|
"font-size",
|
|
2371
2393
|
"fill"
|
|
2372
|
-
],
|
|
2394
|
+
], qn = { key: 1 }, Jn = [
|
|
2373
2395
|
"x",
|
|
2374
2396
|
"y",
|
|
2375
2397
|
"fill"
|
|
2376
|
-
],
|
|
2398
|
+
], Yn = [
|
|
2377
2399
|
"x1",
|
|
2378
2400
|
"y1",
|
|
2379
2401
|
"x2",
|
|
2380
2402
|
"y2",
|
|
2381
2403
|
"stroke",
|
|
2382
2404
|
"stroke-dasharray"
|
|
2383
|
-
],
|
|
2405
|
+
], Xn = [
|
|
2384
2406
|
"x",
|
|
2385
2407
|
"y",
|
|
2386
2408
|
"font-size",
|
|
2387
2409
|
"fill",
|
|
2388
2410
|
"font-weight"
|
|
2389
|
-
],
|
|
2411
|
+
], Zn = [
|
|
2390
2412
|
"x1",
|
|
2391
2413
|
"y1",
|
|
2392
2414
|
"x2",
|
|
2393
2415
|
"y2"
|
|
2394
|
-
],
|
|
2416
|
+
], Qn = [
|
|
2395
2417
|
"x1",
|
|
2396
2418
|
"y1",
|
|
2397
2419
|
"x2",
|
|
2398
2420
|
"y2"
|
|
2399
|
-
],
|
|
2421
|
+
], $n = [
|
|
2400
2422
|
"x1",
|
|
2401
2423
|
"y1",
|
|
2402
2424
|
"x2",
|
|
2403
2425
|
"y2"
|
|
2404
|
-
],
|
|
2426
|
+
], er = [
|
|
2405
2427
|
"x",
|
|
2406
2428
|
"y",
|
|
2407
2429
|
"width",
|
|
2408
2430
|
"height"
|
|
2409
|
-
],
|
|
2431
|
+
], tr = [
|
|
2410
2432
|
"x",
|
|
2411
2433
|
"y",
|
|
2412
2434
|
"font-size",
|
|
2413
2435
|
"fill",
|
|
2414
2436
|
"font-weight",
|
|
2415
2437
|
"fill-opacity"
|
|
2416
|
-
],
|
|
2438
|
+
], nr = [
|
|
2417
2439
|
"x",
|
|
2418
2440
|
"y",
|
|
2419
2441
|
"font-size",
|
|
2420
2442
|
"fill",
|
|
2421
2443
|
"font-weight",
|
|
2422
2444
|
"fill-opacity"
|
|
2423
|
-
],
|
|
2445
|
+
], rr = [
|
|
2424
2446
|
"transform",
|
|
2425
2447
|
"font-size",
|
|
2426
2448
|
"fill",
|
|
2427
2449
|
"font-weight"
|
|
2428
|
-
],
|
|
2450
|
+
], ir = [
|
|
2429
2451
|
"x",
|
|
2430
2452
|
"y",
|
|
2431
2453
|
"text-anchor",
|
|
@@ -2433,7 +2455,7 @@ var en = {
|
|
|
2433
2455
|
"fill",
|
|
2434
2456
|
"font-weight",
|
|
2435
2457
|
"fill-opacity"
|
|
2436
|
-
],
|
|
2458
|
+
], ar = [
|
|
2437
2459
|
"x",
|
|
2438
2460
|
"y",
|
|
2439
2461
|
"text-anchor",
|
|
@@ -2441,13 +2463,13 @@ var en = {
|
|
|
2441
2463
|
"fill",
|
|
2442
2464
|
"font-weight",
|
|
2443
2465
|
"fill-opacity"
|
|
2444
|
-
],
|
|
2466
|
+
], $ = [
|
|
2445
2467
|
"x",
|
|
2446
2468
|
"y",
|
|
2447
2469
|
"font-size",
|
|
2448
2470
|
"fill",
|
|
2449
2471
|
"font-weight"
|
|
2450
|
-
],
|
|
2472
|
+
], or = [
|
|
2451
2473
|
"data-category",
|
|
2452
2474
|
"data-series",
|
|
2453
2475
|
"x",
|
|
@@ -2456,34 +2478,34 @@ var en = {
|
|
|
2456
2478
|
"height",
|
|
2457
2479
|
"fill",
|
|
2458
2480
|
"fill-opacity"
|
|
2459
|
-
],
|
|
2481
|
+
], sr = [
|
|
2460
2482
|
"x",
|
|
2461
2483
|
"y",
|
|
2462
2484
|
"text-anchor",
|
|
2463
2485
|
"font-size",
|
|
2464
2486
|
"font-weight",
|
|
2465
2487
|
"fill"
|
|
2466
|
-
],
|
|
2488
|
+
], cr = [
|
|
2467
2489
|
"d",
|
|
2468
2490
|
"stroke",
|
|
2469
2491
|
"stroke-width",
|
|
2470
2492
|
"stroke-opacity",
|
|
2471
2493
|
"stroke-dasharray"
|
|
2472
|
-
],
|
|
2494
|
+
], lr = [
|
|
2473
2495
|
"cx",
|
|
2474
2496
|
"cy",
|
|
2475
2497
|
"r",
|
|
2476
2498
|
"fill",
|
|
2477
2499
|
"fill-opacity"
|
|
2478
|
-
],
|
|
2500
|
+
], ur = [
|
|
2479
2501
|
"x",
|
|
2480
2502
|
"y",
|
|
2481
2503
|
"width",
|
|
2482
2504
|
"height"
|
|
2483
|
-
],
|
|
2505
|
+
], dr = { class: "bar-chart-tooltip" }, fr = {
|
|
2484
2506
|
key: 0,
|
|
2485
2507
|
class: "bar-chart-tooltip-label"
|
|
2486
|
-
},
|
|
2508
|
+
}, pr = ["href", "download"], mr = 22, hr = 2, gr = 11, _r = .6, vr = 4, yr = 4, br = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
2487
2509
|
inheritAttrs: !1,
|
|
2488
2510
|
__name: "BarChart",
|
|
2489
2511
|
props: {
|
|
@@ -2532,7 +2554,7 @@ var en = {
|
|
|
2532
2554
|
},
|
|
2533
2555
|
tooltipData: {},
|
|
2534
2556
|
tooltipTrigger: {},
|
|
2535
|
-
tooltipClamp: { default: "
|
|
2557
|
+
tooltipClamp: { default: "window" },
|
|
2536
2558
|
tooltipValueFormat: {},
|
|
2537
2559
|
csv: {},
|
|
2538
2560
|
filename: {},
|
|
@@ -2599,13 +2621,13 @@ var en = {
|
|
|
2599
2621
|
isFinite(e) || (e = 0), isFinite(t) || (t = 0);
|
|
2600
2622
|
let i = f.valueMin ?? 0;
|
|
2601
2623
|
f.valueScaleType === "log" ? i > 0 && i < e && (e = i) : i < e && (e = i);
|
|
2602
|
-
let a =
|
|
2624
|
+
let a = Te(e, t, f.valueScaleType, n);
|
|
2603
2625
|
return {
|
|
2604
2626
|
min: a.min,
|
|
2605
2627
|
max: a.max,
|
|
2606
2628
|
range: a.max - a.min || 1
|
|
2607
2629
|
};
|
|
2608
|
-
}), oe = n(() => T.value ?
|
|
2630
|
+
}), oe = n(() => T.value ? B.value : V.value), D = n(() => T.value ? V.value : B.value), O = n(() => {
|
|
2609
2631
|
let e = ie.value;
|
|
2610
2632
|
return e > 0 ? oe.value / e : 0;
|
|
2611
2633
|
}), k = n(() => O.value * (1 - f.barPadding)), se = n(() => {
|
|
@@ -2615,18 +2637,18 @@ var en = {
|
|
|
2615
2637
|
let t = f.groupGap * (e - 1);
|
|
2616
2638
|
return Math.max(1, (k.value - t) / e);
|
|
2617
2639
|
});
|
|
2618
|
-
function
|
|
2619
|
-
return (T.value ?
|
|
2640
|
+
function ce(e) {
|
|
2641
|
+
return (T.value ? z.value.left : z.value.top) + e * O.value;
|
|
2620
2642
|
}
|
|
2621
|
-
let
|
|
2643
|
+
let le = n(() => {
|
|
2622
2644
|
let { min: e, max: t } = E.value, n = f.valueMin ?? 0;
|
|
2623
|
-
return
|
|
2645
|
+
return A(Math.max(e, Math.min(t, n)));
|
|
2624
2646
|
});
|
|
2625
|
-
function
|
|
2626
|
-
let { min: t, max: n } = E.value, r =
|
|
2627
|
-
return T.value ?
|
|
2647
|
+
function A(e) {
|
|
2648
|
+
let { min: t, max: n } = E.value, r = we(e, t, n, f.valueScaleType);
|
|
2649
|
+
return T.value ? z.value.top + V.value - r * V.value : z.value.left + r * B.value;
|
|
2628
2650
|
}
|
|
2629
|
-
function
|
|
2651
|
+
function ue(e, t, n, r, i, a, o, s, c, l) {
|
|
2630
2652
|
let u = Math.min(e, t), d = Math.abs(e - t);
|
|
2631
2653
|
return T.value ? {
|
|
2632
2654
|
x: n,
|
|
@@ -2652,34 +2674,34 @@ var en = {
|
|
|
2652
2674
|
seriesIndex: l
|
|
2653
2675
|
};
|
|
2654
2676
|
}
|
|
2655
|
-
let
|
|
2677
|
+
let j = n(() => {
|
|
2656
2678
|
let e = [], t = S.value, n = t.length;
|
|
2657
2679
|
if (n === 0) return e;
|
|
2658
|
-
let r = ie.value, i = O.value, a = k.value, o = se.value, s = (i - a) / 2, c =
|
|
2680
|
+
let r = ie.value, i = O.value, a = k.value, o = se.value, s = (i - a) / 2, c = le.value;
|
|
2659
2681
|
for (let i = 0; i < r; i++) {
|
|
2660
|
-
let r =
|
|
2682
|
+
let r = ce(i) + s;
|
|
2661
2683
|
if (f.layout === "stacked") {
|
|
2662
2684
|
let o = 0, s = 0;
|
|
2663
2685
|
for (let c = 0; c < n; c++) {
|
|
2664
2686
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
2665
2687
|
if (!isFinite(l)) continue;
|
|
2666
2688
|
let u = l >= 0 ? o : s, d = u + l;
|
|
2667
|
-
e.push(
|
|
2689
|
+
e.push(ue(A(u), A(d), r, a, n.color ?? _e(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
|
|
2668
2690
|
}
|
|
2669
2691
|
} else if (f.layout === "overlay") for (let o = 0; o < n; o++) {
|
|
2670
2692
|
let n = t[o], s = Number(n.data[i] ?? NaN);
|
|
2671
|
-
isFinite(s) && e.push(
|
|
2693
|
+
isFinite(s) && e.push(ue(c, A(s), r, a, n.color ?? _e(o), n.opacity ?? 1, n.blendMode, s, i, o));
|
|
2672
2694
|
}
|
|
2673
2695
|
else for (let a = 0; a < n; a++) {
|
|
2674
2696
|
let s = t[a], l = Number(s.data[i] ?? NaN);
|
|
2675
2697
|
if (!isFinite(l)) continue;
|
|
2676
2698
|
let u = r + (n === 1 ? 0 : a * (o + f.groupGap));
|
|
2677
|
-
e.push(
|
|
2699
|
+
e.push(ue(c, A(l), u, o, s.color ?? _e(a), s.opacity ?? 1, s.blendMode, l, i, a));
|
|
2678
2700
|
}
|
|
2679
2701
|
}
|
|
2680
2702
|
return e;
|
|
2681
2703
|
});
|
|
2682
|
-
function
|
|
2704
|
+
function de(e) {
|
|
2683
2705
|
let t = Infinity, n = -Infinity;
|
|
2684
2706
|
for (let r of e.data) {
|
|
2685
2707
|
let e = Number(r);
|
|
@@ -2690,33 +2712,33 @@ var en = {
|
|
|
2690
2712
|
max: n
|
|
2691
2713
|
};
|
|
2692
2714
|
}
|
|
2693
|
-
function
|
|
2694
|
-
let r = (T.value ?
|
|
2715
|
+
function fe(e, t, n) {
|
|
2716
|
+
let r = (T.value ? z.value.left : z.value.top) + (e + .5) * O.value, i = n.max - n.min || 1, a = (t - n.min) / i;
|
|
2695
2717
|
return T.value ? {
|
|
2696
2718
|
x: r,
|
|
2697
|
-
y:
|
|
2719
|
+
y: z.value.top + V.value - a * V.value
|
|
2698
2720
|
} : {
|
|
2699
|
-
x:
|
|
2721
|
+
x: z.value.left + a * B.value,
|
|
2700
2722
|
y: r
|
|
2701
2723
|
};
|
|
2702
2724
|
}
|
|
2703
|
-
let
|
|
2725
|
+
let pe = n(() => {
|
|
2704
2726
|
let e = f.summaryLines;
|
|
2705
2727
|
return !e || e.length === 0 ? [] : e.map((e, t) => ({
|
|
2706
2728
|
data: e.data ?? v,
|
|
2707
2729
|
x: e.x,
|
|
2708
|
-
color: e.color ??
|
|
2730
|
+
color: e.color ?? he(t),
|
|
2709
2731
|
strokeWidth: e.strokeWidth ?? 2,
|
|
2710
2732
|
dashed: e.dashed ?? !1,
|
|
2711
2733
|
opacity: e.opacity ?? 1,
|
|
2712
2734
|
blendMode: e.blendMode,
|
|
2713
2735
|
dots: e.dots ?? !1,
|
|
2714
2736
|
dotRadius: e.dotRadius ?? (e.strokeWidth ?? 2) + 1,
|
|
2715
|
-
extent:
|
|
2737
|
+
extent: de(e),
|
|
2716
2738
|
legend: e.legend,
|
|
2717
2739
|
showInLegend: e.showInLegend !== !1
|
|
2718
2740
|
}));
|
|
2719
|
-
}),
|
|
2741
|
+
}), M = n(() => O.value === 0 ? [] : pe.value.map((e) => {
|
|
2720
2742
|
let t = [], n = "", r = !1;
|
|
2721
2743
|
for (let i = 0; i < e.data.length; i++) {
|
|
2722
2744
|
let a = Number(e.data[i]), o = e.x ? Number(e.x[i]) : i;
|
|
@@ -2724,7 +2746,7 @@ var en = {
|
|
|
2724
2746
|
r = !1;
|
|
2725
2747
|
continue;
|
|
2726
2748
|
}
|
|
2727
|
-
let s =
|
|
2749
|
+
let s = fe(o, a, e.extent);
|
|
2728
2750
|
t.push(s), n += r ? `L${s.x},${s.y}` : `M${s.x},${s.y}`, r = !0;
|
|
2729
2751
|
}
|
|
2730
2752
|
return {
|
|
@@ -2732,16 +2754,16 @@ var en = {
|
|
|
2732
2754
|
pathD: n,
|
|
2733
2755
|
points: t
|
|
2734
2756
|
};
|
|
2735
|
-
})),
|
|
2757
|
+
})), me = [
|
|
2736
2758
|
"var(--color-fg-1, #111)",
|
|
2737
2759
|
"var(--color-danger, #ef4444)",
|
|
2738
2760
|
"var(--color-success, #10b981)",
|
|
2739
2761
|
"var(--color-info, #6366f1)"
|
|
2740
2762
|
];
|
|
2741
|
-
function
|
|
2742
|
-
return
|
|
2763
|
+
function he(e) {
|
|
2764
|
+
return me[e % me.length];
|
|
2743
2765
|
}
|
|
2744
|
-
let
|
|
2766
|
+
let ge = [
|
|
2745
2767
|
"var(--color-primary, #3b82f6)",
|
|
2746
2768
|
"var(--color-accent, #f59e0b)",
|
|
2747
2769
|
"var(--color-success, #10b981)",
|
|
@@ -2749,36 +2771,36 @@ var en = {
|
|
|
2749
2771
|
"var(--color-info, #6366f1)",
|
|
2750
2772
|
"var(--color-warning, #d97706)"
|
|
2751
2773
|
];
|
|
2752
|
-
function
|
|
2753
|
-
return
|
|
2774
|
+
function _e(e) {
|
|
2775
|
+
return ge[e % ge.length];
|
|
2754
2776
|
}
|
|
2755
|
-
let
|
|
2756
|
-
let { min: e, max: t } = E.value, n = (e) => f.valueTickFormat === void 0 ?
|
|
2777
|
+
let ve = Tt(() => f.tooltipValueFormat, () => f.valueTickFormat), N = n(() => {
|
|
2778
|
+
let { min: e, max: t } = E.value, n = (e) => f.valueTickFormat === void 0 ? Ce(e) : ae(e, f.valueTickFormat);
|
|
2757
2779
|
if (e === t) return [{
|
|
2758
2780
|
value: n(e),
|
|
2759
|
-
pos:
|
|
2781
|
+
pos: P(A(e))
|
|
2760
2782
|
}];
|
|
2761
2783
|
let r = T.value ? 50 : 80;
|
|
2762
|
-
return (f.valueScaleType === "log" ?
|
|
2784
|
+
return (f.valueScaleType === "log" ? I({
|
|
2763
2785
|
min: e,
|
|
2764
2786
|
max: t,
|
|
2765
2787
|
ticks: f.valueTicks
|
|
2766
|
-
}) :
|
|
2788
|
+
}) : F({
|
|
2767
2789
|
min: e,
|
|
2768
2790
|
max: t,
|
|
2769
2791
|
ticks: f.valueTicks,
|
|
2770
2792
|
targetTickCount: D.value / r
|
|
2771
2793
|
})).map((e) => ({
|
|
2772
2794
|
value: n(e),
|
|
2773
|
-
pos:
|
|
2795
|
+
pos: P(A(e))
|
|
2774
2796
|
}));
|
|
2775
|
-
}),
|
|
2797
|
+
}), be = n(() => {
|
|
2776
2798
|
let e = ie.value, t = w.value;
|
|
2777
2799
|
if (t && t.length > 0) {
|
|
2778
2800
|
let e = Infinity, n = -Infinity;
|
|
2779
2801
|
for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
|
|
2780
2802
|
if (!Number.isFinite(e) || e === n) return [];
|
|
2781
|
-
let r = T.value ?
|
|
2803
|
+
let r = T.value ? B.value : V.value, i = Math.max(2, Math.floor(r / 80)), a = qt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
|
|
2782
2804
|
for (let e of a.values) {
|
|
2783
2805
|
let n = -1, r = Infinity;
|
|
2784
2806
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -2787,7 +2809,7 @@ var en = {
|
|
|
2787
2809
|
}
|
|
2788
2810
|
if (n < 0 || c.has(n)) continue;
|
|
2789
2811
|
c.add(n);
|
|
2790
|
-
let i =
|
|
2812
|
+
let i = ce(n) + O.value / 2, a = f.categoryFormat ? f.categoryFormat(C.value[n], n) : $t(t[n], f.dateFormat, "utc", o);
|
|
2791
2813
|
s.push({
|
|
2792
2814
|
label: a,
|
|
2793
2815
|
pos: i,
|
|
@@ -2800,7 +2822,7 @@ var en = {
|
|
|
2800
2822
|
for (let t = 0; t < e; t++) i[t] = r(C.value[t], t), i[t].length > a && (a = i[t].length);
|
|
2801
2823
|
let o = f.tickLabelStyle?.fontSize ?? 10, s = T.value ? a * o * .6 + 8 : o * 1.2 + 8, c = O.value > 0 ? Math.max(1, Math.ceil(s / O.value)) : 1;
|
|
2802
2824
|
for (let t = 0; t < e; t += c) {
|
|
2803
|
-
let e =
|
|
2825
|
+
let e = ce(t) + O.value / 2;
|
|
2804
2826
|
n.push({
|
|
2805
2827
|
label: i[t],
|
|
2806
2828
|
pos: e,
|
|
@@ -2808,15 +2830,15 @@ var en = {
|
|
|
2808
2830
|
});
|
|
2809
2831
|
}
|
|
2810
2832
|
return n;
|
|
2811
|
-
}),
|
|
2833
|
+
}), xe = n(() => {
|
|
2812
2834
|
let e = [];
|
|
2813
2835
|
return S.value.forEach((t, n) => {
|
|
2814
2836
|
!t.legend || t.showInLegend === !1 || e.push({
|
|
2815
2837
|
label: t.legend,
|
|
2816
|
-
color: t.color ??
|
|
2838
|
+
color: t.color ?? _e(n),
|
|
2817
2839
|
kind: "bar"
|
|
2818
2840
|
});
|
|
2819
|
-
}),
|
|
2841
|
+
}), pe.value.forEach((t) => {
|
|
2820
2842
|
!t.legend || !t.showInLegend || e.push({
|
|
2821
2843
|
label: t.legend,
|
|
2822
2844
|
color: t.color,
|
|
@@ -2824,20 +2846,20 @@ var en = {
|
|
|
2824
2846
|
dashed: t.dashed
|
|
2825
2847
|
});
|
|
2826
2848
|
}), e;
|
|
2827
|
-
}),
|
|
2828
|
-
function
|
|
2849
|
+
}), Se = n(() => xe.value.map((e) => e.label));
|
|
2850
|
+
function Ee() {
|
|
2829
2851
|
if (typeof f.csv == "function") return f.csv();
|
|
2830
2852
|
if (typeof f.csv == "string") return f.csv;
|
|
2831
2853
|
let e = S.value.map((e) => ({
|
|
2832
2854
|
label: e.legend,
|
|
2833
2855
|
data: e.data
|
|
2834
2856
|
}));
|
|
2835
|
-
return
|
|
2857
|
+
return $e(C.value, e);
|
|
2836
2858
|
}
|
|
2837
|
-
let
|
|
2838
|
-
function
|
|
2859
|
+
let Oe = n(() => !!f.tooltipData || !!f.tooltipTrigger);
|
|
2860
|
+
function L(e, t) {
|
|
2839
2861
|
if (!isFinite(e) || !isFinite(t) || O.value === 0) return null;
|
|
2840
|
-
let n = (T.value ?
|
|
2862
|
+
let n = (T.value ? z.value.left : z.value.top) + (e + .5) * O.value, r = A(t);
|
|
2841
2863
|
return T.value ? {
|
|
2842
2864
|
x: n,
|
|
2843
2865
|
y: r
|
|
@@ -2846,16 +2868,16 @@ var en = {
|
|
|
2846
2868
|
y: n
|
|
2847
2869
|
};
|
|
2848
2870
|
}
|
|
2849
|
-
function
|
|
2850
|
-
let n =
|
|
2871
|
+
function Ae(e, t) {
|
|
2872
|
+
let n = Ne.value?.getBoundingClientRect();
|
|
2851
2873
|
if (!n) return null;
|
|
2852
2874
|
let r = ie.value;
|
|
2853
2875
|
if (r === 0 || O.value === 0) return null;
|
|
2854
|
-
let i = T.value ? e - n.left -
|
|
2876
|
+
let i = T.value ? e - n.left - z.value.left : t - n.top - z.value.top;
|
|
2855
2877
|
return Math.max(0, Math.min(r - 1, Math.floor(i / O.value)));
|
|
2856
2878
|
}
|
|
2857
|
-
let
|
|
2858
|
-
let e =
|
|
2879
|
+
let je = n(() => !!(f.categoryHeader || f.valueHeader)), Me = n(() => {
|
|
2880
|
+
let e = je.value ? mr : 0, t = f.chartPadding;
|
|
2859
2881
|
return e ? t == null ? { top: e } : typeof t == "number" ? {
|
|
2860
2882
|
top: t + e,
|
|
2861
2883
|
right: t,
|
|
@@ -2865,7 +2887,7 @@ var en = {
|
|
|
2865
2887
|
...t,
|
|
2866
2888
|
top: (t.top ?? 0) + e
|
|
2867
2889
|
} : t;
|
|
2868
|
-
}), { containerRef:
|
|
2890
|
+
}), { containerRef: Ne, svgRef: Pe, width: Fe, height: R, padding: z, legendY: Ie, inlineLegendLayout: Le, innerW: B, innerH: V, bounds: H, hoverIndex: U, tooltipRef: W, tooltipPos: Re, tooltipHandlers: ze, menuItems: Be, downloadLinkText: G, csvHref: Ve, downloadButtonText: He, triggerCsvDownload: K, menuFilename: Ue, isFullscreen: We, fullscreenStyle: Ge, teleportTarget: Ke, exitFullscreen: qe } = wt({
|
|
2869
2891
|
width: () => f.width,
|
|
2870
2892
|
height: () => f.height,
|
|
2871
2893
|
title: () => f.title,
|
|
@@ -2880,18 +2902,18 @@ var en = {
|
|
|
2880
2902
|
downloadLink: () => f.downloadLink,
|
|
2881
2903
|
downloadButton: () => f.downloadButton,
|
|
2882
2904
|
fullscreenTarget: () => f.fullscreenTarget,
|
|
2883
|
-
chartPadding: () =>
|
|
2884
|
-
inlineLegendLabels: () =>
|
|
2885
|
-
hasTooltipSlot: () =>
|
|
2886
|
-
getCsv:
|
|
2887
|
-
pointerToIndex:
|
|
2905
|
+
chartPadding: () => Me.value,
|
|
2906
|
+
inlineLegendLabels: () => Se.value,
|
|
2907
|
+
hasTooltipSlot: () => Oe.value,
|
|
2908
|
+
getCsv: Ee,
|
|
2909
|
+
pointerToIndex: Ae,
|
|
2888
2910
|
scrubAxis: () => T.value ? "x" : "y",
|
|
2889
2911
|
onHover: (e) => ee("hover", e)
|
|
2890
|
-
}),
|
|
2912
|
+
}), q = n(() => ke(f.axisLabelStyle, { fontSize: 13 })), J = n(() => ke(f.tickLabelStyle, {
|
|
2891
2913
|
fontSize: 10,
|
|
2892
|
-
fillOpacity:
|
|
2893
|
-
})),
|
|
2894
|
-
let e = f.titleStyle, t = e?.align ?? "left", n =
|
|
2914
|
+
fillOpacity: De
|
|
2915
|
+
})), Je = n(() => ke(f.legendStyle, { fontSize: 11 })), Ye = n(() => f.categoryAlign === "start" && !T.value ? hr : z.value.left), Y = n(() => {
|
|
2916
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = H.value, r = t === "left" ? Ye.value : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
2895
2917
|
return {
|
|
2896
2918
|
lines: (f.title ?? "").split("\n"),
|
|
2897
2919
|
fontSize: e?.fontSize ?? 14,
|
|
@@ -2901,20 +2923,20 @@ var en = {
|
|
|
2901
2923
|
x: r,
|
|
2902
2924
|
anchor: i
|
|
2903
2925
|
};
|
|
2904
|
-
}),
|
|
2905
|
-
let e =
|
|
2926
|
+
}), Xe = n(() => {
|
|
2927
|
+
let e = U.value;
|
|
2906
2928
|
if (e === null) return;
|
|
2907
2929
|
let t = w.value;
|
|
2908
2930
|
return t && Number.isFinite(t[e]) ? $t(t[e], f.dateFormat, "utc") : C.value[e];
|
|
2909
|
-
}),
|
|
2910
|
-
let e =
|
|
2931
|
+
}), Ze = n(() => {
|
|
2932
|
+
let e = U.value;
|
|
2911
2933
|
if (e === null) return null;
|
|
2912
2934
|
let t = S.value, n = [];
|
|
2913
2935
|
for (let r = 0; r < t.length; r++) {
|
|
2914
2936
|
let i = t[r];
|
|
2915
2937
|
i.showInTooltip !== !1 && n.push({
|
|
2916
2938
|
value: Number(i.data[e] ?? NaN),
|
|
2917
|
-
color: i.color ??
|
|
2939
|
+
color: i.color ?? _e(r),
|
|
2918
2940
|
seriesIndex: r
|
|
2919
2941
|
});
|
|
2920
2942
|
}
|
|
@@ -2924,24 +2946,24 @@ var en = {
|
|
|
2924
2946
|
values: n,
|
|
2925
2947
|
data: f.tooltipData?.[e] ?? null
|
|
2926
2948
|
};
|
|
2927
|
-
}),
|
|
2928
|
-
let e =
|
|
2949
|
+
}), Qe = n(() => {
|
|
2950
|
+
let e = U.value;
|
|
2929
2951
|
if (e === null) return null;
|
|
2930
|
-
let t =
|
|
2952
|
+
let t = ce(e);
|
|
2931
2953
|
return T.value ? {
|
|
2932
2954
|
x: t,
|
|
2933
|
-
y:
|
|
2955
|
+
y: z.value.top,
|
|
2934
2956
|
w: O.value,
|
|
2935
|
-
h:
|
|
2957
|
+
h: V.value
|
|
2936
2958
|
} : {
|
|
2937
|
-
x:
|
|
2959
|
+
x: z.value.left,
|
|
2938
2960
|
y: t,
|
|
2939
|
-
w:
|
|
2961
|
+
w: B.value,
|
|
2940
2962
|
h: O.value
|
|
2941
2963
|
};
|
|
2942
|
-
}),
|
|
2943
|
-
let e =
|
|
2944
|
-
return
|
|
2964
|
+
}), et = n(() => {
|
|
2965
|
+
let e = Le.value.positions, t = Ye.value, n = Ie.value;
|
|
2966
|
+
return xe.value.map((r, i) => {
|
|
2945
2967
|
let a = e[i];
|
|
2946
2968
|
return {
|
|
2947
2969
|
...r,
|
|
@@ -2949,7 +2971,7 @@ var en = {
|
|
|
2949
2971
|
y: n + a.row * 20
|
|
2950
2972
|
};
|
|
2951
2973
|
});
|
|
2952
|
-
}),
|
|
2974
|
+
}), tt = n(() => {
|
|
2953
2975
|
let e = f.barLabels;
|
|
2954
2976
|
if (!e) return null;
|
|
2955
2977
|
let t = e === !0 ? {} : e;
|
|
@@ -2960,37 +2982,37 @@ var en = {
|
|
|
2960
2982
|
align: t.align ?? "center",
|
|
2961
2983
|
overlap: t.overlap ?? "shift",
|
|
2962
2984
|
minSize: t.minSize ?? 0,
|
|
2963
|
-
fontSize: t.fontSize ??
|
|
2985
|
+
fontSize: t.fontSize ?? gr,
|
|
2964
2986
|
fontWeight: t.fontWeight
|
|
2965
2987
|
};
|
|
2966
2988
|
});
|
|
2967
|
-
function
|
|
2968
|
-
let n =
|
|
2969
|
-
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ?
|
|
2989
|
+
function nt(e, t) {
|
|
2990
|
+
let n = tt.value?.format;
|
|
2991
|
+
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ? Ce(e) : ae(e, f.valueTickFormat) : ae(e, n);
|
|
2970
2992
|
}
|
|
2971
|
-
function
|
|
2972
|
-
for (let r =
|
|
2973
|
-
let i =
|
|
2993
|
+
function rt(e, t, n) {
|
|
2994
|
+
for (let r = j.value.length - 1; r >= 0; r--) {
|
|
2995
|
+
let i = j.value[r];
|
|
2974
2996
|
if (i.categoryIndex === e && t >= i.x && t <= i.x + i.w && n >= i.y && n <= i.y + i.h) return i.color;
|
|
2975
2997
|
}
|
|
2976
2998
|
return null;
|
|
2977
2999
|
}
|
|
2978
|
-
let
|
|
2979
|
-
let e =
|
|
3000
|
+
let it = n(() => {
|
|
3001
|
+
let e = tt.value;
|
|
2980
3002
|
if (!e) return [];
|
|
2981
3003
|
let t = T.value, n = e.fontSize, r = [];
|
|
2982
|
-
for (let i of
|
|
2983
|
-
let a =
|
|
3004
|
+
for (let i of j.value) {
|
|
3005
|
+
let a = nt(i.value, {
|
|
2984
3006
|
value: i.value,
|
|
2985
3007
|
categoryIndex: i.categoryIndex,
|
|
2986
3008
|
seriesIndex: i.seriesIndex,
|
|
2987
3009
|
category: C.value[i.categoryIndex] ?? String(i.categoryIndex)
|
|
2988
3010
|
});
|
|
2989
3011
|
if (!a) continue;
|
|
2990
|
-
let o = t ? i.h : i.w, s = a.length * n *
|
|
2991
|
-
if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m +
|
|
2992
|
-
else if (e.align === "start") u = h +
|
|
2993
|
-
else if (e.align === "end") d = m -
|
|
3012
|
+
let o = t ? i.h : i.w, s = a.length * n * _r, c = o >= s + 2 * vr && o >= e.minSize, l = e.placement === "inside" ? !0 : e.placement === "outside" ? !1 : c, u, d, f, p = "middle", m = t ? -i.y : i.x + i.w, h = t ? -(i.y + i.h) : i.x, g = t ? n : s;
|
|
3013
|
+
if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m + vr, d = u + g, p = "start";
|
|
3014
|
+
else if (e.align === "start") u = h + vr, d = u + g, p = "start";
|
|
3015
|
+
else if (e.align === "end") d = m - vr, u = d - g, p = "end";
|
|
2994
3016
|
else {
|
|
2995
3017
|
let e = (m + h) / 2;
|
|
2996
3018
|
u = e - g / 2, d = e + g / 2, p = "middle";
|
|
@@ -3007,7 +3029,7 @@ var en = {
|
|
|
3007
3029
|
hidden: !1
|
|
3008
3030
|
});
|
|
3009
3031
|
}
|
|
3010
|
-
let i = t ? -
|
|
3032
|
+
let i = t ? -z.value.top : Fe.value - 2, a = /* @__PURE__ */ new Map();
|
|
3011
3033
|
for (let e of r) {
|
|
3012
3034
|
let t = a.get(e.bar.categoryIndex);
|
|
3013
3035
|
t ? t.push(e) : a.set(e.bar.categoryIndex, [e]);
|
|
@@ -3016,12 +3038,12 @@ var en = {
|
|
|
3016
3038
|
t.sort((e, t) => e.lo - t.lo);
|
|
3017
3039
|
let n = -Infinity;
|
|
3018
3040
|
for (let r of t) {
|
|
3019
|
-
if (r.lo < n +
|
|
3041
|
+
if (r.lo < n + yr) {
|
|
3020
3042
|
if (e.overlap === "hide") {
|
|
3021
3043
|
r.hidden = !0;
|
|
3022
3044
|
continue;
|
|
3023
3045
|
}
|
|
3024
|
-
let t = n +
|
|
3046
|
+
let t = n + yr - r.lo;
|
|
3025
3047
|
r.lo += t, r.hi += t, r.inside = !1, r.svgAnchor = "start";
|
|
3026
3048
|
}
|
|
3027
3049
|
if (r.hi > i) {
|
|
@@ -3038,10 +3060,10 @@ var en = {
|
|
|
3038
3060
|
t ? (r = i.cross, a = -((i.lo + i.hi) / 2), c = "middle") : (c = i.svgAnchor, r = c === "start" ? i.lo : c === "end" ? i.hi : (i.lo + i.hi) / 2, a = i.cross);
|
|
3039
3061
|
let l;
|
|
3040
3062
|
if (!o) l = e.color;
|
|
3041
|
-
else if (i.inside) l =
|
|
3063
|
+
else if (i.inside) l = jt(i.bar.color);
|
|
3042
3064
|
else {
|
|
3043
|
-
let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r =
|
|
3044
|
-
l = r ?
|
|
3065
|
+
let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r = rt(i.bar.categoryIndex, e, n);
|
|
3066
|
+
l = r ? jt(r) : "currentColor";
|
|
3045
3067
|
}
|
|
3046
3068
|
s.push({
|
|
3047
3069
|
key: `${i.bar.categoryIndex}-${i.bar.seriesIndex}`,
|
|
@@ -3055,36 +3077,36 @@ var en = {
|
|
|
3055
3077
|
});
|
|
3056
3078
|
}
|
|
3057
3079
|
return s;
|
|
3058
|
-
}),
|
|
3059
|
-
let e =
|
|
3080
|
+
}), at = n(() => {
|
|
3081
|
+
let e = z.value.left - 6;
|
|
3060
3082
|
switch (f.categoryAlign ?? "end") {
|
|
3061
3083
|
case "start": return {
|
|
3062
3084
|
anchor: "start",
|
|
3063
|
-
x:
|
|
3085
|
+
x: hr
|
|
3064
3086
|
};
|
|
3065
3087
|
case "center": return {
|
|
3066
3088
|
anchor: "middle",
|
|
3067
|
-
x: (
|
|
3089
|
+
x: (hr + e) / 2
|
|
3068
3090
|
};
|
|
3069
3091
|
default: return {
|
|
3070
3092
|
anchor: "end",
|
|
3071
3093
|
x: e
|
|
3072
3094
|
};
|
|
3073
3095
|
}
|
|
3074
|
-
}),
|
|
3075
|
-
let e = [], t =
|
|
3096
|
+
}), ot = n(() => {
|
|
3097
|
+
let e = [], t = z.value.top - 7;
|
|
3076
3098
|
if (f.valueHeader && e.push({
|
|
3077
3099
|
key: "vh",
|
|
3078
3100
|
text: f.valueHeader,
|
|
3079
|
-
x:
|
|
3101
|
+
x: z.value.left,
|
|
3080
3102
|
y: t,
|
|
3081
3103
|
anchor: "start"
|
|
3082
3104
|
}), f.categoryHeader) {
|
|
3083
|
-
let n = !T.value, r =
|
|
3105
|
+
let n = !T.value, r = at.value;
|
|
3084
3106
|
e.push({
|
|
3085
3107
|
key: "ch",
|
|
3086
3108
|
text: f.categoryHeader,
|
|
3087
|
-
x: n ? r.x :
|
|
3109
|
+
x: n ? r.x : z.value.left,
|
|
3088
3110
|
y: t,
|
|
3089
3111
|
anchor: n ? r.anchor : "start"
|
|
3090
3112
|
});
|
|
@@ -3092,65 +3114,65 @@ var en = {
|
|
|
3092
3114
|
return e;
|
|
3093
3115
|
});
|
|
3094
3116
|
return (n, l) => (_(), r(t, {
|
|
3095
|
-
to: x(
|
|
3096
|
-
disabled: !x(
|
|
3117
|
+
to: x(Ke),
|
|
3118
|
+
disabled: !x(We)
|
|
3097
3119
|
}, [o("div", d({
|
|
3098
3120
|
ref_key: "containerRef",
|
|
3099
|
-
ref:
|
|
3121
|
+
ref: Ne
|
|
3100
3122
|
}, n.$attrs, {
|
|
3101
|
-
class: ["bar-chart-wrapper", { "is-fullscreen": x(
|
|
3102
|
-
style: x(
|
|
3123
|
+
class: ["bar-chart-wrapper", { "is-fullscreen": x(We) }],
|
|
3124
|
+
style: x(Ge)
|
|
3103
3125
|
}), [
|
|
3104
|
-
c.menu ? (_(), r(
|
|
3126
|
+
c.menu ? (_(), r(ye, {
|
|
3105
3127
|
key: 0,
|
|
3106
|
-
items: x(
|
|
3107
|
-
"is-fullscreen": x(
|
|
3108
|
-
onClose: x(
|
|
3128
|
+
items: x(Be),
|
|
3129
|
+
"is-fullscreen": x(We),
|
|
3130
|
+
onClose: x(qe)
|
|
3109
3131
|
}, null, 8, [
|
|
3110
3132
|
"items",
|
|
3111
3133
|
"is-fullscreen",
|
|
3112
3134
|
"onClose"
|
|
3113
3135
|
])) : i("", !0),
|
|
3114
|
-
o("div",
|
|
3136
|
+
o("div", Hn, b(x(We) ? "Chart expanded to fill window" : ""), 1),
|
|
3115
3137
|
(_(), a("svg", {
|
|
3116
3138
|
ref_key: "svgRef",
|
|
3117
|
-
ref:
|
|
3118
|
-
width: x(
|
|
3119
|
-
height: x(
|
|
3139
|
+
ref: Pe,
|
|
3140
|
+
width: x(Fe),
|
|
3141
|
+
height: x(R),
|
|
3120
3142
|
role: g.value || void 0,
|
|
3121
3143
|
"aria-label": p.value || void 0
|
|
3122
3144
|
}, [
|
|
3123
3145
|
c.title ? (_(), a("text", {
|
|
3124
3146
|
key: 0,
|
|
3125
|
-
x:
|
|
3126
|
-
y:
|
|
3127
|
-
"text-anchor":
|
|
3128
|
-
"font-size":
|
|
3129
|
-
"font-weight":
|
|
3130
|
-
fill:
|
|
3131
|
-
}, [(_(!0), a(e, null, y(
|
|
3147
|
+
x: Y.value.x,
|
|
3148
|
+
y: Y.value.lineHeight,
|
|
3149
|
+
"text-anchor": Y.value.anchor,
|
|
3150
|
+
"font-size": Y.value.fontSize,
|
|
3151
|
+
"font-weight": Y.value.fontWeight,
|
|
3152
|
+
fill: Y.value.color
|
|
3153
|
+
}, [(_(!0), a(e, null, y(Y.value.lines, (e, t) => (_(), a("tspan", {
|
|
3132
3154
|
key: t,
|
|
3133
|
-
x:
|
|
3134
|
-
dy: t === 0 ? 0 :
|
|
3135
|
-
}, b(e), 9,
|
|
3136
|
-
(_(!0), a(e, null, y(
|
|
3155
|
+
x: Y.value.x,
|
|
3156
|
+
dy: t === 0 ? 0 : Y.value.lineHeight
|
|
3157
|
+
}, b(e), 9, Gn))), 128))], 8, Wn)) : i("", !0),
|
|
3158
|
+
(_(!0), a(e, null, y(ot.value, (e) => (_(), a("text", {
|
|
3137
3159
|
key: e.key,
|
|
3138
3160
|
"data-testid": e.key === "ch" ? "category-header" : "value-header",
|
|
3139
3161
|
x: e.x,
|
|
3140
3162
|
y: e.y,
|
|
3141
3163
|
"text-anchor": e.anchor,
|
|
3142
|
-
"font-size":
|
|
3143
|
-
fill:
|
|
3164
|
+
"font-size": q.value.fontSize,
|
|
3165
|
+
fill: q.value.fill,
|
|
3144
3166
|
"font-weight": "600"
|
|
3145
|
-
}, b(e.text), 9,
|
|
3146
|
-
|
|
3167
|
+
}, b(e.text), 9, Kn))), 128)),
|
|
3168
|
+
et.value.length > 0 ? (_(), a("g", qn, [(_(!0), a(e, null, y(et.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.kind === "bar" ? (_(), a("rect", {
|
|
3147
3169
|
key: 0,
|
|
3148
3170
|
x: t.x,
|
|
3149
3171
|
y: t.y - 5,
|
|
3150
3172
|
width: "12",
|
|
3151
3173
|
height: "10",
|
|
3152
3174
|
fill: t.color
|
|
3153
|
-
}, null, 8,
|
|
3175
|
+
}, null, 8, Jn)) : (_(), a("line", {
|
|
3154
3176
|
key: 1,
|
|
3155
3177
|
x1: t.x,
|
|
3156
3178
|
y1: t.y,
|
|
@@ -3159,114 +3181,114 @@ var en = {
|
|
|
3159
3181
|
stroke: t.color,
|
|
3160
3182
|
"stroke-width": "2",
|
|
3161
3183
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
3162
|
-
}, null, 8,
|
|
3184
|
+
}, null, 8, Yn)), o("text", {
|
|
3163
3185
|
x: t.x + 18,
|
|
3164
3186
|
y: t.y + 4,
|
|
3165
|
-
"font-size":
|
|
3166
|
-
fill:
|
|
3167
|
-
"font-weight":
|
|
3168
|
-
}, b(t.label), 9,
|
|
3187
|
+
"font-size": Je.value.fontSize,
|
|
3188
|
+
fill: Je.value.fill,
|
|
3189
|
+
"font-weight": Je.value.fontWeight
|
|
3190
|
+
}, b(t.label), 9, Xn)], 64))), 128))])) : i("", !0),
|
|
3169
3191
|
!T.value || c.valueAxis ? (_(), a("line", {
|
|
3170
3192
|
key: 2,
|
|
3171
|
-
x1: x(
|
|
3172
|
-
y1: x(
|
|
3173
|
-
x2: x(
|
|
3174
|
-
y2: x(
|
|
3193
|
+
x1: x(P)(x(z).left),
|
|
3194
|
+
y1: x(P)(x(z).top),
|
|
3195
|
+
x2: x(P)(x(z).left),
|
|
3196
|
+
y2: x(P)(x(z).top + x(V)),
|
|
3175
3197
|
stroke: "currentColor",
|
|
3176
3198
|
"stroke-opacity": "0.3"
|
|
3177
|
-
}, null, 8,
|
|
3199
|
+
}, null, 8, Zn)) : i("", !0),
|
|
3178
3200
|
T.value || c.valueAxis ? (_(), a("line", {
|
|
3179
3201
|
key: 3,
|
|
3180
|
-
x1: x(
|
|
3181
|
-
y1: x(
|
|
3182
|
-
x2: x(
|
|
3183
|
-
y2: x(
|
|
3202
|
+
x1: x(P)(x(z).left),
|
|
3203
|
+
y1: x(P)(x(z).top + x(V)),
|
|
3204
|
+
x2: x(P)(x(z).left + x(B)),
|
|
3205
|
+
y2: x(P)(x(z).top + x(V)),
|
|
3184
3206
|
stroke: "currentColor",
|
|
3185
3207
|
"stroke-opacity": "0.3"
|
|
3186
|
-
}, null, 8,
|
|
3187
|
-
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(
|
|
3208
|
+
}, null, 8, Qn)) : i("", !0),
|
|
3209
|
+
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(N.value, (e, t) => (_(), a("line", {
|
|
3188
3210
|
key: "vg" + t,
|
|
3189
|
-
x1: T.value ? x(
|
|
3190
|
-
y1: T.value ? e.pos : x(
|
|
3191
|
-
x2: T.value ? x(
|
|
3192
|
-
y2: T.value ? e.pos : x(
|
|
3211
|
+
x1: T.value ? x(z).left : e.pos,
|
|
3212
|
+
y1: T.value ? e.pos : x(z).top,
|
|
3213
|
+
x2: T.value ? x(z).left + x(B) : e.pos,
|
|
3214
|
+
y2: T.value ? e.pos : x(z).top + x(V),
|
|
3193
3215
|
stroke: "currentColor",
|
|
3194
3216
|
"stroke-opacity": "0.1"
|
|
3195
|
-
}, null, 8,
|
|
3196
|
-
|
|
3217
|
+
}, null, 8, $n))), 128)) : i("", !0),
|
|
3218
|
+
Qe.value && Oe.value ? (_(), a("rect", {
|
|
3197
3219
|
key: 5,
|
|
3198
|
-
x:
|
|
3199
|
-
y:
|
|
3200
|
-
width:
|
|
3201
|
-
height:
|
|
3220
|
+
x: Qe.value.x,
|
|
3221
|
+
y: Qe.value.y,
|
|
3222
|
+
width: Qe.value.w,
|
|
3223
|
+
height: Qe.value.h,
|
|
3202
3224
|
fill: "currentColor",
|
|
3203
3225
|
"fill-opacity": "0.06",
|
|
3204
3226
|
"pointer-events": "none"
|
|
3205
|
-
}, null, 8,
|
|
3206
|
-
c.valueAxis && T.value ? (_(!0), a(e, { key: 6 }, y(
|
|
3227
|
+
}, null, 8, er)) : i("", !0),
|
|
3228
|
+
c.valueAxis && T.value ? (_(!0), a(e, { key: 6 }, y(N.value, (e, t) => (_(), a("text", {
|
|
3207
3229
|
key: "vt" + t,
|
|
3208
3230
|
"data-testid": "value-tick",
|
|
3209
|
-
x: x(
|
|
3231
|
+
x: x(z).left - 6,
|
|
3210
3232
|
y: e.pos,
|
|
3211
3233
|
"text-anchor": "end",
|
|
3212
3234
|
"dominant-baseline": "middle",
|
|
3213
|
-
"font-size":
|
|
3214
|
-
fill:
|
|
3215
|
-
"font-weight":
|
|
3216
|
-
"fill-opacity":
|
|
3217
|
-
}, b(e.value), 9,
|
|
3235
|
+
"font-size": J.value.fontSize,
|
|
3236
|
+
fill: J.value.fill,
|
|
3237
|
+
"font-weight": J.value.fontWeight,
|
|
3238
|
+
"fill-opacity": J.value.fillOpacity
|
|
3239
|
+
}, b(e.value), 9, tr))), 128)) : c.valueAxis ? (_(!0), a(e, { key: 7 }, y(N.value, (e, t) => (_(), a("text", {
|
|
3218
3240
|
key: "vt" + t,
|
|
3219
3241
|
"data-testid": "value-tick",
|
|
3220
3242
|
x: e.pos,
|
|
3221
|
-
y: x(
|
|
3243
|
+
y: x(z).top + x(V) + 16,
|
|
3222
3244
|
"text-anchor": "middle",
|
|
3223
|
-
"font-size":
|
|
3224
|
-
fill:
|
|
3225
|
-
"font-weight":
|
|
3226
|
-
"fill-opacity":
|
|
3227
|
-
}, b(e.value), 9,
|
|
3245
|
+
"font-size": J.value.fontSize,
|
|
3246
|
+
fill: J.value.fill,
|
|
3247
|
+
"font-weight": J.value.fontWeight,
|
|
3248
|
+
"fill-opacity": J.value.fillOpacity
|
|
3249
|
+
}, b(e.value), 9, nr))), 128)) : i("", !0),
|
|
3228
3250
|
c.yLabel ? (_(), a("text", {
|
|
3229
3251
|
key: 8,
|
|
3230
3252
|
x: 0,
|
|
3231
3253
|
y: 0,
|
|
3232
|
-
transform: `translate(14, ${x(
|
|
3254
|
+
transform: `translate(14, ${x(z).top + x(V) / 2}) rotate(-90)`,
|
|
3233
3255
|
"text-anchor": "middle",
|
|
3234
|
-
"font-size":
|
|
3235
|
-
fill:
|
|
3236
|
-
"font-weight":
|
|
3237
|
-
}, b(c.yLabel), 9,
|
|
3238
|
-
T.value ? (_(!0), a(e, { key: 9 }, y(
|
|
3256
|
+
"font-size": q.value.fontSize,
|
|
3257
|
+
fill: q.value.fill,
|
|
3258
|
+
"font-weight": q.value.fontWeight
|
|
3259
|
+
}, b(c.yLabel), 9, rr)) : i("", !0),
|
|
3260
|
+
T.value ? (_(!0), a(e, { key: 9 }, y(be.value, (e, t) => (_(), a("text", {
|
|
3239
3261
|
key: "ct" + t,
|
|
3240
3262
|
"data-testid": "category-tick",
|
|
3241
3263
|
x: e.pos,
|
|
3242
|
-
y: x(
|
|
3264
|
+
y: x(z).top + x(V) + 16,
|
|
3243
3265
|
"text-anchor": e.anchor,
|
|
3244
|
-
"font-size":
|
|
3245
|
-
fill:
|
|
3246
|
-
"font-weight":
|
|
3247
|
-
"fill-opacity":
|
|
3248
|
-
}, b(e.label), 9,
|
|
3266
|
+
"font-size": J.value.fontSize,
|
|
3267
|
+
fill: J.value.fill,
|
|
3268
|
+
"font-weight": J.value.fontWeight,
|
|
3269
|
+
"fill-opacity": J.value.fillOpacity
|
|
3270
|
+
}, b(e.label), 9, ir))), 128)) : (_(!0), a(e, { key: 10 }, y(be.value, (e, t) => (_(), a("text", {
|
|
3249
3271
|
key: "ct" + t,
|
|
3250
3272
|
"data-testid": "category-tick",
|
|
3251
|
-
x:
|
|
3273
|
+
x: at.value.x,
|
|
3252
3274
|
y: e.pos,
|
|
3253
|
-
"text-anchor":
|
|
3275
|
+
"text-anchor": at.value.anchor,
|
|
3254
3276
|
"dominant-baseline": "middle",
|
|
3255
|
-
"font-size":
|
|
3256
|
-
fill:
|
|
3257
|
-
"font-weight":
|
|
3258
|
-
"fill-opacity":
|
|
3259
|
-
}, b(e.label), 9,
|
|
3277
|
+
"font-size": J.value.fontSize,
|
|
3278
|
+
fill: J.value.fill,
|
|
3279
|
+
"font-weight": J.value.fontWeight,
|
|
3280
|
+
"fill-opacity": J.value.fillOpacity
|
|
3281
|
+
}, b(e.label), 9, ar))), 128)),
|
|
3260
3282
|
c.xLabel ? (_(), a("text", {
|
|
3261
3283
|
key: 11,
|
|
3262
|
-
x: x(
|
|
3263
|
-
y: x(
|
|
3284
|
+
x: x(z).left + x(B) / 2,
|
|
3285
|
+
y: x(R) - 4,
|
|
3264
3286
|
"text-anchor": "middle",
|
|
3265
|
-
"font-size":
|
|
3266
|
-
fill:
|
|
3267
|
-
"font-weight":
|
|
3268
|
-
}, b(c.xLabel), 9,
|
|
3269
|
-
(_(!0), a(e, null, y(
|
|
3287
|
+
"font-size": q.value.fontSize,
|
|
3288
|
+
fill: q.value.fill,
|
|
3289
|
+
"font-weight": q.value.fontWeight
|
|
3290
|
+
}, b(c.xLabel), 9, $)) : i("", !0),
|
|
3291
|
+
(_(!0), a(e, null, y(j.value, (e, t) => (_(), a("rect", {
|
|
3270
3292
|
key: "bar" + t,
|
|
3271
3293
|
"data-testid": "bar",
|
|
3272
3294
|
"data-category": e.categoryIndex,
|
|
@@ -3278,8 +3300,8 @@ var en = {
|
|
|
3278
3300
|
fill: e.color,
|
|
3279
3301
|
"fill-opacity": e.opacity,
|
|
3280
3302
|
style: h(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
3281
|
-
}, null, 12,
|
|
3282
|
-
(_(!0), a(e, null, y(
|
|
3303
|
+
}, null, 12, or))), 128)),
|
|
3304
|
+
(_(!0), a(e, null, y(it.value, (e) => (_(), a("text", {
|
|
3283
3305
|
key: "blbl" + e.key,
|
|
3284
3306
|
"data-testid": "bar-label",
|
|
3285
3307
|
x: e.x,
|
|
@@ -3290,8 +3312,8 @@ var en = {
|
|
|
3290
3312
|
"font-weight": e.fontWeight,
|
|
3291
3313
|
fill: e.fill,
|
|
3292
3314
|
"pointer-events": "none"
|
|
3293
|
-
}, b(e.text), 9,
|
|
3294
|
-
(_(!0), a(e, null, y(
|
|
3315
|
+
}, b(e.text), 9, sr))), 128)),
|
|
3316
|
+
(_(!0), a(e, null, y(M.value, (t, n) => (_(), a(e, { key: "sl" + n }, [t.pathD ? (_(), a("path", {
|
|
3295
3317
|
key: 0,
|
|
3296
3318
|
"data-testid": "summary-line",
|
|
3297
3319
|
d: t.pathD,
|
|
@@ -3303,7 +3325,7 @@ var en = {
|
|
|
3303
3325
|
"stroke-linecap": "round",
|
|
3304
3326
|
"stroke-linejoin": "round",
|
|
3305
3327
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3306
|
-
}, null, 12,
|
|
3328
|
+
}, null, 12, cr)) : i("", !0), t.dots ? (_(!0), a(e, { key: 1 }, y(t.points, (e, r) => (_(), a("circle", {
|
|
3307
3329
|
key: "sld" + n + "-" + r,
|
|
3308
3330
|
cx: e.x,
|
|
3309
3331
|
cy: e.y,
|
|
@@ -3311,71 +3333,71 @@ var en = {
|
|
|
3311
3333
|
fill: t.color,
|
|
3312
3334
|
"fill-opacity": t.opacity,
|
|
3313
3335
|
style: h(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3314
|
-
}, null, 12,
|
|
3315
|
-
|
|
3336
|
+
}, null, 12, lr))), 128)) : i("", !0)], 64))), 128)),
|
|
3337
|
+
Oe.value ? (_(), a("rect", d({
|
|
3316
3338
|
key: 12,
|
|
3317
|
-
x: x(
|
|
3318
|
-
y: x(
|
|
3319
|
-
width: x(
|
|
3320
|
-
height: x(
|
|
3339
|
+
x: x(z).left,
|
|
3340
|
+
y: x(z).top,
|
|
3341
|
+
width: x(B),
|
|
3342
|
+
height: x(V),
|
|
3321
3343
|
fill: "transparent",
|
|
3322
3344
|
style: `cursor: crosshair; touch-action: ${T.value ? "pan-y" : "pan-x"}`
|
|
3323
|
-
}, ne(x(
|
|
3324
|
-
c.annotations && c.annotations.length > 0 ? (_(), r(x(
|
|
3345
|
+
}, ne(x(ze), !0)), null, 16, ur)) : i("", !0),
|
|
3346
|
+
c.annotations && c.annotations.length > 0 ? (_(), r(x(xt), {
|
|
3325
3347
|
key: 13,
|
|
3326
3348
|
annotations: c.annotations,
|
|
3327
|
-
project:
|
|
3328
|
-
bounds: x(
|
|
3349
|
+
project: L,
|
|
3350
|
+
bounds: x(H)
|
|
3329
3351
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
3330
|
-
], 8,
|
|
3331
|
-
|
|
3352
|
+
], 8, Un)),
|
|
3353
|
+
Oe.value && x(U) !== null && Ze.value ? (_(), a("div", {
|
|
3332
3354
|
key: 1,
|
|
3333
3355
|
ref_key: "tooltipRef",
|
|
3334
|
-
ref:
|
|
3356
|
+
ref: W,
|
|
3335
3357
|
class: "chart-tooltip-content",
|
|
3336
3358
|
style: h({
|
|
3337
3359
|
position: "absolute",
|
|
3338
3360
|
top: "0",
|
|
3339
3361
|
left: "0",
|
|
3340
3362
|
willChange: "transform",
|
|
3341
|
-
transform: x(
|
|
3342
|
-
visibility: x(
|
|
3363
|
+
transform: x(Re) ? `translate3d(${x(Re).left}px, ${x(Re).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
3364
|
+
visibility: x(Re) ? "visible" : "hidden"
|
|
3343
3365
|
})
|
|
3344
|
-
}, [te(n.$slots, "tooltip", m(u(
|
|
3366
|
+
}, [te(n.$slots, "tooltip", m(u(Ze.value)), () => [o("div", dr, [Xe.value ? (_(), a("div", fr, b(Xe.value), 1)) : i("", !0), (_(!0), a(e, null, y(Ze.value.values, (e) => (_(), a("div", {
|
|
3345
3367
|
key: e.seriesIndex,
|
|
3346
3368
|
class: "bar-chart-tooltip-row"
|
|
3347
3369
|
}, [o("span", {
|
|
3348
3370
|
class: "bar-chart-tooltip-swatch",
|
|
3349
3371
|
style: h({ background: e.color })
|
|
3350
|
-
}, null, 4), s(" " + b(isFinite(e.value) ? x(
|
|
3351
|
-
x(
|
|
3372
|
+
}, null, 4), s(" " + b(isFinite(e.value) ? x(ve)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
3373
|
+
x(G) ? (_(), a("a", {
|
|
3352
3374
|
key: 2,
|
|
3353
3375
|
class: "bar-chart-download-link",
|
|
3354
|
-
href: x(
|
|
3376
|
+
href: x(Ve),
|
|
3355
3377
|
download: `${x(Ue)()}.csv`
|
|
3356
|
-
}, b(x(
|
|
3357
|
-
x(
|
|
3378
|
+
}, b(x(G)), 9, pr)) : i("", !0),
|
|
3379
|
+
x(He) ? (_(), a("button", {
|
|
3358
3380
|
key: 3,
|
|
3359
3381
|
type: "button",
|
|
3360
3382
|
class: "bar-chart-download-button",
|
|
3361
|
-
onClick: l[0] ||= (...e) => x(
|
|
3362
|
-
}, b(x(
|
|
3383
|
+
onClick: l[0] ||= (...e) => x(K) && x(K)(...e)
|
|
3384
|
+
}, b(x(He)), 1)) : i("", !0)
|
|
3363
3385
|
], 16)], 8, ["to", "disabled"]));
|
|
3364
3386
|
}
|
|
3365
|
-
}), [["__scopeId", "data-v-
|
|
3387
|
+
}), [["__scopeId", "data-v-32872fa4"]]);
|
|
3366
3388
|
//#endregion
|
|
3367
3389
|
//#region src/ChoroplethMap/canvasLayer.ts
|
|
3368
|
-
function
|
|
3390
|
+
function xr(e, t) {
|
|
3369
3391
|
let n = t.dpr * t.meetScale * t.zoom.k;
|
|
3370
3392
|
e.setTransform(n, 0, 0, n, t.dpr * (t.offsetX + t.meetScale * t.zoom.x), t.dpr * (t.offsetY + t.meetScale * t.zoom.y));
|
|
3371
3393
|
}
|
|
3372
|
-
function
|
|
3394
|
+
function Sr(e) {
|
|
3373
3395
|
return (t) => t / (e.meetScale * e.zoom.k || 1);
|
|
3374
3396
|
}
|
|
3375
|
-
function
|
|
3397
|
+
function Cr(e, t, n) {
|
|
3376
3398
|
n === "dashed" ? (e.setLineDash([t(8), t(4)]), e.lineCap = "butt") : n === "dotted" ? (e.setLineDash([0, t(5)]), e.lineCap = "round") : (e.setLineDash([]), e.lineCap = "butt");
|
|
3377
3399
|
}
|
|
3378
|
-
function
|
|
3400
|
+
function wr(e, t, n, r) {
|
|
3379
3401
|
let i = [], a = /* @__PURE__ */ new Map(), o = new Path2D(), s = 0;
|
|
3380
3402
|
for (let r of e) {
|
|
3381
3403
|
let e = t(r);
|
|
@@ -3394,47 +3416,47 @@ function Cr(e, t, n, r) {
|
|
|
3394
3416
|
borders: r ? new Path2D(r) : null
|
|
3395
3417
|
};
|
|
3396
3418
|
}
|
|
3397
|
-
function
|
|
3419
|
+
function Tr(e, t, n, r, i, a) {
|
|
3398
3420
|
let o = t.indexById.get(i);
|
|
3399
3421
|
if (o == null) return;
|
|
3400
3422
|
let s = t.items[o];
|
|
3401
|
-
e.fillStyle = s.fill, e.fill(s.path), e.strokeStyle = a?.stroke ?? r.highlightStroke, e.lineWidth = n(a?.strokeWidth ?? r.strokeWidth + 1),
|
|
3423
|
+
e.fillStyle = s.fill, e.fill(s.path), e.strokeStyle = a?.stroke ?? r.highlightStroke, e.lineWidth = n(a?.strokeWidth ?? r.strokeWidth + 1), Cr(e, n, a?.style), e.stroke(s.path);
|
|
3402
3424
|
}
|
|
3403
|
-
function
|
|
3404
|
-
e.setTransform(1, 0, 0, 1, 0, 0), e.clearRect(0, 0, e.canvas.width, e.canvas.height),
|
|
3425
|
+
function Er(e, t) {
|
|
3426
|
+
e.setTransform(1, 0, 0, 1, 0, 0), e.clearRect(0, 0, e.canvas.width, e.canvas.height), xr(e, t), e.lineJoin = "round", e.setLineDash([]);
|
|
3405
3427
|
}
|
|
3406
|
-
function
|
|
3428
|
+
function Dr(e, t, n, r) {
|
|
3407
3429
|
let i = Math.min(r, t.items.length);
|
|
3408
3430
|
for (let r = n; r < i; r++) e.fillStyle = t.items[r].fill, e.fill(t.items[r].path);
|
|
3409
3431
|
return i;
|
|
3410
3432
|
}
|
|
3411
|
-
function
|
|
3412
|
-
let i =
|
|
3433
|
+
function Or(e, t, n, r) {
|
|
3434
|
+
let i = Sr(n);
|
|
3413
3435
|
if (e.setLineDash([]), e.lineWidth = i(r.strokeWidth), e.strokeStyle = r.strokeColor, t.outlines) e.stroke(t.outlines);
|
|
3414
3436
|
else for (let n of t.items) e.stroke(n.path);
|
|
3415
3437
|
t.borders && (e.lineWidth = i(1), e.stroke(t.borders));
|
|
3416
|
-
for (let [n, a] of r.focused)
|
|
3417
|
-
for (let t of r.overlays) e.strokeStyle = t.stroke, e.lineWidth = i(t.strokeWidth ?? r.strokeWidth + 1.5),
|
|
3438
|
+
for (let [n, a] of r.focused) Tr(e, t, i, r, n, a);
|
|
3439
|
+
for (let t of r.overlays) e.strokeStyle = t.stroke, e.lineWidth = i(t.strokeWidth ?? r.strokeWidth + 1.5), Cr(e, i, t.style), e.stroke(t.path);
|
|
3418
3440
|
e.setLineDash([]);
|
|
3419
3441
|
}
|
|
3420
|
-
function
|
|
3421
|
-
!i || r.focused.has(i) || (
|
|
3442
|
+
function kr(e, t, n, r, i) {
|
|
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));
|
|
3422
3444
|
}
|
|
3423
|
-
function
|
|
3424
|
-
|
|
3445
|
+
function Ar(e, t, n, r) {
|
|
3446
|
+
Er(e, n), Dr(e, t, 0, t.items.length), Or(e, t, n, r), kr(e, t, n, r, r.hoveredId);
|
|
3425
3447
|
}
|
|
3426
|
-
function
|
|
3448
|
+
function jr(e) {
|
|
3427
3449
|
let t = e + 1;
|
|
3428
3450
|
return `rgb(${t >> 16 & 255},${t >> 8 & 255},${t & 255})`;
|
|
3429
3451
|
}
|
|
3430
|
-
function
|
|
3452
|
+
function Mr(e, t, n, r) {
|
|
3431
3453
|
r.width = Math.max(1, Math.round(t)), r.height = Math.max(1, Math.round(n));
|
|
3432
3454
|
let i = r.getContext("2d", { willReadFrequently: !0 });
|
|
3433
3455
|
return i ? (i.imageSmoothingEnabled = !1, i.setTransform(1, 0, 0, 1, 0, 0), i.clearRect(0, 0, r.width, r.height), e.items.forEach((e, t) => {
|
|
3434
|
-
i.fillStyle =
|
|
3456
|
+
i.fillStyle = jr(t), i.fill(e.path);
|
|
3435
3457
|
}), i) : null;
|
|
3436
3458
|
}
|
|
3437
|
-
function
|
|
3459
|
+
function Nr(e, t, n, r) {
|
|
3438
3460
|
let i = Math.round(n), a = Math.round(r);
|
|
3439
3461
|
if (i < 0 || a < 0 || i >= e.canvas.width || a >= e.canvas.height) return null;
|
|
3440
3462
|
let o = e.getImageData(i, a, 1, 1).data;
|
|
@@ -3448,7 +3470,7 @@ function Mr(e, t, n, r) {
|
|
|
3448
3470
|
}
|
|
3449
3471
|
//#endregion
|
|
3450
3472
|
//#region src/ChoroplethMap/ChoroplethTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
3451
|
-
var
|
|
3473
|
+
var Pr = {
|
|
3452
3474
|
ref: "root",
|
|
3453
3475
|
class: "chart-tooltip-content",
|
|
3454
3476
|
style: {
|
|
@@ -3461,7 +3483,7 @@ var Nr = {
|
|
|
3461
3483
|
"pointer-events": "none",
|
|
3462
3484
|
transform: "translateY(-50%)"
|
|
3463
3485
|
}
|
|
3464
|
-
},
|
|
3486
|
+
}, Fr = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
3465
3487
|
__name: "ChoroplethTooltip",
|
|
3466
3488
|
props: { mode: { default: "float" } },
|
|
3467
3489
|
setup(n, { expose: s }) {
|
|
@@ -3476,27 +3498,150 @@ var Nr = {
|
|
|
3476
3498
|
getEl() {
|
|
3477
3499
|
return u.value;
|
|
3478
3500
|
}
|
|
3479
|
-
}), (s, u) => (_(), a(e, null, [(_(), r(t, { to: "body" }, [o("div",
|
|
3501
|
+
}), (s, u) => (_(), a(e, null, [(_(), r(t, { to: "body" }, [o("div", Pr, [c.value && n.mode === "float" ? te(s.$slots, "default", m(d({ key: 0 }, c.value)), void 0, !0) : i("", !0)], 512)])), n.mode === "sheet" ? (_(), a("div", {
|
|
3480
3502
|
key: 0,
|
|
3481
3503
|
class: p(["chart-tooltip-sheet", { "is-open": l.value }])
|
|
3482
3504
|
}, [c.value ? te(s.$slots, "default", m(d({ key: 0 }, c.value)), void 0, !0) : i("", !0)], 2)) : i("", !0)], 64));
|
|
3483
3505
|
}
|
|
3484
|
-
}), [["__scopeId", "data-v-90392830"]]),
|
|
3506
|
+
}), [["__scopeId", "data-v-90392830"]]), Ir = {
|
|
3507
|
+
k: 1,
|
|
3508
|
+
x: 0,
|
|
3509
|
+
y: 0
|
|
3510
|
+
}, Lr = .56, Rr = 1.15;
|
|
3511
|
+
function zr(e, t) {
|
|
3512
|
+
return e.length * Lr * t;
|
|
3513
|
+
}
|
|
3514
|
+
function Br(e) {
|
|
3515
|
+
return Math.round(e * 100) / 100;
|
|
3516
|
+
}
|
|
3517
|
+
function Vr(e, t) {
|
|
3518
|
+
return !(e.x1 <= t.x0 || e.x0 >= t.x1 || e.y1 <= t.y0 || e.y0 >= t.y1);
|
|
3519
|
+
}
|
|
3520
|
+
function Hr(e, t, n) {
|
|
3521
|
+
return e.x0 >= 0 && e.y0 >= 0 && e.x1 <= t && e.y1 <= n;
|
|
3522
|
+
}
|
|
3523
|
+
function Ur(e, t, n, r, i) {
|
|
3524
|
+
let a = t - r / 2, o = t + r / 2;
|
|
3525
|
+
return i === "start" ? {
|
|
3526
|
+
x0: e,
|
|
3527
|
+
y0: a,
|
|
3528
|
+
x1: e + n,
|
|
3529
|
+
y1: o
|
|
3530
|
+
} : i === "end" ? {
|
|
3531
|
+
x0: e - n,
|
|
3532
|
+
y0: a,
|
|
3533
|
+
x1: e,
|
|
3534
|
+
y1: o
|
|
3535
|
+
} : {
|
|
3536
|
+
x0: e - n / 2,
|
|
3537
|
+
y0: a,
|
|
3538
|
+
x1: e + n / 2,
|
|
3539
|
+
y1: o
|
|
3540
|
+
};
|
|
3541
|
+
}
|
|
3542
|
+
function Wr(e, t, n = Ir, r) {
|
|
3543
|
+
let { width: i, height: a, viewScale: o, labelPx: s = 11, dotPx: c = 2.4, gapPx: l = 4, margin: u = 0 } = r, d = o || 1, f = s / d, p = c / d, m = l / d, h = f * Rr, g = [];
|
|
3544
|
+
e.forEach((e, r) => {
|
|
3545
|
+
let o = t(e.coordinates);
|
|
3546
|
+
if (!o || !Number.isFinite(o[0]) || !Number.isFinite(o[1])) return;
|
|
3547
|
+
let s = n.k * o[0] + n.x, c = n.k * o[1] + n.y;
|
|
3548
|
+
s < -u || s > i + u || c < -u || c > a + u || g.push({
|
|
3549
|
+
marker: e,
|
|
3550
|
+
x: s,
|
|
3551
|
+
y: c,
|
|
3552
|
+
radius: p,
|
|
3553
|
+
order: r
|
|
3554
|
+
});
|
|
3555
|
+
}), g.sort((e, t) => !!t.marker.capital - +!!e.marker.capital || e.order - t.order);
|
|
3556
|
+
let ee = g.map((e) => ({
|
|
3557
|
+
x0: e.x - e.radius,
|
|
3558
|
+
y0: e.y - e.radius,
|
|
3559
|
+
x1: e.x + e.radius,
|
|
3560
|
+
y1: e.y + e.radius
|
|
3561
|
+
})), _ = [], v = [];
|
|
3562
|
+
for (let e of g) {
|
|
3563
|
+
let t = zr(e.marker.name, s) / d, n = e.radius, r = [
|
|
3564
|
+
{
|
|
3565
|
+
anchorX: e.x + n + m,
|
|
3566
|
+
cy: e.y,
|
|
3567
|
+
anchor: "start"
|
|
3568
|
+
},
|
|
3569
|
+
{
|
|
3570
|
+
anchorX: e.x - n - m,
|
|
3571
|
+
cy: e.y,
|
|
3572
|
+
anchor: "end"
|
|
3573
|
+
},
|
|
3574
|
+
{
|
|
3575
|
+
anchorX: e.x,
|
|
3576
|
+
cy: e.y - n - m - h / 2,
|
|
3577
|
+
anchor: "middle"
|
|
3578
|
+
},
|
|
3579
|
+
{
|
|
3580
|
+
anchorX: e.x,
|
|
3581
|
+
cy: e.y + n + m + h / 2,
|
|
3582
|
+
anchor: "middle"
|
|
3583
|
+
},
|
|
3584
|
+
{
|
|
3585
|
+
anchorX: e.x + n * .7 + m,
|
|
3586
|
+
cy: e.y - n - m,
|
|
3587
|
+
anchor: "start"
|
|
3588
|
+
},
|
|
3589
|
+
{
|
|
3590
|
+
anchorX: e.x + n * .7 + m,
|
|
3591
|
+
cy: e.y + n + m,
|
|
3592
|
+
anchor: "start"
|
|
3593
|
+
},
|
|
3594
|
+
{
|
|
3595
|
+
anchorX: e.x - n * .7 - m,
|
|
3596
|
+
cy: e.y - n - m,
|
|
3597
|
+
anchor: "end"
|
|
3598
|
+
},
|
|
3599
|
+
{
|
|
3600
|
+
anchorX: e.x - n * .7 - m,
|
|
3601
|
+
cy: e.y + n + m,
|
|
3602
|
+
anchor: "end"
|
|
3603
|
+
}
|
|
3604
|
+
], o = !e.marker.capital, c = null;
|
|
3605
|
+
for (let e of r) {
|
|
3606
|
+
let n = Ur(e.anchorX, e.cy, t, h, e.anchor);
|
|
3607
|
+
if (Hr(n, i, a) && !_.some((e) => Vr(n, e)) && !(o && ee.some((e) => Vr(n, e)))) {
|
|
3608
|
+
c = {
|
|
3609
|
+
x: Br(e.anchorX),
|
|
3610
|
+
y: Br(e.cy),
|
|
3611
|
+
anchor: e.anchor
|
|
3612
|
+
}, _.push(n);
|
|
3613
|
+
break;
|
|
3614
|
+
}
|
|
3615
|
+
}
|
|
3616
|
+
v.push({
|
|
3617
|
+
name: e.marker.name,
|
|
3618
|
+
capital: !!e.marker.capital,
|
|
3619
|
+
x: Br(e.x),
|
|
3620
|
+
y: Br(e.y),
|
|
3621
|
+
radius: Br(n),
|
|
3622
|
+
label: c
|
|
3623
|
+
});
|
|
3624
|
+
}
|
|
3625
|
+
return v;
|
|
3626
|
+
}
|
|
3627
|
+
//#endregion
|
|
3628
|
+
//#region src/ChoroplethMap/ChoroplethMap.vue?vue&type=script&setup=true&lang.ts
|
|
3629
|
+
var Gr = ["role", "aria-label"], Kr = {
|
|
3485
3630
|
class: "chart-sr-only",
|
|
3486
3631
|
"aria-live": "polite"
|
|
3487
|
-
},
|
|
3632
|
+
}, qr = {
|
|
3488
3633
|
key: 1,
|
|
3489
3634
|
class: "choropleth-header"
|
|
3490
|
-
},
|
|
3635
|
+
}, Jr = {
|
|
3491
3636
|
key: 0,
|
|
3492
3637
|
class: "choropleth-legend-title"
|
|
3493
|
-
},
|
|
3638
|
+
}, Yr = {
|
|
3494
3639
|
key: 2,
|
|
3495
3640
|
class: "choropleth-legend-continuous"
|
|
3496
|
-
},
|
|
3641
|
+
}, Xr = { class: "choropleth-legend-ticks" }, Zr = {
|
|
3497
3642
|
key: 2,
|
|
3498
3643
|
class: "choropleth-zoom-hint"
|
|
3499
|
-
},
|
|
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 = 11, hi = 2.4, gi = 3, _i = .9, vi = 2.6, yi = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
3500
3645
|
inheritAttrs: !1,
|
|
3501
3646
|
__name: "ChoroplethMap",
|
|
3502
3647
|
props: {
|
|
@@ -3507,6 +3652,10 @@ var Nr = {
|
|
|
3507
3652
|
state: {},
|
|
3508
3653
|
width: {},
|
|
3509
3654
|
height: {},
|
|
3655
|
+
tightFit: {
|
|
3656
|
+
type: [Boolean, Number],
|
|
3657
|
+
default: !1
|
|
3658
|
+
},
|
|
3510
3659
|
colorScale: {},
|
|
3511
3660
|
title: {},
|
|
3512
3661
|
titleStyle: {},
|
|
@@ -3541,7 +3690,7 @@ var Nr = {
|
|
|
3541
3690
|
tooltipTrigger: {},
|
|
3542
3691
|
tooltipFormat: {},
|
|
3543
3692
|
tooltipValueFormat: {},
|
|
3544
|
-
tooltipClamp: { default: "
|
|
3693
|
+
tooltipClamp: { default: "window" },
|
|
3545
3694
|
focus: {},
|
|
3546
3695
|
focusZoomLevel: { default: 4 },
|
|
3547
3696
|
focusZoom: {
|
|
@@ -3549,7 +3698,9 @@ var Nr = {
|
|
|
3549
3698
|
default: !0
|
|
3550
3699
|
},
|
|
3551
3700
|
renderer: { default: "svg" },
|
|
3552
|
-
fullscreenTarget: {}
|
|
3701
|
+
fullscreenTarget: {},
|
|
3702
|
+
cities: {},
|
|
3703
|
+
citiesMinZoom: { default: 2 }
|
|
3553
3704
|
},
|
|
3554
3705
|
emits: [
|
|
3555
3706
|
"stateClick",
|
|
@@ -3557,10 +3708,10 @@ var Nr = {
|
|
|
3557
3708
|
"update:focus"
|
|
3558
3709
|
],
|
|
3559
3710
|
setup(c, { emit: l }) {
|
|
3560
|
-
let p = c, ne = n(() => p.ariaLabel ?? p.title), ie = n(() => p.role ?? (ne.value ? "figure" : void 0)), T = l, E = (e) => e, oe = v(null), D = v(null), O = v(null), k = v(null), se = v(null),
|
|
3711
|
+
let p = c, ne = n(() => p.ariaLabel ?? p.title), ie = n(() => p.role ?? (ne.value ? "figure" : void 0)), T = l, E = (e) => e, oe = v(null), D = v(null), O = v(null), k = v(null), se = v(null), ce = v(null), le = v(null), _e = v(null), ve = S(), N = n(() => !!p.tooltipTrigger || !!p.tooltipFormat || !!ve.tooltip), P = n(() => {
|
|
3561
3712
|
let e = p.legendStyle, t = {};
|
|
3562
3713
|
return e?.fontSize != null && (t["font-size"] = `${e.fontSize}px`), e?.fontWeight != null && (t["font-weight"] = String(e.fontWeight)), e?.color != null && (t.color = e.color), t;
|
|
3563
|
-
}),
|
|
3714
|
+
}), be = n(() => {
|
|
3564
3715
|
let e = p.titleStyle, t = {
|
|
3565
3716
|
"font-size": `${e?.fontSize ?? 14}px`,
|
|
3566
3717
|
"line-height": `${e?.lineHeight ?? 18}px`,
|
|
@@ -3569,88 +3720,87 @@ var Nr = {
|
|
|
3569
3720
|
width: "100%"
|
|
3570
3721
|
};
|
|
3571
3722
|
return e?.color && (t.color = e.color), t;
|
|
3572
|
-
}),
|
|
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), De = null, Oe = null, ke = null, L = null, Ae = /* @__PURE__ */ new Map(), je = [], Me = 0, Ne = 0, Pe = 0, Fe = 0, R = !1, Ie = null, Le = {
|
|
3573
3724
|
width: 0,
|
|
3574
3725
|
height: 0
|
|
3575
|
-
},
|
|
3576
|
-
function
|
|
3726
|
+
}, B = null, V = !1, H = null, U = v(!1), Be = v(1), Ve = v(1), He = v(!1), K = n(() => p.zoomMode === "scroll"), Ue = n(() => p.zoom && (K.value || !p.touchExpand && He.value)), We = 0, Ge = 0, Ke = 0, qe = null, q = 0, Je = null;
|
|
3727
|
+
function Ye() {
|
|
3577
3728
|
let e = D.value, t = O.value;
|
|
3578
|
-
if (!(!e || !t) && (e.addEventListener("touchstart",
|
|
3579
|
-
if (
|
|
3580
|
-
e.addEventListener("click",
|
|
3729
|
+
if (!(!e || !t) && (e.addEventListener("touchstart", Vn, { passive: !0 }), e.addEventListener("touchend", Hn), e.addEventListener("touchcancel", Wn, { passive: !0 }), !G())) {
|
|
3730
|
+
if (I.value) {
|
|
3731
|
+
e.addEventListener("click", Fn), e.addEventListener("mousemove", Rn), e.addEventListener("mouseleave", zn);
|
|
3581
3732
|
return;
|
|
3582
3733
|
}
|
|
3583
|
-
t.addEventListener("click",
|
|
3734
|
+
t.addEventListener("click", Fn), t.addEventListener("mouseover", Fn), t.addEventListener("mousemove", In), t.addEventListener("mouseout", Ln);
|
|
3584
3735
|
}
|
|
3585
3736
|
}
|
|
3586
|
-
function
|
|
3737
|
+
function Y() {
|
|
3587
3738
|
let e = D.value, t = O.value;
|
|
3588
|
-
e && (e.removeEventListener("touchstart",
|
|
3739
|
+
e && (e.removeEventListener("touchstart", Vn), e.removeEventListener("touchend", Hn), e.removeEventListener("touchcancel", Wn), e.removeEventListener("click", Fn), e.removeEventListener("mousemove", Rn), e.removeEventListener("mouseleave", zn)), t && (t.removeEventListener("click", Fn), t.removeEventListener("mouseover", Fn), t.removeEventListener("mousemove", In), t.removeEventListener("mouseout", Ln));
|
|
3589
3740
|
}
|
|
3590
|
-
function
|
|
3591
|
-
|
|
3741
|
+
function Xe() {
|
|
3742
|
+
Mn();
|
|
3592
3743
|
}
|
|
3593
|
-
let
|
|
3744
|
+
let Qe = null;
|
|
3594
3745
|
g(() => {
|
|
3595
|
-
|
|
3746
|
+
Ye(), $e(), Yn(), it(), Jn(), en(), D.value && typeof ResizeObserver < "u" && (Qe = new ResizeObserver((e) => {
|
|
3596
3747
|
let t = e[0]?.contentRect;
|
|
3597
3748
|
if (!t?.width) return;
|
|
3598
|
-
let n = t.height ? Math.min(t.width /
|
|
3599
|
-
if (
|
|
3600
|
-
let e =
|
|
3601
|
-
if (e
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
e.width = Math.max(1, Math.round(t.width * a)), e.height = Math.max(1, Math.round(t.height * a));
|
|
3749
|
+
let n = t.height ? Math.min(t.width / bt.value, t.height / xt.value) : t.width / bt.value;
|
|
3750
|
+
if (Ve.value = n, Pe = (t.width - n * bt.value) / 2, Fe = t.height ? (t.height - n * xt.value) / 2 : 0, I.value) {
|
|
3751
|
+
let e = Ee.value;
|
|
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));
|
|
3606
3756
|
}
|
|
3607
|
-
|
|
3608
|
-
} else
|
|
3609
|
-
}),
|
|
3757
|
+
wn();
|
|
3758
|
+
} else Dn();
|
|
3759
|
+
}), Qe.observe(D.value)), I.value && _n(), window.addEventListener("scroll", Xe, {
|
|
3610
3760
|
passive: !0,
|
|
3611
3761
|
capture: !0
|
|
3612
|
-
}), window.addEventListener("resize",
|
|
3762
|
+
}), window.addEventListener("resize", Xe, { passive: !0 });
|
|
3613
3763
|
}), ee(() => {
|
|
3614
|
-
|
|
3764
|
+
Ie?.disconnect(), Qe?.disconnect(), gn?.removeEventListener("change", vn), Ke && cancelAnimationFrame(Ke), Me && cancelAnimationFrame(Me), Ne && cancelAnimationFrame(Ne), window.clearTimeout(q), et(), Y(), window.removeEventListener("scroll", Xe, { capture: !0 }), window.removeEventListener("resize", Xe);
|
|
3615
3765
|
});
|
|
3616
|
-
function
|
|
3766
|
+
function $e() {
|
|
3617
3767
|
if (!D.value || !O.value) return;
|
|
3618
|
-
let e =
|
|
3619
|
-
|
|
3620
|
-
|
|
3768
|
+
let e = M(D.value);
|
|
3769
|
+
H = de().scaleExtent([1, st.value]).clickDistance(6).on("start", () => {
|
|
3770
|
+
R = !0;
|
|
3621
3771
|
}).on("zoom", (e) => {
|
|
3622
|
-
|
|
3772
|
+
Mn(), I.value ? wn() : O.value && O.value.setAttribute("transform", e.transform);
|
|
3623
3773
|
let t = e.transform;
|
|
3624
|
-
|
|
3774
|
+
Be.value = t.k, Dn(), p.cities?.length && Jn(), U.value = t.k !== 1 || t.x !== 0 || t.y !== 0, U.value && (He.value = !0);
|
|
3625
3775
|
}).on("end", () => {
|
|
3626
|
-
|
|
3627
|
-
}),
|
|
3776
|
+
R = !1, I.value && wn();
|
|
3777
|
+
}), H.filter((e) => {
|
|
3628
3778
|
if (!p.zoom) return !1;
|
|
3629
|
-
if (!
|
|
3779
|
+
if (!K.value) {
|
|
3630
3780
|
let t = $.isFullscreen.value;
|
|
3631
3781
|
switch (e.type) {
|
|
3632
3782
|
case "wheel":
|
|
3633
3783
|
if (!t) return !1;
|
|
3634
3784
|
break;
|
|
3635
3785
|
case "dblclick":
|
|
3636
|
-
if (
|
|
3786
|
+
if (G()) return !1;
|
|
3637
3787
|
break;
|
|
3638
3788
|
case "mousedown":
|
|
3639
|
-
if (!t && !
|
|
3789
|
+
if (!t && !He.value) return !1;
|
|
3640
3790
|
break;
|
|
3641
3791
|
case "touchstart":
|
|
3642
|
-
if (!t && !
|
|
3792
|
+
if (!t && !Ue.value && !(!p.touchExpand && p.zoomMode !== "scroll" && e.touches.length >= 2)) return !1;
|
|
3643
3793
|
break;
|
|
3644
3794
|
}
|
|
3645
3795
|
}
|
|
3646
3796
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
3647
|
-
}), e.call(
|
|
3797
|
+
}), e.call(H);
|
|
3648
3798
|
}
|
|
3649
|
-
function
|
|
3650
|
-
D.value &&
|
|
3799
|
+
function et() {
|
|
3800
|
+
D.value && H && (M(D.value).on(".zoom", null), H = null);
|
|
3651
3801
|
}
|
|
3652
|
-
function
|
|
3653
|
-
let t =
|
|
3802
|
+
function tt(e) {
|
|
3803
|
+
let t = Bt.value, n = It.value, r = [];
|
|
3654
3804
|
for (let i of e) {
|
|
3655
3805
|
let e = i.geoType ?? p.geoType, a = t.get(e);
|
|
3656
3806
|
if (!a) continue;
|
|
@@ -3668,20 +3818,20 @@ var Nr = {
|
|
|
3668
3818
|
}
|
|
3669
3819
|
return r;
|
|
3670
3820
|
}
|
|
3671
|
-
function
|
|
3821
|
+
function nt(e) {
|
|
3672
3822
|
let t = /* @__PURE__ */ new Set();
|
|
3673
|
-
for (let n of
|
|
3823
|
+
for (let n of tt(e)) n.geoType === p.geoType && t.add(String(n.feature.id));
|
|
3674
3824
|
return t;
|
|
3675
3825
|
}
|
|
3676
|
-
let
|
|
3677
|
-
function
|
|
3678
|
-
if (!D.value || !
|
|
3679
|
-
let e =
|
|
3680
|
-
if (
|
|
3681
|
-
|
|
3682
|
-
for (let e of t)
|
|
3683
|
-
let e =
|
|
3684
|
-
|
|
3826
|
+
let rt = !1;
|
|
3827
|
+
function it() {
|
|
3828
|
+
if (!D.value || !H) return;
|
|
3829
|
+
let e = tt(zt.value), t = e.filter((e) => e.geoType === p.geoType), n = e.filter((e) => e.geoType !== p.geoType);
|
|
3830
|
+
if (I.value) {
|
|
3831
|
+
Ae.clear();
|
|
3832
|
+
for (let e of t) Ae.set(String(e.feature.id), e.item);
|
|
3833
|
+
let e = Z.value;
|
|
3834
|
+
je = n.flatMap((t) => {
|
|
3685
3835
|
let n = e(t.feature);
|
|
3686
3836
|
return n ? [{
|
|
3687
3837
|
path: new Path2D(n),
|
|
@@ -3689,88 +3839,88 @@ var Nr = {
|
|
|
3689
3839
|
strokeWidth: t.item.strokeWidth,
|
|
3690
3840
|
style: t.item.style
|
|
3691
3841
|
}] : [];
|
|
3692
|
-
}),
|
|
3842
|
+
}), wn();
|
|
3693
3843
|
} else {
|
|
3694
3844
|
let e = /* @__PURE__ */ new Map();
|
|
3695
3845
|
for (let n of t) {
|
|
3696
|
-
let t =
|
|
3846
|
+
let t = xe.get(String(n.feature.id));
|
|
3697
3847
|
t && e.set(t, n.item);
|
|
3698
3848
|
}
|
|
3699
|
-
for (let [t] of
|
|
3849
|
+
for (let [t] of we) e.has(t) || t === F || kn(t);
|
|
3700
3850
|
for (let [t, n] of e) {
|
|
3701
|
-
let e =
|
|
3702
|
-
e != null && e.style === n.style && e.stroke === n.stroke && e.strokeWidth === n.strokeWidth && t !==
|
|
3851
|
+
let e = we.get(t);
|
|
3852
|
+
e != null && e.style === n.style && e.stroke === n.stroke && e.strokeWidth === n.strokeWidth && t !== F || t !== F && On(t, n);
|
|
3703
3853
|
}
|
|
3704
|
-
|
|
3705
|
-
for (let [t, n] of e)
|
|
3706
|
-
|
|
3854
|
+
we.clear();
|
|
3855
|
+
for (let [t, n] of e) we.set(t, n);
|
|
3856
|
+
at(n);
|
|
3707
3857
|
}
|
|
3708
3858
|
if (e.length === 0) {
|
|
3709
|
-
|
|
3859
|
+
rt = !0, Mn();
|
|
3710
3860
|
return;
|
|
3711
3861
|
}
|
|
3712
3862
|
if (p.focusZoom === !1) {
|
|
3713
|
-
|
|
3863
|
+
rt = !0;
|
|
3714
3864
|
return;
|
|
3715
3865
|
}
|
|
3716
|
-
let r =
|
|
3866
|
+
let r = M(D.value);
|
|
3717
3867
|
r.interrupt();
|
|
3718
|
-
let i =
|
|
3719
|
-
|
|
3720
|
-
let [[a, o], [s, c]] =
|
|
3868
|
+
let i = rt;
|
|
3869
|
+
rt = !0;
|
|
3870
|
+
let [[a, o], [s, c]] = Z.value.bounds({
|
|
3721
3871
|
type: "FeatureCollection",
|
|
3722
3872
|
features: e.map((e) => e.feature)
|
|
3723
|
-
}), l = (a + s) / 2, u = (o + c) / 2, d = p.focusZoomLevel, f =
|
|
3724
|
-
if (!
|
|
3873
|
+
}), 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
|
+
if (!N.value || !m) return;
|
|
3725
3875
|
let e = String(m.id);
|
|
3726
|
-
if (
|
|
3727
|
-
let t =
|
|
3728
|
-
t &&
|
|
3876
|
+
if (I.value) {
|
|
3877
|
+
let t = En(e);
|
|
3878
|
+
t && rn(e, t.x, t.y);
|
|
3729
3879
|
return;
|
|
3730
3880
|
}
|
|
3731
|
-
let t =
|
|
3881
|
+
let t = xe.get(e);
|
|
3732
3882
|
if (!t) return;
|
|
3733
3883
|
let n = t.getBoundingClientRect();
|
|
3734
|
-
|
|
3884
|
+
rn(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
3735
3885
|
};
|
|
3736
|
-
i ? (
|
|
3886
|
+
i ? (on(), r.transition().duration(oi).call(H.transform, f).on("end", h)) : (H.transform(r, f), h());
|
|
3737
3887
|
}
|
|
3738
|
-
function
|
|
3888
|
+
function at(e) {
|
|
3739
3889
|
let t = se.value;
|
|
3740
3890
|
if (!t) return;
|
|
3741
3891
|
let n = new Set(e.map((e) => e.key));
|
|
3742
|
-
for (let [e, t] of
|
|
3743
|
-
let r =
|
|
3892
|
+
for (let [e, t] of Te) n.has(e) || (t.el.remove(), Te.delete(e));
|
|
3893
|
+
let r = Z.value;
|
|
3744
3894
|
for (let { item: n, feature: i, key: a } of e) {
|
|
3745
|
-
let e =
|
|
3895
|
+
let e = Te.get(a);
|
|
3746
3896
|
if (!e) {
|
|
3747
|
-
let n = document.createElementNS(
|
|
3748
|
-
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 },
|
|
3897
|
+
let n = document.createElementNS(ti, "path");
|
|
3898
|
+
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);
|
|
3749
3899
|
}
|
|
3750
|
-
e.strokeWidth = n.strokeWidth, e.el.setAttribute("stroke", n.stroke ?? "#fff"),
|
|
3900
|
+
e.strokeWidth = n.strokeWidth, e.el.setAttribute("stroke", n.stroke ?? "#fff"), sn(e.el, n.style);
|
|
3751
3901
|
}
|
|
3752
|
-
|
|
3902
|
+
Dn();
|
|
3753
3903
|
}
|
|
3754
|
-
function
|
|
3755
|
-
if (!D.value || !
|
|
3756
|
-
|
|
3757
|
-
let e =
|
|
3758
|
-
e.interrupt(),
|
|
3759
|
-
let t =
|
|
3904
|
+
function ot() {
|
|
3905
|
+
if (!D.value || !H) return;
|
|
3906
|
+
zt.value.length > 0 && T("update:focus", null);
|
|
3907
|
+
let e = M(D.value);
|
|
3908
|
+
e.interrupt(), on();
|
|
3909
|
+
let t = G() && !$.isFullscreen.value && !K.value, n = e.transition().duration(oi).call(H.transform, fe);
|
|
3760
3910
|
t && n.on("end", () => {
|
|
3761
|
-
|
|
3911
|
+
He.value = !1;
|
|
3762
3912
|
});
|
|
3763
3913
|
}
|
|
3764
|
-
let
|
|
3914
|
+
let st = n(() => Math.max(12, p.focusZoomLevel)), ct = n(() => p.zoom && (G() ? $.isFullscreen.value || K.value || !p.touchExpand : !0)), lt = n(() => p.zoom && !G() && (K.value || He.value || $.isFullscreen.value)), ut = n(() => p.zoom && p.zoomHint && !K.value && !$.isFullscreen.value && (G() && p.touchExpand || !He.value)), dt = n(() => G() ? "Double tap to zoom" : "Double click to zoom"), ft = n(() => {
|
|
3765
3915
|
let e = {};
|
|
3766
|
-
return $.isFullscreen.value ||
|
|
3916
|
+
return $.isFullscreen.value || Ue.value ? e["touch-action"] = "none" : p.zoom && !K.value && G() && (e["touch-action"] = p.touchExpand ? "manipulation" : "pan-x pan-y"), (He.value || $.isFullscreen.value || p.zoom && (K.value || G())) && (e["will-change"] = "transform"), Object.keys(e).length ? e : void 0;
|
|
3767
3917
|
});
|
|
3768
|
-
function
|
|
3769
|
-
if (!D.value || !
|
|
3770
|
-
let t =
|
|
3771
|
-
t.interrupt(),
|
|
3918
|
+
function pt(e) {
|
|
3919
|
+
if (!D.value || !H) return;
|
|
3920
|
+
let t = M(D.value);
|
|
3921
|
+
t.interrupt(), on(), t.transition().duration(250).call(H.scaleBy, e);
|
|
3772
3922
|
}
|
|
3773
|
-
function
|
|
3923
|
+
function mt(e, t) {
|
|
3774
3924
|
let n = D.value;
|
|
3775
3925
|
if (!n) return null;
|
|
3776
3926
|
let r = null;
|
|
@@ -3783,69 +3933,69 @@ var Nr = {
|
|
|
3783
3933
|
let n = r.inverse();
|
|
3784
3934
|
return [n.a * e + n.c * t + n.e, n.b * e + n.d * t + n.f];
|
|
3785
3935
|
}
|
|
3786
|
-
let i = n.getBoundingClientRect(), a = i.width ?
|
|
3936
|
+
let i = n.getBoundingClientRect(), a = i.width ? bt.value / i.width : 1, o = i.height ? xt.value / i.height : 1;
|
|
3787
3937
|
return [(e - i.left) * a, (t - i.top) * o];
|
|
3788
3938
|
}
|
|
3789
|
-
function
|
|
3790
|
-
let n = D.value, r =
|
|
3791
|
-
return o && ([i, a] =
|
|
3939
|
+
function ht(e, t) {
|
|
3940
|
+
let n = D.value, r = ci, i = bt.value / 2, a = xt.value / 2, o = mt(e, t);
|
|
3941
|
+
return o && ([i, a] = pe(n).invert(o)), fe.translate(bt.value / 2 - r * i, xt.value / 2 - r * a).scale(r);
|
|
3792
3942
|
}
|
|
3793
|
-
function
|
|
3794
|
-
if (!D.value || !
|
|
3795
|
-
let t =
|
|
3796
|
-
t.interrupt(), t.transition().duration(
|
|
3943
|
+
function gt(e) {
|
|
3944
|
+
if (!D.value || !H) return;
|
|
3945
|
+
let t = M(D.value);
|
|
3946
|
+
t.interrupt(), t.transition().duration(oi).call(H.transform, e);
|
|
3797
3947
|
}
|
|
3798
|
-
function
|
|
3799
|
-
if (!D.value || !
|
|
3800
|
-
let n =
|
|
3801
|
-
$.enter(), f(() =>
|
|
3948
|
+
function _t(e, t) {
|
|
3949
|
+
if (!D.value || !H) return;
|
|
3950
|
+
let n = ht(e, t);
|
|
3951
|
+
$.enter(), f(() => gt(n));
|
|
3802
3952
|
}
|
|
3803
|
-
function
|
|
3804
|
-
!D.value || !
|
|
3953
|
+
function vt(e, t) {
|
|
3954
|
+
!D.value || !H || gt(ht(e, t));
|
|
3805
3955
|
}
|
|
3806
3956
|
C(() => p.focusZoomLevel, () => {
|
|
3807
|
-
|
|
3957
|
+
H && H.scaleExtent([1, st.value]), it();
|
|
3808
3958
|
}), C(() => p.state, () => {
|
|
3809
|
-
if (!D.value || !
|
|
3810
|
-
let e =
|
|
3811
|
-
e.interrupt(),
|
|
3959
|
+
if (!D.value || !H) return;
|
|
3960
|
+
let e = M(D.value);
|
|
3961
|
+
e.interrupt(), H.transform(e, fe);
|
|
3812
3962
|
});
|
|
3813
|
-
let
|
|
3963
|
+
let yt = n(() => p.width && p.height ? p.height / p.width : .625), bt = n(() => li), xt = n(() => li * yt.value), St = n(() => {
|
|
3814
3964
|
let e = re(p.topology), t = e?.objects?.states;
|
|
3815
3965
|
if (!t) return [];
|
|
3816
|
-
let n =
|
|
3966
|
+
let n = me(e, t);
|
|
3817
3967
|
return n.type === "FeatureCollection" ? n.features : [n];
|
|
3818
|
-
}),
|
|
3968
|
+
}), Ct = n(() => {
|
|
3819
3969
|
let e = p.state?.trim();
|
|
3820
3970
|
if (!e) return null;
|
|
3821
3971
|
if (/^\d{1,2}$/.test(e)) return e.padStart(2, "0");
|
|
3822
|
-
let t =
|
|
3972
|
+
let t = St.value.find((t) => t.properties?.name === e);
|
|
3823
3973
|
return t?.id == null ? null : String(t.id).padStart(2, "0");
|
|
3824
|
-
}),
|
|
3825
|
-
let e =
|
|
3826
|
-
return e ?
|
|
3974
|
+
}), wt = n(() => {
|
|
3975
|
+
let e = Ct.value;
|
|
3976
|
+
return e ? St.value.find((t) => String(t.id).padStart(2, "0") === e) ?? null : null;
|
|
3827
3977
|
});
|
|
3828
|
-
C(() => [p.state,
|
|
3978
|
+
C(() => [p.state, Ct.value], ([e, t]) => {
|
|
3829
3979
|
e && e.trim() && !t && console.warn(`[ChoroplethMap] state="${e}" matched no state name or FIPS code; rendering the full map.`);
|
|
3830
3980
|
}, { immediate: !0 });
|
|
3831
|
-
let
|
|
3832
|
-
function
|
|
3833
|
-
return
|
|
3981
|
+
let Tt = v(null), Et = null;
|
|
3982
|
+
function Dt() {
|
|
3983
|
+
return Et ||= import("./hsaMapping-BahYDmea.js").then((e) => e.n).then((e) => (Tt.value = e, e)), Et;
|
|
3834
3984
|
}
|
|
3835
3985
|
C(() => {
|
|
3836
3986
|
if (p.geoType === "hsas" || p.dataGeoType === "hsas") return !0;
|
|
3837
3987
|
let e = p.focus;
|
|
3838
3988
|
return e ? (Array.isArray(e) ? e : [e]).some((e) => typeof e != "string" && e.geoType === "hsas") : !1;
|
|
3839
3989
|
}, (e) => {
|
|
3840
|
-
e &&
|
|
3990
|
+
e && Dt();
|
|
3841
3991
|
}, { immediate: !0 });
|
|
3842
|
-
let
|
|
3843
|
-
let e =
|
|
3992
|
+
let Ot = n(() => {
|
|
3993
|
+
let e = Tt.value;
|
|
3844
3994
|
if (!e) return {
|
|
3845
3995
|
type: "FeatureCollection",
|
|
3846
3996
|
features: []
|
|
3847
3997
|
};
|
|
3848
|
-
let { fipsToHsa: t, hsaNames: n } = e, r = re(p.topology), i = r.objects.counties.geometries, a =
|
|
3998
|
+
let { fipsToHsa: t, hsaNames: n } = e, r = re(p.topology), i = r.objects.counties.geometries, a = Ct.value, o = /* @__PURE__ */ new Map();
|
|
3849
3999
|
for (let e of i) {
|
|
3850
4000
|
let n = String(e.id).padStart(5, "0");
|
|
3851
4001
|
if (a && n.slice(0, 2) !== a) continue;
|
|
@@ -3857,64 +4007,95 @@ var Nr = {
|
|
|
3857
4007
|
type: "Feature",
|
|
3858
4008
|
id: e,
|
|
3859
4009
|
properties: { name: n[e] ?? e },
|
|
3860
|
-
geometry:
|
|
4010
|
+
geometry: he(r, t)
|
|
3861
4011
|
});
|
|
3862
4012
|
return {
|
|
3863
4013
|
type: "FeatureCollection",
|
|
3864
4014
|
features: s
|
|
3865
4015
|
};
|
|
3866
|
-
}),
|
|
3867
|
-
if (p.geoType === "hsas") return
|
|
3868
|
-
let e =
|
|
4016
|
+
}), kt = n(() => {
|
|
4017
|
+
if (p.geoType === "hsas") return Ot.value;
|
|
4018
|
+
let e = Ct.value;
|
|
3869
4019
|
if (p.geoType === "counties") {
|
|
3870
|
-
let t = re(p.topology), n =
|
|
4020
|
+
let t = re(p.topology), n = me(t, t.objects.counties);
|
|
3871
4021
|
return e ? {
|
|
3872
4022
|
type: "FeatureCollection",
|
|
3873
4023
|
features: n.features.filter((t) => String(t.id).padStart(5, "0").slice(0, 2) === e)
|
|
3874
4024
|
} : n;
|
|
3875
4025
|
}
|
|
3876
|
-
let t = re(p.topology), n =
|
|
4026
|
+
let t = re(p.topology), n = me(t, t.objects.states);
|
|
3877
4027
|
return e ? {
|
|
3878
4028
|
type: "FeatureCollection",
|
|
3879
4029
|
features: n.features.filter((t) => String(t.id).padStart(2, "0") === e)
|
|
3880
4030
|
} : n;
|
|
3881
|
-
}),
|
|
4031
|
+
}), jt = n(() => {
|
|
3882
4032
|
if (p.geoType !== "counties" && p.geoType !== "hsas") return null;
|
|
3883
|
-
if (
|
|
4033
|
+
if (Ct.value) return wt.value;
|
|
3884
4034
|
let e = re(p.topology);
|
|
3885
|
-
return
|
|
3886
|
-
}),
|
|
3887
|
-
let e =
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
4035
|
+
return ge(e, e.objects.states, (e, t) => e !== t);
|
|
4036
|
+
}), Mt = n(() => {
|
|
4037
|
+
let e = p.tightFit;
|
|
4038
|
+
return e === !0 ? 1 : e ? Math.max(0, Math.min(1, Number(e))) : 0;
|
|
4039
|
+
}), Nt = n(() => {
|
|
4040
|
+
if (p.geoType === "hsas") {
|
|
4041
|
+
let e = Tt.value;
|
|
4042
|
+
if (!e) return null;
|
|
4043
|
+
let t = /* @__PURE__ */ new Set();
|
|
4044
|
+
for (let n in e.fipsToHsa) {
|
|
4045
|
+
let r = n.slice(0, 2);
|
|
4046
|
+
(r === "02" || r === "15") && t.add(e.fipsToHsa[n]);
|
|
4047
|
+
}
|
|
4048
|
+
return (e) => t.has(e);
|
|
3891
4049
|
}
|
|
3892
|
-
|
|
3893
|
-
|
|
4050
|
+
let e = p.geoType === "counties" ? 5 : 2;
|
|
4051
|
+
return (t) => {
|
|
4052
|
+
let n = t.padStart(e, "0").slice(0, 2);
|
|
4053
|
+
return n === "02" || n === "15";
|
|
4054
|
+
};
|
|
4055
|
+
}), Pt = n(() => {
|
|
4056
|
+
if (Mt.value <= 0 || Ct.value) return null;
|
|
4057
|
+
let e = Nt.value;
|
|
4058
|
+
if (!e) return null;
|
|
4059
|
+
let t = kt.value, n = t.features.filter((t) => !e(String(t.id)));
|
|
4060
|
+
return n.length === t.features.length ? null : {
|
|
4061
|
+
type: "FeatureCollection",
|
|
4062
|
+
features: n
|
|
4063
|
+
};
|
|
4064
|
+
}), X = n(() => {
|
|
4065
|
+
let e = wt.value;
|
|
4066
|
+
if (Ct.value && e) {
|
|
4067
|
+
let t = [[ui, ui], [bt.value - ui, xt.value - ui]], n = A().fitExtent(t, e), r = j(n).centroid(e);
|
|
4068
|
+
return Number.isFinite(r[0]) && Number.isFinite(r[1]) ? n : ue().fitExtent(t, e);
|
|
4069
|
+
}
|
|
4070
|
+
let t = [[0, 0], [bt.value, xt.value]], n = A().fitExtent(t, kt.value), r = Pt.value;
|
|
4071
|
+
if (!r) return n;
|
|
4072
|
+
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
|
+
return A().scale(o(n.scale(), i.scale())).translate([o(s, l), o(c, u)]);
|
|
4074
|
+
}), Z = n(() => j(X.value)), Ft = n(() => p.geoType === "counties" || p.geoType === "hsas" ? p.strokeWidth * .5 : p.strokeWidth), It = n(() => {
|
|
3894
4075
|
let e = /* @__PURE__ */ new Map();
|
|
3895
|
-
for (let [t, n] of
|
|
4076
|
+
for (let [t, n] of Bt.value) {
|
|
3896
4077
|
let r = /* @__PURE__ */ new Map();
|
|
3897
4078
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
3898
4079
|
e.set(t, r);
|
|
3899
4080
|
}
|
|
3900
4081
|
return e;
|
|
3901
4082
|
});
|
|
3902
|
-
function
|
|
4083
|
+
function Lt(e) {
|
|
3903
4084
|
let t = p.dataGeoType;
|
|
3904
4085
|
if (!t || t === p.geoType) return e;
|
|
3905
|
-
if (p.geoType === "counties" && t === "hsas") return
|
|
4086
|
+
if (p.geoType === "counties" && t === "hsas") return Tt.value?.fipsToHsa[e];
|
|
3906
4087
|
if (p.geoType === "counties" && t === "states" || p.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
3907
4088
|
}
|
|
3908
|
-
let
|
|
4089
|
+
let Rt = n(() => {
|
|
3909
4090
|
let e = /* @__PURE__ */ new Map();
|
|
3910
|
-
for (let t of
|
|
4091
|
+
for (let t of kt.value.features) t.id != null && e.set(String(t.id), t);
|
|
3911
4092
|
return e;
|
|
3912
|
-
}),
|
|
4093
|
+
}), zt = n(() => {
|
|
3913
4094
|
let e = p.focus;
|
|
3914
4095
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
3915
|
-
}),
|
|
4096
|
+
}), Bt = n(() => {
|
|
3916
4097
|
let e = /* @__PURE__ */ new Map();
|
|
3917
|
-
e.set(p.geoType,
|
|
4098
|
+
e.set(p.geoType, Rt.value);
|
|
3918
4099
|
let t = re(p.topology), n = t?.objects;
|
|
3919
4100
|
if (!n) return e;
|
|
3920
4101
|
let r = (e) => {
|
|
@@ -3923,25 +4104,25 @@ var Nr = {
|
|
|
3923
4104
|
return t;
|
|
3924
4105
|
};
|
|
3925
4106
|
if (!e.has("states") && n.states) {
|
|
3926
|
-
let i =
|
|
4107
|
+
let i = me(t, n.states);
|
|
3927
4108
|
e.set("states", r(i.features));
|
|
3928
4109
|
}
|
|
3929
4110
|
if (!e.has("counties") && n.counties) {
|
|
3930
|
-
let i =
|
|
4111
|
+
let i = me(t, n.counties);
|
|
3931
4112
|
e.set("counties", r(i.features));
|
|
3932
4113
|
}
|
|
3933
|
-
return !e.has("hsas") && n.counties && e.set("hsas", r(
|
|
3934
|
-
}),
|
|
4114
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(Ot.value.features)), e;
|
|
4115
|
+
}), Vt = n(() => {
|
|
3935
4116
|
let e = /* @__PURE__ */ new Map();
|
|
3936
4117
|
if (!p.data) return e;
|
|
3937
|
-
let t = p.dataGeoType ?? p.geoType, n =
|
|
4118
|
+
let t = p.dataGeoType ?? p.geoType, n = It.value.get(t);
|
|
3938
4119
|
for (let t of p.data) {
|
|
3939
4120
|
e.set(t.id, t.value);
|
|
3940
4121
|
let r = n?.get(t.id);
|
|
3941
4122
|
r && e.set(r, t.value);
|
|
3942
4123
|
}
|
|
3943
4124
|
return e;
|
|
3944
|
-
}),
|
|
4125
|
+
}), Ht = n(() => {
|
|
3945
4126
|
if (!p.data || p.data.length === 0) return {
|
|
3946
4127
|
min: 0,
|
|
3947
4128
|
max: 1
|
|
@@ -3958,122 +4139,119 @@ var Nr = {
|
|
|
3958
4139
|
min: 0,
|
|
3959
4140
|
max: 1
|
|
3960
4141
|
};
|
|
3961
|
-
}),
|
|
3962
|
-
function
|
|
3963
|
-
let [t, n, r] =
|
|
4142
|
+
}), Ut = n(() => Array.isArray(p.colorScale) && p.colorScale.length > 0 && "value" in p.colorScale[0]), Wt = n(() => Array.isArray(p.colorScale) && !Ut.value), Gt = n(() => Wt.value ? "" : p.colorScale?.min ?? "#e5f0fa"), Kt = n(() => Wt.value ? "" : p.colorScale?.max ?? "#08519c");
|
|
4143
|
+
function qt(e) {
|
|
4144
|
+
let [t, n, r] = At(Gt.value) ?? [
|
|
3964
4145
|
229,
|
|
3965
4146
|
240,
|
|
3966
4147
|
250
|
|
3967
|
-
], [i, a, o] =
|
|
4148
|
+
], [i, a, o] = At(Kt.value) ?? [
|
|
3968
4149
|
8,
|
|
3969
4150
|
81,
|
|
3970
4151
|
156
|
|
3971
4152
|
];
|
|
3972
4153
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
3973
4154
|
}
|
|
3974
|
-
let
|
|
3975
|
-
if (!
|
|
4155
|
+
let Jt = n(() => Wt.value ? p.colorScale.slice().sort((e, t) => t.min - e.min) : null), Yt = n(() => {
|
|
4156
|
+
if (!Ut.value) return null;
|
|
3976
4157
|
let e = /* @__PURE__ */ new Map();
|
|
3977
4158
|
for (let t of p.colorScale) e.set(t.value, t.color);
|
|
3978
4159
|
return e;
|
|
3979
4160
|
});
|
|
3980
|
-
function
|
|
3981
|
-
let t =
|
|
3982
|
-
return t == null ? void 0 :
|
|
4161
|
+
function Q(e) {
|
|
4162
|
+
let t = Lt(e);
|
|
4163
|
+
return t == null ? void 0 : Vt.value.get(t);
|
|
3983
4164
|
}
|
|
3984
|
-
function
|
|
3985
|
-
let t =
|
|
4165
|
+
function Xt(e) {
|
|
4166
|
+
let t = Q(e), n = p.noDataColor;
|
|
3986
4167
|
if (t == null) return n;
|
|
3987
|
-
let r =
|
|
4168
|
+
let r = Yt.value;
|
|
3988
4169
|
if (r) return r.get(String(t)) ?? n;
|
|
3989
|
-
let i =
|
|
4170
|
+
let i = Jt.value;
|
|
3990
4171
|
if (i) {
|
|
3991
4172
|
let e = t;
|
|
3992
4173
|
for (let t of i) if (e >= t.min) return t.color;
|
|
3993
4174
|
return n;
|
|
3994
4175
|
}
|
|
3995
|
-
let { min: a, max: o } =
|
|
3996
|
-
return
|
|
4176
|
+
let { min: a, max: o } = Ht.value;
|
|
4177
|
+
return qt((t - a) / (o - a));
|
|
3997
4178
|
}
|
|
3998
|
-
let
|
|
3999
|
-
function
|
|
4179
|
+
let Zt = (e) => e.properties?.name ?? String(e.id);
|
|
4180
|
+
function Qt(e) {
|
|
4000
4181
|
return e == null ? "" : typeof e == "number" && p.tooltipValueFormat !== void 0 ? ae(e, p.tooltipValueFormat) : String(e);
|
|
4001
4182
|
}
|
|
4002
|
-
function
|
|
4003
|
-
return t == null ? e : `${e}: ${
|
|
4183
|
+
function $t(e, t) {
|
|
4184
|
+
return t == null ? e : `${e}: ${Qt(t)}`;
|
|
4004
4185
|
}
|
|
4005
|
-
function
|
|
4006
|
-
let e =
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
}), Me.observe(e);
|
|
4186
|
+
function en() {
|
|
4187
|
+
let e = _e.value?.getEl();
|
|
4188
|
+
e && (Ie?.disconnect(), Ie = new ResizeObserver((e) => {
|
|
4189
|
+
let t = e[0];
|
|
4190
|
+
if (!t) return;
|
|
4191
|
+
let n = t.borderBoxSize?.[0];
|
|
4192
|
+
Le.width = n ? n.inlineSize : t.contentRect.width, Le.height = n ? n.blockSize : t.contentRect.height, V && B && tn(B.x, B.y);
|
|
4193
|
+
}), Ie.observe(e));
|
|
4014
4194
|
}
|
|
4015
|
-
function
|
|
4016
|
-
let n =
|
|
4195
|
+
function tn(e, t) {
|
|
4196
|
+
let n = _e.value?.getEl();
|
|
4017
4197
|
if (!n) return;
|
|
4018
|
-
let r = oe.value?.getBoundingClientRect(), { left: i, top: a } =
|
|
4198
|
+
let r = oe.value?.getBoundingClientRect(), { left: i, top: a } = z(e, t, Le.width, Le.height, p.tooltipClamp, r);
|
|
4019
4199
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
4020
4200
|
let o = typeof window < "u" ? window.visualViewport : null;
|
|
4021
4201
|
if (!o || o.scale <= 1.01 && o.offsetTop < 1 && o.offsetLeft < 1) return;
|
|
4022
4202
|
let s = n.getBoundingClientRect(), c = s.left - i, l = s.top + s.height / 2 - a;
|
|
4023
4203
|
(Math.abs(c) > 1 || Math.abs(l) > 1) && (n.style.transform = `translate3d(${i - c}px, ${a - l}px, 0) translateY(-50%)`);
|
|
4024
4204
|
}
|
|
4025
|
-
let
|
|
4026
|
-
function
|
|
4027
|
-
let r =
|
|
4205
|
+
let nn = n(() => $.isFullscreen.value && G() ? "sheet" : "float");
|
|
4206
|
+
function rn(e, t, n) {
|
|
4207
|
+
let r = Se.get(e);
|
|
4028
4208
|
if (!r) return;
|
|
4029
|
-
let i =
|
|
4209
|
+
let i = _e.value;
|
|
4030
4210
|
if (!i) return;
|
|
4031
|
-
if (i.setData(r),
|
|
4211
|
+
if (i.setData(r), V = !0, nn.value === "sheet") {
|
|
4032
4212
|
i.setOpen(!0);
|
|
4033
4213
|
return;
|
|
4034
4214
|
}
|
|
4035
4215
|
let a = i.getEl();
|
|
4036
|
-
a && (
|
|
4216
|
+
a && (B = {
|
|
4037
4217
|
x: t,
|
|
4038
4218
|
y: n
|
|
4039
|
-
},
|
|
4219
|
+
}, tn(t, n), a.style.visibility = "visible");
|
|
4040
4220
|
}
|
|
4041
|
-
function
|
|
4042
|
-
!
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
y: He
|
|
4048
|
-
}, e.style.transform = `translate3d(${Ve + 16}px, ${He}px, 0) translateY(-50%)`);
|
|
4221
|
+
function an(e, t) {
|
|
4222
|
+
!V || nn.value === "sheet" || (We = e, Ge = t, !Ke && (Ke = requestAnimationFrame(() => {
|
|
4223
|
+
Ke = 0, V && (B = {
|
|
4224
|
+
x: We,
|
|
4225
|
+
y: Ge
|
|
4226
|
+
}, tn(We, Ge));
|
|
4049
4227
|
})));
|
|
4050
4228
|
}
|
|
4051
|
-
function
|
|
4052
|
-
if (!
|
|
4053
|
-
|
|
4054
|
-
let e =
|
|
4229
|
+
function on() {
|
|
4230
|
+
if (!V) return;
|
|
4231
|
+
V = !1, B = null, _e.value?.setOpen(!1);
|
|
4232
|
+
let e = _e.value?.getEl();
|
|
4055
4233
|
e && (e.style.visibility = "hidden");
|
|
4056
4234
|
}
|
|
4057
|
-
function
|
|
4235
|
+
function sn(e, t) {
|
|
4058
4236
|
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"));
|
|
4059
4237
|
}
|
|
4060
|
-
function
|
|
4061
|
-
return
|
|
4238
|
+
function cn() {
|
|
4239
|
+
return Be.value * Ve.value || 1;
|
|
4062
4240
|
}
|
|
4063
|
-
function
|
|
4064
|
-
return e?.strokeWidth ??
|
|
4241
|
+
function ln(e) {
|
|
4242
|
+
return e?.strokeWidth ?? Ft.value + 1;
|
|
4065
4243
|
}
|
|
4066
|
-
function
|
|
4067
|
-
let e =
|
|
4244
|
+
function un() {
|
|
4245
|
+
let e = At(di);
|
|
4068
4246
|
return e ? `rgb(${e[0]},${e[1]},${e[2]})` : "#000";
|
|
4069
4247
|
}
|
|
4070
|
-
function
|
|
4071
|
-
let e =
|
|
4248
|
+
function dn() {
|
|
4249
|
+
let e = pe(D.value);
|
|
4072
4250
|
return {
|
|
4073
4251
|
dpr: typeof window < "u" && window.devicePixelRatio || 1,
|
|
4074
|
-
meetScale:
|
|
4075
|
-
offsetX:
|
|
4076
|
-
offsetY:
|
|
4252
|
+
meetScale: Ve.value,
|
|
4253
|
+
offsetX: Pe,
|
|
4254
|
+
offsetY: Fe,
|
|
4077
4255
|
zoom: {
|
|
4078
4256
|
k: e.k,
|
|
4079
4257
|
x: e.x,
|
|
@@ -4081,73 +4259,73 @@ var Nr = {
|
|
|
4081
4259
|
}
|
|
4082
4260
|
};
|
|
4083
4261
|
}
|
|
4084
|
-
function
|
|
4262
|
+
function fn() {
|
|
4085
4263
|
return {
|
|
4086
4264
|
strokeColor: p.strokeColor,
|
|
4087
|
-
strokeWidth:
|
|
4088
|
-
highlightStroke:
|
|
4089
|
-
hoveredId:
|
|
4090
|
-
focused:
|
|
4091
|
-
overlays:
|
|
4265
|
+
strokeWidth: Ft.value,
|
|
4266
|
+
highlightStroke: un(),
|
|
4267
|
+
hoveredId: L,
|
|
4268
|
+
focused: Ae,
|
|
4269
|
+
overlays: je
|
|
4092
4270
|
};
|
|
4093
4271
|
}
|
|
4094
|
-
let
|
|
4095
|
-
function
|
|
4096
|
-
typeof window > "u" || typeof window.matchMedia != "function" || (
|
|
4272
|
+
let pn = 0, mn = 0, hn = !1, gn = null;
|
|
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));
|
|
4097
4275
|
}
|
|
4098
|
-
function
|
|
4099
|
-
|
|
4100
|
-
let e =
|
|
4101
|
-
if (!
|
|
4276
|
+
function vn() {
|
|
4277
|
+
_n();
|
|
4278
|
+
let e = Ee.value, t = D.value;
|
|
4279
|
+
if (!I.value || !e || !t) return;
|
|
4102
4280
|
let n = t.getBoundingClientRect();
|
|
4103
4281
|
if (n.width) {
|
|
4104
4282
|
let t = window.devicePixelRatio || 1;
|
|
4105
4283
|
e.width = Math.max(1, Math.round(n.width * t)), e.height = Math.max(1, Math.round(n.height * t));
|
|
4106
4284
|
}
|
|
4107
|
-
|
|
4285
|
+
wn();
|
|
4108
4286
|
}
|
|
4109
|
-
let
|
|
4110
|
-
function
|
|
4287
|
+
let yn = null, bn = null, xn = 0;
|
|
4288
|
+
function Sn(e, t, n, r) {
|
|
4111
4289
|
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);
|
|
4112
4290
|
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);
|
|
4113
4291
|
}
|
|
4114
|
-
function
|
|
4115
|
-
let e =
|
|
4292
|
+
function Cn() {
|
|
4293
|
+
let e = Ee.value;
|
|
4116
4294
|
if (!e) return;
|
|
4117
4295
|
let t = e.getContext("2d");
|
|
4118
4296
|
if (!t) return;
|
|
4119
4297
|
let n = () => typeof performance < "u" ? performance.now() : 0;
|
|
4120
|
-
if (t.setTransform(1, 0, 0, 1, 0, 0), t.clearRect(0, 0, e.width, e.height), !
|
|
4121
|
-
let r =
|
|
4122
|
-
if (
|
|
4123
|
-
|
|
4298
|
+
if (t.setTransform(1, 0, 0, 1, 0, 0), t.clearRect(0, 0, e.width, e.height), !De) return;
|
|
4299
|
+
let r = dn();
|
|
4300
|
+
if (hn && R && yn && bn && typeof t.drawImage == "function" && n() - xn < pi) {
|
|
4301
|
+
Sn(t, r, yn, bn), L && kr(t, De, r, fn(), L);
|
|
4124
4302
|
return;
|
|
4125
4303
|
}
|
|
4126
4304
|
let i = n();
|
|
4127
|
-
|
|
4305
|
+
Ar(t, De, r, fn());
|
|
4128
4306
|
let a = n() - i;
|
|
4129
|
-
if (
|
|
4130
|
-
|
|
4131
|
-
let o =
|
|
4132
|
-
o && typeof o.drawImage == "function" ? (o.setTransform(1, 0, 0, 1, 0, 0), o.clearRect(0, 0,
|
|
4307
|
+
if (xn = i + a, a > fi ? (mn = 0, ++pn >= 2 && (hn = !0)) : (pn = 0, ++mn >= 2 && (hn = !1)), !hn || typeof document > "u") return;
|
|
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;
|
|
4133
4311
|
}
|
|
4134
|
-
function
|
|
4135
|
-
!
|
|
4136
|
-
|
|
4312
|
+
function wn() {
|
|
4313
|
+
!I.value || Me || (Me = requestAnimationFrame(() => {
|
|
4314
|
+
Me = 0, Cn();
|
|
4137
4315
|
}));
|
|
4138
4316
|
}
|
|
4139
|
-
function
|
|
4317
|
+
function Tn(e, t) {
|
|
4140
4318
|
let n = D.value;
|
|
4141
|
-
if (!n || !
|
|
4142
|
-
let r =
|
|
4319
|
+
if (!n || !De || !ke) return null;
|
|
4320
|
+
let r = mt(e, t);
|
|
4143
4321
|
if (!r) return null;
|
|
4144
|
-
let [i, a] =
|
|
4145
|
-
return o == null ? null :
|
|
4322
|
+
let [i, a] = pe(n).invert(r), o = Nr(ke, De, i, a);
|
|
4323
|
+
return o == null ? null : De.items[o].id;
|
|
4146
4324
|
}
|
|
4147
|
-
function
|
|
4148
|
-
let t = D.value, n =
|
|
4325
|
+
function En(e) {
|
|
4326
|
+
let t = D.value, n = Rt.value.get(e);
|
|
4149
4327
|
if (!t || !n) return null;
|
|
4150
|
-
let [[r, i], [a, o]] =
|
|
4328
|
+
let [[r, i], [a, o]] = Z.value.bounds(n), [s, c] = pe(t).apply([(r + a) / 2, (i + o) / 2]), l = null;
|
|
4151
4329
|
try {
|
|
4152
4330
|
l = t.getScreenCTM();
|
|
4153
4331
|
} catch {
|
|
@@ -4158,320 +4336,377 @@ var Nr = {
|
|
|
4158
4336
|
y: l.b * s + l.d * c + l.f
|
|
4159
4337
|
} : null;
|
|
4160
4338
|
}
|
|
4161
|
-
function
|
|
4162
|
-
if (
|
|
4163
|
-
let e =
|
|
4164
|
-
k.value?.setAttribute("stroke-width", String(t / e)),
|
|
4165
|
-
for (let { el: t, strokeWidth: n } of
|
|
4166
|
-
for (let [t, n] of
|
|
4167
|
-
|
|
4339
|
+
function Dn() {
|
|
4340
|
+
if (I.value) return;
|
|
4341
|
+
let e = cn(), t = Ft.value;
|
|
4342
|
+
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
|
+
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(ln(n) / e));
|
|
4345
|
+
F && !we.has(F) && F.setAttribute("stroke-width", String(ln() / e));
|
|
4168
4346
|
}
|
|
4169
|
-
function
|
|
4170
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
4347
|
+
function On(e, t) {
|
|
4348
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(ln(t) / cn())), e.style.stroke = t?.stroke ?? di, sn(e, t?.style);
|
|
4171
4349
|
}
|
|
4172
|
-
function
|
|
4350
|
+
function kn(e) {
|
|
4173
4351
|
e.removeAttribute("stroke-width"), e.style.stroke = "", e.setAttribute("stroke", p.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
4174
4352
|
}
|
|
4175
|
-
function
|
|
4176
|
-
|
|
4353
|
+
function An(e) {
|
|
4354
|
+
F !== e && (F && !we.has(F) && kn(F), F = e, On(e, we.get(e)));
|
|
4177
4355
|
}
|
|
4178
|
-
function
|
|
4179
|
-
if (
|
|
4180
|
-
if (
|
|
4181
|
-
|
|
4356
|
+
function jn(e) {
|
|
4357
|
+
if (I.value) {
|
|
4358
|
+
if (L === e) return;
|
|
4359
|
+
L = e, wn();
|
|
4182
4360
|
return;
|
|
4183
4361
|
}
|
|
4184
|
-
let t =
|
|
4185
|
-
t &&
|
|
4362
|
+
let t = xe.get(e);
|
|
4363
|
+
t && An(t);
|
|
4186
4364
|
}
|
|
4187
|
-
function
|
|
4188
|
-
if (
|
|
4189
|
-
|
|
4365
|
+
function Mn() {
|
|
4366
|
+
if (I.value) {
|
|
4367
|
+
L != null && (L = null, wn(), T("stateHover", null)), on();
|
|
4190
4368
|
return;
|
|
4191
4369
|
}
|
|
4192
|
-
if (
|
|
4193
|
-
let e =
|
|
4194
|
-
e == null ?
|
|
4370
|
+
if (F) {
|
|
4371
|
+
let e = we.get(F);
|
|
4372
|
+
e == null ? kn(F) : On(F, e), F = null, T("stateHover", null);
|
|
4195
4373
|
}
|
|
4196
|
-
|
|
4374
|
+
on();
|
|
4197
4375
|
}
|
|
4198
|
-
function
|
|
4376
|
+
function Nn(e) {
|
|
4199
4377
|
let t = e;
|
|
4200
4378
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
4201
4379
|
return t ? t.dataset.featId ?? null : null;
|
|
4202
4380
|
}
|
|
4203
|
-
function
|
|
4381
|
+
function Pn(e) {
|
|
4204
4382
|
T("stateClick", {
|
|
4205
4383
|
id: e.id,
|
|
4206
4384
|
name: e.name,
|
|
4207
4385
|
value: e.value
|
|
4208
|
-
}), T("update:focus",
|
|
4386
|
+
}), T("update:focus", nt(zt.value).has(e.id) ? null : e.id);
|
|
4209
4387
|
}
|
|
4210
|
-
function
|
|
4211
|
-
if (e.type === "mouseover" &&
|
|
4212
|
-
let t = e, n =
|
|
4388
|
+
function Fn(e) {
|
|
4389
|
+
if (e.type === "mouseover" && R) return;
|
|
4390
|
+
let t = e, n = Bn(t.target, t.clientX, t.clientY);
|
|
4213
4391
|
if (!n) return;
|
|
4214
|
-
let r =
|
|
4392
|
+
let r = Se.get(n);
|
|
4215
4393
|
if (!r) return;
|
|
4216
4394
|
let i = {
|
|
4217
4395
|
id: r.id,
|
|
4218
4396
|
name: r.name,
|
|
4219
4397
|
value: r.value
|
|
4220
4398
|
};
|
|
4221
|
-
e.type === "click" ? p.zoom ? (window.clearTimeout(
|
|
4222
|
-
|
|
4223
|
-
},
|
|
4399
|
+
e.type === "click" ? p.zoom ? (window.clearTimeout(q), q = 0, t.detail <= 1 && (q = window.setTimeout(() => {
|
|
4400
|
+
q = 0, Pn(r);
|
|
4401
|
+
}, ii))) : Pn(r) : e.type === "mouseover" && (jn(n), N.value && rn(n, t.clientX, t.clientY), T("stateHover", i));
|
|
4224
4402
|
}
|
|
4225
|
-
function
|
|
4226
|
-
|
|
4403
|
+
function In(e) {
|
|
4404
|
+
R || an(e.clientX, e.clientY);
|
|
4227
4405
|
}
|
|
4228
|
-
function
|
|
4406
|
+
function Ln(e) {
|
|
4229
4407
|
let t = e.relatedTarget;
|
|
4230
|
-
t && O.value?.contains(t) ||
|
|
4408
|
+
t && O.value?.contains(t) || Mn();
|
|
4231
4409
|
}
|
|
4232
|
-
function
|
|
4233
|
-
if (
|
|
4234
|
-
let t =
|
|
4235
|
-
if (t ===
|
|
4236
|
-
t &&
|
|
4410
|
+
function Rn(e) {
|
|
4411
|
+
if (R) return;
|
|
4412
|
+
let t = Tn(e.clientX, e.clientY);
|
|
4413
|
+
if (t === L) {
|
|
4414
|
+
t && an(e.clientX, e.clientY);
|
|
4237
4415
|
return;
|
|
4238
4416
|
}
|
|
4239
4417
|
if (!t) {
|
|
4240
|
-
|
|
4418
|
+
Mn();
|
|
4241
4419
|
return;
|
|
4242
4420
|
}
|
|
4243
|
-
let n =
|
|
4244
|
-
n && (
|
|
4421
|
+
let n = Se.get(t);
|
|
4422
|
+
n && (jn(t), T("stateHover", {
|
|
4245
4423
|
id: n.id,
|
|
4246
4424
|
name: n.name,
|
|
4247
4425
|
value: n.value
|
|
4248
|
-
}),
|
|
4426
|
+
}), N.value && rn(t, e.clientX, e.clientY));
|
|
4249
4427
|
}
|
|
4250
|
-
function
|
|
4251
|
-
|
|
4428
|
+
function zn() {
|
|
4429
|
+
Mn();
|
|
4252
4430
|
}
|
|
4253
|
-
function
|
|
4254
|
-
return
|
|
4431
|
+
function Bn(e, t, n) {
|
|
4432
|
+
return I.value ? Tn(t, n) : Nn(e);
|
|
4255
4433
|
}
|
|
4256
|
-
function
|
|
4434
|
+
function Vn(e) {
|
|
4257
4435
|
if (e.touches.length !== 1) {
|
|
4258
|
-
|
|
4436
|
+
qe = null;
|
|
4259
4437
|
return;
|
|
4260
4438
|
}
|
|
4261
4439
|
let t = e.touches[0];
|
|
4262
|
-
|
|
4440
|
+
qe = {
|
|
4263
4441
|
x: t.clientX,
|
|
4264
4442
|
y: t.clientY,
|
|
4265
4443
|
time: e.timeStamp,
|
|
4266
|
-
featId:
|
|
4444
|
+
featId: Bn(e.target, t.clientX, t.clientY)
|
|
4267
4445
|
};
|
|
4268
4446
|
}
|
|
4269
|
-
function
|
|
4270
|
-
let t =
|
|
4271
|
-
if (
|
|
4447
|
+
function Hn(e) {
|
|
4448
|
+
let t = qe;
|
|
4449
|
+
if (qe = null, !t || e.touches.length > 0) return;
|
|
4272
4450
|
let n = e.changedTouches[0];
|
|
4273
|
-
if (!n || Math.abs(n.clientX - t.x) >
|
|
4274
|
-
if (p.zoom && !
|
|
4275
|
-
e.preventDefault();
|
|
4276
|
-
let r =
|
|
4277
|
-
if (
|
|
4451
|
+
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 && !K.value && G() && !$.isFullscreen.value) {
|
|
4453
|
+
e.cancelable && e.preventDefault();
|
|
4454
|
+
let r = Je;
|
|
4455
|
+
if (Je = {
|
|
4278
4456
|
x: n.clientX,
|
|
4279
4457
|
y: n.clientY,
|
|
4280
4458
|
time: e.timeStamp
|
|
4281
|
-
}, r != null && e.timeStamp - r.time <=
|
|
4282
|
-
|
|
4459
|
+
}, r != null && e.timeStamp - r.time <= ii && Math.abs(n.clientX - r.x) <= ai && Math.abs(n.clientY - r.y) <= ai) {
|
|
4460
|
+
Je = null, window.clearTimeout(q), q = 0, p.touchExpand ? _t(n.clientX, n.clientY) : vt(n.clientX, n.clientY);
|
|
4283
4461
|
return;
|
|
4284
4462
|
}
|
|
4285
|
-
let i = t.featId ?
|
|
4463
|
+
let i = t.featId ? Se.get(t.featId) : void 0;
|
|
4286
4464
|
if (!i) {
|
|
4287
|
-
|
|
4465
|
+
Mn();
|
|
4288
4466
|
return;
|
|
4289
4467
|
}
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
},
|
|
4468
|
+
Un(i, n.clientX, n.clientY), window.clearTimeout(q), q = window.setTimeout(() => {
|
|
4469
|
+
q = 0, Pn(i);
|
|
4470
|
+
}, ii);
|
|
4293
4471
|
return;
|
|
4294
4472
|
}
|
|
4295
4473
|
if (!t.featId) {
|
|
4296
|
-
|
|
4474
|
+
Mn();
|
|
4297
4475
|
return;
|
|
4298
4476
|
}
|
|
4299
|
-
let r =
|
|
4300
|
-
r && (e.preventDefault(),
|
|
4477
|
+
let r = Se.get(t.featId);
|
|
4478
|
+
r && (e.cancelable && e.preventDefault(), Un(r, n.clientX, n.clientY), Pn(r));
|
|
4301
4479
|
}
|
|
4302
|
-
function
|
|
4303
|
-
if (
|
|
4480
|
+
function Un(e, t, n) {
|
|
4481
|
+
if (jn(e.id), T("stateHover", {
|
|
4304
4482
|
id: e.id,
|
|
4305
4483
|
name: e.name,
|
|
4306
4484
|
value: e.value
|
|
4307
|
-
}), !
|
|
4308
|
-
if (
|
|
4309
|
-
let r =
|
|
4310
|
-
r ?
|
|
4485
|
+
}), !N.value) return;
|
|
4486
|
+
if (I.value) {
|
|
4487
|
+
let r = En(e.id);
|
|
4488
|
+
r ? rn(e.id, r.x, r.y) : rn(e.id, t, n);
|
|
4311
4489
|
return;
|
|
4312
4490
|
}
|
|
4313
|
-
let r =
|
|
4491
|
+
let r = xe.get(e.id);
|
|
4314
4492
|
if (r) {
|
|
4315
4493
|
let t = r.getBoundingClientRect();
|
|
4316
|
-
|
|
4317
|
-
} else
|
|
4494
|
+
rn(e.id, t.left + t.width / 2, t.top + t.height / 2);
|
|
4495
|
+
} else rn(e.id, t, n);
|
|
4318
4496
|
}
|
|
4319
|
-
function
|
|
4320
|
-
|
|
4497
|
+
function Wn() {
|
|
4498
|
+
qe = null;
|
|
4321
4499
|
}
|
|
4322
|
-
function
|
|
4323
|
-
let t = document.createElementNS(
|
|
4500
|
+
function Gn(e) {
|
|
4501
|
+
let t = document.createElementNS(ti, "path");
|
|
4324
4502
|
return e && t.setAttribute("d", e), t;
|
|
4325
4503
|
}
|
|
4326
|
-
function
|
|
4504
|
+
function Kn(e) {
|
|
4505
|
+
let t = D.value, n = oe.value?.getBoundingClientRect();
|
|
4506
|
+
if (!e || !t || !n) return;
|
|
4507
|
+
let r = t.getBoundingClientRect();
|
|
4508
|
+
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
|
+
}
|
|
4510
|
+
function qn() {
|
|
4511
|
+
let e = ce.value;
|
|
4512
|
+
if (!e) return;
|
|
4513
|
+
let t = p.cities, n = X.value;
|
|
4514
|
+
if (!t || t.length === 0 || !n) {
|
|
4515
|
+
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
4516
|
+
return;
|
|
4517
|
+
}
|
|
4518
|
+
for (Kn(le.value); e.firstChild;) e.removeChild(e.firstChild);
|
|
4519
|
+
let r = D.value ? pe(D.value) : {
|
|
4520
|
+
k: 1,
|
|
4521
|
+
x: 0,
|
|
4522
|
+
y: 0
|
|
4523
|
+
}, i = p.zoom ? t.filter((e) => r.k >= (e.minZoom ?? p.citiesMinZoom)) : t;
|
|
4524
|
+
if (i.length === 0) return;
|
|
4525
|
+
let a = Wr(i, (e) => n(e), {
|
|
4526
|
+
k: r.k,
|
|
4527
|
+
x: r.x,
|
|
4528
|
+
y: r.y
|
|
4529
|
+
}, {
|
|
4530
|
+
width: bt.value,
|
|
4531
|
+
height: xt.value,
|
|
4532
|
+
viewScale: Ve.value,
|
|
4533
|
+
labelPx: mi,
|
|
4534
|
+
dotPx: hi,
|
|
4535
|
+
gapPx: gi,
|
|
4536
|
+
margin: 4
|
|
4537
|
+
}), o = Ve.value || 1, s = mi / o, c = _i / o, l = vi / o, u = document.createDocumentFragment();
|
|
4538
|
+
for (let e of a) {
|
|
4539
|
+
let t = document.createElementNS(ti, "circle");
|
|
4540
|
+
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) {
|
|
4541
|
+
let t = document.createElementNS(ti, "text");
|
|
4542
|
+
t.setAttribute("x", String(e.label.x)), t.setAttribute("y", String(e.label.y)), t.setAttribute("text-anchor", e.label.anchor), t.setAttribute("dominant-baseline", "central"), t.setAttribute("font-size", String(s)), t.setAttribute("stroke-width", String(l)), t.setAttribute("class", e.capital ? "choropleth-city-label choropleth-city-label-capital" : "choropleth-city-label"), t.textContent = e.name, u.appendChild(t);
|
|
4543
|
+
}
|
|
4544
|
+
}
|
|
4545
|
+
e.appendChild(u);
|
|
4546
|
+
}
|
|
4547
|
+
function Jn() {
|
|
4548
|
+
Ne ||= requestAnimationFrame(() => {
|
|
4549
|
+
Ne = 0, qn();
|
|
4550
|
+
});
|
|
4551
|
+
}
|
|
4552
|
+
function Yn() {
|
|
4327
4553
|
let e = k.value, t = se.value;
|
|
4328
4554
|
if (!e || !t) return;
|
|
4329
4555
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
4330
4556
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
4331
|
-
|
|
4332
|
-
let n =
|
|
4557
|
+
xe.clear(), Se.clear(), Ce = null, F = null, we.clear(), Te.clear(), L = null, Ae.clear(), je = [];
|
|
4558
|
+
let n = Z.value, r = kt.value.features;
|
|
4333
4559
|
if (r.length === 0) {
|
|
4334
|
-
|
|
4560
|
+
De = null, ke = null, bn = null, wn();
|
|
4335
4561
|
return;
|
|
4336
4562
|
}
|
|
4337
|
-
if (
|
|
4563
|
+
if (I.value) {
|
|
4338
4564
|
for (let e of r) {
|
|
4339
4565
|
let t = String(e.id);
|
|
4340
|
-
|
|
4566
|
+
Se.set(t, {
|
|
4341
4567
|
id: t,
|
|
4342
|
-
name:
|
|
4343
|
-
value:
|
|
4568
|
+
name: Zt(e),
|
|
4569
|
+
value: Q(t),
|
|
4344
4570
|
feature: e
|
|
4345
4571
|
});
|
|
4346
4572
|
}
|
|
4347
|
-
let e =
|
|
4348
|
-
|
|
4573
|
+
let e = jt.value;
|
|
4574
|
+
De = wr(r, n, Xt, e ? n(e) : null), !Oe && typeof document < "u" && (Oe = document.createElement("canvas")), ke = Oe ? Mr(De, bt.value, xt.value, Oe) : null, wn();
|
|
4349
4575
|
return;
|
|
4350
4576
|
}
|
|
4351
|
-
let i = p.strokeColor, a = !
|
|
4577
|
+
let i = p.strokeColor, a = !N.value, o = document.createDocumentFragment();
|
|
4352
4578
|
for (let e of r) {
|
|
4353
|
-
let t = String(e.id), r =
|
|
4354
|
-
if (c.setAttribute("class", "state-path"), c.setAttribute("data-feat-id", t), c.setAttribute("fill",
|
|
4355
|
-
let e = document.createElementNS(
|
|
4356
|
-
e.textContent =
|
|
4579
|
+
let t = String(e.id), r = Zt(e), s = Q(t), c = Gn(n(e));
|
|
4580
|
+
if (c.setAttribute("class", "state-path"), c.setAttribute("data-feat-id", t), c.setAttribute("fill", Xt(t)), c.setAttribute("stroke", i), a) {
|
|
4581
|
+
let e = document.createElementNS(ti, "title");
|
|
4582
|
+
e.textContent = $t(r, s), c.appendChild(e);
|
|
4357
4583
|
}
|
|
4358
|
-
o.appendChild(c),
|
|
4584
|
+
o.appendChild(c), xe.set(t, c), Se.set(t, {
|
|
4359
4585
|
id: t,
|
|
4360
4586
|
name: r,
|
|
4361
4587
|
value: s,
|
|
4362
4588
|
feature: e
|
|
4363
4589
|
});
|
|
4364
4590
|
}
|
|
4365
|
-
let s =
|
|
4591
|
+
let s = jt.value;
|
|
4366
4592
|
if (s) {
|
|
4367
|
-
let e =
|
|
4368
|
-
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), o.appendChild(e),
|
|
4593
|
+
let e = Gn(n(s));
|
|
4594
|
+
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), o.appendChild(e), Ce = e;
|
|
4369
4595
|
}
|
|
4370
|
-
e.appendChild(o),
|
|
4596
|
+
e.appendChild(o), Dn();
|
|
4371
4597
|
}
|
|
4372
|
-
function
|
|
4373
|
-
if (
|
|
4374
|
-
if (
|
|
4375
|
-
for (let [e, t] of
|
|
4376
|
-
|
|
4598
|
+
function Xn() {
|
|
4599
|
+
if (I.value) {
|
|
4600
|
+
if (De) for (let e of De.items) e.fill = Xt(e.id);
|
|
4601
|
+
for (let [e, t] of Se) t.value = Q(e);
|
|
4602
|
+
wn();
|
|
4377
4603
|
return;
|
|
4378
4604
|
}
|
|
4379
|
-
let e = !
|
|
4380
|
-
for (let [t, n] of
|
|
4381
|
-
let r =
|
|
4382
|
-
if (n.setAttribute("fill",
|
|
4605
|
+
let e = !N.value;
|
|
4606
|
+
for (let [t, n] of xe) {
|
|
4607
|
+
let r = Q(t), i = Se.get(t);
|
|
4608
|
+
if (n.setAttribute("fill", Xt(t)), i && (i.value = r), e && i) {
|
|
4383
4609
|
let e = n.firstElementChild;
|
|
4384
|
-
e && (e.textContent =
|
|
4610
|
+
e && (e.textContent = $t(i.name, r));
|
|
4385
4611
|
}
|
|
4386
4612
|
}
|
|
4387
4613
|
}
|
|
4388
|
-
function
|
|
4389
|
-
if (
|
|
4390
|
-
|
|
4614
|
+
function Zn() {
|
|
4615
|
+
if (I.value) {
|
|
4616
|
+
wn();
|
|
4391
4617
|
return;
|
|
4392
4618
|
}
|
|
4393
|
-
for (let e of
|
|
4394
|
-
|
|
4619
|
+
for (let e of xe.values()) e === F || we.has(e) || kn(e);
|
|
4620
|
+
Ce && Ce.setAttribute("stroke", p.strokeColor), Dn();
|
|
4395
4621
|
}
|
|
4396
|
-
function
|
|
4622
|
+
function Qn() {
|
|
4397
4623
|
return typeof p.menu == "string" ? p.menu : "choropleth";
|
|
4398
4624
|
}
|
|
4399
|
-
let
|
|
4625
|
+
let $n = n(() => p.legend && (Ut.value || Wt.value || p.data)), er = n(() => p.colorScale.slice().sort((e, t) => e.min - t.min)), tr = n(() => {
|
|
4400
4626
|
let e = [];
|
|
4401
4627
|
for (let t = 0; t <= 10; t++) {
|
|
4402
4628
|
let n = t / 10;
|
|
4403
4629
|
e.push({
|
|
4404
4630
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
4405
|
-
color:
|
|
4631
|
+
color: qt(n)
|
|
4406
4632
|
});
|
|
4407
4633
|
}
|
|
4408
4634
|
return e;
|
|
4409
|
-
}),
|
|
4635
|
+
}), nr = new Intl.NumberFormat("en-US", {
|
|
4410
4636
|
notation: "compact",
|
|
4411
4637
|
maximumFractionDigits: 1
|
|
4412
|
-
}),
|
|
4413
|
-
let { min: e, max: t } =
|
|
4638
|
+
}), rr = n(() => {
|
|
4639
|
+
let { min: e, max: t } = Ht.value, n = t - e, r = [];
|
|
4414
4640
|
for (let t = 1; t <= 3; t++) {
|
|
4415
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
4641
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? nr.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
4416
4642
|
r.push({
|
|
4417
4643
|
value: o,
|
|
4418
4644
|
pct: i * 100
|
|
4419
4645
|
});
|
|
4420
4646
|
}
|
|
4421
4647
|
return r;
|
|
4422
|
-
}),
|
|
4648
|
+
}), ir = n(() => {
|
|
4423
4649
|
let e = [];
|
|
4424
|
-
if (
|
|
4650
|
+
if (Ut.value) for (let t of p.colorScale) e.push({
|
|
4425
4651
|
key: t.value,
|
|
4426
4652
|
color: t.color,
|
|
4427
4653
|
label: t.value
|
|
4428
4654
|
});
|
|
4429
|
-
else if (
|
|
4655
|
+
else if (Wt.value) for (let t of er.value) e.push({
|
|
4430
4656
|
key: String(t.min),
|
|
4431
4657
|
color: t.color,
|
|
4432
4658
|
label: t.label ?? String(t.min)
|
|
4433
4659
|
});
|
|
4434
4660
|
return e;
|
|
4435
|
-
}),
|
|
4436
|
-
let e =
|
|
4437
|
-
return
|
|
4661
|
+
}), ar = n(() => `linear-gradient(to right, ${tr.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), $ = J({ target: () => p.fullscreenTarget }), or = n(() => {
|
|
4662
|
+
let e = Qn();
|
|
4663
|
+
return I.value ? [$.menuItem.value, {
|
|
4438
4664
|
label: "Save as PNG",
|
|
4439
4665
|
action: () => {
|
|
4440
|
-
|
|
4666
|
+
Ee.value && ze(Ee.value, e);
|
|
4441
4667
|
}
|
|
4442
4668
|
}] : [
|
|
4443
4669
|
$.menuItem.value,
|
|
4444
4670
|
{
|
|
4445
4671
|
label: "Save as SVG",
|
|
4446
4672
|
action: () => {
|
|
4447
|
-
D.value &&
|
|
4673
|
+
D.value && W(D.value, e);
|
|
4448
4674
|
}
|
|
4449
4675
|
},
|
|
4450
4676
|
{
|
|
4451
4677
|
label: "Save as PNG",
|
|
4452
4678
|
action: () => {
|
|
4453
|
-
D.value &&
|
|
4679
|
+
D.value && Re(D.value, e);
|
|
4454
4680
|
}
|
|
4455
4681
|
}
|
|
4456
4682
|
];
|
|
4457
4683
|
});
|
|
4458
4684
|
return C(() => [
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
], () =>
|
|
4463
|
-
|
|
4685
|
+
kt.value,
|
|
4686
|
+
Z.value,
|
|
4687
|
+
N.value
|
|
4688
|
+
], () => Yn()), C(() => [
|
|
4689
|
+
Vt.value,
|
|
4464
4690
|
p.colorScale,
|
|
4465
4691
|
p.noDataColor,
|
|
4466
4692
|
p.dataGeoType
|
|
4467
|
-
], () =>
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
], () =>
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4693
|
+
], () => Xn()), C(() => [p.strokeColor, Ft.value], () => Zn()), C(() => [
|
|
4694
|
+
zt.value,
|
|
4695
|
+
Z.value,
|
|
4696
|
+
Tt.value
|
|
4697
|
+
], () => it(), { flush: "post" }), C(() => [
|
|
4698
|
+
p.cities,
|
|
4699
|
+
X.value,
|
|
4700
|
+
Ve.value,
|
|
4701
|
+
p.citiesMinZoom,
|
|
4702
|
+
p.zoom,
|
|
4703
|
+
p.title,
|
|
4704
|
+
p.legend,
|
|
4705
|
+
p.legendTitle
|
|
4706
|
+
], () => Jn(), { flush: "post" }), C(() => $.isFullscreen.value, (e) => {
|
|
4707
|
+
if (on(), e || !G() || !D.value || !H) return;
|
|
4708
|
+
let t = M(D.value);
|
|
4709
|
+
t.interrupt(), H.transform(t, fe);
|
|
4475
4710
|
}), (n, l) => (_(), r(t, {
|
|
4476
4711
|
to: x($).teleportTarget.value,
|
|
4477
4712
|
disabled: !x($).isFullscreen.value
|
|
@@ -4480,16 +4715,16 @@ var Nr = {
|
|
|
4480
4715
|
ref: oe
|
|
4481
4716
|
}, n.$attrs, {
|
|
4482
4717
|
class: ["choropleth-wrapper", {
|
|
4483
|
-
pannable:
|
|
4718
|
+
pannable: lt.value,
|
|
4484
4719
|
"is-fullscreen": x($).isFullscreen.value
|
|
4485
4720
|
}],
|
|
4486
4721
|
style: x($).fullscreenStyle.value,
|
|
4487
4722
|
role: ie.value || void 0,
|
|
4488
4723
|
"aria-label": ne.value || void 0
|
|
4489
4724
|
}), [
|
|
4490
|
-
c.menu || x($).isFullscreen.value ? (_(), r(
|
|
4725
|
+
c.menu || x($).isFullscreen.value ? (_(), r(ye, {
|
|
4491
4726
|
key: 0,
|
|
4492
|
-
items:
|
|
4727
|
+
items: or.value,
|
|
4493
4728
|
"is-fullscreen": x($).isFullscreen.value,
|
|
4494
4729
|
onClose: x($).exit
|
|
4495
4730
|
}, null, 8, [
|
|
@@ -4497,42 +4732,42 @@ var Nr = {
|
|
|
4497
4732
|
"is-fullscreen",
|
|
4498
4733
|
"onClose"
|
|
4499
4734
|
])) : i("", !0),
|
|
4500
|
-
o("div",
|
|
4501
|
-
c.title ||
|
|
4735
|
+
o("div", Kr, b(x($).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
|
|
4736
|
+
c.title || $n.value ? (_(), a("div", qr, [c.title ? (_(), a("div", {
|
|
4502
4737
|
key: 0,
|
|
4503
4738
|
class: "choropleth-title",
|
|
4504
|
-
style: h(
|
|
4505
|
-
}, b(c.title), 5)) : i("", !0),
|
|
4739
|
+
style: h(be.value)
|
|
4740
|
+
}, b(c.title), 5)) : i("", !0), $n.value ? (_(), a("div", {
|
|
4506
4741
|
key: 1,
|
|
4507
4742
|
class: "choropleth-legend",
|
|
4508
|
-
style: h(
|
|
4509
|
-
}, [c.legendTitle ? (_(), a("span",
|
|
4743
|
+
style: h(P.value)
|
|
4744
|
+
}, [c.legendTitle ? (_(), a("span", Jr, b(c.legendTitle), 1)) : i("", !0), Ut.value || Wt.value ? (_(!0), a(e, { key: 1 }, y(ir.value, (e) => (_(), a("span", {
|
|
4510
4745
|
key: e.key,
|
|
4511
4746
|
class: "choropleth-legend-item"
|
|
4512
4747
|
}, [o("span", {
|
|
4513
4748
|
class: "choropleth-legend-swatch",
|
|
4514
4749
|
style: h({ background: e.color })
|
|
4515
|
-
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div",
|
|
4750
|
+
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", Yr, [o("div", {
|
|
4516
4751
|
class: "choropleth-legend-gradient",
|
|
4517
|
-
style: h({ background:
|
|
4518
|
-
}, null, 4), o("div",
|
|
4752
|
+
style: h({ background: ar.value })
|
|
4753
|
+
}, null, 4), o("div", Xr, [(_(!0), a(e, null, y(rr.value, (e) => (_(), a("span", {
|
|
4519
4754
|
key: e.value,
|
|
4520
4755
|
style: h({ left: e.pct + "%" })
|
|
4521
4756
|
}, b(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
|
|
4522
|
-
|
|
4523
|
-
|
|
4757
|
+
ut.value ? (_(), a("div", Zr, b(dt.value), 1)) : i("", !0),
|
|
4758
|
+
I.value ? (_(), a("canvas", {
|
|
4524
4759
|
key: 3,
|
|
4525
4760
|
ref_key: "canvasRef",
|
|
4526
|
-
ref:
|
|
4761
|
+
ref: Ee,
|
|
4527
4762
|
class: "choropleth-canvas",
|
|
4528
4763
|
"aria-hidden": "true"
|
|
4529
4764
|
}, null, 512)) : i("", !0),
|
|
4530
4765
|
(_(), a("svg", {
|
|
4531
4766
|
ref_key: "svgRef",
|
|
4532
4767
|
ref: D,
|
|
4533
|
-
viewBox: `0 0 ${
|
|
4768
|
+
viewBox: `0 0 ${bt.value} ${xt.value}`,
|
|
4534
4769
|
preserveAspectRatio: "xMidYMid meet",
|
|
4535
|
-
style: h(
|
|
4770
|
+
style: h(ft.value)
|
|
4536
4771
|
}, [o("g", {
|
|
4537
4772
|
ref_key: "mapGroupRef",
|
|
4538
4773
|
ref: O
|
|
@@ -4542,37 +4777,50 @@ var Nr = {
|
|
|
4542
4777
|
}, null, 512), o("g", {
|
|
4543
4778
|
ref_key: "overlayGroupRef",
|
|
4544
4779
|
ref: se
|
|
4545
|
-
}, null, 512)], 512)], 12,
|
|
4546
|
-
|
|
4780
|
+
}, null, 512)], 512)], 12, Qr)),
|
|
4781
|
+
c.cities && c.cities.length ? (_(), a("svg", {
|
|
4547
4782
|
key: 4,
|
|
4548
|
-
"
|
|
4549
|
-
|
|
4550
|
-
"
|
|
4783
|
+
ref_key: "cityOverlayRef",
|
|
4784
|
+
ref: le,
|
|
4785
|
+
class: "choropleth-city-overlay",
|
|
4786
|
+
viewBox: `0 0 ${bt.value} ${xt.value}`,
|
|
4787
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
4788
|
+
"aria-hidden": "true"
|
|
4789
|
+
}, [o("g", {
|
|
4790
|
+
ref_key: "cityLayerRef",
|
|
4791
|
+
ref: ce,
|
|
4792
|
+
class: "choropleth-cities"
|
|
4793
|
+
}, null, 512)], 8, $r)) : i("", !0),
|
|
4794
|
+
ct.value ? (_(), r(x(Ze), {
|
|
4795
|
+
key: 5,
|
|
4796
|
+
"can-zoom-in": Be.value < st.value,
|
|
4797
|
+
"can-zoom-out": Be.value > 1,
|
|
4798
|
+
"can-reset": U.value,
|
|
4551
4799
|
"is-fullscreen": x($).isFullscreen.value,
|
|
4552
|
-
onZoomIn: l[0] ||= (e) =>
|
|
4553
|
-
onZoomOut: l[1] ||= (e) =>
|
|
4554
|
-
onReset:
|
|
4800
|
+
onZoomIn: l[0] ||= (e) => pt(si),
|
|
4801
|
+
onZoomOut: l[1] ||= (e) => pt(1 / si),
|
|
4802
|
+
onReset: ot
|
|
4555
4803
|
}, null, 8, [
|
|
4556
4804
|
"can-zoom-in",
|
|
4557
4805
|
"can-zoom-out",
|
|
4558
4806
|
"can-reset",
|
|
4559
4807
|
"is-fullscreen"
|
|
4560
4808
|
])) : i("", !0),
|
|
4561
|
-
|
|
4562
|
-
key:
|
|
4809
|
+
N.value ? (_(), r(Fr, {
|
|
4810
|
+
key: 6,
|
|
4563
4811
|
ref_key: "tooltipChildRef",
|
|
4564
|
-
ref:
|
|
4565
|
-
mode:
|
|
4812
|
+
ref: _e,
|
|
4813
|
+
mode: nn.value
|
|
4566
4814
|
}, {
|
|
4567
4815
|
default: w((t) => [te(n.$slots, "tooltip", m(u(E(t))), () => [c.tooltipFormat ? (_(), a("span", {
|
|
4568
4816
|
key: 0,
|
|
4569
4817
|
innerHTML: c.tooltipFormat(t)
|
|
4570
|
-
}, null, 8,
|
|
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(Qt(t.value)), 1)], 64))], !0)]),
|
|
4571
4819
|
_: 3
|
|
4572
4820
|
}, 8, ["mode"])) : i("", !0)
|
|
4573
|
-
], 16,
|
|
4821
|
+
], 16, Gr)], 8, ["to", "disabled"]));
|
|
4574
4822
|
}
|
|
4575
|
-
}), [["__scopeId", "data-v-
|
|
4823
|
+
}), [["__scopeId", "data-v-f41b59e8"]]), bi = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
4576
4824
|
__name: "ChartTooltip",
|
|
4577
4825
|
props: {
|
|
4578
4826
|
x: {},
|
|
@@ -4592,7 +4840,7 @@ var Nr = {
|
|
|
4592
4840
|
top: `${e.y}px`,
|
|
4593
4841
|
transform: "translateY(-50%)"
|
|
4594
4842
|
})
|
|
4595
|
-
}, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(x(
|
|
4843
|
+
}, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(x(le), {
|
|
4596
4844
|
key: 1,
|
|
4597
4845
|
open: e.open
|
|
4598
4846
|
}, {
|
|
@@ -4605,7 +4853,7 @@ var Nr = {
|
|
|
4605
4853
|
})
|
|
4606
4854
|
}, null, 4)]),
|
|
4607
4855
|
_: 1
|
|
4608
|
-
}), c(x(
|
|
4856
|
+
}), c(x(ce), null, {
|
|
4609
4857
|
default: w(() => [e.open ? (_(), r(x(se), {
|
|
4610
4858
|
key: 0,
|
|
4611
4859
|
class: "chart-tooltip-content",
|
|
@@ -4623,7 +4871,7 @@ var Nr = {
|
|
|
4623
4871
|
_: 3
|
|
4624
4872
|
}, 8, ["open"])) : i("", !0);
|
|
4625
4873
|
}
|
|
4626
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
4874
|
+
}), [["__scopeId", "data-v-44377f70"]]), xi = { class: "TableWrapper" }, Si = ["href", "download"], Ci = /* @__PURE__ */ N(/* @__PURE__ */ l({
|
|
4627
4875
|
__name: "DataTable",
|
|
4628
4876
|
props: {
|
|
4629
4877
|
data: {},
|
|
@@ -4717,15 +4965,15 @@ var Nr = {
|
|
|
4717
4965
|
function x() {
|
|
4718
4966
|
if (typeof c.csv == "function") return c.csv();
|
|
4719
4967
|
if (typeof c.csv == "string") return c.csv;
|
|
4720
|
-
let e = v.value, t = te.value, n = [e.map((e) =>
|
|
4968
|
+
let e = v.value, t = te.value, n = [e.map((e) => et(l(e.name))).join(",")];
|
|
4721
4969
|
for (let r = 0; r < t; r++) {
|
|
4722
|
-
let t = e.map((e) =>
|
|
4970
|
+
let t = e.map((e) => et(ne(e, r)));
|
|
4723
4971
|
n.push(t.join(","));
|
|
4724
4972
|
}
|
|
4725
4973
|
return n.join("\n");
|
|
4726
4974
|
}
|
|
4727
4975
|
function S() {
|
|
4728
|
-
|
|
4976
|
+
Be(x(), re());
|
|
4729
4977
|
}
|
|
4730
4978
|
let ie = n(() => c.downloadButton || c.downloadLink ? [] : [{
|
|
4731
4979
|
label: c.downloadMenuLink,
|
|
@@ -4739,12 +4987,12 @@ var Nr = {
|
|
|
4739
4987
|
"full-width": t.fullWidth,
|
|
4740
4988
|
"has-menu": T.value
|
|
4741
4989
|
}]) }, [
|
|
4742
|
-
T.value ? (_(), r(
|
|
4990
|
+
T.value ? (_(), r(ye, {
|
|
4743
4991
|
key: 0,
|
|
4744
4992
|
items: ie.value,
|
|
4745
4993
|
"force-dropdown": ""
|
|
4746
4994
|
}, null, 8, ["items"])) : i("", !0),
|
|
4747
|
-
o("div",
|
|
4995
|
+
o("div", xi, [o("table", { class: p(["Table", { "full-width": t.fullWidth }]) }, [
|
|
4748
4996
|
o("colgroup", null, [(_(!0), a(e, null, y(v.value, (e) => (_(), a("col", {
|
|
4749
4997
|
key: e.name,
|
|
4750
4998
|
style: h(u(e.name))
|
|
@@ -4770,9 +5018,9 @@ var Nr = {
|
|
|
4770
5018
|
class: "data-table-download-link",
|
|
4771
5019
|
href: w.value,
|
|
4772
5020
|
download: `${re()}.csv`
|
|
4773
|
-
}, b(C.value), 9,
|
|
5021
|
+
}, b(C.value), 9, Si)) : i("", !0)
|
|
4774
5022
|
], 2));
|
|
4775
5023
|
}
|
|
4776
5024
|
}), [["__scopeId", "data-v-9b1b6a76"]]);
|
|
4777
5025
|
//#endregion
|
|
4778
|
-
export {
|
|
5026
|
+
export { br as BarChart, bi as ChartTooltip, yi as ChoroplethMap, Ci as DataTable, Vn as LineChart };
|