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