@cfasim-ui/charts 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChoroplethMap/ChoroplethMap.d.ts +49 -8
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +631 -560
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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 ee, openBlock as g, ref as _, renderList as v, renderSlot as te, toDisplayString as y, toHandlers as ne, toRaw as b, unref as x, useSlots as re, useTemplateRef as S, watch as C, withCtx as w } from "vue";
|
|
2
|
-
import { DropdownMenuContent as T, DropdownMenuItem as
|
|
3
|
-
import { geoAlbersUsa as
|
|
4
|
-
import { zoom as
|
|
5
|
-
import { select as
|
|
2
|
+
import { DropdownMenuContent as T, DropdownMenuItem as ie, DropdownMenuPortal as E, DropdownMenuRoot as D, DropdownMenuTrigger as O, PopoverAnchor as k, PopoverContent as A, PopoverPortal as j, PopoverRoot as M } from "reka-ui";
|
|
3
|
+
import { geoAlbersUsa as N, geoPath as ae } from "d3-geo";
|
|
4
|
+
import { zoom as P, zoomIdentity as F } from "d3-zoom";
|
|
5
|
+
import { select as oe } from "d3-selection";
|
|
6
6
|
import "d3-transition";
|
|
7
|
-
import { feature as
|
|
7
|
+
import { feature as I, merge as se, mesh as L } from "topojson-client";
|
|
8
8
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var R = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PURE__ */ l({
|
|
10
10
|
__name: "ChartMenu",
|
|
11
11
|
props: {
|
|
12
12
|
items: {},
|
|
@@ -17,11 +17,11 @@ var z = { class: "chart-menu-trigger-area" }, B = ["aria-label"], V = /* @__PURE
|
|
|
17
17
|
},
|
|
18
18
|
setup(t) {
|
|
19
19
|
let n = t, i = () => n.forceDropdown || n.items.length > 1;
|
|
20
|
-
return (n, l) => (g(), a("div",
|
|
20
|
+
return (n, l) => (g(), a("div", R, [i() ? (g(), r(x(D), {
|
|
21
21
|
key: 1,
|
|
22
22
|
modal: !1
|
|
23
23
|
}, {
|
|
24
|
-
default: w(() => [c(x(
|
|
24
|
+
default: w(() => [c(x(O), {
|
|
25
25
|
class: "chart-menu-button",
|
|
26
26
|
"aria-label": "Chart options"
|
|
27
27
|
}, {
|
|
@@ -49,13 +49,13 @@ var z = { class: "chart-menu-trigger-area" }, B = ["aria-label"], V = /* @__PURE
|
|
|
49
49
|
})
|
|
50
50
|
], -1)]]),
|
|
51
51
|
_: 1
|
|
52
|
-
}), c(x(
|
|
52
|
+
}), c(x(E), null, {
|
|
53
53
|
default: w(() => [c(x(T), {
|
|
54
54
|
class: "chart-menu-content",
|
|
55
55
|
"side-offset": 4,
|
|
56
56
|
align: "end"
|
|
57
57
|
}, {
|
|
58
|
-
default: w(() => [(g(!0), a(e, null, v(t.items, (e) => (g(), r(x(
|
|
58
|
+
default: w(() => [(g(!0), a(e, null, v(t.items, (e) => (g(), r(x(ie), {
|
|
59
59
|
key: e.label,
|
|
60
60
|
class: "chart-menu-item",
|
|
61
61
|
onSelect: e.action
|
|
@@ -83,46 +83,46 @@ var z = { class: "chart-menu-trigger-area" }, B = ["aria-label"], V = /* @__PURE
|
|
|
83
83
|
"stroke-linecap": "round",
|
|
84
84
|
"stroke-linejoin": "round",
|
|
85
85
|
"aria-hidden": "true"
|
|
86
|
-
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8,
|
|
86
|
+
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, z))]));
|
|
87
87
|
}
|
|
88
|
-
}),
|
|
88
|
+
}), V = (e, t) => {
|
|
89
89
|
let n = e.__vccOpts || e;
|
|
90
90
|
for (let [e, r] of t) n[e] = r;
|
|
91
91
|
return n;
|
|
92
|
-
},
|
|
92
|
+
}, ce = /* @__PURE__ */ V(B, [["__scopeId", "data-v-b3c563e8"]]);
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region src/_shared/axes.ts
|
|
95
|
-
function
|
|
95
|
+
function H(e) {
|
|
96
96
|
return Math.round(e) + .5;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function U(e, t) {
|
|
99
99
|
let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
|
|
100
100
|
return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function W(e, t, n) {
|
|
103
103
|
if (!(n > 0) || !isFinite(n)) return [];
|
|
104
104
|
let r = [], i = Math.ceil(e / n) * n;
|
|
105
105
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
106
106
|
return r;
|
|
107
107
|
}
|
|
108
|
-
var
|
|
108
|
+
var G = new Intl.NumberFormat();
|
|
109
109
|
function K(e) {
|
|
110
|
-
return Math.abs(e) >= 1e3 ?
|
|
110
|
+
return Math.abs(e) >= 1e3 ? G.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
|
|
111
111
|
}
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/_shared/computeTicks.ts
|
|
114
|
-
function
|
|
114
|
+
function q(e) {
|
|
115
115
|
let { min: t, max: n, ticks: r } = e;
|
|
116
116
|
if (t === n) return [];
|
|
117
117
|
let i = e.displayOffset ?? 0;
|
|
118
118
|
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
|
|
119
|
+
if (typeof r == "number") return W(t + i, n + i, r).map((e) => e - i);
|
|
120
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = U(n - t, a);
|
|
121
|
+
return W(t + i, n + i, o).map((e) => e - i);
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
124
124
|
//#region src/_shared/useChartSize.ts
|
|
125
|
-
function
|
|
125
|
+
function le(e = {}) {
|
|
126
126
|
let t = _(null), n = _(0), r = null, i = null;
|
|
127
127
|
return h(() => {
|
|
128
128
|
t.value && (n.value = t.value.clientWidth, r = new ResizeObserver((t) => {
|
|
@@ -140,7 +140,7 @@ function ue(e = {}) {
|
|
|
140
140
|
measuredWidth: n
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function ue(e) {
|
|
144
144
|
let t = n(() => ({
|
|
145
145
|
top: (e.title() ? 30 : 10) + (e.hasInlineLegend() ? 20 : 0),
|
|
146
146
|
right: 10,
|
|
@@ -155,10 +155,10 @@ function de(e) {
|
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/tooltip-position.ts
|
|
158
|
-
var
|
|
159
|
-
function
|
|
158
|
+
var J = 16, Y = 8;
|
|
159
|
+
function X(e, t, n, r, i, a) {
|
|
160
160
|
if (i === "none") return {
|
|
161
|
-
left: e +
|
|
161
|
+
left: e + J,
|
|
162
162
|
top: t
|
|
163
163
|
};
|
|
164
164
|
let o = i === "chart" && a ? {
|
|
@@ -171,15 +171,15 @@ function Y(e, t, n, r, i, a) {
|
|
|
171
171
|
right: window.innerWidth,
|
|
172
172
|
top: 0,
|
|
173
173
|
bottom: window.innerHeight
|
|
174
|
-
}, s = e +
|
|
174
|
+
}, s = e + J + n > o.right - Y ? e - J - n : e + J, c = r / 2;
|
|
175
175
|
return {
|
|
176
176
|
left: s,
|
|
177
|
-
top: Math.min(Math.max(t, o.top +
|
|
177
|
+
top: Math.min(Math.max(t, o.top + Y + c), o.bottom - Y - c)
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/_shared/useChartTooltip.ts
|
|
182
|
-
function
|
|
182
|
+
function de(e) {
|
|
183
183
|
let t = e.touchYOffset ?? 50, n = _(null), r = _(!1), i = _(null), a = _(null), o = _(null);
|
|
184
184
|
function s(e) {
|
|
185
185
|
return "touches" in e ? e.touches[0] ?? null : e;
|
|
@@ -200,7 +200,7 @@ function fe(e) {
|
|
|
200
200
|
}
|
|
201
201
|
let s = i.value, c = e.containerRef.value;
|
|
202
202
|
if (!s || !c) return;
|
|
203
|
-
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } =
|
|
203
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = X(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
|
|
204
204
|
o.value = {
|
|
205
205
|
left: f - l.left,
|
|
206
206
|
top: p - l.top
|
|
@@ -246,17 +246,17 @@ function fe(e) {
|
|
|
246
246
|
}
|
|
247
247
|
//#endregion
|
|
248
248
|
//#region src/ChartMenu/download.ts
|
|
249
|
-
function
|
|
249
|
+
function fe(e, t) {
|
|
250
250
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
251
251
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function Z(e, t) {
|
|
254
254
|
let n = e.cloneNode(!0);
|
|
255
255
|
n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
256
256
|
let r = new XMLSerializer().serializeToString(n);
|
|
257
|
-
|
|
257
|
+
fe(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function pe(e, t) {
|
|
260
260
|
let n = e.cloneNode(!0);
|
|
261
261
|
n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
262
262
|
let 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;
|
|
@@ -265,16 +265,16 @@ function me(e, t) {
|
|
|
265
265
|
e.width = s * 2, e.height = c * 2;
|
|
266
266
|
let n = e.getContext("2d");
|
|
267
267
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
268
|
-
e &&
|
|
268
|
+
e && fe(e, `${t}.png`);
|
|
269
269
|
}), URL.revokeObjectURL(a);
|
|
270
270
|
}, o.src = a;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
|
|
272
|
+
function Q(e, t) {
|
|
273
|
+
fe(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
274
274
|
}
|
|
275
275
|
//#endregion
|
|
276
276
|
//#region src/_shared/useChartMenu.ts
|
|
277
|
-
function
|
|
277
|
+
function me(e) {
|
|
278
278
|
let t = _(null);
|
|
279
279
|
function r() {
|
|
280
280
|
let t = e.filename();
|
|
@@ -288,17 +288,17 @@ function he(e) {
|
|
|
288
288
|
let n = r(), i = [{
|
|
289
289
|
label: "Save as SVG",
|
|
290
290
|
action: () => {
|
|
291
|
-
t.value &&
|
|
291
|
+
t.value && Z(t.value, n);
|
|
292
292
|
}
|
|
293
293
|
}, {
|
|
294
294
|
label: "Save as PNG",
|
|
295
295
|
action: () => {
|
|
296
|
-
t.value &&
|
|
296
|
+
t.value && pe(t.value, n);
|
|
297
297
|
}
|
|
298
298
|
}];
|
|
299
299
|
return e.downloadLink() || i.push({
|
|
300
300
|
label: "Download CSV",
|
|
301
|
-
action: () =>
|
|
301
|
+
action: () => Q(e.getCsv(), n)
|
|
302
302
|
}), i;
|
|
303
303
|
}),
|
|
304
304
|
downloadLinkText: n(() => {
|
|
@@ -311,7 +311,7 @@ function he(e) {
|
|
|
311
311
|
}
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/_shared/seriesCsv.ts
|
|
314
|
-
function
|
|
314
|
+
function he(e) {
|
|
315
315
|
if (e.length === 0) return "";
|
|
316
316
|
let t = 0;
|
|
317
317
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -323,17 +323,17 @@ function ge(e) {
|
|
|
323
323
|
}
|
|
324
324
|
return i.join("\n");
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function ge(e, t, n = "category") {
|
|
327
327
|
if (t.length === 0 || e.length === 0) return "";
|
|
328
328
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
329
329
|
for (let n = 0; n < e.length; n++) {
|
|
330
|
-
let i = [
|
|
330
|
+
let i = [_e(e[n])];
|
|
331
331
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
332
332
|
r.push(i.join(","));
|
|
333
333
|
}
|
|
334
334
|
return r.join("\n");
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function _e(e) {
|
|
337
337
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
338
338
|
}
|
|
339
339
|
//#endregion
|
|
@@ -345,63 +345,63 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
345
345
|
"y2",
|
|
346
346
|
"stroke",
|
|
347
347
|
"stroke-dasharray"
|
|
348
|
-
],
|
|
348
|
+
], Se = [
|
|
349
349
|
"cx",
|
|
350
350
|
"cy",
|
|
351
351
|
"fill",
|
|
352
352
|
"fill-opacity",
|
|
353
353
|
"stroke"
|
|
354
|
-
],
|
|
354
|
+
], Ce = ["x", "y"], we = [
|
|
355
355
|
"x1",
|
|
356
356
|
"y1",
|
|
357
357
|
"x2",
|
|
358
358
|
"y2"
|
|
359
|
-
],
|
|
359
|
+
], Te = [
|
|
360
360
|
"x1",
|
|
361
361
|
"y1",
|
|
362
362
|
"x2",
|
|
363
363
|
"y2"
|
|
364
|
-
],
|
|
364
|
+
], Ee = [
|
|
365
365
|
"x1",
|
|
366
366
|
"y1",
|
|
367
367
|
"x2",
|
|
368
368
|
"y2"
|
|
369
|
-
],
|
|
369
|
+
], De = [
|
|
370
370
|
"x1",
|
|
371
371
|
"y1",
|
|
372
372
|
"x2",
|
|
373
373
|
"y2"
|
|
374
|
-
],
|
|
374
|
+
], Oe = ["x", "y"], ke = ["transform"], Ae = [
|
|
375
375
|
"x",
|
|
376
376
|
"y",
|
|
377
377
|
"text-anchor"
|
|
378
|
-
],
|
|
378
|
+
], je = ["x", "y"], Me = [
|
|
379
379
|
"d",
|
|
380
380
|
"fill",
|
|
381
381
|
"fill-opacity"
|
|
382
|
-
],
|
|
382
|
+
], Ne = [
|
|
383
383
|
"d",
|
|
384
384
|
"stroke",
|
|
385
385
|
"stroke-width",
|
|
386
386
|
"stroke-opacity",
|
|
387
387
|
"stroke-dasharray"
|
|
388
|
-
],
|
|
388
|
+
], Pe = [
|
|
389
389
|
"cx",
|
|
390
390
|
"cy",
|
|
391
391
|
"r",
|
|
392
392
|
"fill",
|
|
393
393
|
"fill-opacity",
|
|
394
394
|
"stroke"
|
|
395
|
-
],
|
|
395
|
+
], Fe = [
|
|
396
396
|
"d",
|
|
397
397
|
"fill",
|
|
398
398
|
"fill-opacity"
|
|
399
|
-
],
|
|
399
|
+
], Ie = [
|
|
400
400
|
"d",
|
|
401
401
|
"stroke",
|
|
402
402
|
"stroke-width",
|
|
403
403
|
"stroke-dasharray"
|
|
404
|
-
],
|
|
404
|
+
], Le = [
|
|
405
405
|
"x1",
|
|
406
406
|
"y1",
|
|
407
407
|
"x2",
|
|
@@ -409,7 +409,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
409
409
|
"stroke",
|
|
410
410
|
"stroke-width",
|
|
411
411
|
"stroke-dasharray"
|
|
412
|
-
],
|
|
412
|
+
], Re = [
|
|
413
413
|
"x1",
|
|
414
414
|
"y1",
|
|
415
415
|
"x2",
|
|
@@ -417,44 +417,44 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
417
417
|
"stroke",
|
|
418
418
|
"stroke-width",
|
|
419
419
|
"stroke-dasharray"
|
|
420
|
-
],
|
|
420
|
+
], ze = [
|
|
421
421
|
"x1",
|
|
422
422
|
"y1",
|
|
423
423
|
"x2",
|
|
424
424
|
"y2"
|
|
425
|
-
],
|
|
425
|
+
], Be = [
|
|
426
426
|
"x1",
|
|
427
427
|
"y1",
|
|
428
428
|
"x2",
|
|
429
429
|
"y2"
|
|
430
|
-
],
|
|
430
|
+
], Ve = [
|
|
431
431
|
"x1",
|
|
432
432
|
"y1",
|
|
433
433
|
"x2",
|
|
434
434
|
"y2"
|
|
435
|
-
],
|
|
435
|
+
], He = [
|
|
436
436
|
"cx",
|
|
437
437
|
"cy",
|
|
438
438
|
"fill"
|
|
439
|
-
],
|
|
439
|
+
], Ue = [
|
|
440
440
|
"x",
|
|
441
441
|
"y",
|
|
442
442
|
"width",
|
|
443
443
|
"height"
|
|
444
|
-
],
|
|
444
|
+
], We = [
|
|
445
445
|
"cx",
|
|
446
446
|
"cy",
|
|
447
447
|
"fill",
|
|
448
448
|
"fill-opacity",
|
|
449
449
|
"stroke"
|
|
450
|
-
],
|
|
450
|
+
], Ge = [
|
|
451
451
|
"x",
|
|
452
452
|
"y",
|
|
453
453
|
"fill"
|
|
454
|
-
],
|
|
454
|
+
], Ke = ["x", "y"], qe = { class: "line-chart-tooltip" }, Je = {
|
|
455
455
|
key: 0,
|
|
456
456
|
class: "line-chart-tooltip-label"
|
|
457
|
-
},
|
|
457
|
+
}, Ye = ["href", "download"], Xe = 36, Ze = 12, Qe = 7, $e = 16, et = /* @__PURE__ */ V(/* @__PURE__ */ l({
|
|
458
458
|
__name: "LineChart",
|
|
459
459
|
props: {
|
|
460
460
|
y: {},
|
|
@@ -493,7 +493,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
493
493
|
},
|
|
494
494
|
emits: ["hover"],
|
|
495
495
|
setup(t, { emit: c }) {
|
|
496
|
-
let l = t, f = c, { containerRef: h, measuredWidth: ee } =
|
|
496
|
+
let l = t, f = c, { containerRef: h, measuredWidth: ee } = le({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => D.value.some((e) => e.legend) || l.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description)) || !1), { padding: S, innerW: C, innerH: w } = ue({
|
|
497
497
|
title: () => l.title,
|
|
498
498
|
xLabel: () => l.xLabel,
|
|
499
499
|
yLabel: () => l.yLabel,
|
|
@@ -501,44 +501,44 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
501
501
|
width: () => _.value,
|
|
502
502
|
height: () => b.value
|
|
503
503
|
}), T = [];
|
|
504
|
-
function
|
|
504
|
+
function ie(e) {
|
|
505
505
|
return {
|
|
506
506
|
...e,
|
|
507
507
|
data: e.y ?? e.data ?? T
|
|
508
508
|
};
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function E(e) {
|
|
511
511
|
return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.yTickFormat ? l.yTickFormat(e) : K(e);
|
|
512
512
|
}
|
|
513
|
-
let
|
|
514
|
-
if (l.series && l.series.length > 0) return l.series.map(
|
|
513
|
+
let D = n(() => {
|
|
514
|
+
if (l.series && l.series.length > 0) return l.series.map(ie);
|
|
515
515
|
let e = l.y ?? l.data;
|
|
516
516
|
return e ? [{
|
|
517
517
|
data: e,
|
|
518
518
|
x: l.x
|
|
519
519
|
}] : [];
|
|
520
|
-
}),
|
|
520
|
+
}), O = n(() => l.areas ?? []), k = n(() => {
|
|
521
521
|
let e = 0;
|
|
522
|
-
for (let t of
|
|
523
|
-
for (let t of
|
|
522
|
+
for (let t of D.value) t.data.length > e && (e = t.data.length);
|
|
523
|
+
for (let t of O.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
|
|
524
524
|
return e;
|
|
525
|
-
}),
|
|
526
|
-
function
|
|
525
|
+
}), A = n(() => D.value.some((e) => e.x != null) || O.value.some((e) => e.x != null));
|
|
526
|
+
function j(e, t) {
|
|
527
527
|
return e.x ? Number(e.x[t]) : t;
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function M(e, t) {
|
|
530
530
|
return e.x ? Number(e.x[t]) : t;
|
|
531
531
|
}
|
|
532
|
-
let
|
|
532
|
+
let N = n(() => A.value ? 0 : l.xMin ?? 0), ae = n(() => {
|
|
533
533
|
let e = Infinity, t = -Infinity;
|
|
534
|
-
for (let n of
|
|
535
|
-
let i =
|
|
534
|
+
for (let n of D.value) for (let r = 0; r < n.data.length; r++) {
|
|
535
|
+
let i = j(n, r);
|
|
536
536
|
isFinite(i) && (i < e && (e = i), i > t && (t = i));
|
|
537
537
|
}
|
|
538
|
-
for (let n of
|
|
538
|
+
for (let n of O.value) {
|
|
539
539
|
let r = Math.max(n.upper.length, n.lower.length);
|
|
540
540
|
for (let i = 0; i < r; i++) {
|
|
541
|
-
let r =
|
|
541
|
+
let r = M(n, i);
|
|
542
542
|
isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
543
543
|
}
|
|
544
544
|
}
|
|
@@ -550,14 +550,14 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
550
550
|
max: 0
|
|
551
551
|
};
|
|
552
552
|
});
|
|
553
|
-
function
|
|
554
|
-
let { min: t, max: n } =
|
|
553
|
+
function P(e) {
|
|
554
|
+
let { min: t, max: n } = ae.value, r = n - t || 1;
|
|
555
555
|
return S.value.left + (e - t) / r * C.value;
|
|
556
556
|
}
|
|
557
|
-
let
|
|
557
|
+
let F = n(() => {
|
|
558
558
|
let e = Infinity, t = -Infinity;
|
|
559
|
-
for (let n of
|
|
560
|
-
for (let n of
|
|
559
|
+
for (let n of D.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
560
|
+
for (let n of O.value) {
|
|
561
561
|
for (let r of n.upper) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
562
562
|
for (let r of n.lower) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
563
563
|
}
|
|
@@ -571,66 +571,66 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
571
571
|
range: 1
|
|
572
572
|
};
|
|
573
573
|
});
|
|
574
|
-
function
|
|
574
|
+
function oe(e) {
|
|
575
575
|
let t = e.data;
|
|
576
576
|
if (t.length === 0) return "";
|
|
577
|
-
let { min: n, range: r } =
|
|
577
|
+
let { min: n, range: r } = F.value, i = w.value / r, a = S.value.top + w.value, o = "", s = !1;
|
|
578
578
|
for (let r = 0; r < t.length; r++) {
|
|
579
|
-
let c =
|
|
579
|
+
let c = j(e, r);
|
|
580
580
|
if (!isFinite(t[r]) || !isFinite(c)) {
|
|
581
581
|
s = !1;
|
|
582
582
|
continue;
|
|
583
583
|
}
|
|
584
|
-
let l =
|
|
584
|
+
let l = P(c), u = a - (t[r] - n) * i;
|
|
585
585
|
o += s ? `L${l},${u}` : `M${l},${u}`, s = !0;
|
|
586
586
|
}
|
|
587
587
|
return o;
|
|
588
588
|
}
|
|
589
|
-
function
|
|
590
|
-
let t = e.data, { min: n, range: r } =
|
|
589
|
+
function I(e) {
|
|
590
|
+
let t = e.data, { min: n, range: r } = F.value, i = w.value / r, a = S.value.top + w.value, o = [];
|
|
591
591
|
for (let r = 0; r < t.length; r++) {
|
|
592
|
-
let s =
|
|
592
|
+
let s = j(e, r);
|
|
593
593
|
!isFinite(t[r]) || !isFinite(s) || o.push({
|
|
594
|
-
x:
|
|
594
|
+
x: P(s),
|
|
595
595
|
y: a - (t[r] - n) * i
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
return o;
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function se(e) {
|
|
601
601
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
602
602
|
if (t === 0) return "";
|
|
603
|
-
let { min: n, range: r } =
|
|
604
|
-
for (let n = 0; n < t; n++) isFinite(e.upper[n]) && isFinite(e.lower[n]) && isFinite(
|
|
603
|
+
let { min: n, range: r } = F.value, i = w.value / r, a = S.value.top + w.value, o = (e) => a - (e - n) * i, s = [], c = [];
|
|
604
|
+
for (let n = 0; n < t; n++) isFinite(e.upper[n]) && isFinite(e.lower[n]) && isFinite(M(e, n)) ? c.push(n) : c.length && (s.push(c), c = []);
|
|
605
605
|
c.length && s.push(c);
|
|
606
606
|
let l = "";
|
|
607
607
|
for (let t of s) {
|
|
608
|
-
l += `M${
|
|
609
|
-
for (let n = 1; n < t.length; n++) l += `L${
|
|
610
|
-
for (let n = t.length - 1; n >= 0; n--) l += `L${
|
|
608
|
+
l += `M${P(M(e, t[0]))},${o(e.upper[t[0]])}`;
|
|
609
|
+
for (let n = 1; n < t.length; n++) l += `L${P(M(e, t[n]))},${o(e.upper[t[n]])}`;
|
|
610
|
+
for (let n = t.length - 1; n >= 0; n--) l += `L${P(M(e, t[n]))},${o(e.lower[t[n]])}`;
|
|
611
611
|
l += "Z";
|
|
612
612
|
}
|
|
613
613
|
return l;
|
|
614
614
|
}
|
|
615
|
-
function
|
|
616
|
-
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null &&
|
|
617
|
-
return
|
|
615
|
+
function L(e, t) {
|
|
616
|
+
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && D.value[e.seriesIndex] || D.value[0];
|
|
617
|
+
return P(r ? j(r, n) : n);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function R(e, t = !0) {
|
|
620
620
|
let n = S.value.top + w.value;
|
|
621
621
|
if (e.seriesIndex == null) {
|
|
622
|
-
let t =
|
|
622
|
+
let t = L(e, "start"), r = L(e, "end");
|
|
623
623
|
return t > r ? "" : `M${t},${S.value.top}L${r},${S.value.top}L${r},${n}L${t},${n}Z`;
|
|
624
624
|
}
|
|
625
|
-
let r =
|
|
625
|
+
let r = D.value[e.seriesIndex];
|
|
626
626
|
if (!r) return "";
|
|
627
|
-
let { min: i, range: a } =
|
|
627
|
+
let { min: i, range: a } = F.value, o = w.value / a, s = (e) => n - (e - i) * o, c = Math.max(0, e.startIndex), l = Math.min(r.data.length - 1, e.endIndex);
|
|
628
628
|
if (c > l) return "";
|
|
629
|
-
let u = `M${
|
|
630
|
-
for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${
|
|
631
|
-
return t && (u += `L${
|
|
629
|
+
let u = `M${P(j(r, c))},${s(r.data[c])}`;
|
|
630
|
+
for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${P(j(r, e))},${s(r.data[e])}`);
|
|
631
|
+
return t && (u += `L${P(j(r, l))},${n}`, u += `L${P(j(r, c))},${n}`, u += "Z"), u;
|
|
632
632
|
}
|
|
633
|
-
let
|
|
633
|
+
let z = n(() => {
|
|
634
634
|
let e = l.areaSections;
|
|
635
635
|
if (!e?.length) return {
|
|
636
636
|
labels: [],
|
|
@@ -639,7 +639,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
639
639
|
let t = [], n = S.value.left + C.value;
|
|
640
640
|
for (let r of e) {
|
|
641
641
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
642
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) *
|
|
642
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Qe, o = L(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : D.value[r.seriesIndex]?.color ?? "currentColor");
|
|
643
643
|
t.push({
|
|
644
644
|
cx: c,
|
|
645
645
|
labelText: e,
|
|
@@ -654,7 +654,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
654
654
|
let r = [];
|
|
655
655
|
for (let e of t) {
|
|
656
656
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
657
|
-
for (; n < r.length && !(t >= r[n] +
|
|
657
|
+
for (; n < r.length && !(t >= r[n] + $e);) n++;
|
|
658
658
|
e.row = n;
|
|
659
659
|
let i = e.cx + e.textWidth / 2;
|
|
660
660
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -664,11 +664,11 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
664
664
|
extraHeight: 0
|
|
665
665
|
} : {
|
|
666
666
|
labels: t,
|
|
667
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
667
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Xe + Ze
|
|
668
668
|
};
|
|
669
|
-
}),
|
|
669
|
+
}), B = n(() => {
|
|
670
670
|
let e = [];
|
|
671
|
-
for (let t of
|
|
671
|
+
for (let t of D.value) t.legend && e.push({
|
|
672
672
|
label: t.legend,
|
|
673
673
|
color: t.color ?? "currentColor",
|
|
674
674
|
type: "series",
|
|
@@ -677,7 +677,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
677
677
|
let t = l.areaSections;
|
|
678
678
|
if (t) for (let n of t) {
|
|
679
679
|
if (n.legend !== "inline" || !n.label && !n.description) continue;
|
|
680
|
-
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" :
|
|
680
|
+
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : D.value[n.seriesIndex]?.color ?? "currentColor");
|
|
681
681
|
e.push({
|
|
682
682
|
label: t,
|
|
683
683
|
color: r,
|
|
@@ -686,12 +686,12 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
return e;
|
|
689
|
-
}),
|
|
690
|
-
let { min: e, max: t } =
|
|
689
|
+
}), V = n(() => b.value + z.value.extraHeight), U = n(() => S.value.top + w.value + S.value.bottom + Ze), W = n(() => {
|
|
690
|
+
let { min: e, max: t } = F.value, n = (t) => H(S.value.top + w.value - (t - e) / F.value.range * w.value), r = (e) => l.yTickFormat ? l.yTickFormat(e) : K(e);
|
|
691
691
|
return e === t ? [{
|
|
692
692
|
value: r(e),
|
|
693
|
-
y:
|
|
694
|
-
}] :
|
|
693
|
+
y: H(S.value.top + w.value / 2)
|
|
694
|
+
}] : q({
|
|
695
695
|
min: e,
|
|
696
696
|
max: t,
|
|
697
697
|
ticks: l.yTicks,
|
|
@@ -700,18 +700,18 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
700
700
|
value: r(e),
|
|
701
701
|
y: n(e)
|
|
702
702
|
}));
|
|
703
|
-
}),
|
|
704
|
-
let { min: e, max: t } =
|
|
703
|
+
}), G = n(() => {
|
|
704
|
+
let { min: e, max: t } = ae.value;
|
|
705
705
|
if (e === t) return [];
|
|
706
|
-
let n =
|
|
706
|
+
let n = N.value, r = k.value, i = (e, t) => {
|
|
707
707
|
let r = e + n;
|
|
708
|
-
return l.xTickFormat ? l.xTickFormat(r, t) : !
|
|
708
|
+
return l.xTickFormat ? l.xTickFormat(r, t) : !A.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : K(r);
|
|
709
709
|
}, a;
|
|
710
|
-
if (l.xTicks == null && !
|
|
710
|
+
if (l.xTicks == null && !A.value && l.xLabels && l.xLabels.length === r) {
|
|
711
711
|
let e = Math.max(3, Math.floor(C.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
|
|
712
712
|
a = [];
|
|
713
713
|
for (let e = 0; e < r; e += t) a.push(e);
|
|
714
|
-
} else a =
|
|
714
|
+
} else a = q({
|
|
715
715
|
min: e,
|
|
716
716
|
max: t,
|
|
717
717
|
ticks: l.xTicks,
|
|
@@ -720,7 +720,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
720
720
|
});
|
|
721
721
|
let o = S.value.left, s = S.value.left + C.value;
|
|
722
722
|
return a.map((e, t) => {
|
|
723
|
-
let n =
|
|
723
|
+
let n = H(P(e)), r = "middle";
|
|
724
724
|
return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
|
|
725
725
|
value: i(e, t),
|
|
726
726
|
x: n,
|
|
@@ -728,49 +728,49 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
728
728
|
};
|
|
729
729
|
});
|
|
730
730
|
});
|
|
731
|
-
function
|
|
732
|
-
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv :
|
|
731
|
+
function J() {
|
|
732
|
+
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : he(D.value);
|
|
733
733
|
}
|
|
734
|
-
let
|
|
735
|
-
let e =
|
|
736
|
-
return e === null || !t ? null :
|
|
737
|
-
}),
|
|
738
|
-
function
|
|
734
|
+
let Y = n(() => !!l.tooltipData || !!l.tooltipTrigger), X = n(() => {
|
|
735
|
+
let e = _e.value, t = D.value[0];
|
|
736
|
+
return e === null || !t ? null : j(t, e);
|
|
737
|
+
}), fe = n(() => X.value === null ? 0 : P(X.value));
|
|
738
|
+
function Z(e, t) {
|
|
739
739
|
let n = e.data.length;
|
|
740
740
|
if (n === 0) return null;
|
|
741
741
|
let r = 0, i = Infinity;
|
|
742
742
|
for (let a = 0; a < n; a++) {
|
|
743
|
-
let n =
|
|
743
|
+
let n = j(e, a);
|
|
744
744
|
if (!isFinite(n)) continue;
|
|
745
745
|
let o = Math.abs(n - t);
|
|
746
746
|
o < i && (i = o, r = a);
|
|
747
747
|
}
|
|
748
748
|
return i === Infinity ? null : r;
|
|
749
749
|
}
|
|
750
|
-
let
|
|
751
|
-
let e =
|
|
750
|
+
let pe = n(() => {
|
|
751
|
+
let e = X.value;
|
|
752
752
|
if (e === null) return [];
|
|
753
|
-
let { min: t, range: n } =
|
|
754
|
-
for (let n of
|
|
755
|
-
let o =
|
|
753
|
+
let { min: t, range: n } = F.value, r = w.value / n, i = S.value.top + w.value, a = [];
|
|
754
|
+
for (let n of D.value) {
|
|
755
|
+
let o = Z(n, e);
|
|
756
756
|
if (o === null) continue;
|
|
757
757
|
let s = n.data[o];
|
|
758
758
|
isFinite(s) && a.push({
|
|
759
|
-
x:
|
|
759
|
+
x: P(j(n, o)),
|
|
760
760
|
y: i - (s - t) * r,
|
|
761
761
|
color: n.color ?? "currentColor"
|
|
762
762
|
});
|
|
763
763
|
}
|
|
764
764
|
return a;
|
|
765
|
-
}),
|
|
766
|
-
let e =
|
|
765
|
+
}), Q = n(() => {
|
|
766
|
+
let e = _e.value, t = X.value;
|
|
767
767
|
if (e === null || t === null) return null;
|
|
768
|
-
let n = t +
|
|
769
|
-
return r = l.xTickFormat ? l.xTickFormat(n, e) :
|
|
768
|
+
let n = t + N.value, r;
|
|
769
|
+
return r = l.xTickFormat ? l.xTickFormat(n, e) : A.value ? K(n) : l.xLabels?.[e], {
|
|
770
770
|
index: e,
|
|
771
771
|
xLabel: r,
|
|
772
|
-
values:
|
|
773
|
-
let r =
|
|
772
|
+
values: D.value.map((e, n) => {
|
|
773
|
+
let r = Z(e, t);
|
|
774
774
|
return {
|
|
775
775
|
value: r === null ? NaN : Number(e.data[r]),
|
|
776
776
|
color: e.color ?? "currentColor",
|
|
@@ -780,25 +780,25 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
780
780
|
data: l.tooltipData?.[e] ?? null
|
|
781
781
|
};
|
|
782
782
|
});
|
|
783
|
-
function
|
|
783
|
+
function ge(e) {
|
|
784
784
|
let t = h.value?.getBoundingClientRect();
|
|
785
785
|
if (!t) return null;
|
|
786
|
-
let n =
|
|
786
|
+
let n = D.value[0];
|
|
787
787
|
if (!n || n.data.length === 0) return null;
|
|
788
|
-
let { min: r, max: i } =
|
|
789
|
-
return
|
|
788
|
+
let { min: r, max: i } = ae.value, a = i - r || 1;
|
|
789
|
+
return Z(n, r + (e - t.left - S.value.left) / C.value * a);
|
|
790
790
|
}
|
|
791
|
-
let { hoverIndex:
|
|
792
|
-
enabled: () =>
|
|
791
|
+
let { hoverIndex: _e, tooltipRef: et, tooltipPos: $, handlers: tt } = de({
|
|
792
|
+
enabled: () => Y.value,
|
|
793
793
|
trigger: () => l.tooltipTrigger,
|
|
794
794
|
clamp: () => l.tooltipClamp,
|
|
795
|
-
pointerToIndex:
|
|
795
|
+
pointerToIndex: ge,
|
|
796
796
|
containerRef: h,
|
|
797
797
|
onHover: (e) => f("hover", e)
|
|
798
|
-
}), { svgRef: nt, items: rt, downloadLinkText: it, csvHref: at, resolvedFilename: ot } =
|
|
798
|
+
}), { svgRef: nt, items: rt, downloadLinkText: it, csvHref: at, resolvedFilename: ot } = me({
|
|
799
799
|
filename: () => l.filename,
|
|
800
800
|
legacyMenuLabel: () => l.menu,
|
|
801
|
-
getCsv:
|
|
801
|
+
getCsv: J,
|
|
802
802
|
downloadLink: () => l.downloadLink
|
|
803
803
|
});
|
|
804
804
|
return (n, c) => (g(), a("div", {
|
|
@@ -806,7 +806,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
806
806
|
ref: h,
|
|
807
807
|
class: "line-chart-wrapper"
|
|
808
808
|
}, [
|
|
809
|
-
t.menu ? (g(), r(
|
|
809
|
+
t.menu ? (g(), r(ce, {
|
|
810
810
|
key: 0,
|
|
811
811
|
items: x(rt)
|
|
812
812
|
}, null, 8, ["items"])) : i("", !0),
|
|
@@ -814,7 +814,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
814
814
|
ref_key: "svgRef",
|
|
815
815
|
ref: nt,
|
|
816
816
|
width: _.value,
|
|
817
|
-
height:
|
|
817
|
+
height: V.value
|
|
818
818
|
}, [
|
|
819
819
|
t.title ? (g(), a("text", {
|
|
820
820
|
key: 0,
|
|
@@ -825,7 +825,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
825
825
|
"font-weight": "600",
|
|
826
826
|
fill: "currentColor"
|
|
827
827
|
}, y(t.title), 9, ye)) : i("", !0),
|
|
828
|
-
|
|
828
|
+
B.value.length > 0 ? (g(), a("g", be, [(g(!0), a(e, null, v(B.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [t.type === "series" ? (g(), a("line", {
|
|
829
829
|
key: 0,
|
|
830
830
|
x1: x(S).left + n * 120,
|
|
831
831
|
y1: x(S).top - x(20) / 2,
|
|
@@ -843,29 +843,29 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
843
843
|
"fill-opacity": t.fillOpacity,
|
|
844
844
|
stroke: t.color,
|
|
845
845
|
"stroke-width": "1.5"
|
|
846
|
-
}, null, 8,
|
|
846
|
+
}, null, 8, Se)), o("text", {
|
|
847
847
|
x: x(S).left + n * 120 + 18,
|
|
848
848
|
y: x(S).top - x(20) / 2 + 4,
|
|
849
849
|
"font-size": "11",
|
|
850
850
|
fill: "currentColor"
|
|
851
|
-
}, y(t.label), 9,
|
|
851
|
+
}, y(t.label), 9, Ce)], 64))), 128))])) : i("", !0),
|
|
852
852
|
o("line", {
|
|
853
|
-
x1: x(
|
|
854
|
-
y1: x(
|
|
855
|
-
x2: x(
|
|
856
|
-
y2: x(
|
|
853
|
+
x1: x(H)(x(S).left),
|
|
854
|
+
y1: x(H)(x(S).top),
|
|
855
|
+
x2: x(H)(x(S).left),
|
|
856
|
+
y2: x(H)(x(S).top + x(w)),
|
|
857
857
|
stroke: "currentColor",
|
|
858
858
|
"stroke-opacity": "0.3"
|
|
859
|
-
}, null, 8,
|
|
859
|
+
}, null, 8, we),
|
|
860
860
|
o("line", {
|
|
861
|
-
x1: x(
|
|
862
|
-
y1: x(
|
|
863
|
-
x2: x(
|
|
864
|
-
y2: x(
|
|
861
|
+
x1: x(H)(x(S).left),
|
|
862
|
+
y1: x(H)(x(S).top + x(w)),
|
|
863
|
+
x2: x(H)(x(S).left + x(C)),
|
|
864
|
+
y2: x(H)(x(S).top + x(w)),
|
|
865
865
|
stroke: "currentColor",
|
|
866
866
|
"stroke-opacity": "0.3"
|
|
867
|
-
}, null, 8,
|
|
868
|
-
t.yGrid ? (g(!0), a(e, { key: 2 }, v(
|
|
867
|
+
}, null, 8, Te),
|
|
868
|
+
t.yGrid ? (g(!0), a(e, { key: 2 }, v(W.value, (e, t) => (g(), a("line", {
|
|
869
869
|
key: "yg" + t,
|
|
870
870
|
x1: x(S).left,
|
|
871
871
|
y1: e.y,
|
|
@@ -873,8 +873,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
873
873
|
y2: e.y,
|
|
874
874
|
stroke: "currentColor",
|
|
875
875
|
"stroke-opacity": "0.1"
|
|
876
|
-
}, null, 8,
|
|
877
|
-
t.xGrid ? (g(!0), a(e, { key: 3 }, v(
|
|
876
|
+
}, null, 8, Ee))), 128)) : i("", !0),
|
|
877
|
+
t.xGrid ? (g(!0), a(e, { key: 3 }, v(G.value, (e, t) => (g(), a("line", {
|
|
878
878
|
key: "xg" + t,
|
|
879
879
|
x1: e.x,
|
|
880
880
|
y1: x(S).top,
|
|
@@ -882,8 +882,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
882
882
|
y2: x(S).top + x(w),
|
|
883
883
|
stroke: "currentColor",
|
|
884
884
|
"stroke-opacity": "0.1"
|
|
885
|
-
}, null, 8,
|
|
886
|
-
(g(!0), a(e, null, v(
|
|
885
|
+
}, null, 8, De))), 128)) : i("", !0),
|
|
886
|
+
(g(!0), a(e, null, v(W.value, (e, t) => (g(), a("text", {
|
|
887
887
|
key: "y" + t,
|
|
888
888
|
"data-testid": "y-tick",
|
|
889
889
|
x: x(S).left - 6,
|
|
@@ -893,7 +893,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
893
893
|
"font-size": "10",
|
|
894
894
|
fill: "currentColor",
|
|
895
895
|
"fill-opacity": "0.6"
|
|
896
|
-
}, y(e.value), 9,
|
|
896
|
+
}, y(e.value), 9, Oe))), 128)),
|
|
897
897
|
t.yLabel ? (g(), a("text", {
|
|
898
898
|
key: 4,
|
|
899
899
|
x: 0,
|
|
@@ -902,8 +902,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
902
902
|
"text-anchor": "middle",
|
|
903
903
|
"font-size": "13",
|
|
904
904
|
fill: "currentColor"
|
|
905
|
-
}, y(t.yLabel), 9,
|
|
906
|
-
(g(!0), a(e, null, v(
|
|
905
|
+
}, y(t.yLabel), 9, ke)) : i("", !0),
|
|
906
|
+
(g(!0), a(e, null, v(G.value, (e, t) => (g(), a("text", {
|
|
907
907
|
key: "x" + t,
|
|
908
908
|
"data-testid": "x-tick",
|
|
909
909
|
x: e.x,
|
|
@@ -912,7 +912,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
912
912
|
"font-size": "10",
|
|
913
913
|
fill: "currentColor",
|
|
914
914
|
"fill-opacity": "0.6"
|
|
915
|
-
}, y(e.value), 9,
|
|
915
|
+
}, y(e.value), 9, Ae))), 128)),
|
|
916
916
|
t.xLabel ? (g(), a("text", {
|
|
917
917
|
key: 5,
|
|
918
918
|
x: x(S).left + x(C) / 2,
|
|
@@ -920,23 +920,23 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
920
920
|
"text-anchor": "middle",
|
|
921
921
|
"font-size": "13",
|
|
922
922
|
fill: "currentColor"
|
|
923
|
-
}, y(t.xLabel), 9,
|
|
924
|
-
(g(!0), a(e, null, v(
|
|
923
|
+
}, y(t.xLabel), 9, je)) : i("", !0),
|
|
924
|
+
(g(!0), a(e, null, v(O.value, (e, t) => (g(), a("path", {
|
|
925
925
|
key: "area" + t,
|
|
926
|
-
d:
|
|
926
|
+
d: se(e),
|
|
927
927
|
fill: e.color ?? "currentColor",
|
|
928
928
|
"fill-opacity": e.opacity ?? .2,
|
|
929
929
|
stroke: "none"
|
|
930
|
-
}, null, 8,
|
|
931
|
-
(g(!0), a(e, null, v(
|
|
930
|
+
}, null, 8, Me))), 128)),
|
|
931
|
+
(g(!0), a(e, null, v(D.value, (n, r) => (g(), a(e, { key: r }, [n.line === !1 ? i("", !0) : (g(), a("path", {
|
|
932
932
|
key: 0,
|
|
933
|
-
d:
|
|
933
|
+
d: oe(n),
|
|
934
934
|
fill: "none",
|
|
935
935
|
stroke: n.color ?? "currentColor",
|
|
936
936
|
"stroke-width": n.strokeWidth ?? 1.5,
|
|
937
937
|
"stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
|
|
938
938
|
"stroke-dasharray": n.dashed ? "6 3" : void 0
|
|
939
|
-
}, null, 8,
|
|
939
|
+
}, null, 8, Ne)), n.dots ? (g(!0), a(e, { key: 1 }, v(I(n), (e, r) => (g(), a("circle", {
|
|
940
940
|
key: r,
|
|
941
941
|
cx: e.x,
|
|
942
942
|
cy: e.y,
|
|
@@ -944,68 +944,68 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
944
944
|
fill: n.dotFill ?? n.color ?? "currentColor",
|
|
945
945
|
"fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
|
|
946
946
|
stroke: n.dotStroke ?? "none"
|
|
947
|
-
}, null, 8,
|
|
947
|
+
}, null, 8, Pe))), 128)) : i("", !0)], 64))), 128)),
|
|
948
948
|
(g(!0), a(e, null, v(t.areaSections ?? [], (t, n) => (g(), a(e, { key: "areasec" + n }, [
|
|
949
949
|
o("path", {
|
|
950
|
-
d:
|
|
951
|
-
fill: t.color ?? (t.seriesIndex == null ? "#999" :
|
|
950
|
+
d: R(t),
|
|
951
|
+
fill: t.color ?? (t.seriesIndex == null ? "#999" : D.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
952
952
|
"fill-opacity": t.opacity ?? .15,
|
|
953
953
|
stroke: "none"
|
|
954
|
-
}, null, 8,
|
|
954
|
+
}, null, 8, Fe),
|
|
955
955
|
t.seriesIndex == null ? i("", !0) : (g(), a("path", {
|
|
956
956
|
key: 0,
|
|
957
|
-
d:
|
|
957
|
+
d: R(t, !1),
|
|
958
958
|
fill: "none",
|
|
959
|
-
stroke: t.color ??
|
|
959
|
+
stroke: t.color ?? D.value[t.seriesIndex]?.color ?? "currentColor",
|
|
960
960
|
"stroke-width": t.strokeWidth ?? 2,
|
|
961
961
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
962
|
-
}, null, 8,
|
|
962
|
+
}, null, 8, Ie)),
|
|
963
963
|
t.seriesIndex == null ? (g(), a(e, { key: 1 }, [o("line", {
|
|
964
|
-
x1: x(
|
|
964
|
+
x1: x(H)(L(t, "start")),
|
|
965
965
|
y1: x(S).top,
|
|
966
|
-
x2: x(
|
|
966
|
+
x2: x(H)(L(t, "start")),
|
|
967
967
|
y2: x(S).top + x(w),
|
|
968
968
|
stroke: t.color ?? "#999",
|
|
969
969
|
"stroke-width": t.strokeWidth ?? 2,
|
|
970
970
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
971
|
-
}, null, 8,
|
|
972
|
-
x1: x(
|
|
971
|
+
}, null, 8, Le), o("line", {
|
|
972
|
+
x1: x(H)(L(t, "end")),
|
|
973
973
|
y1: x(S).top,
|
|
974
|
-
x2: x(
|
|
974
|
+
x2: x(H)(L(t, "end")),
|
|
975
975
|
y2: x(S).top + x(w),
|
|
976
976
|
stroke: t.color ?? "#999",
|
|
977
977
|
"stroke-width": t.strokeWidth ?? 2,
|
|
978
978
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
979
|
-
}, null, 8,
|
|
979
|
+
}, null, 8, Re)], 64)) : i("", !0),
|
|
980
980
|
o("line", {
|
|
981
|
-
x1: x(
|
|
981
|
+
x1: x(H)(L(t, "start")),
|
|
982
982
|
y1: x(S).top + x(w) - 4,
|
|
983
|
-
x2: x(
|
|
983
|
+
x2: x(H)(L(t, "start")),
|
|
984
984
|
y2: x(S).top + x(w) + 4,
|
|
985
985
|
stroke: "currentColor",
|
|
986
986
|
"stroke-opacity": "0.4"
|
|
987
|
-
}, null, 8,
|
|
987
|
+
}, null, 8, ze),
|
|
988
988
|
o("line", {
|
|
989
|
-
x1: x(
|
|
989
|
+
x1: x(H)(L(t, "end")),
|
|
990
990
|
y1: x(S).top + x(w) - 4,
|
|
991
|
-
x2: x(
|
|
991
|
+
x2: x(H)(L(t, "end")),
|
|
992
992
|
y2: x(S).top + x(w) + 4,
|
|
993
993
|
stroke: "currentColor",
|
|
994
994
|
"stroke-opacity": "0.4"
|
|
995
|
-
}, null, 8,
|
|
995
|
+
}, null, 8, Be)
|
|
996
996
|
], 64))), 128)),
|
|
997
|
-
|
|
997
|
+
Y.value && x(_e) !== null ? (g(), a("line", {
|
|
998
998
|
key: 6,
|
|
999
|
-
x1: x(
|
|
999
|
+
x1: x(H)(fe.value),
|
|
1000
1000
|
y1: x(S).top,
|
|
1001
|
-
x2: x(
|
|
1001
|
+
x2: x(H)(fe.value),
|
|
1002
1002
|
y2: x(S).top + x(w),
|
|
1003
1003
|
stroke: "currentColor",
|
|
1004
1004
|
"stroke-opacity": "0.3",
|
|
1005
1005
|
"stroke-dasharray": "4 2",
|
|
1006
1006
|
"pointer-events": "none"
|
|
1007
|
-
}, null, 8,
|
|
1008
|
-
(g(!0), a(e, null, v(
|
|
1007
|
+
}, null, 8, Ve)) : i("", !0),
|
|
1008
|
+
(g(!0), a(e, null, v(pe.value, (e, t) => (g(), a("circle", {
|
|
1009
1009
|
key: "hd" + t,
|
|
1010
1010
|
cx: e.x,
|
|
1011
1011
|
cy: e.y,
|
|
@@ -1014,8 +1014,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1014
1014
|
stroke: "var(--color-bg-0, #fff)",
|
|
1015
1015
|
"stroke-width": "2",
|
|
1016
1016
|
"pointer-events": "none"
|
|
1017
|
-
}, null, 8,
|
|
1018
|
-
|
|
1017
|
+
}, null, 8, He))), 128)),
|
|
1018
|
+
Y.value ? (g(), a("rect", d({
|
|
1019
1019
|
key: 7,
|
|
1020
1020
|
x: x(S).left,
|
|
1021
1021
|
y: x(S).top,
|
|
@@ -1026,64 +1026,64 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1026
1026
|
cursor: "crosshair",
|
|
1027
1027
|
"touch-action": "none"
|
|
1028
1028
|
}
|
|
1029
|
-
}, ne(x(tt), !0)), null, 16,
|
|
1030
|
-
(g(!0), a(e, null, v(
|
|
1029
|
+
}, ne(x(tt), !0)), null, 16, Ue)) : i("", !0),
|
|
1030
|
+
(g(!0), a(e, null, v(z.value.labels, (e, t) => (g(), a("g", { key: "seclab" + t }, [
|
|
1031
1031
|
o("circle", {
|
|
1032
1032
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
1033
|
-
cy:
|
|
1033
|
+
cy: U.value + e.row * Xe + 4,
|
|
1034
1034
|
r: "4",
|
|
1035
1035
|
fill: e.color,
|
|
1036
1036
|
"fill-opacity": e.fillOpacity,
|
|
1037
1037
|
stroke: e.color,
|
|
1038
1038
|
"stroke-width": "1.5"
|
|
1039
|
-
}, null, 8,
|
|
1039
|
+
}, null, 8, We),
|
|
1040
1040
|
e.labelText ? (g(), a("text", {
|
|
1041
1041
|
key: 0,
|
|
1042
1042
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1043
|
-
y:
|
|
1043
|
+
y: U.value + e.row * Xe + 8,
|
|
1044
1044
|
"font-size": "11",
|
|
1045
1045
|
"font-weight": "600",
|
|
1046
1046
|
fill: e.color
|
|
1047
|
-
}, y(e.labelText), 9,
|
|
1047
|
+
}, y(e.labelText), 9, Ge)) : i("", !0),
|
|
1048
1048
|
e.descText ? (g(), a("text", {
|
|
1049
1049
|
key: 1,
|
|
1050
1050
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1051
|
-
y:
|
|
1051
|
+
y: U.value + e.row * Xe + 22,
|
|
1052
1052
|
"font-size": "11",
|
|
1053
1053
|
fill: "currentColor",
|
|
1054
1054
|
"fill-opacity": "0.6"
|
|
1055
|
-
}, y(e.descText), 9,
|
|
1055
|
+
}, y(e.descText), 9, Ke)) : i("", !0)
|
|
1056
1056
|
]))), 128))
|
|
1057
1057
|
], 8, ve)),
|
|
1058
|
-
|
|
1058
|
+
Y.value && x(_e) !== null && Q.value ? (g(), a("div", {
|
|
1059
1059
|
key: 1,
|
|
1060
1060
|
ref_key: "tooltipRef",
|
|
1061
|
-
ref:
|
|
1061
|
+
ref: et,
|
|
1062
1062
|
class: "chart-tooltip-content",
|
|
1063
1063
|
style: m({
|
|
1064
1064
|
position: "absolute",
|
|
1065
1065
|
top: "0",
|
|
1066
1066
|
left: "0",
|
|
1067
1067
|
willChange: "transform",
|
|
1068
|
-
transform: x(
|
|
1069
|
-
visibility: x(
|
|
1068
|
+
transform: x($) ? `translate3d(${x($).left}px, ${x($).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
1069
|
+
visibility: x($) ? "visible" : "hidden"
|
|
1070
1070
|
})
|
|
1071
|
-
}, [te(n.$slots, "tooltip", p(u(
|
|
1071
|
+
}, [te(n.$slots, "tooltip", p(u(Q.value)), () => [o("div", qe, [Q.value.xLabel ? (g(), a("div", Je, y(Q.value.xLabel), 1)) : i("", !0), (g(!0), a(e, null, v(Q.value.values, (e) => (g(), a("div", {
|
|
1072
1072
|
key: e.seriesIndex,
|
|
1073
1073
|
class: "line-chart-tooltip-row"
|
|
1074
1074
|
}, [o("span", {
|
|
1075
1075
|
class: "line-chart-tooltip-swatch",
|
|
1076
1076
|
style: m({ background: e.color })
|
|
1077
|
-
}, null, 4), s(" " + y(isFinite(e.value) ?
|
|
1077
|
+
}, null, 4), s(" " + y(isFinite(e.value) ? E(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1078
1078
|
x(it) ? (g(), a("a", {
|
|
1079
1079
|
key: 2,
|
|
1080
1080
|
class: "line-chart-download-link",
|
|
1081
1081
|
href: x(at),
|
|
1082
1082
|
download: `${x(ot)()}.csv`
|
|
1083
|
-
}, y(x(it)), 9,
|
|
1083
|
+
}, y(x(it)), 9, Ye)) : i("", !0)
|
|
1084
1084
|
], 512));
|
|
1085
1085
|
}
|
|
1086
|
-
}), [["__scopeId", "data-v-083d1c2f"]]),
|
|
1086
|
+
}), [["__scopeId", "data-v-083d1c2f"]]), $ = ["width", "height"], tt = ["x"], nt = { key: 1 }, rt = [
|
|
1087
1087
|
"x",
|
|
1088
1088
|
"y",
|
|
1089
1089
|
"fill"
|
|
@@ -1128,7 +1128,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1128
1128
|
], _t = { class: "bar-chart-tooltip" }, vt = {
|
|
1129
1129
|
key: 0,
|
|
1130
1130
|
class: "bar-chart-tooltip-label"
|
|
1131
|
-
}, yt = ["href", "download"], bt = /* @__PURE__ */
|
|
1131
|
+
}, yt = ["href", "download"], bt = /* @__PURE__ */ V(/* @__PURE__ */ l({
|
|
1132
1132
|
__name: "BarChart",
|
|
1133
1133
|
props: {
|
|
1134
1134
|
data: {},
|
|
@@ -1167,7 +1167,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1167
1167
|
},
|
|
1168
1168
|
emits: ["hover"],
|
|
1169
1169
|
setup(t, { emit: c }) {
|
|
1170
|
-
let l = t, f = c, { containerRef: h, measuredWidth: ee } =
|
|
1170
|
+
let l = t, f = c, { containerRef: h, measuredWidth: ee } = le({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => E.value.some((e) => e.legend)), { padding: S, innerW: C, innerH: w } = ue({
|
|
1171
1171
|
title: () => l.title,
|
|
1172
1172
|
xLabel: () => l.xLabel,
|
|
1173
1173
|
yLabel: () => l.yLabel,
|
|
@@ -1175,7 +1175,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1175
1175
|
width: () => _.value,
|
|
1176
1176
|
height: () => b.value
|
|
1177
1177
|
}), T = [];
|
|
1178
|
-
function
|
|
1178
|
+
function ie(e) {
|
|
1179
1179
|
return {
|
|
1180
1180
|
data: e.y ?? e.data ?? T,
|
|
1181
1181
|
color: e.color,
|
|
@@ -1183,32 +1183,32 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1183
1183
|
legend: e.legend
|
|
1184
1184
|
};
|
|
1185
1185
|
}
|
|
1186
|
-
let
|
|
1187
|
-
if (l.series && l.series.length > 0) return l.series.map(
|
|
1186
|
+
let E = n(() => {
|
|
1187
|
+
if (l.series && l.series.length > 0) return l.series.map(ie);
|
|
1188
1188
|
let e = l.y ?? l.data;
|
|
1189
1189
|
return e ? [{ data: e }] : [];
|
|
1190
|
-
}),
|
|
1190
|
+
}), D = n(() => {
|
|
1191
1191
|
let e = l.categories?.length ?? 0;
|
|
1192
|
-
for (let t of
|
|
1192
|
+
for (let t of E.value) t.data.length > e && (e = t.data.length);
|
|
1193
1193
|
return e;
|
|
1194
|
-
}),
|
|
1195
|
-
let e =
|
|
1194
|
+
}), O = n(() => {
|
|
1195
|
+
let e = D.value, t = Array(e);
|
|
1196
1196
|
for (let n = 0; n < e; n++) t[n] = l.categories?.[n] ?? String(n);
|
|
1197
1197
|
return t;
|
|
1198
|
-
}),
|
|
1198
|
+
}), k = n(() => l.orientation === "vertical"), A = n(() => {
|
|
1199
1199
|
let e = Infinity, t = -Infinity;
|
|
1200
1200
|
if (l.layout === "stacked") {
|
|
1201
|
-
let n =
|
|
1201
|
+
let n = D.value;
|
|
1202
1202
|
for (let r = 0; r < n; r++) {
|
|
1203
1203
|
let n = 0, i = 0;
|
|
1204
|
-
for (let e of
|
|
1204
|
+
for (let e of E.value) {
|
|
1205
1205
|
if (r >= e.data.length) continue;
|
|
1206
1206
|
let t = Number(e.data[r]);
|
|
1207
1207
|
isFinite(t) && (t >= 0 ? n += t : i += t);
|
|
1208
1208
|
}
|
|
1209
1209
|
n > t && (t = n), i < e && (e = i);
|
|
1210
1210
|
}
|
|
1211
|
-
} else for (let n of
|
|
1211
|
+
} else for (let n of E.value) for (let r of n.data) {
|
|
1212
1212
|
let n = Number(r);
|
|
1213
1213
|
isFinite(n) && (n < e && (e = n), n > t && (t = n));
|
|
1214
1214
|
}
|
|
@@ -1221,30 +1221,30 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1221
1221
|
max: t,
|
|
1222
1222
|
range: r
|
|
1223
1223
|
};
|
|
1224
|
-
}),
|
|
1225
|
-
let e =
|
|
1226
|
-
return e > 0 ?
|
|
1227
|
-
}),
|
|
1228
|
-
let e =
|
|
1224
|
+
}), j = n(() => k.value ? C.value : w.value), M = n(() => k.value ? w.value : C.value), N = n(() => {
|
|
1225
|
+
let e = D.value;
|
|
1226
|
+
return e > 0 ? j.value / e : 0;
|
|
1227
|
+
}), ae = n(() => N.value * (1 - l.barPadding)), P = n(() => {
|
|
1228
|
+
let e = E.value.length;
|
|
1229
1229
|
if (e === 0) return 0;
|
|
1230
|
-
if (l.layout === "stacked" || e === 1) return
|
|
1230
|
+
if (l.layout === "stacked" || e === 1) return ae.value;
|
|
1231
1231
|
let t = l.groupGap * (e - 1);
|
|
1232
|
-
return Math.max(1, (
|
|
1232
|
+
return Math.max(1, (ae.value - t) / e);
|
|
1233
1233
|
});
|
|
1234
|
-
function
|
|
1235
|
-
return (
|
|
1234
|
+
function F(e) {
|
|
1235
|
+
return (k.value ? S.value.left : S.value.top) + e * N.value;
|
|
1236
1236
|
}
|
|
1237
|
-
let
|
|
1238
|
-
let { min: e, max: t } =
|
|
1239
|
-
return
|
|
1237
|
+
let oe = n(() => {
|
|
1238
|
+
let { min: e, max: t } = A.value, n = l.valueMin ?? 0;
|
|
1239
|
+
return I(Math.max(e, Math.min(t, n)));
|
|
1240
1240
|
});
|
|
1241
|
-
function
|
|
1242
|
-
let { min: t, range: n } =
|
|
1243
|
-
return
|
|
1241
|
+
function I(e) {
|
|
1242
|
+
let { min: t, range: n } = A.value, r = M.value / n;
|
|
1243
|
+
return k.value ? S.value.top + w.value - (e - t) * r : S.value.left + (e - t) * r;
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function se(e, t, n, r, i, a, o, s, c) {
|
|
1246
1246
|
let l = Math.min(e, t), u = Math.abs(e - t);
|
|
1247
|
-
return
|
|
1247
|
+
return k.value ? {
|
|
1248
1248
|
x: n,
|
|
1249
1249
|
y: l,
|
|
1250
1250
|
w: r,
|
|
@@ -1266,29 +1266,29 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1266
1266
|
seriesIndex: c
|
|
1267
1267
|
};
|
|
1268
1268
|
}
|
|
1269
|
-
let
|
|
1270
|
-
let e = [], t =
|
|
1269
|
+
let L = n(() => {
|
|
1270
|
+
let e = [], t = E.value, n = t.length;
|
|
1271
1271
|
if (n === 0) return e;
|
|
1272
|
-
let r =
|
|
1272
|
+
let r = D.value, i = N.value, a = ae.value, o = P.value, s = (i - a) / 2, c = oe.value;
|
|
1273
1273
|
for (let i = 0; i < r; i++) {
|
|
1274
|
-
let r =
|
|
1274
|
+
let r = F(i) + s;
|
|
1275
1275
|
if (l.layout === "stacked") {
|
|
1276
1276
|
let o = 0, s = 0;
|
|
1277
1277
|
for (let c = 0; c < n; c++) {
|
|
1278
1278
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
1279
1279
|
if (!isFinite(l)) continue;
|
|
1280
1280
|
let u = l >= 0 ? o : s, d = u + l;
|
|
1281
|
-
e.push(
|
|
1281
|
+
e.push(se(I(u), I(d), r, a, n.color ?? z(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
|
|
1282
1282
|
}
|
|
1283
1283
|
} else for (let a = 0; a < n; a++) {
|
|
1284
1284
|
let s = t[a], u = Number(s.data[i] ?? NaN);
|
|
1285
1285
|
if (!isFinite(u)) continue;
|
|
1286
1286
|
let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
|
|
1287
|
-
e.push(
|
|
1287
|
+
e.push(se(c, I(u), d, o, s.color ?? z(a), s.opacity ?? 1, u, i, a));
|
|
1288
1288
|
}
|
|
1289
1289
|
}
|
|
1290
1290
|
return e;
|
|
1291
|
-
}),
|
|
1291
|
+
}), R = [
|
|
1292
1292
|
"var(--color-primary, #3b82f6)",
|
|
1293
1293
|
"var(--color-accent, #f59e0b)",
|
|
1294
1294
|
"var(--color-success, #10b981)",
|
|
@@ -1296,107 +1296,107 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1296
1296
|
"var(--color-info, #6366f1)",
|
|
1297
1297
|
"var(--color-warning, #d97706)"
|
|
1298
1298
|
];
|
|
1299
|
-
function
|
|
1300
|
-
return
|
|
1299
|
+
function z(e) {
|
|
1300
|
+
return R[e % R.length];
|
|
1301
1301
|
}
|
|
1302
|
-
function
|
|
1302
|
+
function B(e) {
|
|
1303
1303
|
return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.valueTickFormat ? l.valueTickFormat(e) : K(e);
|
|
1304
1304
|
}
|
|
1305
|
-
let
|
|
1306
|
-
let { min: e, max: t } =
|
|
1305
|
+
let V = n(() => {
|
|
1306
|
+
let { min: e, max: t } = A.value, n = (e) => l.valueTickFormat ? l.valueTickFormat(e) : K(e);
|
|
1307
1307
|
if (e === t) return [{
|
|
1308
1308
|
value: n(e),
|
|
1309
|
-
pos:
|
|
1309
|
+
pos: H(I(e))
|
|
1310
1310
|
}];
|
|
1311
|
-
let r =
|
|
1312
|
-
return
|
|
1311
|
+
let r = k.value ? 50 : 80;
|
|
1312
|
+
return q({
|
|
1313
1313
|
min: e,
|
|
1314
1314
|
max: t,
|
|
1315
1315
|
ticks: l.valueTicks,
|
|
1316
|
-
targetTickCount:
|
|
1316
|
+
targetTickCount: M.value / r
|
|
1317
1317
|
}).map((e) => ({
|
|
1318
1318
|
value: n(e),
|
|
1319
|
-
pos:
|
|
1319
|
+
pos: H(I(e))
|
|
1320
1320
|
}));
|
|
1321
|
-
}),
|
|
1322
|
-
let e = [], t =
|
|
1321
|
+
}), U = n(() => {
|
|
1322
|
+
let e = [], t = D.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
|
|
1323
1323
|
for (let r = 0; r < t; r++) {
|
|
1324
|
-
let t =
|
|
1324
|
+
let t = F(r) + N.value / 2;
|
|
1325
1325
|
e.push({
|
|
1326
|
-
label: n(
|
|
1326
|
+
label: n(O.value[r], r),
|
|
1327
1327
|
pos: t,
|
|
1328
1328
|
anchor: "middle"
|
|
1329
1329
|
});
|
|
1330
1330
|
}
|
|
1331
1331
|
return e;
|
|
1332
|
-
}),
|
|
1332
|
+
}), W = n(() => {
|
|
1333
1333
|
let e = [];
|
|
1334
|
-
return
|
|
1334
|
+
return E.value.forEach((t, n) => {
|
|
1335
1335
|
t.legend && e.push({
|
|
1336
1336
|
label: t.legend,
|
|
1337
|
-
color: t.color ??
|
|
1337
|
+
color: t.color ?? z(n)
|
|
1338
1338
|
});
|
|
1339
1339
|
}), e;
|
|
1340
1340
|
});
|
|
1341
|
-
function
|
|
1341
|
+
function G() {
|
|
1342
1342
|
if (typeof l.csv == "function") return l.csv();
|
|
1343
1343
|
if (typeof l.csv == "string") return l.csv;
|
|
1344
|
-
let e =
|
|
1344
|
+
let e = E.value.map((e) => ({
|
|
1345
1345
|
label: e.legend,
|
|
1346
1346
|
data: e.data
|
|
1347
1347
|
}));
|
|
1348
|
-
return
|
|
1348
|
+
return ge(O.value, e);
|
|
1349
1349
|
}
|
|
1350
|
-
let
|
|
1351
|
-
function
|
|
1350
|
+
let J = n(() => !!l.tooltipData || !!l.tooltipTrigger);
|
|
1351
|
+
function Y(e, t) {
|
|
1352
1352
|
let n = h.value?.getBoundingClientRect();
|
|
1353
1353
|
if (!n) return null;
|
|
1354
|
-
let r =
|
|
1355
|
-
if (r === 0 ||
|
|
1356
|
-
let i =
|
|
1357
|
-
return Math.max(0, Math.min(r - 1, Math.floor(i /
|
|
1354
|
+
let r = D.value;
|
|
1355
|
+
if (r === 0 || N.value === 0) return null;
|
|
1356
|
+
let i = k.value ? e - n.left - S.value.left : t - n.top - S.value.top;
|
|
1357
|
+
return Math.max(0, Math.min(r - 1, Math.floor(i / N.value)));
|
|
1358
1358
|
}
|
|
1359
|
-
let { hoverIndex:
|
|
1360
|
-
enabled: () =>
|
|
1359
|
+
let { hoverIndex: X, tooltipRef: fe, tooltipPos: Z, handlers: pe } = de({
|
|
1360
|
+
enabled: () => J.value,
|
|
1361
1361
|
trigger: () => l.tooltipTrigger,
|
|
1362
1362
|
clamp: () => l.tooltipClamp,
|
|
1363
|
-
pointerToIndex:
|
|
1363
|
+
pointerToIndex: Y,
|
|
1364
1364
|
containerRef: h,
|
|
1365
1365
|
onHover: (e) => f("hover", e)
|
|
1366
|
-
}), { svgRef:
|
|
1366
|
+
}), { svgRef: Q, items: he, downloadLinkText: _e, csvHref: ve, resolvedFilename: ye } = me({
|
|
1367
1367
|
filename: () => l.filename,
|
|
1368
1368
|
legacyMenuLabel: () => l.menu,
|
|
1369
|
-
getCsv:
|
|
1369
|
+
getCsv: G,
|
|
1370
1370
|
downloadLink: () => l.downloadLink
|
|
1371
1371
|
}), be = n(() => {
|
|
1372
|
-
let e =
|
|
1373
|
-
if (e !== null) return
|
|
1372
|
+
let e = X.value;
|
|
1373
|
+
if (e !== null) return O.value[e];
|
|
1374
1374
|
}), xe = n(() => {
|
|
1375
|
-
let e =
|
|
1375
|
+
let e = X.value;
|
|
1376
1376
|
return e === null ? null : {
|
|
1377
1377
|
index: e,
|
|
1378
|
-
category:
|
|
1379
|
-
values:
|
|
1378
|
+
category: O.value[e] ?? String(e),
|
|
1379
|
+
values: E.value.map((t, n) => ({
|
|
1380
1380
|
value: Number(t.data[e] ?? NaN),
|
|
1381
|
-
color: t.color ??
|
|
1381
|
+
color: t.color ?? z(n),
|
|
1382
1382
|
seriesIndex: n
|
|
1383
1383
|
})),
|
|
1384
1384
|
data: l.tooltipData?.[e] ?? null
|
|
1385
1385
|
};
|
|
1386
|
-
}),
|
|
1387
|
-
let e =
|
|
1386
|
+
}), Se = n(() => {
|
|
1387
|
+
let e = X.value;
|
|
1388
1388
|
if (e === null) return null;
|
|
1389
|
-
let t =
|
|
1390
|
-
return
|
|
1389
|
+
let t = F(e);
|
|
1390
|
+
return k.value ? {
|
|
1391
1391
|
x: t,
|
|
1392
1392
|
y: S.value.top,
|
|
1393
|
-
w:
|
|
1393
|
+
w: N.value,
|
|
1394
1394
|
h: w.value
|
|
1395
1395
|
} : {
|
|
1396
1396
|
x: S.value.left,
|
|
1397
1397
|
y: t,
|
|
1398
1398
|
w: C.value,
|
|
1399
|
-
h:
|
|
1399
|
+
h: N.value
|
|
1400
1400
|
};
|
|
1401
1401
|
});
|
|
1402
1402
|
return (n, c) => (g(), a("div", {
|
|
@@ -1404,13 +1404,13 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1404
1404
|
ref: h,
|
|
1405
1405
|
class: "bar-chart-wrapper"
|
|
1406
1406
|
}, [
|
|
1407
|
-
t.menu ? (g(), r(
|
|
1407
|
+
t.menu ? (g(), r(ce, {
|
|
1408
1408
|
key: 0,
|
|
1409
|
-
items: x(
|
|
1409
|
+
items: x(he)
|
|
1410
1410
|
}, null, 8, ["items"])) : i("", !0),
|
|
1411
1411
|
(g(), a("svg", {
|
|
1412
1412
|
ref_key: "svgRef",
|
|
1413
|
-
ref:
|
|
1413
|
+
ref: Q,
|
|
1414
1414
|
width: _.value,
|
|
1415
1415
|
height: b.value
|
|
1416
1416
|
}, [
|
|
@@ -1423,7 +1423,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1423
1423
|
"font-weight": "600",
|
|
1424
1424
|
fill: "currentColor"
|
|
1425
1425
|
}, y(t.title), 9, tt)) : i("", !0),
|
|
1426
|
-
|
|
1426
|
+
W.value.length > 0 ? (g(), a("g", nt, [(g(!0), a(e, null, v(W.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [o("rect", {
|
|
1427
1427
|
x: x(S).left + n * 120,
|
|
1428
1428
|
y: x(S).top - x(20) / 2 - 5,
|
|
1429
1429
|
width: "12",
|
|
@@ -1436,41 +1436,41 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1436
1436
|
fill: "currentColor"
|
|
1437
1437
|
}, y(t.label), 9, it)], 64))), 128))])) : i("", !0),
|
|
1438
1438
|
o("line", {
|
|
1439
|
-
x1: x(
|
|
1440
|
-
y1: x(
|
|
1441
|
-
x2: x(
|
|
1442
|
-
y2: x(
|
|
1439
|
+
x1: x(H)(x(S).left),
|
|
1440
|
+
y1: x(H)(x(S).top),
|
|
1441
|
+
x2: x(H)(x(S).left),
|
|
1442
|
+
y2: x(H)(x(S).top + x(w)),
|
|
1443
1443
|
stroke: "currentColor",
|
|
1444
1444
|
"stroke-opacity": "0.3"
|
|
1445
1445
|
}, null, 8, at),
|
|
1446
1446
|
o("line", {
|
|
1447
|
-
x1: x(
|
|
1448
|
-
y1: x(
|
|
1449
|
-
x2: x(
|
|
1450
|
-
y2: x(
|
|
1447
|
+
x1: x(H)(x(S).left),
|
|
1448
|
+
y1: x(H)(x(S).top + x(w)),
|
|
1449
|
+
x2: x(H)(x(S).left + x(C)),
|
|
1450
|
+
y2: x(H)(x(S).top + x(w)),
|
|
1451
1451
|
stroke: "currentColor",
|
|
1452
1452
|
"stroke-opacity": "0.3"
|
|
1453
1453
|
}, null, 8, ot),
|
|
1454
|
-
t.valueGrid ? (g(!0), a(e, { key: 2 }, v(
|
|
1454
|
+
t.valueGrid ? (g(!0), a(e, { key: 2 }, v(V.value, (e, t) => (g(), a("line", {
|
|
1455
1455
|
key: "vg" + t,
|
|
1456
|
-
x1:
|
|
1457
|
-
y1:
|
|
1458
|
-
x2:
|
|
1459
|
-
y2:
|
|
1456
|
+
x1: k.value ? x(S).left : e.pos,
|
|
1457
|
+
y1: k.value ? e.pos : x(S).top,
|
|
1458
|
+
x2: k.value ? x(S).left + x(C) : e.pos,
|
|
1459
|
+
y2: k.value ? e.pos : x(S).top + x(w),
|
|
1460
1460
|
stroke: "currentColor",
|
|
1461
1461
|
"stroke-opacity": "0.1"
|
|
1462
1462
|
}, null, 8, st))), 128)) : i("", !0),
|
|
1463
|
-
|
|
1463
|
+
Se.value && J.value ? (g(), a("rect", {
|
|
1464
1464
|
key: 3,
|
|
1465
|
-
x:
|
|
1466
|
-
y:
|
|
1467
|
-
width:
|
|
1468
|
-
height:
|
|
1465
|
+
x: Se.value.x,
|
|
1466
|
+
y: Se.value.y,
|
|
1467
|
+
width: Se.value.w,
|
|
1468
|
+
height: Se.value.h,
|
|
1469
1469
|
fill: "currentColor",
|
|
1470
1470
|
"fill-opacity": "0.06",
|
|
1471
1471
|
"pointer-events": "none"
|
|
1472
1472
|
}, null, 8, ct)) : i("", !0),
|
|
1473
|
-
|
|
1473
|
+
k.value ? (g(!0), a(e, { key: 4 }, v(V.value, (e, t) => (g(), a("text", {
|
|
1474
1474
|
key: "vt" + t,
|
|
1475
1475
|
"data-testid": "value-tick",
|
|
1476
1476
|
x: x(S).left - 6,
|
|
@@ -1480,7 +1480,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1480
1480
|
"font-size": "10",
|
|
1481
1481
|
fill: "currentColor",
|
|
1482
1482
|
"fill-opacity": "0.6"
|
|
1483
|
-
}, y(e.value), 9, lt))), 128)) : (g(!0), a(e, { key: 5 }, v(
|
|
1483
|
+
}, y(e.value), 9, lt))), 128)) : (g(!0), a(e, { key: 5 }, v(V.value, (e, t) => (g(), a("text", {
|
|
1484
1484
|
key: "vt" + t,
|
|
1485
1485
|
"data-testid": "value-tick",
|
|
1486
1486
|
x: e.pos,
|
|
@@ -1499,7 +1499,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1499
1499
|
"font-size": "13",
|
|
1500
1500
|
fill: "currentColor"
|
|
1501
1501
|
}, y(t.yLabel), 9, dt)) : i("", !0),
|
|
1502
|
-
|
|
1502
|
+
k.value ? (g(!0), a(e, { key: 7 }, v(U.value, (e, t) => (g(), a("text", {
|
|
1503
1503
|
key: "ct" + t,
|
|
1504
1504
|
"data-testid": "category-tick",
|
|
1505
1505
|
x: e.pos,
|
|
@@ -1508,7 +1508,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1508
1508
|
"font-size": "10",
|
|
1509
1509
|
fill: "currentColor",
|
|
1510
1510
|
"fill-opacity": "0.6"
|
|
1511
|
-
}, y(e.label), 9, ft))), 128)) : (g(!0), a(e, { key: 8 }, v(
|
|
1511
|
+
}, y(e.label), 9, ft))), 128)) : (g(!0), a(e, { key: 8 }, v(U.value, (e, t) => (g(), a("text", {
|
|
1512
1512
|
key: "ct" + t,
|
|
1513
1513
|
"data-testid": "category-tick",
|
|
1514
1514
|
x: x(S).left - 6,
|
|
@@ -1527,7 +1527,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1527
1527
|
"font-size": "13",
|
|
1528
1528
|
fill: "currentColor"
|
|
1529
1529
|
}, y(t.xLabel), 9, mt)) : i("", !0),
|
|
1530
|
-
(g(!0), a(e, null, v(
|
|
1530
|
+
(g(!0), a(e, null, v(L.value, (e, t) => (g(), a("rect", {
|
|
1531
1531
|
key: "bar" + t,
|
|
1532
1532
|
"data-testid": "bar",
|
|
1533
1533
|
"data-category": e.categoryIndex,
|
|
@@ -1539,7 +1539,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1539
1539
|
fill: e.color,
|
|
1540
1540
|
"fill-opacity": e.opacity
|
|
1541
1541
|
}, null, 8, ht))), 128)),
|
|
1542
|
-
|
|
1542
|
+
J.value ? (g(), a("rect", d({
|
|
1543
1543
|
key: 10,
|
|
1544
1544
|
x: x(S).left,
|
|
1545
1545
|
y: x(S).top,
|
|
@@ -1550,20 +1550,20 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1550
1550
|
cursor: "crosshair",
|
|
1551
1551
|
"touch-action": "none"
|
|
1552
1552
|
}
|
|
1553
|
-
}, ne(x(
|
|
1554
|
-
], 8,
|
|
1555
|
-
|
|
1553
|
+
}, ne(x(pe), !0)), null, 16, gt)) : i("", !0)
|
|
1554
|
+
], 8, $)),
|
|
1555
|
+
J.value && x(X) !== null && xe.value ? (g(), a("div", {
|
|
1556
1556
|
key: 1,
|
|
1557
1557
|
ref_key: "tooltipRef",
|
|
1558
|
-
ref:
|
|
1558
|
+
ref: fe,
|
|
1559
1559
|
class: "chart-tooltip-content",
|
|
1560
1560
|
style: m({
|
|
1561
1561
|
position: "absolute",
|
|
1562
1562
|
top: "0",
|
|
1563
1563
|
left: "0",
|
|
1564
1564
|
willChange: "transform",
|
|
1565
|
-
transform: x(
|
|
1566
|
-
visibility: x(
|
|
1565
|
+
transform: x(Z) ? `translate3d(${x(Z).left}px, ${x(Z).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
1566
|
+
visibility: x(Z) ? "visible" : "hidden"
|
|
1567
1567
|
})
|
|
1568
1568
|
}, [te(n.$slots, "tooltip", p(u(xe.value)), () => [o("div", _t, [be.value ? (g(), a("div", vt, y(be.value), 1)) : i("", !0), (g(!0), a(e, null, v(xe.value.values, (e) => (g(), a("div", {
|
|
1569
1569
|
key: e.seriesIndex,
|
|
@@ -1571,13 +1571,13 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1571
1571
|
}, [o("span", {
|
|
1572
1572
|
class: "bar-chart-tooltip-swatch",
|
|
1573
1573
|
style: m({ background: e.color })
|
|
1574
|
-
}, null, 4), s(" " + y(isFinite(e.value) ?
|
|
1575
|
-
x(
|
|
1574
|
+
}, null, 4), s(" " + y(isFinite(e.value) ? B(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1575
|
+
x(_e) ? (g(), a("a", {
|
|
1576
1576
|
key: 2,
|
|
1577
1577
|
class: "bar-chart-download-link",
|
|
1578
1578
|
href: x(ve),
|
|
1579
1579
|
download: `${x(ye)()}.csv`
|
|
1580
|
-
}, y(x(
|
|
1580
|
+
}, y(x(_e)), 9, yt)) : i("", !0)
|
|
1581
1581
|
], 512));
|
|
1582
1582
|
}
|
|
1583
1583
|
}), [["__scopeId", "data-v-4f604d9f"]]), xt = {
|
|
@@ -5731,12 +5731,13 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5731
5731
|
}, kt = {
|
|
5732
5732
|
key: 2,
|
|
5733
5733
|
class: "choropleth-legend-continuous"
|
|
5734
|
-
}, At = { class: "choropleth-legend-ticks" }, jt = ["viewBox"], Mt = ["innerHTML"], Nt = "http://www.w3.org/2000/svg", Pt = 450, Ft = 1e3, It = /* @__PURE__ */
|
|
5734
|
+
}, At = { class: "choropleth-legend-ticks" }, jt = ["viewBox"], Mt = ["innerHTML"], Nt = "http://www.w3.org/2000/svg", Pt = 450, Ft = 1e3, It = /* @__PURE__ */ V(/* @__PURE__ */ l({
|
|
5735
5735
|
__name: "ChoroplethMap",
|
|
5736
5736
|
props: {
|
|
5737
5737
|
topology: {},
|
|
5738
5738
|
data: {},
|
|
5739
5739
|
geoType: { default: "states" },
|
|
5740
|
+
dataGeoType: {},
|
|
5740
5741
|
width: {},
|
|
5741
5742
|
height: {},
|
|
5742
5743
|
colorScale: {},
|
|
@@ -5774,110 +5775,131 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5774
5775
|
"update:focus"
|
|
5775
5776
|
],
|
|
5776
5777
|
setup(t, { emit: c }) {
|
|
5777
|
-
let l = t, d = c, ne = (e) => e, x = _(null), S = _(null), T = _(null), E = _(null), D =
|
|
5778
|
+
let l = t, d = c, ne = (e) => e, x = _(null), S = _(null), T = _(null), ie = _(null), E = _(null), D = _(null), O = re(), k = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!O.tooltip), A = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), M = null, R = null, z = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), V = !1, H = typeof window < "u" && "ontouchstart" in window, U = null, W = {
|
|
5778
5779
|
width: 0,
|
|
5779
5780
|
height: 0
|
|
5780
|
-
},
|
|
5781
|
+
}, G = null, K = !1, q = null, le = _(!1), ue = 0, J = 0, Y = 0;
|
|
5781
5782
|
function de() {
|
|
5782
|
-
if (
|
|
5783
|
+
if (H) return;
|
|
5783
5784
|
let e = T.value;
|
|
5784
|
-
e && (e.addEventListener("click",
|
|
5785
|
+
e && (e.addEventListener("click", st), e.addEventListener("mouseover", st), e.addEventListener("mousemove", ct), e.addEventListener("mouseout", lt));
|
|
5785
5786
|
}
|
|
5786
|
-
function
|
|
5787
|
+
function fe() {
|
|
5787
5788
|
let e = T.value;
|
|
5788
|
-
e && (e.removeEventListener("click",
|
|
5789
|
+
e && (e.removeEventListener("click", st), e.removeEventListener("mouseover", st), e.removeEventListener("mousemove", ct), e.removeEventListener("mouseout", lt));
|
|
5789
5790
|
}
|
|
5790
|
-
function
|
|
5791
|
-
|
|
5791
|
+
function Q() {
|
|
5792
|
+
at();
|
|
5792
5793
|
}
|
|
5793
5794
|
h(() => {
|
|
5794
|
-
|
|
5795
|
+
me(), de(), dt(), ye(), Ze(), window.addEventListener("scroll", Q, {
|
|
5795
5796
|
passive: !0,
|
|
5796
5797
|
capture: !0
|
|
5797
|
-
}), window.addEventListener("resize",
|
|
5798
|
+
}), window.addEventListener("resize", Q, { passive: !0 });
|
|
5798
5799
|
}), ee(() => {
|
|
5799
|
-
|
|
5800
|
+
U?.disconnect(), Y && cancelAnimationFrame(Y), he(), fe(), window.removeEventListener("scroll", Q, { capture: !0 }), window.removeEventListener("resize", Q);
|
|
5800
5801
|
});
|
|
5801
|
-
function
|
|
5802
|
+
function me() {
|
|
5802
5803
|
if (!S.value || !T.value) return;
|
|
5803
|
-
let e =
|
|
5804
|
-
|
|
5805
|
-
|
|
5804
|
+
let e = oe(S.value), t = Math.max(12, l.focusZoomLevel);
|
|
5805
|
+
q = P().scaleExtent([1, t]).on("start", () => {
|
|
5806
|
+
V = !0, at();
|
|
5806
5807
|
}).on("zoom", (e) => {
|
|
5807
5808
|
T.value && T.value.setAttribute("transform", e.transform);
|
|
5808
5809
|
let t = e.transform;
|
|
5809
|
-
|
|
5810
|
+
le.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
5810
5811
|
}).on("end", () => {
|
|
5811
|
-
|
|
5812
|
-
}),
|
|
5813
|
-
let t =
|
|
5812
|
+
V = !1;
|
|
5813
|
+
}), q.filter((e) => {
|
|
5814
|
+
let t = Pe.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
|
|
5814
5815
|
if (e.type === "wheel" || e.type === "dblclick") {
|
|
5815
5816
|
if (!n) return !1;
|
|
5816
5817
|
} else if (e.type === "mousedown" || e.type === "touchstart") {
|
|
5817
5818
|
if (!r) return !1;
|
|
5818
5819
|
} else if (!n && !r) return !1;
|
|
5819
5820
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
5820
|
-
}), e.call(
|
|
5821
|
+
}), e.call(q);
|
|
5821
5822
|
}
|
|
5822
|
-
function
|
|
5823
|
-
S.value &&
|
|
5823
|
+
function he() {
|
|
5824
|
+
S.value && q && (oe(S.value).on(".zoom", null), q = null);
|
|
5824
5825
|
}
|
|
5825
|
-
function
|
|
5826
|
-
let t =
|
|
5826
|
+
function ge(e) {
|
|
5827
|
+
let t = Fe.value, n = je.value, r = [];
|
|
5827
5828
|
for (let i of e) {
|
|
5828
|
-
let e =
|
|
5829
|
-
|
|
5829
|
+
let e = i.geoType ?? l.geoType, a = t.get(e);
|
|
5830
|
+
if (!a) continue;
|
|
5831
|
+
let o = a.get(i.id);
|
|
5832
|
+
if (!o) {
|
|
5833
|
+
let t = n.get(e)?.get(i.id);
|
|
5834
|
+
t && (o = a.get(t));
|
|
5835
|
+
}
|
|
5836
|
+
o && r.push({
|
|
5837
|
+
item: i,
|
|
5838
|
+
geoType: e,
|
|
5839
|
+
feature: o,
|
|
5840
|
+
key: `${e}:${String(o.id)}`
|
|
5841
|
+
});
|
|
5830
5842
|
}
|
|
5831
5843
|
return r;
|
|
5832
5844
|
}
|
|
5833
|
-
function
|
|
5834
|
-
let t =
|
|
5835
|
-
for (let
|
|
5836
|
-
|
|
5837
|
-
e && n.push(e);
|
|
5838
|
-
}
|
|
5839
|
-
return n;
|
|
5845
|
+
function _e(e) {
|
|
5846
|
+
let t = /* @__PURE__ */ new Set();
|
|
5847
|
+
for (let n of ge(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
|
|
5848
|
+
return t;
|
|
5840
5849
|
}
|
|
5841
|
-
let
|
|
5842
|
-
function
|
|
5843
|
-
if (!S.value || !
|
|
5844
|
-
let e =
|
|
5850
|
+
let ve = !1;
|
|
5851
|
+
function ye() {
|
|
5852
|
+
if (!S.value || !q) return;
|
|
5853
|
+
let e = ge(Pe.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
|
|
5845
5854
|
for (let e of t) {
|
|
5846
|
-
let t =
|
|
5847
|
-
t &&
|
|
5855
|
+
let t = A.get(String(e.feature.id));
|
|
5856
|
+
t && r.set(t, e.item.style ?? "solid");
|
|
5848
5857
|
}
|
|
5849
|
-
for (let e of
|
|
5850
|
-
for (let e of
|
|
5851
|
-
|
|
5852
|
-
for (let e of
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
let i = ge && t.length > 0;
|
|
5856
|
-
if (ge = !0, t.length === 0) {
|
|
5857
|
-
G.transform(r, I), Ze();
|
|
5858
|
+
for (let [e] of z) r.has(e) || e === R || rt(e);
|
|
5859
|
+
for (let [e, t] of r) z.get(e) === t && e !== R || e !== R && nt(e, t);
|
|
5860
|
+
z.clear();
|
|
5861
|
+
for (let [e, t] of r) z.set(e, t);
|
|
5862
|
+
if (be(n), e.length === 0) {
|
|
5863
|
+
ve = !0, at();
|
|
5858
5864
|
return;
|
|
5859
5865
|
}
|
|
5860
|
-
let
|
|
5866
|
+
let i = oe(S.value);
|
|
5867
|
+
i.interrupt();
|
|
5868
|
+
let a = ve;
|
|
5869
|
+
ve = !0;
|
|
5870
|
+
let [[o, s], [c, u]] = ke.value.bounds({
|
|
5861
5871
|
type: "FeatureCollection",
|
|
5862
|
-
features:
|
|
5863
|
-
}),
|
|
5864
|
-
if (!
|
|
5865
|
-
let e = String(
|
|
5866
|
-
if (!
|
|
5867
|
-
let
|
|
5868
|
-
|
|
5872
|
+
features: e.map((e) => e.feature)
|
|
5873
|
+
}), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = F.translate(Ce.value / 2 - p * d, we.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, ee = () => {
|
|
5874
|
+
if (!k.value || !h) return;
|
|
5875
|
+
let e = String(h.id), t = A.get(e);
|
|
5876
|
+
if (!t) return;
|
|
5877
|
+
let n = t.getBoundingClientRect();
|
|
5878
|
+
$e(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
5869
5879
|
};
|
|
5870
|
-
|
|
5880
|
+
a ? ($(), i.transition().duration(Pt).call(q.transform, m).on("end", ee)) : (q.transform(i, m), ee());
|
|
5871
5881
|
}
|
|
5872
|
-
function
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
e.
|
|
5882
|
+
function be(e) {
|
|
5883
|
+
let t = E.value;
|
|
5884
|
+
if (!t) return;
|
|
5885
|
+
let n = new Set(e.map((e) => e.key));
|
|
5886
|
+
for (let [e, t] of B) n.has(e) || (t.remove(), B.delete(e));
|
|
5887
|
+
let r = ke.value, i = Ae.value + 1.5;
|
|
5888
|
+
for (let { item: n, feature: a, key: o } of e) {
|
|
5889
|
+
let e = B.get(o);
|
|
5890
|
+
e || (e = document.createElementNS(Nt, "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), B.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), tt(e, n.style);
|
|
5891
|
+
}
|
|
5892
|
+
}
|
|
5893
|
+
function xe() {
|
|
5894
|
+
if (!S.value || !q) return;
|
|
5895
|
+
Pe.value.length > 0 && d("update:focus", null);
|
|
5896
|
+
let e = oe(S.value);
|
|
5897
|
+
e.interrupt(), $(), e.transition().duration(Pt).call(q.transform, F);
|
|
5876
5898
|
}
|
|
5877
5899
|
C(() => l.focusZoomLevel, () => {
|
|
5878
|
-
|
|
5900
|
+
q && q.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), ye();
|
|
5879
5901
|
});
|
|
5880
|
-
let
|
|
5902
|
+
let Se = n(() => l.width && l.height ? l.height / l.width : .625), Ce = n(() => Ft), we = n(() => Ft * Se.value), Te = n(() => {
|
|
5881
5903
|
let e = b(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
|
|
5882
5904
|
for (let e of t) {
|
|
5883
5905
|
let t = xt[String(e.id).padStart(5, "0")];
|
|
@@ -5888,46 +5910,76 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5888
5910
|
type: "Feature",
|
|
5889
5911
|
id: t,
|
|
5890
5912
|
properties: { name: St[t] ?? t },
|
|
5891
|
-
geometry:
|
|
5913
|
+
geometry: se(e, i)
|
|
5892
5914
|
});
|
|
5893
5915
|
return {
|
|
5894
5916
|
type: "FeatureCollection",
|
|
5895
5917
|
features: r
|
|
5896
5918
|
};
|
|
5897
|
-
}),
|
|
5898
|
-
if (l.geoType === "hsas") return
|
|
5919
|
+
}), Ee = n(() => {
|
|
5920
|
+
if (l.geoType === "hsas") return Te.value;
|
|
5899
5921
|
if (l.geoType === "counties") {
|
|
5900
5922
|
let e = b(l.topology);
|
|
5901
|
-
return
|
|
5923
|
+
return I(e, e.objects.counties);
|
|
5902
5924
|
}
|
|
5903
5925
|
let e = b(l.topology);
|
|
5904
|
-
return
|
|
5905
|
-
}),
|
|
5926
|
+
return I(e, e.objects.states);
|
|
5927
|
+
}), De = n(() => {
|
|
5906
5928
|
if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
|
|
5907
5929
|
let e = b(l.topology);
|
|
5908
|
-
return
|
|
5909
|
-
}),
|
|
5930
|
+
return L(e, e.objects.states, (e, t) => e !== t);
|
|
5931
|
+
}), Oe = n(() => N().fitExtent([[0, 0], [Ce.value, we.value]], Ee.value)), ke = n(() => ae(Oe.value)), Ae = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), je = n(() => {
|
|
5910
5932
|
let e = /* @__PURE__ */ new Map();
|
|
5911
|
-
for (let t of
|
|
5933
|
+
for (let [t, n] of Fe.value) {
|
|
5934
|
+
let r = /* @__PURE__ */ new Map();
|
|
5935
|
+
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
5936
|
+
e.set(t, r);
|
|
5937
|
+
}
|
|
5912
5938
|
return e;
|
|
5913
|
-
})
|
|
5939
|
+
});
|
|
5940
|
+
function Me(e) {
|
|
5941
|
+
let t = l.dataGeoType;
|
|
5942
|
+
if (!t || t === l.geoType) return e;
|
|
5943
|
+
if (l.geoType === "counties" && t === "hsas") return xt[e];
|
|
5944
|
+
if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
5945
|
+
}
|
|
5946
|
+
let Ne = n(() => {
|
|
5914
5947
|
let e = /* @__PURE__ */ new Map();
|
|
5915
|
-
for (let t of
|
|
5948
|
+
for (let t of Ee.value.features) t.id != null && e.set(String(t.id), t);
|
|
5916
5949
|
return e;
|
|
5917
|
-
}),
|
|
5950
|
+
}), Pe = n(() => {
|
|
5918
5951
|
let e = l.focus;
|
|
5919
|
-
return e == null ? [] : Array.isArray(e) ? e : [e];
|
|
5920
|
-
}),
|
|
5952
|
+
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
5953
|
+
}), Fe = n(() => {
|
|
5954
|
+
let e = /* @__PURE__ */ new Map();
|
|
5955
|
+
e.set(l.geoType, Ne.value);
|
|
5956
|
+
let t = b(l.topology), n = t?.objects;
|
|
5957
|
+
if (!n) return e;
|
|
5958
|
+
let r = (e) => {
|
|
5959
|
+
let t = /* @__PURE__ */ new Map();
|
|
5960
|
+
for (let n of e) n.id != null && t.set(String(n.id), n);
|
|
5961
|
+
return t;
|
|
5962
|
+
};
|
|
5963
|
+
if (!e.has("states") && n.states) {
|
|
5964
|
+
let i = I(t, n.states);
|
|
5965
|
+
e.set("states", r(i.features));
|
|
5966
|
+
}
|
|
5967
|
+
if (!e.has("counties") && n.counties) {
|
|
5968
|
+
let i = I(t, n.counties);
|
|
5969
|
+
e.set("counties", r(i.features));
|
|
5970
|
+
}
|
|
5971
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(Te.value.features)), e;
|
|
5972
|
+
}), Ie = n(() => {
|
|
5921
5973
|
let e = /* @__PURE__ */ new Map();
|
|
5922
5974
|
if (!l.data) return e;
|
|
5923
|
-
let t =
|
|
5924
|
-
for (let
|
|
5925
|
-
e.set(
|
|
5926
|
-
let r =
|
|
5927
|
-
r && e.set(r,
|
|
5975
|
+
let t = l.dataGeoType ?? l.geoType, n = je.value.get(t);
|
|
5976
|
+
for (let t of l.data) {
|
|
5977
|
+
e.set(t.id, t.value);
|
|
5978
|
+
let r = n?.get(t.id);
|
|
5979
|
+
r && e.set(r, t.value);
|
|
5928
5980
|
}
|
|
5929
5981
|
return e;
|
|
5930
|
-
}),
|
|
5982
|
+
}), Le = n(() => {
|
|
5931
5983
|
if (!l.data || l.data.length === 0) return {
|
|
5932
5984
|
min: 0,
|
|
5933
5985
|
max: 1
|
|
@@ -5944,8 +5996,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5944
5996
|
min: 0,
|
|
5945
5997
|
max: 1
|
|
5946
5998
|
};
|
|
5947
|
-
}),
|
|
5948
|
-
function
|
|
5999
|
+
}), Re = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), ze = n(() => Array.isArray(l.colorScale) && !Re.value), Be = n(() => ze.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Ve = n(() => ze.value ? "" : l.colorScale?.max ?? "#08519c");
|
|
6000
|
+
function He(e) {
|
|
5949
6001
|
let t = e.replace("#", "");
|
|
5950
6002
|
return [
|
|
5951
6003
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -5953,226 +6005,239 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5953
6005
|
parseInt(t.slice(4, 6), 16)
|
|
5954
6006
|
];
|
|
5955
6007
|
}
|
|
5956
|
-
function
|
|
5957
|
-
let [t, n, r] =
|
|
6008
|
+
function Ue(e) {
|
|
6009
|
+
let [t, n, r] = He(Be.value), [i, a, o] = He(Ve.value);
|
|
5958
6010
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
5959
6011
|
}
|
|
5960
|
-
let
|
|
5961
|
-
if (!
|
|
6012
|
+
let We = n(() => ze.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), Ge = n(() => {
|
|
6013
|
+
if (!Re.value) return null;
|
|
5962
6014
|
let e = /* @__PURE__ */ new Map();
|
|
5963
6015
|
for (let t of l.colorScale) e.set(t.value, t.color);
|
|
5964
6016
|
return e;
|
|
5965
6017
|
});
|
|
5966
|
-
function
|
|
5967
|
-
let t =
|
|
6018
|
+
function Ke(e) {
|
|
6019
|
+
let t = Me(e);
|
|
6020
|
+
return t == null ? void 0 : Ie.value.get(t);
|
|
6021
|
+
}
|
|
6022
|
+
function qe(e) {
|
|
6023
|
+
let t = Ke(e), n = l.noDataColor;
|
|
5968
6024
|
if (t == null) return n;
|
|
5969
|
-
let r =
|
|
6025
|
+
let r = Ge.value;
|
|
5970
6026
|
if (r) return r.get(String(t)) ?? n;
|
|
5971
|
-
let i =
|
|
6027
|
+
let i = We.value;
|
|
5972
6028
|
if (i) {
|
|
5973
6029
|
let e = t;
|
|
5974
6030
|
for (let t of i) if (e >= t.min) return t.color;
|
|
5975
6031
|
return n;
|
|
5976
6032
|
}
|
|
5977
|
-
let { min: a, max: o } =
|
|
5978
|
-
return
|
|
6033
|
+
let { min: a, max: o } = Le.value;
|
|
6034
|
+
return Ue((t - a) / (o - a));
|
|
5979
6035
|
}
|
|
5980
|
-
let
|
|
5981
|
-
function
|
|
6036
|
+
let Je = (e) => e.properties?.name ?? String(e.id);
|
|
6037
|
+
function Ye(e) {
|
|
5982
6038
|
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat ? l.tooltipValueFormat(e) : String(e);
|
|
5983
6039
|
}
|
|
5984
|
-
function
|
|
5985
|
-
return t == null ? e : `${e}: ${
|
|
6040
|
+
function Xe(e, t) {
|
|
6041
|
+
return t == null ? e : `${e}: ${Ye(t)}`;
|
|
5986
6042
|
}
|
|
5987
|
-
function
|
|
5988
|
-
let e =
|
|
6043
|
+
function Ze() {
|
|
6044
|
+
let e = D.value?.getEl();
|
|
5989
6045
|
if (!e) return;
|
|
5990
|
-
|
|
6046
|
+
U?.disconnect();
|
|
5991
6047
|
let t = !1;
|
|
5992
|
-
|
|
6048
|
+
U = new ResizeObserver((e) => {
|
|
5993
6049
|
let n = e[0]?.contentRect;
|
|
5994
|
-
n && (
|
|
5995
|
-
}),
|
|
6050
|
+
n && (W.width = n.width, W.height = n.height, !t && K && G ? (t = !0, Qe(G.x, G.y)) : t = !0);
|
|
6051
|
+
}), U.observe(e);
|
|
5996
6052
|
}
|
|
5997
|
-
function
|
|
5998
|
-
let n =
|
|
6053
|
+
function Qe(e, t) {
|
|
6054
|
+
let n = D.value?.getEl();
|
|
5999
6055
|
if (!n) return;
|
|
6000
|
-
let r = x.value?.getBoundingClientRect(), { left: i, top: a } =
|
|
6056
|
+
let r = x.value?.getBoundingClientRect(), { left: i, top: a } = X(e, t, W.width, W.height, l.tooltipClamp, r);
|
|
6001
6057
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
6002
6058
|
}
|
|
6003
|
-
function
|
|
6004
|
-
let r =
|
|
6059
|
+
function $e(e, t, n) {
|
|
6060
|
+
let r = j.get(e);
|
|
6005
6061
|
if (!r) return;
|
|
6006
|
-
let i =
|
|
6007
|
-
!i || !a || (i.setData(r),
|
|
6062
|
+
let i = D.value, a = i?.getEl();
|
|
6063
|
+
!i || !a || (i.setData(r), G = {
|
|
6008
6064
|
x: t,
|
|
6009
6065
|
y: n
|
|
6010
|
-
},
|
|
6066
|
+
}, K = !0, Qe(t, n), a.style.visibility = "visible");
|
|
6011
6067
|
}
|
|
6012
|
-
function
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
let e =
|
|
6016
|
-
!e || !
|
|
6017
|
-
x:
|
|
6018
|
-
y:
|
|
6019
|
-
}, e.style.transform = `translate3d(${
|
|
6068
|
+
function et(e, t) {
|
|
6069
|
+
K && (ue = e, J = t, !Y && (Y = requestAnimationFrame(() => {
|
|
6070
|
+
Y = 0;
|
|
6071
|
+
let e = D.value?.getEl();
|
|
6072
|
+
!e || !K || (G = {
|
|
6073
|
+
x: ue,
|
|
6074
|
+
y: J
|
|
6075
|
+
}, e.style.transform = `translate3d(${ue + 16}px, ${J}px, 0) translateY(-50%)`);
|
|
6020
6076
|
})));
|
|
6021
6077
|
}
|
|
6022
|
-
function
|
|
6023
|
-
if (!
|
|
6024
|
-
|
|
6025
|
-
let e =
|
|
6078
|
+
function $() {
|
|
6079
|
+
if (!K) return;
|
|
6080
|
+
K = !1, G = null;
|
|
6081
|
+
let e = D.value?.getEl();
|
|
6026
6082
|
e && (e.style.visibility = "hidden");
|
|
6027
6083
|
}
|
|
6028
|
-
function
|
|
6029
|
-
e.
|
|
6084
|
+
function tt(e, t) {
|
|
6085
|
+
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"));
|
|
6030
6086
|
}
|
|
6031
|
-
function
|
|
6032
|
-
e.setAttribute("stroke-width", String(
|
|
6087
|
+
function nt(e, t = "solid") {
|
|
6088
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Ae.value + 1)), e.setAttribute("stroke", "#555"), tt(e, t);
|
|
6033
6089
|
}
|
|
6034
|
-
function
|
|
6035
|
-
|
|
6090
|
+
function rt(e) {
|
|
6091
|
+
e.setAttribute("stroke-width", String(Ae.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
6036
6092
|
}
|
|
6037
|
-
function
|
|
6038
|
-
|
|
6093
|
+
function it(e) {
|
|
6094
|
+
R !== e && (R && !z.has(R) && rt(R), R = e, nt(e, z.get(e) ?? "solid"));
|
|
6095
|
+
}
|
|
6096
|
+
function at() {
|
|
6097
|
+
if (R) {
|
|
6098
|
+
let e = z.get(R);
|
|
6099
|
+
e == null ? rt(R) : nt(R, e), R = null, d("stateHover", null);
|
|
6100
|
+
}
|
|
6101
|
+
$();
|
|
6039
6102
|
}
|
|
6040
|
-
function
|
|
6103
|
+
function ot(e) {
|
|
6041
6104
|
let t = e;
|
|
6042
6105
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
6043
6106
|
return t ? t.dataset.featId ?? null : null;
|
|
6044
6107
|
}
|
|
6045
|
-
function
|
|
6046
|
-
if (
|
|
6047
|
-
let t = e, n =
|
|
6108
|
+
function st(e) {
|
|
6109
|
+
if (V) return;
|
|
6110
|
+
let t = e, n = ot(t.target);
|
|
6048
6111
|
if (!n) return;
|
|
6049
|
-
let r =
|
|
6112
|
+
let r = j.get(n);
|
|
6050
6113
|
if (!r) return;
|
|
6051
6114
|
let i = {
|
|
6052
6115
|
id: r.id,
|
|
6053
6116
|
name: r.name,
|
|
6054
6117
|
value: r.value
|
|
6055
6118
|
};
|
|
6056
|
-
e.type === "click" ? (d("stateClick", i), d("update:focus",
|
|
6119
|
+
e.type === "click" ? (d("stateClick", i), d("update:focus", _e(Pe.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (it(A.get(n)), k.value && $e(n, t.clientX, t.clientY), d("stateHover", i));
|
|
6057
6120
|
}
|
|
6058
|
-
function
|
|
6059
|
-
|
|
6121
|
+
function ct(e) {
|
|
6122
|
+
V || et(e.clientX, e.clientY);
|
|
6060
6123
|
}
|
|
6061
|
-
function
|
|
6124
|
+
function lt(e) {
|
|
6062
6125
|
let t = e.relatedTarget;
|
|
6063
|
-
t && T.value?.contains(t) ||
|
|
6126
|
+
t && T.value?.contains(t) || at();
|
|
6064
6127
|
}
|
|
6065
|
-
function
|
|
6128
|
+
function ut(e) {
|
|
6066
6129
|
let t = document.createElementNS(Nt, "path");
|
|
6067
6130
|
return e && t.setAttribute("d", e), t;
|
|
6068
6131
|
}
|
|
6069
|
-
function
|
|
6070
|
-
let e =
|
|
6071
|
-
if (!e) return;
|
|
6132
|
+
function dt() {
|
|
6133
|
+
let e = ie.value, t = E.value;
|
|
6134
|
+
if (!e || !t) return;
|
|
6072
6135
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6136
|
+
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
6137
|
+
A.clear(), j.clear(), M = null, R = null, z.clear(), B.clear();
|
|
6138
|
+
let n = ke.value, r = Ee.value.features, i = l.strokeColor, a = String(Ae.value), o = !k.value, s = document.createDocumentFragment();
|
|
6139
|
+
for (let e of r) {
|
|
6140
|
+
let t = String(e.id), r = Je(e), c = Ke(t), l = ut(n(e));
|
|
6141
|
+
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) {
|
|
6078
6142
|
let e = document.createElementNS(Nt, "title");
|
|
6079
|
-
e.textContent =
|
|
6143
|
+
e.textContent = Xe(r, c), l.appendChild(e);
|
|
6080
6144
|
}
|
|
6081
|
-
|
|
6082
|
-
id:
|
|
6083
|
-
name:
|
|
6145
|
+
s.appendChild(l), A.set(t, l), j.set(t, {
|
|
6146
|
+
id: t,
|
|
6147
|
+
name: r,
|
|
6084
6148
|
value: c,
|
|
6085
6149
|
feature: e
|
|
6086
6150
|
});
|
|
6087
6151
|
}
|
|
6088
|
-
let
|
|
6089
|
-
if (
|
|
6090
|
-
let e =
|
|
6091
|
-
e.setAttribute("fill", "none"), e.setAttribute("stroke",
|
|
6152
|
+
let c = De.value;
|
|
6153
|
+
if (c) {
|
|
6154
|
+
let e = ut(n(c));
|
|
6155
|
+
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), M = e;
|
|
6092
6156
|
}
|
|
6093
|
-
e.appendChild(
|
|
6157
|
+
e.appendChild(s);
|
|
6094
6158
|
}
|
|
6095
|
-
function
|
|
6096
|
-
let e = !
|
|
6097
|
-
for (let [t, n] of
|
|
6098
|
-
let r =
|
|
6099
|
-
if (n.setAttribute("fill",
|
|
6159
|
+
function ft() {
|
|
6160
|
+
let e = !k.value;
|
|
6161
|
+
for (let [t, n] of A) {
|
|
6162
|
+
let r = Ke(t), i = j.get(t);
|
|
6163
|
+
if (n.setAttribute("fill", qe(t)), i && (i.value = r), e && i) {
|
|
6100
6164
|
let e = n.firstElementChild;
|
|
6101
|
-
e && (e.textContent =
|
|
6165
|
+
e && (e.textContent = Xe(i.name, r));
|
|
6102
6166
|
}
|
|
6103
6167
|
}
|
|
6104
6168
|
}
|
|
6105
|
-
function
|
|
6106
|
-
for (let e of
|
|
6107
|
-
|
|
6169
|
+
function pt() {
|
|
6170
|
+
for (let e of A.values()) e === R || z.has(e) || rt(e);
|
|
6171
|
+
M && M.setAttribute("stroke", l.strokeColor);
|
|
6108
6172
|
}
|
|
6109
|
-
function
|
|
6173
|
+
function mt() {
|
|
6110
6174
|
return typeof l.menu == "string" ? l.menu : "choropleth";
|
|
6111
6175
|
}
|
|
6112
|
-
let
|
|
6176
|
+
let ht = n(() => l.legend && (Re.value || ze.value || l.data)), gt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), _t = n(() => {
|
|
6113
6177
|
let e = [];
|
|
6114
6178
|
for (let t = 0; t <= 10; t++) {
|
|
6115
6179
|
let n = t / 10;
|
|
6116
6180
|
e.push({
|
|
6117
6181
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
6118
|
-
color:
|
|
6182
|
+
color: Ue(n)
|
|
6119
6183
|
});
|
|
6120
6184
|
}
|
|
6121
6185
|
return e;
|
|
6122
|
-
}),
|
|
6186
|
+
}), vt = new Intl.NumberFormat("en-US", {
|
|
6123
6187
|
notation: "compact",
|
|
6124
6188
|
maximumFractionDigits: 1
|
|
6125
|
-
}),
|
|
6126
|
-
let { min: e, max: t } =
|
|
6189
|
+
}), yt = n(() => {
|
|
6190
|
+
let { min: e, max: t } = Le.value, n = t - e, r = [];
|
|
6127
6191
|
for (let t = 1; t <= 3; t++) {
|
|
6128
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
6192
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? vt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
6129
6193
|
r.push({
|
|
6130
6194
|
value: o,
|
|
6131
6195
|
pct: i * 100
|
|
6132
6196
|
});
|
|
6133
6197
|
}
|
|
6134
6198
|
return r;
|
|
6135
|
-
}),
|
|
6199
|
+
}), bt = n(() => {
|
|
6136
6200
|
let e = [];
|
|
6137
|
-
if (
|
|
6201
|
+
if (Re.value) for (let t of l.colorScale) e.push({
|
|
6138
6202
|
key: t.value,
|
|
6139
6203
|
color: t.color,
|
|
6140
6204
|
label: t.value
|
|
6141
6205
|
});
|
|
6142
|
-
else if (
|
|
6206
|
+
else if (ze.value) for (let t of gt.value) e.push({
|
|
6143
6207
|
key: String(t.min),
|
|
6144
6208
|
color: t.color,
|
|
6145
6209
|
label: t.label ?? String(t.min)
|
|
6146
6210
|
});
|
|
6147
6211
|
return e;
|
|
6148
|
-
}),
|
|
6149
|
-
let e =
|
|
6212
|
+
}), Ct = n(() => `linear-gradient(to right, ${_t.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), It = n(() => {
|
|
6213
|
+
let e = mt();
|
|
6150
6214
|
return [{
|
|
6151
6215
|
label: "Save as SVG",
|
|
6152
6216
|
action: () => {
|
|
6153
|
-
S.value &&
|
|
6217
|
+
S.value && Z(S.value, e);
|
|
6154
6218
|
}
|
|
6155
6219
|
}, {
|
|
6156
6220
|
label: "Save as PNG",
|
|
6157
6221
|
action: () => {
|
|
6158
|
-
S.value &&
|
|
6222
|
+
S.value && pe(S.value, e);
|
|
6159
6223
|
}
|
|
6160
6224
|
}];
|
|
6161
6225
|
});
|
|
6162
|
-
return C(() => [
|
|
6163
|
-
|
|
6226
|
+
return C(() => [ke.value, k.value], () => dt()), C(() => [
|
|
6227
|
+
Ie.value,
|
|
6164
6228
|
l.colorScale,
|
|
6165
|
-
l.noDataColor
|
|
6166
|
-
|
|
6229
|
+
l.noDataColor,
|
|
6230
|
+
l.dataGeoType
|
|
6231
|
+
], () => ft()), C(() => [l.strokeColor, Ae.value], () => pt()), C(() => [Pe.value, ke.value], () => ye(), { flush: "post" }), (n, c) => (g(), a("div", {
|
|
6167
6232
|
ref_key: "containerRef",
|
|
6168
6233
|
ref: x,
|
|
6169
6234
|
class: f(["choropleth-wrapper", { pannable: t.pan }])
|
|
6170
6235
|
}, [
|
|
6171
|
-
t.menu ? (g(), r(
|
|
6236
|
+
t.menu ? (g(), r(ce, {
|
|
6172
6237
|
key: 0,
|
|
6173
|
-
items:
|
|
6238
|
+
items: It.value
|
|
6174
6239
|
}, null, 8, ["items"])) : i("", !0),
|
|
6175
|
-
t.title ||
|
|
6240
|
+
t.title || ht.value ? (g(), a("div", Tt, [t.title ? (g(), a("div", Et, y(t.title), 1)) : i("", !0), ht.value ? (g(), a("div", Dt, [t.legendTitle ? (g(), a("span", Ot, y(t.legendTitle), 1)) : i("", !0), Re.value || ze.value ? (g(!0), a(e, { key: 1 }, v(bt.value, (e) => (g(), a("span", {
|
|
6176
6241
|
key: e.key,
|
|
6177
6242
|
class: "choropleth-legend-item"
|
|
6178
6243
|
}, [o("span", {
|
|
@@ -6180,41 +6245,47 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6180
6245
|
style: m({ background: e.color })
|
|
6181
6246
|
}, null, 4), s(" " + y(e.label), 1)]))), 128)) : (g(), a("div", kt, [o("div", {
|
|
6182
6247
|
class: "choropleth-legend-gradient",
|
|
6183
|
-
style: m({ background:
|
|
6184
|
-
}, null, 4), o("div", At, [(g(!0), a(e, null, v(
|
|
6248
|
+
style: m({ background: Ct.value })
|
|
6249
|
+
}, null, 4), o("div", At, [(g(!0), a(e, null, v(yt.value, (e) => (g(), a("span", {
|
|
6185
6250
|
key: e.value,
|
|
6186
6251
|
style: m({ left: e.pct + "%" })
|
|
6187
6252
|
}, y(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
|
|
6188
6253
|
(g(), a("svg", {
|
|
6189
6254
|
ref_key: "svgRef",
|
|
6190
6255
|
ref: S,
|
|
6191
|
-
viewBox: `0 0 ${
|
|
6256
|
+
viewBox: `0 0 ${Ce.value} ${we.value}`,
|
|
6192
6257
|
preserveAspectRatio: "xMidYMid meet"
|
|
6193
6258
|
}, [o("g", {
|
|
6194
6259
|
ref_key: "mapGroupRef",
|
|
6195
6260
|
ref: T
|
|
6196
|
-
},
|
|
6197
|
-
|
|
6261
|
+
}, [o("g", {
|
|
6262
|
+
ref_key: "baseGroupRef",
|
|
6263
|
+
ref: ie
|
|
6264
|
+
}, null, 512), o("g", {
|
|
6265
|
+
ref_key: "overlayGroupRef",
|
|
6266
|
+
ref: E
|
|
6267
|
+
}, null, 512)], 512)], 8, jt)),
|
|
6268
|
+
le.value ? (g(), a("button", {
|
|
6198
6269
|
key: 2,
|
|
6199
6270
|
type: "button",
|
|
6200
6271
|
class: "choropleth-reset",
|
|
6201
6272
|
"aria-label": "Reset zoom",
|
|
6202
|
-
onClick:
|
|
6273
|
+
onClick: xe
|
|
6203
6274
|
}, " Reset ")) : i("", !0),
|
|
6204
|
-
|
|
6275
|
+
k.value ? (g(), r(wt, {
|
|
6205
6276
|
key: 3,
|
|
6206
6277
|
ref_key: "tooltipChildRef",
|
|
6207
|
-
ref:
|
|
6278
|
+
ref: D
|
|
6208
6279
|
}, {
|
|
6209
6280
|
default: w((r) => [te(n.$slots, "tooltip", p(u(ne(r))), () => [t.tooltipFormat ? (g(), a("span", {
|
|
6210
6281
|
key: 0,
|
|
6211
6282
|
innerHTML: t.tooltipFormat(r)
|
|
6212
|
-
}, null, 8, Mt)) : r.value == null ? (g(), a(e, { key: 1 }, [s(y(r.name), 1)], 64)) : (g(), a(e, { key: 2 }, [s(y(r.name) + ": " + y(
|
|
6283
|
+
}, null, 8, Mt)) : r.value == null ? (g(), a(e, { key: 1 }, [s(y(r.name), 1)], 64)) : (g(), a(e, { key: 2 }, [s(y(r.name) + ": " + y(Ye(r.value)), 1)], 64))], !0)]),
|
|
6213
6284
|
_: 3
|
|
6214
6285
|
}, 512)) : i("", !0)
|
|
6215
6286
|
], 2));
|
|
6216
6287
|
}
|
|
6217
|
-
}), [["__scopeId", "data-v-
|
|
6288
|
+
}), [["__scopeId", "data-v-f0f75b22"]]), Lt = /* @__PURE__ */ V(/* @__PURE__ */ l({
|
|
6218
6289
|
__name: "ChartTooltip",
|
|
6219
6290
|
props: {
|
|
6220
6291
|
x: {},
|
|
@@ -6234,11 +6305,11 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6234
6305
|
top: `${e.y}px`,
|
|
6235
6306
|
transform: "translateY(-50%)"
|
|
6236
6307
|
})
|
|
6237
|
-
}, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (g(), r(x(
|
|
6308
|
+
}, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (g(), r(x(M), {
|
|
6238
6309
|
key: 1,
|
|
6239
6310
|
open: e.open
|
|
6240
6311
|
}, {
|
|
6241
|
-
default: w(() => [c(x(
|
|
6312
|
+
default: w(() => [c(x(k), { "as-child": "" }, {
|
|
6242
6313
|
default: w(() => [o("div", {
|
|
6243
6314
|
class: "chart-tooltip-anchor",
|
|
6244
6315
|
style: m({
|
|
@@ -6247,8 +6318,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6247
6318
|
})
|
|
6248
6319
|
}, null, 4)]),
|
|
6249
6320
|
_: 1
|
|
6250
|
-
}), c(x(
|
|
6251
|
-
default: w(() => [e.open ? (g(), r(x(
|
|
6321
|
+
}), c(x(j), null, {
|
|
6322
|
+
default: w(() => [e.open ? (g(), r(x(A), {
|
|
6252
6323
|
key: 0,
|
|
6253
6324
|
class: "chart-tooltip-content",
|
|
6254
6325
|
side: "right",
|
|
@@ -6265,7 +6336,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6265
6336
|
_: 3
|
|
6266
6337
|
}, 8, ["open"])) : i("", !0);
|
|
6267
6338
|
}
|
|
6268
|
-
}), [["__scopeId", "data-v-44377f70"]]), Rt = { class: "TableWrapper" }, zt = /* @__PURE__ */
|
|
6339
|
+
}), [["__scopeId", "data-v-44377f70"]]), Rt = { class: "TableWrapper" }, zt = /* @__PURE__ */ V(/* @__PURE__ */ l({
|
|
6269
6340
|
__name: "DataTable",
|
|
6270
6341
|
props: {
|
|
6271
6342
|
data: {},
|
|
@@ -6350,12 +6421,12 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6350
6421
|
}
|
|
6351
6422
|
let x = n(() => [{
|
|
6352
6423
|
label: c.downloadMenuLink,
|
|
6353
|
-
action: () =>
|
|
6424
|
+
action: () => Q(b(), te())
|
|
6354
6425
|
}]), re = n(() => !!c.menu);
|
|
6355
6426
|
return (n, s) => (g(), a("div", { class: f(["TableOuter", {
|
|
6356
6427
|
"full-width": t.fullWidth,
|
|
6357
6428
|
"has-menu": re.value
|
|
6358
|
-
}]) }, [re.value ? (g(), r(
|
|
6429
|
+
}]) }, [re.value ? (g(), r(ce, {
|
|
6359
6430
|
key: 0,
|
|
6360
6431
|
items: x.value,
|
|
6361
6432
|
"force-dropdown": ""
|
|
@@ -6377,4 +6448,4 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6377
6448
|
}
|
|
6378
6449
|
}), [["__scopeId", "data-v-d5c290dc"]]);
|
|
6379
6450
|
//#endregion
|
|
6380
|
-
export { bt as BarChart, Lt as ChartTooltip, It as ChoroplethMap, zt as DataTable,
|
|
6451
|
+
export { bt as BarChart, Lt as ChartTooltip, It as ChoroplethMap, zt as DataTable, et as LineChart, xt as fipsToHsa, St as hsaNames };
|