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