@cfasim-ui/charts 0.4.1 → 0.4.2

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,11 +1,11 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, mergeProps as u, normalizeClass as d, normalizeProps as f, normalizeStyle as p, onMounted as ee, onUnmounted as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, toHandlers as te, toRaw as b, unref as x, useId as S, watch as ne, withCtx as C } from "vue";
2
- import { DropdownMenuContent as w, DropdownMenuItem as T, DropdownMenuPortal as re, DropdownMenuRoot as E, DropdownMenuTrigger as D, PopoverAnchor as O, PopoverContent as k, PopoverPortal as A, PopoverRoot as j } from "reka-ui";
3
- import { geoAlbersUsa as M, geoPath as N } from "d3-geo";
4
- import { zoom as P } from "d3-zoom";
5
- import { select as F } from "d3-selection";
6
- import { feature as I, merge as L, mesh as ie } from "topojson-client";
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 E, DropdownMenuPortal as D, DropdownMenuRoot as O, DropdownMenuTrigger as k, PopoverAnchor as A, PopoverContent as j, PopoverPortal as M, PopoverRoot as N } from "reka-ui";
3
+ import { geoAlbersUsa as P, geoPath as ie } from "d3-geo";
4
+ import { zoom as F, zoomIdentity as I } from "d3-zoom";
5
+ import { select as ae } from "d3-selection";
6
+ import { feature as L, merge as oe, mesh as R } from "topojson-client";
7
7
  //#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
