@cfasim-ui/charts 0.3.11 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChoroplethMap/ChoroplethMap.d.ts +1 -1
- package/dist/LineChart/LineChart.d.ts +39 -4
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +639 -563
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, normalizeClass as u, normalizeProps as
|
|
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, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, normalizeClass as u, normalizeProps as ee, normalizeStyle as d, onMounted as te, onUnmounted as ne, openBlock as f, ref as p, renderList as m, renderSlot as h, toDisplayString as g, toRaw as _, unref as v, useId as y, watch as re, withCtx as b, withModifiers as x } from "vue";
|
|
2
|
+
import { DropdownMenuContent as S, DropdownMenuItem as C, DropdownMenuPortal as ie, DropdownMenuRoot as w, DropdownMenuTrigger as T, PopoverAnchor as E, PopoverContent as D, PopoverPortal as O, PopoverRoot as ae } from "reka-ui";
|
|
3
|
+
import { geoAlbersUsa as oe, geoPath as k } from "d3-geo";
|
|
4
|
+
import { zoom as A } from "d3-zoom";
|
|
5
|
+
import { select as se } from "d3-selection";
|
|
6
|
+
import { feature as j, merge as M, mesh as N } from "topojson-client";
|
|
7
7
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
8
|
+
var P = { class: "chart-menu-trigger-area" }, ce = ["aria-label"], F = /* @__PURE__ */ c({
|
|
9
9
|
__name: "ChartMenu",
|
|
10
10
|
props: { items: {} },
|
|
11
11
|
setup(t) {
|
|
12
|
-
return (r, c) => (
|
|
12
|
+
return (r, c) => (f(), i("div", P, [t.items.length === 1 ? (f(), i("button", {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "chart-menu-button chart-menu-single",
|
|
15
15
|
"aria-label": t.items[0].label,
|
|
@@ -24,15 +24,15 @@ var I = { class: "chart-menu-trigger-area" }, L = ["aria-label"], oe = /* @__PUR
|
|
|
24
24
|
"stroke-linecap": "round",
|
|
25
25
|
"stroke-linejoin": "round",
|
|
26
26
|
"aria-hidden": "true"
|
|
27
|
-
}, [a("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8,
|
|
27
|
+
}, [a("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, ce)) : (f(), n(v(w), {
|
|
28
28
|
key: 1,
|
|
29
29
|
modal: !1
|
|
30
30
|
}, {
|
|
31
|
-
default:
|
|
31
|
+
default: b(() => [s(v(T), {
|
|
32
32
|
class: "chart-menu-button",
|
|
33
33
|
"aria-label": "Chart options"
|
|
34
34
|
}, {
|
|
35
|
-
default:
|
|
35
|
+
default: b(() => [...c[2] ||= [a("svg", {
|
|
36
36
|
width: "16",
|
|
37
37
|
height: "16",
|
|
38
38
|
viewBox: "0 0 16 16",
|
|
@@ -56,18 +56,18 @@ var I = { class: "chart-menu-trigger-area" }, L = ["aria-label"], oe = /* @__PUR
|
|
|
56
56
|
})
|
|
57
57
|
], -1)]]),
|
|
58
58
|
_: 1
|
|
59
|
-
}), s(
|
|
60
|
-
default:
|
|
59
|
+
}), s(v(ie), null, {
|
|
60
|
+
default: b(() => [s(v(S), {
|
|
61
61
|
class: "chart-menu-content",
|
|
62
62
|
"side-offset": 4,
|
|
63
63
|
align: "end"
|
|
64
64
|
}, {
|
|
65
|
-
default:
|
|
65
|
+
default: b(() => [(f(!0), i(e, null, m(t.items, (e) => (f(), n(v(C), {
|
|
66
66
|
key: e.label,
|
|
67
67
|
class: "chart-menu-item",
|
|
68
68
|
onSelect: e.action
|
|
69
69
|
}, {
|
|
70
|
-
default:
|
|
70
|
+
default: b(() => [o(g(e.label), 1)]),
|
|
71
71
|
_: 2
|
|
72
72
|
}, 1032, ["onSelect"]))), 128))]),
|
|
73
73
|
_: 1
|
|
@@ -77,24 +77,24 @@ var I = { class: "chart-menu-trigger-area" }, L = ["aria-label"], oe = /* @__PUR
|
|
|
77
77
|
_: 1
|
|
78
78
|
}))]));
|
|
79
79
|
}
|
|
80
|
-
}),
|
|
80
|
+
}), I = (e, t) => {
|
|
81
81
|
let n = e.__vccOpts || e;
|
|
82
82
|
for (let [e, r] of t) n[e] = r;
|
|
83
83
|
return n;
|
|
84
|
-
},
|
|
84
|
+
}, le = /* @__PURE__ */ I(F, [["__scopeId", "data-v-fe2f6904"]]);
|
|
85
85
|
//#endregion
|
|
86
86
|
//#region src/ChartMenu/download.ts
|
|
87
|
-
function
|
|
87
|
+
function L(e, t) {
|
|
88
88
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
89
89
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function ue(e, t) {
|
|
92
92
|
let n = e.cloneNode(!0);
|
|
93
93
|
n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
94
94
|
let r = new XMLSerializer().serializeToString(n);
|
|
95
|
-
|
|
95
|
+
L(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function de(e, t) {
|
|
98
98
|
let n = e.cloneNode(!0);
|
|
99
99
|
n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
100
100
|
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;
|
|
@@ -103,19 +103,19 @@ function le(e, t) {
|
|
|
103
103
|
e.width = s * 2, e.height = c * 2;
|
|
104
104
|
let n = e.getContext("2d");
|
|
105
105
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
106
|
-
e &&
|
|
106
|
+
e && L(e, `${t}.png`);
|
|
107
107
|
}), URL.revokeObjectURL(a);
|
|
108
108
|
}, o.src = a;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
110
|
+
function fe(e, t) {
|
|
111
|
+
L(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
112
112
|
}
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region src/tooltip-position.ts
|
|
115
|
-
var
|
|
116
|
-
function
|
|
115
|
+
var R = 16, z = 8;
|
|
116
|
+
function pe(e, t, n, r, i, a) {
|
|
117
117
|
if (i === "none") return {
|
|
118
|
-
left: e +
|
|
118
|
+
left: e + R,
|
|
119
119
|
top: t
|
|
120
120
|
};
|
|
121
121
|
let o = i === "chart" && a ? {
|
|
@@ -128,78 +128,78 @@ function de(e, t, n, r, i, a) {
|
|
|
128
128
|
right: window.innerWidth,
|
|
129
129
|
top: 0,
|
|
130
130
|
bottom: window.innerHeight
|
|
131
|
-
}, s = e +
|
|
131
|
+
}, s = e + R + n > o.right - z ? e - R - n : e + R, c = r / 2;
|
|
132
132
|
return {
|
|
133
133
|
left: s,
|
|
134
|
-
top: Math.min(Math.max(t, o.top +
|
|
134
|
+
top: Math.min(Math.max(t, o.top + z + c), o.bottom - z - c)
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
//#endregion
|
|
138
138
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
139
|
-
var
|
|
139
|
+
var B = ["width", "height"], me = ["x"], he = { key: 1 }, V = [
|
|
140
140
|
"x1",
|
|
141
141
|
"y1",
|
|
142
142
|
"x2",
|
|
143
143
|
"y2",
|
|
144
144
|
"stroke",
|
|
145
145
|
"stroke-dasharray"
|
|
146
|
-
],
|
|
146
|
+
], H = [
|
|
147
147
|
"cx",
|
|
148
148
|
"cy",
|
|
149
149
|
"fill",
|
|
150
150
|
"fill-opacity",
|
|
151
151
|
"stroke"
|
|
152
|
-
],
|
|
152
|
+
], ge = ["x", "y"], _e = [
|
|
153
153
|
"x1",
|
|
154
154
|
"y1",
|
|
155
155
|
"x2",
|
|
156
156
|
"y2"
|
|
157
|
-
],
|
|
157
|
+
], ve = [
|
|
158
158
|
"x1",
|
|
159
159
|
"y1",
|
|
160
160
|
"x2",
|
|
161
161
|
"y2"
|
|
162
|
-
],
|
|
162
|
+
], ye = [
|
|
163
163
|
"x1",
|
|
164
164
|
"y1",
|
|
165
165
|
"x2",
|
|
166
166
|
"y2"
|
|
167
|
-
],
|
|
167
|
+
], be = [
|
|
168
168
|
"x1",
|
|
169
169
|
"y1",
|
|
170
170
|
"x2",
|
|
171
171
|
"y2"
|
|
172
|
-
],
|
|
172
|
+
], xe = ["x", "y"], Se = ["transform"], U = [
|
|
173
173
|
"x",
|
|
174
174
|
"y",
|
|
175
175
|
"text-anchor"
|
|
176
|
-
],
|
|
176
|
+
], W = ["x", "y"], Ce = [
|
|
177
177
|
"d",
|
|
178
178
|
"fill",
|
|
179
179
|
"fill-opacity"
|
|
180
|
-
],
|
|
180
|
+
], we = [
|
|
181
181
|
"d",
|
|
182
182
|
"stroke",
|
|
183
183
|
"stroke-width",
|
|
184
184
|
"stroke-opacity",
|
|
185
185
|
"stroke-dasharray"
|
|
186
|
-
],
|
|
186
|
+
], Te = [
|
|
187
187
|
"cx",
|
|
188
188
|
"cy",
|
|
189
189
|
"r",
|
|
190
190
|
"fill",
|
|
191
191
|
"fill-opacity",
|
|
192
192
|
"stroke"
|
|
193
|
-
],
|
|
193
|
+
], Ee = [
|
|
194
194
|
"d",
|
|
195
195
|
"fill",
|
|
196
196
|
"fill-opacity"
|
|
197
|
-
],
|
|
197
|
+
], De = [
|
|
198
198
|
"d",
|
|
199
199
|
"stroke",
|
|
200
200
|
"stroke-width",
|
|
201
201
|
"stroke-dasharray"
|
|
202
|
-
],
|
|
202
|
+
], Oe = [
|
|
203
203
|
"x1",
|
|
204
204
|
"y1",
|
|
205
205
|
"x2",
|
|
@@ -207,7 +207,7 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
207
207
|
"stroke",
|
|
208
208
|
"stroke-width",
|
|
209
209
|
"stroke-dasharray"
|
|
210
|
-
],
|
|
210
|
+
], G = [
|
|
211
211
|
"x1",
|
|
212
212
|
"y1",
|
|
213
213
|
"x2",
|
|
@@ -215,47 +215,49 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
215
215
|
"stroke",
|
|
216
216
|
"stroke-width",
|
|
217
217
|
"stroke-dasharray"
|
|
218
|
-
],
|
|
218
|
+
], ke = [
|
|
219
219
|
"x1",
|
|
220
220
|
"y1",
|
|
221
221
|
"x2",
|
|
222
222
|
"y2"
|
|
223
|
-
],
|
|
223
|
+
], Ae = [
|
|
224
224
|
"x1",
|
|
225
225
|
"y1",
|
|
226
226
|
"x2",
|
|
227
227
|
"y2"
|
|
228
|
-
],
|
|
228
|
+
], je = [
|
|
229
229
|
"x1",
|
|
230
230
|
"y1",
|
|
231
231
|
"x2",
|
|
232
232
|
"y2"
|
|
233
|
-
],
|
|
233
|
+
], Me = [
|
|
234
234
|
"cx",
|
|
235
235
|
"cy",
|
|
236
236
|
"fill"
|
|
237
|
-
],
|
|
237
|
+
], Ne = [
|
|
238
238
|
"x",
|
|
239
239
|
"y",
|
|
240
240
|
"width",
|
|
241
241
|
"height"
|
|
242
|
-
],
|
|
242
|
+
], Pe = [
|
|
243
243
|
"cx",
|
|
244
244
|
"cy",
|
|
245
245
|
"fill",
|
|
246
246
|
"fill-opacity",
|
|
247
247
|
"stroke"
|
|
248
|
-
],
|
|
248
|
+
], Fe = [
|
|
249
249
|
"x",
|
|
250
250
|
"y",
|
|
251
251
|
"fill"
|
|
252
|
-
],
|
|
252
|
+
], Ie = ["x", "y"], Le = { class: "line-chart-tooltip" }, Re = {
|
|
253
253
|
key: 0,
|
|
254
254
|
class: "line-chart-tooltip-label"
|
|
255
|
-
},
|
|
255
|
+
}, ze = ["href", "download"], K = 20, q = 36, Be = 12, Ve = 7, He = 16, Ue = 50, J = /* @__PURE__ */ I(/* @__PURE__ */ c({
|
|
256
256
|
__name: "LineChart",
|
|
257
257
|
props: {
|
|
258
|
+
y: {},
|
|
258
259
|
data: {},
|
|
260
|
+
x: {},
|
|
259
261
|
series: {},
|
|
260
262
|
areas: {},
|
|
261
263
|
areaSections: {},
|
|
@@ -288,31 +290,77 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
288
290
|
},
|
|
289
291
|
emits: ["hover"],
|
|
290
292
|
setup(s, { emit: c }) {
|
|
291
|
-
let u = s,
|
|
292
|
-
|
|
293
|
-
|
|
293
|
+
let u = s, _ = c, v = p(null), y = p(null), b = p(0), S = null, C = null;
|
|
294
|
+
te(() => {
|
|
295
|
+
v.value && (b.value = v.value.clientWidth, S = new ResizeObserver((e) => {
|
|
294
296
|
let t = e[0];
|
|
295
|
-
t && (u.debounce ? (
|
|
296
|
-
|
|
297
|
-
}, u.debounce)) :
|
|
298
|
-
}),
|
|
299
|
-
}),
|
|
300
|
-
|
|
297
|
+
t && (u.debounce ? (C && clearTimeout(C), C = setTimeout(() => {
|
|
298
|
+
b.value = t.contentRect.width;
|
|
299
|
+
}, u.debounce)) : b.value = t.contentRect.width);
|
|
300
|
+
}), S.observe(v.value));
|
|
301
|
+
}), ne(() => {
|
|
302
|
+
S?.disconnect(), C && clearTimeout(C);
|
|
301
303
|
});
|
|
302
|
-
let
|
|
303
|
-
top: (u.title ? 30 : 10) + (
|
|
304
|
+
let ie = t(() => u.width ?? (b.value || 400)), w = t(() => u.height ?? 200), T = t(() => k.value.some((e) => e.legend) || u.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description))), E = t(() => ({
|
|
305
|
+
top: (u.title ? 30 : 10) + (T.value ? K : 0),
|
|
304
306
|
right: 10,
|
|
305
307
|
bottom: u.xLabel ? 46 : 30,
|
|
306
308
|
left: u.yLabel ? 66 : 50
|
|
307
|
-
})),
|
|
309
|
+
})), D = t(() => ie.value - E.value.left - E.value.right), O = t(() => w.value - E.value.top - E.value.bottom), ae = [];
|
|
310
|
+
function oe(e) {
|
|
311
|
+
return {
|
|
312
|
+
...e,
|
|
313
|
+
data: e.y ?? e.data ?? ae
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
let k = t(() => {
|
|
317
|
+
if (u.series && u.series.length > 0) return u.series.map(oe);
|
|
318
|
+
let e = u.y ?? u.data;
|
|
319
|
+
return e ? [{
|
|
320
|
+
data: e,
|
|
321
|
+
x: u.x
|
|
322
|
+
}] : [];
|
|
323
|
+
}), A = t(() => u.areas ?? []), se = t(() => {
|
|
308
324
|
let e = 0;
|
|
309
|
-
for (let t of
|
|
310
|
-
for (let t of
|
|
325
|
+
for (let t of k.value) t.data.length > e && (e = t.data.length);
|
|
326
|
+
for (let t of A.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
|
|
311
327
|
return e;
|
|
312
|
-
}),
|
|
328
|
+
}), j = t(() => k.value.some((e) => e.x != null) || A.value.some((e) => e.x != null));
|
|
329
|
+
function M(e, t) {
|
|
330
|
+
return e.x ? Number(e.x[t]) : t;
|
|
331
|
+
}
|
|
332
|
+
function N(e, t) {
|
|
333
|
+
return e.x ? Number(e.x[t]) : t;
|
|
334
|
+
}
|
|
335
|
+
let P = t(() => j.value ? 0 : u.xMin ?? 0), ce = t(() => {
|
|
336
|
+
let e = Infinity, t = -Infinity;
|
|
337
|
+
for (let n of k.value) for (let r = 0; r < n.data.length; r++) {
|
|
338
|
+
let i = M(n, r);
|
|
339
|
+
isFinite(i) && (i < e && (e = i), i > t && (t = i));
|
|
340
|
+
}
|
|
341
|
+
for (let n of A.value) {
|
|
342
|
+
let r = Math.max(n.upper.length, n.lower.length);
|
|
343
|
+
for (let i = 0; i < r; i++) {
|
|
344
|
+
let r = N(n, i);
|
|
345
|
+
isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return isFinite(e) ? {
|
|
349
|
+
min: e,
|
|
350
|
+
max: t
|
|
351
|
+
} : {
|
|
352
|
+
min: 0,
|
|
353
|
+
max: 0
|
|
354
|
+
};
|
|
355
|
+
});
|
|
356
|
+
function F(e) {
|
|
357
|
+
let { min: t, max: n } = ce.value, r = n - t || 1;
|
|
358
|
+
return E.value.left + (e - t) / r * D.value;
|
|
359
|
+
}
|
|
360
|
+
let I = t(() => {
|
|
313
361
|
let e = Infinity, t = -Infinity;
|
|
314
|
-
for (let n of
|
|
315
|
-
for (let n of
|
|
362
|
+
for (let n of k.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
363
|
+
for (let n of A.value) {
|
|
316
364
|
for (let r of n.upper) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
317
365
|
for (let r of n.lower) isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
318
366
|
}
|
|
@@ -326,95 +374,104 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
326
374
|
range: 1
|
|
327
375
|
};
|
|
328
376
|
});
|
|
329
|
-
function
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
377
|
+
function L(e) {
|
|
378
|
+
let t = e.data;
|
|
379
|
+
if (t.length === 0) return "";
|
|
380
|
+
let { min: n, range: r } = I.value, i = O.value / r, a = E.value.top + O.value, o = "", s = !1;
|
|
381
|
+
for (let r = 0; r < t.length; r++) {
|
|
382
|
+
let c = M(e, r);
|
|
383
|
+
if (!isFinite(t[r]) || !isFinite(c)) {
|
|
384
|
+
s = !1;
|
|
335
385
|
continue;
|
|
336
386
|
}
|
|
337
|
-
let
|
|
338
|
-
|
|
387
|
+
let l = F(c), u = a - (t[r] - n) * i;
|
|
388
|
+
o += s ? `L${l},${u}` : `M${l},${u}`, s = !0;
|
|
339
389
|
}
|
|
340
|
-
return
|
|
390
|
+
return o;
|
|
341
391
|
}
|
|
342
|
-
function
|
|
343
|
-
let { min:
|
|
344
|
-
for (let
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
392
|
+
function R(e) {
|
|
393
|
+
let t = e.data, { min: n, range: r } = I.value, i = O.value / r, a = E.value.top + O.value, o = [];
|
|
394
|
+
for (let r = 0; r < t.length; r++) {
|
|
395
|
+
let s = M(e, r);
|
|
396
|
+
!isFinite(t[r]) || !isFinite(s) || o.push({
|
|
397
|
+
x: F(s),
|
|
398
|
+
y: a - (t[r] - n) * i
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
return o;
|
|
349
402
|
}
|
|
350
|
-
function
|
|
351
|
-
let
|
|
352
|
-
if (
|
|
353
|
-
let { min:
|
|
354
|
-
for (let
|
|
355
|
-
|
|
356
|
-
let
|
|
357
|
-
for (let
|
|
358
|
-
|
|
359
|
-
for (let
|
|
360
|
-
for (let
|
|
361
|
-
|
|
403
|
+
function z(e) {
|
|
404
|
+
let t = Math.min(e.upper.length, e.lower.length);
|
|
405
|
+
if (t === 0) return "";
|
|
406
|
+
let { min: n, range: r } = I.value, i = O.value / r, a = E.value.top + O.value, o = (e) => a - (e - n) * i, s = [], c = [];
|
|
407
|
+
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 = []);
|
|
408
|
+
c.length && s.push(c);
|
|
409
|
+
let l = "";
|
|
410
|
+
for (let t of s) {
|
|
411
|
+
l += `M${F(N(e, t[0]))},${o(e.upper[t[0]])}`;
|
|
412
|
+
for (let n = 1; n < t.length; n++) l += `L${F(N(e, t[n]))},${o(e.upper[t[n]])}`;
|
|
413
|
+
for (let n = t.length - 1; n >= 0; n--) l += `L${F(N(e, t[n]))},${o(e.lower[t[n]])}`;
|
|
414
|
+
l += "Z";
|
|
362
415
|
}
|
|
363
|
-
return
|
|
416
|
+
return l;
|
|
364
417
|
}
|
|
365
|
-
function
|
|
366
|
-
let n =
|
|
418
|
+
function J(e, t) {
|
|
419
|
+
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && k.value[e.seriesIndex] || k.value[0];
|
|
420
|
+
return F(r ? M(r, n) : n);
|
|
421
|
+
}
|
|
422
|
+
function We(e, t = !0) {
|
|
423
|
+
let n = E.value.top + O.value;
|
|
367
424
|
if (e.seriesIndex == null) {
|
|
368
|
-
let t =
|
|
369
|
-
return t > r ? "" : `M${
|
|
425
|
+
let t = J(e, "start"), r = J(e, "end");
|
|
426
|
+
return t > r ? "" : `M${t},${E.value.top}L${r},${E.value.top}L${r},${n}L${t},${n}Z`;
|
|
370
427
|
}
|
|
371
|
-
let
|
|
372
|
-
if (!
|
|
373
|
-
let { min:
|
|
374
|
-
if (
|
|
375
|
-
let
|
|
376
|
-
for (let e =
|
|
377
|
-
return t && (
|
|
428
|
+
let r = k.value[e.seriesIndex];
|
|
429
|
+
if (!r) return "";
|
|
430
|
+
let { min: i, range: a } = I.value, o = O.value / a, s = (e) => n - (e - i) * o, c = Math.max(0, e.startIndex), l = Math.min(r.data.length - 1, e.endIndex);
|
|
431
|
+
if (c > l) return "";
|
|
432
|
+
let u = `M${F(M(r, c))},${s(r.data[c])}`;
|
|
433
|
+
for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${F(M(r, e))},${s(r.data[e])}`);
|
|
434
|
+
return t && (u += `L${F(M(r, l))},${n}`, u += `L${F(M(r, c))},${n}`, u += "Z"), u;
|
|
378
435
|
}
|
|
379
|
-
let
|
|
436
|
+
let Ge = t(() => {
|
|
380
437
|
let e = u.areaSections;
|
|
381
438
|
if (!e?.length) return {
|
|
382
439
|
labels: [],
|
|
383
440
|
extraHeight: 0
|
|
384
441
|
};
|
|
385
|
-
let t =
|
|
386
|
-
for (let
|
|
387
|
-
if (!
|
|
388
|
-
let e =
|
|
389
|
-
|
|
390
|
-
cx:
|
|
391
|
-
labelText:
|
|
392
|
-
descText:
|
|
393
|
-
textWidth:
|
|
442
|
+
let t = [], n = E.value.left + D.value;
|
|
443
|
+
for (let r of e) {
|
|
444
|
+
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
445
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Ve, o = J(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : k.value[r.seriesIndex]?.color ?? "currentColor");
|
|
446
|
+
t.push({
|
|
447
|
+
cx: c,
|
|
448
|
+
labelText: e,
|
|
449
|
+
descText: i,
|
|
450
|
+
textWidth: a,
|
|
394
451
|
row: 0,
|
|
395
|
-
color:
|
|
396
|
-
fillOpacity:
|
|
452
|
+
color: l,
|
|
453
|
+
fillOpacity: r.opacity ?? .15
|
|
397
454
|
});
|
|
398
455
|
}
|
|
399
|
-
|
|
400
|
-
let
|
|
401
|
-
for (let e of
|
|
456
|
+
t.sort((e, t) => e.cx - t.cx);
|
|
457
|
+
let r = [];
|
|
458
|
+
for (let e of t) {
|
|
402
459
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
403
|
-
for (; n <
|
|
460
|
+
for (; n < r.length && !(t >= r[n] + He);) n++;
|
|
404
461
|
e.row = n;
|
|
405
|
-
let
|
|
406
|
-
|
|
462
|
+
let i = e.cx + e.textWidth / 2;
|
|
463
|
+
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
407
464
|
}
|
|
408
|
-
return
|
|
465
|
+
return t.length === 0 ? {
|
|
409
466
|
labels: [],
|
|
410
467
|
extraHeight: 0
|
|
411
468
|
} : {
|
|
412
|
-
labels:
|
|
413
|
-
extraHeight: (Math.max(...
|
|
469
|
+
labels: t,
|
|
470
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * q + Be
|
|
414
471
|
};
|
|
415
|
-
}),
|
|
472
|
+
}), Ke = t(() => {
|
|
416
473
|
let e = [];
|
|
417
|
-
for (let t of
|
|
474
|
+
for (let t of k.value) t.legend && e.push({
|
|
418
475
|
label: t.legend,
|
|
419
476
|
color: t.color ?? "currentColor",
|
|
420
477
|
type: "series",
|
|
@@ -423,7 +480,7 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
423
480
|
let t = u.areaSections;
|
|
424
481
|
if (t) for (let n of t) {
|
|
425
482
|
if (n.legend !== "inline" || !n.label && !n.description) continue;
|
|
426
|
-
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" :
|
|
483
|
+
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : k.value[n.seriesIndex]?.color ?? "currentColor");
|
|
427
484
|
e.push({
|
|
428
485
|
label: t,
|
|
429
486
|
color: r,
|
|
@@ -432,327 +489,346 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
432
489
|
});
|
|
433
490
|
}
|
|
434
491
|
return e;
|
|
435
|
-
}),
|
|
436
|
-
function
|
|
492
|
+
}), qe = t(() => w.value + Ge.value.extraHeight), Je = t(() => E.value.top + O.value + E.value.bottom + Be);
|
|
493
|
+
function Ye(e, t) {
|
|
437
494
|
let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
|
|
438
495
|
return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
|
|
439
496
|
}
|
|
440
|
-
function
|
|
497
|
+
function Y(e) {
|
|
441
498
|
return Math.round(e) + .5;
|
|
442
499
|
}
|
|
443
|
-
let
|
|
444
|
-
function
|
|
445
|
-
return Math.abs(e) >= 1e3 ?
|
|
500
|
+
let Xe = new Intl.NumberFormat();
|
|
501
|
+
function X(e) {
|
|
502
|
+
return Math.abs(e) >= 1e3 ? Xe.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
|
|
446
503
|
}
|
|
447
|
-
function
|
|
504
|
+
function Ze(e, t, n) {
|
|
448
505
|
if (!(n > 0) || !isFinite(n)) return [];
|
|
449
506
|
let r = [], i = Math.ceil(e / n) * n;
|
|
450
507
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
451
508
|
return r;
|
|
452
509
|
}
|
|
453
|
-
let
|
|
454
|
-
let { min: e, max: t } =
|
|
510
|
+
let Qe = t(() => {
|
|
511
|
+
let { min: e, max: t } = I.value, n = (t) => Y(E.value.top + O.value - (t - e) / I.value.range * O.value), r = (e) => u.yTickFormat ? u.yTickFormat(e) : X(e);
|
|
455
512
|
if (e === t) return [{
|
|
456
513
|
value: r(e),
|
|
457
|
-
y:
|
|
514
|
+
y: Y(E.value.top + O.value / 2)
|
|
458
515
|
}];
|
|
459
516
|
let i;
|
|
460
517
|
if (Array.isArray(u.yTicks)) i = u.yTicks.filter((n) => n >= e && n <= t);
|
|
461
|
-
else if (typeof u.yTicks == "number") i =
|
|
518
|
+
else if (typeof u.yTicks == "number") i = Ze(e, t, u.yTicks);
|
|
462
519
|
else {
|
|
463
|
-
let n = Math.max(3, Math.floor(
|
|
464
|
-
i =
|
|
520
|
+
let n = Math.max(3, Math.floor(O.value / 50));
|
|
521
|
+
i = Ze(e, t, Ye(t - e, n));
|
|
465
522
|
}
|
|
466
523
|
return i.map((e) => ({
|
|
467
524
|
value: r(e),
|
|
468
525
|
y: n(e)
|
|
469
526
|
}));
|
|
470
|
-
}),
|
|
471
|
-
let e =
|
|
472
|
-
if (e
|
|
473
|
-
let
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
if (
|
|
479
|
-
else if (
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
for (let n = 0; n < e; n += r) o.push(t + n);
|
|
527
|
+
}), $e = t(() => {
|
|
528
|
+
let { min: e, max: t } = ce.value;
|
|
529
|
+
if (e === t) return [];
|
|
530
|
+
let n = P.value, r = se.value, i = (e, t) => {
|
|
531
|
+
let r = e + n;
|
|
532
|
+
return u.xTickFormat ? u.xTickFormat(r, t) : !j.value && u.xLabels && Number.isInteger(e) && e >= 0 && e < u.xLabels.length ? u.xLabels[e] : X(r);
|
|
533
|
+
}, a;
|
|
534
|
+
if (Array.isArray(u.xTicks)) a = u.xTicks.map((e) => e - n).filter((n) => n >= e && n <= t);
|
|
535
|
+
else if (typeof u.xTicks == "number") a = Ze(e + n, t + n, u.xTicks).map((e) => e - n);
|
|
536
|
+
else if (!j.value && u.xLabels && u.xLabels.length === r) {
|
|
537
|
+
let e = Math.max(3, Math.floor(D.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
|
|
538
|
+
a = [];
|
|
539
|
+
for (let e = 0; e < r; e += t) a.push(e);
|
|
484
540
|
} else {
|
|
485
|
-
let
|
|
486
|
-
|
|
487
|
-
for (let n = 0; n <= e - 1; n += r) o.push(Math.round(n) + t);
|
|
541
|
+
let r = Math.max(3, Math.floor(D.value / 80)), i = Ye(t - e, r);
|
|
542
|
+
a = Ze(e + n, t + n, i).map((e) => e - n);
|
|
488
543
|
}
|
|
489
|
-
let
|
|
490
|
-
return
|
|
491
|
-
let n =
|
|
492
|
-
return n -
|
|
493
|
-
value:
|
|
544
|
+
let o = E.value.left, s = E.value.left + D.value;
|
|
545
|
+
return a.map((e, t) => {
|
|
546
|
+
let n = Y(F(e)), r = "middle";
|
|
547
|
+
return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
|
|
548
|
+
value: i(e, t),
|
|
494
549
|
x: n,
|
|
495
550
|
anchor: r
|
|
496
551
|
};
|
|
497
552
|
});
|
|
498
553
|
});
|
|
499
|
-
function
|
|
554
|
+
function et() {
|
|
500
555
|
return u.filename ? u.filename : typeof u.menu == "string" ? u.menu : "chart";
|
|
501
556
|
}
|
|
502
|
-
function
|
|
503
|
-
return
|
|
557
|
+
function tt() {
|
|
558
|
+
return y.value;
|
|
504
559
|
}
|
|
505
|
-
function
|
|
560
|
+
function nt() {
|
|
506
561
|
if (typeof u.csv == "function") return u.csv();
|
|
507
562
|
if (typeof u.csv == "string") return u.csv;
|
|
508
|
-
let e =
|
|
563
|
+
let e = k.value;
|
|
509
564
|
if (e.length === 0) return "";
|
|
510
|
-
let t =
|
|
565
|
+
let t = se.value, n = e.every((t) => t.x === e[0].x) ? e[0].x : void 0, r = n ? "x" : "index", i = [(e.length === 1 ? [r, "value"] : [r, ...e.map((e, t) => `series_${t}`)]).join(",")];
|
|
511
566
|
for (let r = 0; r < t; r++) {
|
|
512
|
-
let t = [r.toString()];
|
|
567
|
+
let t = [n ? String(n[r]) : r.toString()];
|
|
513
568
|
for (let n of e) t.push(r < n.data.length ? String(n.data[r]) : "");
|
|
514
|
-
|
|
569
|
+
i.push(t.join(","));
|
|
515
570
|
}
|
|
516
|
-
return
|
|
571
|
+
return i.join("\n");
|
|
517
572
|
}
|
|
518
|
-
let
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
let
|
|
573
|
+
let Z = p(null), rt = p(!1), it = p(null), Q = p(null), $ = p(null), at = t(() => !!u.tooltipData || !!u.tooltipTrigger), ot = t(() => {
|
|
574
|
+
let e = Z.value, t = k.value[0];
|
|
575
|
+
return e === null || !t ? null : M(t, e);
|
|
576
|
+
}), st = t(() => ot.value === null ? 0 : F(ot.value));
|
|
577
|
+
function ct(e, t) {
|
|
578
|
+
let n = e.data.length;
|
|
579
|
+
if (n === 0) return null;
|
|
580
|
+
let r = 0, i = Infinity;
|
|
581
|
+
for (let a = 0; a < n; a++) {
|
|
582
|
+
let n = M(e, a);
|
|
583
|
+
if (!isFinite(n)) continue;
|
|
584
|
+
let o = Math.abs(n - t);
|
|
585
|
+
o < i && (i = o, r = a);
|
|
586
|
+
}
|
|
587
|
+
return i === Infinity ? null : r;
|
|
588
|
+
}
|
|
589
|
+
let lt = t(() => {
|
|
590
|
+
let e = ot.value;
|
|
524
591
|
if (e === null) return [];
|
|
525
|
-
let { min: t, range: n } =
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
592
|
+
let { min: t, range: n } = I.value, r = O.value / n, i = E.value.top + O.value, a = [];
|
|
593
|
+
for (let n of k.value) {
|
|
594
|
+
let o = ct(n, e);
|
|
595
|
+
if (o === null) continue;
|
|
596
|
+
let s = n.data[o];
|
|
597
|
+
isFinite(s) && a.push({
|
|
598
|
+
x: F(M(n, o)),
|
|
599
|
+
y: i - (s - t) * r,
|
|
600
|
+
color: n.color ?? "currentColor"
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
return a;
|
|
604
|
+
}), ut = t(() => {
|
|
605
|
+
let e = Z.value, t = ot.value;
|
|
606
|
+
if (e === null || t === null) return null;
|
|
607
|
+
let n = t + P.value, r;
|
|
608
|
+
return r = u.xTickFormat ? u.xTickFormat(n, e) : j.value ? X(n) : u.xLabels?.[e], {
|
|
536
609
|
index: e,
|
|
537
|
-
xLabel:
|
|
538
|
-
values:
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
610
|
+
xLabel: r,
|
|
611
|
+
values: k.value.map((e, n) => {
|
|
612
|
+
let r = ct(e, t);
|
|
613
|
+
return {
|
|
614
|
+
value: r === null ? NaN : Number(e.data[r]),
|
|
615
|
+
color: e.color ?? "currentColor",
|
|
616
|
+
seriesIndex: n
|
|
617
|
+
};
|
|
618
|
+
}),
|
|
543
619
|
data: u.tooltipData?.[e] ?? null
|
|
544
620
|
};
|
|
545
621
|
});
|
|
546
|
-
function
|
|
622
|
+
function dt(e) {
|
|
547
623
|
return "touches" in e ? e.touches[0] ?? null : e;
|
|
548
624
|
}
|
|
549
|
-
function
|
|
550
|
-
let t =
|
|
625
|
+
function ft(e) {
|
|
626
|
+
let t = v.value?.getBoundingClientRect();
|
|
551
627
|
if (!t) return null;
|
|
552
|
-
let n =
|
|
553
|
-
if (n
|
|
554
|
-
let
|
|
555
|
-
return
|
|
628
|
+
let n = k.value[0];
|
|
629
|
+
if (!n || n.data.length === 0) return null;
|
|
630
|
+
let { min: r, max: i } = ce.value, a = i - r || 1;
|
|
631
|
+
return ct(n, r + (e - t.left - E.value.left) / D.value * a);
|
|
556
632
|
}
|
|
557
|
-
function
|
|
558
|
-
let t =
|
|
633
|
+
function pt(e) {
|
|
634
|
+
let t = dt(e);
|
|
559
635
|
if (!t) return;
|
|
560
|
-
let n =
|
|
561
|
-
n !== null && (
|
|
636
|
+
let n = ft(t.clientX);
|
|
637
|
+
n !== null && (Z.value = n, Q.value = {
|
|
562
638
|
clientX: t.clientX,
|
|
563
639
|
clientY: t.clientY
|
|
564
|
-
},
|
|
640
|
+
}, _("hover", { index: n }));
|
|
565
641
|
}
|
|
566
|
-
|
|
567
|
-
if (
|
|
568
|
-
|
|
642
|
+
re([Q, Z], () => {
|
|
643
|
+
if (Z.value === null || !Q.value) {
|
|
644
|
+
$.value = null;
|
|
569
645
|
return;
|
|
570
646
|
}
|
|
571
|
-
let e =
|
|
647
|
+
let e = it.value, t = v.value;
|
|
572
648
|
if (!e || !t) return;
|
|
573
|
-
let n = t.getBoundingClientRect(), r =
|
|
574
|
-
|
|
649
|
+
let n = t.getBoundingClientRect(), r = rt.value ? Ue : 0, { left: i, top: a } = pe(Q.value.clientX, Q.value.clientY - r, e.offsetWidth, e.offsetHeight, u.tooltipClamp, n);
|
|
650
|
+
$.value = {
|
|
575
651
|
left: i - n.left,
|
|
576
652
|
top: a - n.top
|
|
577
653
|
};
|
|
578
654
|
}, { flush: "post" });
|
|
579
|
-
function
|
|
580
|
-
|
|
655
|
+
function mt(e) {
|
|
656
|
+
pt(e);
|
|
581
657
|
}
|
|
582
|
-
function
|
|
583
|
-
u.tooltipTrigger !== "click" && (
|
|
658
|
+
function ht() {
|
|
659
|
+
u.tooltipTrigger !== "click" && (Z.value = null, _("hover", null));
|
|
584
660
|
}
|
|
585
|
-
function
|
|
661
|
+
function gt(e) {
|
|
586
662
|
if (u.tooltipTrigger !== "click") return;
|
|
587
|
-
let t =
|
|
663
|
+
let t = dt(e);
|
|
588
664
|
if (!t) return;
|
|
589
|
-
let n =
|
|
590
|
-
n !== null && (
|
|
665
|
+
let n = ft(t.clientX);
|
|
666
|
+
n !== null && (Z.value = Z.value === n ? null : n, _("hover", Z.value === null ? null : { index: n }));
|
|
591
667
|
}
|
|
592
|
-
function
|
|
593
|
-
|
|
668
|
+
function _t(e) {
|
|
669
|
+
rt.value = !0, pt(e);
|
|
594
670
|
}
|
|
595
|
-
function
|
|
596
|
-
|
|
671
|
+
function vt(e) {
|
|
672
|
+
pt(e);
|
|
597
673
|
}
|
|
598
|
-
function
|
|
599
|
-
|
|
674
|
+
function yt() {
|
|
675
|
+
rt.value = !1, Z.value = null, _("hover", null);
|
|
600
676
|
}
|
|
601
|
-
let
|
|
602
|
-
let e =
|
|
677
|
+
let bt = t(() => u.downloadLink ? typeof u.downloadLink == "string" ? u.downloadLink : "Download data (CSV)" : null), xt = t(() => u.downloadLink ? `data:text/csv;charset=utf-8,${encodeURIComponent(nt())}` : null), St = t(() => {
|
|
678
|
+
let e = et(), t = [{
|
|
603
679
|
label: "Save as SVG",
|
|
604
680
|
action: () => {
|
|
605
|
-
let t =
|
|
606
|
-
t &&
|
|
681
|
+
let t = tt();
|
|
682
|
+
t && ue(t, e);
|
|
607
683
|
}
|
|
608
684
|
}, {
|
|
609
685
|
label: "Save as PNG",
|
|
610
686
|
action: () => {
|
|
611
|
-
let t =
|
|
612
|
-
t &&
|
|
687
|
+
let t = tt();
|
|
688
|
+
t && de(t, e);
|
|
613
689
|
}
|
|
614
690
|
}];
|
|
615
691
|
return u.downloadLink || t.push({
|
|
616
692
|
label: "Download CSV",
|
|
617
|
-
action: () =>
|
|
693
|
+
action: () => fe(nt(), e)
|
|
618
694
|
}), t;
|
|
619
695
|
});
|
|
620
|
-
return (t, c) => (
|
|
696
|
+
return (t, c) => (f(), i("div", {
|
|
621
697
|
ref_key: "containerRef",
|
|
622
|
-
ref:
|
|
698
|
+
ref: v,
|
|
623
699
|
class: "line-chart-wrapper"
|
|
624
700
|
}, [
|
|
625
|
-
s.menu ? (
|
|
701
|
+
s.menu ? (f(), n(le, {
|
|
626
702
|
key: 0,
|
|
627
|
-
items:
|
|
703
|
+
items: St.value
|
|
628
704
|
}, null, 8, ["items"])) : r("", !0),
|
|
629
|
-
(
|
|
705
|
+
(f(), i("svg", {
|
|
630
706
|
ref_key: "svgRef",
|
|
631
|
-
ref:
|
|
632
|
-
width:
|
|
633
|
-
height:
|
|
707
|
+
ref: y,
|
|
708
|
+
width: ie.value,
|
|
709
|
+
height: qe.value
|
|
634
710
|
}, [
|
|
635
|
-
s.title ? (
|
|
711
|
+
s.title ? (f(), i("text", {
|
|
636
712
|
key: 0,
|
|
637
|
-
x:
|
|
713
|
+
x: ie.value / 2,
|
|
638
714
|
y: 18,
|
|
639
715
|
"text-anchor": "middle",
|
|
640
716
|
"font-size": "14",
|
|
641
717
|
"font-weight": "600",
|
|
642
718
|
fill: "currentColor"
|
|
643
|
-
},
|
|
644
|
-
|
|
719
|
+
}, g(s.title), 9, me)) : r("", !0),
|
|
720
|
+
Ke.value.length > 0 ? (f(), i("g", he, [(f(!0), i(e, null, m(Ke.value, (t, n) => (f(), i(e, { key: "ileg" + n }, [t.type === "series" ? (f(), i("line", {
|
|
645
721
|
key: 0,
|
|
646
|
-
x1:
|
|
647
|
-
y1:
|
|
648
|
-
x2:
|
|
649
|
-
y2:
|
|
722
|
+
x1: E.value.left + n * 120,
|
|
723
|
+
y1: E.value.top - K / 2,
|
|
724
|
+
x2: E.value.left + n * 120 + 12,
|
|
725
|
+
y2: E.value.top - K / 2,
|
|
650
726
|
stroke: t.color,
|
|
651
727
|
"stroke-width": "2",
|
|
652
728
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
653
|
-
}, null, 8,
|
|
729
|
+
}, null, 8, V)) : (f(), i("circle", {
|
|
654
730
|
key: 1,
|
|
655
|
-
cx:
|
|
656
|
-
cy:
|
|
731
|
+
cx: E.value.left + n * 120 + 4,
|
|
732
|
+
cy: E.value.top - K / 2,
|
|
657
733
|
r: "4",
|
|
658
734
|
fill: t.color,
|
|
659
735
|
"fill-opacity": t.fillOpacity,
|
|
660
736
|
stroke: t.color,
|
|
661
737
|
"stroke-width": "1.5"
|
|
662
|
-
}, null, 8,
|
|
663
|
-
x:
|
|
664
|
-
y:
|
|
738
|
+
}, null, 8, H)), a("text", {
|
|
739
|
+
x: E.value.left + n * 120 + 18,
|
|
740
|
+
y: E.value.top - K / 2 + 4,
|
|
665
741
|
"font-size": "11",
|
|
666
742
|
fill: "currentColor"
|
|
667
|
-
},
|
|
743
|
+
}, g(t.label), 9, ge)], 64))), 128))])) : r("", !0),
|
|
668
744
|
a("line", {
|
|
669
|
-
x1:
|
|
670
|
-
y1:
|
|
671
|
-
x2:
|
|
672
|
-
y2:
|
|
745
|
+
x1: Y(E.value.left),
|
|
746
|
+
y1: Y(E.value.top),
|
|
747
|
+
x2: Y(E.value.left),
|
|
748
|
+
y2: Y(E.value.top + O.value),
|
|
673
749
|
stroke: "currentColor",
|
|
674
750
|
"stroke-opacity": "0.3"
|
|
675
|
-
}, null, 8,
|
|
751
|
+
}, null, 8, _e),
|
|
676
752
|
a("line", {
|
|
677
|
-
x1:
|
|
678
|
-
y1:
|
|
679
|
-
x2:
|
|
680
|
-
y2:
|
|
753
|
+
x1: Y(E.value.left),
|
|
754
|
+
y1: Y(E.value.top + O.value),
|
|
755
|
+
x2: Y(E.value.left + D.value),
|
|
756
|
+
y2: Y(E.value.top + O.value),
|
|
681
757
|
stroke: "currentColor",
|
|
682
758
|
"stroke-opacity": "0.3"
|
|
683
|
-
}, null, 8,
|
|
684
|
-
s.yGrid ? (
|
|
759
|
+
}, null, 8, ve),
|
|
760
|
+
s.yGrid ? (f(!0), i(e, { key: 2 }, m(Qe.value, (e, t) => (f(), i("line", {
|
|
685
761
|
key: "yg" + t,
|
|
686
|
-
x1:
|
|
762
|
+
x1: E.value.left,
|
|
687
763
|
y1: e.y,
|
|
688
|
-
x2:
|
|
764
|
+
x2: E.value.left + D.value,
|
|
689
765
|
y2: e.y,
|
|
690
766
|
stroke: "currentColor",
|
|
691
767
|
"stroke-opacity": "0.1"
|
|
692
|
-
}, null, 8,
|
|
693
|
-
s.xGrid ? (
|
|
768
|
+
}, null, 8, ye))), 128)) : r("", !0),
|
|
769
|
+
s.xGrid ? (f(!0), i(e, { key: 3 }, m($e.value, (e, t) => (f(), i("line", {
|
|
694
770
|
key: "xg" + t,
|
|
695
771
|
x1: e.x,
|
|
696
|
-
y1:
|
|
772
|
+
y1: E.value.top,
|
|
697
773
|
x2: e.x,
|
|
698
|
-
y2:
|
|
774
|
+
y2: E.value.top + O.value,
|
|
699
775
|
stroke: "currentColor",
|
|
700
776
|
"stroke-opacity": "0.1"
|
|
701
|
-
}, null, 8,
|
|
702
|
-
(
|
|
777
|
+
}, null, 8, be))), 128)) : r("", !0),
|
|
778
|
+
(f(!0), i(e, null, m(Qe.value, (e, t) => (f(), i("text", {
|
|
703
779
|
key: "y" + t,
|
|
704
780
|
"data-testid": "y-tick",
|
|
705
|
-
x:
|
|
781
|
+
x: E.value.left - 6,
|
|
706
782
|
y: e.y,
|
|
707
783
|
"text-anchor": "end",
|
|
708
784
|
"dominant-baseline": "middle",
|
|
709
785
|
"font-size": "10",
|
|
710
786
|
fill: "currentColor",
|
|
711
787
|
"fill-opacity": "0.6"
|
|
712
|
-
},
|
|
713
|
-
s.yLabel ? (
|
|
788
|
+
}, g(e.value), 9, xe))), 128)),
|
|
789
|
+
s.yLabel ? (f(), i("text", {
|
|
714
790
|
key: 4,
|
|
715
791
|
x: 0,
|
|
716
792
|
y: 0,
|
|
717
|
-
transform: `translate(14, ${
|
|
793
|
+
transform: `translate(14, ${E.value.top + O.value / 2}) rotate(-90)`,
|
|
718
794
|
"text-anchor": "middle",
|
|
719
795
|
"font-size": "13",
|
|
720
796
|
fill: "currentColor"
|
|
721
|
-
},
|
|
722
|
-
(
|
|
797
|
+
}, g(s.yLabel), 9, Se)) : r("", !0),
|
|
798
|
+
(f(!0), i(e, null, m($e.value, (e, t) => (f(), i("text", {
|
|
723
799
|
key: "x" + t,
|
|
724
800
|
"data-testid": "x-tick",
|
|
725
801
|
x: e.x,
|
|
726
|
-
y:
|
|
802
|
+
y: E.value.top + O.value + 16,
|
|
727
803
|
"text-anchor": e.anchor,
|
|
728
804
|
"font-size": "10",
|
|
729
805
|
fill: "currentColor",
|
|
730
806
|
"fill-opacity": "0.6"
|
|
731
|
-
},
|
|
732
|
-
s.xLabel ? (
|
|
807
|
+
}, g(e.value), 9, U))), 128)),
|
|
808
|
+
s.xLabel ? (f(), i("text", {
|
|
733
809
|
key: 5,
|
|
734
|
-
x:
|
|
735
|
-
y:
|
|
810
|
+
x: E.value.left + D.value / 2,
|
|
811
|
+
y: w.value - 4,
|
|
736
812
|
"text-anchor": "middle",
|
|
737
813
|
"font-size": "13",
|
|
738
814
|
fill: "currentColor"
|
|
739
|
-
},
|
|
740
|
-
(
|
|
815
|
+
}, g(s.xLabel), 9, W)) : r("", !0),
|
|
816
|
+
(f(!0), i(e, null, m(A.value, (e, t) => (f(), i("path", {
|
|
741
817
|
key: "area" + t,
|
|
742
|
-
d:
|
|
818
|
+
d: z(e),
|
|
743
819
|
fill: e.color ?? "currentColor",
|
|
744
820
|
"fill-opacity": e.opacity ?? .2,
|
|
745
821
|
stroke: "none"
|
|
746
|
-
}, null, 8,
|
|
747
|
-
(
|
|
822
|
+
}, null, 8, Ce))), 128)),
|
|
823
|
+
(f(!0), i(e, null, m(k.value, (t, n) => (f(), i(e, { key: n }, [t.line === !1 ? r("", !0) : (f(), i("path", {
|
|
748
824
|
key: 0,
|
|
749
|
-
d:
|
|
825
|
+
d: L(t),
|
|
750
826
|
fill: "none",
|
|
751
827
|
stroke: t.color ?? "currentColor",
|
|
752
828
|
"stroke-width": t.strokeWidth ?? 1.5,
|
|
753
829
|
"stroke-opacity": t.lineOpacity ?? t.opacity ?? s.lineOpacity,
|
|
754
830
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
755
|
-
}, null, 8,
|
|
831
|
+
}, null, 8, we)), t.dots ? (f(!0), i(e, { key: 1 }, m(R(t), (e, n) => (f(), i("circle", {
|
|
756
832
|
key: n,
|
|
757
833
|
cx: e.x,
|
|
758
834
|
cy: e.y,
|
|
@@ -760,68 +836,68 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
760
836
|
fill: t.dotFill ?? t.color ?? "currentColor",
|
|
761
837
|
"fill-opacity": t.dotOpacity ?? t.opacity ?? s.lineOpacity,
|
|
762
838
|
stroke: t.dotStroke ?? "none"
|
|
763
|
-
}, null, 8,
|
|
764
|
-
(
|
|
839
|
+
}, null, 8, Te))), 128)) : r("", !0)], 64))), 128)),
|
|
840
|
+
(f(!0), i(e, null, m(s.areaSections ?? [], (t, n) => (f(), i(e, { key: "areasec" + n }, [
|
|
765
841
|
a("path", {
|
|
766
|
-
d:
|
|
767
|
-
fill: t.color ?? (t.seriesIndex == null ? "#999" :
|
|
842
|
+
d: We(t),
|
|
843
|
+
fill: t.color ?? (t.seriesIndex == null ? "#999" : k.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
768
844
|
"fill-opacity": t.opacity ?? .15,
|
|
769
845
|
stroke: "none"
|
|
770
|
-
}, null, 8,
|
|
771
|
-
t.seriesIndex == null ? r("", !0) : (
|
|
846
|
+
}, null, 8, Ee),
|
|
847
|
+
t.seriesIndex == null ? r("", !0) : (f(), i("path", {
|
|
772
848
|
key: 0,
|
|
773
|
-
d:
|
|
849
|
+
d: We(t, !1),
|
|
774
850
|
fill: "none",
|
|
775
|
-
stroke: t.color ??
|
|
851
|
+
stroke: t.color ?? k.value[t.seriesIndex]?.color ?? "currentColor",
|
|
776
852
|
"stroke-width": t.strokeWidth ?? 2,
|
|
777
853
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
778
|
-
}, null, 8,
|
|
779
|
-
t.seriesIndex == null ? (
|
|
780
|
-
x1:
|
|
781
|
-
y1:
|
|
782
|
-
x2:
|
|
783
|
-
y2:
|
|
854
|
+
}, null, 8, De)),
|
|
855
|
+
t.seriesIndex == null ? (f(), i(e, { key: 1 }, [a("line", {
|
|
856
|
+
x1: Y(J(t, "start")),
|
|
857
|
+
y1: E.value.top,
|
|
858
|
+
x2: Y(J(t, "start")),
|
|
859
|
+
y2: E.value.top + O.value,
|
|
784
860
|
stroke: t.color ?? "#999",
|
|
785
861
|
"stroke-width": t.strokeWidth ?? 2,
|
|
786
862
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
787
|
-
}, null, 8,
|
|
788
|
-
x1:
|
|
789
|
-
y1:
|
|
790
|
-
x2:
|
|
791
|
-
y2:
|
|
863
|
+
}, null, 8, Oe), a("line", {
|
|
864
|
+
x1: Y(J(t, "end")),
|
|
865
|
+
y1: E.value.top,
|
|
866
|
+
x2: Y(J(t, "end")),
|
|
867
|
+
y2: E.value.top + O.value,
|
|
792
868
|
stroke: t.color ?? "#999",
|
|
793
869
|
"stroke-width": t.strokeWidth ?? 2,
|
|
794
870
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
795
|
-
}, null, 8,
|
|
871
|
+
}, null, 8, G)], 64)) : r("", !0),
|
|
796
872
|
a("line", {
|
|
797
|
-
x1:
|
|
798
|
-
y1:
|
|
799
|
-
x2:
|
|
800
|
-
y2:
|
|
873
|
+
x1: Y(J(t, "start")),
|
|
874
|
+
y1: E.value.top + O.value - 4,
|
|
875
|
+
x2: Y(J(t, "start")),
|
|
876
|
+
y2: E.value.top + O.value + 4,
|
|
801
877
|
stroke: "currentColor",
|
|
802
878
|
"stroke-opacity": "0.4"
|
|
803
|
-
}, null, 8,
|
|
879
|
+
}, null, 8, ke),
|
|
804
880
|
a("line", {
|
|
805
|
-
x1:
|
|
806
|
-
y1:
|
|
807
|
-
x2:
|
|
808
|
-
y2:
|
|
881
|
+
x1: Y(J(t, "end")),
|
|
882
|
+
y1: E.value.top + O.value - 4,
|
|
883
|
+
x2: Y(J(t, "end")),
|
|
884
|
+
y2: E.value.top + O.value + 4,
|
|
809
885
|
stroke: "currentColor",
|
|
810
886
|
"stroke-opacity": "0.4"
|
|
811
|
-
}, null, 8,
|
|
887
|
+
}, null, 8, Ae)
|
|
812
888
|
], 64))), 128)),
|
|
813
|
-
|
|
889
|
+
at.value && Z.value !== null ? (f(), i("line", {
|
|
814
890
|
key: 6,
|
|
815
|
-
x1:
|
|
816
|
-
y1:
|
|
817
|
-
x2:
|
|
818
|
-
y2:
|
|
891
|
+
x1: Y(st.value),
|
|
892
|
+
y1: E.value.top,
|
|
893
|
+
x2: Y(st.value),
|
|
894
|
+
y2: E.value.top + O.value,
|
|
819
895
|
stroke: "currentColor",
|
|
820
896
|
"stroke-opacity": "0.3",
|
|
821
897
|
"stroke-dasharray": "4 2",
|
|
822
898
|
"pointer-events": "none"
|
|
823
|
-
}, null, 8,
|
|
824
|
-
(
|
|
899
|
+
}, null, 8, je)) : r("", !0),
|
|
900
|
+
(f(!0), i(e, null, m(lt.value, (e, t) => (f(), i("circle", {
|
|
825
901
|
key: "hd" + t,
|
|
826
902
|
cx: e.x,
|
|
827
903
|
cy: e.y,
|
|
@@ -830,82 +906,82 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
830
906
|
stroke: "var(--color-bg-0, #fff)",
|
|
831
907
|
"stroke-width": "2",
|
|
832
908
|
"pointer-events": "none"
|
|
833
|
-
}, null, 8,
|
|
834
|
-
|
|
909
|
+
}, null, 8, Me))), 128)),
|
|
910
|
+
at.value ? (f(), i("rect", {
|
|
835
911
|
key: 7,
|
|
836
|
-
x:
|
|
837
|
-
y:
|
|
838
|
-
width:
|
|
839
|
-
height:
|
|
912
|
+
x: E.value.left,
|
|
913
|
+
y: E.value.top,
|
|
914
|
+
width: D.value,
|
|
915
|
+
height: O.value,
|
|
840
916
|
fill: "transparent",
|
|
841
917
|
style: {
|
|
842
918
|
cursor: "crosshair",
|
|
843
919
|
"touch-action": "none"
|
|
844
920
|
},
|
|
845
|
-
onMousemove:
|
|
846
|
-
onMouseleave:
|
|
847
|
-
onClick:
|
|
848
|
-
onTouchstart:
|
|
849
|
-
onTouchmove:
|
|
850
|
-
onTouchend:
|
|
851
|
-
}, null, 40,
|
|
852
|
-
(
|
|
921
|
+
onMousemove: mt,
|
|
922
|
+
onMouseleave: ht,
|
|
923
|
+
onClick: gt,
|
|
924
|
+
onTouchstart: x(_t, ["prevent"]),
|
|
925
|
+
onTouchmove: x(vt, ["prevent"]),
|
|
926
|
+
onTouchend: yt
|
|
927
|
+
}, null, 40, Ne)) : r("", !0),
|
|
928
|
+
(f(!0), i(e, null, m(Ge.value.labels, (e, t) => (f(), i("g", { key: "seclab" + t }, [
|
|
853
929
|
a("circle", {
|
|
854
930
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
855
|
-
cy:
|
|
931
|
+
cy: Je.value + e.row * q + 4,
|
|
856
932
|
r: "4",
|
|
857
933
|
fill: e.color,
|
|
858
934
|
"fill-opacity": e.fillOpacity,
|
|
859
935
|
stroke: e.color,
|
|
860
936
|
"stroke-width": "1.5"
|
|
861
|
-
}, null, 8,
|
|
862
|
-
e.labelText ? (
|
|
937
|
+
}, null, 8, Pe),
|
|
938
|
+
e.labelText ? (f(), i("text", {
|
|
863
939
|
key: 0,
|
|
864
940
|
x: e.cx - e.textWidth / 2 + 8,
|
|
865
|
-
y:
|
|
941
|
+
y: Je.value + e.row * q + 8,
|
|
866
942
|
"font-size": "11",
|
|
867
943
|
"font-weight": "600",
|
|
868
944
|
fill: e.color
|
|
869
|
-
},
|
|
870
|
-
e.descText ? (
|
|
945
|
+
}, g(e.labelText), 9, Fe)) : r("", !0),
|
|
946
|
+
e.descText ? (f(), i("text", {
|
|
871
947
|
key: 1,
|
|
872
948
|
x: e.cx - e.textWidth / 2 + 8,
|
|
873
|
-
y:
|
|
949
|
+
y: Je.value + e.row * q + 22,
|
|
874
950
|
"font-size": "11",
|
|
875
951
|
fill: "currentColor",
|
|
876
952
|
"fill-opacity": "0.6"
|
|
877
|
-
},
|
|
953
|
+
}, g(e.descText), 9, Ie)) : r("", !0)
|
|
878
954
|
]))), 128))
|
|
879
|
-
], 8,
|
|
880
|
-
|
|
955
|
+
], 8, B)),
|
|
956
|
+
at.value && Z.value !== null && ut.value ? (f(), i("div", {
|
|
881
957
|
key: 1,
|
|
882
958
|
ref_key: "tooltipRef",
|
|
883
|
-
ref:
|
|
959
|
+
ref: it,
|
|
884
960
|
class: "chart-tooltip-content",
|
|
885
|
-
style:
|
|
961
|
+
style: d({
|
|
886
962
|
position: "absolute",
|
|
887
963
|
top: "0",
|
|
888
964
|
left: "0",
|
|
889
965
|
willChange: "transform",
|
|
890
|
-
transform:
|
|
891
|
-
visibility:
|
|
966
|
+
transform: $.value ? `translate3d(${$.value.left}px, ${$.value.top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
967
|
+
visibility: $.value ? "visible" : "hidden"
|
|
892
968
|
})
|
|
893
|
-
}, [
|
|
969
|
+
}, [h(t.$slots, "tooltip", ee(l(ut.value)), () => [a("div", Le, [ut.value.xLabel ? (f(), i("div", Re, g(ut.value.xLabel), 1)) : r("", !0), (f(!0), i(e, null, m(ut.value.values, (e) => (f(), i("div", {
|
|
894
970
|
key: e.seriesIndex,
|
|
895
971
|
class: "line-chart-tooltip-row"
|
|
896
972
|
}, [a("span", {
|
|
897
973
|
class: "line-chart-tooltip-swatch",
|
|
898
|
-
style:
|
|
899
|
-
}, null, 4), o(" " +
|
|
900
|
-
|
|
974
|
+
style: d({ background: e.color })
|
|
975
|
+
}, null, 4), o(" " + g(isFinite(e.value) ? X(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : r("", !0),
|
|
976
|
+
bt.value ? (f(), i("a", {
|
|
901
977
|
key: 2,
|
|
902
978
|
class: "line-chart-download-link",
|
|
903
|
-
href:
|
|
904
|
-
download: `${
|
|
905
|
-
},
|
|
979
|
+
href: xt.value,
|
|
980
|
+
download: `${et()}.csv`
|
|
981
|
+
}, g(bt.value), 9, ze)) : r("", !0)
|
|
906
982
|
], 512));
|
|
907
983
|
}
|
|
908
|
-
}), [["__scopeId", "data-v-
|
|
984
|
+
}), [["__scopeId", "data-v-dc8afa83"]]), We = {
|
|
909
985
|
"01013": "010259",
|
|
910
986
|
"01015": "010177",
|
|
911
987
|
"01029": "010177",
|
|
@@ -4066,7 +4142,7 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
4066
4142
|
51019: "510014",
|
|
4067
4143
|
"02158": "020820",
|
|
4068
4144
|
46102: "460957"
|
|
4069
|
-
},
|
|
4145
|
+
}, Ge = {
|
|
4070
4146
|
"010259": "Butler, AL",
|
|
4071
4147
|
"010177": "Calhoun (Anniston), AL - Cleburne, AL",
|
|
4072
4148
|
"010172": "Chambers, AL - Randolph, AL",
|
|
@@ -5016,25 +5092,25 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5016
5092
|
560775: "Teton, WY - Lincoln, WY",
|
|
5017
5093
|
560792: "Uinta, WY",
|
|
5018
5094
|
560804: "Weston, WY"
|
|
5019
|
-
},
|
|
5095
|
+
}, Ke = ["width", "height"], qe = [
|
|
5020
5096
|
"data-feat-id",
|
|
5021
5097
|
"d",
|
|
5022
5098
|
"fill",
|
|
5023
5099
|
"stroke",
|
|
5024
5100
|
"stroke-width"
|
|
5025
|
-
],
|
|
5101
|
+
], Je = { key: 0 }, Ye = ["d", "stroke"], Y = ["transform"], Xe = {
|
|
5026
5102
|
key: 0,
|
|
5027
5103
|
y: 5,
|
|
5028
5104
|
"font-size": "13",
|
|
5029
5105
|
"font-weight": "600",
|
|
5030
5106
|
fill: "currentColor"
|
|
5031
|
-
},
|
|
5107
|
+
}, X = ["x", "fill"], Ze = ["x"], Qe = {
|
|
5032
5108
|
key: 0,
|
|
5033
5109
|
y: 5,
|
|
5034
5110
|
"font-size": "13",
|
|
5035
5111
|
"font-weight": "600",
|
|
5036
5112
|
fill: "currentColor"
|
|
5037
|
-
},
|
|
5113
|
+
}, $e = ["offset", "stop-color"], et = ["x", "fill"], tt = ["x"], nt = ["x"], Z = /* @__PURE__ */ I(/* @__PURE__ */ c({
|
|
5038
5114
|
__name: "ChoroplethMap",
|
|
5039
5115
|
props: {
|
|
5040
5116
|
topology: {},
|
|
@@ -5070,80 +5146,80 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5070
5146
|
},
|
|
5071
5147
|
emits: ["stateClick", "stateHover"],
|
|
5072
5148
|
setup(o, { emit: s }) {
|
|
5073
|
-
let c = o, l = s,
|
|
5074
|
-
function
|
|
5075
|
-
if (
|
|
5076
|
-
let e =
|
|
5077
|
-
e && (e.addEventListener("click",
|
|
5149
|
+
let c = o, l = s, ee = `choropleth-gradient-${y()}`, d = p(null), h = p(null), v = p(null), b = p(0), x = null, S = null, C = !1, ie = typeof window < "u" && "ontouchstart" in window, w = null, T = null;
|
|
5150
|
+
function E() {
|
|
5151
|
+
if (ie) return;
|
|
5152
|
+
let e = v.value;
|
|
5153
|
+
e && (e.addEventListener("click", G), e.addEventListener("mouseover", G), e.addEventListener("mousemove", ke), e.addEventListener("mouseout", Ae));
|
|
5078
5154
|
}
|
|
5079
|
-
function
|
|
5080
|
-
let e =
|
|
5081
|
-
e && (e.removeEventListener("click",
|
|
5155
|
+
function D() {
|
|
5156
|
+
let e = v.value;
|
|
5157
|
+
e && (e.removeEventListener("click", G), e.removeEventListener("mouseover", G), e.removeEventListener("mousemove", ke), e.removeEventListener("mouseout", Ae));
|
|
5082
5158
|
}
|
|
5083
|
-
|
|
5084
|
-
|
|
5159
|
+
te(() => {
|
|
5160
|
+
d.value && (b.value = d.value.clientWidth, w = new ResizeObserver((e) => {
|
|
5085
5161
|
let t = e[0];
|
|
5086
|
-
t && (
|
|
5087
|
-
}),
|
|
5088
|
-
}),
|
|
5089
|
-
|
|
5162
|
+
t && (b.value = t.contentRect.width);
|
|
5163
|
+
}), w.observe(d.value)), O(), E();
|
|
5164
|
+
}), ne(() => {
|
|
5165
|
+
w?.disconnect(), ae(), D(), Ee();
|
|
5090
5166
|
});
|
|
5091
|
-
function
|
|
5092
|
-
if (!
|
|
5093
|
-
let e =
|
|
5094
|
-
|
|
5095
|
-
|
|
5167
|
+
function O() {
|
|
5168
|
+
if (!h.value || !v.value || !c.zoom && !c.pan) return;
|
|
5169
|
+
let e = se(h.value);
|
|
5170
|
+
T = A().scaleExtent(c.zoom ? [1, 12] : [1, 1]).on("start", () => {
|
|
5171
|
+
C = !0, Oe();
|
|
5096
5172
|
}).on("zoom", (e) => {
|
|
5097
|
-
|
|
5173
|
+
v.value && v.value.setAttribute("transform", e.transform);
|
|
5098
5174
|
}).on("end", () => {
|
|
5099
|
-
|
|
5100
|
-
}), c.pan ||
|
|
5175
|
+
C = !1;
|
|
5176
|
+
}), c.pan || T.filter((e) => e.type === "wheel" || e.type === "dblclick"), e.call(T);
|
|
5101
5177
|
}
|
|
5102
|
-
function
|
|
5103
|
-
|
|
5178
|
+
function ae() {
|
|
5179
|
+
h.value && T && (se(h.value).on(".zoom", null), T = null);
|
|
5104
5180
|
}
|
|
5105
|
-
|
|
5106
|
-
|
|
5181
|
+
re(() => [c.zoom, c.pan], () => {
|
|
5182
|
+
ae(), D(), O(), E();
|
|
5107
5183
|
});
|
|
5108
|
-
let
|
|
5109
|
-
let e =
|
|
5184
|
+
let P = t(() => c.width ?? (b.value || 600)), ce = t(() => c.width && c.height ? c.height / c.width : .625), F = t(() => P.value * ce.value), I = t(() => {
|
|
5185
|
+
let e = _(c.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
|
|
5110
5186
|
for (let e of t) {
|
|
5111
|
-
let t =
|
|
5187
|
+
let t = We[String(e.id).padStart(5, "0")];
|
|
5112
5188
|
t && (n.has(t) || n.set(t, []), n.get(t).push(e));
|
|
5113
5189
|
}
|
|
5114
5190
|
let r = [];
|
|
5115
5191
|
for (let [t, i] of n) r.push({
|
|
5116
5192
|
type: "Feature",
|
|
5117
5193
|
id: t,
|
|
5118
|
-
properties: { name:
|
|
5119
|
-
geometry:
|
|
5194
|
+
properties: { name: Ge[t] ?? t },
|
|
5195
|
+
geometry: M(e, i)
|
|
5120
5196
|
});
|
|
5121
5197
|
return {
|
|
5122
5198
|
type: "FeatureCollection",
|
|
5123
5199
|
features: r
|
|
5124
5200
|
};
|
|
5125
|
-
}),
|
|
5126
|
-
if (c.geoType === "hsas") return
|
|
5201
|
+
}), L = t(() => {
|
|
5202
|
+
if (c.geoType === "hsas") return I.value;
|
|
5127
5203
|
if (c.geoType === "counties") {
|
|
5128
|
-
let e =
|
|
5129
|
-
return
|
|
5204
|
+
let e = _(c.topology);
|
|
5205
|
+
return j(e, e.objects.counties);
|
|
5130
5206
|
}
|
|
5131
|
-
let e =
|
|
5132
|
-
return
|
|
5133
|
-
}),
|
|
5207
|
+
let e = _(c.topology);
|
|
5208
|
+
return j(e, e.objects.states);
|
|
5209
|
+
}), fe = t(() => {
|
|
5134
5210
|
if (c.geoType !== "counties" && c.geoType !== "hsas") return null;
|
|
5135
|
-
let e =
|
|
5136
|
-
return
|
|
5137
|
-
}),
|
|
5211
|
+
let e = _(c.topology);
|
|
5212
|
+
return N(e, e.objects.states, (e, t) => e !== t);
|
|
5213
|
+
}), R = t(() => oe().fitExtent([[0, Ie.value], [P.value, F.value + Ie.value]], L.value)), z = t(() => k(R.value)), B = t(() => c.geoType === "counties" || c.geoType === "hsas" ? c.strokeWidth * .5 : c.strokeWidth), me = t(() => {
|
|
5138
5214
|
let e = /* @__PURE__ */ new Map();
|
|
5139
5215
|
if (!c.data) return e;
|
|
5140
5216
|
for (let t of c.data) {
|
|
5141
5217
|
e.set(t.id, t.value);
|
|
5142
|
-
let n =
|
|
5218
|
+
let n = L.value.features.find((e) => e.properties?.name === t.id);
|
|
5143
5219
|
n?.id != null && e.set(String(n.id), t.value);
|
|
5144
5220
|
}
|
|
5145
5221
|
return e;
|
|
5146
|
-
}),
|
|
5222
|
+
}), he = t(() => {
|
|
5147
5223
|
if (!c.data || c.data.length === 0) return {
|
|
5148
5224
|
min: 0,
|
|
5149
5225
|
max: 1
|
|
@@ -5160,8 +5236,8 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5160
5236
|
min: 0,
|
|
5161
5237
|
max: 1
|
|
5162
5238
|
};
|
|
5163
|
-
}),
|
|
5164
|
-
function
|
|
5239
|
+
}), V = t(() => Array.isArray(c.colorScale) && c.colorScale.length > 0 && "value" in c.colorScale[0]), H = t(() => Array.isArray(c.colorScale) && !V.value), ge = t(() => H.value ? "" : c.colorScale?.min ?? "#e5f0fa"), _e = t(() => H.value ? "" : c.colorScale?.max ?? "#08519c");
|
|
5240
|
+
function ve(e) {
|
|
5165
5241
|
let t = e.replace("#", "");
|
|
5166
5242
|
return [
|
|
5167
5243
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -5169,103 +5245,103 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5169
5245
|
parseInt(t.slice(4, 6), 16)
|
|
5170
5246
|
];
|
|
5171
5247
|
}
|
|
5172
|
-
function
|
|
5173
|
-
let [t, n, r] = ge
|
|
5248
|
+
function ye(e) {
|
|
5249
|
+
let [t, n, r] = ve(ge.value), [i, a, o] = ve(_e.value);
|
|
5174
5250
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
5175
5251
|
}
|
|
5176
|
-
function
|
|
5252
|
+
function be(e) {
|
|
5177
5253
|
let t = c.colorScale.slice().sort((e, t) => t.min - e.min);
|
|
5178
5254
|
for (let n of t) if (e >= n.min) return n.color;
|
|
5179
5255
|
return c.noDataColor;
|
|
5180
5256
|
}
|
|
5181
|
-
function
|
|
5257
|
+
function xe(e) {
|
|
5182
5258
|
let t = c.colorScale.find((t) => t.value === String(e));
|
|
5183
5259
|
return t ? t.color : c.noDataColor;
|
|
5184
5260
|
}
|
|
5185
|
-
function
|
|
5186
|
-
let t =
|
|
5261
|
+
function Se(e) {
|
|
5262
|
+
let t = me.value.get(String(e));
|
|
5187
5263
|
if (t == null) return c.noDataColor;
|
|
5188
|
-
if (
|
|
5189
|
-
if (
|
|
5190
|
-
let { min: n, max: r } =
|
|
5191
|
-
return
|
|
5264
|
+
if (V.value) return xe(t);
|
|
5265
|
+
if (H.value) return be(t);
|
|
5266
|
+
let { min: n, max: r } = he.value;
|
|
5267
|
+
return ye((t - n) / (r - n));
|
|
5192
5268
|
}
|
|
5193
|
-
function
|
|
5269
|
+
function U(e) {
|
|
5194
5270
|
return e.properties?.name ?? String(e.id);
|
|
5195
5271
|
}
|
|
5196
|
-
function
|
|
5197
|
-
return
|
|
5272
|
+
function W(e) {
|
|
5273
|
+
return me.value.get(String(e.id));
|
|
5198
5274
|
}
|
|
5199
|
-
let
|
|
5275
|
+
let Ce = t(() => {
|
|
5200
5276
|
let e = /* @__PURE__ */ new Map();
|
|
5201
|
-
for (let t of
|
|
5277
|
+
for (let t of L.value.features) e.set(String(t.id), t);
|
|
5202
5278
|
return e;
|
|
5203
5279
|
});
|
|
5204
|
-
function
|
|
5280
|
+
function we(e) {
|
|
5205
5281
|
let t = e;
|
|
5206
5282
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
5207
5283
|
if (!t) return null;
|
|
5208
|
-
let n =
|
|
5284
|
+
let n = Ce.value.get(t.dataset.featId);
|
|
5209
5285
|
return n ? {
|
|
5210
5286
|
pathEl: t,
|
|
5211
5287
|
feat: n
|
|
5212
5288
|
} : null;
|
|
5213
5289
|
}
|
|
5214
|
-
function
|
|
5215
|
-
|
|
5216
|
-
let r =
|
|
5290
|
+
function Te(e, t, n) {
|
|
5291
|
+
S || (S = document.createElement("div"), S.className = "chart-tooltip-content", S.style.position = "fixed", S.style.transform = "translateY(-50%)", document.body.appendChild(S));
|
|
5292
|
+
let r = U(e), i = W(e), a = {
|
|
5217
5293
|
id: String(e.id),
|
|
5218
5294
|
name: r,
|
|
5219
5295
|
value: i
|
|
5220
5296
|
};
|
|
5221
|
-
c.tooltipFormat ?
|
|
5222
|
-
let o =
|
|
5223
|
-
|
|
5297
|
+
c.tooltipFormat ? S.innerHTML = c.tooltipFormat(a) : S.textContent = i == null ? r : `${r}: ${i}`;
|
|
5298
|
+
let o = d.value?.getBoundingClientRect(), { left: s, top: l } = pe(t, n, S.offsetWidth, S.offsetHeight, c.tooltipClamp, o);
|
|
5299
|
+
S.style.left = `${s}px`, S.style.top = `${l}px`;
|
|
5224
5300
|
}
|
|
5225
|
-
function
|
|
5226
|
-
|
|
5301
|
+
function Ee() {
|
|
5302
|
+
S &&= (S.remove(), null);
|
|
5227
5303
|
}
|
|
5228
|
-
function
|
|
5229
|
-
|
|
5304
|
+
function De(e, t) {
|
|
5305
|
+
x && x !== e && (x.setAttribute("stroke-width", String(B.value)), x.setAttribute("stroke", c.strokeColor)), x = e, e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(B.value + 1)), e.setAttribute("stroke", "#555");
|
|
5230
5306
|
}
|
|
5231
|
-
function
|
|
5232
|
-
|
|
5307
|
+
function Oe() {
|
|
5308
|
+
x && (x.setAttribute("stroke-width", String(B.value)), x.setAttribute("stroke", c.strokeColor), x = null, l("stateHover", null)), Ee();
|
|
5233
5309
|
}
|
|
5234
|
-
function
|
|
5235
|
-
if (
|
|
5236
|
-
let t = e, n =
|
|
5310
|
+
function G(e) {
|
|
5311
|
+
if (C) return;
|
|
5312
|
+
let t = e, n = we(t.target);
|
|
5237
5313
|
n && (e.type === "click" ? l("stateClick", {
|
|
5238
5314
|
id: String(n.feat.id),
|
|
5239
|
-
name:
|
|
5240
|
-
value:
|
|
5241
|
-
}) : e.type === "mouseover" && (
|
|
5315
|
+
name: U(n.feat),
|
|
5316
|
+
value: W(n.feat)
|
|
5317
|
+
}) : e.type === "mouseover" && (De(n.pathEl, n.feat), c.tooltipTrigger && Te(n.feat, t.clientX, t.clientY), l("stateHover", {
|
|
5242
5318
|
id: String(n.feat.id),
|
|
5243
|
-
name:
|
|
5244
|
-
value:
|
|
5319
|
+
name: U(n.feat),
|
|
5320
|
+
value: W(n.feat)
|
|
5245
5321
|
})));
|
|
5246
5322
|
}
|
|
5247
|
-
function
|
|
5248
|
-
|
|
5323
|
+
function ke(e) {
|
|
5324
|
+
C || !S || (S.style.left = `${e.clientX + 16}px`, S.style.top = `${e.clientY}px`);
|
|
5249
5325
|
}
|
|
5250
|
-
function
|
|
5326
|
+
function Ae(e) {
|
|
5251
5327
|
let t = e.relatedTarget;
|
|
5252
|
-
t &&
|
|
5328
|
+
t && v.value?.contains(t) || Oe();
|
|
5253
5329
|
}
|
|
5254
|
-
function
|
|
5330
|
+
function je() {
|
|
5255
5331
|
return typeof c.menu == "string" ? c.menu : "choropleth";
|
|
5256
5332
|
}
|
|
5257
|
-
let
|
|
5333
|
+
let Me = t(() => c.legend && (V.value || H.value || c.data)), Ne = t(() => c.colorScale.slice().sort((e, t) => e.min - t.min)), Pe = t(() => c.title ? 24 : 0), Fe = t(() => Me.value ? 28 : 0), Ie = t(() => Pe.value + Fe.value), Le = t(() => F.value + Ie.value), Re = t(() => Pe.value + 18), ze = t(() => {
|
|
5258
5334
|
let e = [];
|
|
5259
5335
|
for (let t = 0; t <= 10; t++) {
|
|
5260
5336
|
let n = t / 10;
|
|
5261
5337
|
e.push({
|
|
5262
5338
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
5263
|
-
color:
|
|
5339
|
+
color: ye(n)
|
|
5264
5340
|
});
|
|
5265
5341
|
}
|
|
5266
5342
|
return e;
|
|
5267
|
-
}),
|
|
5268
|
-
let { min: e, max: t } =
|
|
5343
|
+
}), K = t(() => {
|
|
5344
|
+
let { min: e, max: t } = he.value, n = t - e, r = [];
|
|
5269
5345
|
for (let t = 1; t <= 3; t++) {
|
|
5270
5346
|
let i = t / 4, a = e + n * i, o = Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
5271
5347
|
r.push({
|
|
@@ -5274,118 +5350,118 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5274
5350
|
});
|
|
5275
5351
|
}
|
|
5276
5352
|
return r;
|
|
5277
|
-
}),
|
|
5353
|
+
}), q = t(() => {
|
|
5278
5354
|
let e = [];
|
|
5279
|
-
if (
|
|
5355
|
+
if (V.value) for (let t of c.colorScale) e.push({
|
|
5280
5356
|
key: t.value,
|
|
5281
5357
|
color: t.color,
|
|
5282
5358
|
label: t.value
|
|
5283
5359
|
});
|
|
5284
|
-
else if (
|
|
5360
|
+
else if (H.value) for (let t of Ne.value) e.push({
|
|
5285
5361
|
key: String(t.min),
|
|
5286
5362
|
color: t.color,
|
|
5287
5363
|
label: t.label ?? String(t.min)
|
|
5288
5364
|
});
|
|
5289
5365
|
return e;
|
|
5290
|
-
}),
|
|
5366
|
+
}), Be = t(() => {
|
|
5291
5367
|
let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
|
|
5292
|
-
for (let t of
|
|
5293
|
-
return e - (
|
|
5294
|
-
}),
|
|
5368
|
+
for (let t of q.value) e += 16 + t.label.length * 7 + 12;
|
|
5369
|
+
return e - (q.value.length > 0 ? 12 : 0);
|
|
5370
|
+
}), Ve = t(() => {
|
|
5295
5371
|
let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
|
|
5296
|
-
return
|
|
5372
|
+
return q.value.map((t) => {
|
|
5297
5373
|
let n = e;
|
|
5298
5374
|
return e += 16 + t.label.length * 7 + 12, n;
|
|
5299
5375
|
});
|
|
5300
|
-
}),
|
|
5301
|
-
if (
|
|
5376
|
+
}), He = t(() => {
|
|
5377
|
+
if (V.value || H.value) return (P.value - Be.value) / 2;
|
|
5302
5378
|
let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
|
|
5303
|
-
return (
|
|
5304
|
-
}),
|
|
5305
|
-
let e =
|
|
5379
|
+
return (P.value - e - 160) / 2;
|
|
5380
|
+
}), Ue = t(() => {
|
|
5381
|
+
let e = je();
|
|
5306
5382
|
return [{
|
|
5307
5383
|
label: "Save as SVG",
|
|
5308
5384
|
action: () => {
|
|
5309
|
-
|
|
5385
|
+
h.value && ue(h.value, e);
|
|
5310
5386
|
}
|
|
5311
5387
|
}, {
|
|
5312
5388
|
label: "Save as PNG",
|
|
5313
5389
|
action: () => {
|
|
5314
|
-
|
|
5390
|
+
h.value && de(h.value, e);
|
|
5315
5391
|
}
|
|
5316
5392
|
}];
|
|
5317
5393
|
});
|
|
5318
|
-
return (t, s) => (
|
|
5394
|
+
return (t, s) => (f(), i("div", {
|
|
5319
5395
|
ref_key: "containerRef",
|
|
5320
|
-
ref:
|
|
5396
|
+
ref: d,
|
|
5321
5397
|
class: u(["choropleth-wrapper", { pannable: o.pan }])
|
|
5322
|
-
}, [o.menu ? (
|
|
5398
|
+
}, [o.menu ? (f(), n(le, {
|
|
5323
5399
|
key: 0,
|
|
5324
|
-
items:
|
|
5325
|
-
}, null, 8, ["items"])) : r("", !0), (
|
|
5400
|
+
items: Ue.value
|
|
5401
|
+
}, null, 8, ["items"])) : r("", !0), (f(), i("svg", {
|
|
5326
5402
|
ref_key: "svgRef",
|
|
5327
|
-
ref:
|
|
5328
|
-
width:
|
|
5329
|
-
height:
|
|
5403
|
+
ref: h,
|
|
5404
|
+
width: P.value,
|
|
5405
|
+
height: Le.value
|
|
5330
5406
|
}, [
|
|
5331
5407
|
a("g", {
|
|
5332
5408
|
ref_key: "mapGroupRef",
|
|
5333
|
-
ref:
|
|
5334
|
-
}, [(
|
|
5409
|
+
ref: v
|
|
5410
|
+
}, [(f(!0), i(e, null, m(L.value.features, (e) => (f(), i("path", {
|
|
5335
5411
|
key: String(e.id),
|
|
5336
5412
|
"data-feat-id": String(e.id),
|
|
5337
|
-
d:
|
|
5338
|
-
fill:
|
|
5413
|
+
d: z.value(e) ?? void 0,
|
|
5414
|
+
fill: Se(e.id),
|
|
5339
5415
|
stroke: o.strokeColor,
|
|
5340
|
-
"stroke-width":
|
|
5416
|
+
"stroke-width": B.value,
|
|
5341
5417
|
class: "state-path"
|
|
5342
|
-
}, [o.tooltipTrigger ? r("", !0) : (
|
|
5418
|
+
}, [o.tooltipTrigger ? r("", !0) : (f(), i("title", Je, g(U(e)) + g(W(e) == null ? "" : `: ${W(e)}`), 1))], 8, qe))), 128)), fe.value ? (f(), i("path", {
|
|
5343
5419
|
key: 0,
|
|
5344
|
-
d:
|
|
5420
|
+
d: z.value(fe.value) ?? void 0,
|
|
5345
5421
|
fill: "none",
|
|
5346
5422
|
stroke: o.strokeColor,
|
|
5347
5423
|
"stroke-width": 1,
|
|
5348
5424
|
"stroke-linejoin": "round",
|
|
5349
5425
|
"pointer-events": "none"
|
|
5350
|
-
}, null, 8,
|
|
5351
|
-
|
|
5426
|
+
}, null, 8, Ye)) : r("", !0)], 512),
|
|
5427
|
+
Me.value ? (f(), i("g", {
|
|
5352
5428
|
key: 0,
|
|
5353
5429
|
class: "choropleth-legend",
|
|
5354
|
-
transform: `translate(${
|
|
5355
|
-
}, [
|
|
5356
|
-
x:
|
|
5430
|
+
transform: `translate(${He.value},${Re.value})`
|
|
5431
|
+
}, [V.value || H.value ? (f(), i(e, { key: 0 }, [o.legendTitle ? (f(), i("text", Xe, g(o.legendTitle), 1)) : r("", !0), (f(!0), i(e, null, m(q.value, (t, n) => (f(), i(e, { key: t.key }, [a("rect", {
|
|
5432
|
+
x: Ve.value[n],
|
|
5357
5433
|
y: -5,
|
|
5358
5434
|
width: "12",
|
|
5359
5435
|
height: "12",
|
|
5360
5436
|
rx: "3",
|
|
5361
5437
|
fill: t.color
|
|
5362
|
-
}, null, 8,
|
|
5363
|
-
x:
|
|
5438
|
+
}, null, 8, X), a("text", {
|
|
5439
|
+
x: Ve.value[n] + 16,
|
|
5364
5440
|
y: 5,
|
|
5365
5441
|
"font-size": "13",
|
|
5366
5442
|
fill: "currentColor"
|
|
5367
|
-
},
|
|
5368
|
-
o.legendTitle ? (
|
|
5443
|
+
}, g(t.label), 9, Ze)], 64))), 128))], 64)) : (f(), i(e, { key: 1 }, [
|
|
5444
|
+
o.legendTitle ? (f(), i("text", Qe, g(o.legendTitle), 1)) : r("", !0),
|
|
5369
5445
|
a("defs", null, [a("linearGradient", {
|
|
5370
|
-
id:
|
|
5446
|
+
id: ee,
|
|
5371
5447
|
x1: "0",
|
|
5372
5448
|
x2: "1",
|
|
5373
5449
|
y1: "0",
|
|
5374
5450
|
y2: "0"
|
|
5375
|
-
}, [(
|
|
5451
|
+
}, [(f(!0), i(e, null, m(ze.value, (e) => (f(), i("stop", {
|
|
5376
5452
|
key: e.offset,
|
|
5377
5453
|
offset: e.offset,
|
|
5378
5454
|
"stop-color": e.color
|
|
5379
|
-
}, null, 8,
|
|
5455
|
+
}, null, 8, $e))), 128))])]),
|
|
5380
5456
|
a("rect", {
|
|
5381
5457
|
x: o.legendTitle ? o.legendTitle.length * 8 + 12 : 0,
|
|
5382
5458
|
y: -6,
|
|
5383
5459
|
width: 160,
|
|
5384
5460
|
height: 12,
|
|
5385
5461
|
rx: "2",
|
|
5386
|
-
fill: `url(#${
|
|
5387
|
-
}, null, 8,
|
|
5388
|
-
(
|
|
5462
|
+
fill: `url(#${ee})`
|
|
5463
|
+
}, null, 8, et),
|
|
5464
|
+
(f(!0), i(e, null, m(K.value, (e) => (f(), i("text", {
|
|
5389
5465
|
key: e.value,
|
|
5390
5466
|
x: (o.legendTitle ? o.legendTitle.length * 8 + 12 : 0) + e.pct / 100 * 160,
|
|
5391
5467
|
y: 20,
|
|
@@ -5393,20 +5469,20 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5393
5469
|
fill: "currentColor",
|
|
5394
5470
|
opacity: "0.7",
|
|
5395
5471
|
"text-anchor": "middle"
|
|
5396
|
-
},
|
|
5397
|
-
], 64))], 8,
|
|
5398
|
-
o.title ? (
|
|
5472
|
+
}, g(e.value), 9, tt))), 128))
|
|
5473
|
+
], 64))], 8, Y)) : r("", !0),
|
|
5474
|
+
o.title ? (f(), i("text", {
|
|
5399
5475
|
key: 1,
|
|
5400
|
-
x:
|
|
5476
|
+
x: P.value / 2,
|
|
5401
5477
|
y: 18,
|
|
5402
5478
|
"text-anchor": "middle",
|
|
5403
5479
|
"font-size": "14",
|
|
5404
5480
|
"font-weight": "600",
|
|
5405
5481
|
fill: "currentColor"
|
|
5406
|
-
},
|
|
5407
|
-
], 8,
|
|
5482
|
+
}, g(o.title), 9, nt)) : r("", !0)
|
|
5483
|
+
], 8, Ke))], 2));
|
|
5408
5484
|
}
|
|
5409
|
-
}), [["__scopeId", "data-v-25a20d5b"]]),
|
|
5485
|
+
}), [["__scopeId", "data-v-25a20d5b"]]), rt = /* @__PURE__ */ I(/* @__PURE__ */ c({
|
|
5410
5486
|
__name: "ChartTooltip",
|
|
5411
5487
|
props: {
|
|
5412
5488
|
x: {},
|
|
@@ -5417,30 +5493,30 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5417
5493
|
},
|
|
5418
5494
|
emits: ["close"],
|
|
5419
5495
|
setup(e) {
|
|
5420
|
-
return (t, o) => e.mode === "hover" && e.open ? (
|
|
5496
|
+
return (t, o) => e.mode === "hover" && e.open ? (f(), i("div", {
|
|
5421
5497
|
key: 0,
|
|
5422
5498
|
class: "chart-tooltip-content",
|
|
5423
|
-
style:
|
|
5499
|
+
style: d({
|
|
5424
5500
|
position: "absolute",
|
|
5425
5501
|
left: `${e.x + e.sideOffset}px`,
|
|
5426
5502
|
top: `${e.y}px`,
|
|
5427
5503
|
transform: "translateY(-50%)"
|
|
5428
5504
|
})
|
|
5429
|
-
}, [
|
|
5505
|
+
}, [h(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (f(), n(v(ae), {
|
|
5430
5506
|
key: 1,
|
|
5431
5507
|
open: e.open
|
|
5432
5508
|
}, {
|
|
5433
|
-
default:
|
|
5434
|
-
default:
|
|
5509
|
+
default: b(() => [s(v(E), { "as-child": "" }, {
|
|
5510
|
+
default: b(() => [a("div", {
|
|
5435
5511
|
class: "chart-tooltip-anchor",
|
|
5436
|
-
style:
|
|
5512
|
+
style: d({
|
|
5437
5513
|
left: `${e.x}px`,
|
|
5438
5514
|
top: `${e.y}px`
|
|
5439
5515
|
})
|
|
5440
5516
|
}, null, 4)]),
|
|
5441
5517
|
_: 1
|
|
5442
|
-
}), s(
|
|
5443
|
-
default:
|
|
5518
|
+
}), s(v(O), null, {
|
|
5519
|
+
default: b(() => [e.open ? (f(), n(v(D), {
|
|
5444
5520
|
key: 0,
|
|
5445
5521
|
class: "chart-tooltip-content",
|
|
5446
5522
|
side: "right",
|
|
@@ -5449,7 +5525,7 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5449
5525
|
onPointerDownOutside: o[0] ||= (e) => t.$emit("close"),
|
|
5450
5526
|
onEscapeKeyDown: o[1] ||= (e) => t.$emit("close")
|
|
5451
5527
|
}, {
|
|
5452
|
-
default:
|
|
5528
|
+
default: b(() => [h(t.$slots, "default", {}, void 0, !0)]),
|
|
5453
5529
|
_: 3
|
|
5454
5530
|
}, 8, ["side-offset"])) : r("", !0)]),
|
|
5455
5531
|
_: 3
|
|
@@ -5457,7 +5533,7 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5457
5533
|
_: 3
|
|
5458
5534
|
}, 8, ["open"])) : r("", !0);
|
|
5459
5535
|
}
|
|
5460
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
5536
|
+
}), [["__scopeId", "data-v-44377f70"]]), it = { class: "TableWrapper" }, Q = { class: "Table" }, $ = ["href", "download"], at = /* @__PURE__ */ I(/* @__PURE__ */ c({
|
|
5461
5537
|
__name: "DataTable",
|
|
5462
5538
|
props: {
|
|
5463
5539
|
data: {},
|
|
@@ -5480,7 +5556,7 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5480
5556
|
function l(e) {
|
|
5481
5557
|
return c.columnConfig?.[e]?.label ?? e;
|
|
5482
5558
|
}
|
|
5483
|
-
function
|
|
5559
|
+
function ee(e) {
|
|
5484
5560
|
let t = c.columnConfig?.[e]?.width;
|
|
5485
5561
|
if (t == null) return;
|
|
5486
5562
|
let n = typeof t == "number" ? `${t}px` : s[t];
|
|
@@ -5489,16 +5565,16 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5489
5565
|
minWidth: n
|
|
5490
5566
|
};
|
|
5491
5567
|
}
|
|
5492
|
-
function
|
|
5568
|
+
function te(e) {
|
|
5493
5569
|
let t = c.columnConfig?.[e]?.align;
|
|
5494
5570
|
if (t) return { textAlign: t };
|
|
5495
5571
|
}
|
|
5496
|
-
function
|
|
5572
|
+
function ne(e) {
|
|
5497
5573
|
return typeof e.column == "function";
|
|
5498
5574
|
}
|
|
5499
|
-
let
|
|
5575
|
+
let p = t(() => {
|
|
5500
5576
|
let e = c.data;
|
|
5501
|
-
return
|
|
5577
|
+
return ne(e) ? e.columns.map((t) => ({
|
|
5502
5578
|
name: t.name,
|
|
5503
5579
|
values: e.column(t.name),
|
|
5504
5580
|
enumLabels: t.enumLabels
|
|
@@ -5506,65 +5582,65 @@ var H = ["width", "height"], fe = ["x"], pe = { key: 1 }, U = [
|
|
|
5506
5582
|
name: e,
|
|
5507
5583
|
values: t
|
|
5508
5584
|
}));
|
|
5509
|
-
}),
|
|
5510
|
-
let e =
|
|
5585
|
+
}), h = t(() => {
|
|
5586
|
+
let e = p.value;
|
|
5511
5587
|
if (e.length === 0) return 0;
|
|
5512
5588
|
let t = 0;
|
|
5513
5589
|
for (let n of e) t = Math.max(t, n.values.length);
|
|
5514
5590
|
return c.maxRows ? Math.min(t, c.maxRows) : t;
|
|
5515
5591
|
});
|
|
5516
|
-
function
|
|
5592
|
+
function _(e, t) {
|
|
5517
5593
|
let n = e.values[t];
|
|
5518
5594
|
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);
|
|
5519
5595
|
}
|
|
5520
|
-
function
|
|
5596
|
+
function v() {
|
|
5521
5597
|
return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
|
|
5522
5598
|
}
|
|
5523
|
-
function
|
|
5599
|
+
function y(e) {
|
|
5524
5600
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
5525
5601
|
}
|
|
5526
|
-
function
|
|
5602
|
+
function re() {
|
|
5527
5603
|
if (typeof c.csv == "function") return c.csv();
|
|
5528
5604
|
if (typeof c.csv == "string") return c.csv;
|
|
5529
|
-
let e =
|
|
5605
|
+
let e = p.value, t = h.value, n = [e.map((e) => y(l(e.name))).join(",")];
|
|
5530
5606
|
for (let r = 0; r < t; r++) {
|
|
5531
|
-
let t = e.map((e) =>
|
|
5607
|
+
let t = e.map((e) => y(_(e, r)));
|
|
5532
5608
|
n.push(t.join(","));
|
|
5533
5609
|
}
|
|
5534
5610
|
return n.join("\n");
|
|
5535
5611
|
}
|
|
5536
|
-
let
|
|
5612
|
+
let b = t(() => c.downloadLink ? [] : [{
|
|
5537
5613
|
label: "Download CSV",
|
|
5538
|
-
action: () =>
|
|
5539
|
-
}]),
|
|
5540
|
-
return (t, s) => (
|
|
5541
|
-
|
|
5614
|
+
action: () => fe(re(), v())
|
|
5615
|
+
}]), x = t(() => c.downloadLink ? typeof c.downloadLink == "string" ? c.downloadLink : "Download data (CSV)" : null), S = t(() => c.downloadLink ? `data:text/csv;charset=utf-8,${encodeURIComponent(re())}` : null), C = t(() => c.menu && b.value.length > 0);
|
|
5616
|
+
return (t, s) => (f(), i("div", { class: u(["TableOuter", { "has-menu": C.value }]) }, [
|
|
5617
|
+
C.value ? (f(), n(le, {
|
|
5542
5618
|
key: 0,
|
|
5543
|
-
items:
|
|
5619
|
+
items: b.value
|
|
5544
5620
|
}, null, 8, ["items"])) : r("", !0),
|
|
5545
|
-
a("div",
|
|
5546
|
-
a("colgroup", null, [(
|
|
5621
|
+
a("div", it, [a("table", Q, [
|
|
5622
|
+
a("colgroup", null, [(f(!0), i(e, null, m(p.value, (e) => (f(), i("col", {
|
|
5547
5623
|
key: e.name,
|
|
5548
|
-
style:
|
|
5624
|
+
style: d(ee(e.name))
|
|
5549
5625
|
}, null, 4))), 128))]),
|
|
5550
|
-
a("thead", null, [a("tr", null, [(
|
|
5626
|
+
a("thead", null, [a("tr", null, [(f(!0), i(e, null, m(p.value, (e) => (f(), i("th", {
|
|
5551
5627
|
key: e.name,
|
|
5552
|
-
style:
|
|
5553
|
-
},
|
|
5554
|
-
a("tbody", null, [(
|
|
5628
|
+
style: d(te(e.name))
|
|
5629
|
+
}, g(l(e.name)), 5))), 128))])]),
|
|
5630
|
+
a("tbody", null, [(f(!0), i(e, null, m(h.value, (t) => (f(), i("tr", { key: t }, [(f(!0), i(e, null, m(p.value, (e) => (f(), i("td", {
|
|
5555
5631
|
key: e.name,
|
|
5556
5632
|
class: u(o.columnConfig?.[e.name]?.cellClass),
|
|
5557
|
-
style:
|
|
5558
|
-
},
|
|
5633
|
+
style: d(te(e.name))
|
|
5634
|
+
}, g(_(e, t - 1)), 7))), 128))]))), 128))])
|
|
5559
5635
|
])]),
|
|
5560
|
-
|
|
5636
|
+
x.value ? (f(), i("a", {
|
|
5561
5637
|
key: 1,
|
|
5562
5638
|
class: "data-table-download-link",
|
|
5563
|
-
href:
|
|
5564
|
-
download: `${
|
|
5565
|
-
},
|
|
5639
|
+
href: S.value,
|
|
5640
|
+
download: `${v()}.csv`
|
|
5641
|
+
}, g(x.value), 9, $)) : r("", !0)
|
|
5566
5642
|
], 2));
|
|
5567
5643
|
}
|
|
5568
5644
|
}), [["__scopeId", "data-v-505e2187"]]);
|
|
5569
5645
|
//#endregion
|
|
5570
|
-
export {
|
|
5646
|
+
export { rt as ChartTooltip, Z as ChoroplethMap, at as DataTable, J as LineChart };
|