@cfasim-ui/charts 0.5.0 → 0.6.0
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/{src/BarChart → BarChart}/BarChart.d.ts +2 -2
- package/dist/{src/ChartMenu → ChartMenu}/ChartMenu.d.ts +11 -1
- package/dist/{src/ChoroplethMap → ChoroplethMap}/ChoroplethMap.d.ts +11 -2
- package/dist/{src/LineChart → LineChart}/LineChart.d.ts +13 -2
- package/dist/{src/_shared → _shared}/chartProps.d.ts +10 -0
- package/dist/{src/_shared → _shared}/useChartFoundation.d.ts +10 -0
- package/dist/_shared/useChartFullscreen.d.ts +40 -0
- package/dist/{src/_shared → _shared}/useChartMenu.d.ts +10 -5
- package/dist/{src/_shared → _shared}/useChartTooltip.d.ts +7 -0
- package/dist/_shared/useChartTooltip.test.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1061 -927
- package/package.json +2 -2
- package/dist/src/_shared/useChartFullscreen.d.ts +0 -16
- /package/dist/{src/BarChart → BarChart}/BarChart.spec.d.ts +0 -0
- /package/dist/{src/BarChart → BarChart}/BarChart.test.d.ts +0 -0
- /package/dist/{src/ChartMenu → ChartMenu}/download.d.ts +0 -0
- /package/dist/{src/ChartMenu → ChartMenu}/download.test.d.ts +0 -0
- /package/dist/{src/ChartTooltip → ChartTooltip}/ChartTooltip.d.ts +0 -0
- /package/dist/{src/ChartTooltip → ChartTooltip}/ChartTooltip.test.d.ts +0 -0
- /package/dist/{src/ChoroplethMap → ChoroplethMap}/ChoroplethMap.test.d.ts +0 -0
- /package/dist/{src/ChoroplethMap → ChoroplethMap}/ChoroplethTooltip.d.ts +0 -0
- /package/dist/{src/ChoroplethMap → ChoroplethMap}/hsaMapping.d.ts +0 -0
- /package/dist/{src/DataTable → DataTable}/DataTable.d.ts +0 -0
- /package/dist/{src/DataTable → DataTable}/DataTable.test.d.ts +0 -0
- /package/dist/{src/LineChart → LineChart}/LineChart.spec.d.ts +0 -0
- /package/dist/{src/LineChart → LineChart}/LineChart.test.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/ChartAnnotations.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/annotations.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/axes.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/axes.test.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/computeTicks.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/computeTicks.test.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/contrast.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/contrast.test.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/dateAxis.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/dateAxis.test.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/index.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/scale.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/scale.test.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/seriesCsv.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/seriesCsv.test.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/useChartPadding.d.ts +0 -0
- /package/dist/{src/_shared → _shared}/useChartSize.d.ts +0 -0
- /package/dist/{src/hsa-mapping.d.ts → hsa-mapping.d.ts} +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/tooltip-position.d.ts → tooltip-position.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,32 +1,51 @@
|
|
|
1
1
|
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as b, toDisplayString as x, toHandlers as ee, toRaw as S, unref as C, useSlots as w, useTemplateRef as T, watch as E, withCtx as D } from "vue";
|
|
2
2
|
import { formatNumber as te } from "@cfasim-ui/shared";
|
|
3
|
-
import { DropdownMenuContent as O, DropdownMenuItem as k, DropdownMenuPortal as ne, DropdownMenuRoot as A, DropdownMenuTrigger as j, PopoverAnchor as
|
|
3
|
+
import { DropdownMenuContent as O, DropdownMenuItem as k, DropdownMenuPortal as ne, DropdownMenuRoot as A, DropdownMenuTrigger as j, PopoverAnchor as M, PopoverContent as re, PopoverPortal as ie, PopoverRoot as N } from "reka-ui";
|
|
4
4
|
import { geoAlbersUsa as ae, geoPath as P } from "d3-geo";
|
|
5
5
|
import { zoom as oe, zoomIdentity as se } from "d3-zoom";
|
|
6
6
|
import { select as ce } from "d3-selection";
|
|
7
7
|
import "d3-transition";
|
|
8
8
|
import { feature as F, merge as le, mesh as ue } from "topojson-client";
|
|
9
9
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var de = ["aria-label"], I = /* @__PURE__ */ l({
|
|
11
11
|
__name: "ChartMenu",
|
|
12
12
|
props: {
|
|
13
13
|
items: {},
|
|
14
14
|
forceDropdown: {
|
|
15
15
|
type: Boolean,
|
|
16
16
|
default: !1
|
|
17
|
+
},
|
|
18
|
+
isFullscreen: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
emits: ["close"],
|
|
24
|
+
setup(t, { emit: n }) {
|
|
25
|
+
let i = t, l = n, u = () => i.forceDropdown || i.items.length > 1;
|
|
26
|
+
return (n, i) => (_(), a("div", { class: f(["chart-menu-trigger-area", { "chart-menu-trigger-area--expanded": t.isFullscreen }]) }, [t.isFullscreen ? (_(), a("button", {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "chart-menu-button chart-close-button",
|
|
29
|
+
"aria-label": "Collapse",
|
|
30
|
+
onClick: i[0] ||= (e) => l("close")
|
|
31
|
+
}, [...i[2] ||= [o("svg", {
|
|
32
|
+
width: "16",
|
|
33
|
+
height: "16",
|
|
34
|
+
viewBox: "0 0 16 16",
|
|
35
|
+
fill: "none",
|
|
36
|
+
stroke: "currentColor",
|
|
37
|
+
"stroke-width": "1.75",
|
|
38
|
+
"stroke-linecap": "round",
|
|
39
|
+
"aria-hidden": "true"
|
|
40
|
+
}, [o("path", { d: "M4 4l8 8M12 4l-8 8" })], -1)]])) : u() ? (_(), r(C(A), {
|
|
41
|
+
key: 2,
|
|
23
42
|
modal: !1
|
|
24
43
|
}, {
|
|
25
44
|
default: D(() => [c(C(j), {
|
|
26
45
|
class: "chart-menu-button",
|
|
27
46
|
"aria-label": "Chart options"
|
|
28
47
|
}, {
|
|
29
|
-
default: D(() => [...
|
|
48
|
+
default: D(() => [...i[4] ||= [o("svg", {
|
|
30
49
|
width: "16",
|
|
31
50
|
height: "16",
|
|
32
51
|
viewBox: "0 0 16 16",
|
|
@@ -71,11 +90,11 @@ var I = { class: "chart-menu-trigger-area" }, de = ["aria-label"], fe = /* @__PU
|
|
|
71
90
|
})]),
|
|
72
91
|
_: 1
|
|
73
92
|
})) : (_(), a("button", {
|
|
74
|
-
key:
|
|
93
|
+
key: 1,
|
|
75
94
|
class: "chart-menu-button chart-menu-single",
|
|
76
95
|
"aria-label": t.items[0].label,
|
|
77
|
-
onClick:
|
|
78
|
-
}, [...
|
|
96
|
+
onClick: i[1] ||= (...e) => t.items[0].action && t.items[0].action(...e)
|
|
97
|
+
}, [...i[3] ||= [o("svg", {
|
|
79
98
|
width: "14",
|
|
80
99
|
height: "14",
|
|
81
100
|
viewBox: "0 0 14 14",
|
|
@@ -85,44 +104,44 @@ var I = { class: "chart-menu-trigger-area" }, de = ["aria-label"], fe = /* @__PU
|
|
|
85
104
|
"stroke-linecap": "round",
|
|
86
105
|
"stroke-linejoin": "round",
|
|
87
106
|
"aria-hidden": "true"
|
|
88
|
-
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, de))]));
|
|
107
|
+
}, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, de))], 2));
|
|
89
108
|
}
|
|
90
109
|
}), L = (e, t) => {
|
|
91
110
|
let n = e.__vccOpts || e;
|
|
92
111
|
for (let [e, r] of t) n[e] = r;
|
|
93
112
|
return n;
|
|
94
|
-
},
|
|
113
|
+
}, fe = /* @__PURE__ */ L(I, [["__scopeId", "data-v-f5743494"]]);
|
|
95
114
|
//#endregion
|
|
96
115
|
//#region src/_shared/axes.ts
|
|
97
116
|
function R(e) {
|
|
98
117
|
return Math.round(e) + .5;
|
|
99
118
|
}
|
|
100
|
-
function
|
|
119
|
+
function z(e, t) {
|
|
101
120
|
let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
|
|
102
121
|
return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
|
|
103
122
|
}
|
|
104
|
-
function
|
|
123
|
+
function B(e, t, n) {
|
|
105
124
|
if (!(n > 0) || !isFinite(n)) return [];
|
|
106
125
|
let r = [], i = Math.ceil(e / n) * n;
|
|
107
126
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
108
127
|
return r;
|
|
109
128
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
112
|
-
return Math.abs(e) >= 1e3 ?
|
|
129
|
+
var pe = new Intl.NumberFormat();
|
|
130
|
+
function me(e) {
|
|
131
|
+
return Math.abs(e) >= 1e3 ? pe.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
|
|
113
132
|
}
|
|
114
133
|
//#endregion
|
|
115
134
|
//#region src/_shared/computeTicks.ts
|
|
116
|
-
function
|
|
135
|
+
function he(e) {
|
|
117
136
|
let { min: t, max: n, ticks: r } = e;
|
|
118
137
|
if (t === n) return [];
|
|
119
138
|
let i = e.displayOffset ?? 0;
|
|
120
139
|
if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
|
|
121
|
-
if (typeof r == "number") return
|
|
122
|
-
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o =
|
|
123
|
-
return
|
|
140
|
+
if (typeof r == "number") return B(t + i, n + i, r).map((e) => e - i);
|
|
141
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = z(n - t, a);
|
|
142
|
+
return B(t + i, n + i, o).map((e) => e - i);
|
|
124
143
|
}
|
|
125
|
-
function
|
|
144
|
+
function ge(e, t, n, r) {
|
|
126
145
|
if (r === "log") {
|
|
127
146
|
let r = Math.log10(t), i = Math.log10(n) - r || 1;
|
|
128
147
|
return (Math.log10(e > 0 ? e : t) - r) / i;
|
|
@@ -130,7 +149,7 @@ function ye(e, t, n, r) {
|
|
|
130
149
|
let i = n - t || 1;
|
|
131
150
|
return (e - t) / i;
|
|
132
151
|
}
|
|
133
|
-
function
|
|
152
|
+
function _e(e, t, n, r) {
|
|
134
153
|
if (n !== "log") return {
|
|
135
154
|
min: e,
|
|
136
155
|
max: t
|
|
@@ -141,7 +160,7 @@ function be(e, t, n, r) {
|
|
|
141
160
|
max: t > 0 ? Math.max(t, i) : i
|
|
142
161
|
};
|
|
143
162
|
}
|
|
144
|
-
function
|
|
163
|
+
function ve(e) {
|
|
145
164
|
let { min: t, max: n, ticks: r } = e;
|
|
146
165
|
if (!(t > 0) || !(n > 0) || t === n) return [];
|
|
147
166
|
if (Array.isArray(r)) return r.filter((e) => e > 0 && e >= t && e <= n);
|
|
@@ -154,7 +173,7 @@ function z(e) {
|
|
|
154
173
|
}
|
|
155
174
|
//#endregion
|
|
156
175
|
//#region src/_shared/useChartSize.ts
|
|
157
|
-
function
|
|
176
|
+
function ye(e = {}) {
|
|
158
177
|
let t = v(null), n = v(0), r = v(0), i = null, a = null;
|
|
159
178
|
return h(() => {
|
|
160
179
|
t.value && (n.value = t.value.clientWidth, r.value = t.value.clientHeight, i = new ResizeObserver((t) => {
|
|
@@ -173,8 +192,8 @@ function xe(e = {}) {
|
|
|
173
192
|
measuredHeight: r
|
|
174
193
|
};
|
|
175
194
|
}
|
|
176
|
-
var
|
|
177
|
-
function
|
|
195
|
+
var V = .6, be = 8;
|
|
196
|
+
function xe(e, t) {
|
|
178
197
|
return {
|
|
179
198
|
fontSize: e?.fontSize ?? t.fontSize,
|
|
180
199
|
fill: e?.color ?? "currentColor",
|
|
@@ -182,8 +201,8 @@ function V(e, t) {
|
|
|
182
201
|
fillOpacity: e?.color == null ? t.fillOpacity : void 0
|
|
183
202
|
};
|
|
184
203
|
}
|
|
185
|
-
var
|
|
186
|
-
function
|
|
204
|
+
var Se = 7, Ce = 18, we = 16;
|
|
205
|
+
function Te(e) {
|
|
187
206
|
return e == null ? {
|
|
188
207
|
top: 0,
|
|
189
208
|
right: 0,
|
|
@@ -201,12 +220,12 @@ function Ee(e) {
|
|
|
201
220
|
left: e.left ?? 0
|
|
202
221
|
};
|
|
203
222
|
}
|
|
204
|
-
function
|
|
205
|
-
return
|
|
223
|
+
function Ee(e) {
|
|
224
|
+
return Ce + e.length * Se;
|
|
206
225
|
}
|
|
207
|
-
function
|
|
226
|
+
function De(e) {
|
|
208
227
|
let t = n(() => {
|
|
209
|
-
let t =
|
|
228
|
+
let t = Te(e.extraPadding?.());
|
|
210
229
|
return {
|
|
211
230
|
left: (e.yLabel() ? 56 : 50) + t.left,
|
|
212
231
|
right: 10 + t.right
|
|
@@ -219,11 +238,11 @@ function Oe(e) {
|
|
|
219
238
|
};
|
|
220
239
|
let n = Math.max(0, r.value), i = [], a = 0, o = 0;
|
|
221
240
|
for (let e of t) {
|
|
222
|
-
let t =
|
|
241
|
+
let t = Ee(e);
|
|
223
242
|
o > 0 && o + t > n && (a++, o = 0), i.push({
|
|
224
243
|
x: o,
|
|
225
244
|
row: a
|
|
226
|
-
}), o += t +
|
|
245
|
+
}), o += t + we;
|
|
227
246
|
}
|
|
228
247
|
return {
|
|
229
248
|
positions: i,
|
|
@@ -233,9 +252,9 @@ function Oe(e) {
|
|
|
233
252
|
let t = e.title();
|
|
234
253
|
if (!t) return 10;
|
|
235
254
|
let n = e.titleStyle?.()?.lineHeight ?? 18;
|
|
236
|
-
return t.split("\n").length * n +
|
|
255
|
+
return t.split("\n").length * n + be;
|
|
237
256
|
}), o = n(() => {
|
|
238
|
-
let n =
|
|
257
|
+
let n = Te(e.extraPadding?.()), r = i.value.rowCount;
|
|
239
258
|
return {
|
|
240
259
|
top: a.value + r * 20 + n.top,
|
|
241
260
|
bottom: (e.xLabel() ? 38 : 30) + n.bottom,
|
|
@@ -264,10 +283,10 @@ function Oe(e) {
|
|
|
264
283
|
}
|
|
265
284
|
//#endregion
|
|
266
285
|
//#region src/tooltip-position.ts
|
|
267
|
-
var
|
|
268
|
-
function
|
|
286
|
+
var Oe = 16, ke = 8;
|
|
287
|
+
function Ae(e, t, n, r, i, a) {
|
|
269
288
|
if (i === "none") return {
|
|
270
|
-
left: e +
|
|
289
|
+
left: e + Oe,
|
|
271
290
|
top: t
|
|
272
291
|
};
|
|
273
292
|
let o = i === "chart" && a ? {
|
|
@@ -280,21 +299,21 @@ function H(e, t, n, r, i, a) {
|
|
|
280
299
|
right: window.innerWidth,
|
|
281
300
|
top: 0,
|
|
282
301
|
bottom: window.innerHeight
|
|
283
|
-
}, s = e +
|
|
302
|
+
}, s = e + Oe + n > o.right - ke ? e - Oe - n : e + Oe, c = r / 2;
|
|
284
303
|
return {
|
|
285
304
|
left: s,
|
|
286
|
-
top: Math.min(Math.max(t, o.top +
|
|
305
|
+
top: Math.min(Math.max(t, o.top + ke + c), o.bottom - ke - c)
|
|
287
306
|
};
|
|
288
307
|
}
|
|
289
308
|
//#endregion
|
|
290
309
|
//#region src/_shared/useChartTooltip.ts
|
|
291
|
-
function
|
|
292
|
-
let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null);
|
|
293
|
-
function
|
|
310
|
+
function H(e) {
|
|
311
|
+
let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null), s = null, c = "pending";
|
|
312
|
+
function l(e) {
|
|
294
313
|
return "touches" in e ? e.touches[0] ?? null : e;
|
|
295
314
|
}
|
|
296
|
-
function
|
|
297
|
-
let r =
|
|
315
|
+
function u(t) {
|
|
316
|
+
let r = l(t);
|
|
298
317
|
if (!r) return;
|
|
299
318
|
let i = e.pointerToIndex(r.clientX, r.clientY);
|
|
300
319
|
i !== null && (n.value = i, a.value = {
|
|
@@ -309,33 +328,54 @@ function je(e) {
|
|
|
309
328
|
}
|
|
310
329
|
let s = i.value, c = e.containerRef.value;
|
|
311
330
|
if (!s || !c) return;
|
|
312
|
-
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } =
|
|
331
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = Ae(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
|
|
313
332
|
o.value = {
|
|
314
333
|
left: f - l.left,
|
|
315
334
|
top: p - l.top
|
|
316
335
|
};
|
|
317
336
|
}, { flush: "post" });
|
|
318
|
-
function
|
|
319
|
-
e.enabled() &&
|
|
337
|
+
function d(t) {
|
|
338
|
+
e.enabled() && u(t);
|
|
320
339
|
}
|
|
321
|
-
function
|
|
340
|
+
function f() {
|
|
322
341
|
e.enabled() && e.trigger?.() !== "click" && (n.value = null, e.onHover?.(null));
|
|
323
342
|
}
|
|
324
|
-
function
|
|
343
|
+
function p(t) {
|
|
325
344
|
if (!e.enabled() || e.trigger?.() !== "click") return;
|
|
326
|
-
let r =
|
|
345
|
+
let r = l(t);
|
|
327
346
|
if (!r) return;
|
|
328
347
|
let i = e.pointerToIndex(r.clientX, r.clientY);
|
|
329
348
|
i !== null && (n.value = n.value === i ? null : i, e.onHover?.(n.value === null ? null : { index: i }));
|
|
330
349
|
}
|
|
331
|
-
function
|
|
332
|
-
e.enabled()
|
|
350
|
+
function m(t) {
|
|
351
|
+
if (!e.enabled()) return;
|
|
352
|
+
let n = l(t);
|
|
353
|
+
n && (s = {
|
|
354
|
+
x: n.clientX,
|
|
355
|
+
y: n.clientY
|
|
356
|
+
}, c = "pending", r.value = !0, u(t));
|
|
333
357
|
}
|
|
334
|
-
function
|
|
335
|
-
e.enabled() &&
|
|
358
|
+
function h(t) {
|
|
359
|
+
if (e.enabled() && c !== "scroll") {
|
|
360
|
+
if (c === "pending") {
|
|
361
|
+
let r = l(t);
|
|
362
|
+
if (!r || !s) return;
|
|
363
|
+
let i = Math.abs(r.clientX - s.x), a = Math.abs(r.clientY - s.y);
|
|
364
|
+
if (i + a < 10) {
|
|
365
|
+
u(t);
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
if (!((e.scrubAxis?.() ?? "x") === "x" ? i >= a : a >= i)) {
|
|
369
|
+
c = "scroll", n.value = null, e.onHover?.(null);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
c = "scrub";
|
|
373
|
+
}
|
|
374
|
+
t.preventDefault(), u(t);
|
|
375
|
+
}
|
|
336
376
|
}
|
|
337
|
-
function
|
|
338
|
-
e.enabled() && (r.value = !1, n.value = null, e.onHover?.(null));
|
|
377
|
+
function g() {
|
|
378
|
+
e.enabled() && (r.value = !1, s = null, c = "pending", n.value = null, e.onHover?.(null));
|
|
339
379
|
}
|
|
340
380
|
return {
|
|
341
381
|
hoverIndex: n,
|
|
@@ -344,114 +384,127 @@ function je(e) {
|
|
|
344
384
|
tooltipRef: i,
|
|
345
385
|
tooltipPos: o,
|
|
346
386
|
handlers: {
|
|
347
|
-
mousemove:
|
|
348
|
-
mouseleave:
|
|
349
|
-
click:
|
|
350
|
-
touchstart:
|
|
351
|
-
touchmove:
|
|
352
|
-
touchend:
|
|
387
|
+
mousemove: d,
|
|
388
|
+
mouseleave: f,
|
|
389
|
+
click: p,
|
|
390
|
+
touchstart: m,
|
|
391
|
+
touchmove: h,
|
|
392
|
+
touchend: g
|
|
353
393
|
}
|
|
354
394
|
};
|
|
355
395
|
}
|
|
356
396
|
//#endregion
|
|
357
397
|
//#region src/ChartMenu/download.ts
|
|
358
|
-
function
|
|
398
|
+
function je(e, t) {
|
|
359
399
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
360
400
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
361
401
|
}
|
|
362
|
-
var
|
|
402
|
+
var Me = [
|
|
363
403
|
"color",
|
|
364
404
|
"font-family",
|
|
365
405
|
"font-size",
|
|
366
406
|
"font-weight"
|
|
367
|
-
],
|
|
368
|
-
function
|
|
407
|
+
], U = ["fill", "stroke"];
|
|
408
|
+
function W(e) {
|
|
369
409
|
let t = e.match(/^\s*var\(\s*(--[\w-]+)\s*(?:,\s*([^)]*?)\s*)?\)\s*$/);
|
|
370
410
|
if (!t) return e;
|
|
371
411
|
let [, n, r] = t;
|
|
372
412
|
return window.getComputedStyle(document.documentElement).getPropertyValue(n).trim() || (r ? r.trim() : e);
|
|
373
413
|
}
|
|
374
|
-
function
|
|
414
|
+
function Ne(e) {
|
|
375
415
|
let t = e.cloneNode(!0);
|
|
376
416
|
t.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
377
417
|
let n = window.getComputedStyle(e), r = [];
|
|
378
|
-
for (let e of
|
|
418
|
+
for (let e of Me) {
|
|
379
419
|
let t = n.getPropertyValue(e);
|
|
380
420
|
t && r.push(`${e}: ${t}`);
|
|
381
421
|
}
|
|
382
422
|
let i = t.getAttribute("style") ?? "";
|
|
383
423
|
t.setAttribute("style", [i, ...r].filter(Boolean).join("; "));
|
|
384
|
-
for (let e of t.querySelectorAll("*")) for (let t of
|
|
424
|
+
for (let e of t.querySelectorAll("*")) for (let t of U) {
|
|
385
425
|
let n = e.getAttribute(t);
|
|
386
|
-
!n || !n.includes("var(") || e.setAttribute(t,
|
|
426
|
+
!n || !n.includes("var(") || e.setAttribute(t, W(n));
|
|
387
427
|
}
|
|
388
428
|
return t;
|
|
389
429
|
}
|
|
390
|
-
function
|
|
391
|
-
let n =
|
|
392
|
-
|
|
430
|
+
function G(e, t) {
|
|
431
|
+
let n = Ne(e), r = new XMLSerializer().serializeToString(n);
|
|
432
|
+
je(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
393
433
|
}
|
|
394
|
-
function
|
|
395
|
-
let n =
|
|
434
|
+
function K(e, t) {
|
|
435
|
+
let n = Ne(e), r = new XMLSerializer().serializeToString(n), i = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(i), o = new Image(), s = e.width.baseVal.value || e.clientWidth, c = e.height.baseVal.value || e.clientHeight;
|
|
396
436
|
o.onload = () => {
|
|
397
437
|
let e = document.createElement("canvas");
|
|
398
438
|
e.width = s * 2, e.height = c * 2;
|
|
399
439
|
let n = e.getContext("2d");
|
|
400
440
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
401
|
-
e &&
|
|
441
|
+
e && je(e, `${t}.png`);
|
|
402
442
|
}), URL.revokeObjectURL(a);
|
|
403
443
|
}, o.src = a;
|
|
404
444
|
}
|
|
405
|
-
function
|
|
406
|
-
|
|
445
|
+
function Pe(e, t) {
|
|
446
|
+
je(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
407
447
|
}
|
|
408
448
|
//#endregion
|
|
409
449
|
//#region src/_shared/useChartFullscreen.ts
|
|
410
|
-
var
|
|
411
|
-
function
|
|
412
|
-
typeof document > "u" || (
|
|
450
|
+
var q = 0, Fe = "";
|
|
451
|
+
function Ie() {
|
|
452
|
+
typeof document > "u" || (q === 0 && (Fe = document.body.style.overflow, document.body.style.overflow = "hidden"), q++);
|
|
413
453
|
}
|
|
414
|
-
function
|
|
415
|
-
typeof document > "u" ||
|
|
454
|
+
function Le() {
|
|
455
|
+
typeof document > "u" || q !== 0 && (q--, q === 0 && (document.body.style.overflow = Fe));
|
|
416
456
|
}
|
|
417
|
-
function
|
|
418
|
-
let
|
|
419
|
-
function
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
function i(t) {
|
|
423
|
-
if (t.key !== "Escape" || !e.value) return;
|
|
424
|
-
let n = t.target;
|
|
425
|
-
n instanceof Element && n.closest("[role=\"menu\"], [role=\"dialog\"]") || r(!1);
|
|
457
|
+
function Re(e = {}) {
|
|
458
|
+
let t = v(!1), r = !1;
|
|
459
|
+
function i(e) {
|
|
460
|
+
e !== t.value && (t.value = e, e && !r ? (Ie(), r = !0) : !e && r && (Le(), r = !1));
|
|
426
461
|
}
|
|
427
|
-
function a() {
|
|
428
|
-
|
|
462
|
+
function a(e) {
|
|
463
|
+
if (e.key !== "Escape" || !t.value) return;
|
|
464
|
+
let n = e.target;
|
|
465
|
+
n instanceof Element && n.closest("[role=\"menu\"], [role=\"dialog\"]") || i(!1);
|
|
429
466
|
}
|
|
430
467
|
function o() {
|
|
431
|
-
|
|
468
|
+
i(!0);
|
|
432
469
|
}
|
|
433
470
|
function s() {
|
|
434
|
-
|
|
471
|
+
i(!1);
|
|
472
|
+
}
|
|
473
|
+
function c() {
|
|
474
|
+
i(!t.value);
|
|
435
475
|
}
|
|
436
476
|
return h(() => {
|
|
437
|
-
typeof document > "u" || document.addEventListener("keydown",
|
|
477
|
+
typeof document > "u" || document.addEventListener("keydown", a);
|
|
438
478
|
}), g(() => {
|
|
439
|
-
typeof document > "u" || (document.removeEventListener("keydown",
|
|
479
|
+
typeof document > "u" || (document.removeEventListener("keydown", a), r &&= (Le(), !1));
|
|
440
480
|
}), {
|
|
441
|
-
isFullscreen:
|
|
442
|
-
toggle:
|
|
443
|
-
enter:
|
|
444
|
-
exit:
|
|
481
|
+
isFullscreen: t,
|
|
482
|
+
toggle: c,
|
|
483
|
+
enter: o,
|
|
484
|
+
exit: s,
|
|
445
485
|
menuItem: n(() => ({
|
|
446
|
-
label:
|
|
447
|
-
action:
|
|
448
|
-
ariaPressed:
|
|
449
|
-
}))
|
|
486
|
+
label: t.value ? "Collapse" : "Fullscreen",
|
|
487
|
+
action: c,
|
|
488
|
+
ariaPressed: t.value
|
|
489
|
+
})),
|
|
490
|
+
fullscreenStyle: n(() => t.value ? {
|
|
491
|
+
position: "fixed",
|
|
492
|
+
inset: "0",
|
|
493
|
+
"z-index": "var(--cfasim-z-fullscreen, 1000)",
|
|
494
|
+
background: "var(--color-bg-0, #fff)",
|
|
495
|
+
color: "var(--color-text, inherit)",
|
|
496
|
+
padding: "2em",
|
|
497
|
+
"box-sizing": "border-box",
|
|
498
|
+
display: "flex",
|
|
499
|
+
"flex-direction": "column",
|
|
500
|
+
"justify-content": "center"
|
|
501
|
+
} : void 0),
|
|
502
|
+
teleportTarget: n(() => e.target?.() || "body")
|
|
450
503
|
};
|
|
451
504
|
}
|
|
452
505
|
//#endregion
|
|
453
506
|
//#region src/_shared/useChartMenu.ts
|
|
454
|
-
function
|
|
507
|
+
function ze(e) {
|
|
455
508
|
let t = v(null);
|
|
456
509
|
function r() {
|
|
457
510
|
let t = e.filename();
|
|
@@ -459,23 +512,23 @@ function Ve(e) {
|
|
|
459
512
|
let n = e.legacyMenuLabel();
|
|
460
513
|
return typeof n == "string" ? n : "chart";
|
|
461
514
|
}
|
|
462
|
-
let i = e.fullscreen ?
|
|
515
|
+
let i = e.fullscreen ? Re({ target: e.fullscreenTarget }) : null, a = n(() => {
|
|
463
516
|
let n = r(), a = [];
|
|
464
517
|
i && a.push(i.menuItem.value), a.push({
|
|
465
518
|
label: "Save as SVG",
|
|
466
519
|
action: () => {
|
|
467
|
-
t.value &&
|
|
520
|
+
t.value && G(t.value, n);
|
|
468
521
|
}
|
|
469
522
|
}, {
|
|
470
523
|
label: "Save as PNG",
|
|
471
524
|
action: () => {
|
|
472
|
-
t.value &&
|
|
525
|
+
t.value && K(t.value, n);
|
|
473
526
|
}
|
|
474
527
|
});
|
|
475
528
|
let o = e.downloadButton?.();
|
|
476
529
|
return !e.downloadLink() && !o && a.push({
|
|
477
530
|
label: "Download CSV",
|
|
478
|
-
action: () =>
|
|
531
|
+
action: () => Pe(e.getCsv(), n)
|
|
479
532
|
}), a;
|
|
480
533
|
}), o = n(() => {
|
|
481
534
|
if (e.downloadButton?.()) return null;
|
|
@@ -486,7 +539,7 @@ function Ve(e) {
|
|
|
486
539
|
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
487
540
|
});
|
|
488
541
|
function l() {
|
|
489
|
-
|
|
542
|
+
Pe(e.getCsv(), r());
|
|
490
543
|
}
|
|
491
544
|
return {
|
|
492
545
|
svgRef: t,
|
|
@@ -496,12 +549,15 @@ function Ve(e) {
|
|
|
496
549
|
downloadButtonText: c,
|
|
497
550
|
triggerCsvDownload: l,
|
|
498
551
|
resolvedFilename: r,
|
|
499
|
-
isFullscreen: i?.isFullscreen ?? v(!1)
|
|
552
|
+
isFullscreen: i?.isFullscreen ?? v(!1),
|
|
553
|
+
fullscreenStyle: i?.fullscreenStyle ?? n(() => void 0),
|
|
554
|
+
teleportTarget: i?.teleportTarget ?? n(() => "body"),
|
|
555
|
+
exitFullscreen: i?.exit ?? (() => {})
|
|
500
556
|
};
|
|
501
557
|
}
|
|
502
558
|
//#endregion
|
|
503
559
|
//#region src/_shared/seriesCsv.ts
|
|
504
|
-
function
|
|
560
|
+
function Be(e) {
|
|
505
561
|
if (e.length === 0) return "";
|
|
506
562
|
let t = 0;
|
|
507
563
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -513,43 +569,43 @@ function He(e) {
|
|
|
513
569
|
}
|
|
514
570
|
return i.join("\n");
|
|
515
571
|
}
|
|
516
|
-
function
|
|
572
|
+
function Ve(e, t, n = "category") {
|
|
517
573
|
if (t.length === 0 || e.length === 0) return "";
|
|
518
574
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
519
575
|
for (let n = 0; n < e.length; n++) {
|
|
520
|
-
let i = [
|
|
576
|
+
let i = [He(e[n])];
|
|
521
577
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
522
578
|
r.push(i.join(","));
|
|
523
579
|
}
|
|
524
580
|
return r.join("\n");
|
|
525
581
|
}
|
|
526
|
-
function
|
|
582
|
+
function He(e) {
|
|
527
583
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
528
584
|
}
|
|
529
585
|
//#endregion
|
|
530
586
|
//#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
|
|
531
|
-
var
|
|
587
|
+
var Ue = {
|
|
532
588
|
class: "chart-annotations",
|
|
533
589
|
"pointer-events": "none"
|
|
534
590
|
}, We = ["stroke", "stroke-width"], Ge = [
|
|
535
591
|
"d",
|
|
536
592
|
"stroke",
|
|
537
593
|
"stroke-width"
|
|
538
|
-
],
|
|
594
|
+
], Ke = [
|
|
539
595
|
"fill",
|
|
540
596
|
"stroke",
|
|
541
597
|
"stroke-width",
|
|
542
598
|
"transform"
|
|
543
|
-
],
|
|
599
|
+
], J = [
|
|
544
600
|
"stroke",
|
|
545
601
|
"stroke-width",
|
|
546
602
|
"stroke-dasharray"
|
|
547
|
-
],
|
|
603
|
+
], qe = [
|
|
548
604
|
"d",
|
|
549
605
|
"stroke",
|
|
550
606
|
"stroke-width",
|
|
551
607
|
"stroke-dasharray"
|
|
552
|
-
],
|
|
608
|
+
], Y = ["fill", "transform"], X = [
|
|
553
609
|
"x",
|
|
554
610
|
"y",
|
|
555
611
|
"text-anchor",
|
|
@@ -558,7 +614,7 @@ var J = {
|
|
|
558
614
|
"fill",
|
|
559
615
|
"stroke",
|
|
560
616
|
"stroke-width"
|
|
561
|
-
],
|
|
617
|
+
], Je = ["x", "dy"], Z = ["font-weight", "font-style"], Q = 13, Ye = "normal", Xe = 700, Ze = "var(--color-bg-0, #fff)", Qe = 3, $e = 1, et = 4, tt = 6, nt = 1.2, rt = .35, it = /* @__PURE__ */ l({
|
|
562
618
|
__name: "ChartAnnotations",
|
|
563
619
|
props: {
|
|
564
620
|
annotations: { default: () => [] },
|
|
@@ -595,7 +651,7 @@ var J = {
|
|
|
595
651
|
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
596
652
|
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
597
653
|
if (a && !r.bounds) continue;
|
|
598
|
-
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ??
|
|
654
|
+
let { x: o, y: l } = t.offset, d = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? Q, g = t.fontWeight ?? Ye, _ = t.outlineColor ?? Ze, v = t.outlineWidth ?? Qe, y = t.lineColor ?? m, b = t.lineWidth ?? $e, x = s(t.lineDash), ee = {
|
|
599
655
|
left: "start",
|
|
600
656
|
center: "middle",
|
|
601
657
|
right: "end"
|
|
@@ -610,7 +666,7 @@ var J = {
|
|
|
610
666
|
textX: d,
|
|
611
667
|
textY: p,
|
|
612
668
|
textAnchor: ee,
|
|
613
|
-
dy: h *
|
|
669
|
+
dy: h * nt,
|
|
614
670
|
fontSize: h,
|
|
615
671
|
fontWeight: g,
|
|
616
672
|
color: m,
|
|
@@ -676,11 +732,11 @@ var J = {
|
|
|
676
732
|
}
|
|
677
733
|
function f(e, t, n, r, i, a) {
|
|
678
734
|
if (a === "none") return { path: "" };
|
|
679
|
-
let o = n - e, s = r - t, c = r - i *
|
|
735
|
+
let o = n - e, s = r - t, c = r - i * rt;
|
|
680
736
|
if (o === 0 || s === 0 || a === "straight") {
|
|
681
737
|
let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
|
|
682
738
|
if (l <= 10) return { path: "" };
|
|
683
|
-
let u = a / l, d = o / l, f = e + u *
|
|
739
|
+
let u = a / l, d = o / l, f = e + u * et, p = t + d * et, m = n - u * tt, h = i - d * tt, g = Math.atan2(-d, -u) * 180 / Math.PI;
|
|
684
740
|
return {
|
|
685
741
|
path: `M${f},${p} L${m},${h}`,
|
|
686
742
|
arrow: {
|
|
@@ -691,8 +747,8 @@ var J = {
|
|
|
691
747
|
};
|
|
692
748
|
}
|
|
693
749
|
let l = c - t;
|
|
694
|
-
if (Math.abs(l) <=
|
|
695
|
-
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d *
|
|
750
|
+
if (Math.abs(l) <= et || Math.abs(o) <= tt) return { path: "" };
|
|
751
|
+
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d * et, m = n - u * tt, h = c, g = d > 0 ? -90 : 90;
|
|
696
752
|
return {
|
|
697
753
|
path: `M${f},${p} Q${f},${c} ${m},${h}`,
|
|
698
754
|
arrow: {
|
|
@@ -702,7 +758,7 @@ var J = {
|
|
|
702
758
|
}
|
|
703
759
|
};
|
|
704
760
|
}
|
|
705
|
-
return (t, n) => (_(), a("g",
|
|
761
|
+
return (t, n) => (_(), a("g", Ue, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
706
762
|
t.rule && t.outlineWidth > 0 ? (_(), a("line", d({
|
|
707
763
|
key: 0,
|
|
708
764
|
ref_for: !0
|
|
@@ -730,7 +786,7 @@ var J = {
|
|
|
730
786
|
"stroke-width": t.outlineWidth,
|
|
731
787
|
"stroke-linejoin": "round",
|
|
732
788
|
transform: t.arrowTransform
|
|
733
|
-
}, null, 8,
|
|
789
|
+
}, null, 8, Ke)) : i("", !0),
|
|
734
790
|
t.rule ? (_(), a("line", d({
|
|
735
791
|
key: 3,
|
|
736
792
|
ref_for: !0
|
|
@@ -739,7 +795,7 @@ var J = {
|
|
|
739
795
|
"stroke-width": t.lineWidth,
|
|
740
796
|
"stroke-dasharray": t.lineDash,
|
|
741
797
|
"stroke-linecap": "round"
|
|
742
|
-
}), null, 16,
|
|
798
|
+
}), null, 16, J)) : i("", !0),
|
|
743
799
|
t.pointerPath ? (_(), a("path", {
|
|
744
800
|
key: 4,
|
|
745
801
|
d: t.pointerPath,
|
|
@@ -748,13 +804,13 @@ var J = {
|
|
|
748
804
|
"stroke-width": t.lineWidth,
|
|
749
805
|
"stroke-dasharray": t.lineDash,
|
|
750
806
|
"stroke-linecap": "round"
|
|
751
|
-
}, null, 8,
|
|
807
|
+
}, null, 8, qe)) : i("", !0),
|
|
752
808
|
t.arrowTip ? (_(), a("polygon", {
|
|
753
809
|
key: 5,
|
|
754
810
|
points: "0,0 -6,-3 -6,3",
|
|
755
811
|
fill: t.lineColor,
|
|
756
812
|
transform: t.arrowTransform
|
|
757
|
-
}, null, 8,
|
|
813
|
+
}, null, 8, Y)) : i("", !0),
|
|
758
814
|
o("text", {
|
|
759
815
|
x: t.textX,
|
|
760
816
|
y: t.textY,
|
|
@@ -772,58 +828,60 @@ var J = {
|
|
|
772
828
|
dy: r === 0 ? 0 : t.dy
|
|
773
829
|
}, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
|
|
774
830
|
key: t,
|
|
775
|
-
"font-weight": e.bold ?
|
|
831
|
+
"font-weight": e.bold ? Xe : void 0,
|
|
776
832
|
"font-style": e.italic ? "italic" : void 0
|
|
777
|
-
}, x(e.text), 9,
|
|
833
|
+
}, x(e.text), 9, Z))), 128))], 8, Je))), 128))], 8, X)
|
|
778
834
|
], 64))), 128))]));
|
|
779
835
|
}
|
|
780
|
-
}),
|
|
781
|
-
function
|
|
782
|
-
let { containerRef: t, measuredWidth: r, measuredHeight: i } =
|
|
836
|
+
}), at = 400, ot = 200;
|
|
837
|
+
function st(e) {
|
|
838
|
+
let { containerRef: t, measuredWidth: r, measuredHeight: i } = ye({ debounce: e.debounce }), { svgRef: a, items: o, downloadLinkText: s, csvHref: c, downloadButtonText: l, triggerCsvDownload: u, resolvedFilename: d, isFullscreen: f, fullscreenStyle: p, teleportTarget: m, exitFullscreen: h } = ze({
|
|
783
839
|
filename: e.filename,
|
|
784
840
|
legacyMenuLabel: e.menu,
|
|
785
841
|
getCsv: e.getCsv,
|
|
786
842
|
downloadLink: e.downloadLink,
|
|
787
843
|
downloadButton: e.downloadButton,
|
|
788
|
-
fullscreen: !0
|
|
789
|
-
|
|
844
|
+
fullscreen: !0,
|
|
845
|
+
fullscreenTarget: e.fullscreenTarget
|
|
846
|
+
}), g = n(() => f.value && r.value > 0 ? r.value : e.width() ?? (r.value || at)), _ = n(() => {
|
|
790
847
|
if (f.value && i.value > 0) {
|
|
791
848
|
let t = e.extraBelowHeight?.() ?? 0;
|
|
792
849
|
return i.value - t;
|
|
793
850
|
}
|
|
794
|
-
return e.height() ??
|
|
795
|
-
}), { padding:
|
|
851
|
+
return e.height() ?? ot;
|
|
852
|
+
}), { padding: v, legendY: y, inlineLegendLayout: b, innerW: x, innerH: ee, bounds: S } = De({
|
|
796
853
|
title: e.title,
|
|
797
854
|
titleStyle: e.titleStyle,
|
|
798
855
|
xLabel: e.xLabel,
|
|
799
856
|
yLabel: e.yLabel,
|
|
800
857
|
inlineLegendLabels: e.inlineLegendLabels,
|
|
801
|
-
width: () =>
|
|
802
|
-
height: () =>
|
|
858
|
+
width: () => g.value,
|
|
859
|
+
height: () => _.value,
|
|
803
860
|
extraPadding: e.chartPadding
|
|
804
|
-
}), { hoverIndex:
|
|
861
|
+
}), { hoverIndex: C, tooltipRef: w, tooltipPos: T, handlers: E } = H({
|
|
805
862
|
enabled: e.hasTooltipSlot,
|
|
806
863
|
trigger: e.tooltipTrigger,
|
|
807
864
|
clamp: () => e.tooltipClamp() ?? "chart",
|
|
808
865
|
pointerToIndex: e.pointerToIndex,
|
|
809
866
|
containerRef: t,
|
|
867
|
+
scrubAxis: e.scrubAxis,
|
|
810
868
|
onHover: e.onHover
|
|
811
869
|
});
|
|
812
870
|
return {
|
|
813
871
|
containerRef: t,
|
|
814
872
|
svgRef: a,
|
|
815
|
-
width:
|
|
816
|
-
height:
|
|
817
|
-
padding:
|
|
818
|
-
legendY:
|
|
819
|
-
inlineLegendLayout:
|
|
820
|
-
innerW:
|
|
821
|
-
innerH:
|
|
822
|
-
bounds:
|
|
823
|
-
hoverIndex:
|
|
824
|
-
tooltipRef:
|
|
825
|
-
tooltipPos:
|
|
826
|
-
tooltipHandlers:
|
|
873
|
+
width: g,
|
|
874
|
+
height: _,
|
|
875
|
+
padding: v,
|
|
876
|
+
legendY: y,
|
|
877
|
+
inlineLegendLayout: b,
|
|
878
|
+
innerW: x,
|
|
879
|
+
innerH: ee,
|
|
880
|
+
bounds: S,
|
|
881
|
+
hoverIndex: C,
|
|
882
|
+
tooltipRef: w,
|
|
883
|
+
tooltipPos: T,
|
|
884
|
+
tooltipHandlers: E,
|
|
827
885
|
menuItems: o,
|
|
828
886
|
downloadLinkText: s,
|
|
829
887
|
csvHref: c,
|
|
@@ -831,20 +889,23 @@ function ut(e) {
|
|
|
831
889
|
triggerCsvDownload: u,
|
|
832
890
|
menuFilename: d,
|
|
833
891
|
isFullscreen: f,
|
|
892
|
+
fullscreenStyle: p,
|
|
893
|
+
teleportTarget: m,
|
|
894
|
+
exitFullscreen: h,
|
|
834
895
|
measuredHeight: i
|
|
835
896
|
};
|
|
836
897
|
}
|
|
837
|
-
function
|
|
898
|
+
function ct(e, t) {
|
|
838
899
|
return (n) => {
|
|
839
900
|
let r = e();
|
|
840
901
|
if (r !== void 0) return te(n, r);
|
|
841
902
|
let i = t();
|
|
842
|
-
return i === void 0 ?
|
|
903
|
+
return i === void 0 ? me(n) : te(n, i);
|
|
843
904
|
};
|
|
844
905
|
}
|
|
845
906
|
//#endregion
|
|
846
907
|
//#region src/_shared/contrast.ts
|
|
847
|
-
function
|
|
908
|
+
function lt(e) {
|
|
848
909
|
let t = e.trim();
|
|
849
910
|
if (t.startsWith("#")) {
|
|
850
911
|
let e = t.slice(1);
|
|
@@ -871,201 +932,201 @@ function ft(e) {
|
|
|
871
932
|
}
|
|
872
933
|
return null;
|
|
873
934
|
}
|
|
874
|
-
function
|
|
935
|
+
function ut([e, t, n]) {
|
|
875
936
|
let r = (e) => {
|
|
876
937
|
let t = e / 255;
|
|
877
938
|
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
878
939
|
};
|
|
879
940
|
return .2126 * r(e) + .7152 * r(t) + .0722 * r(n);
|
|
880
941
|
}
|
|
881
|
-
var
|
|
882
|
-
function
|
|
883
|
-
let t =
|
|
942
|
+
var dt = null, ft = /* @__PURE__ */ new Map();
|
|
943
|
+
function pt(e) {
|
|
944
|
+
let t = lt(e);
|
|
884
945
|
if (t) return t;
|
|
885
|
-
if (
|
|
946
|
+
if (ft.has(e)) return ft.get(e) ?? null;
|
|
886
947
|
if (typeof document > "u") return null;
|
|
887
|
-
|
|
888
|
-
let n = getComputedStyle(
|
|
889
|
-
return
|
|
948
|
+
dt || (dt = document.createElement("span"), dt.style.cssText = "position:absolute;width:0;height:0;visibility:hidden;pointer-events:none", document.body.appendChild(dt)), dt.style.color = "", dt.style.color = e;
|
|
949
|
+
let n = getComputedStyle(dt).color, r = lt(n);
|
|
950
|
+
return ft.set(e, r), r;
|
|
890
951
|
}
|
|
891
|
-
function
|
|
892
|
-
let r =
|
|
893
|
-
return r &&
|
|
952
|
+
function mt(e, t = "#ffffff", n = "#1a1a1a") {
|
|
953
|
+
let r = pt(e);
|
|
954
|
+
return r && ut(r) > .179 ? n : t;
|
|
894
955
|
}
|
|
895
956
|
//#endregion
|
|
896
957
|
//#region src/_shared/dateAxis.ts
|
|
897
|
-
var
|
|
958
|
+
var ht = /^(\d{4})-(\d{2})-(\d{2})$/, gt = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:?\d{2})?$/, _t = 1e3, vt = 60 * _t, yt = 60 * vt, bt = 24 * yt, xt = 7 * bt, St = 30 * bt, Ct = 365 * bt, wt = [
|
|
898
959
|
{
|
|
899
960
|
unit: "second",
|
|
900
961
|
step: 1,
|
|
901
|
-
ms: 1 *
|
|
962
|
+
ms: 1 * _t
|
|
902
963
|
},
|
|
903
964
|
{
|
|
904
965
|
unit: "second",
|
|
905
966
|
step: 5,
|
|
906
|
-
ms: 5 *
|
|
967
|
+
ms: 5 * _t
|
|
907
968
|
},
|
|
908
969
|
{
|
|
909
970
|
unit: "second",
|
|
910
971
|
step: 15,
|
|
911
|
-
ms: 15 *
|
|
972
|
+
ms: 15 * _t
|
|
912
973
|
},
|
|
913
974
|
{
|
|
914
975
|
unit: "second",
|
|
915
976
|
step: 30,
|
|
916
|
-
ms: 30 *
|
|
977
|
+
ms: 30 * _t
|
|
917
978
|
},
|
|
918
979
|
{
|
|
919
980
|
unit: "minute",
|
|
920
981
|
step: 1,
|
|
921
|
-
ms: 1 *
|
|
982
|
+
ms: 1 * vt
|
|
922
983
|
},
|
|
923
984
|
{
|
|
924
985
|
unit: "minute",
|
|
925
986
|
step: 5,
|
|
926
|
-
ms: 5 *
|
|
987
|
+
ms: 5 * vt
|
|
927
988
|
},
|
|
928
989
|
{
|
|
929
990
|
unit: "minute",
|
|
930
991
|
step: 15,
|
|
931
|
-
ms: 15 *
|
|
992
|
+
ms: 15 * vt
|
|
932
993
|
},
|
|
933
994
|
{
|
|
934
995
|
unit: "minute",
|
|
935
996
|
step: 30,
|
|
936
|
-
ms: 30 *
|
|
997
|
+
ms: 30 * vt
|
|
937
998
|
},
|
|
938
999
|
{
|
|
939
1000
|
unit: "hour",
|
|
940
1001
|
step: 1,
|
|
941
|
-
ms: 1 *
|
|
1002
|
+
ms: 1 * yt
|
|
942
1003
|
},
|
|
943
1004
|
{
|
|
944
1005
|
unit: "hour",
|
|
945
1006
|
step: 3,
|
|
946
|
-
ms: 3 *
|
|
1007
|
+
ms: 3 * yt
|
|
947
1008
|
},
|
|
948
1009
|
{
|
|
949
1010
|
unit: "hour",
|
|
950
1011
|
step: 6,
|
|
951
|
-
ms: 6 *
|
|
1012
|
+
ms: 6 * yt
|
|
952
1013
|
},
|
|
953
1014
|
{
|
|
954
1015
|
unit: "hour",
|
|
955
1016
|
step: 12,
|
|
956
|
-
ms: 12 *
|
|
1017
|
+
ms: 12 * yt
|
|
957
1018
|
},
|
|
958
1019
|
{
|
|
959
1020
|
unit: "day",
|
|
960
1021
|
step: 1,
|
|
961
|
-
ms: 1 *
|
|
1022
|
+
ms: 1 * bt
|
|
962
1023
|
},
|
|
963
1024
|
{
|
|
964
1025
|
unit: "day",
|
|
965
1026
|
step: 2,
|
|
966
|
-
ms: 2 *
|
|
1027
|
+
ms: 2 * bt
|
|
967
1028
|
},
|
|
968
1029
|
{
|
|
969
1030
|
unit: "week",
|
|
970
1031
|
step: 1,
|
|
971
|
-
ms: 1 *
|
|
1032
|
+
ms: 1 * xt
|
|
972
1033
|
},
|
|
973
1034
|
{
|
|
974
1035
|
unit: "month",
|
|
975
1036
|
step: 1,
|
|
976
|
-
ms: 1 *
|
|
1037
|
+
ms: 1 * St
|
|
977
1038
|
},
|
|
978
1039
|
{
|
|
979
1040
|
unit: "month",
|
|
980
1041
|
step: 3,
|
|
981
|
-
ms: 3 *
|
|
1042
|
+
ms: 3 * St
|
|
982
1043
|
},
|
|
983
1044
|
{
|
|
984
1045
|
unit: "month",
|
|
985
1046
|
step: 6,
|
|
986
|
-
ms: 6 *
|
|
1047
|
+
ms: 6 * St
|
|
987
1048
|
},
|
|
988
1049
|
{
|
|
989
1050
|
unit: "year",
|
|
990
1051
|
step: 1,
|
|
991
|
-
ms: 1 *
|
|
1052
|
+
ms: 1 * Ct
|
|
992
1053
|
},
|
|
993
1054
|
{
|
|
994
1055
|
unit: "year",
|
|
995
1056
|
step: 2,
|
|
996
|
-
ms: 2 *
|
|
1057
|
+
ms: 2 * Ct
|
|
997
1058
|
},
|
|
998
1059
|
{
|
|
999
1060
|
unit: "year",
|
|
1000
1061
|
step: 5,
|
|
1001
|
-
ms: 5 *
|
|
1062
|
+
ms: 5 * Ct
|
|
1002
1063
|
},
|
|
1003
1064
|
{
|
|
1004
1065
|
unit: "year",
|
|
1005
1066
|
step: 10,
|
|
1006
|
-
ms: 10 *
|
|
1067
|
+
ms: 10 * Ct
|
|
1007
1068
|
},
|
|
1008
1069
|
{
|
|
1009
1070
|
unit: "year",
|
|
1010
1071
|
step: 25,
|
|
1011
|
-
ms: 25 *
|
|
1072
|
+
ms: 25 * Ct
|
|
1012
1073
|
},
|
|
1013
1074
|
{
|
|
1014
1075
|
unit: "year",
|
|
1015
1076
|
step: 50,
|
|
1016
|
-
ms: 50 *
|
|
1077
|
+
ms: 50 * Ct
|
|
1017
1078
|
},
|
|
1018
1079
|
{
|
|
1019
1080
|
unit: "year",
|
|
1020
1081
|
step: 100,
|
|
1021
|
-
ms: 100 *
|
|
1082
|
+
ms: 100 * Ct
|
|
1022
1083
|
}
|
|
1023
|
-
],
|
|
1024
|
-
function
|
|
1084
|
+
], Tt = 1e3;
|
|
1085
|
+
function Et(e, t) {
|
|
1025
1086
|
if (e instanceof Date) {
|
|
1026
1087
|
let t = e.getTime();
|
|
1027
1088
|
return Number.isFinite(t) ? t : null;
|
|
1028
1089
|
}
|
|
1029
1090
|
if (typeof e != "string") return null;
|
|
1030
|
-
let n =
|
|
1091
|
+
let n = ht.exec(e);
|
|
1031
1092
|
if (n) {
|
|
1032
1093
|
let e = +n[1], r = n[2] - 1, i = +n[3];
|
|
1033
1094
|
return t === "utc" ? Date.UTC(e, r, i) : new Date(e, r, i).getTime();
|
|
1034
1095
|
}
|
|
1035
|
-
let r =
|
|
1096
|
+
let r = gt.exec(e);
|
|
1036
1097
|
if (r) {
|
|
1037
1098
|
let e = +r[1], n = r[2] - 1, i = +r[3], a = +r[4], o = +r[5], s = r[6] ? +r[6] : 0, c = r[7] ? Number("0." + r[7]) * 1e3 : 0, l = r[8];
|
|
1038
1099
|
if (l) {
|
|
1039
1100
|
if (l === "Z" || l === "z") return Date.UTC(e, n, i, a, o, s, c);
|
|
1040
|
-
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) *
|
|
1101
|
+
let t = l[0] === "+" ? 1 : -1, r = +l.slice(1, 3), u = +l.slice(-2), d = t * (r * 60 + u) * vt;
|
|
1041
1102
|
return Date.UTC(e, n, i, a, o, s, c) - d;
|
|
1042
1103
|
}
|
|
1043
1104
|
return t === "utc" ? Date.UTC(e, n, i, a, o, s, c) : new Date(e, n, i, a, o, s, c).getTime();
|
|
1044
1105
|
}
|
|
1045
1106
|
return null;
|
|
1046
1107
|
}
|
|
1047
|
-
function
|
|
1048
|
-
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ?
|
|
1108
|
+
function Dt(e) {
|
|
1109
|
+
return e instanceof Date ? Number.isFinite(e.getTime()) : typeof e == "string" ? ht.test(e) || gt.test(e) : !1;
|
|
1049
1110
|
}
|
|
1050
|
-
function
|
|
1111
|
+
function Ot(e, t) {
|
|
1051
1112
|
if (e.length === 0) return !1;
|
|
1052
1113
|
for (let n = 0; n < e.length; n++) {
|
|
1053
1114
|
let r = e[n];
|
|
1054
|
-
if (!
|
|
1115
|
+
if (!Dt(r) || Et(r, t) === null) return !1;
|
|
1055
1116
|
}
|
|
1056
1117
|
return !0;
|
|
1057
1118
|
}
|
|
1058
|
-
function
|
|
1119
|
+
function kt(e, t) {
|
|
1059
1120
|
let n = e / Math.max(1, t);
|
|
1060
|
-
for (let e of
|
|
1061
|
-
return
|
|
1121
|
+
for (let e of wt) if (n <= e.ms) return e;
|
|
1122
|
+
return wt[wt.length - 1];
|
|
1062
1123
|
}
|
|
1063
|
-
function
|
|
1124
|
+
function At(e, t, n) {
|
|
1064
1125
|
let r = new Date(e);
|
|
1065
1126
|
if (n === "utc") switch (t) {
|
|
1066
|
-
case "second": return Math.floor(e /
|
|
1067
|
-
case "minute": return Math.floor(e /
|
|
1068
|
-
case "hour": return Math.floor(e /
|
|
1127
|
+
case "second": return Math.floor(e / _t) * _t;
|
|
1128
|
+
case "minute": return Math.floor(e / vt) * vt;
|
|
1129
|
+
case "hour": return Math.floor(e / yt) * yt;
|
|
1069
1130
|
case "day": return Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate());
|
|
1070
1131
|
case "week": {
|
|
1071
1132
|
let e = (r.getUTCDay() + 6) % 7;
|
|
@@ -1075,8 +1136,8 @@ function jt(e, t, n) {
|
|
|
1075
1136
|
case "year": return Date.UTC(r.getUTCFullYear(), 0, 1);
|
|
1076
1137
|
}
|
|
1077
1138
|
switch (t) {
|
|
1078
|
-
case "second": return Math.floor(e /
|
|
1079
|
-
case "minute": return Math.floor(e /
|
|
1139
|
+
case "second": return Math.floor(e / _t) * _t;
|
|
1140
|
+
case "minute": return Math.floor(e / vt) * vt;
|
|
1080
1141
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
|
|
1081
1142
|
case "day": return new Date(r.getFullYear(), r.getMonth(), r.getDate()).getTime();
|
|
1082
1143
|
case "week": {
|
|
@@ -1087,11 +1148,11 @@ function jt(e, t, n) {
|
|
|
1087
1148
|
case "year": return new Date(r.getFullYear(), 0, 1).getTime();
|
|
1088
1149
|
}
|
|
1089
1150
|
}
|
|
1090
|
-
function
|
|
1091
|
-
if (t === "second") return e + n *
|
|
1092
|
-
if (t === "minute") return e + n *
|
|
1093
|
-
if (t === "hour" && r === "utc") return e + n *
|
|
1094
|
-
if (t === "week" && r === "utc") return e + n *
|
|
1151
|
+
function jt(e, t, n, r) {
|
|
1152
|
+
if (t === "second") return e + n * _t;
|
|
1153
|
+
if (t === "minute") return e + n * vt;
|
|
1154
|
+
if (t === "hour" && r === "utc") return e + n * yt;
|
|
1155
|
+
if (t === "week" && r === "utc") return e + n * xt;
|
|
1095
1156
|
let i = new Date(e);
|
|
1096
1157
|
if (r === "utc") switch (t) {
|
|
1097
1158
|
case "day": return Date.UTC(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate() + n, i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds());
|
|
@@ -1107,21 +1168,21 @@ function Mt(e, t, n, r) {
|
|
|
1107
1168
|
}
|
|
1108
1169
|
return e;
|
|
1109
1170
|
}
|
|
1110
|
-
function
|
|
1171
|
+
function Mt(e, t, n, r) {
|
|
1111
1172
|
if (!Number.isFinite(e) || !Number.isFinite(t) || e >= t || n < 1) return {
|
|
1112
1173
|
values: [],
|
|
1113
1174
|
unit: "day"
|
|
1114
1175
|
};
|
|
1115
|
-
let { unit: i, step: a } =
|
|
1116
|
-
for (; o < e && s <
|
|
1176
|
+
let { unit: i, step: a } = kt(t - e, n), o = At(e, i, r), s = 0;
|
|
1177
|
+
for (; o < e && s < Tt;) o = jt(o, i, a, r), s++;
|
|
1117
1178
|
let c = [];
|
|
1118
|
-
for (let e = 0; e <
|
|
1179
|
+
for (let e = 0; e < Tt && o <= t; e++) c.push(o), o = jt(o, i, a, r);
|
|
1119
1180
|
return {
|
|
1120
1181
|
values: c,
|
|
1121
1182
|
unit: i
|
|
1122
1183
|
};
|
|
1123
1184
|
}
|
|
1124
|
-
var
|
|
1185
|
+
var Nt = {
|
|
1125
1186
|
iso: {
|
|
1126
1187
|
year: "numeric",
|
|
1127
1188
|
month: "2-digit",
|
|
@@ -1159,7 +1220,7 @@ var Pt = {
|
|
|
1159
1220
|
hourCycle: "h23"
|
|
1160
1221
|
},
|
|
1161
1222
|
medium: { dateStyle: "medium" }
|
|
1162
|
-
},
|
|
1223
|
+
}, Pt = {
|
|
1163
1224
|
year: "year",
|
|
1164
1225
|
month: "month-year",
|
|
1165
1226
|
week: "month-day",
|
|
@@ -1171,27 +1232,27 @@ var Pt = {
|
|
|
1171
1232
|
function $(e) {
|
|
1172
1233
|
return e < 10 ? "0" + e : String(e);
|
|
1173
1234
|
}
|
|
1174
|
-
function
|
|
1235
|
+
function Ft(e, t) {
|
|
1175
1236
|
let n = new Date(e);
|
|
1176
1237
|
return t === "utc" ? `${n.getUTCFullYear()}-${$(n.getUTCMonth() + 1)}-${$(n.getUTCDate())}` : `${n.getFullYear()}-${$(n.getMonth() + 1)}-${$(n.getDate())}`;
|
|
1177
1238
|
}
|
|
1178
|
-
function
|
|
1239
|
+
function It(e, t) {
|
|
1179
1240
|
let n = new Date(e);
|
|
1180
1241
|
return t === "utc" ? `${n.getUTCFullYear()}-${$(n.getUTCMonth() + 1)}-${$(n.getUTCDate())}T${$(n.getUTCHours())}:${$(n.getUTCMinutes())}:${$(n.getUTCSeconds())}Z` : `${n.getFullYear()}-${$(n.getMonth() + 1)}-${$(n.getDate())}T${$(n.getHours())}:${$(n.getMinutes())}:${$(n.getSeconds())}`;
|
|
1181
1242
|
}
|
|
1182
|
-
function
|
|
1183
|
-
return e in
|
|
1243
|
+
function Lt(e) {
|
|
1244
|
+
return e in Nt;
|
|
1184
1245
|
}
|
|
1185
|
-
function
|
|
1246
|
+
function Rt(e, t, n, r) {
|
|
1186
1247
|
if (typeof t == "function") return t(e, r);
|
|
1187
1248
|
let i = null, a;
|
|
1188
|
-
if (t === void 0) i = r ?
|
|
1249
|
+
if (t === void 0) i = r ? Pt[r] : "iso", a = Nt[i];
|
|
1189
1250
|
else if (typeof t == "string") {
|
|
1190
|
-
if (!
|
|
1191
|
-
i = t, a =
|
|
1251
|
+
if (!Lt(t)) throw Error(`Unknown date format preset: "${t}"`);
|
|
1252
|
+
i = t, a = Nt[i];
|
|
1192
1253
|
} else a = t;
|
|
1193
|
-
if (i === "iso") return
|
|
1194
|
-
if (i === "iso-datetime") return
|
|
1254
|
+
if (i === "iso") return Ft(e, n);
|
|
1255
|
+
if (i === "iso-datetime") return It(e, n);
|
|
1195
1256
|
let o = n === "utc" ? {
|
|
1196
1257
|
...a,
|
|
1197
1258
|
timeZone: "UTC"
|
|
@@ -1200,68 +1261,68 @@ function zt(e, t, n, r) {
|
|
|
1200
1261
|
}
|
|
1201
1262
|
//#endregion
|
|
1202
1263
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
1203
|
-
var
|
|
1264
|
+
var zt = {
|
|
1204
1265
|
class: "chart-sr-only",
|
|
1205
1266
|
"aria-live": "polite"
|
|
1206
|
-
},
|
|
1267
|
+
}, Bt = ["width", "height"], Vt = [
|
|
1207
1268
|
"x",
|
|
1208
1269
|
"y",
|
|
1209
1270
|
"text-anchor",
|
|
1210
1271
|
"font-size",
|
|
1211
1272
|
"font-weight",
|
|
1212
1273
|
"fill"
|
|
1213
|
-
],
|
|
1274
|
+
], Ht = ["x", "dy"], Ut = { key: 1 }, Wt = [
|
|
1214
1275
|
"x1",
|
|
1215
1276
|
"y1",
|
|
1216
1277
|
"x2",
|
|
1217
1278
|
"y2",
|
|
1218
1279
|
"stroke",
|
|
1219
1280
|
"stroke-dasharray"
|
|
1220
|
-
],
|
|
1281
|
+
], Gt = [
|
|
1221
1282
|
"cx",
|
|
1222
1283
|
"cy",
|
|
1223
1284
|
"fill",
|
|
1224
1285
|
"fill-opacity",
|
|
1225
1286
|
"stroke"
|
|
1226
|
-
],
|
|
1287
|
+
], Kt = [
|
|
1227
1288
|
"x",
|
|
1228
1289
|
"y",
|
|
1229
1290
|
"font-size",
|
|
1230
1291
|
"fill",
|
|
1231
1292
|
"font-weight"
|
|
1232
|
-
],
|
|
1293
|
+
], qt = [
|
|
1233
1294
|
"x1",
|
|
1234
1295
|
"y1",
|
|
1235
1296
|
"x2",
|
|
1236
1297
|
"y2"
|
|
1237
|
-
],
|
|
1298
|
+
], Jt = [
|
|
1238
1299
|
"x1",
|
|
1239
1300
|
"y1",
|
|
1240
1301
|
"x2",
|
|
1241
1302
|
"y2"
|
|
1242
|
-
],
|
|
1303
|
+
], Yt = [
|
|
1243
1304
|
"x1",
|
|
1244
1305
|
"y1",
|
|
1245
1306
|
"x2",
|
|
1246
1307
|
"y2"
|
|
1247
|
-
],
|
|
1308
|
+
], Xt = [
|
|
1248
1309
|
"x1",
|
|
1249
1310
|
"y1",
|
|
1250
1311
|
"x2",
|
|
1251
1312
|
"y2"
|
|
1252
|
-
],
|
|
1313
|
+
], Zt = [
|
|
1253
1314
|
"x",
|
|
1254
1315
|
"y",
|
|
1255
1316
|
"font-size",
|
|
1256
1317
|
"fill",
|
|
1257
1318
|
"font-weight",
|
|
1258
1319
|
"fill-opacity"
|
|
1259
|
-
],
|
|
1320
|
+
], Qt = [
|
|
1260
1321
|
"transform",
|
|
1261
1322
|
"font-size",
|
|
1262
1323
|
"fill",
|
|
1263
1324
|
"font-weight"
|
|
1264
|
-
],
|
|
1325
|
+
], $t = [
|
|
1265
1326
|
"x",
|
|
1266
1327
|
"y",
|
|
1267
1328
|
"text-anchor",
|
|
@@ -1269,39 +1330,43 @@ var Bt = {
|
|
|
1269
1330
|
"fill",
|
|
1270
1331
|
"font-weight",
|
|
1271
1332
|
"fill-opacity"
|
|
1272
|
-
],
|
|
1333
|
+
], en = [
|
|
1273
1334
|
"x",
|
|
1274
1335
|
"y",
|
|
1275
1336
|
"font-size",
|
|
1276
1337
|
"fill",
|
|
1277
1338
|
"font-weight"
|
|
1278
|
-
],
|
|
1339
|
+
], tn = [
|
|
1279
1340
|
"d",
|
|
1280
1341
|
"fill",
|
|
1281
1342
|
"fill-opacity"
|
|
1282
|
-
],
|
|
1343
|
+
], nn = [
|
|
1344
|
+
"d",
|
|
1345
|
+
"stroke",
|
|
1346
|
+
"stroke-width"
|
|
1347
|
+
], rn = [
|
|
1283
1348
|
"d",
|
|
1284
1349
|
"stroke",
|
|
1285
1350
|
"stroke-width",
|
|
1286
1351
|
"stroke-opacity",
|
|
1287
1352
|
"stroke-dasharray"
|
|
1288
|
-
],
|
|
1353
|
+
], an = [
|
|
1289
1354
|
"cx",
|
|
1290
1355
|
"cy",
|
|
1291
1356
|
"r",
|
|
1292
1357
|
"fill",
|
|
1293
1358
|
"fill-opacity",
|
|
1294
1359
|
"stroke"
|
|
1295
|
-
],
|
|
1360
|
+
], on = [
|
|
1296
1361
|
"d",
|
|
1297
1362
|
"fill",
|
|
1298
1363
|
"fill-opacity"
|
|
1299
|
-
],
|
|
1364
|
+
], sn = [
|
|
1300
1365
|
"d",
|
|
1301
1366
|
"stroke",
|
|
1302
1367
|
"stroke-width",
|
|
1303
1368
|
"stroke-dasharray"
|
|
1304
|
-
],
|
|
1369
|
+
], cn = [
|
|
1305
1370
|
"x1",
|
|
1306
1371
|
"y1",
|
|
1307
1372
|
"x2",
|
|
@@ -1309,7 +1374,7 @@ var Bt = {
|
|
|
1309
1374
|
"stroke",
|
|
1310
1375
|
"stroke-width",
|
|
1311
1376
|
"stroke-dasharray"
|
|
1312
|
-
],
|
|
1377
|
+
], ln = [
|
|
1313
1378
|
"x1",
|
|
1314
1379
|
"y1",
|
|
1315
1380
|
"x2",
|
|
@@ -1317,53 +1382,54 @@ var Bt = {
|
|
|
1317
1382
|
"stroke",
|
|
1318
1383
|
"stroke-width",
|
|
1319
1384
|
"stroke-dasharray"
|
|
1320
|
-
],
|
|
1385
|
+
], un = [
|
|
1321
1386
|
"x1",
|
|
1322
1387
|
"y1",
|
|
1323
1388
|
"x2",
|
|
1324
1389
|
"y2"
|
|
1325
|
-
],
|
|
1390
|
+
], dn = [
|
|
1326
1391
|
"x1",
|
|
1327
1392
|
"y1",
|
|
1328
1393
|
"x2",
|
|
1329
1394
|
"y2"
|
|
1330
|
-
],
|
|
1395
|
+
], fn = [
|
|
1331
1396
|
"x1",
|
|
1332
1397
|
"y1",
|
|
1333
1398
|
"x2",
|
|
1334
1399
|
"y2"
|
|
1335
|
-
],
|
|
1400
|
+
], pn = [
|
|
1336
1401
|
"cx",
|
|
1337
1402
|
"cy",
|
|
1338
1403
|
"fill"
|
|
1339
|
-
],
|
|
1404
|
+
], mn = [
|
|
1340
1405
|
"x",
|
|
1341
1406
|
"y",
|
|
1342
1407
|
"width",
|
|
1343
1408
|
"height"
|
|
1344
|
-
],
|
|
1409
|
+
], hn = [
|
|
1345
1410
|
"cx",
|
|
1346
1411
|
"cy",
|
|
1347
1412
|
"fill",
|
|
1348
1413
|
"fill-opacity",
|
|
1349
1414
|
"stroke"
|
|
1350
|
-
],
|
|
1415
|
+
], gn = [
|
|
1351
1416
|
"x",
|
|
1352
1417
|
"y",
|
|
1353
1418
|
"font-size",
|
|
1354
1419
|
"font-weight",
|
|
1355
1420
|
"fill"
|
|
1356
|
-
],
|
|
1421
|
+
], _n = [
|
|
1357
1422
|
"x",
|
|
1358
1423
|
"y",
|
|
1359
1424
|
"font-size",
|
|
1360
1425
|
"font-weight",
|
|
1361
1426
|
"fill",
|
|
1362
1427
|
"fill-opacity"
|
|
1363
|
-
],
|
|
1428
|
+
], vn = { class: "line-chart-tooltip" }, yn = {
|
|
1364
1429
|
key: 0,
|
|
1365
1430
|
class: "line-chart-tooltip-label"
|
|
1366
|
-
},
|
|
1431
|
+
}, bn = ["href", "download"], xn = 36, Sn = 12, Cn = 7, wn = 16, Tn = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
1432
|
+
inheritAttrs: !1,
|
|
1367
1433
|
__name: "LineChart",
|
|
1368
1434
|
props: {
|
|
1369
1435
|
y: {},
|
|
@@ -1406,12 +1472,13 @@ var Bt = {
|
|
|
1406
1472
|
filename: {},
|
|
1407
1473
|
downloadLink: { type: [Boolean, String] },
|
|
1408
1474
|
downloadButton: { type: [Boolean, String] },
|
|
1475
|
+
fullscreenTarget: {},
|
|
1409
1476
|
annotations: {},
|
|
1410
1477
|
chartPadding: {}
|
|
1411
1478
|
},
|
|
1412
1479
|
emits: ["hover"],
|
|
1413
|
-
setup(
|
|
1414
|
-
let
|
|
1480
|
+
setup(c, { emit: l }) {
|
|
1481
|
+
let f = c, h = l, g = [];
|
|
1415
1482
|
function* v(e) {
|
|
1416
1483
|
if (e.x && e.x.length > 0 && (yield e.x), e.series) for (let t of e.series) t.x && t.x.length > 0 && (yield t.x);
|
|
1417
1484
|
if (e.areas) for (let t of e.areas) t.x && t.x.length > 0 && (yield t.x);
|
|
@@ -1420,30 +1487,30 @@ var Bt = {
|
|
|
1420
1487
|
if (!e) return;
|
|
1421
1488
|
if (!t) return e;
|
|
1422
1489
|
let r = new Float64Array(e.length);
|
|
1423
|
-
for (let t = 0; t < e.length; t++) r[t] =
|
|
1490
|
+
for (let t = 0; t < e.length; t++) r[t] = Et(e[t], n) ?? NaN;
|
|
1424
1491
|
return r;
|
|
1425
1492
|
}
|
|
1426
|
-
let w =
|
|
1493
|
+
let w = ct(() => f.tooltipValueFormat, () => f.yTickFormat), T = n(() => f.timezone ?? "utc"), E = n(() => {
|
|
1427
1494
|
let e = T.value, t = !1, n = !1;
|
|
1428
|
-
for (let r of v(
|
|
1429
|
-
if (n = !0, !
|
|
1495
|
+
for (let r of v(f)) {
|
|
1496
|
+
if (n = !0, !Ot(r, e)) {
|
|
1430
1497
|
t = !1;
|
|
1431
1498
|
break;
|
|
1432
1499
|
}
|
|
1433
1500
|
t = !0;
|
|
1434
1501
|
}
|
|
1435
1502
|
n || (t = !1);
|
|
1436
|
-
let r =
|
|
1503
|
+
let r = f.series && f.series.length > 0 ? f.series.map((n) => ({
|
|
1437
1504
|
...n,
|
|
1438
1505
|
data: n.y ?? n.data ?? g,
|
|
1439
1506
|
x: S(n.x, t, e)
|
|
1440
1507
|
})) : (() => {
|
|
1441
|
-
let n =
|
|
1508
|
+
let n = f.y ?? f.data;
|
|
1442
1509
|
return n ? [{
|
|
1443
1510
|
data: n,
|
|
1444
|
-
x: S(
|
|
1511
|
+
x: S(f.x, t, e)
|
|
1445
1512
|
}] : [];
|
|
1446
|
-
})(), i = (
|
|
1513
|
+
})(), i = (f.areas ?? []).map((n) => ({
|
|
1447
1514
|
...n,
|
|
1448
1515
|
x: S(n.x, t, e)
|
|
1449
1516
|
}));
|
|
@@ -1461,10 +1528,10 @@ var Bt = {
|
|
|
1461
1528
|
function j(e, t) {
|
|
1462
1529
|
return e.x ? Number(e.x[t]) : t;
|
|
1463
1530
|
}
|
|
1464
|
-
function
|
|
1531
|
+
function M(e, t) {
|
|
1465
1532
|
return e.x ? Number(e.x[t]) : t;
|
|
1466
1533
|
}
|
|
1467
|
-
let
|
|
1534
|
+
let re = n(() => A.value ? 0 : f.xMin ?? 0), ie = n(() => {
|
|
1468
1535
|
let e = Infinity, t = -Infinity;
|
|
1469
1536
|
for (let n of O.value) for (let r = 0; r < n.data.length; r++) {
|
|
1470
1537
|
let i = j(n, r);
|
|
@@ -1473,7 +1540,7 @@ var Bt = {
|
|
|
1473
1540
|
for (let n of k.value) {
|
|
1474
1541
|
let r = Math.max(n.upper.length, n.lower.length);
|
|
1475
1542
|
for (let i = 0; i < r; i++) {
|
|
1476
|
-
let r =
|
|
1543
|
+
let r = M(n, i);
|
|
1477
1544
|
isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
1478
1545
|
}
|
|
1479
1546
|
}
|
|
@@ -1503,8 +1570,8 @@ var Bt = {
|
|
|
1503
1570
|
max: 0,
|
|
1504
1571
|
range: 1
|
|
1505
1572
|
};
|
|
1506
|
-
|
|
1507
|
-
let i =
|
|
1573
|
+
f.yMin != null && f.yMin < e && (e = f.yMin);
|
|
1574
|
+
let i = _e(e, t, f.yScaleType, n);
|
|
1508
1575
|
return {
|
|
1509
1576
|
min: i.min,
|
|
1510
1577
|
max: i.max,
|
|
@@ -1513,7 +1580,7 @@ var Bt = {
|
|
|
1513
1580
|
});
|
|
1514
1581
|
function P(e) {
|
|
1515
1582
|
let { min: t, max: n } = ae.value;
|
|
1516
|
-
return U.value.top + K.value -
|
|
1583
|
+
return U.value.top + K.value - ge(e, t, n, f.yScaleType) * K.value;
|
|
1517
1584
|
}
|
|
1518
1585
|
function oe(e) {
|
|
1519
1586
|
let t = e.data;
|
|
@@ -1545,13 +1612,13 @@ var Bt = {
|
|
|
1545
1612
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
1546
1613
|
if (t === 0) return "";
|
|
1547
1614
|
let n = [], r = [];
|
|
1548
|
-
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(
|
|
1615
|
+
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(M(e, i)) ? r.push(i) : r.length && (n.push(r), r = []);
|
|
1549
1616
|
r.length && n.push(r);
|
|
1550
1617
|
let i = "";
|
|
1551
1618
|
for (let t of n) {
|
|
1552
|
-
i += `M${N(
|
|
1553
|
-
for (let n = 1; n < t.length; n++) i += `L${N(
|
|
1554
|
-
for (let n = t.length - 1; n >= 0; n--) i += `L${N(
|
|
1619
|
+
i += `M${N(M(e, t[0]))},${P(e.upper[t[0]])}`;
|
|
1620
|
+
for (let n = 1; n < t.length; n++) i += `L${N(M(e, t[n]))},${P(e.upper[t[n]])}`;
|
|
1621
|
+
for (let n = t.length - 1; n >= 0; n--) i += `L${N(M(e, t[n]))},${P(e.lower[t[n]])}`;
|
|
1555
1622
|
i += "Z";
|
|
1556
1623
|
}
|
|
1557
1624
|
return i;
|
|
@@ -1575,7 +1642,7 @@ var Bt = {
|
|
|
1575
1642
|
return t && (o += `L${N(j(r, a))},${n}`, o += `L${N(j(r, i))},${n}`, o += "Z"), o;
|
|
1576
1643
|
}
|
|
1577
1644
|
let ue = n(() => {
|
|
1578
|
-
let e =
|
|
1645
|
+
let e = f.areaSections;
|
|
1579
1646
|
if (!e?.length) return {
|
|
1580
1647
|
labels: [],
|
|
1581
1648
|
extraHeight: 0
|
|
@@ -1583,11 +1650,11 @@ var Bt = {
|
|
|
1583
1650
|
let t = [], n = U.value.left + G.value;
|
|
1584
1651
|
for (let r of e) {
|
|
1585
1652
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
1586
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) *
|
|
1653
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Cn, o = F(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"), u = xe({
|
|
1587
1654
|
color: l,
|
|
1588
1655
|
fontWeight: 600,
|
|
1589
1656
|
...r.inlineLabelStyle
|
|
1590
|
-
}, { fontSize: 11 }), d =
|
|
1657
|
+
}, { fontSize: 11 }), d = xe(r.inlineDescriptionStyle, {
|
|
1591
1658
|
fontSize: 11,
|
|
1592
1659
|
fillOpacity: .6
|
|
1593
1660
|
});
|
|
@@ -1607,7 +1674,7 @@ var Bt = {
|
|
|
1607
1674
|
let r = [];
|
|
1608
1675
|
for (let e of t) {
|
|
1609
1676
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
1610
|
-
for (; n < r.length && !(t >= r[n] +
|
|
1677
|
+
for (; n < r.length && !(t >= r[n] + wn);) n++;
|
|
1611
1678
|
e.row = n;
|
|
1612
1679
|
let i = e.cx + e.textWidth / 2;
|
|
1613
1680
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -1617,9 +1684,9 @@ var Bt = {
|
|
|
1617
1684
|
extraHeight: 0
|
|
1618
1685
|
} : {
|
|
1619
1686
|
labels: t,
|
|
1620
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
1687
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * xn + Sn
|
|
1621
1688
|
};
|
|
1622
|
-
}),
|
|
1689
|
+
}), de = n(() => {
|
|
1623
1690
|
let e = [];
|
|
1624
1691
|
for (let t of O.value) !t.legend || t.showInLegend === !1 || e.push({
|
|
1625
1692
|
label: t.legend,
|
|
@@ -1627,7 +1694,7 @@ var Bt = {
|
|
|
1627
1694
|
type: "series",
|
|
1628
1695
|
dashed: t.dashed
|
|
1629
1696
|
});
|
|
1630
|
-
let t =
|
|
1697
|
+
let t = f.areaSections;
|
|
1631
1698
|
if (t) for (let n of t) {
|
|
1632
1699
|
if (n.legend !== "inline" || !n.label && !n.description) continue;
|
|
1633
1700
|
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : O.value[n.seriesIndex]?.color ?? "currentColor");
|
|
@@ -1639,68 +1706,68 @@ var Bt = {
|
|
|
1639
1706
|
});
|
|
1640
1707
|
}
|
|
1641
1708
|
return e;
|
|
1642
|
-
}),
|
|
1643
|
-
let { min: e, max: t } = ae.value, n = (e) =>
|
|
1709
|
+
}), I = n(() => de.value.map((e) => e.label)), L = n(() => Me.value + ue.value.extraHeight), z = n(() => U.value.top + K.value + U.value.bottom + Sn), B = n(() => {
|
|
1710
|
+
let { min: e, max: t } = ae.value, n = (e) => f.yTickFormat === void 0 ? me(e) : te(e, f.yTickFormat);
|
|
1644
1711
|
return e === t ? [{
|
|
1645
1712
|
value: n(e),
|
|
1646
1713
|
y: R(U.value.top + K.value / 2)
|
|
1647
|
-
}] : (
|
|
1714
|
+
}] : (f.yScaleType === "log" ? ve({
|
|
1648
1715
|
min: e,
|
|
1649
1716
|
max: t,
|
|
1650
|
-
ticks:
|
|
1651
|
-
}) :
|
|
1717
|
+
ticks: f.yTicks
|
|
1718
|
+
}) : he({
|
|
1652
1719
|
min: e,
|
|
1653
1720
|
max: t,
|
|
1654
|
-
ticks:
|
|
1721
|
+
ticks: f.yTicks,
|
|
1655
1722
|
targetTickCount: K.value / 50
|
|
1656
1723
|
})).map((e) => ({
|
|
1657
1724
|
value: n(e),
|
|
1658
1725
|
y: R(P(e))
|
|
1659
1726
|
}));
|
|
1660
1727
|
});
|
|
1661
|
-
function
|
|
1662
|
-
let r =
|
|
1663
|
-
if (D.value) return typeof r == "function" ? r(e, t) :
|
|
1664
|
-
let i = e +
|
|
1665
|
-
return r === void 0 ? !A.value &&
|
|
1728
|
+
function pe(e, t, n) {
|
|
1729
|
+
let r = f.xTickFormat;
|
|
1730
|
+
if (D.value) return typeof r == "function" ? r(e, t) : Rt(e, r, T.value, n);
|
|
1731
|
+
let i = e + re.value;
|
|
1732
|
+
return r === void 0 ? !A.value && f.xLabels && Number.isInteger(e) && e >= 0 && e < f.xLabels.length ? f.xLabels[e] : me(i) : typeof r == "function" ? r(i, t) : te(i, r);
|
|
1666
1733
|
}
|
|
1667
|
-
let
|
|
1734
|
+
let ye = n(() => {
|
|
1668
1735
|
let { min: e, max: t } = ie.value;
|
|
1669
1736
|
if (e === t) return [];
|
|
1670
|
-
let n = D.value, r = n ? 0 :
|
|
1737
|
+
let n = D.value, r = n ? 0 : re.value, i = ne.value, a = G.value / 80, o, s;
|
|
1671
1738
|
if (n) {
|
|
1672
|
-
let n =
|
|
1673
|
-
s = n.unit, o =
|
|
1739
|
+
let n = Mt(e, t, a, T.value);
|
|
1740
|
+
s = n.unit, o = he({
|
|
1674
1741
|
min: e,
|
|
1675
1742
|
max: t,
|
|
1676
1743
|
ticks: n.values
|
|
1677
1744
|
});
|
|
1678
|
-
} else if (
|
|
1745
|
+
} else if (f.xTicks == null && !A.value && f.xLabels && f.xLabels.length === i) {
|
|
1679
1746
|
let e = Math.max(3, Math.floor(a)), t = Math.max(1, Math.round((i - 1) / e));
|
|
1680
1747
|
o = [];
|
|
1681
1748
|
for (let e = 0; e < i; e += t) o.push(e);
|
|
1682
|
-
} else o =
|
|
1749
|
+
} else o = he({
|
|
1683
1750
|
min: e,
|
|
1684
1751
|
max: t,
|
|
1685
|
-
ticks:
|
|
1752
|
+
ticks: f.xTicks,
|
|
1686
1753
|
targetTickCount: a,
|
|
1687
1754
|
displayOffset: r
|
|
1688
1755
|
});
|
|
1689
|
-
let c = U.value.left,
|
|
1756
|
+
let c = U.value.left, l = U.value.left + G.value;
|
|
1690
1757
|
return o.map((e, t) => {
|
|
1691
1758
|
let n = R(N(e)), r = "middle";
|
|
1692
|
-
return n - c <= 1 ? r = "start" :
|
|
1693
|
-
value:
|
|
1759
|
+
return n - c <= 1 ? r = "start" : l - n <= 1 && (r = "end"), {
|
|
1760
|
+
value: pe(e, t, s),
|
|
1694
1761
|
x: n,
|
|
1695
1762
|
anchor: r
|
|
1696
1763
|
};
|
|
1697
1764
|
});
|
|
1698
1765
|
});
|
|
1699
|
-
function
|
|
1700
|
-
return typeof
|
|
1766
|
+
function be() {
|
|
1767
|
+
return typeof f.csv == "function" ? f.csv() : typeof f.csv == "string" ? f.csv : Be(O.value);
|
|
1701
1768
|
}
|
|
1702
|
-
let
|
|
1703
|
-
let e =
|
|
1769
|
+
let Se = n(() => !!f.tooltipData || !!f.tooltipTrigger), Ce = n(() => {
|
|
1770
|
+
let e = q.value, t = O.value[0];
|
|
1704
1771
|
return e === null || !t ? null : j(t, e);
|
|
1705
1772
|
}), we = n(() => Ce.value === null ? 0 : N(Ce.value));
|
|
1706
1773
|
function Te(e, t) {
|
|
@@ -1732,9 +1799,9 @@ var Bt = {
|
|
|
1732
1799
|
}
|
|
1733
1800
|
return t;
|
|
1734
1801
|
}), De = n(() => {
|
|
1735
|
-
let e =
|
|
1802
|
+
let e = q.value, t = Ce.value;
|
|
1736
1803
|
if (e === null || t === null) return null;
|
|
1737
|
-
let n =
|
|
1804
|
+
let n = pe(t, e), r = O.value, i = [];
|
|
1738
1805
|
for (let e = 0; e < r.length; e++) {
|
|
1739
1806
|
let n = r[e];
|
|
1740
1807
|
if (n.showInTooltip === !1) continue;
|
|
@@ -1749,12 +1816,12 @@ var Bt = {
|
|
|
1749
1816
|
index: e,
|
|
1750
1817
|
xLabel: n,
|
|
1751
1818
|
values: i,
|
|
1752
|
-
data:
|
|
1819
|
+
data: f.tooltipData?.[e] ?? null
|
|
1753
1820
|
};
|
|
1754
1821
|
});
|
|
1755
1822
|
function Oe(e, t) {
|
|
1756
1823
|
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1757
|
-
x: N(e -
|
|
1824
|
+
x: N(e - re.value),
|
|
1758
1825
|
y: P(t)
|
|
1759
1826
|
};
|
|
1760
1827
|
}
|
|
@@ -1766,34 +1833,35 @@ var Bt = {
|
|
|
1766
1833
|
let { min: r, max: i } = ie.value, a = i - r || 1;
|
|
1767
1834
|
return Te(n, r + (e - t.left - U.value.left) / G.value * a);
|
|
1768
1835
|
}
|
|
1769
|
-
let { containerRef: Ae, svgRef: H, width: je, height: Me, padding: U, legendY: W, inlineLegendLayout: Ne, innerW: G, innerH: K, bounds: Pe, hoverIndex:
|
|
1770
|
-
width: () =>
|
|
1771
|
-
height: () =>
|
|
1772
|
-
title: () =>
|
|
1773
|
-
titleStyle: () =>
|
|
1774
|
-
xLabel: () =>
|
|
1775
|
-
yLabel: () =>
|
|
1776
|
-
debounce: () =>
|
|
1777
|
-
menu: () =>
|
|
1778
|
-
tooltipTrigger: () =>
|
|
1779
|
-
tooltipClamp: () =>
|
|
1780
|
-
filename: () =>
|
|
1781
|
-
downloadLink: () =>
|
|
1782
|
-
downloadButton: () =>
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1836
|
+
let { containerRef: Ae, svgRef: H, width: je, height: Me, padding: U, legendY: W, inlineLegendLayout: Ne, innerW: G, innerH: K, bounds: Pe, hoverIndex: q, tooltipRef: Fe, tooltipPos: Ie, tooltipHandlers: Le, menuItems: Re, downloadLinkText: ze, csvHref: Ve, downloadButtonText: He, triggerCsvDownload: Ue, menuFilename: We, isFullscreen: Ge, fullscreenStyle: Ke, teleportTarget: J, exitFullscreen: qe } = st({
|
|
1837
|
+
width: () => f.width,
|
|
1838
|
+
height: () => f.height,
|
|
1839
|
+
title: () => f.title,
|
|
1840
|
+
titleStyle: () => f.titleStyle,
|
|
1841
|
+
xLabel: () => f.xLabel,
|
|
1842
|
+
yLabel: () => f.yLabel,
|
|
1843
|
+
debounce: () => f.debounce,
|
|
1844
|
+
menu: () => f.menu,
|
|
1845
|
+
tooltipTrigger: () => f.tooltipTrigger,
|
|
1846
|
+
tooltipClamp: () => f.tooltipClamp,
|
|
1847
|
+
filename: () => f.filename,
|
|
1848
|
+
downloadLink: () => f.downloadLink,
|
|
1849
|
+
downloadButton: () => f.downloadButton,
|
|
1850
|
+
fullscreenTarget: () => f.fullscreenTarget,
|
|
1851
|
+
chartPadding: () => f.chartPadding,
|
|
1852
|
+
inlineLegendLabels: () => I.value,
|
|
1853
|
+
hasTooltipSlot: () => Se.value,
|
|
1854
|
+
getCsv: be,
|
|
1787
1855
|
pointerToIndex: ke,
|
|
1788
1856
|
onHover: (e) => h("hover", e),
|
|
1789
1857
|
extraBelowHeight: () => ue.value.extraHeight
|
|
1790
|
-
}),
|
|
1858
|
+
}), Y = n(() => xe(f.axisLabelStyle, { fontSize: 13 })), X = n(() => xe(f.tickLabelStyle, {
|
|
1791
1859
|
fontSize: 10,
|
|
1792
|
-
fillOpacity:
|
|
1793
|
-
})),
|
|
1794
|
-
let e =
|
|
1860
|
+
fillOpacity: V
|
|
1861
|
+
})), Je = n(() => xe(f.legendStyle, { fontSize: 11 })), Z = n(() => {
|
|
1862
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = Pe.value, r = t === "left" ? n.left : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
1795
1863
|
return {
|
|
1796
|
-
lines: (
|
|
1864
|
+
lines: (f.title ?? "").split("\n"),
|
|
1797
1865
|
fontSize: e?.fontSize ?? 14,
|
|
1798
1866
|
lineHeight: e?.lineHeight ?? 18,
|
|
1799
1867
|
fontWeight: e?.fontWeight ?? 600,
|
|
@@ -1801,9 +1869,9 @@ var Bt = {
|
|
|
1801
1869
|
x: r,
|
|
1802
1870
|
anchor: i
|
|
1803
1871
|
};
|
|
1804
|
-
}),
|
|
1872
|
+
}), Q = n(() => {
|
|
1805
1873
|
let e = Ne.value.positions, t = U.value.left, n = W.value;
|
|
1806
|
-
return
|
|
1874
|
+
return de.value.map((r, i) => {
|
|
1807
1875
|
let a = e[i];
|
|
1808
1876
|
return {
|
|
1809
1877
|
...r,
|
|
@@ -1812,36 +1880,47 @@ var Bt = {
|
|
|
1812
1880
|
};
|
|
1813
1881
|
});
|
|
1814
1882
|
});
|
|
1815
|
-
return (n,
|
|
1883
|
+
return (n, l) => (_(), r(t, {
|
|
1884
|
+
to: C(J),
|
|
1885
|
+
disabled: !C(Ge)
|
|
1886
|
+
}, [o("div", d({
|
|
1816
1887
|
ref_key: "containerRef",
|
|
1817
|
-
ref: Ae
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1888
|
+
ref: Ae
|
|
1889
|
+
}, n.$attrs, {
|
|
1890
|
+
class: ["line-chart-wrapper", { "is-fullscreen": C(Ge) }],
|
|
1891
|
+
style: C(Ke)
|
|
1892
|
+
}), [
|
|
1893
|
+
c.menu ? (_(), r(fe, {
|
|
1821
1894
|
key: 0,
|
|
1822
|
-
items: C(
|
|
1823
|
-
|
|
1824
|
-
|
|
1895
|
+
items: C(Re),
|
|
1896
|
+
"is-fullscreen": C(Ge),
|
|
1897
|
+
onClose: C(qe)
|
|
1898
|
+
}, null, 8, [
|
|
1899
|
+
"items",
|
|
1900
|
+
"is-fullscreen",
|
|
1901
|
+
"onClose"
|
|
1902
|
+
])) : i("", !0),
|
|
1903
|
+
o("div", zt, x(C(Ge) ? "Chart expanded to fill window" : ""), 1),
|
|
1825
1904
|
(_(), a("svg", {
|
|
1826
1905
|
ref_key: "svgRef",
|
|
1827
1906
|
ref: H,
|
|
1828
1907
|
width: C(je),
|
|
1829
|
-
height:
|
|
1908
|
+
height: L.value
|
|
1830
1909
|
}, [
|
|
1831
|
-
|
|
1910
|
+
c.title ? (_(), a("text", {
|
|
1832
1911
|
key: 0,
|
|
1833
|
-
x:
|
|
1834
|
-
y:
|
|
1835
|
-
"text-anchor":
|
|
1836
|
-
"font-size":
|
|
1837
|
-
"font-weight":
|
|
1838
|
-
fill:
|
|
1839
|
-
}, [(_(!0), a(e, null, y(
|
|
1912
|
+
x: Z.value.x,
|
|
1913
|
+
y: Z.value.lineHeight,
|
|
1914
|
+
"text-anchor": Z.value.anchor,
|
|
1915
|
+
"font-size": Z.value.fontSize,
|
|
1916
|
+
"font-weight": Z.value.fontWeight,
|
|
1917
|
+
fill: Z.value.color
|
|
1918
|
+
}, [(_(!0), a(e, null, y(Z.value.lines, (e, t) => (_(), a("tspan", {
|
|
1840
1919
|
key: t,
|
|
1841
|
-
x:
|
|
1842
|
-
dy: t === 0 ? 0 :
|
|
1843
|
-
}, x(e), 9,
|
|
1844
|
-
|
|
1920
|
+
x: Z.value.x,
|
|
1921
|
+
dy: t === 0 ? 0 : Z.value.lineHeight
|
|
1922
|
+
}, x(e), 9, Ht))), 128))], 8, Vt)) : i("", !0),
|
|
1923
|
+
Q.value.length > 0 ? (_(), a("g", Ut, [(_(!0), a(e, null, y(Q.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
|
|
1845
1924
|
key: 0,
|
|
1846
1925
|
x1: t.x,
|
|
1847
1926
|
y1: t.y,
|
|
@@ -1850,7 +1929,7 @@ var Bt = {
|
|
|
1850
1929
|
stroke: t.color,
|
|
1851
1930
|
"stroke-width": "2",
|
|
1852
1931
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
1853
|
-
}, null, 8,
|
|
1932
|
+
}, null, 8, Wt)) : (_(), a("circle", {
|
|
1854
1933
|
key: 1,
|
|
1855
1934
|
cx: t.x + 4,
|
|
1856
1935
|
cy: t.y,
|
|
@@ -1859,13 +1938,13 @@ var Bt = {
|
|
|
1859
1938
|
"fill-opacity": t.fillOpacity,
|
|
1860
1939
|
stroke: t.color,
|
|
1861
1940
|
"stroke-width": "1.5"
|
|
1862
|
-
}, null, 8,
|
|
1941
|
+
}, null, 8, Gt)), o("text", {
|
|
1863
1942
|
x: t.x + 18,
|
|
1864
1943
|
y: t.y + 4,
|
|
1865
|
-
"font-size":
|
|
1866
|
-
fill:
|
|
1867
|
-
"font-weight":
|
|
1868
|
-
}, x(t.label), 9,
|
|
1944
|
+
"font-size": Je.value.fontSize,
|
|
1945
|
+
fill: Je.value.fill,
|
|
1946
|
+
"font-weight": Je.value.fontWeight
|
|
1947
|
+
}, x(t.label), 9, Kt)], 64))), 128))])) : i("", !0),
|
|
1869
1948
|
o("line", {
|
|
1870
1949
|
x1: C(R)(C(U).left),
|
|
1871
1950
|
y1: C(R)(C(U).top),
|
|
@@ -1873,7 +1952,7 @@ var Bt = {
|
|
|
1873
1952
|
y2: C(R)(C(U).top + C(K)),
|
|
1874
1953
|
stroke: "currentColor",
|
|
1875
1954
|
"stroke-opacity": "0.3"
|
|
1876
|
-
}, null, 8,
|
|
1955
|
+
}, null, 8, qt),
|
|
1877
1956
|
o("line", {
|
|
1878
1957
|
x1: C(R)(C(U).left),
|
|
1879
1958
|
y1: C(R)(C(U).top + C(K)),
|
|
@@ -1881,8 +1960,8 @@ var Bt = {
|
|
|
1881
1960
|
y2: C(R)(C(U).top + C(K)),
|
|
1882
1961
|
stroke: "currentColor",
|
|
1883
1962
|
"stroke-opacity": "0.3"
|
|
1884
|
-
}, null, 8,
|
|
1885
|
-
|
|
1963
|
+
}, null, 8, Jt),
|
|
1964
|
+
c.yGrid ? (_(!0), a(e, { key: 2 }, y(B.value, (e, t) => (_(), a("line", {
|
|
1886
1965
|
key: "yg" + t,
|
|
1887
1966
|
x1: C(U).left,
|
|
1888
1967
|
y1: e.y,
|
|
@@ -1890,8 +1969,8 @@ var Bt = {
|
|
|
1890
1969
|
y2: e.y,
|
|
1891
1970
|
stroke: "currentColor",
|
|
1892
1971
|
"stroke-opacity": "0.1"
|
|
1893
|
-
}, null, 8,
|
|
1894
|
-
|
|
1972
|
+
}, null, 8, Yt))), 128)) : i("", !0),
|
|
1973
|
+
c.xGrid ? (_(!0), a(e, { key: 3 }, y(ye.value, (e, t) => (_(), a("line", {
|
|
1895
1974
|
key: "xg" + t,
|
|
1896
1975
|
x1: e.x,
|
|
1897
1976
|
y1: C(U).top,
|
|
@@ -1899,95 +1978,95 @@ var Bt = {
|
|
|
1899
1978
|
y2: C(U).top + C(K),
|
|
1900
1979
|
stroke: "currentColor",
|
|
1901
1980
|
"stroke-opacity": "0.1"
|
|
1902
|
-
}, null, 8,
|
|
1903
|
-
(_(!0), a(e, null, y(
|
|
1981
|
+
}, null, 8, Xt))), 128)) : i("", !0),
|
|
1982
|
+
(_(!0), a(e, null, y(B.value, (e, t) => (_(), a("text", {
|
|
1904
1983
|
key: "y" + t,
|
|
1905
1984
|
"data-testid": "y-tick",
|
|
1906
1985
|
x: C(U).left - 6,
|
|
1907
1986
|
y: e.y,
|
|
1908
1987
|
"text-anchor": "end",
|
|
1909
1988
|
"dominant-baseline": "middle",
|
|
1910
|
-
"font-size":
|
|
1911
|
-
fill:
|
|
1912
|
-
"font-weight":
|
|
1913
|
-
"fill-opacity":
|
|
1914
|
-
}, x(e.value), 9,
|
|
1915
|
-
|
|
1989
|
+
"font-size": X.value.fontSize,
|
|
1990
|
+
fill: X.value.fill,
|
|
1991
|
+
"font-weight": X.value.fontWeight,
|
|
1992
|
+
"fill-opacity": X.value.fillOpacity
|
|
1993
|
+
}, x(e.value), 9, Zt))), 128)),
|
|
1994
|
+
c.yLabel ? (_(), a("text", {
|
|
1916
1995
|
key: 4,
|
|
1917
1996
|
x: 0,
|
|
1918
1997
|
y: 0,
|
|
1919
1998
|
transform: `translate(14, ${C(U).top + C(K) / 2}) rotate(-90)`,
|
|
1920
1999
|
"text-anchor": "middle",
|
|
1921
|
-
"font-size":
|
|
1922
|
-
fill:
|
|
1923
|
-
"font-weight":
|
|
1924
|
-
}, x(
|
|
1925
|
-
(_(!0), a(e, null, y(
|
|
2000
|
+
"font-size": Y.value.fontSize,
|
|
2001
|
+
fill: Y.value.fill,
|
|
2002
|
+
"font-weight": Y.value.fontWeight
|
|
2003
|
+
}, x(c.yLabel), 9, Qt)) : i("", !0),
|
|
2004
|
+
(_(!0), a(e, null, y(ye.value, (e, t) => (_(), a("text", {
|
|
1926
2005
|
key: "x" + t,
|
|
1927
2006
|
"data-testid": "x-tick",
|
|
1928
2007
|
x: e.x,
|
|
1929
2008
|
y: C(U).top + C(K) + 16,
|
|
1930
2009
|
"text-anchor": e.anchor,
|
|
1931
|
-
"font-size":
|
|
1932
|
-
fill:
|
|
1933
|
-
"font-weight":
|
|
1934
|
-
"fill-opacity":
|
|
1935
|
-
}, x(e.value), 9,
|
|
1936
|
-
|
|
2010
|
+
"font-size": X.value.fontSize,
|
|
2011
|
+
fill: X.value.fill,
|
|
2012
|
+
"font-weight": X.value.fontWeight,
|
|
2013
|
+
"fill-opacity": X.value.fillOpacity
|
|
2014
|
+
}, x(e.value), 9, $t))), 128)),
|
|
2015
|
+
c.xLabel ? (_(), a("text", {
|
|
1937
2016
|
key: 5,
|
|
1938
2017
|
x: C(U).left + C(G) / 2,
|
|
1939
2018
|
y: C(Me) - 4,
|
|
1940
2019
|
"text-anchor": "middle",
|
|
1941
|
-
"font-size":
|
|
1942
|
-
fill:
|
|
1943
|
-
"font-weight":
|
|
1944
|
-
}, x(
|
|
2020
|
+
"font-size": Y.value.fontSize,
|
|
2021
|
+
fill: Y.value.fill,
|
|
2022
|
+
"font-weight": Y.value.fontWeight
|
|
2023
|
+
}, x(c.xLabel), 9, en)) : i("", !0),
|
|
1945
2024
|
(_(!0), a(e, null, y(k.value, (e, t) => (_(), a("path", {
|
|
1946
2025
|
key: "area" + t,
|
|
1947
2026
|
d: ce(e),
|
|
1948
2027
|
fill: e.color ?? "currentColor",
|
|
1949
2028
|
"fill-opacity": e.opacity ?? .2,
|
|
1950
2029
|
stroke: "none"
|
|
1951
|
-
}, null, 8,
|
|
1952
|
-
(_(!0), a(e, null, y(O.value, (
|
|
1953
|
-
|
|
2030
|
+
}, null, 8, tn))), 128)),
|
|
2031
|
+
(_(!0), a(e, null, y(O.value, (t, n) => (_(), a(e, { key: n }, [
|
|
2032
|
+
t.line !== !1 && t.outline ? (_(), a("path", {
|
|
1954
2033
|
key: 0,
|
|
1955
|
-
d: oe(
|
|
2034
|
+
d: oe(t),
|
|
1956
2035
|
fill: "none",
|
|
1957
|
-
stroke: "var(--color-bg-0, #fff)",
|
|
1958
|
-
"stroke-width": (
|
|
2036
|
+
stroke: t.outlineColor ?? "var(--color-bg-0, #fff)",
|
|
2037
|
+
"stroke-width": (t.strokeWidth ?? 1.5) + (t.outlineWidth ?? 4),
|
|
1959
2038
|
"stroke-linecap": "round",
|
|
1960
2039
|
"stroke-linejoin": "round",
|
|
1961
2040
|
"data-testid": "line-outline"
|
|
1962
|
-
}, null, 8,
|
|
1963
|
-
|
|
2041
|
+
}, null, 8, nn)) : i("", !0),
|
|
2042
|
+
t.line === !1 ? i("", !0) : (_(), a("path", {
|
|
1964
2043
|
key: 1,
|
|
1965
|
-
d: oe(
|
|
2044
|
+
d: oe(t),
|
|
1966
2045
|
fill: "none",
|
|
1967
|
-
stroke:
|
|
1968
|
-
"stroke-width":
|
|
1969
|
-
"stroke-opacity":
|
|
1970
|
-
"stroke-dasharray":
|
|
1971
|
-
style: m(
|
|
1972
|
-
}, null, 12,
|
|
1973
|
-
|
|
1974
|
-
key:
|
|
2046
|
+
stroke: t.color ?? "currentColor",
|
|
2047
|
+
"stroke-width": t.strokeWidth ?? 1.5,
|
|
2048
|
+
"stroke-opacity": t.lineOpacity ?? t.opacity ?? c.lineOpacity,
|
|
2049
|
+
"stroke-dasharray": t.dashed ? "6 3" : void 0,
|
|
2050
|
+
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2051
|
+
}, null, 12, rn)),
|
|
2052
|
+
t.dots ? (_(!0), a(e, { key: 2 }, y(se(t), (e, n) => (_(), a("circle", {
|
|
2053
|
+
key: n,
|
|
1975
2054
|
cx: e.x,
|
|
1976
2055
|
cy: e.y,
|
|
1977
|
-
r:
|
|
1978
|
-
fill:
|
|
1979
|
-
"fill-opacity":
|
|
1980
|
-
stroke:
|
|
1981
|
-
style: m(
|
|
1982
|
-
}, null, 12,
|
|
2056
|
+
r: t.dotRadius ?? (t.strokeWidth ?? 1.5) + 1,
|
|
2057
|
+
fill: t.dotFill ?? t.color ?? "currentColor",
|
|
2058
|
+
"fill-opacity": t.dotOpacity ?? t.opacity ?? c.lineOpacity,
|
|
2059
|
+
stroke: t.dotStroke ?? "none",
|
|
2060
|
+
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
2061
|
+
}, null, 12, an))), 128)) : i("", !0)
|
|
1983
2062
|
], 64))), 128)),
|
|
1984
|
-
(_(!0), a(e, null, y(
|
|
2063
|
+
(_(!0), a(e, null, y(c.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
1985
2064
|
o("path", {
|
|
1986
2065
|
d: le(t),
|
|
1987
2066
|
fill: t.color ?? (t.seriesIndex == null ? "#999" : O.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
1988
2067
|
"fill-opacity": t.opacity ?? .15,
|
|
1989
2068
|
stroke: "none"
|
|
1990
|
-
}, null, 8,
|
|
2069
|
+
}, null, 8, on),
|
|
1991
2070
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
1992
2071
|
key: 0,
|
|
1993
2072
|
d: le(t, !1),
|
|
@@ -1995,7 +2074,7 @@ var Bt = {
|
|
|
1995
2074
|
stroke: t.color ?? O.value[t.seriesIndex]?.color ?? "currentColor",
|
|
1996
2075
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1997
2076
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1998
|
-
}, null, 8,
|
|
2077
|
+
}, null, 8, sn)),
|
|
1999
2078
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
2000
2079
|
x1: C(R)(F(t, "start")),
|
|
2001
2080
|
y1: C(U).top,
|
|
@@ -2004,7 +2083,7 @@ var Bt = {
|
|
|
2004
2083
|
stroke: t.color ?? "#999",
|
|
2005
2084
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2006
2085
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2007
|
-
}, null, 8,
|
|
2086
|
+
}, null, 8, cn), o("line", {
|
|
2008
2087
|
x1: C(R)(F(t, "end")),
|
|
2009
2088
|
y1: C(U).top,
|
|
2010
2089
|
x2: C(R)(F(t, "end")),
|
|
@@ -2012,7 +2091,7 @@ var Bt = {
|
|
|
2012
2091
|
stroke: t.color ?? "#999",
|
|
2013
2092
|
"stroke-width": t.strokeWidth ?? 2,
|
|
2014
2093
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
2015
|
-
}, null, 8,
|
|
2094
|
+
}, null, 8, ln)], 64)) : i("", !0),
|
|
2016
2095
|
o("line", {
|
|
2017
2096
|
x1: C(R)(F(t, "start")),
|
|
2018
2097
|
y1: C(U).top + C(K) - 4,
|
|
@@ -2020,7 +2099,7 @@ var Bt = {
|
|
|
2020
2099
|
y2: C(U).top + C(K) + 4,
|
|
2021
2100
|
stroke: "currentColor",
|
|
2022
2101
|
"stroke-opacity": "0.4"
|
|
2023
|
-
}, null, 8,
|
|
2102
|
+
}, null, 8, un),
|
|
2024
2103
|
o("line", {
|
|
2025
2104
|
x1: C(R)(F(t, "end")),
|
|
2026
2105
|
y1: C(U).top + C(K) - 4,
|
|
@@ -2028,9 +2107,9 @@ var Bt = {
|
|
|
2028
2107
|
y2: C(U).top + C(K) + 4,
|
|
2029
2108
|
stroke: "currentColor",
|
|
2030
2109
|
"stroke-opacity": "0.4"
|
|
2031
|
-
}, null, 8,
|
|
2110
|
+
}, null, 8, dn)
|
|
2032
2111
|
], 64))), 128)),
|
|
2033
|
-
|
|
2112
|
+
Se.value && C(q) !== null ? (_(), a("line", {
|
|
2034
2113
|
key: 6,
|
|
2035
2114
|
x1: C(R)(we.value),
|
|
2036
2115
|
y1: C(U).top,
|
|
@@ -2040,7 +2119,7 @@ var Bt = {
|
|
|
2040
2119
|
"stroke-opacity": "0.3",
|
|
2041
2120
|
"stroke-dasharray": "4 2",
|
|
2042
2121
|
"pointer-events": "none"
|
|
2043
|
-
}, null, 8,
|
|
2122
|
+
}, null, 8, fn)) : i("", !0),
|
|
2044
2123
|
(_(!0), a(e, null, y(Ee.value, (e, t) => (_(), a("circle", {
|
|
2045
2124
|
key: "hd" + t,
|
|
2046
2125
|
cx: e.x,
|
|
@@ -2050,8 +2129,8 @@ var Bt = {
|
|
|
2050
2129
|
stroke: "var(--color-bg-0, #fff)",
|
|
2051
2130
|
"stroke-width": "2",
|
|
2052
2131
|
"pointer-events": "none"
|
|
2053
|
-
}, null, 8,
|
|
2054
|
-
|
|
2132
|
+
}, null, 8, pn))), 128)),
|
|
2133
|
+
Se.value ? (_(), a("rect", d({
|
|
2055
2134
|
key: 7,
|
|
2056
2135
|
x: C(U).left,
|
|
2057
2136
|
y: C(U).top,
|
|
@@ -2060,152 +2139,152 @@ var Bt = {
|
|
|
2060
2139
|
fill: "transparent",
|
|
2061
2140
|
style: {
|
|
2062
2141
|
cursor: "crosshair",
|
|
2063
|
-
"touch-action": "
|
|
2142
|
+
"touch-action": "pan-y"
|
|
2064
2143
|
}
|
|
2065
|
-
}, ee(C(
|
|
2066
|
-
|
|
2144
|
+
}, ee(C(Le), !0)), null, 16, mn)) : i("", !0),
|
|
2145
|
+
c.annotations && c.annotations.length > 0 ? (_(), r(C(it), {
|
|
2067
2146
|
key: 8,
|
|
2068
|
-
annotations:
|
|
2147
|
+
annotations: c.annotations,
|
|
2069
2148
|
project: Oe,
|
|
2070
2149
|
bounds: C(Pe)
|
|
2071
2150
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
2072
2151
|
(_(!0), a(e, null, y(ue.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
2073
2152
|
o("circle", {
|
|
2074
2153
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
2075
|
-
cy:
|
|
2154
|
+
cy: z.value + e.row * xn + 4,
|
|
2076
2155
|
r: "4",
|
|
2077
2156
|
fill: e.color,
|
|
2078
2157
|
"fill-opacity": e.fillOpacity,
|
|
2079
2158
|
stroke: e.color,
|
|
2080
2159
|
"stroke-width": "1.5"
|
|
2081
|
-
}, null, 8,
|
|
2160
|
+
}, null, 8, hn),
|
|
2082
2161
|
e.labelText ? (_(), a("text", {
|
|
2083
2162
|
key: 0,
|
|
2084
2163
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2085
|
-
y:
|
|
2164
|
+
y: z.value + e.row * xn + 8,
|
|
2086
2165
|
"font-size": e.labelStyle.fontSize,
|
|
2087
2166
|
"font-weight": e.labelStyle.fontWeight,
|
|
2088
2167
|
fill: e.labelStyle.fill
|
|
2089
|
-
}, x(e.labelText), 9,
|
|
2168
|
+
}, x(e.labelText), 9, gn)) : i("", !0),
|
|
2090
2169
|
e.descText ? (_(), a("text", {
|
|
2091
2170
|
key: 1,
|
|
2092
2171
|
x: e.cx - e.textWidth / 2 + 8,
|
|
2093
|
-
y:
|
|
2172
|
+
y: z.value + e.row * xn + 22,
|
|
2094
2173
|
"font-size": e.descStyle.fontSize,
|
|
2095
2174
|
"font-weight": e.descStyle.fontWeight,
|
|
2096
2175
|
fill: e.descStyle.fill,
|
|
2097
2176
|
"fill-opacity": e.descStyle.fillOpacity
|
|
2098
|
-
}, x(e.descText), 9,
|
|
2177
|
+
}, x(e.descText), 9, _n)) : i("", !0)
|
|
2099
2178
|
]))), 128))
|
|
2100
|
-
], 8,
|
|
2101
|
-
|
|
2179
|
+
], 8, Bt)),
|
|
2180
|
+
Se.value && C(q) !== null && De.value ? (_(), a("div", {
|
|
2102
2181
|
key: 1,
|
|
2103
2182
|
ref_key: "tooltipRef",
|
|
2104
|
-
ref:
|
|
2183
|
+
ref: Fe,
|
|
2105
2184
|
class: "chart-tooltip-content",
|
|
2106
2185
|
style: m({
|
|
2107
2186
|
position: "absolute",
|
|
2108
2187
|
top: "0",
|
|
2109
2188
|
left: "0",
|
|
2110
2189
|
willChange: "transform",
|
|
2111
|
-
transform: C(
|
|
2112
|
-
visibility: C(
|
|
2190
|
+
transform: C(Ie) ? `translate3d(${C(Ie).left}px, ${C(Ie).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2191
|
+
visibility: C(Ie) ? "visible" : "hidden"
|
|
2113
2192
|
})
|
|
2114
|
-
}, [b(n.$slots, "tooltip", p(u(De.value)), () => [o("div",
|
|
2193
|
+
}, [b(n.$slots, "tooltip", p(u(De.value)), () => [o("div", vn, [De.value.xLabel ? (_(), a("div", yn, x(De.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(De.value.values, (e) => (_(), a("div", {
|
|
2115
2194
|
key: e.seriesIndex,
|
|
2116
2195
|
class: "line-chart-tooltip-row"
|
|
2117
2196
|
}, [o("span", {
|
|
2118
2197
|
class: "line-chart-tooltip-swatch",
|
|
2119
2198
|
style: m({ background: e.color })
|
|
2120
2199
|
}, null, 4), s(" " + x(isFinite(e.value) ? C(w)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2121
|
-
C(
|
|
2200
|
+
C(ze) ? (_(), a("a", {
|
|
2122
2201
|
key: 2,
|
|
2123
2202
|
class: "line-chart-download-link",
|
|
2124
2203
|
href: C(Ve),
|
|
2125
|
-
download: `${C(
|
|
2126
|
-
}, x(C(
|
|
2127
|
-
C(
|
|
2204
|
+
download: `${C(We)()}.csv`
|
|
2205
|
+
}, x(C(ze)), 9, bn)) : i("", !0),
|
|
2206
|
+
C(He) ? (_(), a("button", {
|
|
2128
2207
|
key: 3,
|
|
2129
2208
|
type: "button",
|
|
2130
2209
|
class: "line-chart-download-button",
|
|
2131
|
-
onClick:
|
|
2132
|
-
}, x(C(
|
|
2133
|
-
],
|
|
2210
|
+
onClick: l[0] ||= (...e) => C(Ue) && C(Ue)(...e)
|
|
2211
|
+
}, x(C(He)), 1)) : i("", !0)
|
|
2212
|
+
], 16)], 8, ["to", "disabled"]));
|
|
2134
2213
|
}
|
|
2135
|
-
}), [["__scopeId", "data-v-
|
|
2214
|
+
}), [["__scopeId", "data-v-70eeecc9"]]), En = {
|
|
2136
2215
|
class: "chart-sr-only",
|
|
2137
2216
|
"aria-live": "polite"
|
|
2138
|
-
},
|
|
2217
|
+
}, Dn = ["width", "height"], On = [
|
|
2139
2218
|
"x",
|
|
2140
2219
|
"y",
|
|
2141
2220
|
"text-anchor",
|
|
2142
2221
|
"font-size",
|
|
2143
2222
|
"font-weight",
|
|
2144
2223
|
"fill"
|
|
2145
|
-
],
|
|
2224
|
+
], kn = ["x", "dy"], An = [
|
|
2146
2225
|
"data-testid",
|
|
2147
2226
|
"x",
|
|
2148
2227
|
"y",
|
|
2149
2228
|
"text-anchor",
|
|
2150
2229
|
"font-size",
|
|
2151
2230
|
"fill"
|
|
2152
|
-
],
|
|
2231
|
+
], jn = { key: 1 }, Mn = [
|
|
2153
2232
|
"x",
|
|
2154
2233
|
"y",
|
|
2155
2234
|
"fill"
|
|
2156
|
-
],
|
|
2235
|
+
], Nn = [
|
|
2157
2236
|
"x1",
|
|
2158
2237
|
"y1",
|
|
2159
2238
|
"x2",
|
|
2160
2239
|
"y2",
|
|
2161
2240
|
"stroke",
|
|
2162
2241
|
"stroke-dasharray"
|
|
2163
|
-
],
|
|
2242
|
+
], Pn = [
|
|
2164
2243
|
"x",
|
|
2165
2244
|
"y",
|
|
2166
2245
|
"font-size",
|
|
2167
2246
|
"fill",
|
|
2168
2247
|
"font-weight"
|
|
2169
|
-
],
|
|
2248
|
+
], Fn = [
|
|
2170
2249
|
"x1",
|
|
2171
2250
|
"y1",
|
|
2172
2251
|
"x2",
|
|
2173
2252
|
"y2"
|
|
2174
|
-
],
|
|
2253
|
+
], In = [
|
|
2175
2254
|
"x1",
|
|
2176
2255
|
"y1",
|
|
2177
2256
|
"x2",
|
|
2178
2257
|
"y2"
|
|
2179
|
-
],
|
|
2258
|
+
], Ln = [
|
|
2180
2259
|
"x1",
|
|
2181
2260
|
"y1",
|
|
2182
2261
|
"x2",
|
|
2183
2262
|
"y2"
|
|
2184
|
-
],
|
|
2263
|
+
], Rn = [
|
|
2185
2264
|
"x",
|
|
2186
2265
|
"y",
|
|
2187
2266
|
"width",
|
|
2188
2267
|
"height"
|
|
2189
|
-
],
|
|
2268
|
+
], zn = [
|
|
2190
2269
|
"x",
|
|
2191
2270
|
"y",
|
|
2192
2271
|
"font-size",
|
|
2193
2272
|
"fill",
|
|
2194
2273
|
"font-weight",
|
|
2195
2274
|
"fill-opacity"
|
|
2196
|
-
],
|
|
2275
|
+
], Bn = [
|
|
2197
2276
|
"x",
|
|
2198
2277
|
"y",
|
|
2199
2278
|
"font-size",
|
|
2200
2279
|
"fill",
|
|
2201
2280
|
"font-weight",
|
|
2202
2281
|
"fill-opacity"
|
|
2203
|
-
],
|
|
2282
|
+
], Vn = [
|
|
2204
2283
|
"transform",
|
|
2205
2284
|
"font-size",
|
|
2206
2285
|
"fill",
|
|
2207
2286
|
"font-weight"
|
|
2208
|
-
],
|
|
2287
|
+
], Hn = [
|
|
2209
2288
|
"x",
|
|
2210
2289
|
"y",
|
|
2211
2290
|
"text-anchor",
|
|
@@ -2213,7 +2292,7 @@ var Bt = {
|
|
|
2213
2292
|
"fill",
|
|
2214
2293
|
"font-weight",
|
|
2215
2294
|
"fill-opacity"
|
|
2216
|
-
],
|
|
2295
|
+
], Un = [
|
|
2217
2296
|
"x",
|
|
2218
2297
|
"y",
|
|
2219
2298
|
"text-anchor",
|
|
@@ -2221,13 +2300,13 @@ var Bt = {
|
|
|
2221
2300
|
"fill",
|
|
2222
2301
|
"font-weight",
|
|
2223
2302
|
"fill-opacity"
|
|
2224
|
-
],
|
|
2303
|
+
], Wn = [
|
|
2225
2304
|
"x",
|
|
2226
2305
|
"y",
|
|
2227
2306
|
"font-size",
|
|
2228
2307
|
"fill",
|
|
2229
2308
|
"font-weight"
|
|
2230
|
-
],
|
|
2309
|
+
], Gn = [
|
|
2231
2310
|
"data-category",
|
|
2232
2311
|
"data-series",
|
|
2233
2312
|
"x",
|
|
@@ -2236,34 +2315,35 @@ var Bt = {
|
|
|
2236
2315
|
"height",
|
|
2237
2316
|
"fill",
|
|
2238
2317
|
"fill-opacity"
|
|
2239
|
-
],
|
|
2318
|
+
], Kn = [
|
|
2240
2319
|
"x",
|
|
2241
2320
|
"y",
|
|
2242
2321
|
"text-anchor",
|
|
2243
2322
|
"font-size",
|
|
2244
2323
|
"font-weight",
|
|
2245
2324
|
"fill"
|
|
2246
|
-
],
|
|
2325
|
+
], qn = [
|
|
2247
2326
|
"d",
|
|
2248
2327
|
"stroke",
|
|
2249
2328
|
"stroke-width",
|
|
2250
2329
|
"stroke-opacity",
|
|
2251
2330
|
"stroke-dasharray"
|
|
2252
|
-
],
|
|
2331
|
+
], Jn = [
|
|
2253
2332
|
"cx",
|
|
2254
2333
|
"cy",
|
|
2255
2334
|
"r",
|
|
2256
2335
|
"fill",
|
|
2257
2336
|
"fill-opacity"
|
|
2258
|
-
],
|
|
2337
|
+
], Yn = [
|
|
2259
2338
|
"x",
|
|
2260
2339
|
"y",
|
|
2261
2340
|
"width",
|
|
2262
2341
|
"height"
|
|
2263
|
-
],
|
|
2342
|
+
], Xn = { class: "bar-chart-tooltip" }, Zn = {
|
|
2264
2343
|
key: 0,
|
|
2265
2344
|
class: "bar-chart-tooltip-label"
|
|
2266
|
-
},
|
|
2345
|
+
}, Qn = ["href", "download"], $n = 22, er = 2, tr = 11, nr = .6, rr = 4, ir = 4, ar = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
2346
|
+
inheritAttrs: !1,
|
|
2267
2347
|
__name: "BarChart",
|
|
2268
2348
|
props: {
|
|
2269
2349
|
data: {},
|
|
@@ -2315,12 +2395,13 @@ var Bt = {
|
|
|
2315
2395
|
filename: {},
|
|
2316
2396
|
downloadLink: { type: [Boolean, String] },
|
|
2317
2397
|
downloadButton: { type: [Boolean, String] },
|
|
2398
|
+
fullscreenTarget: {},
|
|
2318
2399
|
annotations: {},
|
|
2319
2400
|
chartPadding: {}
|
|
2320
2401
|
},
|
|
2321
2402
|
emits: ["hover"],
|
|
2322
|
-
setup(
|
|
2323
|
-
let
|
|
2403
|
+
setup(c, { emit: l }) {
|
|
2404
|
+
let f = c, h = l, g = [];
|
|
2324
2405
|
function v(e) {
|
|
2325
2406
|
return {
|
|
2326
2407
|
data: e.y ?? e.data ?? g,
|
|
@@ -2333,31 +2414,31 @@ var Bt = {
|
|
|
2333
2414
|
};
|
|
2334
2415
|
}
|
|
2335
2416
|
let S = n(() => {
|
|
2336
|
-
if (
|
|
2337
|
-
let e =
|
|
2417
|
+
if (f.series && f.series.length > 0) return f.series.map(v);
|
|
2418
|
+
let e = f.y ?? f.data;
|
|
2338
2419
|
return e ? [{ data: e }] : [];
|
|
2339
2420
|
}), w = n(() => {
|
|
2340
|
-
let e =
|
|
2421
|
+
let e = f.categories?.length ?? 0;
|
|
2341
2422
|
for (let t of S.value) t.data.length > e && (e = t.data.length);
|
|
2342
2423
|
return e;
|
|
2343
2424
|
}), T = n(() => {
|
|
2344
2425
|
let e = w.value, t = Array(e);
|
|
2345
2426
|
for (let n = 0; n < e; n++) {
|
|
2346
|
-
let e =
|
|
2427
|
+
let e = f.categories?.[n];
|
|
2347
2428
|
e instanceof Date ? t[n] = e.toISOString().slice(0, 10) : t[n] = e ?? String(n);
|
|
2348
2429
|
}
|
|
2349
2430
|
return t;
|
|
2350
2431
|
}), E = n(() => {
|
|
2351
|
-
let e =
|
|
2352
|
-
if (!e || e.length === 0 || !
|
|
2432
|
+
let e = f.categories;
|
|
2433
|
+
if (!e || e.length === 0 || !Ot(e, "utc")) return null;
|
|
2353
2434
|
let t = Array(e.length);
|
|
2354
|
-
for (let n = 0; n < e.length; n++) t[n] =
|
|
2435
|
+
for (let n = 0; n < e.length; n++) t[n] = Et(e[n], "utc") ?? NaN;
|
|
2355
2436
|
return t;
|
|
2356
|
-
}), D = n(() =>
|
|
2437
|
+
}), D = n(() => f.orientation === "vertical"), O = n(() => {
|
|
2357
2438
|
let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
|
|
2358
2439
|
e > 0 && e < n && (n = e);
|
|
2359
2440
|
};
|
|
2360
|
-
if (
|
|
2441
|
+
if (f.layout === "stacked") {
|
|
2361
2442
|
let n = w.value;
|
|
2362
2443
|
for (let i = 0; i < n; i++) {
|
|
2363
2444
|
let n = 0, a = 0;
|
|
@@ -2373,9 +2454,9 @@ var Bt = {
|
|
|
2373
2454
|
isFinite(n) && (r(n), n < e && (e = n), n > t && (t = n));
|
|
2374
2455
|
}
|
|
2375
2456
|
isFinite(e) || (e = 0), isFinite(t) || (t = 0);
|
|
2376
|
-
let i =
|
|
2377
|
-
|
|
2378
|
-
let a =
|
|
2457
|
+
let i = f.valueMin ?? 0;
|
|
2458
|
+
f.valueScaleType === "log" ? i > 0 && i < e && (e = i) : i < e && (e = i);
|
|
2459
|
+
let a = _e(e, t, f.valueScaleType, n);
|
|
2379
2460
|
return {
|
|
2380
2461
|
min: a.min,
|
|
2381
2462
|
max: a.max,
|
|
@@ -2384,22 +2465,22 @@ var Bt = {
|
|
|
2384
2465
|
}), k = n(() => D.value ? U.value : W.value), ne = n(() => D.value ? W.value : U.value), A = n(() => {
|
|
2385
2466
|
let e = w.value;
|
|
2386
2467
|
return e > 0 ? k.value / e : 0;
|
|
2387
|
-
}), j = n(() => A.value * (1 -
|
|
2468
|
+
}), j = n(() => A.value * (1 - f.barPadding)), M = n(() => {
|
|
2388
2469
|
let e = S.value.length;
|
|
2389
2470
|
if (e === 0) return 0;
|
|
2390
|
-
if (
|
|
2391
|
-
let t =
|
|
2471
|
+
if (f.layout === "stacked" || e === 1) return j.value;
|
|
2472
|
+
let t = f.groupGap * (e - 1);
|
|
2392
2473
|
return Math.max(1, (j.value - t) / e);
|
|
2393
2474
|
});
|
|
2394
|
-
function
|
|
2475
|
+
function re(e) {
|
|
2395
2476
|
return (D.value ? H.value.left : H.value.top) + e * A.value;
|
|
2396
2477
|
}
|
|
2397
2478
|
let ie = n(() => {
|
|
2398
|
-
let { min: e, max: t } = O.value, n =
|
|
2479
|
+
let { min: e, max: t } = O.value, n = f.valueMin ?? 0;
|
|
2399
2480
|
return N(Math.max(e, Math.min(t, n)));
|
|
2400
2481
|
});
|
|
2401
2482
|
function N(e) {
|
|
2402
|
-
let { min: t, max: n } = O.value, r =
|
|
2483
|
+
let { min: t, max: n } = O.value, r = ge(e, t, n, f.valueScaleType);
|
|
2403
2484
|
return D.value ? H.value.top + W.value - r * W.value : H.value.left + r * U.value;
|
|
2404
2485
|
}
|
|
2405
2486
|
function ae(e, t, n, r, i, a, o, s, c, l) {
|
|
@@ -2431,26 +2512,26 @@ var Bt = {
|
|
|
2431
2512
|
let P = n(() => {
|
|
2432
2513
|
let e = [], t = S.value, n = t.length;
|
|
2433
2514
|
if (n === 0) return e;
|
|
2434
|
-
let r = w.value, i = A.value, a = j.value, o =
|
|
2515
|
+
let r = w.value, i = A.value, a = j.value, o = M.value, s = (i - a) / 2, c = ie.value;
|
|
2435
2516
|
for (let i = 0; i < r; i++) {
|
|
2436
|
-
let r =
|
|
2437
|
-
if (
|
|
2517
|
+
let r = re(i) + s;
|
|
2518
|
+
if (f.layout === "stacked") {
|
|
2438
2519
|
let o = 0, s = 0;
|
|
2439
2520
|
for (let c = 0; c < n; c++) {
|
|
2440
2521
|
let n = t[c], l = Number(n.data[i] ?? NaN);
|
|
2441
2522
|
if (!isFinite(l)) continue;
|
|
2442
2523
|
let u = l >= 0 ? o : s, d = u + l;
|
|
2443
|
-
e.push(ae(N(u), N(d), r, a, n.color ??
|
|
2524
|
+
e.push(ae(N(u), N(d), r, a, n.color ?? I(c), n.opacity ?? 1, n.blendMode, l, i, c)), l >= 0 ? o = d : s = d;
|
|
2444
2525
|
}
|
|
2445
|
-
} else if (
|
|
2526
|
+
} else if (f.layout === "overlay") for (let o = 0; o < n; o++) {
|
|
2446
2527
|
let n = t[o], s = Number(n.data[i] ?? NaN);
|
|
2447
|
-
isFinite(s) && e.push(ae(c, N(s), r, a, n.color ??
|
|
2528
|
+
isFinite(s) && e.push(ae(c, N(s), r, a, n.color ?? I(o), n.opacity ?? 1, n.blendMode, s, i, o));
|
|
2448
2529
|
}
|
|
2449
2530
|
else for (let a = 0; a < n; a++) {
|
|
2450
|
-
let s = t[a],
|
|
2451
|
-
if (!isFinite(
|
|
2452
|
-
let
|
|
2453
|
-
e.push(ae(c, N(
|
|
2531
|
+
let s = t[a], l = Number(s.data[i] ?? NaN);
|
|
2532
|
+
if (!isFinite(l)) continue;
|
|
2533
|
+
let u = r + (n === 1 ? 0 : a * (o + f.groupGap));
|
|
2534
|
+
e.push(ae(c, N(l), u, o, s.color ?? I(a), s.opacity ?? 1, s.blendMode, l, i, a));
|
|
2454
2535
|
}
|
|
2455
2536
|
}
|
|
2456
2537
|
return e;
|
|
@@ -2477,7 +2558,7 @@ var Bt = {
|
|
|
2477
2558
|
};
|
|
2478
2559
|
}
|
|
2479
2560
|
let ce = n(() => {
|
|
2480
|
-
let e =
|
|
2561
|
+
let e = f.summaryLines;
|
|
2481
2562
|
return !e || e.length === 0 ? [] : e.map((e, t) => ({
|
|
2482
2563
|
data: e.data ?? g,
|
|
2483
2564
|
x: e.x,
|
|
@@ -2517,7 +2598,7 @@ var Bt = {
|
|
|
2517
2598
|
function ue(e) {
|
|
2518
2599
|
return le[e % le.length];
|
|
2519
2600
|
}
|
|
2520
|
-
let
|
|
2601
|
+
let de = [
|
|
2521
2602
|
"var(--color-primary, #3b82f6)",
|
|
2522
2603
|
"var(--color-accent, #f59e0b)",
|
|
2523
2604
|
"var(--color-success, #10b981)",
|
|
@@ -2525,36 +2606,36 @@ var Bt = {
|
|
|
2525
2606
|
"var(--color-info, #6366f1)",
|
|
2526
2607
|
"var(--color-warning, #d97706)"
|
|
2527
2608
|
];
|
|
2528
|
-
function
|
|
2529
|
-
return
|
|
2609
|
+
function I(e) {
|
|
2610
|
+
return de[e % de.length];
|
|
2530
2611
|
}
|
|
2531
|
-
let
|
|
2532
|
-
let { min: e, max: t } = O.value, n = (e) =>
|
|
2612
|
+
let L = ct(() => f.tooltipValueFormat, () => f.valueTickFormat), z = n(() => {
|
|
2613
|
+
let { min: e, max: t } = O.value, n = (e) => f.valueTickFormat === void 0 ? me(e) : te(e, f.valueTickFormat);
|
|
2533
2614
|
if (e === t) return [{
|
|
2534
2615
|
value: n(e),
|
|
2535
2616
|
pos: R(N(e))
|
|
2536
2617
|
}];
|
|
2537
2618
|
let r = D.value ? 50 : 80;
|
|
2538
|
-
return (
|
|
2619
|
+
return (f.valueScaleType === "log" ? ve({
|
|
2539
2620
|
min: e,
|
|
2540
2621
|
max: t,
|
|
2541
|
-
ticks:
|
|
2542
|
-
}) :
|
|
2622
|
+
ticks: f.valueTicks
|
|
2623
|
+
}) : he({
|
|
2543
2624
|
min: e,
|
|
2544
2625
|
max: t,
|
|
2545
|
-
ticks:
|
|
2626
|
+
ticks: f.valueTicks,
|
|
2546
2627
|
targetTickCount: ne.value / r
|
|
2547
2628
|
})).map((e) => ({
|
|
2548
2629
|
value: n(e),
|
|
2549
2630
|
pos: R(N(e))
|
|
2550
2631
|
}));
|
|
2551
|
-
}),
|
|
2632
|
+
}), B = n(() => {
|
|
2552
2633
|
let e = w.value, t = E.value;
|
|
2553
2634
|
if (t && t.length > 0) {
|
|
2554
2635
|
let e = Infinity, n = -Infinity;
|
|
2555
2636
|
for (let r of t) Number.isFinite(r) && (r < e && (e = r), r > n && (n = r));
|
|
2556
2637
|
if (!Number.isFinite(e) || e === n) return [];
|
|
2557
|
-
let r = D.value ? U.value : W.value, i = Math.max(2, Math.floor(r / 80)), a =
|
|
2638
|
+
let r = D.value ? U.value : W.value, i = Math.max(2, Math.floor(r / 80)), a = Mt(e, n, i, "utc"), o = a.unit, s = [], c = /* @__PURE__ */ new Set();
|
|
2558
2639
|
for (let e of a.values) {
|
|
2559
2640
|
let n = -1, r = Infinity;
|
|
2560
2641
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -2563,7 +2644,7 @@ var Bt = {
|
|
|
2563
2644
|
}
|
|
2564
2645
|
if (n < 0 || c.has(n)) continue;
|
|
2565
2646
|
c.add(n);
|
|
2566
|
-
let i =
|
|
2647
|
+
let i = re(n) + A.value / 2, a = f.categoryFormat ? f.categoryFormat(T.value[n], n) : Rt(t[n], f.dateFormat, "utc", o);
|
|
2567
2648
|
s.push({
|
|
2568
2649
|
label: a,
|
|
2569
2650
|
pos: i,
|
|
@@ -2572,11 +2653,11 @@ var Bt = {
|
|
|
2572
2653
|
}
|
|
2573
2654
|
return s;
|
|
2574
2655
|
}
|
|
2575
|
-
let n = [], r = (e, t) =>
|
|
2656
|
+
let n = [], r = (e, t) => f.categoryFormat ? f.categoryFormat(e, t) : e, i = Array(e), a = 0;
|
|
2576
2657
|
for (let t = 0; t < e; t++) i[t] = r(T.value[t], t), i[t].length > a && (a = i[t].length);
|
|
2577
|
-
let o =
|
|
2658
|
+
let o = f.tickLabelStyle?.fontSize ?? 10, s = D.value ? a * o * .6 + 8 : o * 1.2 + 8, c = A.value > 0 ? Math.max(1, Math.ceil(s / A.value)) : 1;
|
|
2578
2659
|
for (let t = 0; t < e; t += c) {
|
|
2579
|
-
let e =
|
|
2660
|
+
let e = re(t) + A.value / 2;
|
|
2580
2661
|
n.push({
|
|
2581
2662
|
label: i[t],
|
|
2582
2663
|
pos: e,
|
|
@@ -2584,12 +2665,12 @@ var Bt = {
|
|
|
2584
2665
|
});
|
|
2585
2666
|
}
|
|
2586
2667
|
return n;
|
|
2587
|
-
}),
|
|
2668
|
+
}), pe = n(() => {
|
|
2588
2669
|
let e = [];
|
|
2589
2670
|
return S.value.forEach((t, n) => {
|
|
2590
2671
|
!t.legend || t.showInLegend === !1 || e.push({
|
|
2591
2672
|
label: t.legend,
|
|
2592
|
-
color: t.color ??
|
|
2673
|
+
color: t.color ?? I(n),
|
|
2593
2674
|
kind: "bar"
|
|
2594
2675
|
});
|
|
2595
2676
|
}), ce.value.forEach((t) => {
|
|
@@ -2600,17 +2681,17 @@ var Bt = {
|
|
|
2600
2681
|
dashed: t.dashed
|
|
2601
2682
|
});
|
|
2602
2683
|
}), e;
|
|
2603
|
-
}),
|
|
2604
|
-
function
|
|
2605
|
-
if (typeof
|
|
2606
|
-
if (typeof
|
|
2684
|
+
}), ye = n(() => pe.value.map((e) => e.label));
|
|
2685
|
+
function be() {
|
|
2686
|
+
if (typeof f.csv == "function") return f.csv();
|
|
2687
|
+
if (typeof f.csv == "string") return f.csv;
|
|
2607
2688
|
let e = S.value.map((e) => ({
|
|
2608
2689
|
label: e.legend,
|
|
2609
2690
|
data: e.data
|
|
2610
2691
|
}));
|
|
2611
|
-
return
|
|
2692
|
+
return Ve(T.value, e);
|
|
2612
2693
|
}
|
|
2613
|
-
let
|
|
2694
|
+
let Se = n(() => !!f.tooltipData || !!f.tooltipTrigger);
|
|
2614
2695
|
function Ce(e, t) {
|
|
2615
2696
|
if (!isFinite(e) || !isFinite(t) || A.value === 0) return null;
|
|
2616
2697
|
let n = (D.value ? H.value.left : H.value.top) + (e + .5) * A.value, r = N(t);
|
|
@@ -2630,8 +2711,8 @@ var Bt = {
|
|
|
2630
2711
|
let i = D.value ? e - n.left - H.value.left : t - n.top - H.value.top;
|
|
2631
2712
|
return Math.max(0, Math.min(r - 1, Math.floor(i / A.value)));
|
|
2632
2713
|
}
|
|
2633
|
-
let Te = n(() => !!(
|
|
2634
|
-
let e = Te.value ?
|
|
2714
|
+
let Te = n(() => !!(f.categoryHeader || f.valueHeader)), Ee = n(() => {
|
|
2715
|
+
let e = Te.value ? $n : 0, t = f.chartPadding;
|
|
2635
2716
|
return e ? t == null ? { top: e } : typeof t == "number" ? {
|
|
2636
2717
|
top: t + e,
|
|
2637
2718
|
right: t,
|
|
@@ -2641,33 +2722,35 @@ var Bt = {
|
|
|
2641
2722
|
...t,
|
|
2642
2723
|
top: (t.top ?? 0) + e
|
|
2643
2724
|
} : t;
|
|
2644
|
-
}), { containerRef: De, svgRef: Oe, width: ke, height: Ae, padding: H, legendY: je, inlineLegendLayout: Me, innerW: U, innerH: W, bounds: Ne, hoverIndex: G, tooltipRef: K, tooltipPos: Pe, tooltipHandlers:
|
|
2645
|
-
width: () =>
|
|
2646
|
-
height: () =>
|
|
2647
|
-
title: () =>
|
|
2648
|
-
titleStyle: () =>
|
|
2649
|
-
xLabel: () =>
|
|
2650
|
-
yLabel: () =>
|
|
2651
|
-
debounce: () =>
|
|
2652
|
-
menu: () =>
|
|
2653
|
-
tooltipTrigger: () =>
|
|
2654
|
-
tooltipClamp: () =>
|
|
2655
|
-
filename: () =>
|
|
2656
|
-
downloadLink: () =>
|
|
2657
|
-
downloadButton: () =>
|
|
2725
|
+
}), { containerRef: De, svgRef: Oe, width: ke, height: Ae, padding: H, legendY: je, inlineLegendLayout: Me, innerW: U, innerH: W, bounds: Ne, hoverIndex: G, tooltipRef: K, tooltipPos: Pe, tooltipHandlers: q, menuItems: Fe, downloadLinkText: Ie, csvHref: Le, downloadButtonText: Re, triggerCsvDownload: ze, menuFilename: Be, isFullscreen: He, fullscreenStyle: Ue, teleportTarget: We, exitFullscreen: Ge } = st({
|
|
2726
|
+
width: () => f.width,
|
|
2727
|
+
height: () => f.height,
|
|
2728
|
+
title: () => f.title,
|
|
2729
|
+
titleStyle: () => f.titleStyle,
|
|
2730
|
+
xLabel: () => f.xLabel,
|
|
2731
|
+
yLabel: () => f.yLabel,
|
|
2732
|
+
debounce: () => f.debounce,
|
|
2733
|
+
menu: () => f.menu,
|
|
2734
|
+
tooltipTrigger: () => f.tooltipTrigger,
|
|
2735
|
+
tooltipClamp: () => f.tooltipClamp,
|
|
2736
|
+
filename: () => f.filename,
|
|
2737
|
+
downloadLink: () => f.downloadLink,
|
|
2738
|
+
downloadButton: () => f.downloadButton,
|
|
2739
|
+
fullscreenTarget: () => f.fullscreenTarget,
|
|
2658
2740
|
chartPadding: () => Ee.value,
|
|
2659
|
-
inlineLegendLabels: () =>
|
|
2660
|
-
hasTooltipSlot: () =>
|
|
2661
|
-
getCsv:
|
|
2741
|
+
inlineLegendLabels: () => ye.value,
|
|
2742
|
+
hasTooltipSlot: () => Se.value,
|
|
2743
|
+
getCsv: be,
|
|
2662
2744
|
pointerToIndex: we,
|
|
2745
|
+
scrubAxis: () => D.value ? "x" : "y",
|
|
2663
2746
|
onHover: (e) => h("hover", e)
|
|
2664
|
-
}),
|
|
2747
|
+
}), Ke = n(() => xe(f.axisLabelStyle, { fontSize: 13 })), J = n(() => xe(f.tickLabelStyle, {
|
|
2665
2748
|
fontSize: 10,
|
|
2666
|
-
fillOpacity:
|
|
2667
|
-
})),
|
|
2668
|
-
let e =
|
|
2749
|
+
fillOpacity: V
|
|
2750
|
+
})), qe = n(() => xe(f.legendStyle, { fontSize: 11 })), Y = n(() => f.categoryAlign === "start" && !D.value ? er : H.value.left), X = n(() => {
|
|
2751
|
+
let e = f.titleStyle, t = e?.align ?? "left", n = Ne.value, r = t === "left" ? Y.value : t === "right" ? n.right : n.left + n.width / 2, i = t === "left" ? "start" : t === "right" ? "end" : "middle";
|
|
2669
2752
|
return {
|
|
2670
|
-
lines: (
|
|
2753
|
+
lines: (f.title ?? "").split("\n"),
|
|
2671
2754
|
fontSize: e?.fontSize ?? 14,
|
|
2672
2755
|
lineHeight: e?.lineHeight ?? 18,
|
|
2673
2756
|
fontWeight: e?.fontWeight ?? 600,
|
|
@@ -2675,12 +2758,12 @@ var Bt = {
|
|
|
2675
2758
|
x: r,
|
|
2676
2759
|
anchor: i
|
|
2677
2760
|
};
|
|
2678
|
-
}),
|
|
2761
|
+
}), Je = n(() => {
|
|
2679
2762
|
let e = G.value;
|
|
2680
2763
|
if (e === null) return;
|
|
2681
2764
|
let t = E.value;
|
|
2682
|
-
return t && Number.isFinite(t[e]) ?
|
|
2683
|
-
}),
|
|
2765
|
+
return t && Number.isFinite(t[e]) ? Rt(t[e], f.dateFormat, "utc") : T.value[e];
|
|
2766
|
+
}), Z = n(() => {
|
|
2684
2767
|
let e = G.value;
|
|
2685
2768
|
if (e === null) return null;
|
|
2686
2769
|
let t = S.value, n = [];
|
|
@@ -2688,7 +2771,7 @@ var Bt = {
|
|
|
2688
2771
|
let i = t[r];
|
|
2689
2772
|
i.showInTooltip !== !1 && n.push({
|
|
2690
2773
|
value: Number(i.data[e] ?? NaN),
|
|
2691
|
-
color: i.color ??
|
|
2774
|
+
color: i.color ?? I(r),
|
|
2692
2775
|
seriesIndex: r
|
|
2693
2776
|
});
|
|
2694
2777
|
}
|
|
@@ -2696,12 +2779,12 @@ var Bt = {
|
|
|
2696
2779
|
index: e,
|
|
2697
2780
|
category: T.value[e] ?? String(e),
|
|
2698
2781
|
values: n,
|
|
2699
|
-
data:
|
|
2782
|
+
data: f.tooltipData?.[e] ?? null
|
|
2700
2783
|
};
|
|
2701
|
-
}),
|
|
2784
|
+
}), Q = n(() => {
|
|
2702
2785
|
let e = G.value;
|
|
2703
2786
|
if (e === null) return null;
|
|
2704
|
-
let t =
|
|
2787
|
+
let t = re(e);
|
|
2705
2788
|
return D.value ? {
|
|
2706
2789
|
x: t,
|
|
2707
2790
|
y: H.value.top,
|
|
@@ -2713,9 +2796,9 @@ var Bt = {
|
|
|
2713
2796
|
w: U.value,
|
|
2714
2797
|
h: A.value
|
|
2715
2798
|
};
|
|
2716
|
-
}),
|
|
2717
|
-
let e = Me.value.positions, t =
|
|
2718
|
-
return
|
|
2799
|
+
}), Ye = n(() => {
|
|
2800
|
+
let e = Me.value.positions, t = Y.value, n = je.value;
|
|
2801
|
+
return pe.value.map((r, i) => {
|
|
2719
2802
|
let a = e[i];
|
|
2720
2803
|
return {
|
|
2721
2804
|
...r,
|
|
@@ -2723,8 +2806,8 @@ var Bt = {
|
|
|
2723
2806
|
y: n + a.row * 20
|
|
2724
2807
|
};
|
|
2725
2808
|
});
|
|
2726
|
-
}),
|
|
2727
|
-
let e =
|
|
2809
|
+
}), Xe = n(() => {
|
|
2810
|
+
let e = f.barLabels;
|
|
2728
2811
|
if (!e) return null;
|
|
2729
2812
|
let t = e === !0 ? {} : e;
|
|
2730
2813
|
return {
|
|
@@ -2734,37 +2817,37 @@ var Bt = {
|
|
|
2734
2817
|
align: t.align ?? "center",
|
|
2735
2818
|
overlap: t.overlap ?? "shift",
|
|
2736
2819
|
minSize: t.minSize ?? 0,
|
|
2737
|
-
fontSize: t.fontSize ??
|
|
2820
|
+
fontSize: t.fontSize ?? tr,
|
|
2738
2821
|
fontWeight: t.fontWeight
|
|
2739
2822
|
};
|
|
2740
2823
|
});
|
|
2741
|
-
function
|
|
2742
|
-
let n =
|
|
2743
|
-
return typeof n == "function" ? n(e, t) : n === void 0 ?
|
|
2824
|
+
function Ze(e, t) {
|
|
2825
|
+
let n = Xe.value?.format;
|
|
2826
|
+
return typeof n == "function" ? n(e, t) : n === void 0 ? f.valueTickFormat === void 0 ? me(e) : te(e, f.valueTickFormat) : te(e, n);
|
|
2744
2827
|
}
|
|
2745
|
-
function
|
|
2828
|
+
function Qe(e, t, n) {
|
|
2746
2829
|
for (let r = P.value.length - 1; r >= 0; r--) {
|
|
2747
2830
|
let i = P.value[r];
|
|
2748
2831
|
if (i.categoryIndex === e && t >= i.x && t <= i.x + i.w && n >= i.y && n <= i.y + i.h) return i.color;
|
|
2749
2832
|
}
|
|
2750
2833
|
return null;
|
|
2751
2834
|
}
|
|
2752
|
-
let
|
|
2753
|
-
let e =
|
|
2835
|
+
let $e = n(() => {
|
|
2836
|
+
let e = Xe.value;
|
|
2754
2837
|
if (!e) return [];
|
|
2755
2838
|
let t = D.value, n = e.fontSize, r = [];
|
|
2756
2839
|
for (let i of P.value) {
|
|
2757
|
-
let a =
|
|
2840
|
+
let a = Ze(i.value, {
|
|
2758
2841
|
value: i.value,
|
|
2759
2842
|
categoryIndex: i.categoryIndex,
|
|
2760
2843
|
seriesIndex: i.seriesIndex,
|
|
2761
2844
|
category: T.value[i.categoryIndex] ?? String(i.categoryIndex)
|
|
2762
2845
|
});
|
|
2763
2846
|
if (!a) continue;
|
|
2764
|
-
let o = t ? i.h : i.w, s = a.length * n *
|
|
2765
|
-
if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m +
|
|
2766
|
-
else if (e.align === "start") u = h +
|
|
2767
|
-
else if (e.align === "end") d = m -
|
|
2847
|
+
let o = t ? i.h : i.w, s = a.length * n * nr, c = o >= s + 2 * rr && o >= e.minSize, l = e.placement === "inside" ? !0 : e.placement === "outside" ? !1 : c, u, d, f, p = "middle", m = t ? -i.y : i.x + i.w, h = t ? -(i.y + i.h) : i.x, g = t ? n : s;
|
|
2848
|
+
if (f = t ? i.x + i.w / 2 : i.y + i.h / 2, !l) u = m + rr, d = u + g, p = "start";
|
|
2849
|
+
else if (e.align === "start") u = h + rr, d = u + g, p = "start";
|
|
2850
|
+
else if (e.align === "end") d = m - rr, u = d - g, p = "end";
|
|
2768
2851
|
else {
|
|
2769
2852
|
let e = (m + h) / 2;
|
|
2770
2853
|
u = e - g / 2, d = e + g / 2, p = "middle";
|
|
@@ -2790,12 +2873,12 @@ var Bt = {
|
|
|
2790
2873
|
t.sort((e, t) => e.lo - t.lo);
|
|
2791
2874
|
let n = -Infinity;
|
|
2792
2875
|
for (let r of t) {
|
|
2793
|
-
if (r.lo < n +
|
|
2876
|
+
if (r.lo < n + ir) {
|
|
2794
2877
|
if (e.overlap === "hide") {
|
|
2795
2878
|
r.hidden = !0;
|
|
2796
2879
|
continue;
|
|
2797
2880
|
}
|
|
2798
|
-
let t = n +
|
|
2881
|
+
let t = n + ir - r.lo;
|
|
2799
2882
|
r.lo += t, r.hi += t, r.inside = !1, r.svgAnchor = "start";
|
|
2800
2883
|
}
|
|
2801
2884
|
if (r.hi > i) {
|
|
@@ -2812,10 +2895,10 @@ var Bt = {
|
|
|
2812
2895
|
t ? (r = i.cross, a = -((i.lo + i.hi) / 2), c = "middle") : (c = i.svgAnchor, r = c === "start" ? i.lo : c === "end" ? i.hi : (i.lo + i.hi) / 2, a = i.cross);
|
|
2813
2896
|
let l;
|
|
2814
2897
|
if (!o) l = e.color;
|
|
2815
|
-
else if (i.inside) l =
|
|
2898
|
+
else if (i.inside) l = mt(i.bar.color);
|
|
2816
2899
|
else {
|
|
2817
|
-
let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r =
|
|
2818
|
-
l = r ?
|
|
2900
|
+
let e = t ? i.cross : (i.lo + i.hi) / 2, n = t ? -((i.lo + i.hi) / 2) : i.cross, r = Qe(i.bar.categoryIndex, e, n);
|
|
2901
|
+
l = r ? mt(r) : "currentColor";
|
|
2819
2902
|
}
|
|
2820
2903
|
s.push({
|
|
2821
2904
|
key: `${i.bar.categoryIndex}-${i.bar.seriesIndex}`,
|
|
@@ -2829,35 +2912,35 @@ var Bt = {
|
|
|
2829
2912
|
});
|
|
2830
2913
|
}
|
|
2831
2914
|
return s;
|
|
2832
|
-
}),
|
|
2915
|
+
}), et = n(() => {
|
|
2833
2916
|
let e = H.value.left - 6;
|
|
2834
|
-
switch (
|
|
2917
|
+
switch (f.categoryAlign ?? "end") {
|
|
2835
2918
|
case "start": return {
|
|
2836
2919
|
anchor: "start",
|
|
2837
|
-
x:
|
|
2920
|
+
x: er
|
|
2838
2921
|
};
|
|
2839
2922
|
case "center": return {
|
|
2840
2923
|
anchor: "middle",
|
|
2841
|
-
x: (
|
|
2924
|
+
x: (er + e) / 2
|
|
2842
2925
|
};
|
|
2843
2926
|
default: return {
|
|
2844
2927
|
anchor: "end",
|
|
2845
2928
|
x: e
|
|
2846
2929
|
};
|
|
2847
2930
|
}
|
|
2848
|
-
}),
|
|
2931
|
+
}), tt = n(() => {
|
|
2849
2932
|
let e = [], t = H.value.top - 7;
|
|
2850
|
-
if (
|
|
2933
|
+
if (f.valueHeader && e.push({
|
|
2851
2934
|
key: "vh",
|
|
2852
|
-
text:
|
|
2935
|
+
text: f.valueHeader,
|
|
2853
2936
|
x: H.value.left,
|
|
2854
2937
|
y: t,
|
|
2855
2938
|
anchor: "start"
|
|
2856
|
-
}),
|
|
2857
|
-
let n = !D.value, r =
|
|
2939
|
+
}), f.categoryHeader) {
|
|
2940
|
+
let n = !D.value, r = et.value;
|
|
2858
2941
|
e.push({
|
|
2859
2942
|
key: "ch",
|
|
2860
|
-
text:
|
|
2943
|
+
text: f.categoryHeader,
|
|
2861
2944
|
x: n ? r.x : H.value.left,
|
|
2862
2945
|
y: t,
|
|
2863
2946
|
anchor: n ? r.anchor : "start"
|
|
@@ -2865,53 +2948,64 @@ var Bt = {
|
|
|
2865
2948
|
}
|
|
2866
2949
|
return e;
|
|
2867
2950
|
});
|
|
2868
|
-
return (n,
|
|
2951
|
+
return (n, l) => (_(), r(t, {
|
|
2952
|
+
to: C(We),
|
|
2953
|
+
disabled: !C(He)
|
|
2954
|
+
}, [o("div", d({
|
|
2869
2955
|
ref_key: "containerRef",
|
|
2870
|
-
ref: De
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2956
|
+
ref: De
|
|
2957
|
+
}, n.$attrs, {
|
|
2958
|
+
class: ["bar-chart-wrapper", { "is-fullscreen": C(He) }],
|
|
2959
|
+
style: C(Ue)
|
|
2960
|
+
}), [
|
|
2961
|
+
c.menu ? (_(), r(fe, {
|
|
2874
2962
|
key: 0,
|
|
2875
|
-
items: C(
|
|
2876
|
-
|
|
2877
|
-
|
|
2963
|
+
items: C(Fe),
|
|
2964
|
+
"is-fullscreen": C(He),
|
|
2965
|
+
onClose: C(Ge)
|
|
2966
|
+
}, null, 8, [
|
|
2967
|
+
"items",
|
|
2968
|
+
"is-fullscreen",
|
|
2969
|
+
"onClose"
|
|
2970
|
+
])) : i("", !0),
|
|
2971
|
+
o("div", En, x(C(He) ? "Chart expanded to fill window" : ""), 1),
|
|
2878
2972
|
(_(), a("svg", {
|
|
2879
2973
|
ref_key: "svgRef",
|
|
2880
2974
|
ref: Oe,
|
|
2881
2975
|
width: C(ke),
|
|
2882
2976
|
height: C(Ae)
|
|
2883
2977
|
}, [
|
|
2884
|
-
|
|
2978
|
+
c.title ? (_(), a("text", {
|
|
2885
2979
|
key: 0,
|
|
2886
|
-
x:
|
|
2887
|
-
y:
|
|
2888
|
-
"text-anchor":
|
|
2889
|
-
"font-size":
|
|
2890
|
-
"font-weight":
|
|
2891
|
-
fill:
|
|
2892
|
-
}, [(_(!0), a(e, null, y(
|
|
2980
|
+
x: X.value.x,
|
|
2981
|
+
y: X.value.lineHeight,
|
|
2982
|
+
"text-anchor": X.value.anchor,
|
|
2983
|
+
"font-size": X.value.fontSize,
|
|
2984
|
+
"font-weight": X.value.fontWeight,
|
|
2985
|
+
fill: X.value.color
|
|
2986
|
+
}, [(_(!0), a(e, null, y(X.value.lines, (e, t) => (_(), a("tspan", {
|
|
2893
2987
|
key: t,
|
|
2894
|
-
x:
|
|
2895
|
-
dy: t === 0 ? 0 :
|
|
2896
|
-
}, x(e), 9,
|
|
2897
|
-
(_(!0), a(e, null, y(
|
|
2988
|
+
x: X.value.x,
|
|
2989
|
+
dy: t === 0 ? 0 : X.value.lineHeight
|
|
2990
|
+
}, x(e), 9, kn))), 128))], 8, On)) : i("", !0),
|
|
2991
|
+
(_(!0), a(e, null, y(tt.value, (e) => (_(), a("text", {
|
|
2898
2992
|
key: e.key,
|
|
2899
2993
|
"data-testid": e.key === "ch" ? "category-header" : "value-header",
|
|
2900
2994
|
x: e.x,
|
|
2901
2995
|
y: e.y,
|
|
2902
2996
|
"text-anchor": e.anchor,
|
|
2903
|
-
"font-size":
|
|
2904
|
-
fill:
|
|
2997
|
+
"font-size": Ke.value.fontSize,
|
|
2998
|
+
fill: Ke.value.fill,
|
|
2905
2999
|
"font-weight": "600"
|
|
2906
|
-
}, x(e.text), 9,
|
|
2907
|
-
|
|
3000
|
+
}, x(e.text), 9, An))), 128)),
|
|
3001
|
+
Ye.value.length > 0 ? (_(), a("g", jn, [(_(!0), a(e, null, y(Ye.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.kind === "bar" ? (_(), a("rect", {
|
|
2908
3002
|
key: 0,
|
|
2909
3003
|
x: t.x,
|
|
2910
3004
|
y: t.y - 5,
|
|
2911
3005
|
width: "12",
|
|
2912
3006
|
height: "10",
|
|
2913
3007
|
fill: t.color
|
|
2914
|
-
}, null, 8,
|
|
3008
|
+
}, null, 8, Mn)) : (_(), a("line", {
|
|
2915
3009
|
key: 1,
|
|
2916
3010
|
x1: t.x,
|
|
2917
3011
|
y1: t.y,
|
|
@@ -2920,14 +3014,14 @@ var Bt = {
|
|
|
2920
3014
|
stroke: t.color,
|
|
2921
3015
|
"stroke-width": "2",
|
|
2922
3016
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
2923
|
-
}, null, 8,
|
|
3017
|
+
}, null, 8, Nn)), o("text", {
|
|
2924
3018
|
x: t.x + 18,
|
|
2925
3019
|
y: t.y + 4,
|
|
2926
|
-
"font-size":
|
|
2927
|
-
fill:
|
|
2928
|
-
"font-weight":
|
|
2929
|
-
}, x(t.label), 9,
|
|
2930
|
-
!D.value ||
|
|
3020
|
+
"font-size": qe.value.fontSize,
|
|
3021
|
+
fill: qe.value.fill,
|
|
3022
|
+
"font-weight": qe.value.fontWeight
|
|
3023
|
+
}, x(t.label), 9, Pn)], 64))), 128))])) : i("", !0),
|
|
3024
|
+
!D.value || c.valueAxis ? (_(), a("line", {
|
|
2931
3025
|
key: 2,
|
|
2932
3026
|
x1: C(R)(C(H).left),
|
|
2933
3027
|
y1: C(R)(C(H).top),
|
|
@@ -2935,8 +3029,8 @@ var Bt = {
|
|
|
2935
3029
|
y2: C(R)(C(H).top + C(W)),
|
|
2936
3030
|
stroke: "currentColor",
|
|
2937
3031
|
"stroke-opacity": "0.3"
|
|
2938
|
-
}, null, 8,
|
|
2939
|
-
D.value ||
|
|
3032
|
+
}, null, 8, Fn)) : i("", !0),
|
|
3033
|
+
D.value || c.valueAxis ? (_(), a("line", {
|
|
2940
3034
|
key: 3,
|
|
2941
3035
|
x1: C(R)(C(H).left),
|
|
2942
3036
|
y1: C(R)(C(H).top + C(W)),
|
|
@@ -2944,8 +3038,8 @@ var Bt = {
|
|
|
2944
3038
|
y2: C(R)(C(H).top + C(W)),
|
|
2945
3039
|
stroke: "currentColor",
|
|
2946
3040
|
"stroke-opacity": "0.3"
|
|
2947
|
-
}, null, 8,
|
|
2948
|
-
|
|
3041
|
+
}, null, 8, In)) : i("", !0),
|
|
3042
|
+
c.valueGrid && c.valueAxis ? (_(!0), a(e, { key: 4 }, y(z.value, (e, t) => (_(), a("line", {
|
|
2949
3043
|
key: "vg" + t,
|
|
2950
3044
|
x1: D.value ? C(H).left : e.pos,
|
|
2951
3045
|
y1: D.value ? e.pos : C(H).top,
|
|
@@ -2953,18 +3047,18 @@ var Bt = {
|
|
|
2953
3047
|
y2: D.value ? e.pos : C(H).top + C(W),
|
|
2954
3048
|
stroke: "currentColor",
|
|
2955
3049
|
"stroke-opacity": "0.1"
|
|
2956
|
-
}, null, 8,
|
|
2957
|
-
|
|
3050
|
+
}, null, 8, Ln))), 128)) : i("", !0),
|
|
3051
|
+
Q.value && Se.value ? (_(), a("rect", {
|
|
2958
3052
|
key: 5,
|
|
2959
|
-
x:
|
|
2960
|
-
y:
|
|
2961
|
-
width:
|
|
2962
|
-
height:
|
|
3053
|
+
x: Q.value.x,
|
|
3054
|
+
y: Q.value.y,
|
|
3055
|
+
width: Q.value.w,
|
|
3056
|
+
height: Q.value.h,
|
|
2963
3057
|
fill: "currentColor",
|
|
2964
3058
|
"fill-opacity": "0.06",
|
|
2965
3059
|
"pointer-events": "none"
|
|
2966
|
-
}, null, 8,
|
|
2967
|
-
|
|
3060
|
+
}, null, 8, Rn)) : i("", !0),
|
|
3061
|
+
c.valueAxis && D.value ? (_(!0), a(e, { key: 6 }, y(z.value, (e, t) => (_(), a("text", {
|
|
2968
3062
|
key: "vt" + t,
|
|
2969
3063
|
"data-testid": "value-tick",
|
|
2970
3064
|
x: C(H).left - 6,
|
|
@@ -2975,7 +3069,7 @@ var Bt = {
|
|
|
2975
3069
|
fill: J.value.fill,
|
|
2976
3070
|
"font-weight": J.value.fontWeight,
|
|
2977
3071
|
"fill-opacity": J.value.fillOpacity
|
|
2978
|
-
}, x(e.value), 9,
|
|
3072
|
+
}, x(e.value), 9, zn))), 128)) : c.valueAxis ? (_(!0), a(e, { key: 7 }, y(z.value, (e, t) => (_(), a("text", {
|
|
2979
3073
|
key: "vt" + t,
|
|
2980
3074
|
"data-testid": "value-tick",
|
|
2981
3075
|
x: e.pos,
|
|
@@ -2985,18 +3079,18 @@ var Bt = {
|
|
|
2985
3079
|
fill: J.value.fill,
|
|
2986
3080
|
"font-weight": J.value.fontWeight,
|
|
2987
3081
|
"fill-opacity": J.value.fillOpacity
|
|
2988
|
-
}, x(e.value), 9,
|
|
2989
|
-
|
|
3082
|
+
}, x(e.value), 9, Bn))), 128)) : i("", !0),
|
|
3083
|
+
c.yLabel ? (_(), a("text", {
|
|
2990
3084
|
key: 8,
|
|
2991
3085
|
x: 0,
|
|
2992
3086
|
y: 0,
|
|
2993
3087
|
transform: `translate(14, ${C(H).top + C(W) / 2}) rotate(-90)`,
|
|
2994
3088
|
"text-anchor": "middle",
|
|
2995
|
-
"font-size":
|
|
2996
|
-
fill:
|
|
2997
|
-
"font-weight":
|
|
2998
|
-
}, x(
|
|
2999
|
-
D.value ? (_(!0), a(e, { key: 9 }, y(
|
|
3089
|
+
"font-size": Ke.value.fontSize,
|
|
3090
|
+
fill: Ke.value.fill,
|
|
3091
|
+
"font-weight": Ke.value.fontWeight
|
|
3092
|
+
}, x(c.yLabel), 9, Vn)) : i("", !0),
|
|
3093
|
+
D.value ? (_(!0), a(e, { key: 9 }, y(B.value, (e, t) => (_(), a("text", {
|
|
3000
3094
|
key: "ct" + t,
|
|
3001
3095
|
"data-testid": "category-tick",
|
|
3002
3096
|
x: e.pos,
|
|
@@ -3006,27 +3100,27 @@ var Bt = {
|
|
|
3006
3100
|
fill: J.value.fill,
|
|
3007
3101
|
"font-weight": J.value.fontWeight,
|
|
3008
3102
|
"fill-opacity": J.value.fillOpacity
|
|
3009
|
-
}, x(e.label), 9,
|
|
3103
|
+
}, x(e.label), 9, Hn))), 128)) : (_(!0), a(e, { key: 10 }, y(B.value, (e, t) => (_(), a("text", {
|
|
3010
3104
|
key: "ct" + t,
|
|
3011
3105
|
"data-testid": "category-tick",
|
|
3012
|
-
x:
|
|
3106
|
+
x: et.value.x,
|
|
3013
3107
|
y: e.pos,
|
|
3014
|
-
"text-anchor":
|
|
3108
|
+
"text-anchor": et.value.anchor,
|
|
3015
3109
|
"dominant-baseline": "middle",
|
|
3016
3110
|
"font-size": J.value.fontSize,
|
|
3017
3111
|
fill: J.value.fill,
|
|
3018
3112
|
"font-weight": J.value.fontWeight,
|
|
3019
3113
|
"fill-opacity": J.value.fillOpacity
|
|
3020
|
-
}, x(e.label), 9,
|
|
3021
|
-
|
|
3114
|
+
}, x(e.label), 9, Un))), 128)),
|
|
3115
|
+
c.xLabel ? (_(), a("text", {
|
|
3022
3116
|
key: 11,
|
|
3023
3117
|
x: C(H).left + C(U) / 2,
|
|
3024
3118
|
y: C(Ae) - 4,
|
|
3025
3119
|
"text-anchor": "middle",
|
|
3026
|
-
"font-size":
|
|
3027
|
-
fill:
|
|
3028
|
-
"font-weight":
|
|
3029
|
-
}, x(
|
|
3120
|
+
"font-size": Ke.value.fontSize,
|
|
3121
|
+
fill: Ke.value.fill,
|
|
3122
|
+
"font-weight": Ke.value.fontWeight
|
|
3123
|
+
}, x(c.xLabel), 9, Wn)) : i("", !0),
|
|
3030
3124
|
(_(!0), a(e, null, y(P.value, (e, t) => (_(), a("rect", {
|
|
3031
3125
|
key: "bar" + t,
|
|
3032
3126
|
"data-testid": "bar",
|
|
@@ -3039,8 +3133,8 @@ var Bt = {
|
|
|
3039
3133
|
fill: e.color,
|
|
3040
3134
|
"fill-opacity": e.opacity,
|
|
3041
3135
|
style: m(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
3042
|
-
}, null, 12,
|
|
3043
|
-
(_(!0), a(e, null, y(
|
|
3136
|
+
}, null, 12, Gn))), 128)),
|
|
3137
|
+
(_(!0), a(e, null, y($e.value, (e) => (_(), a("text", {
|
|
3044
3138
|
key: "blbl" + e.key,
|
|
3045
3139
|
"data-testid": "bar-label",
|
|
3046
3140
|
x: e.x,
|
|
@@ -3051,7 +3145,7 @@ var Bt = {
|
|
|
3051
3145
|
"font-weight": e.fontWeight,
|
|
3052
3146
|
fill: e.fill,
|
|
3053
3147
|
"pointer-events": "none"
|
|
3054
|
-
}, x(e.text), 9,
|
|
3148
|
+
}, x(e.text), 9, Kn))), 128)),
|
|
3055
3149
|
(_(!0), a(e, null, y(F.value, (t, n) => (_(), a(e, { key: "sl" + n }, [t.pathD ? (_(), a("path", {
|
|
3056
3150
|
key: 0,
|
|
3057
3151
|
"data-testid": "summary-line",
|
|
@@ -3064,7 +3158,7 @@ var Bt = {
|
|
|
3064
3158
|
"stroke-linecap": "round",
|
|
3065
3159
|
"stroke-linejoin": "round",
|
|
3066
3160
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3067
|
-
}, null, 12,
|
|
3161
|
+
}, null, 12, qn)) : i("", !0), t.dots ? (_(!0), a(e, { key: 1 }, y(t.points, (e, r) => (_(), a("circle", {
|
|
3068
3162
|
key: "sld" + n + "-" + r,
|
|
3069
3163
|
cx: e.x,
|
|
3070
3164
|
cy: e.y,
|
|
@@ -3072,27 +3166,24 @@ var Bt = {
|
|
|
3072
3166
|
fill: t.color,
|
|
3073
3167
|
"fill-opacity": t.opacity,
|
|
3074
3168
|
style: m(t.blendMode ? { mixBlendMode: t.blendMode } : void 0)
|
|
3075
|
-
}, null, 12,
|
|
3076
|
-
|
|
3169
|
+
}, null, 12, Jn))), 128)) : i("", !0)], 64))), 128)),
|
|
3170
|
+
Se.value ? (_(), a("rect", d({
|
|
3077
3171
|
key: 12,
|
|
3078
3172
|
x: C(H).left,
|
|
3079
3173
|
y: C(H).top,
|
|
3080
3174
|
width: C(U),
|
|
3081
3175
|
height: C(W),
|
|
3082
3176
|
fill: "transparent",
|
|
3083
|
-
style: {
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
}
|
|
3087
|
-
}, ee(C(Fe), !0)), null, 16, Xn)) : i("", !0),
|
|
3088
|
-
t.annotations && t.annotations.length > 0 ? (_(), r(C(st), {
|
|
3177
|
+
style: `cursor: crosshair; touch-action: ${D.value ? "pan-y" : "pan-x"}`
|
|
3178
|
+
}, ee(C(q), !0)), null, 16, Yn)) : i("", !0),
|
|
3179
|
+
c.annotations && c.annotations.length > 0 ? (_(), r(C(it), {
|
|
3089
3180
|
key: 13,
|
|
3090
|
-
annotations:
|
|
3181
|
+
annotations: c.annotations,
|
|
3091
3182
|
project: Ce,
|
|
3092
3183
|
bounds: C(Ne)
|
|
3093
3184
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
3094
|
-
], 8,
|
|
3095
|
-
|
|
3185
|
+
], 8, Dn)),
|
|
3186
|
+
Se.value && C(G) !== null && Z.value ? (_(), a("div", {
|
|
3096
3187
|
key: 1,
|
|
3097
3188
|
ref_key: "tooltipRef",
|
|
3098
3189
|
ref: K,
|
|
@@ -3105,28 +3196,28 @@ var Bt = {
|
|
|
3105
3196
|
transform: C(Pe) ? `translate3d(${C(Pe).left}px, ${C(Pe).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
3106
3197
|
visibility: C(Pe) ? "visible" : "hidden"
|
|
3107
3198
|
})
|
|
3108
|
-
}, [b(n.$slots, "tooltip", p(u(
|
|
3199
|
+
}, [b(n.$slots, "tooltip", p(u(Z.value)), () => [o("div", Xn, [Je.value ? (_(), a("div", Zn, x(Je.value), 1)) : i("", !0), (_(!0), a(e, null, y(Z.value.values, (e) => (_(), a("div", {
|
|
3109
3200
|
key: e.seriesIndex,
|
|
3110
3201
|
class: "bar-chart-tooltip-row"
|
|
3111
3202
|
}, [o("span", {
|
|
3112
3203
|
class: "bar-chart-tooltip-swatch",
|
|
3113
3204
|
style: m({ background: e.color })
|
|
3114
|
-
}, null, 4), s(" " + x(isFinite(e.value) ? C(
|
|
3115
|
-
C(
|
|
3205
|
+
}, null, 4), s(" " + x(isFinite(e.value) ? C(L)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
3206
|
+
C(Ie) ? (_(), a("a", {
|
|
3116
3207
|
key: 2,
|
|
3117
3208
|
class: "bar-chart-download-link",
|
|
3118
|
-
href: C(
|
|
3119
|
-
download: `${C(
|
|
3120
|
-
}, x(C(
|
|
3121
|
-
C(
|
|
3209
|
+
href: C(Le),
|
|
3210
|
+
download: `${C(Be)()}.csv`
|
|
3211
|
+
}, x(C(Ie)), 9, Qn)) : i("", !0),
|
|
3212
|
+
C(Re) ? (_(), a("button", {
|
|
3122
3213
|
key: 3,
|
|
3123
3214
|
type: "button",
|
|
3124
3215
|
class: "bar-chart-download-button",
|
|
3125
|
-
onClick:
|
|
3126
|
-
}, x(C(
|
|
3127
|
-
],
|
|
3216
|
+
onClick: l[0] ||= (...e) => C(ze) && C(ze)(...e)
|
|
3217
|
+
}, x(C(Re)), 1)) : i("", !0)
|
|
3218
|
+
], 16)], 8, ["to", "disabled"]));
|
|
3128
3219
|
}
|
|
3129
|
-
}), [["__scopeId", "data-v-
|
|
3220
|
+
}), [["__scopeId", "data-v-67594e38"]]), or = {
|
|
3130
3221
|
ref: "root",
|
|
3131
3222
|
class: "chart-tooltip-content",
|
|
3132
3223
|
style: {
|
|
@@ -3138,7 +3229,7 @@ var Bt = {
|
|
|
3138
3229
|
"pointer-events": "none",
|
|
3139
3230
|
transform: "translateY(-50%)"
|
|
3140
3231
|
}
|
|
3141
|
-
},
|
|
3232
|
+
}, sr = /* @__PURE__ */ l({
|
|
3142
3233
|
__name: "ChoroplethTooltip",
|
|
3143
3234
|
setup(e, { expose: n }) {
|
|
3144
3235
|
let a = v(null), s = T("root");
|
|
@@ -3149,21 +3240,22 @@ var Bt = {
|
|
|
3149
3240
|
getEl() {
|
|
3150
3241
|
return s.value;
|
|
3151
3242
|
}
|
|
3152
|
-
}), (e, n) => (_(), r(t, { to: "body" }, [o("div",
|
|
3243
|
+
}), (e, n) => (_(), r(t, { to: "body" }, [o("div", or, [a.value ? b(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
|
|
3153
3244
|
}
|
|
3154
|
-
}),
|
|
3245
|
+
}), cr = {
|
|
3155
3246
|
class: "chart-sr-only",
|
|
3156
3247
|
"aria-live": "polite"
|
|
3157
|
-
},
|
|
3248
|
+
}, lr = {
|
|
3158
3249
|
key: 1,
|
|
3159
3250
|
class: "choropleth-header"
|
|
3160
|
-
},
|
|
3251
|
+
}, ur = {
|
|
3161
3252
|
key: 0,
|
|
3162
3253
|
class: "choropleth-legend-title"
|
|
3163
|
-
},
|
|
3254
|
+
}, dr = {
|
|
3164
3255
|
key: 2,
|
|
3165
3256
|
class: "choropleth-legend-continuous"
|
|
3166
|
-
},
|
|
3257
|
+
}, fr = { class: "choropleth-legend-ticks" }, pr = ["viewBox"], mr = ["innerHTML"], hr = "http://www.w3.org/2000/svg", gr = 10, _r = 600, vr = 450, yr = 1e3, br = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3258
|
+
inheritAttrs: !1,
|
|
3167
3259
|
__name: "ChoroplethMap",
|
|
3168
3260
|
props: {
|
|
3169
3261
|
topology: {},
|
|
@@ -3201,19 +3293,20 @@ var Bt = {
|
|
|
3201
3293
|
tooltipValueFormat: {},
|
|
3202
3294
|
tooltipClamp: { default: "chart" },
|
|
3203
3295
|
focus: {},
|
|
3204
|
-
focusZoomLevel: { default: 4 }
|
|
3296
|
+
focusZoomLevel: { default: 4 },
|
|
3297
|
+
fullscreenTarget: {}
|
|
3205
3298
|
},
|
|
3206
3299
|
emits: [
|
|
3207
3300
|
"stateClick",
|
|
3208
3301
|
"stateHover",
|
|
3209
3302
|
"update:focus"
|
|
3210
3303
|
],
|
|
3211
|
-
setup(
|
|
3212
|
-
let
|
|
3213
|
-
let e =
|
|
3304
|
+
setup(c, { emit: l }) {
|
|
3305
|
+
let f = c, ee = l, T = (e) => e, O = v(null), k = v(null), ne = v(null), A = v(null), j = v(null), M = v(null), re = w(), ie = n(() => !!f.tooltipTrigger || !!f.tooltipFormat || !!re.tooltip), N = n(() => {
|
|
3306
|
+
let e = f.legendStyle, t = {};
|
|
3214
3307
|
return e?.fontSize != null && (t["font-size"] = `${e.fontSize}px`), e?.fontWeight != null && (t["font-weight"] = String(e.fontWeight)), e?.color != null && (t.color = e.color), t;
|
|
3215
|
-
}),
|
|
3216
|
-
let e =
|
|
3308
|
+
}), de = n(() => {
|
|
3309
|
+
let e = f.titleStyle, t = {
|
|
3217
3310
|
"font-size": `${e?.fontSize ?? 14}px`,
|
|
3218
3311
|
"line-height": `${e?.lineHeight ?? 18}px`,
|
|
3219
3312
|
"font-weight": String(e?.fontWeight ?? 600),
|
|
@@ -3221,58 +3314,57 @@ var Bt = {
|
|
|
3221
3314
|
width: "100%"
|
|
3222
3315
|
};
|
|
3223
3316
|
return e?.color && (t.color = e.color), t;
|
|
3224
|
-
}), I = /* @__PURE__ */ new Map(),
|
|
3317
|
+
}), I = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map(), R = null, z = null, B = /* @__PURE__ */ new Map(), pe = /* @__PURE__ */ new Map(), me = !1, he = typeof window < "u" && "ontouchstart" in window, ge = null, _e = {
|
|
3225
3318
|
width: 0,
|
|
3226
3319
|
height: 0
|
|
3227
|
-
},
|
|
3228
|
-
function
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
e && (e.addEventListener("click", vt), e.addEventListener("mouseover", vt), e.addEventListener("mousemove", yt), e.addEventListener("mouseout", Z));
|
|
3320
|
+
}, ve = null, ye = !1, V = null, be = v(!1), xe = 0, Se = 0, Ce = 0, we = null;
|
|
3321
|
+
function Te() {
|
|
3322
|
+
let e = ne.value;
|
|
3323
|
+
e && (e.addEventListener("touchstart", St, { passive: !0 }), e.addEventListener("touchend", Ct), e.addEventListener("touchcancel", wt, { passive: !0 }), !he && (e.addEventListener("click", yt), e.addEventListener("mouseover", yt), e.addEventListener("mousemove", bt), e.addEventListener("mouseout", xt)));
|
|
3232
3324
|
}
|
|
3233
|
-
function
|
|
3234
|
-
let e =
|
|
3235
|
-
e && (e.removeEventListener("click",
|
|
3325
|
+
function Ee() {
|
|
3326
|
+
let e = ne.value;
|
|
3327
|
+
e && (e.removeEventListener("touchstart", St), e.removeEventListener("touchend", Ct), e.removeEventListener("touchcancel", wt), e.removeEventListener("click", yt), e.removeEventListener("mouseover", yt), e.removeEventListener("mousemove", bt), e.removeEventListener("mouseout", xt));
|
|
3236
3328
|
}
|
|
3237
|
-
function
|
|
3329
|
+
function De() {
|
|
3238
3330
|
gt();
|
|
3239
3331
|
}
|
|
3240
3332
|
h(() => {
|
|
3241
|
-
|
|
3333
|
+
Oe(), Te(), Et(), U(), st(), window.addEventListener("scroll", De, {
|
|
3242
3334
|
passive: !0,
|
|
3243
3335
|
capture: !0
|
|
3244
|
-
}), window.addEventListener("resize",
|
|
3336
|
+
}), window.addEventListener("resize", De, { passive: !0 });
|
|
3245
3337
|
}), g(() => {
|
|
3246
|
-
|
|
3338
|
+
ge?.disconnect(), Ce && cancelAnimationFrame(Ce), ke(), Ee(), window.removeEventListener("scroll", De, { capture: !0 }), window.removeEventListener("resize", De);
|
|
3247
3339
|
});
|
|
3248
|
-
function
|
|
3249
|
-
if (!
|
|
3250
|
-
let e = ce(
|
|
3251
|
-
|
|
3252
|
-
|
|
3340
|
+
function Oe() {
|
|
3341
|
+
if (!k.value || !ne.value) return;
|
|
3342
|
+
let e = ce(k.value), t = Math.max(12, f.focusZoomLevel);
|
|
3343
|
+
V = oe().scaleExtent([1, t]).on("start", () => {
|
|
3344
|
+
me = !0, gt();
|
|
3253
3345
|
}).on("zoom", (e) => {
|
|
3254
|
-
|
|
3346
|
+
ne.value && ne.value.setAttribute("transform", e.transform);
|
|
3255
3347
|
let t = e.transform;
|
|
3256
|
-
|
|
3348
|
+
be.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
3257
3349
|
}).on("end", () => {
|
|
3258
|
-
|
|
3259
|
-
}),
|
|
3260
|
-
let t = Y.value.length > 0, n = !!
|
|
3350
|
+
me = !1;
|
|
3351
|
+
}), V.filter((e) => {
|
|
3352
|
+
let t = Y.value.length > 0, n = !!f.zoom || t, r = !!f.pan || t;
|
|
3261
3353
|
if (e.type === "wheel" || e.type === "dblclick") {
|
|
3262
3354
|
if (!n) return !1;
|
|
3263
3355
|
} else if (e.type === "mousedown" || e.type === "touchstart") {
|
|
3264
3356
|
if (!r) return !1;
|
|
3265
3357
|
} else if (!n && !r) return !1;
|
|
3266
3358
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
3267
|
-
}), e.call(
|
|
3359
|
+
}), e.call(V);
|
|
3268
3360
|
}
|
|
3269
|
-
function
|
|
3270
|
-
|
|
3361
|
+
function ke() {
|
|
3362
|
+
k.value && V && (ce(k.value).on(".zoom", null), V = null);
|
|
3271
3363
|
}
|
|
3272
|
-
function
|
|
3273
|
-
let t =
|
|
3364
|
+
function H(e) {
|
|
3365
|
+
let t = X.value, n = Ke.value, r = [];
|
|
3274
3366
|
for (let i of e) {
|
|
3275
|
-
let e = i.geoType ??
|
|
3367
|
+
let e = i.geoType ?? f.geoType, a = t.get(e);
|
|
3276
3368
|
if (!a) continue;
|
|
3277
3369
|
let o = a.get(i.id);
|
|
3278
3370
|
if (!o) {
|
|
@@ -3288,81 +3380,81 @@ var Bt = {
|
|
|
3288
3380
|
}
|
|
3289
3381
|
return r;
|
|
3290
3382
|
}
|
|
3291
|
-
function
|
|
3383
|
+
function je(e) {
|
|
3292
3384
|
let t = /* @__PURE__ */ new Set();
|
|
3293
|
-
for (let n of
|
|
3385
|
+
for (let n of H(e)) n.geoType === f.geoType && t.add(String(n.feature.id));
|
|
3294
3386
|
return t;
|
|
3295
3387
|
}
|
|
3296
|
-
let
|
|
3297
|
-
function
|
|
3298
|
-
if (!
|
|
3299
|
-
let e =
|
|
3388
|
+
let Me = !1;
|
|
3389
|
+
function U() {
|
|
3390
|
+
if (!k.value || !V) return;
|
|
3391
|
+
let e = H(Y.value), t = e.filter((e) => e.geoType === f.geoType), n = e.filter((e) => e.geoType !== f.geoType), r = /* @__PURE__ */ new Map();
|
|
3300
3392
|
for (let e of t) {
|
|
3301
3393
|
let t = I.get(String(e.feature.id));
|
|
3302
3394
|
t && r.set(t, e.item.style ?? "solid");
|
|
3303
3395
|
}
|
|
3304
|
-
for (let [e] of
|
|
3305
|
-
for (let [e, t] of r)
|
|
3306
|
-
|
|
3307
|
-
for (let [e, t] of r)
|
|
3308
|
-
if (
|
|
3309
|
-
|
|
3396
|
+
for (let [e] of B) r.has(e) || e === z || mt(e);
|
|
3397
|
+
for (let [e, t] of r) B.get(e) === t && e !== z || e !== z && pt(e, t);
|
|
3398
|
+
B.clear();
|
|
3399
|
+
for (let [e, t] of r) B.set(e, t);
|
|
3400
|
+
if (W(n), e.length === 0) {
|
|
3401
|
+
Me = !0, gt();
|
|
3310
3402
|
return;
|
|
3311
3403
|
}
|
|
3312
|
-
let i = ce(
|
|
3404
|
+
let i = ce(k.value);
|
|
3313
3405
|
i.interrupt();
|
|
3314
|
-
let a =
|
|
3315
|
-
|
|
3316
|
-
let [[o, s], [c,
|
|
3406
|
+
let a = Me;
|
|
3407
|
+
Me = !0;
|
|
3408
|
+
let [[o, s], [c, l]] = We.value.bounds({
|
|
3317
3409
|
type: "FeatureCollection",
|
|
3318
3410
|
features: e.map((e) => e.feature)
|
|
3319
|
-
}),
|
|
3320
|
-
if (!
|
|
3411
|
+
}), u = (o + c) / 2, d = (s + l) / 2, p = f.focusZoomLevel, m = se.translate(q.value / 2 - p * u, Fe.value / 2 - p * d).scale(p), h = t[0]?.feature ?? null, g = () => {
|
|
3412
|
+
if (!ie.value || !h) return;
|
|
3321
3413
|
let e = String(h.id), t = I.get(e);
|
|
3322
3414
|
if (!t) return;
|
|
3323
3415
|
let n = t.getBoundingClientRect();
|
|
3324
3416
|
lt(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
3325
3417
|
};
|
|
3326
|
-
a ? (dt(), i.transition().duration(
|
|
3418
|
+
a ? (dt(), i.transition().duration(vr).call(V.transform, m).on("end", g)) : (V.transform(i, m), g());
|
|
3327
3419
|
}
|
|
3328
|
-
function
|
|
3329
|
-
let t =
|
|
3420
|
+
function W(e) {
|
|
3421
|
+
let t = j.value;
|
|
3330
3422
|
if (!t) return;
|
|
3331
3423
|
let n = new Set(e.map((e) => e.key));
|
|
3332
|
-
for (let [e, t] of
|
|
3333
|
-
let r =
|
|
3424
|
+
for (let [e, t] of pe) n.has(e) || (t.remove(), pe.delete(e));
|
|
3425
|
+
let r = We.value, i = Ge.value + 1.5;
|
|
3334
3426
|
for (let { item: n, feature: a, key: o } of e) {
|
|
3335
|
-
let e =
|
|
3336
|
-
e || (e = document.createElementNS(
|
|
3427
|
+
let e = pe.get(o);
|
|
3428
|
+
e || (e = document.createElementNS(hr, "path"), e.setAttribute("d", r(a) ?? ""), e.setAttribute("fill", "none"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("class", "focus-overlay"), t.appendChild(e), pe.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), ft(e, n.style);
|
|
3337
3429
|
}
|
|
3338
3430
|
}
|
|
3339
|
-
function
|
|
3340
|
-
if (!
|
|
3341
|
-
Y.value.length > 0 &&
|
|
3342
|
-
let e = ce(
|
|
3343
|
-
e.interrupt(), dt(), e.transition().duration(
|
|
3431
|
+
function Ne() {
|
|
3432
|
+
if (!k.value || !V) return;
|
|
3433
|
+
Y.value.length > 0 && ee("update:focus", null);
|
|
3434
|
+
let e = ce(k.value);
|
|
3435
|
+
e.interrupt(), dt(), e.transition().duration(vr).call(V.transform, se);
|
|
3344
3436
|
}
|
|
3345
|
-
E(() =>
|
|
3346
|
-
|
|
3437
|
+
E(() => f.focusZoomLevel, () => {
|
|
3438
|
+
V && V.scaleExtent([1, Math.max(12, f.focusZoomLevel)]), U();
|
|
3347
3439
|
});
|
|
3348
|
-
let
|
|
3349
|
-
function
|
|
3350
|
-
return
|
|
3440
|
+
let Pe = n(() => f.width && f.height ? f.height / f.width : .625), q = n(() => yr), Fe = n(() => yr * Pe.value), Ie = v(null), Le = null;
|
|
3441
|
+
function ze() {
|
|
3442
|
+
return Le ||= import("./hsaMapping-BahYDmea.js").then((e) => e.n).then((e) => (Ie.value = e, e)), Le;
|
|
3351
3443
|
}
|
|
3352
3444
|
E(() => {
|
|
3353
|
-
if (
|
|
3354
|
-
let e =
|
|
3445
|
+
if (f.geoType === "hsas" || f.dataGeoType === "hsas") return !0;
|
|
3446
|
+
let e = f.focus;
|
|
3355
3447
|
return e ? (Array.isArray(e) ? e : [e]).some((e) => typeof e != "string" && e.geoType === "hsas") : !1;
|
|
3356
3448
|
}, (e) => {
|
|
3357
|
-
e &&
|
|
3449
|
+
e && ze();
|
|
3358
3450
|
}, { immediate: !0 });
|
|
3359
|
-
let
|
|
3360
|
-
let e =
|
|
3451
|
+
let Be = n(() => {
|
|
3452
|
+
let e = Ie.value;
|
|
3361
3453
|
if (!e) return {
|
|
3362
3454
|
type: "FeatureCollection",
|
|
3363
3455
|
features: []
|
|
3364
3456
|
};
|
|
3365
|
-
let { fipsToHsa: t, hsaNames: n } = e, r = S(
|
|
3457
|
+
let { fipsToHsa: t, hsaNames: n } = e, r = S(f.topology), i = r.objects.counties.geometries, a = /* @__PURE__ */ new Map();
|
|
3366
3458
|
for (let e of i) {
|
|
3367
3459
|
let n = t[String(e.id).padStart(5, "0")];
|
|
3368
3460
|
n && (a.has(n) || a.set(n, []), a.get(n).push(e));
|
|
@@ -3378,44 +3470,44 @@ var Bt = {
|
|
|
3378
3470
|
type: "FeatureCollection",
|
|
3379
3471
|
features: o
|
|
3380
3472
|
};
|
|
3381
|
-
}),
|
|
3382
|
-
if (
|
|
3383
|
-
if (
|
|
3384
|
-
let e = S(
|
|
3473
|
+
}), Ve = n(() => {
|
|
3474
|
+
if (f.geoType === "hsas") return Be.value;
|
|
3475
|
+
if (f.geoType === "counties") {
|
|
3476
|
+
let e = S(f.topology);
|
|
3385
3477
|
return F(e, e.objects.counties);
|
|
3386
3478
|
}
|
|
3387
|
-
let e = S(
|
|
3479
|
+
let e = S(f.topology);
|
|
3388
3480
|
return F(e, e.objects.states);
|
|
3389
|
-
}),
|
|
3390
|
-
if (
|
|
3391
|
-
let e = S(
|
|
3481
|
+
}), He = n(() => {
|
|
3482
|
+
if (f.geoType !== "counties" && f.geoType !== "hsas") return null;
|
|
3483
|
+
let e = S(f.topology);
|
|
3392
3484
|
return ue(e, e.objects.states, (e, t) => e !== t);
|
|
3393
|
-
}),
|
|
3485
|
+
}), Ue = n(() => ae().fitExtent([[0, 0], [q.value, Fe.value]], Ve.value)), We = n(() => P(Ue.value)), Ge = n(() => f.geoType === "counties" || f.geoType === "hsas" ? f.strokeWidth * .5 : f.strokeWidth), Ke = n(() => {
|
|
3394
3486
|
let e = /* @__PURE__ */ new Map();
|
|
3395
|
-
for (let [t, n] of
|
|
3487
|
+
for (let [t, n] of X.value) {
|
|
3396
3488
|
let r = /* @__PURE__ */ new Map();
|
|
3397
3489
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
3398
3490
|
e.set(t, r);
|
|
3399
3491
|
}
|
|
3400
3492
|
return e;
|
|
3401
3493
|
});
|
|
3402
|
-
function
|
|
3403
|
-
let t =
|
|
3404
|
-
if (!t || t ===
|
|
3405
|
-
if (
|
|
3406
|
-
if (
|
|
3494
|
+
function J(e) {
|
|
3495
|
+
let t = f.dataGeoType;
|
|
3496
|
+
if (!t || t === f.geoType) return e;
|
|
3497
|
+
if (f.geoType === "counties" && t === "hsas") return Ie.value?.fipsToHsa[e];
|
|
3498
|
+
if (f.geoType === "counties" && t === "states" || f.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
3407
3499
|
}
|
|
3408
|
-
let
|
|
3500
|
+
let qe = n(() => {
|
|
3409
3501
|
let e = /* @__PURE__ */ new Map();
|
|
3410
|
-
for (let t of
|
|
3502
|
+
for (let t of Ve.value.features) t.id != null && e.set(String(t.id), t);
|
|
3411
3503
|
return e;
|
|
3412
3504
|
}), Y = n(() => {
|
|
3413
|
-
let e =
|
|
3505
|
+
let e = f.focus;
|
|
3414
3506
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
3415
|
-
}),
|
|
3507
|
+
}), X = n(() => {
|
|
3416
3508
|
let e = /* @__PURE__ */ new Map();
|
|
3417
|
-
e.set(
|
|
3418
|
-
let t = S(
|
|
3509
|
+
e.set(f.geoType, qe.value);
|
|
3510
|
+
let t = S(f.topology), n = t?.objects;
|
|
3419
3511
|
if (!n) return e;
|
|
3420
3512
|
let r = (e) => {
|
|
3421
3513
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3430,24 +3522,24 @@ var Bt = {
|
|
|
3430
3522
|
let i = F(t, n.counties);
|
|
3431
3523
|
e.set("counties", r(i.features));
|
|
3432
3524
|
}
|
|
3433
|
-
return !e.has("hsas") && n.counties && e.set("hsas", r(
|
|
3434
|
-
}),
|
|
3525
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r(Be.value.features)), e;
|
|
3526
|
+
}), Je = n(() => {
|
|
3435
3527
|
let e = /* @__PURE__ */ new Map();
|
|
3436
|
-
if (!
|
|
3437
|
-
let t =
|
|
3438
|
-
for (let t of
|
|
3528
|
+
if (!f.data) return e;
|
|
3529
|
+
let t = f.dataGeoType ?? f.geoType, n = Ke.value.get(t);
|
|
3530
|
+
for (let t of f.data) {
|
|
3439
3531
|
e.set(t.id, t.value);
|
|
3440
3532
|
let r = n?.get(t.id);
|
|
3441
3533
|
r && e.set(r, t.value);
|
|
3442
3534
|
}
|
|
3443
3535
|
return e;
|
|
3444
|
-
}),
|
|
3445
|
-
if (!
|
|
3536
|
+
}), Z = n(() => {
|
|
3537
|
+
if (!f.data || f.data.length === 0) return {
|
|
3446
3538
|
min: 0,
|
|
3447
3539
|
max: 1
|
|
3448
3540
|
};
|
|
3449
3541
|
let e = Infinity, t = -Infinity;
|
|
3450
|
-
for (let n of
|
|
3542
|
+
for (let n of f.data) typeof n.value == "number" && (n.value < e && (e = n.value), n.value > t && (t = n.value));
|
|
3451
3543
|
return isFinite(e) ? e === t ? {
|
|
3452
3544
|
min: e,
|
|
3453
3545
|
max: e + 1
|
|
@@ -3458,7 +3550,7 @@ var Bt = {
|
|
|
3458
3550
|
min: 0,
|
|
3459
3551
|
max: 1
|
|
3460
3552
|
};
|
|
3461
|
-
}),
|
|
3553
|
+
}), Q = n(() => Array.isArray(f.colorScale) && f.colorScale.length > 0 && "value" in f.colorScale[0]), Ye = n(() => Array.isArray(f.colorScale) && !Q.value), Xe = n(() => Ye.value ? "" : f.colorScale?.min ?? "#e5f0fa"), Ze = n(() => Ye.value ? "" : f.colorScale?.max ?? "#08519c");
|
|
3462
3554
|
function Qe(e) {
|
|
3463
3555
|
let t = e.replace("#", "");
|
|
3464
3556
|
return [
|
|
@@ -3471,18 +3563,18 @@ var Bt = {
|
|
|
3471
3563
|
let [t, n, r] = Qe(Xe.value), [i, a, o] = Qe(Ze.value);
|
|
3472
3564
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
3473
3565
|
}
|
|
3474
|
-
let et = n(() => Ye.value ?
|
|
3475
|
-
if (!
|
|
3566
|
+
let et = n(() => Ye.value ? f.colorScale.slice().sort((e, t) => t.min - e.min) : null), tt = n(() => {
|
|
3567
|
+
if (!Q.value) return null;
|
|
3476
3568
|
let e = /* @__PURE__ */ new Map();
|
|
3477
|
-
for (let t of
|
|
3569
|
+
for (let t of f.colorScale) e.set(t.value, t.color);
|
|
3478
3570
|
return e;
|
|
3479
3571
|
});
|
|
3480
3572
|
function nt(e) {
|
|
3481
|
-
let t =
|
|
3482
|
-
return t == null ? void 0 :
|
|
3573
|
+
let t = J(e);
|
|
3574
|
+
return t == null ? void 0 : Je.value.get(t);
|
|
3483
3575
|
}
|
|
3484
3576
|
function rt(e) {
|
|
3485
|
-
let t = nt(e), n =
|
|
3577
|
+
let t = nt(e), n = f.noDataColor;
|
|
3486
3578
|
if (t == null) return n;
|
|
3487
3579
|
let r = tt.value;
|
|
3488
3580
|
if (r) return r.get(String(t)) ?? n;
|
|
@@ -3492,73 +3584,73 @@ var Bt = {
|
|
|
3492
3584
|
for (let t of i) if (e >= t.min) return t.color;
|
|
3493
3585
|
return n;
|
|
3494
3586
|
}
|
|
3495
|
-
let { min: a, max: o } =
|
|
3587
|
+
let { min: a, max: o } = Z.value;
|
|
3496
3588
|
return $e((t - a) / (o - a));
|
|
3497
3589
|
}
|
|
3498
3590
|
let it = (e) => e.properties?.name ?? String(e.id);
|
|
3499
3591
|
function at(e) {
|
|
3500
|
-
return e == null ? "" : typeof e == "number" &&
|
|
3592
|
+
return e == null ? "" : typeof e == "number" && f.tooltipValueFormat !== void 0 ? te(e, f.tooltipValueFormat) : String(e);
|
|
3501
3593
|
}
|
|
3502
3594
|
function ot(e, t) {
|
|
3503
3595
|
return t == null ? e : `${e}: ${at(t)}`;
|
|
3504
3596
|
}
|
|
3505
3597
|
function st() {
|
|
3506
|
-
let e =
|
|
3598
|
+
let e = M.value?.getEl();
|
|
3507
3599
|
if (!e) return;
|
|
3508
|
-
|
|
3600
|
+
ge?.disconnect();
|
|
3509
3601
|
let t = !1;
|
|
3510
|
-
|
|
3602
|
+
ge = new ResizeObserver((e) => {
|
|
3511
3603
|
let n = e[0]?.contentRect;
|
|
3512
|
-
n && (
|
|
3513
|
-
}),
|
|
3604
|
+
n && (_e.width = n.width, _e.height = n.height, !t && ye && ve ? (t = !0, ct(ve.x, ve.y)) : t = !0);
|
|
3605
|
+
}), ge.observe(e);
|
|
3514
3606
|
}
|
|
3515
3607
|
function ct(e, t) {
|
|
3516
|
-
let n =
|
|
3608
|
+
let n = M.value?.getEl();
|
|
3517
3609
|
if (!n) return;
|
|
3518
|
-
let r =
|
|
3610
|
+
let r = O.value?.getBoundingClientRect(), { left: i, top: a } = Ae(e, t, _e.width, _e.height, f.tooltipClamp, r);
|
|
3519
3611
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
3520
3612
|
}
|
|
3521
3613
|
function lt(e, t, n) {
|
|
3522
|
-
let r =
|
|
3614
|
+
let r = L.get(e);
|
|
3523
3615
|
if (!r) return;
|
|
3524
|
-
let i =
|
|
3525
|
-
!i || !a || (i.setData(r),
|
|
3616
|
+
let i = M.value, a = i?.getEl();
|
|
3617
|
+
!i || !a || (i.setData(r), ve = {
|
|
3526
3618
|
x: t,
|
|
3527
3619
|
y: n
|
|
3528
|
-
},
|
|
3620
|
+
}, ye = !0, ct(t, n), a.style.visibility = "visible");
|
|
3529
3621
|
}
|
|
3530
3622
|
function ut(e, t) {
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
let e =
|
|
3534
|
-
!e || !
|
|
3535
|
-
x:
|
|
3536
|
-
y:
|
|
3537
|
-
}, e.style.transform = `translate3d(${
|
|
3623
|
+
ye && (xe = e, Se = t, !Ce && (Ce = requestAnimationFrame(() => {
|
|
3624
|
+
Ce = 0;
|
|
3625
|
+
let e = M.value?.getEl();
|
|
3626
|
+
!e || !ye || (ve = {
|
|
3627
|
+
x: xe,
|
|
3628
|
+
y: Se
|
|
3629
|
+
}, e.style.transform = `translate3d(${xe + 16}px, ${Se}px, 0) translateY(-50%)`);
|
|
3538
3630
|
})));
|
|
3539
3631
|
}
|
|
3540
3632
|
function dt() {
|
|
3541
|
-
if (!
|
|
3542
|
-
|
|
3543
|
-
let e =
|
|
3633
|
+
if (!ye) return;
|
|
3634
|
+
ye = !1, ve = null;
|
|
3635
|
+
let e = M.value?.getEl();
|
|
3544
3636
|
e && (e.style.visibility = "hidden");
|
|
3545
3637
|
}
|
|
3546
3638
|
function ft(e, t) {
|
|
3547
3639
|
t === "dashed" ? (e.setAttribute("stroke-dasharray", "8 4"), e.removeAttribute("stroke-linecap")) : t === "dotted" ? (e.setAttribute("stroke-dasharray", "0 5"), e.setAttribute("stroke-linecap", "round")) : (e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap"));
|
|
3548
3640
|
}
|
|
3549
3641
|
function pt(e, t = "solid") {
|
|
3550
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
3642
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Ge.value + 1)), e.setAttribute("stroke", "#555"), ft(e, t);
|
|
3551
3643
|
}
|
|
3552
3644
|
function mt(e) {
|
|
3553
|
-
e.setAttribute("stroke-width", String(
|
|
3645
|
+
e.setAttribute("stroke-width", String(Ge.value)), e.setAttribute("stroke", f.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
3554
3646
|
}
|
|
3555
3647
|
function ht(e) {
|
|
3556
|
-
|
|
3648
|
+
z !== e && (z && !B.has(z) && mt(z), z = e, pt(e, B.get(e) ?? "solid"));
|
|
3557
3649
|
}
|
|
3558
3650
|
function gt() {
|
|
3559
|
-
if (
|
|
3560
|
-
let e =
|
|
3561
|
-
e == null ? mt(
|
|
3651
|
+
if (z) {
|
|
3652
|
+
let e = B.get(z);
|
|
3653
|
+
e == null ? mt(z) : pt(z, e), z = null, ee("stateHover", null);
|
|
3562
3654
|
}
|
|
3563
3655
|
dt();
|
|
3564
3656
|
}
|
|
@@ -3568,74 +3660,105 @@ var Bt = {
|
|
|
3568
3660
|
return t ? t.dataset.featId ?? null : null;
|
|
3569
3661
|
}
|
|
3570
3662
|
function vt(e) {
|
|
3571
|
-
|
|
3663
|
+
ee("stateClick", {
|
|
3664
|
+
id: e.id,
|
|
3665
|
+
name: e.name,
|
|
3666
|
+
value: e.value
|
|
3667
|
+
}), ee("update:focus", je(Y.value).has(e.id) ? null : e.id);
|
|
3668
|
+
}
|
|
3669
|
+
function yt(e) {
|
|
3670
|
+
if (me) return;
|
|
3572
3671
|
let t = e, n = _t(t.target);
|
|
3573
3672
|
if (!n) return;
|
|
3574
|
-
let r =
|
|
3673
|
+
let r = L.get(n);
|
|
3575
3674
|
if (!r) return;
|
|
3576
3675
|
let i = {
|
|
3577
3676
|
id: r.id,
|
|
3578
3677
|
name: r.name,
|
|
3579
3678
|
value: r.value
|
|
3580
3679
|
};
|
|
3581
|
-
e.type === "click" ? (
|
|
3680
|
+
e.type === "click" ? vt(r) : e.type === "mouseover" && (ht(I.get(n)), ie.value && lt(n, t.clientX, t.clientY), ee("stateHover", i));
|
|
3582
3681
|
}
|
|
3583
|
-
function
|
|
3584
|
-
|
|
3682
|
+
function bt(e) {
|
|
3683
|
+
me || ut(e.clientX, e.clientY);
|
|
3585
3684
|
}
|
|
3586
|
-
function
|
|
3685
|
+
function xt(e) {
|
|
3587
3686
|
let t = e.relatedTarget;
|
|
3588
|
-
t &&
|
|
3687
|
+
t && ne.value?.contains(t) || gt();
|
|
3589
3688
|
}
|
|
3590
|
-
function
|
|
3591
|
-
|
|
3689
|
+
function St(e) {
|
|
3690
|
+
if (e.touches.length !== 1) {
|
|
3691
|
+
we = null;
|
|
3692
|
+
return;
|
|
3693
|
+
}
|
|
3694
|
+
let t = e.touches[0];
|
|
3695
|
+
we = {
|
|
3696
|
+
x: t.clientX,
|
|
3697
|
+
y: t.clientY,
|
|
3698
|
+
time: e.timeStamp,
|
|
3699
|
+
featId: _t(e.target)
|
|
3700
|
+
};
|
|
3701
|
+
}
|
|
3702
|
+
function Ct(e) {
|
|
3703
|
+
let t = we;
|
|
3704
|
+
if (we = null, !t || !t.featId || e.touches.length > 0) return;
|
|
3705
|
+
let n = e.changedTouches[0];
|
|
3706
|
+
if (!n || Math.abs(n.clientX - t.x) > gr || Math.abs(n.clientY - t.y) > gr || e.timeStamp - t.time > _r) return;
|
|
3707
|
+
let r = L.get(t.featId);
|
|
3708
|
+
r && (e.preventDefault(), vt(r));
|
|
3709
|
+
}
|
|
3710
|
+
function wt() {
|
|
3711
|
+
we = null;
|
|
3712
|
+
}
|
|
3713
|
+
function Tt(e) {
|
|
3714
|
+
let t = document.createElementNS(hr, "path");
|
|
3592
3715
|
return e && t.setAttribute("d", e), t;
|
|
3593
3716
|
}
|
|
3594
|
-
function
|
|
3595
|
-
let e =
|
|
3717
|
+
function Et() {
|
|
3718
|
+
let e = A.value, t = j.value;
|
|
3596
3719
|
if (!e || !t) return;
|
|
3597
3720
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
3598
3721
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
3599
|
-
I.clear(),
|
|
3600
|
-
let n =
|
|
3722
|
+
I.clear(), L.clear(), R = null, z = null, B.clear(), pe.clear();
|
|
3723
|
+
let n = We.value, r = Ve.value.features, i = f.strokeColor, a = String(Ge.value), o = !ie.value, s = document.createDocumentFragment();
|
|
3601
3724
|
for (let e of r) {
|
|
3602
|
-
let t = String(e.id), r = it(e), c = nt(t), l =
|
|
3725
|
+
let t = String(e.id), r = it(e), c = nt(t), l = Tt(n(e));
|
|
3603
3726
|
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", rt(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
|
|
3604
|
-
let e = document.createElementNS(
|
|
3727
|
+
let e = document.createElementNS(hr, "title");
|
|
3605
3728
|
e.textContent = ot(r, c), l.appendChild(e);
|
|
3606
3729
|
}
|
|
3607
|
-
s.appendChild(l), I.set(t, l),
|
|
3730
|
+
s.appendChild(l), I.set(t, l), L.set(t, {
|
|
3608
3731
|
id: t,
|
|
3609
3732
|
name: r,
|
|
3610
3733
|
value: c,
|
|
3611
3734
|
feature: e
|
|
3612
3735
|
});
|
|
3613
3736
|
}
|
|
3614
|
-
let c =
|
|
3737
|
+
let c = He.value;
|
|
3615
3738
|
if (c) {
|
|
3616
|
-
let e =
|
|
3617
|
-
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e),
|
|
3739
|
+
let e = Tt(n(c));
|
|
3740
|
+
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), s.appendChild(e), R = e;
|
|
3618
3741
|
}
|
|
3619
3742
|
e.appendChild(s);
|
|
3620
3743
|
}
|
|
3621
|
-
function
|
|
3622
|
-
let e = !
|
|
3744
|
+
function Dt() {
|
|
3745
|
+
let e = !ie.value;
|
|
3623
3746
|
for (let [t, n] of I) {
|
|
3624
|
-
let r = nt(t), i =
|
|
3747
|
+
let r = nt(t), i = L.get(t);
|
|
3625
3748
|
if (n.setAttribute("fill", rt(t)), i && (i.value = r), e && i) {
|
|
3626
3749
|
let e = n.firstElementChild;
|
|
3627
3750
|
e && (e.textContent = ot(i.name, r));
|
|
3628
3751
|
}
|
|
3629
3752
|
}
|
|
3630
3753
|
}
|
|
3631
|
-
function
|
|
3632
|
-
for (let e of I.values()) e ===
|
|
3633
|
-
|
|
3754
|
+
function Ot() {
|
|
3755
|
+
for (let e of I.values()) e === z || B.has(e) || mt(e);
|
|
3756
|
+
R && R.setAttribute("stroke", f.strokeColor);
|
|
3634
3757
|
}
|
|
3635
|
-
function
|
|
3636
|
-
return typeof
|
|
3758
|
+
function kt() {
|
|
3759
|
+
return typeof f.menu == "string" ? f.menu : "choropleth";
|
|
3637
3760
|
}
|
|
3638
|
-
let
|
|
3761
|
+
let At = n(() => f.legend && (Q.value || Ye.value || f.data)), jt = n(() => f.colorScale.slice().sort((e, t) => e.min - t.min)), Mt = n(() => {
|
|
3639
3762
|
let e = [];
|
|
3640
3763
|
for (let t = 0; t <= 10; t++) {
|
|
3641
3764
|
let n = t / 10;
|
|
@@ -3645,129 +3768,140 @@ var Bt = {
|
|
|
3645
3768
|
});
|
|
3646
3769
|
}
|
|
3647
3770
|
return e;
|
|
3648
|
-
}),
|
|
3771
|
+
}), Nt = new Intl.NumberFormat("en-US", {
|
|
3649
3772
|
notation: "compact",
|
|
3650
3773
|
maximumFractionDigits: 1
|
|
3651
|
-
}),
|
|
3652
|
-
let { min: e, max: t } =
|
|
3774
|
+
}), Pt = n(() => {
|
|
3775
|
+
let { min: e, max: t } = Z.value, n = t - e, r = [];
|
|
3653
3776
|
for (let t = 1; t <= 3; t++) {
|
|
3654
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
3777
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? Nt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
3655
3778
|
r.push({
|
|
3656
3779
|
value: o,
|
|
3657
3780
|
pct: i * 100
|
|
3658
3781
|
});
|
|
3659
3782
|
}
|
|
3660
3783
|
return r;
|
|
3661
|
-
}),
|
|
3784
|
+
}), $ = n(() => {
|
|
3662
3785
|
let e = [];
|
|
3663
|
-
if (
|
|
3786
|
+
if (Q.value) for (let t of f.colorScale) e.push({
|
|
3664
3787
|
key: t.value,
|
|
3665
3788
|
color: t.color,
|
|
3666
3789
|
label: t.value
|
|
3667
3790
|
});
|
|
3668
|
-
else if (Ye.value) for (let t of
|
|
3791
|
+
else if (Ye.value) for (let t of jt.value) e.push({
|
|
3669
3792
|
key: String(t.min),
|
|
3670
3793
|
color: t.color,
|
|
3671
3794
|
label: t.label ?? String(t.min)
|
|
3672
3795
|
});
|
|
3673
3796
|
return e;
|
|
3674
|
-
}),
|
|
3675
|
-
let e =
|
|
3797
|
+
}), Ft = n(() => `linear-gradient(to right, ${Mt.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), It = Re({ target: () => f.fullscreenTarget }), Lt = n(() => {
|
|
3798
|
+
let e = kt();
|
|
3676
3799
|
return [
|
|
3677
|
-
|
|
3800
|
+
It.menuItem.value,
|
|
3678
3801
|
{
|
|
3679
3802
|
label: "Save as SVG",
|
|
3680
3803
|
action: () => {
|
|
3681
|
-
|
|
3804
|
+
k.value && G(k.value, e);
|
|
3682
3805
|
}
|
|
3683
3806
|
},
|
|
3684
3807
|
{
|
|
3685
3808
|
label: "Save as PNG",
|
|
3686
3809
|
action: () => {
|
|
3687
|
-
|
|
3810
|
+
k.value && K(k.value, e);
|
|
3688
3811
|
}
|
|
3689
3812
|
}
|
|
3690
3813
|
];
|
|
3691
3814
|
});
|
|
3692
|
-
return E(() => [
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
], () =>
|
|
3815
|
+
return E(() => [We.value, ie.value], () => Et()), E(() => [
|
|
3816
|
+
Je.value,
|
|
3817
|
+
f.colorScale,
|
|
3818
|
+
f.noDataColor,
|
|
3819
|
+
f.dataGeoType
|
|
3820
|
+
], () => Dt()), E(() => [f.strokeColor, Ge.value], () => Ot()), E(() => [
|
|
3698
3821
|
Y.value,
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
], () =>
|
|
3822
|
+
We.value,
|
|
3823
|
+
Ie.value
|
|
3824
|
+
], () => U(), { flush: "post" }), (n, l) => (_(), r(t, {
|
|
3825
|
+
to: C(It).teleportTarget.value,
|
|
3826
|
+
disabled: !C(It).isFullscreen.value
|
|
3827
|
+
}, [o("div", d({
|
|
3702
3828
|
ref_key: "containerRef",
|
|
3703
|
-
ref:
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3829
|
+
ref: O
|
|
3830
|
+
}, n.$attrs, {
|
|
3831
|
+
class: ["choropleth-wrapper", {
|
|
3832
|
+
pannable: c.pan,
|
|
3833
|
+
"is-fullscreen": C(It).isFullscreen.value
|
|
3834
|
+
}],
|
|
3835
|
+
style: C(It).fullscreenStyle.value
|
|
3836
|
+
}), [
|
|
3837
|
+
c.menu ? (_(), r(fe, {
|
|
3710
3838
|
key: 0,
|
|
3711
|
-
items:
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3839
|
+
items: Lt.value,
|
|
3840
|
+
"is-fullscreen": C(It).isFullscreen.value,
|
|
3841
|
+
onClose: C(It).exit
|
|
3842
|
+
}, null, 8, [
|
|
3843
|
+
"items",
|
|
3844
|
+
"is-fullscreen",
|
|
3845
|
+
"onClose"
|
|
3846
|
+
])) : i("", !0),
|
|
3847
|
+
o("div", cr, x(C(It).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
|
|
3848
|
+
c.title || At.value ? (_(), a("div", lr, [c.title ? (_(), a("div", {
|
|
3715
3849
|
key: 0,
|
|
3716
3850
|
class: "choropleth-title",
|
|
3717
|
-
style: m(
|
|
3718
|
-
}, x(
|
|
3851
|
+
style: m(de.value)
|
|
3852
|
+
}, x(c.title), 5)) : i("", !0), At.value ? (_(), a("div", {
|
|
3719
3853
|
key: 1,
|
|
3720
3854
|
class: "choropleth-legend",
|
|
3721
|
-
style: m(
|
|
3722
|
-
}, [
|
|
3855
|
+
style: m(N.value)
|
|
3856
|
+
}, [c.legendTitle ? (_(), a("span", ur, x(c.legendTitle), 1)) : i("", !0), Q.value || Ye.value ? (_(!0), a(e, { key: 1 }, y($.value, (e) => (_(), a("span", {
|
|
3723
3857
|
key: e.key,
|
|
3724
3858
|
class: "choropleth-legend-item"
|
|
3725
3859
|
}, [o("span", {
|
|
3726
3860
|
class: "choropleth-legend-swatch",
|
|
3727
3861
|
style: m({ background: e.color })
|
|
3728
|
-
}, null, 4), s(" " + x(e.label), 1)]))), 128)) : (_(), a("div",
|
|
3862
|
+
}, null, 4), s(" " + x(e.label), 1)]))), 128)) : (_(), a("div", dr, [o("div", {
|
|
3729
3863
|
class: "choropleth-legend-gradient",
|
|
3730
|
-
style: m({ background:
|
|
3731
|
-
}, null, 4), o("div",
|
|
3864
|
+
style: m({ background: Ft.value })
|
|
3865
|
+
}, null, 4), o("div", fr, [(_(!0), a(e, null, y(Pt.value, (e) => (_(), a("span", {
|
|
3732
3866
|
key: e.value,
|
|
3733
3867
|
style: m({ left: e.pct + "%" })
|
|
3734
3868
|
}, x(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
|
|
3735
3869
|
(_(), a("svg", {
|
|
3736
3870
|
ref_key: "svgRef",
|
|
3737
|
-
ref:
|
|
3738
|
-
viewBox: `0 0 ${
|
|
3871
|
+
ref: k,
|
|
3872
|
+
viewBox: `0 0 ${q.value} ${Fe.value}`,
|
|
3739
3873
|
preserveAspectRatio: "xMidYMid meet"
|
|
3740
3874
|
}, [o("g", {
|
|
3741
3875
|
ref_key: "mapGroupRef",
|
|
3742
|
-
ref:
|
|
3876
|
+
ref: ne
|
|
3743
3877
|
}, [o("g", {
|
|
3744
3878
|
ref_key: "baseGroupRef",
|
|
3745
|
-
ref:
|
|
3879
|
+
ref: A
|
|
3746
3880
|
}, null, 512), o("g", {
|
|
3747
3881
|
ref_key: "overlayGroupRef",
|
|
3748
|
-
ref:
|
|
3749
|
-
}, null, 512)], 512)], 8,
|
|
3750
|
-
|
|
3882
|
+
ref: j
|
|
3883
|
+
}, null, 512)], 512)], 8, pr)),
|
|
3884
|
+
be.value ? (_(), a("button", {
|
|
3751
3885
|
key: 2,
|
|
3752
3886
|
type: "button",
|
|
3753
3887
|
class: "choropleth-reset",
|
|
3754
3888
|
"aria-label": "Reset zoom",
|
|
3755
|
-
onClick:
|
|
3889
|
+
onClick: Ne
|
|
3756
3890
|
}, " Reset ")) : i("", !0),
|
|
3757
|
-
|
|
3891
|
+
ie.value ? (_(), r(sr, {
|
|
3758
3892
|
key: 3,
|
|
3759
3893
|
ref_key: "tooltipChildRef",
|
|
3760
|
-
ref:
|
|
3894
|
+
ref: M
|
|
3761
3895
|
}, {
|
|
3762
|
-
default: D((
|
|
3896
|
+
default: D((t) => [b(n.$slots, "tooltip", p(u(T(t))), () => [c.tooltipFormat ? (_(), a("span", {
|
|
3763
3897
|
key: 0,
|
|
3764
|
-
innerHTML:
|
|
3765
|
-
}, null, 8,
|
|
3898
|
+
innerHTML: c.tooltipFormat(t)
|
|
3899
|
+
}, null, 8, mr)) : t.value == null ? (_(), a(e, { key: 1 }, [s(x(t.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(x(t.name) + ": " + x(at(t.value)), 1)], 64))], !0)]),
|
|
3766
3900
|
_: 3
|
|
3767
3901
|
}, 512)) : i("", !0)
|
|
3768
|
-
],
|
|
3902
|
+
], 16)], 8, ["to", "disabled"]));
|
|
3769
3903
|
}
|
|
3770
|
-
}), [["__scopeId", "data-v-
|
|
3904
|
+
}), [["__scopeId", "data-v-96a5f36e"]]), xr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3771
3905
|
__name: "ChartTooltip",
|
|
3772
3906
|
props: {
|
|
3773
3907
|
x: {},
|
|
@@ -3791,7 +3925,7 @@ var Bt = {
|
|
|
3791
3925
|
key: 1,
|
|
3792
3926
|
open: e.open
|
|
3793
3927
|
}, {
|
|
3794
|
-
default: D(() => [c(C(
|
|
3928
|
+
default: D(() => [c(C(M), { "as-child": "" }, {
|
|
3795
3929
|
default: D(() => [o("div", {
|
|
3796
3930
|
class: "chart-tooltip-anchor",
|
|
3797
3931
|
style: m({
|
|
@@ -3801,7 +3935,7 @@ var Bt = {
|
|
|
3801
3935
|
}, null, 4)]),
|
|
3802
3936
|
_: 1
|
|
3803
3937
|
}), c(C(ie), null, {
|
|
3804
|
-
default: D(() => [e.open ? (_(), r(C(
|
|
3938
|
+
default: D(() => [e.open ? (_(), r(C(re), {
|
|
3805
3939
|
key: 0,
|
|
3806
3940
|
class: "chart-tooltip-content",
|
|
3807
3941
|
side: "right",
|
|
@@ -3818,7 +3952,7 @@ var Bt = {
|
|
|
3818
3952
|
_: 3
|
|
3819
3953
|
}, 8, ["open"])) : i("", !0);
|
|
3820
3954
|
}
|
|
3821
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
3955
|
+
}), [["__scopeId", "data-v-44377f70"]]), Sr = { class: "TableWrapper" }, Cr = ["href", "download"], wr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3822
3956
|
__name: "DataTable",
|
|
3823
3957
|
props: {
|
|
3824
3958
|
data: {},
|
|
@@ -3923,7 +4057,7 @@ var Bt = {
|
|
|
3923
4057
|
return n.join("\n");
|
|
3924
4058
|
}
|
|
3925
4059
|
function E() {
|
|
3926
|
-
|
|
4060
|
+
Pe(T(), C());
|
|
3927
4061
|
}
|
|
3928
4062
|
let D = n(() => c.downloadButton || c.downloadLink ? [] : [{
|
|
3929
4063
|
label: c.downloadMenuLink,
|
|
@@ -3937,12 +4071,12 @@ var Bt = {
|
|
|
3937
4071
|
"full-width": t.fullWidth,
|
|
3938
4072
|
"has-menu": ne.value
|
|
3939
4073
|
}]) }, [
|
|
3940
|
-
ne.value ? (_(), r(
|
|
4074
|
+
ne.value ? (_(), r(fe, {
|
|
3941
4075
|
key: 0,
|
|
3942
4076
|
items: D.value,
|
|
3943
4077
|
"force-dropdown": ""
|
|
3944
4078
|
}, null, 8, ["items"])) : i("", !0),
|
|
3945
|
-
o("div",
|
|
4079
|
+
o("div", Sr, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
|
|
3946
4080
|
o("colgroup", null, [(_(!0), a(e, null, y(b.value, (e) => (_(), a("col", {
|
|
3947
4081
|
key: e.name,
|
|
3948
4082
|
style: m(u(e.name))
|
|
@@ -3968,9 +4102,9 @@ var Bt = {
|
|
|
3968
4102
|
class: "data-table-download-link",
|
|
3969
4103
|
href: k.value,
|
|
3970
4104
|
download: `${C()}.csv`
|
|
3971
|
-
}, x(O.value), 9,
|
|
4105
|
+
}, x(O.value), 9, Cr)) : i("", !0)
|
|
3972
4106
|
], 2));
|
|
3973
4107
|
}
|
|
3974
4108
|
}), [["__scopeId", "data-v-21721f41"]]);
|
|
3975
4109
|
//#endregion
|
|
3976
|
-
export {
|
|
4110
|
+
export { ar as BarChart, xr as ChartTooltip, br as ChoroplethMap, wr as DataTable, Tn as LineChart };
|