@cfasim-ui/charts 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarChart/BarChart.d.ts +10 -0
- package/dist/ChartMenu/ChartMenu.d.ts +2 -0
- package/dist/LineChart/LineChart.d.ts +16 -0
- package/dist/_shared/index.d.ts +2 -1
- package/dist/_shared/useChartFoundation.d.ts +19 -2
- package/dist/_shared/useChartFullscreen.d.ts +16 -0
- package/dist/_shared/useChartMenu.d.ts +10 -2
- package/dist/_shared/useChartPadding.d.ts +24 -4
- package/dist/_shared/useChartSize.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +947 -793
- package/package.json +2 -2
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
|
|
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 A, DropdownMenuRoot as j, DropdownMenuTrigger as M, PopoverAnchor as ne, PopoverContent as N, PopoverPortal as P, PopoverRoot as re } from "reka-ui";
|
|
4
4
|
import { geoAlbersUsa as ie, geoPath as F } from "d3-geo";
|
|
5
5
|
import { zoom as ae, zoomIdentity as oe } from "d3-zoom";
|
|
6
6
|
import { select as I } from "d3-selection";
|
|
7
7
|
import "d3-transition";
|
|
8
8
|
import { feature as se, merge as ce, mesh as le } from "topojson-client";
|
|
9
9
|
//#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var ue = { class: "chart-menu-trigger-area" }, L = ["aria-label"], R = /* @__PURE__ */ l({
|
|
11
11
|
__name: "ChartMenu",
|
|
12
12
|
props: {
|
|
13
13
|
items: {},
|
|
@@ -18,15 +18,15 @@ var L = { class: "chart-menu-trigger-area" }, R = ["aria-label"], z = /* @__PURE
|
|
|
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", ue, [i() ? (_(), r(C(j), {
|
|
22
22
|
key: 1,
|
|
23
23
|
modal: !1
|
|
24
24
|
}, {
|
|
25
|
-
default:
|
|
25
|
+
default: D(() => [c(C(M), {
|
|
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,20 +50,21 @@ var L = { class: "chart-menu-trigger-area" }, R = ["aria-label"], z = /* @__PURE
|
|
|
50
50
|
})
|
|
51
51
|
], -1)]]),
|
|
52
52
|
_: 1
|
|
53
|
-
}), c(
|
|
54
|
-
default:
|
|
53
|
+
}), c(C(A), 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
|
+
"aria-pressed": e.ariaPressed,
|
|
62
63
|
onSelect: e.action
|
|
63
64
|
}, {
|
|
64
|
-
default:
|
|
65
|
+
default: D(() => [s(x(e.label), 1)]),
|
|
65
66
|
_: 2
|
|
66
|
-
}, 1032, ["onSelect"]))), 128))]),
|
|
67
|
+
}, 1032, ["aria-pressed", "onSelect"]))), 128))]),
|
|
67
68
|
_: 1
|
|
68
69
|
})]),
|
|
69
70
|
_: 1
|
|
@@ -84,44 +85,44 @@ var L = { class: "chart-menu-trigger-area" }, R = ["aria-label"], z = /* @__PURE
|
|
|
84
85
|
"stroke-linecap": "round",
|
|
85
86
|
"stroke-linejoin": "round",
|
|
86
87
|
"aria-hidden": "true"
|
|
87
|
-
}, [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, L))]));
|
|
88
89
|
}
|
|
89
|
-
}),
|
|
90
|
+
}), z = (e, t) => {
|
|
90
91
|
let n = e.__vccOpts || e;
|
|
91
92
|
for (let [e, r] of t) n[e] = r;
|
|
92
93
|
return n;
|
|
93
|
-
},
|
|
94
|
+
}, de = /* @__PURE__ */ z(R, [["__scopeId", "data-v-c74e2889"]]);
|
|
94
95
|
//#endregion
|
|
95
96
|
//#region src/_shared/axes.ts
|
|
96
|
-
function
|
|
97
|
+
function B(e) {
|
|
97
98
|
return Math.round(e) + .5;
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
+
function fe(e, t) {
|
|
100
101
|
let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
|
|
101
102
|
return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
+
function pe(e, t, n) {
|
|
104
105
|
if (!(n > 0) || !isFinite(n)) return [];
|
|
105
106
|
let r = [], i = Math.ceil(e / n) * n;
|
|
106
107
|
for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
|
|
107
108
|
return r;
|
|
108
109
|
}
|
|
109
|
-
var
|
|
110
|
-
function
|
|
111
|
-
return Math.abs(e) >= 1e3 ?
|
|
110
|
+
var V = new Intl.NumberFormat();
|
|
111
|
+
function H(e) {
|
|
112
|
+
return Math.abs(e) >= 1e3 ? V.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
|
|
112
113
|
}
|
|
113
114
|
//#endregion
|
|
114
115
|
//#region src/_shared/computeTicks.ts
|
|
115
|
-
function
|
|
116
|
+
function U(e) {
|
|
116
117
|
let { min: t, max: n, ticks: r } = e;
|
|
117
118
|
if (t === n) return [];
|
|
118
119
|
let i = e.displayOffset ?? 0;
|
|
119
120
|
if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
|
|
120
|
-
if (typeof r == "number") return
|
|
121
|
-
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o =
|
|
122
|
-
return
|
|
121
|
+
if (typeof r == "number") return pe(t + i, n + i, r).map((e) => e - i);
|
|
122
|
+
let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = fe(n - t, a);
|
|
123
|
+
return pe(t + i, n + i, o).map((e) => e - i);
|
|
123
124
|
}
|
|
124
|
-
function
|
|
125
|
+
function W(e, t, n, r) {
|
|
125
126
|
if (r === "log") {
|
|
126
127
|
let r = Math.log10(t), i = Math.log10(n) - r || 1;
|
|
127
128
|
return (Math.log10(e > 0 ? e : t) - r) / i;
|
|
@@ -129,7 +130,7 @@ function fe(e, t, n, r) {
|
|
|
129
130
|
let i = n - t || 1;
|
|
130
131
|
return (e - t) / i;
|
|
131
132
|
}
|
|
132
|
-
function
|
|
133
|
+
function me(e, t, n, r) {
|
|
133
134
|
if (n !== "log") return {
|
|
134
135
|
min: e,
|
|
135
136
|
max: t
|
|
@@ -140,7 +141,7 @@ function pe(e, t, n, r) {
|
|
|
140
141
|
max: t > 0 ? Math.max(t, i) : i
|
|
141
142
|
};
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
+
function he(e) {
|
|
144
145
|
let { min: t, max: n, ticks: r } = e;
|
|
145
146
|
if (!(t > 0) || !(n > 0) || t === n) return [];
|
|
146
147
|
if (Array.isArray(r)) return r.filter((e) => e > 0 && e >= t && e <= n);
|
|
@@ -153,25 +154,27 @@ function me(e) {
|
|
|
153
154
|
}
|
|
154
155
|
//#endregion
|
|
155
156
|
//#region src/_shared/useChartSize.ts
|
|
156
|
-
function
|
|
157
|
-
let t = v(null), n = v(0), r =
|
|
157
|
+
function ge(e = {}) {
|
|
158
|
+
let t = v(null), n = v(0), r = v(0), i = null, a = null;
|
|
158
159
|
return h(() => {
|
|
159
|
-
t.value && (n.value = t.value.clientWidth, r = new ResizeObserver((t) => {
|
|
160
|
-
let
|
|
161
|
-
if (!
|
|
162
|
-
let
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}),
|
|
160
|
+
t.value && (n.value = t.value.clientWidth, r.value = t.value.clientHeight, i = new ResizeObserver((t) => {
|
|
161
|
+
let i = t[0];
|
|
162
|
+
if (!i) return;
|
|
163
|
+
let o = () => {
|
|
164
|
+
n.value = i.contentRect.width, r.value = i.contentRect.height;
|
|
165
|
+
}, s = e.debounce?.();
|
|
166
|
+
s ? (a && clearTimeout(a), a = setTimeout(o, s)) : o();
|
|
167
|
+
}), i.observe(t.value));
|
|
167
168
|
}), g(() => {
|
|
168
|
-
|
|
169
|
+
i?.disconnect(), a && clearTimeout(a);
|
|
169
170
|
}), {
|
|
170
171
|
containerRef: t,
|
|
171
|
-
measuredWidth: n
|
|
172
|
+
measuredWidth: n,
|
|
173
|
+
measuredHeight: r
|
|
172
174
|
};
|
|
173
175
|
}
|
|
174
|
-
|
|
176
|
+
var G = 7, _e = 18, ve = 16;
|
|
177
|
+
function K(e) {
|
|
175
178
|
return e == null ? {
|
|
176
179
|
top: 0,
|
|
177
180
|
right: 0,
|
|
@@ -190,37 +193,65 @@ function he(e) {
|
|
|
190
193
|
};
|
|
191
194
|
}
|
|
192
195
|
function q(e) {
|
|
196
|
+
return _e + e.length * G;
|
|
197
|
+
}
|
|
198
|
+
function ye(e) {
|
|
193
199
|
let t = n(() => {
|
|
194
|
-
let t =
|
|
200
|
+
let t = K(e.extraPadding?.());
|
|
201
|
+
return {
|
|
202
|
+
left: (e.yLabel() ? 56 : 50) + t.left,
|
|
203
|
+
right: 10 + t.right
|
|
204
|
+
};
|
|
205
|
+
}), r = n(() => e.width() - t.value.left - t.value.right), i = n(() => {
|
|
206
|
+
let t = e.inlineLegendLabels();
|
|
207
|
+
if (t.length === 0) return {
|
|
208
|
+
positions: [],
|
|
209
|
+
rowCount: 0
|
|
210
|
+
};
|
|
211
|
+
let n = Math.max(0, r.value), i = [], a = 0, o = 0;
|
|
212
|
+
for (let e of t) {
|
|
213
|
+
let t = q(e);
|
|
214
|
+
o > 0 && o + t > n && (a++, o = 0), i.push({
|
|
215
|
+
x: o,
|
|
216
|
+
row: a
|
|
217
|
+
}), o += t + ve;
|
|
218
|
+
}
|
|
195
219
|
return {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
bottom: (e.xLabel() ? 38 : 30) + t.bottom,
|
|
199
|
-
left: (e.yLabel() ? 56 : 50) + t.left
|
|
220
|
+
positions: i,
|
|
221
|
+
rowCount: a + 1
|
|
200
222
|
};
|
|
201
|
-
}),
|
|
223
|
+
}), a = n(() => {
|
|
224
|
+
let n = K(e.extraPadding?.()), r = i.value.rowCount;
|
|
225
|
+
return {
|
|
226
|
+
top: (e.title() ? 26 : 10) + r * 20 + n.top,
|
|
227
|
+
bottom: (e.xLabel() ? 38 : 30) + n.bottom,
|
|
228
|
+
left: t.value.left,
|
|
229
|
+
right: t.value.right
|
|
230
|
+
};
|
|
231
|
+
}), o = n(() => (e.title() ? 26 : 10) + 20 / 2), s = n(() => e.height() - a.value.top - a.value.bottom);
|
|
202
232
|
return {
|
|
203
|
-
padding:
|
|
204
|
-
legendY:
|
|
205
|
-
|
|
206
|
-
|
|
233
|
+
padding: a,
|
|
234
|
+
legendY: o,
|
|
235
|
+
inlineLegendLayout: i,
|
|
236
|
+
innerW: r,
|
|
237
|
+
innerH: s,
|
|
207
238
|
bounds: n(() => {
|
|
208
|
-
let e =
|
|
239
|
+
let e = a.value;
|
|
209
240
|
return {
|
|
210
241
|
left: e.left,
|
|
211
242
|
top: e.top,
|
|
212
|
-
right: e.left +
|
|
213
|
-
bottom: e.top +
|
|
214
|
-
width:
|
|
215
|
-
height:
|
|
243
|
+
right: e.left + r.value,
|
|
244
|
+
bottom: e.top + s.value,
|
|
245
|
+
width: r.value,
|
|
246
|
+
height: s.value
|
|
216
247
|
};
|
|
217
248
|
})
|
|
218
249
|
};
|
|
219
250
|
}
|
|
220
251
|
//#endregion
|
|
221
252
|
//#region src/tooltip-position.ts
|
|
222
|
-
var J = 16,
|
|
223
|
-
function
|
|
253
|
+
var J = 16, Y = 8;
|
|
254
|
+
function be(e, t, n, r, i, a) {
|
|
224
255
|
if (i === "none") return {
|
|
225
256
|
left: e + J,
|
|
226
257
|
top: t
|
|
@@ -235,15 +266,15 @@ function _e(e, t, n, r, i, a) {
|
|
|
235
266
|
right: window.innerWidth,
|
|
236
267
|
top: 0,
|
|
237
268
|
bottom: window.innerHeight
|
|
238
|
-
}, s = e + J + n > o.right -
|
|
269
|
+
}, s = e + J + n > o.right - Y ? e - J - n : e + J, c = r / 2;
|
|
239
270
|
return {
|
|
240
271
|
left: s,
|
|
241
|
-
top: Math.min(Math.max(t, o.top +
|
|
272
|
+
top: Math.min(Math.max(t, o.top + Y + c), o.bottom - Y - c)
|
|
242
273
|
};
|
|
243
274
|
}
|
|
244
275
|
//#endregion
|
|
245
276
|
//#region src/_shared/useChartTooltip.ts
|
|
246
|
-
function
|
|
277
|
+
function xe(e) {
|
|
247
278
|
let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null);
|
|
248
279
|
function s(e) {
|
|
249
280
|
return "touches" in e ? e.touches[0] ?? null : e;
|
|
@@ -257,14 +288,14 @@ function ve(e) {
|
|
|
257
288
|
clientY: r.clientY
|
|
258
289
|
}, e.onHover?.({ index: i }));
|
|
259
290
|
}
|
|
260
|
-
|
|
291
|
+
E([a, n], () => {
|
|
261
292
|
if (n.value === null || !a.value) {
|
|
262
293
|
o.value = null;
|
|
263
294
|
return;
|
|
264
295
|
}
|
|
265
296
|
let s = i.value, c = e.containerRef.value;
|
|
266
297
|
if (!s || !c) return;
|
|
267
|
-
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } =
|
|
298
|
+
let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = be(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
|
|
268
299
|
o.value = {
|
|
269
300
|
left: f - l.left,
|
|
270
301
|
top: p - l.top
|
|
@@ -310,59 +341,103 @@ function ve(e) {
|
|
|
310
341
|
}
|
|
311
342
|
//#endregion
|
|
312
343
|
//#region src/ChartMenu/download.ts
|
|
313
|
-
function
|
|
344
|
+
function X(e, t) {
|
|
314
345
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
315
346
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
316
347
|
}
|
|
317
|
-
var
|
|
348
|
+
var Z = [
|
|
318
349
|
"color",
|
|
319
350
|
"font-family",
|
|
320
351
|
"font-size",
|
|
321
352
|
"font-weight"
|
|
322
|
-
],
|
|
323
|
-
function
|
|
353
|
+
], Se = ["fill", "stroke"];
|
|
354
|
+
function Ce(e) {
|
|
324
355
|
let t = e.match(/^\s*var\(\s*(--[\w-]+)\s*(?:,\s*([^)]*?)\s*)?\)\s*$/);
|
|
325
356
|
if (!t) return e;
|
|
326
357
|
let [, n, r] = t;
|
|
327
358
|
return window.getComputedStyle(document.documentElement).getPropertyValue(n).trim() || (r ? r.trim() : e);
|
|
328
359
|
}
|
|
329
|
-
function
|
|
360
|
+
function we(e) {
|
|
330
361
|
let t = e.cloneNode(!0);
|
|
331
362
|
t.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
332
363
|
let n = window.getComputedStyle(e), r = [];
|
|
333
|
-
for (let e of
|
|
364
|
+
for (let e of Z) {
|
|
334
365
|
let t = n.getPropertyValue(e);
|
|
335
366
|
t && r.push(`${e}: ${t}`);
|
|
336
367
|
}
|
|
337
368
|
let i = t.getAttribute("style") ?? "";
|
|
338
369
|
t.setAttribute("style", [i, ...r].filter(Boolean).join("; "));
|
|
339
|
-
for (let e of t.querySelectorAll("*")) for (let t of
|
|
370
|
+
for (let e of t.querySelectorAll("*")) for (let t of Se) {
|
|
340
371
|
let n = e.getAttribute(t);
|
|
341
|
-
!n || !n.includes("var(") || e.setAttribute(t,
|
|
372
|
+
!n || !n.includes("var(") || e.setAttribute(t, Ce(n));
|
|
342
373
|
}
|
|
343
374
|
return t;
|
|
344
375
|
}
|
|
345
|
-
function
|
|
346
|
-
let n =
|
|
347
|
-
|
|
376
|
+
function Te(e, t) {
|
|
377
|
+
let n = we(e), r = new XMLSerializer().serializeToString(n);
|
|
378
|
+
X(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
|
|
348
379
|
}
|
|
349
|
-
function
|
|
350
|
-
let n =
|
|
380
|
+
function Ee(e, t) {
|
|
381
|
+
let n = we(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;
|
|
351
382
|
o.onload = () => {
|
|
352
383
|
let e = document.createElement("canvas");
|
|
353
384
|
e.width = s * 2, e.height = c * 2;
|
|
354
385
|
let n = e.getContext("2d");
|
|
355
386
|
n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
|
|
356
|
-
e &&
|
|
387
|
+
e && X(e, `${t}.png`);
|
|
357
388
|
}), URL.revokeObjectURL(a);
|
|
358
389
|
}, o.src = a;
|
|
359
390
|
}
|
|
360
391
|
function Q(e, t) {
|
|
361
|
-
|
|
392
|
+
X(new Blob([e], { type: "text/csv" }), `${t}.csv`);
|
|
393
|
+
}
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region src/_shared/useChartFullscreen.ts
|
|
396
|
+
var $ = 0, De = "";
|
|
397
|
+
function Oe() {
|
|
398
|
+
typeof document > "u" || ($ === 0 && (De = document.body.style.overflow, document.body.style.overflow = "hidden"), $++);
|
|
399
|
+
}
|
|
400
|
+
function ke() {
|
|
401
|
+
typeof document > "u" || $ !== 0 && ($--, $ === 0 && (document.body.style.overflow = De));
|
|
402
|
+
}
|
|
403
|
+
function Ae() {
|
|
404
|
+
let e = v(!1), t = !1;
|
|
405
|
+
function r(n) {
|
|
406
|
+
n !== e.value && (e.value = n, n && !t ? (Oe(), t = !0) : !n && t && (ke(), t = !1));
|
|
407
|
+
}
|
|
408
|
+
function i(t) {
|
|
409
|
+
if (t.key !== "Escape" || !e.value) return;
|
|
410
|
+
let n = t.target;
|
|
411
|
+
n instanceof Element && n.closest("[role=\"menu\"], [role=\"dialog\"]") || r(!1);
|
|
412
|
+
}
|
|
413
|
+
function a() {
|
|
414
|
+
r(!0);
|
|
415
|
+
}
|
|
416
|
+
function o() {
|
|
417
|
+
r(!1);
|
|
418
|
+
}
|
|
419
|
+
function s() {
|
|
420
|
+
r(!e.value);
|
|
421
|
+
}
|
|
422
|
+
return h(() => {
|
|
423
|
+
typeof document > "u" || document.addEventListener("keydown", i);
|
|
424
|
+
}), g(() => {
|
|
425
|
+
typeof document > "u" || (document.removeEventListener("keydown", i), t &&= (ke(), !1));
|
|
426
|
+
}), {
|
|
427
|
+
isFullscreen: e,
|
|
428
|
+
toggle: s,
|
|
429
|
+
enter: a,
|
|
430
|
+
exit: o,
|
|
431
|
+
menuItem: n(() => ({
|
|
432
|
+
label: e.value ? "Collapse" : "Expand",
|
|
433
|
+
action: s,
|
|
434
|
+
ariaPressed: e.value
|
|
435
|
+
}))
|
|
436
|
+
};
|
|
362
437
|
}
|
|
363
438
|
//#endregion
|
|
364
439
|
//#region src/_shared/useChartMenu.ts
|
|
365
|
-
function
|
|
440
|
+
function je(e) {
|
|
366
441
|
let t = v(null);
|
|
367
442
|
function r() {
|
|
368
443
|
let t = e.filename();
|
|
@@ -370,36 +445,38 @@ function Ce(e) {
|
|
|
370
445
|
let n = e.legacyMenuLabel();
|
|
371
446
|
return typeof n == "string" ? n : "chart";
|
|
372
447
|
}
|
|
448
|
+
let i = e.fullscreen ? Ae() : null;
|
|
373
449
|
return {
|
|
374
450
|
svgRef: t,
|
|
375
451
|
items: n(() => {
|
|
376
|
-
let n = r(),
|
|
452
|
+
let n = r(), a = [];
|
|
453
|
+
return i && a.push(i.menuItem.value), a.push({
|
|
377
454
|
label: "Save as SVG",
|
|
378
455
|
action: () => {
|
|
379
|
-
t.value &&
|
|
456
|
+
t.value && Te(t.value, n);
|
|
380
457
|
}
|
|
381
458
|
}, {
|
|
382
459
|
label: "Save as PNG",
|
|
383
460
|
action: () => {
|
|
384
|
-
t.value &&
|
|
461
|
+
t.value && Ee(t.value, n);
|
|
385
462
|
}
|
|
386
|
-
}
|
|
387
|
-
return e.downloadLink() || i.push({
|
|
463
|
+
}), e.downloadLink() || a.push({
|
|
388
464
|
label: "Download CSV",
|
|
389
465
|
action: () => Q(e.getCsv(), n)
|
|
390
|
-
}),
|
|
466
|
+
}), a;
|
|
391
467
|
}),
|
|
392
468
|
downloadLinkText: n(() => {
|
|
393
469
|
let t = e.downloadLink();
|
|
394
470
|
return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
|
|
395
471
|
}),
|
|
396
472
|
csvHref: n(() => e.downloadLink() ? `data:text/csv;charset=utf-8,${encodeURIComponent(e.getCsv())}` : null),
|
|
397
|
-
resolvedFilename: r
|
|
473
|
+
resolvedFilename: r,
|
|
474
|
+
isFullscreen: i?.isFullscreen ?? v(!1)
|
|
398
475
|
};
|
|
399
476
|
}
|
|
400
477
|
//#endregion
|
|
401
478
|
//#region src/_shared/seriesCsv.ts
|
|
402
|
-
function
|
|
479
|
+
function Me(e) {
|
|
403
480
|
if (e.length === 0) return "";
|
|
404
481
|
let t = 0;
|
|
405
482
|
for (let n of e) n.data.length > t && (t = n.data.length);
|
|
@@ -411,25 +488,25 @@ function we(e) {
|
|
|
411
488
|
}
|
|
412
489
|
return i.join("\n");
|
|
413
490
|
}
|
|
414
|
-
function
|
|
491
|
+
function Ne(e, t, n = "category") {
|
|
415
492
|
if (t.length === 0 || e.length === 0) return "";
|
|
416
493
|
let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
|
|
417
494
|
for (let n = 0; n < e.length; n++) {
|
|
418
|
-
let i = [
|
|
495
|
+
let i = [Pe(e[n])];
|
|
419
496
|
for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
|
|
420
497
|
r.push(i.join(","));
|
|
421
498
|
}
|
|
422
499
|
return r.join("\n");
|
|
423
500
|
}
|
|
424
|
-
function
|
|
501
|
+
function Pe(e) {
|
|
425
502
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
426
503
|
}
|
|
427
504
|
//#endregion
|
|
428
505
|
//#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
|
|
429
|
-
var
|
|
506
|
+
var Fe = {
|
|
430
507
|
class: "chart-annotations",
|
|
431
508
|
"pointer-events": "none"
|
|
432
|
-
},
|
|
509
|
+
}, Ie = [
|
|
433
510
|
"x1",
|
|
434
511
|
"y1",
|
|
435
512
|
"x2",
|
|
@@ -437,12 +514,12 @@ var De = {
|
|
|
437
514
|
"stroke",
|
|
438
515
|
"stroke-width",
|
|
439
516
|
"stroke-dasharray"
|
|
440
|
-
],
|
|
517
|
+
], Le = [
|
|
441
518
|
"d",
|
|
442
519
|
"stroke",
|
|
443
520
|
"stroke-width",
|
|
444
521
|
"stroke-dasharray"
|
|
445
|
-
],
|
|
522
|
+
], Re = ["fill", "transform"], ze = [
|
|
446
523
|
"x",
|
|
447
524
|
"y",
|
|
448
525
|
"text-anchor",
|
|
@@ -451,7 +528,7 @@ var De = {
|
|
|
451
528
|
"fill",
|
|
452
529
|
"stroke",
|
|
453
530
|
"stroke-width"
|
|
454
|
-
],
|
|
531
|
+
], Be = ["x", "dy"], Ve = ["font-weight", "font-style"], He = 13, Ue = "normal", We = 700, Ge = "var(--color-bg-0, #fff)", Ke = 3, qe = 1, Je = 4, Ye = 6, Xe = 1.2, Ze = .35, Qe = /* @__PURE__ */ l({
|
|
455
532
|
__name: "ChartAnnotations",
|
|
456
533
|
props: {
|
|
457
534
|
annotations: { default: () => [] },
|
|
@@ -488,30 +565,30 @@ var De = {
|
|
|
488
565
|
if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
|
|
489
566
|
let i = t.pointer ?? "curved", a = i.startsWith("rule");
|
|
490
567
|
if (a && !r.bounds) continue;
|
|
491
|
-
let { x: o, y: l } = t.offset, f = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ??
|
|
492
|
-
if (a && r.bounds)
|
|
568
|
+
let { x: o, y: l } = t.offset, f = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? He, g = t.fontWeight ?? Ue, _ = t.haloColor ?? Ge, v = t.haloWidth ?? Ke, y = t.lineColor ?? m, b = t.lineWidth ?? qe, x = s(t.lineDash), ee = t.textAnchor ?? (o > 0 ? "start" : o < 0 ? "end" : "middle"), S, C = "", w, T = !a && (t.arrow ?? !0);
|
|
569
|
+
if (a && r.bounds) S = u(i, n.x, n.y, r.bounds);
|
|
493
570
|
else {
|
|
494
571
|
let e = d(n.x, n.y, f, p, h, i);
|
|
495
|
-
|
|
572
|
+
C = e.path, T && e.arrow && (w = e.arrow);
|
|
496
573
|
}
|
|
497
574
|
e.push({
|
|
498
575
|
lines: t.text.split("\n").map(c),
|
|
499
576
|
textX: f,
|
|
500
577
|
textY: p,
|
|
501
|
-
textAnchor:
|
|
502
|
-
dy: h *
|
|
578
|
+
textAnchor: ee,
|
|
579
|
+
dy: h * Xe,
|
|
503
580
|
fontSize: h,
|
|
504
581
|
fontWeight: g,
|
|
505
582
|
color: m,
|
|
506
583
|
haloColor: _,
|
|
507
584
|
haloWidth: v,
|
|
508
|
-
pointerPath:
|
|
585
|
+
pointerPath: C,
|
|
509
586
|
lineColor: y,
|
|
510
|
-
lineWidth:
|
|
511
|
-
lineDash:
|
|
512
|
-
arrow:
|
|
513
|
-
arrowTip:
|
|
514
|
-
rule:
|
|
587
|
+
lineWidth: b,
|
|
588
|
+
lineDash: x,
|
|
589
|
+
arrow: T,
|
|
590
|
+
arrowTip: w,
|
|
591
|
+
rule: S
|
|
515
592
|
});
|
|
516
593
|
}
|
|
517
594
|
return e;
|
|
@@ -564,11 +641,11 @@ var De = {
|
|
|
564
641
|
}
|
|
565
642
|
function d(e, t, n, r, i, a) {
|
|
566
643
|
if (a === "none") return { path: "" };
|
|
567
|
-
let o = n - e, s = r - t, c = r - i *
|
|
644
|
+
let o = n - e, s = r - t, c = r - i * Ze;
|
|
568
645
|
if (o === 0 || s === 0 || a === "straight") {
|
|
569
646
|
let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
|
|
570
|
-
if (l <=
|
|
571
|
-
let u = a / l, d = o / l, f = e + u *
|
|
647
|
+
if (l <= Je + Ye) return { path: "" };
|
|
648
|
+
let u = a / l, d = o / l, f = e + u * Je, p = t + d * Je, m = n - u * Ye, h = i - d * Ye, g = Math.atan2(-d, -u) * 180 / Math.PI;
|
|
572
649
|
return {
|
|
573
650
|
path: `M${f},${p} L${m},${h}`,
|
|
574
651
|
arrow: {
|
|
@@ -579,8 +656,8 @@ var De = {
|
|
|
579
656
|
};
|
|
580
657
|
}
|
|
581
658
|
let l = c - t;
|
|
582
|
-
if (Math.abs(l) <=
|
|
583
|
-
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d *
|
|
659
|
+
if (Math.abs(l) <= Je || Math.abs(o) <= Ye) return { path: "" };
|
|
660
|
+
let u = Math.sign(o), d = Math.sign(l), f = e, p = t + d * Je, m = n - u * Ye, h = c, g = d > 0 ? -90 : 90;
|
|
584
661
|
return {
|
|
585
662
|
path: `M${f},${p} Q${f},${c} ${m},${h}`,
|
|
586
663
|
arrow: {
|
|
@@ -590,7 +667,7 @@ var De = {
|
|
|
590
667
|
}
|
|
591
668
|
};
|
|
592
669
|
}
|
|
593
|
-
return (t, n) => (_(), a("g",
|
|
670
|
+
return (t, n) => (_(), a("g", Fe, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
|
|
594
671
|
t.rule ? (_(), a("line", {
|
|
595
672
|
key: 0,
|
|
596
673
|
x1: t.rule.x1,
|
|
@@ -601,7 +678,7 @@ var De = {
|
|
|
601
678
|
"stroke-width": t.lineWidth,
|
|
602
679
|
"stroke-dasharray": t.lineDash,
|
|
603
680
|
"stroke-linecap": "round"
|
|
604
|
-
}, null, 8,
|
|
681
|
+
}, null, 8, Ie)) : i("", !0),
|
|
605
682
|
t.pointerPath ? (_(), a("path", {
|
|
606
683
|
key: 1,
|
|
607
684
|
d: t.pointerPath,
|
|
@@ -610,13 +687,13 @@ var De = {
|
|
|
610
687
|
"stroke-width": t.lineWidth,
|
|
611
688
|
"stroke-dasharray": t.lineDash,
|
|
612
689
|
"stroke-linecap": "round"
|
|
613
|
-
}, null, 8,
|
|
690
|
+
}, null, 8, Le)) : i("", !0),
|
|
614
691
|
t.arrowTip ? (_(), a("polygon", {
|
|
615
692
|
key: 2,
|
|
616
693
|
points: "0,0 -6,-3 -6,3",
|
|
617
694
|
fill: t.lineColor,
|
|
618
695
|
transform: `translate(${t.arrowTip.x} ${t.arrowTip.y}) rotate(${t.arrowTip.angle})`
|
|
619
|
-
}, null, 8,
|
|
696
|
+
}, null, 8, Re)) : i("", !0),
|
|
620
697
|
o("text", {
|
|
621
698
|
x: t.textX,
|
|
622
699
|
y: t.textY,
|
|
@@ -634,128 +711,141 @@ var De = {
|
|
|
634
711
|
dy: r === 0 ? 0 : t.dy
|
|
635
712
|
}, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
|
|
636
713
|
key: t,
|
|
637
|
-
"font-weight": e.bold ?
|
|
714
|
+
"font-weight": e.bold ? We : void 0,
|
|
638
715
|
"font-style": e.italic ? "italic" : void 0
|
|
639
|
-
},
|
|
716
|
+
}, x(e.text), 9, Ve))), 128))], 8, Be))), 128))], 8, ze)
|
|
640
717
|
], 64))), 128))]));
|
|
641
718
|
}
|
|
642
|
-
}),
|
|
643
|
-
function
|
|
644
|
-
let { containerRef: t, measuredWidth: r } =
|
|
719
|
+
}), $e = 400, et = 200;
|
|
720
|
+
function tt(e) {
|
|
721
|
+
let { containerRef: t, measuredWidth: r, measuredHeight: i } = ge({ debounce: e.debounce }), { svgRef: a, items: o, downloadLinkText: s, csvHref: c, resolvedFilename: l, isFullscreen: u } = je({
|
|
722
|
+
filename: e.filename,
|
|
723
|
+
legacyMenuLabel: e.menu,
|
|
724
|
+
getCsv: e.getCsv,
|
|
725
|
+
downloadLink: e.downloadLink,
|
|
726
|
+
fullscreen: !0
|
|
727
|
+
}), d = n(() => u.value && r.value > 0 ? r.value : e.width() ?? (r.value || $e)), f = n(() => {
|
|
728
|
+
if (u.value && i.value > 0) {
|
|
729
|
+
let t = e.extraBelowHeight?.() ?? 0;
|
|
730
|
+
return i.value - t;
|
|
731
|
+
}
|
|
732
|
+
return e.height() ?? et;
|
|
733
|
+
}), { padding: p, legendY: m, inlineLegendLayout: h, innerW: g, innerH: _, bounds: v } = ye({
|
|
645
734
|
title: e.title,
|
|
646
735
|
xLabel: e.xLabel,
|
|
647
736
|
yLabel: e.yLabel,
|
|
648
|
-
|
|
649
|
-
width: () =>
|
|
650
|
-
height: () =>
|
|
737
|
+
inlineLegendLabels: e.inlineLegendLabels,
|
|
738
|
+
width: () => d.value,
|
|
739
|
+
height: () => f.value,
|
|
651
740
|
extraPadding: e.chartPadding
|
|
652
|
-
}), { hoverIndex:
|
|
741
|
+
}), { hoverIndex: y, tooltipRef: b, tooltipPos: x, handlers: ee } = xe({
|
|
653
742
|
enabled: e.hasTooltipSlot,
|
|
654
743
|
trigger: e.tooltipTrigger,
|
|
655
744
|
clamp: () => e.tooltipClamp() ?? "chart",
|
|
656
745
|
pointerToIndex: e.pointerToIndex,
|
|
657
746
|
containerRef: t,
|
|
658
747
|
onHover: e.onHover
|
|
659
|
-
}), { svgRef: h, items: g, downloadLinkText: _, csvHref: v, resolvedFilename: y } = Ce({
|
|
660
|
-
filename: e.filename,
|
|
661
|
-
legacyMenuLabel: e.menu,
|
|
662
|
-
getCsv: e.getCsv,
|
|
663
|
-
downloadLink: e.downloadLink
|
|
664
748
|
});
|
|
665
749
|
return {
|
|
666
750
|
containerRef: t,
|
|
667
|
-
svgRef:
|
|
668
|
-
width:
|
|
669
|
-
height:
|
|
670
|
-
padding:
|
|
671
|
-
legendY:
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
751
|
+
svgRef: a,
|
|
752
|
+
width: d,
|
|
753
|
+
height: f,
|
|
754
|
+
padding: p,
|
|
755
|
+
legendY: m,
|
|
756
|
+
inlineLegendLayout: h,
|
|
757
|
+
innerW: g,
|
|
758
|
+
innerH: _,
|
|
759
|
+
bounds: v,
|
|
760
|
+
hoverIndex: y,
|
|
761
|
+
tooltipRef: b,
|
|
762
|
+
tooltipPos: x,
|
|
763
|
+
tooltipHandlers: ee,
|
|
764
|
+
menuItems: o,
|
|
765
|
+
downloadLinkText: s,
|
|
766
|
+
csvHref: c,
|
|
767
|
+
menuFilename: l,
|
|
768
|
+
isFullscreen: u,
|
|
769
|
+
measuredHeight: i
|
|
683
770
|
};
|
|
684
771
|
}
|
|
685
|
-
function
|
|
772
|
+
function nt(e, t) {
|
|
686
773
|
return (n) => {
|
|
687
774
|
let r = e();
|
|
688
|
-
if (r !== void 0) return
|
|
775
|
+
if (r !== void 0) return te(n, r);
|
|
689
776
|
let i = t();
|
|
690
|
-
return i === void 0 ?
|
|
777
|
+
return i === void 0 ? H(n) : te(n, i);
|
|
691
778
|
};
|
|
692
779
|
}
|
|
693
780
|
//#endregion
|
|
694
781
|
//#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
695
|
-
var
|
|
782
|
+
var rt = {
|
|
783
|
+
class: "chart-sr-only",
|
|
784
|
+
"aria-live": "polite"
|
|
785
|
+
}, it = ["width", "height"], at = ["x"], ot = { key: 1 }, st = [
|
|
696
786
|
"x1",
|
|
697
787
|
"y1",
|
|
698
788
|
"x2",
|
|
699
789
|
"y2",
|
|
700
790
|
"stroke",
|
|
701
791
|
"stroke-dasharray"
|
|
702
|
-
],
|
|
792
|
+
], ct = [
|
|
703
793
|
"cx",
|
|
704
794
|
"cy",
|
|
705
795
|
"fill",
|
|
706
796
|
"fill-opacity",
|
|
707
797
|
"stroke"
|
|
708
|
-
],
|
|
798
|
+
], lt = ["x", "y"], ut = [
|
|
709
799
|
"x1",
|
|
710
800
|
"y1",
|
|
711
801
|
"x2",
|
|
712
802
|
"y2"
|
|
713
|
-
],
|
|
803
|
+
], dt = [
|
|
714
804
|
"x1",
|
|
715
805
|
"y1",
|
|
716
806
|
"x2",
|
|
717
807
|
"y2"
|
|
718
|
-
],
|
|
808
|
+
], ft = [
|
|
719
809
|
"x1",
|
|
720
810
|
"y1",
|
|
721
811
|
"x2",
|
|
722
812
|
"y2"
|
|
723
|
-
],
|
|
813
|
+
], pt = [
|
|
724
814
|
"x1",
|
|
725
815
|
"y1",
|
|
726
816
|
"x2",
|
|
727
817
|
"y2"
|
|
728
|
-
],
|
|
818
|
+
], mt = ["x", "y"], ht = ["transform"], gt = [
|
|
729
819
|
"x",
|
|
730
820
|
"y",
|
|
731
821
|
"text-anchor"
|
|
732
|
-
],
|
|
822
|
+
], _t = ["x", "y"], vt = [
|
|
733
823
|
"d",
|
|
734
824
|
"fill",
|
|
735
825
|
"fill-opacity"
|
|
736
|
-
],
|
|
826
|
+
], yt = ["d", "stroke-width"], bt = [
|
|
737
827
|
"d",
|
|
738
828
|
"stroke",
|
|
739
829
|
"stroke-width",
|
|
740
830
|
"stroke-opacity",
|
|
741
831
|
"stroke-dasharray"
|
|
742
|
-
],
|
|
832
|
+
], xt = [
|
|
743
833
|
"cx",
|
|
744
834
|
"cy",
|
|
745
835
|
"r",
|
|
746
836
|
"fill",
|
|
747
837
|
"fill-opacity",
|
|
748
838
|
"stroke"
|
|
749
|
-
],
|
|
839
|
+
], St = [
|
|
750
840
|
"d",
|
|
751
841
|
"fill",
|
|
752
842
|
"fill-opacity"
|
|
753
|
-
],
|
|
843
|
+
], Ct = [
|
|
754
844
|
"d",
|
|
755
845
|
"stroke",
|
|
756
846
|
"stroke-width",
|
|
757
847
|
"stroke-dasharray"
|
|
758
|
-
],
|
|
848
|
+
], wt = [
|
|
759
849
|
"x1",
|
|
760
850
|
"y1",
|
|
761
851
|
"x2",
|
|
@@ -763,7 +853,7 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
763
853
|
"stroke",
|
|
764
854
|
"stroke-width",
|
|
765
855
|
"stroke-dasharray"
|
|
766
|
-
],
|
|
856
|
+
], Tt = [
|
|
767
857
|
"x1",
|
|
768
858
|
"y1",
|
|
769
859
|
"x2",
|
|
@@ -771,44 +861,44 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
771
861
|
"stroke",
|
|
772
862
|
"stroke-width",
|
|
773
863
|
"stroke-dasharray"
|
|
774
|
-
],
|
|
864
|
+
], Et = [
|
|
775
865
|
"x1",
|
|
776
866
|
"y1",
|
|
777
867
|
"x2",
|
|
778
868
|
"y2"
|
|
779
|
-
],
|
|
869
|
+
], Dt = [
|
|
780
870
|
"x1",
|
|
781
871
|
"y1",
|
|
782
872
|
"x2",
|
|
783
873
|
"y2"
|
|
784
|
-
],
|
|
874
|
+
], Ot = [
|
|
785
875
|
"x1",
|
|
786
876
|
"y1",
|
|
787
877
|
"x2",
|
|
788
878
|
"y2"
|
|
789
|
-
],
|
|
879
|
+
], kt = [
|
|
790
880
|
"cx",
|
|
791
881
|
"cy",
|
|
792
882
|
"fill"
|
|
793
|
-
],
|
|
883
|
+
], At = [
|
|
794
884
|
"x",
|
|
795
885
|
"y",
|
|
796
886
|
"width",
|
|
797
887
|
"height"
|
|
798
|
-
],
|
|
888
|
+
], jt = [
|
|
799
889
|
"cx",
|
|
800
890
|
"cy",
|
|
801
891
|
"fill",
|
|
802
892
|
"fill-opacity",
|
|
803
893
|
"stroke"
|
|
804
|
-
],
|
|
894
|
+
], Mt = [
|
|
805
895
|
"x",
|
|
806
896
|
"y",
|
|
807
897
|
"fill"
|
|
808
|
-
],
|
|
898
|
+
], Nt = ["x", "y"], Pt = { class: "line-chart-tooltip" }, Ft = {
|
|
809
899
|
key: 0,
|
|
810
900
|
class: "line-chart-tooltip-label"
|
|
811
|
-
},
|
|
901
|
+
}, It = ["href", "download"], Lt = 36, Rt = 12, zt = 7, Bt = 16, Vt = /* @__PURE__ */ z(/* @__PURE__ */ l({
|
|
812
902
|
__name: "LineChart",
|
|
813
903
|
props: {
|
|
814
904
|
y: {},
|
|
@@ -850,42 +940,42 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
850
940
|
},
|
|
851
941
|
emits: ["hover"],
|
|
852
942
|
setup(t, { emit: c }) {
|
|
853
|
-
let l = t,
|
|
943
|
+
let l = t, h = c, g = [];
|
|
854
944
|
function v(e) {
|
|
855
945
|
return {
|
|
856
946
|
...e,
|
|
857
947
|
data: e.y ?? e.data ?? g
|
|
858
948
|
};
|
|
859
949
|
}
|
|
860
|
-
let
|
|
950
|
+
let S = nt(() => l.tooltipValueFormat, () => l.yTickFormat), w = n(() => {
|
|
861
951
|
if (l.series && l.series.length > 0) return l.series.map(v);
|
|
862
952
|
let e = l.y ?? l.data;
|
|
863
953
|
return e ? [{
|
|
864
954
|
data: e,
|
|
865
955
|
x: l.x
|
|
866
956
|
}] : [];
|
|
867
|
-
}),
|
|
957
|
+
}), T = n(() => l.areas ?? []), E = n(() => {
|
|
868
958
|
let e = 0;
|
|
869
|
-
for (let t of
|
|
870
|
-
for (let t of
|
|
959
|
+
for (let t of w.value) t.data.length > e && (e = t.data.length);
|
|
960
|
+
for (let t of T.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
|
|
871
961
|
return e;
|
|
872
|
-
}),
|
|
873
|
-
function
|
|
962
|
+
}), D = n(() => w.value.some((e) => e.x != null) || T.value.some((e) => e.x != null));
|
|
963
|
+
function O(e, t) {
|
|
874
964
|
return e.x ? Number(e.x[t]) : t;
|
|
875
965
|
}
|
|
876
|
-
function
|
|
966
|
+
function k(e, t) {
|
|
877
967
|
return e.x ? Number(e.x[t]) : t;
|
|
878
968
|
}
|
|
879
|
-
let
|
|
969
|
+
let A = n(() => D.value ? 0 : l.xMin ?? 0), j = n(() => {
|
|
880
970
|
let e = Infinity, t = -Infinity;
|
|
881
|
-
for (let n of
|
|
882
|
-
let i =
|
|
971
|
+
for (let n of w.value) for (let r = 0; r < n.data.length; r++) {
|
|
972
|
+
let i = O(n, r);
|
|
883
973
|
isFinite(i) && (i < e && (e = i), i > t && (t = i));
|
|
884
974
|
}
|
|
885
|
-
for (let n of
|
|
975
|
+
for (let n of T.value) {
|
|
886
976
|
let r = Math.max(n.upper.length, n.lower.length);
|
|
887
977
|
for (let i = 0; i < r; i++) {
|
|
888
|
-
let r =
|
|
978
|
+
let r = k(n, i);
|
|
889
979
|
isFinite(r) && (r < e && (e = r), r > t && (t = r));
|
|
890
980
|
}
|
|
891
981
|
}
|
|
@@ -897,16 +987,16 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
897
987
|
max: 0
|
|
898
988
|
};
|
|
899
989
|
});
|
|
900
|
-
function
|
|
901
|
-
let { min: t, max: n } =
|
|
990
|
+
function M(e) {
|
|
991
|
+
let { min: t, max: n } = j.value, r = n - t || 1;
|
|
902
992
|
return Y.value.left + (e - t) / r * X.value;
|
|
903
993
|
}
|
|
904
|
-
let
|
|
994
|
+
let ne = n(() => {
|
|
905
995
|
let e = Infinity, t = -Infinity, n = Infinity, r = (r) => {
|
|
906
996
|
isFinite(r) && (r < e && (e = r), r > t && (t = r), r > 0 && r < n && (n = r));
|
|
907
997
|
};
|
|
908
|
-
for (let e of
|
|
909
|
-
for (let e of
|
|
998
|
+
for (let e of w.value) for (let t of e.data) r(t);
|
|
999
|
+
for (let e of T.value) {
|
|
910
1000
|
for (let t of e.upper) r(t);
|
|
911
1001
|
for (let t of e.lower) r(t);
|
|
912
1002
|
}
|
|
@@ -916,7 +1006,7 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
916
1006
|
range: 1
|
|
917
1007
|
};
|
|
918
1008
|
l.yMin != null && l.yMin < e && (e = l.yMin);
|
|
919
|
-
let i =
|
|
1009
|
+
let i = me(e, t, l.yScaleType, n);
|
|
920
1010
|
return {
|
|
921
1011
|
min: i.min,
|
|
922
1012
|
max: i.max,
|
|
@@ -924,20 +1014,20 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
924
1014
|
};
|
|
925
1015
|
});
|
|
926
1016
|
function N(e) {
|
|
927
|
-
let { min: t, max: n } =
|
|
928
|
-
return Y.value.top + Z.value -
|
|
1017
|
+
let { min: t, max: n } = ne.value;
|
|
1018
|
+
return Y.value.top + Z.value - W(e, t, n, l.yScaleType) * Z.value;
|
|
929
1019
|
}
|
|
930
1020
|
function P(e) {
|
|
931
1021
|
let t = e.data;
|
|
932
1022
|
if (t.length === 0) return "";
|
|
933
1023
|
let n = "", r = !1;
|
|
934
1024
|
for (let i = 0; i < t.length; i++) {
|
|
935
|
-
let a =
|
|
1025
|
+
let a = O(e, i);
|
|
936
1026
|
if (!isFinite(t[i]) || !isFinite(a)) {
|
|
937
1027
|
r = !1;
|
|
938
1028
|
continue;
|
|
939
1029
|
}
|
|
940
|
-
let o =
|
|
1030
|
+
let o = M(a), s = N(t[i]);
|
|
941
1031
|
n += r ? `L${o},${s}` : `M${o},${s}`, r = !0;
|
|
942
1032
|
}
|
|
943
1033
|
return n;
|
|
@@ -945,9 +1035,9 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
945
1035
|
function re(e) {
|
|
946
1036
|
let t = e.data, n = [];
|
|
947
1037
|
for (let r = 0; r < t.length; r++) {
|
|
948
|
-
let i =
|
|
1038
|
+
let i = O(e, r);
|
|
949
1039
|
!isFinite(t[r]) || !isFinite(i) || n.push({
|
|
950
|
-
x:
|
|
1040
|
+
x: M(i),
|
|
951
1041
|
y: N(t[r])
|
|
952
1042
|
});
|
|
953
1043
|
}
|
|
@@ -957,20 +1047,20 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
957
1047
|
let t = Math.min(e.upper.length, e.lower.length);
|
|
958
1048
|
if (t === 0) return "";
|
|
959
1049
|
let n = [], r = [];
|
|
960
|
-
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(
|
|
1050
|
+
for (let i = 0; i < t; i++) isFinite(e.upper[i]) && isFinite(e.lower[i]) && isFinite(k(e, i)) ? r.push(i) : r.length && (n.push(r), r = []);
|
|
961
1051
|
r.length && n.push(r);
|
|
962
1052
|
let i = "";
|
|
963
1053
|
for (let t of n) {
|
|
964
|
-
i += `M${
|
|
965
|
-
for (let n = 1; n < t.length; n++) i += `L${
|
|
966
|
-
for (let n = t.length - 1; n >= 0; n--) i += `L${
|
|
1054
|
+
i += `M${M(k(e, t[0]))},${N(e.upper[t[0]])}`;
|
|
1055
|
+
for (let n = 1; n < t.length; n++) i += `L${M(k(e, t[n]))},${N(e.upper[t[n]])}`;
|
|
1056
|
+
for (let n = t.length - 1; n >= 0; n--) i += `L${M(k(e, t[n]))},${N(e.lower[t[n]])}`;
|
|
967
1057
|
i += "Z";
|
|
968
1058
|
}
|
|
969
1059
|
return i;
|
|
970
1060
|
}
|
|
971
1061
|
function F(e, t) {
|
|
972
|
-
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null &&
|
|
973
|
-
return
|
|
1062
|
+
let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && w.value[e.seriesIndex] || w.value[0];
|
|
1063
|
+
return M(r ? O(r, n) : n);
|
|
974
1064
|
}
|
|
975
1065
|
function ae(e, t = !0) {
|
|
976
1066
|
let n = Y.value.top + Z.value;
|
|
@@ -978,13 +1068,13 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
978
1068
|
let t = F(e, "start"), r = F(e, "end");
|
|
979
1069
|
return t > r ? "" : `M${t},${Y.value.top}L${r},${Y.value.top}L${r},${n}L${t},${n}Z`;
|
|
980
1070
|
}
|
|
981
|
-
let r =
|
|
1071
|
+
let r = w.value[e.seriesIndex];
|
|
982
1072
|
if (!r) return "";
|
|
983
1073
|
let i = Math.max(0, e.startIndex), a = Math.min(r.data.length - 1, e.endIndex);
|
|
984
1074
|
if (i > a) return "";
|
|
985
|
-
let o = `M${
|
|
986
|
-
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${
|
|
987
|
-
return t && (o += `L${
|
|
1075
|
+
let o = `M${M(O(r, i))},${N(r.data[i])}`;
|
|
1076
|
+
for (let e = i + 1; e <= a; e++) isFinite(r.data[e]) && (o += `L${M(O(r, e))},${N(r.data[e])}`);
|
|
1077
|
+
return t && (o += `L${M(O(r, a))},${n}`, o += `L${M(O(r, i))},${n}`, o += "Z"), o;
|
|
988
1078
|
}
|
|
989
1079
|
let oe = n(() => {
|
|
990
1080
|
let e = l.areaSections;
|
|
@@ -995,7 +1085,7 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
995
1085
|
let t = [], n = Y.value.left + X.value;
|
|
996
1086
|
for (let r of e) {
|
|
997
1087
|
if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
|
|
998
|
-
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) *
|
|
1088
|
+
let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * zt, o = F(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : w.value[r.seriesIndex]?.color ?? "currentColor");
|
|
999
1089
|
t.push({
|
|
1000
1090
|
cx: c,
|
|
1001
1091
|
labelText: e,
|
|
@@ -1010,7 +1100,7 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1010
1100
|
let r = [];
|
|
1011
1101
|
for (let e of t) {
|
|
1012
1102
|
let t = e.cx - e.textWidth / 2, n = 0;
|
|
1013
|
-
for (; n < r.length && !(t >= r[n] +
|
|
1103
|
+
for (; n < r.length && !(t >= r[n] + Bt);) n++;
|
|
1014
1104
|
e.row = n;
|
|
1015
1105
|
let i = e.cx + e.textWidth / 2;
|
|
1016
1106
|
r[n] = Math.max(r[n] ?? -Infinity, i);
|
|
@@ -1020,11 +1110,11 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1020
1110
|
extraHeight: 0
|
|
1021
1111
|
} : {
|
|
1022
1112
|
labels: t,
|
|
1023
|
-
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) *
|
|
1113
|
+
extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Lt + Rt
|
|
1024
1114
|
};
|
|
1025
1115
|
}), I = n(() => {
|
|
1026
1116
|
let e = [];
|
|
1027
|
-
for (let t of
|
|
1117
|
+
for (let t of w.value) !t.legend || t.showInLegend === !1 || e.push({
|
|
1028
1118
|
label: t.legend,
|
|
1029
1119
|
color: t.color ?? "currentColor",
|
|
1030
1120
|
type: "series",
|
|
@@ -1033,7 +1123,7 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1033
1123
|
let t = l.areaSections;
|
|
1034
1124
|
if (t) for (let n of t) {
|
|
1035
1125
|
if (n.legend !== "inline" || !n.label && !n.description) continue;
|
|
1036
|
-
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" :
|
|
1126
|
+
let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : w.value[n.seriesIndex]?.color ?? "currentColor");
|
|
1037
1127
|
e.push({
|
|
1038
1128
|
label: t,
|
|
1039
1129
|
color: r,
|
|
@@ -1042,36 +1132,36 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1042
1132
|
});
|
|
1043
1133
|
}
|
|
1044
1134
|
return e;
|
|
1045
|
-
}), se = n(() =>
|
|
1046
|
-
let { min: e, max: t } =
|
|
1135
|
+
}), se = n(() => I.value.map((e) => e.label)), ce = n(() => J.value + oe.value.extraHeight), le = n(() => Y.value.top + Z.value + Y.value.bottom + Rt), ue = n(() => {
|
|
1136
|
+
let { min: e, max: t } = ne.value, n = (e) => l.yTickFormat === void 0 ? H(e) : te(e, l.yTickFormat);
|
|
1047
1137
|
return e === t ? [{
|
|
1048
1138
|
value: n(e),
|
|
1049
|
-
y:
|
|
1050
|
-
}] : (l.yScaleType === "log" ?
|
|
1139
|
+
y: B(Y.value.top + Z.value / 2)
|
|
1140
|
+
}] : (l.yScaleType === "log" ? he({
|
|
1051
1141
|
min: e,
|
|
1052
1142
|
max: t,
|
|
1053
1143
|
ticks: l.yTicks
|
|
1054
|
-
}) :
|
|
1144
|
+
}) : U({
|
|
1055
1145
|
min: e,
|
|
1056
1146
|
max: t,
|
|
1057
1147
|
ticks: l.yTicks,
|
|
1058
1148
|
targetTickCount: Z.value / 50
|
|
1059
1149
|
})).map((e) => ({
|
|
1060
1150
|
value: n(e),
|
|
1061
|
-
y:
|
|
1151
|
+
y: B(N(e))
|
|
1062
1152
|
}));
|
|
1063
1153
|
}), L = n(() => {
|
|
1064
|
-
let { min: e, max: t } =
|
|
1154
|
+
let { min: e, max: t } = j.value;
|
|
1065
1155
|
if (e === t) return [];
|
|
1066
|
-
let n =
|
|
1156
|
+
let n = A.value, r = E.value, i = (e, t) => {
|
|
1067
1157
|
let r = e + n, i = l.xTickFormat;
|
|
1068
|
-
return i === void 0 ? !
|
|
1158
|
+
return i === void 0 ? !D.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : H(r) : typeof i == "function" ? i(r, t) : te(r, i);
|
|
1069
1159
|
}, a;
|
|
1070
|
-
if (l.xTicks == null && !
|
|
1160
|
+
if (l.xTicks == null && !D.value && l.xLabels && l.xLabels.length === r) {
|
|
1071
1161
|
let e = Math.max(3, Math.floor(X.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
|
|
1072
1162
|
a = [];
|
|
1073
1163
|
for (let e = 0; e < r; e += t) a.push(e);
|
|
1074
|
-
} else a =
|
|
1164
|
+
} else a = U({
|
|
1075
1165
|
min: e,
|
|
1076
1166
|
max: t,
|
|
1077
1167
|
ticks: l.xTicks,
|
|
@@ -1080,7 +1170,7 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1080
1170
|
});
|
|
1081
1171
|
let o = Y.value.left, s = Y.value.left + X.value;
|
|
1082
1172
|
return a.map((e, t) => {
|
|
1083
|
-
let n =
|
|
1173
|
+
let n = B(M(e)), r = "middle";
|
|
1084
1174
|
return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
|
|
1085
1175
|
value: i(e, t),
|
|
1086
1176
|
x: n,
|
|
@@ -1089,72 +1179,78 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1089
1179
|
});
|
|
1090
1180
|
});
|
|
1091
1181
|
function R() {
|
|
1092
|
-
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv :
|
|
1182
|
+
return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : Me(w.value);
|
|
1093
1183
|
}
|
|
1094
|
-
let z = n(() => !!l.tooltipData || !!l.tooltipTrigger),
|
|
1095
|
-
let e =
|
|
1096
|
-
return e === null || !t ? null :
|
|
1097
|
-
}),
|
|
1098
|
-
function
|
|
1184
|
+
let z = n(() => !!l.tooltipData || !!l.tooltipTrigger), fe = n(() => {
|
|
1185
|
+
let e = Ce.value, t = w.value[0];
|
|
1186
|
+
return e === null || !t ? null : O(t, e);
|
|
1187
|
+
}), pe = n(() => fe.value === null ? 0 : M(fe.value));
|
|
1188
|
+
function V(e, t) {
|
|
1099
1189
|
let n = e.data.length;
|
|
1100
1190
|
if (n === 0) return null;
|
|
1101
1191
|
let r = 0, i = Infinity;
|
|
1102
1192
|
for (let a = 0; a < n; a++) {
|
|
1103
|
-
let n =
|
|
1193
|
+
let n = O(e, a);
|
|
1104
1194
|
if (!isFinite(n)) continue;
|
|
1105
1195
|
let o = Math.abs(n - t);
|
|
1106
1196
|
o < i && (i = o, r = a);
|
|
1107
1197
|
}
|
|
1108
1198
|
return i === Infinity ? null : r;
|
|
1109
1199
|
}
|
|
1110
|
-
let
|
|
1111
|
-
let e =
|
|
1200
|
+
let ge = n(() => {
|
|
1201
|
+
let e = fe.value;
|
|
1112
1202
|
if (e === null) return [];
|
|
1113
1203
|
let t = [];
|
|
1114
|
-
for (let n of
|
|
1115
|
-
|
|
1204
|
+
for (let n of w.value) {
|
|
1205
|
+
if (n.showInTooltip === !1) continue;
|
|
1206
|
+
let r = V(n, e);
|
|
1116
1207
|
if (r === null) continue;
|
|
1117
1208
|
let i = n.data[r];
|
|
1118
1209
|
isFinite(i) && t.push({
|
|
1119
|
-
x:
|
|
1210
|
+
x: M(O(n, r)),
|
|
1120
1211
|
y: N(i),
|
|
1121
1212
|
color: n.color ?? "currentColor"
|
|
1122
1213
|
});
|
|
1123
1214
|
}
|
|
1124
1215
|
return t;
|
|
1125
|
-
}),
|
|
1126
|
-
let e =
|
|
1216
|
+
}), G = n(() => {
|
|
1217
|
+
let e = Ce.value, t = fe.value;
|
|
1127
1218
|
if (e === null || t === null) return null;
|
|
1128
|
-
let n = t +
|
|
1129
|
-
|
|
1219
|
+
let n = t + A.value, r, i = l.xTickFormat;
|
|
1220
|
+
r = i === void 0 ? D.value ? H(n) : l.xLabels?.[e] : typeof i == "function" ? i(n, e) : te(n, i);
|
|
1221
|
+
let a = w.value, o = [];
|
|
1222
|
+
for (let e = 0; e < a.length; e++) {
|
|
1223
|
+
let n = a[e];
|
|
1224
|
+
if (n.showInTooltip === !1) continue;
|
|
1225
|
+
let r = V(n, t);
|
|
1226
|
+
o.push({
|
|
1227
|
+
value: r === null ? NaN : Number(n.data[r]),
|
|
1228
|
+
color: n.color ?? "currentColor",
|
|
1229
|
+
seriesIndex: e
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
return {
|
|
1130
1233
|
index: e,
|
|
1131
1234
|
xLabel: r,
|
|
1132
|
-
values:
|
|
1133
|
-
let r = H(e, t);
|
|
1134
|
-
return {
|
|
1135
|
-
value: r === null ? NaN : Number(e.data[r]),
|
|
1136
|
-
color: e.color ?? "currentColor",
|
|
1137
|
-
seriesIndex: n
|
|
1138
|
-
};
|
|
1139
|
-
}),
|
|
1235
|
+
values: o,
|
|
1140
1236
|
data: l.tooltipData?.[e] ?? null
|
|
1141
1237
|
};
|
|
1142
1238
|
});
|
|
1143
|
-
function
|
|
1239
|
+
function _e(e, t) {
|
|
1144
1240
|
return !isFinite(e) || !isFinite(t) ? null : {
|
|
1145
|
-
x:
|
|
1241
|
+
x: M(e - A.value),
|
|
1146
1242
|
y: N(t)
|
|
1147
1243
|
};
|
|
1148
1244
|
}
|
|
1149
|
-
function
|
|
1150
|
-
let t =
|
|
1245
|
+
function ve(e) {
|
|
1246
|
+
let t = K.value?.getBoundingClientRect();
|
|
1151
1247
|
if (!t) return null;
|
|
1152
|
-
let n =
|
|
1248
|
+
let n = w.value[0];
|
|
1153
1249
|
if (!n || n.data.length === 0) return null;
|
|
1154
|
-
let { min: r, max: i } =
|
|
1155
|
-
return
|
|
1250
|
+
let { min: r, max: i } = j.value, a = i - r || 1;
|
|
1251
|
+
return V(n, r + (e - t.left - Y.value.left) / X.value * a);
|
|
1156
1252
|
}
|
|
1157
|
-
let { containerRef:
|
|
1253
|
+
let { containerRef: K, svgRef: q, width: ye, height: J, padding: Y, legendY: be, inlineLegendLayout: xe, innerW: X, innerH: Z, bounds: Se, hoverIndex: Ce, tooltipRef: we, tooltipPos: Te, tooltipHandlers: Ee, menuItems: Q, downloadLinkText: $, csvHref: De, menuFilename: Oe, isFullscreen: ke } = tt({
|
|
1158
1254
|
width: () => l.width,
|
|
1159
1255
|
height: () => l.height,
|
|
1160
1256
|
title: () => l.title,
|
|
@@ -1167,217 +1263,242 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1167
1263
|
filename: () => l.filename,
|
|
1168
1264
|
downloadLink: () => l.downloadLink,
|
|
1169
1265
|
chartPadding: () => l.chartPadding,
|
|
1170
|
-
|
|
1266
|
+
inlineLegendLabels: () => se.value,
|
|
1171
1267
|
hasTooltipSlot: () => z.value,
|
|
1172
1268
|
getCsv: R,
|
|
1173
|
-
pointerToIndex:
|
|
1174
|
-
onHover: (e) =>
|
|
1269
|
+
pointerToIndex: ve,
|
|
1270
|
+
onHover: (e) => h("hover", e),
|
|
1271
|
+
extraBelowHeight: () => oe.value.extraHeight
|
|
1272
|
+
}), Ae = n(() => {
|
|
1273
|
+
let e = xe.value.positions, t = Y.value.left, n = be.value;
|
|
1274
|
+
return I.value.map((r, i) => {
|
|
1275
|
+
let a = e[i];
|
|
1276
|
+
return {
|
|
1277
|
+
...r,
|
|
1278
|
+
x: t + a.x,
|
|
1279
|
+
y: n + a.row * 20
|
|
1280
|
+
};
|
|
1281
|
+
});
|
|
1175
1282
|
});
|
|
1176
1283
|
return (n, c) => (_(), a("div", {
|
|
1177
1284
|
ref_key: "containerRef",
|
|
1178
|
-
ref:
|
|
1179
|
-
class: "line-chart-wrapper"
|
|
1285
|
+
ref: K,
|
|
1286
|
+
class: f(["line-chart-wrapper", { "is-fullscreen": C(ke) }])
|
|
1180
1287
|
}, [
|
|
1181
|
-
t.menu ? (_(), r(
|
|
1288
|
+
t.menu ? (_(), r(de, {
|
|
1182
1289
|
key: 0,
|
|
1183
|
-
items:
|
|
1290
|
+
items: C(Q)
|
|
1184
1291
|
}, null, 8, ["items"])) : i("", !0),
|
|
1292
|
+
o("div", rt, x(C(ke) ? "Chart expanded to fill window" : ""), 1),
|
|
1185
1293
|
(_(), a("svg", {
|
|
1186
1294
|
ref_key: "svgRef",
|
|
1187
|
-
ref:
|
|
1188
|
-
width:
|
|
1189
|
-
height:
|
|
1295
|
+
ref: q,
|
|
1296
|
+
width: C(ye),
|
|
1297
|
+
height: ce.value
|
|
1190
1298
|
}, [
|
|
1191
1299
|
t.title ? (_(), a("text", {
|
|
1192
1300
|
key: 0,
|
|
1193
|
-
x:
|
|
1301
|
+
x: C(ye) / 2,
|
|
1194
1302
|
y: 18,
|
|
1195
1303
|
"text-anchor": "middle",
|
|
1196
1304
|
"font-size": "14",
|
|
1197
1305
|
"font-weight": "600",
|
|
1198
1306
|
fill: "currentColor"
|
|
1199
|
-
},
|
|
1200
|
-
|
|
1307
|
+
}, x(t.title), 9, at)) : i("", !0),
|
|
1308
|
+
Ae.value.length > 0 ? (_(), a("g", ot, [(_(!0), a(e, null, y(Ae.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
|
|
1201
1309
|
key: 0,
|
|
1202
|
-
x1:
|
|
1203
|
-
y1:
|
|
1204
|
-
x2:
|
|
1205
|
-
y2:
|
|
1310
|
+
x1: t.x,
|
|
1311
|
+
y1: t.y,
|
|
1312
|
+
x2: t.x + 12,
|
|
1313
|
+
y2: t.y,
|
|
1206
1314
|
stroke: t.color,
|
|
1207
1315
|
"stroke-width": "2",
|
|
1208
1316
|
"stroke-dasharray": t.dashed ? "4 2" : void 0
|
|
1209
|
-
}, null, 8,
|
|
1317
|
+
}, null, 8, st)) : (_(), a("circle", {
|
|
1210
1318
|
key: 1,
|
|
1211
|
-
cx:
|
|
1212
|
-
cy:
|
|
1319
|
+
cx: t.x + 4,
|
|
1320
|
+
cy: t.y,
|
|
1213
1321
|
r: "4",
|
|
1214
1322
|
fill: t.color,
|
|
1215
1323
|
"fill-opacity": t.fillOpacity,
|
|
1216
1324
|
stroke: t.color,
|
|
1217
1325
|
"stroke-width": "1.5"
|
|
1218
|
-
}, null, 8,
|
|
1219
|
-
x:
|
|
1220
|
-
y:
|
|
1326
|
+
}, null, 8, ct)), o("text", {
|
|
1327
|
+
x: t.x + 18,
|
|
1328
|
+
y: t.y + 4,
|
|
1221
1329
|
"font-size": "11",
|
|
1222
1330
|
fill: "currentColor"
|
|
1223
|
-
},
|
|
1331
|
+
}, x(t.label), 9, lt)], 64))), 128))])) : i("", !0),
|
|
1224
1332
|
o("line", {
|
|
1225
|
-
x1:
|
|
1226
|
-
y1:
|
|
1227
|
-
x2:
|
|
1228
|
-
y2:
|
|
1333
|
+
x1: C(B)(C(Y).left),
|
|
1334
|
+
y1: C(B)(C(Y).top),
|
|
1335
|
+
x2: C(B)(C(Y).left),
|
|
1336
|
+
y2: C(B)(C(Y).top + C(Z)),
|
|
1229
1337
|
stroke: "currentColor",
|
|
1230
1338
|
"stroke-opacity": "0.3"
|
|
1231
|
-
}, null, 8,
|
|
1339
|
+
}, null, 8, ut),
|
|
1232
1340
|
o("line", {
|
|
1233
|
-
x1:
|
|
1234
|
-
y1:
|
|
1235
|
-
x2:
|
|
1236
|
-
y2:
|
|
1341
|
+
x1: C(B)(C(Y).left),
|
|
1342
|
+
y1: C(B)(C(Y).top + C(Z)),
|
|
1343
|
+
x2: C(B)(C(Y).left + C(X)),
|
|
1344
|
+
y2: C(B)(C(Y).top + C(Z)),
|
|
1237
1345
|
stroke: "currentColor",
|
|
1238
1346
|
"stroke-opacity": "0.3"
|
|
1239
|
-
}, null, 8,
|
|
1240
|
-
t.yGrid ? (_(!0), a(e, { key: 2 }, y(
|
|
1347
|
+
}, null, 8, dt),
|
|
1348
|
+
t.yGrid ? (_(!0), a(e, { key: 2 }, y(ue.value, (e, t) => (_(), a("line", {
|
|
1241
1349
|
key: "yg" + t,
|
|
1242
|
-
x1:
|
|
1350
|
+
x1: C(Y).left,
|
|
1243
1351
|
y1: e.y,
|
|
1244
|
-
x2:
|
|
1352
|
+
x2: C(Y).left + C(X),
|
|
1245
1353
|
y2: e.y,
|
|
1246
1354
|
stroke: "currentColor",
|
|
1247
1355
|
"stroke-opacity": "0.1"
|
|
1248
|
-
}, null, 8,
|
|
1356
|
+
}, null, 8, ft))), 128)) : i("", !0),
|
|
1249
1357
|
t.xGrid ? (_(!0), a(e, { key: 3 }, y(L.value, (e, t) => (_(), a("line", {
|
|
1250
1358
|
key: "xg" + t,
|
|
1251
1359
|
x1: e.x,
|
|
1252
|
-
y1:
|
|
1360
|
+
y1: C(Y).top,
|
|
1253
1361
|
x2: e.x,
|
|
1254
|
-
y2:
|
|
1362
|
+
y2: C(Y).top + C(Z),
|
|
1255
1363
|
stroke: "currentColor",
|
|
1256
1364
|
"stroke-opacity": "0.1"
|
|
1257
|
-
}, null, 8,
|
|
1258
|
-
(_(!0), a(e, null, y(
|
|
1365
|
+
}, null, 8, pt))), 128)) : i("", !0),
|
|
1366
|
+
(_(!0), a(e, null, y(ue.value, (e, t) => (_(), a("text", {
|
|
1259
1367
|
key: "y" + t,
|
|
1260
1368
|
"data-testid": "y-tick",
|
|
1261
|
-
x:
|
|
1369
|
+
x: C(Y).left - 6,
|
|
1262
1370
|
y: e.y,
|
|
1263
1371
|
"text-anchor": "end",
|
|
1264
1372
|
"dominant-baseline": "middle",
|
|
1265
1373
|
"font-size": "10",
|
|
1266
1374
|
fill: "currentColor",
|
|
1267
1375
|
"fill-opacity": "0.6"
|
|
1268
|
-
},
|
|
1376
|
+
}, x(e.value), 9, mt))), 128)),
|
|
1269
1377
|
t.yLabel ? (_(), a("text", {
|
|
1270
1378
|
key: 4,
|
|
1271
1379
|
x: 0,
|
|
1272
1380
|
y: 0,
|
|
1273
|
-
transform: `translate(14, ${
|
|
1381
|
+
transform: `translate(14, ${C(Y).top + C(Z) / 2}) rotate(-90)`,
|
|
1274
1382
|
"text-anchor": "middle",
|
|
1275
1383
|
"font-size": "13",
|
|
1276
1384
|
fill: "currentColor"
|
|
1277
|
-
},
|
|
1385
|
+
}, x(t.yLabel), 9, ht)) : i("", !0),
|
|
1278
1386
|
(_(!0), a(e, null, y(L.value, (e, t) => (_(), a("text", {
|
|
1279
1387
|
key: "x" + t,
|
|
1280
1388
|
"data-testid": "x-tick",
|
|
1281
1389
|
x: e.x,
|
|
1282
|
-
y:
|
|
1390
|
+
y: C(Y).top + C(Z) + 16,
|
|
1283
1391
|
"text-anchor": e.anchor,
|
|
1284
1392
|
"font-size": "10",
|
|
1285
1393
|
fill: "currentColor",
|
|
1286
1394
|
"fill-opacity": "0.6"
|
|
1287
|
-
},
|
|
1395
|
+
}, x(e.value), 9, gt))), 128)),
|
|
1288
1396
|
t.xLabel ? (_(), a("text", {
|
|
1289
1397
|
key: 5,
|
|
1290
|
-
x:
|
|
1291
|
-
y:
|
|
1398
|
+
x: C(Y).left + C(X) / 2,
|
|
1399
|
+
y: C(J) - 4,
|
|
1292
1400
|
"text-anchor": "middle",
|
|
1293
1401
|
"font-size": "13",
|
|
1294
1402
|
fill: "currentColor"
|
|
1295
|
-
},
|
|
1296
|
-
(_(!0), a(e, null, y(
|
|
1403
|
+
}, x(t.xLabel), 9, _t)) : i("", !0),
|
|
1404
|
+
(_(!0), a(e, null, y(T.value, (e, t) => (_(), a("path", {
|
|
1297
1405
|
key: "area" + t,
|
|
1298
1406
|
d: ie(e),
|
|
1299
1407
|
fill: e.color ?? "currentColor",
|
|
1300
1408
|
"fill-opacity": e.opacity ?? .2,
|
|
1301
1409
|
stroke: "none"
|
|
1302
|
-
}, null, 8,
|
|
1303
|
-
(_(!0), a(e, null, y(
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1410
|
+
}, null, 8, vt))), 128)),
|
|
1411
|
+
(_(!0), a(e, null, y(w.value, (n, r) => (_(), a(e, { key: r }, [
|
|
1412
|
+
n.line !== !1 && n.outline ? (_(), a("path", {
|
|
1413
|
+
key: 0,
|
|
1414
|
+
d: P(n),
|
|
1415
|
+
fill: "none",
|
|
1416
|
+
stroke: "var(--color-bg-0, #fff)",
|
|
1417
|
+
"stroke-width": (n.strokeWidth ?? 1.5) + 4,
|
|
1418
|
+
"stroke-linecap": "round",
|
|
1419
|
+
"stroke-linejoin": "round",
|
|
1420
|
+
"data-testid": "line-outline"
|
|
1421
|
+
}, null, 8, yt)) : i("", !0),
|
|
1422
|
+
n.line === !1 ? i("", !0) : (_(), a("path", {
|
|
1423
|
+
key: 1,
|
|
1424
|
+
d: P(n),
|
|
1425
|
+
fill: "none",
|
|
1426
|
+
stroke: n.color ?? "currentColor",
|
|
1427
|
+
"stroke-width": n.strokeWidth ?? 1.5,
|
|
1428
|
+
"stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
|
|
1429
|
+
"stroke-dasharray": n.dashed ? "6 3" : void 0
|
|
1430
|
+
}, null, 8, bt)),
|
|
1431
|
+
n.dots ? (_(!0), a(e, { key: 2 }, y(re(n), (e, r) => (_(), a("circle", {
|
|
1432
|
+
key: r,
|
|
1433
|
+
cx: e.x,
|
|
1434
|
+
cy: e.y,
|
|
1435
|
+
r: n.dotRadius ?? (n.strokeWidth ?? 1.5) + 1,
|
|
1436
|
+
fill: n.dotFill ?? n.color ?? "currentColor",
|
|
1437
|
+
"fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
|
|
1438
|
+
stroke: n.dotStroke ?? "none"
|
|
1439
|
+
}, null, 8, xt))), 128)) : i("", !0)
|
|
1440
|
+
], 64))), 128)),
|
|
1320
1441
|
(_(!0), a(e, null, y(t.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
|
|
1321
1442
|
o("path", {
|
|
1322
1443
|
d: ae(t),
|
|
1323
|
-
fill: t.color ?? (t.seriesIndex == null ? "#999" :
|
|
1444
|
+
fill: t.color ?? (t.seriesIndex == null ? "#999" : w.value[t.seriesIndex]?.color ?? "currentColor"),
|
|
1324
1445
|
"fill-opacity": t.opacity ?? .15,
|
|
1325
1446
|
stroke: "none"
|
|
1326
|
-
}, null, 8,
|
|
1447
|
+
}, null, 8, St),
|
|
1327
1448
|
t.seriesIndex == null ? i("", !0) : (_(), a("path", {
|
|
1328
1449
|
key: 0,
|
|
1329
1450
|
d: ae(t, !1),
|
|
1330
1451
|
fill: "none",
|
|
1331
|
-
stroke: t.color ??
|
|
1452
|
+
stroke: t.color ?? w.value[t.seriesIndex]?.color ?? "currentColor",
|
|
1332
1453
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1333
1454
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1334
|
-
}, null, 8,
|
|
1455
|
+
}, null, 8, Ct)),
|
|
1335
1456
|
t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
|
|
1336
|
-
x1:
|
|
1337
|
-
y1:
|
|
1338
|
-
x2:
|
|
1339
|
-
y2:
|
|
1457
|
+
x1: C(B)(F(t, "start")),
|
|
1458
|
+
y1: C(Y).top,
|
|
1459
|
+
x2: C(B)(F(t, "start")),
|
|
1460
|
+
y2: C(Y).top + C(Z),
|
|
1340
1461
|
stroke: t.color ?? "#999",
|
|
1341
1462
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1342
1463
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1343
|
-
}, null, 8,
|
|
1344
|
-
x1:
|
|
1345
|
-
y1:
|
|
1346
|
-
x2:
|
|
1347
|
-
y2:
|
|
1464
|
+
}, null, 8, wt), o("line", {
|
|
1465
|
+
x1: C(B)(F(t, "end")),
|
|
1466
|
+
y1: C(Y).top,
|
|
1467
|
+
x2: C(B)(F(t, "end")),
|
|
1468
|
+
y2: C(Y).top + C(Z),
|
|
1348
1469
|
stroke: t.color ?? "#999",
|
|
1349
1470
|
"stroke-width": t.strokeWidth ?? 2,
|
|
1350
1471
|
"stroke-dasharray": t.dashed ? "6 3" : void 0
|
|
1351
|
-
}, null, 8,
|
|
1472
|
+
}, null, 8, Tt)], 64)) : i("", !0),
|
|
1352
1473
|
o("line", {
|
|
1353
|
-
x1:
|
|
1354
|
-
y1:
|
|
1355
|
-
x2:
|
|
1356
|
-
y2:
|
|
1474
|
+
x1: C(B)(F(t, "start")),
|
|
1475
|
+
y1: C(Y).top + C(Z) - 4,
|
|
1476
|
+
x2: C(B)(F(t, "start")),
|
|
1477
|
+
y2: C(Y).top + C(Z) + 4,
|
|
1357
1478
|
stroke: "currentColor",
|
|
1358
1479
|
"stroke-opacity": "0.4"
|
|
1359
|
-
}, null, 8,
|
|
1480
|
+
}, null, 8, Et),
|
|
1360
1481
|
o("line", {
|
|
1361
|
-
x1:
|
|
1362
|
-
y1:
|
|
1363
|
-
x2:
|
|
1364
|
-
y2:
|
|
1482
|
+
x1: C(B)(F(t, "end")),
|
|
1483
|
+
y1: C(Y).top + C(Z) - 4,
|
|
1484
|
+
x2: C(B)(F(t, "end")),
|
|
1485
|
+
y2: C(Y).top + C(Z) + 4,
|
|
1365
1486
|
stroke: "currentColor",
|
|
1366
1487
|
"stroke-opacity": "0.4"
|
|
1367
|
-
}, null, 8,
|
|
1488
|
+
}, null, 8, Dt)
|
|
1368
1489
|
], 64))), 128)),
|
|
1369
|
-
z.value &&
|
|
1490
|
+
z.value && C(Ce) !== null ? (_(), a("line", {
|
|
1370
1491
|
key: 6,
|
|
1371
|
-
x1:
|
|
1372
|
-
y1:
|
|
1373
|
-
x2:
|
|
1374
|
-
y2:
|
|
1492
|
+
x1: C(B)(pe.value),
|
|
1493
|
+
y1: C(Y).top,
|
|
1494
|
+
x2: C(B)(pe.value),
|
|
1495
|
+
y2: C(Y).top + C(Z),
|
|
1375
1496
|
stroke: "currentColor",
|
|
1376
1497
|
"stroke-opacity": "0.3",
|
|
1377
1498
|
"stroke-dasharray": "4 2",
|
|
1378
1499
|
"pointer-events": "none"
|
|
1379
|
-
}, null, 8,
|
|
1380
|
-
(_(!0), a(e, null, y(
|
|
1500
|
+
}, null, 8, Ot)) : i("", !0),
|
|
1501
|
+
(_(!0), a(e, null, y(ge.value, (e, t) => (_(), a("circle", {
|
|
1381
1502
|
key: "hd" + t,
|
|
1382
1503
|
cx: e.x,
|
|
1383
1504
|
cy: e.y,
|
|
@@ -1386,110 +1507,113 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1386
1507
|
stroke: "var(--color-bg-0, #fff)",
|
|
1387
1508
|
"stroke-width": "2",
|
|
1388
1509
|
"pointer-events": "none"
|
|
1389
|
-
}, null, 8,
|
|
1510
|
+
}, null, 8, kt))), 128)),
|
|
1390
1511
|
z.value ? (_(), a("rect", d({
|
|
1391
1512
|
key: 7,
|
|
1392
|
-
x:
|
|
1393
|
-
y:
|
|
1394
|
-
width:
|
|
1395
|
-
height:
|
|
1513
|
+
x: C(Y).left,
|
|
1514
|
+
y: C(Y).top,
|
|
1515
|
+
width: C(X),
|
|
1516
|
+
height: C(Z),
|
|
1396
1517
|
fill: "transparent",
|
|
1397
1518
|
style: {
|
|
1398
1519
|
cursor: "crosshair",
|
|
1399
1520
|
"touch-action": "none"
|
|
1400
1521
|
}
|
|
1401
|
-
},
|
|
1402
|
-
t.annotations && t.annotations.length > 0 ? (_(), r(
|
|
1522
|
+
}, ee(C(Ee), !0)), null, 16, At)) : i("", !0),
|
|
1523
|
+
t.annotations && t.annotations.length > 0 ? (_(), r(C(Qe), {
|
|
1403
1524
|
key: 8,
|
|
1404
1525
|
annotations: t.annotations,
|
|
1405
|
-
project:
|
|
1406
|
-
bounds:
|
|
1526
|
+
project: _e,
|
|
1527
|
+
bounds: C(Se)
|
|
1407
1528
|
}, null, 8, ["annotations", "bounds"])) : i("", !0),
|
|
1408
1529
|
(_(!0), a(e, null, y(oe.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
|
|
1409
1530
|
o("circle", {
|
|
1410
1531
|
cx: e.cx - e.textWidth / 2 - 2,
|
|
1411
|
-
cy:
|
|
1532
|
+
cy: le.value + e.row * Lt + 4,
|
|
1412
1533
|
r: "4",
|
|
1413
1534
|
fill: e.color,
|
|
1414
1535
|
"fill-opacity": e.fillOpacity,
|
|
1415
1536
|
stroke: e.color,
|
|
1416
1537
|
"stroke-width": "1.5"
|
|
1417
|
-
}, null, 8,
|
|
1538
|
+
}, null, 8, jt),
|
|
1418
1539
|
e.labelText ? (_(), a("text", {
|
|
1419
1540
|
key: 0,
|
|
1420
1541
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1421
|
-
y:
|
|
1542
|
+
y: le.value + e.row * Lt + 8,
|
|
1422
1543
|
"font-size": "11",
|
|
1423
1544
|
"font-weight": "600",
|
|
1424
1545
|
fill: e.color
|
|
1425
|
-
},
|
|
1546
|
+
}, x(e.labelText), 9, Mt)) : i("", !0),
|
|
1426
1547
|
e.descText ? (_(), a("text", {
|
|
1427
1548
|
key: 1,
|
|
1428
1549
|
x: e.cx - e.textWidth / 2 + 8,
|
|
1429
|
-
y:
|
|
1550
|
+
y: le.value + e.row * Lt + 22,
|
|
1430
1551
|
"font-size": "11",
|
|
1431
1552
|
fill: "currentColor",
|
|
1432
1553
|
"fill-opacity": "0.6"
|
|
1433
|
-
},
|
|
1554
|
+
}, x(e.descText), 9, Nt)) : i("", !0)
|
|
1434
1555
|
]))), 128))
|
|
1435
|
-
], 8,
|
|
1436
|
-
z.value &&
|
|
1556
|
+
], 8, it)),
|
|
1557
|
+
z.value && C(Ce) !== null && G.value ? (_(), a("div", {
|
|
1437
1558
|
key: 1,
|
|
1438
1559
|
ref_key: "tooltipRef",
|
|
1439
|
-
ref:
|
|
1560
|
+
ref: we,
|
|
1440
1561
|
class: "chart-tooltip-content",
|
|
1441
1562
|
style: m({
|
|
1442
1563
|
position: "absolute",
|
|
1443
1564
|
top: "0",
|
|
1444
1565
|
left: "0",
|
|
1445
1566
|
willChange: "transform",
|
|
1446
|
-
transform:
|
|
1447
|
-
visibility:
|
|
1567
|
+
transform: C(Te) ? `translate3d(${C(Te).left}px, ${C(Te).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
1568
|
+
visibility: C(Te) ? "visible" : "hidden"
|
|
1448
1569
|
})
|
|
1449
|
-
}, [
|
|
1570
|
+
}, [b(n.$slots, "tooltip", p(u(G.value)), () => [o("div", Pt, [G.value.xLabel ? (_(), a("div", Ft, x(G.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(G.value.values, (e) => (_(), a("div", {
|
|
1450
1571
|
key: e.seriesIndex,
|
|
1451
1572
|
class: "line-chart-tooltip-row"
|
|
1452
1573
|
}, [o("span", {
|
|
1453
1574
|
class: "line-chart-tooltip-swatch",
|
|
1454
1575
|
style: m({ background: e.color })
|
|
1455
|
-
}, null, 4), s(" " +
|
|
1456
|
-
|
|
1576
|
+
}, null, 4), s(" " + x(isFinite(e.value) ? C(S)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
1577
|
+
C($) ? (_(), a("a", {
|
|
1457
1578
|
key: 2,
|
|
1458
1579
|
class: "line-chart-download-link",
|
|
1459
|
-
href:
|
|
1460
|
-
download: `${
|
|
1461
|
-
},
|
|
1462
|
-
],
|
|
1580
|
+
href: C(De),
|
|
1581
|
+
download: `${C(Oe)()}.csv`
|
|
1582
|
+
}, x(C($)), 9, It)) : i("", !0)
|
|
1583
|
+
], 2));
|
|
1463
1584
|
}
|
|
1464
|
-
}), [["__scopeId", "data-v-
|
|
1585
|
+
}), [["__scopeId", "data-v-c1d38be7"]]), Ht = {
|
|
1586
|
+
class: "chart-sr-only",
|
|
1587
|
+
"aria-live": "polite"
|
|
1588
|
+
}, Ut = ["width", "height"], Wt = ["x"], Gt = { key: 1 }, Kt = [
|
|
1465
1589
|
"x",
|
|
1466
1590
|
"y",
|
|
1467
1591
|
"fill"
|
|
1468
|
-
],
|
|
1592
|
+
], qt = ["x", "y"], Jt = [
|
|
1469
1593
|
"x1",
|
|
1470
1594
|
"y1",
|
|
1471
1595
|
"x2",
|
|
1472
1596
|
"y2"
|
|
1473
|
-
],
|
|
1597
|
+
], Yt = [
|
|
1474
1598
|
"x1",
|
|
1475
1599
|
"y1",
|
|
1476
1600
|
"x2",
|
|
1477
1601
|
"y2"
|
|
1478
|
-
],
|
|
1602
|
+
], Xt = [
|
|
1479
1603
|
"x1",
|
|
1480
1604
|
"y1",
|
|
1481
1605
|
"x2",
|
|
1482
1606
|
"y2"
|
|
1483
|
-
],
|
|
1607
|
+
], Zt = [
|
|
1484
1608
|
"x",
|
|
1485
1609
|
"y",
|
|
1486
1610
|
"width",
|
|
1487
1611
|
"height"
|
|
1488
|
-
],
|
|
1612
|
+
], Qt = ["x", "y"], $t = ["x", "y"], en = ["transform"], tn = [
|
|
1489
1613
|
"x",
|
|
1490
1614
|
"y",
|
|
1491
1615
|
"text-anchor"
|
|
1492
|
-
],
|
|
1616
|
+
], nn = ["x", "y"], rn = ["x", "y"], an = [
|
|
1493
1617
|
"data-category",
|
|
1494
1618
|
"data-series",
|
|
1495
1619
|
"x",
|
|
@@ -1498,15 +1622,15 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1498
1622
|
"height",
|
|
1499
1623
|
"fill",
|
|
1500
1624
|
"fill-opacity"
|
|
1501
|
-
],
|
|
1625
|
+
], on = [
|
|
1502
1626
|
"x",
|
|
1503
1627
|
"y",
|
|
1504
1628
|
"width",
|
|
1505
1629
|
"height"
|
|
1506
|
-
],
|
|
1630
|
+
], sn = { class: "bar-chart-tooltip" }, cn = {
|
|
1507
1631
|
key: 0,
|
|
1508
1632
|
class: "bar-chart-tooltip-label"
|
|
1509
|
-
},
|
|
1633
|
+
}, ln = ["href", "download"], un = /* @__PURE__ */ z(/* @__PURE__ */ l({
|
|
1510
1634
|
__name: "BarChart",
|
|
1511
1635
|
props: {
|
|
1512
1636
|
data: {},
|
|
@@ -1548,79 +1672,81 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1548
1672
|
},
|
|
1549
1673
|
emits: ["hover"],
|
|
1550
1674
|
setup(t, { emit: c }) {
|
|
1551
|
-
let l = t,
|
|
1675
|
+
let l = t, h = c, g = [];
|
|
1552
1676
|
function v(e) {
|
|
1553
1677
|
return {
|
|
1554
1678
|
data: e.y ?? e.data ?? g,
|
|
1555
1679
|
color: e.color,
|
|
1556
1680
|
opacity: e.opacity,
|
|
1557
|
-
legend: e.legend
|
|
1681
|
+
legend: e.legend,
|
|
1682
|
+
showInLegend: e.showInLegend,
|
|
1683
|
+
showInTooltip: e.showInTooltip
|
|
1558
1684
|
};
|
|
1559
1685
|
}
|
|
1560
|
-
let
|
|
1686
|
+
let S = n(() => {
|
|
1561
1687
|
if (l.series && l.series.length > 0) return l.series.map(v);
|
|
1562
1688
|
let e = l.y ?? l.data;
|
|
1563
1689
|
return e ? [{ data: e }] : [];
|
|
1564
|
-
}),
|
|
1690
|
+
}), w = n(() => {
|
|
1565
1691
|
let e = l.categories?.length ?? 0;
|
|
1566
|
-
for (let t of
|
|
1692
|
+
for (let t of S.value) t.data.length > e && (e = t.data.length);
|
|
1567
1693
|
return e;
|
|
1568
|
-
}),
|
|
1569
|
-
let e =
|
|
1694
|
+
}), T = n(() => {
|
|
1695
|
+
let e = w.value, t = Array(e);
|
|
1570
1696
|
for (let n = 0; n < e; n++) t[n] = l.categories?.[n] ?? String(n);
|
|
1571
1697
|
return t;
|
|
1572
|
-
}),
|
|
1698
|
+
}), E = n(() => l.orientation === "vertical"), D = n(() => {
|
|
1573
1699
|
let e = Infinity, t = -Infinity, n = Infinity, r = (e) => {
|
|
1574
1700
|
e > 0 && e < n && (n = e);
|
|
1575
1701
|
};
|
|
1576
1702
|
if (l.layout === "stacked") {
|
|
1577
|
-
let n =
|
|
1703
|
+
let n = w.value;
|
|
1578
1704
|
for (let i = 0; i < n; i++) {
|
|
1579
1705
|
let n = 0, a = 0;
|
|
1580
|
-
for (let e of
|
|
1706
|
+
for (let e of S.value) {
|
|
1581
1707
|
if (i >= e.data.length) continue;
|
|
1582
1708
|
let t = Number(e.data[i]);
|
|
1583
1709
|
isFinite(t) && (r(t), t >= 0 ? n += t : a += t);
|
|
1584
1710
|
}
|
|
1585
1711
|
n > t && (t = n), a < e && (e = a);
|
|
1586
1712
|
}
|
|
1587
|
-
} else for (let n of
|
|
1713
|
+
} else for (let n of S.value) for (let i of n.data) {
|
|
1588
1714
|
let n = Number(i);
|
|
1589
1715
|
isFinite(n) && (r(n), n < e && (e = n), n > t && (t = n));
|
|
1590
1716
|
}
|
|
1591
1717
|
isFinite(e) || (e = 0), isFinite(t) || (t = 0);
|
|
1592
1718
|
let i = l.valueMin ?? 0;
|
|
1593
1719
|
l.valueScaleType === "log" ? i > 0 && i < e && (e = i) : i < e && (e = i);
|
|
1594
|
-
let a =
|
|
1720
|
+
let a = me(e, t, l.valueScaleType, n);
|
|
1595
1721
|
return {
|
|
1596
1722
|
min: a.min,
|
|
1597
1723
|
max: a.max,
|
|
1598
1724
|
range: a.max - a.min || 1
|
|
1599
1725
|
};
|
|
1600
|
-
}),
|
|
1601
|
-
let e =
|
|
1602
|
-
return e > 0 ?
|
|
1603
|
-
}),
|
|
1604
|
-
let e =
|
|
1726
|
+
}), O = n(() => E.value ? K.value : q.value), k = n(() => E.value ? q.value : K.value), A = n(() => {
|
|
1727
|
+
let e = w.value;
|
|
1728
|
+
return e > 0 ? O.value / e : 0;
|
|
1729
|
+
}), j = n(() => A.value * (1 - l.barPadding)), M = n(() => {
|
|
1730
|
+
let e = S.value.length;
|
|
1605
1731
|
if (e === 0) return 0;
|
|
1606
|
-
if (l.layout === "stacked" || e === 1) return
|
|
1732
|
+
if (l.layout === "stacked" || e === 1) return j.value;
|
|
1607
1733
|
let t = l.groupGap * (e - 1);
|
|
1608
|
-
return Math.max(1, (
|
|
1734
|
+
return Math.max(1, (j.value - t) / e);
|
|
1609
1735
|
});
|
|
1610
|
-
function
|
|
1611
|
-
return (
|
|
1736
|
+
function ne(e) {
|
|
1737
|
+
return (E.value ? G.value.left : G.value.top) + e * A.value;
|
|
1612
1738
|
}
|
|
1613
1739
|
let N = n(() => {
|
|
1614
|
-
let { min: e, max: t } =
|
|
1740
|
+
let { min: e, max: t } = D.value, n = l.valueMin ?? 0;
|
|
1615
1741
|
return P(Math.max(e, Math.min(t, n)));
|
|
1616
1742
|
});
|
|
1617
1743
|
function P(e) {
|
|
1618
|
-
let { min: t, max: n } =
|
|
1619
|
-
return
|
|
1744
|
+
let { min: t, max: n } = D.value, r = W(e, t, n, l.valueScaleType);
|
|
1745
|
+
return E.value ? G.value.top + q.value - r * q.value : G.value.left + r * K.value;
|
|
1620
1746
|
}
|
|
1621
1747
|
function re(e, t, n, r, i, a, o, s, c) {
|
|
1622
1748
|
let l = Math.min(e, t), u = Math.abs(e - t);
|
|
1623
|
-
return
|
|
1749
|
+
return E.value ? {
|
|
1624
1750
|
x: n,
|
|
1625
1751
|
y: l,
|
|
1626
1752
|
w: r,
|
|
@@ -1643,11 +1769,11 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1643
1769
|
};
|
|
1644
1770
|
}
|
|
1645
1771
|
let ie = n(() => {
|
|
1646
|
-
let e = [], t =
|
|
1772
|
+
let e = [], t = S.value, n = t.length;
|
|
1647
1773
|
if (n === 0) return e;
|
|
1648
|
-
let r =
|
|
1774
|
+
let r = w.value, i = A.value, a = j.value, o = M.value, s = (i - a) / 2, c = N.value;
|
|
1649
1775
|
for (let i = 0; i < r; i++) {
|
|
1650
|
-
let r =
|
|
1776
|
+
let r = ne(i) + s;
|
|
1651
1777
|
if (l.layout === "stacked") {
|
|
1652
1778
|
let o = 0, s = 0;
|
|
1653
1779
|
for (let c = 0; c < n; c++) {
|
|
@@ -1675,32 +1801,32 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1675
1801
|
function ae(e) {
|
|
1676
1802
|
return F[e % F.length];
|
|
1677
1803
|
}
|
|
1678
|
-
let oe =
|
|
1679
|
-
let { min: e, max: t } =
|
|
1804
|
+
let oe = nt(() => l.tooltipValueFormat, () => l.valueTickFormat), I = n(() => {
|
|
1805
|
+
let { min: e, max: t } = D.value, n = (e) => l.valueTickFormat === void 0 ? H(e) : te(e, l.valueTickFormat);
|
|
1680
1806
|
if (e === t) return [{
|
|
1681
1807
|
value: n(e),
|
|
1682
|
-
pos:
|
|
1808
|
+
pos: B(P(e))
|
|
1683
1809
|
}];
|
|
1684
|
-
let r =
|
|
1685
|
-
return (l.valueScaleType === "log" ?
|
|
1810
|
+
let r = E.value ? 50 : 80;
|
|
1811
|
+
return (l.valueScaleType === "log" ? he({
|
|
1686
1812
|
min: e,
|
|
1687
1813
|
max: t,
|
|
1688
1814
|
ticks: l.valueTicks
|
|
1689
|
-
}) :
|
|
1815
|
+
}) : U({
|
|
1690
1816
|
min: e,
|
|
1691
1817
|
max: t,
|
|
1692
1818
|
ticks: l.valueTicks,
|
|
1693
|
-
targetTickCount:
|
|
1819
|
+
targetTickCount: k.value / r
|
|
1694
1820
|
})).map((e) => ({
|
|
1695
1821
|
value: n(e),
|
|
1696
|
-
pos:
|
|
1822
|
+
pos: B(P(e))
|
|
1697
1823
|
}));
|
|
1698
1824
|
}), se = n(() => {
|
|
1699
|
-
let e = [], t =
|
|
1825
|
+
let e = [], t = w.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
|
|
1700
1826
|
for (let r = 0; r < t; r++) {
|
|
1701
|
-
let t =
|
|
1827
|
+
let t = ne(r) + A.value / 2;
|
|
1702
1828
|
e.push({
|
|
1703
|
-
label: n(
|
|
1829
|
+
label: n(T.value[r], r),
|
|
1704
1830
|
pos: t,
|
|
1705
1831
|
anchor: "middle"
|
|
1706
1832
|
});
|
|
@@ -1708,27 +1834,27 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1708
1834
|
return e;
|
|
1709
1835
|
}), ce = n(() => {
|
|
1710
1836
|
let e = [];
|
|
1711
|
-
return
|
|
1712
|
-
t.legend
|
|
1837
|
+
return S.value.forEach((t, n) => {
|
|
1838
|
+
!t.legend || t.showInLegend === !1 || e.push({
|
|
1713
1839
|
label: t.legend,
|
|
1714
1840
|
color: t.color ?? ae(n)
|
|
1715
1841
|
});
|
|
1716
1842
|
}), e;
|
|
1717
|
-
});
|
|
1718
|
-
function
|
|
1843
|
+
}), le = n(() => ce.value.map((e) => e.label));
|
|
1844
|
+
function ue() {
|
|
1719
1845
|
if (typeof l.csv == "function") return l.csv();
|
|
1720
1846
|
if (typeof l.csv == "string") return l.csv;
|
|
1721
|
-
let e =
|
|
1847
|
+
let e = S.value.map((e) => ({
|
|
1722
1848
|
label: e.legend,
|
|
1723
1849
|
data: e.data
|
|
1724
1850
|
}));
|
|
1725
|
-
return
|
|
1851
|
+
return Ne(T.value, e);
|
|
1726
1852
|
}
|
|
1727
1853
|
let L = n(() => !!l.tooltipData || !!l.tooltipTrigger);
|
|
1728
1854
|
function R(e, t) {
|
|
1729
|
-
if (!isFinite(e) || !isFinite(t) ||
|
|
1730
|
-
let n = (
|
|
1731
|
-
return
|
|
1855
|
+
if (!isFinite(e) || !isFinite(t) || A.value === 0) return null;
|
|
1856
|
+
let n = (E.value ? G.value.left : G.value.top) + (e + .5) * A.value, r = P(t);
|
|
1857
|
+
return E.value ? {
|
|
1732
1858
|
x: n,
|
|
1733
1859
|
y: r
|
|
1734
1860
|
} : {
|
|
@@ -1737,14 +1863,14 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1737
1863
|
};
|
|
1738
1864
|
}
|
|
1739
1865
|
function z(e, t) {
|
|
1740
|
-
let n =
|
|
1866
|
+
let n = fe.value?.getBoundingClientRect();
|
|
1741
1867
|
if (!n) return null;
|
|
1742
|
-
let r =
|
|
1743
|
-
if (r === 0 ||
|
|
1744
|
-
let i =
|
|
1745
|
-
return Math.max(0, Math.min(r - 1, Math.floor(i /
|
|
1868
|
+
let r = w.value;
|
|
1869
|
+
if (r === 0 || A.value === 0) return null;
|
|
1870
|
+
let i = E.value ? e - n.left - G.value.left : t - n.top - G.value.top;
|
|
1871
|
+
return Math.max(0, Math.min(r - 1, Math.floor(i / A.value)));
|
|
1746
1872
|
}
|
|
1747
|
-
let { containerRef:
|
|
1873
|
+
let { containerRef: fe, svgRef: pe, width: V, height: ge, padding: G, legendY: _e, inlineLegendLayout: ve, innerW: K, innerH: q, bounds: ye, hoverIndex: J, tooltipRef: Y, tooltipPos: be, tooltipHandlers: xe, menuItems: X, downloadLinkText: Z, csvHref: Se, menuFilename: Ce, isFullscreen: we } = tt({
|
|
1748
1874
|
width: () => l.width,
|
|
1749
1875
|
height: () => l.height,
|
|
1750
1876
|
title: () => l.title,
|
|
@@ -1757,170 +1883,187 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1757
1883
|
filename: () => l.filename,
|
|
1758
1884
|
downloadLink: () => l.downloadLink,
|
|
1759
1885
|
chartPadding: () => l.chartPadding,
|
|
1760
|
-
|
|
1886
|
+
inlineLegendLabels: () => le.value,
|
|
1761
1887
|
hasTooltipSlot: () => L.value,
|
|
1762
|
-
getCsv:
|
|
1888
|
+
getCsv: ue,
|
|
1763
1889
|
pointerToIndex: z,
|
|
1764
|
-
onHover: (e) =>
|
|
1765
|
-
}),
|
|
1766
|
-
let e =
|
|
1767
|
-
if (e !== null) return
|
|
1768
|
-
}),
|
|
1769
|
-
let e =
|
|
1770
|
-
|
|
1890
|
+
onHover: (e) => h("hover", e)
|
|
1891
|
+
}), Te = n(() => {
|
|
1892
|
+
let e = J.value;
|
|
1893
|
+
if (e !== null) return T.value[e];
|
|
1894
|
+
}), Ee = n(() => {
|
|
1895
|
+
let e = J.value;
|
|
1896
|
+
if (e === null) return null;
|
|
1897
|
+
let t = S.value, n = [];
|
|
1898
|
+
for (let r = 0; r < t.length; r++) {
|
|
1899
|
+
let i = t[r];
|
|
1900
|
+
i.showInTooltip !== !1 && n.push({
|
|
1901
|
+
value: Number(i.data[e] ?? NaN),
|
|
1902
|
+
color: i.color ?? ae(r),
|
|
1903
|
+
seriesIndex: r
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
return {
|
|
1771
1907
|
index: e,
|
|
1772
|
-
category:
|
|
1773
|
-
values:
|
|
1774
|
-
value: Number(t.data[e] ?? NaN),
|
|
1775
|
-
color: t.color ?? ae(n),
|
|
1776
|
-
seriesIndex: n
|
|
1777
|
-
})),
|
|
1908
|
+
category: T.value[e] ?? String(e),
|
|
1909
|
+
values: n,
|
|
1778
1910
|
data: l.tooltipData?.[e] ?? null
|
|
1779
1911
|
};
|
|
1780
|
-
}),
|
|
1781
|
-
let e =
|
|
1912
|
+
}), Q = n(() => {
|
|
1913
|
+
let e = J.value;
|
|
1782
1914
|
if (e === null) return null;
|
|
1783
|
-
let t =
|
|
1784
|
-
return
|
|
1915
|
+
let t = ne(e);
|
|
1916
|
+
return E.value ? {
|
|
1785
1917
|
x: t,
|
|
1786
|
-
y:
|
|
1787
|
-
w:
|
|
1788
|
-
h:
|
|
1918
|
+
y: G.value.top,
|
|
1919
|
+
w: A.value,
|
|
1920
|
+
h: q.value
|
|
1789
1921
|
} : {
|
|
1790
|
-
x:
|
|
1922
|
+
x: G.value.left,
|
|
1791
1923
|
y: t,
|
|
1792
|
-
w:
|
|
1793
|
-
h:
|
|
1924
|
+
w: K.value,
|
|
1925
|
+
h: A.value
|
|
1794
1926
|
};
|
|
1927
|
+
}), $ = n(() => {
|
|
1928
|
+
let e = ve.value.positions, t = G.value.left, n = _e.value;
|
|
1929
|
+
return ce.value.map((r, i) => {
|
|
1930
|
+
let a = e[i];
|
|
1931
|
+
return {
|
|
1932
|
+
...r,
|
|
1933
|
+
x: t + a.x,
|
|
1934
|
+
y: n + a.row * 20
|
|
1935
|
+
};
|
|
1936
|
+
});
|
|
1795
1937
|
});
|
|
1796
1938
|
return (n, c) => (_(), a("div", {
|
|
1797
1939
|
ref_key: "containerRef",
|
|
1798
|
-
ref:
|
|
1799
|
-
class: "bar-chart-wrapper"
|
|
1940
|
+
ref: fe,
|
|
1941
|
+
class: f(["bar-chart-wrapper", { "is-fullscreen": C(we) }])
|
|
1800
1942
|
}, [
|
|
1801
|
-
t.menu ? (_(), r(
|
|
1943
|
+
t.menu ? (_(), r(de, {
|
|
1802
1944
|
key: 0,
|
|
1803
|
-
items:
|
|
1945
|
+
items: C(X)
|
|
1804
1946
|
}, null, 8, ["items"])) : i("", !0),
|
|
1947
|
+
o("div", Ht, x(C(we) ? "Chart expanded to fill window" : ""), 1),
|
|
1805
1948
|
(_(), a("svg", {
|
|
1806
1949
|
ref_key: "svgRef",
|
|
1807
|
-
ref:
|
|
1808
|
-
width:
|
|
1809
|
-
height:
|
|
1950
|
+
ref: pe,
|
|
1951
|
+
width: C(V),
|
|
1952
|
+
height: C(ge)
|
|
1810
1953
|
}, [
|
|
1811
1954
|
t.title ? (_(), a("text", {
|
|
1812
1955
|
key: 0,
|
|
1813
|
-
x:
|
|
1956
|
+
x: C(V) / 2,
|
|
1814
1957
|
y: 18,
|
|
1815
1958
|
"text-anchor": "middle",
|
|
1816
1959
|
"font-size": "14",
|
|
1817
1960
|
"font-weight": "600",
|
|
1818
1961
|
fill: "currentColor"
|
|
1819
|
-
},
|
|
1820
|
-
|
|
1821
|
-
x:
|
|
1822
|
-
y:
|
|
1962
|
+
}, x(t.title), 9, Wt)) : i("", !0),
|
|
1963
|
+
$.value.length > 0 ? (_(), a("g", Gt, [(_(!0), a(e, null, y($.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [o("rect", {
|
|
1964
|
+
x: t.x,
|
|
1965
|
+
y: t.y - 5,
|
|
1823
1966
|
width: "12",
|
|
1824
1967
|
height: "10",
|
|
1825
1968
|
fill: t.color
|
|
1826
|
-
}, null, 8,
|
|
1827
|
-
x:
|
|
1828
|
-
y:
|
|
1969
|
+
}, null, 8, Kt), o("text", {
|
|
1970
|
+
x: t.x + 18,
|
|
1971
|
+
y: t.y + 4,
|
|
1829
1972
|
"font-size": "11",
|
|
1830
1973
|
fill: "currentColor"
|
|
1831
|
-
},
|
|
1974
|
+
}, x(t.label), 9, qt)], 64))), 128))])) : i("", !0),
|
|
1832
1975
|
o("line", {
|
|
1833
|
-
x1:
|
|
1834
|
-
y1:
|
|
1835
|
-
x2:
|
|
1836
|
-
y2:
|
|
1976
|
+
x1: C(B)(C(G).left),
|
|
1977
|
+
y1: C(B)(C(G).top),
|
|
1978
|
+
x2: C(B)(C(G).left),
|
|
1979
|
+
y2: C(B)(C(G).top + C(q)),
|
|
1837
1980
|
stroke: "currentColor",
|
|
1838
1981
|
"stroke-opacity": "0.3"
|
|
1839
|
-
}, null, 8,
|
|
1982
|
+
}, null, 8, Jt),
|
|
1840
1983
|
o("line", {
|
|
1841
|
-
x1:
|
|
1842
|
-
y1:
|
|
1843
|
-
x2:
|
|
1844
|
-
y2:
|
|
1984
|
+
x1: C(B)(C(G).left),
|
|
1985
|
+
y1: C(B)(C(G).top + C(q)),
|
|
1986
|
+
x2: C(B)(C(G).left + C(K)),
|
|
1987
|
+
y2: C(B)(C(G).top + C(q)),
|
|
1845
1988
|
stroke: "currentColor",
|
|
1846
1989
|
"stroke-opacity": "0.3"
|
|
1847
|
-
}, null, 8,
|
|
1990
|
+
}, null, 8, Yt),
|
|
1848
1991
|
t.valueGrid ? (_(!0), a(e, { key: 2 }, y(I.value, (e, t) => (_(), a("line", {
|
|
1849
1992
|
key: "vg" + t,
|
|
1850
|
-
x1:
|
|
1851
|
-
y1:
|
|
1852
|
-
x2:
|
|
1853
|
-
y2:
|
|
1993
|
+
x1: E.value ? C(G).left : e.pos,
|
|
1994
|
+
y1: E.value ? e.pos : C(G).top,
|
|
1995
|
+
x2: E.value ? C(G).left + C(K) : e.pos,
|
|
1996
|
+
y2: E.value ? e.pos : C(G).top + C(q),
|
|
1854
1997
|
stroke: "currentColor",
|
|
1855
1998
|
"stroke-opacity": "0.1"
|
|
1856
|
-
}, null, 8,
|
|
1857
|
-
|
|
1999
|
+
}, null, 8, Xt))), 128)) : i("", !0),
|
|
2000
|
+
Q.value && L.value ? (_(), a("rect", {
|
|
1858
2001
|
key: 3,
|
|
1859
|
-
x:
|
|
1860
|
-
y:
|
|
1861
|
-
width:
|
|
1862
|
-
height:
|
|
2002
|
+
x: Q.value.x,
|
|
2003
|
+
y: Q.value.y,
|
|
2004
|
+
width: Q.value.w,
|
|
2005
|
+
height: Q.value.h,
|
|
1863
2006
|
fill: "currentColor",
|
|
1864
2007
|
"fill-opacity": "0.06",
|
|
1865
2008
|
"pointer-events": "none"
|
|
1866
|
-
}, null, 8,
|
|
1867
|
-
|
|
2009
|
+
}, null, 8, Zt)) : i("", !0),
|
|
2010
|
+
E.value ? (_(!0), a(e, { key: 4 }, y(I.value, (e, t) => (_(), a("text", {
|
|
1868
2011
|
key: "vt" + t,
|
|
1869
2012
|
"data-testid": "value-tick",
|
|
1870
|
-
x:
|
|
2013
|
+
x: C(G).left - 6,
|
|
1871
2014
|
y: e.pos,
|
|
1872
2015
|
"text-anchor": "end",
|
|
1873
2016
|
"dominant-baseline": "middle",
|
|
1874
2017
|
"font-size": "10",
|
|
1875
2018
|
fill: "currentColor",
|
|
1876
2019
|
"fill-opacity": "0.6"
|
|
1877
|
-
},
|
|
2020
|
+
}, x(e.value), 9, Qt))), 128)) : (_(!0), a(e, { key: 5 }, y(I.value, (e, t) => (_(), a("text", {
|
|
1878
2021
|
key: "vt" + t,
|
|
1879
2022
|
"data-testid": "value-tick",
|
|
1880
2023
|
x: e.pos,
|
|
1881
|
-
y:
|
|
2024
|
+
y: C(G).top + C(q) + 16,
|
|
1882
2025
|
"text-anchor": "middle",
|
|
1883
2026
|
"font-size": "10",
|
|
1884
2027
|
fill: "currentColor",
|
|
1885
2028
|
"fill-opacity": "0.6"
|
|
1886
|
-
},
|
|
2029
|
+
}, x(e.value), 9, $t))), 128)),
|
|
1887
2030
|
t.yLabel ? (_(), a("text", {
|
|
1888
2031
|
key: 6,
|
|
1889
2032
|
x: 0,
|
|
1890
2033
|
y: 0,
|
|
1891
|
-
transform: `translate(14, ${
|
|
2034
|
+
transform: `translate(14, ${C(G).top + C(q) / 2}) rotate(-90)`,
|
|
1892
2035
|
"text-anchor": "middle",
|
|
1893
2036
|
"font-size": "13",
|
|
1894
2037
|
fill: "currentColor"
|
|
1895
|
-
},
|
|
1896
|
-
|
|
2038
|
+
}, x(t.yLabel), 9, en)) : i("", !0),
|
|
2039
|
+
E.value ? (_(!0), a(e, { key: 7 }, y(se.value, (e, t) => (_(), a("text", {
|
|
1897
2040
|
key: "ct" + t,
|
|
1898
2041
|
"data-testid": "category-tick",
|
|
1899
2042
|
x: e.pos,
|
|
1900
|
-
y:
|
|
2043
|
+
y: C(G).top + C(q) + 16,
|
|
1901
2044
|
"text-anchor": e.anchor,
|
|
1902
2045
|
"font-size": "10",
|
|
1903
2046
|
fill: "currentColor",
|
|
1904
2047
|
"fill-opacity": "0.6"
|
|
1905
|
-
},
|
|
2048
|
+
}, x(e.label), 9, tn))), 128)) : (_(!0), a(e, { key: 8 }, y(se.value, (e, t) => (_(), a("text", {
|
|
1906
2049
|
key: "ct" + t,
|
|
1907
2050
|
"data-testid": "category-tick",
|
|
1908
|
-
x:
|
|
2051
|
+
x: C(G).left - 6,
|
|
1909
2052
|
y: e.pos,
|
|
1910
2053
|
"text-anchor": "end",
|
|
1911
2054
|
"dominant-baseline": "middle",
|
|
1912
2055
|
"font-size": "10",
|
|
1913
2056
|
fill: "currentColor",
|
|
1914
2057
|
"fill-opacity": "0.6"
|
|
1915
|
-
},
|
|
2058
|
+
}, x(e.label), 9, nn))), 128)),
|
|
1916
2059
|
t.xLabel ? (_(), a("text", {
|
|
1917
2060
|
key: 9,
|
|
1918
|
-
x:
|
|
1919
|
-
y:
|
|
2061
|
+
x: C(G).left + C(K) / 2,
|
|
2062
|
+
y: C(ge) - 4,
|
|
1920
2063
|
"text-anchor": "middle",
|
|
1921
2064
|
"font-size": "13",
|
|
1922
2065
|
fill: "currentColor"
|
|
1923
|
-
},
|
|
2066
|
+
}, x(t.xLabel), 9, rn)) : i("", !0),
|
|
1924
2067
|
(_(!0), a(e, null, y(ie.value, (e, t) => (_(), a("rect", {
|
|
1925
2068
|
key: "bar" + t,
|
|
1926
2069
|
"data-testid": "bar",
|
|
@@ -1932,55 +2075,55 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
1932
2075
|
height: e.h,
|
|
1933
2076
|
fill: e.color,
|
|
1934
2077
|
"fill-opacity": e.opacity
|
|
1935
|
-
}, null, 8,
|
|
2078
|
+
}, null, 8, an))), 128)),
|
|
1936
2079
|
L.value ? (_(), a("rect", d({
|
|
1937
2080
|
key: 10,
|
|
1938
|
-
x:
|
|
1939
|
-
y:
|
|
1940
|
-
width:
|
|
1941
|
-
height:
|
|
2081
|
+
x: C(G).left,
|
|
2082
|
+
y: C(G).top,
|
|
2083
|
+
width: C(K),
|
|
2084
|
+
height: C(q),
|
|
1942
2085
|
fill: "transparent",
|
|
1943
2086
|
style: {
|
|
1944
2087
|
cursor: "crosshair",
|
|
1945
2088
|
"touch-action": "none"
|
|
1946
2089
|
}
|
|
1947
|
-
},
|
|
1948
|
-
t.annotations && t.annotations.length > 0 ? (_(), r(
|
|
2090
|
+
}, ee(C(xe), !0)), null, 16, on)) : i("", !0),
|
|
2091
|
+
t.annotations && t.annotations.length > 0 ? (_(), r(C(Qe), {
|
|
1949
2092
|
key: 11,
|
|
1950
2093
|
annotations: t.annotations,
|
|
1951
2094
|
project: R,
|
|
1952
|
-
bounds:
|
|
2095
|
+
bounds: C(ye)
|
|
1953
2096
|
}, null, 8, ["annotations", "bounds"])) : i("", !0)
|
|
1954
|
-
], 8,
|
|
1955
|
-
L.value &&
|
|
2097
|
+
], 8, Ut)),
|
|
2098
|
+
L.value && C(J) !== null && Ee.value ? (_(), a("div", {
|
|
1956
2099
|
key: 1,
|
|
1957
2100
|
ref_key: "tooltipRef",
|
|
1958
|
-
ref:
|
|
2101
|
+
ref: Y,
|
|
1959
2102
|
class: "chart-tooltip-content",
|
|
1960
2103
|
style: m({
|
|
1961
2104
|
position: "absolute",
|
|
1962
2105
|
top: "0",
|
|
1963
2106
|
left: "0",
|
|
1964
2107
|
willChange: "transform",
|
|
1965
|
-
transform:
|
|
1966
|
-
visibility:
|
|
2108
|
+
transform: C(be) ? `translate3d(${C(be).left}px, ${C(be).top}px, 0) translateY(-50%)` : "translateY(-50%)",
|
|
2109
|
+
visibility: C(be) ? "visible" : "hidden"
|
|
1967
2110
|
})
|
|
1968
|
-
}, [
|
|
2111
|
+
}, [b(n.$slots, "tooltip", p(u(Ee.value)), () => [o("div", sn, [Te.value ? (_(), a("div", cn, x(Te.value), 1)) : i("", !0), (_(!0), a(e, null, y(Ee.value.values, (e) => (_(), a("div", {
|
|
1969
2112
|
key: e.seriesIndex,
|
|
1970
2113
|
class: "bar-chart-tooltip-row"
|
|
1971
2114
|
}, [o("span", {
|
|
1972
2115
|
class: "bar-chart-tooltip-swatch",
|
|
1973
2116
|
style: m({ background: e.color })
|
|
1974
|
-
}, null, 4), s(" " +
|
|
1975
|
-
|
|
2117
|
+
}, null, 4), s(" " + x(isFinite(e.value) ? C(oe)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
|
|
2118
|
+
C(Z) ? (_(), a("a", {
|
|
1976
2119
|
key: 2,
|
|
1977
2120
|
class: "bar-chart-download-link",
|
|
1978
|
-
href:
|
|
1979
|
-
download: `${
|
|
1980
|
-
},
|
|
1981
|
-
],
|
|
2121
|
+
href: C(Se),
|
|
2122
|
+
download: `${C(Ce)()}.csv`
|
|
2123
|
+
}, x(C(Z)), 9, ln)) : i("", !0)
|
|
2124
|
+
], 2));
|
|
1982
2125
|
}
|
|
1983
|
-
}), [["__scopeId", "data-v-
|
|
2126
|
+
}), [["__scopeId", "data-v-56a9e529"]]), dn = {
|
|
1984
2127
|
"01013": "010259",
|
|
1985
2128
|
"01015": "010177",
|
|
1986
2129
|
"01029": "010177",
|
|
@@ -5141,7 +5284,7 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
5141
5284
|
51019: "510014",
|
|
5142
5285
|
"02158": "020820",
|
|
5143
5286
|
46102: "460957"
|
|
5144
|
-
},
|
|
5287
|
+
}, fn = {
|
|
5145
5288
|
"010259": "Butler, AL",
|
|
5146
5289
|
"010177": "Calhoun (Anniston), AL - Cleburne, AL",
|
|
5147
5290
|
"010172": "Chambers, AL - Randolph, AL",
|
|
@@ -6091,7 +6234,7 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6091
6234
|
560775: "Teton, WY - Lincoln, WY",
|
|
6092
6235
|
560792: "Uinta, WY",
|
|
6093
6236
|
560804: "Weston, WY"
|
|
6094
|
-
},
|
|
6237
|
+
}, pn = {
|
|
6095
6238
|
ref: "root",
|
|
6096
6239
|
class: "chart-tooltip-content",
|
|
6097
6240
|
style: {
|
|
@@ -6103,10 +6246,10 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6103
6246
|
"pointer-events": "none",
|
|
6104
6247
|
transform: "translateY(-50%)"
|
|
6105
6248
|
}
|
|
6106
|
-
},
|
|
6249
|
+
}, mn = /* @__PURE__ */ l({
|
|
6107
6250
|
__name: "ChoroplethTooltip",
|
|
6108
6251
|
setup(e, { expose: n }) {
|
|
6109
|
-
let a = v(null), s =
|
|
6252
|
+
let a = v(null), s = T("root");
|
|
6110
6253
|
return n({
|
|
6111
6254
|
setData(e) {
|
|
6112
6255
|
a.value = e;
|
|
@@ -6114,24 +6257,27 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6114
6257
|
getEl() {
|
|
6115
6258
|
return s.value;
|
|
6116
6259
|
}
|
|
6117
|
-
}), (e, n) => (_(), r(t, { to: "body" }, [o("div",
|
|
6260
|
+
}), (e, n) => (_(), r(t, { to: "body" }, [o("div", pn, [a.value ? b(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
|
|
6118
6261
|
}
|
|
6119
|
-
}),
|
|
6262
|
+
}), hn = {
|
|
6263
|
+
class: "chart-sr-only",
|
|
6264
|
+
"aria-live": "polite"
|
|
6265
|
+
}, gn = {
|
|
6120
6266
|
key: 1,
|
|
6121
6267
|
class: "choropleth-header"
|
|
6122
|
-
},
|
|
6268
|
+
}, _n = {
|
|
6123
6269
|
key: 0,
|
|
6124
6270
|
class: "choropleth-title"
|
|
6125
|
-
},
|
|
6271
|
+
}, vn = {
|
|
6126
6272
|
key: 1,
|
|
6127
6273
|
class: "choropleth-legend"
|
|
6128
|
-
},
|
|
6274
|
+
}, yn = {
|
|
6129
6275
|
key: 0,
|
|
6130
6276
|
class: "choropleth-legend-title"
|
|
6131
|
-
},
|
|
6277
|
+
}, bn = {
|
|
6132
6278
|
key: 2,
|
|
6133
6279
|
class: "choropleth-legend-continuous"
|
|
6134
|
-
},
|
|
6280
|
+
}, xn = { class: "choropleth-legend-ticks" }, Sn = ["viewBox"], Cn = ["innerHTML"], wn = "http://www.w3.org/2000/svg", Tn = 450, En = 1e3, Dn = /* @__PURE__ */ z(/* @__PURE__ */ l({
|
|
6135
6281
|
__name: "ChoroplethMap",
|
|
6136
6282
|
props: {
|
|
6137
6283
|
topology: {},
|
|
@@ -6175,56 +6321,56 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6175
6321
|
"update:focus"
|
|
6176
6322
|
],
|
|
6177
6323
|
setup(t, { emit: c }) {
|
|
6178
|
-
let l = t, d = c,
|
|
6324
|
+
let l = t, d = c, ee = (e) => e, T = v(null), O = v(null), k = v(null), A = v(null), j = v(null), M = v(null), ne = w(), N = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!ne.tooltip), P = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), ue = null, L = null, R = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map(), B = !1, fe = typeof window < "u" && "ontouchstart" in window, pe = null, V = {
|
|
6179
6325
|
width: 0,
|
|
6180
6326
|
height: 0
|
|
6181
|
-
},
|
|
6182
|
-
function
|
|
6183
|
-
if (
|
|
6184
|
-
let e =
|
|
6185
|
-
e && (e.addEventListener("click",
|
|
6327
|
+
}, H = null, U = !1, W = null, me = v(!1), he = 0, ge = 0, G = 0;
|
|
6328
|
+
function _e() {
|
|
6329
|
+
if (fe) return;
|
|
6330
|
+
let e = k.value;
|
|
6331
|
+
e && (e.addEventListener("click", ut), e.addEventListener("mouseover", ut), e.addEventListener("mousemove", dt), e.addEventListener("mouseout", ft));
|
|
6186
6332
|
}
|
|
6187
|
-
function
|
|
6188
|
-
let e =
|
|
6189
|
-
e && (e.removeEventListener("click",
|
|
6333
|
+
function ve() {
|
|
6334
|
+
let e = k.value;
|
|
6335
|
+
e && (e.removeEventListener("click", ut), e.removeEventListener("mouseover", ut), e.removeEventListener("mousemove", dt), e.removeEventListener("mouseout", ft));
|
|
6190
6336
|
}
|
|
6191
|
-
function
|
|
6192
|
-
|
|
6337
|
+
function K() {
|
|
6338
|
+
ct();
|
|
6193
6339
|
}
|
|
6194
6340
|
h(() => {
|
|
6195
|
-
|
|
6341
|
+
q(), _e(), mt(), X(), $e(), window.addEventListener("scroll", K, {
|
|
6196
6342
|
passive: !0,
|
|
6197
6343
|
capture: !0
|
|
6198
|
-
}), window.addEventListener("resize",
|
|
6344
|
+
}), window.addEventListener("resize", K, { passive: !0 });
|
|
6199
6345
|
}), g(() => {
|
|
6200
|
-
|
|
6346
|
+
pe?.disconnect(), G && cancelAnimationFrame(G), ye(), ve(), window.removeEventListener("scroll", K, { capture: !0 }), window.removeEventListener("resize", K);
|
|
6201
6347
|
});
|
|
6202
|
-
function
|
|
6203
|
-
if (!
|
|
6204
|
-
let e = I(
|
|
6205
|
-
|
|
6206
|
-
B = !0,
|
|
6348
|
+
function q() {
|
|
6349
|
+
if (!O.value || !k.value) return;
|
|
6350
|
+
let e = I(O.value), t = Math.max(12, l.focusZoomLevel);
|
|
6351
|
+
W = ae().scaleExtent([1, t]).on("start", () => {
|
|
6352
|
+
B = !0, ct();
|
|
6207
6353
|
}).on("zoom", (e) => {
|
|
6208
|
-
|
|
6354
|
+
k.value && k.value.setAttribute("transform", e.transform);
|
|
6209
6355
|
let t = e.transform;
|
|
6210
|
-
|
|
6356
|
+
me.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
|
|
6211
6357
|
}).on("end", () => {
|
|
6212
6358
|
B = !1;
|
|
6213
|
-
}),
|
|
6214
|
-
let t =
|
|
6359
|
+
}), W.filter((e) => {
|
|
6360
|
+
let t = Ie.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
|
|
6215
6361
|
if (e.type === "wheel" || e.type === "dblclick") {
|
|
6216
6362
|
if (!n) return !1;
|
|
6217
6363
|
} else if (e.type === "mousedown" || e.type === "touchstart") {
|
|
6218
6364
|
if (!r) return !1;
|
|
6219
6365
|
} else if (!n && !r) return !1;
|
|
6220
6366
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
6221
|
-
}), e.call(
|
|
6367
|
+
}), e.call(W);
|
|
6222
6368
|
}
|
|
6223
|
-
function
|
|
6224
|
-
|
|
6369
|
+
function ye() {
|
|
6370
|
+
O.value && W && (I(O.value).on(".zoom", null), W = null);
|
|
6225
6371
|
}
|
|
6226
|
-
function
|
|
6227
|
-
let t =
|
|
6372
|
+
function J(e) {
|
|
6373
|
+
let t = Le.value, n = Ne.value, r = [];
|
|
6228
6374
|
for (let i of e) {
|
|
6229
6375
|
let e = i.geoType ?? l.geoType, a = t.get(e);
|
|
6230
6376
|
if (!a) continue;
|
|
@@ -6242,74 +6388,74 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6242
6388
|
}
|
|
6243
6389
|
return r;
|
|
6244
6390
|
}
|
|
6245
|
-
function
|
|
6391
|
+
function Y(e) {
|
|
6246
6392
|
let t = /* @__PURE__ */ new Set();
|
|
6247
|
-
for (let n of
|
|
6393
|
+
for (let n of J(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
|
|
6248
6394
|
return t;
|
|
6249
6395
|
}
|
|
6250
|
-
let
|
|
6251
|
-
function
|
|
6252
|
-
if (!
|
|
6253
|
-
let e =
|
|
6396
|
+
let xe = !1;
|
|
6397
|
+
function X() {
|
|
6398
|
+
if (!O.value || !W) return;
|
|
6399
|
+
let e = J(Ie.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
|
|
6254
6400
|
for (let e of t) {
|
|
6255
|
-
let t =
|
|
6401
|
+
let t = P.get(String(e.feature.id));
|
|
6256
6402
|
t && r.set(t, e.item.style ?? "solid");
|
|
6257
6403
|
}
|
|
6258
|
-
for (let [e] of R) r.has(e) || e === L ||
|
|
6259
|
-
for (let [e, t] of r) R.get(e) === t && e !== L || e !== L &&
|
|
6404
|
+
for (let [e] of R) r.has(e) || e === L || ot(e);
|
|
6405
|
+
for (let [e, t] of r) R.get(e) === t && e !== L || e !== L && at(e, t);
|
|
6260
6406
|
R.clear();
|
|
6261
6407
|
for (let [e, t] of r) R.set(e, t);
|
|
6262
|
-
if (
|
|
6263
|
-
|
|
6408
|
+
if (Z(n), e.length === 0) {
|
|
6409
|
+
xe = !0, ct();
|
|
6264
6410
|
return;
|
|
6265
6411
|
}
|
|
6266
|
-
let i = I(
|
|
6412
|
+
let i = I(O.value);
|
|
6267
6413
|
i.interrupt();
|
|
6268
|
-
let a =
|
|
6269
|
-
|
|
6270
|
-
let [[o, s], [c, u]] =
|
|
6414
|
+
let a = xe;
|
|
6415
|
+
xe = !0;
|
|
6416
|
+
let [[o, s], [c, u]] = je.value.bounds({
|
|
6271
6417
|
type: "FeatureCollection",
|
|
6272
6418
|
features: e.map((e) => e.feature)
|
|
6273
|
-
}), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = oe.translate(we.value / 2 - p * d,
|
|
6274
|
-
if (!
|
|
6275
|
-
let e = String(h.id), t =
|
|
6419
|
+
}), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = oe.translate(we.value / 2 - p * d, Q.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, g = () => {
|
|
6420
|
+
if (!N.value || !h) return;
|
|
6421
|
+
let e = String(h.id), t = P.get(e);
|
|
6276
6422
|
if (!t) return;
|
|
6277
6423
|
let n = t.getBoundingClientRect();
|
|
6278
|
-
|
|
6424
|
+
tt(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
6279
6425
|
};
|
|
6280
|
-
a ? (
|
|
6426
|
+
a ? (rt(), i.transition().duration(Tn).call(W.transform, m).on("end", g)) : (W.transform(i, m), g());
|
|
6281
6427
|
}
|
|
6282
|
-
function
|
|
6283
|
-
let t =
|
|
6428
|
+
function Z(e) {
|
|
6429
|
+
let t = j.value;
|
|
6284
6430
|
if (!t) return;
|
|
6285
6431
|
let n = new Set(e.map((e) => e.key));
|
|
6286
6432
|
for (let [e, t] of z) n.has(e) || (t.remove(), z.delete(e));
|
|
6287
|
-
let r =
|
|
6433
|
+
let r = je.value, i = Me.value + 1.5;
|
|
6288
6434
|
for (let { item: n, feature: a, key: o } of e) {
|
|
6289
6435
|
let e = z.get(o);
|
|
6290
|
-
e || (e = document.createElementNS(
|
|
6436
|
+
e || (e = document.createElementNS(wn, "path"), e.setAttribute("d", r(a) ?? ""), e.setAttribute("fill", "none"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("class", "focus-overlay"), t.appendChild(e), z.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), it(e, n.style);
|
|
6291
6437
|
}
|
|
6292
6438
|
}
|
|
6293
|
-
function
|
|
6294
|
-
if (!
|
|
6295
|
-
|
|
6296
|
-
let e = I(
|
|
6297
|
-
e.interrupt(),
|
|
6439
|
+
function Se() {
|
|
6440
|
+
if (!O.value || !W) return;
|
|
6441
|
+
Ie.value.length > 0 && d("update:focus", null);
|
|
6442
|
+
let e = I(O.value);
|
|
6443
|
+
e.interrupt(), rt(), e.transition().duration(Tn).call(W.transform, oe);
|
|
6298
6444
|
}
|
|
6299
|
-
|
|
6300
|
-
|
|
6445
|
+
E(() => l.focusZoomLevel, () => {
|
|
6446
|
+
W && W.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), X();
|
|
6301
6447
|
});
|
|
6302
|
-
let Ce = n(() => l.width && l.height ? l.height / l.width : .625), we = n(() =>
|
|
6303
|
-
let e =
|
|
6448
|
+
let Ce = n(() => l.width && l.height ? l.height / l.width : .625), we = n(() => En), Q = n(() => En * Ce.value), $ = n(() => {
|
|
6449
|
+
let e = S(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
|
|
6304
6450
|
for (let e of t) {
|
|
6305
|
-
let t =
|
|
6451
|
+
let t = dn[String(e.id).padStart(5, "0")];
|
|
6306
6452
|
t && (n.has(t) || n.set(t, []), n.get(t).push(e));
|
|
6307
6453
|
}
|
|
6308
6454
|
let r = [];
|
|
6309
6455
|
for (let [t, i] of n) r.push({
|
|
6310
6456
|
type: "Feature",
|
|
6311
6457
|
id: t,
|
|
6312
|
-
properties: { name:
|
|
6458
|
+
properties: { name: fn[t] ?? t },
|
|
6313
6459
|
geometry: ce(e, i)
|
|
6314
6460
|
});
|
|
6315
6461
|
return {
|
|
@@ -6317,43 +6463,43 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6317
6463
|
features: r
|
|
6318
6464
|
};
|
|
6319
6465
|
}), De = n(() => {
|
|
6320
|
-
if (l.geoType === "hsas") return
|
|
6466
|
+
if (l.geoType === "hsas") return $.value;
|
|
6321
6467
|
if (l.geoType === "counties") {
|
|
6322
|
-
let e =
|
|
6468
|
+
let e = S(l.topology);
|
|
6323
6469
|
return se(e, e.objects.counties);
|
|
6324
6470
|
}
|
|
6325
|
-
let e =
|
|
6471
|
+
let e = S(l.topology);
|
|
6326
6472
|
return se(e, e.objects.states);
|
|
6327
6473
|
}), Oe = n(() => {
|
|
6328
6474
|
if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
|
|
6329
|
-
let e =
|
|
6475
|
+
let e = S(l.topology);
|
|
6330
6476
|
return le(e, e.objects.states, (e, t) => e !== t);
|
|
6331
|
-
}), ke = n(() => ie().fitExtent([[0, 0], [we.value,
|
|
6477
|
+
}), ke = n(() => ie().fitExtent([[0, 0], [we.value, Q.value]], De.value)), je = n(() => F(ke.value)), Me = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), Ne = n(() => {
|
|
6332
6478
|
let e = /* @__PURE__ */ new Map();
|
|
6333
|
-
for (let [t, n] of
|
|
6479
|
+
for (let [t, n] of Le.value) {
|
|
6334
6480
|
let r = /* @__PURE__ */ new Map();
|
|
6335
6481
|
for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
|
|
6336
6482
|
e.set(t, r);
|
|
6337
6483
|
}
|
|
6338
6484
|
return e;
|
|
6339
6485
|
});
|
|
6340
|
-
function
|
|
6486
|
+
function Pe(e) {
|
|
6341
6487
|
let t = l.dataGeoType;
|
|
6342
6488
|
if (!t || t === l.geoType) return e;
|
|
6343
|
-
if (l.geoType === "counties" && t === "hsas") return
|
|
6489
|
+
if (l.geoType === "counties" && t === "hsas") return dn[e];
|
|
6344
6490
|
if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
|
|
6345
6491
|
}
|
|
6346
|
-
let
|
|
6492
|
+
let Fe = n(() => {
|
|
6347
6493
|
let e = /* @__PURE__ */ new Map();
|
|
6348
6494
|
for (let t of De.value.features) t.id != null && e.set(String(t.id), t);
|
|
6349
6495
|
return e;
|
|
6350
|
-
}),
|
|
6496
|
+
}), Ie = n(() => {
|
|
6351
6497
|
let e = l.focus;
|
|
6352
6498
|
return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
|
|
6353
|
-
}),
|
|
6499
|
+
}), Le = n(() => {
|
|
6354
6500
|
let e = /* @__PURE__ */ new Map();
|
|
6355
|
-
e.set(l.geoType,
|
|
6356
|
-
let t =
|
|
6501
|
+
e.set(l.geoType, Fe.value);
|
|
6502
|
+
let t = S(l.topology), n = t?.objects;
|
|
6357
6503
|
if (!n) return e;
|
|
6358
6504
|
let r = (e) => {
|
|
6359
6505
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -6368,18 +6514,18 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6368
6514
|
let i = se(t, n.counties);
|
|
6369
6515
|
e.set("counties", r(i.features));
|
|
6370
6516
|
}
|
|
6371
|
-
return !e.has("hsas") && n.counties && e.set("hsas", r(
|
|
6372
|
-
}),
|
|
6517
|
+
return !e.has("hsas") && n.counties && e.set("hsas", r($.value.features)), e;
|
|
6518
|
+
}), Re = n(() => {
|
|
6373
6519
|
let e = /* @__PURE__ */ new Map();
|
|
6374
6520
|
if (!l.data) return e;
|
|
6375
|
-
let t = l.dataGeoType ?? l.geoType, n =
|
|
6521
|
+
let t = l.dataGeoType ?? l.geoType, n = Ne.value.get(t);
|
|
6376
6522
|
for (let t of l.data) {
|
|
6377
6523
|
e.set(t.id, t.value);
|
|
6378
6524
|
let r = n?.get(t.id);
|
|
6379
6525
|
r && e.set(r, t.value);
|
|
6380
6526
|
}
|
|
6381
6527
|
return e;
|
|
6382
|
-
}),
|
|
6528
|
+
}), ze = n(() => {
|
|
6383
6529
|
if (!l.data || l.data.length === 0) return {
|
|
6384
6530
|
min: 0,
|
|
6385
6531
|
max: 1
|
|
@@ -6396,8 +6542,8 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6396
6542
|
min: 0,
|
|
6397
6543
|
max: 1
|
|
6398
6544
|
};
|
|
6399
|
-
}),
|
|
6400
|
-
function
|
|
6545
|
+
}), Be = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Ve = n(() => Array.isArray(l.colorScale) && !Be.value), He = n(() => Ve.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Ue = n(() => Ve.value ? "" : l.colorScale?.max ?? "#08519c");
|
|
6546
|
+
function We(e) {
|
|
6401
6547
|
let t = e.replace("#", "");
|
|
6402
6548
|
return [
|
|
6403
6549
|
parseInt(t.slice(0, 2), 16),
|
|
@@ -6405,144 +6551,144 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6405
6551
|
parseInt(t.slice(4, 6), 16)
|
|
6406
6552
|
];
|
|
6407
6553
|
}
|
|
6408
|
-
function
|
|
6409
|
-
let [t, n, r] = He
|
|
6554
|
+
function Ge(e) {
|
|
6555
|
+
let [t, n, r] = We(He.value), [i, a, o] = We(Ue.value);
|
|
6410
6556
|
return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
|
|
6411
6557
|
}
|
|
6412
|
-
let
|
|
6413
|
-
if (!
|
|
6558
|
+
let Ke = n(() => Ve.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), qe = n(() => {
|
|
6559
|
+
if (!Be.value) return null;
|
|
6414
6560
|
let e = /* @__PURE__ */ new Map();
|
|
6415
6561
|
for (let t of l.colorScale) e.set(t.value, t.color);
|
|
6416
6562
|
return e;
|
|
6417
6563
|
});
|
|
6418
|
-
function
|
|
6419
|
-
let t =
|
|
6420
|
-
return t == null ? void 0 :
|
|
6564
|
+
function Je(e) {
|
|
6565
|
+
let t = Pe(e);
|
|
6566
|
+
return t == null ? void 0 : Re.value.get(t);
|
|
6421
6567
|
}
|
|
6422
|
-
function
|
|
6423
|
-
let t =
|
|
6568
|
+
function Ye(e) {
|
|
6569
|
+
let t = Je(e), n = l.noDataColor;
|
|
6424
6570
|
if (t == null) return n;
|
|
6425
|
-
let r =
|
|
6571
|
+
let r = qe.value;
|
|
6426
6572
|
if (r) return r.get(String(t)) ?? n;
|
|
6427
|
-
let i =
|
|
6573
|
+
let i = Ke.value;
|
|
6428
6574
|
if (i) {
|
|
6429
6575
|
let e = t;
|
|
6430
6576
|
for (let t of i) if (e >= t.min) return t.color;
|
|
6431
6577
|
return n;
|
|
6432
6578
|
}
|
|
6433
|
-
let { min: a, max: o } =
|
|
6434
|
-
return
|
|
6579
|
+
let { min: a, max: o } = ze.value;
|
|
6580
|
+
return Ge((t - a) / (o - a));
|
|
6435
6581
|
}
|
|
6436
|
-
let
|
|
6437
|
-
function
|
|
6438
|
-
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat !== void 0 ?
|
|
6582
|
+
let Xe = (e) => e.properties?.name ?? String(e.id);
|
|
6583
|
+
function Ze(e) {
|
|
6584
|
+
return e == null ? "" : typeof e == "number" && l.tooltipValueFormat !== void 0 ? te(e, l.tooltipValueFormat) : String(e);
|
|
6439
6585
|
}
|
|
6440
|
-
function
|
|
6441
|
-
return t == null ? e : `${e}: ${
|
|
6586
|
+
function Qe(e, t) {
|
|
6587
|
+
return t == null ? e : `${e}: ${Ze(t)}`;
|
|
6442
6588
|
}
|
|
6443
|
-
function
|
|
6444
|
-
let e =
|
|
6589
|
+
function $e() {
|
|
6590
|
+
let e = M.value?.getEl();
|
|
6445
6591
|
if (!e) return;
|
|
6446
|
-
|
|
6592
|
+
pe?.disconnect();
|
|
6447
6593
|
let t = !1;
|
|
6448
|
-
|
|
6594
|
+
pe = new ResizeObserver((e) => {
|
|
6449
6595
|
let n = e[0]?.contentRect;
|
|
6450
|
-
n && (
|
|
6451
|
-
}),
|
|
6596
|
+
n && (V.width = n.width, V.height = n.height, !t && U && H ? (t = !0, et(H.x, H.y)) : t = !0);
|
|
6597
|
+
}), pe.observe(e);
|
|
6452
6598
|
}
|
|
6453
|
-
function
|
|
6454
|
-
let n =
|
|
6599
|
+
function et(e, t) {
|
|
6600
|
+
let n = M.value?.getEl();
|
|
6455
6601
|
if (!n) return;
|
|
6456
|
-
let r =
|
|
6602
|
+
let r = T.value?.getBoundingClientRect(), { left: i, top: a } = be(e, t, V.width, V.height, l.tooltipClamp, r);
|
|
6457
6603
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
6458
6604
|
}
|
|
6459
|
-
function
|
|
6460
|
-
let r =
|
|
6605
|
+
function tt(e, t, n) {
|
|
6606
|
+
let r = re.get(e);
|
|
6461
6607
|
if (!r) return;
|
|
6462
|
-
let i =
|
|
6463
|
-
!i || !a || (i.setData(r),
|
|
6608
|
+
let i = M.value, a = i?.getEl();
|
|
6609
|
+
!i || !a || (i.setData(r), H = {
|
|
6464
6610
|
x: t,
|
|
6465
6611
|
y: n
|
|
6466
|
-
},
|
|
6612
|
+
}, U = !0, et(t, n), a.style.visibility = "visible");
|
|
6467
6613
|
}
|
|
6468
|
-
function
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
let e =
|
|
6472
|
-
!e || !
|
|
6473
|
-
x:
|
|
6474
|
-
y:
|
|
6475
|
-
}, e.style.transform = `translate3d(${
|
|
6614
|
+
function nt(e, t) {
|
|
6615
|
+
U && (he = e, ge = t, !G && (G = requestAnimationFrame(() => {
|
|
6616
|
+
G = 0;
|
|
6617
|
+
let e = M.value?.getEl();
|
|
6618
|
+
!e || !U || (H = {
|
|
6619
|
+
x: he,
|
|
6620
|
+
y: ge
|
|
6621
|
+
}, e.style.transform = `translate3d(${he + 16}px, ${ge}px, 0) translateY(-50%)`);
|
|
6476
6622
|
})));
|
|
6477
6623
|
}
|
|
6478
|
-
function
|
|
6479
|
-
if (!
|
|
6480
|
-
|
|
6481
|
-
let e =
|
|
6624
|
+
function rt() {
|
|
6625
|
+
if (!U) return;
|
|
6626
|
+
U = !1, H = null;
|
|
6627
|
+
let e = M.value?.getEl();
|
|
6482
6628
|
e && (e.style.visibility = "hidden");
|
|
6483
6629
|
}
|
|
6484
|
-
function
|
|
6630
|
+
function it(e, t) {
|
|
6485
6631
|
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"));
|
|
6486
6632
|
}
|
|
6487
|
-
function
|
|
6488
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
6633
|
+
function at(e, t = "solid") {
|
|
6634
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Me.value + 1)), e.setAttribute("stroke", "#555"), it(e, t);
|
|
6489
6635
|
}
|
|
6490
|
-
function
|
|
6491
|
-
e.setAttribute("stroke-width", String(
|
|
6636
|
+
function ot(e) {
|
|
6637
|
+
e.setAttribute("stroke-width", String(Me.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
6492
6638
|
}
|
|
6493
|
-
function
|
|
6494
|
-
L !== e && (L && !R.has(L) &&
|
|
6639
|
+
function st(e) {
|
|
6640
|
+
L !== e && (L && !R.has(L) && ot(L), L = e, at(e, R.get(e) ?? "solid"));
|
|
6495
6641
|
}
|
|
6496
|
-
function
|
|
6642
|
+
function ct() {
|
|
6497
6643
|
if (L) {
|
|
6498
6644
|
let e = R.get(L);
|
|
6499
|
-
e == null ?
|
|
6645
|
+
e == null ? ot(L) : at(L, e), L = null, d("stateHover", null);
|
|
6500
6646
|
}
|
|
6501
|
-
|
|
6647
|
+
rt();
|
|
6502
6648
|
}
|
|
6503
|
-
function
|
|
6649
|
+
function lt(e) {
|
|
6504
6650
|
let t = e;
|
|
6505
6651
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
6506
6652
|
return t ? t.dataset.featId ?? null : null;
|
|
6507
6653
|
}
|
|
6508
|
-
function
|
|
6654
|
+
function ut(e) {
|
|
6509
6655
|
if (B) return;
|
|
6510
|
-
let t = e, n =
|
|
6656
|
+
let t = e, n = lt(t.target);
|
|
6511
6657
|
if (!n) return;
|
|
6512
|
-
let r =
|
|
6658
|
+
let r = re.get(n);
|
|
6513
6659
|
if (!r) return;
|
|
6514
6660
|
let i = {
|
|
6515
6661
|
id: r.id,
|
|
6516
6662
|
name: r.name,
|
|
6517
6663
|
value: r.value
|
|
6518
6664
|
};
|
|
6519
|
-
e.type === "click" ? (d("stateClick", i), d("update:focus",
|
|
6665
|
+
e.type === "click" ? (d("stateClick", i), d("update:focus", Y(Ie.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (st(P.get(n)), N.value && tt(n, t.clientX, t.clientY), d("stateHover", i));
|
|
6520
6666
|
}
|
|
6521
|
-
function
|
|
6522
|
-
B ||
|
|
6667
|
+
function dt(e) {
|
|
6668
|
+
B || nt(e.clientX, e.clientY);
|
|
6523
6669
|
}
|
|
6524
|
-
function
|
|
6670
|
+
function ft(e) {
|
|
6525
6671
|
let t = e.relatedTarget;
|
|
6526
|
-
t &&
|
|
6672
|
+
t && k.value?.contains(t) || ct();
|
|
6527
6673
|
}
|
|
6528
|
-
function
|
|
6529
|
-
let t = document.createElementNS(
|
|
6674
|
+
function pt(e) {
|
|
6675
|
+
let t = document.createElementNS(wn, "path");
|
|
6530
6676
|
return e && t.setAttribute("d", e), t;
|
|
6531
6677
|
}
|
|
6532
|
-
function
|
|
6533
|
-
let e =
|
|
6678
|
+
function mt() {
|
|
6679
|
+
let e = A.value, t = j.value;
|
|
6534
6680
|
if (!e || !t) return;
|
|
6535
6681
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
6536
6682
|
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
6537
|
-
|
|
6538
|
-
let n =
|
|
6683
|
+
P.clear(), re.clear(), ue = null, L = null, R.clear(), z.clear();
|
|
6684
|
+
let n = je.value, r = De.value.features, i = l.strokeColor, a = String(Me.value), o = !N.value, s = document.createDocumentFragment();
|
|
6539
6685
|
for (let e of r) {
|
|
6540
|
-
let t = String(e.id), r =
|
|
6541
|
-
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill",
|
|
6542
|
-
let e = document.createElementNS(
|
|
6543
|
-
e.textContent =
|
|
6686
|
+
let t = String(e.id), r = Xe(e), c = Je(t), l = pt(n(e));
|
|
6687
|
+
if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", Ye(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
|
|
6688
|
+
let e = document.createElementNS(wn, "title");
|
|
6689
|
+
e.textContent = Qe(r, c), l.appendChild(e);
|
|
6544
6690
|
}
|
|
6545
|
-
s.appendChild(l),
|
|
6691
|
+
s.appendChild(l), P.set(t, l), re.set(t, {
|
|
6546
6692
|
id: t,
|
|
6547
6693
|
name: r,
|
|
6548
6694
|
value: c,
|
|
@@ -6551,141 +6697,149 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6551
6697
|
}
|
|
6552
6698
|
let c = Oe.value;
|
|
6553
6699
|
if (c) {
|
|
6554
|
-
let e =
|
|
6555
|
-
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),
|
|
6700
|
+
let e = pt(n(c));
|
|
6701
|
+
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), ue = e;
|
|
6556
6702
|
}
|
|
6557
6703
|
e.appendChild(s);
|
|
6558
6704
|
}
|
|
6559
|
-
function
|
|
6560
|
-
let e = !
|
|
6561
|
-
for (let [t, n] of
|
|
6562
|
-
let r =
|
|
6563
|
-
if (n.setAttribute("fill",
|
|
6705
|
+
function ht() {
|
|
6706
|
+
let e = !N.value;
|
|
6707
|
+
for (let [t, n] of P) {
|
|
6708
|
+
let r = Je(t), i = re.get(t);
|
|
6709
|
+
if (n.setAttribute("fill", Ye(t)), i && (i.value = r), e && i) {
|
|
6564
6710
|
let e = n.firstElementChild;
|
|
6565
|
-
e && (e.textContent =
|
|
6711
|
+
e && (e.textContent = Qe(i.name, r));
|
|
6566
6712
|
}
|
|
6567
6713
|
}
|
|
6568
6714
|
}
|
|
6569
|
-
function
|
|
6570
|
-
for (let e of
|
|
6571
|
-
|
|
6715
|
+
function gt() {
|
|
6716
|
+
for (let e of P.values()) e === L || R.has(e) || ot(e);
|
|
6717
|
+
ue && ue.setAttribute("stroke", l.strokeColor);
|
|
6572
6718
|
}
|
|
6573
|
-
function
|
|
6719
|
+
function _t() {
|
|
6574
6720
|
return typeof l.menu == "string" ? l.menu : "choropleth";
|
|
6575
6721
|
}
|
|
6576
|
-
let
|
|
6722
|
+
let vt = n(() => l.legend && (Be.value || Ve.value || l.data)), yt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), bt = n(() => {
|
|
6577
6723
|
let e = [];
|
|
6578
6724
|
for (let t = 0; t <= 10; t++) {
|
|
6579
6725
|
let n = t / 10;
|
|
6580
6726
|
e.push({
|
|
6581
6727
|
offset: `${(n * 100).toFixed(0)}%`,
|
|
6582
|
-
color:
|
|
6728
|
+
color: Ge(n)
|
|
6583
6729
|
});
|
|
6584
6730
|
}
|
|
6585
6731
|
return e;
|
|
6586
|
-
}),
|
|
6732
|
+
}), xt = new Intl.NumberFormat("en-US", {
|
|
6587
6733
|
notation: "compact",
|
|
6588
6734
|
maximumFractionDigits: 1
|
|
6589
|
-
}),
|
|
6590
|
-
let { min: e, max: t } =
|
|
6735
|
+
}), St = n(() => {
|
|
6736
|
+
let { min: e, max: t } = ze.value, n = t - e, r = [];
|
|
6591
6737
|
for (let t = 1; t <= 3; t++) {
|
|
6592
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
6738
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? xt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
6593
6739
|
r.push({
|
|
6594
6740
|
value: o,
|
|
6595
6741
|
pct: i * 100
|
|
6596
6742
|
});
|
|
6597
6743
|
}
|
|
6598
6744
|
return r;
|
|
6599
|
-
}),
|
|
6745
|
+
}), Ct = n(() => {
|
|
6600
6746
|
let e = [];
|
|
6601
|
-
if (
|
|
6747
|
+
if (Be.value) for (let t of l.colorScale) e.push({
|
|
6602
6748
|
key: t.value,
|
|
6603
6749
|
color: t.color,
|
|
6604
6750
|
label: t.value
|
|
6605
6751
|
});
|
|
6606
|
-
else if (
|
|
6752
|
+
else if (Ve.value) for (let t of yt.value) e.push({
|
|
6607
6753
|
key: String(t.min),
|
|
6608
6754
|
color: t.color,
|
|
6609
6755
|
label: t.label ?? String(t.min)
|
|
6610
6756
|
});
|
|
6611
6757
|
return e;
|
|
6612
|
-
}),
|
|
6613
|
-
let e =
|
|
6614
|
-
return [
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6758
|
+
}), wt = n(() => `linear-gradient(to right, ${bt.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), Tt = Ae(), Et = n(() => {
|
|
6759
|
+
let e = _t();
|
|
6760
|
+
return [
|
|
6761
|
+
Tt.menuItem.value,
|
|
6762
|
+
{
|
|
6763
|
+
label: "Save as SVG",
|
|
6764
|
+
action: () => {
|
|
6765
|
+
O.value && Te(O.value, e);
|
|
6766
|
+
}
|
|
6767
|
+
},
|
|
6768
|
+
{
|
|
6769
|
+
label: "Save as PNG",
|
|
6770
|
+
action: () => {
|
|
6771
|
+
O.value && Ee(O.value, e);
|
|
6772
|
+
}
|
|
6623
6773
|
}
|
|
6624
|
-
|
|
6774
|
+
];
|
|
6625
6775
|
});
|
|
6626
|
-
return
|
|
6627
|
-
|
|
6776
|
+
return E(() => [je.value, N.value], () => mt()), E(() => [
|
|
6777
|
+
Re.value,
|
|
6628
6778
|
l.colorScale,
|
|
6629
6779
|
l.noDataColor,
|
|
6630
6780
|
l.dataGeoType
|
|
6631
|
-
], () =>
|
|
6781
|
+
], () => ht()), E(() => [l.strokeColor, Me.value], () => gt()), E(() => [Ie.value, je.value], () => X(), { flush: "post" }), (n, c) => (_(), a("div", {
|
|
6632
6782
|
ref_key: "containerRef",
|
|
6633
|
-
ref:
|
|
6634
|
-
class: f(["choropleth-wrapper", {
|
|
6783
|
+
ref: T,
|
|
6784
|
+
class: f(["choropleth-wrapper", {
|
|
6785
|
+
pannable: t.pan,
|
|
6786
|
+
"is-fullscreen": C(Tt).isFullscreen.value
|
|
6787
|
+
}])
|
|
6635
6788
|
}, [
|
|
6636
|
-
t.menu ? (_(), r(
|
|
6789
|
+
t.menu ? (_(), r(de, {
|
|
6637
6790
|
key: 0,
|
|
6638
|
-
items:
|
|
6791
|
+
items: Et.value
|
|
6639
6792
|
}, null, 8, ["items"])) : i("", !0),
|
|
6640
|
-
|
|
6793
|
+
o("div", hn, x(C(Tt).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
|
|
6794
|
+
t.title || vt.value ? (_(), a("div", gn, [t.title ? (_(), a("div", _n, x(t.title), 1)) : i("", !0), vt.value ? (_(), a("div", vn, [t.legendTitle ? (_(), a("span", yn, x(t.legendTitle), 1)) : i("", !0), Be.value || Ve.value ? (_(!0), a(e, { key: 1 }, y(Ct.value, (e) => (_(), a("span", {
|
|
6641
6795
|
key: e.key,
|
|
6642
6796
|
class: "choropleth-legend-item"
|
|
6643
6797
|
}, [o("span", {
|
|
6644
6798
|
class: "choropleth-legend-swatch",
|
|
6645
6799
|
style: m({ background: e.color })
|
|
6646
|
-
}, null, 4), s(" " +
|
|
6800
|
+
}, null, 4), s(" " + x(e.label), 1)]))), 128)) : (_(), a("div", bn, [o("div", {
|
|
6647
6801
|
class: "choropleth-legend-gradient",
|
|
6648
|
-
style: m({ background:
|
|
6649
|
-
}, null, 4), o("div",
|
|
6802
|
+
style: m({ background: wt.value })
|
|
6803
|
+
}, null, 4), o("div", xn, [(_(!0), a(e, null, y(St.value, (e) => (_(), a("span", {
|
|
6650
6804
|
key: e.value,
|
|
6651
6805
|
style: m({ left: e.pct + "%" })
|
|
6652
|
-
},
|
|
6806
|
+
}, x(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
|
|
6653
6807
|
(_(), a("svg", {
|
|
6654
6808
|
ref_key: "svgRef",
|
|
6655
|
-
ref:
|
|
6656
|
-
viewBox: `0 0 ${we.value} ${
|
|
6809
|
+
ref: O,
|
|
6810
|
+
viewBox: `0 0 ${we.value} ${Q.value}`,
|
|
6657
6811
|
preserveAspectRatio: "xMidYMid meet"
|
|
6658
6812
|
}, [o("g", {
|
|
6659
6813
|
ref_key: "mapGroupRef",
|
|
6660
|
-
ref:
|
|
6814
|
+
ref: k
|
|
6661
6815
|
}, [o("g", {
|
|
6662
6816
|
ref_key: "baseGroupRef",
|
|
6663
|
-
ref:
|
|
6817
|
+
ref: A
|
|
6664
6818
|
}, null, 512), o("g", {
|
|
6665
6819
|
ref_key: "overlayGroupRef",
|
|
6666
|
-
ref:
|
|
6667
|
-
}, null, 512)], 512)], 8,
|
|
6668
|
-
|
|
6820
|
+
ref: j
|
|
6821
|
+
}, null, 512)], 512)], 8, Sn)),
|
|
6822
|
+
me.value ? (_(), a("button", {
|
|
6669
6823
|
key: 2,
|
|
6670
6824
|
type: "button",
|
|
6671
6825
|
class: "choropleth-reset",
|
|
6672
6826
|
"aria-label": "Reset zoom",
|
|
6673
|
-
onClick:
|
|
6827
|
+
onClick: Se
|
|
6674
6828
|
}, " Reset ")) : i("", !0),
|
|
6675
|
-
|
|
6829
|
+
N.value ? (_(), r(mn, {
|
|
6676
6830
|
key: 3,
|
|
6677
6831
|
ref_key: "tooltipChildRef",
|
|
6678
|
-
ref:
|
|
6832
|
+
ref: M
|
|
6679
6833
|
}, {
|
|
6680
|
-
default:
|
|
6834
|
+
default: D((r) => [b(n.$slots, "tooltip", p(u(ee(r))), () => [t.tooltipFormat ? (_(), a("span", {
|
|
6681
6835
|
key: 0,
|
|
6682
6836
|
innerHTML: t.tooltipFormat(r)
|
|
6683
|
-
}, null, 8,
|
|
6837
|
+
}, null, 8, Cn)) : r.value == null ? (_(), a(e, { key: 1 }, [s(x(r.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(x(r.name) + ": " + x(Ze(r.value)), 1)], 64))], !0)]),
|
|
6684
6838
|
_: 3
|
|
6685
6839
|
}, 512)) : i("", !0)
|
|
6686
6840
|
], 2));
|
|
6687
6841
|
}
|
|
6688
|
-
}), [["__scopeId", "data-v-
|
|
6842
|
+
}), [["__scopeId", "data-v-110171fe"]]), On = /* @__PURE__ */ z(/* @__PURE__ */ l({
|
|
6689
6843
|
__name: "ChartTooltip",
|
|
6690
6844
|
props: {
|
|
6691
6845
|
x: {},
|
|
@@ -6705,12 +6859,12 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6705
6859
|
top: `${e.y}px`,
|
|
6706
6860
|
transform: "translateY(-50%)"
|
|
6707
6861
|
})
|
|
6708
|
-
}, [
|
|
6862
|
+
}, [b(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(C(re), {
|
|
6709
6863
|
key: 1,
|
|
6710
6864
|
open: e.open
|
|
6711
6865
|
}, {
|
|
6712
|
-
default:
|
|
6713
|
-
default:
|
|
6866
|
+
default: D(() => [c(C(ne), { "as-child": "" }, {
|
|
6867
|
+
default: D(() => [o("div", {
|
|
6714
6868
|
class: "chart-tooltip-anchor",
|
|
6715
6869
|
style: m({
|
|
6716
6870
|
left: `${e.x}px`,
|
|
@@ -6718,8 +6872,8 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6718
6872
|
})
|
|
6719
6873
|
}, null, 4)]),
|
|
6720
6874
|
_: 1
|
|
6721
|
-
}), c(
|
|
6722
|
-
default:
|
|
6875
|
+
}), c(C(P), null, {
|
|
6876
|
+
default: D(() => [e.open ? (_(), r(C(N), {
|
|
6723
6877
|
key: 0,
|
|
6724
6878
|
class: "chart-tooltip-content",
|
|
6725
6879
|
side: "right",
|
|
@@ -6728,7 +6882,7 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6728
6882
|
onPointerDownOutside: n[0] ||= (e) => t.$emit("close"),
|
|
6729
6883
|
onEscapeKeyDown: n[1] ||= (e) => t.$emit("close")
|
|
6730
6884
|
}, {
|
|
6731
|
-
default:
|
|
6885
|
+
default: D(() => [b(t.$slots, "default", {}, void 0, !0)]),
|
|
6732
6886
|
_: 3
|
|
6733
6887
|
}, 8, ["side-offset"])) : i("", !0)]),
|
|
6734
6888
|
_: 3
|
|
@@ -6736,7 +6890,7 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6736
6890
|
_: 3
|
|
6737
6891
|
}, 8, ["open"])) : i("", !0);
|
|
6738
6892
|
}
|
|
6739
|
-
}), [["__scopeId", "data-v-44377f70"]]),
|
|
6893
|
+
}), [["__scopeId", "data-v-44377f70"]]), kn = { class: "TableWrapper" }, An = /* @__PURE__ */ z(/* @__PURE__ */ l({
|
|
6740
6894
|
__name: "DataTable",
|
|
6741
6895
|
props: {
|
|
6742
6896
|
data: {},
|
|
@@ -6805,38 +6959,38 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6805
6959
|
let r = c.columnConfig?.[e.name]?.format;
|
|
6806
6960
|
if (r !== void 0) {
|
|
6807
6961
|
if (typeof r == "function") return r(n, t);
|
|
6808
|
-
if (typeof n == "number") return
|
|
6962
|
+
if (typeof n == "number") return te(n, r);
|
|
6809
6963
|
}
|
|
6810
6964
|
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);
|
|
6811
6965
|
}
|
|
6812
|
-
function
|
|
6966
|
+
function b() {
|
|
6813
6967
|
return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
|
|
6814
6968
|
}
|
|
6815
|
-
function
|
|
6969
|
+
function ee(e) {
|
|
6816
6970
|
return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
6817
6971
|
}
|
|
6818
|
-
function
|
|
6972
|
+
function S() {
|
|
6819
6973
|
if (typeof c.csv == "function") return c.csv();
|
|
6820
6974
|
if (typeof c.csv == "string") return c.csv;
|
|
6821
|
-
let e = h.value, t = g.value, n = [e.map((e) =>
|
|
6975
|
+
let e = h.value, t = g.value, n = [e.map((e) => ee(l(e.name))).join(",")];
|
|
6822
6976
|
for (let r = 0; r < t; r++) {
|
|
6823
|
-
let t = e.map((e) =>
|
|
6977
|
+
let t = e.map((e) => ee(v(e, r)));
|
|
6824
6978
|
n.push(t.join(","));
|
|
6825
6979
|
}
|
|
6826
6980
|
return n.join("\n");
|
|
6827
6981
|
}
|
|
6828
|
-
let
|
|
6982
|
+
let C = n(() => [{
|
|
6829
6983
|
label: c.downloadMenuLink,
|
|
6830
|
-
action: () => Q(
|
|
6831
|
-
}]),
|
|
6984
|
+
action: () => Q(S(), b())
|
|
6985
|
+
}]), w = n(() => !!c.menu);
|
|
6832
6986
|
return (n, s) => (_(), a("div", { class: f(["TableOuter", {
|
|
6833
6987
|
"full-width": t.fullWidth,
|
|
6834
|
-
"has-menu":
|
|
6835
|
-
}]) }, [
|
|
6988
|
+
"has-menu": w.value
|
|
6989
|
+
}]) }, [w.value ? (_(), r(de, {
|
|
6836
6990
|
key: 0,
|
|
6837
|
-
items:
|
|
6991
|
+
items: C.value,
|
|
6838
6992
|
"force-dropdown": ""
|
|
6839
|
-
}, null, 8, ["items"])) : i("", !0), o("div",
|
|
6993
|
+
}, null, 8, ["items"])) : i("", !0), o("div", kn, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
|
|
6840
6994
|
o("colgroup", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("col", {
|
|
6841
6995
|
key: e.name,
|
|
6842
6996
|
style: m(u(e.name))
|
|
@@ -6844,14 +6998,14 @@ var Je = ["width", "height"], Ye = ["x"], Xe = { key: 1 }, Ze = [
|
|
|
6844
6998
|
o("thead", null, [o("tr", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("th", {
|
|
6845
6999
|
key: e.name,
|
|
6846
7000
|
style: m(d(e.name))
|
|
6847
|
-
},
|
|
7001
|
+
}, x(l(e.name)), 5))), 128))])]),
|
|
6848
7002
|
o("tbody", null, [(_(!0), a(e, null, y(g.value, (n) => (_(), a("tr", { key: n }, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("td", {
|
|
6849
7003
|
key: e.name,
|
|
6850
7004
|
class: f(t.columnConfig?.[e.name]?.cellClass),
|
|
6851
7005
|
style: m(d(e.name))
|
|
6852
|
-
},
|
|
7006
|
+
}, x(v(e, n - 1)), 7))), 128))]))), 128))])
|
|
6853
7007
|
], 2)])], 2));
|
|
6854
7008
|
}
|
|
6855
7009
|
}), [["__scopeId", "data-v-d6b3bce8"]]);
|
|
6856
7010
|
//#endregion
|
|
6857
|
-
export {
|
|
7011
|
+
export { un as BarChart, On as ChartTooltip, Dn as ChoroplethMap, An as DataTable, Vt as LineChart, dn as fipsToHsa, fn as hsaNames };
|