vue-chrts 1.0.0 → 2.0.0-beta.1

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.
@@ -1,14 +1,13 @@
1
- import { defineComponent as W, useSlots as X, useTemplateRef as H, ref as Y, computed as f, createElementBlock as v, openBlock as l, normalizeStyle as L, createVNode as k, createCommentVNode as y, createElementVNode as j, unref as i, withCtx as $, createBlock as u, Fragment as q, renderList as I, mergeProps as P, renderSlot as C } from "vue";
2
- import { Orientation as p, StackedBar as U, GroupedBar as J } from "@unovis/ts";
3
- import { getFirstPropertyValue as K } from "../../utils.js";
4
- import { useStackedGrouped as Q } from "./stackedGroupedUtils.js";
5
- import { VisXYContainer as Z, VisXYLabels as _, VisTooltip as ee, VisStackedBar as F, VisGroupedBar as ae, VisAxis as V, VisBulletLegend as ie } from "@unovis/vue";
6
- import oe from "../Tooltip.js";
7
- import { LegendPosition as re } from "../../types.js";
1
+ import { defineComponent as W, useSlots as X, useTemplateRef as H, ref as Y, computed as k, createElementBlock as p, openBlock as d, normalizeStyle as L, createVNode as b, createCommentVNode as x, createElementVNode as j, unref as a, withCtx as $, createBlock as c, Fragment as q, renderList as I, mergeProps as C, renderSlot as F } from "vue";
2
+ import { Orientation as u, StackedBar as U, GroupedBar as J } from "@unovis/ts";
3
+ import { useStackedGrouped as K } from "./stackedGroupedUtils.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
+ import { LegendPosition as ie } from "../../types.js";
8
7
  const ne = {
9
8
  ref: "slotWrapper",
10
9
  style: { display: "none" }
11
- }, ge = /* @__PURE__ */ W({
10
+ }, ue = /* @__PURE__ */ W({
12
11
  __name: "BarChart",
13
12
  props: {
14
13
  data: {},
@@ -25,6 +24,7 @@ const ne = {
25
24
  categories: {},
26
25
  xFormatter: {},
27
26
  yFormatter: {},
27
+ tooltipTitleFormatter: {},
28
28
  yNumTicks: {},
29
29
  minMaxTicksOnly: { type: Boolean },
30
30
  xNumTicks: {},
@@ -35,8 +35,8 @@ const ne = {
35
35
  radius: {},
36
36
  hideLegend: { type: Boolean, default: !1 },
37
37
  hideTooltip: { type: Boolean, default: !1 },
38
- orientation: { default: p.Vertical },
39
- legendPosition: { default: re.BottomCenter },
38
+ orientation: { default: u.Vertical },
39
+ legendPosition: { default: ie.BottomCenter },
40
40
  legendStyle: { default: void 0 },
41
41
  xDomainLine: { type: Boolean },
42
42
  yDomainLine: { type: Boolean },
@@ -54,114 +54,114 @@ const ne = {
54
54
  xAxis: {}
55
55
  },
56
56
  emits: ["click"],
57
- setup(G, { emit: S }) {
58
- const O = S, a = G, D = X(), x = H("slotWrapper"), s = Y();
59
- if (a.valueLabel && !a.xAxis)
57
+ setup(e, { emit: S }) {
58
+ const O = S, t = e, D = X(), h = H("slotWrapper"), g = Y();
59
+ if (t.valueLabel && !t.xAxis)
60
60
  throw new Error(
61
61
  "BarChart: 'xAxis' prop is required when 'valueLabel' is enabled. Please provide an 'xAxis' to display value labels."
62
62
  );
63
- if (!a.yAxis || a.yAxis.length === 0)
63
+ if (!t.yAxis || t.yAxis.length === 0)
64
64
  throw new Error("yAxis is required");
65
- const h = f(() => a.yAxis.map((e) => (t) => t[e])), A = (e, t) => {
66
- var r;
67
- return (r = Object.values(a.categories)[t]) == null ? void 0 : r.color;
68
- }, c = f(
69
- () => Q({
70
- data: a.data,
71
- categories: a.categories,
72
- stackAndGrouped: a.stackAndGrouped,
73
- xAxis: a.xAxis,
74
- spacing: a.stackedGroupedSpacing
65
+ const A = k(() => t.yAxis.map((i) => (l) => l[i])), B = (i, l) => {
66
+ var o;
67
+ return (o = Object.values(t.categories)[l]) == null ? void 0 : o.color;
68
+ }, y = k(
69
+ () => K({
70
+ data: t.data,
71
+ categories: t.categories,
72
+ stackAndGrouped: t.stackAndGrouped,
73
+ xAxis: t.xAxis,
74
+ spacing: t.stackedGroupedSpacing
75
75
  }).value
76
- ), E = f(() => a.legendPosition.startsWith("top")), N = f(() => a.legendPosition.includes("left") ? "flex-start" : a.legendPosition.includes("right") ? "flex-end" : "center");
77
- function B(e) {
78
- s.value = e;
76
+ ), E = k(() => t.legendPosition.startsWith("top")), N = k(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center");
77
+ function T(i) {
78
+ g.value = i;
79
79
  }
80
- const T = a.yAxis.map((e) => (t) => t[e]), M = T.length, w = a.data.flatMap(
81
- (e, t) => T.map((r, d) => ({
82
- x: t,
83
- y: Number(r(e) ?? 0),
84
- itemIndex: d
80
+ const P = t.yAxis.map((i) => (l) => l[i]), M = P.length, w = t.data.flatMap(
81
+ (i, l) => P.map((o, s) => ({
82
+ x: l,
83
+ y: Number(o(i) ?? 0),
84
+ itemIndex: s
85
85
  }))
86
- ), z = (e) => {
87
- if (a.stacked || a.stackAndGrouped) return e.x;
88
- const t = M;
89
- if (t <= 1) return e.x;
90
- const d = 1 - (a.groupPadding ?? 0), g = d / t, m = -d / 2, o = g * e.itemIndex + g / 2, b = 1 - (a.barPadding ?? 0), R = (m + o) * b;
91
- return e.x + R;
86
+ ), z = (i) => {
87
+ if (t.stacked || t.stackAndGrouped) return i.x;
88
+ const l = M;
89
+ if (l <= 1) return i.x;
90
+ const s = 1 - (t.groupPadding ?? 0), m = s / l, f = -s / 2, n = m * i.itemIndex + m / 2, v = 1 - (t.barPadding ?? 0), R = (f + n) * v;
91
+ return i.x + R;
92
92
  };
93
- return (e, t) => (l(), v("div", {
93
+ return (i, l) => (d(), p("div", {
94
94
  style: L({
95
95
  display: "flex",
96
96
  flexDirection: E.value ? "column-reverse" : "column",
97
97
  gap: "var(--vis-legend-spacing)"
98
98
  }),
99
- onClick: t[0] || (t[0] = (r) => O("click", r, s.value))
99
+ onClick: l[0] || (l[0] = (o) => O("click", o, g.value))
100
100
  }, [
101
- k(i(Z), {
101
+ b(a(Q), {
102
102
  padding: e.padding,
103
103
  height: e.height
104
104
  }, {
105
105
  default: $(() => {
106
- var r, d, g, m;
106
+ var o, s, m, f;
107
107
  return [
108
- e.valueLabel ? (l(), u(i(_), {
108
+ e.valueLabel ? (d(), c(a(Z), {
109
109
  key: 0,
110
- data: i(w),
110
+ data: a(w),
111
111
  x: z,
112
- y: (o) => {
113
- var n;
114
- return o.y + (((n = a.valueLabel) == null ? void 0 : n.labelSpacing) ?? 0);
112
+ y: (n) => {
113
+ var r;
114
+ return n.y + (((r = t.valueLabel) == null ? void 0 : r.labelSpacing) ?? 0);
115
115
  },
116
- label: (r = a.valueLabel) == null ? void 0 : r.label,
117
- backgroundColor: ((d = a.valueLabel) == null ? void 0 : d.backgroundColor) ?? "transparent",
118
- color: ((g = a.valueLabel) == null ? void 0 : g.color) ?? "red",
119
- labelFontSize: (m = a.valueLabel) == null ? void 0 : m.labelFontSize
120
- }, null, 8, ["data", "y", "label", "backgroundColor", "color", "labelFontSize"])) : y("", !0),
121
- k(i(ee), {
116
+ label: (o = t.valueLabel) == null ? void 0 : o.label,
117
+ backgroundColor: ((s = t.valueLabel) == null ? void 0 : s.backgroundColor) ?? "transparent",
118
+ color: ((m = t.valueLabel) == null ? void 0 : m.color) ?? "red",
119
+ labelFontSize: (f = t.valueLabel) == null ? void 0 : f.labelFontSize
120
+ }, null, 8, ["data", "y", "label", "backgroundColor", "color", "labelFontSize"])) : x("", !0),
121
+ b(a(_), {
122
122
  triggers: {
123
- [i(J).selectors.bar]: (o) => {
124
- var n;
125
- return B(o), o ? (n = x.value) == null ? void 0 : n.innerHTML : "";
123
+ [a(J).selectors.bar]: (n) => {
124
+ var r;
125
+ return T(n), n ? (r = h.value) == null ? void 0 : r.innerHTML : "";
126
126
  },
127
- [i(U).selectors.bar]: (o) => {
128
- var n;
129
- return B(o), o ? (n = x.value) == null ? void 0 : n.innerHTML : "";
127
+ [a(U).selectors.bar]: (n) => {
128
+ var r;
129
+ return T(n), n ? (r = h.value) == null ? void 0 : r.innerHTML : "";
130
130
  }
131
131
  }
132
132
  }, null, 8, ["triggers"]),
133
- e.stackAndGrouped ? (l(!0), v(q, { key: 1 }, I(c.value.states, (o) => (l(), u(i(F), {
134
- key: o,
135
- data: c.value.chartData,
136
- x: (n, b) => b + c.value.positions[o],
137
- y: c.value.bars[o],
138
- color: c.value.colorFunctions[o],
133
+ e.stackAndGrouped ? (d(!0), p(q, { key: 1 }, I(y.value.states, (n) => (d(), c(a(G), {
134
+ key: n,
135
+ data: y.value.chartData,
136
+ x: (r, v) => v + y.value.positions[n],
137
+ y: y.value.bars[n],
138
+ color: y.value.colorFunctions[n],
139
139
  "rounded-corners": e.radius ?? 0,
140
140
  "group-padding": e.groupPadding ?? 0,
141
141
  "bar-padding": e.barPadding,
142
- orientation: e.orientation ?? i(p).Vertical
143
- }, null, 8, ["data", "x", "y", "color", "rounded-corners", "group-padding", "bar-padding", "orientation"]))), 128)) : e.stacked ? (l(), u(i(F), {
142
+ orientation: e.orientation ?? a(u).Vertical
143
+ }, null, 8, ["data", "x", "y", "color", "rounded-corners", "group-padding", "bar-padding", "orientation"]))), 128)) : e.stacked ? (d(), c(a(G), {
144
144
  key: 3,
145
145
  data: e.data,
146
- x: (o, n) => n,
147
- y: h.value,
148
- color: A,
146
+ x: (n, r) => r,
147
+ y: A.value,
148
+ color: B,
149
149
  "rounded-corners": e.radius ?? 0,
150
150
  "group-padding": e.groupPadding ?? 0,
151
151
  "bar-padding": e.barPadding ?? 0.2,
152
- orientation: e.orientation ?? i(p).Vertical
153
- }, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])) : (l(), u(i(ae), {
152
+ orientation: e.orientation ?? a(u).Vertical
153
+ }, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])) : (d(), c(a(ee), {
154
154
  key: 2,
155
155
  data: e.data,
156
- x: (o, n) => n,
157
- y: h.value,
158
- color: A,
156
+ x: (n, r) => r,
157
+ y: A.value,
158
+ color: B,
159
159
  "rounded-corners": e.radius ?? 0,
160
160
  "group-padding": e.groupPadding ?? 0,
161
161
  "bar-padding": e.barPadding ?? 0.2,
162
- orientation: e.orientation ?? i(p).Vertical
162
+ orientation: e.orientation ?? a(u).Vertical
163
163
  }, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])),
164
- e.hideXAxis ? y("", !0) : (l(), u(i(V), P({
164
+ e.hideXAxis ? x("", !0) : (d(), c(a(V), C({
165
165
  key: 4,
166
166
  type: "x",
167
167
  "tick-format": e.xFormatter,
@@ -173,11 +173,11 @@ const ne = {
173
173
  "tick-values": e.xExplicitTicks,
174
174
  minMaxTicksOnly: e.minMaxTicksOnly
175
175
  }, e.xAxisConfig), null, 16, ["tick-format", "label", "grid-line", "domain-line", "tick-line", "num-ticks", "tick-values", "minMaxTicksOnly"])),
176
- e.hideYAxis ? y("", !0) : (l(), u(i(V), P({
176
+ e.hideYAxis ? x("", !0) : (d(), c(a(V), C({
177
177
  key: 5,
178
178
  type: "y",
179
179
  label: e.yLabel,
180
- "grid-line": e.orientation !== i(p).Horizontal && e.yGridLine,
180
+ "grid-line": e.orientation !== a(u).Horizontal && e.yGridLine,
181
181
  "domain-line": !!e.yDomainLine,
182
182
  "tick-format": e.yFormatter,
183
183
  "num-ticks": e.yNumTicks,
@@ -187,40 +187,40 @@ const ne = {
187
187
  }),
188
188
  _: 1
189
189
  }, 8, ["padding", "height"]),
190
- a.hideLegend ? y("", !0) : (l(), v("div", {
190
+ t.hideLegend ? x("", !0) : (d(), p("div", {
191
191
  key: 0,
192
192
  style: L({
193
193
  display: "flex",
194
194
  justifyContent: N.value
195
195
  })
196
196
  }, [
197
- k(i(ie), {
197
+ b(a(te), {
198
198
  style: L([
199
- a.legendStyle,
199
+ t.legendStyle,
200
200
  "display: flex; gap: var(--vis-legend-spacing);"
201
201
  ]),
202
- items: Object.values(a.categories).map((r) => ({
203
- ...r,
204
- color: Array.isArray(r.color) ? r.color[0] : r.color
202
+ items: Object.values(t.categories).map((o) => ({
203
+ ...o,
204
+ color: Array.isArray(o.color) ? o.color[0] : o.color
205
205
  }))
206
206
  }, null, 8, ["style", "items"])
207
207
  ], 4)),
208
208
  j("div", ne, [
209
- i(D).tooltip ? C(e.$slots, "tooltip", {
209
+ a(D).tooltip ? F(i.$slots, "tooltip", {
210
210
  key: 0,
211
- values: s.value
212
- }) : s.value ? C(e.$slots, "fallback", { key: 1 }, () => [
213
- k(oe, {
214
- data: s.value,
215
- categories: a.categories,
216
- toolTipTitle: i(K)(s.value) ?? "",
217
- yFormatter: a.orientation === i(p).Horizontal ? a.xFormatter : a.yFormatter
218
- }, null, 8, ["data", "categories", "toolTipTitle", "yFormatter"])
219
- ]) : y("", !0)
211
+ values: g.value
212
+ }) : g.value ? F(i.$slots, "fallback", { key: 1 }, () => [
213
+ b(ae, {
214
+ data: g.value,
215
+ categories: t.categories,
216
+ "title-formatter": t.tooltipTitleFormatter,
217
+ yFormatter: t.orientation === a(u).Horizontal ? t.xFormatter : t.yFormatter
218
+ }, null, 8, ["data", "categories", "title-formatter", "yFormatter"])
219
+ ]) : x("", !0)
220
220
  ], 512)
221
221
  ], 4));
222
222
  }
223
223
  });
224
224
  export {
225
- ge as default
225
+ ue as default
226
226
  };
@@ -51,6 +51,10 @@ type BarChartPropsBase<T> = {
51
51
  * @returns {string} The formatted string representation of the tick.
52
52
  */
53
53
  yFormatter?: axisFormatter;
54
+ /**
55
+ * Use custom formatter for tooltip titles
56
+ */
57
+ tooltipTitleFormatter?: (data: T) => string | number;
54
58
  /**
55
59
  * The desired number of ticks on the y-axis.
56
60
  */
@@ -1,13 +1,12 @@
1
- import { defineComponent as O, useSlots as S, useTemplateRef as D, ref as R, computed as f, createElementBlock as m, openBlock as l, normalizeStyle as c, createVNode as s, createCommentVNode as r, createElementVNode as w, unref as i, withCtx as K, createBlock as d, mergeProps as g, renderSlot as k } from "vue";
2
- import { Scatter as M, Position as _ } from "@unovis/ts";
3
- import { VisXYContainer as E, VisTooltip as G, VisScatter as W, VisAxis as x, VisBulletLegend as $ } from "@unovis/vue";
4
- import { LegendPosition as j } from "../../types.js";
5
- import { getFirstPropertyValue as X } from "../../utils.js";
1
+ import { defineComponent as O, useSlots as S, useTemplateRef as D, ref as R, computed as g, createElementBlock as p, openBlock as l, normalizeStyle as d, createVNode as s, createCommentVNode as r, createElementVNode as w, unref as t, withCtx as K, createBlock as u, mergeProps as x, renderSlot as k } from "vue";
2
+ import { Scatter as M, Position as E } from "@unovis/ts";
3
+ import { VisXYContainer as G, VisTooltip as W, VisScatter as $, VisAxis as L, VisBulletLegend as j } from "@unovis/vue";
4
+ import { LegendPosition as X } from "../../types.js";
6
5
  import Y from "../Tooltip.js";
7
- const q = {
6
+ const _ = {
8
7
  ref: "slotWrapper",
9
8
  class: "hidden"
10
- }, ee = /* @__PURE__ */ O({
9
+ }, Q = /* @__PURE__ */ O({
11
10
  __name: "BubbleChart",
12
11
  props: {
13
12
  xAccessor: {},
@@ -28,7 +27,8 @@ const q = {
28
27
  categoryKey: {},
29
28
  xFormatter: {},
30
29
  yFormatter: {},
31
- legendPosition: { default: j.BottomCenter },
30
+ tooltipTitleFormatter: {},
31
+ legendPosition: { default: X.BottomCenter },
32
32
  legendStyle: { default: void 0 },
33
33
  sizeOptions: {},
34
34
  xDomainLine: { type: Boolean, default: !0 },
@@ -49,36 +49,36 @@ const q = {
49
49
  yAxisConfig: {}
50
50
  },
51
51
  emits: ["click"],
52
- setup(L, { emit: T }) {
53
- const e = L, h = S(), u = D("slotWrapper"), n = R(), v = e.xAccessor, b = e.yAccessor, B = e.sizeAccessor || ((t) => typeof t.comments == "number" ? t.comments : 1), A = (t) => {
54
- var y, p;
52
+ setup(c, { emit: h }) {
53
+ const e = c, T = S(), y = D("slotWrapper"), n = R(), v = e.xAccessor, b = e.yAccessor, B = e.sizeAccessor || ((i) => typeof i.comments == "number" ? i.comments : 1), A = (i) => {
54
+ var f, m;
55
55
  if (!e.categories || !e.categoryKey)
56
56
  return console.warn(
57
57
  "BubbleChart: categories and categoryKey are required for color mapping"
58
58
  ), "#cccccc";
59
- const a = String(t[e.categoryKey]);
60
- let o = (y = e.categories[a]) == null ? void 0 : y.color;
61
- return Object.keys(e.categories).length === 1 && (o = (p = e.categories[e.categoryKey]) == null ? void 0 : p.color), o || (console.warn(
59
+ const a = String(i[e.categoryKey]);
60
+ let o = (f = e.categories[a]) == null ? void 0 : f.color;
61
+ return Object.keys(e.categories).length === 1 && (o = (m = e.categories[e.categoryKey]) == null ? void 0 : m.color), o || (console.warn(
62
62
  `BubbleChart: No color defined for category "${a}"`
63
63
  ), "#cccccc");
64
- }, C = T;
65
- function V(t) {
66
- return n.value = t, F();
64
+ }, C = h;
65
+ function F(i) {
66
+ return n.value = i, V();
67
67
  }
68
- function F(t) {
69
- return typeof window > "u" ? "" : u.value ? u.value.innerHTML : "";
68
+ function V(i) {
69
+ return typeof window > "u" ? "" : y.value ? y.value.innerHTML : "";
70
70
  }
71
- const P = {
72
- [M.selectors.point]: V
73
- }, z = f(() => e.legendPosition.startsWith("top")), N = f(() => e.legendPosition.includes("left") ? "flex-start" : e.legendPosition.includes("right") ? "flex-end" : "center");
74
- return (t, a) => (l(), m("div", {
75
- style: c({
71
+ const z = {
72
+ [M.selectors.point]: F
73
+ }, P = g(() => e.legendPosition.startsWith("top")), N = g(() => e.legendPosition.includes("left") ? "flex-start" : e.legendPosition.includes("right") ? "flex-end" : "center");
74
+ return (i, a) => (l(), p("div", {
75
+ style: d({
76
76
  display: "flex",
77
- flexDirection: z.value ? "column-reverse" : "column",
77
+ flexDirection: P.value ? "column-reverse" : "column",
78
78
  gap: "var(--vis-legend-spacing)"
79
79
  })
80
80
  }, [
81
- s(i(E), {
81
+ s(t(G), {
82
82
  data: e.data,
83
83
  height: e.height || 600,
84
84
  padding: e.padding,
@@ -86,21 +86,21 @@ const q = {
86
86
  onClick: a[0] || (a[0] = (o) => C("click", o, n.value))
87
87
  }, {
88
88
  default: K(() => [
89
- e.hideTooltip ? r("", !0) : (l(), d(i(G), {
89
+ e.hideTooltip ? r("", !0) : (l(), u(t(W), {
90
90
  key: 0,
91
- triggers: P
91
+ triggers: z
92
92
  })),
93
- s(i(W), {
94
- x: i(v),
95
- y: i(b),
93
+ s(t($), {
94
+ x: t(v),
95
+ y: t(b),
96
96
  color: A,
97
- size: i(B),
98
- labelPosition: e.labelPosition || i(_).Bottom,
97
+ size: t(B),
98
+ labelPosition: e.labelPosition || t(E).Bottom,
99
99
  sizeRange: e.sizeRange || [1, 20],
100
100
  opacity: e.opacity,
101
101
  cursor: "pointer"
102
102
  }, null, 8, ["x", "y", "size", "labelPosition", "sizeRange", "opacity"]),
103
- e.hideXAxis ? r("", !0) : (l(), d(i(x), g({
103
+ e.hideXAxis ? r("", !0) : (l(), u(t(L), x({
104
104
  key: 1,
105
105
  type: "x",
106
106
  label: e.xLabel,
@@ -111,8 +111,8 @@ const q = {
111
111
  numTicks: e.xNumTicks,
112
112
  tickValues: e.xExplicitTicks,
113
113
  minMaxTicksOnly: e.minMaxTicksOnly
114
- }, t.xAxisConfig), null, 16, ["label", "tickFormat", "gridLine", "domainLine", "tickLine", "numTicks", "tickValues", "minMaxTicksOnly"])),
115
- e.hideYAxis ? r("", !0) : (l(), d(i(x), g({
114
+ }, c.xAxisConfig), null, 16, ["label", "tickFormat", "gridLine", "domainLine", "tickLine", "numTicks", "tickValues", "minMaxTicksOnly"])),
115
+ e.hideYAxis ? r("", !0) : (l(), u(t(L), x({
116
116
  key: 2,
117
117
  type: "y",
118
118
  label: e.yLabel,
@@ -121,20 +121,20 @@ const q = {
121
121
  domainLine: !!e.yDomainLine,
122
122
  tickLine: e.yTickLine,
123
123
  numTicks: e.yNumTicks
124
- }, t.yAxisConfig), null, 16, ["label", "tickFormat", "gridLine", "domainLine", "tickLine", "numTicks"]))
124
+ }, c.yAxisConfig), null, 16, ["label", "tickFormat", "gridLine", "domainLine", "tickLine", "numTicks"]))
125
125
  ]),
126
126
  _: 1
127
127
  }, 8, ["data", "height", "padding"]),
128
- e.hideLegend ? r("", !0) : (l(), m("div", {
128
+ e.hideLegend ? r("", !0) : (l(), p("div", {
129
129
  key: 0,
130
- style: c({
130
+ style: d({
131
131
  display: "flex",
132
132
  justifyContent: N.value
133
133
  })
134
134
  }, [
135
- s(i($), {
135
+ s(t(j), {
136
136
  class: "bulletLegendOverrides",
137
- style: c([
137
+ style: d([
138
138
  e.legendStyle,
139
139
  "display: flex; gap: var(--vis-legend-spacing);"
140
140
  ]),
@@ -144,22 +144,22 @@ const q = {
144
144
  }))
145
145
  }, null, 8, ["style", "items"])
146
146
  ], 4)),
147
- w("div", q, [
148
- i(h).tooltip ? k(t.$slots, "tooltip", {
147
+ w("div", _, [
148
+ t(T).tooltip ? k(i.$slots, "tooltip", {
149
149
  key: 0,
150
150
  values: n.value
151
- }) : n.value ? k(t.$slots, "fallback", { key: 1 }, () => [
151
+ }) : n.value ? k(i.$slots, "fallback", { key: 1 }, () => [
152
152
  s(Y, {
153
153
  data: n.value,
154
154
  categories: e.categories || {},
155
- toolTipTitle: i(X)(n.value) ?? "",
155
+ "title-formatter": e.tooltipTitleFormatter,
156
156
  yFormatter: e.yFormatter
157
- }, null, 8, ["data", "categories", "toolTipTitle", "yFormatter"])
157
+ }, null, 8, ["data", "categories", "title-formatter", "yFormatter"])
158
158
  ]) : r("", !0)
159
159
  ], 512)
160
160
  ], 4));
161
161
  }
162
162
  });
163
163
  export {
164
- ee as default
164
+ Q as default
165
165
  };
@@ -90,6 +90,10 @@ export interface BubbleChartProps<T> {
90
90
  * @returns {string} The formatted string representation of the tick.
91
91
  */
92
92
  yFormatter?: axisFormatter;
93
+ /**
94
+ * Use custom formatter for tooltip titles
95
+ */
96
+ tooltipTitleFormatter?: (data: T) => string | number;
93
97
  /**
94
98
  * Optional position for the legend, if applicable.
95
99
  * See `LegendPosition` for available options.