@cfasim-ui/charts 0.4.0 → 0.4.2
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 +11 -2
- package/dist/ChartMenu/ChartMenu.d.ts +5 -1
- package/dist/ChoroplethMap/ChoroplethMap.d.ts +146 -2
- package/dist/ChoroplethMap/ChoroplethTooltip.d.ts +32 -0
- package/dist/DataTable/DataTable.d.ts +10 -8
- package/dist/LineChart/LineChart.d.ts +11 -2
- package/dist/index.css +1 -1
- package/dist/index.js +944 -869
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,73 +1,65 @@
|
|
|
1
|
-
import { Fragment as e,
|
|
2
|
-
import { DropdownMenuContent as
|
|
3
|
-
import { geoAlbersUsa as
|
|
4
|
-
import { zoom as
|
|
5
|
-
import { select as
|
|
6
|
-
import { feature 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 ee, openBlock as g, ref as _, renderList as v, renderSlot as te, toDisplayString as y, toHandlers as ne, toRaw as b, unref as x, useSlots as re, useTemplateRef as S, watch as C, withCtx as w } from "vue";
|
|
2
|
+
import { DropdownMenuContent as T, DropdownMenuItem as E, DropdownMenuPortal as D, DropdownMenuRoot as O, DropdownMenuTrigger as k, PopoverAnchor as A, PopoverContent as j, PopoverPortal as M, PopoverRoot as N } from "reka-ui";
|
|
3
|
+
import { geoAlbersUsa as P, geoPath as ie } from "d3-geo";
|
|
4
|
+
import { zoom as F, zoomIdentity as I } from "d3-zoom";
|
|
5
|
+
import { select as ae } from "d3-selection";
|
|
6
|
+
import { feature as L, merge as oe, mesh as R } from "topojson-client";
|
|
7
7
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
8
|
+
var se = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PURE__ */ l({
|
|
9
9
|
__name: "ChartMenu",
|
|
10
|
-
props: {
|
|
10
|
+
props: {
|
|
11
|
+
items: {},
|
|
12
|
+
forceDropdown: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !1
|
|
15
|
+
}
|
|
16
|
+
},
|
|
11
17
|
setup(t) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class: "chart-menu-button chart-menu-single",
|
|
15
|
-
"aria-label": t.items[0].label,
|
|
16
|
-
onClick: c[0] ||= (...e) => t.items[0].action && t.items[0].action(...e)
|
|
17
|
-
}, [...c[1] ||= [a("svg", {
|
|
18
|
-
width: "14",
|
|
19
|
-
height: "14",
|
|
20
|
-
viewBox: "0 0 14 14",
|
|
21
|
-
fill: "none",
|
|
22
|
-
stroke: "currentColor",
|
|
23
|
-
"stroke-width": "1.5",
|
|
24
|
-
"stroke-linecap": "round",
|
|
25
|
-
"stroke-linejoin": "round",
|
|
26
|
-
"aria-hidden": "true"
|
|
27
|
-
}, [a("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, L)) : (h(), n(x(E), {
|
|
18
|
+
let n = t, i = () => n.forceDropdown || n.items.length > 1;
|
|
19
|
+
return (n, l) => (g(), a("div", se, [i() ? (g(), r(x(O), {
|
|
28
20
|
key: 1,
|
|
29
21
|
modal: !1
|
|
30
22
|
}, {
|
|
31
|
-
default:
|
|
23
|
+
default: w(() => [c(x(k), {
|
|
32
24
|
class: "chart-menu-button",
|
|
33
25
|
"aria-label": "Chart options"
|
|
34
26
|
}, {
|
|
35
|
-
default:
|
|
27
|
+
default: w(() => [...l[2] ||= [o("svg", {
|
|
36
28
|
width: "16",
|
|
37
29
|
height: "16",
|
|
38
30
|
viewBox: "0 0 16 16",
|
|
39
31
|
fill: "currentColor",
|
|
40
32
|
"aria-hidden": "true"
|
|
41
33
|
}, [
|
|
42
|
-
|
|
34
|
+
o("circle", {
|
|
43
35
|
cx: "3",
|
|
44
36
|
cy: "8",
|
|
45
37
|
r: "1.5"
|
|
46
38
|
}),
|
|
47
|
-
|
|
39
|
+
o("circle", {
|
|
48
40
|
cx: "8",
|
|
49
41
|
cy: "8",
|
|
50
42
|
r: "1.5"
|
|
51
43
|
}),
|
|
52
|
-
|
|
44
|
+
o("circle", {
|
|
53
45
|
cx: "13",
|
|
54
46
|
cy: "8",
|
|
55
47
|
r: "1.5"
|
|
56
48
|
})
|
|
57
49
|
], -1)]]),
|
|
58
50
|
_: 1
|
|
59
|
-
}),
|
|
60
|
-
default:
|
|
51
|
+
}), c(x(D), null, {
|
|
52
|
+
default: w(() => [c(x(T), {
|
|
61
53
|
class: "chart-menu-content",
|
|
62
54
|
"side-offset": 4,
|
|
63
55
|
align: "end"
|
|
64
56
|
}, {
|
|
65
|
-
default:
|
|
57
|
+
default: w(() => [(g(!0), a(e, null, v(t.items, (e) => (g(), r(x(E), {
|
|
66
58
|
key: e.label,
|
|
67
59
|
class: "chart-menu-item",
|
|
68
60
|
onSelect: e.action
|
|
69
61
|
}, {
|
|
70
|
-
default:
|
|
62
|
+
default: w(() => [s(y(e.label), 1)]),
|
|
71
63
|
_: 2
|
|
72
64
|
}, 1032, ["onSelect"]))), 128))]),
|
|
73
65
|
_: 1
|
|
@@ -75,48 +67,63 @@ var I = { class: "chart-menu-trigger-area" }, L = ["aria-label"], se = /* @__PUR
|
|
|
75
67
|
_: 1
|
|
76
68
|
})]),
|
|
77
69
|
_: 1
|
|
78
|
-
}))
|
|
70
|
+
})) : (g(), a("button", {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "chart-menu-button chart-menu-single",
|
|
73
|
+
"aria-label": t.items[0].label,
|
|
74
|
+
onClick: l[0] ||= (...e) => t.items[0].action && t.items[0].action(...e)
|
|
75
|
+
}, [...l[1] ||= [o("svg", {
|
|
76
|
+
width: "14",
|
|
77
|
+
height: "14",
|
|
78
|
+
viewBox: "0 0 14 14",
|
|
79
|
+
fill: "none",
|
|
80
|
+
stroke: "currentColor",
|
|
81
|
+
"stroke-width": "1.5",
|
|
82
|
+
"stroke-linecap": "round",
|
|
83
|
+
"stroke-linejoin": "round",
|
|
84
|
+
"aria-hidden": "true"
|
|
85
|
+
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, z))]));
|
|
79
86
|
}
|
|
80
|
-
}),
|
|
87
|
+
}), V = (e, t) => {
|
|
81
88
|
let n = e.__vccOpts || e;
|
|
82
89
|
for (let [e, r] of t) n[e] = r;
|
|
83
90
|
return n;
|
|
84
|
-
}, ce = /* @__PURE__ */
|
|
91
|
+
}, ce = /* @__PURE__ */ V(B, [["__scopeId", "data-v-b3c563e8"]]);
|
|
85
92
|
//#endregion
|
|
86
93
|
//#region src/_shared/axes.ts
|
|
87
|
-
function
|
|
94
|
+
function H(e) {
|
|
88
95
|
return Math.round(e) + .5;
|
|
89
96
|
}
|
|
90
|
-
function
|
|
97
|
+
function U(e, t) {
|
|
91
98
|
let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
|
|
92
99
|
return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
|
|
93
100
|
}
|
|
94
|
-
function
|
|
101
|
+
function W(e, t, n) {
|
|
95
102
|
if (!(n > 0) || !isFinite(n)) return [];
|
|
96
103
|
let r = [], i = Math.ceil(e / n) * n;
|
|
97
104
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
98
105
|
return r;
|
|
99
106
|
}
|
|
100
|
-
var
|
|
101
|
-
function
|
|
102
|
-
return Math.abs(e) >= 1e3 ?
|
|
107
|
+
var le = new Intl.NumberFormat();
|
|
108
|
+
function G(e) {
|
|
109
|
+
return Math.abs(e) >= 1e3 ? le.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
|
|
103
110
|
}
|
|
104
111
|
//#endregion
|
|
105
112
|
//#region src/_shared/computeTicks.ts
|
|
106
|
-
function
|
|
113
|
+
function K(e) {
|
|
107
114
|
let { min: t, max: n, ticks: r } = e;
|
|
108
115
|
if (t === n) return [];
|
|
109
116
|
let i = e.displayOffset ?? 0;
|
|
110
117
|
if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
|
|
111
|
-
if (typeof r == "number") return
|
|
112
|
-
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o =
|
|
113
|
-
return
|
|
118
|
+
if (typeof r == "number") return W(t + i, n + i, r).map((e) => e - i);
|
|
119
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = U(n - t, a);
|
|
120
|
+
return W(t + i, n + i, o).map((e) => e - i);
|
|
114
121
|
}
|
|
115
122
|
//#endregion
|
|
116
123
|
//#region src/_shared/useChartSize.ts
|
|
117
|
-
function
|
|
118
|
-
let t =
|
|
119
|
-
return
|
|
124
|
+
function ue(e = {}) {
|
|
125
|
+
let t = _(null), n = _(0), r = null, i = null;
|
|
126
|
+
return h(() => {
|
|
120
127
|
t.value && (n.value = t.value.clientWidth, r = new ResizeObserver((t) => {
|
|
121
128
|
let r = t[0];
|
|
122
129
|
if (!r) return;
|
|
@@ -125,32 +132,32 @@ function W(e = {}) {
|
|
|
125
132
|
n.value = r.contentRect.width;
|
|
126
133
|
}, a)) : n.value = r.contentRect.width;
|
|
127
134
|
}), r.observe(t.value));
|
|
128
|
-
}),
|
|
135
|
+
}), ee(() => {
|
|
129
136
|
r?.disconnect(), i && clearTimeout(i);
|
|
130
137
|
}), {
|
|
131
138
|
containerRef: t,
|
|
132
139
|
measuredWidth: n
|
|
133
140
|
};
|
|
134
141
|
}
|
|
135
|
-
function
|
|
136
|
-
let
|
|
142
|
+
function de(e) {
|
|
143
|
+
let t = n(() => ({
|
|
137
144
|
top: (e.title() ? 30 : 10) + (e.hasInlineLegend() ? 20 : 0),
|
|
138
145
|
right: 10,
|
|
139
146
|
bottom: e.xLabel() ? 46 : 30,
|
|
140
147
|
left: e.yLabel() ? 66 : 50
|
|
141
148
|
}));
|
|
142
149
|
return {
|
|
143
|
-
padding:
|
|
144
|
-
innerW:
|
|
145
|
-
innerH:
|
|
150
|
+
padding: t,
|
|
151
|
+
innerW: n(() => e.width() - t.value.left - t.value.right),
|
|
152
|
+
innerH: n(() => e.height() - t.value.top - t.value.bottom)
|
|
146
153
|
};
|
|
147
154
|
}
|
|
148
155
|
//#endregion
|
|
149
156
|
//#region src/tooltip-position.ts
|
|
150
|
-
var
|
|
151
|
-
function
|
|
157
|
+
var q = 16, J = 8;
|
|
158
|
+
function Y(e, t, n, r, i, a) {
|
|
152
159
|
if (i === "none") return {
|
|
153
|
-
left: e +
|
|
160
|
+
left: e + q,
|
|
154
161
|
top: t
|
|
155
162
|
};
|
|
156
163
|
let o = i === "chart" && a ? {
|
|
@@ -163,16 +170,16 @@ function J(e, t, n, r, i, a) {
|
|
|
163
170
|
right: window.innerWidth,
|
|
164
171
|
top: 0,
|
|
165
172
|
bottom: window.innerHeight
|
|
166
|
-
}, s = e +
|
|
173
|
+
}, s = e + q + n > o.right - J ? e - q - n : e + q, c = r / 2;
|
|
167
174
|
return {
|
|
168
175
|
left: s,
|
|
169
|
-
top: Math.min(Math.max(t, o.top +
|
|
176
|
+
top: Math.min(Math.max(t, o.top + J + c), o.bottom - J - c)
|
|
170
177
|
};
|
|
171
178
|
}
|
|
172
179
|
//#endregion
|
|
173
180
|
//#region src/_shared/useChartTooltip.ts
|
|
174
|
-
function
|
|
175
|
-
let t = e.touchYOffset ?? 50, n =
|
|
181
|
+
function fe(e) {
|
|
182
|
+
let t = e.touchYOffset ?? 50, n = _(null), r = _(!1), i = _(null), a = _(null), o = _(null);
|
|
176
183
|
function s(e) {
|
|
177
184
|
return "touches" in e ? e.touches[0] ?? null : e;
|
|
178
185
|
}
|
|
@@ -185,14 +192,14 @@ function ue(e) {
|
|
|
185
192
|
clientY: r.clientY
|
|
186
193
|
}, e.onHover?.({ index: i }));
|
|
187
194
|
}
|
|
188
|
-
|
|
195
|
+
C([a, n], () => {
|
|
189
196
|
if (n.value === null || !a.value) {
|
|
190
197
|
o.value = null;
|
|
191
198
|
return;
|
|
192
199
|
}
|
|
193
200
|
let s = i.value, c = e.containerRef.value;
|
|
194
201
|
if (!s || !c) return;
|
|
195
|
-
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } =
|
|
202
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = Y(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
|
|
196
203
|
o.value = {
|
|
197
204
|
left: f - l.left,
|
|
198
205
|
top: p - l.top
|
|
@@ -217,7 +224,7 @@ function ue(e) {
|
|
|
217
224
|
function p(t) {
|
|
218
225
|
e.enabled() && (t.preventDefault(), c(t));
|
|
219
226
|
}
|
|
220
|
-
function
|
|
227
|
+
function m() {
|
|
221
228
|
e.enabled() && (r.value = !1, n.value = null, e.onHover?.(null));
|
|
222
229
|
}
|
|
223
230
|
return {
|
|
@@ -232,13 +239,13 @@ function ue(e) {
|
|
|
232
239
|
click: d,
|
|
233
240
|
touchstart: f,
|
|
234
241
|
touchmove: p,
|
|
235
|
-
touchend:
|
|
242
|
+
touchend: m
|
|
236
243
|
}
|
|
237
244
|
};
|
|
238
245
|
}
|
|
239
246
|
//#endregion
|
|
240
247
|
//#region src/ChartMenu/download.ts
|
|
241
|
-
function
|
|
248
|
+
function pe(e, t) {
|
|
242
249
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
243
250
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
244
251
|
}
|
|
@@ -246,9 +253,9 @@ function X(e, t) {
|
|
|
246
253
|
let n = e.cloneNode(!0);
|
|
247
254
|
n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
248
255
|
let r = new XMLSerializer().serializeToString(n);
|
|
249
|
-
|
|
256
|
+
pe(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
250
257
|
}
|
|
251
|
-
function
|
|
258
|
+
function me(e, t) {
|
|
252
259
|
let n = e.cloneNode(!0);
|
|
253
260
|
n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
254
261
|
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;
|
|
@@ -257,17 +264,17 @@ function de(e, t) {
|
|
|
257
264
|
e.width = s * 2, e.height = c * 2;
|
|
258
265
|
let n = e.getContext("2d");
|
|
259
266
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
260
|
-
e &&
|
|
267
|
+
e && pe(e, `${t}.png`);
|
|
261
268
|
}), URL.revokeObjectURL(a);
|
|
262
269
|
}, o.src = a;
|
|
263
270
|
}
|
|
264
271
|
function Z(e, t) {
|
|
265
|
-
|
|
272
|
+
pe(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
266
273
|
}
|
|
267
274
|
//#endregion
|
|
268
275
|
//#region src/_shared/useChartMenu.ts
|
|
269
|
-
function
|
|
270
|
-
let
|
|
276
|
+
function he(e) {
|
|
277
|
+
let t = _(null);
|
|
271
278
|
function r() {
|
|
272
279
|
let t = e.filename();
|
|
273
280
|
if (t) return t;
|
|
@@ -275,35 +282,35 @@ function fe(e) {
|
|
|
275
282
|
return typeof n == "string" ? n : "chart";
|
|
276
283
|
}
|
|
277
284
|
return {
|
|
278
|
-
svgRef:
|
|
279
|
-
items:
|
|
280
|
-
let
|
|
285
|
+
svgRef: t,
|
|
286
|
+
items: n(() => {
|
|
287
|
+
let n = r(), i = [{
|
|
281
288
|
label: "Save as SVG",
|
|
282
289
|
action: () => {
|
|
283
|
-
|
|
290
|
+
t.value && X(t.value, n);
|
|
284
291
|
}
|
|
285
292
|
}, {
|
|
286
293
|
label: "Save as PNG",
|
|
287
294
|
action: () => {
|
|
288
|
-
|
|
295
|
+
t.value && me(t.value, n);
|
|
289
296
|
}
|
|
290
297
|
}];
|
|
291
298
|
return e.downloadLink() || i.push({
|
|
292
299
|
label: "Download CSV",
|
|
293
|
-
action: () => Z(e.getCsv(),
|
|
300
|
+
action: () => Z(e.getCsv(), n)
|
|
294
301
|
}), i;
|
|
295
302
|
}),
|
|
296
|
-
downloadLinkText:
|
|
303
|
+
downloadLinkText: n(() => {
|
|
297
304
|
let t = e.downloadLink();
|
|
298
305
|
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
299
306
|
}),
|
|
300
|
-
csvHref:
|
|
307
|
+
csvHref: n(() => e.downloadLink() ? `data:text/csv;charset=utf-8,${encodeURIComponent(e.getCsv())}` : null),
|
|
301
308
|
resolvedFilename: r
|
|
302
309
|
};
|
|
303
310
|
}
|
|
304
311
|
//#endregion
|
|
305
312
|
//#region src/_shared/seriesCsv.ts
|
|
306
|
-
function
|
|
313
|
+
function ge(e) {
|
|
307
314
|
if (e.length === 0) return "";
|
|
308
315
|
let t = 0;
|
|
309
316
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -315,7 +322,7 @@ function pe(e) {
|
|
|
315
322
|
}
|
|
316
323
|
return i.join("\n");
|
|
317
324
|
}
|
|
318
|
-
function
|
|
325
|
+
function _e(e, t, n = "category") {
|
|
319
326
|
if (t.length === 0 || e.length === 0) return "";
|
|
320
327
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
321
328
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -330,70 +337,70 @@ function Q(e) {
|
|
|
330
337
|
}
|
|
331
338
|
//#endregion
|
|
332
339
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
333
|
-
var
|
|
340
|
+
var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
|
|
334
341
|
"x1",
|
|
335
342
|
"y1",
|
|
336
343
|
"x2",
|
|
337
344
|
"y2",
|
|
338
345
|
"stroke",
|
|
339
346
|
"stroke-dasharray"
|
|
340
|
-
],
|
|
347
|
+
], xe = [
|
|
341
348
|
"cx",
|
|
342
349
|
"cy",
|
|
343
350
|
"fill",
|
|
344
351
|
"fill-opacity",
|
|
345
352
|
"stroke"
|
|
346
|
-
],
|
|
353
|
+
], Se = ["x", "y"], Ce = [
|
|
347
354
|
"x1",
|
|
348
355
|
"y1",
|
|
349
356
|
"x2",
|
|
350
357
|
"y2"
|
|
351
|
-
],
|
|
358
|
+
], we = [
|
|
352
359
|
"x1",
|
|
353
360
|
"y1",
|
|
354
361
|
"x2",
|
|
355
362
|
"y2"
|
|
356
|
-
],
|
|
363
|
+
], Te = [
|
|
357
364
|
"x1",
|
|
358
365
|
"y1",
|
|
359
366
|
"x2",
|
|
360
367
|
"y2"
|
|
361
|
-
],
|
|
368
|
+
], Ee = [
|
|
362
369
|
"x1",
|
|
363
370
|
"y1",
|
|
364
371
|
"x2",
|
|
365
372
|
"y2"
|
|
366
|
-
],
|
|
373
|
+
], De = ["x", "y"], Oe = ["transform"], ke = [
|
|
367
374
|
"x",
|
|
368
375
|
"y",
|
|
369
376
|
"text-anchor"
|
|
370
|
-
],
|
|
377
|
+
], Ae = ["x", "y"], je = [
|
|
371
378
|
"d",
|
|
372
379
|
"fill",
|
|
373
380
|
"fill-opacity"
|
|
374
|
-
],
|
|
381
|
+
], Me = [
|
|
375
382
|
"d",
|
|
376
383
|
"stroke",
|
|
377
384
|
"stroke-width",
|
|
378
385
|
"stroke-opacity",
|
|
379
386
|
"stroke-dasharray"
|
|
380
|
-
],
|
|
387
|
+
], Ne = [
|
|
381
388
|
"cx",
|
|
382
389
|
"cy",
|
|
383
390
|
"r",
|
|
384
391
|
"fill",
|
|
385
392
|
"fill-opacity",
|
|
386
393
|
"stroke"
|
|
387
|
-
],
|
|
394
|
+
], Pe = [
|
|
388
395
|
"d",
|
|
389
396
|
"fill",
|
|
390
397
|
"fill-opacity"
|
|
391
|
-
],
|
|
398
|
+
], Fe = [
|
|
392
399
|
"d",
|
|
393
400
|
"stroke",
|
|
394
401
|
"stroke-width",
|
|
395
402
|
"stroke-dasharray"
|
|
396
|
-
],
|
|
403
|
+
], Ie = [
|
|
397
404
|
"x1",
|
|
398
405
|
"y1",
|
|
399
406
|
"x2",
|
|
@@ -401,7 +408,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
401
408
|
"stroke",
|
|
402
409
|
"stroke-width",
|
|
403
410
|
"stroke-dasharray"
|
|
404
|
-
],
|
|
411
|
+
], Le = [
|
|
405
412
|
"x1",
|
|
406
413
|
"y1",
|
|
407
414
|
"x2",
|
|
@@ -409,44 +416,44 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
409
416
|
"stroke",
|
|
410
417
|
"stroke-width",
|
|
411
418
|
"stroke-dasharray"
|
|
412
|
-
],
|
|
419
|
+
], Re = [
|
|
413
420
|
"x1",
|
|
414
421
|
"y1",
|
|
415
422
|
"x2",
|
|
416
423
|
"y2"
|
|
417
|
-
],
|
|
424
|
+
], ze = [
|
|
418
425
|
"x1",
|
|
419
426
|
"y1",
|
|
420
427
|
"x2",
|
|
421
428
|
"y2"
|
|
422
|
-
],
|
|
429
|
+
], Be = [
|
|
423
430
|
"x1",
|
|
424
431
|
"y1",
|
|
425
432
|
"x2",
|
|
426
433
|
"y2"
|
|
427
|
-
],
|
|
434
|
+
], Ve = [
|
|
428
435
|
"cx",
|
|
429
436
|
"cy",
|
|
430
437
|
"fill"
|
|
431
|
-
],
|
|
438
|
+
], He = [
|
|
432
439
|
"x",
|
|
433
440
|
"y",
|
|
434
441
|
"width",
|
|
435
442
|
"height"
|
|
436
|
-
],
|
|
443
|
+
], Ue = [
|
|
437
444
|
"cx",
|
|
438
445
|
"cy",
|
|
439
446
|
"fill",
|
|
440
447
|
"fill-opacity",
|
|
441
448
|
"stroke"
|
|
442
|
-
],
|
|
449
|
+
], We = [
|
|
443
450
|
"x",
|
|
444
451
|
"y",
|
|
445
452
|
"fill"
|
|
446
|
-
],
|
|
453
|
+
], Ge = ["x", "y"], Ke = { class: "line-chart-tooltip" }, qe = {
|
|
447
454
|
key: 0,
|
|
448
455
|
class: "line-chart-tooltip-label"
|
|
449
|
-
},
|
|
456
|
+
}, Je = ["href", "download"], Ye = 36, Xe = 12, Ze = 7, Qe = 16, $e = /* @__PURE__ */ V(/* @__PURE__ */ l({
|
|
450
457
|
__name: "LineChart",
|
|
451
458
|
props: {
|
|
452
459
|
y: {},
|
|
@@ -467,6 +474,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
467
474
|
yTicks: {},
|
|
468
475
|
xTickFormat: {},
|
|
469
476
|
yTickFormat: {},
|
|
477
|
+
tooltipValueFormat: {},
|
|
470
478
|
xLabels: {},
|
|
471
479
|
debounce: {},
|
|
472
480
|
menu: {
|
|
@@ -483,50 +491,53 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
483
491
|
downloadLink: { type: [Boolean, String] }
|
|
484
492
|
},
|
|
485
493
|
emits: ["hover"],
|
|
486
|
-
setup(
|
|
487
|
-
let
|
|
488
|
-
title: () =>
|
|
489
|
-
xLabel: () =>
|
|
490
|
-
yLabel: () =>
|
|
491
|
-
hasInlineLegend: () =>
|
|
492
|
-
width: () =>
|
|
493
|
-
height: () =>
|
|
494
|
-
}),
|
|
494
|
+
setup(t, { emit: c }) {
|
|
495
|
+
let l = t, f = c, { containerRef: h, measuredWidth: ee } = ue({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => O.value.some((e) => e.legend) || l.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description)) || !1), { padding: S, innerW: C, innerH: w } = de({
|
|
496
|
+
title: () => l.title,
|
|
497
|
+
xLabel: () => l.xLabel,
|
|
498
|
+
yLabel: () => l.yLabel,
|
|
499
|
+
hasInlineLegend: () => re.value,
|
|
500
|
+
width: () => _.value,
|
|
501
|
+
height: () => b.value
|
|
502
|
+
}), T = [];
|
|
495
503
|
function E(e) {
|
|
496
504
|
return {
|
|
497
505
|
...e,
|
|
498
|
-
data: e.y ?? e.data ??
|
|
506
|
+
data: e.y ?? e.data ?? T
|
|
499
507
|
};
|
|
500
508
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
509
|
+
function D(e) {
|
|
510
|
+
return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.yTickFormat ? l.yTickFormat(e) : G(e);
|
|
511
|
+
}
|
|
512
|
+
let O = n(() => {
|
|
513
|
+
if (l.series && l.series.length > 0) return l.series.map(E);
|
|
514
|
+
let e = l.y ?? l.data;
|
|
504
515
|
return e ? [{
|
|
505
516
|
data: e,
|
|
506
|
-
x:
|
|
517
|
+
x: l.x
|
|
507
518
|
}] : [];
|
|
508
|
-
}),
|
|
519
|
+
}), k = n(() => l.areas ?? []), A = n(() => {
|
|
509
520
|
let e = 0;
|
|
510
|
-
for (let t of
|
|
511
|
-
for (let t of
|
|
521
|
+
for (let t of O.value) t.data.length > e && (e = t.data.length);
|
|
522
|
+
for (let t of k.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
|
|
512
523
|
return e;
|
|
513
|
-
}),
|
|
514
|
-
function
|
|
524
|
+
}), j = n(() => O.value.some((e) => e.x != null) || k.value.some((e) => e.x != null));
|
|
525
|
+
function M(e, t) {
|
|
515
526
|
return e.x ? Number(e.x[t]) : t;
|
|
516
527
|
}
|
|
517
|
-
function
|
|
528
|
+
function N(e, t) {
|
|
518
529
|
return e.x ? Number(e.x[t]) : t;
|
|
519
530
|
}
|
|
520
|
-
let
|
|
531
|
+
let P = n(() => j.value ? 0 : l.xMin ?? 0), ie = n(() => {
|
|
521
532
|
let e = Infinity, t = -Infinity;
|
|
522
|
-
for (let n of
|
|
523
|
-
let i =
|
|
533
|
+
for (let n of O.value) for (let r = 0; r < n.data.length; r++) {
|
|
534
|
+
let i = M(n, r);
|
|
524
535
|
isFinite(i) && (i < e && (e = i), i > t && (t = i));
|
|
525
536
|
}
|
|
526
|
-
for (let n of
|
|
537
|
+
for (let n of k.value) {
|
|
527
538
|
let r = Math.max(n.upper.length, n.lower.length);
|
|
528
539
|
for (let i = 0; i < r; i++) {
|
|
529
|
-
let r =
|
|
540
|
+
let r = N(n, i);
|
|
530
541
|
isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
531
542
|
}
|
|
532
543
|
}
|
|
@@ -538,18 +549,18 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
538
549
|
max: 0
|
|
539
550
|
};
|
|
540
551
|
});
|
|
541
|
-
function
|
|
542
|
-
let { min: t, max: n } =
|
|
543
|
-
return
|
|
552
|
+
function F(e) {
|
|
553
|
+
let { min: t, max: n } = ie.value, r = n - t || 1;
|
|
554
|
+
return S.value.left + (e - t) / r * C.value;
|
|
544
555
|
}
|
|
545
|
-
let
|
|
556
|
+
let I = n(() => {
|
|
546
557
|
let e = Infinity, t = -Infinity;
|
|
547
|
-
for (let n of
|
|
548
|
-
for (let n of
|
|
558
|
+
for (let n of O.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
559
|
+
for (let n of k.value) {
|
|
549
560
|
for (let r of n.upper) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
550
561
|
for (let r of n.lower) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
551
562
|
}
|
|
552
|
-
return isFinite(e) ? (
|
|
563
|
+
return isFinite(e) ? (l.yMin != null && l.yMin < e && (e = l.yMin), {
|
|
553
564
|
min: e,
|
|
554
565
|
max: t,
|
|
555
566
|
range: t - e || 1
|
|
@@ -562,72 +573,72 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
562
573
|
function ae(e) {
|
|
563
574
|
let t = e.data;
|
|
564
575
|
if (t.length === 0) return "";
|
|
565
|
-
let { min: n, range: r } =
|
|
576
|
+
let { min: n, range: r } = I.value, i = w.value / r, a = S.value.top + w.value, o = "", s = !1;
|
|
566
577
|
for (let r = 0; r < t.length; r++) {
|
|
567
|
-
let c =
|
|
578
|
+
let c = M(e, r);
|
|
568
579
|
if (!isFinite(t[r]) || !isFinite(c)) {
|
|
569
580
|
s = !1;
|
|
570
581
|
continue;
|
|
571
582
|
}
|
|
572
|
-
let l =
|
|
583
|
+
let l = F(c), u = a - (t[r] - n) * i;
|
|
573
584
|
o += s ? `L${l},${u}` : `M${l},${u}`, s = !0;
|
|
574
585
|
}
|
|
575
586
|
return o;
|
|
576
587
|
}
|
|
577
|
-
function
|
|
578
|
-
let t = e.data, { min: n, range: r } =
|
|
588
|
+
function L(e) {
|
|
589
|
+
let t = e.data, { min: n, range: r } = I.value, i = w.value / r, a = S.value.top + w.value, o = [];
|
|
579
590
|
for (let r = 0; r < t.length; r++) {
|
|
580
|
-
let s =
|
|
591
|
+
let s = M(e, r);
|
|
581
592
|
!isFinite(t[r]) || !isFinite(s) || o.push({
|
|
582
|
-
x:
|
|
593
|
+
x: F(s),
|
|
583
594
|
y: a - (t[r] - n) * i
|
|
584
595
|
});
|
|
585
596
|
}
|
|
586
597
|
return o;
|
|
587
598
|
}
|
|
588
|
-
function
|
|
599
|
+
function oe(e) {
|
|
589
600
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
590
601
|
if (t === 0) return "";
|
|
591
|
-
let { min: n, range: r } =
|
|
592
|
-
for (let n = 0; n < t; n++) isFinite(e.upper[n]) && isFinite(e.lower[n]) && isFinite(
|
|
602
|
+
let { min: n, range: r } = I.value, i = w.value / r, a = S.value.top + w.value, o = (e) => a - (e - n) * i, s = [], c = [];
|
|
603
|
+
for (let n = 0; n < t; n++) isFinite(e.upper[n]) && isFinite(e.lower[n]) && isFinite(N(e, n)) ? c.push(n) : c.length && (s.push(c), c = []);
|
|
593
604
|
c.length && s.push(c);
|
|
594
605
|
let l = "";
|
|
595
606
|
for (let t of s) {
|
|
596
|
-
l += `M${
|
|
597
|
-
for (let n = 1; n < t.length; n++) l += `L${
|
|
598
|
-
for (let n = t.length - 1; n >= 0; n--) l += `L${
|
|
607
|
+
l += `M${F(N(e, t[0]))},${o(e.upper[t[0]])}`;
|
|
608
|
+
for (let n = 1; n < t.length; n++) l += `L${F(N(e, t[n]))},${o(e.upper[t[n]])}`;
|
|
609
|
+
for (let n = t.length - 1; n >= 0; n--) l += `L${F(N(e, t[n]))},${o(e.lower[t[n]])}`;
|
|
599
610
|
l += "Z";
|
|
600
611
|
}
|
|
601
612
|
return l;
|
|
602
613
|
}
|
|
603
|
-
function
|
|
604
|
-
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null &&
|
|
605
|
-
return
|
|
614
|
+
function R(e, t) {
|
|
615
|
+
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && O.value[e.seriesIndex] || O.value[0];
|
|
616
|
+
return F(r ? M(r, n) : n);
|
|
606
617
|
}
|
|
607
618
|
function se(e, t = !0) {
|
|
608
|
-
let n =
|
|
619
|
+
let n = S.value.top + w.value;
|
|
609
620
|
if (e.seriesIndex == null) {
|
|
610
|
-
let t =
|
|
611
|
-
return t > r ? "" : `M${t},${
|
|
621
|
+
let t = R(e, "start"), r = R(e, "end");
|
|
622
|
+
return t > r ? "" : `M${t},${S.value.top}L${r},${S.value.top}L${r},${n}L${t},${n}Z`;
|
|
612
623
|
}
|
|
613
|
-
let r =
|
|
624
|
+
let r = O.value[e.seriesIndex];
|
|
614
625
|
if (!r) return "";
|
|
615
|
-
let { min: i, range: a } =
|
|
626
|
+
let { min: i, range: a } = I.value, o = w.value / a, s = (e) => n - (e - i) * o, c = Math.max(0, e.startIndex), l = Math.min(r.data.length - 1, e.endIndex);
|
|
616
627
|
if (c > l) return "";
|
|
617
|
-
let u = `M${
|
|
618
|
-
for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${
|
|
619
|
-
return t && (u += `L${
|
|
628
|
+
let u = `M${F(M(r, c))},${s(r.data[c])}`;
|
|
629
|
+
for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${F(M(r, e))},${s(r.data[e])}`);
|
|
630
|
+
return t && (u += `L${F(M(r, l))},${n}`, u += `L${F(M(r, c))},${n}`, u += "Z"), u;
|
|
620
631
|
}
|
|
621
|
-
let
|
|
622
|
-
let e =
|
|
632
|
+
let z = n(() => {
|
|
633
|
+
let e = l.areaSections;
|
|
623
634
|
if (!e?.length) return {
|
|
624
635
|
labels: [],
|
|
625
636
|
extraHeight: 0
|
|
626
637
|
};
|
|
627
|
-
let t = [], n =
|
|
638
|
+
let t = [], n = S.value.left + C.value;
|
|
628
639
|
for (let r of e) {
|
|
629
640
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
630
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) *
|
|
641
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Ze, o = R(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : O.value[r.seriesIndex]?.color ?? "currentColor");
|
|
631
642
|
t.push({
|
|
632
643
|
cx: c,
|
|
633
644
|
labelText: e,
|
|
@@ -642,7 +653,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
642
653
|
let r = [];
|
|
643
654
|
for (let e of t) {
|
|
644
655
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
645
|
-
for (; n < r.length && !(t >= r[n] +
|
|
656
|
+
for (; n < r.length && !(t >= r[n] + Qe);) n++;
|
|
646
657
|
e.row = n;
|
|
647
658
|
let i = e.cx + e.textWidth / 2;
|
|
648
659
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -652,20 +663,20 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
652
663
|
extraHeight: 0
|
|
653
664
|
} : {
|
|
654
665
|
labels: t,
|
|
655
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
666
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Ye + Xe
|
|
656
667
|
};
|
|
657
|
-
}), B =
|
|
668
|
+
}), B = n(() => {
|
|
658
669
|
let e = [];
|
|
659
|
-
for (let t of
|
|
670
|
+
for (let t of O.value) t.legend && e.push({
|
|
660
671
|
label: t.legend,
|
|
661
672
|
color: t.color ?? "currentColor",
|
|
662
673
|
type: "series",
|
|
663
674
|
dashed: t.dashed
|
|
664
675
|
});
|
|
665
|
-
let t =
|
|
676
|
+
let t = l.areaSections;
|
|
666
677
|
if (t) for (let n of t) {
|
|
667
678
|
if (n.legend !== "inline" || !n.label && !n.description) continue;
|
|
668
|
-
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" :
|
|
679
|
+
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : O.value[n.seriesIndex]?.color ?? "currentColor");
|
|
669
680
|
e.push({
|
|
670
681
|
label: t,
|
|
671
682
|
color: r,
|
|
@@ -674,41 +685,41 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
674
685
|
});
|
|
675
686
|
}
|
|
676
687
|
return e;
|
|
677
|
-
}), V =
|
|
678
|
-
let { min: e, max: t } =
|
|
688
|
+
}), V = n(() => b.value + z.value.extraHeight), U = n(() => S.value.top + w.value + S.value.bottom + Xe), W = n(() => {
|
|
689
|
+
let { min: e, max: t } = I.value, n = (t) => H(S.value.top + w.value - (t - e) / I.value.range * w.value), r = (e) => l.yTickFormat ? l.yTickFormat(e) : G(e);
|
|
679
690
|
return e === t ? [{
|
|
680
691
|
value: r(e),
|
|
681
|
-
y:
|
|
682
|
-
}] :
|
|
692
|
+
y: H(S.value.top + w.value / 2)
|
|
693
|
+
}] : K({
|
|
683
694
|
min: e,
|
|
684
695
|
max: t,
|
|
685
|
-
ticks:
|
|
686
|
-
targetTickCount:
|
|
696
|
+
ticks: l.yTicks,
|
|
697
|
+
targetTickCount: w.value / 50
|
|
687
698
|
}).map((e) => ({
|
|
688
699
|
value: r(e),
|
|
689
700
|
y: n(e)
|
|
690
701
|
}));
|
|
691
|
-
}),
|
|
692
|
-
let { min: e, max: t } =
|
|
702
|
+
}), le = n(() => {
|
|
703
|
+
let { min: e, max: t } = ie.value;
|
|
693
704
|
if (e === t) return [];
|
|
694
|
-
let n =
|
|
705
|
+
let n = P.value, r = A.value, i = (e, t) => {
|
|
695
706
|
let r = e + n;
|
|
696
|
-
return
|
|
707
|
+
return l.xTickFormat ? l.xTickFormat(r, t) : !j.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : G(r);
|
|
697
708
|
}, a;
|
|
698
|
-
if (
|
|
699
|
-
let e = Math.max(3, Math.floor(
|
|
709
|
+
if (l.xTicks == null && !j.value && l.xLabels && l.xLabels.length === r) {
|
|
710
|
+
let e = Math.max(3, Math.floor(C.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
|
|
700
711
|
a = [];
|
|
701
712
|
for (let e = 0; e < r; e += t) a.push(e);
|
|
702
|
-
} else a =
|
|
713
|
+
} else a = K({
|
|
703
714
|
min: e,
|
|
704
715
|
max: t,
|
|
705
|
-
ticks:
|
|
706
|
-
targetTickCount:
|
|
716
|
+
ticks: l.xTicks,
|
|
717
|
+
targetTickCount: C.value / 80,
|
|
707
718
|
displayOffset: n
|
|
708
719
|
});
|
|
709
|
-
let o =
|
|
720
|
+
let o = S.value.left, s = S.value.left + C.value;
|
|
710
721
|
return a.map((e, t) => {
|
|
711
|
-
let n =
|
|
722
|
+
let n = H(F(e)), r = "middle";
|
|
712
723
|
return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
|
|
713
724
|
value: i(e, t),
|
|
714
725
|
x: n,
|
|
@@ -716,284 +727,284 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
716
727
|
};
|
|
717
728
|
});
|
|
718
729
|
});
|
|
719
|
-
function
|
|
720
|
-
return typeof
|
|
730
|
+
function q() {
|
|
731
|
+
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : ge(O.value);
|
|
721
732
|
}
|
|
722
|
-
let
|
|
723
|
-
let e =
|
|
724
|
-
return e === null || !t ? null :
|
|
725
|
-
}),
|
|
726
|
-
function
|
|
733
|
+
let J = n(() => !!l.tooltipData || !!l.tooltipTrigger), Y = n(() => {
|
|
734
|
+
let e = Q.value, t = O.value[0];
|
|
735
|
+
return e === null || !t ? null : M(t, e);
|
|
736
|
+
}), pe = n(() => Y.value === null ? 0 : F(Y.value));
|
|
737
|
+
function X(e, t) {
|
|
727
738
|
let n = e.data.length;
|
|
728
739
|
if (n === 0) return null;
|
|
729
740
|
let r = 0, i = Infinity;
|
|
730
741
|
for (let a = 0; a < n; a++) {
|
|
731
|
-
let n =
|
|
742
|
+
let n = M(e, a);
|
|
732
743
|
if (!isFinite(n)) continue;
|
|
733
744
|
let o = Math.abs(n - t);
|
|
734
745
|
o < i && (i = o, r = a);
|
|
735
746
|
}
|
|
736
747
|
return i === Infinity ? null : r;
|
|
737
748
|
}
|
|
738
|
-
let me =
|
|
739
|
-
let e =
|
|
749
|
+
let me = n(() => {
|
|
750
|
+
let e = Y.value;
|
|
740
751
|
if (e === null) return [];
|
|
741
|
-
let { min: t, range: n } =
|
|
742
|
-
for (let n of
|
|
743
|
-
let o =
|
|
752
|
+
let { min: t, range: n } = I.value, r = w.value / n, i = S.value.top + w.value, a = [];
|
|
753
|
+
for (let n of O.value) {
|
|
754
|
+
let o = X(n, e);
|
|
744
755
|
if (o === null) continue;
|
|
745
756
|
let s = n.data[o];
|
|
746
757
|
isFinite(s) && a.push({
|
|
747
|
-
x:
|
|
758
|
+
x: F(M(n, o)),
|
|
748
759
|
y: i - (s - t) * r,
|
|
749
760
|
color: n.color ?? "currentColor"
|
|
750
761
|
});
|
|
751
762
|
}
|
|
752
763
|
return a;
|
|
753
|
-
}),
|
|
754
|
-
let e =
|
|
764
|
+
}), Z = n(() => {
|
|
765
|
+
let e = Q.value, t = Y.value;
|
|
755
766
|
if (e === null || t === null) return null;
|
|
756
|
-
let n = t +
|
|
757
|
-
return r =
|
|
767
|
+
let n = t + P.value, r;
|
|
768
|
+
return r = l.xTickFormat ? l.xTickFormat(n, e) : j.value ? G(n) : l.xLabels?.[e], {
|
|
758
769
|
index: e,
|
|
759
770
|
xLabel: r,
|
|
760
|
-
values:
|
|
761
|
-
let r =
|
|
771
|
+
values: O.value.map((e, n) => {
|
|
772
|
+
let r = X(e, t);
|
|
762
773
|
return {
|
|
763
774
|
value: r === null ? NaN : Number(e.data[r]),
|
|
764
775
|
color: e.color ?? "currentColor",
|
|
765
776
|
seriesIndex: n
|
|
766
777
|
};
|
|
767
778
|
}),
|
|
768
|
-
data:
|
|
779
|
+
data: l.tooltipData?.[e] ?? null
|
|
769
780
|
};
|
|
770
781
|
});
|
|
771
|
-
function
|
|
772
|
-
let t =
|
|
782
|
+
function _e(e) {
|
|
783
|
+
let t = h.value?.getBoundingClientRect();
|
|
773
784
|
if (!t) return null;
|
|
774
|
-
let n =
|
|
785
|
+
let n = O.value[0];
|
|
775
786
|
if (!n || n.data.length === 0) return null;
|
|
776
|
-
let { min: r, max: i } =
|
|
777
|
-
return
|
|
787
|
+
let { min: r, max: i } = ie.value, a = i - r || 1;
|
|
788
|
+
return X(n, r + (e - t.left - S.value.left) / C.value * a);
|
|
778
789
|
}
|
|
779
|
-
let { hoverIndex:
|
|
780
|
-
enabled: () =>
|
|
781
|
-
trigger: () =>
|
|
782
|
-
clamp: () =>
|
|
783
|
-
pointerToIndex:
|
|
784
|
-
containerRef:
|
|
785
|
-
onHover: (e) =>
|
|
786
|
-
}), { svgRef:
|
|
787
|
-
filename: () =>
|
|
788
|
-
legacyMenuLabel: () =>
|
|
789
|
-
getCsv:
|
|
790
|
-
downloadLink: () =>
|
|
790
|
+
let { hoverIndex: Q, tooltipRef: $e, tooltipPos: et, handlers: tt } = fe({
|
|
791
|
+
enabled: () => J.value,
|
|
792
|
+
trigger: () => l.tooltipTrigger,
|
|
793
|
+
clamp: () => l.tooltipClamp,
|
|
794
|
+
pointerToIndex: _e,
|
|
795
|
+
containerRef: h,
|
|
796
|
+
onHover: (e) => f("hover", e)
|
|
797
|
+
}), { svgRef: nt, items: rt, downloadLinkText: it, csvHref: at, resolvedFilename: ot } = he({
|
|
798
|
+
filename: () => l.filename,
|
|
799
|
+
legacyMenuLabel: () => l.menu,
|
|
800
|
+
getCsv: q,
|
|
801
|
+
downloadLink: () => l.downloadLink
|
|
791
802
|
});
|
|
792
|
-
return (
|
|
803
|
+
return (n, c) => (g(), a("div", {
|
|
793
804
|
ref_key: "containerRef",
|
|
794
|
-
ref:
|
|
805
|
+
ref: h,
|
|
795
806
|
class: "line-chart-wrapper"
|
|
796
807
|
}, [
|
|
797
|
-
|
|
808
|
+
t.menu ? (g(), r(ce, {
|
|
798
809
|
key: 0,
|
|
799
|
-
items: x(
|
|
800
|
-
}, null, 8, ["items"])) :
|
|
801
|
-
(
|
|
810
|
+
items: x(rt)
|
|
811
|
+
}, null, 8, ["items"])) : i("", !0),
|
|
812
|
+
(g(), a("svg", {
|
|
802
813
|
ref_key: "svgRef",
|
|
803
|
-
ref:
|
|
804
|
-
width:
|
|
814
|
+
ref: nt,
|
|
815
|
+
width: _.value,
|
|
805
816
|
height: V.value
|
|
806
817
|
}, [
|
|
807
|
-
|
|
818
|
+
t.title ? (g(), a("text", {
|
|
808
819
|
key: 0,
|
|
809
|
-
x:
|
|
820
|
+
x: _.value / 2,
|
|
810
821
|
y: 18,
|
|
811
822
|
"text-anchor": "middle",
|
|
812
823
|
"font-size": "14",
|
|
813
824
|
"font-weight": "600",
|
|
814
825
|
fill: "currentColor"
|
|
815
|
-
}, y(
|
|
816
|
-
B.value.length > 0 ? (
|
|
826
|
+
}, y(t.title), 9, ye)) : i("", !0),
|
|
827
|
+
B.value.length > 0 ? (g(), a("g", be, [(g(!0), a(e, null, v(B.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [t.type === "series" ? (g(), a("line", {
|
|
817
828
|
key: 0,
|
|
818
|
-
x1: x(
|
|
819
|
-
y1: x(
|
|
820
|
-
x2: x(
|
|
821
|
-
y2: x(
|
|
829
|
+
x1: x(S).left + n * 120,
|
|
830
|
+
y1: x(S).top - x(20) / 2,
|
|
831
|
+
x2: x(S).left + n * 120 + 12,
|
|
832
|
+
y2: x(S).top - x(20) / 2,
|
|
822
833
|
stroke: t.color,
|
|
823
834
|
"stroke-width": "2",
|
|
824
835
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
825
|
-
}, null, 8,
|
|
836
|
+
}, null, 8, $)) : (g(), a("circle", {
|
|
826
837
|
key: 1,
|
|
827
|
-
cx: x(
|
|
828
|
-
cy: x(
|
|
838
|
+
cx: x(S).left + n * 120 + 4,
|
|
839
|
+
cy: x(S).top - x(20) / 2,
|
|
829
840
|
r: "4",
|
|
830
841
|
fill: t.color,
|
|
831
842
|
"fill-opacity": t.fillOpacity,
|
|
832
843
|
stroke: t.color,
|
|
833
844
|
"stroke-width": "1.5"
|
|
834
|
-
}, null, 8,
|
|
835
|
-
x: x(
|
|
836
|
-
y: x(
|
|
845
|
+
}, null, 8, xe)), o("text", {
|
|
846
|
+
x: x(S).left + n * 120 + 18,
|
|
847
|
+
y: x(S).top - x(20) / 2 + 4,
|
|
837
848
|
"font-size": "11",
|
|
838
849
|
fill: "currentColor"
|
|
839
|
-
}, y(t.label), 9,
|
|
840
|
-
|
|
841
|
-
x1: x(
|
|
842
|
-
y1: x(
|
|
843
|
-
x2: x(
|
|
844
|
-
y2: x(
|
|
850
|
+
}, y(t.label), 9, Se)], 64))), 128))])) : i("", !0),
|
|
851
|
+
o("line", {
|
|
852
|
+
x1: x(H)(x(S).left),
|
|
853
|
+
y1: x(H)(x(S).top),
|
|
854
|
+
x2: x(H)(x(S).left),
|
|
855
|
+
y2: x(H)(x(S).top + x(w)),
|
|
845
856
|
stroke: "currentColor",
|
|
846
857
|
"stroke-opacity": "0.3"
|
|
847
|
-
}, null, 8,
|
|
848
|
-
|
|
849
|
-
x1: x(
|
|
850
|
-
y1: x(
|
|
851
|
-
x2: x(
|
|
852
|
-
y2: x(
|
|
858
|
+
}, null, 8, Ce),
|
|
859
|
+
o("line", {
|
|
860
|
+
x1: x(H)(x(S).left),
|
|
861
|
+
y1: x(H)(x(S).top + x(w)),
|
|
862
|
+
x2: x(H)(x(S).left + x(C)),
|
|
863
|
+
y2: x(H)(x(S).top + x(w)),
|
|
853
864
|
stroke: "currentColor",
|
|
854
865
|
"stroke-opacity": "0.3"
|
|
855
|
-
}, null, 8,
|
|
856
|
-
|
|
866
|
+
}, null, 8, we),
|
|
867
|
+
t.yGrid ? (g(!0), a(e, { key: 2 }, v(W.value, (e, t) => (g(), a("line", {
|
|
857
868
|
key: "yg" + t,
|
|
858
|
-
x1: x(
|
|
869
|
+
x1: x(S).left,
|
|
859
870
|
y1: e.y,
|
|
860
|
-
x2: x(
|
|
871
|
+
x2: x(S).left + x(C),
|
|
861
872
|
y2: e.y,
|
|
862
873
|
stroke: "currentColor",
|
|
863
874
|
"stroke-opacity": "0.1"
|
|
864
|
-
}, null, 8,
|
|
865
|
-
|
|
875
|
+
}, null, 8, Te))), 128)) : i("", !0),
|
|
876
|
+
t.xGrid ? (g(!0), a(e, { key: 3 }, v(le.value, (e, t) => (g(), a("line", {
|
|
866
877
|
key: "xg" + t,
|
|
867
878
|
x1: e.x,
|
|
868
|
-
y1: x(
|
|
879
|
+
y1: x(S).top,
|
|
869
880
|
x2: e.x,
|
|
870
|
-
y2: x(
|
|
881
|
+
y2: x(S).top + x(w),
|
|
871
882
|
stroke: "currentColor",
|
|
872
883
|
"stroke-opacity": "0.1"
|
|
873
|
-
}, null, 8,
|
|
874
|
-
(
|
|
884
|
+
}, null, 8, Ee))), 128)) : i("", !0),
|
|
885
|
+
(g(!0), a(e, null, v(W.value, (e, t) => (g(), a("text", {
|
|
875
886
|
key: "y" + t,
|
|
876
887
|
"data-testid": "y-tick",
|
|
877
|
-
x: x(
|
|
888
|
+
x: x(S).left - 6,
|
|
878
889
|
y: e.y,
|
|
879
890
|
"text-anchor": "end",
|
|
880
891
|
"dominant-baseline": "middle",
|
|
881
892
|
"font-size": "10",
|
|
882
893
|
fill: "currentColor",
|
|
883
894
|
"fill-opacity": "0.6"
|
|
884
|
-
}, y(e.value), 9,
|
|
885
|
-
|
|
895
|
+
}, y(e.value), 9, De))), 128)),
|
|
896
|
+
t.yLabel ? (g(), a("text", {
|
|
886
897
|
key: 4,
|
|
887
898
|
x: 0,
|
|
888
899
|
y: 0,
|
|
889
|
-
transform: `translate(14, ${x(
|
|
900
|
+
transform: `translate(14, ${x(S).top + x(w) / 2}) rotate(-90)`,
|
|
890
901
|
"text-anchor": "middle",
|
|
891
902
|
"font-size": "13",
|
|
892
903
|
fill: "currentColor"
|
|
893
|
-
}, y(
|
|
894
|
-
(
|
|
904
|
+
}, y(t.yLabel), 9, Oe)) : i("", !0),
|
|
905
|
+
(g(!0), a(e, null, v(le.value, (e, t) => (g(), a("text", {
|
|
895
906
|
key: "x" + t,
|
|
896
907
|
"data-testid": "x-tick",
|
|
897
908
|
x: e.x,
|
|
898
|
-
y: x(
|
|
909
|
+
y: x(S).top + x(w) + 16,
|
|
899
910
|
"text-anchor": e.anchor,
|
|
900
911
|
"font-size": "10",
|
|
901
912
|
fill: "currentColor",
|
|
902
913
|
"fill-opacity": "0.6"
|
|
903
|
-
}, y(e.value), 9,
|
|
904
|
-
|
|
914
|
+
}, y(e.value), 9, ke))), 128)),
|
|
915
|
+
t.xLabel ? (g(), a("text", {
|
|
905
916
|
key: 5,
|
|
906
|
-
x: x(
|
|
907
|
-
y:
|
|
917
|
+
x: x(S).left + x(C) / 2,
|
|
918
|
+
y: b.value - 4,
|
|
908
919
|
"text-anchor": "middle",
|
|
909
920
|
"font-size": "13",
|
|
910
921
|
fill: "currentColor"
|
|
911
|
-
}, y(
|
|
912
|
-
(
|
|
922
|
+
}, y(t.xLabel), 9, Ae)) : i("", !0),
|
|
923
|
+
(g(!0), a(e, null, v(k.value, (e, t) => (g(), a("path", {
|
|
913
924
|
key: "area" + t,
|
|
914
|
-
d:
|
|
925
|
+
d: oe(e),
|
|
915
926
|
fill: e.color ?? "currentColor",
|
|
916
927
|
"fill-opacity": e.opacity ?? .2,
|
|
917
928
|
stroke: "none"
|
|
918
|
-
}, null, 8,
|
|
919
|
-
(
|
|
929
|
+
}, null, 8, je))), 128)),
|
|
930
|
+
(g(!0), a(e, null, v(O.value, (n, r) => (g(), a(e, { key: r }, [n.line === !1 ? i("", !0) : (g(), a("path", {
|
|
920
931
|
key: 0,
|
|
921
|
-
d: ae(
|
|
932
|
+
d: ae(n),
|
|
922
933
|
fill: "none",
|
|
923
|
-
stroke:
|
|
924
|
-
"stroke-width":
|
|
925
|
-
"stroke-opacity":
|
|
926
|
-
"stroke-dasharray":
|
|
927
|
-
}, null, 8,
|
|
928
|
-
key:
|
|
934
|
+
stroke: n.color ?? "currentColor",
|
|
935
|
+
"stroke-width": n.strokeWidth ?? 1.5,
|
|
936
|
+
"stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
|
|
937
|
+
"stroke-dasharray": n.dashed ? "6 3" : void 0
|
|
938
|
+
}, null, 8, Me)), n.dots ? (g(!0), a(e, { key: 1 }, v(L(n), (e, r) => (g(), a("circle", {
|
|
939
|
+
key: r,
|
|
929
940
|
cx: e.x,
|
|
930
941
|
cy: e.y,
|
|
931
|
-
r:
|
|
932
|
-
fill:
|
|
933
|
-
"fill-opacity":
|
|
934
|
-
stroke:
|
|
935
|
-
}, null, 8,
|
|
936
|
-
(
|
|
937
|
-
|
|
942
|
+
r: n.dotRadius ?? (n.strokeWidth ?? 1.5) + 1,
|
|
943
|
+
fill: n.dotFill ?? n.color ?? "currentColor",
|
|
944
|
+
"fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
|
|
945
|
+
stroke: n.dotStroke ?? "none"
|
|
946
|
+
}, null, 8, Ne))), 128)) : i("", !0)], 64))), 128)),
|
|
947
|
+
(g(!0), a(e, null, v(t.areaSections ?? [], (t, n) => (g(), a(e, { key: "areasec" + n }, [
|
|
948
|
+
o("path", {
|
|
938
949
|
d: se(t),
|
|
939
|
-
fill: t.color ?? (t.seriesIndex == null ? "#999" :
|
|
950
|
+
fill: t.color ?? (t.seriesIndex == null ? "#999" : O.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
940
951
|
"fill-opacity": t.opacity ?? .15,
|
|
941
952
|
stroke: "none"
|
|
942
|
-
}, null, 8,
|
|
943
|
-
t.seriesIndex == null ?
|
|
953
|
+
}, null, 8, Pe),
|
|
954
|
+
t.seriesIndex == null ? i("", !0) : (g(), a("path", {
|
|
944
955
|
key: 0,
|
|
945
956
|
d: se(t, !1),
|
|
946
957
|
fill: "none",
|
|
947
|
-
stroke: t.color ??
|
|
958
|
+
stroke: t.color ?? O.value[t.seriesIndex]?.color ?? "currentColor",
|
|
948
959
|
"stroke-width": t.strokeWidth ?? 2,
|
|
949
960
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
950
|
-
}, null, 8,
|
|
951
|
-
t.seriesIndex == null ? (
|
|
952
|
-
x1: x(
|
|
953
|
-
y1: x(
|
|
954
|
-
x2: x(
|
|
955
|
-
y2: x(
|
|
961
|
+
}, null, 8, Fe)),
|
|
962
|
+
t.seriesIndex == null ? (g(), a(e, { key: 1 }, [o("line", {
|
|
963
|
+
x1: x(H)(R(t, "start")),
|
|
964
|
+
y1: x(S).top,
|
|
965
|
+
x2: x(H)(R(t, "start")),
|
|
966
|
+
y2: x(S).top + x(w),
|
|
956
967
|
stroke: t.color ?? "#999",
|
|
957
968
|
"stroke-width": t.strokeWidth ?? 2,
|
|
958
969
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
959
|
-
}, null, 8,
|
|
960
|
-
x1: x(
|
|
961
|
-
y1: x(
|
|
962
|
-
x2: x(
|
|
963
|
-
y2: x(
|
|
970
|
+
}, null, 8, Ie), o("line", {
|
|
971
|
+
x1: x(H)(R(t, "end")),
|
|
972
|
+
y1: x(S).top,
|
|
973
|
+
x2: x(H)(R(t, "end")),
|
|
974
|
+
y2: x(S).top + x(w),
|
|
964
975
|
stroke: t.color ?? "#999",
|
|
965
976
|
"stroke-width": t.strokeWidth ?? 2,
|
|
966
977
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
967
|
-
}, null, 8,
|
|
968
|
-
|
|
969
|
-
x1: x(
|
|
970
|
-
y1: x(
|
|
971
|
-
x2: x(
|
|
972
|
-
y2: x(
|
|
978
|
+
}, null, 8, Le)], 64)) : i("", !0),
|
|
979
|
+
o("line", {
|
|
980
|
+
x1: x(H)(R(t, "start")),
|
|
981
|
+
y1: x(S).top + x(w) - 4,
|
|
982
|
+
x2: x(H)(R(t, "start")),
|
|
983
|
+
y2: x(S).top + x(w) + 4,
|
|
973
984
|
stroke: "currentColor",
|
|
974
985
|
"stroke-opacity": "0.4"
|
|
975
|
-
}, null, 8,
|
|
976
|
-
|
|
977
|
-
x1: x(
|
|
978
|
-
y1: x(
|
|
979
|
-
x2: x(
|
|
980
|
-
y2: x(
|
|
986
|
+
}, null, 8, Re),
|
|
987
|
+
o("line", {
|
|
988
|
+
x1: x(H)(R(t, "end")),
|
|
989
|
+
y1: x(S).top + x(w) - 4,
|
|
990
|
+
x2: x(H)(R(t, "end")),
|
|
991
|
+
y2: x(S).top + x(w) + 4,
|
|
981
992
|
stroke: "currentColor",
|
|
982
993
|
"stroke-opacity": "0.4"
|
|
983
|
-
}, null, 8,
|
|
994
|
+
}, null, 8, ze)
|
|
984
995
|
], 64))), 128)),
|
|
985
|
-
|
|
996
|
+
J.value && x(Q) !== null ? (g(), a("line", {
|
|
986
997
|
key: 6,
|
|
987
|
-
x1: x(
|
|
988
|
-
y1: x(
|
|
989
|
-
x2: x(
|
|
990
|
-
y2: x(
|
|
998
|
+
x1: x(H)(pe.value),
|
|
999
|
+
y1: x(S).top,
|
|
1000
|
+
x2: x(H)(pe.value),
|
|
1001
|
+
y2: x(S).top + x(w),
|
|
991
1002
|
stroke: "currentColor",
|
|
992
1003
|
"stroke-opacity": "0.3",
|
|
993
1004
|
"stroke-dasharray": "4 2",
|
|
994
1005
|
"pointer-events": "none"
|
|
995
|
-
}, null, 8,
|
|
996
|
-
(
|
|
1006
|
+
}, null, 8, Be)) : i("", !0),
|
|
1007
|
+
(g(!0), a(e, null, v(me.value, (e, t) => (g(), a("circle", {
|
|
997
1008
|
key: "hd" + t,
|
|
998
1009
|
cx: e.x,
|
|
999
1010
|
cy: e.y,
|
|
@@ -1002,104 +1013,104 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
1002
1013
|
stroke: "var(--color-bg-0, #fff)",
|
|
1003
1014
|
"stroke-width": "2",
|
|
1004
1015
|
"pointer-events": "none"
|
|
1005
|
-
}, null, 8,
|
|
1006
|
-
|
|
1016
|
+
}, null, 8, Ve))), 128)),
|
|
1017
|
+
J.value ? (g(), a("rect", d({
|
|
1007
1018
|
key: 7,
|
|
1008
|
-
x: x(
|
|
1009
|
-
y: x(
|
|
1010
|
-
width: x(
|
|
1011
|
-
height: x(
|
|
1019
|
+
x: x(S).left,
|
|
1020
|
+
y: x(S).top,
|
|
1021
|
+
width: x(C),
|
|
1022
|
+
height: x(w),
|
|
1012
1023
|
fill: "transparent",
|
|
1013
1024
|
style: {
|
|
1014
1025
|
cursor: "crosshair",
|
|
1015
1026
|
"touch-action": "none"
|
|
1016
1027
|
}
|
|
1017
|
-
},
|
|
1018
|
-
(
|
|
1019
|
-
|
|
1028
|
+
}, ne(x(tt), !0)), null, 16, He)) : i("", !0),
|
|
1029
|
+
(g(!0), a(e, null, v(z.value.labels, (e, t) => (g(), a("g", { key: "seclab" + t }, [
|
|
1030
|
+
o("circle", {
|
|
1020
1031
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
1021
|
-
cy:
|
|
1032
|
+
cy: U.value + e.row * Ye + 4,
|
|
1022
1033
|
r: "4",
|
|
1023
1034
|
fill: e.color,
|
|
1024
1035
|
"fill-opacity": e.fillOpacity,
|
|
1025
1036
|
stroke: e.color,
|
|
1026
1037
|
"stroke-width": "1.5"
|
|
1027
|
-
}, null, 8,
|
|
1028
|
-
e.labelText ? (
|
|
1038
|
+
}, null, 8, Ue),
|
|
1039
|
+
e.labelText ? (g(), a("text", {
|
|
1029
1040
|
key: 0,
|
|
1030
1041
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1031
|
-
y:
|
|
1042
|
+
y: U.value + e.row * Ye + 8,
|
|
1032
1043
|
"font-size": "11",
|
|
1033
1044
|
"font-weight": "600",
|
|
1034
1045
|
fill: e.color
|
|
1035
|
-
}, y(e.labelText), 9,
|
|
1036
|
-
e.descText ? (
|
|
1046
|
+
}, y(e.labelText), 9, We)) : i("", !0),
|
|
1047
|
+
e.descText ? (g(), a("text", {
|
|
1037
1048
|
key: 1,
|
|
1038
1049
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1039
|
-
y:
|
|
1050
|
+
y: U.value + e.row * Ye + 22,
|
|
1040
1051
|
"font-size": "11",
|
|
1041
1052
|
fill: "currentColor",
|
|
1042
1053
|
"fill-opacity": "0.6"
|
|
1043
|
-
}, y(e.descText), 9,
|
|
1054
|
+
}, y(e.descText), 9, Ge)) : i("", !0)
|
|
1044
1055
|
]))), 128))
|
|
1045
|
-
], 8,
|
|
1046
|
-
|
|
1056
|
+
], 8, ve)),
|
|
1057
|
+
J.value && x(Q) !== null && Z.value ? (g(), a("div", {
|
|
1047
1058
|
key: 1,
|
|
1048
1059
|
ref_key: "tooltipRef",
|
|
1049
|
-
ref:
|
|
1060
|
+
ref: $e,
|
|
1050
1061
|
class: "chart-tooltip-content",
|
|
1051
|
-
style:
|
|
1062
|
+
style: m({
|
|
1052
1063
|
position: "absolute",
|
|
1053
1064
|
top: "0",
|
|
1054
1065
|
left: "0",
|
|
1055
1066
|
willChange: "transform",
|
|
1056
|
-
transform: x(
|
|
1057
|
-
visibility: x(
|
|
1067
|
+
transform: x(et) ? `translate3d(${x(et).left}px, ${x(et).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
1068
|
+
visibility: x(et) ? "visible" : "hidden"
|
|
1058
1069
|
})
|
|
1059
|
-
}, [
|
|
1070
|
+
}, [te(n.$slots, "tooltip", p(u(Z.value)), () => [o("div", Ke, [Z.value.xLabel ? (g(), a("div", qe, y(Z.value.xLabel), 1)) : i("", !0), (g(!0), a(e, null, v(Z.value.values, (e) => (g(), a("div", {
|
|
1060
1071
|
key: e.seriesIndex,
|
|
1061
1072
|
class: "line-chart-tooltip-row"
|
|
1062
|
-
}, [
|
|
1073
|
+
}, [o("span", {
|
|
1063
1074
|
class: "line-chart-tooltip-swatch",
|
|
1064
|
-
style:
|
|
1065
|
-
}, null, 4),
|
|
1066
|
-
x(
|
|
1075
|
+
style: m({ background: e.color })
|
|
1076
|
+
}, null, 4), s(" " + y(isFinite(e.value) ? D(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1077
|
+
x(it) ? (g(), a("a", {
|
|
1067
1078
|
key: 2,
|
|
1068
1079
|
class: "line-chart-download-link",
|
|
1069
|
-
href: x(
|
|
1070
|
-
download: `${x(
|
|
1071
|
-
}, y(x(
|
|
1080
|
+
href: x(at),
|
|
1081
|
+
download: `${x(ot)()}.csv`
|
|
1082
|
+
}, y(x(it)), 9, Je)) : i("", !0)
|
|
1072
1083
|
], 512));
|
|
1073
1084
|
}
|
|
1074
|
-
}), [["__scopeId", "data-v-
|
|
1085
|
+
}), [["__scopeId", "data-v-083d1c2f"]]), et = ["width", "height"], tt = ["x"], nt = { key: 1 }, rt = [
|
|
1075
1086
|
"x",
|
|
1076
1087
|
"y",
|
|
1077
1088
|
"fill"
|
|
1078
|
-
],
|
|
1089
|
+
], it = ["x", "y"], at = [
|
|
1079
1090
|
"x1",
|
|
1080
1091
|
"y1",
|
|
1081
1092
|
"x2",
|
|
1082
1093
|
"y2"
|
|
1083
|
-
],
|
|
1094
|
+
], ot = [
|
|
1084
1095
|
"x1",
|
|
1085
1096
|
"y1",
|
|
1086
1097
|
"x2",
|
|
1087
1098
|
"y2"
|
|
1088
|
-
],
|
|
1099
|
+
], st = [
|
|
1089
1100
|
"x1",
|
|
1090
1101
|
"y1",
|
|
1091
1102
|
"x2",
|
|
1092
1103
|
"y2"
|
|
1093
|
-
],
|
|
1104
|
+
], ct = [
|
|
1094
1105
|
"x",
|
|
1095
1106
|
"y",
|
|
1096
1107
|
"width",
|
|
1097
1108
|
"height"
|
|
1098
|
-
],
|
|
1109
|
+
], lt = ["x", "y"], ut = ["x", "y"], dt = ["transform"], ft = [
|
|
1099
1110
|
"x",
|
|
1100
1111
|
"y",
|
|
1101
1112
|
"text-anchor"
|
|
1102
|
-
],
|
|
1113
|
+
], pt = ["x", "y"], mt = ["x", "y"], ht = [
|
|
1103
1114
|
"data-category",
|
|
1104
1115
|
"data-series",
|
|
1105
1116
|
"x",
|
|
@@ -1108,15 +1119,15 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
1108
1119
|
"height",
|
|
1109
1120
|
"fill",
|
|
1110
1121
|
"fill-opacity"
|
|
1111
|
-
],
|
|
1122
|
+
], gt = [
|
|
1112
1123
|
"x",
|
|
1113
1124
|
"y",
|
|
1114
1125
|
"width",
|
|
1115
1126
|
"height"
|
|
1116
|
-
],
|
|
1127
|
+
], _t = { class: "bar-chart-tooltip" }, vt = {
|
|
1117
1128
|
key: 0,
|
|
1118
1129
|
class: "bar-chart-tooltip-label"
|
|
1119
|
-
},
|
|
1130
|
+
}, yt = ["href", "download"], bt = /* @__PURE__ */ V(/* @__PURE__ */ l({
|
|
1120
1131
|
__name: "BarChart",
|
|
1121
1132
|
props: {
|
|
1122
1133
|
data: {},
|
|
@@ -1133,6 +1144,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
1133
1144
|
valueMin: { default: 0 },
|
|
1134
1145
|
valueTicks: {},
|
|
1135
1146
|
valueTickFormat: {},
|
|
1147
|
+
tooltipValueFormat: {},
|
|
1136
1148
|
categoryFormat: {},
|
|
1137
1149
|
barPadding: { default: .2 },
|
|
1138
1150
|
groupGap: { default: 1 },
|
|
@@ -1153,38 +1165,38 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
1153
1165
|
downloadLink: { type: [Boolean, String] }
|
|
1154
1166
|
},
|
|
1155
1167
|
emits: ["hover"],
|
|
1156
|
-
setup(
|
|
1157
|
-
let
|
|
1158
|
-
title: () =>
|
|
1159
|
-
xLabel: () =>
|
|
1160
|
-
yLabel: () =>
|
|
1161
|
-
hasInlineLegend: () =>
|
|
1162
|
-
width: () =>
|
|
1163
|
-
height: () =>
|
|
1164
|
-
}),
|
|
1168
|
+
setup(t, { emit: c }) {
|
|
1169
|
+
let l = t, f = c, { containerRef: h, measuredWidth: ee } = ue({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => D.value.some((e) => e.legend)), { padding: S, innerW: C, innerH: w } = de({
|
|
1170
|
+
title: () => l.title,
|
|
1171
|
+
xLabel: () => l.xLabel,
|
|
1172
|
+
yLabel: () => l.yLabel,
|
|
1173
|
+
hasInlineLegend: () => re.value,
|
|
1174
|
+
width: () => _.value,
|
|
1175
|
+
height: () => b.value
|
|
1176
|
+
}), T = [];
|
|
1165
1177
|
function E(e) {
|
|
1166
1178
|
return {
|
|
1167
|
-
data: e.y ?? e.data ??
|
|
1179
|
+
data: e.y ?? e.data ?? T,
|
|
1168
1180
|
color: e.color,
|
|
1169
1181
|
opacity: e.opacity,
|
|
1170
1182
|
legend: e.legend
|
|
1171
1183
|
};
|
|
1172
1184
|
}
|
|
1173
|
-
let D =
|
|
1174
|
-
if (
|
|
1175
|
-
let e =
|
|
1185
|
+
let D = n(() => {
|
|
1186
|
+
if (l.series && l.series.length > 0) return l.series.map(E);
|
|
1187
|
+
let e = l.y ?? l.data;
|
|
1176
1188
|
return e ? [{ data: e }] : [];
|
|
1177
|
-
}), O =
|
|
1178
|
-
let e =
|
|
1189
|
+
}), O = n(() => {
|
|
1190
|
+
let e = l.categories?.length ?? 0;
|
|
1179
1191
|
for (let t of D.value) t.data.length > e && (e = t.data.length);
|
|
1180
1192
|
return e;
|
|
1181
|
-
}), k =
|
|
1193
|
+
}), k = n(() => {
|
|
1182
1194
|
let e = O.value, t = Array(e);
|
|
1183
|
-
for (let n = 0; n < e; n++) t[n] =
|
|
1195
|
+
for (let n = 0; n < e; n++) t[n] = l.categories?.[n] ?? String(n);
|
|
1184
1196
|
return t;
|
|
1185
|
-
}), A =
|
|
1197
|
+
}), A = n(() => l.orientation === "vertical"), j = n(() => {
|
|
1186
1198
|
let e = Infinity, t = -Infinity;
|
|
1187
|
-
if (
|
|
1199
|
+
if (l.layout === "stacked") {
|
|
1188
1200
|
let n = O.value;
|
|
1189
1201
|
for (let r = 0; r < n; r++) {
|
|
1190
1202
|
let n = 0, i = 0;
|
|
@@ -1200,7 +1212,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
1200
1212
|
isFinite(n) && (n < e && (e = n), n > t && (t = n));
|
|
1201
1213
|
}
|
|
1202
1214
|
isFinite(e) || (e = 0), isFinite(t) || (t = 0);
|
|
1203
|
-
let n =
|
|
1215
|
+
let n = l.valueMin ?? 0;
|
|
1204
1216
|
n < e && (e = n);
|
|
1205
1217
|
let r = t - e || 1;
|
|
1206
1218
|
return {
|
|
@@ -1208,28 +1220,28 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
1208
1220
|
max: t,
|
|
1209
1221
|
range: r
|
|
1210
1222
|
};
|
|
1211
|
-
}), M =
|
|
1223
|
+
}), M = n(() => A.value ? C.value : w.value), N = n(() => A.value ? w.value : C.value), P = n(() => {
|
|
1212
1224
|
let e = O.value;
|
|
1213
1225
|
return e > 0 ? M.value / e : 0;
|
|
1214
|
-
}),
|
|
1226
|
+
}), ie = n(() => P.value * (1 - l.barPadding)), F = n(() => {
|
|
1215
1227
|
let e = D.value.length;
|
|
1216
1228
|
if (e === 0) return 0;
|
|
1217
|
-
if (
|
|
1218
|
-
let t =
|
|
1219
|
-
return Math.max(1, (
|
|
1229
|
+
if (l.layout === "stacked" || e === 1) return ie.value;
|
|
1230
|
+
let t = l.groupGap * (e - 1);
|
|
1231
|
+
return Math.max(1, (ie.value - t) / e);
|
|
1220
1232
|
});
|
|
1221
|
-
function
|
|
1222
|
-
return (A.value ?
|
|
1233
|
+
function I(e) {
|
|
1234
|
+
return (A.value ? S.value.left : S.value.top) + e * P.value;
|
|
1223
1235
|
}
|
|
1224
|
-
let
|
|
1225
|
-
let { min: e, max: t } = j.value, n =
|
|
1226
|
-
return
|
|
1236
|
+
let ae = n(() => {
|
|
1237
|
+
let { min: e, max: t } = j.value, n = l.valueMin ?? 0;
|
|
1238
|
+
return L(Math.max(e, Math.min(t, n)));
|
|
1227
1239
|
});
|
|
1228
|
-
function
|
|
1229
|
-
let { min: t, range: n } = j.value, r =
|
|
1230
|
-
return A.value ?
|
|
1240
|
+
function L(e) {
|
|
1241
|
+
let { min: t, range: n } = j.value, r = N.value / n;
|
|
1242
|
+
return A.value ? S.value.top + w.value - (e - t) * r : S.value.left + (e - t) * r;
|
|
1231
1243
|
}
|
|
1232
|
-
function
|
|
1244
|
+
function oe(e, t, n, r, i, a, o, s, c) {
|
|
1233
1245
|
let l = Math.min(e, t), u = Math.abs(e - t);
|
|
1234
1246
|
return A.value ? {
|
|
1235
1247
|
x: n,
|
|
@@ -1253,29 +1265,29 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
1253
1265
|
seriesIndex: c
|
|
1254
1266
|
};
|
|
1255
1267
|
}
|
|
1256
|
-
let
|
|
1268
|
+
let R = n(() => {
|
|
1257
1269
|
let e = [], t = D.value, n = t.length;
|
|
1258
1270
|
if (n === 0) return e;
|
|
1259
|
-
let r = O.value, i =
|
|
1271
|
+
let r = O.value, i = P.value, a = ie.value, o = F.value, s = (i - a) / 2, c = ae.value;
|
|
1260
1272
|
for (let i = 0; i < r; i++) {
|
|
1261
|
-
let r =
|
|
1262
|
-
if (
|
|
1273
|
+
let r = I(i) + s;
|
|
1274
|
+
if (l.layout === "stacked") {
|
|
1263
1275
|
let o = 0, s = 0;
|
|
1264
1276
|
for (let c = 0; c < n; c++) {
|
|
1265
1277
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
1266
1278
|
if (!isFinite(l)) continue;
|
|
1267
1279
|
let u = l >= 0 ? o : s, d = u + l;
|
|
1268
|
-
e.push(L(
|
|
1280
|
+
e.push(oe(L(u), L(d), r, a, n.color ?? z(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
|
|
1269
1281
|
}
|
|
1270
1282
|
} else for (let a = 0; a < n; a++) {
|
|
1271
|
-
let s = t[a],
|
|
1272
|
-
if (!isFinite(
|
|
1273
|
-
let
|
|
1274
|
-
e.push(
|
|
1283
|
+
let s = t[a], u = Number(s.data[i] ?? NaN);
|
|
1284
|
+
if (!isFinite(u)) continue;
|
|
1285
|
+
let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
|
|
1286
|
+
e.push(oe(c, L(u), d, o, s.color ?? z(a), s.opacity ?? 1, u, i, a));
|
|
1275
1287
|
}
|
|
1276
1288
|
}
|
|
1277
1289
|
return e;
|
|
1278
|
-
}),
|
|
1290
|
+
}), se = [
|
|
1279
1291
|
"var(--color-primary, #3b82f6)",
|
|
1280
1292
|
"var(--color-accent, #f59e0b)",
|
|
1281
1293
|
"var(--color-success, #10b981)",
|
|
@@ -1283,29 +1295,32 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
1283
1295
|
"var(--color-info, #6366f1)",
|
|
1284
1296
|
"var(--color-warning, #d97706)"
|
|
1285
1297
|
];
|
|
1298
|
+
function z(e) {
|
|
1299
|
+
return se[e % se.length];
|
|
1300
|
+
}
|
|
1286
1301
|
function B(e) {
|
|
1287
|
-
return
|
|
1302
|
+
return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.valueTickFormat ? l.valueTickFormat(e) : G(e);
|
|
1288
1303
|
}
|
|
1289
|
-
let V =
|
|
1290
|
-
let { min: e, max: t } = j.value, n = (e) =>
|
|
1304
|
+
let V = n(() => {
|
|
1305
|
+
let { min: e, max: t } = j.value, n = (e) => l.valueTickFormat ? l.valueTickFormat(e) : G(e);
|
|
1291
1306
|
if (e === t) return [{
|
|
1292
1307
|
value: n(e),
|
|
1293
|
-
pos:
|
|
1308
|
+
pos: H(L(e))
|
|
1294
1309
|
}];
|
|
1295
1310
|
let r = A.value ? 50 : 80;
|
|
1296
|
-
return
|
|
1311
|
+
return K({
|
|
1297
1312
|
min: e,
|
|
1298
1313
|
max: t,
|
|
1299
|
-
ticks:
|
|
1300
|
-
targetTickCount:
|
|
1314
|
+
ticks: l.valueTicks,
|
|
1315
|
+
targetTickCount: N.value / r
|
|
1301
1316
|
}).map((e) => ({
|
|
1302
1317
|
value: n(e),
|
|
1303
|
-
pos:
|
|
1318
|
+
pos: H(L(e))
|
|
1304
1319
|
}));
|
|
1305
|
-
}),
|
|
1306
|
-
let e = [], t = O.value, n = (e, t) =>
|
|
1320
|
+
}), U = n(() => {
|
|
1321
|
+
let e = [], t = O.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
|
|
1307
1322
|
for (let r = 0; r < t; r++) {
|
|
1308
|
-
let t =
|
|
1323
|
+
let t = I(r) + P.value / 2;
|
|
1309
1324
|
e.push({
|
|
1310
1325
|
label: n(k.value[r], r),
|
|
1311
1326
|
pos: t,
|
|
@@ -1313,205 +1328,205 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
1313
1328
|
});
|
|
1314
1329
|
}
|
|
1315
1330
|
return e;
|
|
1316
|
-
}),
|
|
1331
|
+
}), W = n(() => {
|
|
1317
1332
|
let e = [];
|
|
1318
1333
|
return D.value.forEach((t, n) => {
|
|
1319
1334
|
t.legend && e.push({
|
|
1320
1335
|
label: t.legend,
|
|
1321
|
-
color: t.color ??
|
|
1336
|
+
color: t.color ?? z(n)
|
|
1322
1337
|
});
|
|
1323
1338
|
}), e;
|
|
1324
1339
|
});
|
|
1325
|
-
function
|
|
1326
|
-
if (typeof
|
|
1327
|
-
if (typeof
|
|
1340
|
+
function le() {
|
|
1341
|
+
if (typeof l.csv == "function") return l.csv();
|
|
1342
|
+
if (typeof l.csv == "string") return l.csv;
|
|
1328
1343
|
let e = D.value.map((e) => ({
|
|
1329
1344
|
label: e.legend,
|
|
1330
1345
|
data: e.data
|
|
1331
1346
|
}));
|
|
1332
|
-
return
|
|
1347
|
+
return _e(k.value, e);
|
|
1333
1348
|
}
|
|
1334
|
-
let
|
|
1335
|
-
function
|
|
1336
|
-
let n =
|
|
1349
|
+
let q = n(() => !!l.tooltipData || !!l.tooltipTrigger);
|
|
1350
|
+
function J(e, t) {
|
|
1351
|
+
let n = h.value?.getBoundingClientRect();
|
|
1337
1352
|
if (!n) return null;
|
|
1338
1353
|
let r = O.value;
|
|
1339
|
-
if (r === 0 ||
|
|
1340
|
-
let i = A.value ? e - n.left -
|
|
1341
|
-
return Math.max(0, Math.min(r - 1, Math.floor(i /
|
|
1354
|
+
if (r === 0 || P.value === 0) return null;
|
|
1355
|
+
let i = A.value ? e - n.left - S.value.left : t - n.top - S.value.top;
|
|
1356
|
+
return Math.max(0, Math.min(r - 1, Math.floor(i / P.value)));
|
|
1342
1357
|
}
|
|
1343
|
-
let { hoverIndex:
|
|
1344
|
-
enabled: () =>
|
|
1345
|
-
trigger: () =>
|
|
1346
|
-
clamp: () =>
|
|
1347
|
-
pointerToIndex:
|
|
1348
|
-
containerRef:
|
|
1349
|
-
onHover: (e) =>
|
|
1350
|
-
}), { svgRef:
|
|
1351
|
-
filename: () =>
|
|
1352
|
-
legacyMenuLabel: () =>
|
|
1353
|
-
getCsv:
|
|
1354
|
-
downloadLink: () =>
|
|
1355
|
-
}),
|
|
1356
|
-
let e =
|
|
1358
|
+
let { hoverIndex: Y, tooltipRef: pe, tooltipPos: X, handlers: me } = fe({
|
|
1359
|
+
enabled: () => q.value,
|
|
1360
|
+
trigger: () => l.tooltipTrigger,
|
|
1361
|
+
clamp: () => l.tooltipClamp,
|
|
1362
|
+
pointerToIndex: J,
|
|
1363
|
+
containerRef: h,
|
|
1364
|
+
onHover: (e) => f("hover", e)
|
|
1365
|
+
}), { svgRef: Z, items: ge, downloadLinkText: Q, csvHref: ve, resolvedFilename: ye } = he({
|
|
1366
|
+
filename: () => l.filename,
|
|
1367
|
+
legacyMenuLabel: () => l.menu,
|
|
1368
|
+
getCsv: le,
|
|
1369
|
+
downloadLink: () => l.downloadLink
|
|
1370
|
+
}), be = n(() => {
|
|
1371
|
+
let e = Y.value;
|
|
1357
1372
|
if (e !== null) return k.value[e];
|
|
1358
|
-
}),
|
|
1359
|
-
let e =
|
|
1373
|
+
}), $ = n(() => {
|
|
1374
|
+
let e = Y.value;
|
|
1360
1375
|
return e === null ? null : {
|
|
1361
1376
|
index: e,
|
|
1362
1377
|
category: k.value[e] ?? String(e),
|
|
1363
1378
|
values: D.value.map((t, n) => ({
|
|
1364
1379
|
value: Number(t.data[e] ?? NaN),
|
|
1365
|
-
color: t.color ??
|
|
1380
|
+
color: t.color ?? z(n),
|
|
1366
1381
|
seriesIndex: n
|
|
1367
1382
|
})),
|
|
1368
|
-
data:
|
|
1383
|
+
data: l.tooltipData?.[e] ?? null
|
|
1369
1384
|
};
|
|
1370
|
-
}),
|
|
1371
|
-
let e =
|
|
1385
|
+
}), xe = n(() => {
|
|
1386
|
+
let e = Y.value;
|
|
1372
1387
|
if (e === null) return null;
|
|
1373
|
-
let t =
|
|
1388
|
+
let t = I(e);
|
|
1374
1389
|
return A.value ? {
|
|
1375
1390
|
x: t,
|
|
1376
|
-
y:
|
|
1377
|
-
w:
|
|
1378
|
-
h:
|
|
1391
|
+
y: S.value.top,
|
|
1392
|
+
w: P.value,
|
|
1393
|
+
h: w.value
|
|
1379
1394
|
} : {
|
|
1380
|
-
x:
|
|
1395
|
+
x: S.value.left,
|
|
1381
1396
|
y: t,
|
|
1382
|
-
w:
|
|
1383
|
-
h:
|
|
1397
|
+
w: C.value,
|
|
1398
|
+
h: P.value
|
|
1384
1399
|
};
|
|
1385
1400
|
});
|
|
1386
|
-
return (
|
|
1401
|
+
return (n, c) => (g(), a("div", {
|
|
1387
1402
|
ref_key: "containerRef",
|
|
1388
|
-
ref:
|
|
1403
|
+
ref: h,
|
|
1389
1404
|
class: "bar-chart-wrapper"
|
|
1390
1405
|
}, [
|
|
1391
|
-
|
|
1406
|
+
t.menu ? (g(), r(ce, {
|
|
1392
1407
|
key: 0,
|
|
1393
|
-
items: x(
|
|
1394
|
-
}, null, 8, ["items"])) :
|
|
1395
|
-
(
|
|
1408
|
+
items: x(ge)
|
|
1409
|
+
}, null, 8, ["items"])) : i("", !0),
|
|
1410
|
+
(g(), a("svg", {
|
|
1396
1411
|
ref_key: "svgRef",
|
|
1397
|
-
ref:
|
|
1398
|
-
width:
|
|
1399
|
-
height:
|
|
1412
|
+
ref: Z,
|
|
1413
|
+
width: _.value,
|
|
1414
|
+
height: b.value
|
|
1400
1415
|
}, [
|
|
1401
|
-
|
|
1416
|
+
t.title ? (g(), a("text", {
|
|
1402
1417
|
key: 0,
|
|
1403
|
-
x:
|
|
1418
|
+
x: _.value / 2,
|
|
1404
1419
|
y: 18,
|
|
1405
1420
|
"text-anchor": "middle",
|
|
1406
1421
|
"font-size": "14",
|
|
1407
1422
|
"font-weight": "600",
|
|
1408
1423
|
fill: "currentColor"
|
|
1409
|
-
}, y(
|
|
1410
|
-
|
|
1411
|
-
x: x(
|
|
1412
|
-
y: x(
|
|
1424
|
+
}, y(t.title), 9, tt)) : i("", !0),
|
|
1425
|
+
W.value.length > 0 ? (g(), a("g", nt, [(g(!0), a(e, null, v(W.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [o("rect", {
|
|
1426
|
+
x: x(S).left + n * 120,
|
|
1427
|
+
y: x(S).top - x(20) / 2 - 5,
|
|
1413
1428
|
width: "12",
|
|
1414
1429
|
height: "10",
|
|
1415
1430
|
fill: t.color
|
|
1416
|
-
}, null, 8,
|
|
1417
|
-
x: x(
|
|
1418
|
-
y: x(
|
|
1431
|
+
}, null, 8, rt), o("text", {
|
|
1432
|
+
x: x(S).left + n * 120 + 18,
|
|
1433
|
+
y: x(S).top - x(20) / 2 + 4,
|
|
1419
1434
|
"font-size": "11",
|
|
1420
1435
|
fill: "currentColor"
|
|
1421
|
-
}, y(t.label), 9,
|
|
1422
|
-
|
|
1423
|
-
x1: x(
|
|
1424
|
-
y1: x(
|
|
1425
|
-
x2: x(
|
|
1426
|
-
y2: x(
|
|
1436
|
+
}, y(t.label), 9, it)], 64))), 128))])) : i("", !0),
|
|
1437
|
+
o("line", {
|
|
1438
|
+
x1: x(H)(x(S).left),
|
|
1439
|
+
y1: x(H)(x(S).top),
|
|
1440
|
+
x2: x(H)(x(S).left),
|
|
1441
|
+
y2: x(H)(x(S).top + x(w)),
|
|
1427
1442
|
stroke: "currentColor",
|
|
1428
1443
|
"stroke-opacity": "0.3"
|
|
1429
|
-
}, null, 8,
|
|
1430
|
-
|
|
1431
|
-
x1: x(
|
|
1432
|
-
y1: x(
|
|
1433
|
-
x2: x(
|
|
1434
|
-
y2: x(
|
|
1444
|
+
}, null, 8, at),
|
|
1445
|
+
o("line", {
|
|
1446
|
+
x1: x(H)(x(S).left),
|
|
1447
|
+
y1: x(H)(x(S).top + x(w)),
|
|
1448
|
+
x2: x(H)(x(S).left + x(C)),
|
|
1449
|
+
y2: x(H)(x(S).top + x(w)),
|
|
1435
1450
|
stroke: "currentColor",
|
|
1436
1451
|
"stroke-opacity": "0.3"
|
|
1437
|
-
}, null, 8,
|
|
1438
|
-
|
|
1452
|
+
}, null, 8, ot),
|
|
1453
|
+
t.valueGrid ? (g(!0), a(e, { key: 2 }, v(V.value, (e, t) => (g(), a("line", {
|
|
1439
1454
|
key: "vg" + t,
|
|
1440
|
-
x1: A.value ? x(
|
|
1441
|
-
y1: A.value ? e.pos : x(
|
|
1442
|
-
x2: A.value ? x(
|
|
1443
|
-
y2: A.value ? e.pos : x(
|
|
1455
|
+
x1: A.value ? x(S).left : e.pos,
|
|
1456
|
+
y1: A.value ? e.pos : x(S).top,
|
|
1457
|
+
x2: A.value ? x(S).left + x(C) : e.pos,
|
|
1458
|
+
y2: A.value ? e.pos : x(S).top + x(w),
|
|
1444
1459
|
stroke: "currentColor",
|
|
1445
1460
|
"stroke-opacity": "0.1"
|
|
1446
|
-
}, null, 8,
|
|
1447
|
-
|
|
1461
|
+
}, null, 8, st))), 128)) : i("", !0),
|
|
1462
|
+
xe.value && q.value ? (g(), a("rect", {
|
|
1448
1463
|
key: 3,
|
|
1449
|
-
x:
|
|
1450
|
-
y:
|
|
1451
|
-
width:
|
|
1452
|
-
height:
|
|
1464
|
+
x: xe.value.x,
|
|
1465
|
+
y: xe.value.y,
|
|
1466
|
+
width: xe.value.w,
|
|
1467
|
+
height: xe.value.h,
|
|
1453
1468
|
fill: "currentColor",
|
|
1454
1469
|
"fill-opacity": "0.06",
|
|
1455
1470
|
"pointer-events": "none"
|
|
1456
|
-
}, null, 8,
|
|
1457
|
-
A.value ? (
|
|
1471
|
+
}, null, 8, ct)) : i("", !0),
|
|
1472
|
+
A.value ? (g(!0), a(e, { key: 4 }, v(V.value, (e, t) => (g(), a("text", {
|
|
1458
1473
|
key: "vt" + t,
|
|
1459
1474
|
"data-testid": "value-tick",
|
|
1460
|
-
x: x(
|
|
1475
|
+
x: x(S).left - 6,
|
|
1461
1476
|
y: e.pos,
|
|
1462
1477
|
"text-anchor": "end",
|
|
1463
1478
|
"dominant-baseline": "middle",
|
|
1464
1479
|
"font-size": "10",
|
|
1465
1480
|
fill: "currentColor",
|
|
1466
1481
|
"fill-opacity": "0.6"
|
|
1467
|
-
}, y(e.value), 9,
|
|
1482
|
+
}, y(e.value), 9, lt))), 128)) : (g(!0), a(e, { key: 5 }, v(V.value, (e, t) => (g(), a("text", {
|
|
1468
1483
|
key: "vt" + t,
|
|
1469
1484
|
"data-testid": "value-tick",
|
|
1470
1485
|
x: e.pos,
|
|
1471
|
-
y: x(
|
|
1486
|
+
y: x(S).top + x(w) + 16,
|
|
1472
1487
|
"text-anchor": "middle",
|
|
1473
1488
|
"font-size": "10",
|
|
1474
1489
|
fill: "currentColor",
|
|
1475
1490
|
"fill-opacity": "0.6"
|
|
1476
|
-
}, y(e.value), 9,
|
|
1477
|
-
|
|
1491
|
+
}, y(e.value), 9, ut))), 128)),
|
|
1492
|
+
t.yLabel ? (g(), a("text", {
|
|
1478
1493
|
key: 6,
|
|
1479
1494
|
x: 0,
|
|
1480
1495
|
y: 0,
|
|
1481
|
-
transform: `translate(14, ${x(
|
|
1496
|
+
transform: `translate(14, ${x(S).top + x(w) / 2}) rotate(-90)`,
|
|
1482
1497
|
"text-anchor": "middle",
|
|
1483
1498
|
"font-size": "13",
|
|
1484
1499
|
fill: "currentColor"
|
|
1485
|
-
}, y(
|
|
1486
|
-
A.value ? (
|
|
1500
|
+
}, y(t.yLabel), 9, dt)) : i("", !0),
|
|
1501
|
+
A.value ? (g(!0), a(e, { key: 7 }, v(U.value, (e, t) => (g(), a("text", {
|
|
1487
1502
|
key: "ct" + t,
|
|
1488
1503
|
"data-testid": "category-tick",
|
|
1489
1504
|
x: e.pos,
|
|
1490
|
-
y: x(
|
|
1505
|
+
y: x(S).top + x(w) + 16,
|
|
1491
1506
|
"text-anchor": e.anchor,
|
|
1492
1507
|
"font-size": "10",
|
|
1493
1508
|
fill: "currentColor",
|
|
1494
1509
|
"fill-opacity": "0.6"
|
|
1495
|
-
}, y(e.label), 9,
|
|
1510
|
+
}, y(e.label), 9, ft))), 128)) : (g(!0), a(e, { key: 8 }, v(U.value, (e, t) => (g(), a("text", {
|
|
1496
1511
|
key: "ct" + t,
|
|
1497
1512
|
"data-testid": "category-tick",
|
|
1498
|
-
x: x(
|
|
1513
|
+
x: x(S).left - 6,
|
|
1499
1514
|
y: e.pos,
|
|
1500
1515
|
"text-anchor": "end",
|
|
1501
1516
|
"dominant-baseline": "middle",
|
|
1502
1517
|
"font-size": "10",
|
|
1503
1518
|
fill: "currentColor",
|
|
1504
1519
|
"fill-opacity": "0.6"
|
|
1505
|
-
}, y(e.label), 9,
|
|
1506
|
-
|
|
1520
|
+
}, y(e.label), 9, pt))), 128)),
|
|
1521
|
+
t.xLabel ? (g(), a("text", {
|
|
1507
1522
|
key: 9,
|
|
1508
|
-
x: x(
|
|
1509
|
-
y:
|
|
1523
|
+
x: x(S).left + x(C) / 2,
|
|
1524
|
+
y: b.value - 4,
|
|
1510
1525
|
"text-anchor": "middle",
|
|
1511
1526
|
"font-size": "13",
|
|
1512
1527
|
fill: "currentColor"
|
|
1513
|
-
}, y(
|
|
1514
|
-
(
|
|
1528
|
+
}, y(t.xLabel), 9, mt)) : i("", !0),
|
|
1529
|
+
(g(!0), a(e, null, v(R.value, (e, t) => (g(), a("rect", {
|
|
1515
1530
|
key: "bar" + t,
|
|
1516
1531
|
"data-testid": "bar",
|
|
1517
1532
|
"data-category": e.categoryIndex,
|
|
@@ -1522,49 +1537,49 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
1522
1537
|
height: e.h,
|
|
1523
1538
|
fill: e.color,
|
|
1524
1539
|
"fill-opacity": e.opacity
|
|
1525
|
-
}, null, 8,
|
|
1526
|
-
|
|
1540
|
+
}, null, 8, ht))), 128)),
|
|
1541
|
+
q.value ? (g(), a("rect", d({
|
|
1527
1542
|
key: 10,
|
|
1528
|
-
x: x(
|
|
1529
|
-
y: x(
|
|
1530
|
-
width: x(
|
|
1531
|
-
height: x(
|
|
1543
|
+
x: x(S).left,
|
|
1544
|
+
y: x(S).top,
|
|
1545
|
+
width: x(C),
|
|
1546
|
+
height: x(w),
|
|
1532
1547
|
fill: "transparent",
|
|
1533
1548
|
style: {
|
|
1534
1549
|
cursor: "crosshair",
|
|
1535
1550
|
"touch-action": "none"
|
|
1536
1551
|
}
|
|
1537
|
-
},
|
|
1538
|
-
], 8,
|
|
1539
|
-
|
|
1552
|
+
}, ne(x(me), !0)), null, 16, gt)) : i("", !0)
|
|
1553
|
+
], 8, et)),
|
|
1554
|
+
q.value && x(Y) !== null && $.value ? (g(), a("div", {
|
|
1540
1555
|
key: 1,
|
|
1541
1556
|
ref_key: "tooltipRef",
|
|
1542
|
-
ref:
|
|
1557
|
+
ref: pe,
|
|
1543
1558
|
class: "chart-tooltip-content",
|
|
1544
|
-
style:
|
|
1559
|
+
style: m({
|
|
1545
1560
|
position: "absolute",
|
|
1546
1561
|
top: "0",
|
|
1547
1562
|
left: "0",
|
|
1548
1563
|
willChange: "transform",
|
|
1549
|
-
transform: x(
|
|
1550
|
-
visibility: x(
|
|
1564
|
+
transform: x(X) ? `translate3d(${x(X).left}px, ${x(X).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
1565
|
+
visibility: x(X) ? "visible" : "hidden"
|
|
1551
1566
|
})
|
|
1552
|
-
}, [
|
|
1567
|
+
}, [te(n.$slots, "tooltip", p(u($.value)), () => [o("div", _t, [be.value ? (g(), a("div", vt, y(be.value), 1)) : i("", !0), (g(!0), a(e, null, v($.value.values, (e) => (g(), a("div", {
|
|
1553
1568
|
key: e.seriesIndex,
|
|
1554
1569
|
class: "bar-chart-tooltip-row"
|
|
1555
|
-
}, [
|
|
1570
|
+
}, [o("span", {
|
|
1556
1571
|
class: "bar-chart-tooltip-swatch",
|
|
1557
|
-
style:
|
|
1558
|
-
}, null, 4),
|
|
1559
|
-
x(
|
|
1572
|
+
style: m({ background: e.color })
|
|
1573
|
+
}, null, 4), s(" " + y(isFinite(e.value) ? B(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1574
|
+
x(Q) ? (g(), a("a", {
|
|
1560
1575
|
key: 2,
|
|
1561
1576
|
class: "bar-chart-download-link",
|
|
1562
|
-
href: x(
|
|
1563
|
-
download: `${x(
|
|
1564
|
-
}, y(x(
|
|
1577
|
+
href: x(ve),
|
|
1578
|
+
download: `${x(ye)()}.csv`
|
|
1579
|
+
}, y(x(Q)), 9, yt)) : i("", !0)
|
|
1565
1580
|
], 512));
|
|
1566
1581
|
}
|
|
1567
|
-
}), [["__scopeId", "data-v-
|
|
1582
|
+
}), [["__scopeId", "data-v-4f604d9f"]]), xt = {
|
|
1568
1583
|
"01013": "010259",
|
|
1569
1584
|
"01015": "010177",
|
|
1570
1585
|
"01029": "010177",
|
|
@@ -4725,7 +4740,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
4725
4740
|
51019: "510014",
|
|
4726
4741
|
"02158": "020820",
|
|
4727
4742
|
46102: "460957"
|
|
4728
|
-
},
|
|
4743
|
+
}, St = {
|
|
4729
4744
|
"010259": "Butler, AL",
|
|
4730
4745
|
"010177": "Calhoun (Anniston), AL - Cleburne, AL",
|
|
4731
4746
|
"010172": "Chambers, AL - Randolph, AL",
|
|
@@ -5675,25 +5690,47 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
5675
5690
|
560775: "Teton, WY - Lincoln, WY",
|
|
5676
5691
|
560792: "Uinta, WY",
|
|
5677
5692
|
560804: "Weston, WY"
|
|
5678
|
-
},
|
|
5679
|
-
"
|
|
5680
|
-
"
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5693
|
+
}, Ct = {
|
|
5694
|
+
ref: "root",
|
|
5695
|
+
class: "chart-tooltip-content",
|
|
5696
|
+
style: {
|
|
5697
|
+
position: "fixed",
|
|
5698
|
+
left: "0",
|
|
5699
|
+
top: "0",
|
|
5700
|
+
visibility: "hidden",
|
|
5701
|
+
"will-change": "transform",
|
|
5702
|
+
"pointer-events": "none",
|
|
5703
|
+
transform: "translateY(-50%)"
|
|
5704
|
+
}
|
|
5705
|
+
}, wt = /* @__PURE__ */ l({
|
|
5706
|
+
__name: "ChoroplethTooltip",
|
|
5707
|
+
setup(e, { expose: n }) {
|
|
5708
|
+
let a = _(null), s = S("root");
|
|
5709
|
+
return n({
|
|
5710
|
+
setData(e) {
|
|
5711
|
+
a.value = e;
|
|
5712
|
+
},
|
|
5713
|
+
getEl() {
|
|
5714
|
+
return s.value;
|
|
5715
|
+
}
|
|
5716
|
+
}), (e, n) => (g(), r(t, { to: "body" }, [o("div", Ct, [a.value ? te(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
|
|
5717
|
+
}
|
|
5718
|
+
}), Tt = {
|
|
5719
|
+
key: 1,
|
|
5720
|
+
class: "choropleth-header"
|
|
5721
|
+
}, Et = {
|
|
5685
5722
|
key: 0,
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
},
|
|
5723
|
+
class: "choropleth-title"
|
|
5724
|
+
}, Dt = {
|
|
5725
|
+
key: 1,
|
|
5726
|
+
class: "choropleth-legend"
|
|
5727
|
+
}, Ot = {
|
|
5691
5728
|
key: 0,
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
},
|
|
5729
|
+
class: "choropleth-legend-title"
|
|
5730
|
+
}, kt = {
|
|
5731
|
+
key: 2,
|
|
5732
|
+
class: "choropleth-legend-continuous"
|
|
5733
|
+
}, At = { class: "choropleth-legend-ticks" }, jt = ["viewBox"], Mt = ["innerHTML"], Nt = "http://www.w3.org/2000/svg", Pt = 1e3, Ft = /* @__PURE__ */ V(/* @__PURE__ */ l({
|
|
5697
5734
|
__name: "ChoroplethMap",
|
|
5698
5735
|
props: {
|
|
5699
5736
|
topology: {},
|
|
@@ -5725,90 +5762,107 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
5725
5762
|
},
|
|
5726
5763
|
tooltipTrigger: {},
|
|
5727
5764
|
tooltipFormat: {},
|
|
5765
|
+
tooltipValueFormat: {},
|
|
5728
5766
|
tooltipClamp: { default: "chart" }
|
|
5729
5767
|
},
|
|
5730
5768
|
emits: ["stateClick", "stateHover"],
|
|
5731
|
-
setup(
|
|
5732
|
-
let
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5769
|
+
setup(t, { emit: c }) {
|
|
5770
|
+
let l = t, d = c, ne = (e) => e, x = _(null), S = _(null), T = _(null), E = _(null), D = re(), O = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!D.tooltip), k = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), j = null, M = null, N = !1, se = typeof window < "u" && "ontouchstart" in window, z = null, B = {
|
|
5771
|
+
width: 0,
|
|
5772
|
+
height: 0
|
|
5773
|
+
}, V = null, H = !1, U = null, W = _(!1), le = 0, G = 0, K = 0;
|
|
5774
|
+
function ue() {
|
|
5775
|
+
if (se) return;
|
|
5776
|
+
let e = T.value;
|
|
5777
|
+
e && (e.addEventListener("click", We), e.addEventListener("mouseover", We), e.addEventListener("mousemove", Ge), e.addEventListener("mouseout", Ke));
|
|
5737
5778
|
}
|
|
5738
|
-
function
|
|
5739
|
-
let e =
|
|
5740
|
-
e && (e.removeEventListener("click",
|
|
5779
|
+
function de() {
|
|
5780
|
+
let e = T.value;
|
|
5781
|
+
e && (e.removeEventListener("click", We), e.removeEventListener("mouseover", We), e.removeEventListener("mousemove", Ge), e.removeEventListener("mouseout", Ke));
|
|
5741
5782
|
}
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5783
|
+
function q() {
|
|
5784
|
+
He();
|
|
5785
|
+
}
|
|
5786
|
+
h(() => {
|
|
5787
|
+
J(), ue(), Je(), Ie(), window.addEventListener("scroll", q, {
|
|
5788
|
+
passive: !0,
|
|
5789
|
+
capture: !0
|
|
5790
|
+
}), window.addEventListener("resize", q, { passive: !0 });
|
|
5791
|
+
}), ee(() => {
|
|
5792
|
+
z?.disconnect(), K && cancelAnimationFrame(K), fe(), de(), window.removeEventListener("scroll", q, { capture: !0 }), window.removeEventListener("resize", q);
|
|
5749
5793
|
});
|
|
5750
|
-
function
|
|
5751
|
-
if (!
|
|
5752
|
-
let e =
|
|
5753
|
-
|
|
5754
|
-
|
|
5794
|
+
function J() {
|
|
5795
|
+
if (!S.value || !T.value || !l.zoom && !l.pan) return;
|
|
5796
|
+
let e = ae(S.value);
|
|
5797
|
+
U = F().scaleExtent(l.zoom ? [1, 12] : [1, 1]).on("start", () => {
|
|
5798
|
+
N = !0, He();
|
|
5755
5799
|
}).on("zoom", (e) => {
|
|
5756
|
-
|
|
5800
|
+
T.value && T.value.setAttribute("transform", e.transform);
|
|
5801
|
+
let t = e.transform;
|
|
5802
|
+
W.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
5757
5803
|
}).on("end", () => {
|
|
5758
|
-
|
|
5759
|
-
}),
|
|
5804
|
+
N = !1;
|
|
5805
|
+
}), l.pan || U.filter((e) => e.type === "wheel" || e.type === "dblclick"), e.call(U);
|
|
5760
5806
|
}
|
|
5761
|
-
function
|
|
5762
|
-
|
|
5807
|
+
function fe() {
|
|
5808
|
+
S.value && U && (ae(S.value).on(".zoom", null), U = null);
|
|
5763
5809
|
}
|
|
5764
|
-
|
|
5765
|
-
|
|
5810
|
+
function pe() {
|
|
5811
|
+
!S.value || !U || U.transform(ae(S.value), I);
|
|
5812
|
+
}
|
|
5813
|
+
C(() => [l.zoom, l.pan], () => {
|
|
5814
|
+
fe(), de(), J(), ue();
|
|
5766
5815
|
});
|
|
5767
|
-
let
|
|
5768
|
-
let e = b(
|
|
5816
|
+
let Z = n(() => l.width && l.height ? l.height / l.width : .625), he = n(() => Pt), ge = n(() => Pt * Z.value), _e = n(() => {
|
|
5817
|
+
let e = b(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
|
|
5769
5818
|
for (let e of t) {
|
|
5770
|
-
let t =
|
|
5819
|
+
let t = xt[String(e.id).padStart(5, "0")];
|
|
5771
5820
|
t && (n.has(t) || n.set(t, []), n.get(t).push(e));
|
|
5772
5821
|
}
|
|
5773
5822
|
let r = [];
|
|
5774
5823
|
for (let [t, i] of n) r.push({
|
|
5775
5824
|
type: "Feature",
|
|
5776
5825
|
id: t,
|
|
5777
|
-
properties: { name:
|
|
5778
|
-
geometry:
|
|
5826
|
+
properties: { name: St[t] ?? t },
|
|
5827
|
+
geometry: oe(e, i)
|
|
5779
5828
|
});
|
|
5780
5829
|
return {
|
|
5781
5830
|
type: "FeatureCollection",
|
|
5782
5831
|
features: r
|
|
5783
5832
|
};
|
|
5784
|
-
}),
|
|
5785
|
-
if (
|
|
5786
|
-
if (
|
|
5787
|
-
let e = b(
|
|
5788
|
-
return
|
|
5833
|
+
}), Q = n(() => {
|
|
5834
|
+
if (l.geoType === "hsas") return _e.value;
|
|
5835
|
+
if (l.geoType === "counties") {
|
|
5836
|
+
let e = b(l.topology);
|
|
5837
|
+
return L(e, e.objects.counties);
|
|
5789
5838
|
}
|
|
5790
|
-
let e = b(
|
|
5791
|
-
return
|
|
5792
|
-
}),
|
|
5793
|
-
if (
|
|
5794
|
-
let e = b(
|
|
5795
|
-
return
|
|
5796
|
-
}),
|
|
5839
|
+
let e = b(l.topology);
|
|
5840
|
+
return L(e, e.objects.states);
|
|
5841
|
+
}), ve = n(() => {
|
|
5842
|
+
if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
|
|
5843
|
+
let e = b(l.topology);
|
|
5844
|
+
return R(e, e.objects.states, (e, t) => e !== t);
|
|
5845
|
+
}), ye = n(() => P().fitExtent([[0, 0], [he.value, ge.value]], Q.value)), be = n(() => ie(ye.value)), $ = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), xe = n(() => {
|
|
5797
5846
|
let e = /* @__PURE__ */ new Map();
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5847
|
+
for (let t of Q.value.features) t.properties?.name != null && t.id != null && e.set(t.properties.name, String(t.id));
|
|
5848
|
+
return e;
|
|
5849
|
+
}), Se = n(() => {
|
|
5850
|
+
let e = /* @__PURE__ */ new Map();
|
|
5851
|
+
if (!l.data) return e;
|
|
5852
|
+
let t = xe.value;
|
|
5853
|
+
for (let n of l.data) {
|
|
5854
|
+
e.set(n.id, n.value);
|
|
5855
|
+
let r = t.get(n.id);
|
|
5856
|
+
r && e.set(r, n.value);
|
|
5803
5857
|
}
|
|
5804
5858
|
return e;
|
|
5805
|
-
}),
|
|
5806
|
-
if (!
|
|
5859
|
+
}), Ce = n(() => {
|
|
5860
|
+
if (!l.data || l.data.length === 0) return {
|
|
5807
5861
|
min: 0,
|
|
5808
5862
|
max: 1
|
|
5809
5863
|
};
|
|
5810
5864
|
let e = Infinity, t = -Infinity;
|
|
5811
|
-
for (let n of
|
|
5865
|
+
for (let n of l.data) typeof n.value == "number" && (n.value < e && (e = n.value), n.value > t && (t = n.value));
|
|
5812
5866
|
return isFinite(e) ? e === t ? {
|
|
5813
5867
|
min: e,
|
|
5814
5868
|
max: e + 1
|
|
@@ -5819,8 +5873,8 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
5819
5873
|
min: 0,
|
|
5820
5874
|
max: 1
|
|
5821
5875
|
};
|
|
5822
|
-
}),
|
|
5823
|
-
function
|
|
5876
|
+
}), we = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Te = n(() => Array.isArray(l.colorScale) && !we.value), Ee = n(() => Te.value ? "" : l.colorScale?.min ?? "#e5f0fa"), De = n(() => Te.value ? "" : l.colorScale?.max ?? "#08519c");
|
|
5877
|
+
function Oe(e) {
|
|
5824
5878
|
let t = e.replace("#", "");
|
|
5825
5879
|
return [
|
|
5826
5880
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -5828,244 +5882,263 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
5828
5882
|
parseInt(t.slice(4, 6), 16)
|
|
5829
5883
|
];
|
|
5830
5884
|
}
|
|
5831
|
-
function
|
|
5832
|
-
let [t, n, r] =
|
|
5885
|
+
function ke(e) {
|
|
5886
|
+
let [t, n, r] = Oe(Ee.value), [i, a, o] = Oe(De.value);
|
|
5833
5887
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
5834
5888
|
}
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5889
|
+
let Ae = n(() => Te.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), je = n(() => {
|
|
5890
|
+
if (!we.value) return null;
|
|
5891
|
+
let e = /* @__PURE__ */ new Map();
|
|
5892
|
+
for (let t of l.colorScale) e.set(t.value, t.color);
|
|
5893
|
+
return e;
|
|
5894
|
+
});
|
|
5895
|
+
function Me(e) {
|
|
5896
|
+
let t = Se.value.get(e), n = l.noDataColor;
|
|
5897
|
+
if (t == null) return n;
|
|
5898
|
+
let r = je.value;
|
|
5899
|
+
if (r) return r.get(String(t)) ?? n;
|
|
5900
|
+
let i = Ae.value;
|
|
5901
|
+
if (i) {
|
|
5902
|
+
let e = t;
|
|
5903
|
+
for (let t of i) if (e >= t.min) return t.color;
|
|
5904
|
+
return n;
|
|
5905
|
+
}
|
|
5906
|
+
let { min: a, max: o } = Ce.value;
|
|
5907
|
+
return ke((t - a) / (o - a));
|
|
5839
5908
|
}
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
return
|
|
5909
|
+
let Ne = (e) => e.properties?.name ?? String(e.id);
|
|
5910
|
+
function Pe(e) {
|
|
5911
|
+
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat ? l.tooltipValueFormat(e) : String(e);
|
|
5843
5912
|
}
|
|
5844
|
-
function
|
|
5845
|
-
|
|
5846
|
-
if (t == null) return c.noDataColor;
|
|
5847
|
-
if (W.value) return fe(t);
|
|
5848
|
-
if (G.value) return Z(t);
|
|
5849
|
-
let { min: n, max: r } = le.value;
|
|
5850
|
-
return Y((t - n) / (r - n));
|
|
5913
|
+
function Fe(e, t) {
|
|
5914
|
+
return t == null ? e : `${e}: ${Pe(t)}`;
|
|
5851
5915
|
}
|
|
5852
|
-
function
|
|
5853
|
-
|
|
5916
|
+
function Ie() {
|
|
5917
|
+
let e = E.value?.getEl();
|
|
5918
|
+
if (!e) return;
|
|
5919
|
+
z?.disconnect();
|
|
5920
|
+
let t = !1;
|
|
5921
|
+
z = new ResizeObserver((e) => {
|
|
5922
|
+
let n = e[0]?.contentRect;
|
|
5923
|
+
n && (B.width = n.width, B.height = n.height, !t && H && V ? (t = !0, Le(V.x, V.y)) : t = !0);
|
|
5924
|
+
}), z.observe(e);
|
|
5854
5925
|
}
|
|
5855
|
-
function
|
|
5856
|
-
|
|
5926
|
+
function Le(e, t) {
|
|
5927
|
+
let n = E.value?.getEl();
|
|
5928
|
+
if (!n) return;
|
|
5929
|
+
let r = x.value?.getBoundingClientRect(), { left: i, top: a } = Y(e, t, B.width, B.height, l.tooltipClamp, r);
|
|
5930
|
+
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
5857
5931
|
}
|
|
5858
|
-
|
|
5859
|
-
let
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5932
|
+
function Re(e, t, n) {
|
|
5933
|
+
let r = A.get(e);
|
|
5934
|
+
if (!r) return;
|
|
5935
|
+
let i = E.value, a = i?.getEl();
|
|
5936
|
+
!i || !a || (i.setData(r), V = {
|
|
5937
|
+
x: t,
|
|
5938
|
+
y: n
|
|
5939
|
+
}, H = !0, Le(t, n), a.style.visibility = "visible");
|
|
5940
|
+
}
|
|
5941
|
+
function ze(e, t) {
|
|
5942
|
+
H && (le = e, G = t, !K && (K = requestAnimationFrame(() => {
|
|
5943
|
+
K = 0;
|
|
5944
|
+
let e = E.value?.getEl();
|
|
5945
|
+
!e || !H || (V = {
|
|
5946
|
+
x: le,
|
|
5947
|
+
y: G
|
|
5948
|
+
}, e.style.transform = `translate3d(${le + 16}px, ${G}px, 0) translateY(-50%)`);
|
|
5949
|
+
})));
|
|
5950
|
+
}
|
|
5951
|
+
function Be() {
|
|
5952
|
+
if (!H) return;
|
|
5953
|
+
H = !1, V = null;
|
|
5954
|
+
let e = E.value?.getEl();
|
|
5955
|
+
e && (e.style.visibility = "hidden");
|
|
5956
|
+
}
|
|
5957
|
+
function Ve(e) {
|
|
5958
|
+
M !== e && (M && (M.setAttribute("stroke-width", String($.value)), M.setAttribute("stroke", l.strokeColor)), M = e, e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String($.value + 1)), e.setAttribute("stroke", "#555"));
|
|
5959
|
+
}
|
|
5960
|
+
function He() {
|
|
5961
|
+
M && (M.setAttribute("stroke-width", String($.value)), M.setAttribute("stroke", l.strokeColor), M = null, d("stateHover", null)), Be();
|
|
5962
|
+
}
|
|
5963
|
+
function Ue(e) {
|
|
5864
5964
|
let t = e;
|
|
5865
5965
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
5866
|
-
|
|
5867
|
-
let n = he.value.get(t.dataset.featId);
|
|
5868
|
-
return n ? {
|
|
5869
|
-
pathEl: t,
|
|
5870
|
-
feat: n
|
|
5871
|
-
} : null;
|
|
5966
|
+
return t ? t.dataset.featId ?? null : null;
|
|
5872
5967
|
}
|
|
5873
|
-
function
|
|
5874
|
-
|
|
5875
|
-
let
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5968
|
+
function We(e) {
|
|
5969
|
+
if (N) return;
|
|
5970
|
+
let t = e, n = Ue(t.target);
|
|
5971
|
+
if (!n) return;
|
|
5972
|
+
let r = A.get(n);
|
|
5973
|
+
if (!r) return;
|
|
5974
|
+
let i = {
|
|
5975
|
+
id: r.id,
|
|
5976
|
+
name: r.name,
|
|
5977
|
+
value: r.value
|
|
5879
5978
|
};
|
|
5880
|
-
|
|
5881
|
-
let o = f.value?.getBoundingClientRect(), { left: s, top: l } = J(t, n, C.offsetWidth, C.offsetHeight, c.tooltipClamp, o);
|
|
5882
|
-
C.style.left = `${s}px`, C.style.top = `${l}px`;
|
|
5979
|
+
e.type === "click" ? d("stateClick", i) : e.type === "mouseover" && (Ve(k.get(n)), O.value && Re(n, t.clientX, t.clientY), d("stateHover", i));
|
|
5883
5980
|
}
|
|
5884
|
-
function
|
|
5885
|
-
|
|
5981
|
+
function Ge(e) {
|
|
5982
|
+
N || ze(e.clientX, e.clientY);
|
|
5886
5983
|
}
|
|
5887
|
-
function
|
|
5888
|
-
|
|
5984
|
+
function Ke(e) {
|
|
5985
|
+
let t = e.relatedTarget;
|
|
5986
|
+
t && T.value?.contains(t) || He();
|
|
5889
5987
|
}
|
|
5890
|
-
function
|
|
5891
|
-
|
|
5988
|
+
function qe(e) {
|
|
5989
|
+
let t = document.createElementNS(Nt, "path");
|
|
5990
|
+
return e && t.setAttribute("d", e), t;
|
|
5892
5991
|
}
|
|
5893
|
-
function
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
id
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5992
|
+
function Je() {
|
|
5993
|
+
let e = T.value;
|
|
5994
|
+
if (!e) return;
|
|
5995
|
+
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
5996
|
+
k.clear(), A.clear(), j = null, M = null;
|
|
5997
|
+
let t = be.value, n = Q.value.features, r = l.strokeColor, i = String($.value), a = !O.value, o = document.createDocumentFragment();
|
|
5998
|
+
for (let e of n) {
|
|
5999
|
+
let n = String(e.id), s = Ne(e), c = Se.value.get(n), l = qe(t(e));
|
|
6000
|
+
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", n), l.setAttribute("fill", Me(n)), l.setAttribute("stroke", r), l.setAttribute("stroke-width", i), l.setAttribute("vector-effect", "non-scaling-stroke"), a) {
|
|
6001
|
+
let e = document.createElementNS(Nt, "title");
|
|
6002
|
+
e.textContent = Fe(s, c), l.appendChild(e);
|
|
6003
|
+
}
|
|
6004
|
+
o.appendChild(l), k.set(n, l), A.set(n, {
|
|
6005
|
+
id: n,
|
|
6006
|
+
name: s,
|
|
6007
|
+
value: c,
|
|
6008
|
+
feature: e
|
|
6009
|
+
});
|
|
6010
|
+
}
|
|
6011
|
+
let s = ve.value;
|
|
6012
|
+
if (s) {
|
|
6013
|
+
let e = qe(t(s));
|
|
6014
|
+
e.setAttribute("fill", "none"), e.setAttribute("stroke", r), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), o.appendChild(e), j = e;
|
|
6015
|
+
}
|
|
6016
|
+
e.appendChild(o);
|
|
5905
6017
|
}
|
|
5906
|
-
function
|
|
5907
|
-
|
|
6018
|
+
function Ye() {
|
|
6019
|
+
let e = !O.value;
|
|
6020
|
+
for (let [t, n] of k) {
|
|
6021
|
+
let r = Se.value.get(t), i = A.get(t);
|
|
6022
|
+
if (n.setAttribute("fill", Me(t)), i && (i.value = r), e && i) {
|
|
6023
|
+
let e = n.firstElementChild;
|
|
6024
|
+
e && (e.textContent = Fe(i.name, r));
|
|
6025
|
+
}
|
|
6026
|
+
}
|
|
5908
6027
|
}
|
|
5909
|
-
function
|
|
5910
|
-
let t =
|
|
5911
|
-
|
|
6028
|
+
function Xe() {
|
|
6029
|
+
let e = l.strokeColor, t = String($.value);
|
|
6030
|
+
for (let n of k.values()) n !== M && (n.setAttribute("stroke", e), n.setAttribute("stroke-width", t));
|
|
6031
|
+
j && j.setAttribute("stroke", e);
|
|
5912
6032
|
}
|
|
5913
|
-
function
|
|
5914
|
-
return typeof
|
|
6033
|
+
function Ze() {
|
|
6034
|
+
return typeof l.menu == "string" ? l.menu : "choropleth";
|
|
5915
6035
|
}
|
|
5916
|
-
let
|
|
6036
|
+
let Qe = n(() => l.legend && (we.value || Te.value || l.data)), $e = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), et = n(() => {
|
|
5917
6037
|
let e = [];
|
|
5918
6038
|
for (let t = 0; t <= 10; t++) {
|
|
5919
6039
|
let n = t / 10;
|
|
5920
6040
|
e.push({
|
|
5921
6041
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
5922
|
-
color:
|
|
6042
|
+
color: ke(n)
|
|
5923
6043
|
});
|
|
5924
6044
|
}
|
|
5925
6045
|
return e;
|
|
5926
|
-
}),
|
|
5927
|
-
|
|
6046
|
+
}), tt = new Intl.NumberFormat("en-US", {
|
|
6047
|
+
notation: "compact",
|
|
6048
|
+
maximumFractionDigits: 1
|
|
6049
|
+
}), nt = n(() => {
|
|
6050
|
+
let { min: e, max: t } = Ce.value, n = t - e, r = [];
|
|
5928
6051
|
for (let t = 1; t <= 3; t++) {
|
|
5929
|
-
let i = t / 4, a = e + n * i, o = Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
6052
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? tt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
5930
6053
|
r.push({
|
|
5931
6054
|
value: o,
|
|
5932
6055
|
pct: i * 100
|
|
5933
6056
|
});
|
|
5934
6057
|
}
|
|
5935
6058
|
return r;
|
|
5936
|
-
}),
|
|
6059
|
+
}), rt = n(() => {
|
|
5937
6060
|
let e = [];
|
|
5938
|
-
if (
|
|
6061
|
+
if (we.value) for (let t of l.colorScale) e.push({
|
|
5939
6062
|
key: t.value,
|
|
5940
6063
|
color: t.color,
|
|
5941
6064
|
label: t.value
|
|
5942
6065
|
});
|
|
5943
|
-
else if (
|
|
6066
|
+
else if (Te.value) for (let t of $e.value) e.push({
|
|
5944
6067
|
key: String(t.min),
|
|
5945
6068
|
color: t.color,
|
|
5946
6069
|
label: t.label ?? String(t.min)
|
|
5947
6070
|
});
|
|
5948
6071
|
return e;
|
|
5949
|
-
}),
|
|
5950
|
-
let e =
|
|
5951
|
-
for (let t of Ne.value) e += 16 + t.label.length * 7 + 12;
|
|
5952
|
-
return e - (Ne.value.length > 0 ? 12 : 0);
|
|
5953
|
-
}), Fe = t(() => {
|
|
5954
|
-
let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
|
|
5955
|
-
return Ne.value.map((t) => {
|
|
5956
|
-
let n = e;
|
|
5957
|
-
return e += 16 + t.label.length * 7 + 12, n;
|
|
5958
|
-
});
|
|
5959
|
-
}), Ie = t(() => {
|
|
5960
|
-
if (W.value || G.value) return (j.value - Pe.value) / 2;
|
|
5961
|
-
let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
|
|
5962
|
-
return (j.value - e - 160) / 2;
|
|
5963
|
-
}), Le = t(() => {
|
|
5964
|
-
let e = Ce();
|
|
6072
|
+
}), it = n(() => `linear-gradient(to right, ${et.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), at = n(() => {
|
|
6073
|
+
let e = Ze();
|
|
5965
6074
|
return [{
|
|
5966
6075
|
label: "Save as SVG",
|
|
5967
6076
|
action: () => {
|
|
5968
|
-
|
|
6077
|
+
S.value && X(S.value, e);
|
|
5969
6078
|
}
|
|
5970
6079
|
}, {
|
|
5971
6080
|
label: "Save as PNG",
|
|
5972
6081
|
action: () => {
|
|
5973
|
-
|
|
6082
|
+
S.value && me(S.value, e);
|
|
5974
6083
|
}
|
|
5975
6084
|
}];
|
|
5976
6085
|
});
|
|
5977
|
-
return (
|
|
6086
|
+
return C(() => [be.value, O.value], () => Je()), C(() => [
|
|
6087
|
+
Se.value,
|
|
6088
|
+
l.colorScale,
|
|
6089
|
+
l.noDataColor
|
|
6090
|
+
], () => Ye()), C(() => [l.strokeColor, $.value], () => Xe()), (n, c) => (g(), a("div", {
|
|
5978
6091
|
ref_key: "containerRef",
|
|
5979
|
-
ref:
|
|
5980
|
-
class:
|
|
5981
|
-
}, [o.menu ? (h(), n(ce, {
|
|
5982
|
-
key: 0,
|
|
5983
|
-
items: Le.value
|
|
5984
|
-
}, null, 8, ["items"])) : r("", !0), (h(), i("svg", {
|
|
5985
|
-
ref_key: "svgRef",
|
|
5986
|
-
ref: p,
|
|
5987
|
-
width: j.value,
|
|
5988
|
-
height: ke.value
|
|
6092
|
+
ref: x,
|
|
6093
|
+
class: f(["choropleth-wrapper", { pannable: t.pan }])
|
|
5989
6094
|
}, [
|
|
5990
|
-
|
|
5991
|
-
ref_key: "mapGroupRef",
|
|
5992
|
-
ref: v
|
|
5993
|
-
}, [(h(!0), i(e, null, _(R.value.features, (e) => (h(), i("path", {
|
|
5994
|
-
key: String(e.id),
|
|
5995
|
-
"data-feat-id": String(e.id),
|
|
5996
|
-
d: V.value(e) ?? void 0,
|
|
5997
|
-
fill: pe(e.id),
|
|
5998
|
-
stroke: o.strokeColor,
|
|
5999
|
-
"stroke-width": H.value,
|
|
6000
|
-
class: "state-path"
|
|
6001
|
-
}, [o.tooltipTrigger ? r("", !0) : (h(), i("title", St, y(me(e)) + y(Q(e) == null ? "" : `: ${Q(e)}`), 1))], 8, xt))), 128)), z.value ? (h(), i("path", {
|
|
6095
|
+
t.menu ? (g(), r(ce, {
|
|
6002
6096
|
key: 0,
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
class: "choropleth-legend",
|
|
6013
|
-
|
|
6014
|
-
},
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
},
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
a("
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
}, null, 8, At),
|
|
6047
|
-
(h(!0), i(e, null, _(Me.value, (e) => (h(), i("text", {
|
|
6048
|
-
key: e.value,
|
|
6049
|
-
x: (o.legendTitle ? o.legendTitle.length * 8 + 12 : 0) + e.pct / 100 * 160,
|
|
6050
|
-
y: 20,
|
|
6051
|
-
"font-size": "11",
|
|
6052
|
-
fill: "currentColor",
|
|
6053
|
-
opacity: "0.7",
|
|
6054
|
-
"text-anchor": "middle"
|
|
6055
|
-
}, y(e.value), 9, jt))), 128))
|
|
6056
|
-
], 64))], 8, wt)) : r("", !0),
|
|
6057
|
-
o.title ? (h(), i("text", {
|
|
6058
|
-
key: 1,
|
|
6059
|
-
x: j.value / 2,
|
|
6060
|
-
y: 18,
|
|
6061
|
-
"text-anchor": "middle",
|
|
6062
|
-
"font-size": "14",
|
|
6063
|
-
"font-weight": "600",
|
|
6064
|
-
fill: "currentColor"
|
|
6065
|
-
}, y(o.title), 9, Mt)) : r("", !0)
|
|
6066
|
-
], 8, bt))], 2));
|
|
6097
|
+
items: at.value
|
|
6098
|
+
}, null, 8, ["items"])) : i("", !0),
|
|
6099
|
+
t.title || Qe.value ? (g(), a("div", Tt, [t.title ? (g(), a("div", Et, y(t.title), 1)) : i("", !0), Qe.value ? (g(), a("div", Dt, [t.legendTitle ? (g(), a("span", Ot, y(t.legendTitle), 1)) : i("", !0), we.value || Te.value ? (g(!0), a(e, { key: 1 }, v(rt.value, (e) => (g(), a("span", {
|
|
6100
|
+
key: e.key,
|
|
6101
|
+
class: "choropleth-legend-item"
|
|
6102
|
+
}, [o("span", {
|
|
6103
|
+
class: "choropleth-legend-swatch",
|
|
6104
|
+
style: m({ background: e.color })
|
|
6105
|
+
}, null, 4), s(" " + y(e.label), 1)]))), 128)) : (g(), a("div", kt, [o("div", {
|
|
6106
|
+
class: "choropleth-legend-gradient",
|
|
6107
|
+
style: m({ background: it.value })
|
|
6108
|
+
}, null, 4), o("div", At, [(g(!0), a(e, null, v(nt.value, (e) => (g(), a("span", {
|
|
6109
|
+
key: e.value,
|
|
6110
|
+
style: m({ left: e.pct + "%" })
|
|
6111
|
+
}, y(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
|
|
6112
|
+
(g(), a("svg", {
|
|
6113
|
+
ref_key: "svgRef",
|
|
6114
|
+
ref: S,
|
|
6115
|
+
viewBox: `0 0 ${he.value} ${ge.value}`,
|
|
6116
|
+
preserveAspectRatio: "xMidYMid meet"
|
|
6117
|
+
}, [o("g", {
|
|
6118
|
+
ref_key: "mapGroupRef",
|
|
6119
|
+
ref: T
|
|
6120
|
+
}, null, 512)], 8, jt)),
|
|
6121
|
+
(t.zoom || t.pan) && W.value ? (g(), a("button", {
|
|
6122
|
+
key: 2,
|
|
6123
|
+
type: "button",
|
|
6124
|
+
class: "choropleth-reset",
|
|
6125
|
+
"aria-label": "Reset zoom",
|
|
6126
|
+
onClick: pe
|
|
6127
|
+
}, " Reset ")) : i("", !0),
|
|
6128
|
+
O.value ? (g(), r(wt, {
|
|
6129
|
+
key: 3,
|
|
6130
|
+
ref_key: "tooltipChildRef",
|
|
6131
|
+
ref: E
|
|
6132
|
+
}, {
|
|
6133
|
+
default: w((r) => [te(n.$slots, "tooltip", p(u(ne(r))), () => [t.tooltipFormat ? (g(), a("span", {
|
|
6134
|
+
key: 0,
|
|
6135
|
+
innerHTML: t.tooltipFormat(r)
|
|
6136
|
+
}, null, 8, Mt)) : r.value == null ? (g(), a(e, { key: 1 }, [s(y(r.name), 1)], 64)) : (g(), a(e, { key: 2 }, [s(y(r.name) + ": " + y(Pe(r.value)), 1)], 64))], !0)]),
|
|
6137
|
+
_: 3
|
|
6138
|
+
}, 512)) : i("", !0)
|
|
6139
|
+
], 2));
|
|
6067
6140
|
}
|
|
6068
|
-
}), [["__scopeId", "data-v-
|
|
6141
|
+
}), [["__scopeId", "data-v-ecaa9e15"]]), It = /* @__PURE__ */ V(/* @__PURE__ */ l({
|
|
6069
6142
|
__name: "ChartTooltip",
|
|
6070
6143
|
props: {
|
|
6071
6144
|
x: {},
|
|
@@ -6076,47 +6149,47 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
6076
6149
|
},
|
|
6077
6150
|
emits: ["close"],
|
|
6078
6151
|
setup(e) {
|
|
6079
|
-
return (t,
|
|
6152
|
+
return (t, n) => e.mode === "hover" && e.open ? (g(), a("div", {
|
|
6080
6153
|
key: 0,
|
|
6081
6154
|
class: "chart-tooltip-content",
|
|
6082
|
-
style:
|
|
6155
|
+
style: m({
|
|
6083
6156
|
position: "absolute",
|
|
6084
6157
|
left: `${e.x + e.sideOffset}px`,
|
|
6085
6158
|
top: `${e.y}px`,
|
|
6086
6159
|
transform: "translateY(-50%)"
|
|
6087
6160
|
})
|
|
6088
|
-
}, [
|
|
6161
|
+
}, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (g(), r(x(N), {
|
|
6089
6162
|
key: 1,
|
|
6090
6163
|
open: e.open
|
|
6091
6164
|
}, {
|
|
6092
|
-
default:
|
|
6093
|
-
default:
|
|
6165
|
+
default: w(() => [c(x(A), { "as-child": "" }, {
|
|
6166
|
+
default: w(() => [o("div", {
|
|
6094
6167
|
class: "chart-tooltip-anchor",
|
|
6095
|
-
style:
|
|
6168
|
+
style: m({
|
|
6096
6169
|
left: `${e.x}px`,
|
|
6097
6170
|
top: `${e.y}px`
|
|
6098
6171
|
})
|
|
6099
6172
|
}, null, 4)]),
|
|
6100
6173
|
_: 1
|
|
6101
|
-
}),
|
|
6102
|
-
default:
|
|
6174
|
+
}), c(x(M), null, {
|
|
6175
|
+
default: w(() => [e.open ? (g(), r(x(j), {
|
|
6103
6176
|
key: 0,
|
|
6104
6177
|
class: "chart-tooltip-content",
|
|
6105
6178
|
side: "right",
|
|
6106
6179
|
"side-offset": e.sideOffset,
|
|
6107
6180
|
"update-position-strategy": "always",
|
|
6108
|
-
onPointerDownOutside:
|
|
6109
|
-
onEscapeKeyDown:
|
|
6181
|
+
onPointerDownOutside: n[0] ||= (e) => t.$emit("close"),
|
|
6182
|
+
onEscapeKeyDown: n[1] ||= (e) => t.$emit("close")
|
|
6110
6183
|
}, {
|
|
6111
|
-
default:
|
|
6184
|
+
default: w(() => [te(t.$slots, "default", {}, void 0, !0)]),
|
|
6112
6185
|
_: 3
|
|
6113
|
-
}, 8, ["side-offset"])) :
|
|
6186
|
+
}, 8, ["side-offset"])) : i("", !0)]),
|
|
6114
6187
|
_: 3
|
|
6115
6188
|
})]),
|
|
6116
6189
|
_: 3
|
|
6117
|
-
}, 8, ["open"])) :
|
|
6190
|
+
}, 8, ["open"])) : i("", !0);
|
|
6118
6191
|
}
|
|
6119
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
6192
|
+
}), [["__scopeId", "data-v-44377f70"]]), Lt = { class: "TableWrapper" }, Rt = /* @__PURE__ */ V(/* @__PURE__ */ l({
|
|
6120
6193
|
__name: "DataTable",
|
|
6121
6194
|
props: {
|
|
6122
6195
|
data: {},
|
|
@@ -6128,36 +6201,43 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
6128
6201
|
},
|
|
6129
6202
|
csv: {},
|
|
6130
6203
|
filename: {},
|
|
6131
|
-
|
|
6204
|
+
downloadMenuLink: { default: "Download" },
|
|
6205
|
+
fullWidth: {
|
|
6206
|
+
type: Boolean,
|
|
6207
|
+
default: !1
|
|
6208
|
+
}
|
|
6132
6209
|
},
|
|
6133
|
-
setup(
|
|
6210
|
+
setup(t) {
|
|
6134
6211
|
let s = {
|
|
6135
6212
|
small: "80px",
|
|
6136
6213
|
medium: "150px",
|
|
6137
6214
|
large: "250px"
|
|
6138
|
-
}, c =
|
|
6215
|
+
}, c = t;
|
|
6139
6216
|
function l(e) {
|
|
6140
6217
|
return c.columnConfig?.[e]?.label ?? e;
|
|
6141
6218
|
}
|
|
6142
6219
|
function u(e) {
|
|
6143
6220
|
let t = c.columnConfig?.[e]?.width;
|
|
6144
|
-
if (t == null) return
|
|
6221
|
+
if (t == null) return c.fullWidth ? void 0 : {
|
|
6222
|
+
width: s.medium,
|
|
6223
|
+
minWidth: s.medium
|
|
6224
|
+
};
|
|
6145
6225
|
let n = typeof t == "number" ? `${t}px` : s[t];
|
|
6146
6226
|
return {
|
|
6147
6227
|
width: n,
|
|
6148
6228
|
minWidth: n
|
|
6149
6229
|
};
|
|
6150
6230
|
}
|
|
6151
|
-
function
|
|
6231
|
+
function d(e) {
|
|
6152
6232
|
let t = c.columnConfig?.[e]?.align;
|
|
6153
6233
|
if (t) return { textAlign: t };
|
|
6154
6234
|
}
|
|
6155
|
-
function
|
|
6235
|
+
function p(e) {
|
|
6156
6236
|
return typeof e.column == "function";
|
|
6157
6237
|
}
|
|
6158
|
-
let
|
|
6238
|
+
let h = n(() => {
|
|
6159
6239
|
let e = c.data;
|
|
6160
|
-
return
|
|
6240
|
+
return p(e) ? e.columns.map((t) => ({
|
|
6161
6241
|
name: t.name,
|
|
6162
6242
|
values: e.column(t.name),
|
|
6163
6243
|
enumLabels: t.enumLabels
|
|
@@ -6165,65 +6245,60 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
|
|
|
6165
6245
|
name: e,
|
|
6166
6246
|
values: t
|
|
6167
6247
|
}));
|
|
6168
|
-
}),
|
|
6169
|
-
let e =
|
|
6248
|
+
}), ee = n(() => {
|
|
6249
|
+
let e = h.value;
|
|
6170
6250
|
if (e.length === 0) return 0;
|
|
6171
6251
|
let t = 0;
|
|
6172
6252
|
for (let n of e) t = Math.max(t, n.values.length);
|
|
6173
6253
|
return c.maxRows ? Math.min(t, c.maxRows) : t;
|
|
6174
6254
|
});
|
|
6175
|
-
function
|
|
6255
|
+
function _(e, t) {
|
|
6176
6256
|
let n = e.values[t];
|
|
6177
6257
|
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);
|
|
6178
6258
|
}
|
|
6179
6259
|
function te() {
|
|
6180
6260
|
return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
|
|
6181
6261
|
}
|
|
6182
|
-
function
|
|
6262
|
+
function ne(e) {
|
|
6183
6263
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
6184
6264
|
}
|
|
6185
|
-
function
|
|
6265
|
+
function b() {
|
|
6186
6266
|
if (typeof c.csv == "function") return c.csv();
|
|
6187
6267
|
if (typeof c.csv == "string") return c.csv;
|
|
6188
|
-
let e =
|
|
6268
|
+
let e = h.value, t = ee.value, n = [e.map((e) => ne(l(e.name))).join(",")];
|
|
6189
6269
|
for (let r = 0; r < t; r++) {
|
|
6190
|
-
let t = e.map((e) =>
|
|
6270
|
+
let t = e.map((e) => ne(_(e, r)));
|
|
6191
6271
|
n.push(t.join(","));
|
|
6192
6272
|
}
|
|
6193
6273
|
return n.join("\n");
|
|
6194
6274
|
}
|
|
6195
|
-
let
|
|
6196
|
-
label:
|
|
6197
|
-
action: () => Z(
|
|
6198
|
-
}]),
|
|
6199
|
-
return (
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
class: "data-table-download-link",
|
|
6222
|
-
href: C.value,
|
|
6223
|
-
download: `${te()}.csv`
|
|
6224
|
-
}, y(ne.value), 9, Lt)) : r("", !0)
|
|
6225
|
-
], 2));
|
|
6275
|
+
let x = n(() => [{
|
|
6276
|
+
label: c.downloadMenuLink,
|
|
6277
|
+
action: () => Z(b(), te())
|
|
6278
|
+
}]), re = n(() => !!c.menu);
|
|
6279
|
+
return (n, s) => (g(), a("div", { class: f(["TableOuter", {
|
|
6280
|
+
"full-width": t.fullWidth,
|
|
6281
|
+
"has-menu": re.value
|
|
6282
|
+
}]) }, [re.value ? (g(), r(ce, {
|
|
6283
|
+
key: 0,
|
|
6284
|
+
items: x.value,
|
|
6285
|
+
"force-dropdown": ""
|
|
6286
|
+
}, null, 8, ["items"])) : i("", !0), o("div", Lt, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
|
|
6287
|
+
o("colgroup", null, [(g(!0), a(e, null, v(h.value, (e) => (g(), a("col", {
|
|
6288
|
+
key: e.name,
|
|
6289
|
+
style: m(u(e.name))
|
|
6290
|
+
}, null, 4))), 128))]),
|
|
6291
|
+
o("thead", null, [o("tr", null, [(g(!0), a(e, null, v(h.value, (e) => (g(), a("th", {
|
|
6292
|
+
key: e.name,
|
|
6293
|
+
style: m(d(e.name))
|
|
6294
|
+
}, y(l(e.name)), 5))), 128))])]),
|
|
6295
|
+
o("tbody", null, [(g(!0), a(e, null, v(ee.value, (n) => (g(), a("tr", { key: n }, [(g(!0), a(e, null, v(h.value, (e) => (g(), a("td", {
|
|
6296
|
+
key: e.name,
|
|
6297
|
+
class: f(t.columnConfig?.[e.name]?.cellClass),
|
|
6298
|
+
style: m(d(e.name))
|
|
6299
|
+
}, y(_(e, n - 1)), 7))), 128))]))), 128))])
|
|
6300
|
+
], 2)])], 2));
|
|
6226
6301
|
}
|
|
6227
|
-
}), [["__scopeId", "data-v-
|
|
6302
|
+
}), [["__scopeId", "data-v-d5c290dc"]]);
|
|
6228
6303
|
//#endregion
|
|
6229
|
-
export {
|
|
6304
|
+
export { bt as BarChart, It as ChartTooltip, Ft as ChoroplethMap, Rt as DataTable, $e as LineChart };
|