@cfasim-ui/charts 0.4.6 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarChart/BarChart.d.ts +17 -2
- package/dist/ChartMenu/download.d.ts +5 -0
- package/dist/ChartMenu/download.test.d.ts +1 -0
- 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/ChartAnnotations.d.ts +1 -1
- 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 +678 -587
- 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,35 +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
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
317
|
+
var ye = [
|
|
318
|
+
"color",
|
|
319
|
+
"font-family",
|
|
320
|
+
"font-size",
|
|
321
|
+
"font-weight"
|
|
322
|
+
], X = ["fill", "stroke"];
|
|
323
|
+
function Z(e) {
|
|
324
|
+
let t = e.match(/^\s*var\(\s*(--[\w-]+)\s*(?:,\s*([^)]*?)\s*)?\)\s*$/);
|
|
325
|
+
if (!t) return e;
|
|
326
|
+
let [, n, r] = t;
|
|
327
|
+
return window.getComputedStyle(document.documentElement).getPropertyValue(n).trim() || (r ? r.trim() : e);
|
|
291
328
|
}
|
|
292
|
-
function
|
|
293
|
-
let
|
|
294
|
-
|
|
295
|
-
let
|
|
329
|
+
function be(e) {
|
|
330
|
+
let t = e.cloneNode(!0);
|
|
331
|
+
t.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
332
|
+
let n = window.getComputedStyle(e), r = [];
|
|
333
|
+
for (let e of ye) {
|
|
334
|
+
let t = n.getPropertyValue(e);
|
|
335
|
+
t && r.push(`${e}: ${t}`);
|
|
336
|
+
}
|
|
337
|
+
let i = t.getAttribute("style") ?? "";
|
|
338
|
+
t.setAttribute("style", [i, ...r].filter(Boolean).join("; "));
|
|
339
|
+
for (let e of t.querySelectorAll("*")) for (let t of X) {
|
|
340
|
+
let n = e.getAttribute(t);
|
|
341
|
+
!n || !n.includes("var(") || e.setAttribute(t, Z(n));
|
|
342
|
+
}
|
|
343
|
+
return t;
|
|
344
|
+
}
|
|
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`);
|
|
348
|
+
}
|
|
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;
|
|
296
351
|
o.onload = () => {
|
|
297
352
|
let e = document.createElement("canvas");
|
|
298
353
|
e.width = s * 2, e.height = c * 2;
|
|
299
354
|
let n = e.getContext("2d");
|
|
300
355
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
301
|
-
e &&
|
|
356
|
+
e && Y(e, `${t}.png`);
|
|
302
357
|
}), URL.revokeObjectURL(a);
|
|
303
358
|
}, o.src = a;
|
|
304
359
|
}
|
|
305
|
-
function
|
|
306
|
-
|
|
360
|
+
function Q(e, t) {
|
|
361
|
+
Y(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
307
362
|
}
|
|
308
363
|
//#endregion
|
|
309
364
|
//#region src/_shared/useChartMenu.ts
|
|
310
|
-
function
|
|
365
|
+
function Ce(e) {
|
|
311
366
|
let t = v(null);
|
|
312
367
|
function r() {
|
|
313
368
|
let t = e.filename();
|
|
@@ -321,17 +376,17 @@ function he(e) {
|
|
|
321
376
|
let n = r(), i = [{
|
|
322
377
|
label: "Save as SVG",
|
|
323
378
|
action: () => {
|
|
324
|
-
t.value &&
|
|
379
|
+
t.value && xe(t.value, n);
|
|
325
380
|
}
|
|
326
381
|
}, {
|
|
327
382
|
label: "Save as PNG",
|
|
328
383
|
action: () => {
|
|
329
|
-
t.value &&
|
|
384
|
+
t.value && Se(t.value, n);
|
|
330
385
|
}
|
|
331
386
|
}];
|
|
332
387
|
return e.downloadLink() || i.push({
|
|
333
388
|
label: "Download CSV",
|
|
334
|
-
action: () =>
|
|
389
|
+
action: () => Q(e.getCsv(), n)
|
|
335
390
|
}), i;
|
|
336
391
|
}),
|
|
337
392
|
downloadLinkText: n(() => {
|
|
@@ -344,7 +399,7 @@ function he(e) {
|
|
|
344
399
|
}
|
|
345
400
|
//#endregion
|
|
346
401
|
//#region src/_shared/seriesCsv.ts
|
|
347
|
-
function
|
|
402
|
+
function we(e) {
|
|
348
403
|
if (e.length === 0) return "";
|
|
349
404
|
let t = 0;
|
|
350
405
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -356,25 +411,25 @@ function ge(e) {
|
|
|
356
411
|
}
|
|
357
412
|
return i.join("\n");
|
|
358
413
|
}
|
|
359
|
-
function
|
|
414
|
+
function Te(e, t, n = "category") {
|
|
360
415
|
if (t.length === 0 || e.length === 0) return "";
|
|
361
416
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
362
417
|
for (let n = 0; n < e.length; n++) {
|
|
363
|
-
let i = [
|
|
418
|
+
let i = [Ee(e[n])];
|
|
364
419
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
365
420
|
r.push(i.join(","));
|
|
366
421
|
}
|
|
367
422
|
return r.join("\n");
|
|
368
423
|
}
|
|
369
|
-
function
|
|
424
|
+
function Ee(e) {
|
|
370
425
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
371
426
|
}
|
|
372
427
|
//#endregion
|
|
373
428
|
//#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
|
|
374
|
-
var
|
|
429
|
+
var De = {
|
|
375
430
|
class: "chart-annotations",
|
|
376
431
|
"pointer-events": "none"
|
|
377
|
-
},
|
|
432
|
+
}, Oe = [
|
|
378
433
|
"x1",
|
|
379
434
|
"y1",
|
|
380
435
|
"x2",
|
|
@@ -382,13 +437,12 @@ var ve = {
|
|
|
382
437
|
"stroke",
|
|
383
438
|
"stroke-width",
|
|
384
439
|
"stroke-dasharray"
|
|
385
|
-
],
|
|
440
|
+
], ke = [
|
|
386
441
|
"d",
|
|
387
442
|
"stroke",
|
|
388
443
|
"stroke-width",
|
|
389
|
-
"stroke-dasharray"
|
|
390
|
-
|
|
391
|
-
], xe = [
|
|
444
|
+
"stroke-dasharray"
|
|
445
|
+
], Ae = ["fill", "transform"], je = [
|
|
392
446
|
"x",
|
|
393
447
|
"y",
|
|
394
448
|
"text-anchor",
|
|
@@ -397,7 +451,7 @@ var ve = {
|
|
|
397
451
|
"fill",
|
|
398
452
|
"stroke",
|
|
399
453
|
"stroke-width"
|
|
400
|
-
],
|
|
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({
|
|
401
455
|
__name: "ChartAnnotations",
|
|
402
456
|
props: {
|
|
403
457
|
annotations: { default: () => [] },
|
|
@@ -434,13 +488,18 @@ var ve = {
|
|
|
434
488
|
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
435
489
|
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
436
490
|
if (a && !r.bounds) continue;
|
|
437
|
-
let { x: o, y: l } = t.offset, f = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ??
|
|
438
|
-
a && r.bounds
|
|
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);
|
|
492
|
+
if (a && r.bounds) x = u(i, n.x, n.y, r.bounds);
|
|
493
|
+
else {
|
|
494
|
+
let e = d(n.x, n.y, f, p, h, i);
|
|
495
|
+
S = e.path, w && e.arrow && (C = e.arrow);
|
|
496
|
+
}
|
|
497
|
+
e.push({
|
|
439
498
|
lines: t.text.split("\n").map(c),
|
|
440
499
|
textX: f,
|
|
441
500
|
textY: p,
|
|
442
501
|
textAnchor: te,
|
|
443
|
-
dy: h *
|
|
502
|
+
dy: h * Ve,
|
|
444
503
|
fontSize: h,
|
|
445
504
|
fontWeight: g,
|
|
446
505
|
color: m,
|
|
@@ -450,7 +509,8 @@ var ve = {
|
|
|
450
509
|
lineColor: y,
|
|
451
510
|
lineWidth: ee,
|
|
452
511
|
lineDash: b,
|
|
453
|
-
arrow:
|
|
512
|
+
arrow: w,
|
|
513
|
+
arrowTip: C,
|
|
454
514
|
rule: x
|
|
455
515
|
});
|
|
456
516
|
}
|
|
@@ -503,32 +563,34 @@ var ve = {
|
|
|
503
563
|
}
|
|
504
564
|
}
|
|
505
565
|
function d(e, t, n, r, i, a) {
|
|
506
|
-
if (a === "none") return "";
|
|
507
|
-
let o = n - e, s = r - t, c = r - i *
|
|
566
|
+
if (a === "none") return { path: "" };
|
|
567
|
+
let o = n - e, s = r - t, c = r - i * He;
|
|
508
568
|
if (o === 0 || s === 0 || a === "straight") {
|
|
509
569
|
let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
|
|
510
|
-
if (l <=
|
|
511
|
-
let u = a / l, d = o / l;
|
|
512
|
-
return
|
|
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;
|
|
572
|
+
return {
|
|
573
|
+
path: `M${f},${p} L${m},${h}`,
|
|
574
|
+
arrow: {
|
|
575
|
+
x: f,
|
|
576
|
+
y: p,
|
|
577
|
+
angle: g
|
|
578
|
+
}
|
|
579
|
+
};
|
|
513
580
|
}
|
|
514
581
|
let l = c - t;
|
|
515
|
-
if (Math.abs(l) <=
|
|
516
|
-
let u = Math.sign(o), d = Math.sign(l), f = e + u *
|
|
517
|
-
return
|
|
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;
|
|
584
|
+
return {
|
|
585
|
+
path: `M${f},${p} Q${f},${c} ${m},${h}`,
|
|
586
|
+
arrow: {
|
|
587
|
+
x: f,
|
|
588
|
+
y: p,
|
|
589
|
+
angle: g
|
|
590
|
+
}
|
|
591
|
+
};
|
|
518
592
|
}
|
|
519
|
-
return (t, n) => (_(), a(
|
|
520
|
-
id: "chart-annotation-arrow",
|
|
521
|
-
viewBox: "0 0 8 8",
|
|
522
|
-
refX: "7",
|
|
523
|
-
refY: "4",
|
|
524
|
-
markerWidth: "6",
|
|
525
|
-
markerHeight: "6",
|
|
526
|
-
orient: "auto-start-reverse",
|
|
527
|
-
markerUnits: "userSpaceOnUse"
|
|
528
|
-
}, [o("path", {
|
|
529
|
-
d: "M0,0 L8,4 L0,8 Z",
|
|
530
|
-
fill: "context-stroke"
|
|
531
|
-
})])], -1), o("g", ve, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
593
|
+
return (t, n) => (_(), a("g", De, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
532
594
|
t.rule ? (_(), a("line", {
|
|
533
595
|
key: 0,
|
|
534
596
|
x1: t.rule.x1,
|
|
@@ -539,18 +601,22 @@ var ve = {
|
|
|
539
601
|
"stroke-width": t.lineWidth,
|
|
540
602
|
"stroke-dasharray": t.lineDash,
|
|
541
603
|
"stroke-linecap": "round"
|
|
542
|
-
}, null, 8,
|
|
604
|
+
}, null, 8, Oe)) : i("", !0),
|
|
543
605
|
t.pointerPath ? (_(), a("path", {
|
|
544
606
|
key: 1,
|
|
545
607
|
d: t.pointerPath,
|
|
546
608
|
fill: "none",
|
|
547
609
|
stroke: t.lineColor,
|
|
548
|
-
style: m({ color: t.lineColor }),
|
|
549
610
|
"stroke-width": t.lineWidth,
|
|
550
611
|
"stroke-dasharray": t.lineDash,
|
|
551
|
-
"stroke-linecap": "round"
|
|
552
|
-
|
|
553
|
-
|
|
612
|
+
"stroke-linecap": "round"
|
|
613
|
+
}, null, 8, ke)) : i("", !0),
|
|
614
|
+
t.arrowTip ? (_(), a("polygon", {
|
|
615
|
+
key: 2,
|
|
616
|
+
points: "0,0 -6,-3 -6,3",
|
|
617
|
+
fill: t.lineColor,
|
|
618
|
+
transform: `translate(${t.arrowTip.x} ${t.arrowTip.y}) rotate(${t.arrowTip.angle})`
|
|
619
|
+
}, null, 8, Ae)) : i("", !0),
|
|
554
620
|
o("text", {
|
|
555
621
|
x: t.textX,
|
|
556
622
|
y: t.textY,
|
|
@@ -568,14 +634,14 @@ var ve = {
|
|
|
568
634
|
dy: r === 0 ? 0 : t.dy
|
|
569
635
|
}, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
|
|
570
636
|
key: t,
|
|
571
|
-
"font-weight": e.bold ?
|
|
637
|
+
"font-weight": e.bold ? Ie : void 0,
|
|
572
638
|
"font-style": e.italic ? "italic" : void 0
|
|
573
|
-
}, b(e.text), 9,
|
|
574
|
-
], 64))), 128))])
|
|
639
|
+
}, b(e.text), 9, Ne))), 128))], 8, Me))), 128))], 8, je)
|
|
640
|
+
], 64))), 128))]));
|
|
575
641
|
}
|
|
576
|
-
}),
|
|
577
|
-
function
|
|
578
|
-
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({
|
|
579
645
|
title: e.title,
|
|
580
646
|
xLabel: e.xLabel,
|
|
581
647
|
yLabel: e.yLabel,
|
|
@@ -583,14 +649,14 @@ function Re(e) {
|
|
|
583
649
|
width: () => i.value,
|
|
584
650
|
height: () => a.value,
|
|
585
651
|
extraPadding: e.chartPadding
|
|
586
|
-
}), { hoverIndex: d, tooltipRef: f, tooltipPos: p, handlers: m } =
|
|
652
|
+
}), { hoverIndex: d, tooltipRef: f, tooltipPos: p, handlers: m } = ve({
|
|
587
653
|
enabled: e.hasTooltipSlot,
|
|
588
654
|
trigger: e.tooltipTrigger,
|
|
589
655
|
clamp: () => e.tooltipClamp() ?? "chart",
|
|
590
656
|
pointerToIndex: e.pointerToIndex,
|
|
591
657
|
containerRef: t,
|
|
592
658
|
onHover: e.onHover
|
|
593
|
-
}), { svgRef: h, items: g, downloadLinkText: _, csvHref: v, resolvedFilename: y } =
|
|
659
|
+
}), { svgRef: h, items: g, downloadLinkText: _, csvHref: v, resolvedFilename: y } = Ce({
|
|
594
660
|
filename: e.filename,
|
|
595
661
|
legacyMenuLabel: e.menu,
|
|
596
662
|
getCsv: e.getCsv,
|
|
@@ -616,80 +682,80 @@ function Re(e) {
|
|
|
616
682
|
menuFilename: y
|
|
617
683
|
};
|
|
618
684
|
}
|
|
619
|
-
function
|
|
685
|
+
function qe(e, t) {
|
|
620
686
|
return (n) => {
|
|
621
687
|
let r = e();
|
|
622
|
-
if (r) return
|
|
688
|
+
if (r !== void 0) return ne(n, r);
|
|
623
689
|
let i = t();
|
|
624
|
-
return i ?
|
|
690
|
+
return i === void 0 ? W(n) : ne(n, i);
|
|
625
691
|
};
|
|
626
692
|
}
|
|
627
693
|
//#endregion
|
|
628
694
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
629
|
-
var
|
|
695
|
+
var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
630
696
|
"x1",
|
|
631
697
|
"y1",
|
|
632
698
|
"x2",
|
|
633
699
|
"y2",
|
|
634
700
|
"stroke",
|
|
635
701
|
"stroke-dasharray"
|
|
636
|
-
],
|
|
702
|
+
], Qe = [
|
|
637
703
|
"cx",
|
|
638
704
|
"cy",
|
|
639
705
|
"fill",
|
|
640
706
|
"fill-opacity",
|
|
641
707
|
"stroke"
|
|
642
|
-
],
|
|
708
|
+
], $e = ["x", "y"], et = [
|
|
643
709
|
"x1",
|
|
644
710
|
"y1",
|
|
645
711
|
"x2",
|
|
646
712
|
"y2"
|
|
647
|
-
],
|
|
713
|
+
], tt = [
|
|
648
714
|
"x1",
|
|
649
715
|
"y1",
|
|
650
716
|
"x2",
|
|
651
717
|
"y2"
|
|
652
|
-
],
|
|
718
|
+
], nt = [
|
|
653
719
|
"x1",
|
|
654
720
|
"y1",
|
|
655
721
|
"x2",
|
|
656
722
|
"y2"
|
|
657
|
-
],
|
|
723
|
+
], rt = [
|
|
658
724
|
"x1",
|
|
659
725
|
"y1",
|
|
660
726
|
"x2",
|
|
661
727
|
"y2"
|
|
662
|
-
],
|
|
728
|
+
], it = ["x", "y"], at = ["transform"], ot = [
|
|
663
729
|
"x",
|
|
664
730
|
"y",
|
|
665
731
|
"text-anchor"
|
|
666
|
-
],
|
|
732
|
+
], st = ["x", "y"], ct = [
|
|
667
733
|
"d",
|
|
668
734
|
"fill",
|
|
669
735
|
"fill-opacity"
|
|
670
|
-
],
|
|
736
|
+
], lt = [
|
|
671
737
|
"d",
|
|
672
738
|
"stroke",
|
|
673
739
|
"stroke-width",
|
|
674
740
|
"stroke-opacity",
|
|
675
741
|
"stroke-dasharray"
|
|
676
|
-
],
|
|
742
|
+
], ut = [
|
|
677
743
|
"cx",
|
|
678
744
|
"cy",
|
|
679
745
|
"r",
|
|
680
746
|
"fill",
|
|
681
747
|
"fill-opacity",
|
|
682
748
|
"stroke"
|
|
683
|
-
],
|
|
749
|
+
], dt = [
|
|
684
750
|
"d",
|
|
685
751
|
"fill",
|
|
686
752
|
"fill-opacity"
|
|
687
|
-
],
|
|
753
|
+
], ft = [
|
|
688
754
|
"d",
|
|
689
755
|
"stroke",
|
|
690
756
|
"stroke-width",
|
|
691
757
|
"stroke-dasharray"
|
|
692
|
-
],
|
|
758
|
+
], pt = [
|
|
693
759
|
"x1",
|
|
694
760
|
"y1",
|
|
695
761
|
"x2",
|
|
@@ -697,7 +763,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
697
763
|
"stroke",
|
|
698
764
|
"stroke-width",
|
|
699
765
|
"stroke-dasharray"
|
|
700
|
-
],
|
|
766
|
+
], mt = [
|
|
701
767
|
"x1",
|
|
702
768
|
"y1",
|
|
703
769
|
"x2",
|
|
@@ -705,44 +771,44 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
705
771
|
"stroke",
|
|
706
772
|
"stroke-width",
|
|
707
773
|
"stroke-dasharray"
|
|
708
|
-
],
|
|
774
|
+
], ht = [
|
|
709
775
|
"x1",
|
|
710
776
|
"y1",
|
|
711
777
|
"x2",
|
|
712
778
|
"y2"
|
|
713
|
-
],
|
|
779
|
+
], gt = [
|
|
714
780
|
"x1",
|
|
715
781
|
"y1",
|
|
716
782
|
"x2",
|
|
717
783
|
"y2"
|
|
718
|
-
],
|
|
784
|
+
], _t = [
|
|
719
785
|
"x1",
|
|
720
786
|
"y1",
|
|
721
787
|
"x2",
|
|
722
788
|
"y2"
|
|
723
|
-
],
|
|
789
|
+
], vt = [
|
|
724
790
|
"cx",
|
|
725
791
|
"cy",
|
|
726
792
|
"fill"
|
|
727
|
-
],
|
|
793
|
+
], yt = [
|
|
728
794
|
"x",
|
|
729
795
|
"y",
|
|
730
796
|
"width",
|
|
731
797
|
"height"
|
|
732
|
-
],
|
|
798
|
+
], bt = [
|
|
733
799
|
"cx",
|
|
734
800
|
"cy",
|
|
735
801
|
"fill",
|
|
736
802
|
"fill-opacity",
|
|
737
803
|
"stroke"
|
|
738
|
-
],
|
|
804
|
+
], xt = [
|
|
739
805
|
"x",
|
|
740
806
|
"y",
|
|
741
807
|
"fill"
|
|
742
|
-
],
|
|
808
|
+
], St = ["x", "y"], Ct = { class: "line-chart-tooltip" }, wt = {
|
|
743
809
|
key: 0,
|
|
744
810
|
class: "line-chart-tooltip-label"
|
|
745
|
-
},
|
|
811
|
+
}, Tt = ["href", "download"], Et = 36, Dt = 12, Ot = 7, kt = 16, At = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
746
812
|
__name: "LineChart",
|
|
747
813
|
props: {
|
|
748
814
|
y: {},
|
|
@@ -753,6 +819,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
753
819
|
areaSections: {},
|
|
754
820
|
lineOpacity: { default: 1 },
|
|
755
821
|
yMin: {},
|
|
822
|
+
yScaleType: { default: "linear" },
|
|
756
823
|
xMin: {},
|
|
757
824
|
xTicks: {},
|
|
758
825
|
yTicks: {},
|
|
@@ -790,7 +857,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
790
857
|
data: e.y ?? e.data ?? g
|
|
791
858
|
};
|
|
792
859
|
}
|
|
793
|
-
let x =
|
|
860
|
+
let x = qe(() => l.tooltipValueFormat, () => l.yTickFormat), C = n(() => {
|
|
794
861
|
if (l.series && l.series.length > 0) return l.series.map(v);
|
|
795
862
|
let e = l.y ?? l.data;
|
|
796
863
|
return e ? [{
|
|
@@ -832,94 +899,103 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
832
899
|
});
|
|
833
900
|
function j(e) {
|
|
834
901
|
let { min: t, max: n } = A.value, r = n - t || 1;
|
|
835
|
-
return Y.value.left + (e - t) / r *
|
|
902
|
+
return Y.value.left + (e - t) / r * X.value;
|
|
836
903
|
}
|
|
837
904
|
let M = n(() => {
|
|
838
|
-
let e = Infinity, t = -Infinity
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
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);
|
|
843
912
|
}
|
|
844
|
-
|
|
845
|
-
min: e,
|
|
846
|
-
max: t,
|
|
847
|
-
range: t - e || 1
|
|
848
|
-
}) : {
|
|
913
|
+
if (!isFinite(e)) return {
|
|
849
914
|
min: 0,
|
|
850
915
|
max: 0,
|
|
851
916
|
range: 1
|
|
852
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
|
+
};
|
|
853
925
|
});
|
|
854
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) {
|
|
855
931
|
let t = e.data;
|
|
856
932
|
if (t.length === 0) return "";
|
|
857
|
-
let
|
|
858
|
-
for (let
|
|
859
|
-
let
|
|
860
|
-
if (!isFinite(t[
|
|
861
|
-
|
|
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;
|
|
862
938
|
continue;
|
|
863
939
|
}
|
|
864
|
-
let
|
|
865
|
-
|
|
940
|
+
let o = j(a), s = N(t[i]);
|
|
941
|
+
n += r ? `L${o},${s}` : `M${o},${s}`, r = !0;
|
|
866
942
|
}
|
|
867
|
-
return
|
|
943
|
+
return n;
|
|
868
944
|
}
|
|
869
|
-
function
|
|
870
|
-
let t = e.data,
|
|
945
|
+
function re(e) {
|
|
946
|
+
let t = e.data, n = [];
|
|
871
947
|
for (let r = 0; r < t.length; r++) {
|
|
872
|
-
let
|
|
873
|
-
!isFinite(t[r]) || !isFinite(
|
|
874
|
-
x: j(
|
|
875
|
-
y:
|
|
948
|
+
let i = D(e, r);
|
|
949
|
+
!isFinite(t[r]) || !isFinite(i) || n.push({
|
|
950
|
+
x: j(i),
|
|
951
|
+
y: N(t[r])
|
|
876
952
|
});
|
|
877
953
|
}
|
|
878
|
-
return
|
|
954
|
+
return n;
|
|
879
955
|
}
|
|
880
|
-
function
|
|
956
|
+
function ie(e) {
|
|
881
957
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
882
958
|
if (t === 0) return "";
|
|
883
|
-
let
|
|
884
|
-
for (let
|
|
885
|
-
|
|
886
|
-
let
|
|
887
|
-
for (let t of
|
|
888
|
-
|
|
889
|
-
for (let n = 1; n < t.length; n++)
|
|
890
|
-
for (let n = t.length - 1; n >= 0; n--)
|
|
891
|
-
|
|
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";
|
|
892
968
|
}
|
|
893
|
-
return
|
|
969
|
+
return i;
|
|
894
970
|
}
|
|
895
971
|
function F(e, t) {
|
|
896
972
|
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && C.value[e.seriesIndex] || C.value[0];
|
|
897
973
|
return j(r ? D(r, n) : n);
|
|
898
974
|
}
|
|
899
|
-
function
|
|
900
|
-
let n = Y.value.top +
|
|
975
|
+
function ae(e, t = !0) {
|
|
976
|
+
let n = Y.value.top + Z.value;
|
|
901
977
|
if (e.seriesIndex == null) {
|
|
902
978
|
let t = F(e, "start"), r = F(e, "end");
|
|
903
979
|
return t > r ? "" : `M${t},${Y.value.top}L${r},${Y.value.top}L${r},${n}L${t},${n}Z`;
|
|
904
980
|
}
|
|
905
981
|
let r = C.value[e.seriesIndex];
|
|
906
982
|
if (!r) return "";
|
|
907
|
-
let
|
|
908
|
-
if (
|
|
909
|
-
let
|
|
910
|
-
for (let e =
|
|
911
|
-
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;
|
|
912
988
|
}
|
|
913
|
-
let
|
|
989
|
+
let oe = n(() => {
|
|
914
990
|
let e = l.areaSections;
|
|
915
991
|
if (!e?.length) return {
|
|
916
992
|
labels: [],
|
|
917
993
|
extraHeight: 0
|
|
918
994
|
};
|
|
919
|
-
let t = [], n = Y.value.left +
|
|
995
|
+
let t = [], n = Y.value.left + X.value;
|
|
920
996
|
for (let r of e) {
|
|
921
997
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
922
|
-
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");
|
|
923
999
|
t.push({
|
|
924
1000
|
cx: c,
|
|
925
1001
|
labelText: e,
|
|
@@ -934,7 +1010,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
934
1010
|
let r = [];
|
|
935
1011
|
for (let e of t) {
|
|
936
1012
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
937
|
-
for (; n < r.length && !(t >= r[n] +
|
|
1013
|
+
for (; n < r.length && !(t >= r[n] + kt);) n++;
|
|
938
1014
|
e.row = n;
|
|
939
1015
|
let i = e.cx + e.textWidth / 2;
|
|
940
1016
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -944,9 +1020,9 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
944
1020
|
extraHeight: 0
|
|
945
1021
|
} : {
|
|
946
1022
|
labels: t,
|
|
947
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
1023
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Et + Dt
|
|
948
1024
|
};
|
|
949
|
-
}),
|
|
1025
|
+
}), I = n(() => {
|
|
950
1026
|
let e = [];
|
|
951
1027
|
for (let t of C.value) t.legend && e.push({
|
|
952
1028
|
label: t.legend,
|
|
@@ -966,39 +1042,43 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
966
1042
|
});
|
|
967
1043
|
}
|
|
968
1044
|
return e;
|
|
969
|
-
}),
|
|
970
|
-
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);
|
|
971
1047
|
return e === t ? [{
|
|
972
|
-
value:
|
|
973
|
-
y: V(Y.value.top +
|
|
974
|
-
}] :
|
|
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({
|
|
975
1055
|
min: e,
|
|
976
1056
|
max: t,
|
|
977
1057
|
ticks: l.yTicks,
|
|
978
|
-
targetTickCount:
|
|
979
|
-
}).map((e) => ({
|
|
980
|
-
value:
|
|
981
|
-
y:
|
|
1058
|
+
targetTickCount: Z.value / 50
|
|
1059
|
+
})).map((e) => ({
|
|
1060
|
+
value: n(e),
|
|
1061
|
+
y: V(N(e))
|
|
982
1062
|
}));
|
|
983
|
-
}),
|
|
1063
|
+
}), L = n(() => {
|
|
984
1064
|
let { min: e, max: t } = A.value;
|
|
985
1065
|
if (e === t) return [];
|
|
986
1066
|
let n = k.value, r = T.value, i = (e, t) => {
|
|
987
|
-
let r = e + n;
|
|
988
|
-
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);
|
|
989
1069
|
}, a;
|
|
990
1070
|
if (l.xTicks == null && !E.value && l.xLabels && l.xLabels.length === r) {
|
|
991
|
-
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));
|
|
992
1072
|
a = [];
|
|
993
1073
|
for (let e = 0; e < r; e += t) a.push(e);
|
|
994
1074
|
} else a = G({
|
|
995
1075
|
min: e,
|
|
996
1076
|
max: t,
|
|
997
1077
|
ticks: l.xTicks,
|
|
998
|
-
targetTickCount:
|
|
1078
|
+
targetTickCount: X.value / 80,
|
|
999
1079
|
displayOffset: n
|
|
1000
1080
|
});
|
|
1001
|
-
let o = Y.value.left, s = Y.value.left +
|
|
1081
|
+
let o = Y.value.left, s = Y.value.left + X.value;
|
|
1002
1082
|
return a.map((e, t) => {
|
|
1003
1083
|
let n = V(j(e)), r = "middle";
|
|
1004
1084
|
return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
|
|
@@ -1008,13 +1088,13 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1008
1088
|
};
|
|
1009
1089
|
});
|
|
1010
1090
|
});
|
|
1011
|
-
function
|
|
1012
|
-
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);
|
|
1013
1093
|
}
|
|
1014
|
-
let
|
|
1015
|
-
let e =
|
|
1094
|
+
let z = n(() => !!l.tooltipData || !!l.tooltipTrigger), B = n(() => {
|
|
1095
|
+
let e = xe.value, t = C.value[0];
|
|
1016
1096
|
return e === null || !t ? null : D(t, e);
|
|
1017
|
-
}),
|
|
1097
|
+
}), de = n(() => B.value === null ? 0 : j(B.value));
|
|
1018
1098
|
function H(e, t) {
|
|
1019
1099
|
let n = e.data.length;
|
|
1020
1100
|
if (n === 0) return null;
|
|
@@ -1027,26 +1107,26 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1027
1107
|
}
|
|
1028
1108
|
return i === Infinity ? null : r;
|
|
1029
1109
|
}
|
|
1030
|
-
let
|
|
1031
|
-
let e =
|
|
1110
|
+
let U = n(() => {
|
|
1111
|
+
let e = B.value;
|
|
1032
1112
|
if (e === null) return [];
|
|
1033
|
-
let
|
|
1113
|
+
let t = [];
|
|
1034
1114
|
for (let n of C.value) {
|
|
1035
|
-
let
|
|
1036
|
-
if (
|
|
1037
|
-
let
|
|
1038
|
-
isFinite(
|
|
1039
|
-
x: j(D(n,
|
|
1040
|
-
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),
|
|
1041
1121
|
color: n.color ?? "currentColor"
|
|
1042
1122
|
});
|
|
1043
1123
|
}
|
|
1044
|
-
return
|
|
1045
|
-
}),
|
|
1046
|
-
let e =
|
|
1124
|
+
return t;
|
|
1125
|
+
}), K = n(() => {
|
|
1126
|
+
let e = xe.value, t = B.value;
|
|
1047
1127
|
if (e === null || t === null) return null;
|
|
1048
|
-
let n = t + k.value, r;
|
|
1049
|
-
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), {
|
|
1050
1130
|
index: e,
|
|
1051
1131
|
xLabel: r,
|
|
1052
1132
|
values: C.value.map((e, n) => {
|
|
@@ -1060,23 +1140,21 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1060
1140
|
data: l.tooltipData?.[e] ?? null
|
|
1061
1141
|
};
|
|
1062
1142
|
});
|
|
1063
|
-
function
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
x: j(n),
|
|
1068
|
-
y: a
|
|
1143
|
+
function he(e, t) {
|
|
1144
|
+
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1145
|
+
x: j(e - k.value),
|
|
1146
|
+
y: N(t)
|
|
1069
1147
|
};
|
|
1070
1148
|
}
|
|
1071
|
-
function
|
|
1072
|
-
let t =
|
|
1149
|
+
function q(e) {
|
|
1150
|
+
let t = J.value?.getBoundingClientRect();
|
|
1073
1151
|
if (!t) return null;
|
|
1074
1152
|
let n = C.value[0];
|
|
1075
1153
|
if (!n || n.data.length === 0) return null;
|
|
1076
1154
|
let { min: r, max: i } = A.value, a = i - r || 1;
|
|
1077
|
-
return H(n, r + (e - t.left - Y.value.left) /
|
|
1155
|
+
return H(n, r + (e - t.left - Y.value.left) / X.value * a);
|
|
1078
1156
|
}
|
|
1079
|
-
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({
|
|
1080
1158
|
width: () => l.width,
|
|
1081
1159
|
height: () => l.height,
|
|
1082
1160
|
title: () => l.title,
|
|
@@ -1090,94 +1168,94 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1090
1168
|
downloadLink: () => l.downloadLink,
|
|
1091
1169
|
chartPadding: () => l.chartPadding,
|
|
1092
1170
|
hasInlineLegend: () => h.value,
|
|
1093
|
-
hasTooltipSlot: () =>
|
|
1094
|
-
getCsv:
|
|
1095
|
-
pointerToIndex:
|
|
1171
|
+
hasTooltipSlot: () => z.value,
|
|
1172
|
+
getCsv: R,
|
|
1173
|
+
pointerToIndex: q,
|
|
1096
1174
|
onHover: (e) => f("hover", e)
|
|
1097
1175
|
});
|
|
1098
1176
|
return (n, c) => (_(), a("div", {
|
|
1099
1177
|
ref_key: "containerRef",
|
|
1100
|
-
ref:
|
|
1178
|
+
ref: J,
|
|
1101
1179
|
class: "line-chart-wrapper"
|
|
1102
1180
|
}, [
|
|
1103
|
-
t.menu ? (_(), r(
|
|
1181
|
+
t.menu ? (_(), r(ue, {
|
|
1104
1182
|
key: 0,
|
|
1105
|
-
items: S(
|
|
1183
|
+
items: S(Te)
|
|
1106
1184
|
}, null, 8, ["items"])) : i("", !0),
|
|
1107
1185
|
(_(), a("svg", {
|
|
1108
1186
|
ref_key: "svgRef",
|
|
1109
|
-
ref:
|
|
1110
|
-
width: S(
|
|
1111
|
-
height:
|
|
1187
|
+
ref: ge,
|
|
1188
|
+
width: S(_e),
|
|
1189
|
+
height: se.value
|
|
1112
1190
|
}, [
|
|
1113
1191
|
t.title ? (_(), a("text", {
|
|
1114
1192
|
key: 0,
|
|
1115
|
-
x: S(
|
|
1193
|
+
x: S(_e) / 2,
|
|
1116
1194
|
y: 18,
|
|
1117
1195
|
"text-anchor": "middle",
|
|
1118
1196
|
"font-size": "14",
|
|
1119
1197
|
"font-weight": "600",
|
|
1120
1198
|
fill: "currentColor"
|
|
1121
|
-
}, b(t.title), 9,
|
|
1122
|
-
|
|
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", {
|
|
1123
1201
|
key: 0,
|
|
1124
1202
|
x1: S(Y).left + n * 120,
|
|
1125
|
-
y1: S(
|
|
1203
|
+
y1: S(ye),
|
|
1126
1204
|
x2: S(Y).left + n * 120 + 12,
|
|
1127
|
-
y2: S(
|
|
1205
|
+
y2: S(ye),
|
|
1128
1206
|
stroke: t.color,
|
|
1129
1207
|
"stroke-width": "2",
|
|
1130
1208
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
1131
|
-
}, null, 8,
|
|
1209
|
+
}, null, 8, Ze)) : (_(), a("circle", {
|
|
1132
1210
|
key: 1,
|
|
1133
1211
|
cx: S(Y).left + n * 120 + 4,
|
|
1134
|
-
cy: S(
|
|
1212
|
+
cy: S(ye),
|
|
1135
1213
|
r: "4",
|
|
1136
1214
|
fill: t.color,
|
|
1137
1215
|
"fill-opacity": t.fillOpacity,
|
|
1138
1216
|
stroke: t.color,
|
|
1139
1217
|
"stroke-width": "1.5"
|
|
1140
|
-
}, null, 8,
|
|
1218
|
+
}, null, 8, Qe)), o("text", {
|
|
1141
1219
|
x: S(Y).left + n * 120 + 18,
|
|
1142
|
-
y: S(
|
|
1220
|
+
y: S(ye) + 4,
|
|
1143
1221
|
"font-size": "11",
|
|
1144
1222
|
fill: "currentColor"
|
|
1145
|
-
}, b(t.label), 9,
|
|
1223
|
+
}, b(t.label), 9, $e)], 64))), 128))])) : i("", !0),
|
|
1146
1224
|
o("line", {
|
|
1147
1225
|
x1: S(V)(S(Y).left),
|
|
1148
1226
|
y1: S(V)(S(Y).top),
|
|
1149
1227
|
x2: S(V)(S(Y).left),
|
|
1150
|
-
y2: S(V)(S(Y).top + S(
|
|
1228
|
+
y2: S(V)(S(Y).top + S(Z)),
|
|
1151
1229
|
stroke: "currentColor",
|
|
1152
1230
|
"stroke-opacity": "0.3"
|
|
1153
|
-
}, null, 8,
|
|
1231
|
+
}, null, 8, et),
|
|
1154
1232
|
o("line", {
|
|
1155
1233
|
x1: S(V)(S(Y).left),
|
|
1156
|
-
y1: S(V)(S(Y).top + S(
|
|
1157
|
-
x2: S(V)(S(Y).left + S(
|
|
1158
|
-
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)),
|
|
1159
1237
|
stroke: "currentColor",
|
|
1160
1238
|
"stroke-opacity": "0.3"
|
|
1161
|
-
}, null, 8,
|
|
1162
|
-
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", {
|
|
1163
1241
|
key: "yg" + t,
|
|
1164
1242
|
x1: S(Y).left,
|
|
1165
1243
|
y1: e.y,
|
|
1166
|
-
x2: S(Y).left + S(
|
|
1244
|
+
x2: S(Y).left + S(X),
|
|
1167
1245
|
y2: e.y,
|
|
1168
1246
|
stroke: "currentColor",
|
|
1169
1247
|
"stroke-opacity": "0.1"
|
|
1170
|
-
}, null, 8,
|
|
1171
|
-
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", {
|
|
1172
1250
|
key: "xg" + t,
|
|
1173
1251
|
x1: e.x,
|
|
1174
1252
|
y1: S(Y).top,
|
|
1175
1253
|
x2: e.x,
|
|
1176
|
-
y2: S(Y).top + S(
|
|
1254
|
+
y2: S(Y).top + S(Z),
|
|
1177
1255
|
stroke: "currentColor",
|
|
1178
1256
|
"stroke-opacity": "0.1"
|
|
1179
|
-
}, null, 8,
|
|
1180
|
-
(_(!0), a(e, null, y(
|
|
1257
|
+
}, null, 8, rt))), 128)) : i("", !0),
|
|
1258
|
+
(_(!0), a(e, null, y(le.value, (e, t) => (_(), a("text", {
|
|
1181
1259
|
key: "y" + t,
|
|
1182
1260
|
"data-testid": "y-tick",
|
|
1183
1261
|
x: S(Y).left - 6,
|
|
@@ -1187,50 +1265,50 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1187
1265
|
"font-size": "10",
|
|
1188
1266
|
fill: "currentColor",
|
|
1189
1267
|
"fill-opacity": "0.6"
|
|
1190
|
-
}, b(e.value), 9,
|
|
1268
|
+
}, b(e.value), 9, it))), 128)),
|
|
1191
1269
|
t.yLabel ? (_(), a("text", {
|
|
1192
1270
|
key: 4,
|
|
1193
1271
|
x: 0,
|
|
1194
1272
|
y: 0,
|
|
1195
|
-
transform: `translate(14, ${S(Y).top + S(
|
|
1273
|
+
transform: `translate(14, ${S(Y).top + S(Z) / 2}) rotate(-90)`,
|
|
1196
1274
|
"text-anchor": "middle",
|
|
1197
1275
|
"font-size": "13",
|
|
1198
1276
|
fill: "currentColor"
|
|
1199
|
-
}, b(t.yLabel), 9,
|
|
1200
|
-
(_(!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", {
|
|
1201
1279
|
key: "x" + t,
|
|
1202
1280
|
"data-testid": "x-tick",
|
|
1203
1281
|
x: e.x,
|
|
1204
|
-
y: S(Y).top + S(
|
|
1282
|
+
y: S(Y).top + S(Z) + 16,
|
|
1205
1283
|
"text-anchor": e.anchor,
|
|
1206
1284
|
"font-size": "10",
|
|
1207
1285
|
fill: "currentColor",
|
|
1208
1286
|
"fill-opacity": "0.6"
|
|
1209
|
-
}, b(e.value), 9,
|
|
1287
|
+
}, b(e.value), 9, ot))), 128)),
|
|
1210
1288
|
t.xLabel ? (_(), a("text", {
|
|
1211
1289
|
key: 5,
|
|
1212
|
-
x: S(Y).left + S(
|
|
1213
|
-
y: S(
|
|
1290
|
+
x: S(Y).left + S(X) / 2,
|
|
1291
|
+
y: S(ve) - 4,
|
|
1214
1292
|
"text-anchor": "middle",
|
|
1215
1293
|
"font-size": "13",
|
|
1216
1294
|
fill: "currentColor"
|
|
1217
|
-
}, b(t.xLabel), 9,
|
|
1295
|
+
}, b(t.xLabel), 9, st)) : i("", !0),
|
|
1218
1296
|
(_(!0), a(e, null, y(w.value, (e, t) => (_(), a("path", {
|
|
1219
1297
|
key: "area" + t,
|
|
1220
|
-
d:
|
|
1298
|
+
d: ie(e),
|
|
1221
1299
|
fill: e.color ?? "currentColor",
|
|
1222
1300
|
"fill-opacity": e.opacity ?? .2,
|
|
1223
1301
|
stroke: "none"
|
|
1224
|
-
}, null, 8,
|
|
1302
|
+
}, null, 8, ct))), 128)),
|
|
1225
1303
|
(_(!0), a(e, null, y(C.value, (n, r) => (_(), a(e, { key: r }, [n.line === !1 ? i("", !0) : (_(), a("path", {
|
|
1226
1304
|
key: 0,
|
|
1227
|
-
d:
|
|
1305
|
+
d: P(n),
|
|
1228
1306
|
fill: "none",
|
|
1229
1307
|
stroke: n.color ?? "currentColor",
|
|
1230
1308
|
"stroke-width": n.strokeWidth ?? 1.5,
|
|
1231
1309
|
"stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
|
|
1232
1310
|
"stroke-dasharray": n.dashed ? "6 3" : void 0
|
|
1233
|
-
}, null, 8,
|
|
1311
|
+
}, null, 8, lt)), n.dots ? (_(!0), a(e, { key: 1 }, y(re(n), (e, r) => (_(), a("circle", {
|
|
1234
1312
|
key: r,
|
|
1235
1313
|
cx: e.x,
|
|
1236
1314
|
cy: e.y,
|
|
@@ -1238,68 +1316,68 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1238
1316
|
fill: n.dotFill ?? n.color ?? "currentColor",
|
|
1239
1317
|
"fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
|
|
1240
1318
|
stroke: n.dotStroke ?? "none"
|
|
1241
|
-
}, null, 8,
|
|
1319
|
+
}, null, 8, ut))), 128)) : i("", !0)], 64))), 128)),
|
|
1242
1320
|
(_(!0), a(e, null, y(t.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
1243
1321
|
o("path", {
|
|
1244
|
-
d:
|
|
1322
|
+
d: ae(t),
|
|
1245
1323
|
fill: t.color ?? (t.seriesIndex == null ? "#999" : C.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
1246
1324
|
"fill-opacity": t.opacity ?? .15,
|
|
1247
1325
|
stroke: "none"
|
|
1248
|
-
}, null, 8,
|
|
1326
|
+
}, null, 8, dt),
|
|
1249
1327
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
1250
1328
|
key: 0,
|
|
1251
|
-
d:
|
|
1329
|
+
d: ae(t, !1),
|
|
1252
1330
|
fill: "none",
|
|
1253
1331
|
stroke: t.color ?? C.value[t.seriesIndex]?.color ?? "currentColor",
|
|
1254
1332
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1255
1333
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1256
|
-
}, null, 8,
|
|
1334
|
+
}, null, 8, ft)),
|
|
1257
1335
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
1258
1336
|
x1: S(V)(F(t, "start")),
|
|
1259
1337
|
y1: S(Y).top,
|
|
1260
1338
|
x2: S(V)(F(t, "start")),
|
|
1261
|
-
y2: S(Y).top + S(
|
|
1339
|
+
y2: S(Y).top + S(Z),
|
|
1262
1340
|
stroke: t.color ?? "#999",
|
|
1263
1341
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1264
1342
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1265
|
-
}, null, 8,
|
|
1343
|
+
}, null, 8, pt), o("line", {
|
|
1266
1344
|
x1: S(V)(F(t, "end")),
|
|
1267
1345
|
y1: S(Y).top,
|
|
1268
1346
|
x2: S(V)(F(t, "end")),
|
|
1269
|
-
y2: S(Y).top + S(
|
|
1347
|
+
y2: S(Y).top + S(Z),
|
|
1270
1348
|
stroke: t.color ?? "#999",
|
|
1271
1349
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1272
1350
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1273
|
-
}, null, 8,
|
|
1351
|
+
}, null, 8, mt)], 64)) : i("", !0),
|
|
1274
1352
|
o("line", {
|
|
1275
1353
|
x1: S(V)(F(t, "start")),
|
|
1276
|
-
y1: S(Y).top + S(
|
|
1354
|
+
y1: S(Y).top + S(Z) - 4,
|
|
1277
1355
|
x2: S(V)(F(t, "start")),
|
|
1278
|
-
y2: S(Y).top + S(
|
|
1356
|
+
y2: S(Y).top + S(Z) + 4,
|
|
1279
1357
|
stroke: "currentColor",
|
|
1280
1358
|
"stroke-opacity": "0.4"
|
|
1281
|
-
}, null, 8,
|
|
1359
|
+
}, null, 8, ht),
|
|
1282
1360
|
o("line", {
|
|
1283
1361
|
x1: S(V)(F(t, "end")),
|
|
1284
|
-
y1: S(Y).top + S(
|
|
1362
|
+
y1: S(Y).top + S(Z) - 4,
|
|
1285
1363
|
x2: S(V)(F(t, "end")),
|
|
1286
|
-
y2: S(Y).top + S(
|
|
1364
|
+
y2: S(Y).top + S(Z) + 4,
|
|
1287
1365
|
stroke: "currentColor",
|
|
1288
1366
|
"stroke-opacity": "0.4"
|
|
1289
|
-
}, null, 8,
|
|
1367
|
+
}, null, 8, gt)
|
|
1290
1368
|
], 64))), 128)),
|
|
1291
|
-
|
|
1369
|
+
z.value && S(xe) !== null ? (_(), a("line", {
|
|
1292
1370
|
key: 6,
|
|
1293
|
-
x1: S(V)(
|
|
1371
|
+
x1: S(V)(de.value),
|
|
1294
1372
|
y1: S(Y).top,
|
|
1295
|
-
x2: S(V)(
|
|
1296
|
-
y2: S(Y).top + S(
|
|
1373
|
+
x2: S(V)(de.value),
|
|
1374
|
+
y2: S(Y).top + S(Z),
|
|
1297
1375
|
stroke: "currentColor",
|
|
1298
1376
|
"stroke-opacity": "0.3",
|
|
1299
1377
|
"stroke-dasharray": "4 2",
|
|
1300
1378
|
"pointer-events": "none"
|
|
1301
|
-
}, null, 8,
|
|
1302
|
-
(_(!0), a(e, null, y(
|
|
1379
|
+
}, null, 8, _t)) : i("", !0),
|
|
1380
|
+
(_(!0), a(e, null, y(U.value, (e, t) => (_(), a("circle", {
|
|
1303
1381
|
key: "hd" + t,
|
|
1304
1382
|
cx: e.x,
|
|
1305
1383
|
cy: e.y,
|
|
@@ -1308,110 +1386,110 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1308
1386
|
stroke: "var(--color-bg-0, #fff)",
|
|
1309
1387
|
"stroke-width": "2",
|
|
1310
1388
|
"pointer-events": "none"
|
|
1311
|
-
}, null, 8,
|
|
1312
|
-
|
|
1389
|
+
}, null, 8, vt))), 128)),
|
|
1390
|
+
z.value ? (_(), a("rect", d({
|
|
1313
1391
|
key: 7,
|
|
1314
1392
|
x: S(Y).left,
|
|
1315
1393
|
y: S(Y).top,
|
|
1316
|
-
width: S(
|
|
1317
|
-
height: S(
|
|
1394
|
+
width: S(X),
|
|
1395
|
+
height: S(Z),
|
|
1318
1396
|
fill: "transparent",
|
|
1319
1397
|
style: {
|
|
1320
1398
|
cursor: "crosshair",
|
|
1321
1399
|
"touch-action": "none"
|
|
1322
1400
|
}
|
|
1323
|
-
}, te(S(
|
|
1324
|
-
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), {
|
|
1325
1403
|
key: 8,
|
|
1326
1404
|
annotations: t.annotations,
|
|
1327
|
-
project:
|
|
1328
|
-
bounds: S(
|
|
1405
|
+
project: he,
|
|
1406
|
+
bounds: S(be)
|
|
1329
1407
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
1330
|
-
(_(!0), a(e, null, y(
|
|
1408
|
+
(_(!0), a(e, null, y(oe.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
1331
1409
|
o("circle", {
|
|
1332
1410
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
1333
|
-
cy:
|
|
1411
|
+
cy: ce.value + e.row * Et + 4,
|
|
1334
1412
|
r: "4",
|
|
1335
1413
|
fill: e.color,
|
|
1336
1414
|
"fill-opacity": e.fillOpacity,
|
|
1337
1415
|
stroke: e.color,
|
|
1338
1416
|
"stroke-width": "1.5"
|
|
1339
|
-
}, null, 8,
|
|
1417
|
+
}, null, 8, bt),
|
|
1340
1418
|
e.labelText ? (_(), a("text", {
|
|
1341
1419
|
key: 0,
|
|
1342
1420
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1343
|
-
y:
|
|
1421
|
+
y: ce.value + e.row * Et + 8,
|
|
1344
1422
|
"font-size": "11",
|
|
1345
1423
|
"font-weight": "600",
|
|
1346
1424
|
fill: e.color
|
|
1347
|
-
}, b(e.labelText), 9,
|
|
1425
|
+
}, b(e.labelText), 9, xt)) : i("", !0),
|
|
1348
1426
|
e.descText ? (_(), a("text", {
|
|
1349
1427
|
key: 1,
|
|
1350
1428
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1351
|
-
y:
|
|
1429
|
+
y: ce.value + e.row * Et + 22,
|
|
1352
1430
|
"font-size": "11",
|
|
1353
1431
|
fill: "currentColor",
|
|
1354
1432
|
"fill-opacity": "0.6"
|
|
1355
|
-
}, b(e.descText), 9,
|
|
1433
|
+
}, b(e.descText), 9, St)) : i("", !0)
|
|
1356
1434
|
]))), 128))
|
|
1357
|
-
], 8,
|
|
1358
|
-
|
|
1435
|
+
], 8, Je)),
|
|
1436
|
+
z.value && S(xe) !== null && K.value ? (_(), a("div", {
|
|
1359
1437
|
key: 1,
|
|
1360
1438
|
ref_key: "tooltipRef",
|
|
1361
|
-
ref:
|
|
1439
|
+
ref: Se,
|
|
1362
1440
|
class: "chart-tooltip-content",
|
|
1363
1441
|
style: m({
|
|
1364
1442
|
position: "absolute",
|
|
1365
1443
|
top: "0",
|
|
1366
1444
|
left: "0",
|
|
1367
1445
|
willChange: "transform",
|
|
1368
|
-
transform: S(
|
|
1369
|
-
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"
|
|
1370
1448
|
})
|
|
1371
|
-
}, [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", {
|
|
1372
1450
|
key: e.seriesIndex,
|
|
1373
1451
|
class: "line-chart-tooltip-row"
|
|
1374
1452
|
}, [o("span", {
|
|
1375
1453
|
class: "line-chart-tooltip-swatch",
|
|
1376
1454
|
style: m({ background: e.color })
|
|
1377
1455
|
}, null, 4), s(" " + b(isFinite(e.value) ? S(x)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1378
|
-
S(
|
|
1456
|
+
S(Ee) ? (_(), a("a", {
|
|
1379
1457
|
key: 2,
|
|
1380
1458
|
class: "line-chart-download-link",
|
|
1381
|
-
href: S(
|
|
1382
|
-
download: `${S(
|
|
1383
|
-
}, b(S(
|
|
1459
|
+
href: S(De),
|
|
1460
|
+
download: `${S(Oe)()}.csv`
|
|
1461
|
+
}, b(S(Ee)), 9, Tt)) : i("", !0)
|
|
1384
1462
|
], 512));
|
|
1385
1463
|
}
|
|
1386
|
-
}), [["__scopeId", "data-v-
|
|
1464
|
+
}), [["__scopeId", "data-v-384bab8e"]]), jt = ["width", "height"], Mt = ["x"], Nt = { key: 1 }, Pt = [
|
|
1387
1465
|
"x",
|
|
1388
1466
|
"y",
|
|
1389
1467
|
"fill"
|
|
1390
|
-
],
|
|
1468
|
+
], Ft = ["x", "y"], It = [
|
|
1391
1469
|
"x1",
|
|
1392
1470
|
"y1",
|
|
1393
1471
|
"x2",
|
|
1394
1472
|
"y2"
|
|
1395
|
-
],
|
|
1473
|
+
], Lt = [
|
|
1396
1474
|
"x1",
|
|
1397
1475
|
"y1",
|
|
1398
1476
|
"x2",
|
|
1399
1477
|
"y2"
|
|
1400
|
-
],
|
|
1478
|
+
], Rt = [
|
|
1401
1479
|
"x1",
|
|
1402
1480
|
"y1",
|
|
1403
1481
|
"x2",
|
|
1404
1482
|
"y2"
|
|
1405
|
-
],
|
|
1483
|
+
], zt = [
|
|
1406
1484
|
"x",
|
|
1407
1485
|
"y",
|
|
1408
1486
|
"width",
|
|
1409
1487
|
"height"
|
|
1410
|
-
],
|
|
1488
|
+
], Bt = ["x", "y"], Vt = ["x", "y"], Ht = ["transform"], Ut = [
|
|
1411
1489
|
"x",
|
|
1412
1490
|
"y",
|
|
1413
1491
|
"text-anchor"
|
|
1414
|
-
],
|
|
1492
|
+
], Wt = ["x", "y"], Gt = ["x", "y"], Kt = [
|
|
1415
1493
|
"data-category",
|
|
1416
1494
|
"data-series",
|
|
1417
1495
|
"x",
|
|
@@ -1420,15 +1498,15 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1420
1498
|
"height",
|
|
1421
1499
|
"fill",
|
|
1422
1500
|
"fill-opacity"
|
|
1423
|
-
],
|
|
1501
|
+
], qt = [
|
|
1424
1502
|
"x",
|
|
1425
1503
|
"y",
|
|
1426
1504
|
"width",
|
|
1427
1505
|
"height"
|
|
1428
|
-
],
|
|
1506
|
+
], Jt = { class: "bar-chart-tooltip" }, Yt = {
|
|
1429
1507
|
key: 0,
|
|
1430
1508
|
class: "bar-chart-tooltip-label"
|
|
1431
|
-
},
|
|
1509
|
+
}, Xt = ["href", "download"], Zt = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
1432
1510
|
__name: "BarChart",
|
|
1433
1511
|
props: {
|
|
1434
1512
|
data: {},
|
|
@@ -1438,6 +1516,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1438
1516
|
orientation: { default: "vertical" },
|
|
1439
1517
|
layout: { default: "grouped" },
|
|
1440
1518
|
valueMin: { default: 0 },
|
|
1519
|
+
valueScaleType: { default: "linear" },
|
|
1441
1520
|
valueTicks: {},
|
|
1442
1521
|
valueTickFormat: {},
|
|
1443
1522
|
categoryFormat: {},
|
|
@@ -1491,30 +1570,32 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1491
1570
|
for (let n = 0; n < e; n++) t[n] = l.categories?.[n] ?? String(n);
|
|
1492
1571
|
return t;
|
|
1493
1572
|
}), T = n(() => l.orientation === "vertical"), E = n(() => {
|
|
1494
|
-
let e = Infinity, t = -Infinity
|
|
1573
|
+
let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
|
|
1574
|
+
e > 0 && e < n && (n = e);
|
|
1575
|
+
};
|
|
1495
1576
|
if (l.layout === "stacked") {
|
|
1496
1577
|
let n = C.value;
|
|
1497
|
-
for (let
|
|
1498
|
-
let n = 0,
|
|
1578
|
+
for (let i = 0; i < n; i++) {
|
|
1579
|
+
let n = 0, a = 0;
|
|
1499
1580
|
for (let e of x.value) {
|
|
1500
|
-
if (
|
|
1501
|
-
let t = Number(e.data[
|
|
1502
|
-
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);
|
|
1503
1584
|
}
|
|
1504
|
-
n > t && (t = n),
|
|
1585
|
+
n > t && (t = n), a < e && (e = a);
|
|
1505
1586
|
}
|
|
1506
|
-
} else for (let n of x.value) for (let
|
|
1507
|
-
let n = Number(
|
|
1508
|
-
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));
|
|
1509
1590
|
}
|
|
1510
1591
|
isFinite(e) || (e = 0), isFinite(t) || (t = 0);
|
|
1511
|
-
let
|
|
1512
|
-
|
|
1513
|
-
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);
|
|
1514
1595
|
return {
|
|
1515
|
-
min:
|
|
1516
|
-
max:
|
|
1517
|
-
range:
|
|
1596
|
+
min: a.min,
|
|
1597
|
+
max: a.max,
|
|
1598
|
+
range: a.max - a.min || 1
|
|
1518
1599
|
};
|
|
1519
1600
|
}), D = n(() => T.value ? q.value : J.value), O = n(() => T.value ? J.value : q.value), k = n(() => {
|
|
1520
1601
|
let e = C.value;
|
|
@@ -1534,10 +1615,10 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1534
1615
|
return P(Math.max(e, Math.min(t, n)));
|
|
1535
1616
|
});
|
|
1536
1617
|
function P(e) {
|
|
1537
|
-
let { min: t,
|
|
1538
|
-
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;
|
|
1539
1620
|
}
|
|
1540
|
-
function
|
|
1621
|
+
function re(e, t, n, r, i, a, o, s, c) {
|
|
1541
1622
|
let l = Math.min(e, t), u = Math.abs(e - t);
|
|
1542
1623
|
return T.value ? {
|
|
1543
1624
|
x: n,
|
|
@@ -1561,7 +1642,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1561
1642
|
seriesIndex: c
|
|
1562
1643
|
};
|
|
1563
1644
|
}
|
|
1564
|
-
let
|
|
1645
|
+
let ie = n(() => {
|
|
1565
1646
|
let e = [], t = x.value, n = t.length;
|
|
1566
1647
|
if (n === 0) return e;
|
|
1567
1648
|
let r = C.value, i = k.value, a = A.value, o = j.value, s = (i - a) / 2, c = N.value;
|
|
@@ -1573,17 +1654,17 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1573
1654
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
1574
1655
|
if (!isFinite(l)) continue;
|
|
1575
1656
|
let u = l >= 0 ? o : s, d = u + l;
|
|
1576
|
-
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;
|
|
1577
1658
|
}
|
|
1578
1659
|
} else for (let a = 0; a < n; a++) {
|
|
1579
1660
|
let s = t[a], u = Number(s.data[i] ?? NaN);
|
|
1580
1661
|
if (!isFinite(u)) continue;
|
|
1581
1662
|
let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
|
|
1582
|
-
e.push(
|
|
1663
|
+
e.push(re(c, P(u), d, o, s.color ?? ae(a), s.opacity ?? 1, u, i, a));
|
|
1583
1664
|
}
|
|
1584
1665
|
}
|
|
1585
1666
|
return e;
|
|
1586
|
-
}),
|
|
1667
|
+
}), F = [
|
|
1587
1668
|
"var(--color-primary, #3b82f6)",
|
|
1588
1669
|
"var(--color-accent, #f59e0b)",
|
|
1589
1670
|
"var(--color-success, #10b981)",
|
|
@@ -1591,26 +1672,30 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1591
1672
|
"var(--color-info, #6366f1)",
|
|
1592
1673
|
"var(--color-warning, #d97706)"
|
|
1593
1674
|
];
|
|
1594
|
-
function
|
|
1595
|
-
return
|
|
1675
|
+
function ae(e) {
|
|
1676
|
+
return F[e % F.length];
|
|
1596
1677
|
}
|
|
1597
|
-
let
|
|
1598
|
-
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);
|
|
1599
1680
|
if (e === t) return [{
|
|
1600
1681
|
value: n(e),
|
|
1601
1682
|
pos: V(P(e))
|
|
1602
1683
|
}];
|
|
1603
1684
|
let r = T.value ? 50 : 80;
|
|
1604
|
-
return
|
|
1685
|
+
return (l.valueScaleType === "log" ? me({
|
|
1686
|
+
min: e,
|
|
1687
|
+
max: t,
|
|
1688
|
+
ticks: l.valueTicks
|
|
1689
|
+
}) : G({
|
|
1605
1690
|
min: e,
|
|
1606
1691
|
max: t,
|
|
1607
1692
|
ticks: l.valueTicks,
|
|
1608
1693
|
targetTickCount: O.value / r
|
|
1609
|
-
}).map((e) => ({
|
|
1694
|
+
})).map((e) => ({
|
|
1610
1695
|
value: n(e),
|
|
1611
1696
|
pos: V(P(e))
|
|
1612
1697
|
}));
|
|
1613
|
-
}),
|
|
1698
|
+
}), se = n(() => {
|
|
1614
1699
|
let e = [], t = C.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
|
|
1615
1700
|
for (let r = 0; r < t; r++) {
|
|
1616
1701
|
let t = M(r) + k.value / 2;
|
|
@@ -1621,23 +1706,23 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1621
1706
|
});
|
|
1622
1707
|
}
|
|
1623
1708
|
return e;
|
|
1624
|
-
}),
|
|
1709
|
+
}), ce = n(() => {
|
|
1625
1710
|
let e = [];
|
|
1626
1711
|
return x.value.forEach((t, n) => {
|
|
1627
1712
|
t.legend && e.push({
|
|
1628
1713
|
label: t.legend,
|
|
1629
|
-
color: t.color ??
|
|
1714
|
+
color: t.color ?? ae(n)
|
|
1630
1715
|
});
|
|
1631
1716
|
}), e;
|
|
1632
1717
|
});
|
|
1633
|
-
function
|
|
1718
|
+
function le() {
|
|
1634
1719
|
if (typeof l.csv == "function") return l.csv();
|
|
1635
1720
|
if (typeof l.csv == "string") return l.csv;
|
|
1636
1721
|
let e = x.value.map((e) => ({
|
|
1637
1722
|
label: e.legend,
|
|
1638
1723
|
data: e.data
|
|
1639
1724
|
}));
|
|
1640
|
-
return
|
|
1725
|
+
return Te(w.value, e);
|
|
1641
1726
|
}
|
|
1642
1727
|
let L = n(() => !!l.tooltipData || !!l.tooltipTrigger);
|
|
1643
1728
|
function R(e, t) {
|
|
@@ -1659,7 +1744,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1659
1744
|
let i = T.value ? e - n.left - K.value.left : t - n.top - K.value.top;
|
|
1660
1745
|
return Math.max(0, Math.min(r - 1, Math.floor(i / k.value)));
|
|
1661
1746
|
}
|
|
1662
|
-
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({
|
|
1663
1748
|
width: () => l.width,
|
|
1664
1749
|
height: () => l.height,
|
|
1665
1750
|
title: () => l.title,
|
|
@@ -1674,26 +1759,26 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1674
1759
|
chartPadding: () => l.chartPadding,
|
|
1675
1760
|
hasInlineLegend: () => h.value,
|
|
1676
1761
|
hasTooltipSlot: () => L.value,
|
|
1677
|
-
getCsv:
|
|
1762
|
+
getCsv: le,
|
|
1678
1763
|
pointerToIndex: z,
|
|
1679
1764
|
onHover: (e) => f("hover", e)
|
|
1680
|
-
}),
|
|
1681
|
-
let e =
|
|
1765
|
+
}), Se = n(() => {
|
|
1766
|
+
let e = _e.value;
|
|
1682
1767
|
if (e !== null) return w.value[e];
|
|
1683
|
-
}),
|
|
1684
|
-
let e =
|
|
1768
|
+
}), Q = n(() => {
|
|
1769
|
+
let e = _e.value;
|
|
1685
1770
|
return e === null ? null : {
|
|
1686
1771
|
index: e,
|
|
1687
1772
|
category: w.value[e] ?? String(e),
|
|
1688
1773
|
values: x.value.map((t, n) => ({
|
|
1689
1774
|
value: Number(t.data[e] ?? NaN),
|
|
1690
|
-
color: t.color ??
|
|
1775
|
+
color: t.color ?? ae(n),
|
|
1691
1776
|
seriesIndex: n
|
|
1692
1777
|
})),
|
|
1693
1778
|
data: l.tooltipData?.[e] ?? null
|
|
1694
1779
|
};
|
|
1695
|
-
}),
|
|
1696
|
-
let e =
|
|
1780
|
+
}), Ce = n(() => {
|
|
1781
|
+
let e = _e.value;
|
|
1697
1782
|
if (e === null) return null;
|
|
1698
1783
|
let t = M(e);
|
|
1699
1784
|
return T.value ? {
|
|
@@ -1713,37 +1798,37 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1713
1798
|
ref: B,
|
|
1714
1799
|
class: "bar-chart-wrapper"
|
|
1715
1800
|
}, [
|
|
1716
|
-
t.menu ? (_(), r(
|
|
1801
|
+
t.menu ? (_(), r(ue, {
|
|
1717
1802
|
key: 0,
|
|
1718
|
-
items: S(
|
|
1803
|
+
items: S(X)
|
|
1719
1804
|
}, null, 8, ["items"])) : i("", !0),
|
|
1720
1805
|
(_(), a("svg", {
|
|
1721
1806
|
ref_key: "svgRef",
|
|
1722
|
-
ref:
|
|
1723
|
-
width: S(
|
|
1807
|
+
ref: de,
|
|
1808
|
+
width: S(H),
|
|
1724
1809
|
height: S(U)
|
|
1725
1810
|
}, [
|
|
1726
1811
|
t.title ? (_(), a("text", {
|
|
1727
1812
|
key: 0,
|
|
1728
|
-
x: S(
|
|
1813
|
+
x: S(H) / 2,
|
|
1729
1814
|
y: 18,
|
|
1730
1815
|
"text-anchor": "middle",
|
|
1731
1816
|
"font-size": "14",
|
|
1732
1817
|
"font-weight": "600",
|
|
1733
1818
|
fill: "currentColor"
|
|
1734
|
-
}, b(t.title), 9,
|
|
1735
|
-
|
|
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", {
|
|
1736
1821
|
x: S(K).left + n * 120,
|
|
1737
|
-
y: S(
|
|
1822
|
+
y: S(he) - 5,
|
|
1738
1823
|
width: "12",
|
|
1739
1824
|
height: "10",
|
|
1740
1825
|
fill: t.color
|
|
1741
|
-
}, null, 8,
|
|
1826
|
+
}, null, 8, Pt), o("text", {
|
|
1742
1827
|
x: S(K).left + n * 120 + 18,
|
|
1743
|
-
y: S(
|
|
1828
|
+
y: S(he) + 4,
|
|
1744
1829
|
"font-size": "11",
|
|
1745
1830
|
fill: "currentColor"
|
|
1746
|
-
}, b(t.label), 9,
|
|
1831
|
+
}, b(t.label), 9, Ft)], 64))), 128))])) : i("", !0),
|
|
1747
1832
|
o("line", {
|
|
1748
1833
|
x1: S(V)(S(K).left),
|
|
1749
1834
|
y1: S(V)(S(K).top),
|
|
@@ -1751,7 +1836,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1751
1836
|
y2: S(V)(S(K).top + S(J)),
|
|
1752
1837
|
stroke: "currentColor",
|
|
1753
1838
|
"stroke-opacity": "0.3"
|
|
1754
|
-
}, null, 8,
|
|
1839
|
+
}, null, 8, It),
|
|
1755
1840
|
o("line", {
|
|
1756
1841
|
x1: S(V)(S(K).left),
|
|
1757
1842
|
y1: S(V)(S(K).top + S(J)),
|
|
@@ -1759,8 +1844,8 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1759
1844
|
y2: S(V)(S(K).top + S(J)),
|
|
1760
1845
|
stroke: "currentColor",
|
|
1761
1846
|
"stroke-opacity": "0.3"
|
|
1762
|
-
}, null, 8,
|
|
1763
|
-
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", {
|
|
1764
1849
|
key: "vg" + t,
|
|
1765
1850
|
x1: T.value ? S(K).left : e.pos,
|
|
1766
1851
|
y1: T.value ? e.pos : S(K).top,
|
|
@@ -1768,18 +1853,18 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1768
1853
|
y2: T.value ? e.pos : S(K).top + S(J),
|
|
1769
1854
|
stroke: "currentColor",
|
|
1770
1855
|
"stroke-opacity": "0.1"
|
|
1771
|
-
}, null, 8,
|
|
1772
|
-
|
|
1856
|
+
}, null, 8, Rt))), 128)) : i("", !0),
|
|
1857
|
+
Ce.value && L.value ? (_(), a("rect", {
|
|
1773
1858
|
key: 3,
|
|
1774
|
-
x:
|
|
1775
|
-
y:
|
|
1776
|
-
width:
|
|
1777
|
-
height:
|
|
1859
|
+
x: Ce.value.x,
|
|
1860
|
+
y: Ce.value.y,
|
|
1861
|
+
width: Ce.value.w,
|
|
1862
|
+
height: Ce.value.h,
|
|
1778
1863
|
fill: "currentColor",
|
|
1779
1864
|
"fill-opacity": "0.06",
|
|
1780
1865
|
"pointer-events": "none"
|
|
1781
|
-
}, null, 8,
|
|
1782
|
-
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", {
|
|
1783
1868
|
key: "vt" + t,
|
|
1784
1869
|
"data-testid": "value-tick",
|
|
1785
1870
|
x: S(K).left - 6,
|
|
@@ -1789,7 +1874,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1789
1874
|
"font-size": "10",
|
|
1790
1875
|
fill: "currentColor",
|
|
1791
1876
|
"fill-opacity": "0.6"
|
|
1792
|
-
}, b(e.value), 9,
|
|
1877
|
+
}, b(e.value), 9, Bt))), 128)) : (_(!0), a(e, { key: 5 }, y(I.value, (e, t) => (_(), a("text", {
|
|
1793
1878
|
key: "vt" + t,
|
|
1794
1879
|
"data-testid": "value-tick",
|
|
1795
1880
|
x: e.pos,
|
|
@@ -1798,7 +1883,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1798
1883
|
"font-size": "10",
|
|
1799
1884
|
fill: "currentColor",
|
|
1800
1885
|
"fill-opacity": "0.6"
|
|
1801
|
-
}, b(e.value), 9,
|
|
1886
|
+
}, b(e.value), 9, Vt))), 128)),
|
|
1802
1887
|
t.yLabel ? (_(), a("text", {
|
|
1803
1888
|
key: 6,
|
|
1804
1889
|
x: 0,
|
|
@@ -1807,8 +1892,8 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1807
1892
|
"text-anchor": "middle",
|
|
1808
1893
|
"font-size": "13",
|
|
1809
1894
|
fill: "currentColor"
|
|
1810
|
-
}, b(t.yLabel), 9,
|
|
1811
|
-
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", {
|
|
1812
1897
|
key: "ct" + t,
|
|
1813
1898
|
"data-testid": "category-tick",
|
|
1814
1899
|
x: e.pos,
|
|
@@ -1817,7 +1902,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1817
1902
|
"font-size": "10",
|
|
1818
1903
|
fill: "currentColor",
|
|
1819
1904
|
"fill-opacity": "0.6"
|
|
1820
|
-
}, b(e.label), 9,
|
|
1905
|
+
}, b(e.label), 9, Ut))), 128)) : (_(!0), a(e, { key: 8 }, y(se.value, (e, t) => (_(), a("text", {
|
|
1821
1906
|
key: "ct" + t,
|
|
1822
1907
|
"data-testid": "category-tick",
|
|
1823
1908
|
x: S(K).left - 6,
|
|
@@ -1827,7 +1912,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1827
1912
|
"font-size": "10",
|
|
1828
1913
|
fill: "currentColor",
|
|
1829
1914
|
"fill-opacity": "0.6"
|
|
1830
|
-
}, b(e.label), 9,
|
|
1915
|
+
}, b(e.label), 9, Wt))), 128)),
|
|
1831
1916
|
t.xLabel ? (_(), a("text", {
|
|
1832
1917
|
key: 9,
|
|
1833
1918
|
x: S(K).left + S(q) / 2,
|
|
@@ -1835,8 +1920,8 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1835
1920
|
"text-anchor": "middle",
|
|
1836
1921
|
"font-size": "13",
|
|
1837
1922
|
fill: "currentColor"
|
|
1838
|
-
}, b(t.xLabel), 9,
|
|
1839
|
-
(_(!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", {
|
|
1840
1925
|
key: "bar" + t,
|
|
1841
1926
|
"data-testid": "bar",
|
|
1842
1927
|
"data-category": e.categoryIndex,
|
|
@@ -1847,7 +1932,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1847
1932
|
height: e.h,
|
|
1848
1933
|
fill: e.color,
|
|
1849
1934
|
"fill-opacity": e.opacity
|
|
1850
|
-
}, null, 8,
|
|
1935
|
+
}, null, 8, Kt))), 128)),
|
|
1851
1936
|
L.value ? (_(), a("rect", d({
|
|
1852
1937
|
key: 10,
|
|
1853
1938
|
x: S(K).left,
|
|
@@ -1859,43 +1944,43 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
1859
1944
|
cursor: "crosshair",
|
|
1860
1945
|
"touch-action": "none"
|
|
1861
1946
|
}
|
|
1862
|
-
}, te(S(
|
|
1863
|
-
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), {
|
|
1864
1949
|
key: 11,
|
|
1865
1950
|
annotations: t.annotations,
|
|
1866
1951
|
project: R,
|
|
1867
|
-
bounds: S(
|
|
1952
|
+
bounds: S(ge)
|
|
1868
1953
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
1869
|
-
], 8,
|
|
1870
|
-
L.value && S(
|
|
1954
|
+
], 8, jt)),
|
|
1955
|
+
L.value && S(_e) !== null && Q.value ? (_(), a("div", {
|
|
1871
1956
|
key: 1,
|
|
1872
1957
|
ref_key: "tooltipRef",
|
|
1873
|
-
ref:
|
|
1958
|
+
ref: ve,
|
|
1874
1959
|
class: "chart-tooltip-content",
|
|
1875
1960
|
style: m({
|
|
1876
1961
|
position: "absolute",
|
|
1877
1962
|
top: "0",
|
|
1878
1963
|
left: "0",
|
|
1879
1964
|
willChange: "transform",
|
|
1880
|
-
transform: S(
|
|
1881
|
-
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"
|
|
1882
1967
|
})
|
|
1883
|
-
}, [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", {
|
|
1884
1969
|
key: e.seriesIndex,
|
|
1885
1970
|
class: "bar-chart-tooltip-row"
|
|
1886
1971
|
}, [o("span", {
|
|
1887
1972
|
class: "bar-chart-tooltip-swatch",
|
|
1888
1973
|
style: m({ background: e.color })
|
|
1889
|
-
}, null, 4), s(" " + b(isFinite(e.value) ? S(
|
|
1890
|
-
S(
|
|
1974
|
+
}, null, 4), s(" " + b(isFinite(e.value) ? S(oe)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1975
|
+
S(Z) ? (_(), a("a", {
|
|
1891
1976
|
key: 2,
|
|
1892
1977
|
class: "bar-chart-download-link",
|
|
1893
|
-
href: S(
|
|
1894
|
-
download: `${S(
|
|
1895
|
-
}, b(S(
|
|
1978
|
+
href: S(be),
|
|
1979
|
+
download: `${S(xe)()}.csv`
|
|
1980
|
+
}, b(S(Z)), 9, Xt)) : i("", !0)
|
|
1896
1981
|
], 512));
|
|
1897
1982
|
}
|
|
1898
|
-
}), [["__scopeId", "data-v-
|
|
1983
|
+
}), [["__scopeId", "data-v-734e6c4e"]]), Qt = {
|
|
1899
1984
|
"01013": "010259",
|
|
1900
1985
|
"01015": "010177",
|
|
1901
1986
|
"01029": "010177",
|
|
@@ -5056,7 +5141,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
5056
5141
|
51019: "510014",
|
|
5057
5142
|
"02158": "020820",
|
|
5058
5143
|
46102: "460957"
|
|
5059
|
-
},
|
|
5144
|
+
}, $t = {
|
|
5060
5145
|
"010259": "Butler, AL",
|
|
5061
5146
|
"010177": "Calhoun (Anniston), AL - Cleburne, AL",
|
|
5062
5147
|
"010172": "Chambers, AL - Randolph, AL",
|
|
@@ -6006,7 +6091,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6006
6091
|
560775: "Teton, WY - Lincoln, WY",
|
|
6007
6092
|
560792: "Uinta, WY",
|
|
6008
6093
|
560804: "Weston, WY"
|
|
6009
|
-
},
|
|
6094
|
+
}, en = {
|
|
6010
6095
|
ref: "root",
|
|
6011
6096
|
class: "chart-tooltip-content",
|
|
6012
6097
|
style: {
|
|
@@ -6018,7 +6103,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6018
6103
|
"pointer-events": "none",
|
|
6019
6104
|
transform: "translateY(-50%)"
|
|
6020
6105
|
}
|
|
6021
|
-
},
|
|
6106
|
+
}, tn = /* @__PURE__ */ l({
|
|
6022
6107
|
__name: "ChoroplethTooltip",
|
|
6023
6108
|
setup(e, { expose: n }) {
|
|
6024
6109
|
let a = v(null), s = w("root");
|
|
@@ -6029,24 +6114,24 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6029
6114
|
getEl() {
|
|
6030
6115
|
return s.value;
|
|
6031
6116
|
}
|
|
6032
|
-
}), (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)]));
|
|
6033
6118
|
}
|
|
6034
|
-
}),
|
|
6119
|
+
}), nn = {
|
|
6035
6120
|
key: 1,
|
|
6036
6121
|
class: "choropleth-header"
|
|
6037
|
-
},
|
|
6122
|
+
}, rn = {
|
|
6038
6123
|
key: 0,
|
|
6039
6124
|
class: "choropleth-title"
|
|
6040
|
-
},
|
|
6125
|
+
}, an = {
|
|
6041
6126
|
key: 1,
|
|
6042
6127
|
class: "choropleth-legend"
|
|
6043
|
-
},
|
|
6128
|
+
}, on = {
|
|
6044
6129
|
key: 0,
|
|
6045
6130
|
class: "choropleth-legend-title"
|
|
6046
|
-
},
|
|
6131
|
+
}, sn = {
|
|
6047
6132
|
key: 2,
|
|
6048
6133
|
class: "choropleth-legend-continuous"
|
|
6049
|
-
},
|
|
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({
|
|
6050
6135
|
__name: "ChoroplethMap",
|
|
6051
6136
|
props: {
|
|
6052
6137
|
topology: {},
|
|
@@ -6090,43 +6175,43 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6090
6175
|
"update:focus"
|
|
6091
6176
|
],
|
|
6092
6177
|
setup(t, { emit: c }) {
|
|
6093
|
-
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 = {
|
|
6094
6179
|
width: 0,
|
|
6095
6180
|
height: 0
|
|
6096
|
-
}, U = null, W = !1, G = null,
|
|
6097
|
-
function
|
|
6181
|
+
}, U = null, W = !1, G = null, fe = v(!1), pe = 0, me = 0, K = 0;
|
|
6182
|
+
function he() {
|
|
6098
6183
|
if (V) return;
|
|
6099
6184
|
let e = D.value;
|
|
6100
|
-
e && (e.addEventListener("click",
|
|
6185
|
+
e && (e.addEventListener("click", ct), e.addEventListener("mouseover", ct), e.addEventListener("mousemove", lt), e.addEventListener("mouseout", ut));
|
|
6101
6186
|
}
|
|
6102
|
-
function
|
|
6187
|
+
function q() {
|
|
6103
6188
|
let e = D.value;
|
|
6104
|
-
e && (e.removeEventListener("click",
|
|
6189
|
+
e && (e.removeEventListener("click", ct), e.removeEventListener("mouseover", ct), e.removeEventListener("mousemove", lt), e.removeEventListener("mouseout", ut));
|
|
6105
6190
|
}
|
|
6106
|
-
function
|
|
6107
|
-
|
|
6191
|
+
function J() {
|
|
6192
|
+
ot();
|
|
6108
6193
|
}
|
|
6109
6194
|
h(() => {
|
|
6110
|
-
|
|
6195
|
+
ge(), he(), ft(), Z(), Ze(), window.addEventListener("scroll", J, {
|
|
6111
6196
|
passive: !0,
|
|
6112
6197
|
capture: !0
|
|
6113
|
-
}), window.addEventListener("resize",
|
|
6198
|
+
}), window.addEventListener("resize", J, { passive: !0 });
|
|
6114
6199
|
}), g(() => {
|
|
6115
|
-
|
|
6200
|
+
de?.disconnect(), K && cancelAnimationFrame(K), ve(), q(), window.removeEventListener("scroll", J, { capture: !0 }), window.removeEventListener("resize", J);
|
|
6116
6201
|
});
|
|
6117
|
-
function
|
|
6202
|
+
function ge() {
|
|
6118
6203
|
if (!w.value || !D.value) return;
|
|
6119
|
-
let e =
|
|
6120
|
-
G =
|
|
6121
|
-
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();
|
|
6122
6207
|
}).on("zoom", (e) => {
|
|
6123
6208
|
D.value && D.value.setAttribute("transform", e.transform);
|
|
6124
6209
|
let t = e.transform;
|
|
6125
|
-
|
|
6210
|
+
fe.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
6126
6211
|
}).on("end", () => {
|
|
6127
6212
|
B = !1;
|
|
6128
6213
|
}), G.filter((e) => {
|
|
6129
|
-
let t =
|
|
6214
|
+
let t = Fe.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
|
|
6130
6215
|
if (e.type === "wheel" || e.type === "dblclick") {
|
|
6131
6216
|
if (!n) return !1;
|
|
6132
6217
|
} else if (e.type === "mousedown" || e.type === "touchstart") {
|
|
@@ -6135,11 +6220,11 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6135
6220
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
6136
6221
|
}), e.call(G);
|
|
6137
6222
|
}
|
|
6138
|
-
function
|
|
6139
|
-
w.value && G && (
|
|
6223
|
+
function ve() {
|
|
6224
|
+
w.value && G && (I(w.value).on(".zoom", null), G = null);
|
|
6140
6225
|
}
|
|
6141
|
-
function
|
|
6142
|
-
let t =
|
|
6226
|
+
function Y(e) {
|
|
6227
|
+
let t = Ie.value, n = Me.value, r = [];
|
|
6143
6228
|
for (let i of e) {
|
|
6144
6229
|
let e = i.geoType ?? l.geoType, a = t.get(e);
|
|
6145
6230
|
if (!a) continue;
|
|
@@ -6157,117 +6242,117 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6157
6242
|
}
|
|
6158
6243
|
return r;
|
|
6159
6244
|
}
|
|
6160
|
-
function
|
|
6245
|
+
function ye(e) {
|
|
6161
6246
|
let t = /* @__PURE__ */ new Set();
|
|
6162
|
-
for (let n of
|
|
6247
|
+
for (let n of Y(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
|
|
6163
6248
|
return t;
|
|
6164
6249
|
}
|
|
6165
|
-
let
|
|
6166
|
-
function
|
|
6250
|
+
let X = !1;
|
|
6251
|
+
function Z() {
|
|
6167
6252
|
if (!w.value || !G) return;
|
|
6168
|
-
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();
|
|
6169
6254
|
for (let e of t) {
|
|
6170
6255
|
let t = N.get(String(e.feature.id));
|
|
6171
6256
|
t && r.set(t, e.item.style ?? "solid");
|
|
6172
6257
|
}
|
|
6173
|
-
for (let [e] of R) r.has(e) || e === L ||
|
|
6174
|
-
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);
|
|
6175
6260
|
R.clear();
|
|
6176
6261
|
for (let [e, t] of r) R.set(e, t);
|
|
6177
|
-
if (
|
|
6178
|
-
|
|
6262
|
+
if (be(n), e.length === 0) {
|
|
6263
|
+
X = !0, ot();
|
|
6179
6264
|
return;
|
|
6180
6265
|
}
|
|
6181
|
-
let i =
|
|
6266
|
+
let i = I(w.value);
|
|
6182
6267
|
i.interrupt();
|
|
6183
|
-
let a =
|
|
6184
|
-
|
|
6185
|
-
let [[o, s], [c, u]] =
|
|
6268
|
+
let a = X;
|
|
6269
|
+
X = !0;
|
|
6270
|
+
let [[o, s], [c, u]] = Ae.value.bounds({
|
|
6186
6271
|
type: "FeatureCollection",
|
|
6187
6272
|
features: e.map((e) => e.feature)
|
|
6188
|
-
}), 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 = () => {
|
|
6189
6274
|
if (!M.value || !h) return;
|
|
6190
6275
|
let e = String(h.id), t = N.get(e);
|
|
6191
6276
|
if (!t) return;
|
|
6192
6277
|
let n = t.getBoundingClientRect();
|
|
6193
|
-
|
|
6278
|
+
$e(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
6194
6279
|
};
|
|
6195
|
-
a ? (
|
|
6280
|
+
a ? (tt(), i.transition().duration(fn).call(G.transform, m).on("end", g)) : (G.transform(i, m), g());
|
|
6196
6281
|
}
|
|
6197
|
-
function
|
|
6282
|
+
function be(e) {
|
|
6198
6283
|
let t = k.value;
|
|
6199
6284
|
if (!t) return;
|
|
6200
6285
|
let n = new Set(e.map((e) => e.key));
|
|
6201
6286
|
for (let [e, t] of z) n.has(e) || (t.remove(), z.delete(e));
|
|
6202
|
-
let r =
|
|
6287
|
+
let r = Ae.value, i = je.value + 1.5;
|
|
6203
6288
|
for (let { item: n, feature: a, key: o } of e) {
|
|
6204
6289
|
let e = z.get(o);
|
|
6205
|
-
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);
|
|
6206
6291
|
}
|
|
6207
6292
|
}
|
|
6208
|
-
function
|
|
6293
|
+
function Q() {
|
|
6209
6294
|
if (!w.value || !G) return;
|
|
6210
|
-
|
|
6211
|
-
let e =
|
|
6212
|
-
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);
|
|
6213
6298
|
}
|
|
6214
6299
|
T(() => l.focusZoomLevel, () => {
|
|
6215
|
-
G && G.scaleExtent([1, Math.max(12, l.focusZoomLevel)]),
|
|
6300
|
+
G && G.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), Z();
|
|
6216
6301
|
});
|
|
6217
|
-
let
|
|
6302
|
+
let Ce = n(() => l.width && l.height ? l.height / l.width : .625), we = n(() => pn), Te = n(() => pn * Ce.value), Ee = n(() => {
|
|
6218
6303
|
let e = x(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
|
|
6219
6304
|
for (let e of t) {
|
|
6220
|
-
let t =
|
|
6305
|
+
let t = Qt[String(e.id).padStart(5, "0")];
|
|
6221
6306
|
t && (n.has(t) || n.set(t, []), n.get(t).push(e));
|
|
6222
6307
|
}
|
|
6223
6308
|
let r = [];
|
|
6224
6309
|
for (let [t, i] of n) r.push({
|
|
6225
6310
|
type: "Feature",
|
|
6226
6311
|
id: t,
|
|
6227
|
-
properties: { name:
|
|
6228
|
-
geometry:
|
|
6312
|
+
properties: { name: $t[t] ?? t },
|
|
6313
|
+
geometry: ce(e, i)
|
|
6229
6314
|
});
|
|
6230
6315
|
return {
|
|
6231
6316
|
type: "FeatureCollection",
|
|
6232
6317
|
features: r
|
|
6233
6318
|
};
|
|
6234
|
-
}),
|
|
6235
|
-
if (l.geoType === "hsas") return
|
|
6319
|
+
}), De = n(() => {
|
|
6320
|
+
if (l.geoType === "hsas") return Ee.value;
|
|
6236
6321
|
if (l.geoType === "counties") {
|
|
6237
6322
|
let e = x(l.topology);
|
|
6238
|
-
return
|
|
6323
|
+
return se(e, e.objects.counties);
|
|
6239
6324
|
}
|
|
6240
6325
|
let e = x(l.topology);
|
|
6241
|
-
return
|
|
6242
|
-
}),
|
|
6326
|
+
return se(e, e.objects.states);
|
|
6327
|
+
}), Oe = n(() => {
|
|
6243
6328
|
if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
|
|
6244
6329
|
let e = x(l.topology);
|
|
6245
|
-
return
|
|
6246
|
-
}),
|
|
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(() => {
|
|
6247
6332
|
let e = /* @__PURE__ */ new Map();
|
|
6248
|
-
for (let [t, n] of
|
|
6333
|
+
for (let [t, n] of Ie.value) {
|
|
6249
6334
|
let r = /* @__PURE__ */ new Map();
|
|
6250
6335
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
6251
6336
|
e.set(t, r);
|
|
6252
6337
|
}
|
|
6253
6338
|
return e;
|
|
6254
6339
|
});
|
|
6255
|
-
function
|
|
6340
|
+
function Ne(e) {
|
|
6256
6341
|
let t = l.dataGeoType;
|
|
6257
6342
|
if (!t || t === l.geoType) return e;
|
|
6258
|
-
if (l.geoType === "counties" && t === "hsas") return
|
|
6343
|
+
if (l.geoType === "counties" && t === "hsas") return Qt[e];
|
|
6259
6344
|
if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
6260
6345
|
}
|
|
6261
|
-
let
|
|
6346
|
+
let Pe = n(() => {
|
|
6262
6347
|
let e = /* @__PURE__ */ new Map();
|
|
6263
|
-
for (let t of
|
|
6348
|
+
for (let t of De.value.features) t.id != null && e.set(String(t.id), t);
|
|
6264
6349
|
return e;
|
|
6265
|
-
}),
|
|
6350
|
+
}), Fe = n(() => {
|
|
6266
6351
|
let e = l.focus;
|
|
6267
6352
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
6268
|
-
}),
|
|
6353
|
+
}), Ie = n(() => {
|
|
6269
6354
|
let e = /* @__PURE__ */ new Map();
|
|
6270
|
-
e.set(l.geoType,
|
|
6355
|
+
e.set(l.geoType, Pe.value);
|
|
6271
6356
|
let t = x(l.topology), n = t?.objects;
|
|
6272
6357
|
if (!n) return e;
|
|
6273
6358
|
let r = (e) => {
|
|
@@ -6276,25 +6361,25 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6276
6361
|
return t;
|
|
6277
6362
|
};
|
|
6278
6363
|
if (!e.has("states") && n.states) {
|
|
6279
|
-
let i =
|
|
6364
|
+
let i = se(t, n.states);
|
|
6280
6365
|
e.set("states", r(i.features));
|
|
6281
6366
|
}
|
|
6282
6367
|
if (!e.has("counties") && n.counties) {
|
|
6283
|
-
let i =
|
|
6368
|
+
let i = se(t, n.counties);
|
|
6284
6369
|
e.set("counties", r(i.features));
|
|
6285
6370
|
}
|
|
6286
|
-
return !e.has("hsas") && n.counties && e.set("hsas", r(
|
|
6287
|
-
}),
|
|
6371
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(Ee.value.features)), e;
|
|
6372
|
+
}), Le = n(() => {
|
|
6288
6373
|
let e = /* @__PURE__ */ new Map();
|
|
6289
6374
|
if (!l.data) return e;
|
|
6290
|
-
let t = l.dataGeoType ?? l.geoType, n =
|
|
6375
|
+
let t = l.dataGeoType ?? l.geoType, n = Me.value.get(t);
|
|
6291
6376
|
for (let t of l.data) {
|
|
6292
6377
|
e.set(t.id, t.value);
|
|
6293
6378
|
let r = n?.get(t.id);
|
|
6294
6379
|
r && e.set(r, t.value);
|
|
6295
6380
|
}
|
|
6296
6381
|
return e;
|
|
6297
|
-
}),
|
|
6382
|
+
}), Re = n(() => {
|
|
6298
6383
|
if (!l.data || l.data.length === 0) return {
|
|
6299
6384
|
min: 0,
|
|
6300
6385
|
max: 1
|
|
@@ -6311,8 +6396,8 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6311
6396
|
min: 0,
|
|
6312
6397
|
max: 1
|
|
6313
6398
|
};
|
|
6314
|
-
}),
|
|
6315
|
-
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) {
|
|
6316
6401
|
let t = e.replace("#", "");
|
|
6317
6402
|
return [
|
|
6318
6403
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -6320,109 +6405,109 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6320
6405
|
parseInt(t.slice(4, 6), 16)
|
|
6321
6406
|
];
|
|
6322
6407
|
}
|
|
6323
|
-
function
|
|
6324
|
-
let [t, n, r] =
|
|
6408
|
+
function Ue(e) {
|
|
6409
|
+
let [t, n, r] = He(Be.value), [i, a, o] = He(Ve.value);
|
|
6325
6410
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
6326
6411
|
}
|
|
6327
|
-
let
|
|
6328
|
-
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;
|
|
6329
6414
|
let e = /* @__PURE__ */ new Map();
|
|
6330
6415
|
for (let t of l.colorScale) e.set(t.value, t.color);
|
|
6331
6416
|
return e;
|
|
6332
6417
|
});
|
|
6333
|
-
function Ge(e) {
|
|
6334
|
-
let t = je(e);
|
|
6335
|
-
return t == null ? void 0 : Fe.value.get(t);
|
|
6336
|
-
}
|
|
6337
6418
|
function Ke(e) {
|
|
6338
|
-
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;
|
|
6339
6424
|
if (t == null) return n;
|
|
6340
|
-
let r =
|
|
6425
|
+
let r = Ge.value;
|
|
6341
6426
|
if (r) return r.get(String(t)) ?? n;
|
|
6342
|
-
let i =
|
|
6427
|
+
let i = We.value;
|
|
6343
6428
|
if (i) {
|
|
6344
6429
|
let e = t;
|
|
6345
6430
|
for (let t of i) if (e >= t.min) return t.color;
|
|
6346
6431
|
return n;
|
|
6347
6432
|
}
|
|
6348
|
-
let { min: a, max: o } =
|
|
6349
|
-
return
|
|
6433
|
+
let { min: a, max: o } = Re.value;
|
|
6434
|
+
return Ue((t - a) / (o - a));
|
|
6350
6435
|
}
|
|
6351
|
-
let
|
|
6352
|
-
function
|
|
6353
|
-
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);
|
|
6354
6439
|
}
|
|
6355
|
-
function
|
|
6356
|
-
return t == null ? e : `${e}: ${
|
|
6440
|
+
function Xe(e, t) {
|
|
6441
|
+
return t == null ? e : `${e}: ${Ye(t)}`;
|
|
6357
6442
|
}
|
|
6358
|
-
function
|
|
6443
|
+
function Ze() {
|
|
6359
6444
|
let e = A.value?.getEl();
|
|
6360
6445
|
if (!e) return;
|
|
6361
|
-
|
|
6446
|
+
de?.disconnect();
|
|
6362
6447
|
let t = !1;
|
|
6363
|
-
|
|
6448
|
+
de = new ResizeObserver((e) => {
|
|
6364
6449
|
let n = e[0]?.contentRect;
|
|
6365
|
-
n && (
|
|
6366
|
-
}),
|
|
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);
|
|
6367
6452
|
}
|
|
6368
|
-
function
|
|
6453
|
+
function Qe(e, t) {
|
|
6369
6454
|
let n = A.value?.getEl();
|
|
6370
6455
|
if (!n) return;
|
|
6371
|
-
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);
|
|
6372
6457
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
6373
6458
|
}
|
|
6374
|
-
function
|
|
6459
|
+
function $e(e, t, n) {
|
|
6375
6460
|
let r = P.get(e);
|
|
6376
6461
|
if (!r) return;
|
|
6377
6462
|
let i = A.value, a = i?.getEl();
|
|
6378
6463
|
!i || !a || (i.setData(r), U = {
|
|
6379
6464
|
x: t,
|
|
6380
6465
|
y: n
|
|
6381
|
-
}, W = !0,
|
|
6466
|
+
}, W = !0, Qe(t, n), a.style.visibility = "visible");
|
|
6382
6467
|
}
|
|
6383
|
-
function
|
|
6384
|
-
W && (
|
|
6385
|
-
|
|
6468
|
+
function et(e, t) {
|
|
6469
|
+
W && (pe = e, me = t, !K && (K = requestAnimationFrame(() => {
|
|
6470
|
+
K = 0;
|
|
6386
6471
|
let e = A.value?.getEl();
|
|
6387
6472
|
!e || !W || (U = {
|
|
6388
|
-
x:
|
|
6389
|
-
y:
|
|
6390
|
-
}, e.style.transform = `translate3d(${
|
|
6473
|
+
x: pe,
|
|
6474
|
+
y: me
|
|
6475
|
+
}, e.style.transform = `translate3d(${pe + 16}px, ${me}px, 0) translateY(-50%)`);
|
|
6391
6476
|
})));
|
|
6392
6477
|
}
|
|
6393
|
-
function
|
|
6478
|
+
function tt() {
|
|
6394
6479
|
if (!W) return;
|
|
6395
6480
|
W = !1, U = null;
|
|
6396
6481
|
let e = A.value?.getEl();
|
|
6397
6482
|
e && (e.style.visibility = "hidden");
|
|
6398
6483
|
}
|
|
6399
|
-
function
|
|
6484
|
+
function nt(e, t) {
|
|
6400
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"));
|
|
6401
6486
|
}
|
|
6402
|
-
function
|
|
6403
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
6404
|
-
}
|
|
6405
|
-
function rt(e) {
|
|
6406
|
-
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);
|
|
6407
6489
|
}
|
|
6408
6490
|
function it(e) {
|
|
6409
|
-
|
|
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"));
|
|
6410
6495
|
}
|
|
6411
|
-
function
|
|
6496
|
+
function ot() {
|
|
6412
6497
|
if (L) {
|
|
6413
6498
|
let e = R.get(L);
|
|
6414
|
-
e == null ?
|
|
6499
|
+
e == null ? it(L) : rt(L, e), L = null, d("stateHover", null);
|
|
6415
6500
|
}
|
|
6416
|
-
|
|
6501
|
+
tt();
|
|
6417
6502
|
}
|
|
6418
|
-
function
|
|
6503
|
+
function st(e) {
|
|
6419
6504
|
let t = e;
|
|
6420
6505
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
6421
6506
|
return t ? t.dataset.featId ?? null : null;
|
|
6422
6507
|
}
|
|
6423
|
-
function
|
|
6508
|
+
function ct(e) {
|
|
6424
6509
|
if (B) return;
|
|
6425
|
-
let t = e, n =
|
|
6510
|
+
let t = e, n = st(t.target);
|
|
6426
6511
|
if (!n) return;
|
|
6427
6512
|
let r = P.get(n);
|
|
6428
6513
|
if (!r) return;
|
|
@@ -6431,31 +6516,31 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6431
6516
|
name: r.name,
|
|
6432
6517
|
value: r.value
|
|
6433
6518
|
};
|
|
6434
|
-
e.type === "click" ? (d("stateClick", i), d("update:focus",
|
|
6435
|
-
}
|
|
6436
|
-
function ct(e) {
|
|
6437
|
-
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));
|
|
6438
6520
|
}
|
|
6439
6521
|
function lt(e) {
|
|
6440
|
-
|
|
6441
|
-
t && D.value?.contains(t) || at();
|
|
6522
|
+
B || et(e.clientX, e.clientY);
|
|
6442
6523
|
}
|
|
6443
6524
|
function ut(e) {
|
|
6444
|
-
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");
|
|
6445
6530
|
return e && t.setAttribute("d", e), t;
|
|
6446
6531
|
}
|
|
6447
|
-
function
|
|
6532
|
+
function ft() {
|
|
6448
6533
|
let e = O.value, t = k.value;
|
|
6449
6534
|
if (!e || !t) return;
|
|
6450
6535
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
6451
6536
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
6452
|
-
N.clear(), P.clear(),
|
|
6453
|
-
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();
|
|
6454
6539
|
for (let e of r) {
|
|
6455
|
-
let t = String(e.id), r =
|
|
6456
|
-
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill",
|
|
6457
|
-
let e = document.createElementNS(
|
|
6458
|
-
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);
|
|
6459
6544
|
}
|
|
6460
6545
|
s.appendChild(l), N.set(t, l), P.set(t, {
|
|
6461
6546
|
id: t,
|
|
@@ -6464,111 +6549,111 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6464
6549
|
feature: e
|
|
6465
6550
|
});
|
|
6466
6551
|
}
|
|
6467
|
-
let c =
|
|
6552
|
+
let c = Oe.value;
|
|
6468
6553
|
if (c) {
|
|
6469
|
-
let e =
|
|
6470
|
-
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;
|
|
6471
6556
|
}
|
|
6472
6557
|
e.appendChild(s);
|
|
6473
6558
|
}
|
|
6474
|
-
function
|
|
6559
|
+
function pt() {
|
|
6475
6560
|
let e = !M.value;
|
|
6476
6561
|
for (let [t, n] of N) {
|
|
6477
|
-
let r =
|
|
6478
|
-
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) {
|
|
6479
6564
|
let e = n.firstElementChild;
|
|
6480
|
-
e && (e.textContent =
|
|
6565
|
+
e && (e.textContent = Xe(i.name, r));
|
|
6481
6566
|
}
|
|
6482
6567
|
}
|
|
6483
6568
|
}
|
|
6484
|
-
function pt() {
|
|
6485
|
-
for (let e of N.values()) e === L || R.has(e) || rt(e);
|
|
6486
|
-
ne && ne.setAttribute("stroke", l.strokeColor);
|
|
6487
|
-
}
|
|
6488
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() {
|
|
6489
6574
|
return typeof l.menu == "string" ? l.menu : "choropleth";
|
|
6490
6575
|
}
|
|
6491
|
-
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(() => {
|
|
6492
6577
|
let e = [];
|
|
6493
6578
|
for (let t = 0; t <= 10; t++) {
|
|
6494
6579
|
let n = t / 10;
|
|
6495
6580
|
e.push({
|
|
6496
6581
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
6497
|
-
color:
|
|
6582
|
+
color: Ue(n)
|
|
6498
6583
|
});
|
|
6499
6584
|
}
|
|
6500
6585
|
return e;
|
|
6501
|
-
}),
|
|
6586
|
+
}), yt = new Intl.NumberFormat("en-US", {
|
|
6502
6587
|
notation: "compact",
|
|
6503
6588
|
maximumFractionDigits: 1
|
|
6504
|
-
}),
|
|
6505
|
-
let { min: e, max: t } =
|
|
6589
|
+
}), bt = n(() => {
|
|
6590
|
+
let { min: e, max: t } = Re.value, n = t - e, r = [];
|
|
6506
6591
|
for (let t = 1; t <= 3; t++) {
|
|
6507
|
-
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$/, "");
|
|
6508
6593
|
r.push({
|
|
6509
6594
|
value: o,
|
|
6510
6595
|
pct: i * 100
|
|
6511
6596
|
});
|
|
6512
6597
|
}
|
|
6513
6598
|
return r;
|
|
6514
|
-
}),
|
|
6599
|
+
}), xt = n(() => {
|
|
6515
6600
|
let e = [];
|
|
6516
|
-
if (
|
|
6601
|
+
if (ze.value) for (let t of l.colorScale) e.push({
|
|
6517
6602
|
key: t.value,
|
|
6518
6603
|
color: t.color,
|
|
6519
6604
|
label: t.value
|
|
6520
6605
|
});
|
|
6521
|
-
else if (
|
|
6606
|
+
else if ($.value) for (let t of _t.value) e.push({
|
|
6522
6607
|
key: String(t.min),
|
|
6523
6608
|
color: t.color,
|
|
6524
6609
|
label: t.label ?? String(t.min)
|
|
6525
6610
|
});
|
|
6526
6611
|
return e;
|
|
6527
|
-
}),
|
|
6528
|
-
let e =
|
|
6612
|
+
}), St = n(() => `linear-gradient(to right, ${vt.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), Ct = n(() => {
|
|
6613
|
+
let e = ht();
|
|
6529
6614
|
return [{
|
|
6530
6615
|
label: "Save as SVG",
|
|
6531
6616
|
action: () => {
|
|
6532
|
-
w.value &&
|
|
6617
|
+
w.value && xe(w.value, e);
|
|
6533
6618
|
}
|
|
6534
6619
|
}, {
|
|
6535
6620
|
label: "Save as PNG",
|
|
6536
6621
|
action: () => {
|
|
6537
|
-
w.value &&
|
|
6622
|
+
w.value && Se(w.value, e);
|
|
6538
6623
|
}
|
|
6539
6624
|
}];
|
|
6540
6625
|
});
|
|
6541
|
-
return T(() => [
|
|
6542
|
-
|
|
6626
|
+
return T(() => [Ae.value, M.value], () => ft()), T(() => [
|
|
6627
|
+
Le.value,
|
|
6543
6628
|
l.colorScale,
|
|
6544
6629
|
l.noDataColor,
|
|
6545
6630
|
l.dataGeoType
|
|
6546
|
-
], () =>
|
|
6631
|
+
], () => pt()), T(() => [l.strokeColor, je.value], () => mt()), T(() => [Fe.value, Ae.value], () => Z(), { flush: "post" }), (n, c) => (_(), a("div", {
|
|
6547
6632
|
ref_key: "containerRef",
|
|
6548
6633
|
ref: S,
|
|
6549
6634
|
class: f(["choropleth-wrapper", { pannable: t.pan }])
|
|
6550
6635
|
}, [
|
|
6551
|
-
t.menu ? (_(), r(
|
|
6636
|
+
t.menu ? (_(), r(ue, {
|
|
6552
6637
|
key: 0,
|
|
6553
|
-
items:
|
|
6638
|
+
items: Ct.value
|
|
6554
6639
|
}, null, 8, ["items"])) : i("", !0),
|
|
6555
|
-
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", {
|
|
6556
6641
|
key: e.key,
|
|
6557
6642
|
class: "choropleth-legend-item"
|
|
6558
6643
|
}, [o("span", {
|
|
6559
6644
|
class: "choropleth-legend-swatch",
|
|
6560
6645
|
style: m({ background: e.color })
|
|
6561
|
-
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div",
|
|
6646
|
+
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", sn, [o("div", {
|
|
6562
6647
|
class: "choropleth-legend-gradient",
|
|
6563
|
-
style: m({ background:
|
|
6564
|
-
}, 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", {
|
|
6565
6650
|
key: e.value,
|
|
6566
6651
|
style: m({ left: e.pct + "%" })
|
|
6567
6652
|
}, b(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
|
|
6568
6653
|
(_(), a("svg", {
|
|
6569
6654
|
ref_key: "svgRef",
|
|
6570
6655
|
ref: w,
|
|
6571
|
-
viewBox: `0 0 ${
|
|
6656
|
+
viewBox: `0 0 ${we.value} ${Te.value}`,
|
|
6572
6657
|
preserveAspectRatio: "xMidYMid meet"
|
|
6573
6658
|
}, [o("g", {
|
|
6574
6659
|
ref_key: "mapGroupRef",
|
|
@@ -6579,15 +6664,15 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6579
6664
|
}, null, 512), o("g", {
|
|
6580
6665
|
ref_key: "overlayGroupRef",
|
|
6581
6666
|
ref: k
|
|
6582
|
-
}, null, 512)], 512)], 8,
|
|
6583
|
-
|
|
6667
|
+
}, null, 512)], 512)], 8, ln)),
|
|
6668
|
+
fe.value ? (_(), a("button", {
|
|
6584
6669
|
key: 2,
|
|
6585
6670
|
type: "button",
|
|
6586
6671
|
class: "choropleth-reset",
|
|
6587
6672
|
"aria-label": "Reset zoom",
|
|
6588
|
-
onClick:
|
|
6673
|
+
onClick: Q
|
|
6589
6674
|
}, " Reset ")) : i("", !0),
|
|
6590
|
-
M.value ? (_(), r(
|
|
6675
|
+
M.value ? (_(), r(tn, {
|
|
6591
6676
|
key: 3,
|
|
6592
6677
|
ref_key: "tooltipChildRef",
|
|
6593
6678
|
ref: A
|
|
@@ -6595,12 +6680,12 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6595
6680
|
default: E((r) => [ee(n.$slots, "tooltip", p(u(te(r))), () => [t.tooltipFormat ? (_(), a("span", {
|
|
6596
6681
|
key: 0,
|
|
6597
6682
|
innerHTML: t.tooltipFormat(r)
|
|
6598
|
-
}, 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)]),
|
|
6599
6684
|
_: 3
|
|
6600
6685
|
}, 512)) : i("", !0)
|
|
6601
6686
|
], 2));
|
|
6602
6687
|
}
|
|
6603
|
-
}), [["__scopeId", "data-v-
|
|
6688
|
+
}), [["__scopeId", "data-v-a53cf9ce"]]), hn = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
6604
6689
|
__name: "ChartTooltip",
|
|
6605
6690
|
props: {
|
|
6606
6691
|
x: {},
|
|
@@ -6620,7 +6705,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6620
6705
|
top: `${e.y}px`,
|
|
6621
6706
|
transform: "translateY(-50%)"
|
|
6622
6707
|
})
|
|
6623
|
-
}, [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), {
|
|
6624
6709
|
key: 1,
|
|
6625
6710
|
open: e.open
|
|
6626
6711
|
}, {
|
|
@@ -6651,7 +6736,7 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6651
6736
|
_: 3
|
|
6652
6737
|
}, 8, ["open"])) : i("", !0);
|
|
6653
6738
|
}
|
|
6654
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
6739
|
+
}), [["__scopeId", "data-v-44377f70"]]), gn = { class: "TableWrapper" }, _n = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
6655
6740
|
__name: "DataTable",
|
|
6656
6741
|
props: {
|
|
6657
6742
|
data: {},
|
|
@@ -6716,7 +6801,13 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6716
6801
|
});
|
|
6717
6802
|
function v(e, t) {
|
|
6718
6803
|
let n = e.values[t];
|
|
6719
|
-
|
|
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);
|
|
6720
6811
|
}
|
|
6721
6812
|
function ee() {
|
|
6722
6813
|
return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
|
|
@@ -6736,16 +6827,16 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6736
6827
|
}
|
|
6737
6828
|
let S = n(() => [{
|
|
6738
6829
|
label: c.downloadMenuLink,
|
|
6739
|
-
action: () =>
|
|
6830
|
+
action: () => Q(x(), ee())
|
|
6740
6831
|
}]), C = n(() => !!c.menu);
|
|
6741
6832
|
return (n, s) => (_(), a("div", { class: f(["TableOuter", {
|
|
6742
6833
|
"full-width": t.fullWidth,
|
|
6743
6834
|
"has-menu": C.value
|
|
6744
|
-
}]) }, [C.value ? (_(), r(
|
|
6835
|
+
}]) }, [C.value ? (_(), r(ue, {
|
|
6745
6836
|
key: 0,
|
|
6746
6837
|
items: S.value,
|
|
6747
6838
|
"force-dropdown": ""
|
|
6748
|
-
}, 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 }]) }, [
|
|
6749
6840
|
o("colgroup", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("col", {
|
|
6750
6841
|
key: e.name,
|
|
6751
6842
|
style: m(u(e.name))
|
|
@@ -6761,6 +6852,6 @@ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
|
6761
6852
|
}, b(v(e, n - 1)), 7))), 128))]))), 128))])
|
|
6762
6853
|
], 2)])], 2));
|
|
6763
6854
|
}
|
|
6764
|
-
}), [["__scopeId", "data-v-
|
|
6855
|
+
}), [["__scopeId", "data-v-d6b3bce8"]]);
|
|
6765
6856
|
//#endregion
|
|
6766
|
-
export {
|
|
6857
|
+
export { Zt as BarChart, hn as ChartTooltip, mn as ChoroplethMap, _n as DataTable, At as LineChart, Qt as fipsToHsa, $t as hsaNames };
|