@cfasim-ui/charts 0.4.7 → 0.4.9
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/BarChart/BarChart.d.ts +17 -2
- package/dist/ChoroplethMap/ChoroplethMap.d.ts +6 -4
- package/dist/DataTable/DataTable.d.ts +12 -1
- package/dist/LineChart/LineChart.d.ts +21 -4
- package/dist/_shared/chartProps.d.ts +6 -4
- package/dist/_shared/index.d.ts +1 -0
- package/dist/_shared/scale.d.ts +39 -0
- package/dist/_shared/scale.test.d.ts +1 -0
- package/dist/_shared/useChartFoundation.d.ts +2 -1
- package/dist/index.css +1 -1
- package/dist/index.js +624 -568
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as ee, toDisplayString as b, toHandlers as te, toRaw as x, unref as S, useSlots as C, useTemplateRef as w, watch as T, withCtx as E } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { formatNumber as ne } from "@cfasim-ui/shared";
|
|
3
|
+
import { DropdownMenuContent as D, DropdownMenuItem as O, DropdownMenuPortal as k, DropdownMenuRoot as A, DropdownMenuTrigger as j, PopoverAnchor as M, PopoverContent as N, PopoverPortal as P, PopoverRoot as re } from "reka-ui";
|
|
4
|
+
import { geoAlbersUsa as ie, geoPath as F } from "d3-geo";
|
|
5
|
+
import { zoom as ae, zoomIdentity as oe } from "d3-zoom";
|
|
6
|
+
import { select as I } from "d3-selection";
|
|
6
7
|
import "d3-transition";
|
|
7
|
-
import { feature as
|
|
8
|
+
import { feature as se, merge as ce, mesh as le } from "topojson-client";
|
|
8
9
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
9
10
|
var L = { class: "chart-menu-trigger-area" }, R = ["aria-label"], z = /* @__PURE__ */ l({
|
|
10
11
|
__name: "ChartMenu",
|
|
@@ -89,17 +90,17 @@ var L = { class: "chart-menu-trigger-area" }, R = ["aria-label"], z = /* @__PURE
|
|
|
89
90
|
let n = e.__vccOpts || e;
|
|
90
91
|
for (let [e, r] of t) n[e] = r;
|
|
91
92
|
return n;
|
|
92
|
-
},
|
|
93
|
+
}, ue = /* @__PURE__ */ B(z, [["__scopeId", "data-v-b3c563e8"]]);
|
|
93
94
|
//#endregion
|
|
94
95
|
//#region src/_shared/axes.ts
|
|
95
96
|
function V(e) {
|
|
96
97
|
return Math.round(e) + .5;
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
+
function de(e, t) {
|
|
99
100
|
let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
|
|
100
101
|
return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
|
|
101
102
|
}
|
|
102
|
-
function
|
|
103
|
+
function H(e, t, n) {
|
|
103
104
|
if (!(n > 0) || !isFinite(n)) return [];
|
|
104
105
|
let r = [], i = Math.ceil(e / n) * n;
|
|
105
106
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
@@ -116,9 +117,39 @@ function G(e) {
|
|
|
116
117
|
if (t === n) return [];
|
|
117
118
|
let i = e.displayOffset ?? 0;
|
|
118
119
|
if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
|
|
119
|
-
if (typeof r == "number") return
|
|
120
|
-
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o =
|
|
121
|
-
return
|
|
120
|
+
if (typeof r == "number") return H(t + i, n + i, r).map((e) => e - i);
|
|
121
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = de(n - t, a);
|
|
122
|
+
return H(t + i, n + i, o).map((e) => e - i);
|
|
123
|
+
}
|
|
124
|
+
function fe(e, t, n, r) {
|
|
125
|
+
if (r === "log") {
|
|
126
|
+
let r = Math.log10(t), i = Math.log10(n) - r || 1;
|
|
127
|
+
return (Math.log10(e > 0 ? e : t) - r) / i;
|
|
128
|
+
}
|
|
129
|
+
let i = n - t || 1;
|
|
130
|
+
return (e - t) / i;
|
|
131
|
+
}
|
|
132
|
+
function pe(e, t, n, r) {
|
|
133
|
+
if (n !== "log") return {
|
|
134
|
+
min: e,
|
|
135
|
+
max: t
|
|
136
|
+
};
|
|
137
|
+
let i = e > 0 ? e : r > 0 && isFinite(r) ? r : 1;
|
|
138
|
+
return {
|
|
139
|
+
min: i,
|
|
140
|
+
max: t > 0 ? Math.max(t, i) : i
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function me(e) {
|
|
144
|
+
let { min: t, max: n, ticks: r } = e;
|
|
145
|
+
if (!(t > 0) || !(n > 0) || t === n) return [];
|
|
146
|
+
if (Array.isArray(r)) return r.filter((e) => e > 0 && e >= t && e <= n);
|
|
147
|
+
let i = Math.floor(Math.log10(t)), a = Math.ceil(Math.log10(n)), o = [];
|
|
148
|
+
for (let e = i; e <= a; e++) {
|
|
149
|
+
let r = 10 ** e;
|
|
150
|
+
r >= t && r <= n && o.push(r);
|
|
151
|
+
}
|
|
152
|
+
return o;
|
|
122
153
|
}
|
|
123
154
|
//#endregion
|
|
124
155
|
//#region src/_shared/useChartSize.ts
|
|
@@ -140,7 +171,7 @@ function K(e = {}) {
|
|
|
140
171
|
measuredWidth: n
|
|
141
172
|
};
|
|
142
173
|
}
|
|
143
|
-
function
|
|
174
|
+
function he(e) {
|
|
144
175
|
return e == null ? {
|
|
145
176
|
top: 0,
|
|
146
177
|
right: 0,
|
|
@@ -160,7 +191,7 @@ function de(e) {
|
|
|
160
191
|
}
|
|
161
192
|
function q(e) {
|
|
162
193
|
let t = n(() => {
|
|
163
|
-
let t =
|
|
194
|
+
let t = he(e.extraPadding?.());
|
|
164
195
|
return {
|
|
165
196
|
top: (e.title() ? 26 : 10) + (e.hasInlineLegend() ? 20 : 0) + t.top,
|
|
166
197
|
right: 10 + t.right,
|
|
@@ -188,8 +219,8 @@ function q(e) {
|
|
|
188
219
|
}
|
|
189
220
|
//#endregion
|
|
190
221
|
//#region src/tooltip-position.ts
|
|
191
|
-
var J = 16,
|
|
192
|
-
function
|
|
222
|
+
var J = 16, ge = 8;
|
|
223
|
+
function _e(e, t, n, r, i, a) {
|
|
193
224
|
if (i === "none") return {
|
|
194
225
|
left: e + J,
|
|
195
226
|
top: t
|
|
@@ -204,15 +235,15 @@ function pe(e, t, n, r, i, a) {
|
|
|
204
235
|
right: window.innerWidth,
|
|
205
236
|
top: 0,
|
|
206
237
|
bottom: window.innerHeight
|
|
207
|
-
}, s = e + J + n > o.right -
|
|
238
|
+
}, s = e + J + n > o.right - ge ? e - J - n : e + J, c = r / 2;
|
|
208
239
|
return {
|
|
209
240
|
left: s,
|
|
210
|
-
top: Math.min(Math.max(t, o.top +
|
|
241
|
+
top: Math.min(Math.max(t, o.top + ge + c), o.bottom - ge - c)
|
|
211
242
|
};
|
|
212
243
|
}
|
|
213
244
|
//#endregion
|
|
214
245
|
//#region src/_shared/useChartTooltip.ts
|
|
215
|
-
function
|
|
246
|
+
function ve(e) {
|
|
216
247
|
let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null);
|
|
217
248
|
function s(e) {
|
|
218
249
|
return "touches" in e ? e.touches[0] ?? null : e;
|
|
@@ -233,7 +264,7 @@ function Y(e) {
|
|
|
233
264
|
}
|
|
234
265
|
let s = i.value, c = e.containerRef.value;
|
|
235
266
|
if (!s || !c) return;
|
|
236
|
-
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } =
|
|
267
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = _e(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
|
|
237
268
|
o.value = {
|
|
238
269
|
left: f - l.left,
|
|
239
270
|
top: p - l.top
|
|
@@ -279,59 +310,59 @@ function Y(e) {
|
|
|
279
310
|
}
|
|
280
311
|
//#endregion
|
|
281
312
|
//#region src/ChartMenu/download.ts
|
|
282
|
-
function
|
|
313
|
+
function Y(e, t) {
|
|
283
314
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
284
315
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
285
316
|
}
|
|
286
|
-
var
|
|
317
|
+
var ye = [
|
|
287
318
|
"color",
|
|
288
319
|
"font-family",
|
|
289
320
|
"font-size",
|
|
290
321
|
"font-weight"
|
|
291
|
-
],
|
|
292
|
-
function
|
|
322
|
+
], X = ["fill", "stroke"];
|
|
323
|
+
function Z(e) {
|
|
293
324
|
let t = e.match(/^\s*var\(\s*(--[\w-]+)\s*(?:,\s*([^)]*?)\s*)?\)\s*$/);
|
|
294
325
|
if (!t) return e;
|
|
295
326
|
let [, n, r] = t;
|
|
296
327
|
return window.getComputedStyle(document.documentElement).getPropertyValue(n).trim() || (r ? r.trim() : e);
|
|
297
328
|
}
|
|
298
|
-
function
|
|
329
|
+
function be(e) {
|
|
299
330
|
let t = e.cloneNode(!0);
|
|
300
331
|
t.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
301
332
|
let n = window.getComputedStyle(e), r = [];
|
|
302
|
-
for (let e of
|
|
333
|
+
for (let e of ye) {
|
|
303
334
|
let t = n.getPropertyValue(e);
|
|
304
335
|
t && r.push(`${e}: ${t}`);
|
|
305
336
|
}
|
|
306
337
|
let i = t.getAttribute("style") ?? "";
|
|
307
338
|
t.setAttribute("style", [i, ...r].filter(Boolean).join("; "));
|
|
308
|
-
for (let e of t.querySelectorAll("*")) for (let t of
|
|
339
|
+
for (let e of t.querySelectorAll("*")) for (let t of X) {
|
|
309
340
|
let n = e.getAttribute(t);
|
|
310
|
-
!n || !n.includes("var(") || e.setAttribute(t,
|
|
341
|
+
!n || !n.includes("var(") || e.setAttribute(t, Z(n));
|
|
311
342
|
}
|
|
312
343
|
return t;
|
|
313
344
|
}
|
|
314
|
-
function
|
|
315
|
-
let n =
|
|
316
|
-
|
|
345
|
+
function xe(e, t) {
|
|
346
|
+
let n = be(e), r = new XMLSerializer().serializeToString(n);
|
|
347
|
+
Y(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
317
348
|
}
|
|
318
|
-
function
|
|
319
|
-
let n =
|
|
349
|
+
function Se(e, t) {
|
|
350
|
+
let n = be(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;
|
|
320
351
|
o.onload = () => {
|
|
321
352
|
let e = document.createElement("canvas");
|
|
322
353
|
e.width = s * 2, e.height = c * 2;
|
|
323
354
|
let n = e.getContext("2d");
|
|
324
355
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
325
|
-
e &&
|
|
356
|
+
e && Y(e, `${t}.png`);
|
|
326
357
|
}), URL.revokeObjectURL(a);
|
|
327
358
|
}, o.src = a;
|
|
328
359
|
}
|
|
329
|
-
function
|
|
330
|
-
|
|
360
|
+
function Q(e, t) {
|
|
361
|
+
Y(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
331
362
|
}
|
|
332
363
|
//#endregion
|
|
333
364
|
//#region src/_shared/useChartMenu.ts
|
|
334
|
-
function
|
|
365
|
+
function Ce(e) {
|
|
335
366
|
let t = v(null);
|
|
336
367
|
function r() {
|
|
337
368
|
let t = e.filename();
|
|
@@ -345,17 +376,17 @@ function $(e) {
|
|
|
345
376
|
let n = r(), i = [{
|
|
346
377
|
label: "Save as SVG",
|
|
347
378
|
action: () => {
|
|
348
|
-
t.value &&
|
|
379
|
+
t.value && xe(t.value, n);
|
|
349
380
|
}
|
|
350
381
|
}, {
|
|
351
382
|
label: "Save as PNG",
|
|
352
383
|
action: () => {
|
|
353
|
-
t.value &&
|
|
384
|
+
t.value && Se(t.value, n);
|
|
354
385
|
}
|
|
355
386
|
}];
|
|
356
387
|
return e.downloadLink() || i.push({
|
|
357
388
|
label: "Download CSV",
|
|
358
|
-
action: () =>
|
|
389
|
+
action: () => Q(e.getCsv(), n)
|
|
359
390
|
}), i;
|
|
360
391
|
}),
|
|
361
392
|
downloadLinkText: n(() => {
|
|
@@ -368,7 +399,7 @@ function $(e) {
|
|
|
368
399
|
}
|
|
369
400
|
//#endregion
|
|
370
401
|
//#region src/_shared/seriesCsv.ts
|
|
371
|
-
function
|
|
402
|
+
function we(e) {
|
|
372
403
|
if (e.length === 0) return "";
|
|
373
404
|
let t = 0;
|
|
374
405
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -380,25 +411,25 @@ function ye(e) {
|
|
|
380
411
|
}
|
|
381
412
|
return i.join("\n");
|
|
382
413
|
}
|
|
383
|
-
function
|
|
414
|
+
function Te(e, t, n = "category") {
|
|
384
415
|
if (t.length === 0 || e.length === 0) return "";
|
|
385
416
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
386
417
|
for (let n = 0; n < e.length; n++) {
|
|
387
|
-
let i = [
|
|
418
|
+
let i = [Ee(e[n])];
|
|
388
419
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
389
420
|
r.push(i.join(","));
|
|
390
421
|
}
|
|
391
422
|
return r.join("\n");
|
|
392
423
|
}
|
|
393
|
-
function
|
|
424
|
+
function Ee(e) {
|
|
394
425
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
395
426
|
}
|
|
396
427
|
//#endregion
|
|
397
428
|
//#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
|
|
398
|
-
var
|
|
429
|
+
var De = {
|
|
399
430
|
class: "chart-annotations",
|
|
400
431
|
"pointer-events": "none"
|
|
401
|
-
},
|
|
432
|
+
}, Oe = [
|
|
402
433
|
"x1",
|
|
403
434
|
"y1",
|
|
404
435
|
"x2",
|
|
@@ -406,12 +437,12 @@ var Se = {
|
|
|
406
437
|
"stroke",
|
|
407
438
|
"stroke-width",
|
|
408
439
|
"stroke-dasharray"
|
|
409
|
-
],
|
|
440
|
+
], ke = [
|
|
410
441
|
"d",
|
|
411
442
|
"stroke",
|
|
412
443
|
"stroke-width",
|
|
413
444
|
"stroke-dasharray"
|
|
414
|
-
],
|
|
445
|
+
], Ae = ["fill", "transform"], je = [
|
|
415
446
|
"x",
|
|
416
447
|
"y",
|
|
417
448
|
"text-anchor",
|
|
@@ -420,7 +451,7 @@ var Se = {
|
|
|
420
451
|
"fill",
|
|
421
452
|
"stroke",
|
|
422
453
|
"stroke-width"
|
|
423
|
-
],
|
|
454
|
+
], Me = ["x", "dy"], Ne = ["font-weight", "font-style"], Pe = 13, Fe = "normal", Ie = 700, Le = "var(--color-bg-0, #fff)", Re = 3, ze = 1, $ = 4, Be = 6, Ve = 1.2, He = .35, Ue = /* @__PURE__ */ l({
|
|
424
455
|
__name: "ChartAnnotations",
|
|
425
456
|
props: {
|
|
426
457
|
annotations: { default: () => [] },
|
|
@@ -457,7 +488,7 @@ var Se = {
|
|
|
457
488
|
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
458
489
|
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
459
490
|
if (a && !r.bounds) continue;
|
|
460
|
-
let { x: o, y: l } = t.offset, f = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ??
|
|
491
|
+
let { x: o, y: l } = t.offset, f = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? Pe, g = t.fontWeight ?? Fe, _ = t.haloColor ?? Le, v = t.haloWidth ?? Re, y = t.lineColor ?? m, ee = t.lineWidth ?? ze, b = s(t.lineDash), te = t.textAnchor ?? (o > 0 ? "start" : o < 0 ? "end" : "middle"), x, S = "", C, w = !a && (t.arrow ?? !0);
|
|
461
492
|
if (a && r.bounds) x = u(i, n.x, n.y, r.bounds);
|
|
462
493
|
else {
|
|
463
494
|
let e = d(n.x, n.y, f, p, h, i);
|
|
@@ -468,7 +499,7 @@ var Se = {
|
|
|
468
499
|
textX: f,
|
|
469
500
|
textY: p,
|
|
470
501
|
textAnchor: te,
|
|
471
|
-
dy: h *
|
|
502
|
+
dy: h * Ve,
|
|
472
503
|
fontSize: h,
|
|
473
504
|
fontWeight: g,
|
|
474
505
|
color: m,
|
|
@@ -533,11 +564,11 @@ var Se = {
|
|
|
533
564
|
}
|
|
534
565
|
function d(e, t, n, r, i, a) {
|
|
535
566
|
if (a === "none") return { path: "" };
|
|
536
|
-
let o = n - e, s = r - t, c = r - i *
|
|
567
|
+
let o = n - e, s = r - t, c = r - i * He;
|
|
537
568
|
if (o === 0 || s === 0 || a === "straight") {
|
|
538
569
|
let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
|
|
539
|
-
if (l <=
|
|
540
|
-
let u = a / l, d = o / l, f = e + u *
|
|
570
|
+
if (l <= $ + Be) return { path: "" };
|
|
571
|
+
let u = a / l, d = o / l, f = e + u * $, p = t + d * $, m = n - u * Be, h = i - d * Be, g = Math.atan2(-d, -u) * 180 / Math.PI;
|
|
541
572
|
return {
|
|
542
573
|
path: `M${f},${p} L${m},${h}`,
|
|
543
574
|
arrow: {
|
|
@@ -548,8 +579,8 @@ var Se = {
|
|
|
548
579
|
};
|
|
549
580
|
}
|
|
550
581
|
let l = c - t;
|
|
551
|
-
if (Math.abs(l) <=
|
|
552
|
-
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d *
|
|
582
|
+
if (Math.abs(l) <= $ || Math.abs(o) <= Be) return { path: "" };
|
|
583
|
+
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d * $, m = n - u * Be, h = c, g = d > 0 ? -90 : 90;
|
|
553
584
|
return {
|
|
554
585
|
path: `M${f},${p} Q${f},${c} ${m},${h}`,
|
|
555
586
|
arrow: {
|
|
@@ -559,7 +590,7 @@ var Se = {
|
|
|
559
590
|
}
|
|
560
591
|
};
|
|
561
592
|
}
|
|
562
|
-
return (t, n) => (_(), a("g",
|
|
593
|
+
return (t, n) => (_(), a("g", De, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
563
594
|
t.rule ? (_(), a("line", {
|
|
564
595
|
key: 0,
|
|
565
596
|
x1: t.rule.x1,
|
|
@@ -570,7 +601,7 @@ var Se = {
|
|
|
570
601
|
"stroke-width": t.lineWidth,
|
|
571
602
|
"stroke-dasharray": t.lineDash,
|
|
572
603
|
"stroke-linecap": "round"
|
|
573
|
-
}, null, 8,
|
|
604
|
+
}, null, 8, Oe)) : i("", !0),
|
|
574
605
|
t.pointerPath ? (_(), a("path", {
|
|
575
606
|
key: 1,
|
|
576
607
|
d: t.pointerPath,
|
|
@@ -579,13 +610,13 @@ var Se = {
|
|
|
579
610
|
"stroke-width": t.lineWidth,
|
|
580
611
|
"stroke-dasharray": t.lineDash,
|
|
581
612
|
"stroke-linecap": "round"
|
|
582
|
-
}, null, 8,
|
|
613
|
+
}, null, 8, ke)) : i("", !0),
|
|
583
614
|
t.arrowTip ? (_(), a("polygon", {
|
|
584
615
|
key: 2,
|
|
585
616
|
points: "0,0 -6,-3 -6,3",
|
|
586
617
|
fill: t.lineColor,
|
|
587
618
|
transform: `translate(${t.arrowTip.x} ${t.arrowTip.y}) rotate(${t.arrowTip.angle})`
|
|
588
|
-
}, null, 8,
|
|
619
|
+
}, null, 8, Ae)) : i("", !0),
|
|
589
620
|
o("text", {
|
|
590
621
|
x: t.textX,
|
|
591
622
|
y: t.textY,
|
|
@@ -603,14 +634,14 @@ var Se = {
|
|
|
603
634
|
dy: r === 0 ? 0 : t.dy
|
|
604
635
|
}, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
|
|
605
636
|
key: t,
|
|
606
|
-
"font-weight": e.bold ?
|
|
637
|
+
"font-weight": e.bold ? Ie : void 0,
|
|
607
638
|
"font-style": e.italic ? "italic" : void 0
|
|
608
|
-
}, b(e.text), 9,
|
|
639
|
+
}, b(e.text), 9, Ne))), 128))], 8, Me))), 128))], 8, je)
|
|
609
640
|
], 64))), 128))]));
|
|
610
641
|
}
|
|
611
|
-
}),
|
|
612
|
-
function
|
|
613
|
-
let { containerRef: t, measuredWidth: r } = K({ debounce: e.debounce }), i = n(() => e.width() ?? (r.value ||
|
|
642
|
+
}), We = 400, Ge = 200;
|
|
643
|
+
function Ke(e) {
|
|
644
|
+
let { containerRef: t, measuredWidth: r } = K({ debounce: e.debounce }), i = n(() => e.width() ?? (r.value || We)), a = n(() => e.height() ?? Ge), { padding: o, legendY: s, innerW: c, innerH: l, bounds: u } = q({
|
|
614
645
|
title: e.title,
|
|
615
646
|
xLabel: e.xLabel,
|
|
616
647
|
yLabel: e.yLabel,
|
|
@@ -618,14 +649,14 @@ function He(e) {
|
|
|
618
649
|
width: () => i.value,
|
|
619
650
|
height: () => a.value,
|
|
620
651
|
extraPadding: e.chartPadding
|
|
621
|
-
}), { hoverIndex: d, tooltipRef: f, tooltipPos: p, handlers: m } =
|
|
652
|
+
}), { hoverIndex: d, tooltipRef: f, tooltipPos: p, handlers: m } = ve({
|
|
622
653
|
enabled: e.hasTooltipSlot,
|
|
623
654
|
trigger: e.tooltipTrigger,
|
|
624
655
|
clamp: () => e.tooltipClamp() ?? "chart",
|
|
625
656
|
pointerToIndex: e.pointerToIndex,
|
|
626
657
|
containerRef: t,
|
|
627
658
|
onHover: e.onHover
|
|
628
|
-
}), { svgRef: h, items: g, downloadLinkText: _, csvHref: v, resolvedFilename: y } =
|
|
659
|
+
}), { svgRef: h, items: g, downloadLinkText: _, csvHref: v, resolvedFilename: y } = Ce({
|
|
629
660
|
filename: e.filename,
|
|
630
661
|
legacyMenuLabel: e.menu,
|
|
631
662
|
getCsv: e.getCsv,
|
|
@@ -651,80 +682,80 @@ function He(e) {
|
|
|
651
682
|
menuFilename: y
|
|
652
683
|
};
|
|
653
684
|
}
|
|
654
|
-
function
|
|
685
|
+
function qe(e, t) {
|
|
655
686
|
return (n) => {
|
|
656
687
|
let r = e();
|
|
657
|
-
if (r) return
|
|
688
|
+
if (r !== void 0) return ne(n, r);
|
|
658
689
|
let i = t();
|
|
659
|
-
return i ?
|
|
690
|
+
return i === void 0 ? W(n) : ne(n, i);
|
|
660
691
|
};
|
|
661
692
|
}
|
|
662
693
|
//#endregion
|
|
663
694
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
664
|
-
var
|
|
695
|
+
var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
665
696
|
"x1",
|
|
666
697
|
"y1",
|
|
667
698
|
"x2",
|
|
668
699
|
"y2",
|
|
669
700
|
"stroke",
|
|
670
701
|
"stroke-dasharray"
|
|
671
|
-
],
|
|
702
|
+
], Qe = [
|
|
672
703
|
"cx",
|
|
673
704
|
"cy",
|
|
674
705
|
"fill",
|
|
675
706
|
"fill-opacity",
|
|
676
707
|
"stroke"
|
|
677
|
-
],
|
|
708
|
+
], $e = ["x", "y"], et = [
|
|
678
709
|
"x1",
|
|
679
710
|
"y1",
|
|
680
711
|
"x2",
|
|
681
712
|
"y2"
|
|
682
|
-
],
|
|
713
|
+
], tt = [
|
|
683
714
|
"x1",
|
|
684
715
|
"y1",
|
|
685
716
|
"x2",
|
|
686
717
|
"y2"
|
|
687
|
-
],
|
|
718
|
+
], nt = [
|
|
688
719
|
"x1",
|
|
689
720
|
"y1",
|
|
690
721
|
"x2",
|
|
691
722
|
"y2"
|
|
692
|
-
],
|
|
723
|
+
], rt = [
|
|
693
724
|
"x1",
|
|
694
725
|
"y1",
|
|
695
726
|
"x2",
|
|
696
727
|
"y2"
|
|
697
|
-
],
|
|
728
|
+
], it = ["x", "y"], at = ["transform"], ot = [
|
|
698
729
|
"x",
|
|
699
730
|
"y",
|
|
700
731
|
"text-anchor"
|
|
701
|
-
],
|
|
732
|
+
], st = ["x", "y"], ct = [
|
|
702
733
|
"d",
|
|
703
734
|
"fill",
|
|
704
735
|
"fill-opacity"
|
|
705
|
-
],
|
|
736
|
+
], lt = [
|
|
706
737
|
"d",
|
|
707
738
|
"stroke",
|
|
708
739
|
"stroke-width",
|
|
709
740
|
"stroke-opacity",
|
|
710
741
|
"stroke-dasharray"
|
|
711
|
-
],
|
|
742
|
+
], ut = [
|
|
712
743
|
"cx",
|
|
713
744
|
"cy",
|
|
714
745
|
"r",
|
|
715
746
|
"fill",
|
|
716
747
|
"fill-opacity",
|
|
717
748
|
"stroke"
|
|
718
|
-
],
|
|
749
|
+
], dt = [
|
|
719
750
|
"d",
|
|
720
751
|
"fill",
|
|
721
752
|
"fill-opacity"
|
|
722
|
-
],
|
|
753
|
+
], ft = [
|
|
723
754
|
"d",
|
|
724
755
|
"stroke",
|
|
725
756
|
"stroke-width",
|
|
726
757
|
"stroke-dasharray"
|
|
727
|
-
],
|
|
758
|
+
], pt = [
|
|
728
759
|
"x1",
|
|
729
760
|
"y1",
|
|
730
761
|
"x2",
|
|
@@ -732,7 +763,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
732
763
|
"stroke",
|
|
733
764
|
"stroke-width",
|
|
734
765
|
"stroke-dasharray"
|
|
735
|
-
],
|
|
766
|
+
], mt = [
|
|
736
767
|
"x1",
|
|
737
768
|
"y1",
|
|
738
769
|
"x2",
|
|
@@ -740,44 +771,44 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
740
771
|
"stroke",
|
|
741
772
|
"stroke-width",
|
|
742
773
|
"stroke-dasharray"
|
|
743
|
-
],
|
|
774
|
+
], ht = [
|
|
744
775
|
"x1",
|
|
745
776
|
"y1",
|
|
746
777
|
"x2",
|
|
747
778
|
"y2"
|
|
748
|
-
],
|
|
779
|
+
], gt = [
|
|
749
780
|
"x1",
|
|
750
781
|
"y1",
|
|
751
782
|
"x2",
|
|
752
783
|
"y2"
|
|
753
|
-
],
|
|
784
|
+
], _t = [
|
|
754
785
|
"x1",
|
|
755
786
|
"y1",
|
|
756
787
|
"x2",
|
|
757
788
|
"y2"
|
|
758
|
-
],
|
|
789
|
+
], vt = [
|
|
759
790
|
"cx",
|
|
760
791
|
"cy",
|
|
761
792
|
"fill"
|
|
762
|
-
],
|
|
793
|
+
], yt = [
|
|
763
794
|
"x",
|
|
764
795
|
"y",
|
|
765
796
|
"width",
|
|
766
797
|
"height"
|
|
767
|
-
],
|
|
798
|
+
], bt = [
|
|
768
799
|
"cx",
|
|
769
800
|
"cy",
|
|
770
801
|
"fill",
|
|
771
802
|
"fill-opacity",
|
|
772
803
|
"stroke"
|
|
773
|
-
],
|
|
804
|
+
], xt = [
|
|
774
805
|
"x",
|
|
775
806
|
"y",
|
|
776
807
|
"fill"
|
|
777
|
-
],
|
|
808
|
+
], St = ["x", "y"], Ct = { class: "line-chart-tooltip" }, wt = {
|
|
778
809
|
key: 0,
|
|
779
810
|
class: "line-chart-tooltip-label"
|
|
780
|
-
},
|
|
811
|
+
}, Tt = ["href", "download"], Et = 36, Dt = 12, Ot = 7, kt = 16, At = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
781
812
|
__name: "LineChart",
|
|
782
813
|
props: {
|
|
783
814
|
y: {},
|
|
@@ -788,6 +819,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
788
819
|
areaSections: {},
|
|
789
820
|
lineOpacity: { default: 1 },
|
|
790
821
|
yMin: {},
|
|
822
|
+
yScaleType: { default: "linear" },
|
|
791
823
|
xMin: {},
|
|
792
824
|
xTicks: {},
|
|
793
825
|
yTicks: {},
|
|
@@ -825,7 +857,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
825
857
|
data: e.y ?? e.data ?? g
|
|
826
858
|
};
|
|
827
859
|
}
|
|
828
|
-
let x =
|
|
860
|
+
let x = qe(() => l.tooltipValueFormat, () => l.yTickFormat), C = n(() => {
|
|
829
861
|
if (l.series && l.series.length > 0) return l.series.map(v);
|
|
830
862
|
let e = l.y ?? l.data;
|
|
831
863
|
return e ? [{
|
|
@@ -867,94 +899,103 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
867
899
|
});
|
|
868
900
|
function j(e) {
|
|
869
901
|
let { min: t, max: n } = A.value, r = n - t || 1;
|
|
870
|
-
return Y.value.left + (e - t) / r *
|
|
902
|
+
return Y.value.left + (e - t) / r * X.value;
|
|
871
903
|
}
|
|
872
904
|
let M = n(() => {
|
|
873
|
-
let e = Infinity, t = -Infinity
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
905
|
+
let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
|
|
906
|
+
isFinite(r) && (r < e && (e = r), r > t && (t = r), r > 0 && r < n && (n = r));
|
|
907
|
+
};
|
|
908
|
+
for (let e of C.value) for (let t of e.data) r(t);
|
|
909
|
+
for (let e of w.value) {
|
|
910
|
+
for (let t of e.upper) r(t);
|
|
911
|
+
for (let t of e.lower) r(t);
|
|
878
912
|
}
|
|
879
|
-
|
|
880
|
-
min: e,
|
|
881
|
-
max: t,
|
|
882
|
-
range: t - e || 1
|
|
883
|
-
}) : {
|
|
913
|
+
if (!isFinite(e)) return {
|
|
884
914
|
min: 0,
|
|
885
915
|
max: 0,
|
|
886
916
|
range: 1
|
|
887
917
|
};
|
|
918
|
+
l.yMin != null && l.yMin < e && (e = l.yMin);
|
|
919
|
+
let i = pe(e, t, l.yScaleType, n);
|
|
920
|
+
return {
|
|
921
|
+
min: i.min,
|
|
922
|
+
max: i.max,
|
|
923
|
+
range: i.max - i.min || 1
|
|
924
|
+
};
|
|
888
925
|
});
|
|
889
926
|
function N(e) {
|
|
927
|
+
let { min: t, max: n } = M.value;
|
|
928
|
+
return Y.value.top + Z.value - fe(e, t, n, l.yScaleType) * Z.value;
|
|
929
|
+
}
|
|
930
|
+
function P(e) {
|
|
890
931
|
let t = e.data;
|
|
891
932
|
if (t.length === 0) return "";
|
|
892
|
-
let
|
|
893
|
-
for (let
|
|
894
|
-
let
|
|
895
|
-
if (!isFinite(t[
|
|
896
|
-
|
|
933
|
+
let n = "", r = !1;
|
|
934
|
+
for (let i = 0; i < t.length; i++) {
|
|
935
|
+
let a = D(e, i);
|
|
936
|
+
if (!isFinite(t[i]) || !isFinite(a)) {
|
|
937
|
+
r = !1;
|
|
897
938
|
continue;
|
|
898
939
|
}
|
|
899
|
-
let
|
|
900
|
-
|
|
940
|
+
let o = j(a), s = N(t[i]);
|
|
941
|
+
n += r ? `L${o},${s}` : `M${o},${s}`, r = !0;
|
|
901
942
|
}
|
|
902
|
-
return
|
|
943
|
+
return n;
|
|
903
944
|
}
|
|
904
|
-
function
|
|
905
|
-
let t = e.data,
|
|
945
|
+
function re(e) {
|
|
946
|
+
let t = e.data, n = [];
|
|
906
947
|
for (let r = 0; r < t.length; r++) {
|
|
907
|
-
let
|
|
908
|
-
!isFinite(t[r]) || !isFinite(
|
|
909
|
-
x: j(
|
|
910
|
-
y:
|
|
948
|
+
let i = D(e, r);
|
|
949
|
+
!isFinite(t[r]) || !isFinite(i) || n.push({
|
|
950
|
+
x: j(i),
|
|
951
|
+
y: N(t[r])
|
|
911
952
|
});
|
|
912
953
|
}
|
|
913
|
-
return
|
|
954
|
+
return n;
|
|
914
955
|
}
|
|
915
|
-
function
|
|
956
|
+
function ie(e) {
|
|
916
957
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
917
958
|
if (t === 0) return "";
|
|
918
|
-
let
|
|
919
|
-
for (let
|
|
920
|
-
|
|
921
|
-
let
|
|
922
|
-
for (let t of
|
|
923
|
-
|
|
924
|
-
for (let n = 1; n < t.length; n++)
|
|
925
|
-
for (let n = t.length - 1; n >= 0; n--)
|
|
926
|
-
|
|
959
|
+
let n = [], r = [];
|
|
960
|
+
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(O(e, i)) ? r.push(i) : r.length && (n.push(r), r = []);
|
|
961
|
+
r.length && n.push(r);
|
|
962
|
+
let i = "";
|
|
963
|
+
for (let t of n) {
|
|
964
|
+
i += `M${j(O(e, t[0]))},${N(e.upper[t[0]])}`;
|
|
965
|
+
for (let n = 1; n < t.length; n++) i += `L${j(O(e, t[n]))},${N(e.upper[t[n]])}`;
|
|
966
|
+
for (let n = t.length - 1; n >= 0; n--) i += `L${j(O(e, t[n]))},${N(e.lower[t[n]])}`;
|
|
967
|
+
i += "Z";
|
|
927
968
|
}
|
|
928
|
-
return
|
|
969
|
+
return i;
|
|
929
970
|
}
|
|
930
971
|
function F(e, t) {
|
|
931
972
|
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && C.value[e.seriesIndex] || C.value[0];
|
|
932
973
|
return j(r ? D(r, n) : n);
|
|
933
974
|
}
|
|
934
|
-
function
|
|
935
|
-
let n = Y.value.top +
|
|
975
|
+
function ae(e, t = !0) {
|
|
976
|
+
let n = Y.value.top + Z.value;
|
|
936
977
|
if (e.seriesIndex == null) {
|
|
937
978
|
let t = F(e, "start"), r = F(e, "end");
|
|
938
979
|
return t > r ? "" : `M${t},${Y.value.top}L${r},${Y.value.top}L${r},${n}L${t},${n}Z`;
|
|
939
980
|
}
|
|
940
981
|
let r = C.value[e.seriesIndex];
|
|
941
982
|
if (!r) return "";
|
|
942
|
-
let
|
|
943
|
-
if (
|
|
944
|
-
let
|
|
945
|
-
for (let e =
|
|
946
|
-
return t && (
|
|
983
|
+
let i = Math.max(0, e.startIndex), a = Math.min(r.data.length - 1, e.endIndex);
|
|
984
|
+
if (i > a) return "";
|
|
985
|
+
let o = `M${j(D(r, i))},${N(r.data[i])}`;
|
|
986
|
+
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${j(D(r, e))},${N(r.data[e])}`);
|
|
987
|
+
return t && (o += `L${j(D(r, a))},${n}`, o += `L${j(D(r, i))},${n}`, o += "Z"), o;
|
|
947
988
|
}
|
|
948
|
-
let
|
|
989
|
+
let oe = n(() => {
|
|
949
990
|
let e = l.areaSections;
|
|
950
991
|
if (!e?.length) return {
|
|
951
992
|
labels: [],
|
|
952
993
|
extraHeight: 0
|
|
953
994
|
};
|
|
954
|
-
let t = [], n = Y.value.left +
|
|
995
|
+
let t = [], n = Y.value.left + X.value;
|
|
955
996
|
for (let r of e) {
|
|
956
997
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
957
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) *
|
|
998
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Ot, o = F(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : C.value[r.seriesIndex]?.color ?? "currentColor");
|
|
958
999
|
t.push({
|
|
959
1000
|
cx: c,
|
|
960
1001
|
labelText: e,
|
|
@@ -969,7 +1010,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
969
1010
|
let r = [];
|
|
970
1011
|
for (let e of t) {
|
|
971
1012
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
972
|
-
for (; n < r.length && !(t >= r[n] +
|
|
1013
|
+
for (; n < r.length && !(t >= r[n] + kt);) n++;
|
|
973
1014
|
e.row = n;
|
|
974
1015
|
let i = e.cx + e.textWidth / 2;
|
|
975
1016
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -979,9 +1020,9 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
979
1020
|
extraHeight: 0
|
|
980
1021
|
} : {
|
|
981
1022
|
labels: t,
|
|
982
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
1023
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Et + Dt
|
|
983
1024
|
};
|
|
984
|
-
}),
|
|
1025
|
+
}), I = n(() => {
|
|
985
1026
|
let e = [];
|
|
986
1027
|
for (let t of C.value) t.legend && e.push({
|
|
987
1028
|
label: t.legend,
|
|
@@ -1001,39 +1042,43 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1001
1042
|
});
|
|
1002
1043
|
}
|
|
1003
1044
|
return e;
|
|
1004
|
-
}),
|
|
1005
|
-
let { min: e, max: t } = M.value, n = (
|
|
1045
|
+
}), se = n(() => ve.value + oe.value.extraHeight), ce = n(() => Y.value.top + Z.value + Y.value.bottom + Dt), le = n(() => {
|
|
1046
|
+
let { min: e, max: t } = M.value, n = (e) => l.yTickFormat === void 0 ? W(e) : ne(e, l.yTickFormat);
|
|
1006
1047
|
return e === t ? [{
|
|
1007
|
-
value:
|
|
1008
|
-
y: V(Y.value.top +
|
|
1009
|
-
}] :
|
|
1048
|
+
value: n(e),
|
|
1049
|
+
y: V(Y.value.top + Z.value / 2)
|
|
1050
|
+
}] : (l.yScaleType === "log" ? me({
|
|
1051
|
+
min: e,
|
|
1052
|
+
max: t,
|
|
1053
|
+
ticks: l.yTicks
|
|
1054
|
+
}) : G({
|
|
1010
1055
|
min: e,
|
|
1011
1056
|
max: t,
|
|
1012
1057
|
ticks: l.yTicks,
|
|
1013
|
-
targetTickCount:
|
|
1014
|
-
}).map((e) => ({
|
|
1015
|
-
value:
|
|
1016
|
-
y:
|
|
1058
|
+
targetTickCount: Z.value / 50
|
|
1059
|
+
})).map((e) => ({
|
|
1060
|
+
value: n(e),
|
|
1061
|
+
y: V(N(e))
|
|
1017
1062
|
}));
|
|
1018
|
-
}),
|
|
1063
|
+
}), L = n(() => {
|
|
1019
1064
|
let { min: e, max: t } = A.value;
|
|
1020
1065
|
if (e === t) return [];
|
|
1021
1066
|
let n = k.value, r = T.value, i = (e, t) => {
|
|
1022
|
-
let r = e + n;
|
|
1023
|
-
return
|
|
1067
|
+
let r = e + n, i = l.xTickFormat;
|
|
1068
|
+
return i === void 0 ? !E.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : W(r) : typeof i == "function" ? i(r, t) : ne(r, i);
|
|
1024
1069
|
}, a;
|
|
1025
1070
|
if (l.xTicks == null && !E.value && l.xLabels && l.xLabels.length === r) {
|
|
1026
|
-
let e = Math.max(3, Math.floor(
|
|
1071
|
+
let e = Math.max(3, Math.floor(X.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
|
|
1027
1072
|
a = [];
|
|
1028
1073
|
for (let e = 0; e < r; e += t) a.push(e);
|
|
1029
1074
|
} else a = G({
|
|
1030
1075
|
min: e,
|
|
1031
1076
|
max: t,
|
|
1032
1077
|
ticks: l.xTicks,
|
|
1033
|
-
targetTickCount:
|
|
1078
|
+
targetTickCount: X.value / 80,
|
|
1034
1079
|
displayOffset: n
|
|
1035
1080
|
});
|
|
1036
|
-
let o = Y.value.left, s = Y.value.left +
|
|
1081
|
+
let o = Y.value.left, s = Y.value.left + X.value;
|
|
1037
1082
|
return a.map((e, t) => {
|
|
1038
1083
|
let n = V(j(e)), r = "middle";
|
|
1039
1084
|
return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
|
|
@@ -1043,13 +1088,13 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1043
1088
|
};
|
|
1044
1089
|
});
|
|
1045
1090
|
});
|
|
1046
|
-
function
|
|
1047
|
-
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv :
|
|
1091
|
+
function R() {
|
|
1092
|
+
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : we(C.value);
|
|
1048
1093
|
}
|
|
1049
|
-
let
|
|
1050
|
-
let e =
|
|
1094
|
+
let z = n(() => !!l.tooltipData || !!l.tooltipTrigger), B = n(() => {
|
|
1095
|
+
let e = xe.value, t = C.value[0];
|
|
1051
1096
|
return e === null || !t ? null : D(t, e);
|
|
1052
|
-
}),
|
|
1097
|
+
}), de = n(() => B.value === null ? 0 : j(B.value));
|
|
1053
1098
|
function H(e, t) {
|
|
1054
1099
|
let n = e.data.length;
|
|
1055
1100
|
if (n === 0) return null;
|
|
@@ -1062,26 +1107,26 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1062
1107
|
}
|
|
1063
1108
|
return i === Infinity ? null : r;
|
|
1064
1109
|
}
|
|
1065
|
-
let
|
|
1066
|
-
let e =
|
|
1110
|
+
let U = n(() => {
|
|
1111
|
+
let e = B.value;
|
|
1067
1112
|
if (e === null) return [];
|
|
1068
|
-
let
|
|
1113
|
+
let t = [];
|
|
1069
1114
|
for (let n of C.value) {
|
|
1070
|
-
let
|
|
1071
|
-
if (
|
|
1072
|
-
let
|
|
1073
|
-
isFinite(
|
|
1074
|
-
x: j(D(n,
|
|
1075
|
-
y: i
|
|
1115
|
+
let r = H(n, e);
|
|
1116
|
+
if (r === null) continue;
|
|
1117
|
+
let i = n.data[r];
|
|
1118
|
+
isFinite(i) && t.push({
|
|
1119
|
+
x: j(D(n, r)),
|
|
1120
|
+
y: N(i),
|
|
1076
1121
|
color: n.color ?? "currentColor"
|
|
1077
1122
|
});
|
|
1078
1123
|
}
|
|
1079
|
-
return
|
|
1080
|
-
}),
|
|
1081
|
-
let e =
|
|
1124
|
+
return t;
|
|
1125
|
+
}), K = n(() => {
|
|
1126
|
+
let e = xe.value, t = B.value;
|
|
1082
1127
|
if (e === null || t === null) return null;
|
|
1083
|
-
let n = t + k.value, r;
|
|
1084
|
-
return r =
|
|
1128
|
+
let n = t + k.value, r, i = l.xTickFormat;
|
|
1129
|
+
return r = i === void 0 ? E.value ? W(n) : l.xLabels?.[e] : typeof i == "function" ? i(n, e) : ne(n, i), {
|
|
1085
1130
|
index: e,
|
|
1086
1131
|
xLabel: r,
|
|
1087
1132
|
values: C.value.map((e, n) => {
|
|
@@ -1095,23 +1140,21 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1095
1140
|
data: l.tooltipData?.[e] ?? null
|
|
1096
1141
|
};
|
|
1097
1142
|
});
|
|
1098
|
-
function
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
x: j(n),
|
|
1103
|
-
y: a
|
|
1143
|
+
function he(e, t) {
|
|
1144
|
+
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1145
|
+
x: j(e - k.value),
|
|
1146
|
+
y: N(t)
|
|
1104
1147
|
};
|
|
1105
1148
|
}
|
|
1106
|
-
function
|
|
1107
|
-
let t =
|
|
1149
|
+
function q(e) {
|
|
1150
|
+
let t = J.value?.getBoundingClientRect();
|
|
1108
1151
|
if (!t) return null;
|
|
1109
1152
|
let n = C.value[0];
|
|
1110
1153
|
if (!n || n.data.length === 0) return null;
|
|
1111
1154
|
let { min: r, max: i } = A.value, a = i - r || 1;
|
|
1112
|
-
return H(n, r + (e - t.left - Y.value.left) /
|
|
1155
|
+
return H(n, r + (e - t.left - Y.value.left) / X.value * a);
|
|
1113
1156
|
}
|
|
1114
|
-
let { containerRef:
|
|
1157
|
+
let { containerRef: J, svgRef: ge, width: _e, height: ve, padding: Y, legendY: ye, innerW: X, innerH: Z, bounds: be, hoverIndex: xe, tooltipRef: Se, tooltipPos: Q, tooltipHandlers: Ce, menuItems: Te, downloadLinkText: Ee, csvHref: De, menuFilename: Oe } = Ke({
|
|
1115
1158
|
width: () => l.width,
|
|
1116
1159
|
height: () => l.height,
|
|
1117
1160
|
title: () => l.title,
|
|
@@ -1125,94 +1168,94 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1125
1168
|
downloadLink: () => l.downloadLink,
|
|
1126
1169
|
chartPadding: () => l.chartPadding,
|
|
1127
1170
|
hasInlineLegend: () => h.value,
|
|
1128
|
-
hasTooltipSlot: () =>
|
|
1129
|
-
getCsv:
|
|
1130
|
-
pointerToIndex:
|
|
1171
|
+
hasTooltipSlot: () => z.value,
|
|
1172
|
+
getCsv: R,
|
|
1173
|
+
pointerToIndex: q,
|
|
1131
1174
|
onHover: (e) => f("hover", e)
|
|
1132
1175
|
});
|
|
1133
1176
|
return (n, c) => (_(), a("div", {
|
|
1134
1177
|
ref_key: "containerRef",
|
|
1135
|
-
ref:
|
|
1178
|
+
ref: J,
|
|
1136
1179
|
class: "line-chart-wrapper"
|
|
1137
1180
|
}, [
|
|
1138
|
-
t.menu ? (_(), r(
|
|
1181
|
+
t.menu ? (_(), r(ue, {
|
|
1139
1182
|
key: 0,
|
|
1140
|
-
items: S(
|
|
1183
|
+
items: S(Te)
|
|
1141
1184
|
}, null, 8, ["items"])) : i("", !0),
|
|
1142
1185
|
(_(), a("svg", {
|
|
1143
1186
|
ref_key: "svgRef",
|
|
1144
|
-
ref:
|
|
1145
|
-
width: S(
|
|
1146
|
-
height:
|
|
1187
|
+
ref: ge,
|
|
1188
|
+
width: S(_e),
|
|
1189
|
+
height: se.value
|
|
1147
1190
|
}, [
|
|
1148
1191
|
t.title ? (_(), a("text", {
|
|
1149
1192
|
key: 0,
|
|
1150
|
-
x: S(
|
|
1193
|
+
x: S(_e) / 2,
|
|
1151
1194
|
y: 18,
|
|
1152
1195
|
"text-anchor": "middle",
|
|
1153
1196
|
"font-size": "14",
|
|
1154
1197
|
"font-weight": "600",
|
|
1155
1198
|
fill: "currentColor"
|
|
1156
|
-
}, b(t.title), 9,
|
|
1157
|
-
|
|
1199
|
+
}, b(t.title), 9, Ye)) : i("", !0),
|
|
1200
|
+
I.value.length > 0 ? (_(), a("g", Xe, [(_(!0), a(e, null, y(I.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
|
|
1158
1201
|
key: 0,
|
|
1159
1202
|
x1: S(Y).left + n * 120,
|
|
1160
|
-
y1: S(
|
|
1203
|
+
y1: S(ye),
|
|
1161
1204
|
x2: S(Y).left + n * 120 + 12,
|
|
1162
|
-
y2: S(
|
|
1205
|
+
y2: S(ye),
|
|
1163
1206
|
stroke: t.color,
|
|
1164
1207
|
"stroke-width": "2",
|
|
1165
1208
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
1166
|
-
}, null, 8,
|
|
1209
|
+
}, null, 8, Ze)) : (_(), a("circle", {
|
|
1167
1210
|
key: 1,
|
|
1168
1211
|
cx: S(Y).left + n * 120 + 4,
|
|
1169
|
-
cy: S(
|
|
1212
|
+
cy: S(ye),
|
|
1170
1213
|
r: "4",
|
|
1171
1214
|
fill: t.color,
|
|
1172
1215
|
"fill-opacity": t.fillOpacity,
|
|
1173
1216
|
stroke: t.color,
|
|
1174
1217
|
"stroke-width": "1.5"
|
|
1175
|
-
}, null, 8,
|
|
1218
|
+
}, null, 8, Qe)), o("text", {
|
|
1176
1219
|
x: S(Y).left + n * 120 + 18,
|
|
1177
|
-
y: S(
|
|
1220
|
+
y: S(ye) + 4,
|
|
1178
1221
|
"font-size": "11",
|
|
1179
1222
|
fill: "currentColor"
|
|
1180
|
-
}, b(t.label), 9,
|
|
1223
|
+
}, b(t.label), 9, $e)], 64))), 128))])) : i("", !0),
|
|
1181
1224
|
o("line", {
|
|
1182
1225
|
x1: S(V)(S(Y).left),
|
|
1183
1226
|
y1: S(V)(S(Y).top),
|
|
1184
1227
|
x2: S(V)(S(Y).left),
|
|
1185
|
-
y2: S(V)(S(Y).top + S(
|
|
1228
|
+
y2: S(V)(S(Y).top + S(Z)),
|
|
1186
1229
|
stroke: "currentColor",
|
|
1187
1230
|
"stroke-opacity": "0.3"
|
|
1188
|
-
}, null, 8,
|
|
1231
|
+
}, null, 8, et),
|
|
1189
1232
|
o("line", {
|
|
1190
1233
|
x1: S(V)(S(Y).left),
|
|
1191
|
-
y1: S(V)(S(Y).top + S(
|
|
1192
|
-
x2: S(V)(S(Y).left + S(
|
|
1193
|
-
y2: S(V)(S(Y).top + S(
|
|
1234
|
+
y1: S(V)(S(Y).top + S(Z)),
|
|
1235
|
+
x2: S(V)(S(Y).left + S(X)),
|
|
1236
|
+
y2: S(V)(S(Y).top + S(Z)),
|
|
1194
1237
|
stroke: "currentColor",
|
|
1195
1238
|
"stroke-opacity": "0.3"
|
|
1196
|
-
}, null, 8,
|
|
1197
|
-
t.yGrid ? (_(!0), a(e, { key: 2 }, y(
|
|
1239
|
+
}, null, 8, tt),
|
|
1240
|
+
t.yGrid ? (_(!0), a(e, { key: 2 }, y(le.value, (e, t) => (_(), a("line", {
|
|
1198
1241
|
key: "yg" + t,
|
|
1199
1242
|
x1: S(Y).left,
|
|
1200
1243
|
y1: e.y,
|
|
1201
|
-
x2: S(Y).left + S(
|
|
1244
|
+
x2: S(Y).left + S(X),
|
|
1202
1245
|
y2: e.y,
|
|
1203
1246
|
stroke: "currentColor",
|
|
1204
1247
|
"stroke-opacity": "0.1"
|
|
1205
|
-
}, null, 8,
|
|
1206
|
-
t.xGrid ? (_(!0), a(e, { key: 3 }, y(
|
|
1248
|
+
}, null, 8, nt))), 128)) : i("", !0),
|
|
1249
|
+
t.xGrid ? (_(!0), a(e, { key: 3 }, y(L.value, (e, t) => (_(), a("line", {
|
|
1207
1250
|
key: "xg" + t,
|
|
1208
1251
|
x1: e.x,
|
|
1209
1252
|
y1: S(Y).top,
|
|
1210
1253
|
x2: e.x,
|
|
1211
|
-
y2: S(Y).top + S(
|
|
1254
|
+
y2: S(Y).top + S(Z),
|
|
1212
1255
|
stroke: "currentColor",
|
|
1213
1256
|
"stroke-opacity": "0.1"
|
|
1214
|
-
}, null, 8,
|
|
1215
|
-
(_(!0), a(e, null, y(
|
|
1257
|
+
}, null, 8, rt))), 128)) : i("", !0),
|
|
1258
|
+
(_(!0), a(e, null, y(le.value, (e, t) => (_(), a("text", {
|
|
1216
1259
|
key: "y" + t,
|
|
1217
1260
|
"data-testid": "y-tick",
|
|
1218
1261
|
x: S(Y).left - 6,
|
|
@@ -1222,50 +1265,50 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1222
1265
|
"font-size": "10",
|
|
1223
1266
|
fill: "currentColor",
|
|
1224
1267
|
"fill-opacity": "0.6"
|
|
1225
|
-
}, b(e.value), 9,
|
|
1268
|
+
}, b(e.value), 9, it))), 128)),
|
|
1226
1269
|
t.yLabel ? (_(), a("text", {
|
|
1227
1270
|
key: 4,
|
|
1228
1271
|
x: 0,
|
|
1229
1272
|
y: 0,
|
|
1230
|
-
transform: `translate(14, ${S(Y).top + S(
|
|
1273
|
+
transform: `translate(14, ${S(Y).top + S(Z) / 2}) rotate(-90)`,
|
|
1231
1274
|
"text-anchor": "middle",
|
|
1232
1275
|
"font-size": "13",
|
|
1233
1276
|
fill: "currentColor"
|
|
1234
|
-
}, b(t.yLabel), 9,
|
|
1235
|
-
(_(!0), a(e, null, y(
|
|
1277
|
+
}, b(t.yLabel), 9, at)) : i("", !0),
|
|
1278
|
+
(_(!0), a(e, null, y(L.value, (e, t) => (_(), a("text", {
|
|
1236
1279
|
key: "x" + t,
|
|
1237
1280
|
"data-testid": "x-tick",
|
|
1238
1281
|
x: e.x,
|
|
1239
|
-
y: S(Y).top + S(
|
|
1282
|
+
y: S(Y).top + S(Z) + 16,
|
|
1240
1283
|
"text-anchor": e.anchor,
|
|
1241
1284
|
"font-size": "10",
|
|
1242
1285
|
fill: "currentColor",
|
|
1243
1286
|
"fill-opacity": "0.6"
|
|
1244
|
-
}, b(e.value), 9,
|
|
1287
|
+
}, b(e.value), 9, ot))), 128)),
|
|
1245
1288
|
t.xLabel ? (_(), a("text", {
|
|
1246
1289
|
key: 5,
|
|
1247
|
-
x: S(Y).left + S(
|
|
1248
|
-
y: S(
|
|
1290
|
+
x: S(Y).left + S(X) / 2,
|
|
1291
|
+
y: S(ve) - 4,
|
|
1249
1292
|
"text-anchor": "middle",
|
|
1250
1293
|
"font-size": "13",
|
|
1251
1294
|
fill: "currentColor"
|
|
1252
|
-
}, b(t.xLabel), 9,
|
|
1295
|
+
}, b(t.xLabel), 9, st)) : i("", !0),
|
|
1253
1296
|
(_(!0), a(e, null, y(w.value, (e, t) => (_(), a("path", {
|
|
1254
1297
|
key: "area" + t,
|
|
1255
|
-
d:
|
|
1298
|
+
d: ie(e),
|
|
1256
1299
|
fill: e.color ?? "currentColor",
|
|
1257
1300
|
"fill-opacity": e.opacity ?? .2,
|
|
1258
1301
|
stroke: "none"
|
|
1259
|
-
}, null, 8,
|
|
1302
|
+
}, null, 8, ct))), 128)),
|
|
1260
1303
|
(_(!0), a(e, null, y(C.value, (n, r) => (_(), a(e, { key: r }, [n.line === !1 ? i("", !0) : (_(), a("path", {
|
|
1261
1304
|
key: 0,
|
|
1262
|
-
d:
|
|
1305
|
+
d: P(n),
|
|
1263
1306
|
fill: "none",
|
|
1264
1307
|
stroke: n.color ?? "currentColor",
|
|
1265
1308
|
"stroke-width": n.strokeWidth ?? 1.5,
|
|
1266
1309
|
"stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
|
|
1267
1310
|
"stroke-dasharray": n.dashed ? "6 3" : void 0
|
|
1268
|
-
}, null, 8,
|
|
1311
|
+
}, null, 8, lt)), n.dots ? (_(!0), a(e, { key: 1 }, y(re(n), (e, r) => (_(), a("circle", {
|
|
1269
1312
|
key: r,
|
|
1270
1313
|
cx: e.x,
|
|
1271
1314
|
cy: e.y,
|
|
@@ -1273,68 +1316,68 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1273
1316
|
fill: n.dotFill ?? n.color ?? "currentColor",
|
|
1274
1317
|
"fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
|
|
1275
1318
|
stroke: n.dotStroke ?? "none"
|
|
1276
|
-
}, null, 8,
|
|
1319
|
+
}, null, 8, ut))), 128)) : i("", !0)], 64))), 128)),
|
|
1277
1320
|
(_(!0), a(e, null, y(t.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
1278
1321
|
o("path", {
|
|
1279
|
-
d:
|
|
1322
|
+
d: ae(t),
|
|
1280
1323
|
fill: t.color ?? (t.seriesIndex == null ? "#999" : C.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
1281
1324
|
"fill-opacity": t.opacity ?? .15,
|
|
1282
1325
|
stroke: "none"
|
|
1283
|
-
}, null, 8,
|
|
1326
|
+
}, null, 8, dt),
|
|
1284
1327
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
1285
1328
|
key: 0,
|
|
1286
|
-
d:
|
|
1329
|
+
d: ae(t, !1),
|
|
1287
1330
|
fill: "none",
|
|
1288
1331
|
stroke: t.color ?? C.value[t.seriesIndex]?.color ?? "currentColor",
|
|
1289
1332
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1290
1333
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1291
|
-
}, null, 8,
|
|
1334
|
+
}, null, 8, ft)),
|
|
1292
1335
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
1293
1336
|
x1: S(V)(F(t, "start")),
|
|
1294
1337
|
y1: S(Y).top,
|
|
1295
1338
|
x2: S(V)(F(t, "start")),
|
|
1296
|
-
y2: S(Y).top + S(
|
|
1339
|
+
y2: S(Y).top + S(Z),
|
|
1297
1340
|
stroke: t.color ?? "#999",
|
|
1298
1341
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1299
1342
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1300
|
-
}, null, 8,
|
|
1343
|
+
}, null, 8, pt), o("line", {
|
|
1301
1344
|
x1: S(V)(F(t, "end")),
|
|
1302
1345
|
y1: S(Y).top,
|
|
1303
1346
|
x2: S(V)(F(t, "end")),
|
|
1304
|
-
y2: S(Y).top + S(
|
|
1347
|
+
y2: S(Y).top + S(Z),
|
|
1305
1348
|
stroke: t.color ?? "#999",
|
|
1306
1349
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1307
1350
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1308
|
-
}, null, 8,
|
|
1351
|
+
}, null, 8, mt)], 64)) : i("", !0),
|
|
1309
1352
|
o("line", {
|
|
1310
1353
|
x1: S(V)(F(t, "start")),
|
|
1311
|
-
y1: S(Y).top + S(
|
|
1354
|
+
y1: S(Y).top + S(Z) - 4,
|
|
1312
1355
|
x2: S(V)(F(t, "start")),
|
|
1313
|
-
y2: S(Y).top + S(
|
|
1356
|
+
y2: S(Y).top + S(Z) + 4,
|
|
1314
1357
|
stroke: "currentColor",
|
|
1315
1358
|
"stroke-opacity": "0.4"
|
|
1316
|
-
}, null, 8,
|
|
1359
|
+
}, null, 8, ht),
|
|
1317
1360
|
o("line", {
|
|
1318
1361
|
x1: S(V)(F(t, "end")),
|
|
1319
|
-
y1: S(Y).top + S(
|
|
1362
|
+
y1: S(Y).top + S(Z) - 4,
|
|
1320
1363
|
x2: S(V)(F(t, "end")),
|
|
1321
|
-
y2: S(Y).top + S(
|
|
1364
|
+
y2: S(Y).top + S(Z) + 4,
|
|
1322
1365
|
stroke: "currentColor",
|
|
1323
1366
|
"stroke-opacity": "0.4"
|
|
1324
|
-
}, null, 8,
|
|
1367
|
+
}, null, 8, gt)
|
|
1325
1368
|
], 64))), 128)),
|
|
1326
|
-
|
|
1369
|
+
z.value && S(xe) !== null ? (_(), a("line", {
|
|
1327
1370
|
key: 6,
|
|
1328
|
-
x1: S(V)(
|
|
1371
|
+
x1: S(V)(de.value),
|
|
1329
1372
|
y1: S(Y).top,
|
|
1330
|
-
x2: S(V)(
|
|
1331
|
-
y2: S(Y).top + S(
|
|
1373
|
+
x2: S(V)(de.value),
|
|
1374
|
+
y2: S(Y).top + S(Z),
|
|
1332
1375
|
stroke: "currentColor",
|
|
1333
1376
|
"stroke-opacity": "0.3",
|
|
1334
1377
|
"stroke-dasharray": "4 2",
|
|
1335
1378
|
"pointer-events": "none"
|
|
1336
|
-
}, null, 8,
|
|
1337
|
-
(_(!0), a(e, null, y(
|
|
1379
|
+
}, null, 8, _t)) : i("", !0),
|
|
1380
|
+
(_(!0), a(e, null, y(U.value, (e, t) => (_(), a("circle", {
|
|
1338
1381
|
key: "hd" + t,
|
|
1339
1382
|
cx: e.x,
|
|
1340
1383
|
cy: e.y,
|
|
@@ -1343,110 +1386,110 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1343
1386
|
stroke: "var(--color-bg-0, #fff)",
|
|
1344
1387
|
"stroke-width": "2",
|
|
1345
1388
|
"pointer-events": "none"
|
|
1346
|
-
}, null, 8,
|
|
1347
|
-
|
|
1389
|
+
}, null, 8, vt))), 128)),
|
|
1390
|
+
z.value ? (_(), a("rect", d({
|
|
1348
1391
|
key: 7,
|
|
1349
1392
|
x: S(Y).left,
|
|
1350
1393
|
y: S(Y).top,
|
|
1351
|
-
width: S(
|
|
1352
|
-
height: S(
|
|
1394
|
+
width: S(X),
|
|
1395
|
+
height: S(Z),
|
|
1353
1396
|
fill: "transparent",
|
|
1354
1397
|
style: {
|
|
1355
1398
|
cursor: "crosshair",
|
|
1356
1399
|
"touch-action": "none"
|
|
1357
1400
|
}
|
|
1358
|
-
}, te(S(
|
|
1359
|
-
t.annotations && t.annotations.length > 0 ? (_(), r(S(
|
|
1401
|
+
}, te(S(Ce), !0)), null, 16, yt)) : i("", !0),
|
|
1402
|
+
t.annotations && t.annotations.length > 0 ? (_(), r(S(Ue), {
|
|
1360
1403
|
key: 8,
|
|
1361
1404
|
annotations: t.annotations,
|
|
1362
|
-
project:
|
|
1363
|
-
bounds: S(
|
|
1405
|
+
project: he,
|
|
1406
|
+
bounds: S(be)
|
|
1364
1407
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
1365
|
-
(_(!0), a(e, null, y(
|
|
1408
|
+
(_(!0), a(e, null, y(oe.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
1366
1409
|
o("circle", {
|
|
1367
1410
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
1368
|
-
cy:
|
|
1411
|
+
cy: ce.value + e.row * Et + 4,
|
|
1369
1412
|
r: "4",
|
|
1370
1413
|
fill: e.color,
|
|
1371
1414
|
"fill-opacity": e.fillOpacity,
|
|
1372
1415
|
stroke: e.color,
|
|
1373
1416
|
"stroke-width": "1.5"
|
|
1374
|
-
}, null, 8,
|
|
1417
|
+
}, null, 8, bt),
|
|
1375
1418
|
e.labelText ? (_(), a("text", {
|
|
1376
1419
|
key: 0,
|
|
1377
1420
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1378
|
-
y:
|
|
1421
|
+
y: ce.value + e.row * Et + 8,
|
|
1379
1422
|
"font-size": "11",
|
|
1380
1423
|
"font-weight": "600",
|
|
1381
1424
|
fill: e.color
|
|
1382
|
-
}, b(e.labelText), 9,
|
|
1425
|
+
}, b(e.labelText), 9, xt)) : i("", !0),
|
|
1383
1426
|
e.descText ? (_(), a("text", {
|
|
1384
1427
|
key: 1,
|
|
1385
1428
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1386
|
-
y:
|
|
1429
|
+
y: ce.value + e.row * Et + 22,
|
|
1387
1430
|
"font-size": "11",
|
|
1388
1431
|
fill: "currentColor",
|
|
1389
1432
|
"fill-opacity": "0.6"
|
|
1390
|
-
}, b(e.descText), 9,
|
|
1433
|
+
}, b(e.descText), 9, St)) : i("", !0)
|
|
1391
1434
|
]))), 128))
|
|
1392
|
-
], 8,
|
|
1393
|
-
|
|
1435
|
+
], 8, Je)),
|
|
1436
|
+
z.value && S(xe) !== null && K.value ? (_(), a("div", {
|
|
1394
1437
|
key: 1,
|
|
1395
1438
|
ref_key: "tooltipRef",
|
|
1396
|
-
ref:
|
|
1439
|
+
ref: Se,
|
|
1397
1440
|
class: "chart-tooltip-content",
|
|
1398
1441
|
style: m({
|
|
1399
1442
|
position: "absolute",
|
|
1400
1443
|
top: "0",
|
|
1401
1444
|
left: "0",
|
|
1402
1445
|
willChange: "transform",
|
|
1403
|
-
transform: S(
|
|
1404
|
-
visibility: S(
|
|
1446
|
+
transform: S(Q) ? `translate3d(${S(Q).left}px, ${S(Q).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
1447
|
+
visibility: S(Q) ? "visible" : "hidden"
|
|
1405
1448
|
})
|
|
1406
|
-
}, [ee(n.$slots, "tooltip", p(u(
|
|
1449
|
+
}, [ee(n.$slots, "tooltip", p(u(K.value)), () => [o("div", Ct, [K.value.xLabel ? (_(), a("div", wt, b(K.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(K.value.values, (e) => (_(), a("div", {
|
|
1407
1450
|
key: e.seriesIndex,
|
|
1408
1451
|
class: "line-chart-tooltip-row"
|
|
1409
1452
|
}, [o("span", {
|
|
1410
1453
|
class: "line-chart-tooltip-swatch",
|
|
1411
1454
|
style: m({ background: e.color })
|
|
1412
1455
|
}, null, 4), s(" " + b(isFinite(e.value) ? S(x)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1413
|
-
S(
|
|
1456
|
+
S(Ee) ? (_(), a("a", {
|
|
1414
1457
|
key: 2,
|
|
1415
1458
|
class: "line-chart-download-link",
|
|
1416
|
-
href: S(
|
|
1417
|
-
download: `${S(
|
|
1418
|
-
}, b(S(
|
|
1459
|
+
href: S(De),
|
|
1460
|
+
download: `${S(Oe)()}.csv`
|
|
1461
|
+
}, b(S(Ee)), 9, Tt)) : i("", !0)
|
|
1419
1462
|
], 512));
|
|
1420
1463
|
}
|
|
1421
|
-
}), [["__scopeId", "data-v-
|
|
1464
|
+
}), [["__scopeId", "data-v-384bab8e"]]), jt = ["width", "height"], Mt = ["x"], Nt = { key: 1 }, Pt = [
|
|
1422
1465
|
"x",
|
|
1423
1466
|
"y",
|
|
1424
1467
|
"fill"
|
|
1425
|
-
],
|
|
1468
|
+
], Ft = ["x", "y"], It = [
|
|
1426
1469
|
"x1",
|
|
1427
1470
|
"y1",
|
|
1428
1471
|
"x2",
|
|
1429
1472
|
"y2"
|
|
1430
|
-
],
|
|
1473
|
+
], Lt = [
|
|
1431
1474
|
"x1",
|
|
1432
1475
|
"y1",
|
|
1433
1476
|
"x2",
|
|
1434
1477
|
"y2"
|
|
1435
|
-
],
|
|
1478
|
+
], Rt = [
|
|
1436
1479
|
"x1",
|
|
1437
1480
|
"y1",
|
|
1438
1481
|
"x2",
|
|
1439
1482
|
"y2"
|
|
1440
|
-
],
|
|
1483
|
+
], zt = [
|
|
1441
1484
|
"x",
|
|
1442
1485
|
"y",
|
|
1443
1486
|
"width",
|
|
1444
1487
|
"height"
|
|
1445
|
-
],
|
|
1488
|
+
], Bt = ["x", "y"], Vt = ["x", "y"], Ht = ["transform"], Ut = [
|
|
1446
1489
|
"x",
|
|
1447
1490
|
"y",
|
|
1448
1491
|
"text-anchor"
|
|
1449
|
-
],
|
|
1492
|
+
], Wt = ["x", "y"], Gt = ["x", "y"], Kt = [
|
|
1450
1493
|
"data-category",
|
|
1451
1494
|
"data-series",
|
|
1452
1495
|
"x",
|
|
@@ -1455,15 +1498,15 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1455
1498
|
"height",
|
|
1456
1499
|
"fill",
|
|
1457
1500
|
"fill-opacity"
|
|
1458
|
-
],
|
|
1501
|
+
], qt = [
|
|
1459
1502
|
"x",
|
|
1460
1503
|
"y",
|
|
1461
1504
|
"width",
|
|
1462
1505
|
"height"
|
|
1463
|
-
],
|
|
1506
|
+
], Jt = { class: "bar-chart-tooltip" }, Yt = {
|
|
1464
1507
|
key: 0,
|
|
1465
1508
|
class: "bar-chart-tooltip-label"
|
|
1466
|
-
},
|
|
1509
|
+
}, Xt = ["href", "download"], Zt = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
1467
1510
|
__name: "BarChart",
|
|
1468
1511
|
props: {
|
|
1469
1512
|
data: {},
|
|
@@ -1473,6 +1516,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1473
1516
|
orientation: { default: "vertical" },
|
|
1474
1517
|
layout: { default: "grouped" },
|
|
1475
1518
|
valueMin: { default: 0 },
|
|
1519
|
+
valueScaleType: { default: "linear" },
|
|
1476
1520
|
valueTicks: {},
|
|
1477
1521
|
valueTickFormat: {},
|
|
1478
1522
|
categoryFormat: {},
|
|
@@ -1526,30 +1570,32 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1526
1570
|
for (let n = 0; n < e; n++) t[n] = l.categories?.[n] ?? String(n);
|
|
1527
1571
|
return t;
|
|
1528
1572
|
}), T = n(() => l.orientation === "vertical"), E = n(() => {
|
|
1529
|
-
let e = Infinity, t = -Infinity
|
|
1573
|
+
let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
|
|
1574
|
+
e > 0 && e < n && (n = e);
|
|
1575
|
+
};
|
|
1530
1576
|
if (l.layout === "stacked") {
|
|
1531
1577
|
let n = C.value;
|
|
1532
|
-
for (let
|
|
1533
|
-
let n = 0,
|
|
1578
|
+
for (let i = 0; i < n; i++) {
|
|
1579
|
+
let n = 0, a = 0;
|
|
1534
1580
|
for (let e of x.value) {
|
|
1535
|
-
if (
|
|
1536
|
-
let t = Number(e.data[
|
|
1537
|
-
isFinite(t) && (t >= 0 ? n += t :
|
|
1581
|
+
if (i >= e.data.length) continue;
|
|
1582
|
+
let t = Number(e.data[i]);
|
|
1583
|
+
isFinite(t) && (r(t), t >= 0 ? n += t : a += t);
|
|
1538
1584
|
}
|
|
1539
|
-
n > t && (t = n),
|
|
1585
|
+
n > t && (t = n), a < e && (e = a);
|
|
1540
1586
|
}
|
|
1541
|
-
} else for (let n of x.value) for (let
|
|
1542
|
-
let n = Number(
|
|
1543
|
-
isFinite(n) && (n < e && (e = n), n > t && (t = n));
|
|
1587
|
+
} else for (let n of x.value) for (let i of n.data) {
|
|
1588
|
+
let n = Number(i);
|
|
1589
|
+
isFinite(n) && (r(n), n < e && (e = n), n > t && (t = n));
|
|
1544
1590
|
}
|
|
1545
1591
|
isFinite(e) || (e = 0), isFinite(t) || (t = 0);
|
|
1546
|
-
let
|
|
1547
|
-
|
|
1548
|
-
let
|
|
1592
|
+
let i = l.valueMin ?? 0;
|
|
1593
|
+
l.valueScaleType === "log" ? i > 0 && i < e && (e = i) : i < e && (e = i);
|
|
1594
|
+
let a = pe(e, t, l.valueScaleType, n);
|
|
1549
1595
|
return {
|
|
1550
|
-
min:
|
|
1551
|
-
max:
|
|
1552
|
-
range:
|
|
1596
|
+
min: a.min,
|
|
1597
|
+
max: a.max,
|
|
1598
|
+
range: a.max - a.min || 1
|
|
1553
1599
|
};
|
|
1554
1600
|
}), D = n(() => T.value ? q.value : J.value), O = n(() => T.value ? J.value : q.value), k = n(() => {
|
|
1555
1601
|
let e = C.value;
|
|
@@ -1569,10 +1615,10 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1569
1615
|
return P(Math.max(e, Math.min(t, n)));
|
|
1570
1616
|
});
|
|
1571
1617
|
function P(e) {
|
|
1572
|
-
let { min: t,
|
|
1573
|
-
return T.value ? K.value.top + J.value -
|
|
1618
|
+
let { min: t, max: n } = E.value, r = fe(e, t, n, l.valueScaleType);
|
|
1619
|
+
return T.value ? K.value.top + J.value - r * J.value : K.value.left + r * q.value;
|
|
1574
1620
|
}
|
|
1575
|
-
function
|
|
1621
|
+
function re(e, t, n, r, i, a, o, s, c) {
|
|
1576
1622
|
let l = Math.min(e, t), u = Math.abs(e - t);
|
|
1577
1623
|
return T.value ? {
|
|
1578
1624
|
x: n,
|
|
@@ -1596,7 +1642,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1596
1642
|
seriesIndex: c
|
|
1597
1643
|
};
|
|
1598
1644
|
}
|
|
1599
|
-
let
|
|
1645
|
+
let ie = n(() => {
|
|
1600
1646
|
let e = [], t = x.value, n = t.length;
|
|
1601
1647
|
if (n === 0) return e;
|
|
1602
1648
|
let r = C.value, i = k.value, a = A.value, o = j.value, s = (i - a) / 2, c = N.value;
|
|
@@ -1608,17 +1654,17 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1608
1654
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
1609
1655
|
if (!isFinite(l)) continue;
|
|
1610
1656
|
let u = l >= 0 ? o : s, d = u + l;
|
|
1611
|
-
e.push(
|
|
1657
|
+
e.push(re(P(u), P(d), r, a, n.color ?? ae(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
|
|
1612
1658
|
}
|
|
1613
1659
|
} else for (let a = 0; a < n; a++) {
|
|
1614
1660
|
let s = t[a], u = Number(s.data[i] ?? NaN);
|
|
1615
1661
|
if (!isFinite(u)) continue;
|
|
1616
1662
|
let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
|
|
1617
|
-
e.push(
|
|
1663
|
+
e.push(re(c, P(u), d, o, s.color ?? ae(a), s.opacity ?? 1, u, i, a));
|
|
1618
1664
|
}
|
|
1619
1665
|
}
|
|
1620
1666
|
return e;
|
|
1621
|
-
}),
|
|
1667
|
+
}), F = [
|
|
1622
1668
|
"var(--color-primary, #3b82f6)",
|
|
1623
1669
|
"var(--color-accent, #f59e0b)",
|
|
1624
1670
|
"var(--color-success, #10b981)",
|
|
@@ -1626,26 +1672,30 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1626
1672
|
"var(--color-info, #6366f1)",
|
|
1627
1673
|
"var(--color-warning, #d97706)"
|
|
1628
1674
|
];
|
|
1629
|
-
function
|
|
1630
|
-
return
|
|
1675
|
+
function ae(e) {
|
|
1676
|
+
return F[e % F.length];
|
|
1631
1677
|
}
|
|
1632
|
-
let
|
|
1633
|
-
let { min: e, max: t } = E.value, n = (e) => l.valueTickFormat ?
|
|
1678
|
+
let oe = qe(() => l.tooltipValueFormat, () => l.valueTickFormat), I = n(() => {
|
|
1679
|
+
let { min: e, max: t } = E.value, n = (e) => l.valueTickFormat === void 0 ? W(e) : ne(e, l.valueTickFormat);
|
|
1634
1680
|
if (e === t) return [{
|
|
1635
1681
|
value: n(e),
|
|
1636
1682
|
pos: V(P(e))
|
|
1637
1683
|
}];
|
|
1638
1684
|
let r = T.value ? 50 : 80;
|
|
1639
|
-
return
|
|
1685
|
+
return (l.valueScaleType === "log" ? me({
|
|
1686
|
+
min: e,
|
|
1687
|
+
max: t,
|
|
1688
|
+
ticks: l.valueTicks
|
|
1689
|
+
}) : G({
|
|
1640
1690
|
min: e,
|
|
1641
1691
|
max: t,
|
|
1642
1692
|
ticks: l.valueTicks,
|
|
1643
1693
|
targetTickCount: O.value / r
|
|
1644
|
-
}).map((e) => ({
|
|
1694
|
+
})).map((e) => ({
|
|
1645
1695
|
value: n(e),
|
|
1646
1696
|
pos: V(P(e))
|
|
1647
1697
|
}));
|
|
1648
|
-
}),
|
|
1698
|
+
}), se = n(() => {
|
|
1649
1699
|
let e = [], t = C.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
|
|
1650
1700
|
for (let r = 0; r < t; r++) {
|
|
1651
1701
|
let t = M(r) + k.value / 2;
|
|
@@ -1656,23 +1706,23 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1656
1706
|
});
|
|
1657
1707
|
}
|
|
1658
1708
|
return e;
|
|
1659
|
-
}),
|
|
1709
|
+
}), ce = n(() => {
|
|
1660
1710
|
let e = [];
|
|
1661
1711
|
return x.value.forEach((t, n) => {
|
|
1662
1712
|
t.legend && e.push({
|
|
1663
1713
|
label: t.legend,
|
|
1664
|
-
color: t.color ??
|
|
1714
|
+
color: t.color ?? ae(n)
|
|
1665
1715
|
});
|
|
1666
1716
|
}), e;
|
|
1667
1717
|
});
|
|
1668
|
-
function
|
|
1718
|
+
function le() {
|
|
1669
1719
|
if (typeof l.csv == "function") return l.csv();
|
|
1670
1720
|
if (typeof l.csv == "string") return l.csv;
|
|
1671
1721
|
let e = x.value.map((e) => ({
|
|
1672
1722
|
label: e.legend,
|
|
1673
1723
|
data: e.data
|
|
1674
1724
|
}));
|
|
1675
|
-
return
|
|
1725
|
+
return Te(w.value, e);
|
|
1676
1726
|
}
|
|
1677
1727
|
let L = n(() => !!l.tooltipData || !!l.tooltipTrigger);
|
|
1678
1728
|
function R(e, t) {
|
|
@@ -1694,7 +1744,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1694
1744
|
let i = T.value ? e - n.left - K.value.left : t - n.top - K.value.top;
|
|
1695
1745
|
return Math.max(0, Math.min(r - 1, Math.floor(i / k.value)));
|
|
1696
1746
|
}
|
|
1697
|
-
let { containerRef: B, svgRef:
|
|
1747
|
+
let { containerRef: B, svgRef: de, width: H, height: U, padding: K, legendY: he, innerW: q, innerH: J, bounds: ge, hoverIndex: _e, tooltipRef: ve, tooltipPos: Y, tooltipHandlers: ye, menuItems: X, downloadLinkText: Z, csvHref: be, menuFilename: xe } = Ke({
|
|
1698
1748
|
width: () => l.width,
|
|
1699
1749
|
height: () => l.height,
|
|
1700
1750
|
title: () => l.title,
|
|
@@ -1709,26 +1759,26 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1709
1759
|
chartPadding: () => l.chartPadding,
|
|
1710
1760
|
hasInlineLegend: () => h.value,
|
|
1711
1761
|
hasTooltipSlot: () => L.value,
|
|
1712
|
-
getCsv:
|
|
1762
|
+
getCsv: le,
|
|
1713
1763
|
pointerToIndex: z,
|
|
1714
1764
|
onHover: (e) => f("hover", e)
|
|
1715
|
-
}),
|
|
1716
|
-
let e =
|
|
1765
|
+
}), Se = n(() => {
|
|
1766
|
+
let e = _e.value;
|
|
1717
1767
|
if (e !== null) return w.value[e];
|
|
1718
|
-
}),
|
|
1719
|
-
let e =
|
|
1768
|
+
}), Q = n(() => {
|
|
1769
|
+
let e = _e.value;
|
|
1720
1770
|
return e === null ? null : {
|
|
1721
1771
|
index: e,
|
|
1722
1772
|
category: w.value[e] ?? String(e),
|
|
1723
1773
|
values: x.value.map((t, n) => ({
|
|
1724
1774
|
value: Number(t.data[e] ?? NaN),
|
|
1725
|
-
color: t.color ??
|
|
1775
|
+
color: t.color ?? ae(n),
|
|
1726
1776
|
seriesIndex: n
|
|
1727
1777
|
})),
|
|
1728
1778
|
data: l.tooltipData?.[e] ?? null
|
|
1729
1779
|
};
|
|
1730
|
-
}),
|
|
1731
|
-
let e =
|
|
1780
|
+
}), Ce = n(() => {
|
|
1781
|
+
let e = _e.value;
|
|
1732
1782
|
if (e === null) return null;
|
|
1733
1783
|
let t = M(e);
|
|
1734
1784
|
return T.value ? {
|
|
@@ -1748,37 +1798,37 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1748
1798
|
ref: B,
|
|
1749
1799
|
class: "bar-chart-wrapper"
|
|
1750
1800
|
}, [
|
|
1751
|
-
t.menu ? (_(), r(
|
|
1801
|
+
t.menu ? (_(), r(ue, {
|
|
1752
1802
|
key: 0,
|
|
1753
|
-
items: S(
|
|
1803
|
+
items: S(X)
|
|
1754
1804
|
}, null, 8, ["items"])) : i("", !0),
|
|
1755
1805
|
(_(), a("svg", {
|
|
1756
1806
|
ref_key: "svgRef",
|
|
1757
|
-
ref:
|
|
1758
|
-
width: S(
|
|
1807
|
+
ref: de,
|
|
1808
|
+
width: S(H),
|
|
1759
1809
|
height: S(U)
|
|
1760
1810
|
}, [
|
|
1761
1811
|
t.title ? (_(), a("text", {
|
|
1762
1812
|
key: 0,
|
|
1763
|
-
x: S(
|
|
1813
|
+
x: S(H) / 2,
|
|
1764
1814
|
y: 18,
|
|
1765
1815
|
"text-anchor": "middle",
|
|
1766
1816
|
"font-size": "14",
|
|
1767
1817
|
"font-weight": "600",
|
|
1768
1818
|
fill: "currentColor"
|
|
1769
|
-
}, b(t.title), 9,
|
|
1770
|
-
|
|
1819
|
+
}, b(t.title), 9, Mt)) : i("", !0),
|
|
1820
|
+
ce.value.length > 0 ? (_(), a("g", Nt, [(_(!0), a(e, null, y(ce.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [o("rect", {
|
|
1771
1821
|
x: S(K).left + n * 120,
|
|
1772
|
-
y: S(
|
|
1822
|
+
y: S(he) - 5,
|
|
1773
1823
|
width: "12",
|
|
1774
1824
|
height: "10",
|
|
1775
1825
|
fill: t.color
|
|
1776
|
-
}, null, 8,
|
|
1826
|
+
}, null, 8, Pt), o("text", {
|
|
1777
1827
|
x: S(K).left + n * 120 + 18,
|
|
1778
|
-
y: S(
|
|
1828
|
+
y: S(he) + 4,
|
|
1779
1829
|
"font-size": "11",
|
|
1780
1830
|
fill: "currentColor"
|
|
1781
|
-
}, b(t.label), 9,
|
|
1831
|
+
}, b(t.label), 9, Ft)], 64))), 128))])) : i("", !0),
|
|
1782
1832
|
o("line", {
|
|
1783
1833
|
x1: S(V)(S(K).left),
|
|
1784
1834
|
y1: S(V)(S(K).top),
|
|
@@ -1786,7 +1836,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1786
1836
|
y2: S(V)(S(K).top + S(J)),
|
|
1787
1837
|
stroke: "currentColor",
|
|
1788
1838
|
"stroke-opacity": "0.3"
|
|
1789
|
-
}, null, 8,
|
|
1839
|
+
}, null, 8, It),
|
|
1790
1840
|
o("line", {
|
|
1791
1841
|
x1: S(V)(S(K).left),
|
|
1792
1842
|
y1: S(V)(S(K).top + S(J)),
|
|
@@ -1794,8 +1844,8 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1794
1844
|
y2: S(V)(S(K).top + S(J)),
|
|
1795
1845
|
stroke: "currentColor",
|
|
1796
1846
|
"stroke-opacity": "0.3"
|
|
1797
|
-
}, null, 8,
|
|
1798
|
-
t.valueGrid ? (_(!0), a(e, { key: 2 }, y(
|
|
1847
|
+
}, null, 8, Lt),
|
|
1848
|
+
t.valueGrid ? (_(!0), a(e, { key: 2 }, y(I.value, (e, t) => (_(), a("line", {
|
|
1799
1849
|
key: "vg" + t,
|
|
1800
1850
|
x1: T.value ? S(K).left : e.pos,
|
|
1801
1851
|
y1: T.value ? e.pos : S(K).top,
|
|
@@ -1803,18 +1853,18 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1803
1853
|
y2: T.value ? e.pos : S(K).top + S(J),
|
|
1804
1854
|
stroke: "currentColor",
|
|
1805
1855
|
"stroke-opacity": "0.1"
|
|
1806
|
-
}, null, 8,
|
|
1807
|
-
|
|
1856
|
+
}, null, 8, Rt))), 128)) : i("", !0),
|
|
1857
|
+
Ce.value && L.value ? (_(), a("rect", {
|
|
1808
1858
|
key: 3,
|
|
1809
|
-
x:
|
|
1810
|
-
y:
|
|
1811
|
-
width:
|
|
1812
|
-
height:
|
|
1859
|
+
x: Ce.value.x,
|
|
1860
|
+
y: Ce.value.y,
|
|
1861
|
+
width: Ce.value.w,
|
|
1862
|
+
height: Ce.value.h,
|
|
1813
1863
|
fill: "currentColor",
|
|
1814
1864
|
"fill-opacity": "0.06",
|
|
1815
1865
|
"pointer-events": "none"
|
|
1816
|
-
}, null, 8,
|
|
1817
|
-
T.value ? (_(!0), a(e, { key: 4 }, y(
|
|
1866
|
+
}, null, 8, zt)) : i("", !0),
|
|
1867
|
+
T.value ? (_(!0), a(e, { key: 4 }, y(I.value, (e, t) => (_(), a("text", {
|
|
1818
1868
|
key: "vt" + t,
|
|
1819
1869
|
"data-testid": "value-tick",
|
|
1820
1870
|
x: S(K).left - 6,
|
|
@@ -1824,7 +1874,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1824
1874
|
"font-size": "10",
|
|
1825
1875
|
fill: "currentColor",
|
|
1826
1876
|
"fill-opacity": "0.6"
|
|
1827
|
-
}, b(e.value), 9,
|
|
1877
|
+
}, b(e.value), 9, Bt))), 128)) : (_(!0), a(e, { key: 5 }, y(I.value, (e, t) => (_(), a("text", {
|
|
1828
1878
|
key: "vt" + t,
|
|
1829
1879
|
"data-testid": "value-tick",
|
|
1830
1880
|
x: e.pos,
|
|
@@ -1833,7 +1883,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1833
1883
|
"font-size": "10",
|
|
1834
1884
|
fill: "currentColor",
|
|
1835
1885
|
"fill-opacity": "0.6"
|
|
1836
|
-
}, b(e.value), 9,
|
|
1886
|
+
}, b(e.value), 9, Vt))), 128)),
|
|
1837
1887
|
t.yLabel ? (_(), a("text", {
|
|
1838
1888
|
key: 6,
|
|
1839
1889
|
x: 0,
|
|
@@ -1842,8 +1892,8 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1842
1892
|
"text-anchor": "middle",
|
|
1843
1893
|
"font-size": "13",
|
|
1844
1894
|
fill: "currentColor"
|
|
1845
|
-
}, b(t.yLabel), 9,
|
|
1846
|
-
T.value ? (_(!0), a(e, { key: 7 }, y(
|
|
1895
|
+
}, b(t.yLabel), 9, Ht)) : i("", !0),
|
|
1896
|
+
T.value ? (_(!0), a(e, { key: 7 }, y(se.value, (e, t) => (_(), a("text", {
|
|
1847
1897
|
key: "ct" + t,
|
|
1848
1898
|
"data-testid": "category-tick",
|
|
1849
1899
|
x: e.pos,
|
|
@@ -1852,7 +1902,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1852
1902
|
"font-size": "10",
|
|
1853
1903
|
fill: "currentColor",
|
|
1854
1904
|
"fill-opacity": "0.6"
|
|
1855
|
-
}, b(e.label), 9,
|
|
1905
|
+
}, b(e.label), 9, Ut))), 128)) : (_(!0), a(e, { key: 8 }, y(se.value, (e, t) => (_(), a("text", {
|
|
1856
1906
|
key: "ct" + t,
|
|
1857
1907
|
"data-testid": "category-tick",
|
|
1858
1908
|
x: S(K).left - 6,
|
|
@@ -1862,7 +1912,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1862
1912
|
"font-size": "10",
|
|
1863
1913
|
fill: "currentColor",
|
|
1864
1914
|
"fill-opacity": "0.6"
|
|
1865
|
-
}, b(e.label), 9,
|
|
1915
|
+
}, b(e.label), 9, Wt))), 128)),
|
|
1866
1916
|
t.xLabel ? (_(), a("text", {
|
|
1867
1917
|
key: 9,
|
|
1868
1918
|
x: S(K).left + S(q) / 2,
|
|
@@ -1870,8 +1920,8 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1870
1920
|
"text-anchor": "middle",
|
|
1871
1921
|
"font-size": "13",
|
|
1872
1922
|
fill: "currentColor"
|
|
1873
|
-
}, b(t.xLabel), 9,
|
|
1874
|
-
(_(!0), a(e, null, y(
|
|
1923
|
+
}, b(t.xLabel), 9, Gt)) : i("", !0),
|
|
1924
|
+
(_(!0), a(e, null, y(ie.value, (e, t) => (_(), a("rect", {
|
|
1875
1925
|
key: "bar" + t,
|
|
1876
1926
|
"data-testid": "bar",
|
|
1877
1927
|
"data-category": e.categoryIndex,
|
|
@@ -1882,7 +1932,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1882
1932
|
height: e.h,
|
|
1883
1933
|
fill: e.color,
|
|
1884
1934
|
"fill-opacity": e.opacity
|
|
1885
|
-
}, null, 8,
|
|
1935
|
+
}, null, 8, Kt))), 128)),
|
|
1886
1936
|
L.value ? (_(), a("rect", d({
|
|
1887
1937
|
key: 10,
|
|
1888
1938
|
x: S(K).left,
|
|
@@ -1894,43 +1944,43 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
1894
1944
|
cursor: "crosshair",
|
|
1895
1945
|
"touch-action": "none"
|
|
1896
1946
|
}
|
|
1897
|
-
}, te(S(
|
|
1898
|
-
t.annotations && t.annotations.length > 0 ? (_(), r(S(
|
|
1947
|
+
}, te(S(ye), !0)), null, 16, qt)) : i("", !0),
|
|
1948
|
+
t.annotations && t.annotations.length > 0 ? (_(), r(S(Ue), {
|
|
1899
1949
|
key: 11,
|
|
1900
1950
|
annotations: t.annotations,
|
|
1901
1951
|
project: R,
|
|
1902
|
-
bounds: S(
|
|
1952
|
+
bounds: S(ge)
|
|
1903
1953
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
1904
|
-
], 8,
|
|
1905
|
-
L.value && S(
|
|
1954
|
+
], 8, jt)),
|
|
1955
|
+
L.value && S(_e) !== null && Q.value ? (_(), a("div", {
|
|
1906
1956
|
key: 1,
|
|
1907
1957
|
ref_key: "tooltipRef",
|
|
1908
|
-
ref:
|
|
1958
|
+
ref: ve,
|
|
1909
1959
|
class: "chart-tooltip-content",
|
|
1910
1960
|
style: m({
|
|
1911
1961
|
position: "absolute",
|
|
1912
1962
|
top: "0",
|
|
1913
1963
|
left: "0",
|
|
1914
1964
|
willChange: "transform",
|
|
1915
|
-
transform: S(
|
|
1916
|
-
visibility: S(
|
|
1965
|
+
transform: S(Y) ? `translate3d(${S(Y).left}px, ${S(Y).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
1966
|
+
visibility: S(Y) ? "visible" : "hidden"
|
|
1917
1967
|
})
|
|
1918
|
-
}, [ee(n.$slots, "tooltip", p(u(
|
|
1968
|
+
}, [ee(n.$slots, "tooltip", p(u(Q.value)), () => [o("div", Jt, [Se.value ? (_(), a("div", Yt, b(Se.value), 1)) : i("", !0), (_(!0), a(e, null, y(Q.value.values, (e) => (_(), a("div", {
|
|
1919
1969
|
key: e.seriesIndex,
|
|
1920
1970
|
class: "bar-chart-tooltip-row"
|
|
1921
1971
|
}, [o("span", {
|
|
1922
1972
|
class: "bar-chart-tooltip-swatch",
|
|
1923
1973
|
style: m({ background: e.color })
|
|
1924
|
-
}, null, 4), s(" " + b(isFinite(e.value) ? S(
|
|
1925
|
-
S(
|
|
1974
|
+
}, null, 4), s(" " + b(isFinite(e.value) ? S(oe)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1975
|
+
S(Z) ? (_(), a("a", {
|
|
1926
1976
|
key: 2,
|
|
1927
1977
|
class: "bar-chart-download-link",
|
|
1928
|
-
href: S(
|
|
1929
|
-
download: `${S(
|
|
1930
|
-
}, b(S(
|
|
1978
|
+
href: S(be),
|
|
1979
|
+
download: `${S(xe)()}.csv`
|
|
1980
|
+
}, b(S(Z)), 9, Xt)) : i("", !0)
|
|
1931
1981
|
], 512));
|
|
1932
1982
|
}
|
|
1933
|
-
}), [["__scopeId", "data-v-
|
|
1983
|
+
}), [["__scopeId", "data-v-734e6c4e"]]), Qt = {
|
|
1934
1984
|
"01013": "010259",
|
|
1935
1985
|
"01015": "010177",
|
|
1936
1986
|
"01029": "010177",
|
|
@@ -5091,7 +5141,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
5091
5141
|
51019: "510014",
|
|
5092
5142
|
"02158": "020820",
|
|
5093
5143
|
46102: "460957"
|
|
5094
|
-
},
|
|
5144
|
+
}, $t = {
|
|
5095
5145
|
"010259": "Butler, AL",
|
|
5096
5146
|
"010177": "Calhoun (Anniston), AL - Cleburne, AL",
|
|
5097
5147
|
"010172": "Chambers, AL - Randolph, AL",
|
|
@@ -6041,7 +6091,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6041
6091
|
560775: "Teton, WY - Lincoln, WY",
|
|
6042
6092
|
560792: "Uinta, WY",
|
|
6043
6093
|
560804: "Weston, WY"
|
|
6044
|
-
},
|
|
6094
|
+
}, en = {
|
|
6045
6095
|
ref: "root",
|
|
6046
6096
|
class: "chart-tooltip-content",
|
|
6047
6097
|
style: {
|
|
@@ -6053,7 +6103,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6053
6103
|
"pointer-events": "none",
|
|
6054
6104
|
transform: "translateY(-50%)"
|
|
6055
6105
|
}
|
|
6056
|
-
},
|
|
6106
|
+
}, tn = /* @__PURE__ */ l({
|
|
6057
6107
|
__name: "ChoroplethTooltip",
|
|
6058
6108
|
setup(e, { expose: n }) {
|
|
6059
6109
|
let a = v(null), s = w("root");
|
|
@@ -6064,24 +6114,24 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6064
6114
|
getEl() {
|
|
6065
6115
|
return s.value;
|
|
6066
6116
|
}
|
|
6067
|
-
}), (e, n) => (_(), r(t, { to: "body" }, [o("div",
|
|
6117
|
+
}), (e, n) => (_(), r(t, { to: "body" }, [o("div", en, [a.value ? ee(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
|
|
6068
6118
|
}
|
|
6069
|
-
}),
|
|
6119
|
+
}), nn = {
|
|
6070
6120
|
key: 1,
|
|
6071
6121
|
class: "choropleth-header"
|
|
6072
|
-
},
|
|
6122
|
+
}, rn = {
|
|
6073
6123
|
key: 0,
|
|
6074
6124
|
class: "choropleth-title"
|
|
6075
|
-
},
|
|
6125
|
+
}, an = {
|
|
6076
6126
|
key: 1,
|
|
6077
6127
|
class: "choropleth-legend"
|
|
6078
|
-
},
|
|
6128
|
+
}, on = {
|
|
6079
6129
|
key: 0,
|
|
6080
6130
|
class: "choropleth-legend-title"
|
|
6081
|
-
},
|
|
6131
|
+
}, sn = {
|
|
6082
6132
|
key: 2,
|
|
6083
6133
|
class: "choropleth-legend-continuous"
|
|
6084
|
-
},
|
|
6134
|
+
}, cn = { class: "choropleth-legend-ticks" }, ln = ["viewBox"], un = ["innerHTML"], dn = "http://www.w3.org/2000/svg", fn = 450, pn = 1e3, mn = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
6085
6135
|
__name: "ChoroplethMap",
|
|
6086
6136
|
props: {
|
|
6087
6137
|
topology: {},
|
|
@@ -6125,43 +6175,43 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6125
6175
|
"update:focus"
|
|
6126
6176
|
],
|
|
6127
6177
|
setup(t, { emit: c }) {
|
|
6128
|
-
let l = t, d = c, te = (e) => e, S = v(null), w = v(null), D = v(null), O = v(null), k = v(null), A = v(null), j = C(), M = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!j.tooltip), N = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(),
|
|
6178
|
+
let l = t, d = c, te = (e) => e, S = v(null), w = v(null), D = v(null), O = v(null), k = v(null), A = v(null), j = C(), M = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!j.tooltip), N = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), re = null, L = null, R = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map(), B = !1, V = typeof window < "u" && "ontouchstart" in window, de = null, H = {
|
|
6129
6179
|
width: 0,
|
|
6130
6180
|
height: 0
|
|
6131
|
-
}, U = null, W = !1, G = null,
|
|
6132
|
-
function
|
|
6181
|
+
}, U = null, W = !1, G = null, fe = v(!1), pe = 0, me = 0, K = 0;
|
|
6182
|
+
function he() {
|
|
6133
6183
|
if (V) return;
|
|
6134
6184
|
let e = D.value;
|
|
6135
|
-
e && (e.addEventListener("click",
|
|
6185
|
+
e && (e.addEventListener("click", ct), e.addEventListener("mouseover", ct), e.addEventListener("mousemove", lt), e.addEventListener("mouseout", ut));
|
|
6136
6186
|
}
|
|
6137
|
-
function
|
|
6187
|
+
function q() {
|
|
6138
6188
|
let e = D.value;
|
|
6139
|
-
e && (e.removeEventListener("click",
|
|
6189
|
+
e && (e.removeEventListener("click", ct), e.removeEventListener("mouseover", ct), e.removeEventListener("mousemove", lt), e.removeEventListener("mouseout", ut));
|
|
6140
6190
|
}
|
|
6141
|
-
function
|
|
6142
|
-
|
|
6191
|
+
function J() {
|
|
6192
|
+
ot();
|
|
6143
6193
|
}
|
|
6144
6194
|
h(() => {
|
|
6145
|
-
|
|
6195
|
+
ge(), he(), ft(), Z(), Ze(), window.addEventListener("scroll", J, {
|
|
6146
6196
|
passive: !0,
|
|
6147
6197
|
capture: !0
|
|
6148
|
-
}), window.addEventListener("resize",
|
|
6198
|
+
}), window.addEventListener("resize", J, { passive: !0 });
|
|
6149
6199
|
}), g(() => {
|
|
6150
|
-
|
|
6200
|
+
de?.disconnect(), K && cancelAnimationFrame(K), ve(), q(), window.removeEventListener("scroll", J, { capture: !0 }), window.removeEventListener("resize", J);
|
|
6151
6201
|
});
|
|
6152
|
-
function
|
|
6202
|
+
function ge() {
|
|
6153
6203
|
if (!w.value || !D.value) return;
|
|
6154
|
-
let e =
|
|
6155
|
-
G =
|
|
6156
|
-
B = !0,
|
|
6204
|
+
let e = I(w.value), t = Math.max(12, l.focusZoomLevel);
|
|
6205
|
+
G = ae().scaleExtent([1, t]).on("start", () => {
|
|
6206
|
+
B = !0, ot();
|
|
6157
6207
|
}).on("zoom", (e) => {
|
|
6158
6208
|
D.value && D.value.setAttribute("transform", e.transform);
|
|
6159
6209
|
let t = e.transform;
|
|
6160
|
-
|
|
6210
|
+
fe.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
6161
6211
|
}).on("end", () => {
|
|
6162
6212
|
B = !1;
|
|
6163
6213
|
}), G.filter((e) => {
|
|
6164
|
-
let t =
|
|
6214
|
+
let t = Fe.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
|
|
6165
6215
|
if (e.type === "wheel" || e.type === "dblclick") {
|
|
6166
6216
|
if (!n) return !1;
|
|
6167
6217
|
} else if (e.type === "mousedown" || e.type === "touchstart") {
|
|
@@ -6170,11 +6220,11 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6170
6220
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
6171
6221
|
}), e.call(G);
|
|
6172
6222
|
}
|
|
6173
|
-
function
|
|
6174
|
-
w.value && G && (
|
|
6223
|
+
function ve() {
|
|
6224
|
+
w.value && G && (I(w.value).on(".zoom", null), G = null);
|
|
6175
6225
|
}
|
|
6176
|
-
function
|
|
6177
|
-
let t =
|
|
6226
|
+
function Y(e) {
|
|
6227
|
+
let t = Ie.value, n = Me.value, r = [];
|
|
6178
6228
|
for (let i of e) {
|
|
6179
6229
|
let e = i.geoType ?? l.geoType, a = t.get(e);
|
|
6180
6230
|
if (!a) continue;
|
|
@@ -6192,117 +6242,117 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6192
6242
|
}
|
|
6193
6243
|
return r;
|
|
6194
6244
|
}
|
|
6195
|
-
function
|
|
6245
|
+
function ye(e) {
|
|
6196
6246
|
let t = /* @__PURE__ */ new Set();
|
|
6197
|
-
for (let n of
|
|
6247
|
+
for (let n of Y(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
|
|
6198
6248
|
return t;
|
|
6199
6249
|
}
|
|
6200
|
-
let
|
|
6201
|
-
function
|
|
6250
|
+
let X = !1;
|
|
6251
|
+
function Z() {
|
|
6202
6252
|
if (!w.value || !G) return;
|
|
6203
|
-
let e =
|
|
6253
|
+
let e = Y(Fe.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
|
|
6204
6254
|
for (let e of t) {
|
|
6205
6255
|
let t = N.get(String(e.feature.id));
|
|
6206
6256
|
t && r.set(t, e.item.style ?? "solid");
|
|
6207
6257
|
}
|
|
6208
|
-
for (let [e] of R) r.has(e) || e === L ||
|
|
6209
|
-
for (let [e, t] of r) R.get(e) === t && e !== L || e !== L &&
|
|
6258
|
+
for (let [e] of R) r.has(e) || e === L || it(e);
|
|
6259
|
+
for (let [e, t] of r) R.get(e) === t && e !== L || e !== L && rt(e, t);
|
|
6210
6260
|
R.clear();
|
|
6211
6261
|
for (let [e, t] of r) R.set(e, t);
|
|
6212
|
-
if (
|
|
6213
|
-
|
|
6262
|
+
if (be(n), e.length === 0) {
|
|
6263
|
+
X = !0, ot();
|
|
6214
6264
|
return;
|
|
6215
6265
|
}
|
|
6216
|
-
let i =
|
|
6266
|
+
let i = I(w.value);
|
|
6217
6267
|
i.interrupt();
|
|
6218
|
-
let a =
|
|
6219
|
-
|
|
6220
|
-
let [[o, s], [c, u]] =
|
|
6268
|
+
let a = X;
|
|
6269
|
+
X = !0;
|
|
6270
|
+
let [[o, s], [c, u]] = Ae.value.bounds({
|
|
6221
6271
|
type: "FeatureCollection",
|
|
6222
6272
|
features: e.map((e) => e.feature)
|
|
6223
|
-
}), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m =
|
|
6273
|
+
}), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = oe.translate(we.value / 2 - p * d, Te.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, g = () => {
|
|
6224
6274
|
if (!M.value || !h) return;
|
|
6225
6275
|
let e = String(h.id), t = N.get(e);
|
|
6226
6276
|
if (!t) return;
|
|
6227
6277
|
let n = t.getBoundingClientRect();
|
|
6228
|
-
|
|
6278
|
+
$e(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
6229
6279
|
};
|
|
6230
|
-
a ? (
|
|
6280
|
+
a ? (tt(), i.transition().duration(fn).call(G.transform, m).on("end", g)) : (G.transform(i, m), g());
|
|
6231
6281
|
}
|
|
6232
|
-
function
|
|
6282
|
+
function be(e) {
|
|
6233
6283
|
let t = k.value;
|
|
6234
6284
|
if (!t) return;
|
|
6235
6285
|
let n = new Set(e.map((e) => e.key));
|
|
6236
6286
|
for (let [e, t] of z) n.has(e) || (t.remove(), z.delete(e));
|
|
6237
|
-
let r =
|
|
6287
|
+
let r = Ae.value, i = je.value + 1.5;
|
|
6238
6288
|
for (let { item: n, feature: a, key: o } of e) {
|
|
6239
6289
|
let e = z.get(o);
|
|
6240
|
-
e || (e = document.createElementNS(
|
|
6290
|
+
e || (e = document.createElementNS(dn, "path"), e.setAttribute("d", r(a) ?? ""), e.setAttribute("fill", "none"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("class", "focus-overlay"), t.appendChild(e), z.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), nt(e, n.style);
|
|
6241
6291
|
}
|
|
6242
6292
|
}
|
|
6243
|
-
function
|
|
6293
|
+
function Q() {
|
|
6244
6294
|
if (!w.value || !G) return;
|
|
6245
|
-
|
|
6246
|
-
let e =
|
|
6247
|
-
e.interrupt(),
|
|
6295
|
+
Fe.value.length > 0 && d("update:focus", null);
|
|
6296
|
+
let e = I(w.value);
|
|
6297
|
+
e.interrupt(), tt(), e.transition().duration(fn).call(G.transform, oe);
|
|
6248
6298
|
}
|
|
6249
6299
|
T(() => l.focusZoomLevel, () => {
|
|
6250
|
-
G && G.scaleExtent([1, Math.max(12, l.focusZoomLevel)]),
|
|
6300
|
+
G && G.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), Z();
|
|
6251
6301
|
});
|
|
6252
|
-
let
|
|
6302
|
+
let Ce = n(() => l.width && l.height ? l.height / l.width : .625), we = n(() => pn), Te = n(() => pn * Ce.value), Ee = n(() => {
|
|
6253
6303
|
let e = x(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
|
|
6254
6304
|
for (let e of t) {
|
|
6255
|
-
let t =
|
|
6305
|
+
let t = Qt[String(e.id).padStart(5, "0")];
|
|
6256
6306
|
t && (n.has(t) || n.set(t, []), n.get(t).push(e));
|
|
6257
6307
|
}
|
|
6258
6308
|
let r = [];
|
|
6259
6309
|
for (let [t, i] of n) r.push({
|
|
6260
6310
|
type: "Feature",
|
|
6261
6311
|
id: t,
|
|
6262
|
-
properties: { name:
|
|
6263
|
-
geometry:
|
|
6312
|
+
properties: { name: $t[t] ?? t },
|
|
6313
|
+
geometry: ce(e, i)
|
|
6264
6314
|
});
|
|
6265
6315
|
return {
|
|
6266
6316
|
type: "FeatureCollection",
|
|
6267
6317
|
features: r
|
|
6268
6318
|
};
|
|
6269
|
-
}),
|
|
6270
|
-
if (l.geoType === "hsas") return
|
|
6319
|
+
}), De = n(() => {
|
|
6320
|
+
if (l.geoType === "hsas") return Ee.value;
|
|
6271
6321
|
if (l.geoType === "counties") {
|
|
6272
6322
|
let e = x(l.topology);
|
|
6273
|
-
return
|
|
6323
|
+
return se(e, e.objects.counties);
|
|
6274
6324
|
}
|
|
6275
6325
|
let e = x(l.topology);
|
|
6276
|
-
return
|
|
6277
|
-
}),
|
|
6326
|
+
return se(e, e.objects.states);
|
|
6327
|
+
}), Oe = n(() => {
|
|
6278
6328
|
if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
|
|
6279
6329
|
let e = x(l.topology);
|
|
6280
|
-
return
|
|
6281
|
-
}),
|
|
6330
|
+
return le(e, e.objects.states, (e, t) => e !== t);
|
|
6331
|
+
}), ke = n(() => ie().fitExtent([[0, 0], [we.value, Te.value]], De.value)), Ae = n(() => F(ke.value)), je = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), Me = n(() => {
|
|
6282
6332
|
let e = /* @__PURE__ */ new Map();
|
|
6283
|
-
for (let [t, n] of
|
|
6333
|
+
for (let [t, n] of Ie.value) {
|
|
6284
6334
|
let r = /* @__PURE__ */ new Map();
|
|
6285
6335
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
6286
6336
|
e.set(t, r);
|
|
6287
6337
|
}
|
|
6288
6338
|
return e;
|
|
6289
6339
|
});
|
|
6290
|
-
function
|
|
6340
|
+
function Ne(e) {
|
|
6291
6341
|
let t = l.dataGeoType;
|
|
6292
6342
|
if (!t || t === l.geoType) return e;
|
|
6293
|
-
if (l.geoType === "counties" && t === "hsas") return
|
|
6343
|
+
if (l.geoType === "counties" && t === "hsas") return Qt[e];
|
|
6294
6344
|
if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
6295
6345
|
}
|
|
6296
|
-
let
|
|
6346
|
+
let Pe = n(() => {
|
|
6297
6347
|
let e = /* @__PURE__ */ new Map();
|
|
6298
|
-
for (let t of
|
|
6348
|
+
for (let t of De.value.features) t.id != null && e.set(String(t.id), t);
|
|
6299
6349
|
return e;
|
|
6300
|
-
}),
|
|
6350
|
+
}), Fe = n(() => {
|
|
6301
6351
|
let e = l.focus;
|
|
6302
6352
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
6303
|
-
}),
|
|
6353
|
+
}), Ie = n(() => {
|
|
6304
6354
|
let e = /* @__PURE__ */ new Map();
|
|
6305
|
-
e.set(l.geoType,
|
|
6355
|
+
e.set(l.geoType, Pe.value);
|
|
6306
6356
|
let t = x(l.topology), n = t?.objects;
|
|
6307
6357
|
if (!n) return e;
|
|
6308
6358
|
let r = (e) => {
|
|
@@ -6311,25 +6361,25 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6311
6361
|
return t;
|
|
6312
6362
|
};
|
|
6313
6363
|
if (!e.has("states") && n.states) {
|
|
6314
|
-
let i =
|
|
6364
|
+
let i = se(t, n.states);
|
|
6315
6365
|
e.set("states", r(i.features));
|
|
6316
6366
|
}
|
|
6317
6367
|
if (!e.has("counties") && n.counties) {
|
|
6318
|
-
let i =
|
|
6368
|
+
let i = se(t, n.counties);
|
|
6319
6369
|
e.set("counties", r(i.features));
|
|
6320
6370
|
}
|
|
6321
|
-
return !e.has("hsas") && n.counties && e.set("hsas", r(
|
|
6322
|
-
}),
|
|
6371
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(Ee.value.features)), e;
|
|
6372
|
+
}), Le = n(() => {
|
|
6323
6373
|
let e = /* @__PURE__ */ new Map();
|
|
6324
6374
|
if (!l.data) return e;
|
|
6325
|
-
let t = l.dataGeoType ?? l.geoType, n =
|
|
6375
|
+
let t = l.dataGeoType ?? l.geoType, n = Me.value.get(t);
|
|
6326
6376
|
for (let t of l.data) {
|
|
6327
6377
|
e.set(t.id, t.value);
|
|
6328
6378
|
let r = n?.get(t.id);
|
|
6329
6379
|
r && e.set(r, t.value);
|
|
6330
6380
|
}
|
|
6331
6381
|
return e;
|
|
6332
|
-
}),
|
|
6382
|
+
}), Re = n(() => {
|
|
6333
6383
|
if (!l.data || l.data.length === 0) return {
|
|
6334
6384
|
min: 0,
|
|
6335
6385
|
max: 1
|
|
@@ -6346,8 +6396,8 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6346
6396
|
min: 0,
|
|
6347
6397
|
max: 1
|
|
6348
6398
|
};
|
|
6349
|
-
}),
|
|
6350
|
-
function
|
|
6399
|
+
}), ze = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), $ = n(() => Array.isArray(l.colorScale) && !ze.value), Be = n(() => $.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Ve = n(() => $.value ? "" : l.colorScale?.max ?? "#08519c");
|
|
6400
|
+
function He(e) {
|
|
6351
6401
|
let t = e.replace("#", "");
|
|
6352
6402
|
return [
|
|
6353
6403
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -6355,109 +6405,109 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6355
6405
|
parseInt(t.slice(4, 6), 16)
|
|
6356
6406
|
];
|
|
6357
6407
|
}
|
|
6358
|
-
function
|
|
6359
|
-
let [t, n, r] =
|
|
6408
|
+
function Ue(e) {
|
|
6409
|
+
let [t, n, r] = He(Be.value), [i, a, o] = He(Ve.value);
|
|
6360
6410
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
6361
6411
|
}
|
|
6362
|
-
let
|
|
6363
|
-
if (!
|
|
6412
|
+
let We = n(() => $.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), Ge = n(() => {
|
|
6413
|
+
if (!ze.value) return null;
|
|
6364
6414
|
let e = /* @__PURE__ */ new Map();
|
|
6365
6415
|
for (let t of l.colorScale) e.set(t.value, t.color);
|
|
6366
6416
|
return e;
|
|
6367
6417
|
});
|
|
6368
|
-
function Ge(e) {
|
|
6369
|
-
let t = je(e);
|
|
6370
|
-
return t == null ? void 0 : Fe.value.get(t);
|
|
6371
|
-
}
|
|
6372
6418
|
function Ke(e) {
|
|
6373
|
-
let t =
|
|
6419
|
+
let t = Ne(e);
|
|
6420
|
+
return t == null ? void 0 : Le.value.get(t);
|
|
6421
|
+
}
|
|
6422
|
+
function qe(e) {
|
|
6423
|
+
let t = Ke(e), n = l.noDataColor;
|
|
6374
6424
|
if (t == null) return n;
|
|
6375
|
-
let r =
|
|
6425
|
+
let r = Ge.value;
|
|
6376
6426
|
if (r) return r.get(String(t)) ?? n;
|
|
6377
|
-
let i =
|
|
6427
|
+
let i = We.value;
|
|
6378
6428
|
if (i) {
|
|
6379
6429
|
let e = t;
|
|
6380
6430
|
for (let t of i) if (e >= t.min) return t.color;
|
|
6381
6431
|
return n;
|
|
6382
6432
|
}
|
|
6383
|
-
let { min: a, max: o } =
|
|
6384
|
-
return
|
|
6433
|
+
let { min: a, max: o } = Re.value;
|
|
6434
|
+
return Ue((t - a) / (o - a));
|
|
6385
6435
|
}
|
|
6386
|
-
let
|
|
6387
|
-
function
|
|
6388
|
-
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat ? l.tooltipValueFormat
|
|
6436
|
+
let Je = (e) => e.properties?.name ?? String(e.id);
|
|
6437
|
+
function Ye(e) {
|
|
6438
|
+
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat !== void 0 ? ne(e, l.tooltipValueFormat) : String(e);
|
|
6389
6439
|
}
|
|
6390
|
-
function
|
|
6391
|
-
return t == null ? e : `${e}: ${
|
|
6440
|
+
function Xe(e, t) {
|
|
6441
|
+
return t == null ? e : `${e}: ${Ye(t)}`;
|
|
6392
6442
|
}
|
|
6393
|
-
function
|
|
6443
|
+
function Ze() {
|
|
6394
6444
|
let e = A.value?.getEl();
|
|
6395
6445
|
if (!e) return;
|
|
6396
|
-
|
|
6446
|
+
de?.disconnect();
|
|
6397
6447
|
let t = !1;
|
|
6398
|
-
|
|
6448
|
+
de = new ResizeObserver((e) => {
|
|
6399
6449
|
let n = e[0]?.contentRect;
|
|
6400
|
-
n && (
|
|
6401
|
-
}),
|
|
6450
|
+
n && (H.width = n.width, H.height = n.height, !t && W && U ? (t = !0, Qe(U.x, U.y)) : t = !0);
|
|
6451
|
+
}), de.observe(e);
|
|
6402
6452
|
}
|
|
6403
|
-
function
|
|
6453
|
+
function Qe(e, t) {
|
|
6404
6454
|
let n = A.value?.getEl();
|
|
6405
6455
|
if (!n) return;
|
|
6406
|
-
let r = S.value?.getBoundingClientRect(), { left: i, top: a } =
|
|
6456
|
+
let r = S.value?.getBoundingClientRect(), { left: i, top: a } = _e(e, t, H.width, H.height, l.tooltipClamp, r);
|
|
6407
6457
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
6408
6458
|
}
|
|
6409
|
-
function
|
|
6459
|
+
function $e(e, t, n) {
|
|
6410
6460
|
let r = P.get(e);
|
|
6411
6461
|
if (!r) return;
|
|
6412
6462
|
let i = A.value, a = i?.getEl();
|
|
6413
6463
|
!i || !a || (i.setData(r), U = {
|
|
6414
6464
|
x: t,
|
|
6415
6465
|
y: n
|
|
6416
|
-
}, W = !0,
|
|
6466
|
+
}, W = !0, Qe(t, n), a.style.visibility = "visible");
|
|
6417
6467
|
}
|
|
6418
|
-
function
|
|
6419
|
-
W && (
|
|
6420
|
-
|
|
6468
|
+
function et(e, t) {
|
|
6469
|
+
W && (pe = e, me = t, !K && (K = requestAnimationFrame(() => {
|
|
6470
|
+
K = 0;
|
|
6421
6471
|
let e = A.value?.getEl();
|
|
6422
6472
|
!e || !W || (U = {
|
|
6423
|
-
x:
|
|
6424
|
-
y:
|
|
6425
|
-
}, e.style.transform = `translate3d(${
|
|
6473
|
+
x: pe,
|
|
6474
|
+
y: me
|
|
6475
|
+
}, e.style.transform = `translate3d(${pe + 16}px, ${me}px, 0) translateY(-50%)`);
|
|
6426
6476
|
})));
|
|
6427
6477
|
}
|
|
6428
|
-
function
|
|
6478
|
+
function tt() {
|
|
6429
6479
|
if (!W) return;
|
|
6430
6480
|
W = !1, U = null;
|
|
6431
6481
|
let e = A.value?.getEl();
|
|
6432
6482
|
e && (e.style.visibility = "hidden");
|
|
6433
6483
|
}
|
|
6434
|
-
function
|
|
6484
|
+
function nt(e, t) {
|
|
6435
6485
|
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"));
|
|
6436
6486
|
}
|
|
6437
|
-
function
|
|
6438
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
6439
|
-
}
|
|
6440
|
-
function rt(e) {
|
|
6441
|
-
e.setAttribute("stroke-width", String(ke.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
6487
|
+
function rt(e, t = "solid") {
|
|
6488
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(je.value + 1)), e.setAttribute("stroke", "#555"), nt(e, t);
|
|
6442
6489
|
}
|
|
6443
6490
|
function it(e) {
|
|
6444
|
-
|
|
6491
|
+
e.setAttribute("stroke-width", String(je.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
6492
|
+
}
|
|
6493
|
+
function at(e) {
|
|
6494
|
+
L !== e && (L && !R.has(L) && it(L), L = e, rt(e, R.get(e) ?? "solid"));
|
|
6445
6495
|
}
|
|
6446
|
-
function
|
|
6496
|
+
function ot() {
|
|
6447
6497
|
if (L) {
|
|
6448
6498
|
let e = R.get(L);
|
|
6449
|
-
e == null ?
|
|
6499
|
+
e == null ? it(L) : rt(L, e), L = null, d("stateHover", null);
|
|
6450
6500
|
}
|
|
6451
|
-
|
|
6501
|
+
tt();
|
|
6452
6502
|
}
|
|
6453
|
-
function
|
|
6503
|
+
function st(e) {
|
|
6454
6504
|
let t = e;
|
|
6455
6505
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
6456
6506
|
return t ? t.dataset.featId ?? null : null;
|
|
6457
6507
|
}
|
|
6458
|
-
function
|
|
6508
|
+
function ct(e) {
|
|
6459
6509
|
if (B) return;
|
|
6460
|
-
let t = e, n =
|
|
6510
|
+
let t = e, n = st(t.target);
|
|
6461
6511
|
if (!n) return;
|
|
6462
6512
|
let r = P.get(n);
|
|
6463
6513
|
if (!r) return;
|
|
@@ -6466,31 +6516,31 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6466
6516
|
name: r.name,
|
|
6467
6517
|
value: r.value
|
|
6468
6518
|
};
|
|
6469
|
-
e.type === "click" ? (d("stateClick", i), d("update:focus",
|
|
6470
|
-
}
|
|
6471
|
-
function ct(e) {
|
|
6472
|
-
B || $e(e.clientX, e.clientY);
|
|
6519
|
+
e.type === "click" ? (d("stateClick", i), d("update:focus", ye(Fe.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (at(N.get(n)), M.value && $e(n, t.clientX, t.clientY), d("stateHover", i));
|
|
6473
6520
|
}
|
|
6474
6521
|
function lt(e) {
|
|
6475
|
-
|
|
6476
|
-
t && D.value?.contains(t) || at();
|
|
6522
|
+
B || et(e.clientX, e.clientY);
|
|
6477
6523
|
}
|
|
6478
6524
|
function ut(e) {
|
|
6479
|
-
let t =
|
|
6525
|
+
let t = e.relatedTarget;
|
|
6526
|
+
t && D.value?.contains(t) || ot();
|
|
6527
|
+
}
|
|
6528
|
+
function dt(e) {
|
|
6529
|
+
let t = document.createElementNS(dn, "path");
|
|
6480
6530
|
return e && t.setAttribute("d", e), t;
|
|
6481
6531
|
}
|
|
6482
|
-
function
|
|
6532
|
+
function ft() {
|
|
6483
6533
|
let e = O.value, t = k.value;
|
|
6484
6534
|
if (!e || !t) return;
|
|
6485
6535
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
6486
6536
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
6487
|
-
N.clear(), P.clear(),
|
|
6488
|
-
let n =
|
|
6537
|
+
N.clear(), P.clear(), re = null, L = null, R.clear(), z.clear();
|
|
6538
|
+
let n = Ae.value, r = De.value.features, i = l.strokeColor, a = String(je.value), o = !M.value, s = document.createDocumentFragment();
|
|
6489
6539
|
for (let e of r) {
|
|
6490
|
-
let t = String(e.id), r =
|
|
6491
|
-
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill",
|
|
6492
|
-
let e = document.createElementNS(
|
|
6493
|
-
e.textContent =
|
|
6540
|
+
let t = String(e.id), r = Je(e), c = Ke(t), l = dt(n(e));
|
|
6541
|
+
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", qe(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
|
|
6542
|
+
let e = document.createElementNS(dn, "title");
|
|
6543
|
+
e.textContent = Xe(r, c), l.appendChild(e);
|
|
6494
6544
|
}
|
|
6495
6545
|
s.appendChild(l), N.set(t, l), P.set(t, {
|
|
6496
6546
|
id: t,
|
|
@@ -6499,111 +6549,111 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6499
6549
|
feature: e
|
|
6500
6550
|
});
|
|
6501
6551
|
}
|
|
6502
|
-
let c =
|
|
6552
|
+
let c = Oe.value;
|
|
6503
6553
|
if (c) {
|
|
6504
|
-
let e =
|
|
6505
|
-
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e),
|
|
6554
|
+
let e = dt(n(c));
|
|
6555
|
+
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e), re = e;
|
|
6506
6556
|
}
|
|
6507
6557
|
e.appendChild(s);
|
|
6508
6558
|
}
|
|
6509
|
-
function
|
|
6559
|
+
function pt() {
|
|
6510
6560
|
let e = !M.value;
|
|
6511
6561
|
for (let [t, n] of N) {
|
|
6512
|
-
let r =
|
|
6513
|
-
if (n.setAttribute("fill",
|
|
6562
|
+
let r = Ke(t), i = P.get(t);
|
|
6563
|
+
if (n.setAttribute("fill", qe(t)), i && (i.value = r), e && i) {
|
|
6514
6564
|
let e = n.firstElementChild;
|
|
6515
|
-
e && (e.textContent =
|
|
6565
|
+
e && (e.textContent = Xe(i.name, r));
|
|
6516
6566
|
}
|
|
6517
6567
|
}
|
|
6518
6568
|
}
|
|
6519
|
-
function pt() {
|
|
6520
|
-
for (let e of N.values()) e === L || R.has(e) || rt(e);
|
|
6521
|
-
ne && ne.setAttribute("stroke", l.strokeColor);
|
|
6522
|
-
}
|
|
6523
6569
|
function mt() {
|
|
6570
|
+
for (let e of N.values()) e === L || R.has(e) || it(e);
|
|
6571
|
+
re && re.setAttribute("stroke", l.strokeColor);
|
|
6572
|
+
}
|
|
6573
|
+
function ht() {
|
|
6524
6574
|
return typeof l.menu == "string" ? l.menu : "choropleth";
|
|
6525
6575
|
}
|
|
6526
|
-
let
|
|
6576
|
+
let gt = n(() => l.legend && (ze.value || $.value || l.data)), _t = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), vt = n(() => {
|
|
6527
6577
|
let e = [];
|
|
6528
6578
|
for (let t = 0; t <= 10; t++) {
|
|
6529
6579
|
let n = t / 10;
|
|
6530
6580
|
e.push({
|
|
6531
6581
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
6532
|
-
color:
|
|
6582
|
+
color: Ue(n)
|
|
6533
6583
|
});
|
|
6534
6584
|
}
|
|
6535
6585
|
return e;
|
|
6536
|
-
}),
|
|
6586
|
+
}), yt = new Intl.NumberFormat("en-US", {
|
|
6537
6587
|
notation: "compact",
|
|
6538
6588
|
maximumFractionDigits: 1
|
|
6539
|
-
}),
|
|
6540
|
-
let { min: e, max: t } =
|
|
6589
|
+
}), bt = n(() => {
|
|
6590
|
+
let { min: e, max: t } = Re.value, n = t - e, r = [];
|
|
6541
6591
|
for (let t = 1; t <= 3; t++) {
|
|
6542
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
6592
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? yt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
6543
6593
|
r.push({
|
|
6544
6594
|
value: o,
|
|
6545
6595
|
pct: i * 100
|
|
6546
6596
|
});
|
|
6547
6597
|
}
|
|
6548
6598
|
return r;
|
|
6549
|
-
}),
|
|
6599
|
+
}), xt = n(() => {
|
|
6550
6600
|
let e = [];
|
|
6551
|
-
if (
|
|
6601
|
+
if (ze.value) for (let t of l.colorScale) e.push({
|
|
6552
6602
|
key: t.value,
|
|
6553
6603
|
color: t.color,
|
|
6554
6604
|
label: t.value
|
|
6555
6605
|
});
|
|
6556
|
-
else if (
|
|
6606
|
+
else if ($.value) for (let t of _t.value) e.push({
|
|
6557
6607
|
key: String(t.min),
|
|
6558
6608
|
color: t.color,
|
|
6559
6609
|
label: t.label ?? String(t.min)
|
|
6560
6610
|
});
|
|
6561
6611
|
return e;
|
|
6562
|
-
}),
|
|
6563
|
-
let e =
|
|
6612
|
+
}), St = n(() => `linear-gradient(to right, ${vt.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), Ct = n(() => {
|
|
6613
|
+
let e = ht();
|
|
6564
6614
|
return [{
|
|
6565
6615
|
label: "Save as SVG",
|
|
6566
6616
|
action: () => {
|
|
6567
|
-
w.value &&
|
|
6617
|
+
w.value && xe(w.value, e);
|
|
6568
6618
|
}
|
|
6569
6619
|
}, {
|
|
6570
6620
|
label: "Save as PNG",
|
|
6571
6621
|
action: () => {
|
|
6572
|
-
w.value &&
|
|
6622
|
+
w.value && Se(w.value, e);
|
|
6573
6623
|
}
|
|
6574
6624
|
}];
|
|
6575
6625
|
});
|
|
6576
|
-
return T(() => [
|
|
6577
|
-
|
|
6626
|
+
return T(() => [Ae.value, M.value], () => ft()), T(() => [
|
|
6627
|
+
Le.value,
|
|
6578
6628
|
l.colorScale,
|
|
6579
6629
|
l.noDataColor,
|
|
6580
6630
|
l.dataGeoType
|
|
6581
|
-
], () =>
|
|
6631
|
+
], () => pt()), T(() => [l.strokeColor, je.value], () => mt()), T(() => [Fe.value, Ae.value], () => Z(), { flush: "post" }), (n, c) => (_(), a("div", {
|
|
6582
6632
|
ref_key: "containerRef",
|
|
6583
6633
|
ref: S,
|
|
6584
6634
|
class: f(["choropleth-wrapper", { pannable: t.pan }])
|
|
6585
6635
|
}, [
|
|
6586
|
-
t.menu ? (_(), r(
|
|
6636
|
+
t.menu ? (_(), r(ue, {
|
|
6587
6637
|
key: 0,
|
|
6588
|
-
items:
|
|
6638
|
+
items: Ct.value
|
|
6589
6639
|
}, null, 8, ["items"])) : i("", !0),
|
|
6590
|
-
t.title ||
|
|
6640
|
+
t.title || gt.value ? (_(), a("div", nn, [t.title ? (_(), a("div", rn, b(t.title), 1)) : i("", !0), gt.value ? (_(), a("div", an, [t.legendTitle ? (_(), a("span", on, b(t.legendTitle), 1)) : i("", !0), ze.value || $.value ? (_(!0), a(e, { key: 1 }, y(xt.value, (e) => (_(), a("span", {
|
|
6591
6641
|
key: e.key,
|
|
6592
6642
|
class: "choropleth-legend-item"
|
|
6593
6643
|
}, [o("span", {
|
|
6594
6644
|
class: "choropleth-legend-swatch",
|
|
6595
6645
|
style: m({ background: e.color })
|
|
6596
|
-
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div",
|
|
6646
|
+
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", sn, [o("div", {
|
|
6597
6647
|
class: "choropleth-legend-gradient",
|
|
6598
|
-
style: m({ background:
|
|
6599
|
-
}, null, 4), o("div",
|
|
6648
|
+
style: m({ background: St.value })
|
|
6649
|
+
}, null, 4), o("div", cn, [(_(!0), a(e, null, y(bt.value, (e) => (_(), a("span", {
|
|
6600
6650
|
key: e.value,
|
|
6601
6651
|
style: m({ left: e.pct + "%" })
|
|
6602
6652
|
}, b(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
|
|
6603
6653
|
(_(), a("svg", {
|
|
6604
6654
|
ref_key: "svgRef",
|
|
6605
6655
|
ref: w,
|
|
6606
|
-
viewBox: `0 0 ${
|
|
6656
|
+
viewBox: `0 0 ${we.value} ${Te.value}`,
|
|
6607
6657
|
preserveAspectRatio: "xMidYMid meet"
|
|
6608
6658
|
}, [o("g", {
|
|
6609
6659
|
ref_key: "mapGroupRef",
|
|
@@ -6614,15 +6664,15 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6614
6664
|
}, null, 512), o("g", {
|
|
6615
6665
|
ref_key: "overlayGroupRef",
|
|
6616
6666
|
ref: k
|
|
6617
|
-
}, null, 512)], 512)], 8,
|
|
6618
|
-
|
|
6667
|
+
}, null, 512)], 512)], 8, ln)),
|
|
6668
|
+
fe.value ? (_(), a("button", {
|
|
6619
6669
|
key: 2,
|
|
6620
6670
|
type: "button",
|
|
6621
6671
|
class: "choropleth-reset",
|
|
6622
6672
|
"aria-label": "Reset zoom",
|
|
6623
|
-
onClick:
|
|
6673
|
+
onClick: Q
|
|
6624
6674
|
}, " Reset ")) : i("", !0),
|
|
6625
|
-
M.value ? (_(), r(
|
|
6675
|
+
M.value ? (_(), r(tn, {
|
|
6626
6676
|
key: 3,
|
|
6627
6677
|
ref_key: "tooltipChildRef",
|
|
6628
6678
|
ref: A
|
|
@@ -6630,12 +6680,12 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6630
6680
|
default: E((r) => [ee(n.$slots, "tooltip", p(u(te(r))), () => [t.tooltipFormat ? (_(), a("span", {
|
|
6631
6681
|
key: 0,
|
|
6632
6682
|
innerHTML: t.tooltipFormat(r)
|
|
6633
|
-
}, null, 8,
|
|
6683
|
+
}, null, 8, un)) : r.value == null ? (_(), a(e, { key: 1 }, [s(b(r.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(r.name) + ": " + b(Ye(r.value)), 1)], 64))], !0)]),
|
|
6634
6684
|
_: 3
|
|
6635
6685
|
}, 512)) : i("", !0)
|
|
6636
6686
|
], 2));
|
|
6637
6687
|
}
|
|
6638
|
-
}), [["__scopeId", "data-v-
|
|
6688
|
+
}), [["__scopeId", "data-v-a53cf9ce"]]), hn = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
6639
6689
|
__name: "ChartTooltip",
|
|
6640
6690
|
props: {
|
|
6641
6691
|
x: {},
|
|
@@ -6655,7 +6705,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6655
6705
|
top: `${e.y}px`,
|
|
6656
6706
|
transform: "translateY(-50%)"
|
|
6657
6707
|
})
|
|
6658
|
-
}, [ee(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(S(
|
|
6708
|
+
}, [ee(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(S(re), {
|
|
6659
6709
|
key: 1,
|
|
6660
6710
|
open: e.open
|
|
6661
6711
|
}, {
|
|
@@ -6686,7 +6736,7 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6686
6736
|
_: 3
|
|
6687
6737
|
}, 8, ["open"])) : i("", !0);
|
|
6688
6738
|
}
|
|
6689
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
6739
|
+
}), [["__scopeId", "data-v-44377f70"]]), gn = { class: "TableWrapper" }, _n = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
6690
6740
|
__name: "DataTable",
|
|
6691
6741
|
props: {
|
|
6692
6742
|
data: {},
|
|
@@ -6751,7 +6801,13 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6751
6801
|
});
|
|
6752
6802
|
function v(e, t) {
|
|
6753
6803
|
let n = e.values[t];
|
|
6754
|
-
|
|
6804
|
+
if (n == null) return "";
|
|
6805
|
+
let r = c.columnConfig?.[e.name]?.format;
|
|
6806
|
+
if (r !== void 0) {
|
|
6807
|
+
if (typeof r == "function") return r(n, t);
|
|
6808
|
+
if (typeof n == "number") return ne(n, r);
|
|
6809
|
+
}
|
|
6810
|
+
return e.enumLabels && typeof n == "number" ? e.enumLabels[n] ?? String(n) : typeof n == "number" ? Number.isInteger(n) ? n.toString() : n.toFixed(4) : typeof n == "boolean" ? n ? "true" : "false" : String(n);
|
|
6755
6811
|
}
|
|
6756
6812
|
function ee() {
|
|
6757
6813
|
return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
|
|
@@ -6771,16 +6827,16 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6771
6827
|
}
|
|
6772
6828
|
let S = n(() => [{
|
|
6773
6829
|
label: c.downloadMenuLink,
|
|
6774
|
-
action: () =>
|
|
6830
|
+
action: () => Q(x(), ee())
|
|
6775
6831
|
}]), C = n(() => !!c.menu);
|
|
6776
6832
|
return (n, s) => (_(), a("div", { class: f(["TableOuter", {
|
|
6777
6833
|
"full-width": t.fullWidth,
|
|
6778
6834
|
"has-menu": C.value
|
|
6779
|
-
}]) }, [C.value ? (_(), r(
|
|
6835
|
+
}]) }, [C.value ? (_(), r(ue, {
|
|
6780
6836
|
key: 0,
|
|
6781
6837
|
items: S.value,
|
|
6782
6838
|
"force-dropdown": ""
|
|
6783
|
-
}, null, 8, ["items"])) : i("", !0), o("div",
|
|
6839
|
+
}, null, 8, ["items"])) : i("", !0), o("div", gn, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
|
|
6784
6840
|
o("colgroup", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("col", {
|
|
6785
6841
|
key: e.name,
|
|
6786
6842
|
style: m(u(e.name))
|
|
@@ -6796,6 +6852,6 @@ var We = ["width", "height"], Ge = ["x"], Ke = { key: 1 }, qe = [
|
|
|
6796
6852
|
}, b(v(e, n - 1)), 7))), 128))]))), 128))])
|
|
6797
6853
|
], 2)])], 2));
|
|
6798
6854
|
}
|
|
6799
|
-
}), [["__scopeId", "data-v-
|
|
6855
|
+
}), [["__scopeId", "data-v-d6b3bce8"]]);
|
|
6800
6856
|
//#endregion
|
|
6801
|
-
export {
|
|
6857
|
+
export { Zt as BarChart, hn as ChartTooltip, mn as ChoroplethMap, _n as DataTable, At as LineChart, Qt as fipsToHsa, $t as hsaNames };
|