vue-chrts 2.1.3 → 2.1.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.
@@ -152,7 +152,7 @@ export interface AreaChartProps<T> {
152
152
  /**
153
153
  * Crosshair configuration object for customizing the appearance of the crosshair line.
154
154
  */
155
- crosshairConfig?: CrosshairConfig;
155
+ crosshairConfig?: CrosshairConfig<T>;
156
156
  /**
157
157
  * Axis configuration object for customizing the appearance of the axes.
158
158
  */
@@ -1,13 +1,13 @@
1
- import { defineComponent as I, useSlots as K, useTemplateRef as q, ref as J, getCurrentInstance as Q, computed as u, createElementBlock as y, openBlock as l, normalizeClass as Z, normalizeStyle as T, createVNode as m, createCommentVNode as d, createElementVNode as _, unref as i, withCtx as ee, createBlock as c, Fragment as C, renderList as oe, mergeProps as g, renderSlot as D } from "vue";
2
- import { Position as $, CurveType as k } from "@unovis/ts";
3
- import { createScopedMarkers as te } from "../../utils.js";
4
- import ie from "../Tooltip.js";
5
- import { VisXYContainer as re, VisTooltip as ne, VisArea as B, VisLine as O, VisAxis as w, VisCrosshair as ae, VisBulletLegend as le } from "@unovis/vue";
6
- import { LegendPosition as se } from "../../enums.js";
7
- const ue = ["id"], de = {
1
+ import { defineComponent as I, useSlots as K, useTemplateRef as q, ref as J, getCurrentInstance as Q, computed as u, openBlock as c, createElementBlock as f, normalizeClass as Z, normalizeStyle as C, createVNode as g, unref as n, withCtx as _, createBlock as y, createCommentVNode as d, Fragment as p, renderList as ee, mergeProps as v, createElementVNode as te, renderSlot as D } from "vue";
2
+ import { Position as $, CurveType as h } from "@unovis/ts";
3
+ import { createScopedMarkers as ie } from "../../utils.js";
4
+ import oe from "../Tooltip.js";
5
+ import { VisXYContainer as ne, VisTooltip as ae, VisArea as B, VisLine as O, VisAxis as w, VisCrosshair as re, VisBulletLegend as le } from "@unovis/vue";
6
+ import { LegendPosition as ce } from "../../enums.js";
7
+ const se = ["id"], ue = {
8
8
  ref: "slotWrapper",
9
9
  style: { display: "none" }
10
- }, F = 0.5, N = "#3b82f6", ke = /* @__PURE__ */ I({
10
+ }, F = 0.5, N = "#3b82f6", ve = /* @__PURE__ */ I({
11
11
  __name: "AreaChart",
12
12
  props: {
13
13
  data: {},
@@ -35,7 +35,7 @@ const ue = ["id"], de = {
35
35
  yExplicitTicks: {},
36
36
  hideLegend: { type: Boolean, default: !1 },
37
37
  hideTooltip: { type: Boolean },
38
- legendPosition: { default: se.BottomCenter },
38
+ legendPosition: { default: ce.BottomCenter },
39
39
  legendStyle: { default: void 0 },
40
40
  xDomainLine: { type: Boolean },
41
41
  yDomainLine: { type: Boolean },
@@ -59,75 +59,75 @@ const ue = ["id"], de = {
59
59
  }) }
60
60
  },
61
61
  emits: ["click"],
62
- setup(V, { emit: j }) {
62
+ setup(e, { emit: V }) {
63
63
  var b;
64
- const S = j, o = V, M = K(), A = q("slotWrapper"), p = J(), f = `area-${((b = Q()) == null ? void 0 : b.uid) ?? Math.random().toString(36).slice(2)}`, v = u(() => {
65
- const e = Object.values(o.categories).map(
66
- (t, n) => `var(--vis-color${n})`
64
+ const j = V, t = e, S = K(), A = q("slotWrapper"), m = J(), k = `area-${((b = Q()) == null ? void 0 : b.uid) ?? Math.random().toString(36).slice(2)}`, x = u(() => {
65
+ const i = Object.values(t.categories).map(
66
+ (o, r) => `var(--vis-color${r})`
67
67
  );
68
- return Object.values(o.categories).map(
69
- (t, n) => t.color ?? e[n]
68
+ return Object.values(t.categories).map(
69
+ (o, r) => o.color ?? i[r]
70
70
  );
71
- }), x = u(() => o.yNumTicks !== void 0 ? o.yNumTicks : Math.max(2, Object.keys(o.categories ?? {}).length)), E = u(() => {
72
- var e;
73
- return (e = o.markerConfig) != null && e.config ? te(o.markerConfig, f) : "";
71
+ }), M = u(() => t.yNumTicks !== void 0 ? t.yNumTicks : Math.max(2, Object.keys(t.categories ?? {}).length)), E = u(() => {
72
+ var i;
73
+ return (i = t.markerConfig) != null && i.config ? ie(t.markerConfig, k) : "";
74
74
  }), P = u(() => {
75
- var t;
76
- if (!((t = o.markerConfig) != null && t.config)) return {};
77
- const e = {};
78
- for (const n of Object.keys(o.markerConfig.config))
79
- e[`--vis-marker-${n}`] = `url("#${o.markerConfig.id}--${f}--${n}")`;
80
- return e;
81
- }), W = u(() => o.legendPosition.startsWith("top")), X = u(() => o.legendPosition.includes("left") ? "flex-start" : o.legendPosition.includes("right") ? "flex-end" : "center"), G = u(() => v.value.map((e, t) => {
82
- var a;
83
- const n = `gradient-${f}-${t}`, r = ((a = o.gradientStops) == null ? void 0 : a.map(
84
- (s) => `<stop offset="${s.offset}" stop-color="${e}" stop-opacity="${s.stopOpacity}" />`
75
+ var o;
76
+ if (!((o = t.markerConfig) != null && o.config)) return {};
77
+ const i = {};
78
+ for (const r of Object.keys(t.markerConfig.config))
79
+ i[`--vis-marker-${r}`] = `url("#${t.markerConfig.id}--${k}--${r}")`;
80
+ return i;
81
+ }), W = u(() => t.legendPosition.startsWith("top")), X = u(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center"), G = u(() => x.value.map((i, o) => {
82
+ var l;
83
+ const r = `gradient-${k}-${o}`, a = ((l = t.gradientStops) == null ? void 0 : l.map(
84
+ (s) => `<stop offset="${s.offset}" stop-color="${i}" stop-opacity="${s.stopOpacity}" />`
85
85
  ).join("")) ?? "";
86
86
  return `
87
- <linearGradient id="${n}" gradientTransform="rotate(90)">
88
- ${r}
89
- <stop offset="100%" stop-color="${e}" stop-opacity="0" />
87
+ <linearGradient id="${r}" gradientTransform="rotate(90)">
88
+ ${a}
89
+ <stop offset="100%" stop-color="${i}" stop-opacity="0" />
90
90
  </linearGradient>
91
91
  `;
92
92
  }).join(""));
93
- function Y(e) {
94
- var t;
93
+ function Y(i) {
94
+ var o;
95
95
  return {
96
- y: (n) => Number(n[e]),
97
- color: ((t = o.categories[e]) == null ? void 0 : t.color) ?? N
96
+ y: (r) => Number(r[i]),
97
+ color: ((o = t.categories[i]) == null ? void 0 : o.color) ?? N
98
98
  };
99
99
  }
100
- const z = u(() => Object.keys(o.categories).map(
101
- (e) => (t) => Number(t[e])
100
+ const z = u(() => Object.keys(t.categories).map(
101
+ (i) => (o) => Number(o[i])
102
102
  )), R = u(() => {
103
- const e = Object.keys(o.categories);
104
- return e.map((t, n) => (r) => {
105
- let a = 0;
106
- for (let s = 0; s <= n; s++)
107
- a += Number(r[e[s]]) || 0;
108
- return a;
103
+ const i = Object.keys(t.categories);
104
+ return i.map((o, r) => (a) => {
105
+ let l = 0;
106
+ for (let s = 0; s <= r; s++)
107
+ l += Number(a[i[s]]) || 0;
108
+ return l;
109
109
  });
110
- }), L = u(() => (e, t) => v.value[t] ?? N);
111
- function U(e) {
110
+ }), L = u(() => (i, o) => x.value[o] ?? N);
111
+ function U(i) {
112
112
  return typeof window > "u" ? "" : A.value ? A.value.innerHTML : "";
113
113
  }
114
- function H(e) {
115
- return p.value = e, U();
114
+ function H(i) {
115
+ return m.value = i, U();
116
116
  }
117
- return (e, t) => {
118
- var n;
119
- return l(), y("div", {
120
- style: T({
117
+ return (i, o) => {
118
+ var r;
119
+ return c(), f("div", {
120
+ style: C({
121
121
  display: "flex",
122
122
  flexDirection: W.value ? "column-reverse" : "column",
123
123
  gap: "var(--vis-legend-spacing)",
124
124
  ...P.value
125
125
  }),
126
126
  class: Z({ "stacked-area-chart": e.stacked }),
127
- id: (n = e.markerConfig) == null ? void 0 : n.id,
128
- onClick: t[0] || (t[0] = (r) => S("click", r, p.value))
127
+ id: (r = e.markerConfig) == null ? void 0 : r.id,
128
+ onClick: o[0] || (o[0] = (a) => j("click", a, m.value))
129
129
  }, [
130
- m(i(re), {
130
+ g(n(ne), {
131
131
  data: e.data,
132
132
  height: e.height,
133
133
  duration: e.duration,
@@ -136,50 +136,50 @@ const ue = ["id"], de = {
136
136
  "y-domain": e.yDomain,
137
137
  "x-domain": e.xDomain
138
138
  }, {
139
- default: ee(() => [
140
- e.hideTooltip ? d("", !0) : (l(), c(i(ne), {
139
+ default: _(() => [
140
+ e.hideTooltip ? d("", !0) : (c(), y(n(ae), {
141
141
  key: 0,
142
- "horizontal-placement": i($).Right,
143
- "vertical-placement": i($).Top,
144
- "follow-cursor": o.tooltip.followCursor,
145
- "show-delay": o.tooltip.showDelay,
146
- "hide-delay": o.tooltip.hideDelay
142
+ "horizontal-placement": n($).Right,
143
+ "vertical-placement": n($).Top,
144
+ "follow-cursor": t.tooltip.followCursor,
145
+ "show-delay": t.tooltip.showDelay,
146
+ "hide-delay": t.tooltip.hideDelay
147
147
  }, null, 8, ["horizontal-placement", "vertical-placement", "follow-cursor", "show-delay", "hide-delay"])),
148
- e.stacked ? (l(), y(C, { key: 1 }, [
149
- e.hideArea ? d("", !0) : (l(), c(i(B), {
148
+ e.stacked ? (c(), f(p, { key: 1 }, [
149
+ e.hideArea ? d("", !0) : (c(), y(n(B), {
150
150
  key: 0,
151
- x: (r, a) => a,
151
+ x: (a, l) => l,
152
152
  y: z.value,
153
153
  color: L.value,
154
154
  opacity: F,
155
- "curve-type": e.curveType ?? i(k).MonotoneX
155
+ "curve-type": e.curveType ?? n(h).MonotoneX
156
156
  }, null, 8, ["x", "y", "color", "curve-type"])),
157
- m(i(O), {
158
- x: (r, a) => a,
157
+ g(n(O), {
158
+ x: (a, l) => l,
159
159
  y: R.value,
160
160
  color: L.value,
161
- "curve-type": e.curveType ?? i(k).MonotoneX,
161
+ "curve-type": e.curveType ?? n(h).MonotoneX,
162
162
  "line-width": e.lineWidth
163
163
  }, null, 8, ["x", "y", "color", "curve-type", "line-width"])
164
- ], 64)) : (l(!0), y(C, { key: 2 }, oe(Object.keys(o.categories), (r, a) => (l(), y(C, { key: r }, [
165
- e.hideArea ? d("", !0) : (l(), c(i(B), g({
164
+ ], 64)) : (c(!0), f(p, { key: 2 }, ee(Object.keys(t.categories), (a, l) => (c(), f(p, { key: a }, [
165
+ e.hideArea ? d("", !0) : (c(), y(n(B), v({
166
166
  key: 0,
167
- x: (s, h) => h
168
- }, { ref_for: !0 }, Y(r), {
169
- color: `url(#gradient-${f}-${a})`,
167
+ x: (s, T) => T
168
+ }, { ref_for: !0 }, Y(a), {
169
+ color: `url(#gradient-${k}-${l})`,
170
170
  opacity: F,
171
- "curve-type": e.curveType ?? i(k).MonotoneX
171
+ "curve-type": e.curveType ?? n(h).MonotoneX
172
172
  }), null, 16, ["x", "color", "curve-type"])),
173
- m(i(O), {
174
- x: (s, h) => h,
175
- y: (s) => s[r],
176
- color: v.value[a],
177
- "curve-type": e.curveType ?? i(k).MonotoneX,
173
+ g(n(O), {
174
+ x: (s, T) => T,
175
+ y: (s) => s[a],
176
+ color: x.value[l],
177
+ "curve-type": e.curveType ?? n(h).MonotoneX,
178
178
  "line-width": e.lineWidth,
179
- lineDashArray: e.lineDashArray ? e.lineDashArray[a] : void 0
179
+ lineDashArray: e.lineDashArray ? e.lineDashArray[l] : void 0
180
180
  }, null, 8, ["x", "y", "color", "curve-type", "line-width", "lineDashArray"])
181
181
  ], 64))), 128)),
182
- e.hideXAxis ? d("", !0) : (l(), c(i(w), g({
182
+ e.hideXAxis ? d("", !0) : (c(), y(n(w), v({
183
183
  key: 3,
184
184
  type: "x",
185
185
  label: e.xLabel,
@@ -193,11 +193,11 @@ const ue = ["id"], de = {
193
193
  "min-max-ticks-only": e.minMaxTicksOnly,
194
194
  duration: e.duration
195
195
  }, e.xAxisConfig), null, 16, ["label", "num-ticks", "tick-format", "tick-values", "grid-line", "domain-line", "tick-line", "min-max-ticks-only", "duration"])),
196
- e.hideYAxis ? d("", !0) : (l(), c(i(w), g({
196
+ e.hideYAxis ? d("", !0) : (c(), y(n(w), v({
197
197
  key: 4,
198
198
  type: "y",
199
199
  label: e.yLabel,
200
- "num-ticks": x.value,
200
+ "num-ticks": M.value,
201
201
  "tick-format": e.yFormatter,
202
202
  "tick-values": e.yExplicitTicks,
203
203
  "grid-line": e.yGridLine,
@@ -205,46 +205,46 @@ const ue = ["id"], de = {
205
205
  "tick-line": e.yTickLine,
206
206
  duration: e.duration
207
207
  }, e.yAxisConfig), null, 16, ["label", "num-ticks", "tick-format", "tick-values", "grid-line", "domain-line", "tick-line", "duration"])),
208
- e.hideTooltip ? d("", !0) : (l(), c(i(ae), g({ key: 5 }, e.crosshairConfig, { template: H }), null, 16))
208
+ e.hideTooltip ? d("", !0) : (c(), y(n(re), v({ key: 5 }, e.crosshairConfig, { template: H }), null, 16))
209
209
  ]),
210
210
  _: 1
211
211
  }, 8, ["data", "height", "duration", "padding", "svg-defs", "y-domain", "x-domain"]),
212
- o.hideLegend ? d("", !0) : (l(), y("div", {
212
+ t.hideLegend ? d("", !0) : (c(), f("div", {
213
213
  key: 0,
214
- style: T({
214
+ style: C({
215
215
  display: "flex",
216
216
  justifyContent: X.value
217
217
  })
218
218
  }, [
219
- m(i(le), {
220
- style: T([
221
- o.legendStyle,
219
+ g(n(le), {
220
+ style: C([
221
+ t.legendStyle,
222
222
  "display: flex; gap: var(--vis-legend-spacing);"
223
223
  ]),
224
- items: Object.values(o.categories).map((r) => ({
225
- ...r,
226
- color: Array.isArray(r.color) ? r.color[0] : r.color
224
+ items: Object.values(t.categories).map((a) => ({
225
+ ...a,
226
+ color: Array.isArray(a.color) ? a.color[0] : a.color
227
227
  }))
228
228
  }, null, 8, ["style", "items"])
229
229
  ], 4)),
230
- _("div", de, [
231
- i(M).tooltip ? D(e.$slots, "tooltip", {
230
+ te("div", ue, [
231
+ n(S).tooltip ? D(i.$slots, "tooltip", {
232
232
  key: 0,
233
- values: p.value
234
- }) : p.value ? D(e.$slots, "fallback", { key: 1 }, () => [
235
- m(ie, {
236
- data: p.value,
233
+ values: m.value
234
+ }) : m.value ? D(i.$slots, "fallback", { key: 1 }, () => [
235
+ g(oe, {
236
+ data: m.value,
237
237
  followCursor: !1,
238
238
  categories: e.categories,
239
- "title-formatter": o.tooltipTitleFormatter,
240
- yFormatter: o.yFormatter
239
+ "title-formatter": t.tooltipTitleFormatter,
240
+ yFormatter: t.yFormatter
241
241
  }, null, 8, ["data", "categories", "title-formatter", "yFormatter"])
242
242
  ]) : d("", !0)
243
243
  ], 512)
244
- ], 14, ue);
244
+ ], 14, se);
245
245
  };
246
246
  }
247
247
  });
248
248
  export {
249
- ke as default
249
+ ve as default
250
250
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as W, useSlots as X, useTemplateRef as H, ref as Y, computed as f, createElementBlock as b, openBlock as l, normalizeStyle as v, createVNode as h, createCommentVNode as u, createElementVNode as j, unref as o, withCtx as $, createBlock as s, Fragment as q, renderList as I, mergeProps as T, renderSlot as P } from "vue";
2
- import { Orientation as p, StackedBar as U, GroupedBar as J } from "@unovis/ts";
1
+ import { defineComponent as W, useSlots as X, useTemplateRef as H, ref as Y, computed as k, openBlock as d, createElementBlock as v, normalizeStyle as h, createVNode as p, unref as a, withCtx as j, createBlock as s, createCommentVNode as c, Fragment as $, renderList as q, mergeProps as P, createElementVNode as I, renderSlot as F } from "vue";
2
+ import { Orientation as g, StackedBar as U, GroupedBar as J } from "@unovis/ts";
3
3
  import { useStackedGrouped as K } from "./stackedGroupedUtils.js";
4
- import { VisXYContainer as Q, VisXYLabels as Z, VisTooltip as _, VisStackedBar as F, VisGroupedBar as ee, VisAxis as G, VisBulletLegend as ae } from "@unovis/vue";
5
- import oe from "../Tooltip.js";
4
+ import { VisXYContainer as Q, VisXYLabels as Z, VisTooltip as _, VisStackedBar as G, VisGroupedBar as ee, VisAxis as V, VisBulletLegend as te } from "@unovis/vue";
5
+ import ae from "../Tooltip.js";
6
6
  import { LegendPosition as ie } from "../../enums.js";
7
- const re = {
7
+ const ne = {
8
8
  ref: "slotWrapper",
9
9
  style: { display: "none" }
10
- }, pe = /* @__PURE__ */ W({
10
+ }, ce = /* @__PURE__ */ W({
11
11
  __name: "BarChart",
12
12
  props: {
13
13
  data: {},
@@ -35,7 +35,7 @@ const re = {
35
35
  radius: {},
36
36
  hideLegend: { type: Boolean, default: !1 },
37
37
  hideTooltip: { type: Boolean, default: !1 },
38
- orientation: { default: p.Vertical },
38
+ orientation: { default: g.Vertical },
39
39
  legendPosition: { default: ie.BottomCenter },
40
40
  legendStyle: { default: void 0 },
41
41
  xDomainLine: { type: Boolean },
@@ -58,119 +58,119 @@ const re = {
58
58
  xAxis: {}
59
59
  },
60
60
  emits: ["click"],
61
- setup(V, { emit: S }) {
62
- const w = S, a = V, D = X(), L = H("slotWrapper"), g = Y();
63
- if (a.valueLabel && !a.xAxis)
61
+ setup(e, { emit: S }) {
62
+ const w = S, t = e, D = X(), L = H("slotWrapper"), y = Y();
63
+ if (t.valueLabel && !t.xAxis)
64
64
  throw new Error(
65
65
  "BarChart: 'xAxis' prop is required when 'valueLabel' is enabled. Please provide an 'xAxis' to display value labels."
66
66
  );
67
- if (!a.yAxis || a.yAxis.length === 0)
67
+ if (!t.yAxis || t.yAxis.length === 0)
68
68
  throw new Error("yAxis is required");
69
- const A = f(() => a.yAxis.map((e) => (n) => n[e])), x = (e, n) => {
70
- var r;
71
- return (r = Object.values(a.categories)[n]) == null ? void 0 : r.color;
72
- }, c = f(
69
+ const A = k(() => t.yAxis.map((n) => (l) => l[n])), B = (n, l) => {
70
+ var o;
71
+ return (o = Object.values(t.categories)[l]) == null ? void 0 : o.color;
72
+ }, m = k(
73
73
  () => K({
74
- data: a.data,
75
- categories: a.categories,
76
- stackAndGrouped: a.stackAndGrouped,
77
- xAxis: a.xAxis,
78
- spacing: a.stackedGroupedSpacing
74
+ data: t.data,
75
+ categories: t.categories,
76
+ stackAndGrouped: t.stackAndGrouped,
77
+ xAxis: t.xAxis,
78
+ spacing: t.stackedGroupedSpacing
79
79
  }).value
80
- ), O = f(() => a.legendPosition.startsWith("top")), E = f(() => a.legendPosition.includes("left") ? "flex-start" : a.legendPosition.includes("right") ? "flex-end" : "center");
81
- function B(e) {
82
- g.value = e;
80
+ ), O = k(() => t.legendPosition.startsWith("top")), E = k(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center");
81
+ function C(n) {
82
+ y.value = n;
83
83
  }
84
- const C = a.yAxis.map((e) => (n) => n[e]), N = C.length, M = a.data.flatMap(
85
- (e, n) => C.map((r, d) => ({
86
- x: n,
87
- y: Number(r(e) ?? 0),
88
- itemIndex: d
84
+ const T = t.yAxis.map((n) => (l) => l[n]), N = T.length, M = t.data.flatMap(
85
+ (n, l) => T.map((o, u) => ({
86
+ x: l,
87
+ y: Number(o(n) ?? 0),
88
+ itemIndex: u
89
89
  }))
90
- ), z = (e) => {
91
- if (a.stacked || a.stackAndGrouped) return e.x;
92
- const n = N;
93
- if (n <= 1) return e.x;
94
- const d = 1 - (a.groupPadding ?? 0), y = d / n, m = -d / 2, i = y * e.itemIndex + y / 2, k = 1 - (a.barPadding ?? 0), R = (m + i) * k;
95
- return e.x + R;
90
+ ), z = (n) => {
91
+ if (t.stacked || t.stackAndGrouped) return n.x;
92
+ const l = N;
93
+ if (l <= 1) return n.x;
94
+ const u = 1 - (t.groupPadding ?? 0), f = u / l, x = -u / 2, i = f * n.itemIndex + f / 2, b = 1 - (t.barPadding ?? 0), R = (x + i) * b;
95
+ return n.x + R;
96
96
  };
97
- return (e, n) => (l(), b("div", {
98
- style: v({
97
+ return (n, l) => (d(), v("div", {
98
+ style: h({
99
99
  display: "flex",
100
100
  flexDirection: O.value ? "column-reverse" : "column",
101
101
  gap: "var(--vis-legend-spacing)"
102
102
  }),
103
- onClick: n[0] || (n[0] = (r) => w("click", r, g.value))
103
+ onClick: l[0] || (l[0] = (o) => w("click", o, y.value))
104
104
  }, [
105
- h(o(Q), {
105
+ p(a(Q), {
106
106
  padding: e.padding,
107
107
  height: e.height,
108
108
  duration: e.duration
109
109
  }, {
110
- default: $(() => {
111
- var r, d, y, m;
110
+ default: j(() => {
111
+ var o, u, f, x;
112
112
  return [
113
- e.valueLabel ? (l(), s(o(Z), {
113
+ e.valueLabel ? (d(), s(a(Z), {
114
114
  key: 0,
115
- data: o(M),
115
+ data: a(M),
116
116
  x: z,
117
117
  y: (i) => {
118
- var t;
119
- return i.y + (((t = a.valueLabel) == null ? void 0 : t.labelSpacing) ?? 0);
118
+ var r;
119
+ return i.y + (((r = t.valueLabel) == null ? void 0 : r.labelSpacing) ?? 0) * (i.y < 0 ? -1 : 1);
120
120
  },
121
- label: (r = a.valueLabel) == null ? void 0 : r.label,
122
- backgroundColor: ((d = a.valueLabel) == null ? void 0 : d.backgroundColor) ?? "transparent",
123
- color: ((y = a.valueLabel) == null ? void 0 : y.color) ?? "red",
124
- labelFontSize: (m = a.valueLabel) == null ? void 0 : m.labelFontSize
125
- }, null, 8, ["data", "y", "label", "backgroundColor", "color", "labelFontSize"])) : u("", !0),
126
- e.hideTooltip ? u("", !0) : (l(), s(o(_), {
121
+ label: (o = t.valueLabel) == null ? void 0 : o.label,
122
+ backgroundColor: ((u = t.valueLabel) == null ? void 0 : u.backgroundColor) ?? "transparent",
123
+ color: ((f = t.valueLabel) == null ? void 0 : f.color) ?? "red",
124
+ labelFontSize: (x = t.valueLabel) == null ? void 0 : x.labelFontSize
125
+ }, null, 8, ["data", "y", "label", "backgroundColor", "color", "labelFontSize"])) : c("", !0),
126
+ e.hideTooltip ? c("", !0) : (d(), s(a(_), {
127
127
  key: 1,
128
- followCursor: a.tooltip.followCursor,
129
- "show-delay": a.tooltip.showDelay,
130
- "hide-delay": a.tooltip.hideDelay,
128
+ followCursor: t.tooltip.followCursor,
129
+ "show-delay": t.tooltip.showDelay,
130
+ "hide-delay": t.tooltip.hideDelay,
131
131
  triggers: {
132
- [o(J).selectors.bar]: (i) => {
133
- var t;
134
- return B(i), i ? (t = L.value) == null ? void 0 : t.innerHTML : "";
132
+ [a(J).selectors.bar]: (i) => {
133
+ var r;
134
+ return C(i), i ? (r = L.value) == null ? void 0 : r.innerHTML : "";
135
135
  },
136
- [o(U).selectors.bar]: (i) => {
137
- var t;
138
- return B(i), i ? (t = L.value) == null ? void 0 : t.innerHTML : "";
136
+ [a(U).selectors.bar]: (i) => {
137
+ var r;
138
+ return C(i), i ? (r = L.value) == null ? void 0 : r.innerHTML : "";
139
139
  }
140
140
  }
141
141
  }, null, 8, ["followCursor", "show-delay", "hide-delay", "triggers"])),
142
- e.stackAndGrouped ? (l(!0), b(q, { key: 2 }, I(c.value.states, (i) => (l(), s(o(F), {
142
+ e.stackAndGrouped ? (d(!0), v($, { key: 2 }, q(m.value.states, (i) => (d(), s(a(G), {
143
143
  key: i,
144
- data: c.value.chartData,
145
- x: (t, k) => k + c.value.positions[i],
146
- y: c.value.bars[i],
147
- color: c.value.colorFunctions[i],
144
+ data: m.value.chartData,
145
+ x: (r, b) => b + m.value.positions[i],
146
+ y: m.value.bars[i],
147
+ color: m.value.colorFunctions[i],
148
148
  "rounded-corners": e.radius ?? 0,
149
149
  "group-padding": e.groupPadding ?? 0,
150
150
  "bar-padding": e.barPadding,
151
- orientation: e.orientation ?? o(p).Vertical
152
- }, null, 8, ["data", "x", "y", "color", "rounded-corners", "group-padding", "bar-padding", "orientation"]))), 128)) : e.stacked ? (l(), s(o(F), {
151
+ orientation: e.orientation ?? a(g).Vertical
152
+ }, null, 8, ["data", "x", "y", "color", "rounded-corners", "group-padding", "bar-padding", "orientation"]))), 128)) : e.stacked ? (d(), s(a(G), {
153
153
  key: 4,
154
154
  data: e.data,
155
- x: (i, t) => t,
155
+ x: (i, r) => r,
156
156
  y: A.value,
157
- color: x,
157
+ color: B,
158
158
  "rounded-corners": e.radius ?? 0,
159
159
  "group-padding": e.groupPadding ?? 0,
160
160
  "bar-padding": e.barPadding ?? 0.2,
161
- orientation: e.orientation ?? o(p).Vertical
162
- }, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])) : (l(), s(o(ee), {
161
+ orientation: e.orientation ?? a(g).Vertical
162
+ }, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])) : (d(), s(a(ee), {
163
163
  key: 3,
164
164
  data: e.data,
165
- x: (i, t) => t,
165
+ x: (i, r) => r,
166
166
  y: A.value,
167
- color: x,
167
+ color: B,
168
168
  "rounded-corners": e.radius ?? 0,
169
169
  "group-padding": e.groupPadding ?? 0,
170
170
  "bar-padding": e.barPadding ?? 0.2,
171
- orientation: e.orientation ?? o(p).Vertical
171
+ orientation: e.orientation ?? a(g).Vertical
172
172
  }, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])),
173
- e.hideXAxis ? u("", !0) : (l(), s(o(G), T({
173
+ e.hideXAxis ? c("", !0) : (d(), s(a(V), P({
174
174
  key: 5,
175
175
  type: "x",
176
176
  "tick-format": e.xFormatter,
@@ -183,11 +183,11 @@ const re = {
183
183
  minMaxTicksOnly: e.minMaxTicksOnly,
184
184
  duration: e.duration
185
185
  }, e.xAxisConfig), null, 16, ["tick-format", "label", "grid-line", "domain-line", "tick-line", "num-ticks", "tick-values", "minMaxTicksOnly", "duration"])),
186
- e.hideYAxis ? u("", !0) : (l(), s(o(G), T({
186
+ e.hideYAxis ? c("", !0) : (d(), s(a(V), P({
187
187
  key: 6,
188
188
  type: "y",
189
189
  label: e.yLabel,
190
- "grid-line": e.orientation !== o(p).Horizontal && e.yGridLine,
190
+ "grid-line": e.orientation !== a(g).Horizontal && e.yGridLine,
191
191
  "domain-line": !!e.yDomainLine,
192
192
  "tick-format": e.yFormatter,
193
193
  "num-ticks": e.yNumTicks,
@@ -198,40 +198,40 @@ const re = {
198
198
  }),
199
199
  _: 1
200
200
  }, 8, ["padding", "height", "duration"]),
201
- a.hideLegend ? u("", !0) : (l(), b("div", {
201
+ t.hideLegend ? c("", !0) : (d(), v("div", {
202
202
  key: 0,
203
- style: v({
203
+ style: h({
204
204
  display: "flex",
205
205
  justifyContent: E.value
206
206
  })
207
207
  }, [
208
- h(o(ae), {
209
- style: v([
210
- a.legendStyle,
208
+ p(a(te), {
209
+ style: h([
210
+ t.legendStyle,
211
211
  "display: flex; gap: var(--vis-legend-spacing);"
212
212
  ]),
213
- items: Object.values(a.categories).map((r) => ({
214
- ...r,
215
- color: Array.isArray(r.color) ? r.color[0] : r.color
213
+ items: Object.values(t.categories).map((o) => ({
214
+ ...o,
215
+ color: Array.isArray(o.color) ? o.color[0] : o.color
216
216
  }))
217
217
  }, null, 8, ["style", "items"])
218
218
  ], 4)),
219
- j("div", re, [
220
- o(D).tooltip ? P(e.$slots, "tooltip", {
219
+ I("div", ne, [
220
+ a(D).tooltip ? F(n.$slots, "tooltip", {
221
221
  key: 0,
222
- values: g.value
223
- }) : g.value ? P(e.$slots, "fallback", { key: 1 }, () => [
224
- h(oe, {
225
- data: g.value,
226
- categories: a.categories,
227
- "title-formatter": a.tooltipTitleFormatter,
228
- yFormatter: a.orientation === o(p).Horizontal ? a.xFormatter : a.yFormatter
222
+ values: y.value
223
+ }) : y.value ? F(n.$slots, "fallback", { key: 1 }, () => [
224
+ p(ae, {
225
+ data: y.value,
226
+ categories: t.categories,
227
+ "title-formatter": t.tooltipTitleFormatter,
228
+ yFormatter: t.orientation === a(g).Horizontal ? t.xFormatter : t.yFormatter
229
229
  }, null, 8, ["data", "categories", "title-formatter", "yFormatter"])
230
- ]) : u("", !0)
230
+ ]) : c("", !0)
231
231
  ], 512)
232
232
  ], 4));
233
233
  }
234
234
  });
235
235
  export {
236
- pe as default
236
+ ce as default
237
237
  };
@@ -153,7 +153,7 @@ export interface BubbleChartProps<T> {
153
153
  /**
154
154
  * Crosshair configuration object for customizing the appearance of the crosshair line.
155
155
  */
156
- crosshairConfig?: CrosshairConfig;
156
+ crosshairConfig?: CrosshairConfig<T>;
157
157
  /**
158
158
  * Axis configuration object for customizing the appearance of the axes.
159
159
  */