@cfasim-ui/charts 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarChart/BarChart.d.ts +9 -55
- package/dist/ChoroplethMap/ChoroplethMap.d.ts +49 -8
- package/dist/LineChart/LineChart.d.ts +9 -67
- package/dist/_shared/ChartAnnotations.d.ts +25 -0
- package/dist/_shared/annotations.d.ts +94 -0
- package/dist/_shared/chartProps.d.ts +67 -0
- package/dist/_shared/index.d.ts +5 -1
- package/dist/_shared/useChartFoundation.d.ts +82 -0
- package/dist/_shared/useChartPadding.d.ts +34 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1174 -788
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
|
|
2
|
-
import { DropdownMenuContent as
|
|
3
|
-
import { geoAlbersUsa as
|
|
4
|
-
import { zoom as
|
|
5
|
-
import { select as
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as ee, toDisplayString as b, toHandlers as te, toRaw as x, unref as S, useSlots as C, useTemplateRef as w, watch as T, withCtx as E } from "vue";
|
|
2
|
+
import { DropdownMenuContent as D, DropdownMenuItem as O, DropdownMenuPortal as k, DropdownMenuRoot as A, DropdownMenuTrigger as j, PopoverAnchor as M, PopoverContent as N, PopoverPortal as P, PopoverRoot as ne } from "reka-ui";
|
|
3
|
+
import { geoAlbersUsa as F, geoPath as re } from "d3-geo";
|
|
4
|
+
import { zoom as ie, zoomIdentity as ae } 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 ce } from "topojson-client";
|
|
8
8
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var L = { class: "chart-menu-trigger-area" }, R = ["aria-label"], z = /* @__PURE__ */ l({
|
|
10
10
|
__name: "ChartMenu",
|
|
11
11
|
props: {
|
|
12
12
|
items: {},
|
|
@@ -17,15 +17,15 @@ 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) => (
|
|
20
|
+
return (n, l) => (_(), a("div", L, [i() ? (_(), r(S(A), {
|
|
21
21
|
key: 1,
|
|
22
22
|
modal: !1
|
|
23
23
|
}, {
|
|
24
|
-
default:
|
|
24
|
+
default: E(() => [c(S(j), {
|
|
25
25
|
class: "chart-menu-button",
|
|
26
26
|
"aria-label": "Chart options"
|
|
27
27
|
}, {
|
|
28
|
-
default:
|
|
28
|
+
default: E(() => [...l[2] ||= [o("svg", {
|
|
29
29
|
width: "16",
|
|
30
30
|
height: "16",
|
|
31
31
|
viewBox: "0 0 16 16",
|
|
@@ -49,18 +49,18 @@ var z = { class: "chart-menu-trigger-area" }, B = ["aria-label"], V = /* @__PURE
|
|
|
49
49
|
})
|
|
50
50
|
], -1)]]),
|
|
51
51
|
_: 1
|
|
52
|
-
}), c(
|
|
53
|
-
default:
|
|
52
|
+
}), c(S(k), null, {
|
|
53
|
+
default: E(() => [c(S(D), {
|
|
54
54
|
class: "chart-menu-content",
|
|
55
55
|
"side-offset": 4,
|
|
56
56
|
align: "end"
|
|
57
57
|
}, {
|
|
58
|
-
default:
|
|
58
|
+
default: E(() => [(_(!0), a(e, null, y(t.items, (e) => (_(), r(S(O), {
|
|
59
59
|
key: e.label,
|
|
60
60
|
class: "chart-menu-item",
|
|
61
61
|
onSelect: e.action
|
|
62
62
|
}, {
|
|
63
|
-
default:
|
|
63
|
+
default: E(() => [s(b(e.label), 1)]),
|
|
64
64
|
_: 2
|
|
65
65
|
}, 1032, ["onSelect"]))), 128))]),
|
|
66
66
|
_: 1
|
|
@@ -68,7 +68,7 @@ var z = { class: "chart-menu-trigger-area" }, B = ["aria-label"], V = /* @__PURE
|
|
|
68
68
|
_: 1
|
|
69
69
|
})]),
|
|
70
70
|
_: 1
|
|
71
|
-
})) : (
|
|
71
|
+
})) : (_(), a("button", {
|
|
72
72
|
key: 0,
|
|
73
73
|
class: "chart-menu-button chart-menu-single",
|
|
74
74
|
"aria-label": t.items[0].label,
|
|
@@ -83,47 +83,47 @@ 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, R))]));
|
|
87
87
|
}
|
|
88
|
-
}),
|
|
88
|
+
}), B = (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
|
+
}, le = /* @__PURE__ */ B(z, [["__scopeId", "data-v-b3c563e8"]]);
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region src/_shared/axes.ts
|
|
95
|
-
function
|
|
95
|
+
function V(e) {
|
|
96
96
|
return Math.round(e) + .5;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function H(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 ue(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
|
|
109
|
-
function
|
|
110
|
-
return Math.abs(e) >= 1e3 ?
|
|
108
|
+
var U = new Intl.NumberFormat();
|
|
109
|
+
function W(e) {
|
|
110
|
+
return Math.abs(e) >= 1e3 ? U.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 G(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 ue(t + i, n + i, r).map((e) => e - i);
|
|
120
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = H(n - t, a);
|
|
121
|
+
return ue(t + i, n + i, o).map((e) => e - i);
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
124
124
|
//#region src/_shared/useChartSize.ts
|
|
125
|
-
function
|
|
126
|
-
let t =
|
|
125
|
+
function K(e = {}) {
|
|
126
|
+
let t = v(null), n = v(0), r = null, i = null;
|
|
127
127
|
return h(() => {
|
|
128
128
|
t.value && (n.value = t.value.clientWidth, r = new ResizeObserver((t) => {
|
|
129
129
|
let r = t[0];
|
|
@@ -133,7 +133,7 @@ function ue(e = {}) {
|
|
|
133
133
|
n.value = r.contentRect.width;
|
|
134
134
|
}, a)) : n.value = r.contentRect.width;
|
|
135
135
|
}), r.observe(t.value));
|
|
136
|
-
}),
|
|
136
|
+
}), g(() => {
|
|
137
137
|
r?.disconnect(), i && clearTimeout(i);
|
|
138
138
|
}), {
|
|
139
139
|
containerRef: t,
|
|
@@ -141,24 +141,57 @@ function ue(e = {}) {
|
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
function de(e) {
|
|
144
|
-
|
|
145
|
-
top:
|
|
146
|
-
right:
|
|
147
|
-
bottom:
|
|
148
|
-
left:
|
|
149
|
-
}
|
|
144
|
+
return e == null ? {
|
|
145
|
+
top: 0,
|
|
146
|
+
right: 0,
|
|
147
|
+
bottom: 0,
|
|
148
|
+
left: 0
|
|
149
|
+
} : typeof e == "number" ? {
|
|
150
|
+
top: e,
|
|
151
|
+
right: e,
|
|
152
|
+
bottom: e,
|
|
153
|
+
left: e
|
|
154
|
+
} : {
|
|
155
|
+
top: e.top ?? 0,
|
|
156
|
+
right: e.right ?? 0,
|
|
157
|
+
bottom: e.bottom ?? 0,
|
|
158
|
+
left: e.left ?? 0
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function q(e) {
|
|
162
|
+
let t = n(() => {
|
|
163
|
+
let t = de(e.extraPadding?.());
|
|
164
|
+
return {
|
|
165
|
+
top: (e.title() ? 26 : 10) + (e.hasInlineLegend() ? 20 : 0) + t.top,
|
|
166
|
+
right: 10 + t.right,
|
|
167
|
+
bottom: (e.xLabel() ? 38 : 30) + t.bottom,
|
|
168
|
+
left: (e.yLabel() ? 56 : 50) + t.left
|
|
169
|
+
};
|
|
170
|
+
}), r = n(() => (e.title() ? 26 : 10) + 20 / 2), i = n(() => e.width() - t.value.left - t.value.right), a = n(() => e.height() - t.value.top - t.value.bottom);
|
|
150
171
|
return {
|
|
151
172
|
padding: t,
|
|
152
|
-
|
|
153
|
-
|
|
173
|
+
legendY: r,
|
|
174
|
+
innerW: i,
|
|
175
|
+
innerH: a,
|
|
176
|
+
bounds: n(() => {
|
|
177
|
+
let e = t.value;
|
|
178
|
+
return {
|
|
179
|
+
left: e.left,
|
|
180
|
+
top: e.top,
|
|
181
|
+
right: e.left + i.value,
|
|
182
|
+
bottom: e.top + a.value,
|
|
183
|
+
width: i.value,
|
|
184
|
+
height: a.value
|
|
185
|
+
};
|
|
186
|
+
})
|
|
154
187
|
};
|
|
155
188
|
}
|
|
156
189
|
//#endregion
|
|
157
190
|
//#region src/tooltip-position.ts
|
|
158
|
-
var
|
|
159
|
-
function
|
|
191
|
+
var J = 16, fe = 8;
|
|
192
|
+
function pe(e, t, n, r, i, a) {
|
|
160
193
|
if (i === "none") return {
|
|
161
|
-
left: e +
|
|
194
|
+
left: e + J,
|
|
162
195
|
top: t
|
|
163
196
|
};
|
|
164
197
|
let o = i === "chart" && a ? {
|
|
@@ -171,16 +204,16 @@ function Y(e, t, n, r, i, a) {
|
|
|
171
204
|
right: window.innerWidth,
|
|
172
205
|
top: 0,
|
|
173
206
|
bottom: window.innerHeight
|
|
174
|
-
}, s = e +
|
|
207
|
+
}, s = e + J + n > o.right - fe ? e - J - n : e + J, c = r / 2;
|
|
175
208
|
return {
|
|
176
209
|
left: s,
|
|
177
|
-
top: Math.min(Math.max(t, o.top +
|
|
210
|
+
top: Math.min(Math.max(t, o.top + fe + c), o.bottom - fe - c)
|
|
178
211
|
};
|
|
179
212
|
}
|
|
180
213
|
//#endregion
|
|
181
214
|
//#region src/_shared/useChartTooltip.ts
|
|
182
|
-
function
|
|
183
|
-
let t = e.touchYOffset ?? 50, n =
|
|
215
|
+
function Y(e) {
|
|
216
|
+
let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null);
|
|
184
217
|
function s(e) {
|
|
185
218
|
return "touches" in e ? e.touches[0] ?? null : e;
|
|
186
219
|
}
|
|
@@ -193,14 +226,14 @@ function fe(e) {
|
|
|
193
226
|
clientY: r.clientY
|
|
194
227
|
}, e.onHover?.({ index: i }));
|
|
195
228
|
}
|
|
196
|
-
|
|
229
|
+
T([a, n], () => {
|
|
197
230
|
if (n.value === null || !a.value) {
|
|
198
231
|
o.value = null;
|
|
199
232
|
return;
|
|
200
233
|
}
|
|
201
234
|
let s = i.value, c = e.containerRef.value;
|
|
202
235
|
if (!s || !c) return;
|
|
203
|
-
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } =
|
|
236
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = pe(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
|
|
204
237
|
o.value = {
|
|
205
238
|
left: f - l.left,
|
|
206
239
|
top: p - l.top
|
|
@@ -246,17 +279,17 @@ function fe(e) {
|
|
|
246
279
|
}
|
|
247
280
|
//#endregion
|
|
248
281
|
//#region src/ChartMenu/download.ts
|
|
249
|
-
function
|
|
282
|
+
function X(e, t) {
|
|
250
283
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
251
284
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
252
285
|
}
|
|
253
|
-
function
|
|
286
|
+
function Z(e, t) {
|
|
254
287
|
let n = e.cloneNode(!0);
|
|
255
288
|
n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
256
289
|
let r = new XMLSerializer().serializeToString(n);
|
|
257
|
-
|
|
290
|
+
X(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
258
291
|
}
|
|
259
|
-
function
|
|
292
|
+
function Q(e, t) {
|
|
260
293
|
let n = e.cloneNode(!0);
|
|
261
294
|
n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
262
295
|
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,17 +298,17 @@ function me(e, t) {
|
|
|
265
298
|
e.width = s * 2, e.height = c * 2;
|
|
266
299
|
let n = e.getContext("2d");
|
|
267
300
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
268
|
-
e &&
|
|
301
|
+
e && X(e, `${t}.png`);
|
|
269
302
|
}), URL.revokeObjectURL(a);
|
|
270
303
|
}, o.src = a;
|
|
271
304
|
}
|
|
272
|
-
function
|
|
273
|
-
|
|
305
|
+
function me(e, t) {
|
|
306
|
+
X(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
274
307
|
}
|
|
275
308
|
//#endregion
|
|
276
309
|
//#region src/_shared/useChartMenu.ts
|
|
277
310
|
function he(e) {
|
|
278
|
-
let t =
|
|
311
|
+
let t = v(null);
|
|
279
312
|
function r() {
|
|
280
313
|
let t = e.filename();
|
|
281
314
|
if (t) return t;
|
|
@@ -288,17 +321,17 @@ function he(e) {
|
|
|
288
321
|
let n = r(), i = [{
|
|
289
322
|
label: "Save as SVG",
|
|
290
323
|
action: () => {
|
|
291
|
-
t.value &&
|
|
324
|
+
t.value && Z(t.value, n);
|
|
292
325
|
}
|
|
293
326
|
}, {
|
|
294
327
|
label: "Save as PNG",
|
|
295
328
|
action: () => {
|
|
296
|
-
t.value &&
|
|
329
|
+
t.value && Q(t.value, n);
|
|
297
330
|
}
|
|
298
331
|
}];
|
|
299
332
|
return e.downloadLink() || i.push({
|
|
300
333
|
label: "Download CSV",
|
|
301
|
-
action: () =>
|
|
334
|
+
action: () => me(e.getCsv(), n)
|
|
302
335
|
}), i;
|
|
303
336
|
}),
|
|
304
337
|
downloadLinkText: n(() => {
|
|
@@ -327,81 +360,336 @@ function _e(e, t, n = "category") {
|
|
|
327
360
|
if (t.length === 0 || e.length === 0) return "";
|
|
328
361
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
329
362
|
for (let n = 0; n < e.length; n++) {
|
|
330
|
-
let i = [
|
|
363
|
+
let i = [$(e[n])];
|
|
331
364
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
332
365
|
r.push(i.join(","));
|
|
333
366
|
}
|
|
334
367
|
return r.join("\n");
|
|
335
368
|
}
|
|
336
|
-
function
|
|
369
|
+
function $(e) {
|
|
337
370
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
338
371
|
}
|
|
339
372
|
//#endregion
|
|
373
|
+
//#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
|
|
374
|
+
var ve = {
|
|
375
|
+
class: "chart-annotations",
|
|
376
|
+
"pointer-events": "none"
|
|
377
|
+
}, ye = [
|
|
378
|
+
"x1",
|
|
379
|
+
"y1",
|
|
380
|
+
"x2",
|
|
381
|
+
"y2",
|
|
382
|
+
"stroke",
|
|
383
|
+
"stroke-width",
|
|
384
|
+
"stroke-dasharray"
|
|
385
|
+
], be = [
|
|
386
|
+
"d",
|
|
387
|
+
"stroke",
|
|
388
|
+
"stroke-width",
|
|
389
|
+
"stroke-dasharray",
|
|
390
|
+
"marker-start"
|
|
391
|
+
], xe = [
|
|
392
|
+
"x",
|
|
393
|
+
"y",
|
|
394
|
+
"text-anchor",
|
|
395
|
+
"font-size",
|
|
396
|
+
"font-weight",
|
|
397
|
+
"fill",
|
|
398
|
+
"stroke",
|
|
399
|
+
"stroke-width"
|
|
400
|
+
], Se = ["x", "dy"], Ce = ["font-weight", "font-style"], we = 13, Te = "normal", Ee = 700, De = "var(--color-bg-0, #fff)", Oe = 3, ke = 1, Ae = 4, je = 6, Me = 1.2, Ne = .35, Pe = 3, Fe = /* @__PURE__ */ l({
|
|
401
|
+
__name: "ChartAnnotations",
|
|
402
|
+
props: {
|
|
403
|
+
annotations: { default: () => [] },
|
|
404
|
+
project: {},
|
|
405
|
+
bounds: { default: void 0 }
|
|
406
|
+
},
|
|
407
|
+
setup(t) {
|
|
408
|
+
let r = t;
|
|
409
|
+
function s(e) {
|
|
410
|
+
if (e !== void 0) return typeof e == "number" ? `${e} ${e}` : typeof e == "string" ? e : e.join(" ");
|
|
411
|
+
}
|
|
412
|
+
function c(e) {
|
|
413
|
+
let t = [], n = !1, r = !1, i = "", a = () => {
|
|
414
|
+
i && t.push({
|
|
415
|
+
text: i,
|
|
416
|
+
bold: n,
|
|
417
|
+
italic: r
|
|
418
|
+
}), i = "";
|
|
419
|
+
};
|
|
420
|
+
for (let t = 0; t < e.length; t++) {
|
|
421
|
+
let o = e[t];
|
|
422
|
+
o === "*" && e[t + 1] === "*" ? (a(), n = !n, t++) : o === "_" ? (a(), r = !r) : i += o;
|
|
423
|
+
}
|
|
424
|
+
return a(), t.length === 0 ? [{
|
|
425
|
+
text: "",
|
|
426
|
+
bold: !1,
|
|
427
|
+
italic: !1
|
|
428
|
+
}] : t;
|
|
429
|
+
}
|
|
430
|
+
let l = n(() => {
|
|
431
|
+
let e = [];
|
|
432
|
+
for (let t of r.annotations) {
|
|
433
|
+
let n = r.project(t.x, t.y);
|
|
434
|
+
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
435
|
+
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
436
|
+
if (a && !r.bounds) continue;
|
|
437
|
+
let { x: o, y: l } = t.offset, f = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? we, g = t.fontWeight ?? Te, _ = t.haloColor ?? De, v = t.haloWidth ?? Oe, y = t.lineColor ?? m, ee = t.lineWidth ?? ke, b = s(t.lineDash), te = t.textAnchor ?? (o > 0 ? "start" : o < 0 ? "end" : "middle"), x, S = "";
|
|
438
|
+
a && r.bounds ? x = u(i, n.x, n.y, r.bounds) : S = d(n.x, n.y, f, p, h, i), e.push({
|
|
439
|
+
lines: t.text.split("\n").map(c),
|
|
440
|
+
textX: f,
|
|
441
|
+
textY: p,
|
|
442
|
+
textAnchor: te,
|
|
443
|
+
dy: h * Me,
|
|
444
|
+
fontSize: h,
|
|
445
|
+
fontWeight: g,
|
|
446
|
+
color: m,
|
|
447
|
+
haloColor: _,
|
|
448
|
+
haloWidth: v,
|
|
449
|
+
pointerPath: S,
|
|
450
|
+
lineColor: y,
|
|
451
|
+
lineWidth: ee,
|
|
452
|
+
lineDash: b,
|
|
453
|
+
arrow: !a && (t.arrow ?? !0),
|
|
454
|
+
rule: x
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
return e;
|
|
458
|
+
});
|
|
459
|
+
function u(e, t, n, r) {
|
|
460
|
+
switch (e) {
|
|
461
|
+
case "ruleX": return {
|
|
462
|
+
x1: t,
|
|
463
|
+
y1: r.top,
|
|
464
|
+
x2: t,
|
|
465
|
+
y2: r.bottom
|
|
466
|
+
};
|
|
467
|
+
case "ruleY": return {
|
|
468
|
+
x1: r.left,
|
|
469
|
+
y1: n,
|
|
470
|
+
x2: r.right,
|
|
471
|
+
y2: n
|
|
472
|
+
};
|
|
473
|
+
case "ruleUp": return {
|
|
474
|
+
x1: t,
|
|
475
|
+
y1: r.bottom,
|
|
476
|
+
x2: t,
|
|
477
|
+
y2: n
|
|
478
|
+
};
|
|
479
|
+
case "ruleDown": return {
|
|
480
|
+
x1: t,
|
|
481
|
+
y1: r.top,
|
|
482
|
+
x2: t,
|
|
483
|
+
y2: n
|
|
484
|
+
};
|
|
485
|
+
case "ruleFromLeft": return {
|
|
486
|
+
x1: r.left,
|
|
487
|
+
y1: n,
|
|
488
|
+
x2: t,
|
|
489
|
+
y2: n
|
|
490
|
+
};
|
|
491
|
+
case "ruleFromRight": return {
|
|
492
|
+
x1: r.right,
|
|
493
|
+
y1: n,
|
|
494
|
+
x2: t,
|
|
495
|
+
y2: n
|
|
496
|
+
};
|
|
497
|
+
default: return {
|
|
498
|
+
x1: t,
|
|
499
|
+
y1: n,
|
|
500
|
+
x2: t,
|
|
501
|
+
y2: n
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
function d(e, t, n, r, i, a) {
|
|
506
|
+
if (a === "none") return "";
|
|
507
|
+
let o = n - e, s = r - t, c = r - i * Ne;
|
|
508
|
+
if (o === 0 || s === 0 || a === "straight") {
|
|
509
|
+
let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
|
|
510
|
+
if (l <= Ae + je) return "";
|
|
511
|
+
let u = a / l, d = o / l;
|
|
512
|
+
return `M${e + u * Ae},${t + d * Ae} L${n - u * je},${i - d * je}`;
|
|
513
|
+
}
|
|
514
|
+
let l = c - t;
|
|
515
|
+
if (Math.abs(l) <= Ae || Math.abs(o) <= je) return "";
|
|
516
|
+
let u = Math.sign(o), d = Math.sign(l), f = e + u * Pe;
|
|
517
|
+
return `M${f},${t + d * Ae} Q${f},${c} ${n - u * je},${c}`;
|
|
518
|
+
}
|
|
519
|
+
return (t, n) => (_(), a(e, null, [n[0] ||= o("defs", null, [o("marker", {
|
|
520
|
+
id: "chart-annotation-arrow",
|
|
521
|
+
viewBox: "0 0 8 8",
|
|
522
|
+
refX: "7",
|
|
523
|
+
refY: "4",
|
|
524
|
+
markerWidth: "6",
|
|
525
|
+
markerHeight: "6",
|
|
526
|
+
orient: "auto-start-reverse",
|
|
527
|
+
markerUnits: "userSpaceOnUse"
|
|
528
|
+
}, [o("path", {
|
|
529
|
+
d: "M0,0 L8,4 L0,8 Z",
|
|
530
|
+
fill: "context-stroke"
|
|
531
|
+
})])], -1), o("g", ve, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
532
|
+
t.rule ? (_(), a("line", {
|
|
533
|
+
key: 0,
|
|
534
|
+
x1: t.rule.x1,
|
|
535
|
+
y1: t.rule.y1,
|
|
536
|
+
x2: t.rule.x2,
|
|
537
|
+
y2: t.rule.y2,
|
|
538
|
+
stroke: t.lineColor,
|
|
539
|
+
"stroke-width": t.lineWidth,
|
|
540
|
+
"stroke-dasharray": t.lineDash,
|
|
541
|
+
"stroke-linecap": "round"
|
|
542
|
+
}, null, 8, ye)) : i("", !0),
|
|
543
|
+
t.pointerPath ? (_(), a("path", {
|
|
544
|
+
key: 1,
|
|
545
|
+
d: t.pointerPath,
|
|
546
|
+
fill: "none",
|
|
547
|
+
stroke: t.lineColor,
|
|
548
|
+
style: m({ color: t.lineColor }),
|
|
549
|
+
"stroke-width": t.lineWidth,
|
|
550
|
+
"stroke-dasharray": t.lineDash,
|
|
551
|
+
"stroke-linecap": "round",
|
|
552
|
+
"marker-start": t.arrow ? "url(#chart-annotation-arrow)" : void 0
|
|
553
|
+
}, null, 12, be)) : i("", !0),
|
|
554
|
+
o("text", {
|
|
555
|
+
x: t.textX,
|
|
556
|
+
y: t.textY,
|
|
557
|
+
"text-anchor": t.textAnchor,
|
|
558
|
+
"font-size": t.fontSize,
|
|
559
|
+
"font-weight": t.fontWeight,
|
|
560
|
+
fill: t.color,
|
|
561
|
+
stroke: t.haloColor,
|
|
562
|
+
"stroke-width": t.haloWidth,
|
|
563
|
+
"stroke-linejoin": "round",
|
|
564
|
+
"paint-order": "stroke fill"
|
|
565
|
+
}, [(_(!0), a(e, null, y(t.lines, (n, r) => (_(), a("tspan", {
|
|
566
|
+
key: r,
|
|
567
|
+
x: t.textX,
|
|
568
|
+
dy: r === 0 ? 0 : t.dy
|
|
569
|
+
}, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
|
|
570
|
+
key: t,
|
|
571
|
+
"font-weight": e.bold ? Ee : void 0,
|
|
572
|
+
"font-style": e.italic ? "italic" : void 0
|
|
573
|
+
}, b(e.text), 9, Ce))), 128))], 8, Se))), 128))], 8, xe)
|
|
574
|
+
], 64))), 128))])], 64));
|
|
575
|
+
}
|
|
576
|
+
}), Ie = 400, Le = 200;
|
|
577
|
+
function Re(e) {
|
|
578
|
+
let { containerRef: t, measuredWidth: r } = K({ debounce: e.debounce }), i = n(() => e.width() ?? (r.value || Ie)), a = n(() => e.height() ?? Le), { padding: o, legendY: s, innerW: c, innerH: l, bounds: u } = q({
|
|
579
|
+
title: e.title,
|
|
580
|
+
xLabel: e.xLabel,
|
|
581
|
+
yLabel: e.yLabel,
|
|
582
|
+
hasInlineLegend: e.hasInlineLegend,
|
|
583
|
+
width: () => i.value,
|
|
584
|
+
height: () => a.value,
|
|
585
|
+
extraPadding: e.chartPadding
|
|
586
|
+
}), { hoverIndex: d, tooltipRef: f, tooltipPos: p, handlers: m } = Y({
|
|
587
|
+
enabled: e.hasTooltipSlot,
|
|
588
|
+
trigger: e.tooltipTrigger,
|
|
589
|
+
clamp: () => e.tooltipClamp() ?? "chart",
|
|
590
|
+
pointerToIndex: e.pointerToIndex,
|
|
591
|
+
containerRef: t,
|
|
592
|
+
onHover: e.onHover
|
|
593
|
+
}), { svgRef: h, items: g, downloadLinkText: _, csvHref: v, resolvedFilename: y } = he({
|
|
594
|
+
filename: e.filename,
|
|
595
|
+
legacyMenuLabel: e.menu,
|
|
596
|
+
getCsv: e.getCsv,
|
|
597
|
+
downloadLink: e.downloadLink
|
|
598
|
+
});
|
|
599
|
+
return {
|
|
600
|
+
containerRef: t,
|
|
601
|
+
svgRef: h,
|
|
602
|
+
width: i,
|
|
603
|
+
height: a,
|
|
604
|
+
padding: o,
|
|
605
|
+
legendY: s,
|
|
606
|
+
innerW: c,
|
|
607
|
+
innerH: l,
|
|
608
|
+
bounds: u,
|
|
609
|
+
hoverIndex: d,
|
|
610
|
+
tooltipRef: f,
|
|
611
|
+
tooltipPos: p,
|
|
612
|
+
tooltipHandlers: m,
|
|
613
|
+
menuItems: g,
|
|
614
|
+
downloadLinkText: _,
|
|
615
|
+
csvHref: v,
|
|
616
|
+
menuFilename: y
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
function ze(e, t) {
|
|
620
|
+
return (n) => {
|
|
621
|
+
let r = e();
|
|
622
|
+
if (r) return r(n);
|
|
623
|
+
let i = t();
|
|
624
|
+
return i ? i(n) : W(n);
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
//#endregion
|
|
340
628
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
341
|
-
var
|
|
629
|
+
var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
|
|
342
630
|
"x1",
|
|
343
631
|
"y1",
|
|
344
632
|
"x2",
|
|
345
633
|
"y2",
|
|
346
634
|
"stroke",
|
|
347
635
|
"stroke-dasharray"
|
|
348
|
-
],
|
|
636
|
+
], We = [
|
|
349
637
|
"cx",
|
|
350
638
|
"cy",
|
|
351
639
|
"fill",
|
|
352
640
|
"fill-opacity",
|
|
353
641
|
"stroke"
|
|
354
|
-
],
|
|
642
|
+
], Ge = ["x", "y"], Ke = [
|
|
355
643
|
"x1",
|
|
356
644
|
"y1",
|
|
357
645
|
"x2",
|
|
358
646
|
"y2"
|
|
359
|
-
],
|
|
647
|
+
], qe = [
|
|
360
648
|
"x1",
|
|
361
649
|
"y1",
|
|
362
650
|
"x2",
|
|
363
651
|
"y2"
|
|
364
|
-
],
|
|
652
|
+
], Je = [
|
|
365
653
|
"x1",
|
|
366
654
|
"y1",
|
|
367
655
|
"x2",
|
|
368
656
|
"y2"
|
|
369
|
-
],
|
|
657
|
+
], Ye = [
|
|
370
658
|
"x1",
|
|
371
659
|
"y1",
|
|
372
660
|
"x2",
|
|
373
661
|
"y2"
|
|
374
|
-
],
|
|
662
|
+
], Xe = ["x", "y"], Ze = ["transform"], Qe = [
|
|
375
663
|
"x",
|
|
376
664
|
"y",
|
|
377
665
|
"text-anchor"
|
|
378
|
-
],
|
|
666
|
+
], $e = ["x", "y"], et = [
|
|
379
667
|
"d",
|
|
380
668
|
"fill",
|
|
381
669
|
"fill-opacity"
|
|
382
|
-
],
|
|
670
|
+
], tt = [
|
|
383
671
|
"d",
|
|
384
672
|
"stroke",
|
|
385
673
|
"stroke-width",
|
|
386
674
|
"stroke-opacity",
|
|
387
675
|
"stroke-dasharray"
|
|
388
|
-
],
|
|
676
|
+
], nt = [
|
|
389
677
|
"cx",
|
|
390
678
|
"cy",
|
|
391
679
|
"r",
|
|
392
680
|
"fill",
|
|
393
681
|
"fill-opacity",
|
|
394
682
|
"stroke"
|
|
395
|
-
],
|
|
683
|
+
], rt = [
|
|
396
684
|
"d",
|
|
397
685
|
"fill",
|
|
398
686
|
"fill-opacity"
|
|
399
|
-
],
|
|
687
|
+
], it = [
|
|
400
688
|
"d",
|
|
401
689
|
"stroke",
|
|
402
690
|
"stroke-width",
|
|
403
691
|
"stroke-dasharray"
|
|
404
|
-
],
|
|
692
|
+
], at = [
|
|
405
693
|
"x1",
|
|
406
694
|
"y1",
|
|
407
695
|
"x2",
|
|
@@ -409,7 +697,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
409
697
|
"stroke",
|
|
410
698
|
"stroke-width",
|
|
411
699
|
"stroke-dasharray"
|
|
412
|
-
],
|
|
700
|
+
], ot = [
|
|
413
701
|
"x1",
|
|
414
702
|
"y1",
|
|
415
703
|
"x2",
|
|
@@ -417,44 +705,44 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
417
705
|
"stroke",
|
|
418
706
|
"stroke-width",
|
|
419
707
|
"stroke-dasharray"
|
|
420
|
-
],
|
|
708
|
+
], st = [
|
|
421
709
|
"x1",
|
|
422
710
|
"y1",
|
|
423
711
|
"x2",
|
|
424
712
|
"y2"
|
|
425
|
-
],
|
|
713
|
+
], ct = [
|
|
426
714
|
"x1",
|
|
427
715
|
"y1",
|
|
428
716
|
"x2",
|
|
429
717
|
"y2"
|
|
430
|
-
],
|
|
718
|
+
], lt = [
|
|
431
719
|
"x1",
|
|
432
720
|
"y1",
|
|
433
721
|
"x2",
|
|
434
722
|
"y2"
|
|
435
|
-
],
|
|
723
|
+
], ut = [
|
|
436
724
|
"cx",
|
|
437
725
|
"cy",
|
|
438
726
|
"fill"
|
|
439
|
-
],
|
|
727
|
+
], dt = [
|
|
440
728
|
"x",
|
|
441
729
|
"y",
|
|
442
730
|
"width",
|
|
443
731
|
"height"
|
|
444
|
-
],
|
|
732
|
+
], ft = [
|
|
445
733
|
"cx",
|
|
446
734
|
"cy",
|
|
447
735
|
"fill",
|
|
448
736
|
"fill-opacity",
|
|
449
737
|
"stroke"
|
|
450
|
-
],
|
|
738
|
+
], pt = [
|
|
451
739
|
"x",
|
|
452
740
|
"y",
|
|
453
741
|
"fill"
|
|
454
|
-
],
|
|
742
|
+
], mt = ["x", "y"], ht = { class: "line-chart-tooltip" }, gt = {
|
|
455
743
|
key: 0,
|
|
456
744
|
class: "line-chart-tooltip-label"
|
|
457
|
-
},
|
|
745
|
+
}, _t = ["href", "download"], vt = 36, yt = 12, bt = 7, xt = 16, St = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
458
746
|
__name: "LineChart",
|
|
459
747
|
props: {
|
|
460
748
|
y: {},
|
|
@@ -463,82 +751,74 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
463
751
|
series: {},
|
|
464
752
|
areas: {},
|
|
465
753
|
areaSections: {},
|
|
466
|
-
width: {},
|
|
467
|
-
height: {},
|
|
468
754
|
lineOpacity: { default: 1 },
|
|
469
|
-
title: {},
|
|
470
|
-
xLabel: {},
|
|
471
|
-
yLabel: {},
|
|
472
755
|
yMin: {},
|
|
473
756
|
xMin: {},
|
|
474
757
|
xTicks: {},
|
|
475
758
|
yTicks: {},
|
|
476
759
|
xTickFormat: {},
|
|
477
760
|
yTickFormat: {},
|
|
478
|
-
tooltipValueFormat: {},
|
|
479
761
|
xLabels: {},
|
|
762
|
+
xGrid: { type: Boolean },
|
|
763
|
+
yGrid: { type: Boolean },
|
|
764
|
+
width: {},
|
|
765
|
+
height: {},
|
|
766
|
+
title: {},
|
|
767
|
+
xLabel: {},
|
|
768
|
+
yLabel: {},
|
|
480
769
|
debounce: {},
|
|
481
770
|
menu: {
|
|
482
771
|
type: [Boolean, String],
|
|
483
772
|
default: !0
|
|
484
773
|
},
|
|
485
|
-
xGrid: { type: Boolean },
|
|
486
|
-
yGrid: { type: Boolean },
|
|
487
774
|
tooltipData: {},
|
|
488
775
|
tooltipTrigger: {},
|
|
489
776
|
tooltipClamp: { default: "chart" },
|
|
777
|
+
tooltipValueFormat: {},
|
|
490
778
|
csv: {},
|
|
491
779
|
filename: {},
|
|
492
|
-
downloadLink: { type: [Boolean, String] }
|
|
780
|
+
downloadLink: { type: [Boolean, String] },
|
|
781
|
+
annotations: {},
|
|
782
|
+
chartPadding: {}
|
|
493
783
|
},
|
|
494
784
|
emits: ["hover"],
|
|
495
785
|
setup(t, { emit: c }) {
|
|
496
|
-
let l = t, f = c,
|
|
497
|
-
|
|
498
|
-
xLabel: () => l.xLabel,
|
|
499
|
-
yLabel: () => l.yLabel,
|
|
500
|
-
hasInlineLegend: () => re.value,
|
|
501
|
-
width: () => _.value,
|
|
502
|
-
height: () => b.value
|
|
503
|
-
}), T = [];
|
|
504
|
-
function E(e) {
|
|
786
|
+
let l = t, f = c, h = n(() => C.value.some((e) => e.legend) || l.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description)) || !1), g = [];
|
|
787
|
+
function v(e) {
|
|
505
788
|
return {
|
|
506
789
|
...e,
|
|
507
|
-
data: e.y ?? e.data ??
|
|
790
|
+
data: e.y ?? e.data ?? g
|
|
508
791
|
};
|
|
509
792
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
let O = n(() => {
|
|
514
|
-
if (l.series && l.series.length > 0) return l.series.map(E);
|
|
793
|
+
let x = ze(() => l.tooltipValueFormat, () => l.yTickFormat), C = n(() => {
|
|
794
|
+
if (l.series && l.series.length > 0) return l.series.map(v);
|
|
515
795
|
let e = l.y ?? l.data;
|
|
516
796
|
return e ? [{
|
|
517
797
|
data: e,
|
|
518
798
|
x: l.x
|
|
519
799
|
}] : [];
|
|
520
|
-
}),
|
|
800
|
+
}), w = n(() => l.areas ?? []), T = n(() => {
|
|
521
801
|
let e = 0;
|
|
522
|
-
for (let t of
|
|
523
|
-
for (let t of
|
|
802
|
+
for (let t of C.value) t.data.length > e && (e = t.data.length);
|
|
803
|
+
for (let t of w.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
|
|
524
804
|
return e;
|
|
525
|
-
}),
|
|
526
|
-
function
|
|
805
|
+
}), E = n(() => C.value.some((e) => e.x != null) || w.value.some((e) => e.x != null));
|
|
806
|
+
function D(e, t) {
|
|
527
807
|
return e.x ? Number(e.x[t]) : t;
|
|
528
808
|
}
|
|
529
|
-
function
|
|
809
|
+
function O(e, t) {
|
|
530
810
|
return e.x ? Number(e.x[t]) : t;
|
|
531
811
|
}
|
|
532
|
-
let
|
|
812
|
+
let k = n(() => E.value ? 0 : l.xMin ?? 0), A = n(() => {
|
|
533
813
|
let e = Infinity, t = -Infinity;
|
|
534
|
-
for (let n of
|
|
535
|
-
let i =
|
|
814
|
+
for (let n of C.value) for (let r = 0; r < n.data.length; r++) {
|
|
815
|
+
let i = D(n, r);
|
|
536
816
|
isFinite(i) && (i < e && (e = i), i > t && (t = i));
|
|
537
817
|
}
|
|
538
|
-
for (let n of
|
|
818
|
+
for (let n of w.value) {
|
|
539
819
|
let r = Math.max(n.upper.length, n.lower.length);
|
|
540
820
|
for (let i = 0; i < r; i++) {
|
|
541
|
-
let r =
|
|
821
|
+
let r = O(n, i);
|
|
542
822
|
isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
543
823
|
}
|
|
544
824
|
}
|
|
@@ -550,14 +830,14 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
550
830
|
max: 0
|
|
551
831
|
};
|
|
552
832
|
});
|
|
553
|
-
function
|
|
554
|
-
let { min: t, max: n } =
|
|
555
|
-
return
|
|
833
|
+
function j(e) {
|
|
834
|
+
let { min: t, max: n } = A.value, r = n - t || 1;
|
|
835
|
+
return Y.value.left + (e - t) / r * Z.value;
|
|
556
836
|
}
|
|
557
|
-
let
|
|
837
|
+
let M = n(() => {
|
|
558
838
|
let e = Infinity, t = -Infinity;
|
|
559
|
-
for (let n of
|
|
560
|
-
for (let n of
|
|
839
|
+
for (let n of C.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
840
|
+
for (let n of w.value) {
|
|
561
841
|
for (let r of n.upper) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
562
842
|
for (let r of n.lower) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
563
843
|
}
|
|
@@ -571,75 +851,75 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
571
851
|
range: 1
|
|
572
852
|
};
|
|
573
853
|
});
|
|
574
|
-
function
|
|
854
|
+
function N(e) {
|
|
575
855
|
let t = e.data;
|
|
576
856
|
if (t.length === 0) return "";
|
|
577
|
-
let { min: n, range: r } =
|
|
857
|
+
let { min: n, range: r } = M.value, i = Q.value / r, a = Y.value.top + Q.value, o = "", s = !1;
|
|
578
858
|
for (let r = 0; r < t.length; r++) {
|
|
579
|
-
let c =
|
|
859
|
+
let c = D(e, r);
|
|
580
860
|
if (!isFinite(t[r]) || !isFinite(c)) {
|
|
581
861
|
s = !1;
|
|
582
862
|
continue;
|
|
583
863
|
}
|
|
584
|
-
let l =
|
|
864
|
+
let l = j(c), u = a - (t[r] - n) * i;
|
|
585
865
|
o += s ? `L${l},${u}` : `M${l},${u}`, s = !0;
|
|
586
866
|
}
|
|
587
867
|
return o;
|
|
588
868
|
}
|
|
589
|
-
function
|
|
590
|
-
let t = e.data, { min: n, range: r } =
|
|
869
|
+
function P(e) {
|
|
870
|
+
let t = e.data, { min: n, range: r } = M.value, i = Q.value / r, a = Y.value.top + Q.value, o = [];
|
|
591
871
|
for (let r = 0; r < t.length; r++) {
|
|
592
|
-
let s =
|
|
872
|
+
let s = D(e, r);
|
|
593
873
|
!isFinite(t[r]) || !isFinite(s) || o.push({
|
|
594
|
-
x:
|
|
874
|
+
x: j(s),
|
|
595
875
|
y: a - (t[r] - n) * i
|
|
596
876
|
});
|
|
597
877
|
}
|
|
598
878
|
return o;
|
|
599
879
|
}
|
|
600
|
-
function
|
|
880
|
+
function ne(e) {
|
|
601
881
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
602
882
|
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(
|
|
883
|
+
let { min: n, range: r } = M.value, i = Q.value / r, a = Y.value.top + Q.value, o = (e) => a - (e - n) * i, s = [], c = [];
|
|
884
|
+
for (let n = 0; n < t; n++) isFinite(e.upper[n]) && isFinite(e.lower[n]) && isFinite(O(e, n)) ? c.push(n) : c.length && (s.push(c), c = []);
|
|
605
885
|
c.length && s.push(c);
|
|
606
886
|
let l = "";
|
|
607
887
|
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${
|
|
888
|
+
l += `M${j(O(e, t[0]))},${o(e.upper[t[0]])}`;
|
|
889
|
+
for (let n = 1; n < t.length; n++) l += `L${j(O(e, t[n]))},${o(e.upper[t[n]])}`;
|
|
890
|
+
for (let n = t.length - 1; n >= 0; n--) l += `L${j(O(e, t[n]))},${o(e.lower[t[n]])}`;
|
|
611
891
|
l += "Z";
|
|
612
892
|
}
|
|
613
893
|
return l;
|
|
614
894
|
}
|
|
615
|
-
function
|
|
616
|
-
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null &&
|
|
617
|
-
return
|
|
895
|
+
function F(e, t) {
|
|
896
|
+
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && C.value[e.seriesIndex] || C.value[0];
|
|
897
|
+
return j(r ? D(r, n) : n);
|
|
618
898
|
}
|
|
619
|
-
function
|
|
620
|
-
let n =
|
|
899
|
+
function re(e, t = !0) {
|
|
900
|
+
let n = Y.value.top + Q.value;
|
|
621
901
|
if (e.seriesIndex == null) {
|
|
622
|
-
let t =
|
|
623
|
-
return t > r ? "" : `M${t},${
|
|
902
|
+
let t = F(e, "start"), r = F(e, "end");
|
|
903
|
+
return t > r ? "" : `M${t},${Y.value.top}L${r},${Y.value.top}L${r},${n}L${t},${n}Z`;
|
|
624
904
|
}
|
|
625
|
-
let r =
|
|
905
|
+
let r = C.value[e.seriesIndex];
|
|
626
906
|
if (!r) return "";
|
|
627
|
-
let { min: i, range: a } =
|
|
907
|
+
let { min: i, range: a } = M.value, o = Q.value / a, s = (e) => n - (e - i) * o, c = Math.max(0, e.startIndex), l = Math.min(r.data.length - 1, e.endIndex);
|
|
628
908
|
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${
|
|
909
|
+
let u = `M${j(D(r, c))},${s(r.data[c])}`;
|
|
910
|
+
for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${j(D(r, e))},${s(r.data[e])}`);
|
|
911
|
+
return t && (u += `L${j(D(r, l))},${n}`, u += `L${j(D(r, c))},${n}`, u += "Z"), u;
|
|
632
912
|
}
|
|
633
|
-
let
|
|
913
|
+
let ie = n(() => {
|
|
634
914
|
let e = l.areaSections;
|
|
635
915
|
if (!e?.length) return {
|
|
636
916
|
labels: [],
|
|
637
917
|
extraHeight: 0
|
|
638
918
|
};
|
|
639
|
-
let t = [], n =
|
|
919
|
+
let t = [], n = Y.value.left + Z.value;
|
|
640
920
|
for (let r of e) {
|
|
641
921
|
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) *
|
|
922
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * bt, o = F(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : C.value[r.seriesIndex]?.color ?? "currentColor");
|
|
643
923
|
t.push({
|
|
644
924
|
cx: c,
|
|
645
925
|
labelText: e,
|
|
@@ -654,7 +934,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
654
934
|
let r = [];
|
|
655
935
|
for (let e of t) {
|
|
656
936
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
657
|
-
for (; n < r.length && !(t >= r[n] +
|
|
937
|
+
for (; n < r.length && !(t >= r[n] + xt);) n++;
|
|
658
938
|
e.row = n;
|
|
659
939
|
let i = e.cx + e.textWidth / 2;
|
|
660
940
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -664,11 +944,11 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
664
944
|
extraHeight: 0
|
|
665
945
|
} : {
|
|
666
946
|
labels: t,
|
|
667
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
947
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * vt + yt
|
|
668
948
|
};
|
|
669
|
-
}),
|
|
949
|
+
}), ae = n(() => {
|
|
670
950
|
let e = [];
|
|
671
|
-
for (let t of
|
|
951
|
+
for (let t of C.value) t.legend && e.push({
|
|
672
952
|
label: t.legend,
|
|
673
953
|
color: t.color ?? "currentColor",
|
|
674
954
|
type: "series",
|
|
@@ -677,7 +957,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
677
957
|
let t = l.areaSections;
|
|
678
958
|
if (t) for (let n of t) {
|
|
679
959
|
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" :
|
|
960
|
+
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : C.value[n.seriesIndex]?.color ?? "currentColor");
|
|
681
961
|
e.push({
|
|
682
962
|
label: t,
|
|
683
963
|
color: r,
|
|
@@ -686,41 +966,41 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
686
966
|
});
|
|
687
967
|
}
|
|
688
968
|
return e;
|
|
689
|
-
}),
|
|
690
|
-
let { min: e, max: t } =
|
|
969
|
+
}), oe = n(() => pe.value + ie.value.extraHeight), I = n(() => Y.value.top + Q.value + Y.value.bottom + yt), se = n(() => {
|
|
970
|
+
let { min: e, max: t } = M.value, n = (t) => V(Y.value.top + Q.value - (t - e) / M.value.range * Q.value), r = (e) => l.yTickFormat ? l.yTickFormat(e) : W(e);
|
|
691
971
|
return e === t ? [{
|
|
692
972
|
value: r(e),
|
|
693
|
-
y:
|
|
694
|
-
}] :
|
|
973
|
+
y: V(Y.value.top + Q.value / 2)
|
|
974
|
+
}] : G({
|
|
695
975
|
min: e,
|
|
696
976
|
max: t,
|
|
697
977
|
ticks: l.yTicks,
|
|
698
|
-
targetTickCount:
|
|
978
|
+
targetTickCount: Q.value / 50
|
|
699
979
|
}).map((e) => ({
|
|
700
980
|
value: r(e),
|
|
701
981
|
y: n(e)
|
|
702
982
|
}));
|
|
703
983
|
}), ce = n(() => {
|
|
704
|
-
let { min: e, max: t } =
|
|
984
|
+
let { min: e, max: t } = A.value;
|
|
705
985
|
if (e === t) return [];
|
|
706
|
-
let n =
|
|
986
|
+
let n = k.value, r = T.value, i = (e, t) => {
|
|
707
987
|
let r = e + n;
|
|
708
|
-
return l.xTickFormat ? l.xTickFormat(r, t) : !
|
|
988
|
+
return l.xTickFormat ? l.xTickFormat(r, t) : !E.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : W(r);
|
|
709
989
|
}, a;
|
|
710
|
-
if (l.xTicks == null && !
|
|
711
|
-
let e = Math.max(3, Math.floor(
|
|
990
|
+
if (l.xTicks == null && !E.value && l.xLabels && l.xLabels.length === r) {
|
|
991
|
+
let e = Math.max(3, Math.floor(Z.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
|
|
712
992
|
a = [];
|
|
713
993
|
for (let e = 0; e < r; e += t) a.push(e);
|
|
714
|
-
} else a =
|
|
994
|
+
} else a = G({
|
|
715
995
|
min: e,
|
|
716
996
|
max: t,
|
|
717
997
|
ticks: l.xTicks,
|
|
718
|
-
targetTickCount:
|
|
998
|
+
targetTickCount: Z.value / 80,
|
|
719
999
|
displayOffset: n
|
|
720
1000
|
});
|
|
721
|
-
let o =
|
|
1001
|
+
let o = Y.value.left, s = Y.value.left + Z.value;
|
|
722
1002
|
return a.map((e, t) => {
|
|
723
|
-
let n =
|
|
1003
|
+
let n = V(j(e)), r = "middle";
|
|
724
1004
|
return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
|
|
725
1005
|
value: i(e, t),
|
|
726
1006
|
x: n,
|
|
@@ -728,49 +1008,49 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
728
1008
|
};
|
|
729
1009
|
});
|
|
730
1010
|
});
|
|
731
|
-
function
|
|
732
|
-
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : ge(
|
|
1011
|
+
function L() {
|
|
1012
|
+
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : ge(C.value);
|
|
733
1013
|
}
|
|
734
|
-
let
|
|
735
|
-
let e =
|
|
736
|
-
return e === null || !t ? null :
|
|
737
|
-
}),
|
|
738
|
-
function
|
|
1014
|
+
let R = n(() => !!l.tooltipData || !!l.tooltipTrigger), z = n(() => {
|
|
1015
|
+
let e = he.value, t = C.value[0];
|
|
1016
|
+
return e === null || !t ? null : D(t, e);
|
|
1017
|
+
}), B = n(() => z.value === null ? 0 : j(z.value));
|
|
1018
|
+
function H(e, t) {
|
|
739
1019
|
let n = e.data.length;
|
|
740
1020
|
if (n === 0) return null;
|
|
741
1021
|
let r = 0, i = Infinity;
|
|
742
1022
|
for (let a = 0; a < n; a++) {
|
|
743
|
-
let n =
|
|
1023
|
+
let n = D(e, a);
|
|
744
1024
|
if (!isFinite(n)) continue;
|
|
745
1025
|
let o = Math.abs(n - t);
|
|
746
1026
|
o < i && (i = o, r = a);
|
|
747
1027
|
}
|
|
748
1028
|
return i === Infinity ? null : r;
|
|
749
1029
|
}
|
|
750
|
-
let
|
|
751
|
-
let e =
|
|
1030
|
+
let ue = n(() => {
|
|
1031
|
+
let e = z.value;
|
|
752
1032
|
if (e === null) return [];
|
|
753
|
-
let { min: t, range: n } =
|
|
754
|
-
for (let n of
|
|
755
|
-
let o =
|
|
1033
|
+
let { min: t, range: n } = M.value, r = Q.value / n, i = Y.value.top + Q.value, a = [];
|
|
1034
|
+
for (let n of C.value) {
|
|
1035
|
+
let o = H(n, e);
|
|
756
1036
|
if (o === null) continue;
|
|
757
1037
|
let s = n.data[o];
|
|
758
1038
|
isFinite(s) && a.push({
|
|
759
|
-
x:
|
|
1039
|
+
x: j(D(n, o)),
|
|
760
1040
|
y: i - (s - t) * r,
|
|
761
1041
|
color: n.color ?? "currentColor"
|
|
762
1042
|
});
|
|
763
1043
|
}
|
|
764
1044
|
return a;
|
|
765
|
-
}),
|
|
766
|
-
let e =
|
|
1045
|
+
}), U = n(() => {
|
|
1046
|
+
let e = he.value, t = z.value;
|
|
767
1047
|
if (e === null || t === null) return null;
|
|
768
|
-
let n = t +
|
|
769
|
-
return r = l.xTickFormat ? l.xTickFormat(n, e) :
|
|
1048
|
+
let n = t + k.value, r;
|
|
1049
|
+
return r = l.xTickFormat ? l.xTickFormat(n, e) : E.value ? W(n) : l.xLabels?.[e], {
|
|
770
1050
|
index: e,
|
|
771
1051
|
xLabel: r,
|
|
772
|
-
values:
|
|
773
|
-
let r =
|
|
1052
|
+
values: C.value.map((e, n) => {
|
|
1053
|
+
let r = H(e, t);
|
|
774
1054
|
return {
|
|
775
1055
|
value: r === null ? NaN : Number(e.data[r]),
|
|
776
1056
|
color: e.color ?? "currentColor",
|
|
@@ -780,163 +1060,177 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
780
1060
|
data: l.tooltipData?.[e] ?? null
|
|
781
1061
|
};
|
|
782
1062
|
});
|
|
783
|
-
function
|
|
784
|
-
|
|
1063
|
+
function K(e, t) {
|
|
1064
|
+
if (!isFinite(e) || !isFinite(t)) return null;
|
|
1065
|
+
let n = e - k.value, { min: r, range: i } = M.value, a = Y.value.top + Q.value - (t - r) * (Q.value / i);
|
|
1066
|
+
return {
|
|
1067
|
+
x: j(n),
|
|
1068
|
+
y: a
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
function de(e) {
|
|
1072
|
+
let t = q.value?.getBoundingClientRect();
|
|
785
1073
|
if (!t) return null;
|
|
786
|
-
let n =
|
|
1074
|
+
let n = C.value[0];
|
|
787
1075
|
if (!n || n.data.length === 0) return null;
|
|
788
|
-
let { min: r, max: i } =
|
|
789
|
-
return
|
|
1076
|
+
let { min: r, max: i } = A.value, a = i - r || 1;
|
|
1077
|
+
return H(n, r + (e - t.left - Y.value.left) / Z.value * a);
|
|
790
1078
|
}
|
|
791
|
-
let {
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
1079
|
+
let { containerRef: q, svgRef: J, width: fe, height: pe, padding: Y, legendY: X, innerW: Z, innerH: Q, bounds: me, hoverIndex: he, tooltipRef: _e, tooltipPos: $, tooltipHandlers: ve, menuItems: ye, downloadLinkText: be, csvHref: xe, menuFilename: Se } = Re({
|
|
1080
|
+
width: () => l.width,
|
|
1081
|
+
height: () => l.height,
|
|
1082
|
+
title: () => l.title,
|
|
1083
|
+
xLabel: () => l.xLabel,
|
|
1084
|
+
yLabel: () => l.yLabel,
|
|
1085
|
+
debounce: () => l.debounce,
|
|
1086
|
+
menu: () => l.menu,
|
|
1087
|
+
tooltipTrigger: () => l.tooltipTrigger,
|
|
1088
|
+
tooltipClamp: () => l.tooltipClamp,
|
|
799
1089
|
filename: () => l.filename,
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
1090
|
+
downloadLink: () => l.downloadLink,
|
|
1091
|
+
chartPadding: () => l.chartPadding,
|
|
1092
|
+
hasInlineLegend: () => h.value,
|
|
1093
|
+
hasTooltipSlot: () => R.value,
|
|
1094
|
+
getCsv: L,
|
|
1095
|
+
pointerToIndex: de,
|
|
1096
|
+
onHover: (e) => f("hover", e)
|
|
803
1097
|
});
|
|
804
|
-
return (n, c) => (
|
|
1098
|
+
return (n, c) => (_(), a("div", {
|
|
805
1099
|
ref_key: "containerRef",
|
|
806
|
-
ref:
|
|
1100
|
+
ref: q,
|
|
807
1101
|
class: "line-chart-wrapper"
|
|
808
1102
|
}, [
|
|
809
|
-
t.menu ? (
|
|
1103
|
+
t.menu ? (_(), r(le, {
|
|
810
1104
|
key: 0,
|
|
811
|
-
items:
|
|
1105
|
+
items: S(ye)
|
|
812
1106
|
}, null, 8, ["items"])) : i("", !0),
|
|
813
|
-
(
|
|
1107
|
+
(_(), a("svg", {
|
|
814
1108
|
ref_key: "svgRef",
|
|
815
|
-
ref:
|
|
816
|
-
width:
|
|
817
|
-
height:
|
|
1109
|
+
ref: J,
|
|
1110
|
+
width: S(fe),
|
|
1111
|
+
height: oe.value
|
|
818
1112
|
}, [
|
|
819
|
-
t.title ? (
|
|
1113
|
+
t.title ? (_(), a("text", {
|
|
820
1114
|
key: 0,
|
|
821
|
-
x:
|
|
1115
|
+
x: S(fe) / 2,
|
|
822
1116
|
y: 18,
|
|
823
1117
|
"text-anchor": "middle",
|
|
824
1118
|
"font-size": "14",
|
|
825
1119
|
"font-weight": "600",
|
|
826
1120
|
fill: "currentColor"
|
|
827
|
-
},
|
|
828
|
-
|
|
1121
|
+
}, b(t.title), 9, Ve)) : i("", !0),
|
|
1122
|
+
ae.value.length > 0 ? (_(), a("g", He, [(_(!0), a(e, null, y(ae.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
|
|
829
1123
|
key: 0,
|
|
830
|
-
x1:
|
|
831
|
-
y1:
|
|
832
|
-
x2:
|
|
833
|
-
y2:
|
|
1124
|
+
x1: S(Y).left + n * 120,
|
|
1125
|
+
y1: S(X),
|
|
1126
|
+
x2: S(Y).left + n * 120 + 12,
|
|
1127
|
+
y2: S(X),
|
|
834
1128
|
stroke: t.color,
|
|
835
1129
|
"stroke-width": "2",
|
|
836
1130
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
837
|
-
}, null, 8,
|
|
1131
|
+
}, null, 8, Ue)) : (_(), a("circle", {
|
|
838
1132
|
key: 1,
|
|
839
|
-
cx:
|
|
840
|
-
cy:
|
|
1133
|
+
cx: S(Y).left + n * 120 + 4,
|
|
1134
|
+
cy: S(X),
|
|
841
1135
|
r: "4",
|
|
842
1136
|
fill: t.color,
|
|
843
1137
|
"fill-opacity": t.fillOpacity,
|
|
844
1138
|
stroke: t.color,
|
|
845
1139
|
"stroke-width": "1.5"
|
|
846
|
-
}, null, 8,
|
|
847
|
-
x:
|
|
848
|
-
y:
|
|
1140
|
+
}, null, 8, We)), o("text", {
|
|
1141
|
+
x: S(Y).left + n * 120 + 18,
|
|
1142
|
+
y: S(X) + 4,
|
|
849
1143
|
"font-size": "11",
|
|
850
1144
|
fill: "currentColor"
|
|
851
|
-
},
|
|
1145
|
+
}, b(t.label), 9, Ge)], 64))), 128))])) : i("", !0),
|
|
852
1146
|
o("line", {
|
|
853
|
-
x1:
|
|
854
|
-
y1:
|
|
855
|
-
x2:
|
|
856
|
-
y2:
|
|
1147
|
+
x1: S(V)(S(Y).left),
|
|
1148
|
+
y1: S(V)(S(Y).top),
|
|
1149
|
+
x2: S(V)(S(Y).left),
|
|
1150
|
+
y2: S(V)(S(Y).top + S(Q)),
|
|
857
1151
|
stroke: "currentColor",
|
|
858
1152
|
"stroke-opacity": "0.3"
|
|
859
|
-
}, null, 8,
|
|
1153
|
+
}, null, 8, Ke),
|
|
860
1154
|
o("line", {
|
|
861
|
-
x1:
|
|
862
|
-
y1:
|
|
863
|
-
x2:
|
|
864
|
-
y2:
|
|
1155
|
+
x1: S(V)(S(Y).left),
|
|
1156
|
+
y1: S(V)(S(Y).top + S(Q)),
|
|
1157
|
+
x2: S(V)(S(Y).left + S(Z)),
|
|
1158
|
+
y2: S(V)(S(Y).top + S(Q)),
|
|
865
1159
|
stroke: "currentColor",
|
|
866
1160
|
"stroke-opacity": "0.3"
|
|
867
|
-
}, null, 8,
|
|
868
|
-
t.yGrid ? (
|
|
1161
|
+
}, null, 8, qe),
|
|
1162
|
+
t.yGrid ? (_(!0), a(e, { key: 2 }, y(se.value, (e, t) => (_(), a("line", {
|
|
869
1163
|
key: "yg" + t,
|
|
870
|
-
x1:
|
|
1164
|
+
x1: S(Y).left,
|
|
871
1165
|
y1: e.y,
|
|
872
|
-
x2:
|
|
1166
|
+
x2: S(Y).left + S(Z),
|
|
873
1167
|
y2: e.y,
|
|
874
1168
|
stroke: "currentColor",
|
|
875
1169
|
"stroke-opacity": "0.1"
|
|
876
|
-
}, null, 8,
|
|
877
|
-
t.xGrid ? (
|
|
1170
|
+
}, null, 8, Je))), 128)) : i("", !0),
|
|
1171
|
+
t.xGrid ? (_(!0), a(e, { key: 3 }, y(ce.value, (e, t) => (_(), a("line", {
|
|
878
1172
|
key: "xg" + t,
|
|
879
1173
|
x1: e.x,
|
|
880
|
-
y1:
|
|
1174
|
+
y1: S(Y).top,
|
|
881
1175
|
x2: e.x,
|
|
882
|
-
y2:
|
|
1176
|
+
y2: S(Y).top + S(Q),
|
|
883
1177
|
stroke: "currentColor",
|
|
884
1178
|
"stroke-opacity": "0.1"
|
|
885
|
-
}, null, 8,
|
|
886
|
-
(
|
|
1179
|
+
}, null, 8, Ye))), 128)) : i("", !0),
|
|
1180
|
+
(_(!0), a(e, null, y(se.value, (e, t) => (_(), a("text", {
|
|
887
1181
|
key: "y" + t,
|
|
888
1182
|
"data-testid": "y-tick",
|
|
889
|
-
x:
|
|
1183
|
+
x: S(Y).left - 6,
|
|
890
1184
|
y: e.y,
|
|
891
1185
|
"text-anchor": "end",
|
|
892
1186
|
"dominant-baseline": "middle",
|
|
893
1187
|
"font-size": "10",
|
|
894
1188
|
fill: "currentColor",
|
|
895
1189
|
"fill-opacity": "0.6"
|
|
896
|
-
},
|
|
897
|
-
t.yLabel ? (
|
|
1190
|
+
}, b(e.value), 9, Xe))), 128)),
|
|
1191
|
+
t.yLabel ? (_(), a("text", {
|
|
898
1192
|
key: 4,
|
|
899
1193
|
x: 0,
|
|
900
1194
|
y: 0,
|
|
901
|
-
transform: `translate(14, ${
|
|
1195
|
+
transform: `translate(14, ${S(Y).top + S(Q) / 2}) rotate(-90)`,
|
|
902
1196
|
"text-anchor": "middle",
|
|
903
1197
|
"font-size": "13",
|
|
904
1198
|
fill: "currentColor"
|
|
905
|
-
},
|
|
906
|
-
(
|
|
1199
|
+
}, b(t.yLabel), 9, Ze)) : i("", !0),
|
|
1200
|
+
(_(!0), a(e, null, y(ce.value, (e, t) => (_(), a("text", {
|
|
907
1201
|
key: "x" + t,
|
|
908
1202
|
"data-testid": "x-tick",
|
|
909
1203
|
x: e.x,
|
|
910
|
-
y:
|
|
1204
|
+
y: S(Y).top + S(Q) + 16,
|
|
911
1205
|
"text-anchor": e.anchor,
|
|
912
1206
|
"font-size": "10",
|
|
913
1207
|
fill: "currentColor",
|
|
914
1208
|
"fill-opacity": "0.6"
|
|
915
|
-
},
|
|
916
|
-
t.xLabel ? (
|
|
1209
|
+
}, b(e.value), 9, Qe))), 128)),
|
|
1210
|
+
t.xLabel ? (_(), a("text", {
|
|
917
1211
|
key: 5,
|
|
918
|
-
x:
|
|
919
|
-
y:
|
|
1212
|
+
x: S(Y).left + S(Z) / 2,
|
|
1213
|
+
y: S(pe) - 4,
|
|
920
1214
|
"text-anchor": "middle",
|
|
921
1215
|
"font-size": "13",
|
|
922
1216
|
fill: "currentColor"
|
|
923
|
-
},
|
|
924
|
-
(
|
|
1217
|
+
}, b(t.xLabel), 9, $e)) : i("", !0),
|
|
1218
|
+
(_(!0), a(e, null, y(w.value, (e, t) => (_(), a("path", {
|
|
925
1219
|
key: "area" + t,
|
|
926
|
-
d:
|
|
1220
|
+
d: ne(e),
|
|
927
1221
|
fill: e.color ?? "currentColor",
|
|
928
1222
|
"fill-opacity": e.opacity ?? .2,
|
|
929
1223
|
stroke: "none"
|
|
930
|
-
}, null, 8,
|
|
931
|
-
(
|
|
1224
|
+
}, null, 8, et))), 128)),
|
|
1225
|
+
(_(!0), a(e, null, y(C.value, (n, r) => (_(), a(e, { key: r }, [n.line === !1 ? i("", !0) : (_(), a("path", {
|
|
932
1226
|
key: 0,
|
|
933
|
-
d:
|
|
1227
|
+
d: N(n),
|
|
934
1228
|
fill: "none",
|
|
935
1229
|
stroke: n.color ?? "currentColor",
|
|
936
1230
|
"stroke-width": n.strokeWidth ?? 1.5,
|
|
937
1231
|
"stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
|
|
938
1232
|
"stroke-dasharray": n.dashed ? "6 3" : void 0
|
|
939
|
-
}, null, 8,
|
|
1233
|
+
}, null, 8, tt)), n.dots ? (_(!0), a(e, { key: 1 }, y(P(n), (e, r) => (_(), a("circle", {
|
|
940
1234
|
key: r,
|
|
941
1235
|
cx: e.x,
|
|
942
1236
|
cy: e.y,
|
|
@@ -944,68 +1238,68 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
944
1238
|
fill: n.dotFill ?? n.color ?? "currentColor",
|
|
945
1239
|
"fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
|
|
946
1240
|
stroke: n.dotStroke ?? "none"
|
|
947
|
-
}, null, 8,
|
|
948
|
-
(
|
|
1241
|
+
}, null, 8, nt))), 128)) : i("", !0)], 64))), 128)),
|
|
1242
|
+
(_(!0), a(e, null, y(t.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
949
1243
|
o("path", {
|
|
950
|
-
d:
|
|
951
|
-
fill: t.color ?? (t.seriesIndex == null ? "#999" :
|
|
1244
|
+
d: re(t),
|
|
1245
|
+
fill: t.color ?? (t.seriesIndex == null ? "#999" : C.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
952
1246
|
"fill-opacity": t.opacity ?? .15,
|
|
953
1247
|
stroke: "none"
|
|
954
|
-
}, null, 8,
|
|
955
|
-
t.seriesIndex == null ? i("", !0) : (
|
|
1248
|
+
}, null, 8, rt),
|
|
1249
|
+
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
956
1250
|
key: 0,
|
|
957
|
-
d:
|
|
1251
|
+
d: re(t, !1),
|
|
958
1252
|
fill: "none",
|
|
959
|
-
stroke: t.color ??
|
|
1253
|
+
stroke: t.color ?? C.value[t.seriesIndex]?.color ?? "currentColor",
|
|
960
1254
|
"stroke-width": t.strokeWidth ?? 2,
|
|
961
1255
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
962
|
-
}, null, 8,
|
|
963
|
-
t.seriesIndex == null ? (
|
|
964
|
-
x1:
|
|
965
|
-
y1:
|
|
966
|
-
x2:
|
|
967
|
-
y2:
|
|
1256
|
+
}, null, 8, it)),
|
|
1257
|
+
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
1258
|
+
x1: S(V)(F(t, "start")),
|
|
1259
|
+
y1: S(Y).top,
|
|
1260
|
+
x2: S(V)(F(t, "start")),
|
|
1261
|
+
y2: S(Y).top + S(Q),
|
|
968
1262
|
stroke: t.color ?? "#999",
|
|
969
1263
|
"stroke-width": t.strokeWidth ?? 2,
|
|
970
1264
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
971
|
-
}, null, 8,
|
|
972
|
-
x1:
|
|
973
|
-
y1:
|
|
974
|
-
x2:
|
|
975
|
-
y2:
|
|
1265
|
+
}, null, 8, at), o("line", {
|
|
1266
|
+
x1: S(V)(F(t, "end")),
|
|
1267
|
+
y1: S(Y).top,
|
|
1268
|
+
x2: S(V)(F(t, "end")),
|
|
1269
|
+
y2: S(Y).top + S(Q),
|
|
976
1270
|
stroke: t.color ?? "#999",
|
|
977
1271
|
"stroke-width": t.strokeWidth ?? 2,
|
|
978
1272
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
979
|
-
}, null, 8,
|
|
1273
|
+
}, null, 8, ot)], 64)) : i("", !0),
|
|
980
1274
|
o("line", {
|
|
981
|
-
x1:
|
|
982
|
-
y1:
|
|
983
|
-
x2:
|
|
984
|
-
y2:
|
|
1275
|
+
x1: S(V)(F(t, "start")),
|
|
1276
|
+
y1: S(Y).top + S(Q) - 4,
|
|
1277
|
+
x2: S(V)(F(t, "start")),
|
|
1278
|
+
y2: S(Y).top + S(Q) + 4,
|
|
985
1279
|
stroke: "currentColor",
|
|
986
1280
|
"stroke-opacity": "0.4"
|
|
987
|
-
}, null, 8,
|
|
1281
|
+
}, null, 8, st),
|
|
988
1282
|
o("line", {
|
|
989
|
-
x1:
|
|
990
|
-
y1:
|
|
991
|
-
x2:
|
|
992
|
-
y2:
|
|
1283
|
+
x1: S(V)(F(t, "end")),
|
|
1284
|
+
y1: S(Y).top + S(Q) - 4,
|
|
1285
|
+
x2: S(V)(F(t, "end")),
|
|
1286
|
+
y2: S(Y).top + S(Q) + 4,
|
|
993
1287
|
stroke: "currentColor",
|
|
994
1288
|
"stroke-opacity": "0.4"
|
|
995
|
-
}, null, 8,
|
|
1289
|
+
}, null, 8, ct)
|
|
996
1290
|
], 64))), 128)),
|
|
997
|
-
|
|
1291
|
+
R.value && S(he) !== null ? (_(), a("line", {
|
|
998
1292
|
key: 6,
|
|
999
|
-
x1:
|
|
1000
|
-
y1:
|
|
1001
|
-
x2:
|
|
1002
|
-
y2:
|
|
1293
|
+
x1: S(V)(B.value),
|
|
1294
|
+
y1: S(Y).top,
|
|
1295
|
+
x2: S(V)(B.value),
|
|
1296
|
+
y2: S(Y).top + S(Q),
|
|
1003
1297
|
stroke: "currentColor",
|
|
1004
1298
|
"stroke-opacity": "0.3",
|
|
1005
1299
|
"stroke-dasharray": "4 2",
|
|
1006
1300
|
"pointer-events": "none"
|
|
1007
|
-
}, null, 8,
|
|
1008
|
-
(
|
|
1301
|
+
}, null, 8, lt)) : i("", !0),
|
|
1302
|
+
(_(!0), a(e, null, y(ue.value, (e, t) => (_(), a("circle", {
|
|
1009
1303
|
key: "hd" + t,
|
|
1010
1304
|
cx: e.x,
|
|
1011
1305
|
cy: e.y,
|
|
@@ -1014,104 +1308,110 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1014
1308
|
stroke: "var(--color-bg-0, #fff)",
|
|
1015
1309
|
"stroke-width": "2",
|
|
1016
1310
|
"pointer-events": "none"
|
|
1017
|
-
}, null, 8,
|
|
1018
|
-
|
|
1311
|
+
}, null, 8, ut))), 128)),
|
|
1312
|
+
R.value ? (_(), a("rect", d({
|
|
1019
1313
|
key: 7,
|
|
1020
|
-
x:
|
|
1021
|
-
y:
|
|
1022
|
-
width:
|
|
1023
|
-
height:
|
|
1314
|
+
x: S(Y).left,
|
|
1315
|
+
y: S(Y).top,
|
|
1316
|
+
width: S(Z),
|
|
1317
|
+
height: S(Q),
|
|
1024
1318
|
fill: "transparent",
|
|
1025
1319
|
style: {
|
|
1026
1320
|
cursor: "crosshair",
|
|
1027
1321
|
"touch-action": "none"
|
|
1028
1322
|
}
|
|
1029
|
-
},
|
|
1030
|
-
|
|
1323
|
+
}, te(S(ve), !0)), null, 16, dt)) : i("", !0),
|
|
1324
|
+
t.annotations && t.annotations.length > 0 ? (_(), r(S(Fe), {
|
|
1325
|
+
key: 8,
|
|
1326
|
+
annotations: t.annotations,
|
|
1327
|
+
project: K,
|
|
1328
|
+
bounds: S(me)
|
|
1329
|
+
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
1330
|
+
(_(!0), a(e, null, y(ie.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
1031
1331
|
o("circle", {
|
|
1032
1332
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
1033
|
-
cy:
|
|
1333
|
+
cy: I.value + e.row * vt + 4,
|
|
1034
1334
|
r: "4",
|
|
1035
1335
|
fill: e.color,
|
|
1036
1336
|
"fill-opacity": e.fillOpacity,
|
|
1037
1337
|
stroke: e.color,
|
|
1038
1338
|
"stroke-width": "1.5"
|
|
1039
|
-
}, null, 8,
|
|
1040
|
-
e.labelText ? (
|
|
1339
|
+
}, null, 8, ft),
|
|
1340
|
+
e.labelText ? (_(), a("text", {
|
|
1041
1341
|
key: 0,
|
|
1042
1342
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1043
|
-
y:
|
|
1343
|
+
y: I.value + e.row * vt + 8,
|
|
1044
1344
|
"font-size": "11",
|
|
1045
1345
|
"font-weight": "600",
|
|
1046
1346
|
fill: e.color
|
|
1047
|
-
},
|
|
1048
|
-
e.descText ? (
|
|
1347
|
+
}, b(e.labelText), 9, pt)) : i("", !0),
|
|
1348
|
+
e.descText ? (_(), a("text", {
|
|
1049
1349
|
key: 1,
|
|
1050
1350
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1051
|
-
y:
|
|
1351
|
+
y: I.value + e.row * vt + 22,
|
|
1052
1352
|
"font-size": "11",
|
|
1053
1353
|
fill: "currentColor",
|
|
1054
1354
|
"fill-opacity": "0.6"
|
|
1055
|
-
},
|
|
1355
|
+
}, b(e.descText), 9, mt)) : i("", !0)
|
|
1056
1356
|
]))), 128))
|
|
1057
|
-
], 8,
|
|
1058
|
-
|
|
1357
|
+
], 8, Be)),
|
|
1358
|
+
R.value && S(he) !== null && U.value ? (_(), a("div", {
|
|
1059
1359
|
key: 1,
|
|
1060
1360
|
ref_key: "tooltipRef",
|
|
1061
|
-
ref:
|
|
1361
|
+
ref: _e,
|
|
1062
1362
|
class: "chart-tooltip-content",
|
|
1063
1363
|
style: m({
|
|
1064
1364
|
position: "absolute",
|
|
1065
1365
|
top: "0",
|
|
1066
1366
|
left: "0",
|
|
1067
1367
|
willChange: "transform",
|
|
1068
|
-
transform:
|
|
1069
|
-
visibility:
|
|
1368
|
+
transform: S($) ? `translate3d(${S($).left}px, ${S($).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
1369
|
+
visibility: S($) ? "visible" : "hidden"
|
|
1070
1370
|
})
|
|
1071
|
-
}, [
|
|
1371
|
+
}, [ee(n.$slots, "tooltip", p(u(U.value)), () => [o("div", ht, [U.value.xLabel ? (_(), a("div", gt, b(U.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(U.value.values, (e) => (_(), a("div", {
|
|
1072
1372
|
key: e.seriesIndex,
|
|
1073
1373
|
class: "line-chart-tooltip-row"
|
|
1074
1374
|
}, [o("span", {
|
|
1075
1375
|
class: "line-chart-tooltip-swatch",
|
|
1076
1376
|
style: m({ background: e.color })
|
|
1077
|
-
}, null, 4), s(" " +
|
|
1078
|
-
|
|
1377
|
+
}, null, 4), s(" " + b(isFinite(e.value) ? S(x)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1378
|
+
S(be) ? (_(), a("a", {
|
|
1079
1379
|
key: 2,
|
|
1080
1380
|
class: "line-chart-download-link",
|
|
1081
|
-
href:
|
|
1082
|
-
download: `${
|
|
1083
|
-
},
|
|
1381
|
+
href: S(xe),
|
|
1382
|
+
download: `${S(Se)()}.csv`
|
|
1383
|
+
}, b(S(be)), 9, _t)) : i("", !0)
|
|
1084
1384
|
], 512));
|
|
1085
1385
|
}
|
|
1086
|
-
}), [["__scopeId", "data-v-
|
|
1386
|
+
}), [["__scopeId", "data-v-ebe2731e"]]), Ct = ["width", "height"], wt = ["x"], Tt = { key: 1 }, Et = [
|
|
1087
1387
|
"x",
|
|
1088
1388
|
"y",
|
|
1089
1389
|
"fill"
|
|
1090
|
-
],
|
|
1390
|
+
], Dt = ["x", "y"], Ot = [
|
|
1091
1391
|
"x1",
|
|
1092
1392
|
"y1",
|
|
1093
1393
|
"x2",
|
|
1094
1394
|
"y2"
|
|
1095
|
-
],
|
|
1395
|
+
], kt = [
|
|
1096
1396
|
"x1",
|
|
1097
1397
|
"y1",
|
|
1098
1398
|
"x2",
|
|
1099
1399
|
"y2"
|
|
1100
|
-
],
|
|
1400
|
+
], At = [
|
|
1101
1401
|
"x1",
|
|
1102
1402
|
"y1",
|
|
1103
1403
|
"x2",
|
|
1104
1404
|
"y2"
|
|
1105
|
-
],
|
|
1405
|
+
], jt = [
|
|
1106
1406
|
"x",
|
|
1107
1407
|
"y",
|
|
1108
1408
|
"width",
|
|
1109
1409
|
"height"
|
|
1110
|
-
],
|
|
1410
|
+
], Mt = ["x", "y"], Nt = ["x", "y"], Pt = ["transform"], Ft = [
|
|
1111
1411
|
"x",
|
|
1112
1412
|
"y",
|
|
1113
1413
|
"text-anchor"
|
|
1114
|
-
],
|
|
1414
|
+
], It = ["x", "y"], Lt = ["x", "y"], Rt = [
|
|
1115
1415
|
"data-category",
|
|
1116
1416
|
"data-series",
|
|
1117
1417
|
"x",
|
|
@@ -1120,15 +1420,15 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1120
1420
|
"height",
|
|
1121
1421
|
"fill",
|
|
1122
1422
|
"fill-opacity"
|
|
1123
|
-
],
|
|
1423
|
+
], zt = [
|
|
1124
1424
|
"x",
|
|
1125
1425
|
"y",
|
|
1126
1426
|
"width",
|
|
1127
1427
|
"height"
|
|
1128
|
-
],
|
|
1428
|
+
], Bt = { class: "bar-chart-tooltip" }, Vt = {
|
|
1129
1429
|
key: 0,
|
|
1130
1430
|
class: "bar-chart-tooltip-label"
|
|
1131
|
-
},
|
|
1431
|
+
}, Ht = ["href", "download"], Ut = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
1132
1432
|
__name: "BarChart",
|
|
1133
1433
|
props: {
|
|
1134
1434
|
data: {},
|
|
@@ -1137,78 +1437,73 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1137
1437
|
categories: {},
|
|
1138
1438
|
orientation: { default: "vertical" },
|
|
1139
1439
|
layout: { default: "grouped" },
|
|
1140
|
-
width: {},
|
|
1141
|
-
height: {},
|
|
1142
|
-
title: {},
|
|
1143
|
-
xLabel: {},
|
|
1144
|
-
yLabel: {},
|
|
1145
1440
|
valueMin: { default: 0 },
|
|
1146
1441
|
valueTicks: {},
|
|
1147
1442
|
valueTickFormat: {},
|
|
1148
|
-
tooltipValueFormat: {},
|
|
1149
1443
|
categoryFormat: {},
|
|
1150
1444
|
barPadding: { default: .2 },
|
|
1151
1445
|
groupGap: { default: 1 },
|
|
1446
|
+
valueGrid: {
|
|
1447
|
+
type: Boolean,
|
|
1448
|
+
default: !0
|
|
1449
|
+
},
|
|
1450
|
+
width: {},
|
|
1451
|
+
height: {},
|
|
1452
|
+
title: {},
|
|
1453
|
+
xLabel: {},
|
|
1454
|
+
yLabel: {},
|
|
1152
1455
|
debounce: {},
|
|
1153
1456
|
menu: {
|
|
1154
1457
|
type: [Boolean, String],
|
|
1155
1458
|
default: !0
|
|
1156
1459
|
},
|
|
1157
|
-
valueGrid: {
|
|
1158
|
-
type: Boolean,
|
|
1159
|
-
default: !0
|
|
1160
|
-
},
|
|
1161
1460
|
tooltipData: {},
|
|
1162
1461
|
tooltipTrigger: {},
|
|
1163
1462
|
tooltipClamp: { default: "chart" },
|
|
1463
|
+
tooltipValueFormat: {},
|
|
1164
1464
|
csv: {},
|
|
1165
1465
|
filename: {},
|
|
1166
|
-
downloadLink: { type: [Boolean, String] }
|
|
1466
|
+
downloadLink: { type: [Boolean, String] },
|
|
1467
|
+
annotations: {},
|
|
1468
|
+
chartPadding: {}
|
|
1167
1469
|
},
|
|
1168
1470
|
emits: ["hover"],
|
|
1169
1471
|
setup(t, { emit: c }) {
|
|
1170
|
-
let l = t, f = c,
|
|
1171
|
-
|
|
1172
|
-
xLabel: () => l.xLabel,
|
|
1173
|
-
yLabel: () => l.yLabel,
|
|
1174
|
-
hasInlineLegend: () => re.value,
|
|
1175
|
-
width: () => _.value,
|
|
1176
|
-
height: () => b.value
|
|
1177
|
-
}), T = [];
|
|
1178
|
-
function E(e) {
|
|
1472
|
+
let l = t, f = c, h = n(() => x.value.some((e) => e.legend)), g = [];
|
|
1473
|
+
function v(e) {
|
|
1179
1474
|
return {
|
|
1180
|
-
data: e.y ?? e.data ??
|
|
1475
|
+
data: e.y ?? e.data ?? g,
|
|
1181
1476
|
color: e.color,
|
|
1182
1477
|
opacity: e.opacity,
|
|
1183
1478
|
legend: e.legend
|
|
1184
1479
|
};
|
|
1185
1480
|
}
|
|
1186
|
-
let
|
|
1187
|
-
if (l.series && l.series.length > 0) return l.series.map(
|
|
1481
|
+
let x = n(() => {
|
|
1482
|
+
if (l.series && l.series.length > 0) return l.series.map(v);
|
|
1188
1483
|
let e = l.y ?? l.data;
|
|
1189
1484
|
return e ? [{ data: e }] : [];
|
|
1190
|
-
}),
|
|
1485
|
+
}), C = n(() => {
|
|
1191
1486
|
let e = l.categories?.length ?? 0;
|
|
1192
|
-
for (let t of
|
|
1487
|
+
for (let t of x.value) t.data.length > e && (e = t.data.length);
|
|
1193
1488
|
return e;
|
|
1194
|
-
}),
|
|
1195
|
-
let e =
|
|
1489
|
+
}), w = n(() => {
|
|
1490
|
+
let e = C.value, t = Array(e);
|
|
1196
1491
|
for (let n = 0; n < e; n++) t[n] = l.categories?.[n] ?? String(n);
|
|
1197
1492
|
return t;
|
|
1198
|
-
}),
|
|
1493
|
+
}), T = n(() => l.orientation === "vertical"), E = n(() => {
|
|
1199
1494
|
let e = Infinity, t = -Infinity;
|
|
1200
1495
|
if (l.layout === "stacked") {
|
|
1201
|
-
let n =
|
|
1496
|
+
let n = C.value;
|
|
1202
1497
|
for (let r = 0; r < n; r++) {
|
|
1203
1498
|
let n = 0, i = 0;
|
|
1204
|
-
for (let e of
|
|
1499
|
+
for (let e of x.value) {
|
|
1205
1500
|
if (r >= e.data.length) continue;
|
|
1206
1501
|
let t = Number(e.data[r]);
|
|
1207
1502
|
isFinite(t) && (t >= 0 ? n += t : i += t);
|
|
1208
1503
|
}
|
|
1209
1504
|
n > t && (t = n), i < e && (e = i);
|
|
1210
1505
|
}
|
|
1211
|
-
} else for (let n of
|
|
1506
|
+
} else for (let n of x.value) for (let r of n.data) {
|
|
1212
1507
|
let n = Number(r);
|
|
1213
1508
|
isFinite(n) && (n < e && (e = n), n > t && (t = n));
|
|
1214
1509
|
}
|
|
@@ -1221,30 +1516,30 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1221
1516
|
max: t,
|
|
1222
1517
|
range: r
|
|
1223
1518
|
};
|
|
1224
|
-
}),
|
|
1225
|
-
let e =
|
|
1226
|
-
return e > 0 ?
|
|
1227
|
-
}),
|
|
1228
|
-
let e =
|
|
1519
|
+
}), D = n(() => T.value ? q.value : J.value), O = n(() => T.value ? J.value : q.value), k = n(() => {
|
|
1520
|
+
let e = C.value;
|
|
1521
|
+
return e > 0 ? D.value / e : 0;
|
|
1522
|
+
}), A = n(() => k.value * (1 - l.barPadding)), j = n(() => {
|
|
1523
|
+
let e = x.value.length;
|
|
1229
1524
|
if (e === 0) return 0;
|
|
1230
|
-
if (l.layout === "stacked" || e === 1) return
|
|
1525
|
+
if (l.layout === "stacked" || e === 1) return A.value;
|
|
1231
1526
|
let t = l.groupGap * (e - 1);
|
|
1232
|
-
return Math.max(1, (
|
|
1527
|
+
return Math.max(1, (A.value - t) / e);
|
|
1233
1528
|
});
|
|
1234
|
-
function
|
|
1235
|
-
return (
|
|
1529
|
+
function M(e) {
|
|
1530
|
+
return (T.value ? K.value.left : K.value.top) + e * k.value;
|
|
1236
1531
|
}
|
|
1237
|
-
let
|
|
1238
|
-
let { min: e, max: t } =
|
|
1239
|
-
return
|
|
1532
|
+
let N = n(() => {
|
|
1533
|
+
let { min: e, max: t } = E.value, n = l.valueMin ?? 0;
|
|
1534
|
+
return P(Math.max(e, Math.min(t, n)));
|
|
1240
1535
|
});
|
|
1241
|
-
function
|
|
1242
|
-
let { min: t, range: n } =
|
|
1243
|
-
return
|
|
1536
|
+
function P(e) {
|
|
1537
|
+
let { min: t, range: n } = E.value, r = O.value / n;
|
|
1538
|
+
return T.value ? K.value.top + J.value - (e - t) * r : K.value.left + (e - t) * r;
|
|
1244
1539
|
}
|
|
1245
|
-
function
|
|
1540
|
+
function ne(e, t, n, r, i, a, o, s, c) {
|
|
1246
1541
|
let l = Math.min(e, t), u = Math.abs(e - t);
|
|
1247
|
-
return
|
|
1542
|
+
return T.value ? {
|
|
1248
1543
|
x: n,
|
|
1249
1544
|
y: l,
|
|
1250
1545
|
w: r,
|
|
@@ -1266,29 +1561,29 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1266
1561
|
seriesIndex: c
|
|
1267
1562
|
};
|
|
1268
1563
|
}
|
|
1269
|
-
let
|
|
1270
|
-
let e = [], t =
|
|
1564
|
+
let F = n(() => {
|
|
1565
|
+
let e = [], t = x.value, n = t.length;
|
|
1271
1566
|
if (n === 0) return e;
|
|
1272
|
-
let r =
|
|
1567
|
+
let r = C.value, i = k.value, a = A.value, o = j.value, s = (i - a) / 2, c = N.value;
|
|
1273
1568
|
for (let i = 0; i < r; i++) {
|
|
1274
|
-
let r =
|
|
1569
|
+
let r = M(i) + s;
|
|
1275
1570
|
if (l.layout === "stacked") {
|
|
1276
1571
|
let o = 0, s = 0;
|
|
1277
1572
|
for (let c = 0; c < n; c++) {
|
|
1278
1573
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
1279
1574
|
if (!isFinite(l)) continue;
|
|
1280
1575
|
let u = l >= 0 ? o : s, d = u + l;
|
|
1281
|
-
e.push(
|
|
1576
|
+
e.push(ne(P(u), P(d), r, a, n.color ?? ie(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
|
|
1282
1577
|
}
|
|
1283
1578
|
} else for (let a = 0; a < n; a++) {
|
|
1284
1579
|
let s = t[a], u = Number(s.data[i] ?? NaN);
|
|
1285
1580
|
if (!isFinite(u)) continue;
|
|
1286
1581
|
let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
|
|
1287
|
-
e.push(
|
|
1582
|
+
e.push(ne(c, P(u), d, o, s.color ?? ie(a), s.opacity ?? 1, u, i, a));
|
|
1288
1583
|
}
|
|
1289
1584
|
}
|
|
1290
1585
|
return e;
|
|
1291
|
-
}),
|
|
1586
|
+
}), re = [
|
|
1292
1587
|
"var(--color-primary, #3b82f6)",
|
|
1293
1588
|
"var(--color-accent, #f59e0b)",
|
|
1294
1589
|
"var(--color-success, #10b981)",
|
|
@@ -1296,238 +1591,252 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1296
1591
|
"var(--color-info, #6366f1)",
|
|
1297
1592
|
"var(--color-warning, #d97706)"
|
|
1298
1593
|
];
|
|
1299
|
-
function
|
|
1300
|
-
return
|
|
1301
|
-
}
|
|
1302
|
-
function V(e) {
|
|
1303
|
-
return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.valueTickFormat ? l.valueTickFormat(e) : K(e);
|
|
1594
|
+
function ie(e) {
|
|
1595
|
+
return re[e % re.length];
|
|
1304
1596
|
}
|
|
1305
|
-
let
|
|
1306
|
-
let { min: e, max: t } =
|
|
1597
|
+
let ae = ze(() => l.tooltipValueFormat, () => l.valueTickFormat), oe = n(() => {
|
|
1598
|
+
let { min: e, max: t } = E.value, n = (e) => l.valueTickFormat ? l.valueTickFormat(e) : W(e);
|
|
1307
1599
|
if (e === t) return [{
|
|
1308
1600
|
value: n(e),
|
|
1309
|
-
pos:
|
|
1601
|
+
pos: V(P(e))
|
|
1310
1602
|
}];
|
|
1311
|
-
let r =
|
|
1312
|
-
return
|
|
1603
|
+
let r = T.value ? 50 : 80;
|
|
1604
|
+
return G({
|
|
1313
1605
|
min: e,
|
|
1314
1606
|
max: t,
|
|
1315
1607
|
ticks: l.valueTicks,
|
|
1316
|
-
targetTickCount:
|
|
1608
|
+
targetTickCount: O.value / r
|
|
1317
1609
|
}).map((e) => ({
|
|
1318
1610
|
value: n(e),
|
|
1319
|
-
pos:
|
|
1611
|
+
pos: V(P(e))
|
|
1320
1612
|
}));
|
|
1321
|
-
}),
|
|
1322
|
-
let e = [], t =
|
|
1613
|
+
}), I = n(() => {
|
|
1614
|
+
let e = [], t = C.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
|
|
1323
1615
|
for (let r = 0; r < t; r++) {
|
|
1324
|
-
let t =
|
|
1616
|
+
let t = M(r) + k.value / 2;
|
|
1325
1617
|
e.push({
|
|
1326
|
-
label: n(
|
|
1618
|
+
label: n(w.value[r], r),
|
|
1327
1619
|
pos: t,
|
|
1328
1620
|
anchor: "middle"
|
|
1329
1621
|
});
|
|
1330
1622
|
}
|
|
1331
1623
|
return e;
|
|
1332
|
-
}),
|
|
1624
|
+
}), se = n(() => {
|
|
1333
1625
|
let e = [];
|
|
1334
|
-
return
|
|
1626
|
+
return x.value.forEach((t, n) => {
|
|
1335
1627
|
t.legend && e.push({
|
|
1336
1628
|
label: t.legend,
|
|
1337
|
-
color: t.color ??
|
|
1629
|
+
color: t.color ?? ie(n)
|
|
1338
1630
|
});
|
|
1339
1631
|
}), e;
|
|
1340
1632
|
});
|
|
1341
1633
|
function ce() {
|
|
1342
1634
|
if (typeof l.csv == "function") return l.csv();
|
|
1343
1635
|
if (typeof l.csv == "string") return l.csv;
|
|
1344
|
-
let e =
|
|
1636
|
+
let e = x.value.map((e) => ({
|
|
1345
1637
|
label: e.legend,
|
|
1346
1638
|
data: e.data
|
|
1347
1639
|
}));
|
|
1348
|
-
return _e(
|
|
1640
|
+
return _e(w.value, e);
|
|
1641
|
+
}
|
|
1642
|
+
let L = n(() => !!l.tooltipData || !!l.tooltipTrigger);
|
|
1643
|
+
function R(e, t) {
|
|
1644
|
+
if (!isFinite(e) || !isFinite(t) || k.value === 0) return null;
|
|
1645
|
+
let n = (T.value ? K.value.left : K.value.top) + (e + .5) * k.value, r = P(t);
|
|
1646
|
+
return T.value ? {
|
|
1647
|
+
x: n,
|
|
1648
|
+
y: r
|
|
1649
|
+
} : {
|
|
1650
|
+
x: r,
|
|
1651
|
+
y: n
|
|
1652
|
+
};
|
|
1349
1653
|
}
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
let n = h.value?.getBoundingClientRect();
|
|
1654
|
+
function z(e, t) {
|
|
1655
|
+
let n = B.value?.getBoundingClientRect();
|
|
1353
1656
|
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 /
|
|
1657
|
+
let r = C.value;
|
|
1658
|
+
if (r === 0 || k.value === 0) return null;
|
|
1659
|
+
let i = T.value ? e - n.left - K.value.left : t - n.top - K.value.top;
|
|
1660
|
+
return Math.max(0, Math.min(r - 1, Math.floor(i / k.value)));
|
|
1358
1661
|
}
|
|
1359
|
-
let { hoverIndex:
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1662
|
+
let { containerRef: B, svgRef: H, width: ue, height: U, padding: K, legendY: de, innerW: q, innerH: J, bounds: fe, hoverIndex: pe, tooltipRef: Y, tooltipPos: X, tooltipHandlers: Z, menuItems: Q, downloadLinkText: me, csvHref: he, menuFilename: ge } = Re({
|
|
1663
|
+
width: () => l.width,
|
|
1664
|
+
height: () => l.height,
|
|
1665
|
+
title: () => l.title,
|
|
1666
|
+
xLabel: () => l.xLabel,
|
|
1667
|
+
yLabel: () => l.yLabel,
|
|
1668
|
+
debounce: () => l.debounce,
|
|
1669
|
+
menu: () => l.menu,
|
|
1670
|
+
tooltipTrigger: () => l.tooltipTrigger,
|
|
1671
|
+
tooltipClamp: () => l.tooltipClamp,
|
|
1367
1672
|
filename: () => l.filename,
|
|
1368
|
-
|
|
1673
|
+
downloadLink: () => l.downloadLink,
|
|
1674
|
+
chartPadding: () => l.chartPadding,
|
|
1675
|
+
hasInlineLegend: () => h.value,
|
|
1676
|
+
hasTooltipSlot: () => L.value,
|
|
1369
1677
|
getCsv: ce,
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1678
|
+
pointerToIndex: z,
|
|
1679
|
+
onHover: (e) => f("hover", e)
|
|
1680
|
+
}), $ = n(() => {
|
|
1681
|
+
let e = pe.value;
|
|
1682
|
+
if (e !== null) return w.value[e];
|
|
1683
|
+
}), ve = n(() => {
|
|
1684
|
+
let e = pe.value;
|
|
1376
1685
|
return e === null ? null : {
|
|
1377
1686
|
index: e,
|
|
1378
|
-
category:
|
|
1379
|
-
values:
|
|
1687
|
+
category: w.value[e] ?? String(e),
|
|
1688
|
+
values: x.value.map((t, n) => ({
|
|
1380
1689
|
value: Number(t.data[e] ?? NaN),
|
|
1381
|
-
color: t.color ??
|
|
1690
|
+
color: t.color ?? ie(n),
|
|
1382
1691
|
seriesIndex: n
|
|
1383
1692
|
})),
|
|
1384
1693
|
data: l.tooltipData?.[e] ?? null
|
|
1385
1694
|
};
|
|
1386
|
-
}),
|
|
1387
|
-
let e =
|
|
1695
|
+
}), ye = n(() => {
|
|
1696
|
+
let e = pe.value;
|
|
1388
1697
|
if (e === null) return null;
|
|
1389
|
-
let t =
|
|
1390
|
-
return
|
|
1698
|
+
let t = M(e);
|
|
1699
|
+
return T.value ? {
|
|
1391
1700
|
x: t,
|
|
1392
|
-
y:
|
|
1393
|
-
w:
|
|
1394
|
-
h:
|
|
1701
|
+
y: K.value.top,
|
|
1702
|
+
w: k.value,
|
|
1703
|
+
h: J.value
|
|
1395
1704
|
} : {
|
|
1396
|
-
x:
|
|
1705
|
+
x: K.value.left,
|
|
1397
1706
|
y: t,
|
|
1398
|
-
w:
|
|
1399
|
-
h:
|
|
1707
|
+
w: q.value,
|
|
1708
|
+
h: k.value
|
|
1400
1709
|
};
|
|
1401
1710
|
});
|
|
1402
|
-
return (n, c) => (
|
|
1711
|
+
return (n, c) => (_(), a("div", {
|
|
1403
1712
|
ref_key: "containerRef",
|
|
1404
|
-
ref:
|
|
1713
|
+
ref: B,
|
|
1405
1714
|
class: "bar-chart-wrapper"
|
|
1406
1715
|
}, [
|
|
1407
|
-
t.menu ? (
|
|
1716
|
+
t.menu ? (_(), r(le, {
|
|
1408
1717
|
key: 0,
|
|
1409
|
-
items:
|
|
1718
|
+
items: S(Q)
|
|
1410
1719
|
}, null, 8, ["items"])) : i("", !0),
|
|
1411
|
-
(
|
|
1720
|
+
(_(), a("svg", {
|
|
1412
1721
|
ref_key: "svgRef",
|
|
1413
|
-
ref:
|
|
1414
|
-
width:
|
|
1415
|
-
height:
|
|
1722
|
+
ref: H,
|
|
1723
|
+
width: S(ue),
|
|
1724
|
+
height: S(U)
|
|
1416
1725
|
}, [
|
|
1417
|
-
t.title ? (
|
|
1726
|
+
t.title ? (_(), a("text", {
|
|
1418
1727
|
key: 0,
|
|
1419
|
-
x:
|
|
1728
|
+
x: S(ue) / 2,
|
|
1420
1729
|
y: 18,
|
|
1421
1730
|
"text-anchor": "middle",
|
|
1422
1731
|
"font-size": "14",
|
|
1423
1732
|
"font-weight": "600",
|
|
1424
1733
|
fill: "currentColor"
|
|
1425
|
-
},
|
|
1426
|
-
|
|
1427
|
-
x:
|
|
1428
|
-
y:
|
|
1734
|
+
}, b(t.title), 9, wt)) : i("", !0),
|
|
1735
|
+
se.value.length > 0 ? (_(), a("g", Tt, [(_(!0), a(e, null, y(se.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [o("rect", {
|
|
1736
|
+
x: S(K).left + n * 120,
|
|
1737
|
+
y: S(de) - 5,
|
|
1429
1738
|
width: "12",
|
|
1430
1739
|
height: "10",
|
|
1431
1740
|
fill: t.color
|
|
1432
|
-
}, null, 8,
|
|
1433
|
-
x:
|
|
1434
|
-
y:
|
|
1741
|
+
}, null, 8, Et), o("text", {
|
|
1742
|
+
x: S(K).left + n * 120 + 18,
|
|
1743
|
+
y: S(de) + 4,
|
|
1435
1744
|
"font-size": "11",
|
|
1436
1745
|
fill: "currentColor"
|
|
1437
|
-
},
|
|
1746
|
+
}, b(t.label), 9, Dt)], 64))), 128))])) : i("", !0),
|
|
1438
1747
|
o("line", {
|
|
1439
|
-
x1:
|
|
1440
|
-
y1:
|
|
1441
|
-
x2:
|
|
1442
|
-
y2:
|
|
1748
|
+
x1: S(V)(S(K).left),
|
|
1749
|
+
y1: S(V)(S(K).top),
|
|
1750
|
+
x2: S(V)(S(K).left),
|
|
1751
|
+
y2: S(V)(S(K).top + S(J)),
|
|
1443
1752
|
stroke: "currentColor",
|
|
1444
1753
|
"stroke-opacity": "0.3"
|
|
1445
|
-
}, null, 8,
|
|
1754
|
+
}, null, 8, Ot),
|
|
1446
1755
|
o("line", {
|
|
1447
|
-
x1:
|
|
1448
|
-
y1:
|
|
1449
|
-
x2:
|
|
1450
|
-
y2:
|
|
1756
|
+
x1: S(V)(S(K).left),
|
|
1757
|
+
y1: S(V)(S(K).top + S(J)),
|
|
1758
|
+
x2: S(V)(S(K).left + S(q)),
|
|
1759
|
+
y2: S(V)(S(K).top + S(J)),
|
|
1451
1760
|
stroke: "currentColor",
|
|
1452
1761
|
"stroke-opacity": "0.3"
|
|
1453
|
-
}, null, 8,
|
|
1454
|
-
t.valueGrid ? (
|
|
1762
|
+
}, null, 8, kt),
|
|
1763
|
+
t.valueGrid ? (_(!0), a(e, { key: 2 }, y(oe.value, (e, t) => (_(), a("line", {
|
|
1455
1764
|
key: "vg" + t,
|
|
1456
|
-
x1:
|
|
1457
|
-
y1:
|
|
1458
|
-
x2:
|
|
1459
|
-
y2:
|
|
1765
|
+
x1: T.value ? S(K).left : e.pos,
|
|
1766
|
+
y1: T.value ? e.pos : S(K).top,
|
|
1767
|
+
x2: T.value ? S(K).left + S(q) : e.pos,
|
|
1768
|
+
y2: T.value ? e.pos : S(K).top + S(J),
|
|
1460
1769
|
stroke: "currentColor",
|
|
1461
1770
|
"stroke-opacity": "0.1"
|
|
1462
|
-
}, null, 8,
|
|
1463
|
-
|
|
1771
|
+
}, null, 8, At))), 128)) : i("", !0),
|
|
1772
|
+
ye.value && L.value ? (_(), a("rect", {
|
|
1464
1773
|
key: 3,
|
|
1465
|
-
x:
|
|
1466
|
-
y:
|
|
1467
|
-
width:
|
|
1468
|
-
height:
|
|
1774
|
+
x: ye.value.x,
|
|
1775
|
+
y: ye.value.y,
|
|
1776
|
+
width: ye.value.w,
|
|
1777
|
+
height: ye.value.h,
|
|
1469
1778
|
fill: "currentColor",
|
|
1470
1779
|
"fill-opacity": "0.06",
|
|
1471
1780
|
"pointer-events": "none"
|
|
1472
|
-
}, null, 8,
|
|
1473
|
-
|
|
1781
|
+
}, null, 8, jt)) : i("", !0),
|
|
1782
|
+
T.value ? (_(!0), a(e, { key: 4 }, y(oe.value, (e, t) => (_(), a("text", {
|
|
1474
1783
|
key: "vt" + t,
|
|
1475
1784
|
"data-testid": "value-tick",
|
|
1476
|
-
x:
|
|
1785
|
+
x: S(K).left - 6,
|
|
1477
1786
|
y: e.pos,
|
|
1478
1787
|
"text-anchor": "end",
|
|
1479
1788
|
"dominant-baseline": "middle",
|
|
1480
1789
|
"font-size": "10",
|
|
1481
1790
|
fill: "currentColor",
|
|
1482
1791
|
"fill-opacity": "0.6"
|
|
1483
|
-
},
|
|
1792
|
+
}, b(e.value), 9, Mt))), 128)) : (_(!0), a(e, { key: 5 }, y(oe.value, (e, t) => (_(), a("text", {
|
|
1484
1793
|
key: "vt" + t,
|
|
1485
1794
|
"data-testid": "value-tick",
|
|
1486
1795
|
x: e.pos,
|
|
1487
|
-
y:
|
|
1796
|
+
y: S(K).top + S(J) + 16,
|
|
1488
1797
|
"text-anchor": "middle",
|
|
1489
1798
|
"font-size": "10",
|
|
1490
1799
|
fill: "currentColor",
|
|
1491
1800
|
"fill-opacity": "0.6"
|
|
1492
|
-
},
|
|
1493
|
-
t.yLabel ? (
|
|
1801
|
+
}, b(e.value), 9, Nt))), 128)),
|
|
1802
|
+
t.yLabel ? (_(), a("text", {
|
|
1494
1803
|
key: 6,
|
|
1495
1804
|
x: 0,
|
|
1496
1805
|
y: 0,
|
|
1497
|
-
transform: `translate(14, ${
|
|
1806
|
+
transform: `translate(14, ${S(K).top + S(J) / 2}) rotate(-90)`,
|
|
1498
1807
|
"text-anchor": "middle",
|
|
1499
1808
|
"font-size": "13",
|
|
1500
1809
|
fill: "currentColor"
|
|
1501
|
-
},
|
|
1502
|
-
|
|
1810
|
+
}, b(t.yLabel), 9, Pt)) : i("", !0),
|
|
1811
|
+
T.value ? (_(!0), a(e, { key: 7 }, y(I.value, (e, t) => (_(), a("text", {
|
|
1503
1812
|
key: "ct" + t,
|
|
1504
1813
|
"data-testid": "category-tick",
|
|
1505
1814
|
x: e.pos,
|
|
1506
|
-
y:
|
|
1815
|
+
y: S(K).top + S(J) + 16,
|
|
1507
1816
|
"text-anchor": e.anchor,
|
|
1508
1817
|
"font-size": "10",
|
|
1509
1818
|
fill: "currentColor",
|
|
1510
1819
|
"fill-opacity": "0.6"
|
|
1511
|
-
},
|
|
1820
|
+
}, b(e.label), 9, Ft))), 128)) : (_(!0), a(e, { key: 8 }, y(I.value, (e, t) => (_(), a("text", {
|
|
1512
1821
|
key: "ct" + t,
|
|
1513
1822
|
"data-testid": "category-tick",
|
|
1514
|
-
x:
|
|
1823
|
+
x: S(K).left - 6,
|
|
1515
1824
|
y: e.pos,
|
|
1516
1825
|
"text-anchor": "end",
|
|
1517
1826
|
"dominant-baseline": "middle",
|
|
1518
1827
|
"font-size": "10",
|
|
1519
1828
|
fill: "currentColor",
|
|
1520
1829
|
"fill-opacity": "0.6"
|
|
1521
|
-
},
|
|
1522
|
-
t.xLabel ? (
|
|
1830
|
+
}, b(e.label), 9, It))), 128)),
|
|
1831
|
+
t.xLabel ? (_(), a("text", {
|
|
1523
1832
|
key: 9,
|
|
1524
|
-
x:
|
|
1525
|
-
y:
|
|
1833
|
+
x: S(K).left + S(q) / 2,
|
|
1834
|
+
y: S(U) - 4,
|
|
1526
1835
|
"text-anchor": "middle",
|
|
1527
1836
|
"font-size": "13",
|
|
1528
1837
|
fill: "currentColor"
|
|
1529
|
-
},
|
|
1530
|
-
(
|
|
1838
|
+
}, b(t.xLabel), 9, Lt)) : i("", !0),
|
|
1839
|
+
(_(!0), a(e, null, y(F.value, (e, t) => (_(), a("rect", {
|
|
1531
1840
|
key: "bar" + t,
|
|
1532
1841
|
"data-testid": "bar",
|
|
1533
1842
|
"data-category": e.categoryIndex,
|
|
@@ -1538,49 +1847,55 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
1538
1847
|
height: e.h,
|
|
1539
1848
|
fill: e.color,
|
|
1540
1849
|
"fill-opacity": e.opacity
|
|
1541
|
-
}, null, 8,
|
|
1542
|
-
|
|
1850
|
+
}, null, 8, Rt))), 128)),
|
|
1851
|
+
L.value ? (_(), a("rect", d({
|
|
1543
1852
|
key: 10,
|
|
1544
|
-
x:
|
|
1545
|
-
y:
|
|
1546
|
-
width:
|
|
1547
|
-
height:
|
|
1853
|
+
x: S(K).left,
|
|
1854
|
+
y: S(K).top,
|
|
1855
|
+
width: S(q),
|
|
1856
|
+
height: S(J),
|
|
1548
1857
|
fill: "transparent",
|
|
1549
1858
|
style: {
|
|
1550
1859
|
cursor: "crosshair",
|
|
1551
1860
|
"touch-action": "none"
|
|
1552
1861
|
}
|
|
1553
|
-
},
|
|
1554
|
-
|
|
1555
|
-
|
|
1862
|
+
}, te(S(Z), !0)), null, 16, zt)) : i("", !0),
|
|
1863
|
+
t.annotations && t.annotations.length > 0 ? (_(), r(S(Fe), {
|
|
1864
|
+
key: 11,
|
|
1865
|
+
annotations: t.annotations,
|
|
1866
|
+
project: R,
|
|
1867
|
+
bounds: S(fe)
|
|
1868
|
+
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
1869
|
+
], 8, Ct)),
|
|
1870
|
+
L.value && S(pe) !== null && ve.value ? (_(), a("div", {
|
|
1556
1871
|
key: 1,
|
|
1557
1872
|
ref_key: "tooltipRef",
|
|
1558
|
-
ref:
|
|
1873
|
+
ref: Y,
|
|
1559
1874
|
class: "chart-tooltip-content",
|
|
1560
1875
|
style: m({
|
|
1561
1876
|
position: "absolute",
|
|
1562
1877
|
top: "0",
|
|
1563
1878
|
left: "0",
|
|
1564
1879
|
willChange: "transform",
|
|
1565
|
-
transform:
|
|
1566
|
-
visibility:
|
|
1880
|
+
transform: S(X) ? `translate3d(${S(X).left}px, ${S(X).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
1881
|
+
visibility: S(X) ? "visible" : "hidden"
|
|
1567
1882
|
})
|
|
1568
|
-
}, [
|
|
1883
|
+
}, [ee(n.$slots, "tooltip", p(u(ve.value)), () => [o("div", Bt, [$.value ? (_(), a("div", Vt, b($.value), 1)) : i("", !0), (_(!0), a(e, null, y(ve.value.values, (e) => (_(), a("div", {
|
|
1569
1884
|
key: e.seriesIndex,
|
|
1570
1885
|
class: "bar-chart-tooltip-row"
|
|
1571
1886
|
}, [o("span", {
|
|
1572
1887
|
class: "bar-chart-tooltip-swatch",
|
|
1573
1888
|
style: m({ background: e.color })
|
|
1574
|
-
}, null, 4), s(" " +
|
|
1575
|
-
|
|
1889
|
+
}, null, 4), s(" " + b(isFinite(e.value) ? S(ae)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1890
|
+
S(me) ? (_(), a("a", {
|
|
1576
1891
|
key: 2,
|
|
1577
1892
|
class: "bar-chart-download-link",
|
|
1578
|
-
href:
|
|
1579
|
-
download: `${
|
|
1580
|
-
},
|
|
1893
|
+
href: S(he),
|
|
1894
|
+
download: `${S(ge)()}.csv`
|
|
1895
|
+
}, b(S(me)), 9, Ht)) : i("", !0)
|
|
1581
1896
|
], 512));
|
|
1582
1897
|
}
|
|
1583
|
-
}), [["__scopeId", "data-v-
|
|
1898
|
+
}), [["__scopeId", "data-v-690ebb3c"]]), Wt = {
|
|
1584
1899
|
"01013": "010259",
|
|
1585
1900
|
"01015": "010177",
|
|
1586
1901
|
"01029": "010177",
|
|
@@ -4741,7 +5056,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
4741
5056
|
51019: "510014",
|
|
4742
5057
|
"02158": "020820",
|
|
4743
5058
|
46102: "460957"
|
|
4744
|
-
},
|
|
5059
|
+
}, Gt = {
|
|
4745
5060
|
"010259": "Butler, AL",
|
|
4746
5061
|
"010177": "Calhoun (Anniston), AL - Cleburne, AL",
|
|
4747
5062
|
"010172": "Chambers, AL - Randolph, AL",
|
|
@@ -5691,7 +6006,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5691
6006
|
560775: "Teton, WY - Lincoln, WY",
|
|
5692
6007
|
560792: "Uinta, WY",
|
|
5693
6008
|
560804: "Weston, WY"
|
|
5694
|
-
},
|
|
6009
|
+
}, Kt = {
|
|
5695
6010
|
ref: "root",
|
|
5696
6011
|
class: "chart-tooltip-content",
|
|
5697
6012
|
style: {
|
|
@@ -5703,10 +6018,10 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5703
6018
|
"pointer-events": "none",
|
|
5704
6019
|
transform: "translateY(-50%)"
|
|
5705
6020
|
}
|
|
5706
|
-
},
|
|
6021
|
+
}, qt = /* @__PURE__ */ l({
|
|
5707
6022
|
__name: "ChoroplethTooltip",
|
|
5708
6023
|
setup(e, { expose: n }) {
|
|
5709
|
-
let a =
|
|
6024
|
+
let a = v(null), s = w("root");
|
|
5710
6025
|
return n({
|
|
5711
6026
|
setData(e) {
|
|
5712
6027
|
a.value = e;
|
|
@@ -5714,29 +6029,30 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5714
6029
|
getEl() {
|
|
5715
6030
|
return s.value;
|
|
5716
6031
|
}
|
|
5717
|
-
}), (e, n) => (
|
|
6032
|
+
}), (e, n) => (_(), r(t, { to: "body" }, [o("div", Kt, [a.value ? ee(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
|
|
5718
6033
|
}
|
|
5719
|
-
}),
|
|
6034
|
+
}), Jt = {
|
|
5720
6035
|
key: 1,
|
|
5721
6036
|
class: "choropleth-header"
|
|
5722
|
-
},
|
|
6037
|
+
}, Yt = {
|
|
5723
6038
|
key: 0,
|
|
5724
6039
|
class: "choropleth-title"
|
|
5725
|
-
},
|
|
6040
|
+
}, Xt = {
|
|
5726
6041
|
key: 1,
|
|
5727
6042
|
class: "choropleth-legend"
|
|
5728
|
-
},
|
|
6043
|
+
}, Zt = {
|
|
5729
6044
|
key: 0,
|
|
5730
6045
|
class: "choropleth-legend-title"
|
|
5731
|
-
},
|
|
6046
|
+
}, Qt = {
|
|
5732
6047
|
key: 2,
|
|
5733
6048
|
class: "choropleth-legend-continuous"
|
|
5734
|
-
},
|
|
6049
|
+
}, $t = { class: "choropleth-legend-ticks" }, en = ["viewBox"], tn = ["innerHTML"], nn = "http://www.w3.org/2000/svg", rn = 450, an = 1e3, on = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
5735
6050
|
__name: "ChoroplethMap",
|
|
5736
6051
|
props: {
|
|
5737
6052
|
topology: {},
|
|
5738
6053
|
data: {},
|
|
5739
6054
|
geoType: { default: "states" },
|
|
6055
|
+
dataGeoType: {},
|
|
5740
6056
|
width: {},
|
|
5741
6057
|
height: {},
|
|
5742
6058
|
colorScale: {},
|
|
@@ -5774,43 +6090,43 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5774
6090
|
"update:focus"
|
|
5775
6091
|
],
|
|
5776
6092
|
setup(t, { emit: c }) {
|
|
5777
|
-
let l = t, d = c,
|
|
6093
|
+
let l = t, d = c, te = (e) => e, S = v(null), w = v(null), D = v(null), O = v(null), k = v(null), A = v(null), j = C(), M = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!j.tooltip), N = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), ne = null, L = null, R = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map(), B = !1, V = typeof window < "u" && "ontouchstart" in window, H = null, ue = {
|
|
5778
6094
|
width: 0,
|
|
5779
6095
|
height: 0
|
|
5780
|
-
}, U = null, W = !1, G = null,
|
|
5781
|
-
function
|
|
5782
|
-
if (
|
|
5783
|
-
let e =
|
|
5784
|
-
e && (e.addEventListener("click",
|
|
6096
|
+
}, U = null, W = !1, G = null, K = v(!1), de = 0, q = 0, J = 0;
|
|
6097
|
+
function fe() {
|
|
6098
|
+
if (V) return;
|
|
6099
|
+
let e = D.value;
|
|
6100
|
+
e && (e.addEventListener("click", st), e.addEventListener("mouseover", st), e.addEventListener("mousemove", ct), e.addEventListener("mouseout", lt));
|
|
5785
6101
|
}
|
|
5786
|
-
function
|
|
5787
|
-
let e =
|
|
5788
|
-
e && (e.removeEventListener("click",
|
|
6102
|
+
function Y() {
|
|
6103
|
+
let e = D.value;
|
|
6104
|
+
e && (e.removeEventListener("click", st), e.removeEventListener("mouseover", st), e.removeEventListener("mousemove", ct), e.removeEventListener("mouseout", lt));
|
|
5789
6105
|
}
|
|
5790
|
-
function
|
|
5791
|
-
|
|
6106
|
+
function X() {
|
|
6107
|
+
at();
|
|
5792
6108
|
}
|
|
5793
6109
|
h(() => {
|
|
5794
|
-
|
|
6110
|
+
me(), fe(), dt(), ve(), Xe(), window.addEventListener("scroll", X, {
|
|
5795
6111
|
passive: !0,
|
|
5796
6112
|
capture: !0
|
|
5797
|
-
}), window.addEventListener("resize",
|
|
5798
|
-
}),
|
|
5799
|
-
|
|
6113
|
+
}), window.addEventListener("resize", X, { passive: !0 });
|
|
6114
|
+
}), g(() => {
|
|
6115
|
+
H?.disconnect(), J && cancelAnimationFrame(J), he(), Y(), window.removeEventListener("scroll", X, { capture: !0 }), window.removeEventListener("resize", X);
|
|
5800
6116
|
});
|
|
5801
|
-
function
|
|
5802
|
-
if (!
|
|
5803
|
-
let e =
|
|
5804
|
-
G =
|
|
5805
|
-
|
|
6117
|
+
function me() {
|
|
6118
|
+
if (!w.value || !D.value) return;
|
|
6119
|
+
let e = oe(w.value), t = Math.max(12, l.focusZoomLevel);
|
|
6120
|
+
G = ie().scaleExtent([1, t]).on("start", () => {
|
|
6121
|
+
B = !0, at();
|
|
5806
6122
|
}).on("zoom", (e) => {
|
|
5807
|
-
|
|
6123
|
+
D.value && D.value.setAttribute("transform", e.transform);
|
|
5808
6124
|
let t = e.transform;
|
|
5809
|
-
|
|
6125
|
+
K.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
5810
6126
|
}).on("end", () => {
|
|
5811
|
-
|
|
6127
|
+
B = !1;
|
|
5812
6128
|
}), G.filter((e) => {
|
|
5813
|
-
let t =
|
|
6129
|
+
let t = Ne.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
|
|
5814
6130
|
if (e.type === "wheel" || e.type === "dblclick") {
|
|
5815
6131
|
if (!n) return !1;
|
|
5816
6132
|
} else if (e.type === "mousedown" || e.type === "touchstart") {
|
|
@@ -5819,115 +6135,166 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5819
6135
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
5820
6136
|
}), e.call(G);
|
|
5821
6137
|
}
|
|
5822
|
-
function
|
|
5823
|
-
|
|
6138
|
+
function he() {
|
|
6139
|
+
w.value && G && (oe(w.value).on(".zoom", null), G = null);
|
|
5824
6140
|
}
|
|
5825
|
-
function
|
|
5826
|
-
let t =
|
|
6141
|
+
function ge(e) {
|
|
6142
|
+
let t = Pe.value, n = Ae.value, r = [];
|
|
5827
6143
|
for (let i of e) {
|
|
5828
|
-
let e =
|
|
5829
|
-
|
|
6144
|
+
let e = i.geoType ?? l.geoType, a = t.get(e);
|
|
6145
|
+
if (!a) continue;
|
|
6146
|
+
let o = a.get(i.id);
|
|
6147
|
+
if (!o) {
|
|
6148
|
+
let t = n.get(e)?.get(i.id);
|
|
6149
|
+
t && (o = a.get(t));
|
|
6150
|
+
}
|
|
6151
|
+
o && r.push({
|
|
6152
|
+
item: i,
|
|
6153
|
+
geoType: e,
|
|
6154
|
+
feature: o,
|
|
6155
|
+
key: `${e}:${String(o.id)}`
|
|
6156
|
+
});
|
|
5830
6157
|
}
|
|
5831
6158
|
return r;
|
|
5832
6159
|
}
|
|
5833
|
-
function
|
|
5834
|
-
let t =
|
|
5835
|
-
for (let
|
|
5836
|
-
|
|
5837
|
-
e && n.push(e);
|
|
5838
|
-
}
|
|
5839
|
-
return n;
|
|
6160
|
+
function _e(e) {
|
|
6161
|
+
let t = /* @__PURE__ */ new Set();
|
|
6162
|
+
for (let n of ge(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
|
|
6163
|
+
return t;
|
|
5840
6164
|
}
|
|
5841
|
-
let
|
|
5842
|
-
function
|
|
5843
|
-
if (!
|
|
5844
|
-
let e =
|
|
6165
|
+
let $ = !1;
|
|
6166
|
+
function ve() {
|
|
6167
|
+
if (!w.value || !G) return;
|
|
6168
|
+
let e = ge(Ne.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
|
|
5845
6169
|
for (let e of t) {
|
|
5846
|
-
let t =
|
|
5847
|
-
t &&
|
|
6170
|
+
let t = N.get(String(e.feature.id));
|
|
6171
|
+
t && r.set(t, e.item.style ?? "solid");
|
|
5848
6172
|
}
|
|
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();
|
|
6173
|
+
for (let [e] of R) r.has(e) || e === L || rt(e);
|
|
6174
|
+
for (let [e, t] of r) R.get(e) === t && e !== L || e !== L && nt(e, t);
|
|
6175
|
+
R.clear();
|
|
6176
|
+
for (let [e, t] of r) R.set(e, t);
|
|
6177
|
+
if (ye(n), e.length === 0) {
|
|
6178
|
+
$ = !0, at();
|
|
5858
6179
|
return;
|
|
5859
6180
|
}
|
|
5860
|
-
let
|
|
6181
|
+
let i = oe(w.value);
|
|
6182
|
+
i.interrupt();
|
|
6183
|
+
let a = $;
|
|
6184
|
+
$ = !0;
|
|
6185
|
+
let [[o, s], [c, u]] = Oe.value.bounds({
|
|
5861
6186
|
type: "FeatureCollection",
|
|
5862
|
-
features:
|
|
5863
|
-
}),
|
|
5864
|
-
if (!
|
|
5865
|
-
let e = String(
|
|
5866
|
-
if (!
|
|
5867
|
-
let
|
|
5868
|
-
|
|
6187
|
+
features: e.map((e) => e.feature)
|
|
6188
|
+
}), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = ae.translate(Se.value / 2 - p * d, Ce.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, g = () => {
|
|
6189
|
+
if (!M.value || !h) return;
|
|
6190
|
+
let e = String(h.id), t = N.get(e);
|
|
6191
|
+
if (!t) return;
|
|
6192
|
+
let n = t.getBoundingClientRect();
|
|
6193
|
+
Qe(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
5869
6194
|
};
|
|
5870
|
-
|
|
6195
|
+
a ? (et(), i.transition().duration(rn).call(G.transform, m).on("end", g)) : (G.transform(i, m), g());
|
|
6196
|
+
}
|
|
6197
|
+
function ye(e) {
|
|
6198
|
+
let t = k.value;
|
|
6199
|
+
if (!t) return;
|
|
6200
|
+
let n = new Set(e.map((e) => e.key));
|
|
6201
|
+
for (let [e, t] of z) n.has(e) || (t.remove(), z.delete(e));
|
|
6202
|
+
let r = Oe.value, i = ke.value + 1.5;
|
|
6203
|
+
for (let { item: n, feature: a, key: o } of e) {
|
|
6204
|
+
let e = z.get(o);
|
|
6205
|
+
e || (e = document.createElementNS(nn, "path"), e.setAttribute("d", r(a) ?? ""), e.setAttribute("fill", "none"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("class", "focus-overlay"), t.appendChild(e), z.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), tt(e, n.style);
|
|
6206
|
+
}
|
|
5871
6207
|
}
|
|
5872
|
-
function
|
|
5873
|
-
if (!
|
|
5874
|
-
|
|
5875
|
-
|
|
6208
|
+
function be() {
|
|
6209
|
+
if (!w.value || !G) return;
|
|
6210
|
+
Ne.value.length > 0 && d("update:focus", null);
|
|
6211
|
+
let e = oe(w.value);
|
|
6212
|
+
e.interrupt(), et(), e.transition().duration(rn).call(G.transform, ae);
|
|
5876
6213
|
}
|
|
5877
|
-
|
|
5878
|
-
G && G.scaleExtent([1, Math.max(12, l.focusZoomLevel)]),
|
|
6214
|
+
T(() => l.focusZoomLevel, () => {
|
|
6215
|
+
G && G.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), ve();
|
|
5879
6216
|
});
|
|
5880
|
-
let
|
|
5881
|
-
let e =
|
|
6217
|
+
let xe = n(() => l.width && l.height ? l.height / l.width : .625), Se = n(() => an), Ce = n(() => an * xe.value), we = n(() => {
|
|
6218
|
+
let e = x(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
|
|
5882
6219
|
for (let e of t) {
|
|
5883
|
-
let t =
|
|
6220
|
+
let t = Wt[String(e.id).padStart(5, "0")];
|
|
5884
6221
|
t && (n.has(t) || n.set(t, []), n.get(t).push(e));
|
|
5885
6222
|
}
|
|
5886
6223
|
let r = [];
|
|
5887
6224
|
for (let [t, i] of n) r.push({
|
|
5888
6225
|
type: "Feature",
|
|
5889
6226
|
id: t,
|
|
5890
|
-
properties: { name:
|
|
5891
|
-
geometry:
|
|
6227
|
+
properties: { name: Gt[t] ?? t },
|
|
6228
|
+
geometry: se(e, i)
|
|
5892
6229
|
});
|
|
5893
6230
|
return {
|
|
5894
6231
|
type: "FeatureCollection",
|
|
5895
6232
|
features: r
|
|
5896
6233
|
};
|
|
5897
|
-
}),
|
|
5898
|
-
if (l.geoType === "hsas") return
|
|
6234
|
+
}), Te = n(() => {
|
|
6235
|
+
if (l.geoType === "hsas") return we.value;
|
|
5899
6236
|
if (l.geoType === "counties") {
|
|
5900
|
-
let e =
|
|
5901
|
-
return
|
|
6237
|
+
let e = x(l.topology);
|
|
6238
|
+
return I(e, e.objects.counties);
|
|
5902
6239
|
}
|
|
5903
|
-
let e =
|
|
5904
|
-
return
|
|
5905
|
-
}),
|
|
6240
|
+
let e = x(l.topology);
|
|
6241
|
+
return I(e, e.objects.states);
|
|
6242
|
+
}), Ee = n(() => {
|
|
5906
6243
|
if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
|
|
5907
|
-
let e =
|
|
5908
|
-
return
|
|
5909
|
-
}),
|
|
6244
|
+
let e = x(l.topology);
|
|
6245
|
+
return ce(e, e.objects.states, (e, t) => e !== t);
|
|
6246
|
+
}), De = n(() => F().fitExtent([[0, 0], [Se.value, Ce.value]], Te.value)), Oe = n(() => re(De.value)), ke = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), Ae = n(() => {
|
|
5910
6247
|
let e = /* @__PURE__ */ new Map();
|
|
5911
|
-
for (let t of
|
|
6248
|
+
for (let [t, n] of Pe.value) {
|
|
6249
|
+
let r = /* @__PURE__ */ new Map();
|
|
6250
|
+
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
6251
|
+
e.set(t, r);
|
|
6252
|
+
}
|
|
5912
6253
|
return e;
|
|
5913
|
-
})
|
|
6254
|
+
});
|
|
6255
|
+
function je(e) {
|
|
6256
|
+
let t = l.dataGeoType;
|
|
6257
|
+
if (!t || t === l.geoType) return e;
|
|
6258
|
+
if (l.geoType === "counties" && t === "hsas") return Wt[e];
|
|
6259
|
+
if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
6260
|
+
}
|
|
6261
|
+
let Me = n(() => {
|
|
5914
6262
|
let e = /* @__PURE__ */ new Map();
|
|
5915
|
-
for (let t of
|
|
6263
|
+
for (let t of Te.value.features) t.id != null && e.set(String(t.id), t);
|
|
5916
6264
|
return e;
|
|
5917
|
-
}),
|
|
6265
|
+
}), Ne = n(() => {
|
|
5918
6266
|
let e = l.focus;
|
|
5919
|
-
return e == null ? [] : Array.isArray(e) ? e : [e];
|
|
5920
|
-
}),
|
|
6267
|
+
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
6268
|
+
}), Pe = n(() => {
|
|
6269
|
+
let e = /* @__PURE__ */ new Map();
|
|
6270
|
+
e.set(l.geoType, Me.value);
|
|
6271
|
+
let t = x(l.topology), n = t?.objects;
|
|
6272
|
+
if (!n) return e;
|
|
6273
|
+
let r = (e) => {
|
|
6274
|
+
let t = /* @__PURE__ */ new Map();
|
|
6275
|
+
for (let n of e) n.id != null && t.set(String(n.id), n);
|
|
6276
|
+
return t;
|
|
6277
|
+
};
|
|
6278
|
+
if (!e.has("states") && n.states) {
|
|
6279
|
+
let i = I(t, n.states);
|
|
6280
|
+
e.set("states", r(i.features));
|
|
6281
|
+
}
|
|
6282
|
+
if (!e.has("counties") && n.counties) {
|
|
6283
|
+
let i = I(t, n.counties);
|
|
6284
|
+
e.set("counties", r(i.features));
|
|
6285
|
+
}
|
|
6286
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(we.value.features)), e;
|
|
6287
|
+
}), Fe = n(() => {
|
|
5921
6288
|
let e = /* @__PURE__ */ new Map();
|
|
5922
6289
|
if (!l.data) return e;
|
|
5923
|
-
let t =
|
|
5924
|
-
for (let
|
|
5925
|
-
e.set(
|
|
5926
|
-
let r =
|
|
5927
|
-
r && e.set(r,
|
|
6290
|
+
let t = l.dataGeoType ?? l.geoType, n = Ae.value.get(t);
|
|
6291
|
+
for (let t of l.data) {
|
|
6292
|
+
e.set(t.id, t.value);
|
|
6293
|
+
let r = n?.get(t.id);
|
|
6294
|
+
r && e.set(r, t.value);
|
|
5928
6295
|
}
|
|
5929
6296
|
return e;
|
|
5930
|
-
}),
|
|
6297
|
+
}), Ie = n(() => {
|
|
5931
6298
|
if (!l.data || l.data.length === 0) return {
|
|
5932
6299
|
min: 0,
|
|
5933
6300
|
max: 1
|
|
@@ -5944,8 +6311,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5944
6311
|
min: 0,
|
|
5945
6312
|
max: 1
|
|
5946
6313
|
};
|
|
5947
|
-
}),
|
|
5948
|
-
function
|
|
6314
|
+
}), Le = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Re = n(() => Array.isArray(l.colorScale) && !Le.value), ze = n(() => Re.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Be = n(() => Re.value ? "" : l.colorScale?.max ?? "#08519c");
|
|
6315
|
+
function Ve(e) {
|
|
5949
6316
|
let t = e.replace("#", "");
|
|
5950
6317
|
return [
|
|
5951
6318
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -5953,268 +6320,287 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
5953
6320
|
parseInt(t.slice(4, 6), 16)
|
|
5954
6321
|
];
|
|
5955
6322
|
}
|
|
5956
|
-
function
|
|
5957
|
-
let [t, n, r] =
|
|
6323
|
+
function He(e) {
|
|
6324
|
+
let [t, n, r] = Ve(ze.value), [i, a, o] = Ve(Be.value);
|
|
5958
6325
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
5959
6326
|
}
|
|
5960
|
-
let
|
|
5961
|
-
if (!
|
|
6327
|
+
let Ue = n(() => Re.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), We = n(() => {
|
|
6328
|
+
if (!Le.value) return null;
|
|
5962
6329
|
let e = /* @__PURE__ */ new Map();
|
|
5963
6330
|
for (let t of l.colorScale) e.set(t.value, t.color);
|
|
5964
6331
|
return e;
|
|
5965
6332
|
});
|
|
5966
|
-
function
|
|
5967
|
-
let t =
|
|
6333
|
+
function Ge(e) {
|
|
6334
|
+
let t = je(e);
|
|
6335
|
+
return t == null ? void 0 : Fe.value.get(t);
|
|
6336
|
+
}
|
|
6337
|
+
function Ke(e) {
|
|
6338
|
+
let t = Ge(e), n = l.noDataColor;
|
|
5968
6339
|
if (t == null) return n;
|
|
5969
|
-
let r =
|
|
6340
|
+
let r = We.value;
|
|
5970
6341
|
if (r) return r.get(String(t)) ?? n;
|
|
5971
|
-
let i =
|
|
6342
|
+
let i = Ue.value;
|
|
5972
6343
|
if (i) {
|
|
5973
6344
|
let e = t;
|
|
5974
6345
|
for (let t of i) if (e >= t.min) return t.color;
|
|
5975
6346
|
return n;
|
|
5976
6347
|
}
|
|
5977
|
-
let { min: a, max: o } =
|
|
5978
|
-
return
|
|
6348
|
+
let { min: a, max: o } = Ie.value;
|
|
6349
|
+
return He((t - a) / (o - a));
|
|
5979
6350
|
}
|
|
5980
|
-
let
|
|
5981
|
-
function
|
|
6351
|
+
let qe = (e) => e.properties?.name ?? String(e.id);
|
|
6352
|
+
function Je(e) {
|
|
5982
6353
|
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat ? l.tooltipValueFormat(e) : String(e);
|
|
5983
6354
|
}
|
|
5984
|
-
function
|
|
5985
|
-
return t == null ? e : `${e}: ${
|
|
6355
|
+
function Ye(e, t) {
|
|
6356
|
+
return t == null ? e : `${e}: ${Je(t)}`;
|
|
5986
6357
|
}
|
|
5987
|
-
function
|
|
5988
|
-
let e =
|
|
6358
|
+
function Xe() {
|
|
6359
|
+
let e = A.value?.getEl();
|
|
5989
6360
|
if (!e) return;
|
|
5990
|
-
|
|
6361
|
+
H?.disconnect();
|
|
5991
6362
|
let t = !1;
|
|
5992
|
-
|
|
6363
|
+
H = new ResizeObserver((e) => {
|
|
5993
6364
|
let n = e[0]?.contentRect;
|
|
5994
|
-
n && (
|
|
5995
|
-
}),
|
|
6365
|
+
n && (ue.width = n.width, ue.height = n.height, !t && W && U ? (t = !0, Ze(U.x, U.y)) : t = !0);
|
|
6366
|
+
}), H.observe(e);
|
|
5996
6367
|
}
|
|
5997
|
-
function
|
|
5998
|
-
let n =
|
|
6368
|
+
function Ze(e, t) {
|
|
6369
|
+
let n = A.value?.getEl();
|
|
5999
6370
|
if (!n) return;
|
|
6000
|
-
let r =
|
|
6371
|
+
let r = S.value?.getBoundingClientRect(), { left: i, top: a } = pe(e, t, ue.width, ue.height, l.tooltipClamp, r);
|
|
6001
6372
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
6002
6373
|
}
|
|
6003
|
-
function
|
|
6004
|
-
let r =
|
|
6374
|
+
function Qe(e, t, n) {
|
|
6375
|
+
let r = P.get(e);
|
|
6005
6376
|
if (!r) return;
|
|
6006
|
-
let i =
|
|
6377
|
+
let i = A.value, a = i?.getEl();
|
|
6007
6378
|
!i || !a || (i.setData(r), U = {
|
|
6008
6379
|
x: t,
|
|
6009
6380
|
y: n
|
|
6010
|
-
}, W = !0,
|
|
6381
|
+
}, W = !0, Ze(t, n), a.style.visibility = "visible");
|
|
6011
6382
|
}
|
|
6012
|
-
function
|
|
6013
|
-
W && (
|
|
6014
|
-
|
|
6015
|
-
let e =
|
|
6383
|
+
function $e(e, t) {
|
|
6384
|
+
W && (de = e, q = t, !J && (J = requestAnimationFrame(() => {
|
|
6385
|
+
J = 0;
|
|
6386
|
+
let e = A.value?.getEl();
|
|
6016
6387
|
!e || !W || (U = {
|
|
6017
|
-
x:
|
|
6018
|
-
y:
|
|
6019
|
-
}, e.style.transform = `translate3d(${
|
|
6388
|
+
x: de,
|
|
6389
|
+
y: q
|
|
6390
|
+
}, e.style.transform = `translate3d(${de + 16}px, ${q}px, 0) translateY(-50%)`);
|
|
6020
6391
|
})));
|
|
6021
6392
|
}
|
|
6022
|
-
function
|
|
6393
|
+
function et() {
|
|
6023
6394
|
if (!W) return;
|
|
6024
6395
|
W = !1, U = null;
|
|
6025
|
-
let e =
|
|
6396
|
+
let e = A.value?.getEl();
|
|
6026
6397
|
e && (e.style.visibility = "hidden");
|
|
6027
6398
|
}
|
|
6028
|
-
function
|
|
6029
|
-
e.
|
|
6399
|
+
function tt(e, t) {
|
|
6400
|
+
t === "dashed" ? (e.setAttribute("stroke-dasharray", "8 4"), e.removeAttribute("stroke-linecap")) : t === "dotted" ? (e.setAttribute("stroke-dasharray", "0 5"), e.setAttribute("stroke-linecap", "round")) : (e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap"));
|
|
6401
|
+
}
|
|
6402
|
+
function nt(e, t = "solid") {
|
|
6403
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(ke.value + 1)), e.setAttribute("stroke", "#555"), tt(e, t);
|
|
6030
6404
|
}
|
|
6031
|
-
function
|
|
6032
|
-
e.setAttribute("stroke-width", String(
|
|
6405
|
+
function rt(e) {
|
|
6406
|
+
e.setAttribute("stroke-width", String(ke.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
6033
6407
|
}
|
|
6034
|
-
function
|
|
6035
|
-
|
|
6408
|
+
function it(e) {
|
|
6409
|
+
L !== e && (L && !R.has(L) && rt(L), L = e, nt(e, R.get(e) ?? "solid"));
|
|
6036
6410
|
}
|
|
6037
|
-
function
|
|
6038
|
-
|
|
6411
|
+
function at() {
|
|
6412
|
+
if (L) {
|
|
6413
|
+
let e = R.get(L);
|
|
6414
|
+
e == null ? rt(L) : nt(L, e), L = null, d("stateHover", null);
|
|
6415
|
+
}
|
|
6416
|
+
et();
|
|
6039
6417
|
}
|
|
6040
|
-
function
|
|
6418
|
+
function ot(e) {
|
|
6041
6419
|
let t = e;
|
|
6042
6420
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
6043
6421
|
return t ? t.dataset.featId ?? null : null;
|
|
6044
6422
|
}
|
|
6045
|
-
function
|
|
6046
|
-
if (
|
|
6047
|
-
let t = e, n =
|
|
6423
|
+
function st(e) {
|
|
6424
|
+
if (B) return;
|
|
6425
|
+
let t = e, n = ot(t.target);
|
|
6048
6426
|
if (!n) return;
|
|
6049
|
-
let r =
|
|
6427
|
+
let r = P.get(n);
|
|
6050
6428
|
if (!r) return;
|
|
6051
6429
|
let i = {
|
|
6052
6430
|
id: r.id,
|
|
6053
6431
|
name: r.name,
|
|
6054
6432
|
value: r.value
|
|
6055
6433
|
};
|
|
6056
|
-
e.type === "click" ? (d("stateClick", i), d("update:focus",
|
|
6434
|
+
e.type === "click" ? (d("stateClick", i), d("update:focus", _e(Ne.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (it(N.get(n)), M.value && Qe(n, t.clientX, t.clientY), d("stateHover", i));
|
|
6057
6435
|
}
|
|
6058
|
-
function
|
|
6059
|
-
|
|
6436
|
+
function ct(e) {
|
|
6437
|
+
B || $e(e.clientX, e.clientY);
|
|
6060
6438
|
}
|
|
6061
|
-
function
|
|
6439
|
+
function lt(e) {
|
|
6062
6440
|
let t = e.relatedTarget;
|
|
6063
|
-
t &&
|
|
6441
|
+
t && D.value?.contains(t) || at();
|
|
6064
6442
|
}
|
|
6065
|
-
function
|
|
6066
|
-
let t = document.createElementNS(
|
|
6443
|
+
function ut(e) {
|
|
6444
|
+
let t = document.createElementNS(nn, "path");
|
|
6067
6445
|
return e && t.setAttribute("d", e), t;
|
|
6068
6446
|
}
|
|
6069
|
-
function
|
|
6070
|
-
let e =
|
|
6071
|
-
if (!e) return;
|
|
6447
|
+
function dt() {
|
|
6448
|
+
let e = O.value, t = k.value;
|
|
6449
|
+
if (!e || !t) return;
|
|
6072
6450
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
e
|
|
6451
|
+
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
6452
|
+
N.clear(), P.clear(), ne = null, L = null, R.clear(), z.clear();
|
|
6453
|
+
let n = Oe.value, r = Te.value.features, i = l.strokeColor, a = String(ke.value), o = !M.value, s = document.createDocumentFragment();
|
|
6454
|
+
for (let e of r) {
|
|
6455
|
+
let t = String(e.id), r = qe(e), c = Ge(t), l = ut(n(e));
|
|
6456
|
+
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", Ke(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
|
|
6457
|
+
let e = document.createElementNS(nn, "title");
|
|
6458
|
+
e.textContent = Ye(r, c), l.appendChild(e);
|
|
6080
6459
|
}
|
|
6081
|
-
|
|
6082
|
-
id:
|
|
6083
|
-
name:
|
|
6460
|
+
s.appendChild(l), N.set(t, l), P.set(t, {
|
|
6461
|
+
id: t,
|
|
6462
|
+
name: r,
|
|
6084
6463
|
value: c,
|
|
6085
6464
|
feature: e
|
|
6086
6465
|
});
|
|
6087
6466
|
}
|
|
6088
|
-
let
|
|
6089
|
-
if (
|
|
6090
|
-
let e =
|
|
6091
|
-
e.setAttribute("fill", "none"), e.setAttribute("stroke",
|
|
6467
|
+
let c = Ee.value;
|
|
6468
|
+
if (c) {
|
|
6469
|
+
let e = ut(n(c));
|
|
6470
|
+
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e), ne = e;
|
|
6092
6471
|
}
|
|
6093
|
-
e.appendChild(
|
|
6472
|
+
e.appendChild(s);
|
|
6094
6473
|
}
|
|
6095
|
-
function
|
|
6096
|
-
let e = !
|
|
6097
|
-
for (let [t, n] of
|
|
6098
|
-
let r =
|
|
6099
|
-
if (n.setAttribute("fill",
|
|
6474
|
+
function ft() {
|
|
6475
|
+
let e = !M.value;
|
|
6476
|
+
for (let [t, n] of N) {
|
|
6477
|
+
let r = Ge(t), i = P.get(t);
|
|
6478
|
+
if (n.setAttribute("fill", Ke(t)), i && (i.value = r), e && i) {
|
|
6100
6479
|
let e = n.firstElementChild;
|
|
6101
|
-
e && (e.textContent =
|
|
6480
|
+
e && (e.textContent = Ye(i.name, r));
|
|
6102
6481
|
}
|
|
6103
6482
|
}
|
|
6104
6483
|
}
|
|
6105
|
-
function
|
|
6106
|
-
for (let e of
|
|
6107
|
-
|
|
6484
|
+
function pt() {
|
|
6485
|
+
for (let e of N.values()) e === L || R.has(e) || rt(e);
|
|
6486
|
+
ne && ne.setAttribute("stroke", l.strokeColor);
|
|
6108
6487
|
}
|
|
6109
|
-
function
|
|
6488
|
+
function mt() {
|
|
6110
6489
|
return typeof l.menu == "string" ? l.menu : "choropleth";
|
|
6111
6490
|
}
|
|
6112
|
-
let
|
|
6491
|
+
let ht = n(() => l.legend && (Le.value || Re.value || l.data)), gt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), _t = n(() => {
|
|
6113
6492
|
let e = [];
|
|
6114
6493
|
for (let t = 0; t <= 10; t++) {
|
|
6115
6494
|
let n = t / 10;
|
|
6116
6495
|
e.push({
|
|
6117
6496
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
6118
|
-
color:
|
|
6497
|
+
color: He(n)
|
|
6119
6498
|
});
|
|
6120
6499
|
}
|
|
6121
6500
|
return e;
|
|
6122
|
-
}),
|
|
6501
|
+
}), vt = new Intl.NumberFormat("en-US", {
|
|
6123
6502
|
notation: "compact",
|
|
6124
6503
|
maximumFractionDigits: 1
|
|
6125
|
-
}),
|
|
6126
|
-
let { min: e, max: t } =
|
|
6504
|
+
}), yt = n(() => {
|
|
6505
|
+
let { min: e, max: t } = Ie.value, n = t - e, r = [];
|
|
6127
6506
|
for (let t = 1; t <= 3; t++) {
|
|
6128
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
6507
|
+
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
6508
|
r.push({
|
|
6130
6509
|
value: o,
|
|
6131
6510
|
pct: i * 100
|
|
6132
6511
|
});
|
|
6133
6512
|
}
|
|
6134
6513
|
return r;
|
|
6135
|
-
}),
|
|
6514
|
+
}), bt = n(() => {
|
|
6136
6515
|
let e = [];
|
|
6137
|
-
if (
|
|
6516
|
+
if (Le.value) for (let t of l.colorScale) e.push({
|
|
6138
6517
|
key: t.value,
|
|
6139
6518
|
color: t.color,
|
|
6140
6519
|
label: t.value
|
|
6141
6520
|
});
|
|
6142
|
-
else if (
|
|
6521
|
+
else if (Re.value) for (let t of gt.value) e.push({
|
|
6143
6522
|
key: String(t.min),
|
|
6144
6523
|
color: t.color,
|
|
6145
6524
|
label: t.label ?? String(t.min)
|
|
6146
6525
|
});
|
|
6147
6526
|
return e;
|
|
6148
|
-
}),
|
|
6149
|
-
let e =
|
|
6527
|
+
}), xt = n(() => `linear-gradient(to right, ${_t.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), St = n(() => {
|
|
6528
|
+
let e = mt();
|
|
6150
6529
|
return [{
|
|
6151
6530
|
label: "Save as SVG",
|
|
6152
6531
|
action: () => {
|
|
6153
|
-
|
|
6532
|
+
w.value && Z(w.value, e);
|
|
6154
6533
|
}
|
|
6155
6534
|
}, {
|
|
6156
6535
|
label: "Save as PNG",
|
|
6157
6536
|
action: () => {
|
|
6158
|
-
|
|
6537
|
+
w.value && Q(w.value, e);
|
|
6159
6538
|
}
|
|
6160
6539
|
}];
|
|
6161
6540
|
});
|
|
6162
|
-
return
|
|
6163
|
-
|
|
6541
|
+
return T(() => [Oe.value, M.value], () => dt()), T(() => [
|
|
6542
|
+
Fe.value,
|
|
6164
6543
|
l.colorScale,
|
|
6165
|
-
l.noDataColor
|
|
6166
|
-
|
|
6544
|
+
l.noDataColor,
|
|
6545
|
+
l.dataGeoType
|
|
6546
|
+
], () => ft()), T(() => [l.strokeColor, ke.value], () => pt()), T(() => [Ne.value, Oe.value], () => ve(), { flush: "post" }), (n, c) => (_(), a("div", {
|
|
6167
6547
|
ref_key: "containerRef",
|
|
6168
|
-
ref:
|
|
6548
|
+
ref: S,
|
|
6169
6549
|
class: f(["choropleth-wrapper", { pannable: t.pan }])
|
|
6170
6550
|
}, [
|
|
6171
|
-
t.menu ? (
|
|
6551
|
+
t.menu ? (_(), r(le, {
|
|
6172
6552
|
key: 0,
|
|
6173
|
-
items:
|
|
6553
|
+
items: St.value
|
|
6174
6554
|
}, null, 8, ["items"])) : i("", !0),
|
|
6175
|
-
t.title ||
|
|
6555
|
+
t.title || ht.value ? (_(), a("div", Jt, [t.title ? (_(), a("div", Yt, b(t.title), 1)) : i("", !0), ht.value ? (_(), a("div", Xt, [t.legendTitle ? (_(), a("span", Zt, b(t.legendTitle), 1)) : i("", !0), Le.value || Re.value ? (_(!0), a(e, { key: 1 }, y(bt.value, (e) => (_(), a("span", {
|
|
6176
6556
|
key: e.key,
|
|
6177
6557
|
class: "choropleth-legend-item"
|
|
6178
6558
|
}, [o("span", {
|
|
6179
6559
|
class: "choropleth-legend-swatch",
|
|
6180
6560
|
style: m({ background: e.color })
|
|
6181
|
-
}, null, 4), s(" " +
|
|
6561
|
+
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", Qt, [o("div", {
|
|
6182
6562
|
class: "choropleth-legend-gradient",
|
|
6183
|
-
style: m({ background:
|
|
6184
|
-
}, null, 4), o("div",
|
|
6563
|
+
style: m({ background: xt.value })
|
|
6564
|
+
}, null, 4), o("div", $t, [(_(!0), a(e, null, y(yt.value, (e) => (_(), a("span", {
|
|
6185
6565
|
key: e.value,
|
|
6186
6566
|
style: m({ left: e.pct + "%" })
|
|
6187
|
-
},
|
|
6188
|
-
(
|
|
6567
|
+
}, b(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
|
|
6568
|
+
(_(), a("svg", {
|
|
6189
6569
|
ref_key: "svgRef",
|
|
6190
|
-
ref:
|
|
6191
|
-
viewBox: `0 0 ${
|
|
6570
|
+
ref: w,
|
|
6571
|
+
viewBox: `0 0 ${Se.value} ${Ce.value}`,
|
|
6192
6572
|
preserveAspectRatio: "xMidYMid meet"
|
|
6193
6573
|
}, [o("g", {
|
|
6194
6574
|
ref_key: "mapGroupRef",
|
|
6195
|
-
ref:
|
|
6196
|
-
},
|
|
6197
|
-
|
|
6575
|
+
ref: D
|
|
6576
|
+
}, [o("g", {
|
|
6577
|
+
ref_key: "baseGroupRef",
|
|
6578
|
+
ref: O
|
|
6579
|
+
}, null, 512), o("g", {
|
|
6580
|
+
ref_key: "overlayGroupRef",
|
|
6581
|
+
ref: k
|
|
6582
|
+
}, null, 512)], 512)], 8, en)),
|
|
6583
|
+
K.value ? (_(), a("button", {
|
|
6198
6584
|
key: 2,
|
|
6199
6585
|
type: "button",
|
|
6200
6586
|
class: "choropleth-reset",
|
|
6201
6587
|
"aria-label": "Reset zoom",
|
|
6202
|
-
onClick:
|
|
6588
|
+
onClick: be
|
|
6203
6589
|
}, " Reset ")) : i("", !0),
|
|
6204
|
-
|
|
6590
|
+
M.value ? (_(), r(qt, {
|
|
6205
6591
|
key: 3,
|
|
6206
6592
|
ref_key: "tooltipChildRef",
|
|
6207
|
-
ref:
|
|
6593
|
+
ref: A
|
|
6208
6594
|
}, {
|
|
6209
|
-
default:
|
|
6595
|
+
default: E((r) => [ee(n.$slots, "tooltip", p(u(te(r))), () => [t.tooltipFormat ? (_(), a("span", {
|
|
6210
6596
|
key: 0,
|
|
6211
6597
|
innerHTML: t.tooltipFormat(r)
|
|
6212
|
-
}, null, 8,
|
|
6598
|
+
}, null, 8, tn)) : r.value == null ? (_(), a(e, { key: 1 }, [s(b(r.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(r.name) + ": " + b(Je(r.value)), 1)], 64))], !0)]),
|
|
6213
6599
|
_: 3
|
|
6214
6600
|
}, 512)) : i("", !0)
|
|
6215
6601
|
], 2));
|
|
6216
6602
|
}
|
|
6217
|
-
}), [["__scopeId", "data-v-
|
|
6603
|
+
}), [["__scopeId", "data-v-f0f75b22"]]), sn = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
6218
6604
|
__name: "ChartTooltip",
|
|
6219
6605
|
props: {
|
|
6220
6606
|
x: {},
|
|
@@ -6225,7 +6611,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6225
6611
|
},
|
|
6226
6612
|
emits: ["close"],
|
|
6227
6613
|
setup(e) {
|
|
6228
|
-
return (t, n) => e.mode === "hover" && e.open ? (
|
|
6614
|
+
return (t, n) => e.mode === "hover" && e.open ? (_(), a("div", {
|
|
6229
6615
|
key: 0,
|
|
6230
6616
|
class: "chart-tooltip-content",
|
|
6231
6617
|
style: m({
|
|
@@ -6234,12 +6620,12 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6234
6620
|
top: `${e.y}px`,
|
|
6235
6621
|
transform: "translateY(-50%)"
|
|
6236
6622
|
})
|
|
6237
|
-
}, [
|
|
6623
|
+
}, [ee(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(S(ne), {
|
|
6238
6624
|
key: 1,
|
|
6239
6625
|
open: e.open
|
|
6240
6626
|
}, {
|
|
6241
|
-
default:
|
|
6242
|
-
default:
|
|
6627
|
+
default: E(() => [c(S(M), { "as-child": "" }, {
|
|
6628
|
+
default: E(() => [o("div", {
|
|
6243
6629
|
class: "chart-tooltip-anchor",
|
|
6244
6630
|
style: m({
|
|
6245
6631
|
left: `${e.x}px`,
|
|
@@ -6247,8 +6633,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6247
6633
|
})
|
|
6248
6634
|
}, null, 4)]),
|
|
6249
6635
|
_: 1
|
|
6250
|
-
}), c(
|
|
6251
|
-
default:
|
|
6636
|
+
}), c(S(P), null, {
|
|
6637
|
+
default: E(() => [e.open ? (_(), r(S(N), {
|
|
6252
6638
|
key: 0,
|
|
6253
6639
|
class: "chart-tooltip-content",
|
|
6254
6640
|
side: "right",
|
|
@@ -6257,7 +6643,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6257
6643
|
onPointerDownOutside: n[0] ||= (e) => t.$emit("close"),
|
|
6258
6644
|
onEscapeKeyDown: n[1] ||= (e) => t.$emit("close")
|
|
6259
6645
|
}, {
|
|
6260
|
-
default:
|
|
6646
|
+
default: E(() => [ee(t.$slots, "default", {}, void 0, !0)]),
|
|
6261
6647
|
_: 3
|
|
6262
6648
|
}, 8, ["side-offset"])) : i("", !0)]),
|
|
6263
6649
|
_: 3
|
|
@@ -6265,7 +6651,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6265
6651
|
_: 3
|
|
6266
6652
|
}, 8, ["open"])) : i("", !0);
|
|
6267
6653
|
}
|
|
6268
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
6654
|
+
}), [["__scopeId", "data-v-44377f70"]]), cn = { class: "TableWrapper" }, ln = /* @__PURE__ */ B(/* @__PURE__ */ l({
|
|
6269
6655
|
__name: "DataTable",
|
|
6270
6656
|
props: {
|
|
6271
6657
|
data: {},
|
|
@@ -6321,60 +6707,60 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
|
|
|
6321
6707
|
name: e,
|
|
6322
6708
|
values: t
|
|
6323
6709
|
}));
|
|
6324
|
-
}),
|
|
6710
|
+
}), g = n(() => {
|
|
6325
6711
|
let e = h.value;
|
|
6326
6712
|
if (e.length === 0) return 0;
|
|
6327
6713
|
let t = 0;
|
|
6328
6714
|
for (let n of e) t = Math.max(t, n.values.length);
|
|
6329
6715
|
return c.maxRows ? Math.min(t, c.maxRows) : t;
|
|
6330
6716
|
});
|
|
6331
|
-
function
|
|
6717
|
+
function v(e, t) {
|
|
6332
6718
|
let n = e.values[t];
|
|
6333
6719
|
return n == null ? "" : e.enumLabels && typeof n == "number" ? e.enumLabels[n] ?? String(n) : typeof n == "number" ? Number.isInteger(n) ? n.toString() : n.toFixed(4) : typeof n == "boolean" ? n ? "true" : "false" : String(n);
|
|
6334
6720
|
}
|
|
6335
|
-
function
|
|
6721
|
+
function ee() {
|
|
6336
6722
|
return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
|
|
6337
6723
|
}
|
|
6338
|
-
function
|
|
6724
|
+
function te(e) {
|
|
6339
6725
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
6340
6726
|
}
|
|
6341
|
-
function
|
|
6727
|
+
function x() {
|
|
6342
6728
|
if (typeof c.csv == "function") return c.csv();
|
|
6343
6729
|
if (typeof c.csv == "string") return c.csv;
|
|
6344
|
-
let e = h.value, t =
|
|
6730
|
+
let e = h.value, t = g.value, n = [e.map((e) => te(l(e.name))).join(",")];
|
|
6345
6731
|
for (let r = 0; r < t; r++) {
|
|
6346
|
-
let t = e.map((e) =>
|
|
6732
|
+
let t = e.map((e) => te(v(e, r)));
|
|
6347
6733
|
n.push(t.join(","));
|
|
6348
6734
|
}
|
|
6349
6735
|
return n.join("\n");
|
|
6350
6736
|
}
|
|
6351
|
-
let
|
|
6737
|
+
let S = n(() => [{
|
|
6352
6738
|
label: c.downloadMenuLink,
|
|
6353
|
-
action: () =>
|
|
6354
|
-
}]),
|
|
6355
|
-
return (n, s) => (
|
|
6739
|
+
action: () => me(x(), ee())
|
|
6740
|
+
}]), C = n(() => !!c.menu);
|
|
6741
|
+
return (n, s) => (_(), a("div", { class: f(["TableOuter", {
|
|
6356
6742
|
"full-width": t.fullWidth,
|
|
6357
|
-
"has-menu":
|
|
6358
|
-
}]) }, [
|
|
6743
|
+
"has-menu": C.value
|
|
6744
|
+
}]) }, [C.value ? (_(), r(le, {
|
|
6359
6745
|
key: 0,
|
|
6360
|
-
items:
|
|
6746
|
+
items: S.value,
|
|
6361
6747
|
"force-dropdown": ""
|
|
6362
|
-
}, null, 8, ["items"])) : i("", !0), o("div",
|
|
6363
|
-
o("colgroup", null, [(
|
|
6748
|
+
}, null, 8, ["items"])) : i("", !0), o("div", cn, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
|
|
6749
|
+
o("colgroup", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("col", {
|
|
6364
6750
|
key: e.name,
|
|
6365
6751
|
style: m(u(e.name))
|
|
6366
6752
|
}, null, 4))), 128))]),
|
|
6367
|
-
o("thead", null, [o("tr", null, [(
|
|
6753
|
+
o("thead", null, [o("tr", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("th", {
|
|
6368
6754
|
key: e.name,
|
|
6369
6755
|
style: m(d(e.name))
|
|
6370
|
-
},
|
|
6371
|
-
o("tbody", null, [(
|
|
6756
|
+
}, b(l(e.name)), 5))), 128))])]),
|
|
6757
|
+
o("tbody", null, [(_(!0), a(e, null, y(g.value, (n) => (_(), a("tr", { key: n }, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("td", {
|
|
6372
6758
|
key: e.name,
|
|
6373
6759
|
class: f(t.columnConfig?.[e.name]?.cellClass),
|
|
6374
6760
|
style: m(d(e.name))
|
|
6375
|
-
},
|
|
6761
|
+
}, b(v(e, n - 1)), 7))), 128))]))), 128))])
|
|
6376
6762
|
], 2)])], 2));
|
|
6377
6763
|
}
|
|
6378
6764
|
}), [["__scopeId", "data-v-d5c290dc"]]);
|
|
6379
6765
|
//#endregion
|
|
6380
|
-
export {
|
|
6766
|
+
export { Ut as BarChart, sn as ChartTooltip, on as ChoroplethMap, ln as DataTable, St as LineChart, Wt as fipsToHsa, Gt as hsaNames };
|