@cfasim-ui/charts 0.4.5 → 0.4.6

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/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, onMounted as h, onUnmounted as ee, openBlock as g, ref as _, renderList as v, renderSlot as te, toDisplayString as y, toHandlers as ne, toRaw as b, unref as x, useSlots as re, useTemplateRef as S, watch as C, withCtx as w } from "vue";
2
- import { DropdownMenuContent as T, DropdownMenuItem as ie, DropdownMenuPortal as E, DropdownMenuRoot as D, DropdownMenuTrigger as O, PopoverAnchor as k, PopoverContent as A, PopoverPortal as j, PopoverRoot as M } from "reka-ui";
3
- import { geoAlbersUsa as N, geoPath as ae } from "d3-geo";
4
- import { zoom as P, zoomIdentity as F } from "d3-zoom";
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 ee, toDisplayString as b, toHandlers as te, toRaw as x, unref as S, useSlots as C, useTemplateRef as w, watch as T, withCtx as E } from "vue";
2
+ import { DropdownMenuContent as D, DropdownMenuItem as O, DropdownMenuPortal as k, DropdownMenuRoot as A, DropdownMenuTrigger as j, PopoverAnchor as M, PopoverContent as N, PopoverPortal as P, PopoverRoot as ne } from "reka-ui";
3
+ import { geoAlbersUsa as F, geoPath as re } from "d3-geo";
4
+ import { zoom as ie, zoomIdentity as ae } from "d3-zoom";
5
5
  import { select as oe } from "d3-selection";
6
6
  import "d3-transition";
7
- import { feature as I, merge as se, mesh as L } from "topojson-client";
7
+ import { feature as I, merge as se, mesh as ce } from "topojson-client";
8
8
  //#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
