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.
- package/dist/components/AreaChart/AreaChart.d.ts +1 -1
- package/dist/components/AreaChart/AreaChart.js +102 -102
- package/dist/components/BarChart/BarChart.js +95 -95
- package/dist/components/BubbleChart/BubbleChart.d.ts +1 -1
- package/dist/components/BubbleChart/BubbleChart.js +39 -39
- package/dist/components/DagreGraph/DagreGraph.js +70 -70
- package/dist/components/DonutChart/DonutChart.js +63 -63
- package/dist/components/DualChart/DualChart.d.ts +1 -1
- package/dist/components/DualChart/DualChart.js +85 -85
- package/dist/components/DualChart/types.d.ts +1 -1
- package/dist/components/GanttChart/GanttChart.d.ts +1 -1
- package/dist/components/GanttChart/GanttChart.js +45 -45
- package/dist/components/GanttChart/GanttChart.vue.d.ts +1 -1
- package/dist/components/LineChart/LineChart.js +2 -2
- package/dist/components/Maps/DottedMap/DottedMap.js +2 -2
- package/dist/components/Maps/DottedMap/core.js +17 -17
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap.js +4 -4
- package/dist/components/SankeyChart/SankeyChart.js +43 -43
- package/dist/components/Tooltip.js +28 -28
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -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,
|
|
2
|
-
import { Position as $, CurveType as
|
|
3
|
-
import { createScopedMarkers as
|
|
4
|
-
import
|
|
5
|
-
import { VisXYContainer as
|
|
6
|
-
import { LegendPosition as
|
|
7
|
-
const
|
|
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",
|
|
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:
|
|
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(
|
|
62
|
+
setup(e, { emit: V }) {
|
|
63
63
|
var b;
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
(
|
|
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(
|
|
69
|
-
(
|
|
68
|
+
return Object.values(t.categories).map(
|
|
69
|
+
(o, r) => o.color ?? i[r]
|
|
70
70
|
);
|
|
71
|
-
}),
|
|
72
|
-
var
|
|
73
|
-
return (
|
|
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
|
|
76
|
-
if (!((
|
|
77
|
-
const
|
|
78
|
-
for (const
|
|
79
|
-
|
|
80
|
-
return
|
|
81
|
-
}), W = u(() =>
|
|
82
|
-
var
|
|
83
|
-
const
|
|
84
|
-
(s) => `<stop offset="${s.offset}" stop-color="${
|
|
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="${
|
|
88
|
-
${
|
|
89
|
-
<stop offset="100%" stop-color="${
|
|
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(
|
|
94
|
-
var
|
|
93
|
+
function Y(i) {
|
|
94
|
+
var o;
|
|
95
95
|
return {
|
|
96
|
-
y: (
|
|
97
|
-
color: ((
|
|
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(
|
|
101
|
-
(
|
|
100
|
+
const z = u(() => Object.keys(t.categories).map(
|
|
101
|
+
(i) => (o) => Number(o[i])
|
|
102
102
|
)), R = u(() => {
|
|
103
|
-
const
|
|
104
|
-
return
|
|
105
|
-
let
|
|
106
|
-
for (let s = 0; s <=
|
|
107
|
-
|
|
108
|
-
return
|
|
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(() => (
|
|
111
|
-
function U(
|
|
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(
|
|
115
|
-
return
|
|
114
|
+
function H(i) {
|
|
115
|
+
return m.value = i, U();
|
|
116
116
|
}
|
|
117
|
-
return (
|
|
118
|
-
var
|
|
119
|
-
return
|
|
120
|
-
style:
|
|
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: (
|
|
128
|
-
onClick:
|
|
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
|
-
|
|
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:
|
|
140
|
-
e.hideTooltip ? d("", !0) : (
|
|
139
|
+
default: _(() => [
|
|
140
|
+
e.hideTooltip ? d("", !0) : (c(), y(n(ae), {
|
|
141
141
|
key: 0,
|
|
142
|
-
"horizontal-placement":
|
|
143
|
-
"vertical-placement":
|
|
144
|
-
"follow-cursor":
|
|
145
|
-
"show-delay":
|
|
146
|
-
"hide-delay":
|
|
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 ? (
|
|
149
|
-
e.hideArea ? d("", !0) : (
|
|
148
|
+
e.stacked ? (c(), f(p, { key: 1 }, [
|
|
149
|
+
e.hideArea ? d("", !0) : (c(), y(n(B), {
|
|
150
150
|
key: 0,
|
|
151
|
-
x: (
|
|
151
|
+
x: (a, l) => l,
|
|
152
152
|
y: z.value,
|
|
153
153
|
color: L.value,
|
|
154
154
|
opacity: F,
|
|
155
|
-
"curve-type": e.curveType ??
|
|
155
|
+
"curve-type": e.curveType ?? n(h).MonotoneX
|
|
156
156
|
}, null, 8, ["x", "y", "color", "curve-type"])),
|
|
157
|
-
|
|
158
|
-
x: (
|
|
157
|
+
g(n(O), {
|
|
158
|
+
x: (a, l) => l,
|
|
159
159
|
y: R.value,
|
|
160
160
|
color: L.value,
|
|
161
|
-
"curve-type": e.curveType ??
|
|
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)) : (
|
|
165
|
-
e.hideArea ? d("", !0) : (
|
|
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,
|
|
168
|
-
}, { ref_for: !0 }, Y(
|
|
169
|
-
color: `url(#gradient-${
|
|
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 ??
|
|
171
|
+
"curve-type": e.curveType ?? n(h).MonotoneX
|
|
172
172
|
}), null, 16, ["x", "color", "curve-type"])),
|
|
173
|
-
|
|
174
|
-
x: (s,
|
|
175
|
-
y: (s) => s[
|
|
176
|
-
color:
|
|
177
|
-
"curve-type": e.curveType ??
|
|
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[
|
|
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) : (
|
|
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) : (
|
|
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":
|
|
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) : (
|
|
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
|
-
|
|
212
|
+
t.hideLegend ? d("", !0) : (c(), f("div", {
|
|
213
213
|
key: 0,
|
|
214
|
-
style:
|
|
214
|
+
style: C({
|
|
215
215
|
display: "flex",
|
|
216
216
|
justifyContent: X.value
|
|
217
217
|
})
|
|
218
218
|
}, [
|
|
219
|
-
|
|
220
|
-
style:
|
|
221
|
-
|
|
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(
|
|
225
|
-
...
|
|
226
|
-
color: Array.isArray(
|
|
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
|
-
|
|
231
|
-
|
|
230
|
+
te("div", ue, [
|
|
231
|
+
n(S).tooltip ? D(i.$slots, "tooltip", {
|
|
232
232
|
key: 0,
|
|
233
|
-
values:
|
|
234
|
-
}) :
|
|
235
|
-
|
|
236
|
-
data:
|
|
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":
|
|
240
|
-
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,
|
|
244
|
+
], 14, se);
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
247
|
});
|
|
248
248
|
export {
|
|
249
|
-
|
|
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
|
|
2
|
-
import { Orientation as
|
|
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
|
|
5
|
-
import
|
|
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
|
|
7
|
+
const ne = {
|
|
8
8
|
ref: "slotWrapper",
|
|
9
9
|
style: { display: "none" }
|
|
10
|
-
},
|
|
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:
|
|
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(
|
|
62
|
-
const w = S,
|
|
63
|
-
if (
|
|
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 (!
|
|
67
|
+
if (!t.yAxis || t.yAxis.length === 0)
|
|
68
68
|
throw new Error("yAxis is required");
|
|
69
|
-
const A =
|
|
70
|
-
var
|
|
71
|
-
return (
|
|
72
|
-
},
|
|
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:
|
|
75
|
-
categories:
|
|
76
|
-
stackAndGrouped:
|
|
77
|
-
xAxis:
|
|
78
|
-
spacing:
|
|
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 =
|
|
81
|
-
function
|
|
82
|
-
|
|
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
|
|
85
|
-
(
|
|
86
|
-
x:
|
|
87
|
-
y: Number(
|
|
88
|
-
itemIndex:
|
|
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 = (
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
95
|
-
return
|
|
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 (
|
|
98
|
-
style:
|
|
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:
|
|
103
|
+
onClick: l[0] || (l[0] = (o) => w("click", o, y.value))
|
|
104
104
|
}, [
|
|
105
|
-
|
|
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
|
|
110
|
+
default: j(() => {
|
|
111
|
+
var o, u, f, x;
|
|
112
112
|
return [
|
|
113
|
-
e.valueLabel ? (
|
|
113
|
+
e.valueLabel ? (d(), s(a(Z), {
|
|
114
114
|
key: 0,
|
|
115
|
-
data:
|
|
115
|
+
data: a(M),
|
|
116
116
|
x: z,
|
|
117
117
|
y: (i) => {
|
|
118
|
-
var
|
|
119
|
-
return i.y + (((
|
|
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: (
|
|
122
|
-
backgroundColor: ((
|
|
123
|
-
color: ((
|
|
124
|
-
labelFontSize: (
|
|
125
|
-
}, null, 8, ["data", "y", "label", "backgroundColor", "color", "labelFontSize"])) :
|
|
126
|
-
e.hideTooltip ?
|
|
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:
|
|
129
|
-
"show-delay":
|
|
130
|
-
"hide-delay":
|
|
128
|
+
followCursor: t.tooltip.followCursor,
|
|
129
|
+
"show-delay": t.tooltip.showDelay,
|
|
130
|
+
"hide-delay": t.tooltip.hideDelay,
|
|
131
131
|
triggers: {
|
|
132
|
-
[
|
|
133
|
-
var
|
|
134
|
-
return
|
|
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
|
-
[
|
|
137
|
-
var
|
|
138
|
-
return
|
|
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 ? (
|
|
142
|
+
e.stackAndGrouped ? (d(!0), v($, { key: 2 }, q(m.value.states, (i) => (d(), s(a(G), {
|
|
143
143
|
key: i,
|
|
144
|
-
data:
|
|
145
|
-
x: (
|
|
146
|
-
y:
|
|
147
|
-
color:
|
|
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 ??
|
|
152
|
-
}, null, 8, ["data", "x", "y", "color", "rounded-corners", "group-padding", "bar-padding", "orientation"]))), 128)) : e.stacked ? (
|
|
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,
|
|
155
|
+
x: (i, r) => r,
|
|
156
156
|
y: A.value,
|
|
157
|
-
color:
|
|
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 ??
|
|
162
|
-
}, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])) : (
|
|
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,
|
|
165
|
+
x: (i, r) => r,
|
|
166
166
|
y: A.value,
|
|
167
|
-
color:
|
|
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 ??
|
|
171
|
+
orientation: e.orientation ?? a(g).Vertical
|
|
172
172
|
}, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])),
|
|
173
|
-
e.hideXAxis ?
|
|
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 ?
|
|
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 !==
|
|
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
|
-
|
|
201
|
+
t.hideLegend ? c("", !0) : (d(), v("div", {
|
|
202
202
|
key: 0,
|
|
203
|
-
style:
|
|
203
|
+
style: h({
|
|
204
204
|
display: "flex",
|
|
205
205
|
justifyContent: E.value
|
|
206
206
|
})
|
|
207
207
|
}, [
|
|
208
|
-
|
|
209
|
-
style:
|
|
210
|
-
|
|
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(
|
|
214
|
-
...
|
|
215
|
-
color: Array.isArray(
|
|
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
|
-
|
|
220
|
-
|
|
219
|
+
I("div", ne, [
|
|
220
|
+
a(D).tooltip ? F(n.$slots, "tooltip", {
|
|
221
221
|
key: 0,
|
|
222
|
-
values:
|
|
223
|
-
}) :
|
|
224
|
-
|
|
225
|
-
data:
|
|
226
|
-
categories:
|
|
227
|
-
"title-formatter":
|
|
228
|
-
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
|
-
]) :
|
|
230
|
+
]) : c("", !0)
|
|
231
231
|
], 512)
|
|
232
232
|
], 4));
|
|
233
233
|
}
|
|
234
234
|
});
|
|
235
235
|
export {
|
|
236
|
-
|
|
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
|
*/
|