8
- var R = { class: "chart-menu-trigger-area" }, ae = ["aria-label"], z = /* @__PURE__ */ c({
8
+ var se = { class: "chart-menu-trigger-area" }, z = ["aria-label"], B = /* @__PURE__ */ l({
9
9
  __name: "ChartMenu",
10
10
  props: {
11
11
  items: {},
@@ -15,51 +15,51 @@ var R = { class: "chart-menu-trigger-area" }, ae = ["aria-label"], z = /* @__PUR
15
15
  }
16
16
  },
17
17
  setup(t) {
18
- let r = t, c = () => r.forceDropdown || r.items.length > 1;
19
- return (r, l) => (h(), i("div", R, [c() ? (h(), n(x(E), {
18
+ let n = t, i = () => n.forceDropdown || n.items.length > 1;
19
+ return (n, l) => (g(), a("div", se, [i() ? (g(), r(x(O), {
20
20
  key: 1,
21
21
  modal: !1
22
22
  }, {
23
- default: C(() => [s(x(D), {
23
+ default: w(() => [c(x(k), {
24
24
  class: "chart-menu-button",
25
25
  "aria-label": "Chart options"
26
26
  }, {
27
- default: C(() => [...l[2] ||= [a("svg", {
27
+ default: w(() => [...l[2] ||= [o("svg", {
28
28
  width: "16",
29
29
  height: "16",
30
30
  viewBox: "0 0 16 16",
31
31
  fill: "currentColor",
32
32
  "aria-hidden": "true"
33
33
  }, [
34
- a("circle", {
34
+ o("circle", {
35
35
  cx: "3",
36
36
  cy: "8",
37
37
  r: "1.5"
38
38
  }),
39
- a("circle", {
39
+ o("circle", {
40
40
  cx: "8",
41
41
  cy: "8",
42
42
  r: "1.5"
43
43
  }),
44
- a("circle", {
44
+ o("circle", {
45
45
  cx: "13",
46
46
  cy: "8",
47
47
  r: "1.5"
48
48
  })
49
49
  ], -1)]]),
50
50
  _: 1
51
- }), s(x(re), null, {
52
- default: C(() => [s(x(w), {
51
+ }), c(x(D), null, {
52
+ default: w(() => [c(x(T), {
53
53
  class: "chart-menu-content",
54
54
  "side-offset": 4,
55
55
  align: "end"
56
56
  }, {
57
- default: C(() => [(h(!0), i(e, null, _(t.items, (e) => (h(), n(x(T), {
57
+ default: w(() => [(g(!0), a(e, null, v(t.items, (e) => (g(), r(x(E), {
58
58
  key: e.label,
59
59
  class: "chart-menu-item",
60
60
  onSelect: e.action
61
61
  }, {
62
- default: C(() => [o(y(e.label), 1)]),
62
+ default: w(() => [s(y(e.label), 1)]),
63
63
  _: 2
64
64
  }, 1032, ["onSelect"]))), 128))]),
65
65
  _: 1
@@ -67,12 +67,12 @@ var R = { class: "chart-menu-trigger-area" }, ae = ["aria-label"], z = /* @__PUR
67
67
  _: 1
68
68
  })]),
69
69
  _: 1
70
- })) : (h(), i("button", {
70
+ })) : (g(), a("button", {
71
71
  key: 0,
72
72
  class: "chart-menu-button chart-menu-single",
73
73
  "aria-label": t.items[0].label,
74
74
  onClick: l[0] ||= (...e) => t.items[0].action && t.items[0].action(...e)
75
- }, [...l[1] ||= [a("svg", {
75
+ }, [...l[1] ||= [o("svg", {
76
76
  width: "14",
77
77
  height: "14",
78
78
  viewBox: "0 0 14 14",
@@ -82,48 +82,48 @@ var R = { class: "chart-menu-trigger-area" }, ae = ["aria-label"], z = /* @__PUR
82
82
  "stroke-linecap": "round",
83
83
  "stroke-linejoin": "round",
84
84
  "aria-hidden": "true"
85
- }, [a("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, ae))]));
85
+ }, [o("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, z))]));
86
86
  }
87
- }), B = (e, t) => {
87
+ }), V = (e, t) => {
88
88
  let n = e.__vccOpts || e;
89
89
  for (let [e, r] of t) n[e] = r;
90
90
  return n;
91
- }, oe = /* @__PURE__ */ B(z, [["__scopeId", "data-v-b3c563e8"]]);
91
+ }, ce = /* @__PURE__ */ V(B, [["__scopeId", "data-v-b3c563e8"]]);
92
92
  //#endregion
93
93
  //#region src/_shared/axes.ts
94
- function V(e) {
94
+ function H(e) {
95
95
  return Math.round(e) + .5;
96
96
  }
97
- function H(e, t) {
97
+ function U(e, t) {
98
98
  let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
99
99
  return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
100
100
  }
101
- function se(e, t, n) {
101
+ function W(e, t, n) {
102
102
  if (!(n > 0) || !isFinite(n)) return [];
103
103
  let r = [], i = Math.ceil(e / n) * n;
104
104
  for (let e = 0, a = i; a <= t + 1e-9 && e < 1e3; e++, a = i + e * n) r.push(a);
105
105
  return r;
106
106
  }
107
- var U = new Intl.NumberFormat();
108
- function W(e) {
109
- return Math.abs(e) >= 1e3 ? U.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
107
+ var le = new Intl.NumberFormat();
108
+ function G(e) {
109
+ return Math.abs(e) >= 1e3 ? le.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
110
110
  }
111
111
  //#endregion
112
112
  //#region src/_shared/computeTicks.ts
113
- function ce(e) {
113
+ function K(e) {
114
114
  let { min: t, max: n, ticks: r } = e;
115
115
  if (t === n) return [];
116
116
  let i = e.displayOffset ?? 0;
117
117
  if (Array.isArray(r)) return r.map((e) => e - i).filter((e) => e >= t && e <= n);
118
- if (typeof r == "number") return se(t + i, n + i, r).map((e) => e - i);
119
- let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = H(n - t, a);
120
- return se(t + i, n + i, o).map((e) => e - i);
118
+ if (typeof r == "number") return W(t + i, n + i, r).map((e) => e - i);
119
+ let a = Math.max(3, Math.floor(e.targetTickCount ?? 3)), o = U(n - t, a);
120
+ return W(t + i, n + i, o).map((e) => e - i);
121
121
  }
122
122
  //#endregion
123
123
  //#region src/_shared/useChartSize.ts
124
- function G(e = {}) {
125
- let t = g(null), n = g(0), r = null, i = null;
126
- return ee(() => {
124
+ function ue(e = {}) {
125
+ let t = _(null), n = _(0), r = null, i = null;
126
+ return h(() => {
127
127
  t.value && (n.value = t.value.clientWidth, r = new ResizeObserver((t) => {
128
128
  let r = t[0];
129
129
  if (!r) return;
@@ -132,30 +132,30 @@ function G(e = {}) {
132
132
  n.value = r.contentRect.width;
133
133
  }, a)) : n.value = r.contentRect.width;
134
134
  }), r.observe(t.value));
135
- }), m(() => {
135
+ }), ee(() => {
136
136
  r?.disconnect(), i && clearTimeout(i);
137
137
  }), {
138
138
  containerRef: t,
139
139
  measuredWidth: n
140
140
  };
141
141
  }
142
- function K(e) {
143
- let n = t(() => ({
142
+ function de(e) {
143
+ let t = n(() => ({
144
144
  top: (e.title() ? 30 : 10) + (e.hasInlineLegend() ? 20 : 0),
145
145
  right: 10,
146
146
  bottom: e.xLabel() ? 46 : 30,
147
147
  left: e.yLabel() ? 66 : 50
148
148
  }));
149
149
  return {
150
- padding: n,
151
- innerW: t(() => e.width() - n.value.left - n.value.right),
152
- innerH: t(() => e.height() - n.value.top - n.value.bottom)
150
+ padding: t,
151
+ innerW: n(() => e.width() - t.value.left - t.value.right),
152
+ innerH: n(() => e.height() - t.value.top - t.value.bottom)
153
153
  };
154
154
  }
155
155
  //#endregion
156
156
  //#region src/tooltip-position.ts
157
157
  var q = 16, J = 8;
158
- function le(e, t, n, r, i, a) {
158
+ function Y(e, t, n, r, i, a) {
159
159
  if (i === "none") return {
160
160
  left: e + q,
161
161
  top: t
@@ -178,8 +178,8 @@ function le(e, t, n, r, i, a) {
178
178
  }
179
179
  //#endregion
180
180
  //#region src/_shared/useChartTooltip.ts
181
- function ue(e) {
182
- let t = e.touchYOffset ?? 50, n = g(null), r = g(!1), i = g(null), a = g(null), o = g(null);
181
+ function fe(e) {
182
+ let t = e.touchYOffset ?? 50, n = _(null), r = _(!1), i = _(null), a = _(null), o = _(null);
183
183
  function s(e) {
184
184
  return "touches" in e ? e.touches[0] ?? null : e;
185
185
  }
@@ -192,14 +192,14 @@ function ue(e) {
192
192
  clientY: r.clientY
193
193
  }, e.onHover?.({ index: i }));
194
194
  }
195
- ne([a, n], () => {
195
+ C([a, n], () => {
196
196
  if (n.value === null || !a.value) {
197
197
  o.value = null;
198
198
  return;
199
199
  }
200
200
  let s = i.value, c = e.containerRef.value;
201
201
  if (!s || !c) return;
202
- let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = le(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
202
+ let l = c.getBoundingClientRect(), u = r.value ? t : 0, d = e.clamp?.() ?? "chart", { left: f, top: p } = Y(a.value.clientX, a.value.clientY - u, s.offsetWidth, s.offsetHeight, d, l);
203
203
  o.value = {
204
204
  left: f - l.left,
205
205
  top: p - l.top
@@ -224,7 +224,7 @@ function ue(e) {
224
224
  function p(t) {
225
225
  e.enabled() && (t.preventDefault(), c(t));
226
226
  }
227
- function ee() {
227
+ function m() {
228
228
  e.enabled() && (r.value = !1, n.value = null, e.onHover?.(null));
229
229
  }
230
230
  return {
@@ -239,23 +239,23 @@ function ue(e) {
239
239
  click: d,
240
240
  touchstart: f,
241
241
  touchmove: p,
242
- touchend: ee
242
+ touchend: m
243
243
  }
244
244
  };
245
245
  }
246
246
  //#endregion
247
247
  //#region src/ChartMenu/download.ts
248
- function Y(e, t) {
248
+ function pe(e, t) {
249
249
  let n = URL.createObjectURL(e), r = document.createElement("a");
250
250
  r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
251
251
  }
252
- function de(e, t) {
252
+ function X(e, t) {
253
253
  let n = e.cloneNode(!0);
254
254
  n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
255
255
  let r = new XMLSerializer().serializeToString(n);
256
- Y(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
256
+ pe(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
257
257
  }
258
- function X(e, t) {
258
+ function me(e, t) {
259
259
  let n = e.cloneNode(!0);
260
260
  n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
261
261
  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;
@@ -264,17 +264,17 @@ function X(e, t) {
264
264
  e.width = s * 2, e.height = c * 2;
265
265
  let n = e.getContext("2d");
266
266
  n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
267
- e && Y(e, `${t}.png`);
267
+ e && pe(e, `${t}.png`);
268
268
  }), URL.revokeObjectURL(a);
269
269
  }, o.src = a;
270
270
  }
271
- function fe(e, t) {
272
- Y(new Blob([e], { type: "text/csv" }), `${t}.csv`);
271
+ function Z(e, t) {
272
+ pe(new Blob([e], { type: "text/csv" }), `${t}.csv`);
273
273
  }
274
274
  //#endregion
275
275
  //#region src/_shared/useChartMenu.ts
276
- function pe(e) {
277
- let n = g(null);
276
+ function he(e) {
277
+ let t = _(null);
278
278
  function r() {
279
279
  let t = e.filename();
280
280
  if (t) return t;
@@ -282,35 +282,35 @@ function pe(e) {
282
282
  return typeof n == "string" ? n : "chart";
283
283
  }
284
284
  return {
285
- svgRef: n,
286
- items: t(() => {
287
- let t = r(), i = [{
285
+ svgRef: t,
286
+ items: n(() => {
287
+ let n = r(), i = [{
288
288
  label: "Save as SVG",
289
289
  action: () => {
290
- n.value && de(n.value, t);
290
+ t.value && X(t.value, n);
291
291
  }
292
292
  }, {
293
293
  label: "Save as PNG",
294
294
  action: () => {
295
- n.value && X(n.value, t);
295
+ t.value && me(t.value, n);
296
296
  }
297
297
  }];
298
298
  return e.downloadLink() || i.push({
299
299
  label: "Download CSV",
300
- action: () => fe(e.getCsv(), t)
300
+ action: () => Z(e.getCsv(), n)
301
301
  }), i;
302
302
  }),
303
- downloadLinkText: t(() => {
303
+ downloadLinkText: n(() => {
304
304
  let t = e.downloadLink();
305
305
  return t ? typeof t == "string" ? t : "Download data (CSV)" : null;
306
306
  }),
307
- csvHref: t(() => e.downloadLink() ? `data:text/csv;charset=utf-8,${encodeURIComponent(e.getCsv())}` : null),
307
+ csvHref: n(() => e.downloadLink() ? `data:text/csv;charset=utf-8,${encodeURIComponent(e.getCsv())}` : null),
308
308
  resolvedFilename: r
309
309
  };
310
310
  }
311
311
  //#endregion
312
312
  //#region src/_shared/seriesCsv.ts
313
- function me(e) {
313
+ function ge(e) {
314
314
  if (e.length === 0) return "";
315
315
  let t = 0;
316
316
  for (let n of e) n.data.length > t && (t = n.data.length);
@@ -322,7 +322,7 @@ function me(e) {
322
322
  }
323
323
  return i.join("\n");
324
324
  }
325
- function Z(e, t, n = "category") {
325
+ function _e(e, t, n = "category") {
326
326
  if (t.length === 0 || e.length === 0) return "";
327
327
  let r = [(t.length === 1 ? [n, t[0].label || "value"] : [n, ...t.map((e, t) => e.label || `series_${t}`)]).join(",")];
328
328
  for (let n = 0; n < e.length; n++) {
@@ -337,70 +337,70 @@ function Q(e) {
337
337
  }
338
338
  //#endregion
339
339
  //#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
340
- var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
340
+ var ve = ["width", "height"], ye = ["x"], be = { key: 1 }, $ = [
341
341
  "x1",
342
342
  "y1",
343
343
  "x2",
344
344
  "y2",
345
345
  "stroke",
346
346
  "stroke-dasharray"
347
- ], ye = [
347
+ ], xe = [
348
348
  "cx",
349
349
  "cy",
350
350
  "fill",
351
351
  "fill-opacity",
352
352
  "stroke"
353
- ], be = ["x", "y"], xe = [
353
+ ], Se = ["x", "y"], Ce = [
354
354
  "x1",
355
355
  "y1",
356
356
  "x2",
357
357
  "y2"
358
- ], $ = [
358
+ ], we = [
359
359
  "x1",
360
360
  "y1",
361
361
  "x2",
362
362
  "y2"
363
- ], Se = [
363
+ ], Te = [
364
364
  "x1",
365
365
  "y1",
366
366
  "x2",
367
367
  "y2"
368
- ], Ce = [
368
+ ], Ee = [
369
369
  "x1",
370
370
  "y1",
371
371
  "x2",
372
372
  "y2"
373
- ], we = ["x", "y"], Te = ["transform"], Ee = [
373
+ ], De = ["x", "y"], Oe = ["transform"], ke = [
374
374
  "x",
375
375
  "y",
376
376
  "text-anchor"
377
- ], De = ["x", "y"], Oe = [
377
+ ], Ae = ["x", "y"], je = [
378
378
  "d",
379
379
  "fill",
380
380
  "fill-opacity"
381
- ], ke = [
381
+ ], Me = [
382
382
  "d",
383
383
  "stroke",
384
384
  "stroke-width",
385
385
  "stroke-opacity",
386
386
  "stroke-dasharray"
387
- ], Ae = [
387
+ ], Ne = [
388
388
  "cx",
389
389
  "cy",
390
390
  "r",
391
391
  "fill",
392
392
  "fill-opacity",
393
393
  "stroke"
394
- ], je = [
394
+ ], Pe = [
395
395
  "d",
396
396
  "fill",
397
397
  "fill-opacity"
398
- ], Me = [
398
+ ], Fe = [
399
399
  "d",
400
400
  "stroke",
401
401
  "stroke-width",
402
402
  "stroke-dasharray"
403
- ], Ne = [
403
+ ], Ie = [
404
404
  "x1",
405
405
  "y1",
406
406
  "x2",
@@ -408,7 +408,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
408
408
  "stroke",
409
409
  "stroke-width",
410
410
  "stroke-dasharray"
411
- ], Pe = [
411
+ ], Le = [
412
412
  "x1",
413
413
  "y1",
414
414
  "x2",
@@ -416,44 +416,44 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
416
416
  "stroke",
417
417
  "stroke-width",
418
418
  "stroke-dasharray"
419
- ], Fe = [
419
+ ], Re = [
420
420
  "x1",
421
421
  "y1",
422
422
  "x2",
423
423
  "y2"
424
- ], Ie = [
424
+ ], ze = [
425
425
  "x1",
426
426
  "y1",
427
427
  "x2",
428
428
  "y2"
429
- ], Le = [
429
+ ], Be = [
430
430
  "x1",
431
431
  "y1",
432
432
  "x2",
433
433
  "y2"
434
- ], Re = [
434
+ ], Ve = [
435
435
  "cx",
436
436
  "cy",
437
437
  "fill"
438
- ], ze = [
438
+ ], He = [
439
439
  "x",
440
440
  "y",
441
441
  "width",
442
442
  "height"
443
- ], Be = [
443
+ ], Ue = [
444
444
  "cx",
445
445
  "cy",
446
446
  "fill",
447
447
  "fill-opacity",
448
448
  "stroke"
449
- ], Ve = [
449
+ ], We = [
450
450
  "x",
451
451
  "y",
452
452
  "fill"
453
- ], He = ["x", "y"], Ue = { class: "line-chart-tooltip" }, We = {
453
+ ], Ge = ["x", "y"], Ke = { class: "line-chart-tooltip" }, qe = {
454
454
  key: 0,
455
455
  class: "line-chart-tooltip-label"
456
- }, Ge = ["href", "download"], Ke = 36, qe = 12, Je = 7, Ye = 16, Xe = /* @__PURE__ */ B(/* @__PURE__ */ c({
456
+ }, Je = ["href", "download"], Ye = 36, Xe = 12, Ze = 7, Qe = 16, $e = /* @__PURE__ */ V(/* @__PURE__ */ l({
457
457
  __name: "LineChart",
458
458
  props: {
459
459
  y: {},
@@ -491,44 +491,44 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
491
491
  downloadLink: { type: [Boolean, String] }
492
492
  },
493
493
  emits: ["hover"],
494
- setup(s, { emit: c }) {
495
- let d = s, ee = c, { containerRef: m, measuredWidth: g } = G({ debounce: () => d.debounce }), b = t(() => d.width ?? (g.value || 400)), S = t(() => d.height ?? 200), ne = t(() => O.value.some((e) => e.legend) || d.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description)) || !1), { padding: C, innerW: w, innerH: T } = K({
496
- title: () => d.title,
497
- xLabel: () => d.xLabel,
498
- yLabel: () => d.yLabel,
499
- hasInlineLegend: () => ne.value,
500
- width: () => b.value,
501
- height: () => S.value
502
- }), re = [];
494
+ setup(t, { emit: c }) {
495
+ let l = t, f = c, { containerRef: h, measuredWidth: ee } = ue({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => O.value.some((e) => e.legend) || l.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description)) || !1), { padding: S, innerW: C, innerH: w } = de({
496
+ title: () => l.title,
497
+ xLabel: () => l.xLabel,
498
+ yLabel: () => l.yLabel,
499
+ hasInlineLegend: () => re.value,
500
+ width: () => _.value,
501
+ height: () => b.value
502
+ }), T = [];
503
503
  function E(e) {
504
504
  return {
505
505
  ...e,
506
- data: e.y ?? e.data ?? re
506
+ data: e.y ?? e.data ?? T
507
507
  };
508
508
  }
509
509
  function D(e) {
510
- return d.tooltipValueFormat ? d.tooltipValueFormat(e) : d.yTickFormat ? d.yTickFormat(e) : W(e);
510
+ return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.yTickFormat ? l.yTickFormat(e) : G(e);
511
511
  }
512
- let O = t(() => {
513
- if (d.series && d.series.length > 0) return d.series.map(E);
514
- let e = d.y ?? d.data;
512
+ let O = n(() => {
513
+ if (l.series && l.series.length > 0) return l.series.map(E);
514
+ let e = l.y ?? l.data;
515
515
  return e ? [{
516
516
  data: e,
517
- x: d.x
517
+ x: l.x
518
518
  }] : [];
519
- }), k = t(() => d.areas ?? []), A = t(() => {
519
+ }), k = n(() => l.areas ?? []), A = n(() => {
520
520
  let e = 0;
521
521
  for (let t of O.value) t.data.length > e && (e = t.data.length);
522
522
  for (let t of k.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
523
523
  return e;
524
- }), j = t(() => O.value.some((e) => e.x != null) || k.value.some((e) => e.x != null));
524
+ }), j = n(() => O.value.some((e) => e.x != null) || k.value.some((e) => e.x != null));
525
525
  function M(e, t) {
526
526
  return e.x ? Number(e.x[t]) : t;
527
527
  }
528
528
  function N(e, t) {
529
529
  return e.x ? Number(e.x[t]) : t;
530
530
  }
531
- let P = t(() => j.value ? 0 : d.xMin ?? 0), F = t(() => {
531
+ let P = n(() => j.value ? 0 : l.xMin ?? 0), ie = n(() => {
532
532
  let e = Infinity, t = -Infinity;
533
533
  for (let n of O.value) for (let r = 0; r < n.data.length; r++) {
534
534
  let i = M(n, r);
@@ -549,18 +549,18 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
549
549
  max: 0
550
550
  };
551
551
  });
552
- function I(e) {
553
- let { min: t, max: n } = F.value, r = n - t || 1;
554
- return C.value.left + (e - t) / r * w.value;
552
+ function F(e) {
553
+ let { min: t, max: n } = ie.value, r = n - t || 1;
554
+ return S.value.left + (e - t) / r * C.value;
555
555
  }
556
- let L = t(() => {
556
+ let I = n(() => {
557
557
  let e = Infinity, t = -Infinity;
558
558
  for (let n of O.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
559
559
  for (let n of k.value) {
560
560
  for (let r of n.upper) isFinite(r) && (r < e && (e = r), r > t && (t = r));
561
561
  for (let r of n.lower) isFinite(r) && (r < e && (e = r), r > t && (t = r));
562
562
  }
563
- return isFinite(e) ? (d.yMin != null && d.yMin < e && (e = d.yMin), {
563
+ return isFinite(e) ? (l.yMin != null && l.yMin < e && (e = l.yMin), {
564
564
  min: e,
565
565
  max: t,
566
566
  range: t - e || 1
@@ -570,75 +570,75 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
570
570
  range: 1
571
571
  };
572
572
  });
573
- function ie(e) {
573
+ function ae(e) {
574
574
  let t = e.data;
575
575
  if (t.length === 0) return "";
576
- let { min: n, range: r } = L.value, i = T.value / r, a = C.value.top + T.value, o = "", s = !1;
576
+ let { min: n, range: r } = I.value, i = w.value / r, a = S.value.top + w.value, o = "", s = !1;
577
577
  for (let r = 0; r < t.length; r++) {
578
578
  let c = M(e, r);
579
579
  if (!isFinite(t[r]) || !isFinite(c)) {
580
580
  s = !1;
581
581
  continue;
582
582
  }
583
- let l = I(c), u = a - (t[r] - n) * i;
583
+ let l = F(c), u = a - (t[r] - n) * i;
584
584
  o += s ? `L${l},${u}` : `M${l},${u}`, s = !0;
585
585
  }
586
586
  return o;
587
587
  }
588
- function R(e) {
589
- let t = e.data, { min: n, range: r } = L.value, i = T.value / r, a = C.value.top + T.value, o = [];
588
+ function L(e) {
589
+ let t = e.data, { min: n, range: r } = I.value, i = w.value / r, a = S.value.top + w.value, o = [];
590
590
  for (let r = 0; r < t.length; r++) {
591
591
  let s = M(e, r);
592
592
  !isFinite(t[r]) || !isFinite(s) || o.push({
593
- x: I(s),
593
+ x: F(s),
594
594
  y: a - (t[r] - n) * i
595
595
  });
596
596
  }
597
597
  return o;
598
598
  }
599
- function ae(e) {
599
+ function oe(e) {
600
600
  let t = Math.min(e.upper.length, e.lower.length);
601
601
  if (t === 0) return "";
602
- let { min: n, range: r } = L.value, i = T.value / r, a = C.value.top + T.value, o = (e) => a - (e - n) * i, s = [], c = [];
602
+ let { min: n, range: r } = I.value, i = w.value / r, a = S.value.top + w.value, o = (e) => a - (e - n) * i, s = [], c = [];
603
603
  for (let n = 0; n < t; n++) isFinite(e.upper[n]) && isFinite(e.lower[n]) && isFinite(N(e, n)) ? c.push(n) : c.length && (s.push(c), c = []);
604
604
  c.length && s.push(c);
605
605
  let l = "";
606
606
  for (let t of s) {
607
- l += `M${I(N(e, t[0]))},${o(e.upper[t[0]])}`;
608
- for (let n = 1; n < t.length; n++) l += `L${I(N(e, t[n]))},${o(e.upper[t[n]])}`;
609
- for (let n = t.length - 1; n >= 0; n--) l += `L${I(N(e, t[n]))},${o(e.lower[t[n]])}`;
607
+ l += `M${F(N(e, t[0]))},${o(e.upper[t[0]])}`;
608
+ for (let n = 1; n < t.length; n++) l += `L${F(N(e, t[n]))},${o(e.upper[t[n]])}`;
609
+ for (let n = t.length - 1; n >= 0; n--) l += `L${F(N(e, t[n]))},${o(e.lower[t[n]])}`;
610
610
  l += "Z";
611
611
  }
612
612
  return l;
613
613
  }
614
- function z(e, t) {
614
+ function R(e, t) {
615
615
  let n = t === "start" ? e.startIndex : e.endIndex, r = e.seriesIndex != null && O.value[e.seriesIndex] || O.value[0];
616
- return I(r ? M(r, n) : n);
616
+ return F(r ? M(r, n) : n);
617
617
  }
618
- function B(e, t = !0) {
619
- let n = C.value.top + T.value;
618
+ function se(e, t = !0) {
619
+ let n = S.value.top + w.value;
620
620
  if (e.seriesIndex == null) {
621
- let t = z(e, "start"), r = z(e, "end");
622
- return t > r ? "" : `M${t},${C.value.top}L${r},${C.value.top}L${r},${n}L${t},${n}Z`;
621
+ let t = R(e, "start"), r = R(e, "end");
622
+ return t > r ? "" : `M${t},${S.value.top}L${r},${S.value.top}L${r},${n}L${t},${n}Z`;
623
623
  }
624
624
  let r = O.value[e.seriesIndex];
625
625
  if (!r) return "";
626
- let { min: i, range: a } = L.value, o = T.value / a, s = (e) => n - (e - i) * o, c = Math.max(0, e.startIndex), l = Math.min(r.data.length - 1, e.endIndex);
626
+ let { min: i, range: a } = I.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);
627
627
  if (c > l) return "";
628
- let u = `M${I(M(r, c))},${s(r.data[c])}`;
629
- for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${I(M(r, e))},${s(r.data[e])}`);
630
- return t && (u += `L${I(M(r, l))},${n}`, u += `L${I(M(r, c))},${n}`, u += "Z"), u;
628
+ let u = `M${F(M(r, c))},${s(r.data[c])}`;
629
+ for (let e = c + 1; e <= l; e++) isFinite(r.data[e]) && (u += `L${F(M(r, e))},${s(r.data[e])}`);
630
+ return t && (u += `L${F(M(r, l))},${n}`, u += `L${F(M(r, c))},${n}`, u += "Z"), u;
631
631
  }
632
- let H = t(() => {
633
- let e = d.areaSections;
632
+ let z = n(() => {
633
+ let e = l.areaSections;
634
634
  if (!e?.length) return {
635
635
  labels: [],
636
636
  extraHeight: 0
637
637
  };
638
- let t = [], n = C.value.left + w.value;
638
+ let t = [], n = S.value.left + C.value;
639
639
  for (let r of e) {
640
640
  if (!r.label && !r.description || r.legend === "inline" || r.legend === !1) continue;
641
- let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Je, o = z(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : O.value[r.seriesIndex]?.color ?? "currentColor");
641
+ let e = r.label ?? "", i = r.description ?? "", a = Math.max(e.length, i.length) * Ze, o = R(r, "start") + a / 2 + 2, s = n - a / 2 - 8, c = Math.min(o, s), l = r.color ?? (r.seriesIndex == null ? "#999" : O.value[r.seriesIndex]?.color ?? "currentColor");
642
642
  t.push({
643
643
  cx: c,
644
644
  labelText: e,
@@ -653,7 +653,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
653
653
  let r = [];
654
654
  for (let e of t) {
655
655
  let t = e.cx - e.textWidth / 2, n = 0;
656
- for (; n < r.length && !(t >= r[n] + Ye);) n++;
656
+ for (; n < r.length && !(t >= r[n] + Qe);) n++;
657
657
  e.row = n;
658
658
  let i = e.cx + e.textWidth / 2;
659
659
  r[n] = Math.max(r[n] ?? -Infinity, i);
@@ -663,9 +663,9 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
663
663
  extraHeight: 0
664
664
  } : {
665
665
  labels: t,
666
- extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Ke + qe
666
+ extraHeight: (Math.max(...t.map((e) => e.row)) + 1) * Ye + Xe
667
667
  };
668
- }), se = t(() => {
668
+ }), B = n(() => {
669
669
  let e = [];
670
670
  for (let t of O.value) t.legend && e.push({
671
671
  label: t.legend,
@@ -673,7 +673,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
673
673
  type: "series",
674
674
  dashed: t.dashed
675
675
  });
676
- let t = d.areaSections;
676
+ let t = l.areaSections;
677
677
  if (t) for (let n of t) {
678
678
  if (n.legend !== "inline" || !n.label && !n.description) continue;
679
679
  let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : O.value[n.seriesIndex]?.color ?? "currentColor");
@@ -685,41 +685,41 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
685
685
  });
686
686
  }
687
687
  return e;
688
- }), U = t(() => S.value + H.value.extraHeight), q = t(() => C.value.top + T.value + C.value.bottom + qe), J = t(() => {
689
- let { min: e, max: t } = L.value, n = (t) => V(C.value.top + T.value - (t - e) / L.value.range * T.value), r = (e) => d.yTickFormat ? d.yTickFormat(e) : W(e);
688
+ }), V = n(() => b.value + z.value.extraHeight), U = n(() => S.value.top + w.value + S.value.bottom + Xe), W = n(() => {
689
+ let { min: e, max: t } = I.value, n = (t) => H(S.value.top + w.value - (t - e) / I.value.range * w.value), r = (e) => l.yTickFormat ? l.yTickFormat(e) : G(e);
690
690
  return e === t ? [{
691
691
  value: r(e),
692
- y: V(C.value.top + T.value / 2)
693
- }] : ce({
692
+ y: H(S.value.top + w.value / 2)
693
+ }] : K({
694
694
  min: e,
695
695
  max: t,
696
- ticks: d.yTicks,
697
- targetTickCount: T.value / 50
696
+ ticks: l.yTicks,
697
+ targetTickCount: w.value / 50
698
698
  }).map((e) => ({
699
699
  value: r(e),
700
700
  y: n(e)
701
701
  }));
702
- }), le = t(() => {
703
- let { min: e, max: t } = F.value;
702
+ }), le = n(() => {
703
+ let { min: e, max: t } = ie.value;
704
704
  if (e === t) return [];
705
705
  let n = P.value, r = A.value, i = (e, t) => {
706
706
  let r = e + n;
707
- return d.xTickFormat ? d.xTickFormat(r, t) : !j.value && d.xLabels && Number.isInteger(e) && e >= 0 && e < d.xLabels.length ? d.xLabels[e] : W(r);
707
+ return l.xTickFormat ? l.xTickFormat(r, t) : !j.value && l.xLabels && Number.isInteger(e) && e >= 0 && e < l.xLabels.length ? l.xLabels[e] : G(r);
708
708
  }, a;
709
- if (d.xTicks == null && !j.value && d.xLabels && d.xLabels.length === r) {
710
- let e = Math.max(3, Math.floor(w.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
709
+ if (l.xTicks == null && !j.value && l.xLabels && l.xLabels.length === r) {
710
+ let e = Math.max(3, Math.floor(C.value / 80)), t = Math.max(1, Math.round((r - 1) / e));
711
711
  a = [];
712
712
  for (let e = 0; e < r; e += t) a.push(e);
713
- } else a = ce({
713
+ } else a = K({
714
714
  min: e,
715
715
  max: t,
716
- ticks: d.xTicks,
717
- targetTickCount: w.value / 80,
716
+ ticks: l.xTicks,
717
+ targetTickCount: C.value / 80,
718
718
  displayOffset: n
719
719
  });
720
- let o = C.value.left, s = C.value.left + w.value;
720
+ let o = S.value.left, s = S.value.left + C.value;
721
721
  return a.map((e, t) => {
722
- let n = V(I(e)), r = "middle";
722
+ let n = H(F(e)), r = "middle";
723
723
  return n - o <= 1 ? r = "start" : s - n <= 1 && (r = "end"), {
724
724
  value: i(e, t),
725
725
  x: n,
@@ -727,14 +727,14 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
727
727
  };
728
728
  });
729
729
  });
730
- function Y() {
731
- return typeof d.csv == "function" ? d.csv() : typeof d.csv == "string" ? d.csv : me(O.value);
730
+ function q() {
731
+ return typeof l.csv == "function" ? l.csv() : typeof l.csv == "string" ? l.csv : ge(O.value);
732
732
  }
733
- let de = t(() => !!d.tooltipData || !!d.tooltipTrigger), X = t(() => {
734
- let e = Qe.value, t = O.value[0];
733
+ let J = n(() => !!l.tooltipData || !!l.tooltipTrigger), Y = n(() => {
734
+ let e = Q.value, t = O.value[0];
735
735
  return e === null || !t ? null : M(t, e);
736
- }), fe = t(() => X.value === null ? 0 : I(X.value));
737
- function Z(e, t) {
736
+ }), pe = n(() => Y.value === null ? 0 : F(Y.value));
737
+ function X(e, t) {
738
738
  let n = e.data.length;
739
739
  if (n === 0) return null;
740
740
  let r = 0, i = Infinity;
@@ -746,265 +746,265 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
746
746
  }
747
747
  return i === Infinity ? null : r;
748
748
  }
749
- let Q = t(() => {
750
- let e = X.value;
749
+ let me = n(() => {
750
+ let e = Y.value;
751
751
  if (e === null) return [];
752
- let { min: t, range: n } = L.value, r = T.value / n, i = C.value.top + T.value, a = [];
752
+ let { min: t, range: n } = I.value, r = w.value / n, i = S.value.top + w.value, a = [];
753
753
  for (let n of O.value) {
754
- let o = Z(n, e);
754
+ let o = X(n, e);
755
755
  if (o === null) continue;
756
756
  let s = n.data[o];
757
757
  isFinite(s) && a.push({
758
- x: I(M(n, o)),
758
+ x: F(M(n, o)),
759
759
  y: i - (s - t) * r,
760
760
  color: n.color ?? "currentColor"
761
761
  });
762
762
  }
763
763
  return a;
764
- }), Xe = t(() => {
765
- let e = Qe.value, t = X.value;
764
+ }), Z = n(() => {
765
+ let e = Q.value, t = Y.value;
766
766
  if (e === null || t === null) return null;
767
767
  let n = t + P.value, r;
768
- return r = d.xTickFormat ? d.xTickFormat(n, e) : j.value ? W(n) : d.xLabels?.[e], {
768
+ return r = l.xTickFormat ? l.xTickFormat(n, e) : j.value ? G(n) : l.xLabels?.[e], {
769
769
  index: e,
770
770
  xLabel: r,
771
771
  values: O.value.map((e, n) => {
772
- let r = Z(e, t);
772
+ let r = X(e, t);
773
773
  return {
774
774
  value: r === null ? NaN : Number(e.data[r]),
775
775
  color: e.color ?? "currentColor",
776
776
  seriesIndex: n
777
777
  };
778
778
  }),
779
- data: d.tooltipData?.[e] ?? null
779
+ data: l.tooltipData?.[e] ?? null
780
780
  };
781
781
  });
782
- function Ze(e) {
783
- let t = m.value?.getBoundingClientRect();
782
+ function _e(e) {
783
+ let t = h.value?.getBoundingClientRect();
784
784
  if (!t) return null;
785
785
  let n = O.value[0];
786
786
  if (!n || n.data.length === 0) return null;
787
- let { min: r, max: i } = F.value, a = i - r || 1;
788
- return Z(n, r + (e - t.left - C.value.left) / w.value * a);
787
+ let { min: r, max: i } = ie.value, a = i - r || 1;
788
+ return X(n, r + (e - t.left - S.value.left) / C.value * a);
789
789
  }
790
- let { hoverIndex: Qe, tooltipRef: $e, tooltipPos: et, handlers: tt } = ue({
791
- enabled: () => de.value,
792
- trigger: () => d.tooltipTrigger,
793
- clamp: () => d.tooltipClamp,
794
- pointerToIndex: Ze,
795
- containerRef: m,
796
- onHover: (e) => ee("hover", e)
797
- }), { svgRef: nt, items: rt, downloadLinkText: it, csvHref: at, resolvedFilename: ot } = pe({
798
- filename: () => d.filename,
799
- legacyMenuLabel: () => d.menu,
800
- getCsv: Y,
801
- downloadLink: () => d.downloadLink
790
+ let { hoverIndex: Q, tooltipRef: $e, tooltipPos: et, handlers: tt } = fe({
791
+ enabled: () => J.value,
792
+ trigger: () => l.tooltipTrigger,
793
+ clamp: () => l.tooltipClamp,
794
+ pointerToIndex: _e,
795
+ containerRef: h,
796
+ onHover: (e) => f("hover", e)
797
+ }), { svgRef: nt, items: rt, downloadLinkText: it, csvHref: at, resolvedFilename: ot } = he({
798
+ filename: () => l.filename,
799
+ legacyMenuLabel: () => l.menu,
800
+ getCsv: q,
801
+ downloadLink: () => l.downloadLink
802
802
  });
803
- return (t, c) => (h(), i("div", {
803
+ return (n, c) => (g(), a("div", {
804
804
  ref_key: "containerRef",
805
- ref: m,
805
+ ref: h,
806
806
  class: "line-chart-wrapper"
807
807
  }, [
808
- s.menu ? (h(), n(oe, {
808
+ t.menu ? (g(), r(ce, {
809
809
  key: 0,
810
810
  items: x(rt)
811
- }, null, 8, ["items"])) : r("", !0),
812
- (h(), i("svg", {
811
+ }, null, 8, ["items"])) : i("", !0),
812
+ (g(), a("svg", {
813
813
  ref_key: "svgRef",
814
814
  ref: nt,
815
- width: b.value,
816
- height: U.value
815
+ width: _.value,
816
+ height: V.value
817
817
  }, [
818
- s.title ? (h(), i("text", {
818
+ t.title ? (g(), a("text", {
819
819
  key: 0,
820
- x: b.value / 2,
820
+ x: _.value / 2,
821
821
  y: 18,
822
822
  "text-anchor": "middle",
823
823
  "font-size": "14",
824
824
  "font-weight": "600",
825
825
  fill: "currentColor"
826
- }, y(s.title), 9, ge)) : r("", !0),
827
- se.value.length > 0 ? (h(), i("g", _e, [(h(!0), i(e, null, _(se.value, (t, n) => (h(), i(e, { key: "ileg" + n }, [t.type === "series" ? (h(), i("line", {
826
+ }, y(t.title), 9, ye)) : i("", !0),
827
+ 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", {
828
828
  key: 0,
829
- x1: x(C).left + n * 120,
830
- y1: x(C).top - x(20) / 2,
831
- x2: x(C).left + n * 120 + 12,
832
- y2: x(C).top - x(20) / 2,
829
+ x1: x(S).left + n * 120,
830
+ y1: x(S).top - x(20) / 2,
831
+ x2: x(S).left + n * 120 + 12,
832
+ y2: x(S).top - x(20) / 2,
833
833
  stroke: t.color,
834
834
  "stroke-width": "2",
835
835
  "stroke-dasharray": t.dashed ? "4 2" : void 0
836
- }, null, 8, ve)) : (h(), i("circle", {
836
+ }, null, 8, $)) : (g(), a("circle", {
837
837
  key: 1,
838
- cx: x(C).left + n * 120 + 4,
839
- cy: x(C).top - x(20) / 2,
838
+ cx: x(S).left + n * 120 + 4,
839
+ cy: x(S).top - x(20) / 2,
840
840
  r: "4",
841
841
  fill: t.color,
842
842
  "fill-opacity": t.fillOpacity,
843
843
  stroke: t.color,
844
844
  "stroke-width": "1.5"
845
- }, null, 8, ye)), a("text", {
846
- x: x(C).left + n * 120 + 18,
847
- y: x(C).top - x(20) / 2 + 4,
845
+ }, null, 8, xe)), o("text", {
846
+ x: x(S).left + n * 120 + 18,
847
+ y: x(S).top - x(20) / 2 + 4,
848
848
  "font-size": "11",
849
849
  fill: "currentColor"
850
- }, y(t.label), 9, be)], 64))), 128))])) : r("", !0),
851
- a("line", {
852
- x1: x(V)(x(C).left),
853
- y1: x(V)(x(C).top),
854
- x2: x(V)(x(C).left),
855
- y2: x(V)(x(C).top + x(T)),
850
+ }, y(t.label), 9, Se)], 64))), 128))])) : i("", !0),
851
+ o("line", {
852
+ x1: x(H)(x(S).left),
853
+ y1: x(H)(x(S).top),
854
+ x2: x(H)(x(S).left),
855
+ y2: x(H)(x(S).top + x(w)),
856
856
  stroke: "currentColor",
857
857
  "stroke-opacity": "0.3"
858
- }, null, 8, xe),
859
- a("line", {
860
- x1: x(V)(x(C).left),
861
- y1: x(V)(x(C).top + x(T)),
862
- x2: x(V)(x(C).left + x(w)),
863
- y2: x(V)(x(C).top + x(T)),
858
+ }, null, 8, Ce),
859
+ o("line", {
860
+ x1: x(H)(x(S).left),
861
+ y1: x(H)(x(S).top + x(w)),
862
+ x2: x(H)(x(S).left + x(C)),
863
+ y2: x(H)(x(S).top + x(w)),
864
864
  stroke: "currentColor",
865
865
  "stroke-opacity": "0.3"
866
- }, null, 8, $),
867
- s.yGrid ? (h(!0), i(e, { key: 2 }, _(J.value, (e, t) => (h(), i("line", {
866
+ }, null, 8, we),
867
+ t.yGrid ? (g(!0), a(e, { key: 2 }, v(W.value, (e, t) => (g(), a("line", {
868
868
  key: "yg" + t,
869
- x1: x(C).left,
869
+ x1: x(S).left,
870
870
  y1: e.y,
871
- x2: x(C).left + x(w),
871
+ x2: x(S).left + x(C),
872
872
  y2: e.y,
873
873
  stroke: "currentColor",
874
874
  "stroke-opacity": "0.1"
875
- }, null, 8, Se))), 128)) : r("", !0),
876
- s.xGrid ? (h(!0), i(e, { key: 3 }, _(le.value, (e, t) => (h(), i("line", {
875
+ }, null, 8, Te))), 128)) : i("", !0),
876
+ t.xGrid ? (g(!0), a(e, { key: 3 }, v(le.value, (e, t) => (g(), a("line", {
877
877
  key: "xg" + t,
878
878
  x1: e.x,
879
- y1: x(C).top,
879
+ y1: x(S).top,
880
880
  x2: e.x,
881
- y2: x(C).top + x(T),
881
+ y2: x(S).top + x(w),
882
882
  stroke: "currentColor",
883
883
  "stroke-opacity": "0.1"
884
- }, null, 8, Ce))), 128)) : r("", !0),
885
- (h(!0), i(e, null, _(J.value, (e, t) => (h(), i("text", {
884
+ }, null, 8, Ee))), 128)) : i("", !0),
885
+ (g(!0), a(e, null, v(W.value, (e, t) => (g(), a("text", {
886
886
  key: "y" + t,
887
887
  "data-testid": "y-tick",
888
- x: x(C).left - 6,
888
+ x: x(S).left - 6,
889
889
  y: e.y,
890
890
  "text-anchor": "end",
891
891
  "dominant-baseline": "middle",
892
892
  "font-size": "10",
893
893
  fill: "currentColor",
894
894
  "fill-opacity": "0.6"
895
- }, y(e.value), 9, we))), 128)),
896
- s.yLabel ? (h(), i("text", {
895
+ }, y(e.value), 9, De))), 128)),
896
+ t.yLabel ? (g(), a("text", {
897
897
  key: 4,
898
898
  x: 0,
899
899
  y: 0,
900
- transform: `translate(14, ${x(C).top + x(T) / 2}) rotate(-90)`,
900
+ transform: `translate(14, ${x(S).top + x(w) / 2}) rotate(-90)`,
901
901
  "text-anchor": "middle",
902
902
  "font-size": "13",
903
903
  fill: "currentColor"
904
- }, y(s.yLabel), 9, Te)) : r("", !0),
905
- (h(!0), i(e, null, _(le.value, (e, t) => (h(), i("text", {
904
+ }, y(t.yLabel), 9, Oe)) : i("", !0),
905
+ (g(!0), a(e, null, v(le.value, (e, t) => (g(), a("text", {
906
906
  key: "x" + t,
907
907
  "data-testid": "x-tick",
908
908
  x: e.x,
909
- y: x(C).top + x(T) + 16,
909
+ y: x(S).top + x(w) + 16,
910
910
  "text-anchor": e.anchor,
911
911
  "font-size": "10",
912
912
  fill: "currentColor",
913
913
  "fill-opacity": "0.6"
914
- }, y(e.value), 9, Ee))), 128)),
915
- s.xLabel ? (h(), i("text", {
914
+ }, y(e.value), 9, ke))), 128)),
915
+ t.xLabel ? (g(), a("text", {
916
916
  key: 5,
917
- x: x(C).left + x(w) / 2,
918
- y: S.value - 4,
917
+ x: x(S).left + x(C) / 2,
918
+ y: b.value - 4,
919
919
  "text-anchor": "middle",
920
920
  "font-size": "13",
921
921
  fill: "currentColor"
922
- }, y(s.xLabel), 9, De)) : r("", !0),
923
- (h(!0), i(e, null, _(k.value, (e, t) => (h(), i("path", {
922
+ }, y(t.xLabel), 9, Ae)) : i("", !0),
923
+ (g(!0), a(e, null, v(k.value, (e, t) => (g(), a("path", {
924
924
  key: "area" + t,
925
- d: ae(e),
925
+ d: oe(e),
926
926
  fill: e.color ?? "currentColor",
927
927
  "fill-opacity": e.opacity ?? .2,
928
928
  stroke: "none"
929
- }, null, 8, Oe))), 128)),
930
- (h(!0), i(e, null, _(O.value, (t, n) => (h(), i(e, { key: n }, [t.line === !1 ? r("", !0) : (h(), i("path", {
929
+ }, null, 8, je))), 128)),
930
+ (g(!0), a(e, null, v(O.value, (n, r) => (g(), a(e, { key: r }, [n.line === !1 ? i("", !0) : (g(), a("path", {
931
931
  key: 0,
932
- d: ie(t),
932
+ d: ae(n),
933
933
  fill: "none",
934
- stroke: t.color ?? "currentColor",
935
- "stroke-width": t.strokeWidth ?? 1.5,
936
- "stroke-opacity": t.lineOpacity ?? t.opacity ?? s.lineOpacity,
937
- "stroke-dasharray": t.dashed ? "6 3" : void 0
938
- }, null, 8, ke)), t.dots ? (h(!0), i(e, { key: 1 }, _(R(t), (e, n) => (h(), i("circle", {
939
- key: n,
934
+ stroke: n.color ?? "currentColor",
935
+ "stroke-width": n.strokeWidth ?? 1.5,
936
+ "stroke-opacity": n.lineOpacity ?? n.opacity ?? t.lineOpacity,
937
+ "stroke-dasharray": n.dashed ? "6 3" : void 0
938
+ }, null, 8, Me)), n.dots ? (g(!0), a(e, { key: 1 }, v(L(n), (e, r) => (g(), a("circle", {
939
+ key: r,
940
940
  cx: e.x,
941
941
  cy: e.y,
942
- r: t.dotRadius ?? (t.strokeWidth ?? 1.5) + 1,
943
- fill: t.dotFill ?? t.color ?? "currentColor",
944
- "fill-opacity": t.dotOpacity ?? t.opacity ?? s.lineOpacity,
945
- stroke: t.dotStroke ?? "none"
946
- }, null, 8, Ae))), 128)) : r("", !0)], 64))), 128)),
947
- (h(!0), i(e, null, _(s.areaSections ?? [], (t, n) => (h(), i(e, { key: "areasec" + n }, [
948
- a("path", {
949
- d: B(t),
942
+ r: n.dotRadius ?? (n.strokeWidth ?? 1.5) + 1,
943
+ fill: n.dotFill ?? n.color ?? "currentColor",
944
+ "fill-opacity": n.dotOpacity ?? n.opacity ?? t.lineOpacity,
945
+ stroke: n.dotStroke ?? "none"
946
+ }, null, 8, Ne))), 128)) : i("", !0)], 64))), 128)),
947
+ (g(!0), a(e, null, v(t.areaSections ?? [], (t, n) => (g(), a(e, { key: "areasec" + n }, [
948
+ o("path", {
949
+ d: se(t),
950
950
  fill: t.color ?? (t.seriesIndex == null ? "#999" : O.value[t.seriesIndex]?.color ?? "currentColor"),
951
951
  "fill-opacity": t.opacity ?? .15,
952
952
  stroke: "none"
953
- }, null, 8, je),
954
- t.seriesIndex == null ? r("", !0) : (h(), i("path", {
953
+ }, null, 8, Pe),
954
+ t.seriesIndex == null ? i("", !0) : (g(), a("path", {
955
955
  key: 0,
956
- d: B(t, !1),
956
+ d: se(t, !1),
957
957
  fill: "none",
958
958
  stroke: t.color ?? O.value[t.seriesIndex]?.color ?? "currentColor",
959
959
  "stroke-width": t.strokeWidth ?? 2,
960
960
  "stroke-dasharray": t.dashed ? "6 3" : void 0
961
- }, null, 8, Me)),
962
- t.seriesIndex == null ? (h(), i(e, { key: 1 }, [a("line", {
963
- x1: x(V)(z(t, "start")),
964
- y1: x(C).top,
965
- x2: x(V)(z(t, "start")),
966
- y2: x(C).top + x(T),
961
+ }, null, 8, Fe)),
962
+ t.seriesIndex == null ? (g(), a(e, { key: 1 }, [o("line", {
963
+ x1: x(H)(R(t, "start")),
964
+ y1: x(S).top,
965
+ x2: x(H)(R(t, "start")),
966
+ y2: x(S).top + x(w),
967
967
  stroke: t.color ?? "#999",
968
968
  "stroke-width": t.strokeWidth ?? 2,
969
969
  "stroke-dasharray": t.dashed ? "6 3" : void 0
970
- }, null, 8, Ne), a("line", {
971
- x1: x(V)(z(t, "end")),
972
- y1: x(C).top,
973
- x2: x(V)(z(t, "end")),
974
- y2: x(C).top + x(T),
970
+ }, null, 8, Ie), o("line", {
971
+ x1: x(H)(R(t, "end")),
972
+ y1: x(S).top,
973
+ x2: x(H)(R(t, "end")),
974
+ y2: x(S).top + x(w),
975
975
  stroke: t.color ?? "#999",
976
976
  "stroke-width": t.strokeWidth ?? 2,
977
977
  "stroke-dasharray": t.dashed ? "6 3" : void 0
978
- }, null, 8, Pe)], 64)) : r("", !0),
979
- a("line", {
980
- x1: x(V)(z(t, "start")),
981
- y1: x(C).top + x(T) - 4,
982
- x2: x(V)(z(t, "start")),
983
- y2: x(C).top + x(T) + 4,
978
+ }, null, 8, Le)], 64)) : i("", !0),
979
+ o("line", {
980
+ x1: x(H)(R(t, "start")),
981
+ y1: x(S).top + x(w) - 4,
982
+ x2: x(H)(R(t, "start")),
983
+ y2: x(S).top + x(w) + 4,
984
984
  stroke: "currentColor",
985
985
  "stroke-opacity": "0.4"
986
- }, null, 8, Fe),
987
- a("line", {
988
- x1: x(V)(z(t, "end")),
989
- y1: x(C).top + x(T) - 4,
990
- x2: x(V)(z(t, "end")),
991
- y2: x(C).top + x(T) + 4,
986
+ }, null, 8, Re),
987
+ o("line", {
988
+ x1: x(H)(R(t, "end")),
989
+ y1: x(S).top + x(w) - 4,
990
+ x2: x(H)(R(t, "end")),
991
+ y2: x(S).top + x(w) + 4,
992
992
  stroke: "currentColor",
993
993
  "stroke-opacity": "0.4"
994
- }, null, 8, Ie)
994
+ }, null, 8, ze)
995
995
  ], 64))), 128)),
996
- de.value && x(Qe) !== null ? (h(), i("line", {
996
+ J.value && x(Q) !== null ? (g(), a("line", {
997
997
  key: 6,
998
- x1: x(V)(fe.value),
999
- y1: x(C).top,
1000
- x2: x(V)(fe.value),
1001
- y2: x(C).top + x(T),
998
+ x1: x(H)(pe.value),
999
+ y1: x(S).top,
1000
+ x2: x(H)(pe.value),
1001
+ y2: x(S).top + x(w),
1002
1002
  stroke: "currentColor",
1003
1003
  "stroke-opacity": "0.3",
1004
1004
  "stroke-dasharray": "4 2",
1005
1005
  "pointer-events": "none"
1006
- }, null, 8, Le)) : r("", !0),
1007
- (h(!0), i(e, null, _(Q.value, (e, t) => (h(), i("circle", {
1006
+ }, null, 8, Be)) : i("", !0),
1007
+ (g(!0), a(e, null, v(me.value, (e, t) => (g(), a("circle", {
1008
1008
  key: "hd" + t,
1009
1009
  cx: e.x,
1010
1010
  cy: e.y,
@@ -1013,53 +1013,53 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
1013
1013
  stroke: "var(--color-bg-0, #fff)",
1014
1014
  "stroke-width": "2",
1015
1015
  "pointer-events": "none"
1016
- }, null, 8, Re))), 128)),
1017
- de.value ? (h(), i("rect", u({
1016
+ }, null, 8, Ve))), 128)),
1017
+ J.value ? (g(), a("rect", d({
1018
1018
  key: 7,
1019
- x: x(C).left,
1020
- y: x(C).top,
1021
- width: x(w),
1022
- height: x(T),
1019
+ x: x(S).left,
1020
+ y: x(S).top,
1021
+ width: x(C),
1022
+ height: x(w),
1023
1023
  fill: "transparent",
1024
1024
  style: {
1025
1025
  cursor: "crosshair",
1026
1026
  "touch-action": "none"
1027
1027
  }
1028
- }, te(x(tt), !0)), null, 16, ze)) : r("", !0),
1029
- (h(!0), i(e, null, _(H.value.labels, (e, t) => (h(), i("g", { key: "seclab" + t }, [
1030
- a("circle", {
1028
+ }, ne(x(tt), !0)), null, 16, He)) : i("", !0),
1029
+ (g(!0), a(e, null, v(z.value.labels, (e, t) => (g(), a("g", { key: "seclab" + t }, [
1030
+ o("circle", {
1031
1031
  cx: e.cx - e.textWidth / 2 - 2,
1032
- cy: q.value + e.row * Ke + 4,
1032
+ cy: U.value + e.row * Ye + 4,
1033
1033
  r: "4",
1034
1034
  fill: e.color,
1035
1035
  "fill-opacity": e.fillOpacity,
1036
1036
  stroke: e.color,
1037
1037
  "stroke-width": "1.5"
1038
- }, null, 8, Be),
1039
- e.labelText ? (h(), i("text", {
1038
+ }, null, 8, Ue),
1039
+ e.labelText ? (g(), a("text", {
1040
1040
  key: 0,
1041
1041
  x: e.cx - e.textWidth / 2 + 8,
1042
- y: q.value + e.row * Ke + 8,
1042
+ y: U.value + e.row * Ye + 8,
1043
1043
  "font-size": "11",
1044
1044
  "font-weight": "600",
1045
1045
  fill: e.color
1046
- }, y(e.labelText), 9, Ve)) : r("", !0),
1047
- e.descText ? (h(), i("text", {
1046
+ }, y(e.labelText), 9, We)) : i("", !0),
1047
+ e.descText ? (g(), a("text", {
1048
1048
  key: 1,
1049
1049
  x: e.cx - e.textWidth / 2 + 8,
1050
- y: q.value + e.row * Ke + 22,
1050
+ y: U.value + e.row * Ye + 22,
1051
1051
  "font-size": "11",
1052
1052
  fill: "currentColor",
1053
1053
  "fill-opacity": "0.6"
1054
- }, y(e.descText), 9, He)) : r("", !0)
1054
+ }, y(e.descText), 9, Ge)) : i("", !0)
1055
1055
  ]))), 128))
1056
- ], 8, he)),
1057
- de.value && x(Qe) !== null && Xe.value ? (h(), i("div", {
1056
+ ], 8, ve)),
1057
+ J.value && x(Q) !== null && Z.value ? (g(), a("div", {
1058
1058
  key: 1,
1059
1059
  ref_key: "tooltipRef",
1060
1060
  ref: $e,
1061
1061
  class: "chart-tooltip-content",
1062
- style: p({
1062
+ style: m({
1063
1063
  position: "absolute",
1064
1064
  top: "0",
1065
1065
  left: "0",
@@ -1067,50 +1067,50 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
1067
1067
  transform: x(et) ? `translate3d(${x(et).left}px, ${x(et).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1068
1068
  visibility: x(et) ? "visible" : "hidden"
1069
1069
  })
1070
- }, [v(t.$slots, "tooltip", f(l(Xe.value)), () => [a("div", Ue, [Xe.value.xLabel ? (h(), i("div", We, y(Xe.value.xLabel), 1)) : r("", !0), (h(!0), i(e, null, _(Xe.value.values, (e) => (h(), i("div", {
1070
+ }, [te(n.$slots, "tooltip", p(u(Z.value)), () => [o("div", Ke, [Z.value.xLabel ? (g(), a("div", qe, y(Z.value.xLabel), 1)) : i("", !0), (g(!0), a(e, null, v(Z.value.values, (e) => (g(), a("div", {
1071
1071
  key: e.seriesIndex,
1072
1072
  class: "line-chart-tooltip-row"
1073
- }, [a("span", {
1073
+ }, [o("span", {
1074
1074
  class: "line-chart-tooltip-swatch",
1075
- style: p({ background: e.color })
1076
- }, null, 4), o(" " + y(isFinite(e.value) ? D(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : r("", !0),
1077
- x(it) ? (h(), i("a", {
1075
+ style: m({ background: e.color })
1076
+ }, null, 4), s(" " + y(isFinite(e.value) ? D(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
1077
+ x(it) ? (g(), a("a", {
1078
1078
  key: 2,
1079
1079
  class: "line-chart-download-link",
1080
1080
  href: x(at),
1081
1081
  download: `${x(ot)()}.csv`
1082
- }, y(x(it)), 9, Ge)) : r("", !0)
1082
+ }, y(x(it)), 9, Je)) : i("", !0)
1083
1083
  ], 512));
1084
1084
  }
1085
- }), [["__scopeId", "data-v-083d1c2f"]]), Ze = ["width", "height"], Qe = ["x"], $e = { key: 1 }, et = [
1085
+ }), [["__scopeId", "data-v-083d1c2f"]]), et = ["width", "height"], tt = ["x"], nt = { key: 1 }, rt = [
1086
1086
  "x",
1087
1087
  "y",
1088
1088
  "fill"
1089
- ], tt = ["x", "y"], nt = [
1089
+ ], it = ["x", "y"], at = [
1090
1090
  "x1",
1091
1091
  "y1",
1092
1092
  "x2",
1093
1093
  "y2"
1094
- ], rt = [
1094
+ ], ot = [
1095
1095
  "x1",
1096
1096
  "y1",
1097
1097
  "x2",
1098
1098
  "y2"
1099
- ], it = [
1099
+ ], st = [
1100
1100
  "x1",
1101
1101
  "y1",
1102
1102
  "x2",
1103
1103
  "y2"
1104
- ], at = [
1104
+ ], ct = [
1105
1105
  "x",
1106
1106
  "y",
1107
1107
  "width",
1108
1108
  "height"
1109
- ], ot = ["x", "y"], st = ["x", "y"], ct = ["transform"], lt = [
1109
+ ], lt = ["x", "y"], ut = ["x", "y"], dt = ["transform"], ft = [
1110
1110
  "x",
1111
1111
  "y",
1112
1112
  "text-anchor"
1113
- ], ut = ["x", "y"], dt = ["x", "y"], ft = [
1113
+ ], pt = ["x", "y"], mt = ["x", "y"], ht = [
1114
1114
  "data-category",
1115
1115
  "data-series",
1116
1116
  "x",
@@ -1119,15 +1119,15 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
1119
1119
  "height",
1120
1120
  "fill",
1121
1121
  "fill-opacity"
1122
- ], pt = [
1122
+ ], gt = [
1123
1123
  "x",
1124
1124
  "y",
1125
1125
  "width",
1126
1126
  "height"
1127
- ], mt = { class: "bar-chart-tooltip" }, ht = {
1127
+ ], _t = { class: "bar-chart-tooltip" }, vt = {
1128
1128
  key: 0,
1129
1129
  class: "bar-chart-tooltip-label"
1130
- }, gt = ["href", "download"], _t = /* @__PURE__ */ B(/* @__PURE__ */ c({
1130
+ }, yt = ["href", "download"], bt = /* @__PURE__ */ V(/* @__PURE__ */ l({
1131
1131
  __name: "BarChart",
1132
1132
  props: {
1133
1133
  data: {},
@@ -1165,38 +1165,38 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
1165
1165
  downloadLink: { type: [Boolean, String] }
1166
1166
  },
1167
1167
  emits: ["hover"],
1168
- setup(s, { emit: c }) {
1169
- let d = s, ee = c, { containerRef: m, measuredWidth: g } = G({ debounce: () => d.debounce }), b = t(() => d.width ?? (g.value || 400)), S = t(() => d.height ?? 200), ne = t(() => D.value.some((e) => e.legend)), { padding: C, innerW: w, innerH: T } = K({
1170
- title: () => d.title,
1171
- xLabel: () => d.xLabel,
1172
- yLabel: () => d.yLabel,
1173
- hasInlineLegend: () => ne.value,
1174
- width: () => b.value,
1175
- height: () => S.value
1176
- }), re = [];
1168
+ setup(t, { emit: c }) {
1169
+ let l = t, f = c, { containerRef: h, measuredWidth: ee } = ue({ debounce: () => l.debounce }), _ = n(() => l.width ?? (ee.value || 400)), b = n(() => l.height ?? 200), re = n(() => D.value.some((e) => e.legend)), { padding: S, innerW: C, innerH: w } = de({
1170
+ title: () => l.title,
1171
+ xLabel: () => l.xLabel,
1172
+ yLabel: () => l.yLabel,
1173
+ hasInlineLegend: () => re.value,
1174
+ width: () => _.value,
1175
+ height: () => b.value
1176
+ }), T = [];
1177
1177
  function E(e) {
1178
1178
  return {
1179
- data: e.y ?? e.data ?? re,
1179
+ data: e.y ?? e.data ?? T,
1180
1180
  color: e.color,
1181
1181
  opacity: e.opacity,
1182
1182
  legend: e.legend
1183
1183
  };
1184
1184
  }
1185
- let D = t(() => {
1186
- if (d.series && d.series.length > 0) return d.series.map(E);
1187
- let e = d.y ?? d.data;
1185
+ let D = n(() => {
1186
+ if (l.series && l.series.length > 0) return l.series.map(E);
1187
+ let e = l.y ?? l.data;
1188
1188
  return e ? [{ data: e }] : [];
1189
- }), O = t(() => {
1190
- let e = d.categories?.length ?? 0;
1189
+ }), O = n(() => {
1190
+ let e = l.categories?.length ?? 0;
1191
1191
  for (let t of D.value) t.data.length > e && (e = t.data.length);
1192
1192
  return e;
1193
- }), k = t(() => {
1193
+ }), k = n(() => {
1194
1194
  let e = O.value, t = Array(e);
1195
- for (let n = 0; n < e; n++) t[n] = d.categories?.[n] ?? String(n);
1195
+ for (let n = 0; n < e; n++) t[n] = l.categories?.[n] ?? String(n);
1196
1196
  return t;
1197
- }), A = t(() => d.orientation === "vertical"), j = t(() => {
1197
+ }), A = n(() => l.orientation === "vertical"), j = n(() => {
1198
1198
  let e = Infinity, t = -Infinity;
1199
- if (d.layout === "stacked") {
1199
+ if (l.layout === "stacked") {
1200
1200
  let n = O.value;
1201
1201
  for (let r = 0; r < n; r++) {
1202
1202
  let n = 0, i = 0;
@@ -1212,7 +1212,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
1212
1212
  isFinite(n) && (n < e && (e = n), n > t && (t = n));
1213
1213
  }
1214
1214
  isFinite(e) || (e = 0), isFinite(t) || (t = 0);
1215
- let n = d.valueMin ?? 0;
1215
+ let n = l.valueMin ?? 0;
1216
1216
  n < e && (e = n);
1217
1217
  let r = t - e || 1;
1218
1218
  return {
@@ -1220,28 +1220,28 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
1220
1220
  max: t,
1221
1221
  range: r
1222
1222
  };
1223
- }), M = t(() => A.value ? w.value : T.value), N = t(() => A.value ? T.value : w.value), P = t(() => {
1223
+ }), M = n(() => A.value ? C.value : w.value), N = n(() => A.value ? w.value : C.value), P = n(() => {
1224
1224
  let e = O.value;
1225
1225
  return e > 0 ? M.value / e : 0;
1226
- }), F = t(() => P.value * (1 - d.barPadding)), I = t(() => {
1226
+ }), ie = n(() => P.value * (1 - l.barPadding)), F = n(() => {
1227
1227
  let e = D.value.length;
1228
1228
  if (e === 0) return 0;
1229
- if (d.layout === "stacked" || e === 1) return F.value;
1230
- let t = d.groupGap * (e - 1);
1231
- return Math.max(1, (F.value - t) / e);
1229
+ if (l.layout === "stacked" || e === 1) return ie.value;
1230
+ let t = l.groupGap * (e - 1);
1231
+ return Math.max(1, (ie.value - t) / e);
1232
1232
  });
1233
- function L(e) {
1234
- return (A.value ? C.value.left : C.value.top) + e * P.value;
1233
+ function I(e) {
1234
+ return (A.value ? S.value.left : S.value.top) + e * P.value;
1235
1235
  }
1236
- let ie = t(() => {
1237
- let { min: e, max: t } = j.value, n = d.valueMin ?? 0;
1238
- return R(Math.max(e, Math.min(t, n)));
1236
+ let ae = n(() => {
1237
+ let { min: e, max: t } = j.value, n = l.valueMin ?? 0;
1238
+ return L(Math.max(e, Math.min(t, n)));
1239
1239
  });
1240
- function R(e) {
1240
+ function L(e) {
1241
1241
  let { min: t, range: n } = j.value, r = N.value / n;
1242
- return A.value ? C.value.top + T.value - (e - t) * r : C.value.left + (e - t) * r;
1242
+ return A.value ? S.value.top + w.value - (e - t) * r : S.value.left + (e - t) * r;
1243
1243
  }
1244
- function ae(e, t, n, r, i, a, o, s, c) {
1244
+ function oe(e, t, n, r, i, a, o, s, c) {
1245
1245
  let l = Math.min(e, t), u = Math.abs(e - t);
1246
1246
  return A.value ? {
1247
1247
  x: n,
@@ -1265,29 +1265,29 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
1265
1265
  seriesIndex: c
1266
1266
  };
1267
1267
  }
1268
- let z = t(() => {
1268
+ let R = n(() => {
1269
1269
  let e = [], t = D.value, n = t.length;
1270
1270
  if (n === 0) return e;
1271
- let r = O.value, i = P.value, a = F.value, o = I.value, s = (i - a) / 2, c = ie.value;
1271
+ let r = O.value, i = P.value, a = ie.value, o = F.value, s = (i - a) / 2, c = ae.value;
1272
1272
  for (let i = 0; i < r; i++) {
1273
- let r = L(i) + s;
1274
- if (d.layout === "stacked") {
1273
+ let r = I(i) + s;
1274
+ if (l.layout === "stacked") {
1275
1275
  let o = 0, s = 0;
1276
1276
  for (let c = 0; c < n; c++) {
1277
1277
  let n = t[c], l = Number(n.data[i] ?? NaN);
1278
1278
  if (!isFinite(l)) continue;
1279
1279
  let u = l >= 0 ? o : s, d = u + l;
1280
- e.push(ae(R(u), R(d), r, a, n.color ?? H(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
1280
+ e.push(oe(L(u), L(d), r, a, n.color ?? z(c), n.opacity ?? 1, l, i, c)), l >= 0 ? o = d : s = d;
1281
1281
  }
1282
1282
  } else for (let a = 0; a < n; a++) {
1283
- let s = t[a], l = Number(s.data[i] ?? NaN);
1284
- if (!isFinite(l)) continue;
1285
- let u = r + (n === 1 ? 0 : a * (o + d.groupGap));
1286
- e.push(ae(c, R(l), u, o, s.color ?? H(a), s.opacity ?? 1, l, i, a));
1283
+ let s = t[a], u = Number(s.data[i] ?? NaN);
1284
+ if (!isFinite(u)) continue;
1285
+ let d = r + (n === 1 ? 0 : a * (o + l.groupGap));
1286
+ e.push(oe(c, L(u), d, o, s.color ?? z(a), s.opacity ?? 1, u, i, a));
1287
1287
  }
1288
1288
  }
1289
1289
  return e;
1290
- }), B = [
1290
+ }), se = [
1291
1291
  "var(--color-primary, #3b82f6)",
1292
1292
  "var(--color-accent, #f59e0b)",
1293
1293
  "var(--color-success, #10b981)",
@@ -1295,32 +1295,32 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
1295
1295
  "var(--color-info, #6366f1)",
1296
1296
  "var(--color-warning, #d97706)"
1297
1297
  ];
1298
- function H(e) {
1299
- return B[e % B.length];
1298
+ function z(e) {
1299
+ return se[e % se.length];
1300
1300
  }
1301
- function se(e) {
1302
- return d.tooltipValueFormat ? d.tooltipValueFormat(e) : d.valueTickFormat ? d.valueTickFormat(e) : W(e);
1301
+ function B(e) {
1302
+ return l.tooltipValueFormat ? l.tooltipValueFormat(e) : l.valueTickFormat ? l.valueTickFormat(e) : G(e);
1303
1303
  }
1304
- let U = t(() => {
1305
- let { min: e, max: t } = j.value, n = (e) => d.valueTickFormat ? d.valueTickFormat(e) : W(e);
1304
+ let V = n(() => {
1305
+ let { min: e, max: t } = j.value, n = (e) => l.valueTickFormat ? l.valueTickFormat(e) : G(e);
1306
1306
  if (e === t) return [{
1307
1307
  value: n(e),
1308
- pos: V(R(e))
1308
+ pos: H(L(e))
1309
1309
  }];
1310
1310
  let r = A.value ? 50 : 80;
1311
- return ce({
1311
+ return K({
1312
1312
  min: e,
1313
1313
  max: t,
1314
- ticks: d.valueTicks,
1314
+ ticks: l.valueTicks,
1315
1315
  targetTickCount: N.value / r
1316
1316
  }).map((e) => ({
1317
1317
  value: n(e),
1318
- pos: V(R(e))
1318
+ pos: H(L(e))
1319
1319
  }));
1320
- }), q = t(() => {
1321
- let e = [], t = O.value, n = (e, t) => d.categoryFormat ? d.categoryFormat(e, t) : e;
1320
+ }), U = n(() => {
1321
+ let e = [], t = O.value, n = (e, t) => l.categoryFormat ? l.categoryFormat(e, t) : e;
1322
1322
  for (let r = 0; r < t; r++) {
1323
- let t = L(r) + P.value / 2;
1323
+ let t = I(r) + P.value / 2;
1324
1324
  e.push({
1325
1325
  label: n(k.value[r], r),
1326
1326
  pos: t,
@@ -1328,205 +1328,205 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
1328
1328
  });
1329
1329
  }
1330
1330
  return e;
1331
- }), J = t(() => {
1331
+ }), W = n(() => {
1332
1332
  let e = [];
1333
1333
  return D.value.forEach((t, n) => {
1334
1334
  t.legend && e.push({
1335
1335
  label: t.legend,
1336
- color: t.color ?? H(n)
1336
+ color: t.color ?? z(n)
1337
1337
  });
1338
1338
  }), e;
1339
1339
  });
1340
1340
  function le() {
1341
- if (typeof d.csv == "function") return d.csv();
1342
- if (typeof d.csv == "string") return d.csv;
1341
+ if (typeof l.csv == "function") return l.csv();
1342
+ if (typeof l.csv == "string") return l.csv;
1343
1343
  let e = D.value.map((e) => ({
1344
1344
  label: e.legend,
1345
1345
  data: e.data
1346
1346
  }));
1347
- return Z(k.value, e);
1347
+ return _e(k.value, e);
1348
1348
  }
1349
- let Y = t(() => !!d.tooltipData || !!d.tooltipTrigger);
1350
- function de(e, t) {
1351
- let n = m.value?.getBoundingClientRect();
1349
+ let q = n(() => !!l.tooltipData || !!l.tooltipTrigger);
1350
+ function J(e, t) {
1351
+ let n = h.value?.getBoundingClientRect();
1352
1352
  if (!n) return null;
1353
1353
  let r = O.value;
1354
1354
  if (r === 0 || P.value === 0) return null;
1355
- let i = A.value ? e - n.left - C.value.left : t - n.top - C.value.top;
1355
+ let i = A.value ? e - n.left - S.value.left : t - n.top - S.value.top;
1356
1356
  return Math.max(0, Math.min(r - 1, Math.floor(i / P.value)));
1357
1357
  }
1358
- let { hoverIndex: X, tooltipRef: fe, tooltipPos: me, handlers: Q } = ue({
1359
- enabled: () => Y.value,
1360
- trigger: () => d.tooltipTrigger,
1361
- clamp: () => d.tooltipClamp,
1362
- pointerToIndex: de,
1363
- containerRef: m,
1364
- onHover: (e) => ee("hover", e)
1365
- }), { svgRef: he, items: ge, downloadLinkText: _e, csvHref: ve, resolvedFilename: ye } = pe({
1366
- filename: () => d.filename,
1367
- legacyMenuLabel: () => d.menu,
1358
+ let { hoverIndex: Y, tooltipRef: pe, tooltipPos: X, handlers: me } = fe({
1359
+ enabled: () => q.value,
1360
+ trigger: () => l.tooltipTrigger,
1361
+ clamp: () => l.tooltipClamp,
1362
+ pointerToIndex: J,
1363
+ containerRef: h,
1364
+ onHover: (e) => f("hover", e)
1365
+ }), { svgRef: Z, items: ge, downloadLinkText: Q, csvHref: ve, resolvedFilename: ye } = he({
1366
+ filename: () => l.filename,
1367
+ legacyMenuLabel: () => l.menu,
1368
1368
  getCsv: le,
1369
- downloadLink: () => d.downloadLink
1370
- }), be = t(() => {
1371
- let e = X.value;
1369
+ downloadLink: () => l.downloadLink
1370
+ }), be = n(() => {
1371
+ let e = Y.value;
1372
1372
  if (e !== null) return k.value[e];
1373
- }), xe = t(() => {
1374
- let e = X.value;
1373
+ }), $ = n(() => {
1374
+ let e = Y.value;
1375
1375
  return e === null ? null : {
1376
1376
  index: e,
1377
1377
  category: k.value[e] ?? String(e),
1378
1378
  values: D.value.map((t, n) => ({
1379
1379
  value: Number(t.data[e] ?? NaN),
1380
- color: t.color ?? H(n),
1380
+ color: t.color ?? z(n),
1381
1381
  seriesIndex: n
1382
1382
  })),
1383
- data: d.tooltipData?.[e] ?? null
1383
+ data: l.tooltipData?.[e] ?? null
1384
1384
  };
1385
- }), $ = t(() => {
1386
- let e = X.value;
1385
+ }), xe = n(() => {
1386
+ let e = Y.value;
1387
1387
  if (e === null) return null;
1388
- let t = L(e);
1388
+ let t = I(e);
1389
1389
  return A.value ? {
1390
1390
  x: t,
1391
- y: C.value.top,
1391
+ y: S.value.top,
1392
1392
  w: P.value,
1393
- h: T.value
1393
+ h: w.value
1394
1394
  } : {
1395
- x: C.value.left,
1395
+ x: S.value.left,
1396
1396
  y: t,
1397
- w: w.value,
1397
+ w: C.value,
1398
1398
  h: P.value
1399
1399
  };
1400
1400
  });
1401
- return (t, c) => (h(), i("div", {
1401
+ return (n, c) => (g(), a("div", {
1402
1402
  ref_key: "containerRef",
1403
- ref: m,
1403
+ ref: h,
1404
1404
  class: "bar-chart-wrapper"
1405
1405
  }, [
1406
- s.menu ? (h(), n(oe, {
1406
+ t.menu ? (g(), r(ce, {
1407
1407
  key: 0,
1408
1408
  items: x(ge)
1409
- }, null, 8, ["items"])) : r("", !0),
1410
- (h(), i("svg", {
1409
+ }, null, 8, ["items"])) : i("", !0),
1410
+ (g(), a("svg", {
1411
1411
  ref_key: "svgRef",
1412
- ref: he,
1413
- width: b.value,
1414
- height: S.value
1412
+ ref: Z,
1413
+ width: _.value,
1414
+ height: b.value
1415
1415
  }, [
1416
- s.title ? (h(), i("text", {
1416
+ t.title ? (g(), a("text", {
1417
1417
  key: 0,
1418
- x: b.value / 2,
1418
+ x: _.value / 2,
1419
1419
  y: 18,
1420
1420
  "text-anchor": "middle",
1421
1421
  "font-size": "14",
1422
1422
  "font-weight": "600",
1423
1423
  fill: "currentColor"
1424
- }, y(s.title), 9, Qe)) : r("", !0),
1425
- J.value.length > 0 ? (h(), i("g", $e, [(h(!0), i(e, null, _(J.value, (t, n) => (h(), i(e, { key: "ileg" + n }, [a("rect", {
1426
- x: x(C).left + n * 120,
1427
- y: x(C).top - x(20) / 2 - 5,
1424
+ }, y(t.title), 9, tt)) : i("", !0),
1425
+ 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", {
1426
+ x: x(S).left + n * 120,
1427
+ y: x(S).top - x(20) / 2 - 5,
1428
1428
  width: "12",
1429
1429
  height: "10",
1430
1430
  fill: t.color
1431
- }, null, 8, et), a("text", {
1432
- x: x(C).left + n * 120 + 18,
1433
- y: x(C).top - x(20) / 2 + 4,
1431
+ }, null, 8, rt), o("text", {
1432
+ x: x(S).left + n * 120 + 18,
1433
+ y: x(S).top - x(20) / 2 + 4,
1434
1434
  "font-size": "11",
1435
1435
  fill: "currentColor"
1436
- }, y(t.label), 9, tt)], 64))), 128))])) : r("", !0),
1437
- a("line", {
1438
- x1: x(V)(x(C).left),
1439
- y1: x(V)(x(C).top),
1440
- x2: x(V)(x(C).left),
1441
- y2: x(V)(x(C).top + x(T)),
1436
+ }, y(t.label), 9, it)], 64))), 128))])) : i("", !0),
1437
+ o("line", {
1438
+ x1: x(H)(x(S).left),
1439
+ y1: x(H)(x(S).top),
1440
+ x2: x(H)(x(S).left),
1441
+ y2: x(H)(x(S).top + x(w)),
1442
1442
  stroke: "currentColor",
1443
1443
  "stroke-opacity": "0.3"
1444
- }, null, 8, nt),
1445
- a("line", {
1446
- x1: x(V)(x(C).left),
1447
- y1: x(V)(x(C).top + x(T)),
1448
- x2: x(V)(x(C).left + x(w)),
1449
- y2: x(V)(x(C).top + x(T)),
1444
+ }, null, 8, at),
1445
+ o("line", {
1446
+ x1: x(H)(x(S).left),
1447
+ y1: x(H)(x(S).top + x(w)),
1448
+ x2: x(H)(x(S).left + x(C)),
1449
+ y2: x(H)(x(S).top + x(w)),
1450
1450
  stroke: "currentColor",
1451
1451
  "stroke-opacity": "0.3"
1452
- }, null, 8, rt),
1453
- s.valueGrid ? (h(!0), i(e, { key: 2 }, _(U.value, (e, t) => (h(), i("line", {
1452
+ }, null, 8, ot),
1453
+ t.valueGrid ? (g(!0), a(e, { key: 2 }, v(V.value, (e, t) => (g(), a("line", {
1454
1454
  key: "vg" + t,
1455
- x1: A.value ? x(C).left : e.pos,
1456
- y1: A.value ? e.pos : x(C).top,
1457
- x2: A.value ? x(C).left + x(w) : e.pos,
1458
- y2: A.value ? e.pos : x(C).top + x(T),
1455
+ x1: A.value ? x(S).left : e.pos,
1456
+ y1: A.value ? e.pos : x(S).top,
1457
+ x2: A.value ? x(S).left + x(C) : e.pos,
1458
+ y2: A.value ? e.pos : x(S).top + x(w),
1459
1459
  stroke: "currentColor",
1460
1460
  "stroke-opacity": "0.1"
1461
- }, null, 8, it))), 128)) : r("", !0),
1462
- $.value && Y.value ? (h(), i("rect", {
1461
+ }, null, 8, st))), 128)) : i("", !0),
1462
+ xe.value && q.value ? (g(), a("rect", {
1463
1463
  key: 3,
1464
- x: $.value.x,
1465
- y: $.value.y,
1466
- width: $.value.w,
1467
- height: $.value.h,
1464
+ x: xe.value.x,
1465
+ y: xe.value.y,
1466
+ width: xe.value.w,
1467
+ height: xe.value.h,
1468
1468
  fill: "currentColor",
1469
1469
  "fill-opacity": "0.06",
1470
1470
  "pointer-events": "none"
1471
- }, null, 8, at)) : r("", !0),
1472
- A.value ? (h(!0), i(e, { key: 4 }, _(U.value, (e, t) => (h(), i("text", {
1471
+ }, null, 8, ct)) : i("", !0),
1472
+ A.value ? (g(!0), a(e, { key: 4 }, v(V.value, (e, t) => (g(), a("text", {
1473
1473
  key: "vt" + t,
1474
1474
  "data-testid": "value-tick",
1475
- x: x(C).left - 6,
1475
+ x: x(S).left - 6,
1476
1476
  y: e.pos,
1477
1477
  "text-anchor": "end",
1478
1478
  "dominant-baseline": "middle",
1479
1479
  "font-size": "10",
1480
1480
  fill: "currentColor",
1481
1481
  "fill-opacity": "0.6"
1482
- }, y(e.value), 9, ot))), 128)) : (h(!0), i(e, { key: 5 }, _(U.value, (e, t) => (h(), i("text", {
1482
+ }, y(e.value), 9, lt))), 128)) : (g(!0), a(e, { key: 5 }, v(V.value, (e, t) => (g(), a("text", {
1483
1483
  key: "vt" + t,
1484
1484
  "data-testid": "value-tick",
1485
1485
  x: e.pos,
1486
- y: x(C).top + x(T) + 16,
1486
+ y: x(S).top + x(w) + 16,
1487
1487
  "text-anchor": "middle",
1488
1488
  "font-size": "10",
1489
1489
  fill: "currentColor",
1490
1490
  "fill-opacity": "0.6"
1491
- }, y(e.value), 9, st))), 128)),
1492
- s.yLabel ? (h(), i("text", {
1491
+ }, y(e.value), 9, ut))), 128)),
1492
+ t.yLabel ? (g(), a("text", {
1493
1493
  key: 6,
1494
1494
  x: 0,
1495
1495
  y: 0,
1496
- transform: `translate(14, ${x(C).top + x(T) / 2}) rotate(-90)`,
1496
+ transform: `translate(14, ${x(S).top + x(w) / 2}) rotate(-90)`,
1497
1497
  "text-anchor": "middle",
1498
1498
  "font-size": "13",
1499
1499
  fill: "currentColor"
1500
- }, y(s.yLabel), 9, ct)) : r("", !0),
1501
- A.value ? (h(!0), i(e, { key: 7 }, _(q.value, (e, t) => (h(), i("text", {
1500
+ }, y(t.yLabel), 9, dt)) : i("", !0),
1501
+ A.value ? (g(!0), a(e, { key: 7 }, v(U.value, (e, t) => (g(), a("text", {
1502
1502
  key: "ct" + t,
1503
1503
  "data-testid": "category-tick",
1504
1504
  x: e.pos,
1505
- y: x(C).top + x(T) + 16,
1505
+ y: x(S).top + x(w) + 16,
1506
1506
  "text-anchor": e.anchor,
1507
1507
  "font-size": "10",
1508
1508
  fill: "currentColor",
1509
1509
  "fill-opacity": "0.6"
1510
- }, y(e.label), 9, lt))), 128)) : (h(!0), i(e, { key: 8 }, _(q.value, (e, t) => (h(), i("text", {
1510
+ }, y(e.label), 9, ft))), 128)) : (g(!0), a(e, { key: 8 }, v(U.value, (e, t) => (g(), a("text", {
1511
1511
  key: "ct" + t,
1512
1512
  "data-testid": "category-tick",
1513
- x: x(C).left - 6,
1513
+ x: x(S).left - 6,
1514
1514
  y: e.pos,
1515
1515
  "text-anchor": "end",
1516
1516
  "dominant-baseline": "middle",
1517
1517
  "font-size": "10",
1518
1518
  fill: "currentColor",
1519
1519
  "fill-opacity": "0.6"
1520
- }, y(e.label), 9, ut))), 128)),
1521
- s.xLabel ? (h(), i("text", {
1520
+ }, y(e.label), 9, pt))), 128)),
1521
+ t.xLabel ? (g(), a("text", {
1522
1522
  key: 9,
1523
- x: x(C).left + x(w) / 2,
1524
- y: S.value - 4,
1523
+ x: x(S).left + x(C) / 2,
1524
+ y: b.value - 4,
1525
1525
  "text-anchor": "middle",
1526
1526
  "font-size": "13",
1527
1527
  fill: "currentColor"
1528
- }, y(s.xLabel), 9, dt)) : r("", !0),
1529
- (h(!0), i(e, null, _(z.value, (e, t) => (h(), i("rect", {
1528
+ }, y(t.xLabel), 9, mt)) : i("", !0),
1529
+ (g(!0), a(e, null, v(R.value, (e, t) => (g(), a("rect", {
1530
1530
  key: "bar" + t,
1531
1531
  "data-testid": "bar",
1532
1532
  "data-category": e.categoryIndex,
@@ -1537,49 +1537,49 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
1537
1537
  height: e.h,
1538
1538
  fill: e.color,
1539
1539
  "fill-opacity": e.opacity
1540
- }, null, 8, ft))), 128)),
1541
- Y.value ? (h(), i("rect", u({
1540
+ }, null, 8, ht))), 128)),
1541
+ q.value ? (g(), a("rect", d({
1542
1542
  key: 10,
1543
- x: x(C).left,
1544
- y: x(C).top,
1545
- width: x(w),
1546
- height: x(T),
1543
+ x: x(S).left,
1544
+ y: x(S).top,
1545
+ width: x(C),
1546
+ height: x(w),
1547
1547
  fill: "transparent",
1548
1548
  style: {
1549
1549
  cursor: "crosshair",
1550
1550
  "touch-action": "none"
1551
1551
  }
1552
- }, te(x(Q), !0)), null, 16, pt)) : r("", !0)
1553
- ], 8, Ze)),
1554
- Y.value && x(X) !== null && xe.value ? (h(), i("div", {
1552
+ }, ne(x(me), !0)), null, 16, gt)) : i("", !0)
1553
+ ], 8, et)),
1554
+ q.value && x(Y) !== null && $.value ? (g(), a("div", {
1555
1555
  key: 1,
1556
1556
  ref_key: "tooltipRef",
1557
- ref: fe,
1557
+ ref: pe,
1558
1558
  class: "chart-tooltip-content",
1559
- style: p({
1559
+ style: m({
1560
1560
  position: "absolute",
1561
1561
  top: "0",
1562
1562
  left: "0",
1563
1563
  willChange: "transform",
1564
- transform: x(me) ? `translate3d(${x(me).left}px, ${x(me).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1565
- visibility: x(me) ? "visible" : "hidden"
1564
+ transform: x(X) ? `translate3d(${x(X).left}px, ${x(X).top}px, 0) translateY(-50%)` : "translateY(-50%)",
1565
+ visibility: x(X) ? "visible" : "hidden"
1566
1566
  })
1567
- }, [v(t.$slots, "tooltip", f(l(xe.value)), () => [a("div", mt, [be.value ? (h(), i("div", ht, y(be.value), 1)) : r("", !0), (h(!0), i(e, null, _(xe.value.values, (e) => (h(), i("div", {
1567
+ }, [te(n.$slots, "tooltip", p(u($.value)), () => [o("div", _t, [be.value ? (g(), a("div", vt, y(be.value), 1)) : i("", !0), (g(!0), a(e, null, v($.value.values, (e) => (g(), a("div", {
1568
1568
  key: e.seriesIndex,
1569
1569
  class: "bar-chart-tooltip-row"
1570
- }, [a("span", {
1570
+ }, [o("span", {
1571
1571
  class: "bar-chart-tooltip-swatch",
1572
- style: p({ background: e.color })
1573
- }, null, 4), o(" " + y(isFinite(e.value) ? se(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : r("", !0),
1574
- x(_e) ? (h(), i("a", {
1572
+ style: m({ background: e.color })
1573
+ }, null, 4), s(" " + y(isFinite(e.value) ? B(e.value) : "—"), 1)]))), 128))])], !0)], 4)) : i("", !0),
1574
+ x(Q) ? (g(), a("a", {
1575
1575
  key: 2,
1576
1576
  class: "bar-chart-download-link",
1577
1577
  href: x(ve),
1578
1578
  download: `${x(ye)()}.csv`
1579
- }, y(x(_e)), 9, gt)) : r("", !0)
1579
+ }, y(x(Q)), 9, yt)) : i("", !0)
1580
1580
  ], 512));
1581
1581
  }
1582
- }), [["__scopeId", "data-v-4f604d9f"]]), vt = {
1582
+ }), [["__scopeId", "data-v-4f604d9f"]]), xt = {
1583
1583
  "01013": "010259",
1584
1584
  "01015": "010177",
1585
1585
  "01029": "010177",
@@ -4740,7 +4740,7 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
4740
4740
  51019: "510014",
4741
4741
  "02158": "020820",
4742
4742
  46102: "460957"
4743
- }, yt = {
4743
+ }, St = {
4744
4744
  "010259": "Butler, AL",
4745
4745
  "010177": "Calhoun (Anniston), AL - Cleburne, AL",
4746
4746
  "010172": "Chambers, AL - Randolph, AL",
@@ -5690,25 +5690,47 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
5690
5690
  560775: "Teton, WY - Lincoln, WY",
5691
5691
  560792: "Uinta, WY",
5692
5692
  560804: "Weston, WY"
5693
- }, bt = ["width", "height"], xt = [
5694
- "data-feat-id",
5695
- "d",
5696
- "fill",
5697
- "stroke",
5698
- "stroke-width"
5699
- ], St = { key: 0 }, Ct = ["d", "stroke"], wt = ["transform"], Tt = {
5693
+ }, Ct = {
5694
+ ref: "root",
5695
+ class: "chart-tooltip-content",
5696
+ style: {
5697
+ position: "fixed",
5698
+ left: "0",
5699
+ top: "0",
5700
+ visibility: "hidden",
5701
+ "will-change": "transform",
5702
+ "pointer-events": "none",
5703
+ transform: "translateY(-50%)"
5704
+ }
5705
+ }, wt = /* @__PURE__ */ l({
5706
+ __name: "ChoroplethTooltip",
5707
+ setup(e, { expose: n }) {
5708
+ let a = _(null), s = S("root");
5709
+ return n({
5710
+ setData(e) {
5711
+ a.value = e;
5712
+ },
5713
+ getEl() {
5714
+ return s.value;
5715
+ }
5716
+ }), (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)]));
5717
+ }
5718
+ }), Tt = {
5719
+ key: 1,
5720
+ class: "choropleth-header"
5721
+ }, Et = {
5700
5722
  key: 0,
5701
- y: 5,
5702
- "font-size": "13",
5703
- "font-weight": "600",
5704
- fill: "currentColor"
5705
- }, Et = ["x", "fill"], Dt = ["x"], Ot = {
5723
+ class: "choropleth-title"
5724
+ }, Dt = {
5725
+ key: 1,
5726
+ class: "choropleth-legend"
5727
+ }, Ot = {
5706
5728
  key: 0,
5707
- y: 5,
5708
- "font-size": "13",
5709
- "font-weight": "600",
5710
- fill: "currentColor"
5711
- }, kt = ["offset", "stop-color"], At = ["x", "fill"], jt = ["x"], Mt = ["x"], Nt = /* @__PURE__ */ B(/* @__PURE__ */ c({
5729
+ class: "choropleth-legend-title"
5730
+ }, kt = {
5731
+ key: 2,
5732
+ class: "choropleth-legend-continuous"
5733
+ }, At = { class: "choropleth-legend-ticks" }, jt = ["viewBox"], Mt = ["innerHTML"], Nt = "http://www.w3.org/2000/svg", Pt = 1e3, Ft = /* @__PURE__ */ V(/* @__PURE__ */ l({
5712
5734
  __name: "ChoroplethMap",
5713
5735
  props: {
5714
5736
  topology: {},
@@ -5744,87 +5766,103 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
5744
5766
  tooltipClamp: { default: "chart" }
5745
5767
  },
5746
5768
  emits: ["stateClick", "stateHover"],
5747
- setup(o, { emit: s }) {
5748
- let c = o, l = s, u = `choropleth-gradient-${S()}`, f = g(null), p = g(null), v = g(null), te = g(0), x = null, C = null, w = !1, T = typeof window < "u" && "ontouchstart" in window, re = null, E = null;
5749
- function D() {
5750
- if (T) return;
5751
- let e = v.value;
5752
- e && (e.addEventListener("click", $), e.addEventListener("mouseover", $), e.addEventListener("mousemove", Se), e.addEventListener("mouseout", Ce));
5769
+ setup(t, { emit: c }) {
5770
+ let l = t, d = c, ne = (e) => e, x = _(null), S = _(null), T = _(null), E = _(null), D = re(), O = n(() => !!l.tooltipTrigger || !!l.tooltipFormat || !!D.tooltip), k = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), j = null, M = null, N = !1, se = typeof window < "u" && "ontouchstart" in window, z = null, B = {
5771
+ width: 0,
5772
+ height: 0
5773
+ }, V = null, H = !1, U = null, W = _(!1), le = 0, G = 0, K = 0;
5774
+ function ue() {
5775
+ if (se) return;
5776
+ let e = T.value;
5777
+ e && (e.addEventListener("click", We), e.addEventListener("mouseover", We), e.addEventListener("mousemove", Ge), e.addEventListener("mouseout", Ke));
5778
+ }
5779
+ function de() {
5780
+ let e = T.value;
5781
+ e && (e.removeEventListener("click", We), e.removeEventListener("mouseover", We), e.removeEventListener("mousemove", Ge), e.removeEventListener("mouseout", Ke));
5753
5782
  }
5754
- function O() {
5755
- let e = v.value;
5756
- e && (e.removeEventListener("click", $), e.removeEventListener("mouseover", $), e.removeEventListener("mousemove", Se), e.removeEventListener("mouseout", Ce));
5783
+ function q() {
5784
+ He();
5757
5785
  }
5758
- ee(() => {
5759
- f.value && (te.value = f.value.clientWidth, re = new ResizeObserver((e) => {
5760
- let t = e[0];
5761
- t && (te.value = t.contentRect.width);
5762
- }), re.observe(f.value)), k(), D();
5763
- }), m(() => {
5764
- re?.disconnect(), A(), O(), ye();
5786
+ h(() => {
5787
+ J(), ue(), Je(), Ie(), window.addEventListener("scroll", q, {
5788
+ passive: !0,
5789
+ capture: !0
5790
+ }), window.addEventListener("resize", q, { passive: !0 });
5791
+ }), ee(() => {
5792
+ z?.disconnect(), K && cancelAnimationFrame(K), fe(), de(), window.removeEventListener("scroll", q, { capture: !0 }), window.removeEventListener("resize", q);
5765
5793
  });
5766
- function k() {
5767
- if (!p.value || !v.value || !c.zoom && !c.pan) return;
5768
- let e = F(p.value);
5769
- E = P().scaleExtent(c.zoom ? [1, 12] : [1, 1]).on("start", () => {
5770
- w = !0, xe();
5794
+ function J() {
5795
+ if (!S.value || !T.value || !l.zoom && !l.pan) return;
5796
+ let e = ae(S.value);
5797
+ U = F().scaleExtent(l.zoom ? [1, 12] : [1, 1]).on("start", () => {
5798
+ N = !0, He();
5771
5799
  }).on("zoom", (e) => {
5772
- v.value && v.value.setAttribute("transform", e.transform);
5800
+ T.value && T.value.setAttribute("transform", e.transform);
5801
+ let t = e.transform;
5802
+ W.value = t.k !== 1 || t.x !== 0 || t.y !== 0;
5773
5803
  }).on("end", () => {
5774
- w = !1;
5775
- }), c.pan || E.filter((e) => e.type === "wheel" || e.type === "dblclick"), e.call(E);
5804
+ N = !1;
5805
+ }), l.pan || U.filter((e) => e.type === "wheel" || e.type === "dblclick"), e.call(U);
5776
5806
  }
5777
- function A() {
5778
- p.value && E && (F(p.value).on(".zoom", null), E = null);
5807
+ function fe() {
5808
+ S.value && U && (ae(S.value).on(".zoom", null), U = null);
5779
5809
  }
5780
- ne(() => [c.zoom, c.pan], () => {
5781
- A(), O(), k(), D();
5810
+ function pe() {
5811
+ !S.value || !U || U.transform(ae(S.value), I);
5812
+ }
5813
+ C(() => [l.zoom, l.pan], () => {
5814
+ fe(), de(), J(), ue();
5782
5815
  });
5783
- let j = t(() => c.width ?? (te.value || 600)), R = t(() => c.width && c.height ? c.height / c.width : .625), ae = t(() => j.value * R.value), z = t(() => {
5784
- let e = b(c.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
5816
+ let Z = n(() => l.width && l.height ? l.height / l.width : .625), he = n(() => Pt), ge = n(() => Pt * Z.value), _e = n(() => {
5817
+ let e = b(l.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
5785
5818
  for (let e of t) {
5786
- let t = vt[String(e.id).padStart(5, "0")];
5819
+ let t = xt[String(e.id).padStart(5, "0")];
5787
5820
  t && (n.has(t) || n.set(t, []), n.get(t).push(e));
5788
5821
  }
5789
5822
  let r = [];
5790
5823
  for (let [t, i] of n) r.push({
5791
5824
  type: "Feature",
5792
5825
  id: t,
5793
- properties: { name: yt[t] ?? t },
5794
- geometry: L(e, i)
5826
+ properties: { name: St[t] ?? t },
5827
+ geometry: oe(e, i)
5795
5828
  });
5796
5829
  return {
5797
5830
  type: "FeatureCollection",
5798
5831
  features: r
5799
5832
  };
5800
- }), B = t(() => {
5801
- if (c.geoType === "hsas") return z.value;
5802
- if (c.geoType === "counties") {
5803
- let e = b(c.topology);
5804
- return I(e, e.objects.counties);
5833
+ }), Q = n(() => {
5834
+ if (l.geoType === "hsas") return _e.value;
5835
+ if (l.geoType === "counties") {
5836
+ let e = b(l.topology);
5837
+ return L(e, e.objects.counties);
5805
5838
  }
5806
- let e = b(c.topology);
5807
- return I(e, e.objects.states);
5808
- }), V = t(() => {
5809
- if (c.geoType !== "counties" && c.geoType !== "hsas") return null;
5810
- let e = b(c.topology);
5811
- return ie(e, e.objects.states, (e, t) => e !== t);
5812
- }), H = t(() => M().fitExtent([[0, ke.value], [j.value, ae.value + ke.value]], B.value)), se = t(() => N(H.value)), U = t(() => c.geoType === "counties" || c.geoType === "hsas" ? c.strokeWidth * .5 : c.strokeWidth), W = t(() => {
5839
+ let e = b(l.topology);
5840
+ return L(e, e.objects.states);
5841
+ }), ve = n(() => {
5842
+ if (l.geoType !== "counties" && l.geoType !== "hsas") return null;
5843
+ let e = b(l.topology);
5844
+ return R(e, e.objects.states, (e, t) => e !== t);
5845
+ }), ye = n(() => P().fitExtent([[0, 0], [he.value, ge.value]], Q.value)), be = n(() => ie(ye.value)), $ = n(() => l.geoType === "counties" || l.geoType === "hsas" ? l.strokeWidth * .5 : l.strokeWidth), xe = n(() => {
5846
+ let e = /* @__PURE__ */ new Map();
5847
+ for (let t of Q.value.features) t.properties?.name != null && t.id != null && e.set(t.properties.name, String(t.id));
5848
+ return e;
5849
+ }), Se = n(() => {
5813
5850
  let e = /* @__PURE__ */ new Map();
5814
- if (!c.data) return e;
5815
- for (let t of c.data) {
5816
- e.set(t.id, t.value);
5817
- let n = B.value.features.find((e) => e.properties?.name === t.id);
5818
- n?.id != null && e.set(String(n.id), t.value);
5851
+ if (!l.data) return e;
5852
+ let t = xe.value;
5853
+ for (let n of l.data) {
5854
+ e.set(n.id, n.value);
5855
+ let r = t.get(n.id);
5856
+ r && e.set(r, n.value);
5819
5857
  }
5820
5858
  return e;
5821
- }), ce = t(() => {
5822
- if (!c.data || c.data.length === 0) return {
5859
+ }), Ce = n(() => {
5860
+ if (!l.data || l.data.length === 0) return {
5823
5861
  min: 0,
5824
5862
  max: 1
5825
5863
  };
5826
5864
  let e = Infinity, t = -Infinity;
5827
- for (let n of c.data) typeof n.value == "number" && (n.value < e && (e = n.value), n.value > t && (t = n.value));
5865
+ for (let n of l.data) typeof n.value == "number" && (n.value < e && (e = n.value), n.value > t && (t = n.value));
5828
5866
  return isFinite(e) ? e === t ? {
5829
5867
  min: e,
5830
5868
  max: e + 1
@@ -5835,8 +5873,8 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
5835
5873
  min: 0,
5836
5874
  max: 1
5837
5875
  };
5838
- }), G = t(() => Array.isArray(c.colorScale) && c.colorScale.length > 0 && "value" in c.colorScale[0]), K = t(() => Array.isArray(c.colorScale) && !G.value), q = t(() => K.value ? "" : c.colorScale?.min ?? "#e5f0fa"), J = t(() => K.value ? "" : c.colorScale?.max ?? "#08519c");
5839
- function ue(e) {
5876
+ }), we = n(() => Array.isArray(l.colorScale) && l.colorScale.length > 0 && "value" in l.colorScale[0]), Te = n(() => Array.isArray(l.colorScale) && !we.value), Ee = n(() => Te.value ? "" : l.colorScale?.min ?? "#e5f0fa"), De = n(() => Te.value ? "" : l.colorScale?.max ?? "#08519c");
5877
+ function Oe(e) {
5840
5878
  let t = e.replace("#", "");
5841
5879
  return [
5842
5880
  parseInt(t.slice(0, 2), 16),
@@ -5844,247 +5882,263 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
5844
5882
  parseInt(t.slice(4, 6), 16)
5845
5883
  ];
5846
5884
  }
5847
- function Y(e) {
5848
- let [t, n, r] = ue(q.value), [i, a, o] = ue(J.value);
5885
+ function ke(e) {
5886
+ let [t, n, r] = Oe(Ee.value), [i, a, o] = Oe(De.value);
5849
5887
  return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
5850
5888
  }
5851
- function fe(e) {
5852
- let t = c.colorScale.slice().sort((e, t) => t.min - e.min);
5853
- for (let n of t) if (e >= n.min) return n.color;
5854
- return c.noDataColor;
5889
+ let Ae = n(() => Te.value ? l.colorScale.slice().sort((e, t) => t.min - e.min) : null), je = n(() => {
5890
+ if (!we.value) return null;
5891
+ let e = /* @__PURE__ */ new Map();
5892
+ for (let t of l.colorScale) e.set(t.value, t.color);
5893
+ return e;
5894
+ });
5895
+ function Me(e) {
5896
+ let t = Se.value.get(e), n = l.noDataColor;
5897
+ if (t == null) return n;
5898
+ let r = je.value;
5899
+ if (r) return r.get(String(t)) ?? n;
5900
+ let i = Ae.value;
5901
+ if (i) {
5902
+ let e = t;
5903
+ for (let t of i) if (e >= t.min) return t.color;
5904
+ return n;
5905
+ }
5906
+ let { min: a, max: o } = Ce.value;
5907
+ return ke((t - a) / (o - a));
5855
5908
  }
5856
- function pe(e) {
5857
- let t = c.colorScale.find((t) => t.value === String(e));
5858
- return t ? t.color : c.noDataColor;
5909
+ let Ne = (e) => e.properties?.name ?? String(e.id);
5910
+ function Pe(e) {
5911
+ return e == null ? "" : typeof e == "number" && l.tooltipValueFormat ? l.tooltipValueFormat(e) : String(e);
5859
5912
  }
5860
- function me(e) {
5861
- let t = W.value.get(String(e));
5862
- if (t == null) return c.noDataColor;
5863
- if (G.value) return pe(t);
5864
- if (K.value) return fe(t);
5865
- let { min: n, max: r } = ce.value;
5866
- return Y((t - n) / (r - n));
5913
+ function Fe(e, t) {
5914
+ return t == null ? e : `${e}: ${Pe(t)}`;
5867
5915
  }
5868
- function Z(e) {
5869
- return e.properties?.name ?? String(e.id);
5916
+ function Ie() {
5917
+ let e = E.value?.getEl();
5918
+ if (!e) return;
5919
+ z?.disconnect();
5920
+ let t = !1;
5921
+ z = new ResizeObserver((e) => {
5922
+ let n = e[0]?.contentRect;
5923
+ n && (B.width = n.width, B.height = n.height, !t && H && V ? (t = !0, Le(V.x, V.y)) : t = !0);
5924
+ }), z.observe(e);
5870
5925
  }
5871
- function Q(e) {
5872
- return W.value.get(String(e.id));
5926
+ function Le(e, t) {
5927
+ let n = E.value?.getEl();
5928
+ if (!n) return;
5929
+ let r = x.value?.getBoundingClientRect(), { left: i, top: a } = Y(e, t, B.width, B.height, l.tooltipClamp, r);
5930
+ n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
5873
5931
  }
5874
- function he(e) {
5875
- return e == null ? "" : typeof e == "number" && c.tooltipValueFormat ? c.tooltipValueFormat(e) : String(e);
5932
+ function Re(e, t, n) {
5933
+ let r = A.get(e);
5934
+ if (!r) return;
5935
+ let i = E.value, a = i?.getEl();
5936
+ !i || !a || (i.setData(r), V = {
5937
+ x: t,
5938
+ y: n
5939
+ }, H = !0, Le(t, n), a.style.visibility = "visible");
5876
5940
  }
5877
- let ge = t(() => {
5878
- let e = /* @__PURE__ */ new Map();
5879
- for (let t of B.value.features) e.set(String(t.id), t);
5880
- return e;
5881
- });
5882
- function _e(e) {
5941
+ function ze(e, t) {
5942
+ H && (le = e, G = t, !K && (K = requestAnimationFrame(() => {
5943
+ K = 0;
5944
+ let e = E.value?.getEl();
5945
+ !e || !H || (V = {
5946
+ x: le,
5947
+ y: G
5948
+ }, e.style.transform = `translate3d(${le + 16}px, ${G}px, 0) translateY(-50%)`);
5949
+ })));
5950
+ }
5951
+ function Be() {
5952
+ if (!H) return;
5953
+ H = !1, V = null;
5954
+ let e = E.value?.getEl();
5955
+ e && (e.style.visibility = "hidden");
5956
+ }
5957
+ function Ve(e) {
5958
+ M !== e && (M && (M.setAttribute("stroke-width", String($.value)), M.setAttribute("stroke", l.strokeColor)), M = e, e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String($.value + 1)), e.setAttribute("stroke", "#555"));
5959
+ }
5960
+ function He() {
5961
+ M && (M.setAttribute("stroke-width", String($.value)), M.setAttribute("stroke", l.strokeColor), M = null, d("stateHover", null)), Be();
5962
+ }
5963
+ function Ue(e) {
5883
5964
  let t = e;
5884
5965
  for (; t && !t.dataset?.featId;) t = t.parentElement;
5885
- if (!t) return null;
5886
- let n = ge.value.get(t.dataset.featId);
5887
- return n ? {
5888
- pathEl: t,
5889
- feat: n
5890
- } : null;
5966
+ return t ? t.dataset.featId ?? null : null;
5891
5967
  }
5892
- function ve(e, t, n) {
5893
- C || (C = document.createElement("div"), C.className = "chart-tooltip-content", C.style.position = "fixed", C.style.transform = "translateY(-50%)", document.body.appendChild(C));
5894
- let r = Z(e), i = Q(e), a = {
5895
- id: String(e.id),
5896
- name: r,
5897
- value: i
5968
+ function We(e) {
5969
+ if (N) return;
5970
+ let t = e, n = Ue(t.target);
5971
+ if (!n) return;
5972
+ let r = A.get(n);
5973
+ if (!r) return;
5974
+ let i = {
5975
+ id: r.id,
5976
+ name: r.name,
5977
+ value: r.value
5898
5978
  };
5899
- c.tooltipFormat ? C.innerHTML = c.tooltipFormat(a) : i == null ? C.textContent = r : C.textContent = `${r}: ${he(i)}`;
5900
- let o = f.value?.getBoundingClientRect(), { left: s, top: l } = le(t, n, C.offsetWidth, C.offsetHeight, c.tooltipClamp, o);
5901
- C.style.left = `${s}px`, C.style.top = `${l}px`;
5979
+ e.type === "click" ? d("stateClick", i) : e.type === "mouseover" && (Ve(k.get(n)), O.value && Re(n, t.clientX, t.clientY), d("stateHover", i));
5902
5980
  }
5903
- function ye() {
5904
- C &&= (C.remove(), null);
5981
+ function Ge(e) {
5982
+ N || ze(e.clientX, e.clientY);
5905
5983
  }
5906
- function be(e, t) {
5907
- x && x !== e && (x.setAttribute("stroke-width", String(U.value)), x.setAttribute("stroke", c.strokeColor)), x = e, e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(U.value + 1)), e.setAttribute("stroke", "#555");
5984
+ function Ke(e) {
5985
+ let t = e.relatedTarget;
5986
+ t && T.value?.contains(t) || He();
5908
5987
  }
5909
- function xe() {
5910
- x && (x.setAttribute("stroke-width", String(U.value)), x.setAttribute("stroke", c.strokeColor), x = null, l("stateHover", null)), ye();
5988
+ function qe(e) {
5989
+ let t = document.createElementNS(Nt, "path");
5990
+ return e && t.setAttribute("d", e), t;
5911
5991
  }
5912
- function $(e) {
5913
- if (w) return;
5914
- let t = e, n = _e(t.target);
5915
- n && (e.type === "click" ? l("stateClick", {
5916
- id: String(n.feat.id),
5917
- name: Z(n.feat),
5918
- value: Q(n.feat)
5919
- }) : e.type === "mouseover" && (be(n.pathEl, n.feat), c.tooltipTrigger && ve(n.feat, t.clientX, t.clientY), l("stateHover", {
5920
- id: String(n.feat.id),
5921
- name: Z(n.feat),
5922
- value: Q(n.feat)
5923
- })));
5992
+ function Je() {
5993
+ let e = T.value;
5994
+ if (!e) return;
5995
+ for (; e.firstChild;) e.removeChild(e.firstChild);
5996
+ k.clear(), A.clear(), j = null, M = null;
5997
+ let t = be.value, n = Q.value.features, r = l.strokeColor, i = String($.value), a = !O.value, o = document.createDocumentFragment();
5998
+ for (let e of n) {
5999
+ let n = String(e.id), s = Ne(e), c = Se.value.get(n), l = qe(t(e));
6000
+ if (l.setAttribute("class", "state-path"), l.setAttribute("data-feat-id", n), l.setAttribute("fill", Me(n)), l.setAttribute("stroke", r), l.setAttribute("stroke-width", i), l.setAttribute("vector-effect", "non-scaling-stroke"), a) {
6001
+ let e = document.createElementNS(Nt, "title");
6002
+ e.textContent = Fe(s, c), l.appendChild(e);
6003
+ }
6004
+ o.appendChild(l), k.set(n, l), A.set(n, {
6005
+ id: n,
6006
+ name: s,
6007
+ value: c,
6008
+ feature: e
6009
+ });
6010
+ }
6011
+ let s = ve.value;
6012
+ if (s) {
6013
+ let e = qe(t(s));
6014
+ e.setAttribute("fill", "none"), e.setAttribute("stroke", r), e.setAttribute("stroke-width", "1"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), e.setAttribute("vector-effect", "non-scaling-stroke"), o.appendChild(e), j = e;
6015
+ }
6016
+ e.appendChild(o);
5924
6017
  }
5925
- function Se(e) {
5926
- w || !C || (C.style.left = `${e.clientX + 16}px`, C.style.top = `${e.clientY}px`);
6018
+ function Ye() {
6019
+ let e = !O.value;
6020
+ for (let [t, n] of k) {
6021
+ let r = Se.value.get(t), i = A.get(t);
6022
+ if (n.setAttribute("fill", Me(t)), i && (i.value = r), e && i) {
6023
+ let e = n.firstElementChild;
6024
+ e && (e.textContent = Fe(i.name, r));
6025
+ }
6026
+ }
5927
6027
  }
5928
- function Ce(e) {
5929
- let t = e.relatedTarget;
5930
- t && v.value?.contains(t) || xe();
6028
+ function Xe() {
6029
+ let e = l.strokeColor, t = String($.value);
6030
+ for (let n of k.values()) n !== M && (n.setAttribute("stroke", e), n.setAttribute("stroke-width", t));
6031
+ j && j.setAttribute("stroke", e);
5931
6032
  }
5932
- function we() {
5933
- return typeof c.menu == "string" ? c.menu : "choropleth";
6033
+ function Ze() {
6034
+ return typeof l.menu == "string" ? l.menu : "choropleth";
5934
6035
  }
5935
- let Te = t(() => c.legend && (G.value || K.value || c.data)), Ee = t(() => c.colorScale.slice().sort((e, t) => e.min - t.min)), De = t(() => c.title ? 24 : 0), Oe = t(() => Te.value ? 28 : 0), ke = t(() => De.value + Oe.value), Ae = t(() => ae.value + ke.value), je = t(() => De.value + 18), Me = t(() => {
6036
+ let Qe = n(() => l.legend && (we.value || Te.value || l.data)), $e = n(() => l.colorScale.slice().sort((e, t) => e.min - t.min)), et = n(() => {
5936
6037
  let e = [];
5937
6038
  for (let t = 0; t <= 10; t++) {
5938
6039
  let n = t / 10;
5939
6040
  e.push({
5940
6041
  offset: `${(n * 100).toFixed(0)}%`,
5941
- color: Y(n)
6042
+ color: ke(n)
5942
6043
  });
5943
6044
  }
5944
6045
  return e;
5945
- }), Ne = t(() => {
5946
- let { min: e, max: t } = ce.value, n = t - e, r = [];
6046
+ }), tt = new Intl.NumberFormat("en-US", {
6047
+ notation: "compact",
6048
+ maximumFractionDigits: 1
6049
+ }), nt = n(() => {
6050
+ let { min: e, max: t } = Ce.value, n = t - e, r = [];
5947
6051
  for (let t = 1; t <= 3; t++) {
5948
- let i = t / 4, a = e + n * i, o = Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
6052
+ let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? tt.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
5949
6053
  r.push({
5950
6054
  value: o,
5951
6055
  pct: i * 100
5952
6056
  });
5953
6057
  }
5954
6058
  return r;
5955
- }), Pe = t(() => {
6059
+ }), rt = n(() => {
5956
6060
  let e = [];
5957
- if (G.value) for (let t of c.colorScale) e.push({
6061
+ if (we.value) for (let t of l.colorScale) e.push({
5958
6062
  key: t.value,
5959
6063
  color: t.color,
5960
6064
  label: t.value
5961
6065
  });
5962
- else if (K.value) for (let t of Ee.value) e.push({
6066
+ else if (Te.value) for (let t of $e.value) e.push({
5963
6067
  key: String(t.min),
5964
6068
  color: t.color,
5965
6069
  label: t.label ?? String(t.min)
5966
6070
  });
5967
6071
  return e;
5968
- }), Fe = t(() => {
5969
- let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
5970
- for (let t of Pe.value) e += 16 + t.label.length * 7 + 12;
5971
- return e - (Pe.value.length > 0 ? 12 : 0);
5972
- }), Ie = t(() => {
5973
- let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
5974
- return Pe.value.map((t) => {
5975
- let n = e;
5976
- return e += 16 + t.label.length * 7 + 12, n;
5977
- });
5978
- }), Le = t(() => {
5979
- if (G.value || K.value) return (j.value - Fe.value) / 2;
5980
- let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
5981
- return (j.value - e - 160) / 2;
5982
- }), Re = t(() => {
5983
- let e = we();
6072
+ }), it = n(() => `linear-gradient(to right, ${et.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), at = n(() => {
6073
+ let e = Ze();
5984
6074
  return [{
5985
6075
  label: "Save as SVG",
5986
6076
  action: () => {
5987
- p.value && de(p.value, e);
6077
+ S.value && X(S.value, e);
5988
6078
  }
5989
6079
  }, {
5990
6080
  label: "Save as PNG",
5991
6081
  action: () => {
5992
- p.value && X(p.value, e);
6082
+ S.value && me(S.value, e);
5993
6083
  }
5994
6084
  }];
5995
6085
  });
5996
- return (t, s) => (h(), i("div", {
6086
+ return C(() => [be.value, O.value], () => Je()), C(() => [
6087
+ Se.value,
6088
+ l.colorScale,
6089
+ l.noDataColor
6090
+ ], () => Ye()), C(() => [l.strokeColor, $.value], () => Xe()), (n, c) => (g(), a("div", {
5997
6091
  ref_key: "containerRef",
5998
- ref: f,
5999
- class: d(["choropleth-wrapper", { pannable: o.pan }])
6000
- }, [o.menu ? (h(), n(oe, {
6001
- key: 0,
6002
- items: Re.value
6003
- }, null, 8, ["items"])) : r("", !0), (h(), i("svg", {
6004
- ref_key: "svgRef",
6005
- ref: p,
6006
- width: j.value,
6007
- height: Ae.value
6092
+ ref: x,
6093
+ class: f(["choropleth-wrapper", { pannable: t.pan }])
6008
6094
  }, [
6009
- a("g", {
6010
- ref_key: "mapGroupRef",
6011
- ref: v
6012
- }, [(h(!0), i(e, null, _(B.value.features, (e) => (h(), i("path", {
6013
- key: String(e.id),
6014
- "data-feat-id": String(e.id),
6015
- d: se.value(e) ?? void 0,
6016
- fill: me(e.id),
6017
- stroke: o.strokeColor,
6018
- "stroke-width": U.value,
6019
- class: "state-path"
6020
- }, [o.tooltipTrigger ? r("", !0) : (h(), i("title", St, y(Z(e)) + y(Q(e) == null ? "" : `: ${he(Q(e))}`), 1))], 8, xt))), 128)), V.value ? (h(), i("path", {
6021
- key: 0,
6022
- d: se.value(V.value) ?? void 0,
6023
- fill: "none",
6024
- stroke: o.strokeColor,
6025
- "stroke-width": 1,
6026
- "stroke-linejoin": "round",
6027
- "pointer-events": "none"
6028
- }, null, 8, Ct)) : r("", !0)], 512),
6029
- Te.value ? (h(), i("g", {
6095
+ t.menu ? (g(), r(ce, {
6030
6096
  key: 0,
6031
- class: "choropleth-legend",
6032
- transform: `translate(${Le.value},${je.value})`
6033
- }, [G.value || K.value ? (h(), i(e, { key: 0 }, [o.legendTitle ? (h(), i("text", Tt, y(o.legendTitle), 1)) : r("", !0), (h(!0), i(e, null, _(Pe.value, (t, n) => (h(), i(e, { key: t.key }, [a("rect", {
6034
- x: Ie.value[n],
6035
- y: -5,
6036
- width: "12",
6037
- height: "12",
6038
- rx: "3",
6039
- fill: t.color
6040
- }, null, 8, Et), a("text", {
6041
- x: Ie.value[n] + 16,
6042
- y: 5,
6043
- "font-size": "13",
6044
- fill: "currentColor"
6045
- }, y(t.label), 9, Dt)], 64))), 128))], 64)) : (h(), i(e, { key: 1 }, [
6046
- o.legendTitle ? (h(), i("text", Ot, y(o.legendTitle), 1)) : r("", !0),
6047
- a("defs", null, [a("linearGradient", {
6048
- id: u,
6049
- x1: "0",
6050
- x2: "1",
6051
- y1: "0",
6052
- y2: "0"
6053
- }, [(h(!0), i(e, null, _(Me.value, (e) => (h(), i("stop", {
6054
- key: e.offset,
6055
- offset: e.offset,
6056
- "stop-color": e.color
6057
- }, null, 8, kt))), 128))])]),
6058
- a("rect", {
6059
- x: o.legendTitle ? o.legendTitle.length * 8 + 12 : 0,
6060
- y: -6,
6061
- width: 160,
6062
- height: 12,
6063
- rx: "2",
6064
- fill: `url(#${u})`
6065
- }, null, 8, At),
6066
- (h(!0), i(e, null, _(Ne.value, (e) => (h(), i("text", {
6067
- key: e.value,
6068
- x: (o.legendTitle ? o.legendTitle.length * 8 + 12 : 0) + e.pct / 100 * 160,
6069
- y: 20,
6070
- "font-size": "11",
6071
- fill: "currentColor",
6072
- opacity: "0.7",
6073
- "text-anchor": "middle"
6074
- }, y(e.value), 9, jt))), 128))
6075
- ], 64))], 8, wt)) : r("", !0),
6076
- o.title ? (h(), i("text", {
6077
- key: 1,
6078
- x: j.value / 2,
6079
- y: 18,
6080
- "text-anchor": "middle",
6081
- "font-size": "14",
6082
- "font-weight": "600",
6083
- fill: "currentColor"
6084
- }, y(o.title), 9, Mt)) : r("", !0)
6085
- ], 8, bt))], 2));
6097
+ items: at.value
6098
+ }, null, 8, ["items"])) : i("", !0),
6099
+ t.title || Qe.value ? (g(), a("div", Tt, [t.title ? (g(), a("div", Et, y(t.title), 1)) : i("", !0), Qe.value ? (g(), a("div", Dt, [t.legendTitle ? (g(), a("span", Ot, y(t.legendTitle), 1)) : i("", !0), we.value || Te.value ? (g(!0), a(e, { key: 1 }, v(rt.value, (e) => (g(), a("span", {
6100
+ key: e.key,
6101
+ class: "choropleth-legend-item"
6102
+ }, [o("span", {
6103
+ class: "choropleth-legend-swatch",
6104
+ style: m({ background: e.color })
6105
+ }, null, 4), s(" " + y(e.label), 1)]))), 128)) : (g(), a("div", kt, [o("div", {
6106
+ class: "choropleth-legend-gradient",
6107
+ style: m({ background: it.value })
6108
+ }, null, 4), o("div", At, [(g(!0), a(e, null, v(nt.value, (e) => (g(), a("span", {
6109
+ key: e.value,
6110
+ style: m({ left: e.pct + "%" })
6111
+ }, y(e.value), 5))), 128))])]))])) : i("", !0)])) : i("", !0),
6112
+ (g(), a("svg", {
6113
+ ref_key: "svgRef",
6114
+ ref: S,
6115
+ viewBox: `0 0 ${he.value} ${ge.value}`,
6116
+ preserveAspectRatio: "xMidYMid meet"
6117
+ }, [o("g", {
6118
+ ref_key: "mapGroupRef",
6119
+ ref: T
6120
+ }, null, 512)], 8, jt)),
6121
+ (t.zoom || t.pan) && W.value ? (g(), a("button", {
6122
+ key: 2,
6123
+ type: "button",
6124
+ class: "choropleth-reset",
6125
+ "aria-label": "Reset zoom",
6126
+ onClick: pe
6127
+ }, " Reset ")) : i("", !0),
6128
+ O.value ? (g(), r(wt, {
6129
+ key: 3,
6130
+ ref_key: "tooltipChildRef",
6131
+ ref: E
6132
+ }, {
6133
+ default: w((r) => [te(n.$slots, "tooltip", p(u(ne(r))), () => [t.tooltipFormat ? (g(), a("span", {
6134
+ key: 0,
6135
+ innerHTML: t.tooltipFormat(r)
6136
+ }, 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(Pe(r.value)), 1)], 64))], !0)]),
6137
+ _: 3
6138
+ }, 512)) : i("", !0)
6139
+ ], 2));
6086
6140
  }
6087
- }), [["__scopeId", "data-v-105ba317"]]), Pt = /* @__PURE__ */ B(/* @__PURE__ */ c({
6141
+ }), [["__scopeId", "data-v-ecaa9e15"]]), It = /* @__PURE__ */ V(/* @__PURE__ */ l({
6088
6142
  __name: "ChartTooltip",
6089
6143
  props: {
6090
6144
  x: {},
@@ -6095,47 +6149,47 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
6095
6149
  },
6096
6150
  emits: ["close"],
6097
6151
  setup(e) {
6098
- return (t, o) => e.mode === "hover" && e.open ? (h(), i("div", {
6152
+ return (t, n) => e.mode === "hover" && e.open ? (g(), a("div", {
6099
6153
  key: 0,
6100
6154
  class: "chart-tooltip-content",
6101
- style: p({
6155
+ style: m({
6102
6156
  position: "absolute",
6103
6157
  left: `${e.x + e.sideOffset}px`,
6104
6158
  top: `${e.y}px`,
6105
6159
  transform: "translateY(-50%)"
6106
6160
  })
6107
- }, [v(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (h(), n(x(j), {
6161
+ }, [te(t.$slots, "default", {}, void 0, !0)], 4)) : e.mode === "click" ? (g(), r(x(N), {
6108
6162
  key: 1,
6109
6163
  open: e.open
6110
6164
  }, {
6111
- default: C(() => [s(x(O), { "as-child": "" }, {
6112
- default: C(() => [a("div", {
6165
+ default: w(() => [c(x(A), { "as-child": "" }, {
6166
+ default: w(() => [o("div", {
6113
6167
  class: "chart-tooltip-anchor",
6114
- style: p({
6168
+ style: m({
6115
6169
  left: `${e.x}px`,
6116
6170
  top: `${e.y}px`
6117
6171
  })
6118
6172
  }, null, 4)]),
6119
6173
  _: 1
6120
- }), s(x(A), null, {
6121
- default: C(() => [e.open ? (h(), n(x(k), {
6174
+ }), c(x(M), null, {
6175
+ default: w(() => [e.open ? (g(), r(x(j), {
6122
6176
  key: 0,
6123
6177
  class: "chart-tooltip-content",
6124
6178
  side: "right",
6125
6179
  "side-offset": e.sideOffset,
6126
6180
  "update-position-strategy": "always",
6127
- onPointerDownOutside: o[0] ||= (e) => t.$emit("close"),
6128
- onEscapeKeyDown: o[1] ||= (e) => t.$emit("close")
6181
+ onPointerDownOutside: n[0] ||= (e) => t.$emit("close"),
6182
+ onEscapeKeyDown: n[1] ||= (e) => t.$emit("close")
6129
6183
  }, {
6130
- default: C(() => [v(t.$slots, "default", {}, void 0, !0)]),
6184
+ default: w(() => [te(t.$slots, "default", {}, void 0, !0)]),
6131
6185
  _: 3
6132
- }, 8, ["side-offset"])) : r("", !0)]),
6186
+ }, 8, ["side-offset"])) : i("", !0)]),
6133
6187
  _: 3
6134
6188
  })]),
6135
6189
  _: 3
6136
- }, 8, ["open"])) : r("", !0);
6190
+ }, 8, ["open"])) : i("", !0);
6137
6191
  }
6138
- }), [["__scopeId", "data-v-44377f70"]]), Ft = { class: "TableWrapper" }, It = /* @__PURE__ */ B(/* @__PURE__ */ c({
6192
+ }), [["__scopeId", "data-v-44377f70"]]), Lt = { class: "TableWrapper" }, Rt = /* @__PURE__ */ V(/* @__PURE__ */ l({
6139
6193
  __name: "DataTable",
6140
6194
  props: {
6141
6195
  data: {},
@@ -6153,12 +6207,12 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
6153
6207
  default: !1
6154
6208
  }
6155
6209
  },
6156
- setup(o) {
6210
+ setup(t) {
6157
6211
  let s = {
6158
6212
  small: "80px",
6159
6213
  medium: "150px",
6160
6214
  large: "250px"
6161
- }, c = o;
6215
+ }, c = t;
6162
6216
  function l(e) {
6163
6217
  return c.columnConfig?.[e]?.label ?? e;
6164
6218
  }
@@ -6174,16 +6228,16 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
6174
6228
  minWidth: n
6175
6229
  };
6176
6230
  }
6177
- function f(e) {
6231
+ function d(e) {
6178
6232
  let t = c.columnConfig?.[e]?.align;
6179
6233
  if (t) return { textAlign: t };
6180
6234
  }
6181
- function ee(e) {
6235
+ function p(e) {
6182
6236
  return typeof e.column == "function";
6183
6237
  }
6184
- let m = t(() => {
6238
+ let h = n(() => {
6185
6239
  let e = c.data;
6186
- return ee(e) ? e.columns.map((t) => ({
6240
+ return p(e) ? e.columns.map((t) => ({
6187
6241
  name: t.name,
6188
6242
  values: e.column(t.name),
6189
6243
  enumLabels: t.enumLabels
@@ -6191,60 +6245,60 @@ var he = ["width", "height"], ge = ["x"], _e = { key: 1 }, ve = [
6191
6245
  name: e,
6192
6246
  values: t
6193
6247
  }));
6194
- }), g = t(() => {
6195
- let e = m.value;
6248
+ }), ee = n(() => {
6249
+ let e = h.value;
6196
6250
  if (e.length === 0) return 0;
6197
6251
  let t = 0;
6198
6252
  for (let n of e) t = Math.max(t, n.values.length);
6199
6253
  return c.maxRows ? Math.min(t, c.maxRows) : t;
6200
6254
  });
6201
- function v(e, t) {
6255
+ function _(e, t) {
6202
6256
  let n = e.values[t];
6203
6257
  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);
6204
6258
  }
6205
6259
  function te() {
6206
6260
  return c.filename ? c.filename : typeof c.menu == "string" ? c.menu : "data";
6207
6261
  }
6208
- function b(e) {
6262
+ function ne(e) {
6209
6263
  return e.includes(",") || e.includes("\"") || e.includes("\n") ? `"${e.replace(/"/g, "\"\"")}"` : e;
6210
6264
  }
6211
- function x() {
6265
+ function b() {
6212
6266
  if (typeof c.csv == "function") return c.csv();
6213
6267
  if (typeof c.csv == "string") return c.csv;
6214
- let e = m.value, t = g.value, n = [e.map((e) => b(l(e.name))).join(",")];
6268
+ let e = h.value, t = ee.value, n = [e.map((e) => ne(l(e.name))).join(",")];
6215
6269
  for (let r = 0; r < t; r++) {
6216
- let t = e.map((e) => b(v(e, r)));
6270
+ let t = e.map((e) => ne(_(e, r)));
6217
6271
  n.push(t.join(","));
6218
6272
  }
6219
6273
  return n.join("\n");
6220
6274
  }
6221
- let S = t(() => [{
6275
+ let x = n(() => [{
6222
6276
  label: c.downloadMenuLink,
6223
- action: () => fe(x(), te())
6224
- }]), ne = t(() => !!c.menu);
6225
- return (t, s) => (h(), i("div", { class: d(["TableOuter", {
6226
- "full-width": o.fullWidth,
6227
- "has-menu": ne.value
6228
- }]) }, [ne.value ? (h(), n(oe, {
6277
+ action: () => Z(b(), te())
6278
+ }]), re = n(() => !!c.menu);
6279
+ return (n, s) => (g(), a("div", { class: f(["TableOuter", {
6280
+ "full-width": t.fullWidth,
6281
+ "has-menu": re.value
6282
+ }]) }, [re.value ? (g(), r(ce, {
6229
6283
  key: 0,
6230
- items: S.value,
6284
+ items: x.value,
6231
6285
  "force-dropdown": ""
6232
- }, null, 8, ["items"])) : r("", !0), a("div", Ft, [a("table", { class: d(["Table", { "full-width": o.fullWidth }]) }, [
6233
- a("colgroup", null, [(h(!0), i(e, null, _(m.value, (e) => (h(), i("col", {
6286
+ }, null, 8, ["items"])) : i("", !0), o("div", Lt, [o("table", { class: f(["Table", { "full-width": t.fullWidth }]) }, [
6287
+ o("colgroup", null, [(g(!0), a(e, null, v(h.value, (e) => (g(), a("col", {
6234
6288
  key: e.name,
6235
- style: p(u(e.name))
6289
+ style: m(u(e.name))
6236
6290
  }, null, 4))), 128))]),
6237
- a("thead", null, [a("tr", null, [(h(!0), i(e, null, _(m.value, (e) => (h(), i("th", {
6291
+ o("thead", null, [o("tr", null, [(g(!0), a(e, null, v(h.value, (e) => (g(), a("th", {
6238
6292
  key: e.name,
6239
- style: p(f(e.name))
6293
+ style: m(d(e.name))
6240
6294
  }, y(l(e.name)), 5))), 128))])]),
6241
- a("tbody", null, [(h(!0), i(e, null, _(g.value, (t) => (h(), i("tr", { key: t }, [(h(!0), i(e, null, _(m.value, (e) => (h(), i("td", {
6295
+ 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", {
6242
6296
  key: e.name,
6243
- class: d(o.columnConfig?.[e.name]?.cellClass),
6244
- style: p(f(e.name))
6245
- }, y(v(e, t - 1)), 7))), 128))]))), 128))])
6297
+ class: f(t.columnConfig?.[e.name]?.cellClass),
6298
+ style: m(d(e.name))
6299
+ }, y(_(e, n - 1)), 7))), 128))]))), 128))])
6246
6300
  ], 2)])], 2));
6247
6301
  }
6248
6302
  }), [["__scopeId", "data-v-d5c290dc"]]);
6249
6303
  //#endregion
6250
- export { _t as BarChart, Pt as ChartTooltip, Nt as ChoroplethMap, It as DataTable, Xe as LineChart };
6304
+ export { bt as BarChart, It as ChartTooltip, Ft as ChoroplethMap, Rt as DataTable, $e as LineChart };