9
- var R = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PURE__ */ l({
9
+ var L = { class: "chart-menu-trigger-area" }, R = ["aria-label"], z = /* @__PURE__ */ l({
10
10
  __name: "ChartMenu",
11
11
  props: {
12
12
  items: {},
@@ -17,15 +17,15 @@ var R = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PURE
17
17
  },
18
18
  setup(t) {
19
19
  let n = t, i = () => n.forceDropdown || n.items.length > 1;
20
- return (n, l) => (g(), a("div", R, [i() ? (g(), r(x(D), {
20
+ return (n, l) => (_(), a("div", L, [i() ? (_(), r(S(A), {
21
21
  key: 1,
22
22
  modal: !1
23
23
  }, {
24
- default: w(() => [c(x(O), {
24
+ default: E(() => [c(S(j), {
25
25
  class: "chart-menu-button",
26
26
  "aria-label": "Chart options"
27
27
  }, {
28
- default: w(() => [...l[2] ||= [o("svg", {
28
+ default: E(() => [...l[2] ||= [o("svg", {
29
29
  width: "16",
30
30
  height: "16",
31
31
  viewBox: "0 0 16 16",
@@ -49,18 +49,18 @@ var R = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PURE
49
49
  })
50
50
  ], -1)]]),
51
51
  _: 1
52
- }), c(x(E), null, {
53
- default: w(() => [c(x(T), {
52
+ }), c(S(k), null, {
53
+ default: E(() => [c(S(D), {
54
54
  class: "chart-menu-content",
55
55
  "side-offset": 4,
56
56
  align: "end"
57
57
  }, {
58
- default: w(() => [(g(!0), a(e, null, v(t.items, (e) => (g(), r(x(ie), {
58
+ default: E(() => [(_(!0), a(e, null, y(t.items, (e) => (_(), r(S(O), {
59
59
  key: e.label,
60
60
  class: "chart-menu-item",
61
61
  onSelect: e.action
62
62
  }, {
63
- default: w(() => [s(y(e.label), 1)]),
63
+ default: E(() => [s(b(e.label), 1)]),
64
64
  _: 2
65
65
  }, 1032, ["onSelect"]))), 128))]),
66
66
  _: 1
@@ -68,7 +68,7 @@ var R = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PURE
68
68
  _: 1
69
69
  })]),
70
70
  _: 1
71
- })) : (g(), a("button", {
71
+ })) : (_(), a("button", {
72
72
  key: 0,
73
73
  class: "chart-menu-button chart-menu-single",
74
74
  "aria-label": t.items[0].label,
@@ -83,47 +83,47 @@ var R = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PURE
83
83
  "stroke-linecap": "round",
84
84
  "stroke-linejoin": "round",
85
85
  "aria-hidden": "true"
86
- }, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, z))]));
86
+ }, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, R))]));
87
87
  }
88
- }), V = (e, t) => {
88
+ }), B = (e, t) => {
89
89
  let n = e.__vccOpts || e;
90
90
  for (let [e, r] of t) n[e] = r;
91
91
  return n;
92
- }, ce = /* @__PURE__ */ V(B, [["__scopeId", "data-v-b3c563e8"]]);
92
+ }, le = /* @__PURE__ */ B(z, [["__scopeId", "data-v-b3c563e8"]]);
93
93
  //#endregion
94
94
  //#region src/_shared/axes.ts
95
- function H(e) {
95
+ function V(e) {
96
96
  return Math.round(e) + .5;
97
97
  }
98
- function U(e, t) {
98
+ function H(e, t) {
99
99
  let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
100
100
  return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
101
101
  }
102
- function W(e, t, n) {
102
+ function ue(e, t, n) {
103
103
  if (!(n > 0) || !isFinite(n)) return [];
104
104
  let r = [], i = Math.ceil(e / n) * n;
105
105
  for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
106
106
  return r;
107
107
  }
108
- var G = new Intl.NumberFormat();
109
- function K(e) {
110
- return Math.abs(e) >= 1e3 ? G.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
108
+ var U = new Intl.NumberFormat();
109
+ function W(e) {
110
+ return Math.abs(e) >= 1e3 ? U.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
111
111
  }
112
112
  //#endregion
113
113
  //#region src/_shared/computeTicks.ts
114
- function q(e) {
114
+ function G(e) {
115
115
  let { min: t, max: n, ticks: r } = e;
116
116
  if (t === n) return [];
117
117
  let i = e.displayOffset ?? 0;
118
118
  if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
119
- if (typeof r == "number") return W(t + i, n + i, r).map((e) => e - i);
120
- let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = U(n - t, a);
121
- return W(t + i, n + i, o).map((e) => e - i);
119
+ if (typeof r == "number") return ue(t + i, n + i, r).map((e) => e - i);
120
+ let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = H(n - t, a);
121
+ return ue(t + i, n + i, o).map((e) => e - i);
122
122
  }
123
123
  //#endregion
124
124
  //#region src/_shared/useChartSize.ts
125
- function le(e = {}) {
126
- let t = _(null), n = _(0), r = null, i = null;
125
+ function K(e = {}) {
126
+ let t = v(null), n = v(0), r = null, i = null;
127
127
  return h(() => {
128
128
  t.value && (n.value = t.value.clientWidth, r = new ResizeObserver((t) => {
129
129
  let r = t[0];
@@ -133,30 +133,63 @@ function le(e = {}) {
133
133
  n.value = r.contentRect.width;
134
134
  }, a)) : n.value = r.contentRect.width;
135
135
  }), r.observe(t.value));
136
- }), ee(() => {
136
+ }), g(() => {
137
137
  r?.disconnect(), i && clearTimeout(i);
138
138
  }), {
139
139
  containerRef: t,
140
140
  measuredWidth: n
141
141
  };
142
142
  }
143
- function ue(e) {
144
- let t = n(() => ({
145
- top: (e.title() ? 30 : 10) + (e.hasInlineLegend() ? 20 : 0),
146
- right: 10,
147
- bottom: e.xLabel() ? 46 : 30,
148
- left: e.yLabel() ? 66 : 50
149
- }));
143
+ function de(e) {
144
+ return e == null ? {
145
+ top: 0,
146
+ right: 0,
147
+ bottom: 0,
148
+ left: 0
149
+ } : typeof e == "number" ? {
150
+ top: e,
151
+ right: e,
152
+ bottom: e,
153
+ left: e
154
+ } : {
155
+ top: e.top ?? 0,
156
+ right: e.right ?? 0,
157
+ bottom: e.bottom ?? 0,
158
+ left: e.left ?? 0
159
+ };
160
+ }
161
+ function q(e) {
162
+ let t = n(() => {
163
+ let t = de(e.extraPadding?.());
164
+ return {
165
+ top: (e.title() ? 26 : 10) + (e.hasInlineLegend() ? 20 : 0) + t.top,
166
+ right: 10 + t.right,
167
+ bottom: (e.xLabel() ? 38 : 30) + t.bottom,
168
+ left: (e.yLabel() ? 56 : 50) + t.left
169
+ };
170
+ }), r = n(() => (e.title() ? 26 : 10) + 20 / 2), i = n(() => e.width() - t.value.left - t.value.right), a = n(() => e.height() - t.value.top - t.value.bottom);
150
171
  return {
151
172
  padding: t,
152
- innerW: n(() => e.width() - t.value.left - t.value.right),
153
- innerH: n(() => e.height() - t.value.top - t.value.bottom)
173
+ legendY: r,
174
+ innerW: i,
175
+ innerH: a,
176
+ bounds: n(() => {
177
+ let e = t.value;
178
+ return {
179
+ left: e.left,
180
+ top: e.top,
181
+ right: e.left + i.value,
182
+ bottom: e.top + a.value,
183
+ width: i.value,
184
+ height: a.value
185
+ };
186
+ })
154
187
  };
155
188
  }
156
189
  //#endregion
157
190
  //#region src/tooltip-position.ts
158
- var J = 16, Y = 8;
159
- function X(e, t, n, r, i, a) {
191
+ var J = 16, fe = 8;
192
+ function pe(e, t, n, r, i, a) {
160
193
  if (i === "none") return {
161
194
  left: e + J,
162
195
  top: t
@@ -171,16 +204,16 @@ function X(e, t, n, r, i, a) {
171
204
  right: window.innerWidth,
172
205
  top: 0,
173
206
  bottom: window.innerHeight
174
- }, s = e + J + n > o.right - Y ? e - J - n : e + J, c = r / 2;
207
+ }, s = e + J + n > o.right - fe ? e - J - n : e + J, c = r / 2;
175
208
  return {
176
209
  left: s,
177
- top: Math.min(Math.max(t, o.top + Y + c), o.bottom - Y - c)
210
+ top: Math.min(Math.max(t, o.top + fe + c), o.bottom - fe - c)
178
211
  };
179
212
  }
180
213
  //#endregion
181
214
  //#region src/_shared/useChartTooltip.ts
182
- function de(e) {
183
- let t = e.touchYOffset ?? 50, n = _(null), r = _(!1), i = _(null), a = _(null), o = _(null);
215
+ function Y(e) {
216
+ let t = e.touchYOffset ?? 50, n = v(null), r = v(!1), i = v(null), a = v(null), o = v(null);
184
217
  function s(e) {
185
218
  return "touches" in e ? e.touches[0] ?? null : e;
186
219
  }
@@ -193,14 +226,14 @@ function de(e) {
193
226
  clientY: r.clientY
194
227
  }, e.onHover?.({ index: i }));
195
228
  }
196
- C([a, n], () => {
229
+ T([a, n], () => {
197
230
  if (n.value === null || !a.value) {
198
231
  o.value = null;
199
232
  return;
200
233
  }
201
234
  let s = i.value, c = e.containerRef.value;
202
235
  if (!s || !c) return;
203
- let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = X(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
236
+ let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = pe(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
204
237
  o.value = {
205
238
  left: f - l.left,
206
239
  top: p - l.top
@@ -246,7 +279,7 @@ function de(e) {
246
279
  }
247
280
  //#endregion
248
281
  //#region src/ChartMenu/download.ts
249
- function fe(e, t) {
282
+ function X(e, t) {
250
283
  let n = URL.createObjectURL(e), r = document.createElement("a");
251
284
  r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
252
285
  }
@@ -254,9 +287,9 @@ function Z(e, t) {
254
287
  let n = e.cloneNode(!0);
255
288
  n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
256
289
  let r = new XMLSerializer().serializeToString(n);
257
- fe(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
290
+ X(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
258
291
  }
259
- function pe(e, t) {
292
+ function Q(e, t) {
260
293
  let n = e.cloneNode(!0);
261
294
  n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
262
295
  let r = new XMLSerializer().serializeToString(n), i = new Blob([r], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(i), o = new Image(), s = e.width.baseVal.value || e.clientWidth, c = e.height.baseVal.value || e.clientHeight;
@@ -265,17 +298,17 @@ function pe(e, t) {
265
298
  e.width = s * 2, e.height = c * 2;
266
299
  let n = e.getContext("2d");
267
300
  n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
268
- e && fe(e, `${t}.png`);
301
+ e && X(e, `${t}.png`);
269
302
  }), URL.revokeObjectURL(a);
270
303
  }, o.src = a;
271
304
  }
272
- function Q(e, t) {
273
- fe(new Blob([e], { type: "text/csv" }), `${t}.csv`);
305
+ function me(e, t) {
306
+ X(new Blob([e], { type: "text/csv" }), `${t}.csv`);
274
307
  }
275
308
  //#endregion
276
309
  //#region src/_shared/useChartMenu.ts
277
- function me(e) {
278
- let t = _(null);
310
+ function he(e) {
311
+ let t = v(null);
279
312
  function r() {
280
313
  let t = e.filename();
281
314
  if (t) return t;
@@ -293,12 +326,12 @@ function me(e) {
293
326
  }, {
294
327
  label: "Save as PNG",
295
328
  action: () => {
296
- t.value && pe(t.value, n);
329
+ t.value && Q(t.value, n);
297
330
  }
298
331
  }];
299
332
  return e.downloadLink() || i.push({
300
333
  label: "Download CSV",
301
- action: () => Q(e.getCsv(), n)
334
+ action: () => me(e.getCsv(), n)
302
335
  }), i;
303
336
  }),
304
337
  downloadLinkText: n(() => {
@@ -311,7 +344,7 @@ function me(e) {
311
344
  }
312
345
  //#endregion
313
346
  //#region src/_shared/seriesCsv.ts
314
- function he(e) {
347
+ function ge(e) {
315
348
  if (e.length === 0) return "";
316
349
  let t = 0;
317
350
  for (let n of e) n.data.length > t && (t = n.data.length);
@@ -323,85 +356,340 @@ function he(e) {
323
356
  }
324
357
  return i.join("\n");
325
358
  }
326
- function ge(e, t, n = "category") {
359
+ function _e(e, t, n = "category") {
327
360
  if (t.length === 0 || e.length === 0) return "";
328
361
  let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
329
362
  for (let n = 0; n < e.length; n++) {
330
- let i = [_e(e[n])];
363
+ let i = [$(e[n])];
331
364
  for (let e of t) i.push(n < e.data.length ? String(e.data[n]) : "");
332
365
  r.push(i.join(","));
333
366
  }
334
367
  return r.join("\n");
335
368
  }
336
- function _e(e) {
369
+ function $(e) {
337
370
  return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
338
371
  }
339
372
  //#endregion
373
+ //#region src/_shared/ChartAnnotations.vue?vue&type=script&setup=true&lang.ts
374
+ var ve = {
375
+ class: "chart-annotations",
376
+ "pointer-events": "none"
377
+ }, ye = [
378
+ "x1",
379
+ "y1",
380
+ "x2",
381
+ "y2",
382
+ "stroke",
383
+ "stroke-width",
384
+ "stroke-dasharray"
385
+ ], be = [
386
+ "d",
387
+ "stroke",
388
+ "stroke-width",
389
+ "stroke-dasharray",
390
+ "marker-start"
391
+ ], xe = [
392
+ "x",
393
+ "y",
394
+ "text-anchor",
395
+ "font-size",
396
+ "font-weight",
397
+ "fill",
398
+ "stroke",
399
+ "stroke-width"
400
+ ], Se = ["x", "dy"], Ce = ["font-weight", "font-style"], we = 13, Te = "normal", Ee = 700, De = "var(--color-bg-0, #fff)", Oe = 3, ke = 1, Ae = 4, je = 6, Me = 1.2, Ne = .35, Pe = 3, Fe = /* @__PURE__ */ l({
401
+ __name: "ChartAnnotations",
402
+ props: {
403
+ annotations: { default: () => [] },
404
+ project: {},
405
+ bounds: { default: void 0 }
406
+ },
407
+ setup(t) {
408
+ let r = t;
409
+ function s(e) {
410
+ if (e !== void 0) return typeof e == "number" ? `${e} ${e}` : typeof e == "string" ? e : e.join(" ");
411
+ }
412
+ function c(e) {
413
+ let t = [], n = !1, r = !1, i = "", a = () => {
414
+ i && t.push({
415
+ text: i,
416
+ bold: n,
417
+ italic: r
418
+ }), i = "";
419
+ };
420
+ for (let t = 0; t < e.length; t++) {
421
+ let o = e[t];
422
+ o === "*" && e[t + 1] === "*" ? (a(), n = !n, t++) : o === "_" ? (a(), r = !r) : i += o;
423
+ }
424
+ return a(), t.length === 0 ? [{
425
+ text: "",
426
+ bold: !1,
427
+ italic: !1
428
+ }] : t;
429
+ }
430
+ let l = n(() => {
431
+ let e = [];
432
+ for (let t of r.annotations) {
433
+ let n = r.project(t.x, t.y);
434
+ if (!n || !isFinite(n.x) || !isFinite(n.y)) continue;
435
+ let i = t.pointer ?? "curved", a = i.startsWith("rule");
436
+ if (a && !r.bounds) continue;
437
+ let { x: o, y: l } = t.offset, f = n.x + o, p = n.y + l, m = t.color ?? "currentColor", h = t.fontSize ?? we, g = t.fontWeight ?? Te, _ = t.haloColor ?? De, v = t.haloWidth ?? Oe, y = t.lineColor ?? m, ee = t.lineWidth ?? ke, b = s(t.lineDash), te = t.textAnchor ?? (o > 0 ? "start" : o < 0 ? "end" : "middle"), x, S = "";
438
+ a && r.bounds ? x = u(i, n.x, n.y, r.bounds) : S = d(n.x, n.y, f, p, h, i), e.push({
439
+ lines: t.text.split("\n").map(c),
440
+ textX: f,
441
+ textY: p,
442
+ textAnchor: te,
443
+ dy: h * Me,
444
+ fontSize: h,
445
+ fontWeight: g,
446
+ color: m,
447
+ haloColor: _,
448
+ haloWidth: v,
449
+ pointerPath: S,
450
+ lineColor: y,
451
+ lineWidth: ee,
452
+ lineDash: b,
453
+ arrow: !a && (t.arrow ?? !0),
454
+ rule: x
455
+ });
456
+ }
457
+ return e;
458
+ });
459
+ function u(e, t, n, r) {
460
+ switch (e) {
461
+ case "ruleX": return {
462
+ x1: t,
463
+ y1: r.top,
464
+ x2: t,
465
+ y2: r.bottom
466
+ };
467
+ case "ruleY": return {
468
+ x1: r.left,
469
+ y1: n,
470
+ x2: r.right,
471
+ y2: n
472
+ };
473
+ case "ruleUp": return {
474
+ x1: t,
475
+ y1: r.bottom,
476
+ x2: t,
477
+ y2: n
478
+ };
479
+ case "ruleDown": return {
480
+ x1: t,
481
+ y1: r.top,
482
+ x2: t,
483
+ y2: n
484
+ };
485
+ case "ruleFromLeft": return {
486
+ x1: r.left,
487
+ y1: n,
488
+ x2: t,
489
+ y2: n
490
+ };
491
+ case "ruleFromRight": return {
492
+ x1: r.right,
493
+ y1: n,
494
+ x2: t,
495
+ y2: n
496
+ };
497
+ default: return {
498
+ x1: t,
499
+ y1: n,
500
+ x2: t,
501
+ y2: n
502
+ };
503
+ }
504
+ }
505
+ function d(e, t, n, r, i, a) {
506
+ if (a === "none") return "";
507
+ let o = n - e, s = r - t, c = r - i * Ne;
508
+ if (o === 0 || s === 0 || a === "straight") {
509
+ let i = s === 0 ? r : c, a = n - e, o = i - t, l = Math.hypot(a, o);
510
+ if (l <= Ae + je) return "";
511
+ let u = a / l, d = o / l;
512
+ return `M${e + u * Ae},${t + d * Ae} L${n - u * je},${i - d * je}`;
513
+ }
514
+ let l = c - t;
515
+ if (Math.abs(l) <= Ae || Math.abs(o) <= je) return "";
516
+ let u = Math.sign(o), d = Math.sign(l), f = e + u * Pe;
517
+ return `M${f},${t + d * Ae} Q${f},${c} ${n - u * je},${c}`;
518
+ }
519
+ return (t, n) => (_(), a(e, null, [n[0] ||= o("defs", null, [o("marker", {
520
+ id: "chart-annotation-arrow",
521
+ viewBox: "0 0 8 8",
522
+ refX: "7",
523
+ refY: "4",
524
+ markerWidth: "6",
525
+ markerHeight: "6",
526
+ orient: "auto-start-reverse",
527
+ markerUnits: "userSpaceOnUse"
528
+ }, [o("path", {
529
+ d: "M0,0 L8,4 L0,8 Z",
530
+ fill: "context-stroke"
531
+ })])], -1), o("g", ve, [(_(!0), a(e, null, y(l.value, (t, n) => (_(), a(e, { key: n }, [
532
+ t.rule ? (_(), a("line", {
533
+ key: 0,
534
+ x1: t.rule.x1,
535
+ y1: t.rule.y1,
536
+ x2: t.rule.x2,
537
+ y2: t.rule.y2,
538
+ stroke: t.lineColor,
539
+ "stroke-width": t.lineWidth,
540
+ "stroke-dasharray": t.lineDash,
541
+ "stroke-linecap": "round"
542
+ }, null, 8, ye)) : i("", !0),
543
+ t.pointerPath ? (_(), a("path", {
544
+ key: 1,
545
+ d: t.pointerPath,
546
+ fill: "none",
547
+ stroke: t.lineColor,
548
+ style: m({ color: t.lineColor }),
549
+ "stroke-width": t.lineWidth,
550
+ "stroke-dasharray": t.lineDash,
551
+ "stroke-linecap": "round",
552
+ "marker-start": t.arrow ? "url(#chart-annotation-arrow)" : void 0
553
+ }, null, 12, be)) : i("", !0),
554
+ o("text", {
555
+ x: t.textX,
556
+ y: t.textY,
557
+ "text-anchor": t.textAnchor,
558
+ "font-size": t.fontSize,
559
+ "font-weight": t.fontWeight,
560
+ fill: t.color,
561
+ stroke: t.haloColor,
562
+ "stroke-width": t.haloWidth,
563
+ "stroke-linejoin": "round",
564
+ "paint-order": "stroke fill"
565
+ }, [(_(!0), a(e, null, y(t.lines, (n, r) => (_(), a("tspan", {
566
+ key: r,
567
+ x: t.textX,
568
+ dy: r === 0 ? 0 : t.dy
569
+ }, [(_(!0), a(e, null, y(n, (e, t) => (_(), a("tspan", {
570
+ key: t,
571
+ "font-weight": e.bold ? Ee : void 0,
572
+ "font-style": e.italic ? "italic" : void 0
573
+ }, b(e.text), 9, Ce))), 128))], 8, Se))), 128))], 8, xe)
574
+ ], 64))), 128))])], 64));
575
+ }
576
+ }), Ie = 400, Le = 200;
577
+ function Re(e) {
578
+ let { containerRef: t, measuredWidth: r } = K({ debounce: e.debounce }), i = n(() => e.width() ?? (r.value || Ie)), a = n(() => e.height() ?? Le), { padding: o, legendY: s, innerW: c, innerH: l, bounds: u } = q({
579
+ title: e.title,
580
+ xLabel: e.xLabel,
581
+ yLabel: e.yLabel,
582
+ hasInlineLegend: e.hasInlineLegend,
583
+ width: () => i.value,
584
+ height: () => a.value,
585
+ extraPadding: e.chartPadding
586
+ }), { hoverIndex: d, tooltipRef: f, tooltipPos: p, handlers: m } = Y({
587
+ enabled: e.hasTooltipSlot,
588
+ trigger: e.tooltipTrigger,
589
+ clamp: () => e.tooltipClamp() ?? "chart",
590
+ pointerToIndex: e.pointerToIndex,
591
+ containerRef: t,
592
+ onHover: e.onHover
593
+ }), { svgRef: h, items: g, downloadLinkText: _, csvHref: v, resolvedFilename: y } = he({
594
+ filename: e.filename,
595
+ legacyMenuLabel: e.menu,
596
+ getCsv: e.getCsv,
597
+ downloadLink: e.downloadLink
598
+ });
599
+ return {
600
+ containerRef: t,
601
+ svgRef: h,
602
+ width: i,
603
+ height: a,
604
+ padding: o,
605
+ legendY: s,
606
+ innerW: c,
607
+ innerH: l,
608
+ bounds: u,
609
+ hoverIndex: d,
610
+ tooltipRef: f,
611
+ tooltipPos: p,
612
+ tooltipHandlers: m,
613
+ menuItems: g,
614
+ downloadLinkText: _,
615
+ csvHref: v,
616
+ menuFilename: y
617
+ };
618
+ }
619
+ function ze(e, t) {
620
+ return (n) => {
621
+ let r = e();
622
+ if (r) return r(n);
623
+ let i = t();
624
+ return i ? i(n) : W(n);
625
+ };
626
+ }
627
+ //#endregion
340
628
  //#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
341
- var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
629
+ var Be = ["width", "height"], Ve = ["x"], He = { key: 1 }, Ue = [
342
630
  "x1",
343
631
  "y1",
344
632
  "x2",
345
633
  "y2",
346
634
  "stroke",
347
635
  "stroke-dasharray"
348
- ], Se = [
636
+ ], We = [
349
637
  "cx",
350
638
  "cy",
351
639
  "fill",
352
640
  "fill-opacity",
353
641
  "stroke"
354
- ], Ce = ["x", "y"], we = [
642
+ ], Ge = ["x", "y"], Ke = [
355
643
  "x1",
356
644
  "y1",
357
645
  "x2",
358
646
  "y2"
359
- ], Te = [
647
+ ], qe = [
360
648
  "x1",
361
649
  "y1",
362
650
  "x2",
363
651
  "y2"
364
- ], Ee = [
652
+ ], Je = [
365
653
  "x1",
366
654
  "y1",
367
655
  "x2",
368
656
  "y2"
369
- ], De = [
657
+ ], Ye = [
370
658
  "x1",
371
659
  "y1",
372
660
  "x2",
373
661
  "y2"
374
- ], Oe = ["x", "y"], ke = ["transform"], Ae = [
662
+ ], Xe = ["x", "y"], Ze = ["transform"], Qe = [
375
663
  "x",
376
664
  "y",
377
665
  "text-anchor"
378
- ], je = ["x", "y"], Me = [
666
+ ], $e = ["x", "y"], et = [
379
667
  "d",
380
668
  "fill",
381
669
  "fill-opacity"
382
- ], Ne = [
670
+ ], tt = [
383
671
  "d",
384
672
  "stroke",
385
673
  "stroke-width",
386
674
  "stroke-opacity",
387
675
  "stroke-dasharray"
388
- ], Pe = [
676
+ ], nt = [
389
677
  "cx",
390
678
  "cy",
391
679
  "r",
392
680
  "fill",
393
681
  "fill-opacity",
394
682
  "stroke"
395
- ], Fe = [
683
+ ], rt = [
396
684
  "d",
397
685
  "fill",
398
686
  "fill-opacity"
399
- ], Ie = [
687
+ ], it = [
400
688
  "d",
401
689
  "stroke",
402
690
  "stroke-width",
403
691
  "stroke-dasharray"
404
- ], Le = [
692
+ ], at = [
405
693
  "x1",
406
694
  "y1",
407
695
  "x2",
@@ -409,7 +697,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
409
697
  "stroke",
410
698
  "stroke-width",
411
699
  "stroke-dasharray"
412
- ], Re = [
700
+ ], ot = [
413
701
  "x1",
414
702
  "y1",
415
703
  "x2",
@@ -417,44 +705,44 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
417
705
  "stroke",
418
706
  "stroke-width",
419
707
  "stroke-dasharray"
420
- ], ze = [
708
+ ], st = [
421
709
  "x1",
422
710
  "y1",
423
711
  "x2",
424
712
  "y2"
425
- ], Be = [
713
+ ], ct = [
426
714
  "x1",
427
715
  "y1",
428
716
  "x2",
429
717
  "y2"
430
- ], Ve = [
718
+ ], lt = [
431
719
  "x1",
432
720
  "y1",
433
721
  "x2",
434
722
  "y2"
435
- ], He = [
723
+ ], ut = [
436
724
  "cx",
437
725
  "cy",
438
726
  "fill"
439
- ], Ue = [
727
+ ], dt = [
440
728
  "x",
441
729
  "y",
442
730
  "width",
443
731
  "height"
444
- ], We = [
732
+ ], ft = [
445
733
  "cx",
446
734
  "cy",
447
735
  "fill",
448
736
  "fill-opacity",
449
737
  "stroke"
450
- ], Ge = [
738
+ ], pt = [
451
739
  "x",
452
740
  "y",
453
741
  "fill"
454
- ], Ke = ["x", "y"], qe = { class: "line-chart-tooltip" }, Je = {
742
+ ], mt = ["x", "y"], ht = { class: "line-chart-tooltip" }, gt = {
455
743
  key: 0,
456
744
  class: "line-chart-tooltip-label"
457
- }, Ye = ["href", "download"], Xe = 36, Ze = 12, Qe = 7, $e = 16, et = /* @__PURE__ */ V(/* @__PURE__ */ l({
745
+ }, _t = ["href", "download"], vt = 36, yt = 12, bt = 7, xt = 16, St = /* @__PURE__ */ B(/* @__PURE__ */ l({
458
746
  __name: "LineChart",
459
747
  props: {
460
748
  y: {},
@@ -463,82 +751,74 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
463
751
  series: {},
464
752
  areas: {},
465
753
  areaSections: {},
466
- width: {},
467
- height: {},
468
754
  lineOpacity: { default: 1 },
469
- title: {},
470
- xLabel: {},
471
- yLabel: {},
472
755
  yMin: {},
473
756
  xMin: {},
474
757
  xTicks: {},
475
758
  yTicks: {},
476
759
  xTickFormat: {},
477
760
  yTickFormat: {},
478
- tooltipValueFormat: {},
479
761
  xLabels: {},
762
+ xGrid: { type: Boolean },
763
+ yGrid: { type: Boolean },
764
+ width: {},
765
+ height: {},
766
+ title: {},
767
+ xLabel: {},
768
+ yLabel: {},
480
769
  debounce: {},
481
770
  menu: {
482
771
  type: [Boolean, String],
483
772
  default: !0
484
773
  },
485
- xGrid: { type: Boolean },
486
- yGrid: { type: Boolean },
487
774
  tooltipData: {},
488
775
  tooltipTrigger: {},
489
776
  tooltipClamp: { default: "chart" },
777
+ tooltipValueFormat: {},
490
778
  csv: {},
491
779
  filename: {},
492
- downloadLink: { type: [Boolean, String] }
780
+ downloadLink: { type: [Boolean, String] },
781
+ annotations: {},
782
+ chartPadding: {}
493
783
  },
494
784
  emits: ["hover"],
495
785
  setup(t, { emit: c }) {
496
- let l = t, f = c, { containerRef: h, measuredWidth: ee } = le({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => D.value.some((e) => e.legend) || l.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description)) || !1), { padding: S, innerW: C, innerH: w } = ue({
497
- title: () => l.title,
498
- xLabel: () => l.xLabel,
499
- yLabel: () => l.yLabel,
500
- hasInlineLegend: () => re.value,
501
- width: () => _.value,
502
- height: () => b.value
503
- }), T = [];
504
- function ie(e) {
786
+ let l = t, f = c, h = n(() => C.value.some((e) => e.legend) || l.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description)) || !1), g = [];
787
+ function v(e) {
505
788
  return {
506
789
  ...e,
507
- data: e.y ?? e.data ?? T
790
+ data: e.y ?? e.data ?? g
508
791
  };
509
792
  }
510
- function E(e) {
511
- return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.yTickFormat ? l.yTickFormat(e) : K(e);
512
- }
513
- let D = n(() => {
514
- if (l.series && l.series.length > 0) return l.series.map(ie);
793
+ let x = ze(() => l.tooltipValueFormat, () => l.yTickFormat), C = n(() => {
794
+ if (l.series && l.series.length > 0) return l.series.map(v);
515
795
  let e = l.y ?? l.data;
516
796
  return e ? [{
517
797
  data: e,
518
798
  x: l.x
519
799
  }] : [];
520
- }), O = n(() => l.areas ?? []), k = n(() => {
800
+ }), w = n(() => l.areas ?? []), T = n(() => {
521
801
  let e = 0;
522
- for (let t of D.value) t.data.length > e && (e = t.data.length);
523
- for (let t of O.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
802
+ for (let t of C.value) t.data.length > e && (e = t.data.length);
803
+ for (let t of w.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
524
804
  return e;
525
- }), A = n(() => D.value.some((e) => e.x != null) || O.value.some((e) => e.x != null));
526
- function j(e, t) {
805
+ }), E = n(() => C.value.some((e) => e.x != null) || w.value.some((e) => e.x != null));
806
+ function D(e, t) {
527
807
  return e.x ? Number(e.x[t]) : t;
528
808
  }
529
- function M(e, t) {
809
+ function O(e, t) {
530
810
  return e.x ? Number(e.x[t]) : t;
531
811
  }
532
- let N = n(() => A.value ? 0 : l.xMin ?? 0), ae = n(() => {
812
+ let k = n(() => E.value ? 0 : l.xMin ?? 0), A = n(() => {
533
813
  let e = Infinity, t = -Infinity;
534
- for (let n of D.value) for (let r = 0; r < n.data.length; r++) {
535
- let i = j(n, r);
814
+ for (let n of C.value) for (let r = 0; r < n.data.length; r++) {
815
+ let i = D(n, r);
536
816
  isFinite(i) && (i < e && (e = i), i > t && (t = i));
537
817
  }
538
- for (let n of O.value) {
818
+ for (let n of w.value) {
539
819
  let r = Math.max(n.upper.length, n.lower.length);
540
820
  for (let i = 0; i < r; i++) {
541
- let r = M(n, i);
821
+ let r = O(n, i);
542
822
  isFinite(r) && (r < e && (e = r), r > t && (t = r));
543
823
  }
544
824
  }
@@ -550,14 +830,14 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
550
830
  max: 0
551
831
  };
552
832
  });
553
- function P(e) {
554
- let { min: t, max: n } = ae.value, r = n - t || 1;
555
- return S.value.left + (e - t) / r * C.value;
833
+ function j(e) {
834
+ let { min: t, max: n } = A.value, r = n - t || 1;
835
+ return Y.value.left + (e - t) / r * Z.value;
556
836
  }
557
- let F = n(() => {
837
+ let M = n(() => {
558
838
  let e = Infinity, t = -Infinity;
559
- for (let n of D.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
560
- for (let n of O.value) {
839
+ for (let n of C.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
840
+ for (let n of w.value) {
561
841
  for (let r of n.upper) isFinite(r) && (r < e && (e = r), r > t && (t = r));
562
842
  for (let r of n.lower) isFinite(r) && (r < e && (e = r), r > t && (t = r));
563
843
  }
@@ -571,75 +851,75 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
571
851
  range: 1
572
852
  };
573
853
  });
574
- function oe(e) {
854
+ function N(e) {
575
855
  let t = e.data;
576
856
  if (t.length === 0) return "";
577
- let { min: n, range: r } = F.value, i = w.value / r, a = S.value.top + w.value, o = "", s = !1;
857
+ let { min: n, range: r } = M.value, i = Q.value / r, a = Y.value.top + Q.value, o = "", s = !1;
578
858
  for (let r = 0; r < t.length; r++) {
579
- let c = j(e, r);
859
+ let c = D(e, r);
580
860
  if (!isFinite(t[r]) || !isFinite(c)) {
581
861
  s = !1;
582
862
  continue;
583
863
  }
584
- let l = P(c), u = a - (t[r] - n) * i;
864
+ let l = j(c), u = a - (t[r] - n) * i;
585
865
  o += s ? `L${l},${u}` : `M${l},${u}`, s = !0;
586
866
  }
587
867
  return o;
588
868
  }
589
- function I(e) {
590
- let t = e.data, { min: n, range: r } = F.value, i = w.value / r, a = S.value.top + w.value, o = [];
869
+ function P(e) {
870
+ let t = e.data, { min: n, range: r } = M.value, i = Q.value / r, a = Y.value.top + Q.value, o = [];
591
871
  for (let r = 0; r < t.length; r++) {
592
- let s = j(e, r);
872
+ let s = D(e, r);
593
873
  !isFinite(t[r]) || !isFinite(s) || o.push({
594
- x: P(s),
874
+ x: j(s),
595
875
  y: a - (t[r] - n) * i
596
876
  });
597
877
  }
598
878
  return o;
599
879
  }
600
- function se(e) {
880
+ function ne(e) {
601
881
  let t = Math.min(e.upper.length, e.lower.length);
602
882
  if (t === 0) return "";
603
- let { min: n, range: r } = F.value, i = w.value / r, a = S.value.top + w.value, o = (e) => a - (e - n) * i, s = [], c = [];
604
- for (let n = 0; n < t; n++) isFinite(e.upper[n]) && isFinite(e.lower[n]) && isFinite(M(e, n)) ? c.push(n) : c.length && (s.push(c), c = []);
883
+ let { min: n, range: r } = M.value, i = Q.value / r, a = Y.value.top + Q.value, o = (e) => a - (e - n) * i, s = [], c = [];
884
+ for (let n = 0; n < t; n++) isFinite(e.upper[n]) && isFinite(e.lower[n]) && isFinite(O(e, n)) ? c.push(n) : c.length && (s.push(c), c = []);
605
885
  c.length && s.push(c);
606
886
  let l = "";
607
887
  for (let t of s) {
608
- l += `M${P(M(e, t[0]))},${o(e.upper[t[0]])}`;
609
- for (let n = 1; n < t.length; n++) l += `L${P(M(e, t[n]))},${o(e.upper[t[n]])}`;
610
- for (let n = t.length - 1; n >= 0; n--) l += `L${P(M(e, t[n]))},${o(e.lower[t[n]])}`;
888
+ l += `M${j(O(e, t[0]))},${o(e.upper[t[0]])}`;
889
+ for (let n = 1; n < t.length; n++) l += `L${j(O(e, t[n]))},${o(e.upper[t[n]])}`;
890
+ for (let n = t.length - 1; n >= 0; n--) l += `L${j(O(e, t[n]))},${o(e.lower[t[n]])}`;
611
891
  l += "Z";
612
892
  }
613
893
  return l;
614
894
  }
615
- function L(e, t) {
616
- let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && D.value[e.seriesIndex] || D.value[0];
617
- return P(r ? j(r, n) : n);
895
+ function F(e, t) {
896
+ let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && C.value[e.seriesIndex] || C.value[0];
897
+ return j(r ? D(r, n) : n);
618
898
  }
619
- function R(e, t = !0) {
620
- let n = S.value.top + w.value;
899
+ function re(e, t = !0) {
900
+ let n = Y.value.top + Q.value;
621
901
  if (e.seriesIndex == null) {
622
- let t = L(e, "start"), r = L(e, "end");
623
- return t > r ? "" : `M${t},${S.value.top}L${r},${S.value.top}L${r},${n}L${t},${n}Z`;
902
+ let t = F(e, "start"), r = F(e, "end");
903
+ return t > r ? "" : `M${t},${Y.value.top}L${r},${Y.value.top}L${r},${n}L${t},${n}Z`;
624
904
  }
625
- let r = D.value[e.seriesIndex];
905
+ let r = C.value[e.seriesIndex];
626
906
  if (!r) return "";
627
- let { min: i, range: a } = F.value, o = w.value / a, s = (e) => n - (e - i) * o, c = Math.max(0, e.startIndex), l = Math.min(r.data.length - 1, e.endIndex);
907
+ let { min: i, range: a } = M.value, o = Q.value / a, s = (e) => n - (e - i) * o, c = Math.max(0, e.startIndex), l = Math.min(r.data.length - 1, e.endIndex);
628
908
  if (c > l) return "";
629
- let u = `M${P(j(r, c))},${s(r.data[c])}`;
630
- for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${P(j(r, e))},${s(r.data[e])}`);
631
- return t && (u += `L${P(j(r, l))},${n}`, u += `L${P(j(r, c))},${n}`, u += "Z"), u;
909
+ let u = `M${j(D(r, c))},${s(r.data[c])}`;
910
+ for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${j(D(r, e))},${s(r.data[e])}`);
911
+ return t && (u += `L${j(D(r, l))},${n}`, u += `L${j(D(r, c))},${n}`, u += "Z"), u;
632
912
  }
633
- let z = n(() => {
913
+ let ie = n(() => {
634
914
  let e = l.areaSections;
635
915
  if (!e?.length) return {
636
916
  labels: [],
637
917
  extraHeight: 0
638
918
  };
639
- let t = [], n = S.value.left + C.value;
919
+ let t = [], n = Y.value.left + Z.value;
640
920
  for (let r of e) {
641
921
  if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
642
- let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Qe, o = L(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : D.value[r.seriesIndex]?.color ?? "currentColor");
922
+ let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * bt, o = F(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : C.value[r.seriesIndex]?.color ?? "currentColor");
643
923
  t.push({
644
924
  cx: c,
645
925
  labelText: e,
@@ -654,7 +934,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
654
934
  let r = [];
655
935
  for (let e of t) {
656
936
  let t = e.cx - e.textWidth / 2, n = 0;
657
- for (; n < r.length && !(t >= r[n] + $e);) n++;
937
+ for (; n < r.length && !(t >= r[n] + xt);) n++;
658
938
  e.row = n;
659
939
  let i = e.cx + e.textWidth / 2;
660
940
  r[n] = Math.max(r[n] ?? -Infinity, i);
@@ -664,11 +944,11 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
664
944
  extraHeight: 0
665
945
  } : {
666
946
  labels: t,
667
- extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Xe + Ze
947
+ extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * vt + yt
668
948
  };
669
- }), B = n(() => {
949
+ }), ae = n(() => {
670
950
  let e = [];
671
- for (let t of D.value) t.legend && e.push({
951
+ for (let t of C.value) t.legend && e.push({
672
952
  label: t.legend,
673
953
  color: t.color ?? "currentColor",
674
954
  type: "series",
@@ -677,7 +957,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
677
957
  let t = l.areaSections;
678
958
  if (t) for (let n of t) {
679
959
  if (n.legend !== "inline" || !n.label && !n.description) continue;
680
- let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : D.value[n.seriesIndex]?.color ?? "currentColor");
960
+ let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : C.value[n.seriesIndex]?.color ?? "currentColor");
681
961
  e.push({
682
962
  label: t,
683
963
  color: r,
@@ -686,41 +966,41 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
686
966
  });
687
967
  }
688
968
  return e;
689
- }), V = n(() => b.value + z.value.extraHeight), U = n(() => S.value.top + w.value + S.value.bottom + Ze), W = n(() => {
690
- let { min: e, max: t } = F.value, n = (t) => H(S.value.top + w.value - (t - e) / F.value.range * w.value), r = (e) => l.yTickFormat ? l.yTickFormat(e) : K(e);
969
+ }), oe = n(() => pe.value + ie.value.extraHeight), I = n(() => Y.value.top + Q.value + Y.value.bottom + yt), se = n(() => {
970
+ let { min: e, max: t } = M.value, n = (t) => V(Y.value.top + Q.value - (t - e) / M.value.range * Q.value), r = (e) => l.yTickFormat ? l.yTickFormat(e) : W(e);
691
971
  return e === t ? [{
692
972
  value: r(e),
693
- y: H(S.value.top + w.value / 2)
694
- }] : q({
973
+ y: V(Y.value.top + Q.value / 2)
974
+ }] : G({
695
975
  min: e,
696
976
  max: t,
697
977
  ticks: l.yTicks,
698
- targetTickCount: w.value / 50
978
+ targetTickCount: Q.value / 50
699
979
  }).map((e) => ({
700
980
  value: r(e),
701
981
  y: n(e)
702
982
  }));
703
- }), G = n(() => {
704
- let { min: e, max: t } = ae.value;
983
+ }), ce = n(() => {
984
+ let { min: e, max: t } = A.value;
705
985
  if (e === t) return [];
706
- let n = N.value, r = k.value, i = (e, t) => {
986
+ let n = k.value, r = T.value, i = (e, t) => {
707
987
  let r = e + n;
708
- return l.xTickFormat ? l.xTickFormat(r, t) : !A.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : K(r);
988
+ return l.xTickFormat ? l.xTickFormat(r, t) : !E.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : W(r);
709
989
  }, a;
710
- if (l.xTicks == null && !A.value && l.xLabels && l.xLabels.length === r) {
711
- let e = Math.max(3, Math.floor(C.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
990
+ if (l.xTicks == null && !E.value && l.xLabels && l.xLabels.length === r) {
991
+ let e = Math.max(3, Math.floor(Z.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
712
992
  a = [];
713
993
  for (let e = 0; e < r; e += t) a.push(e);
714
- } else a = q({
994
+ } else a = G({
715
995
  min: e,
716
996
  max: t,
717
997
  ticks: l.xTicks,
718
- targetTickCount: C.value / 80,
998
+ targetTickCount: Z.value / 80,
719
999
  displayOffset: n
720
1000
  });
721
- let o = S.value.left, s = S.value.left + C.value;
1001
+ let o = Y.value.left, s = Y.value.left + Z.value;
722
1002
  return a.map((e, t) => {
723
- let n = H(P(e)), r = "middle";
1003
+ let n = V(j(e)), r = "middle";
724
1004
  return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
725
1005
  value: i(e, t),
726
1006
  x: n,
@@ -728,49 +1008,49 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
728
1008
  };
729
1009
  });
730
1010
  });
731
- function J() {
732
- return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : he(D.value);
1011
+ function L() {
1012
+ return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : ge(C.value);
733
1013
  }
734
- let Y = n(() => !!l.tooltipData || !!l.tooltipTrigger), X = n(() => {
735
- let e = _e.value, t = D.value[0];
736
- return e === null || !t ? null : j(t, e);
737
- }), fe = n(() => X.value === null ? 0 : P(X.value));
738
- function Z(e, t) {
1014
+ let R = n(() => !!l.tooltipData || !!l.tooltipTrigger), z = n(() => {
1015
+ let e = he.value, t = C.value[0];
1016
+ return e === null || !t ? null : D(t, e);
1017
+ }), B = n(() => z.value === null ? 0 : j(z.value));
1018
+ function H(e, t) {
739
1019
  let n = e.data.length;
740
1020
  if (n === 0) return null;
741
1021
  let r = 0, i = Infinity;
742
1022
  for (let a = 0; a < n; a++) {
743
- let n = j(e, a);
1023
+ let n = D(e, a);
744
1024
  if (!isFinite(n)) continue;
745
1025
  let o = Math.abs(n - t);
746
1026
  o < i && (i = o, r = a);
747
1027
  }
748
1028
  return i === Infinity ? null : r;
749
1029
  }
750
- let pe = n(() => {
751
- let e = X.value;
1030
+ let ue = n(() => {
1031
+ let e = z.value;
752
1032
  if (e === null) return [];
753
- let { min: t, range: n } = F.value, r = w.value / n, i = S.value.top + w.value, a = [];
754
- for (let n of D.value) {
755
- let o = Z(n, e);
1033
+ let { min: t, range: n } = M.value, r = Q.value / n, i = Y.value.top + Q.value, a = [];
1034
+ for (let n of C.value) {
1035
+ let o = H(n, e);
756
1036
  if (o === null) continue;
757
1037
  let s = n.data[o];
758
1038
  isFinite(s) && a.push({
759
- x: P(j(n, o)),
1039
+ x: j(D(n, o)),
760
1040
  y: i - (s - t) * r,
761
1041
  color: n.color ?? "currentColor"
762
1042
  });
763
1043
  }
764
1044
  return a;
765
- }), Q = n(() => {
766
- let e = _e.value, t = X.value;
1045
+ }), U = n(() => {
1046
+ let e = he.value, t = z.value;
767
1047
  if (e === null || t === null) return null;
768
- let n = t + N.value, r;
769
- return r = l.xTickFormat ? l.xTickFormat(n, e) : A.value ? K(n) : l.xLabels?.[e], {
1048
+ let n = t + k.value, r;
1049
+ return r = l.xTickFormat ? l.xTickFormat(n, e) : E.value ? W(n) : l.xLabels?.[e], {
770
1050
  index: e,
771
1051
  xLabel: r,
772
- values: D.value.map((e, n) => {
773
- let r = Z(e, t);
1052
+ values: C.value.map((e, n) => {
1053
+ let r = H(e, t);
774
1054
  return {
775
1055
  value: r === null ? NaN : Number(e.data[r]),
776
1056
  color: e.color ?? "currentColor",
@@ -780,163 +1060,177 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
780
1060
  data: l.tooltipData?.[e] ?? null
781
1061
  };
782
1062
  });
783
- function ge(e) {
784
- let t = h.value?.getBoundingClientRect();
1063
+ function K(e, t) {
1064
+ if (!isFinite(e) || !isFinite(t)) return null;
1065
+ let n = e - k.value, { min: r, range: i } = M.value, a = Y.value.top + Q.value - (t - r) * (Q.value / i);
1066
+ return {
1067
+ x: j(n),
1068
+ y: a
1069
+ };
1070
+ }
1071
+ function de(e) {
1072
+ let t = q.value?.getBoundingClientRect();
785
1073
  if (!t) return null;
786
- let n = D.value[0];
1074
+ let n = C.value[0];
787
1075
  if (!n || n.data.length === 0) return null;
788
- let { min: r, max: i } = ae.value, a = i - r || 1;
789
- return Z(n, r + (e - t.left - S.value.left) / C.value * a);
1076
+ let { min: r, max: i } = A.value, a = i - r || 1;
1077
+ return H(n, r + (e - t.left - Y.value.left) / Z.value * a);
790
1078
  }
791
- let { hoverIndex: _e, tooltipRef: et, tooltipPos: $, handlers: tt } = de({
792
- enabled: () => Y.value,
793
- trigger: () => l.tooltipTrigger,
794
- clamp: () => l.tooltipClamp,
795
- pointerToIndex: ge,
796
- containerRef: h,
797
- onHover: (e) => f("hover", e)
798
- }), { svgRef: nt, items: rt, downloadLinkText: it, csvHref: at, resolvedFilename: ot } = me({
1079
+ let { containerRef: q, svgRef: J, width: fe, height: pe, padding: Y, legendY: X, innerW: Z, innerH: Q, bounds: me, hoverIndex: he, tooltipRef: _e, tooltipPos: $, tooltipHandlers: ve, menuItems: ye, downloadLinkText: be, csvHref: xe, menuFilename: Se } = Re({
1080
+ width: () => l.width,
1081
+ height: () => l.height,
1082
+ title: () => l.title,
1083
+ xLabel: () => l.xLabel,
1084
+ yLabel: () => l.yLabel,
1085
+ debounce: () => l.debounce,
1086
+ menu: () => l.menu,
1087
+ tooltipTrigger: () => l.tooltipTrigger,
1088
+ tooltipClamp: () => l.tooltipClamp,
799
1089
  filename: () => l.filename,
800
- legacyMenuLabel: () => l.menu,
801
- getCsv: J,
802
- downloadLink: () => l.downloadLink
1090
+ downloadLink: () => l.downloadLink,
1091
+ chartPadding: () => l.chartPadding,
1092
+ hasInlineLegend: () => h.value,
1093
+ hasTooltipSlot: () => R.value,
1094
+ getCsv: L,
1095
+ pointerToIndex: de,
1096
+ onHover: (e) => f("hover", e)
803
1097
  });
804
- return (n, c) => (g(), a("div", {
1098
+ return (n, c) => (_(), a("div", {
805
1099
  ref_key: "containerRef",
806
- ref: h,
1100
+ ref: q,
807
1101
  class: "line-chart-wrapper"
808
1102
  }, [
809
- t.menu ? (g(), r(ce, {
1103
+ t.menu ? (_(), r(le, {
810
1104
  key: 0,
811
- items: x(rt)
1105
+ items: S(ye)
812
1106
  }, null, 8, ["items"])) : i("", !0),
813
- (g(), a("svg", {
1107
+ (_(), a("svg", {
814
1108
  ref_key: "svgRef",
815
- ref: nt,
816
- width: _.value,
817
- height: V.value
1109
+ ref: J,
1110
+ width: S(fe),
1111
+ height: oe.value
818
1112
  }, [
819
- t.title ? (g(), a("text", {
1113
+ t.title ? (_(), a("text", {
820
1114
  key: 0,
821
- x: _.value / 2,
1115
+ x: S(fe) / 2,
822
1116
  y: 18,
823
1117
  "text-anchor": "middle",
824
1118
  "font-size": "14",
825
1119
  "font-weight": "600",
826
1120
  fill: "currentColor"
827
- }, y(t.title), 9, ye)) : i("", !0),
828
- B.value.length > 0 ? (g(), a("g", be, [(g(!0), a(e, null, v(B.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [t.type === "series" ? (g(), a("line", {
1121
+ }, b(t.title), 9, Ve)) : i("", !0),
1122
+ ae.value.length > 0 ? (_(), a("g", He, [(_(!0), a(e, null, y(ae.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [t.type === "series" ? (_(), a("line", {
829
1123
  key: 0,
830
- x1: x(S).left + n * 120,
831
- y1: x(S).top - x(20) / 2,
832
- x2: x(S).left + n * 120 + 12,
833
- y2: x(S).top - x(20) / 2,
1124
+ x1: S(Y).left + n * 120,
1125
+ y1: S(X),
1126
+ x2: S(Y).left + n * 120 + 12,
1127
+ y2: S(X),
834
1128
  stroke: t.color,
835
1129
  "stroke-width": "2",
836
1130
  "stroke-dasharray": t.dashed ? "4 2" : void 0
837
- }, null, 8, xe)) : (g(), a("circle", {
1131
+ }, null, 8, Ue)) : (_(), a("circle", {
838
1132
  key: 1,
839
- cx: x(S).left + n * 120 + 4,
840
- cy: x(S).top - x(20) / 2,
1133
+ cx: S(Y).left + n * 120 + 4,
1134
+ cy: S(X),
841
1135
  r: "4",
842
1136
  fill: t.color,
843
1137
  "fill-opacity": t.fillOpacity,
844
1138
  stroke: t.color,
845
1139
  "stroke-width": "1.5"
846
- }, null, 8, Se)), o("text", {
847
- x: x(S).left + n * 120 + 18,
848
- y: x(S).top - x(20) / 2 + 4,
1140
+ }, null, 8, We)), o("text", {
1141
+ x: S(Y).left + n * 120 + 18,
1142
+ y: S(X) + 4,
849
1143
  "font-size": "11",
850
1144
  fill: "currentColor"
851
- }, y(t.label), 9, Ce)], 64))), 128))])) : i("", !0),
1145
+ }, b(t.label), 9, Ge)], 64))), 128))])) : i("", !0),
852
1146
  o("line", {
853
- x1: x(H)(x(S).left),
854
- y1: x(H)(x(S).top),
855
- x2: x(H)(x(S).left),
856
- y2: x(H)(x(S).top + x(w)),
1147
+ x1: S(V)(S(Y).left),
1148
+ y1: S(V)(S(Y).top),
1149
+ x2: S(V)(S(Y).left),
1150
+ y2: S(V)(S(Y).top + S(Q)),
857
1151
  stroke: "currentColor",
858
1152
  "stroke-opacity": "0.3"
859
- }, null, 8, we),
1153
+ }, null, 8, Ke),
860
1154
  o("line", {
861
- x1: x(H)(x(S).left),
862
- y1: x(H)(x(S).top + x(w)),
863
- x2: x(H)(x(S).left + x(C)),
864
- y2: x(H)(x(S).top + x(w)),
1155
+ x1: S(V)(S(Y).left),
1156
+ y1: S(V)(S(Y).top + S(Q)),
1157
+ x2: S(V)(S(Y).left + S(Z)),
1158
+ y2: S(V)(S(Y).top + S(Q)),
865
1159
  stroke: "currentColor",
866
1160
  "stroke-opacity": "0.3"
867
- }, null, 8, Te),
868
- t.yGrid ? (g(!0), a(e, { key: 2 }, v(W.value, (e, t) => (g(), a("line", {
1161
+ }, null, 8, qe),
1162
+ t.yGrid ? (_(!0), a(e, { key: 2 }, y(se.value, (e, t) => (_(), a("line", {
869
1163
  key: "yg" + t,
870
- x1: x(S).left,
1164
+ x1: S(Y).left,
871
1165
  y1: e.y,
872
- x2: x(S).left + x(C),
1166
+ x2: S(Y).left + S(Z),
873
1167
  y2: e.y,
874
1168
  stroke: "currentColor",
875
1169
  "stroke-opacity": "0.1"
876
- }, null, 8, Ee))), 128)) : i("", !0),
877
- t.xGrid ? (g(!0), a(e, { key: 3 }, v(G.value, (e, t) => (g(), a("line", {
1170
+ }, null, 8, Je))), 128)) : i("", !0),
1171
+ t.xGrid ? (_(!0), a(e, { key: 3 }, y(ce.value, (e, t) => (_(), a("line", {
878
1172
  key: "xg" + t,
879
1173
  x1: e.x,
880
- y1: x(S).top,
1174
+ y1: S(Y).top,
881
1175
  x2: e.x,
882
- y2: x(S).top + x(w),
1176
+ y2: S(Y).top + S(Q),
883
1177
  stroke: "currentColor",
884
1178
  "stroke-opacity": "0.1"
885
- }, null, 8, De))), 128)) : i("", !0),
886
- (g(!0), a(e, null, v(W.value, (e, t) => (g(), a("text", {
1179
+ }, null, 8, Ye))), 128)) : i("", !0),
1180
+ (_(!0), a(e, null, y(se.value, (e, t) => (_(), a("text", {
887
1181
  key: "y" + t,
888
1182
  "data-testid": "y-tick",
889
- x: x(S).left - 6,
1183
+ x: S(Y).left - 6,
890
1184
  y: e.y,
891
1185
  "text-anchor": "end",
892
1186
  "dominant-baseline": "middle",
893
1187
  "font-size": "10",
894
1188
  fill: "currentColor",
895
1189
  "fill-opacity": "0.6"
896
- }, y(e.value), 9, Oe))), 128)),
897
- t.yLabel ? (g(), a("text", {
1190
+ }, b(e.value), 9, Xe))), 128)),
1191
+ t.yLabel ? (_(), a("text", {
898
1192
  key: 4,
899
1193
  x: 0,
900
1194
  y: 0,
901
- transform: `translate(14, ${x(S).top + x(w) / 2}) rotate(-90)`,
1195
+ transform: `translate(14, ${S(Y).top + S(Q) / 2}) rotate(-90)`,
902
1196
  "text-anchor": "middle",
903
1197
  "font-size": "13",
904
1198
  fill: "currentColor"
905
- }, y(t.yLabel), 9, ke)) : i("", !0),
906
- (g(!0), a(e, null, v(G.value, (e, t) => (g(), a("text", {
1199
+ }, b(t.yLabel), 9, Ze)) : i("", !0),
1200
+ (_(!0), a(e, null, y(ce.value, (e, t) => (_(), a("text", {
907
1201
  key: "x" + t,
908
1202
  "data-testid": "x-tick",
909
1203
  x: e.x,
910
- y: x(S).top + x(w) + 16,
1204
+ y: S(Y).top + S(Q) + 16,
911
1205
  "text-anchor": e.anchor,
912
1206
  "font-size": "10",
913
1207
  fill: "currentColor",
914
1208
  "fill-opacity": "0.6"
915
- }, y(e.value), 9, Ae))), 128)),
916
- t.xLabel ? (g(), a("text", {
1209
+ }, b(e.value), 9, Qe))), 128)),
1210
+ t.xLabel ? (_(), a("text", {
917
1211
  key: 5,
918
- x: x(S).left + x(C) / 2,
919
- y: b.value - 4,
1212
+ x: S(Y).left + S(Z) / 2,
1213
+ y: S(pe) - 4,
920
1214
  "text-anchor": "middle",
921
1215
  "font-size": "13",
922
1216
  fill: "currentColor"
923
- }, y(t.xLabel), 9, je)) : i("", !0),
924
- (g(!0), a(e, null, v(O.value, (e, t) => (g(), a("path", {
1217
+ }, b(t.xLabel), 9, $e)) : i("", !0),
1218
+ (_(!0), a(e, null, y(w.value, (e, t) => (_(), a("path", {
925
1219
  key: "area" + t,
926
- d: se(e),
1220
+ d: ne(e),
927
1221
  fill: e.color ?? "currentColor",
928
1222
  "fill-opacity": e.opacity ?? .2,
929
1223
  stroke: "none"
930
- }, null, 8, Me))), 128)),
931
- (g(!0), a(e, null, v(D.value, (n, r) => (g(), a(e, { key: r }, [n.line === !1 ? i("", !0) : (g(), a("path", {
1224
+ }, null, 8, et))), 128)),
1225
+ (_(!0), a(e, null, y(C.value, (n, r) => (_(), a(e, { key: r }, [n.line === !1 ? i("", !0) : (_(), a("path", {
932
1226
  key: 0,
933
- d: oe(n),
1227
+ d: N(n),
934
1228
  fill: "none",
935
1229
  stroke: n.color ?? "currentColor",
936
1230
  "stroke-width": n.strokeWidth ?? 1.5,
937
1231
  "stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
938
1232
  "stroke-dasharray": n.dashed ? "6 3" : void 0
939
- }, null, 8, Ne)), n.dots ? (g(!0), a(e, { key: 1 }, v(I(n), (e, r) => (g(), a("circle", {
1233
+ }, null, 8, tt)), n.dots ? (_(!0), a(e, { key: 1 }, y(P(n), (e, r) => (_(), a("circle", {
940
1234
  key: r,
941
1235
  cx: e.x,
942
1236
  cy: e.y,
@@ -944,68 +1238,68 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
944
1238
  fill: n.dotFill ?? n.color ?? "currentColor",
945
1239
  "fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
946
1240
  stroke: n.dotStroke ?? "none"
947
- }, null, 8, Pe))), 128)) : i("", !0)], 64))), 128)),
948
- (g(!0), a(e, null, v(t.areaSections ?? [], (t, n) => (g(), a(e, { key: "areasec" + n }, [
1241
+ }, null, 8, nt))), 128)) : i("", !0)], 64))), 128)),
1242
+ (_(!0), a(e, null, y(t.areaSections ?? [], (t, n) => (_(), a(e, { key: "areasec" + n }, [
949
1243
  o("path", {
950
- d: R(t),
951
- fill: t.color ?? (t.seriesIndex == null ? "#999" : D.value[t.seriesIndex]?.color ?? "currentColor"),
1244
+ d: re(t),
1245
+ fill: t.color ?? (t.seriesIndex == null ? "#999" : C.value[t.seriesIndex]?.color ?? "currentColor"),
952
1246
  "fill-opacity": t.opacity ?? .15,
953
1247
  stroke: "none"
954
- }, null, 8, Fe),
955
- t.seriesIndex == null ? i("", !0) : (g(), a("path", {
1248
+ }, null, 8, rt),
1249
+ t.seriesIndex == null ? i("", !0) : (_(), a("path", {
956
1250
  key: 0,
957
- d: R(t, !1),
1251
+ d: re(t, !1),
958
1252
  fill: "none",
959
- stroke: t.color ?? D.value[t.seriesIndex]?.color ?? "currentColor",
1253
+ stroke: t.color ?? C.value[t.seriesIndex]?.color ?? "currentColor",
960
1254
  "stroke-width": t.strokeWidth ?? 2,
961
1255
  "stroke-dasharray": t.dashed ? "6 3" : void 0
962
- }, null, 8, Ie)),
963
- t.seriesIndex == null ? (g(), a(e, { key: 1 }, [o("line", {
964
- x1: x(H)(L(t, "start")),
965
- y1: x(S).top,
966
- x2: x(H)(L(t, "start")),
967
- y2: x(S).top + x(w),
1256
+ }, null, 8, it)),
1257
+ t.seriesIndex == null ? (_(), a(e, { key: 1 }, [o("line", {
1258
+ x1: S(V)(F(t, "start")),
1259
+ y1: S(Y).top,
1260
+ x2: S(V)(F(t, "start")),
1261
+ y2: S(Y).top + S(Q),
968
1262
  stroke: t.color ?? "#999",
969
1263
  "stroke-width": t.strokeWidth ?? 2,
970
1264
  "stroke-dasharray": t.dashed ? "6 3" : void 0
971
- }, null, 8, Le), o("line", {
972
- x1: x(H)(L(t, "end")),
973
- y1: x(S).top,
974
- x2: x(H)(L(t, "end")),
975
- y2: x(S).top + x(w),
1265
+ }, null, 8, at), o("line", {
1266
+ x1: S(V)(F(t, "end")),
1267
+ y1: S(Y).top,
1268
+ x2: S(V)(F(t, "end")),
1269
+ y2: S(Y).top + S(Q),
976
1270
  stroke: t.color ?? "#999",
977
1271
  "stroke-width": t.strokeWidth ?? 2,
978
1272
  "stroke-dasharray": t.dashed ? "6 3" : void 0
979
- }, null, 8, Re)], 64)) : i("", !0),
1273
+ }, null, 8, ot)], 64)) : i("", !0),
980
1274
  o("line", {
981
- x1: x(H)(L(t, "start")),
982
- y1: x(S).top + x(w) - 4,
983
- x2: x(H)(L(t, "start")),
984
- y2: x(S).top + x(w) + 4,
1275
+ x1: S(V)(F(t, "start")),
1276
+ y1: S(Y).top + S(Q) - 4,
1277
+ x2: S(V)(F(t, "start")),
1278
+ y2: S(Y).top + S(Q) + 4,
985
1279
  stroke: "currentColor",
986
1280
  "stroke-opacity": "0.4"
987
- }, null, 8, ze),
1281
+ }, null, 8, st),
988
1282
  o("line", {
989
- x1: x(H)(L(t, "end")),
990
- y1: x(S).top + x(w) - 4,
991
- x2: x(H)(L(t, "end")),
992
- y2: x(S).top + x(w) + 4,
1283
+ x1: S(V)(F(t, "end")),
1284
+ y1: S(Y).top + S(Q) - 4,
1285
+ x2: S(V)(F(t, "end")),
1286
+ y2: S(Y).top + S(Q) + 4,
993
1287
  stroke: "currentColor",
994
1288
  "stroke-opacity": "0.4"
995
- }, null, 8, Be)
1289
+ }, null, 8, ct)
996
1290
  ], 64))), 128)),
997
- Y.value && x(_e) !== null ? (g(), a("line", {
1291
+ R.value && S(he) !== null ? (_(), a("line", {
998
1292
  key: 6,
999
- x1: x(H)(fe.value),
1000
- y1: x(S).top,
1001
- x2: x(H)(fe.value),
1002
- y2: x(S).top + x(w),
1293
+ x1: S(V)(B.value),
1294
+ y1: S(Y).top,
1295
+ x2: S(V)(B.value),
1296
+ y2: S(Y).top + S(Q),
1003
1297
  stroke: "currentColor",
1004
1298
  "stroke-opacity": "0.3",
1005
1299
  "stroke-dasharray": "4 2",
1006
1300
  "pointer-events": "none"
1007
- }, null, 8, Ve)) : i("", !0),
1008
- (g(!0), a(e, null, v(pe.value, (e, t) => (g(), a("circle", {
1301
+ }, null, 8, lt)) : i("", !0),
1302
+ (_(!0), a(e, null, y(ue.value, (e, t) => (_(), a("circle", {
1009
1303
  key: "hd" + t,
1010
1304
  cx: e.x,
1011
1305
  cy: e.y,
@@ -1014,104 +1308,110 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1014
1308
  stroke: "var(--color-bg-0, #fff)",
1015
1309
  "stroke-width": "2",
1016
1310
  "pointer-events": "none"
1017
- }, null, 8, He))), 128)),
1018
- Y.value ? (g(), a("rect", d({
1311
+ }, null, 8, ut))), 128)),
1312
+ R.value ? (_(), a("rect", d({
1019
1313
  key: 7,
1020
- x: x(S).left,
1021
- y: x(S).top,
1022
- width: x(C),
1023
- height: x(w),
1314
+ x: S(Y).left,
1315
+ y: S(Y).top,
1316
+ width: S(Z),
1317
+ height: S(Q),
1024
1318
  fill: "transparent",
1025
1319
  style: {
1026
1320
  cursor: "crosshair",
1027
1321
  "touch-action": "none"
1028
1322
  }
1029
- }, ne(x(tt), !0)), null, 16, Ue)) : i("", !0),
1030
- (g(!0), a(e, null, v(z.value.labels, (e, t) => (g(), a("g", { key: "seclab" + t }, [
1323
+ }, te(S(ve), !0)), null, 16, dt)) : i("", !0),
1324
+ t.annotations && t.annotations.length > 0 ? (_(), r(S(Fe), {
1325
+ key: 8,
1326
+ annotations: t.annotations,
1327
+ project: K,
1328
+ bounds: S(me)
1329
+ }, null, 8, ["annotations", "bounds"])) : i("", !0),
1330
+ (_(!0), a(e, null, y(ie.value.labels, (e, t) => (_(), a("g", { key: "seclab" + t }, [
1031
1331
  o("circle", {
1032
1332
  cx: e.cx - e.textWidth / 2 - 2,
1033
- cy: U.value + e.row * Xe + 4,
1333
+ cy: I.value + e.row * vt + 4,
1034
1334
  r: "4",
1035
1335
  fill: e.color,
1036
1336
  "fill-opacity": e.fillOpacity,
1037
1337
  stroke: e.color,
1038
1338
  "stroke-width": "1.5"
1039
- }, null, 8, We),
1040
- e.labelText ? (g(), a("text", {
1339
+ }, null, 8, ft),
1340
+ e.labelText ? (_(), a("text", {
1041
1341
  key: 0,
1042
1342
  x: e.cx - e.textWidth / 2 + 8,
1043
- y: U.value + e.row * Xe + 8,
1343
+ y: I.value + e.row * vt + 8,
1044
1344
  "font-size": "11",
1045
1345
  "font-weight": "600",
1046
1346
  fill: e.color
1047
- }, y(e.labelText), 9, Ge)) : i("", !0),
1048
- e.descText ? (g(), a("text", {
1347
+ }, b(e.labelText), 9, pt)) : i("", !0),
1348
+ e.descText ? (_(), a("text", {
1049
1349
  key: 1,
1050
1350
  x: e.cx - e.textWidth / 2 + 8,
1051
- y: U.value + e.row * Xe + 22,
1351
+ y: I.value + e.row * vt + 22,
1052
1352
  "font-size": "11",
1053
1353
  fill: "currentColor",
1054
1354
  "fill-opacity": "0.6"
1055
- }, y(e.descText), 9, Ke)) : i("", !0)
1355
+ }, b(e.descText), 9, mt)) : i("", !0)
1056
1356
  ]))), 128))
1057
- ], 8, ve)),
1058
- Y.value && x(_e) !== null && Q.value ? (g(), a("div", {
1357
+ ], 8, Be)),
1358
+ R.value && S(he) !== null && U.value ? (_(), a("div", {
1059
1359
  key: 1,
1060
1360
  ref_key: "tooltipRef",
1061
- ref: et,
1361
+ ref: _e,
1062
1362
  class: "chart-tooltip-content",
1063
1363
  style: m({
1064
1364
  position: "absolute",
1065
1365
  top: "0",
1066
1366
  left: "0",
1067
1367
  willChange: "transform",
1068
- transform: x($) ? `translate3d(${x($).left}px, ${x($).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1069
- visibility: x($) ? "visible" : "hidden"
1368
+ transform: S($) ? `translate3d(${S($).left}px, ${S($).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1369
+ visibility: S($) ? "visible" : "hidden"
1070
1370
  })
1071
- }, [te(n.$slots, "tooltip", p(u(Q.value)), () => [o("div", qe, [Q.value.xLabel ? (g(), a("div", Je, y(Q.value.xLabel), 1)) : i("", !0), (g(!0), a(e, null, v(Q.value.values, (e) => (g(), a("div", {
1371
+ }, [ee(n.$slots, "tooltip", p(u(U.value)), () => [o("div", ht, [U.value.xLabel ? (_(), a("div", gt, b(U.value.xLabel), 1)) : i("", !0), (_(!0), a(e, null, y(U.value.values, (e) => (_(), a("div", {
1072
1372
  key: e.seriesIndex,
1073
1373
  class: "line-chart-tooltip-row"
1074
1374
  }, [o("span", {
1075
1375
  class: "line-chart-tooltip-swatch",
1076
1376
  style: m({ background: e.color })
1077
- }, null, 4), s(" " + y(isFinite(e.value) ? E(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
1078
- x(it) ? (g(), a("a", {
1377
+ }, null, 4), s(" " + b(isFinite(e.value) ? S(x)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
1378
+ S(be) ? (_(), a("a", {
1079
1379
  key: 2,
1080
1380
  class: "line-chart-download-link",
1081
- href: x(at),
1082
- download: `${x(ot)()}.csv`
1083
- }, y(x(it)), 9, Ye)) : i("", !0)
1381
+ href: S(xe),
1382
+ download: `${S(Se)()}.csv`
1383
+ }, b(S(be)), 9, _t)) : i("", !0)
1084
1384
  ], 512));
1085
1385
  }
1086
- }), [["__scopeId", "data-v-083d1c2f"]]), $ = ["width", "height"], tt = ["x"], nt = { key: 1 }, rt = [
1386
+ }), [["__scopeId", "data-v-ebe2731e"]]), Ct = ["width", "height"], wt = ["x"], Tt = { key: 1 }, Et = [
1087
1387
  "x",
1088
1388
  "y",
1089
1389
  "fill"
1090
- ], it = ["x", "y"], at = [
1390
+ ], Dt = ["x", "y"], Ot = [
1091
1391
  "x1",
1092
1392
  "y1",
1093
1393
  "x2",
1094
1394
  "y2"
1095
- ], ot = [
1395
+ ], kt = [
1096
1396
  "x1",
1097
1397
  "y1",
1098
1398
  "x2",
1099
1399
  "y2"
1100
- ], st = [
1400
+ ], At = [
1101
1401
  "x1",
1102
1402
  "y1",
1103
1403
  "x2",
1104
1404
  "y2"
1105
- ], ct = [
1405
+ ], jt = [
1106
1406
  "x",
1107
1407
  "y",
1108
1408
  "width",
1109
1409
  "height"
1110
- ], lt = ["x", "y"], ut = ["x", "y"], dt = ["transform"], ft = [
1410
+ ], Mt = ["x", "y"], Nt = ["x", "y"], Pt = ["transform"], Ft = [
1111
1411
  "x",
1112
1412
  "y",
1113
1413
  "text-anchor"
1114
- ], pt = ["x", "y"], mt = ["x", "y"], ht = [
1414
+ ], It = ["x", "y"], Lt = ["x", "y"], Rt = [
1115
1415
  "data-category",
1116
1416
  "data-series",
1117
1417
  "x",
@@ -1120,15 +1420,15 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1120
1420
  "height",
1121
1421
  "fill",
1122
1422
  "fill-opacity"
1123
- ], gt = [
1423
+ ], zt = [
1124
1424
  "x",
1125
1425
  "y",
1126
1426
  "width",
1127
1427
  "height"
1128
- ], _t = { class: "bar-chart-tooltip" }, vt = {
1428
+ ], Bt = { class: "bar-chart-tooltip" }, Vt = {
1129
1429
  key: 0,
1130
1430
  class: "bar-chart-tooltip-label"
1131
- }, yt = ["href", "download"], bt = /* @__PURE__ */ V(/* @__PURE__ */ l({
1431
+ }, Ht = ["href", "download"], Ut = /* @__PURE__ */ B(/* @__PURE__ */ l({
1132
1432
  __name: "BarChart",
1133
1433
  props: {
1134
1434
  data: {},
@@ -1137,78 +1437,73 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1137
1437
  categories: {},
1138
1438
  orientation: { default: "vertical" },
1139
1439
  layout: { default: "grouped" },
1140
- width: {},
1141
- height: {},
1142
- title: {},
1143
- xLabel: {},
1144
- yLabel: {},
1145
1440
  valueMin: { default: 0 },
1146
1441
  valueTicks: {},
1147
1442
  valueTickFormat: {},
1148
- tooltipValueFormat: {},
1149
1443
  categoryFormat: {},
1150
1444
  barPadding: { default: .2 },
1151
1445
  groupGap: { default: 1 },
1446
+ valueGrid: {
1447
+ type: Boolean,
1448
+ default: !0
1449
+ },
1450
+ width: {},
1451
+ height: {},
1452
+ title: {},
1453
+ xLabel: {},
1454
+ yLabel: {},
1152
1455
  debounce: {},
1153
1456
  menu: {
1154
1457
  type: [Boolean, String],
1155
1458
  default: !0
1156
1459
  },
1157
- valueGrid: {
1158
- type: Boolean,
1159
- default: !0
1160
- },
1161
1460
  tooltipData: {},
1162
1461
  tooltipTrigger: {},
1163
1462
  tooltipClamp: { default: "chart" },
1463
+ tooltipValueFormat: {},
1164
1464
  csv: {},
1165
1465
  filename: {},
1166
- downloadLink: { type: [Boolean, String] }
1466
+ downloadLink: { type: [Boolean, String] },
1467
+ annotations: {},
1468
+ chartPadding: {}
1167
1469
  },
1168
1470
  emits: ["hover"],
1169
1471
  setup(t, { emit: c }) {
1170
- let l = t, f = c, { containerRef: h, measuredWidth: ee } = le({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => E.value.some((e) => e.legend)), { padding: S, innerW: C, innerH: w } = ue({
1171
- title: () => l.title,
1172
- xLabel: () => l.xLabel,
1173
- yLabel: () => l.yLabel,
1174
- hasInlineLegend: () => re.value,
1175
- width: () => _.value,
1176
- height: () => b.value
1177
- }), T = [];
1178
- function ie(e) {
1472
+ let l = t, f = c, h = n(() => x.value.some((e) => e.legend)), g = [];
1473
+ function v(e) {
1179
1474
  return {
1180
- data: e.y ?? e.data ?? T,
1475
+ data: e.y ?? e.data ?? g,
1181
1476
  color: e.color,
1182
1477
  opacity: e.opacity,
1183
1478
  legend: e.legend
1184
1479
  };
1185
1480
  }
1186
- let E = n(() => {
1187
- if (l.series && l.series.length > 0) return l.series.map(ie);
1481
+ let x = n(() => {
1482
+ if (l.series && l.series.length > 0) return l.series.map(v);
1188
1483
  let e = l.y ?? l.data;
1189
1484
  return e ? [{ data: e }] : [];
1190
- }), D = n(() => {
1485
+ }), C = n(() => {
1191
1486
  let e = l.categories?.length ?? 0;
1192
- for (let t of E.value) t.data.length > e && (e = t.data.length);
1487
+ for (let t of x.value) t.data.length > e && (e = t.data.length);
1193
1488
  return e;
1194
- }), O = n(() => {
1195
- let e = D.value, t = Array(e);
1489
+ }), w = n(() => {
1490
+ let e = C.value, t = Array(e);
1196
1491
  for (let n = 0; n < e; n++) t[n] = l.categories?.[n] ?? String(n);
1197
1492
  return t;
1198
- }), k = n(() => l.orientation === "vertical"), A = n(() => {
1493
+ }), T = n(() => l.orientation === "vertical"), E = n(() => {
1199
1494
  let e = Infinity, t = -Infinity;
1200
1495
  if (l.layout === "stacked") {
1201
- let n = D.value;
1496
+ let n = C.value;
1202
1497
  for (let r = 0; r < n; r++) {
1203
1498
  let n = 0, i = 0;
1204
- for (let e of E.value) {
1499
+ for (let e of x.value) {
1205
1500
  if (r >= e.data.length) continue;
1206
1501
  let t = Number(e.data[r]);
1207
1502
  isFinite(t) && (t >= 0 ? n += t : i += t);
1208
1503
  }
1209
1504
  n > t && (t = n), i < e && (e = i);
1210
1505
  }
1211
- } else for (let n of E.value) for (let r of n.data) {
1506
+ } else for (let n of x.value) for (let r of n.data) {
1212
1507
  let n = Number(r);
1213
1508
  isFinite(n) && (n < e && (e = n), n > t && (t = n));
1214
1509
  }
@@ -1221,30 +1516,30 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1221
1516
  max: t,
1222
1517
  range: r
1223
1518
  };
1224
- }), j = n(() => k.value ? C.value : w.value), M = n(() => k.value ? w.value : C.value), N = n(() => {
1225
- let e = D.value;
1226
- return e > 0 ? j.value / e : 0;
1227
- }), ae = n(() => N.value * (1 - l.barPadding)), P = n(() => {
1228
- let e = E.value.length;
1519
+ }), D = n(() => T.value ? q.value : J.value), O = n(() => T.value ? J.value : q.value), k = n(() => {
1520
+ let e = C.value;
1521
+ return e > 0 ? D.value / e : 0;
1522
+ }), A = n(() => k.value * (1 - l.barPadding)), j = n(() => {
1523
+ let e = x.value.length;
1229
1524
  if (e === 0) return 0;
1230
- if (l.layout === "stacked" || e === 1) return ae.value;
1525
+ if (l.layout === "stacked" || e === 1) return A.value;
1231
1526
  let t = l.groupGap * (e - 1);
1232
- return Math.max(1, (ae.value - t) / e);
1527
+ return Math.max(1, (A.value - t) / e);
1233
1528
  });
1234
- function F(e) {
1235
- return (k.value ? S.value.left : S.value.top) + e * N.value;
1529
+ function M(e) {
1530
+ return (T.value ? K.value.left : K.value.top) + e * k.value;
1236
1531
  }
1237
- let oe = n(() => {
1238
- let { min: e, max: t } = A.value, n = l.valueMin ?? 0;
1239
- return I(Math.max(e, Math.min(t, n)));
1532
+ let N = n(() => {
1533
+ let { min: e, max: t } = E.value, n = l.valueMin ?? 0;
1534
+ return P(Math.max(e, Math.min(t, n)));
1240
1535
  });
1241
- function I(e) {
1242
- let { min: t, range: n } = A.value, r = M.value / n;
1243
- return k.value ? S.value.top + w.value - (e - t) * r : S.value.left + (e - t) * r;
1536
+ function P(e) {
1537
+ let { min: t, range: n } = E.value, r = O.value / n;
1538
+ return T.value ? K.value.top + J.value - (e - t) * r : K.value.left + (e - t) * r;
1244
1539
  }
1245
- function se(e, t, n, r, i, a, o, s, c) {
1540
+ function ne(e, t, n, r, i, a, o, s, c) {
1246
1541
  let l = Math.min(e, t), u = Math.abs(e - t);
1247
- return k.value ? {
1542
+ return T.value ? {
1248
1543
  x: n,
1249
1544
  y: l,
1250
1545
  w: r,
@@ -1266,29 +1561,29 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1266
1561
  seriesIndex: c
1267
1562
  };
1268
1563
  }
1269
- let L = n(() => {
1270
- let e = [], t = E.value, n = t.length;
1564
+ let F = n(() => {
1565
+ let e = [], t = x.value, n = t.length;
1271
1566
  if (n === 0) return e;
1272
- let r = D.value, i = N.value, a = ae.value, o = P.value, s = (i - a) / 2, c = oe.value;
1567
+ let r = C.value, i = k.value, a = A.value, o = j.value, s = (i - a) / 2, c = N.value;
1273
1568
  for (let i = 0; i < r; i++) {
1274
- let r = F(i) + s;
1569
+ let r = M(i) + s;
1275
1570
  if (l.layout === "stacked") {
1276
1571
  let o = 0, s = 0;
1277
1572
  for (let c = 0; c < n; c++) {
1278
1573
  let n = t[c], l = Number(n.data[i] ?? NaN);
1279
1574
  if (!isFinite(l)) continue;
1280
1575
  let u = l >= 0 ? o : s, d = u + l;
1281
- e.push(se(I(u), I(d), r, a, n.color ?? z(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
1576
+ e.push(ne(P(u), P(d), r, a, n.color ?? ie(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
1282
1577
  }
1283
1578
  } else for (let a = 0; a < n; a++) {
1284
1579
  let s = t[a], u = Number(s.data[i] ?? NaN);
1285
1580
  if (!isFinite(u)) continue;
1286
1581
  let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
1287
- e.push(se(c, I(u), d, o, s.color ?? z(a), s.opacity ?? 1, u, i, a));
1582
+ e.push(ne(c, P(u), d, o, s.color ?? ie(a), s.opacity ?? 1, u, i, a));
1288
1583
  }
1289
1584
  }
1290
1585
  return e;
1291
- }), R = [
1586
+ }), re = [
1292
1587
  "var(--color-primary, #3b82f6)",
1293
1588
  "var(--color-accent, #f59e0b)",
1294
1589
  "var(--color-success, #10b981)",
@@ -1296,238 +1591,252 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1296
1591
  "var(--color-info, #6366f1)",
1297
1592
  "var(--color-warning, #d97706)"
1298
1593
  ];
1299
- function z(e) {
1300
- return R[e % R.length];
1301
- }
1302
- function B(e) {
1303
- return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.valueTickFormat ? l.valueTickFormat(e) : K(e);
1594
+ function ie(e) {
1595
+ return re[e % re.length];
1304
1596
  }
1305
- let V = n(() => {
1306
- let { min: e, max: t } = A.value, n = (e) => l.valueTickFormat ? l.valueTickFormat(e) : K(e);
1597
+ let ae = ze(() => l.tooltipValueFormat, () => l.valueTickFormat), oe = n(() => {
1598
+ let { min: e, max: t } = E.value, n = (e) => l.valueTickFormat ? l.valueTickFormat(e) : W(e);
1307
1599
  if (e === t) return [{
1308
1600
  value: n(e),
1309
- pos: H(I(e))
1601
+ pos: V(P(e))
1310
1602
  }];
1311
- let r = k.value ? 50 : 80;
1312
- return q({
1603
+ let r = T.value ? 50 : 80;
1604
+ return G({
1313
1605
  min: e,
1314
1606
  max: t,
1315
1607
  ticks: l.valueTicks,
1316
- targetTickCount: M.value / r
1608
+ targetTickCount: O.value / r
1317
1609
  }).map((e) => ({
1318
1610
  value: n(e),
1319
- pos: H(I(e))
1611
+ pos: V(P(e))
1320
1612
  }));
1321
- }), U = n(() => {
1322
- let e = [], t = D.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
1613
+ }), I = n(() => {
1614
+ let e = [], t = C.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
1323
1615
  for (let r = 0; r < t; r++) {
1324
- let t = F(r) + N.value / 2;
1616
+ let t = M(r) + k.value / 2;
1325
1617
  e.push({
1326
- label: n(O.value[r], r),
1618
+ label: n(w.value[r], r),
1327
1619
  pos: t,
1328
1620
  anchor: "middle"
1329
1621
  });
1330
1622
  }
1331
1623
  return e;
1332
- }), W = n(() => {
1624
+ }), se = n(() => {
1333
1625
  let e = [];
1334
- return E.value.forEach((t, n) => {
1626
+ return x.value.forEach((t, n) => {
1335
1627
  t.legend && e.push({
1336
1628
  label: t.legend,
1337
- color: t.color ?? z(n)
1629
+ color: t.color ?? ie(n)
1338
1630
  });
1339
1631
  }), e;
1340
1632
  });
1341
- function G() {
1633
+ function ce() {
1342
1634
  if (typeof l.csv == "function") return l.csv();
1343
1635
  if (typeof l.csv == "string") return l.csv;
1344
- let e = E.value.map((e) => ({
1636
+ let e = x.value.map((e) => ({
1345
1637
  label: e.legend,
1346
1638
  data: e.data
1347
1639
  }));
1348
- return ge(O.value, e);
1640
+ return _e(w.value, e);
1349
1641
  }
1350
- let J = n(() => !!l.tooltipData || !!l.tooltipTrigger);
1351
- function Y(e, t) {
1352
- let n = h.value?.getBoundingClientRect();
1642
+ let L = n(() => !!l.tooltipData || !!l.tooltipTrigger);
1643
+ function R(e, t) {
1644
+ if (!isFinite(e) || !isFinite(t) || k.value === 0) return null;
1645
+ let n = (T.value ? K.value.left : K.value.top) + (e + .5) * k.value, r = P(t);
1646
+ return T.value ? {
1647
+ x: n,
1648
+ y: r
1649
+ } : {
1650
+ x: r,
1651
+ y: n
1652
+ };
1653
+ }
1654
+ function z(e, t) {
1655
+ let n = B.value?.getBoundingClientRect();
1353
1656
  if (!n) return null;
1354
- let r = D.value;
1355
- if (r === 0 || N.value === 0) return null;
1356
- let i = k.value ? e - n.left - S.value.left : t - n.top - S.value.top;
1357
- return Math.max(0, Math.min(r - 1, Math.floor(i / N.value)));
1657
+ let r = C.value;
1658
+ if (r === 0 || k.value === 0) return null;
1659
+ let i = T.value ? e - n.left - K.value.left : t - n.top - K.value.top;
1660
+ return Math.max(0, Math.min(r - 1, Math.floor(i / k.value)));
1358
1661
  }
1359
- let { hoverIndex: X, tooltipRef: fe, tooltipPos: Z, handlers: pe } = de({
1360
- enabled: () => J.value,
1361
- trigger: () => l.tooltipTrigger,
1362
- clamp: () => l.tooltipClamp,
1363
- pointerToIndex: Y,
1364
- containerRef: h,
1365
- onHover: (e) => f("hover", e)
1366
- }), { svgRef: Q, items: he, downloadLinkText: _e, csvHref: ve, resolvedFilename: ye } = me({
1662
+ let { containerRef: B, svgRef: H, width: ue, height: U, padding: K, legendY: de, innerW: q, innerH: J, bounds: fe, hoverIndex: pe, tooltipRef: Y, tooltipPos: X, tooltipHandlers: Z, menuItems: Q, downloadLinkText: me, csvHref: he, menuFilename: ge } = Re({
1663
+ width: () => l.width,
1664
+ height: () => l.height,
1665
+ title: () => l.title,
1666
+ xLabel: () => l.xLabel,
1667
+ yLabel: () => l.yLabel,
1668
+ debounce: () => l.debounce,
1669
+ menu: () => l.menu,
1670
+ tooltipTrigger: () => l.tooltipTrigger,
1671
+ tooltipClamp: () => l.tooltipClamp,
1367
1672
  filename: () => l.filename,
1368
- legacyMenuLabel: () => l.menu,
1369
- getCsv: G,
1370
- downloadLink: () => l.downloadLink
1371
- }), be = n(() => {
1372
- let e = X.value;
1373
- if (e !== null) return O.value[e];
1374
- }), xe = n(() => {
1375
- let e = X.value;
1673
+ downloadLink: () => l.downloadLink,
1674
+ chartPadding: () => l.chartPadding,
1675
+ hasInlineLegend: () => h.value,
1676
+ hasTooltipSlot: () => L.value,
1677
+ getCsv: ce,
1678
+ pointerToIndex: z,
1679
+ onHover: (e) => f("hover", e)
1680
+ }), $ = n(() => {
1681
+ let e = pe.value;
1682
+ if (e !== null) return w.value[e];
1683
+ }), ve = n(() => {
1684
+ let e = pe.value;
1376
1685
  return e === null ? null : {
1377
1686
  index: e,
1378
- category: O.value[e] ?? String(e),
1379
- values: E.value.map((t, n) => ({
1687
+ category: w.value[e] ?? String(e),
1688
+ values: x.value.map((t, n) => ({
1380
1689
  value: Number(t.data[e] ?? NaN),
1381
- color: t.color ?? z(n),
1690
+ color: t.color ?? ie(n),
1382
1691
  seriesIndex: n
1383
1692
  })),
1384
1693
  data: l.tooltipData?.[e] ?? null
1385
1694
  };
1386
- }), Se = n(() => {
1387
- let e = X.value;
1695
+ }), ye = n(() => {
1696
+ let e = pe.value;
1388
1697
  if (e === null) return null;
1389
- let t = F(e);
1390
- return k.value ? {
1698
+ let t = M(e);
1699
+ return T.value ? {
1391
1700
  x: t,
1392
- y: S.value.top,
1393
- w: N.value,
1394
- h: w.value
1701
+ y: K.value.top,
1702
+ w: k.value,
1703
+ h: J.value
1395
1704
  } : {
1396
- x: S.value.left,
1705
+ x: K.value.left,
1397
1706
  y: t,
1398
- w: C.value,
1399
- h: N.value
1707
+ w: q.value,
1708
+ h: k.value
1400
1709
  };
1401
1710
  });
1402
- return (n, c) => (g(), a("div", {
1711
+ return (n, c) => (_(), a("div", {
1403
1712
  ref_key: "containerRef",
1404
- ref: h,
1713
+ ref: B,
1405
1714
  class: "bar-chart-wrapper"
1406
1715
  }, [
1407
- t.menu ? (g(), r(ce, {
1716
+ t.menu ? (_(), r(le, {
1408
1717
  key: 0,
1409
- items: x(he)
1718
+ items: S(Q)
1410
1719
  }, null, 8, ["items"])) : i("", !0),
1411
- (g(), a("svg", {
1720
+ (_(), a("svg", {
1412
1721
  ref_key: "svgRef",
1413
- ref: Q,
1414
- width: _.value,
1415
- height: b.value
1722
+ ref: H,
1723
+ width: S(ue),
1724
+ height: S(U)
1416
1725
  }, [
1417
- t.title ? (g(), a("text", {
1726
+ t.title ? (_(), a("text", {
1418
1727
  key: 0,
1419
- x: _.value / 2,
1728
+ x: S(ue) / 2,
1420
1729
  y: 18,
1421
1730
  "text-anchor": "middle",
1422
1731
  "font-size": "14",
1423
1732
  "font-weight": "600",
1424
1733
  fill: "currentColor"
1425
- }, y(t.title), 9, tt)) : i("", !0),
1426
- W.value.length > 0 ? (g(), a("g", nt, [(g(!0), a(e, null, v(W.value, (t, n) => (g(), a(e, { key: "ileg" + n }, [o("rect", {
1427
- x: x(S).left + n * 120,
1428
- y: x(S).top - x(20) / 2 - 5,
1734
+ }, b(t.title), 9, wt)) : i("", !0),
1735
+ se.value.length > 0 ? (_(), a("g", Tt, [(_(!0), a(e, null, y(se.value, (t, n) => (_(), a(e, { key: "ileg" + n }, [o("rect", {
1736
+ x: S(K).left + n * 120,
1737
+ y: S(de) - 5,
1429
1738
  width: "12",
1430
1739
  height: "10",
1431
1740
  fill: t.color
1432
- }, null, 8, rt), o("text", {
1433
- x: x(S).left + n * 120 + 18,
1434
- y: x(S).top - x(20) / 2 + 4,
1741
+ }, null, 8, Et), o("text", {
1742
+ x: S(K).left + n * 120 + 18,
1743
+ y: S(de) + 4,
1435
1744
  "font-size": "11",
1436
1745
  fill: "currentColor"
1437
- }, y(t.label), 9, it)], 64))), 128))])) : i("", !0),
1746
+ }, b(t.label), 9, Dt)], 64))), 128))])) : i("", !0),
1438
1747
  o("line", {
1439
- x1: x(H)(x(S).left),
1440
- y1: x(H)(x(S).top),
1441
- x2: x(H)(x(S).left),
1442
- y2: x(H)(x(S).top + x(w)),
1748
+ x1: S(V)(S(K).left),
1749
+ y1: S(V)(S(K).top),
1750
+ x2: S(V)(S(K).left),
1751
+ y2: S(V)(S(K).top + S(J)),
1443
1752
  stroke: "currentColor",
1444
1753
  "stroke-opacity": "0.3"
1445
- }, null, 8, at),
1754
+ }, null, 8, Ot),
1446
1755
  o("line", {
1447
- x1: x(H)(x(S).left),
1448
- y1: x(H)(x(S).top + x(w)),
1449
- x2: x(H)(x(S).left + x(C)),
1450
- y2: x(H)(x(S).top + x(w)),
1756
+ x1: S(V)(S(K).left),
1757
+ y1: S(V)(S(K).top + S(J)),
1758
+ x2: S(V)(S(K).left + S(q)),
1759
+ y2: S(V)(S(K).top + S(J)),
1451
1760
  stroke: "currentColor",
1452
1761
  "stroke-opacity": "0.3"
1453
- }, null, 8, ot),
1454
- t.valueGrid ? (g(!0), a(e, { key: 2 }, v(V.value, (e, t) => (g(), a("line", {
1762
+ }, null, 8, kt),
1763
+ t.valueGrid ? (_(!0), a(e, { key: 2 }, y(oe.value, (e, t) => (_(), a("line", {
1455
1764
  key: "vg" + t,
1456
- x1: k.value ? x(S).left : e.pos,
1457
- y1: k.value ? e.pos : x(S).top,
1458
- x2: k.value ? x(S).left + x(C) : e.pos,
1459
- y2: k.value ? e.pos : x(S).top + x(w),
1765
+ x1: T.value ? S(K).left : e.pos,
1766
+ y1: T.value ? e.pos : S(K).top,
1767
+ x2: T.value ? S(K).left + S(q) : e.pos,
1768
+ y2: T.value ? e.pos : S(K).top + S(J),
1460
1769
  stroke: "currentColor",
1461
1770
  "stroke-opacity": "0.1"
1462
- }, null, 8, st))), 128)) : i("", !0),
1463
- Se.value && J.value ? (g(), a("rect", {
1771
+ }, null, 8, At))), 128)) : i("", !0),
1772
+ ye.value && L.value ? (_(), a("rect", {
1464
1773
  key: 3,
1465
- x: Se.value.x,
1466
- y: Se.value.y,
1467
- width: Se.value.w,
1468
- height: Se.value.h,
1774
+ x: ye.value.x,
1775
+ y: ye.value.y,
1776
+ width: ye.value.w,
1777
+ height: ye.value.h,
1469
1778
  fill: "currentColor",
1470
1779
  "fill-opacity": "0.06",
1471
1780
  "pointer-events": "none"
1472
- }, null, 8, ct)) : i("", !0),
1473
- k.value ? (g(!0), a(e, { key: 4 }, v(V.value, (e, t) => (g(), a("text", {
1781
+ }, null, 8, jt)) : i("", !0),
1782
+ T.value ? (_(!0), a(e, { key: 4 }, y(oe.value, (e, t) => (_(), a("text", {
1474
1783
  key: "vt" + t,
1475
1784
  "data-testid": "value-tick",
1476
- x: x(S).left - 6,
1785
+ x: S(K).left - 6,
1477
1786
  y: e.pos,
1478
1787
  "text-anchor": "end",
1479
1788
  "dominant-baseline": "middle",
1480
1789
  "font-size": "10",
1481
1790
  fill: "currentColor",
1482
1791
  "fill-opacity": "0.6"
1483
- }, y(e.value), 9, lt))), 128)) : (g(!0), a(e, { key: 5 }, v(V.value, (e, t) => (g(), a("text", {
1792
+ }, b(e.value), 9, Mt))), 128)) : (_(!0), a(e, { key: 5 }, y(oe.value, (e, t) => (_(), a("text", {
1484
1793
  key: "vt" + t,
1485
1794
  "data-testid": "value-tick",
1486
1795
  x: e.pos,
1487
- y: x(S).top + x(w) + 16,
1796
+ y: S(K).top + S(J) + 16,
1488
1797
  "text-anchor": "middle",
1489
1798
  "font-size": "10",
1490
1799
  fill: "currentColor",
1491
1800
  "fill-opacity": "0.6"
1492
- }, y(e.value), 9, ut))), 128)),
1493
- t.yLabel ? (g(), a("text", {
1801
+ }, b(e.value), 9, Nt))), 128)),
1802
+ t.yLabel ? (_(), a("text", {
1494
1803
  key: 6,
1495
1804
  x: 0,
1496
1805
  y: 0,
1497
- transform: `translate(14, ${x(S).top + x(w) / 2}) rotate(-90)`,
1806
+ transform: `translate(14, ${S(K).top + S(J) / 2}) rotate(-90)`,
1498
1807
  "text-anchor": "middle",
1499
1808
  "font-size": "13",
1500
1809
  fill: "currentColor"
1501
- }, y(t.yLabel), 9, dt)) : i("", !0),
1502
- k.value ? (g(!0), a(e, { key: 7 }, v(U.value, (e, t) => (g(), a("text", {
1810
+ }, b(t.yLabel), 9, Pt)) : i("", !0),
1811
+ T.value ? (_(!0), a(e, { key: 7 }, y(I.value, (e, t) => (_(), a("text", {
1503
1812
  key: "ct" + t,
1504
1813
  "data-testid": "category-tick",
1505
1814
  x: e.pos,
1506
- y: x(S).top + x(w) + 16,
1815
+ y: S(K).top + S(J) + 16,
1507
1816
  "text-anchor": e.anchor,
1508
1817
  "font-size": "10",
1509
1818
  fill: "currentColor",
1510
1819
  "fill-opacity": "0.6"
1511
- }, y(e.label), 9, ft))), 128)) : (g(!0), a(e, { key: 8 }, v(U.value, (e, t) => (g(), a("text", {
1820
+ }, b(e.label), 9, Ft))), 128)) : (_(!0), a(e, { key: 8 }, y(I.value, (e, t) => (_(), a("text", {
1512
1821
  key: "ct" + t,
1513
1822
  "data-testid": "category-tick",
1514
- x: x(S).left - 6,
1823
+ x: S(K).left - 6,
1515
1824
  y: e.pos,
1516
1825
  "text-anchor": "end",
1517
1826
  "dominant-baseline": "middle",
1518
1827
  "font-size": "10",
1519
1828
  fill: "currentColor",
1520
1829
  "fill-opacity": "0.6"
1521
- }, y(e.label), 9, pt))), 128)),
1522
- t.xLabel ? (g(), a("text", {
1830
+ }, b(e.label), 9, It))), 128)),
1831
+ t.xLabel ? (_(), a("text", {
1523
1832
  key: 9,
1524
- x: x(S).left + x(C) / 2,
1525
- y: b.value - 4,
1833
+ x: S(K).left + S(q) / 2,
1834
+ y: S(U) - 4,
1526
1835
  "text-anchor": "middle",
1527
1836
  "font-size": "13",
1528
1837
  fill: "currentColor"
1529
- }, y(t.xLabel), 9, mt)) : i("", !0),
1530
- (g(!0), a(e, null, v(L.value, (e, t) => (g(), a("rect", {
1838
+ }, b(t.xLabel), 9, Lt)) : i("", !0),
1839
+ (_(!0), a(e, null, y(F.value, (e, t) => (_(), a("rect", {
1531
1840
  key: "bar" + t,
1532
1841
  "data-testid": "bar",
1533
1842
  "data-category": e.categoryIndex,
@@ -1538,49 +1847,55 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
1538
1847
  height: e.h,
1539
1848
  fill: e.color,
1540
1849
  "fill-opacity": e.opacity
1541
- }, null, 8, ht))), 128)),
1542
- J.value ? (g(), a("rect", d({
1850
+ }, null, 8, Rt))), 128)),
1851
+ L.value ? (_(), a("rect", d({
1543
1852
  key: 10,
1544
- x: x(S).left,
1545
- y: x(S).top,
1546
- width: x(C),
1547
- height: x(w),
1853
+ x: S(K).left,
1854
+ y: S(K).top,
1855
+ width: S(q),
1856
+ height: S(J),
1548
1857
  fill: "transparent",
1549
1858
  style: {
1550
1859
  cursor: "crosshair",
1551
1860
  "touch-action": "none"
1552
1861
  }
1553
- }, ne(x(pe), !0)), null, 16, gt)) : i("", !0)
1554
- ], 8, $)),
1555
- J.value && x(X) !== null && xe.value ? (g(), a("div", {
1862
+ }, te(S(Z), !0)), null, 16, zt)) : i("", !0),
1863
+ t.annotations && t.annotations.length > 0 ? (_(), r(S(Fe), {
1864
+ key: 11,
1865
+ annotations: t.annotations,
1866
+ project: R,
1867
+ bounds: S(fe)
1868
+ }, null, 8, ["annotations", "bounds"])) : i("", !0)
1869
+ ], 8, Ct)),
1870
+ L.value && S(pe) !== null && ve.value ? (_(), a("div", {
1556
1871
  key: 1,
1557
1872
  ref_key: "tooltipRef",
1558
- ref: fe,
1873
+ ref: Y,
1559
1874
  class: "chart-tooltip-content",
1560
1875
  style: m({
1561
1876
  position: "absolute",
1562
1877
  top: "0",
1563
1878
  left: "0",
1564
1879
  willChange: "transform",
1565
- transform: x(Z) ? `translate3d(${x(Z).left}px, ${x(Z).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1566
- visibility: x(Z) ? "visible" : "hidden"
1880
+ transform: S(X) ? `translate3d(${S(X).left}px, ${S(X).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1881
+ visibility: S(X) ? "visible" : "hidden"
1567
1882
  })
1568
- }, [te(n.$slots, "tooltip", p(u(xe.value)), () => [o("div", _t, [be.value ? (g(), a("div", vt, y(be.value), 1)) : i("", !0), (g(!0), a(e, null, v(xe.value.values, (e) => (g(), a("div", {
1883
+ }, [ee(n.$slots, "tooltip", p(u(ve.value)), () => [o("div", Bt, [$.value ? (_(), a("div", Vt, b($.value), 1)) : i("", !0), (_(!0), a(e, null, y(ve.value.values, (e) => (_(), a("div", {
1569
1884
  key: e.seriesIndex,
1570
1885
  class: "bar-chart-tooltip-row"
1571
1886
  }, [o("span", {
1572
1887
  class: "bar-chart-tooltip-swatch",
1573
1888
  style: m({ background: e.color })
1574
- }, null, 4), s(" " + y(isFinite(e.value) ? B(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
1575
- x(_e) ? (g(), a("a", {
1889
+ }, null, 4), s(" " + b(isFinite(e.value) ? S(ae)(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
1890
+ S(me) ? (_(), a("a", {
1576
1891
  key: 2,
1577
1892
  class: "bar-chart-download-link",
1578
- href: x(ve),
1579
- download: `${x(ye)()}.csv`
1580
- }, y(x(_e)), 9, yt)) : i("", !0)
1893
+ href: S(he),
1894
+ download: `${S(ge)()}.csv`
1895
+ }, b(S(me)), 9, Ht)) : i("", !0)
1581
1896
  ], 512));
1582
1897
  }
1583
- }), [["__scopeId", "data-v-4f604d9f"]]), xt = {
1898
+ }), [["__scopeId", "data-v-690ebb3c"]]), Wt = {
1584
1899
  "01013": "010259",
1585
1900
  "01015": "010177",
1586
1901
  "01029": "010177",
@@ -4741,7 +5056,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
4741
5056
  51019: "510014",
4742
5057
  "02158": "020820",
4743
5058
  46102: "460957"
4744
- }, St = {
5059
+ }, Gt = {
4745
5060
  "010259": "Butler, AL",
4746
5061
  "010177": "Calhoun (Anniston), AL - Cleburne, AL",
4747
5062
  "010172": "Chambers, AL - Randolph, AL",
@@ -5691,7 +6006,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5691
6006
  560775: "Teton, WY - Lincoln, WY",
5692
6007
  560792: "Uinta, WY",
5693
6008
  560804: "Weston, WY"
5694
- }, Ct = {
6009
+ }, Kt = {
5695
6010
  ref: "root",
5696
6011
  class: "chart-tooltip-content",
5697
6012
  style: {
@@ -5703,10 +6018,10 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5703
6018
  "pointer-events": "none",
5704
6019
  transform: "translateY(-50%)"
5705
6020
  }
5706
- }, wt = /* @__PURE__ */ l({
6021
+ }, qt = /* @__PURE__ */ l({
5707
6022
  __name: "ChoroplethTooltip",
5708
6023
  setup(e, { expose: n }) {
5709
- let a = _(null), s = S("root");
6024
+ let a = v(null), s = w("root");
5710
6025
  return n({
5711
6026
  setData(e) {
5712
6027
  a.value = e;
@@ -5714,24 +6029,24 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5714
6029
  getEl() {
5715
6030
  return s.value;
5716
6031
  }
5717
- }), (e, n) => (g(), r(t, { to: "body" }, [o("div", Ct, [a.value ? te(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
6032
+ }), (e, n) => (_(), r(t, { to: "body" }, [o("div", Kt, [a.value ? ee(e.$slots, "default", p(d({ key: 0 }, a.value))) : i("", !0)], 512)]));
5718
6033
  }
5719
- }), Tt = {
6034
+ }), Jt = {
5720
6035
  key: 1,
5721
6036
  class: "choropleth-header"
5722
- }, Et = {
6037
+ }, Yt = {
5723
6038
  key: 0,
5724
6039
  class: "choropleth-title"
5725
- }, Dt = {
6040
+ }, Xt = {
5726
6041
  key: 1,
5727
6042
  class: "choropleth-legend"
5728
- }, Ot = {
6043
+ }, Zt = {
5729
6044
  key: 0,
5730
6045
  class: "choropleth-legend-title"
5731
- }, kt = {
6046
+ }, Qt = {
5732
6047
  key: 2,
5733
6048
  class: "choropleth-legend-continuous"
5734
- }, At = { class: "choropleth-legend-ticks" }, jt = ["viewBox"], Mt = ["innerHTML"], Nt = "http://www.w3.org/2000/svg", Pt = 450, Ft = 1e3, It = /* @__PURE__ */ V(/* @__PURE__ */ l({
6049
+ }, $t = { class: "choropleth-legend-ticks" }, en = ["viewBox"], tn = ["innerHTML"], nn = "http://www.w3.org/2000/svg", rn = 450, an = 1e3, on = /* @__PURE__ */ B(/* @__PURE__ */ l({
5735
6050
  __name: "ChoroplethMap",
5736
6051
  props: {
5737
6052
  topology: {},
@@ -5775,56 +6090,56 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5775
6090
  "update:focus"
5776
6091
  ],
5777
6092
  setup(t, { emit: c }) {
5778
- let l = t, d = c, ne = (e) => e, x = _(null), S = _(null), T = _(null), ie = _(null), E = _(null), D = _(null), O = re(), k = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!O.tooltip), A = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), M = null, R = null, z = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), V = !1, H = typeof window < "u" && "ontouchstart" in window, U = null, W = {
6093
+ let l = t, d = c, te = (e) => e, S = v(null), w = v(null), D = v(null), O = v(null), k = v(null), A = v(null), j = C(), M = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!j.tooltip), N = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), ne = null, L = null, R = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map(), B = !1, V = typeof window < "u" && "ontouchstart" in window, H = null, ue = {
5779
6094
  width: 0,
5780
6095
  height: 0
5781
- }, G = null, K = !1, q = null, le = _(!1), ue = 0, J = 0, Y = 0;
5782
- function de() {
5783
- if (H) return;
5784
- let e = T.value;
6096
+ }, U = null, W = !1, G = null, K = v(!1), de = 0, q = 0, J = 0;
6097
+ function fe() {
6098
+ if (V) return;
6099
+ let e = D.value;
5785
6100
  e && (e.addEventListener("click", st), e.addEventListener("mouseover", st), e.addEventListener("mousemove", ct), e.addEventListener("mouseout", lt));
5786
6101
  }
5787
- function fe() {
5788
- let e = T.value;
6102
+ function Y() {
6103
+ let e = D.value;
5789
6104
  e && (e.removeEventListener("click", st), e.removeEventListener("mouseover", st), e.removeEventListener("mousemove", ct), e.removeEventListener("mouseout", lt));
5790
6105
  }
5791
- function Q() {
6106
+ function X() {
5792
6107
  at();
5793
6108
  }
5794
6109
  h(() => {
5795
- me(), de(), dt(), ye(), Ze(), window.addEventListener("scroll", Q, {
6110
+ me(), fe(), dt(), ve(), Xe(), window.addEventListener("scroll", X, {
5796
6111
  passive: !0,
5797
6112
  capture: !0
5798
- }), window.addEventListener("resize", Q, { passive: !0 });
5799
- }), ee(() => {
5800
- U?.disconnect(), Y && cancelAnimationFrame(Y), he(), fe(), window.removeEventListener("scroll", Q, { capture: !0 }), window.removeEventListener("resize", Q);
6113
+ }), window.addEventListener("resize", X, { passive: !0 });
6114
+ }), g(() => {
6115
+ H?.disconnect(), J && cancelAnimationFrame(J), he(), Y(), window.removeEventListener("scroll", X, { capture: !0 }), window.removeEventListener("resize", X);
5801
6116
  });
5802
6117
  function me() {
5803
- if (!S.value || !T.value) return;
5804
- let e = oe(S.value), t = Math.max(12, l.focusZoomLevel);
5805
- q = P().scaleExtent([1, t]).on("start", () => {
5806
- V = !0, at();
6118
+ if (!w.value || !D.value) return;
6119
+ let e = oe(w.value), t = Math.max(12, l.focusZoomLevel);
6120
+ G = ie().scaleExtent([1, t]).on("start", () => {
6121
+ B = !0, at();
5807
6122
  }).on("zoom", (e) => {
5808
- T.value && T.value.setAttribute("transform", e.transform);
6123
+ D.value && D.value.setAttribute("transform", e.transform);
5809
6124
  let t = e.transform;
5810
- le.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
6125
+ K.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
5811
6126
  }).on("end", () => {
5812
- V = !1;
5813
- }), q.filter((e) => {
5814
- let t = Pe.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
6127
+ B = !1;
6128
+ }), G.filter((e) => {
6129
+ let t = Ne.value.length > 0, n = !!l.zoom || t, r = !!l.pan || t;
5815
6130
  if (e.type === "wheel" || e.type === "dblclick") {
5816
6131
  if (!n) return !1;
5817
6132
  } else if (e.type === "mousedown" || e.type === "touchstart") {
5818
6133
  if (!r) return !1;
5819
6134
  } else if (!n && !r) return !1;
5820
6135
  return (!e.ctrlKey || e.type === "wheel") && !e.button;
5821
- }), e.call(q);
6136
+ }), e.call(G);
5822
6137
  }
5823
6138
  function he() {
5824
- S.value && q && (oe(S.value).on(".zoom", null), q = null);
6139
+ w.value && G && (oe(w.value).on(".zoom", null), G = null);
5825
6140
  }
5826
6141
  function ge(e) {
5827
- let t = Fe.value, n = je.value, r = [];
6142
+ let t = Pe.value, n = Ae.value, r = [];
5828
6143
  for (let i of e) {
5829
6144
  let e = i.geoType ?? l.geoType, a = t.get(e);
5830
6145
  if (!a) continue;
@@ -5847,113 +6162,113 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5847
6162
  for (let n of ge(e)) n.geoType === l.geoType && t.add(String(n.feature.id));
5848
6163
  return t;
5849
6164
  }
5850
- let ve = !1;
5851
- function ye() {
5852
- if (!S.value || !q) return;
5853
- let e = ge(Pe.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
6165
+ let $ = !1;
6166
+ function ve() {
6167
+ if (!w.value || !G) return;
6168
+ let e = ge(Ne.value), t = e.filter((e) => e.geoType === l.geoType), n = e.filter((e) => e.geoType !== l.geoType), r = /* @__PURE__ */ new Map();
5854
6169
  for (let e of t) {
5855
- let t = A.get(String(e.feature.id));
6170
+ let t = N.get(String(e.feature.id));
5856
6171
  t && r.set(t, e.item.style ?? "solid");
5857
6172
  }
5858
- for (let [e] of z) r.has(e) || e === R || rt(e);
5859
- for (let [e, t] of r) z.get(e) === t && e !== R || e !== R && nt(e, t);
5860
- z.clear();
5861
- for (let [e, t] of r) z.set(e, t);
5862
- if (be(n), e.length === 0) {
5863
- ve = !0, at();
6173
+ for (let [e] of R) r.has(e) || e === L || rt(e);
6174
+ for (let [e, t] of r) R.get(e) === t && e !== L || e !== L && nt(e, t);
6175
+ R.clear();
6176
+ for (let [e, t] of r) R.set(e, t);
6177
+ if (ye(n), e.length === 0) {
6178
+ $ = !0, at();
5864
6179
  return;
5865
6180
  }
5866
- let i = oe(S.value);
6181
+ let i = oe(w.value);
5867
6182
  i.interrupt();
5868
- let a = ve;
5869
- ve = !0;
5870
- let [[o, s], [c, u]] = ke.value.bounds({
6183
+ let a = $;
6184
+ $ = !0;
6185
+ let [[o, s], [c, u]] = Oe.value.bounds({
5871
6186
  type: "FeatureCollection",
5872
6187
  features: e.map((e) => e.feature)
5873
- }), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = F.translate(Ce.value / 2 - p * d, we.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, ee = () => {
5874
- if (!k.value || !h) return;
5875
- let e = String(h.id), t = A.get(e);
6188
+ }), d = (o + c) / 2, f = (s + u) / 2, p = l.focusZoomLevel, m = ae.translate(Se.value / 2 - p * d, Ce.value / 2 - p * f).scale(p), h = t[0]?.feature ?? null, g = () => {
6189
+ if (!M.value || !h) return;
6190
+ let e = String(h.id), t = N.get(e);
5876
6191
  if (!t) return;
5877
6192
  let n = t.getBoundingClientRect();
5878
- $e(e, n.left + n.width / 2, n.top + n.height / 2);
6193
+ Qe(e, n.left + n.width / 2, n.top + n.height / 2);
5879
6194
  };
5880
- a ? ($(), i.transition().duration(Pt).call(q.transform, m).on("end", ee)) : (q.transform(i, m), ee());
6195
+ a ? (et(), i.transition().duration(rn).call(G.transform, m).on("end", g)) : (G.transform(i, m), g());
5881
6196
  }
5882
- function be(e) {
5883
- let t = E.value;
6197
+ function ye(e) {
6198
+ let t = k.value;
5884
6199
  if (!t) return;
5885
6200
  let n = new Set(e.map((e) => e.key));
5886
- for (let [e, t] of B) n.has(e) || (t.remove(), B.delete(e));
5887
- let r = ke.value, i = Ae.value + 1.5;
6201
+ for (let [e, t] of z) n.has(e) || (t.remove(), z.delete(e));
6202
+ let r = Oe.value, i = ke.value + 1.5;
5888
6203
  for (let { item: n, feature: a, key: o } of e) {
5889
- let e = B.get(o);
5890
- e || (e = document.createElementNS(Nt, "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), B.set(o, e)), e.setAttribute("stroke", n.stroke ?? "#fff"), e.setAttribute("stroke-width", String(i)), tt(e, n.style);
6204
+ let e = z.get(o);
6205
+ e || (e = document.createElementNS(nn, "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)), tt(e, n.style);
5891
6206
  }
5892
6207
  }
5893
- function xe() {
5894
- if (!S.value || !q) return;
5895
- Pe.value.length > 0 && d("update:focus", null);
5896
- let e = oe(S.value);
5897
- e.interrupt(), $(), e.transition().duration(Pt).call(q.transform, F);
6208
+ function be() {
6209
+ if (!w.value || !G) return;
6210
+ Ne.value.length > 0 && d("update:focus", null);
6211
+ let e = oe(w.value);
6212
+ e.interrupt(), et(), e.transition().duration(rn).call(G.transform, ae);
5898
6213
  }
5899
- C(() => l.focusZoomLevel, () => {
5900
- q && q.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), ye();
6214
+ T(() => l.focusZoomLevel, () => {
6215
+ G && G.scaleExtent([1, Math.max(12, l.focusZoomLevel)]), ve();
5901
6216
  });
5902
- let Se = n(() => l.width && l.height ? l.height / l.width : .625), Ce = n(() => Ft), we = n(() => Ft * Se.value), Te = n(() => {
5903
- let e = b(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
6217
+ let xe = n(() => l.width && l.height ? l.height / l.width : .625), Se = n(() => an), Ce = n(() => an * xe.value), we = n(() => {
6218
+ let e = x(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
5904
6219
  for (let e of t) {
5905
- let t = xt[String(e.id).padStart(5, "0")];
6220
+ let t = Wt[String(e.id).padStart(5, "0")];
5906
6221
  t && (n.has(t) || n.set(t, []), n.get(t).push(e));
5907
6222
  }
5908
6223
  let r = [];
5909
6224
  for (let [t, i] of n) r.push({
5910
6225
  type: "Feature",
5911
6226
  id: t,
5912
- properties: { name: St[t] ?? t },
6227
+ properties: { name: Gt[t] ?? t },
5913
6228
  geometry: se(e, i)
5914
6229
  });
5915
6230
  return {
5916
6231
  type: "FeatureCollection",
5917
6232
  features: r
5918
6233
  };
5919
- }), Ee = n(() => {
5920
- if (l.geoType === "hsas") return Te.value;
6234
+ }), Te = n(() => {
6235
+ if (l.geoType === "hsas") return we.value;
5921
6236
  if (l.geoType === "counties") {
5922
- let e = b(l.topology);
6237
+ let e = x(l.topology);
5923
6238
  return I(e, e.objects.counties);
5924
6239
  }
5925
- let e = b(l.topology);
6240
+ let e = x(l.topology);
5926
6241
  return I(e, e.objects.states);
5927
- }), De = n(() => {
6242
+ }), Ee = n(() => {
5928
6243
  if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
5929
- let e = b(l.topology);
5930
- return L(e, e.objects.states, (e, t) => e !== t);
5931
- }), Oe = n(() => N().fitExtent([[0, 0], [Ce.value, we.value]], Ee.value)), ke = n(() => ae(Oe.value)), Ae = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), je = n(() => {
6244
+ let e = x(l.topology);
6245
+ return ce(e, e.objects.states, (e, t) => e !== t);
6246
+ }), De = n(() => F().fitExtent([[0, 0], [Se.value, Ce.value]], Te.value)), Oe = n(() => re(De.value)), ke = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), Ae = n(() => {
5932
6247
  let e = /* @__PURE__ */ new Map();
5933
- for (let [t, n] of Fe.value) {
6248
+ for (let [t, n] of Pe.value) {
5934
6249
  let r = /* @__PURE__ */ new Map();
5935
6250
  for (let [e, t] of n) t.properties?.name != null && r.set(t.properties.name, e);
5936
6251
  e.set(t, r);
5937
6252
  }
5938
6253
  return e;
5939
6254
  });
5940
- function Me(e) {
6255
+ function je(e) {
5941
6256
  let t = l.dataGeoType;
5942
6257
  if (!t || t === l.geoType) return e;
5943
- if (l.geoType === "counties" && t === "hsas") return xt[e];
6258
+ if (l.geoType === "counties" && t === "hsas") return Wt[e];
5944
6259
  if (l.geoType === "counties" && t === "states" || l.geoType === "hsas" && t === "states") return e.slice(0, 2);
5945
6260
  }
5946
- let Ne = n(() => {
6261
+ let Me = n(() => {
5947
6262
  let e = /* @__PURE__ */ new Map();
5948
- for (let t of Ee.value.features) t.id != null && e.set(String(t.id), t);
6263
+ for (let t of Te.value.features) t.id != null && e.set(String(t.id), t);
5949
6264
  return e;
5950
- }), Pe = n(() => {
6265
+ }), Ne = n(() => {
5951
6266
  let e = l.focus;
5952
6267
  return e == null ? [] : (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { id: e } : e);
5953
- }), Fe = n(() => {
6268
+ }), Pe = n(() => {
5954
6269
  let e = /* @__PURE__ */ new Map();
5955
- e.set(l.geoType, Ne.value);
5956
- let t = b(l.topology), n = t?.objects;
6270
+ e.set(l.geoType, Me.value);
6271
+ let t = x(l.topology), n = t?.objects;
5957
6272
  if (!n) return e;
5958
6273
  let r = (e) => {
5959
6274
  let t = /* @__PURE__ */ new Map();
@@ -5968,18 +6283,18 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5968
6283
  let i = I(t, n.counties);
5969
6284
  e.set("counties", r(i.features));
5970
6285
  }
5971
- return !e.has("hsas") && n.counties && e.set("hsas", r(Te.value.features)), e;
5972
- }), Ie = n(() => {
6286
+ return !e.has("hsas") && n.counties && e.set("hsas", r(we.value.features)), e;
6287
+ }), Fe = n(() => {
5973
6288
  let e = /* @__PURE__ */ new Map();
5974
6289
  if (!l.data) return e;
5975
- let t = l.dataGeoType ?? l.geoType, n = je.value.get(t);
6290
+ let t = l.dataGeoType ?? l.geoType, n = Ae.value.get(t);
5976
6291
  for (let t of l.data) {
5977
6292
  e.set(t.id, t.value);
5978
6293
  let r = n?.get(t.id);
5979
6294
  r && e.set(r, t.value);
5980
6295
  }
5981
6296
  return e;
5982
- }), Le = n(() => {
6297
+ }), Ie = n(() => {
5983
6298
  if (!l.data || l.data.length === 0) return {
5984
6299
  min: 0,
5985
6300
  max: 1
@@ -5996,8 +6311,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
5996
6311
  min: 0,
5997
6312
  max: 1
5998
6313
  };
5999
- }), Re = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), ze = n(() => Array.isArray(l.colorScale) && !Re.value), Be = n(() => ze.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Ve = n(() => ze.value ? "" : l.colorScale?.max ?? "#08519c");
6000
- function He(e) {
6314
+ }), Le = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Re = n(() => Array.isArray(l.colorScale) && !Le.value), ze = n(() => Re.value ? "" : l.colorScale?.min ?? "#e5f0fa"), Be = n(() => Re.value ? "" : l.colorScale?.max ?? "#08519c");
6315
+ function Ve(e) {
6001
6316
  let t = e.replace("#", "");
6002
6317
  return [
6003
6318
  parseInt(t.slice(0, 2), 16),
@@ -6005,100 +6320,100 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6005
6320
  parseInt(t.slice(4, 6), 16)
6006
6321
  ];
6007
6322
  }
6008
- function Ue(e) {
6009
- let [t, n, r] = He(Be.value), [i, a, o] = He(Ve.value);
6323
+ function He(e) {
6324
+ let [t, n, r] = Ve(ze.value), [i, a, o] = Ve(Be.value);
6010
6325
  return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
6011
6326
  }
6012
- let We = n(() => ze.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), Ge = n(() => {
6013
- if (!Re.value) return null;
6327
+ let Ue = n(() => Re.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), We = n(() => {
6328
+ if (!Le.value) return null;
6014
6329
  let e = /* @__PURE__ */ new Map();
6015
6330
  for (let t of l.colorScale) e.set(t.value, t.color);
6016
6331
  return e;
6017
6332
  });
6018
- function Ke(e) {
6019
- let t = Me(e);
6020
- return t == null ? void 0 : Ie.value.get(t);
6333
+ function Ge(e) {
6334
+ let t = je(e);
6335
+ return t == null ? void 0 : Fe.value.get(t);
6021
6336
  }
6022
- function qe(e) {
6023
- let t = Ke(e), n = l.noDataColor;
6337
+ function Ke(e) {
6338
+ let t = Ge(e), n = l.noDataColor;
6024
6339
  if (t == null) return n;
6025
- let r = Ge.value;
6340
+ let r = We.value;
6026
6341
  if (r) return r.get(String(t)) ?? n;
6027
- let i = We.value;
6342
+ let i = Ue.value;
6028
6343
  if (i) {
6029
6344
  let e = t;
6030
6345
  for (let t of i) if (e >= t.min) return t.color;
6031
6346
  return n;
6032
6347
  }
6033
- let { min: a, max: o } = Le.value;
6034
- return Ue((t - a) / (o - a));
6348
+ let { min: a, max: o } = Ie.value;
6349
+ return He((t - a) / (o - a));
6035
6350
  }
6036
- let Je = (e) => e.properties?.name ?? String(e.id);
6037
- function Ye(e) {
6351
+ let qe = (e) => e.properties?.name ?? String(e.id);
6352
+ function Je(e) {
6038
6353
  return e == null ? "" : typeof e == "number" && l.tooltipValueFormat ? l.tooltipValueFormat(e) : String(e);
6039
6354
  }
6040
- function Xe(e, t) {
6041
- return t == null ? e : `${e}: ${Ye(t)}`;
6355
+ function Ye(e, t) {
6356
+ return t == null ? e : `${e}: ${Je(t)}`;
6042
6357
  }
6043
- function Ze() {
6044
- let e = D.value?.getEl();
6358
+ function Xe() {
6359
+ let e = A.value?.getEl();
6045
6360
  if (!e) return;
6046
- U?.disconnect();
6361
+ H?.disconnect();
6047
6362
  let t = !1;
6048
- U = new ResizeObserver((e) => {
6363
+ H = new ResizeObserver((e) => {
6049
6364
  let n = e[0]?.contentRect;
6050
- n && (W.width = n.width, W.height = n.height, !t && K && G ? (t = !0, Qe(G.x, G.y)) : t = !0);
6051
- }), U.observe(e);
6365
+ n && (ue.width = n.width, ue.height = n.height, !t && W && U ? (t = !0, Ze(U.x, U.y)) : t = !0);
6366
+ }), H.observe(e);
6052
6367
  }
6053
- function Qe(e, t) {
6054
- let n = D.value?.getEl();
6368
+ function Ze(e, t) {
6369
+ let n = A.value?.getEl();
6055
6370
  if (!n) return;
6056
- let r = x.value?.getBoundingClientRect(), { left: i, top: a } = X(e, t, W.width, W.height, l.tooltipClamp, r);
6371
+ let r = S.value?.getBoundingClientRect(), { left: i, top: a } = pe(e, t, ue.width, ue.height, l.tooltipClamp, r);
6057
6372
  n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
6058
6373
  }
6059
- function $e(e, t, n) {
6060
- let r = j.get(e);
6374
+ function Qe(e, t, n) {
6375
+ let r = P.get(e);
6061
6376
  if (!r) return;
6062
- let i = D.value, a = i?.getEl();
6063
- !i || !a || (i.setData(r), G = {
6377
+ let i = A.value, a = i?.getEl();
6378
+ !i || !a || (i.setData(r), U = {
6064
6379
  x: t,
6065
6380
  y: n
6066
- }, K = !0, Qe(t, n), a.style.visibility = "visible");
6381
+ }, W = !0, Ze(t, n), a.style.visibility = "visible");
6067
6382
  }
6068
- function et(e, t) {
6069
- K && (ue = e, J = t, !Y && (Y = requestAnimationFrame(() => {
6070
- Y = 0;
6071
- let e = D.value?.getEl();
6072
- !e || !K || (G = {
6073
- x: ue,
6074
- y: J
6075
- }, e.style.transform = `translate3d(${ue + 16}px, ${J}px, 0) translateY(-50%)`);
6383
+ function $e(e, t) {
6384
+ W && (de = e, q = t, !J && (J = requestAnimationFrame(() => {
6385
+ J = 0;
6386
+ let e = A.value?.getEl();
6387
+ !e || !W || (U = {
6388
+ x: de,
6389
+ y: q
6390
+ }, e.style.transform = `translate3d(${de + 16}px, ${q}px, 0) translateY(-50%)`);
6076
6391
  })));
6077
6392
  }
6078
- function $() {
6079
- if (!K) return;
6080
- K = !1, G = null;
6081
- let e = D.value?.getEl();
6393
+ function et() {
6394
+ if (!W) return;
6395
+ W = !1, U = null;
6396
+ let e = A.value?.getEl();
6082
6397
  e && (e.style.visibility = "hidden");
6083
6398
  }
6084
6399
  function tt(e, t) {
6085
6400
  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"));
6086
6401
  }
6087
6402
  function nt(e, t = "solid") {
6088
- e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Ae.value + 1)), e.setAttribute("stroke", "#555"), tt(e, t);
6403
+ e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(ke.value + 1)), e.setAttribute("stroke", "#555"), tt(e, t);
6089
6404
  }
6090
6405
  function rt(e) {
6091
- e.setAttribute("stroke-width", String(Ae.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
6406
+ e.setAttribute("stroke-width", String(ke.value)), e.setAttribute("stroke", l.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
6092
6407
  }
6093
6408
  function it(e) {
6094
- R !== e && (R && !z.has(R) && rt(R), R = e, nt(e, z.get(e) ?? "solid"));
6409
+ L !== e && (L && !R.has(L) && rt(L), L = e, nt(e, R.get(e) ?? "solid"));
6095
6410
  }
6096
6411
  function at() {
6097
- if (R) {
6098
- let e = z.get(R);
6099
- e == null ? rt(R) : nt(R, e), R = null, d("stateHover", null);
6412
+ if (L) {
6413
+ let e = R.get(L);
6414
+ e == null ? rt(L) : nt(L, e), L = null, d("stateHover", null);
6100
6415
  }
6101
- $();
6416
+ et();
6102
6417
  }
6103
6418
  function ot(e) {
6104
6419
  let t = e;
@@ -6106,80 +6421,80 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6106
6421
  return t ? t.dataset.featId ?? null : null;
6107
6422
  }
6108
6423
  function st(e) {
6109
- if (V) return;
6424
+ if (B) return;
6110
6425
  let t = e, n = ot(t.target);
6111
6426
  if (!n) return;
6112
- let r = j.get(n);
6427
+ let r = P.get(n);
6113
6428
  if (!r) return;
6114
6429
  let i = {
6115
6430
  id: r.id,
6116
6431
  name: r.name,
6117
6432
  value: r.value
6118
6433
  };
6119
- e.type === "click" ? (d("stateClick", i), d("update:focus", _e(Pe.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (it(A.get(n)), k.value && $e(n, t.clientX, t.clientY), d("stateHover", i));
6434
+ e.type === "click" ? (d("stateClick", i), d("update:focus", _e(Ne.value).has(r.id) ? null : r.id)) : e.type === "mouseover" && (it(N.get(n)), M.value && Qe(n, t.clientX, t.clientY), d("stateHover", i));
6120
6435
  }
6121
6436
  function ct(e) {
6122
- V || et(e.clientX, e.clientY);
6437
+ B || $e(e.clientX, e.clientY);
6123
6438
  }
6124
6439
  function lt(e) {
6125
6440
  let t = e.relatedTarget;
6126
- t && T.value?.contains(t) || at();
6441
+ t && D.value?.contains(t) || at();
6127
6442
  }
6128
6443
  function ut(e) {
6129
- let t = document.createElementNS(Nt, "path");
6444
+ let t = document.createElementNS(nn, "path");
6130
6445
  return e && t.setAttribute("d", e), t;
6131
6446
  }
6132
6447
  function dt() {
6133
- let e = ie.value, t = E.value;
6448
+ let e = O.value, t = k.value;
6134
6449
  if (!e || !t) return;
6135
6450
  for (; e.firstChild;) e.removeChild(e.firstChild);
6136
6451
  for (; t.firstChild;) t.removeChild(t.firstChild);
6137
- A.clear(), j.clear(), M = null, R = null, z.clear(), B.clear();
6138
- let n = ke.value, r = Ee.value.features, i = l.strokeColor, a = String(Ae.value), o = !k.value, s = document.createDocumentFragment();
6452
+ N.clear(), P.clear(), ne = null, L = null, R.clear(), z.clear();
6453
+ let n = Oe.value, r = Te.value.features, i = l.strokeColor, a = String(ke.value), o = !M.value, s = document.createDocumentFragment();
6139
6454
  for (let e of r) {
6140
- let t = String(e.id), r = Je(e), c = Ke(t), l = ut(n(e));
6141
- if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", qe(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
6142
- let e = document.createElementNS(Nt, "title");
6143
- e.textContent = Xe(r, c), l.appendChild(e);
6455
+ let t = String(e.id), r = qe(e), c = Ge(t), l = ut(n(e));
6456
+ if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", t), l.setAttribute("fill", Ke(t)), l.setAttribute("stroke", i), l.setAttribute("stroke-width", a), l.setAttribute("vector-effect", "non-scaling-stroke"), o) {
6457
+ let e = document.createElementNS(nn, "title");
6458
+ e.textContent = Ye(r, c), l.appendChild(e);
6144
6459
  }
6145
- s.appendChild(l), A.set(t, l), j.set(t, {
6460
+ s.appendChild(l), N.set(t, l), P.set(t, {
6146
6461
  id: t,
6147
6462
  name: r,
6148
6463
  value: c,
6149
6464
  feature: e
6150
6465
  });
6151
6466
  }
6152
- let c = De.value;
6467
+ let c = Ee.value;
6153
6468
  if (c) {
6154
6469
  let e = ut(n(c));
6155
- 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), M = e;
6470
+ 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), ne = e;
6156
6471
  }
6157
6472
  e.appendChild(s);
6158
6473
  }
6159
6474
  function ft() {
6160
- let e = !k.value;
6161
- for (let [t, n] of A) {
6162
- let r = Ke(t), i = j.get(t);
6163
- if (n.setAttribute("fill", qe(t)), i && (i.value = r), e && i) {
6475
+ let e = !M.value;
6476
+ for (let [t, n] of N) {
6477
+ let r = Ge(t), i = P.get(t);
6478
+ if (n.setAttribute("fill", Ke(t)), i && (i.value = r), e && i) {
6164
6479
  let e = n.firstElementChild;
6165
- e && (e.textContent = Xe(i.name, r));
6480
+ e && (e.textContent = Ye(i.name, r));
6166
6481
  }
6167
6482
  }
6168
6483
  }
6169
6484
  function pt() {
6170
- for (let e of A.values()) e === R || z.has(e) || rt(e);
6171
- M && M.setAttribute("stroke", l.strokeColor);
6485
+ for (let e of N.values()) e === L || R.has(e) || rt(e);
6486
+ ne && ne.setAttribute("stroke", l.strokeColor);
6172
6487
  }
6173
6488
  function mt() {
6174
6489
  return typeof l.menu == "string" ? l.menu : "choropleth";
6175
6490
  }
6176
- let ht = n(() => l.legend && (Re.value || ze.value || l.data)), gt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), _t = n(() => {
6491
+ let ht = n(() => l.legend && (Le.value || Re.value || l.data)), gt = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), _t = n(() => {
6177
6492
  let e = [];
6178
6493
  for (let t = 0; t <= 10; t++) {
6179
6494
  let n = t / 10;
6180
6495
  e.push({
6181
6496
  offset: `${(n * 100).toFixed(0)}%`,
6182
- color: Ue(n)
6497
+ color: He(n)
6183
6498
  });
6184
6499
  }
6185
6500
  return e;
@@ -6187,7 +6502,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6187
6502
  notation: "compact",
6188
6503
  maximumFractionDigits: 1
6189
6504
  }), yt = n(() => {
6190
- let { min: e, max: t } = Le.value, n = t - e, r = [];
6505
+ let { min: e, max: t } = Ie.value, n = t - e, r = [];
6191
6506
  for (let t = 1; t <= 3; t++) {
6192
6507
  let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? vt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
6193
6508
  r.push({
@@ -6198,94 +6513,94 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6198
6513
  return r;
6199
6514
  }), bt = n(() => {
6200
6515
  let e = [];
6201
- if (Re.value) for (let t of l.colorScale) e.push({
6516
+ if (Le.value) for (let t of l.colorScale) e.push({
6202
6517
  key: t.value,
6203
6518
  color: t.color,
6204
6519
  label: t.value
6205
6520
  });
6206
- else if (ze.value) for (let t of gt.value) e.push({
6521
+ else if (Re.value) for (let t of gt.value) e.push({
6207
6522
  key: String(t.min),
6208
6523
  color: t.color,
6209
6524
  label: t.label ?? String(t.min)
6210
6525
  });
6211
6526
  return e;
6212
- }), Ct = n(() => `linear-gradient(to right, ${_t.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), It = n(() => {
6527
+ }), xt = n(() => `linear-gradient(to right, ${_t.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), St = n(() => {
6213
6528
  let e = mt();
6214
6529
  return [{
6215
6530
  label: "Save as SVG",
6216
6531
  action: () => {
6217
- S.value && Z(S.value, e);
6532
+ w.value && Z(w.value, e);
6218
6533
  }
6219
6534
  }, {
6220
6535
  label: "Save as PNG",
6221
6536
  action: () => {
6222
- S.value && pe(S.value, e);
6537
+ w.value && Q(w.value, e);
6223
6538
  }
6224
6539
  }];
6225
6540
  });
6226
- return C(() => [ke.value, k.value], () => dt()), C(() => [
6227
- Ie.value,
6541
+ return T(() => [Oe.value, M.value], () => dt()), T(() => [
6542
+ Fe.value,
6228
6543
  l.colorScale,
6229
6544
  l.noDataColor,
6230
6545
  l.dataGeoType
6231
- ], () => ft()), C(() => [l.strokeColor, Ae.value], () => pt()), C(() => [Pe.value, ke.value], () => ye(), { flush: "post" }), (n, c) => (g(), a("div", {
6546
+ ], () => ft()), T(() => [l.strokeColor, ke.value], () => pt()), T(() => [Ne.value, Oe.value], () => ve(), { flush: "post" }), (n, c) => (_(), a("div", {
6232
6547
  ref_key: "containerRef",
6233
- ref: x,
6548
+ ref: S,
6234
6549
  class: f(["choropleth-wrapper", { pannable: t.pan }])
6235
6550
  }, [
6236
- t.menu ? (g(), r(ce, {
6551
+ t.menu ? (_(), r(le, {
6237
6552
  key: 0,
6238
- items: It.value
6553
+ items: St.value
6239
6554
  }, null, 8, ["items"])) : i("", !0),
6240
- t.title || ht.value ? (g(), a("div", Tt, [t.title ? (g(), a("div", Et, y(t.title), 1)) : i("", !0), ht.value ? (g(), a("div", Dt, [t.legendTitle ? (g(), a("span", Ot, y(t.legendTitle), 1)) : i("", !0), Re.value || ze.value ? (g(!0), a(e, { key: 1 }, v(bt.value, (e) => (g(), a("span", {
6555
+ t.title || ht.value ? (_(), a("div", Jt, [t.title ? (_(), a("div", Yt, b(t.title), 1)) : i("", !0), ht.value ? (_(), a("div", Xt, [t.legendTitle ? (_(), a("span", Zt, b(t.legendTitle), 1)) : i("", !0), Le.value || Re.value ? (_(!0), a(e, { key: 1 }, y(bt.value, (e) => (_(), a("span", {
6241
6556
  key: e.key,
6242
6557
  class: "choropleth-legend-item"
6243
6558
  }, [o("span", {
6244
6559
  class: "choropleth-legend-swatch",
6245
6560
  style: m({ background: e.color })
6246
- }, null, 4), s(" " + y(e.label), 1)]))), 128)) : (g(), a("div", kt, [o("div", {
6561
+ }, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", Qt, [o("div", {
6247
6562
  class: "choropleth-legend-gradient",
6248
- style: m({ background: Ct.value })
6249
- }, null, 4), o("div", At, [(g(!0), a(e, null, v(yt.value, (e) => (g(), a("span", {
6563
+ style: m({ background: xt.value })
6564
+ }, null, 4), o("div", $t, [(_(!0), a(e, null, y(yt.value, (e) => (_(), a("span", {
6250
6565
  key: e.value,
6251
6566
  style: m({ left: e.pct + "%" })
6252
- }, y(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
6253
- (g(), a("svg", {
6567
+ }, b(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
6568
+ (_(), a("svg", {
6254
6569
  ref_key: "svgRef",
6255
- ref: S,
6256
- viewBox: `0 0 ${Ce.value} ${we.value}`,
6570
+ ref: w,
6571
+ viewBox: `0 0 ${Se.value} ${Ce.value}`,
6257
6572
  preserveAspectRatio: "xMidYMid meet"
6258
6573
  }, [o("g", {
6259
6574
  ref_key: "mapGroupRef",
6260
- ref: T
6575
+ ref: D
6261
6576
  }, [o("g", {
6262
6577
  ref_key: "baseGroupRef",
6263
- ref: ie
6578
+ ref: O
6264
6579
  }, null, 512), o("g", {
6265
6580
  ref_key: "overlayGroupRef",
6266
- ref: E
6267
- }, null, 512)], 512)], 8, jt)),
6268
- le.value ? (g(), a("button", {
6581
+ ref: k
6582
+ }, null, 512)], 512)], 8, en)),
6583
+ K.value ? (_(), a("button", {
6269
6584
  key: 2,
6270
6585
  type: "button",
6271
6586
  class: "choropleth-reset",
6272
6587
  "aria-label": "Reset zoom",
6273
- onClick: xe
6588
+ onClick: be
6274
6589
  }, " Reset ")) : i("", !0),
6275
- k.value ? (g(), r(wt, {
6590
+ M.value ? (_(), r(qt, {
6276
6591
  key: 3,
6277
6592
  ref_key: "tooltipChildRef",
6278
- ref: D
6593
+ ref: A
6279
6594
  }, {
6280
- default: w((r) => [te(n.$slots, "tooltip", p(u(ne(r))), () => [t.tooltipFormat ? (g(), a("span", {
6595
+ default: E((r) => [ee(n.$slots, "tooltip", p(u(te(r))), () => [t.tooltipFormat ? (_(), a("span", {
6281
6596
  key: 0,
6282
6597
  innerHTML: t.tooltipFormat(r)
6283
- }, null, 8, Mt)) : r.value == null ? (g(), a(e, { key: 1 }, [s(y(r.name), 1)], 64)) : (g(), a(e, { key: 2 }, [s(y(r.name) + ": " + y(Ye(r.value)), 1)], 64))], !0)]),
6598
+ }, null, 8, tn)) : r.value == null ? (_(), a(e, { key: 1 }, [s(b(r.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(r.name) + ": " + b(Je(r.value)), 1)], 64))], !0)]),
6284
6599
  _: 3
6285
6600
  }, 512)) : i("", !0)
6286
6601
  ], 2));
6287
6602
  }
6288
- }), [["__scopeId", "data-v-f0f75b22"]]), Lt = /* @__PURE__ */ V(/* @__PURE__ */ l({
6603
+ }), [["__scopeId", "data-v-f0f75b22"]]), sn = /* @__PURE__ */ B(/* @__PURE__ */ l({
6289
6604
  __name: "ChartTooltip",
6290
6605
  props: {
6291
6606
  x: {},
@@ -6296,7 +6611,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6296
6611
  },
6297
6612
  emits: ["close"],
6298
6613
  setup(e) {
6299
- return (t, n) => e.mode === "hover" && e.open ? (g(), a("div", {
6614
+ return (t, n) => e.mode === "hover" && e.open ? (_(), a("div", {
6300
6615
  key: 0,
6301
6616
  class: "chart-tooltip-content",
6302
6617
  style: m({
@@ -6305,12 +6620,12 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6305
6620
  top: `${e.y}px`,
6306
6621
  transform: "translateY(-50%)"
6307
6622
  })
6308
- }, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (g(), r(x(M), {
6623
+ }, [ee(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (_(), r(S(ne), {
6309
6624
  key: 1,
6310
6625
  open: e.open
6311
6626
  }, {
6312
- default: w(() => [c(x(k), { "as-child": "" }, {
6313
- default: w(() => [o("div", {
6627
+ default: E(() => [c(S(M), { "as-child": "" }, {
6628
+ default: E(() => [o("div", {
6314
6629
  class: "chart-tooltip-anchor",
6315
6630
  style: m({
6316
6631
  left: `${e.x}px`,
@@ -6318,8 +6633,8 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6318
6633
  })
6319
6634
  }, null, 4)]),
6320
6635
  _: 1
6321
- }), c(x(j), null, {
6322
- default: w(() => [e.open ? (g(), r(x(A), {
6636
+ }), c(S(P), null, {
6637
+ default: E(() => [e.open ? (_(), r(S(N), {
6323
6638
  key: 0,
6324
6639
  class: "chart-tooltip-content",
6325
6640
  side: "right",
@@ -6328,7 +6643,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6328
6643
  onPointerDownOutside: n[0] ||= (e) => t.$emit("close"),
6329
6644
  onEscapeKeyDown: n[1] ||= (e) => t.$emit("close")
6330
6645
  }, {
6331
- default: w(() => [te(t.$slots, "default", {}, void 0, !0)]),
6646
+ default: E(() => [ee(t.$slots, "default", {}, void 0, !0)]),
6332
6647
  _: 3
6333
6648
  }, 8, ["side-offset"])) : i("", !0)]),
6334
6649
  _: 3
@@ -6336,7 +6651,7 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6336
6651
  _: 3
6337
6652
  }, 8, ["open"])) : i("", !0);
6338
6653
  }
6339
- }), [["__scopeId", "data-v-44377f70"]]), Rt = { class: "TableWrapper" }, zt = /* @__PURE__ */ V(/* @__PURE__ */ l({
6654
+ }), [["__scopeId", "data-v-44377f70"]]), cn = { class: "TableWrapper" }, ln = /* @__PURE__ */ B(/* @__PURE__ */ l({
6340
6655
  __name: "DataTable",
6341
6656
  props: {
6342
6657
  data: {},
@@ -6392,60 +6707,60 @@ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, xe = [
6392
6707
  name: e,
6393
6708
  values: t
6394
6709
  }));
6395
- }), ee = n(() => {
6710
+ }), g = n(() => {
6396
6711
  let e = h.value;
6397
6712
  if (e.length === 0) return 0;
6398
6713
  let t = 0;
6399
6714
  for (let n of e) t = Math.max(t, n.values.length);
6400
6715
  return c.maxRows ? Math.min(t, c.maxRows) : t;
6401
6716
  });
6402
- function _(e, t) {
6717
+ function v(e, t) {
6403
6718
  let n = e.values[t];
6404
6719
  return n == null ? "" : e.enumLabels && typeof n == "number" ? e.enumLabels[n] ?? String(n) : typeof n == "number" ? Number.isInteger(n) ? n.toString() : n.toFixed(4) : typeof n == "boolean" ? n ? "true" : "false" : String(n);
6405
6720
  }
6406
- function te() {
6721
+ function ee() {
6407
6722
  return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
6408
6723
  }
6409
- function ne(e) {
6724
+ function te(e) {
6410
6725
  return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
6411
6726
  }
6412
- function b() {
6727
+ function x() {
6413
6728
  if (typeof c.csv == "function") return c.csv();
6414
6729
  if (typeof c.csv == "string") return c.csv;
6415
- let e = h.value, t = ee.value, n = [e.map((e) => ne(l(e.name))).join(",")];
6730
+ let e = h.value, t = g.value, n = [e.map((e) => te(l(e.name))).join(",")];
6416
6731
  for (let r = 0; r < t; r++) {
6417
- let t = e.map((e) => ne(_(e, r)));
6732
+ let t = e.map((e) => te(v(e, r)));
6418
6733
  n.push(t.join(","));
6419
6734
  }
6420
6735
  return n.join("\n");
6421
6736
  }
6422
- let x = n(() => [{
6737
+ let S = n(() => [{
6423
6738
  label: c.downloadMenuLink,
6424
- action: () => Q(b(), te())
6425
- }]), re = n(() => !!c.menu);
6426
- return (n, s) => (g(), a("div", { class: f(["TableOuter", {
6739
+ action: () => me(x(), ee())
6740
+ }]), C = n(() => !!c.menu);
6741
+ return (n, s) => (_(), a("div", { class: f(["TableOuter", {
6427
6742
  "full-width": t.fullWidth,
6428
- "has-menu": re.value
6429
- }]) }, [re.value ? (g(), r(ce, {
6743
+ "has-menu": C.value
6744
+ }]) }, [C.value ? (_(), r(le, {
6430
6745
  key: 0,
6431
- items: x.value,
6746
+ items: S.value,
6432
6747
  "force-dropdown": ""
6433
- }, null, 8, ["items"])) : i("", !0), o("div", Rt, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
6434
- o("colgroup", null, [(g(!0), a(e, null, v(h.value, (e) => (g(), a("col", {
6748
+ }, null, 8, ["items"])) : i("", !0), o("div", cn, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
6749
+ o("colgroup", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("col", {
6435
6750
  key: e.name,
6436
6751
  style: m(u(e.name))
6437
6752
  }, null, 4))), 128))]),
6438
- o("thead", null, [o("tr", null, [(g(!0), a(e, null, v(h.value, (e) => (g(), a("th", {
6753
+ o("thead", null, [o("tr", null, [(_(!0), a(e, null, y(h.value, (e) => (_(), a("th", {
6439
6754
  key: e.name,
6440
6755
  style: m(d(e.name))
6441
- }, y(l(e.name)), 5))), 128))])]),
6442
- o("tbody", null, [(g(!0), a(e, null, v(ee.value, (n) => (g(), a("tr", { key: n }, [(g(!0), a(e, null, v(h.value, (e) => (g(), a("td", {
6756
+ }, b(l(e.name)), 5))), 128))])]),
6757
+ 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", {
6443
6758
  key: e.name,
6444
6759
  class: f(t.columnConfig?.[e.name]?.cellClass),
6445
6760
  style: m(d(e.name))
6446
- }, y(_(e, n - 1)), 7))), 128))]))), 128))])
6761
+ }, b(v(e, n - 1)), 7))), 128))]))), 128))])
6447
6762
  ], 2)])], 2));
6448
6763
  }
6449
6764
  }), [["__scopeId", "data-v-d5c290dc"]]);
6450
6765
  //#endregion
6451
- export { bt as BarChart, Lt as ChartTooltip, It as ChoroplethMap, zt as DataTable, et as LineChart, xt as fipsToHsa, St as hsaNames };
6766
+ export { Ut as BarChart, sn as ChartTooltip, on as ChoroplethMap, ln as DataTable, St as LineChart, Wt as fipsToHsa, Gt as hsaNames };