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.
- package/dist/components/AreaChart/AreaChart.js +138 -131
- package/dist/components/AreaChart/types.d.ts +13 -3
- package/dist/components/BarChart/BarChart.js +96 -96
- package/dist/components/BarChart/types.d.ts +4 -0
- package/dist/components/BubbleChart/BubbleChart.js +47 -47
- package/dist/components/BubbleChart/types.d.ts +4 -0
- package/dist/components/DonutChart/DonutChart.js +64 -68
- package/dist/components/DonutChart/DonutChart.vue.d.ts +1 -1
- package/dist/components/DonutChart/types.d.ts +5 -1
- package/dist/components/GanttChart/GanttChart.js +65 -64
- package/dist/components/GanttChart/GanttChart.vue.d.ts +1 -1
- package/dist/components/GanttChart/types.d.ts +6 -2
- package/dist/components/LineChart/LineChart.js +6 -5
- package/dist/components/Tooltip.js +59 -33
- package/dist/components/Tooltip.vue.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +12 -14
- package/dist/types.d.ts +12 -7
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +6 -6
- package/package.json +3 -3
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap.js +0 -59
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap.vue.d.ts +0 -14
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap2.js +0 -4
- package/dist/components/Maps/TopoJSONMap/types.d.ts +0 -5
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { defineComponent as W, useSlots as X, useTemplateRef as H, ref as Y, computed as
|
|
2
|
-
import { Orientation as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
|
-
},
|
|
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:
|
|
39
|
-
legendPosition: { default:
|
|
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(
|
|
58
|
-
const O = S,
|
|
59
|
-
if (
|
|
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 (!
|
|
63
|
+
if (!t.yAxis || t.yAxis.length === 0)
|
|
64
64
|
throw new Error("yAxis is required");
|
|
65
|
-
const
|
|
66
|
-
var
|
|
67
|
-
return (
|
|
68
|
-
},
|
|
69
|
-
() =>
|
|
70
|
-
data:
|
|
71
|
-
categories:
|
|
72
|
-
stackAndGrouped:
|
|
73
|
-
xAxis:
|
|
74
|
-
spacing:
|
|
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 =
|
|
77
|
-
function
|
|
78
|
-
|
|
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
|
|
81
|
-
(
|
|
82
|
-
x:
|
|
83
|
-
y: Number(
|
|
84
|
-
itemIndex:
|
|
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 = (
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
return
|
|
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 (
|
|
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:
|
|
99
|
+
onClick: l[0] || (l[0] = (o) => O("click", o, g.value))
|
|
100
100
|
}, [
|
|
101
|
-
|
|
101
|
+
b(a(Q), {
|
|
102
102
|
padding: e.padding,
|
|
103
103
|
height: e.height
|
|
104
104
|
}, {
|
|
105
105
|
default: $(() => {
|
|
106
|
-
var
|
|
106
|
+
var o, s, m, f;
|
|
107
107
|
return [
|
|
108
|
-
e.valueLabel ? (
|
|
108
|
+
e.valueLabel ? (d(), c(a(Z), {
|
|
109
109
|
key: 0,
|
|
110
|
-
data:
|
|
110
|
+
data: a(w),
|
|
111
111
|
x: z,
|
|
112
|
-
y: (
|
|
113
|
-
var
|
|
114
|
-
return
|
|
112
|
+
y: (n) => {
|
|
113
|
+
var r;
|
|
114
|
+
return n.y + (((r = t.valueLabel) == null ? void 0 : r.labelSpacing) ?? 0);
|
|
115
115
|
},
|
|
116
|
-
label: (
|
|
117
|
-
backgroundColor: ((
|
|
118
|
-
color: ((
|
|
119
|
-
labelFontSize: (
|
|
120
|
-
}, null, 8, ["data", "y", "label", "backgroundColor", "color", "labelFontSize"])) :
|
|
121
|
-
|
|
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
|
-
[
|
|
124
|
-
var
|
|
125
|
-
return
|
|
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
|
-
[
|
|
128
|
-
var
|
|
129
|
-
return
|
|
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 ? (
|
|
134
|
-
key:
|
|
135
|
-
data:
|
|
136
|
-
x: (
|
|
137
|
-
y:
|
|
138
|
-
color:
|
|
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 ??
|
|
143
|
-
}, null, 8, ["data", "x", "y", "color", "rounded-corners", "group-padding", "bar-padding", "orientation"]))), 128)) : e.stacked ? (
|
|
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: (
|
|
147
|
-
y:
|
|
148
|
-
color:
|
|
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 ??
|
|
153
|
-
}, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])) : (
|
|
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: (
|
|
157
|
-
y:
|
|
158
|
-
color:
|
|
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 ??
|
|
162
|
+
orientation: e.orientation ?? a(u).Vertical
|
|
163
163
|
}, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])),
|
|
164
|
-
e.hideXAxis ?
|
|
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 ?
|
|
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 !==
|
|
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
|
-
|
|
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
|
-
|
|
197
|
+
b(a(te), {
|
|
198
198
|
style: L([
|
|
199
|
-
|
|
199
|
+
t.legendStyle,
|
|
200
200
|
"display: flex; gap: var(--vis-legend-spacing);"
|
|
201
201
|
]),
|
|
202
|
-
items: Object.values(
|
|
203
|
-
...
|
|
204
|
-
color: Array.isArray(
|
|
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
|
-
|
|
209
|
+
a(D).tooltip ? F(i.$slots, "tooltip", {
|
|
210
210
|
key: 0,
|
|
211
|
-
values:
|
|
212
|
-
}) :
|
|
213
|
-
|
|
214
|
-
data:
|
|
215
|
-
categories:
|
|
216
|
-
|
|
217
|
-
yFormatter:
|
|
218
|
-
}, null, 8, ["data", "categories", "
|
|
219
|
-
]) :
|
|
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
|
-
|
|
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
|
|
2
|
-
import { Scatter as M, Position as
|
|
3
|
-
import { VisXYContainer as
|
|
4
|
-
import { LegendPosition as
|
|
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
|
|
6
|
+
const _ = {
|
|
8
7
|
ref: "slotWrapper",
|
|
9
8
|
class: "hidden"
|
|
10
|
-
},
|
|
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
|
-
|
|
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(
|
|
53
|
-
const e =
|
|
54
|
-
var
|
|
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(
|
|
60
|
-
let o = (
|
|
61
|
-
return Object.keys(e.categories).length === 1 && (o = (
|
|
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 =
|
|
65
|
-
function
|
|
66
|
-
return n.value =
|
|
64
|
+
}, C = h;
|
|
65
|
+
function F(i) {
|
|
66
|
+
return n.value = i, V();
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return typeof window > "u" ? "" :
|
|
68
|
+
function V(i) {
|
|
69
|
+
return typeof window > "u" ? "" : y.value ? y.value.innerHTML : "";
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
[M.selectors.point]:
|
|
73
|
-
},
|
|
74
|
-
return (
|
|
75
|
-
style:
|
|
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:
|
|
77
|
+
flexDirection: P.value ? "column-reverse" : "column",
|
|
78
78
|
gap: "var(--vis-legend-spacing)"
|
|
79
79
|
})
|
|
80
80
|
}, [
|
|
81
|
-
s(
|
|
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(),
|
|
89
|
+
e.hideTooltip ? r("", !0) : (l(), u(t(W), {
|
|
90
90
|
key: 0,
|
|
91
|
-
triggers:
|
|
91
|
+
triggers: z
|
|
92
92
|
})),
|
|
93
|
-
s(
|
|
94
|
-
x:
|
|
95
|
-
y:
|
|
93
|
+
s(t($), {
|
|
94
|
+
x: t(v),
|
|
95
|
+
y: t(b),
|
|
96
96
|
color: A,
|
|
97
|
-
size:
|
|
98
|
-
labelPosition: e.labelPosition ||
|
|
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(),
|
|
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
|
-
},
|
|
115
|
-
e.hideYAxis ? r("", !0) : (l(),
|
|
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
|
-
},
|
|
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(),
|
|
128
|
+
e.hideLegend ? r("", !0) : (l(), p("div", {
|
|
129
129
|
key: 0,
|
|
130
|
-
style:
|
|
130
|
+
style: d({
|
|
131
131
|
display: "flex",
|
|
132
132
|
justifyContent: N.value
|
|
133
133
|
})
|
|
134
134
|
}, [
|
|
135
|
-
s(
|
|
135
|
+
s(t(j), {
|
|
136
136
|
class: "bulletLegendOverrides",
|
|
137
|
-
style:
|
|
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",
|
|
148
|
-
|
|
147
|
+
w("div", _, [
|
|
148
|
+
t(T).tooltip ? k(i.$slots, "tooltip", {
|
|
149
149
|
key: 0,
|
|
150
150
|
values: n.value
|
|
151
|
-
}) : n.value ? k(
|
|
151
|
+
}) : n.value ? k(i.$slots, "fallback", { key: 1 }, () => [
|
|
152
152
|
s(Y, {
|
|
153
153
|
data: n.value,
|
|
154
154
|
categories: e.categories || {},
|
|
155
|
-
|
|
155
|
+
"title-formatter": e.tooltipTitleFormatter,
|
|
156
156
|
yFormatter: e.yFormatter
|
|
157
|
-
}, null, 8, ["data", "categories", "
|
|
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
|
-
|
|
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.
|