@cfasim-ui/charts 0.3.2 → 0.3.4

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,15 +1,15 @@
1
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, normalizeClass as u, normalizeProps as d, normalizeStyle as f, onMounted as p, onUnmounted as ee, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, toRaw as y, unref as b, useId as x, watch as S, withCtx as C, withModifiers as w } from "vue";
2
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 te } from "d3-geo";
4
- import { zoom as ne } from "d3-zoom";
5
- import { select as re } from "d3-selection";
6
- import { feature as F, merge as I, mesh as ie } from "topojson-client";
3
+ import { geoAlbersUsa as P, geoPath as F } from "d3-geo";
4
+ import { zoom as te } from "d3-zoom";
5
+ import { select as ne } from "d3-selection";
6
+ import { feature as re, merge as ie, mesh as ae } from "topojson-client";
7
7
  //#region src/ChartMenu/ChartMenu.vue?vue&type=script&setup=true&lang.ts
8
- var L = { class: "chart-menu-trigger-area" }, R = ["aria-label"], z = /* @__PURE__ */ c({
8
+ var I = { class: "chart-menu-trigger-area" }, oe = ["aria-label"], L = /* @__PURE__ */ c({
9
9
  __name: "ChartMenu",
10
10
  props: { items: {} },
11
11
  setup(t) {
12
- return (r, c) => (m(), i("div", L, [t.items.length === 1 ? (m(), i("button", {
12
+ return (r, c) => (m(), i("div", I, [t.items.length === 1 ? (m(), i("button", {
13
13
  key: 0,
14
14
  class: "chart-menu-button chart-menu-single",
15
15
  "aria-label": t.items[0].label,
@@ -24,7 +24,7 @@ var L = { class: "chart-menu-trigger-area" }, R = ["aria-label"], z = /* @__PURE
24
24
  "stroke-linecap": "round",
25
25
  "stroke-linejoin": "round",
26
26
  "aria-hidden": "true"
27
- }, [a("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, R)) : (m(), n(b(O), {
27
+ }, [a("path", { d: "M7 1v8M3 6l4 4 4-4M2 13h10" })], -1)]], 8, oe)) : (m(), n(b(O), {
28
28
  key: 1,
29
29
  modal: !1
30
30
  }, {
@@ -77,24 +77,24 @@ var L = { class: "chart-menu-trigger-area" }, R = ["aria-label"], z = /* @__PURE
77
77
  _: 1
78
78
  }))]));
79
79
  }
80
- }), B = (e, t) => {
80
+ }), R = (e, t) => {
81
81
  let n = e.__vccOpts || e;
82
82
  for (let [e, r] of t) n[e] = r;
83
83
  return n;
84
- }, ae = /* @__PURE__ */ B(z, [["__scopeId", "data-v-fe2f6904"]]);
84
+ }, se = /* @__PURE__ */ R(L, [["__scopeId", "data-v-fe2f6904"]]);
85
85
  //#endregion
86
86
  //#region src/ChartMenu/download.ts
87
- function V(e, t) {
87
+ function z(e, t) {
88
88
  let n = URL.createObjectURL(e), r = document.createElement("a");
89
89
  r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
90
90
  }
91
- function oe(e, t) {
91
+ function ce(e, t) {
92
92
  let n = e.cloneNode(!0);
93
93
  n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
94
94
  let r = new XMLSerializer().serializeToString(n);
95
- V(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
95
+ z(new Blob([r], { type: "image/svg+xml" }), `${t}.svg`);
96
96
  }
97
- function se(e, t) {
97
+ function le(e, t) {
98
98
  let n = e.cloneNode(!0);
99
99
  n.setAttribute("xmlns", "http://www.w3.org/2000/svg");
100
100
  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;
@@ -103,75 +103,158 @@ function se(e, t) {
103
103
  e.width = s * 2, e.height = c * 2;
104
104
  let n = e.getContext("2d");
105
105
  n.scale(2, 2), n.drawImage(o, 0, 0, s, c), e.toBlob((e) => {
106
- e && V(e, `${t}.png`);
106
+ e && z(e, `${t}.png`);
107
107
  }), URL.revokeObjectURL(a);
108
108
  }, o.src = a;
109
109
  }
110
- function H(e, t) {
111
- V(new Blob([e], { type: "text/csv" }), `${t}.csv`);
110
+ function B(e, t) {
111
+ z(new Blob([e], { type: "text/csv" }), `${t}.csv`);
112
+ }
113
+ //#endregion
114
+ //#region src/tooltip-position.ts
115
+ var V = 16, H = 8;
116
+ function ue(e, t, n, r, i, a) {
117
+ if (i === "none") return {
118
+ left: e + V,
119
+ top: t
120
+ };
121
+ let o = i === "chart" && a ? {
122
+ left: a.left,
123
+ right: a.right,
124
+ top: a.top,
125
+ bottom: a.bottom
126
+ } : {
127
+ left: 0,
128
+ right: window.innerWidth,
129
+ top: 0,
130
+ bottom: window.innerHeight
131
+ }, s = e + V + n > o.right - H ? e - V - n : e + V, c = r / 2;
132
+ return {
133
+ left: s,
134
+ top: Math.min(Math.max(t, o.top + H + c), o.bottom - H - c)
135
+ };
112
136
  }
113
137
  //#endregion
114
138
  //#region src/LineChart/LineChart.vue?vue&type=script&setup=true&lang.ts
115
- var ce = ["width", "height"], le = ["x"], U = [
139
+ var U = ["width", "height"], de = ["x"], fe = { key: 1 }, W = [
140
+ "x1",
141
+ "y1",
142
+ "x2",
143
+ "y2",
144
+ "stroke",
145
+ "stroke-dasharray"
146
+ ], G = [
147
+ "cx",
148
+ "cy",
149
+ "fill",
150
+ "fill-opacity",
151
+ "stroke"
152
+ ], pe = ["x", "y"], me = [
116
153
  "x1",
117
154
  "y1",
118
155
  "x2",
119
156
  "y2"
120
- ], ue = [
157
+ ], he = [
121
158
  "x1",
122
159
  "y1",
123
160
  "x2",
124
161
  "y2"
125
- ], de = [
162
+ ], ge = [
126
163
  "x1",
127
164
  "y1",
128
165
  "x2",
129
166
  "y2"
130
- ], W = [
167
+ ], _e = [
131
168
  "x1",
132
169
  "y1",
133
170
  "x2",
134
171
  "y2"
135
- ], G = ["x", "y"], fe = ["transform"], pe = ["x", "y"], me = ["x", "y"], he = [
172
+ ], ve = ["x", "y"], ye = ["transform"], K = ["x", "y"], q = ["x", "y"], be = [
136
173
  "d",
137
174
  "fill",
138
175
  "fill-opacity"
139
- ], ge = [
176
+ ], xe = [
140
177
  "d",
141
178
  "stroke",
142
179
  "stroke-width",
143
180
  "stroke-opacity",
144
181
  "stroke-dasharray"
145
- ], _e = [
182
+ ], Se = [
146
183
  "cx",
147
184
  "cy",
148
185
  "r",
149
186
  "fill",
150
187
  "fill-opacity",
151
188
  "stroke"
152
- ], ve = [
189
+ ], Ce = [
190
+ "d",
191
+ "fill",
192
+ "fill-opacity"
193
+ ], we = [
194
+ "d",
195
+ "stroke",
196
+ "stroke-width",
197
+ "stroke-dasharray"
198
+ ], Te = [
199
+ "x1",
200
+ "y1",
201
+ "x2",
202
+ "y2",
203
+ "stroke",
204
+ "stroke-width",
205
+ "stroke-dasharray"
206
+ ], J = [
207
+ "x1",
208
+ "y1",
209
+ "x2",
210
+ "y2",
211
+ "stroke",
212
+ "stroke-width",
213
+ "stroke-dasharray"
214
+ ], Ee = [
153
215
  "x1",
154
216
  "y1",
155
217
  "x2",
156
218
  "y2"
157
- ], K = [
219
+ ], De = [
220
+ "x1",
221
+ "y1",
222
+ "x2",
223
+ "y2"
224
+ ], Oe = [
225
+ "x1",
226
+ "y1",
227
+ "x2",
228
+ "y2"
229
+ ], ke = [
158
230
  "cx",
159
231
  "cy",
160
232
  "fill"
161
- ], q = [
233
+ ], Ae = [
162
234
  "x",
163
235
  "y",
164
236
  "width",
165
237
  "height"
166
- ], ye = { class: "line-chart-tooltip" }, be = {
238
+ ], je = [
239
+ "cx",
240
+ "cy",
241
+ "fill",
242
+ "fill-opacity",
243
+ "stroke"
244
+ ], Me = [
245
+ "x",
246
+ "y",
247
+ "fill"
248
+ ], Y = ["x", "y"], Ne = { class: "line-chart-tooltip" }, Pe = {
167
249
  key: 0,
168
250
  class: "line-chart-tooltip-label"
169
- }, xe = ["href", "download"], Se = 50, J = /* @__PURE__ */ B(/* @__PURE__ */ c({
251
+ }, Fe = ["href", "download"], X = 20, Z = 36, Ie = 12, Le = 7, Re = 16, ze = 50, Be = /* @__PURE__ */ R(/* @__PURE__ */ c({
170
252
  __name: "LineChart",
171
253
  props: {
172
254
  data: {},
173
255
  series: {},
174
256
  areas: {},
257
+ areaSections: {},
175
258
  width: {},
176
259
  height: {},
177
260
  lineOpacity: { default: 1 },
@@ -190,6 +273,7 @@ var ce = ["width", "height"], le = ["x"], U = [
190
273
  yGrid: { type: Boolean },
191
274
  tooltipData: {},
192
275
  tooltipTrigger: {},
276
+ tooltipClamp: { default: "chart" },
193
277
  csv: {},
194
278
  filename: {},
195
279
  downloadLink: { type: [Boolean, String] }
@@ -207,20 +291,20 @@ var ce = ["width", "height"], le = ["x"], U = [
207
291
  }), ee(() => {
208
292
  C?.disconnect(), T && clearTimeout(T);
209
293
  });
210
- let E = t(() => u.width ?? (S.value || 400)), D = t(() => u.height ?? 200), O = t(() => ({
211
- top: u.title ? 30 : 10,
294
+ let E = t(() => u.width ?? (S.value || 400)), D = t(() => u.height ?? 200), O = t(() => M.value.some((e) => e.legend) || u.areaSections?.some((e) => e.legend === "inline" && (e.label || e.description))), k = t(() => ({
295
+ top: (u.title ? 30 : 10) + (O.value ? X : 0),
212
296
  right: 10,
213
297
  bottom: u.xLabel ? 46 : 30,
214
298
  left: u.yLabel ? 66 : 50
215
- })), k = t(() => E.value - O.value.left - O.value.right), A = t(() => D.value - O.value.top - O.value.bottom), j = t(() => u.series && u.series.length > 0 ? u.series : u.data ? [{ data: u.data }] : []), M = t(() => u.areas ?? []), N = t(() => {
299
+ })), A = t(() => E.value - k.value.left - k.value.right), j = t(() => D.value - k.value.top - k.value.bottom), M = t(() => u.series && u.series.length > 0 ? u.series : u.data ? [{ data: u.data }] : []), N = t(() => u.areas ?? []), P = t(() => {
216
300
  let e = 0;
217
- for (let t of j.value) t.data.length > e && (e = t.data.length);
218
- for (let t of M.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
301
+ for (let t of M.value) t.data.length > e && (e = t.data.length);
302
+ for (let t of N.value) t.upper.length > e && (e = t.upper.length), t.lower.length > e && (e = t.lower.length);
219
303
  return e;
220
- }), P = t(() => {
304
+ }), F = t(() => {
221
305
  let e = Infinity, t = -Infinity;
222
- for (let n of j.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
223
- for (let n of M.value) {
306
+ for (let n of M.value) for (let r of n.data) isFinite(r) && (r < e && (e = r), r > t && (t = r));
307
+ for (let n of N.value) {
224
308
  for (let r of n.upper) isFinite(r) && (r < e && (e = r), r > t && (t = r));
225
309
  for (let r of n.lower) isFinite(r) && (r < e && (e = r), r > t && (t = r));
226
310
  }
@@ -236,21 +320,21 @@ var ce = ["width", "height"], le = ["x"], U = [
236
320
  });
237
321
  function te(e) {
238
322
  if (e.length === 0) return "";
239
- let { min: t, range: n } = P.value, r = N.value, i = k.value / (r - 1 || 1), a = A.value / n, o = O.value.top + A.value, s = "", c = !1;
323
+ let { min: t, range: n } = F.value, r = P.value, i = A.value / (r - 1 || 1), a = j.value / n, o = k.value.top + j.value, s = "", c = !1;
240
324
  for (let n = 0; n < e.length; n++) {
241
325
  if (!isFinite(e[n])) {
242
326
  c = !1;
243
327
  continue;
244
328
  }
245
- let r = O.value.left + n * i, l = o - (e[n] - t) * a;
329
+ let r = k.value.left + n * i, l = o - (e[n] - t) * a;
246
330
  s += c ? `L${r},${l}` : `M${r},${l}`, c = !0;
247
331
  }
248
332
  return s;
249
333
  }
250
334
  function ne(e) {
251
- let { min: t, range: n } = P.value, r = N.value, i = k.value / (r - 1 || 1), a = A.value / n, o = O.value.top + A.value, s = [];
335
+ let { min: t, range: n } = F.value, r = P.value, i = A.value / (r - 1 || 1), a = j.value / n, o = k.value.top + j.value, s = [];
252
336
  for (let n = 0; n < e.length; n++) isFinite(e[n]) && s.push({
253
- x: O.value.left + n * i,
337
+ x: k.value.left + n * i,
254
338
  y: o - (e[n] - t) * a
255
339
  });
256
340
  return s;
@@ -258,7 +342,7 @@ var ce = ["width", "height"], le = ["x"], U = [
258
342
  function re(e, t) {
259
343
  let n = Math.min(e.length, t.length);
260
344
  if (n === 0) return "";
261
- let { min: r, range: i } = P.value, a = N.value, o = k.value / (a - 1 || 1), s = A.value / i, c = O.value.top + A.value, l = (e) => O.value.left + e * o, u = (e) => c - (e - r) * s, d = [], f = [];
345
+ let { min: r, range: i } = F.value, a = P.value, o = A.value / (a - 1 || 1), s = j.value / i, c = k.value.top + j.value, l = (e) => k.value.left + e * o, u = (e) => c - (e - r) * s, d = [], f = [];
262
346
  for (let r = 0; r < n; r++) isFinite(e[r]) && isFinite(t[r]) ? f.push(r) : f.length && (d.push(f), f = []);
263
347
  f.length && d.push(f);
264
348
  let p = "";
@@ -270,63 +354,134 @@ var ce = ["width", "height"], le = ["x"], U = [
270
354
  }
271
355
  return p;
272
356
  }
273
- function F(e, t) {
357
+ function ie(e, t = !0) {
358
+ let n = P.value, r = A.value / (n - 1 || 1), i = k.value.top + j.value, a = (e) => k.value.left + e * r;
359
+ if (e.seriesIndex == null) {
360
+ let t = Math.max(0, e.startIndex), r = Math.min(n - 1, e.endIndex);
361
+ return t > r ? "" : `M${a(t)},${k.value.top}L${a(r)},${k.value.top}L${a(r)},${i}L${a(t)},${i}Z`;
362
+ }
363
+ let o = M.value[e.seriesIndex];
364
+ if (!o) return "";
365
+ let { min: s, range: c } = F.value, l = j.value / c, u = (e) => i - (e - s) * l, d = Math.max(0, e.startIndex), f = Math.min(o.data.length - 1, e.endIndex);
366
+ if (d > f) return "";
367
+ let p = `M${a(d)},${u(o.data[d])}`;
368
+ for (let e = d + 1; e <= f; e++) isFinite(o.data[e]) && (p += `L${a(e)},${u(o.data[e])}`);
369
+ return t && (p += `L${a(f)},${i}`, p += `L${a(d)},${i}`, p += "Z"), p;
370
+ }
371
+ let ae = t(() => {
372
+ let e = u.areaSections;
373
+ if (!e?.length) return {
374
+ labels: [],
375
+ extraHeight: 0
376
+ };
377
+ let t = P.value, n = A.value / (t - 1 || 1), r = [];
378
+ for (let t of e) {
379
+ if (!t.label && !t.description || t.legend === "inline" || t.legend === !1) continue;
380
+ let e = k.value.left + (t.startIndex + t.endIndex) / 2 * n, i = t.label ?? "", a = t.description ?? "", o = Math.max(i.length, a.length) * Le, s = t.color ?? (t.seriesIndex == null ? "#999" : M.value[t.seriesIndex]?.color ?? "currentColor");
381
+ r.push({
382
+ cx: e,
383
+ labelText: i,
384
+ descText: a,
385
+ textWidth: o,
386
+ row: 0,
387
+ color: s,
388
+ fillOpacity: t.opacity ?? .15
389
+ });
390
+ }
391
+ r.sort((e, t) => e.cx - t.cx);
392
+ let i = [];
393
+ for (let e of r) {
394
+ let t = e.cx - e.textWidth / 2, n = 0;
395
+ for (; n < i.length && !(t >= i[n] + Re);) n++;
396
+ e.row = n;
397
+ let r = e.cx + e.textWidth / 2;
398
+ i[n] = Math.max(i[n] ?? -Infinity, r);
399
+ }
400
+ return r.length === 0 ? {
401
+ labels: [],
402
+ extraHeight: 0
403
+ } : {
404
+ labels: r,
405
+ extraHeight: (Math.max(...r.map((e) => e.row)) + 1) * Z + Ie
406
+ };
407
+ }), I = t(() => {
408
+ let e = [];
409
+ for (let t of M.value) t.legend && e.push({
410
+ label: t.legend,
411
+ color: t.color ?? "currentColor",
412
+ type: "series",
413
+ dashed: t.dashed
414
+ });
415
+ let t = u.areaSections;
416
+ if (t) for (let n of t) {
417
+ if (n.legend !== "inline" || !n.label && !n.description) continue;
418
+ let t = [n.label, n.description].filter(Boolean).join(" "), r = n.color ?? (n.seriesIndex == null ? "#999" : M.value[n.seriesIndex]?.color ?? "currentColor");
419
+ e.push({
420
+ label: t,
421
+ color: r,
422
+ type: "section",
423
+ fillOpacity: n.opacity ?? .15
424
+ });
425
+ }
426
+ return e;
427
+ }), oe = t(() => D.value + ae.value.extraHeight), L = t(() => k.value.top + j.value + k.value.bottom + Ie);
428
+ function R(e, t) {
274
429
  let n = e / t, r = 10 ** Math.floor(Math.log10(n)), i = n / r, a;
275
430
  return a = i <= 1.5 ? 1 : i <= 3 ? 2 : i <= 7 ? 5 : 10, a * r;
276
431
  }
277
- function I(e) {
432
+ function z(e) {
278
433
  return Math.round(e) + .5;
279
434
  }
280
- let ie = new Intl.NumberFormat();
281
- function L(e) {
282
- return Math.abs(e) >= 1e3 ? ie.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
435
+ let V = new Intl.NumberFormat();
436
+ function H(e) {
437
+ return Math.abs(e) >= 1e3 ? V.format(e) : Number.isInteger(e) ? e.toString() : e.toFixed(1);
283
438
  }
284
- let R = t(() => {
285
- let { min: e, max: t } = P.value;
439
+ let Be = t(() => {
440
+ let { min: e, max: t } = F.value;
286
441
  if (e === t) return [{
287
- value: L(e),
288
- y: I(O.value.top + A.value / 2)
442
+ value: H(e),
443
+ y: z(k.value.top + j.value / 2)
289
444
  }];
290
- let n = Math.max(3, Math.floor(A.value / 50)), r = F(t - e, n), i = Math.ceil(e / r) * r, a = [];
445
+ let n = Math.max(3, Math.floor(j.value / 50)), r = R(t - e, n), i = Math.ceil(e / r) * r, a = [];
291
446
  for (let n = i; n <= t; n += r) a.push({
292
- value: L(n),
293
- y: I(O.value.top + A.value - (n - e) / P.value.range * A.value)
447
+ value: H(n),
448
+ y: z(k.value.top + j.value - (n - e) / F.value.range * j.value)
294
449
  });
295
450
  return a;
296
- }), z = t(() => {
297
- let e = N.value;
451
+ }), Ve = t(() => {
452
+ let e = P.value;
298
453
  if (e <= 1) return [];
299
454
  let t = u.xLabels;
300
455
  if (t && t.length === e) {
301
- let n = Math.max(3, Math.floor(k.value / 80)), r = Math.max(1, Math.round((e - 1) / n)), i = [];
456
+ let n = Math.max(3, Math.floor(A.value / 80)), r = Math.max(1, Math.round((e - 1) / n)), i = [];
302
457
  for (let n = 0; n < e; n += r) i.push({
303
458
  value: t[n],
304
- x: I(O.value.left + n / (e - 1) * k.value)
459
+ x: z(k.value.left + n / (e - 1) * A.value)
305
460
  });
306
461
  return i;
307
462
  }
308
- let n = u.xMin ?? 0, r = Math.max(3, Math.floor(k.value / 80)), i = F(e - 1, r), a = [];
463
+ let n = u.xMin ?? 0, r = Math.max(3, Math.floor(A.value / 80)), i = R(e - 1, r), a = [];
309
464
  for (let t = 0; t <= e - 1; t += i) {
310
465
  let r = Math.round(t);
311
466
  a.push({
312
- value: L(r + n),
313
- x: I(O.value.left + r / (e - 1) * k.value)
467
+ value: H(r + n),
468
+ x: z(k.value.left + r / (e - 1) * A.value)
314
469
  });
315
470
  }
316
471
  return a;
317
472
  });
318
- function B() {
473
+ function He() {
319
474
  return u.filename ? u.filename : typeof u.menu == "string" ? u.menu : "chart";
320
475
  }
321
- function V() {
476
+ function Ue() {
322
477
  return x.value;
323
478
  }
324
- function J() {
479
+ function We() {
325
480
  if (typeof u.csv == "function") return u.csv();
326
481
  if (typeof u.csv == "string") return u.csv;
327
- let e = j.value;
482
+ let e = M.value;
328
483
  if (e.length === 0) return "";
329
- let t = N.value, n = [(e.length === 1 ? ["index", "value"] : ["index", ...e.map((e, t) => `series_${t}`)]).join(",")];
484
+ let t = P.value, n = [(e.length === 1 ? ["index", "value"] : ["index", ...e.map((e, t) => `series_${t}`)]).join(",")];
330
485
  for (let r = 0; r < t; r++) {
331
486
  let t = [r.toString()];
332
487
  for (let n of e) t.push(r < n.data.length ? String(n.data[r]) : "");
@@ -334,25 +489,25 @@ var ce = ["width", "height"], le = ["x"], U = [
334
489
  }
335
490
  return n.join("\n");
336
491
  }
337
- let Y = h(null), X = h(!1), Ce = h(null), we = t(() => !!u.tooltipData || !!u.tooltipTrigger), Te = t(() => {
338
- if (Y.value === null) return 0;
339
- let e = N.value, t = k.value / (e - 1 || 1);
340
- return O.value.left + Y.value * t;
341
- }), Ee = t(() => {
342
- let e = Y.value;
492
+ let Q = h(null), Ge = h(!1), Ke = h(null), qe = t(() => !!u.tooltipData || !!u.tooltipTrigger), Je = t(() => {
493
+ if (Q.value === null) return 0;
494
+ let e = P.value, t = A.value / (e - 1 || 1);
495
+ return k.value.left + Q.value * t;
496
+ }), Ye = t(() => {
497
+ let e = Q.value;
343
498
  if (e === null) return [];
344
- let { min: t, range: n } = P.value, r = A.value / n, i = O.value.top + A.value;
345
- return j.value.filter((t) => e < t.data.length && isFinite(t.data[e])).map((n) => ({
346
- x: Te.value,
499
+ let { min: t, range: n } = F.value, r = j.value / n, i = k.value.top + j.value;
500
+ return M.value.filter((t) => e < t.data.length && isFinite(t.data[e])).map((n) => ({
501
+ x: Je.value,
347
502
  y: i - (n.data[e] - t) * r,
348
503
  color: n.color ?? "currentColor"
349
504
  }));
350
- }), Z = t(() => {
351
- let e = Y.value;
505
+ }), $ = t(() => {
506
+ let e = Q.value;
352
507
  return e === null ? null : {
353
508
  index: e,
354
509
  xLabel: u.xLabels?.[e],
355
- values: j.value.map((t, n) => ({
510
+ values: M.value.map((t, n) => ({
356
511
  value: t.data[e],
357
512
  color: t.color ?? "currentColor",
358
513
  seriesIndex: n
@@ -360,68 +515,68 @@ var ce = ["width", "height"], le = ["x"], U = [
360
515
  data: u.tooltipData?.[e] ?? null
361
516
  };
362
517
  });
363
- function De(e) {
518
+ function Xe(e) {
364
519
  return "touches" in e ? e.touches[0] ?? null : e;
365
520
  }
366
- function Oe(e) {
521
+ function Ze(e) {
367
522
  let t = b.value?.getBoundingClientRect();
368
523
  if (!t) return null;
369
- let n = N.value;
524
+ let n = P.value;
370
525
  if (n <= 1) return null;
371
- let r = e - t.left, i = k.value / (n - 1 || 1), a = (r - O.value.left) / i;
526
+ let r = e - t.left, i = A.value / (n - 1 || 1), a = (r - k.value.left) / i;
372
527
  return Math.round(Math.max(0, Math.min(n - 1, a)));
373
528
  }
374
- function ke(e, t) {
375
- let n = Ce.value;
529
+ function Qe(e, t) {
530
+ let n = Ke.value;
376
531
  if (!n) return;
377
- let r = b.value.getBoundingClientRect(), i = X.value ? Se : 0, a = e - r.left, o = Math.max(0, t - r.top - i);
378
- n.style.left = `${a + 16}px`, n.style.top = `${o}px`;
532
+ let r = b.value.getBoundingClientRect(), { left: i, top: a } = ue(e, t - (Ge.value ? ze : 0), n.offsetWidth, n.offsetHeight, u.tooltipClamp, r);
533
+ n.style.left = `${i - r.left}px`, n.style.top = `${a - r.top}px`;
379
534
  }
380
- function Ae(e) {
381
- let t = De(e);
535
+ function $e(e) {
536
+ let t = Xe(e);
382
537
  if (!t) return;
383
- let n = Oe(t.clientX);
384
- n !== null && (Y.value = n, ke(t.clientX, t.clientY), y("hover", { index: n }));
538
+ let n = Ze(t.clientX);
539
+ n !== null && (Q.value = n, Qe(t.clientX, t.clientY), y("hover", { index: n }));
385
540
  }
386
- function je(e) {
387
- Ae(e);
541
+ function et(e) {
542
+ $e(e);
388
543
  }
389
- function Me() {
390
- u.tooltipTrigger !== "click" && (Y.value = null, y("hover", null));
544
+ function tt() {
545
+ u.tooltipTrigger !== "click" && (Q.value = null, y("hover", null));
391
546
  }
392
- function Ne(e) {
547
+ function nt(e) {
393
548
  if (u.tooltipTrigger !== "click") return;
394
- let t = De(e);
549
+ let t = Xe(e);
395
550
  if (!t) return;
396
- let n = Oe(t.clientX);
397
- n !== null && (Y.value = Y.value === n ? null : n, y("hover", Y.value === null ? null : { index: n }));
551
+ let n = Ze(t.clientX);
552
+ n !== null && (Q.value = Q.value === n ? null : n, y("hover", Q.value === null ? null : { index: n }));
398
553
  }
399
- function Pe(e) {
400
- X.value = !0, Ae(e);
554
+ function rt(e) {
555
+ Ge.value = !0, $e(e);
401
556
  }
402
- function Fe(e) {
403
- Ae(e);
557
+ function it(e) {
558
+ $e(e);
404
559
  }
405
- function Q() {
406
- X.value = !1, Y.value = null, y("hover", null);
560
+ function at() {
561
+ Ge.value = !1, Q.value = null, y("hover", null);
407
562
  }
408
- let $ = t(() => u.downloadLink ? typeof u.downloadLink == "string" ? u.downloadLink : "Download data (CSV)" : null), Ie = t(() => u.downloadLink ? `data:text/csv;charset=utf-8,${encodeURIComponent(J())}` : null), Le = t(() => {
409
- let e = B(), t = [{
563
+ let ot = t(() => u.downloadLink ? typeof u.downloadLink == "string" ? u.downloadLink : "Download data (CSV)" : null), st = t(() => u.downloadLink ? `data:text/csv;charset=utf-8,${encodeURIComponent(We())}` : null), ct = t(() => {
564
+ let e = He(), t = [{
410
565
  label: "Save as SVG",
411
566
  action: () => {
412
- let t = V();
413
- t && oe(t, e);
567
+ let t = Ue();
568
+ t && ce(t, e);
414
569
  }
415
570
  }, {
416
571
  label: "Save as PNG",
417
572
  action: () => {
418
- let t = V();
419
- t && se(t, e);
573
+ let t = Ue();
574
+ t && le(t, e);
420
575
  }
421
576
  }];
422
577
  return u.downloadLink || t.push({
423
578
  label: "Download CSV",
424
- action: () => H(J(), e)
579
+ action: () => B(We(), e)
425
580
  }), t;
426
581
  });
427
582
  return (t, c) => (m(), i("div", {
@@ -429,15 +584,15 @@ var ce = ["width", "height"], le = ["x"], U = [
429
584
  ref: b,
430
585
  class: "line-chart-wrapper"
431
586
  }, [
432
- s.menu ? (m(), n(ae, {
587
+ s.menu ? (m(), n(se, {
433
588
  key: 0,
434
- items: Le.value
589
+ items: ct.value
435
590
  }, null, 8, ["items"])) : r("", !0),
436
591
  (m(), i("svg", {
437
592
  ref_key: "svgRef",
438
593
  ref: x,
439
594
  width: E.value,
440
- height: D.value
595
+ height: oe.value
441
596
  }, [
442
597
  s.title ? (m(), i("text", {
443
598
  key: 0,
@@ -447,85 +602,109 @@ var ce = ["width", "height"], le = ["x"], U = [
447
602
  "font-size": "14",
448
603
  "font-weight": "600",
449
604
  fill: "currentColor"
450
- }, v(s.title), 9, le)) : r("", !0),
605
+ }, v(s.title), 9, de)) : r("", !0),
606
+ I.value.length > 0 ? (m(), i("g", fe, [(m(!0), i(e, null, g(I.value, (t, n) => (m(), i(e, { key: "ileg" + n }, [t.type === "series" ? (m(), i("line", {
607
+ key: 0,
608
+ x1: k.value.left + n * 120,
609
+ y1: k.value.top - X / 2,
610
+ x2: k.value.left + n * 120 + 12,
611
+ y2: k.value.top - X / 2,
612
+ stroke: t.color,
613
+ "stroke-width": "2",
614
+ "stroke-dasharray": t.dashed ? "4 2" : void 0
615
+ }, null, 8, W)) : (m(), i("circle", {
616
+ key: 1,
617
+ cx: k.value.left + n * 120 + 4,
618
+ cy: k.value.top - X / 2,
619
+ r: "4",
620
+ fill: t.color,
621
+ "fill-opacity": t.fillOpacity,
622
+ stroke: t.color,
623
+ "stroke-width": "1.5"
624
+ }, null, 8, G)), a("text", {
625
+ x: k.value.left + n * 120 + 18,
626
+ y: k.value.top - X / 2 + 4,
627
+ "font-size": "11",
628
+ fill: "currentColor"
629
+ }, v(t.label), 9, pe)], 64))), 128))])) : r("", !0),
451
630
  a("line", {
452
- x1: I(O.value.left),
453
- y1: I(O.value.top),
454
- x2: I(O.value.left),
455
- y2: I(O.value.top + A.value),
631
+ x1: z(k.value.left),
632
+ y1: z(k.value.top),
633
+ x2: z(k.value.left),
634
+ y2: z(k.value.top + j.value),
456
635
  stroke: "currentColor",
457
636
  "stroke-opacity": "0.3"
458
- }, null, 8, U),
637
+ }, null, 8, me),
459
638
  a("line", {
460
- x1: I(O.value.left),
461
- y1: I(O.value.top + A.value),
462
- x2: I(O.value.left + k.value),
463
- y2: I(O.value.top + A.value),
639
+ x1: z(k.value.left),
640
+ y1: z(k.value.top + j.value),
641
+ x2: z(k.value.left + A.value),
642
+ y2: z(k.value.top + j.value),
464
643
  stroke: "currentColor",
465
644
  "stroke-opacity": "0.3"
466
- }, null, 8, ue),
467
- s.yGrid ? (m(!0), i(e, { key: 1 }, g(R.value, (e, t) => (m(), i("line", {
645
+ }, null, 8, he),
646
+ s.yGrid ? (m(!0), i(e, { key: 2 }, g(Be.value, (e, t) => (m(), i("line", {
468
647
  key: "yg" + t,
469
- x1: O.value.left,
648
+ x1: k.value.left,
470
649
  y1: e.y,
471
- x2: O.value.left + k.value,
650
+ x2: k.value.left + A.value,
472
651
  y2: e.y,
473
652
  stroke: "currentColor",
474
653
  "stroke-opacity": "0.1"
475
- }, null, 8, de))), 128)) : r("", !0),
476
- s.xGrid ? (m(!0), i(e, { key: 2 }, g(z.value, (e, t) => (m(), i("line", {
654
+ }, null, 8, ge))), 128)) : r("", !0),
655
+ s.xGrid ? (m(!0), i(e, { key: 3 }, g(Ve.value, (e, t) => (m(), i("line", {
477
656
  key: "xg" + t,
478
657
  x1: e.x,
479
- y1: O.value.top,
658
+ y1: k.value.top,
480
659
  x2: e.x,
481
- y2: O.value.top + A.value,
660
+ y2: k.value.top + j.value,
482
661
  stroke: "currentColor",
483
662
  "stroke-opacity": "0.1"
484
- }, null, 8, W))), 128)) : r("", !0),
485
- (m(!0), i(e, null, g(R.value, (e, t) => (m(), i("text", {
663
+ }, null, 8, _e))), 128)) : r("", !0),
664
+ (m(!0), i(e, null, g(Be.value, (e, t) => (m(), i("text", {
486
665
  key: "y" + t,
487
- x: O.value.left - 6,
666
+ x: k.value.left - 6,
488
667
  y: e.y,
489
668
  "text-anchor": "end",
490
669
  "dominant-baseline": "middle",
491
670
  "font-size": "10",
492
671
  fill: "currentColor",
493
672
  "fill-opacity": "0.6"
494
- }, v(e.value), 9, G))), 128)),
673
+ }, v(e.value), 9, ve))), 128)),
495
674
  s.yLabel ? (m(), i("text", {
496
- key: 3,
675
+ key: 4,
497
676
  x: 0,
498
677
  y: 0,
499
- transform: `translate(14, ${O.value.top + A.value / 2}) rotate(-90)`,
678
+ transform: `translate(14, ${k.value.top + j.value / 2}) rotate(-90)`,
500
679
  "text-anchor": "middle",
501
680
  "font-size": "13",
502
681
  fill: "currentColor"
503
- }, v(s.yLabel), 9, fe)) : r("", !0),
504
- (m(!0), i(e, null, g(z.value, (e, t) => (m(), i("text", {
682
+ }, v(s.yLabel), 9, ye)) : r("", !0),
683
+ (m(!0), i(e, null, g(Ve.value, (e, t) => (m(), i("text", {
505
684
  key: "x" + t,
506
685
  x: e.x,
507
- y: O.value.top + A.value + 16,
686
+ y: k.value.top + j.value + 16,
508
687
  "text-anchor": "middle",
509
688
  "font-size": "10",
510
689
  fill: "currentColor",
511
690
  "fill-opacity": "0.6"
512
- }, v(e.value), 9, pe))), 128)),
691
+ }, v(e.value), 9, K))), 128)),
513
692
  s.xLabel ? (m(), i("text", {
514
- key: 4,
515
- x: O.value.left + k.value / 2,
693
+ key: 5,
694
+ x: k.value.left + A.value / 2,
516
695
  y: D.value - 4,
517
696
  "text-anchor": "middle",
518
697
  "font-size": "13",
519
698
  fill: "currentColor"
520
- }, v(s.xLabel), 9, me)) : r("", !0),
521
- (m(!0), i(e, null, g(M.value, (e, t) => (m(), i("path", {
699
+ }, v(s.xLabel), 9, q)) : r("", !0),
700
+ (m(!0), i(e, null, g(N.value, (e, t) => (m(), i("path", {
522
701
  key: "area" + t,
523
702
  d: re(e.upper, e.lower),
524
703
  fill: e.color ?? "currentColor",
525
704
  "fill-opacity": e.opacity ?? .2,
526
705
  stroke: "none"
527
- }, null, 8, he))), 128)),
528
- (m(!0), i(e, null, g(j.value, (t, n) => (m(), i(e, { key: n }, [t.line === !1 ? r("", !0) : (m(), i("path", {
706
+ }, null, 8, be))), 128)),
707
+ (m(!0), i(e, null, g(M.value, (t, n) => (m(), i(e, { key: n }, [t.line === !1 ? r("", !0) : (m(), i("path", {
529
708
  key: 0,
530
709
  d: te(t.data),
531
710
  fill: "none",
@@ -533,7 +712,7 @@ var ce = ["width", "height"], le = ["x"], U = [
533
712
  "stroke-width": t.strokeWidth ?? 1.5,
534
713
  "stroke-opacity": t.lineOpacity ?? t.opacity ?? s.lineOpacity,
535
714
  "stroke-dasharray": t.dashed ? "6 3" : void 0
536
- }, null, 8, ge)), t.dots ? (m(!0), i(e, { key: 1 }, g(ne(t.data), (e, n) => (m(), i("circle", {
715
+ }, null, 8, xe)), t.dots ? (m(!0), i(e, { key: 1 }, g(ne(t.data), (e, n) => (m(), i("circle", {
537
716
  key: n,
538
717
  cx: e.x,
539
718
  cy: e.y,
@@ -541,19 +720,68 @@ var ce = ["width", "height"], le = ["x"], U = [
541
720
  fill: t.dotFill ?? t.color ?? "currentColor",
542
721
  "fill-opacity": t.dotOpacity ?? t.opacity ?? s.lineOpacity,
543
722
  stroke: t.dotStroke ?? "none"
544
- }, null, 8, _e))), 128)) : r("", !0)], 64))), 128)),
545
- we.value && Y.value !== null ? (m(), i("line", {
546
- key: 5,
547
- x1: I(Te.value),
548
- y1: O.value.top,
549
- x2: I(Te.value),
550
- y2: O.value.top + A.value,
723
+ }, null, 8, Se))), 128)) : r("", !0)], 64))), 128)),
724
+ (m(!0), i(e, null, g(s.areaSections ?? [], (t, n) => (m(), i(e, { key: "areasec" + n }, [
725
+ a("path", {
726
+ d: ie(t),
727
+ fill: t.color ?? (t.seriesIndex == null ? "#999" : M.value[t.seriesIndex]?.color ?? "currentColor"),
728
+ "fill-opacity": t.opacity ?? .15,
729
+ stroke: "none"
730
+ }, null, 8, Ce),
731
+ t.seriesIndex == null ? r("", !0) : (m(), i("path", {
732
+ key: 0,
733
+ d: ie(t, !1),
734
+ fill: "none",
735
+ stroke: t.color ?? M.value[t.seriesIndex]?.color ?? "currentColor",
736
+ "stroke-width": t.strokeWidth ?? 2,
737
+ "stroke-dasharray": t.dashed ? "6 3" : void 0
738
+ }, null, 8, we)),
739
+ t.seriesIndex == null ? (m(), i(e, { key: 1 }, [a("line", {
740
+ x1: z(k.value.left + t.startIndex * (A.value / (P.value - 1 || 1))),
741
+ y1: k.value.top,
742
+ x2: z(k.value.left + t.startIndex * (A.value / (P.value - 1 || 1))),
743
+ y2: k.value.top + j.value,
744
+ stroke: t.color ?? "#999",
745
+ "stroke-width": t.strokeWidth ?? 2,
746
+ "stroke-dasharray": t.dashed ? "6 3" : void 0
747
+ }, null, 8, Te), a("line", {
748
+ x1: z(k.value.left + t.endIndex * (A.value / (P.value - 1 || 1))),
749
+ y1: k.value.top,
750
+ x2: z(k.value.left + t.endIndex * (A.value / (P.value - 1 || 1))),
751
+ y2: k.value.top + j.value,
752
+ stroke: t.color ?? "#999",
753
+ "stroke-width": t.strokeWidth ?? 2,
754
+ "stroke-dasharray": t.dashed ? "6 3" : void 0
755
+ }, null, 8, J)], 64)) : r("", !0),
756
+ a("line", {
757
+ x1: z(k.value.left + t.startIndex * (A.value / (P.value - 1 || 1))),
758
+ y1: k.value.top + j.value - 4,
759
+ x2: z(k.value.left + t.startIndex * (A.value / (P.value - 1 || 1))),
760
+ y2: k.value.top + j.value + 4,
761
+ stroke: "currentColor",
762
+ "stroke-opacity": "0.4"
763
+ }, null, 8, Ee),
764
+ a("line", {
765
+ x1: z(k.value.left + t.endIndex * (A.value / (P.value - 1 || 1))),
766
+ y1: k.value.top + j.value - 4,
767
+ x2: z(k.value.left + t.endIndex * (A.value / (P.value - 1 || 1))),
768
+ y2: k.value.top + j.value + 4,
769
+ stroke: "currentColor",
770
+ "stroke-opacity": "0.4"
771
+ }, null, 8, De)
772
+ ], 64))), 128)),
773
+ qe.value && Q.value !== null ? (m(), i("line", {
774
+ key: 6,
775
+ x1: z(Je.value),
776
+ y1: k.value.top,
777
+ x2: z(Je.value),
778
+ y2: k.value.top + j.value,
551
779
  stroke: "currentColor",
552
780
  "stroke-opacity": "0.3",
553
781
  "stroke-dasharray": "4 2",
554
782
  "pointer-events": "none"
555
- }, null, 8, ve)) : r("", !0),
556
- (m(!0), i(e, null, g(Ee.value, (e, t) => (m(), i("circle", {
783
+ }, null, 8, Oe)) : r("", !0),
784
+ (m(!0), i(e, null, g(Ye.value, (e, t) => (m(), i("circle", {
557
785
  key: "hd" + t,
558
786
  cx: e.x,
559
787
  cy: e.y,
@@ -562,51 +790,78 @@ var ce = ["width", "height"], le = ["x"], U = [
562
790
  stroke: "var(--color-bg-0, #fff)",
563
791
  "stroke-width": "2",
564
792
  "pointer-events": "none"
565
- }, null, 8, K))), 128)),
566
- we.value ? (m(), i("rect", {
567
- key: 6,
568
- x: O.value.left,
569
- y: O.value.top,
570
- width: k.value,
571
- height: A.value,
793
+ }, null, 8, ke))), 128)),
794
+ qe.value ? (m(), i("rect", {
795
+ key: 7,
796
+ x: k.value.left,
797
+ y: k.value.top,
798
+ width: A.value,
799
+ height: j.value,
572
800
  fill: "transparent",
573
801
  style: {
574
802
  cursor: "crosshair",
575
803
  "touch-action": "none"
576
804
  },
577
- onMousemove: je,
578
- onMouseleave: Me,
579
- onClick: Ne,
580
- onTouchstart: w(Pe, ["prevent"]),
581
- onTouchmove: w(Fe, ["prevent"]),
582
- onTouchend: Q
583
- }, null, 40, q)) : r("", !0)
584
- ], 8, ce)),
585
- we.value && Y.value !== null && Z.value ? (m(), i("div", {
805
+ onMousemove: et,
806
+ onMouseleave: tt,
807
+ onClick: nt,
808
+ onTouchstart: w(rt, ["prevent"]),
809
+ onTouchmove: w(it, ["prevent"]),
810
+ onTouchend: at
811
+ }, null, 40, Ae)) : r("", !0),
812
+ (m(!0), i(e, null, g(ae.value.labels, (e, t) => (m(), i("g", { key: "seclab" + t }, [
813
+ a("circle", {
814
+ cx: e.cx - e.textWidth / 2 - 2,
815
+ cy: L.value + e.row * Z + 4,
816
+ r: "4",
817
+ fill: e.color,
818
+ "fill-opacity": e.fillOpacity,
819
+ stroke: e.color,
820
+ "stroke-width": "1.5"
821
+ }, null, 8, je),
822
+ e.labelText ? (m(), i("text", {
823
+ key: 0,
824
+ x: e.cx - e.textWidth / 2 + 8,
825
+ y: L.value + e.row * Z + 8,
826
+ "font-size": "11",
827
+ "font-weight": "600",
828
+ fill: e.color
829
+ }, v(e.labelText), 9, Me)) : r("", !0),
830
+ e.descText ? (m(), i("text", {
831
+ key: 1,
832
+ x: e.cx - e.textWidth / 2 + 8,
833
+ y: L.value + e.row * Z + 22,
834
+ "font-size": "11",
835
+ fill: "currentColor",
836
+ "fill-opacity": "0.6"
837
+ }, v(e.descText), 9, Y)) : r("", !0)
838
+ ]))), 128))
839
+ ], 8, U)),
840
+ qe.value && Q.value !== null && $.value ? (m(), i("div", {
586
841
  key: 1,
587
842
  ref_key: "tooltipRef",
588
- ref: Ce,
843
+ ref: Ke,
589
844
  class: "chart-tooltip-content",
590
845
  style: {
591
846
  position: "absolute",
592
847
  transform: "translateY(-50%)"
593
848
  }
594
- }, [_(t.$slots, "tooltip", d(l(Z.value)), () => [a("div", ye, [Z.value.xLabel ? (m(), i("div", be, v(Z.value.xLabel), 1)) : r("", !0), (m(!0), i(e, null, g(Z.value.values, (e) => (m(), i("div", {
849
+ }, [_(t.$slots, "tooltip", d(l($.value)), () => [a("div", Ne, [$.value.xLabel ? (m(), i("div", Pe, v($.value.xLabel), 1)) : r("", !0), (m(!0), i(e, null, g($.value.values, (e) => (m(), i("div", {
595
850
  key: e.seriesIndex,
596
851
  class: "line-chart-tooltip-row"
597
852
  }, [a("span", {
598
853
  class: "line-chart-tooltip-swatch",
599
854
  style: f({ background: e.color })
600
- }, null, 4), o(" " + v(isFinite(e.value) ? L(e.value) : "—"), 1)]))), 128))])], !0)], 512)) : r("", !0),
601
- $.value ? (m(), i("a", {
855
+ }, null, 4), o(" " + v(isFinite(e.value) ? H(e.value) : "—"), 1)]))), 128))])], !0)], 512)) : r("", !0),
856
+ ot.value ? (m(), i("a", {
602
857
  key: 2,
603
858
  class: "line-chart-download-link",
604
- href: Ie.value,
605
- download: `${B()}.csv`
606
- }, v($.value), 9, xe)) : r("", !0)
859
+ href: st.value,
860
+ download: `${He()}.csv`
861
+ }, v(ot.value), 9, Fe)) : r("", !0)
607
862
  ], 512));
608
863
  }
609
- }), [["__scopeId", "data-v-61fdeef2"]]), Y = {
864
+ }), [["__scopeId", "data-v-d1434a63"]]), Ve = {
610
865
  "01013": "010259",
611
866
  "01015": "010177",
612
867
  "01029": "010177",
@@ -3767,7 +4022,7 @@ var ce = ["width", "height"], le = ["x"], U = [
3767
4022
  51019: "510014",
3768
4023
  "02158": "020820",
3769
4024
  46102: "460957"
3770
- }, X = {
4025
+ }, He = {
3771
4026
  "010259": "Butler, AL",
3772
4027
  "010177": "Calhoun (Anniston), AL - Cleburne, AL",
3773
4028
  "010172": "Chambers, AL - Randolph, AL",
@@ -4717,25 +4972,25 @@ var ce = ["width", "height"], le = ["x"], U = [
4717
4972
  560775: "Teton, WY - Lincoln, WY",
4718
4973
  560792: "Uinta, WY",
4719
4974
  560804: "Weston, WY"
4720
- }, Ce = ["width", "height"], we = [
4975
+ }, Ue = ["width", "height"], We = [
4721
4976
  "data-feat-id",
4722
4977
  "d",
4723
4978
  "fill",
4724
4979
  "stroke",
4725
4980
  "stroke-width"
4726
- ], Te = { key: 0 }, Ee = ["d", "stroke"], Z = ["transform"], De = {
4981
+ ], Q = { key: 0 }, Ge = ["d", "stroke"], Ke = ["transform"], qe = {
4727
4982
  key: 0,
4728
4983
  y: 5,
4729
4984
  "font-size": "13",
4730
4985
  "font-weight": "600",
4731
4986
  fill: "currentColor"
4732
- }, Oe = ["x", "fill"], ke = ["x"], Ae = {
4987
+ }, Je = ["x", "fill"], Ye = ["x"], $ = {
4733
4988
  key: 0,
4734
4989
  y: 5,
4735
4990
  "font-size": "13",
4736
4991
  "font-weight": "600",
4737
4992
  fill: "currentColor"
4738
- }, je = ["offset", "stop-color"], Me = ["x", "fill"], Ne = ["x"], Pe = ["x"], Fe = /* @__PURE__ */ B(/* @__PURE__ */ c({
4993
+ }, Xe = ["offset", "stop-color"], Ze = ["x", "fill"], Qe = ["x"], $e = ["x"], et = /* @__PURE__ */ R(/* @__PURE__ */ c({
4739
4994
  __name: "ChoroplethMap",
4740
4995
  props: {
4741
4996
  topology: {},
@@ -4766,7 +5021,8 @@ var ce = ["width", "height"], le = ["x"], U = [
4766
5021
  default: !1
4767
5022
  },
4768
5023
  tooltipTrigger: {},
4769
- tooltipFormat: {}
5024
+ tooltipFormat: {},
5025
+ tooltipClamp: { default: "chart" }
4770
5026
  },
4771
5027
  emits: ["stateClick", "stateHover"],
4772
5028
  setup(o, { emit: s }) {
@@ -4774,11 +5030,11 @@ var ce = ["width", "height"], le = ["x"], U = [
4774
5030
  function A() {
4775
5031
  if (D) return;
4776
5032
  let e = b.value;
4777
- e && (e.addEventListener("click", Q), e.addEventListener("mouseover", Q), e.addEventListener("mousemove", $), e.addEventListener("mouseout", Ie));
5033
+ e && (e.addEventListener("click", J), e.addEventListener("mouseover", J), e.addEventListener("mousemove", Ee), e.addEventListener("mouseout", De));
4778
5034
  }
4779
5035
  function j() {
4780
5036
  let e = b.value;
4781
- e && (e.removeEventListener("click", Q), e.removeEventListener("mouseover", Q), e.removeEventListener("mousemove", $), e.removeEventListener("mouseout", Ie));
5037
+ e && (e.removeEventListener("click", J), e.removeEventListener("mouseover", J), e.removeEventListener("mousemove", Ee), e.removeEventListener("mouseout", De));
4782
5038
  }
4783
5039
  p(() => {
4784
5040
  f.value && (C.value = f.value.clientWidth, O = new ResizeObserver((e) => {
@@ -4786,13 +5042,13 @@ var ce = ["width", "height"], le = ["x"], U = [
4786
5042
  t && (C.value = t.contentRect.width);
4787
5043
  }), O.observe(f.value)), M(), A();
4788
5044
  }), ee(() => {
4789
- O?.disconnect(), N(), j(), Se();
5045
+ O?.disconnect(), N(), j(), Ce();
4790
5046
  });
4791
5047
  function M() {
4792
5048
  if (!_.value || !b.value || !c.zoom && !c.pan) return;
4793
- let e = re(_.value);
4794
- k = ne().scaleExtent(c.zoom ? [1, 12] : [1, 1]).on("start", () => {
4795
- E = !0, Fe();
5049
+ let e = ne(_.value);
5050
+ k = te().scaleExtent(c.zoom ? [1, 12] : [1, 1]).on("start", () => {
5051
+ E = !0, Te();
4796
5052
  }).on("zoom", (e) => {
4797
5053
  b.value && b.value.setAttribute("transform", e.transform);
4798
5054
  }).on("end", () => {
@@ -4800,50 +5056,50 @@ var ce = ["width", "height"], le = ["x"], U = [
4800
5056
  }), c.pan || k.filter((e) => e.type === "wheel" || e.type === "dblclick"), e.call(k);
4801
5057
  }
4802
5058
  function N() {
4803
- _.value && k && (re(_.value).on(".zoom", null), k = null);
5059
+ _.value && k && (ne(_.value).on(".zoom", null), k = null);
4804
5060
  }
4805
5061
  S(() => [c.zoom, c.pan], () => {
4806
5062
  N(), j(), M(), A();
4807
5063
  });
4808
- let L = t(() => c.width ?? (C.value || 600)), R = t(() => c.width && c.height ? c.height / c.width : .625), z = t(() => L.value * R.value), B = t(() => {
5064
+ let I = t(() => c.width ?? (C.value || 600)), oe = t(() => c.width && c.height ? c.height / c.width : .625), L = t(() => I.value * oe.value), R = t(() => {
4809
5065
  let e = y(c.topology), t = e.objects.counties.geometries, n = /* @__PURE__ */ new Map();
4810
5066
  for (let e of t) {
4811
- let t = Y[String(e.id).padStart(5, "0")];
5067
+ let t = Ve[String(e.id).padStart(5, "0")];
4812
5068
  t && (n.has(t) || n.set(t, []), n.get(t).push(e));
4813
5069
  }
4814
5070
  let r = [];
4815
5071
  for (let [t, i] of n) r.push({
4816
5072
  type: "Feature",
4817
5073
  id: t,
4818
- properties: { name: X[t] ?? t },
4819
- geometry: I(e, i)
5074
+ properties: { name: He[t] ?? t },
5075
+ geometry: ie(e, i)
4820
5076
  });
4821
5077
  return {
4822
5078
  type: "FeatureCollection",
4823
5079
  features: r
4824
5080
  };
4825
- }), V = t(() => {
4826
- if (c.geoType === "hsas") return B.value;
5081
+ }), z = t(() => {
5082
+ if (c.geoType === "hsas") return R.value;
4827
5083
  if (c.geoType === "counties") {
4828
5084
  let e = y(c.topology);
4829
- return F(e, e.objects.counties);
5085
+ return re(e, e.objects.counties);
4830
5086
  }
4831
5087
  let e = y(c.topology);
4832
- return F(e, e.objects.states);
4833
- }), H = t(() => {
5088
+ return re(e, e.objects.states);
5089
+ }), B = t(() => {
4834
5090
  if (c.geoType !== "counties" && c.geoType !== "hsas") return null;
4835
5091
  let e = y(c.topology);
4836
- return ie(e, e.objects.states, (e, t) => e !== t);
4837
- }), ce = t(() => P().fitExtent([[0, He.value], [L.value, z.value + He.value]], V.value)), le = t(() => te(ce.value)), U = t(() => c.geoType === "counties" || c.geoType === "hsas" ? c.strokeWidth * .5 : c.strokeWidth), ue = t(() => {
5092
+ return ae(e, e.objects.states, (e, t) => e !== t);
5093
+ }), V = t(() => P().fitExtent([[0, Y.value], [I.value, L.value + Y.value]], z.value)), H = t(() => F(V.value)), U = t(() => c.geoType === "counties" || c.geoType === "hsas" ? c.strokeWidth * .5 : c.strokeWidth), de = t(() => {
4838
5094
  let e = /* @__PURE__ */ new Map();
4839
5095
  if (!c.data) return e;
4840
5096
  for (let t of c.data) {
4841
5097
  e.set(t.id, t.value);
4842
- let n = V.value.features.find((e) => e.properties?.name === t.id);
5098
+ let n = z.value.features.find((e) => e.properties?.name === t.id);
4843
5099
  n?.id != null && e.set(String(n.id), t.value);
4844
5100
  }
4845
5101
  return e;
4846
- }), de = t(() => {
5102
+ }), fe = t(() => {
4847
5103
  if (!c.data || c.data.length === 0) return {
4848
5104
  min: 0,
4849
5105
  max: 1
@@ -4860,8 +5116,8 @@ var ce = ["width", "height"], le = ["x"], U = [
4860
5116
  min: 0,
4861
5117
  max: 1
4862
5118
  };
4863
- }), W = t(() => Array.isArray(c.colorScale) && c.colorScale.length > 0 && "value" in c.colorScale[0]), G = t(() => Array.isArray(c.colorScale) && !W.value), fe = t(() => G.value ? "" : c.colorScale?.min ?? "#e5f0fa"), pe = t(() => G.value ? "" : c.colorScale?.max ?? "#08519c");
4864
- function me(e) {
5119
+ }), W = t(() => Array.isArray(c.colorScale) && c.colorScale.length > 0 && "value" in c.colorScale[0]), G = t(() => Array.isArray(c.colorScale) && !W.value), pe = t(() => G.value ? "" : c.colorScale?.min ?? "#e5f0fa"), me = t(() => G.value ? "" : c.colorScale?.max ?? "#08519c");
5120
+ function he(e) {
4865
5121
  let t = e.replace("#", "");
4866
5122
  return [
4867
5123
  parseInt(t.slice(0, 2), 16),
@@ -4869,101 +5125,103 @@ var ce = ["width", "height"], le = ["x"], U = [
4869
5125
  parseInt(t.slice(4, 6), 16)
4870
5126
  ];
4871
5127
  }
4872
- function he(e) {
4873
- let [t, n, r] = me(fe.value), [i, a, o] = me(pe.value);
5128
+ function ge(e) {
5129
+ let [t, n, r] = he(pe.value), [i, a, o] = he(me.value);
4874
5130
  return `rgb(${Math.round(t + (i - t) * e)},${Math.round(n + (a - n) * e)},${Math.round(r + (o - r) * e)})`;
4875
5131
  }
4876
- function ge(e) {
5132
+ function _e(e) {
4877
5133
  let t = c.colorScale.slice().sort((e, t) => t.min - e.min);
4878
5134
  for (let n of t) if (e >= n.min) return n.color;
4879
5135
  return c.noDataColor;
4880
5136
  }
4881
- function _e(e) {
5137
+ function ve(e) {
4882
5138
  let t = c.colorScale.find((t) => t.value === String(e));
4883
5139
  return t ? t.color : c.noDataColor;
4884
5140
  }
4885
- function ve(e) {
4886
- let t = ue.value.get(String(e));
5141
+ function ye(e) {
5142
+ let t = de.value.get(String(e));
4887
5143
  if (t == null) return c.noDataColor;
4888
- if (W.value) return _e(t);
4889
- if (G.value) return ge(t);
4890
- let { min: n, max: r } = de.value;
4891
- return he((t - n) / (r - n));
5144
+ if (W.value) return ve(t);
5145
+ if (G.value) return _e(t);
5146
+ let { min: n, max: r } = fe.value;
5147
+ return ge((t - n) / (r - n));
4892
5148
  }
4893
5149
  function K(e) {
4894
5150
  return e.properties?.name ?? String(e.id);
4895
5151
  }
4896
5152
  function q(e) {
4897
- return ue.value.get(String(e.id));
5153
+ return de.value.get(String(e.id));
4898
5154
  }
4899
- let ye = t(() => {
5155
+ let be = t(() => {
4900
5156
  let e = /* @__PURE__ */ new Map();
4901
- for (let t of V.value.features) e.set(String(t.id), t);
5157
+ for (let t of z.value.features) e.set(String(t.id), t);
4902
5158
  return e;
4903
5159
  });
4904
- function be(e) {
5160
+ function xe(e) {
4905
5161
  let t = e;
4906
5162
  for (; t && !t.dataset?.featId;) t = t.parentElement;
4907
5163
  if (!t) return null;
4908
- let n = ye.value.get(t.dataset.featId);
5164
+ let n = be.value.get(t.dataset.featId);
4909
5165
  return n ? {
4910
5166
  pathEl: t,
4911
5167
  feat: n
4912
5168
  } : null;
4913
5169
  }
4914
- function xe(e, t, n) {
5170
+ function Se(e, t, n) {
4915
5171
  T || (T = document.createElement("div"), T.className = "chart-tooltip-content", T.style.position = "fixed", T.style.transform = "translateY(-50%)", document.body.appendChild(T));
4916
5172
  let r = K(e), i = q(e), a = {
4917
5173
  id: String(e.id),
4918
5174
  name: r,
4919
5175
  value: i
4920
5176
  };
4921
- c.tooltipFormat ? T.innerHTML = c.tooltipFormat(a) : T.textContent = i == null ? r : `${r}: ${i}`, T.style.left = `${t + 16}px`, T.style.top = `${n}px`;
5177
+ c.tooltipFormat ? T.innerHTML = c.tooltipFormat(a) : T.textContent = i == null ? r : `${r}: ${i}`;
5178
+ let o = f.value?.getBoundingClientRect(), { left: s, top: l } = ue(t, n, T.offsetWidth, T.offsetHeight, c.tooltipClamp, o);
5179
+ T.style.left = `${s}px`, T.style.top = `${l}px`;
4922
5180
  }
4923
- function Se() {
5181
+ function Ce() {
4924
5182
  T &&= (T.remove(), null);
4925
5183
  }
4926
- function J(e, t) {
5184
+ function we(e, t) {
4927
5185
  w && w !== e && (w.setAttribute("stroke-width", String(U.value)), w.setAttribute("stroke", c.strokeColor)), w = e, e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(U.value + 1)), e.setAttribute("stroke", "#555");
4928
5186
  }
4929
- function Fe() {
4930
- w && (w.setAttribute("stroke-width", String(U.value)), w.setAttribute("stroke", c.strokeColor), w = null, l("stateHover", null)), Se();
5187
+ function Te() {
5188
+ w && (w.setAttribute("stroke-width", String(U.value)), w.setAttribute("stroke", c.strokeColor), w = null, l("stateHover", null)), Ce();
4931
5189
  }
4932
- function Q(e) {
5190
+ function J(e) {
4933
5191
  if (E) return;
4934
- let t = e, n = be(t.target);
5192
+ let t = e, n = xe(t.target);
4935
5193
  n && (e.type === "click" ? l("stateClick", {
4936
5194
  id: String(n.feat.id),
4937
5195
  name: K(n.feat),
4938
5196
  value: q(n.feat)
4939
- }) : e.type === "mouseover" && (J(n.pathEl, n.feat), c.tooltipTrigger && xe(n.feat, t.clientX, t.clientY), l("stateHover", {
5197
+ }) : e.type === "mouseover" && (we(n.pathEl, n.feat), c.tooltipTrigger && Se(n.feat, t.clientX, t.clientY), l("stateHover", {
4940
5198
  id: String(n.feat.id),
4941
5199
  name: K(n.feat),
4942
5200
  value: q(n.feat)
4943
5201
  })));
4944
5202
  }
4945
- function $(e) {
5203
+ function Ee(e) {
4946
5204
  E || !T || (T.style.left = `${e.clientX + 16}px`, T.style.top = `${e.clientY}px`);
4947
5205
  }
4948
- function Ie(e) {
5206
+ function De(e) {
4949
5207
  let t = e.relatedTarget;
4950
- t && b.value?.contains(t) || Fe();
5208
+ t && b.value?.contains(t) || Te();
4951
5209
  }
4952
- function Le() {
5210
+ function Oe() {
4953
5211
  return typeof c.menu == "string" ? c.menu : "choropleth";
4954
5212
  }
4955
- let Re = t(() => c.legend && (W.value || G.value || c.data)), ze = t(() => c.colorScale.slice().sort((e, t) => e.min - t.min)), Be = t(() => c.title ? 24 : 0), Ve = t(() => Re.value ? 28 : 0), He = t(() => Be.value + Ve.value), Ue = t(() => z.value + He.value), We = t(() => Be.value + 18), Ge = t(() => {
5213
+ let ke = t(() => c.legend && (W.value || G.value || c.data)), Ae = t(() => c.colorScale.slice().sort((e, t) => e.min - t.min)), je = t(() => c.title ? 24 : 0), Me = t(() => ke.value ? 28 : 0), Y = t(() => je.value + Me.value), Ne = t(() => L.value + Y.value), Pe = t(() => je.value + 18), Fe = t(() => {
4956
5214
  let e = [];
4957
5215
  for (let t = 0; t <= 10; t++) {
4958
5216
  let n = t / 10;
4959
5217
  e.push({
4960
5218
  offset: `${(n * 100).toFixed(0)}%`,
4961
- color: he(n)
5219
+ color: ge(n)
4962
5220
  });
4963
5221
  }
4964
5222
  return e;
4965
- }), Ke = t(() => {
4966
- let { min: e, max: t } = de.value, n = t - e, r = [];
5223
+ }), X = t(() => {
5224
+ let { min: e, max: t } = fe.value, n = t - e, r = [];
4967
5225
  for (let t = 1; t <= 3; t++) {
4968
5226
  let i = t / 4, a = e + n * i, o = Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
4969
5227
  r.push({
@@ -4972,44 +5230,44 @@ var ce = ["width", "height"], le = ["x"], U = [
4972
5230
  });
4973
5231
  }
4974
5232
  return r;
4975
- }), qe = t(() => {
5233
+ }), Z = t(() => {
4976
5234
  let e = [];
4977
5235
  if (W.value) for (let t of c.colorScale) e.push({
4978
5236
  key: t.value,
4979
5237
  color: t.color,
4980
5238
  label: t.value
4981
5239
  });
4982
- else if (G.value) for (let t of ze.value) e.push({
5240
+ else if (G.value) for (let t of Ae.value) e.push({
4983
5241
  key: String(t.min),
4984
5242
  color: t.color,
4985
5243
  label: t.label ?? String(t.min)
4986
5244
  });
4987
5245
  return e;
4988
- }), Je = t(() => {
5246
+ }), Ie = t(() => {
4989
5247
  let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
4990
- for (let t of qe.value) e += 16 + t.label.length * 7 + 12;
4991
- return e - (qe.value.length > 0 ? 12 : 0);
4992
- }), Ye = t(() => {
5248
+ for (let t of Z.value) e += 16 + t.label.length * 7 + 12;
5249
+ return e - (Z.value.length > 0 ? 12 : 0);
5250
+ }), Le = t(() => {
4993
5251
  let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
4994
- return qe.value.map((t) => {
5252
+ return Z.value.map((t) => {
4995
5253
  let n = e;
4996
5254
  return e += 16 + t.label.length * 7 + 12, n;
4997
5255
  });
4998
- }), Xe = t(() => {
4999
- if (W.value || G.value) return (L.value - Je.value) / 2;
5256
+ }), Re = t(() => {
5257
+ if (W.value || G.value) return (I.value - Ie.value) / 2;
5000
5258
  let e = c.legendTitle ? c.legendTitle.length * 8 + 12 : 0;
5001
- return (L.value - e - 160) / 2;
5002
- }), Ze = t(() => {
5003
- let e = Le();
5259
+ return (I.value - e - 160) / 2;
5260
+ }), ze = t(() => {
5261
+ let e = Oe();
5004
5262
  return [{
5005
5263
  label: "Save as SVG",
5006
5264
  action: () => {
5007
- _.value && oe(_.value, e);
5265
+ _.value && ce(_.value, e);
5008
5266
  }
5009
5267
  }, {
5010
5268
  label: "Save as PNG",
5011
5269
  action: () => {
5012
- _.value && se(_.value, e);
5270
+ _.value && le(_.value, e);
5013
5271
  }
5014
5272
  }];
5015
5273
  });
@@ -5017,64 +5275,64 @@ var ce = ["width", "height"], le = ["x"], U = [
5017
5275
  ref_key: "containerRef",
5018
5276
  ref: f,
5019
5277
  class: u(["choropleth-wrapper", { pannable: o.pan }])
5020
- }, [o.menu ? (m(), n(ae, {
5278
+ }, [o.menu ? (m(), n(se, {
5021
5279
  key: 0,
5022
- items: Ze.value
5280
+ items: ze.value
5023
5281
  }, null, 8, ["items"])) : r("", !0), (m(), i("svg", {
5024
5282
  ref_key: "svgRef",
5025
5283
  ref: _,
5026
- width: L.value,
5027
- height: Ue.value
5284
+ width: I.value,
5285
+ height: Ne.value
5028
5286
  }, [
5029
5287
  a("g", {
5030
5288
  ref_key: "mapGroupRef",
5031
5289
  ref: b
5032
- }, [(m(!0), i(e, null, g(V.value.features, (e) => (m(), i("path", {
5290
+ }, [(m(!0), i(e, null, g(z.value.features, (e) => (m(), i("path", {
5033
5291
  key: String(e.id),
5034
5292
  "data-feat-id": String(e.id),
5035
- d: le.value(e) ?? void 0,
5036
- fill: ve(e.id),
5293
+ d: H.value(e) ?? void 0,
5294
+ fill: ye(e.id),
5037
5295
  stroke: o.strokeColor,
5038
5296
  "stroke-width": U.value,
5039
5297
  class: "state-path"
5040
- }, [o.tooltipTrigger ? r("", !0) : (m(), i("title", Te, v(K(e)) + v(q(e) == null ? "" : `: ${q(e)}`), 1))], 8, we))), 128)), H.value ? (m(), i("path", {
5298
+ }, [o.tooltipTrigger ? r("", !0) : (m(), i("title", Q, v(K(e)) + v(q(e) == null ? "" : `: ${q(e)}`), 1))], 8, We))), 128)), B.value ? (m(), i("path", {
5041
5299
  key: 0,
5042
- d: le.value(H.value) ?? void 0,
5300
+ d: H.value(B.value) ?? void 0,
5043
5301
  fill: "none",
5044
5302
  stroke: o.strokeColor,
5045
5303
  "stroke-width": 1,
5046
5304
  "stroke-linejoin": "round",
5047
5305
  "pointer-events": "none"
5048
- }, null, 8, Ee)) : r("", !0)], 512),
5049
- Re.value ? (m(), i("g", {
5306
+ }, null, 8, Ge)) : r("", !0)], 512),
5307
+ ke.value ? (m(), i("g", {
5050
5308
  key: 0,
5051
5309
  class: "choropleth-legend",
5052
- transform: `translate(${Xe.value},${We.value})`
5053
- }, [W.value || G.value ? (m(), i(e, { key: 0 }, [o.legendTitle ? (m(), i("text", De, v(o.legendTitle), 1)) : r("", !0), (m(!0), i(e, null, g(qe.value, (t, n) => (m(), i(e, { key: t.key }, [a("rect", {
5054
- x: Ye.value[n],
5310
+ transform: `translate(${Re.value},${Pe.value})`
5311
+ }, [W.value || G.value ? (m(), i(e, { key: 0 }, [o.legendTitle ? (m(), i("text", qe, v(o.legendTitle), 1)) : r("", !0), (m(!0), i(e, null, g(Z.value, (t, n) => (m(), i(e, { key: t.key }, [a("rect", {
5312
+ x: Le.value[n],
5055
5313
  y: -5,
5056
5314
  width: "12",
5057
5315
  height: "12",
5058
5316
  rx: "3",
5059
5317
  fill: t.color
5060
- }, null, 8, Oe), a("text", {
5061
- x: Ye.value[n] + 16,
5318
+ }, null, 8, Je), a("text", {
5319
+ x: Le.value[n] + 16,
5062
5320
  y: 5,
5063
5321
  "font-size": "13",
5064
5322
  fill: "currentColor"
5065
- }, v(t.label), 9, ke)], 64))), 128))], 64)) : (m(), i(e, { key: 1 }, [
5066
- o.legendTitle ? (m(), i("text", Ae, v(o.legendTitle), 1)) : r("", !0),
5323
+ }, v(t.label), 9, Ye)], 64))), 128))], 64)) : (m(), i(e, { key: 1 }, [
5324
+ o.legendTitle ? (m(), i("text", $, v(o.legendTitle), 1)) : r("", !0),
5067
5325
  a("defs", null, [a("linearGradient", {
5068
5326
  id: d,
5069
5327
  x1: "0",
5070
5328
  x2: "1",
5071
5329
  y1: "0",
5072
5330
  y2: "0"
5073
- }, [(m(!0), i(e, null, g(Ge.value, (e) => (m(), i("stop", {
5331
+ }, [(m(!0), i(e, null, g(Fe.value, (e) => (m(), i("stop", {
5074
5332
  key: e.offset,
5075
5333
  offset: e.offset,
5076
5334
  "stop-color": e.color
5077
- }, null, 8, je))), 128))])]),
5335
+ }, null, 8, Xe))), 128))])]),
5078
5336
  a("rect", {
5079
5337
  x: o.legendTitle ? o.legendTitle.length * 8 + 12 : 0,
5080
5338
  y: -6,
@@ -5082,8 +5340,8 @@ var ce = ["width", "height"], le = ["x"], U = [
5082
5340
  height: 12,
5083
5341
  rx: "2",
5084
5342
  fill: `url(#${d})`
5085
- }, null, 8, Me),
5086
- (m(!0), i(e, null, g(Ke.value, (e) => (m(), i("text", {
5343
+ }, null, 8, Ze),
5344
+ (m(!0), i(e, null, g(X.value, (e) => (m(), i("text", {
5087
5345
  key: e.value,
5088
5346
  x: (o.legendTitle ? o.legendTitle.length * 8 + 12 : 0) + e.pct / 100 * 160,
5089
5347
  y: 20,
@@ -5091,20 +5349,20 @@ var ce = ["width", "height"], le = ["x"], U = [
5091
5349
  fill: "currentColor",
5092
5350
  opacity: "0.7",
5093
5351
  "text-anchor": "middle"
5094
- }, v(e.value), 9, Ne))), 128))
5095
- ], 64))], 8, Z)) : r("", !0),
5352
+ }, v(e.value), 9, Qe))), 128))
5353
+ ], 64))], 8, Ke)) : r("", !0),
5096
5354
  o.title ? (m(), i("text", {
5097
5355
  key: 1,
5098
- x: L.value / 2,
5356
+ x: I.value / 2,
5099
5357
  y: 18,
5100
5358
  "text-anchor": "middle",
5101
5359
  "font-size": "14",
5102
5360
  "font-weight": "600",
5103
5361
  fill: "currentColor"
5104
- }, v(o.title), 9, Pe)) : r("", !0)
5105
- ], 8, Ce))], 2));
5362
+ }, v(o.title), 9, $e)) : r("", !0)
5363
+ ], 8, Ue))], 2));
5106
5364
  }
5107
- }), [["__scopeId", "data-v-ffaf1671"]]), Q = /* @__PURE__ */ B(/* @__PURE__ */ c({
5365
+ }), [["__scopeId", "data-v-25a20d5b"]]), tt = /* @__PURE__ */ R(/* @__PURE__ */ c({
5108
5366
  __name: "ChartTooltip",
5109
5367
  props: {
5110
5368
  x: {},
@@ -5155,7 +5413,7 @@ var ce = ["width", "height"], le = ["x"], U = [
5155
5413
  _: 3
5156
5414
  }, 8, ["open"])) : r("", !0);
5157
5415
  }
5158
- }), [["__scopeId", "data-v-44377f70"]]), $ = { class: "TableWrapper" }, Ie = { class: "Table" }, Le = ["href", "download"], Re = /* @__PURE__ */ B(/* @__PURE__ */ c({
5416
+ }), [["__scopeId", "data-v-44377f70"]]), nt = { class: "TableWrapper" }, rt = { class: "Table" }, it = ["href", "download"], at = /* @__PURE__ */ R(/* @__PURE__ */ c({
5159
5417
  __name: "DataTable",
5160
5418
  props: {
5161
5419
  data: {},
@@ -5233,14 +5491,14 @@ var ce = ["width", "height"], le = ["x"], U = [
5233
5491
  }
5234
5492
  let C = t(() => c.downloadLink ? [] : [{
5235
5493
  label: "Download CSV",
5236
- action: () => H(S(), b())
5494
+ action: () => B(S(), b())
5237
5495
  }]), w = t(() => c.downloadLink ? typeof c.downloadLink == "string" ? c.downloadLink : "Download data (CSV)" : null), T = t(() => c.downloadLink ? `data:text/csv;charset=utf-8,${encodeURIComponent(S())}` : null), E = t(() => c.menu && C.value.length > 0);
5238
5496
  return (t, s) => (m(), i("div", { class: u(["TableOuter", { "has-menu": E.value }]) }, [
5239
- E.value ? (m(), n(ae, {
5497
+ E.value ? (m(), n(se, {
5240
5498
  key: 0,
5241
5499
  items: C.value
5242
5500
  }, null, 8, ["items"])) : r("", !0),
5243
- a("div", $, [a("table", Ie, [
5501
+ a("div", nt, [a("table", rt, [
5244
5502
  a("colgroup", null, [(m(!0), i(e, null, g(h.value, (e) => (m(), i("col", {
5245
5503
  key: e.name,
5246
5504
  style: f(d(e.name))
@@ -5260,9 +5518,9 @@ var ce = ["width", "height"], le = ["x"], U = [
5260
5518
  class: "data-table-download-link",
5261
5519
  href: T.value,
5262
5520
  download: `${b()}.csv`
5263
- }, v(w.value), 9, Le)) : r("", !0)
5521
+ }, v(w.value), 9, it)) : r("", !0)
5264
5522
  ], 2));
5265
5523
  }
5266
5524
  }), [["__scopeId", "data-v-505e2187"]]);
5267
5525
  //#endregion
5268
- export { Q as ChartTooltip, Fe as ChoroplethMap, Re as DataTable, J as LineChart };
5526
+ export { tt as ChartTooltip, et as ChoroplethMap, at as DataTable, Be as LineChart };