vue-chrts 0.2.4 → 0.2.5-test.2
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 +107 -79
- package/dist/components/AreaChart/types.d.ts +15 -0
- package/dist/components/BarChart/BarChart.js +160 -122
- package/dist/components/BarChart/BarChart.vue.d.ts +1 -1
- package/dist/components/BarChart/types.d.ts +27 -11
- package/dist/components/BubbleChart/BubbleChart.js +74 -56
- package/dist/components/BubbleChart/types.d.ts +4 -0
- package/dist/components/DonutChart/DonutChart.js +81 -75
- package/dist/components/DonutChart/types.d.ts +10 -0
- package/dist/components/LineChart/LineChart.js +26 -127
- package/dist/components/LineChart/LineChart.vue.d.ts +3 -10
- package/dist/components/LineChart/types.d.ts +2 -140
- package/dist/components/Tooltip.js +24 -24
- package/dist/index.d.ts +1 -2
- package/dist/index.js +14 -16
- package/dist/types.d.ts +6 -2
- package/dist/types.js +4 -4
- package/package.json +1 -1
- package/dist/components/AreaStackedChart/AreaStackedChart.js +0 -77
- package/dist/components/AreaStackedChart/AreaStackedChart.vue.d.ts +0 -14
- package/dist/components/AreaStackedChart/AreaStackedChart2.js +0 -4
- package/dist/components/AreaStackedChart/types.d.ts +0 -86
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Position as
|
|
3
|
-
import { createMarkers as
|
|
1
|
+
import { defineComponent as N, useSlots as W, useTemplateRef as E, ref as M, computed as m, createElementBlock as f, openBlock as c, normalizeClass as w, normalizeStyle as v, createVNode as y, createCommentVNode as u, createElementVNode as X, unref as n, withCtx as z, createBlock as g, Fragment as h, renderList as R, mergeProps as x, renderSlot as T } from "vue";
|
|
2
|
+
import { Position as L, CurveType as C } from "@unovis/ts";
|
|
3
|
+
import { createMarkers as Y, getFirstPropertyValue as U } from "../../utils.js";
|
|
4
4
|
import H from "../Tooltip.js";
|
|
5
|
-
import { VisXYContainer as
|
|
6
|
-
import { LegendPosition as
|
|
7
|
-
const
|
|
5
|
+
import { VisXYContainer as q, VisTooltip as J, VisArea as K, VisLine as Q, VisAxis as A, VisCrosshair as Z, VisBulletLegend as I } from "@unovis/vue";
|
|
6
|
+
import { LegendPosition as _ } from "../../types.js";
|
|
7
|
+
const ee = {
|
|
8
8
|
ref: "slotWrapper",
|
|
9
9
|
style: { display: "none" }
|
|
10
|
-
},
|
|
10
|
+
}, te = 0.5, $ = "#3b82f6", se = /* @__PURE__ */ N({
|
|
11
11
|
__name: "AreaChart",
|
|
12
12
|
props: {
|
|
13
13
|
data: {},
|
|
@@ -20,15 +20,21 @@ const ie = {
|
|
|
20
20
|
xFormatter: {},
|
|
21
21
|
yFormatter: {},
|
|
22
22
|
curveType: {},
|
|
23
|
+
hideArea: { type: Boolean, default: !1 },
|
|
24
|
+
gradientStops: { default: () => [
|
|
25
|
+
{ offset: "0%", stopOpacity: 1 },
|
|
26
|
+
{ offset: "75%", stopOpacity: 0 }
|
|
27
|
+
] },
|
|
23
28
|
lineWidth: { default: 2 },
|
|
24
29
|
lineDashArray: {},
|
|
25
|
-
xNumTicks: {
|
|
30
|
+
xNumTicks: {},
|
|
26
31
|
xExplicitTicks: {},
|
|
27
32
|
minMaxTicksOnly: { type: Boolean },
|
|
28
|
-
yNumTicks: {
|
|
29
|
-
hideLegend: { type: Boolean },
|
|
33
|
+
yNumTicks: {},
|
|
34
|
+
hideLegend: { type: Boolean, default: !1 },
|
|
30
35
|
hideTooltip: { type: Boolean },
|
|
31
|
-
legendPosition: {},
|
|
36
|
+
legendPosition: { default: _.BottomCenter },
|
|
37
|
+
legendStyle: { default: void 0 },
|
|
32
38
|
xDomainLine: { type: Boolean },
|
|
33
39
|
yDomainLine: { type: Boolean },
|
|
34
40
|
xTickLine: { type: Boolean },
|
|
@@ -44,78 +50,96 @@ const ie = {
|
|
|
44
50
|
xDomain: {}
|
|
45
51
|
},
|
|
46
52
|
emits: ["click"],
|
|
47
|
-
setup(
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
setup(e, { emit: D }) {
|
|
54
|
+
const b = D, i = e, B = W(), p = E("slotWrapper"), d = M(), k = m(() => {
|
|
55
|
+
const o = Object.values(i.categories).map(
|
|
56
|
+
(l, t) => `var(--vis-color${t})`
|
|
57
|
+
);
|
|
58
|
+
return Object.values(i.categories).map(
|
|
59
|
+
(l, t) => l.color ?? o[t]
|
|
60
|
+
);
|
|
61
|
+
}), O = m(() => i.markerConfig ? Y(i.markerConfig) : ""), V = m(() => i.legendPosition.startsWith("top")), F = m(() => i.legendPosition.includes("left") ? "flex-start" : i.legendPosition.includes("right") ? "flex-end" : "center"), G = m(() => {
|
|
62
|
+
const o = (t, a) => {
|
|
63
|
+
var r;
|
|
64
|
+
return `
|
|
65
|
+
<linearGradient id="gradient${t}-${a}" gradientTransform="rotate(90)">
|
|
66
|
+
${((r = i.gradientStops) == null ? void 0 : r.map(
|
|
67
|
+
(s) => `<stop offset="${s.offset}" stop-color="${a}" stop-opacity="${s.stopOpacity}" />`
|
|
68
|
+
).join("")) ?? ""}
|
|
69
|
+
<stop offset="100%" stop-color="${a}" stop-opacity="0" />
|
|
55
70
|
</linearGradient>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
`;
|
|
72
|
+
}, l = (t, a) => {
|
|
73
|
+
var r;
|
|
74
|
+
return `
|
|
75
|
+
<linearGradient id="gradient${t}-${a}" gradientTransform="rotate(90)">
|
|
76
|
+
|
|
77
|
+
${((r = i.gradientStops) == null ? void 0 : r.map(
|
|
78
|
+
(s) => `
|
|
79
|
+
<stop offset="${s.offset}" style="stop-color:var(${a});stop-opacity:${s.stopOpacity}" />
|
|
80
|
+
`
|
|
81
|
+
).join("")) ?? ""}
|
|
60
82
|
</linearGradient>
|
|
61
83
|
`;
|
|
62
|
-
|
|
63
|
-
|
|
84
|
+
};
|
|
85
|
+
return k.value.map(
|
|
86
|
+
(t, a) => t != null && t.includes("#") ? o(a, t) : l(a, t ?? $)
|
|
64
87
|
).join("");
|
|
65
88
|
});
|
|
66
|
-
function P(
|
|
89
|
+
function P(o) {
|
|
67
90
|
var l;
|
|
68
91
|
return {
|
|
69
|
-
y: (
|
|
70
|
-
color: ((l =
|
|
92
|
+
y: (t) => Number(t[o]),
|
|
93
|
+
color: ((l = i.categories[o]) == null ? void 0 : l.color) ?? $
|
|
71
94
|
};
|
|
72
95
|
}
|
|
73
|
-
function
|
|
74
|
-
return typeof window > "u" ? "" :
|
|
96
|
+
function S(o) {
|
|
97
|
+
return typeof window > "u" ? "" : p.value ? p.value.innerHTML : "";
|
|
75
98
|
}
|
|
76
|
-
function
|
|
77
|
-
return
|
|
99
|
+
function j(o) {
|
|
100
|
+
return d.value = o, S();
|
|
78
101
|
}
|
|
79
|
-
return (
|
|
80
|
-
style:
|
|
102
|
+
return (o, l) => (c(), f("div", {
|
|
103
|
+
style: v({
|
|
81
104
|
display: "flex",
|
|
82
|
-
flexDirection:
|
|
105
|
+
flexDirection: V.value ? "column-reverse" : "column",
|
|
106
|
+
gap: "var(--vis-legend-spacing)"
|
|
83
107
|
}),
|
|
84
|
-
class:
|
|
85
|
-
onClick: l[0] || (l[0] = (
|
|
108
|
+
class: w({ markers: !!i.markerConfig }),
|
|
109
|
+
onClick: l[0] || (l[0] = (t) => b("click", t, d.value))
|
|
86
110
|
}, [
|
|
87
|
-
|
|
111
|
+
y(n(q), {
|
|
88
112
|
data: e.data,
|
|
89
113
|
height: e.height,
|
|
90
114
|
padding: e.padding,
|
|
91
|
-
"svg-defs":
|
|
115
|
+
"svg-defs": G.value + O.value,
|
|
92
116
|
"y-domain": e.yDomain,
|
|
93
117
|
"x-domain": e.xDomain
|
|
94
118
|
}, {
|
|
95
|
-
default:
|
|
96
|
-
e.hideTooltip ?
|
|
119
|
+
default: z(() => [
|
|
120
|
+
e.hideTooltip ? u("", !0) : (c(), g(n(J), {
|
|
97
121
|
key: 0,
|
|
98
|
-
"horizontal-placement":
|
|
99
|
-
"vertical-placement":
|
|
122
|
+
"horizontal-placement": n(L).Right,
|
|
123
|
+
"vertical-placement": n(L).Top
|
|
100
124
|
}, null, 8, ["horizontal-placement", "vertical-placement"])),
|
|
101
|
-
(
|
|
102
|
-
|
|
103
|
-
x: (
|
|
104
|
-
}, { ref_for: !0 }, P(
|
|
105
|
-
color: `url(#gradient${
|
|
106
|
-
opacity: te,
|
|
107
|
-
"curve-type": e.curveType ??
|
|
108
|
-
}), null, 16, ["x", "color", "curve-type"]),
|
|
109
|
-
|
|
110
|
-
x: (
|
|
111
|
-
y: (
|
|
112
|
-
color:
|
|
113
|
-
"curve-type": e.curveType ??
|
|
125
|
+
(c(!0), f(h, null, R(Object.keys(i.categories), (t, a) => (c(), f(h, { key: t }, [
|
|
126
|
+
y(n(K), x({
|
|
127
|
+
x: (r, s) => s
|
|
128
|
+
}, { ref_for: !0 }, P(t), {
|
|
129
|
+
color: `url(#gradient${a}-${k.value[a]})`,
|
|
130
|
+
opacity: e.hideArea ? 0 : te,
|
|
131
|
+
"curve-type": e.curveType ?? n(C).MonotoneX
|
|
132
|
+
}), null, 16, ["x", "color", "opacity", "curve-type"]),
|
|
133
|
+
y(n(Q), {
|
|
134
|
+
x: (r, s) => s,
|
|
135
|
+
y: (r) => r[t],
|
|
136
|
+
color: k.value[a],
|
|
137
|
+
"curve-type": e.curveType ?? n(C).MonotoneX,
|
|
114
138
|
"line-width": e.lineWidth,
|
|
115
|
-
lineDashArray: e.lineDashArray ? e.lineDashArray[
|
|
139
|
+
lineDashArray: e.lineDashArray ? e.lineDashArray[a] : void 0
|
|
116
140
|
}, null, 8, ["x", "y", "color", "curve-type", "line-width", "lineDashArray"])
|
|
117
141
|
], 64))), 128)),
|
|
118
|
-
e.hideXAxis ?
|
|
142
|
+
e.hideXAxis ? u("", !0) : (c(), g(n(A), {
|
|
119
143
|
key: 1,
|
|
120
144
|
type: "x",
|
|
121
145
|
label: e.xLabel,
|
|
@@ -128,7 +152,7 @@ const ie = {
|
|
|
128
152
|
"tick-line": e.xTickLine,
|
|
129
153
|
"min-max-ticks-only": e.minMaxTicksOnly
|
|
130
154
|
}, null, 8, ["label", "num-ticks", "tick-format", "tick-values", "grid-line", "domain-line", "tick-line", "min-max-ticks-only"])),
|
|
131
|
-
e.hideYAxis ?
|
|
155
|
+
e.hideYAxis ? u("", !0) : (c(), g(n(A), {
|
|
132
156
|
key: 2,
|
|
133
157
|
type: "y",
|
|
134
158
|
label: e.yLabel,
|
|
@@ -138,40 +162,44 @@ const ie = {
|
|
|
138
162
|
"domain-line": e.yDomainLine,
|
|
139
163
|
"tick-line": e.yTickLine
|
|
140
164
|
}, null, 8, ["label", "num-ticks", "tick-format", "grid-line", "domain-line", "tick-line"])),
|
|
141
|
-
e.hideTooltip ?
|
|
165
|
+
e.hideTooltip ? u("", !0) : (c(), g(n(Z), x({ key: 3 }, e.crosshairConfig, { template: j }), null, 16))
|
|
142
166
|
]),
|
|
143
167
|
_: 1
|
|
144
168
|
}, 8, ["data", "height", "padding", "svg-defs", "y-domain", "x-domain"]),
|
|
145
|
-
|
|
169
|
+
i.hideLegend ? u("", !0) : (c(), f("div", {
|
|
146
170
|
key: 0,
|
|
147
|
-
style:
|
|
171
|
+
style: v({
|
|
148
172
|
display: "flex",
|
|
149
|
-
|
|
150
|
-
justifyContent: "flex-end",
|
|
151
|
-
paddingBottom: g.value ? "1rem" : void 0,
|
|
152
|
-
paddingTop: g.value ? void 0 : "1rem"
|
|
173
|
+
justifyContent: F.value
|
|
153
174
|
})
|
|
154
175
|
}, [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
176
|
+
y(n(I), {
|
|
177
|
+
style: v([
|
|
178
|
+
i.legendStyle,
|
|
179
|
+
"display: flex; gap: var(--vis-legend-spacing);"
|
|
180
|
+
]),
|
|
181
|
+
items: Object.values(i.categories).map((t) => ({
|
|
182
|
+
...t,
|
|
183
|
+
color: Array.isArray(t.color) ? t.color[0] : t.color
|
|
184
|
+
}))
|
|
185
|
+
}, null, 8, ["style", "items"])
|
|
158
186
|
], 4)),
|
|
159
|
-
X("div",
|
|
160
|
-
|
|
187
|
+
X("div", ee, [
|
|
188
|
+
n(B).tooltip ? T(o.$slots, "tooltip", {
|
|
161
189
|
key: 0,
|
|
162
|
-
values:
|
|
163
|
-
}) :
|
|
164
|
-
|
|
165
|
-
data:
|
|
190
|
+
values: d.value
|
|
191
|
+
}) : d.value ? T(o.$slots, "fallback", { key: 1 }, () => [
|
|
192
|
+
y(H, {
|
|
193
|
+
data: d.value,
|
|
166
194
|
categories: e.categories,
|
|
167
|
-
toolTipTitle:
|
|
168
|
-
yFormatter:
|
|
195
|
+
toolTipTitle: n(U)(d.value) ?? "",
|
|
196
|
+
yFormatter: i.yFormatter
|
|
169
197
|
}, null, 8, ["data", "categories", "toolTipTitle", "yFormatter"])
|
|
170
|
-
]) :
|
|
198
|
+
]) : u("", !0)
|
|
171
199
|
], 512)
|
|
172
200
|
], 6));
|
|
173
201
|
}
|
|
174
202
|
});
|
|
175
203
|
export {
|
|
176
|
-
|
|
204
|
+
se as default
|
|
177
205
|
};
|
|
@@ -57,6 +57,17 @@ export interface AreaChartProps<T> {
|
|
|
57
57
|
* See `CurveType` for available options.
|
|
58
58
|
*/
|
|
59
59
|
curveType?: CurveType;
|
|
60
|
+
/**
|
|
61
|
+
* If `true`, hides the area fill, displaying only the line.
|
|
62
|
+
*/
|
|
63
|
+
hideArea?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Edit the gradient stops for the area fill.
|
|
66
|
+
*/
|
|
67
|
+
gradientStops?: Array<{
|
|
68
|
+
offset: string;
|
|
69
|
+
stopOpacity: number;
|
|
70
|
+
}>;
|
|
60
71
|
/**
|
|
61
72
|
* The width of the line in pixels. Default is 2px.
|
|
62
73
|
*/
|
|
@@ -94,6 +105,10 @@ export interface AreaChartProps<T> {
|
|
|
94
105
|
* See `LegendPosition` for available options.
|
|
95
106
|
*/
|
|
96
107
|
legendPosition?: LegendPosition;
|
|
108
|
+
/**
|
|
109
|
+
* Optional style object for the legend container. Allows custom CSS styling.
|
|
110
|
+
*/
|
|
111
|
+
legendStyle?: string | Record<string, string>;
|
|
97
112
|
/**
|
|
98
113
|
* If `true`, displays a domain line (axis line) along the x-axis.
|
|
99
114
|
*/
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Orientation as
|
|
3
|
-
import { getFirstPropertyValue as
|
|
4
|
-
import { useStackedGrouped as
|
|
5
|
-
import { VisXYContainer as
|
|
6
|
-
import
|
|
7
|
-
import { LegendPosition as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as W, useSlots as X, useTemplateRef as Y, ref as j, computed as k, createElementBlock as v, openBlock as l, normalizeStyle as L, createVNode as b, createCommentVNode as f, createElementVNode as H, unref as a, withCtx as $, createBlock as c, Fragment as q, renderList as I, renderSlot as C } from "vue";
|
|
2
|
+
import { Orientation as g, 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 te, VisAxis as V, VisBulletLegend as ae } from "@unovis/vue";
|
|
6
|
+
import ie from "../Tooltip.js";
|
|
7
|
+
import { LegendPosition as ne } from "../../types.js";
|
|
8
|
+
const oe = {
|
|
9
9
|
ref: "slotWrapper",
|
|
10
10
|
style: { display: "none" }
|
|
11
|
-
},
|
|
11
|
+
}, ye = /* @__PURE__ */ W({
|
|
12
12
|
__name: "BarChart",
|
|
13
13
|
props: {
|
|
14
14
|
data: {},
|
|
@@ -25,18 +25,19 @@ const U = {
|
|
|
25
25
|
categories: {},
|
|
26
26
|
xFormatter: {},
|
|
27
27
|
yFormatter: {},
|
|
28
|
-
yNumTicks: {
|
|
28
|
+
yNumTicks: {},
|
|
29
29
|
minMaxTicksOnly: { type: Boolean },
|
|
30
|
-
xNumTicks: {
|
|
30
|
+
xNumTicks: {},
|
|
31
31
|
xExplicitTicks: {},
|
|
32
32
|
yAxis: {},
|
|
33
|
-
groupPadding: {},
|
|
34
|
-
barPadding: {},
|
|
33
|
+
groupPadding: { default: 0 },
|
|
34
|
+
barPadding: { default: 0.2 },
|
|
35
35
|
radius: {},
|
|
36
|
-
hideLegend: { type: Boolean },
|
|
36
|
+
hideLegend: { type: Boolean, default: !1 },
|
|
37
37
|
hideTooltip: { type: Boolean, default: !1 },
|
|
38
|
-
orientation: { default:
|
|
39
|
-
legendPosition: {},
|
|
38
|
+
orientation: { default: g.Vertical },
|
|
39
|
+
legendPosition: { default: ne.BottomCenter },
|
|
40
|
+
legendStyle: { default: void 0 },
|
|
40
41
|
xDomainLine: { type: Boolean },
|
|
41
42
|
yDomainLine: { type: Boolean },
|
|
42
43
|
xTickLine: { type: Boolean },
|
|
@@ -47,137 +48,174 @@ const U = {
|
|
|
47
48
|
hideYAxis: { type: Boolean },
|
|
48
49
|
stackedGroupedSpacing: { default: 0.1 },
|
|
49
50
|
stackAndGrouped: { type: Boolean },
|
|
51
|
+
valueLabel: {},
|
|
50
52
|
xAxis: {}
|
|
51
53
|
},
|
|
52
54
|
emits: ["click"],
|
|
53
|
-
setup(
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
55
|
+
setup(e, { emit: G }) {
|
|
56
|
+
const S = G, t = e, O = X(), h = Y("slotWrapper"), u = j();
|
|
57
|
+
if (t.valueLabel && !t.xAxis)
|
|
58
|
+
throw new Error(
|
|
59
|
+
"BarChart: 'xAxis' prop is required when 'valueLabel' is enabled. Please provide an 'xAxis' to display value labels."
|
|
60
|
+
);
|
|
61
|
+
if (!t.yAxis || t.yAxis.length === 0)
|
|
56
62
|
throw new Error("yAxis is required");
|
|
57
|
-
const
|
|
58
|
-
var
|
|
59
|
-
return (
|
|
60
|
-
},
|
|
61
|
-
() =>
|
|
62
|
-
data:
|
|
63
|
-
categories:
|
|
64
|
-
stackAndGrouped:
|
|
65
|
-
xAxis:
|
|
66
|
-
spacing:
|
|
63
|
+
const A = k(() => t.yAxis.map((i) => (o) => o[i])), B = (i, o) => {
|
|
64
|
+
var n;
|
|
65
|
+
return (n = Object.values(t.categories)[o]) == null ? void 0 : n.color;
|
|
66
|
+
}, y = k(
|
|
67
|
+
() => Q({
|
|
68
|
+
data: t.data,
|
|
69
|
+
categories: t.categories,
|
|
70
|
+
stackAndGrouped: t.stackAndGrouped,
|
|
71
|
+
xAxis: t.xAxis,
|
|
72
|
+
spacing: t.stackedGroupedSpacing
|
|
67
73
|
}).value
|
|
68
|
-
),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
function b(e) {
|
|
72
|
-
return r.value = e, P();
|
|
74
|
+
), w = k(() => t.legendPosition.startsWith("top")), D = k(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center");
|
|
75
|
+
function T(i) {
|
|
76
|
+
return u.value = i, E();
|
|
73
77
|
}
|
|
74
|
-
function
|
|
75
|
-
return typeof window > "u" ? "" :
|
|
78
|
+
function E(i) {
|
|
79
|
+
return typeof window > "u" ? "" : h.value ? h.value.innerHTML : "";
|
|
76
80
|
}
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
const P = t.yAxis.map((i) => (o) => o[i]), N = P.length, z = t.data.flatMap(
|
|
82
|
+
(i, o) => P.map((n, s) => ({
|
|
83
|
+
x: o,
|
|
84
|
+
y: Number(n(i) ?? 0),
|
|
85
|
+
itemIndex: s
|
|
86
|
+
}))
|
|
87
|
+
), M = (i) => {
|
|
88
|
+
if (t.stacked || t.stackAndGrouped) return i.x;
|
|
89
|
+
const o = N;
|
|
90
|
+
if (o <= 1) return i.x;
|
|
91
|
+
const s = 1 - (t.groupPadding ?? 0), m = s / o, x = -s / 2, r = m * i.itemIndex + m / 2, p = 1 - (t.barPadding ?? 0), R = (x + r) * p;
|
|
92
|
+
return i.x + R;
|
|
93
|
+
};
|
|
94
|
+
return (i, o) => (l(), v("div", {
|
|
95
|
+
style: L({
|
|
79
96
|
display: "flex",
|
|
80
|
-
flexDirection:
|
|
81
|
-
gap: "
|
|
97
|
+
flexDirection: w.value ? "column-reverse" : "column",
|
|
98
|
+
gap: "var(--vis-legend-spacing)"
|
|
82
99
|
}),
|
|
83
|
-
onClick:
|
|
100
|
+
onClick: o[0] || (o[0] = (n) => S("click", n, u.value))
|
|
84
101
|
}, [
|
|
85
|
-
|
|
102
|
+
b(a(Z), {
|
|
86
103
|
padding: e.padding,
|
|
87
104
|
height: e.height
|
|
88
105
|
}, {
|
|
89
|
-
default:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
color:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
106
|
+
default: $(() => {
|
|
107
|
+
var n, s, m, x;
|
|
108
|
+
return [
|
|
109
|
+
e.valueLabel ? (l(), c(a(_), {
|
|
110
|
+
key: 0,
|
|
111
|
+
data: a(z),
|
|
112
|
+
x: M,
|
|
113
|
+
y: (r) => {
|
|
114
|
+
var d;
|
|
115
|
+
return r.y + (((d = t.valueLabel) == null ? void 0 : d.labelSpacing) ?? 0);
|
|
116
|
+
},
|
|
117
|
+
label: (n = t.valueLabel) == null ? void 0 : n.label,
|
|
118
|
+
backgroundColor: ((s = t.valueLabel) == null ? void 0 : s.backgroundColor) ?? "transparent",
|
|
119
|
+
color: ((m = t.valueLabel) == null ? void 0 : m.color) ?? "red",
|
|
120
|
+
labelFontSize: (x = t.valueLabel) == null ? void 0 : x.labelFontSize
|
|
121
|
+
}, null, 8, ["data", "y", "label", "backgroundColor", "color", "labelFontSize"])) : f("", !0),
|
|
122
|
+
b(a(ee), {
|
|
123
|
+
triggers: {
|
|
124
|
+
[a(J).selectors.bar]: T,
|
|
125
|
+
[a(U).selectors.bar]: T
|
|
126
|
+
}
|
|
127
|
+
}, null, 8, ["triggers"]),
|
|
128
|
+
e.stackAndGrouped ? (l(!0), v(q, { key: 1 }, I(y.value.states, (r) => (l(), c(a(F), {
|
|
129
|
+
key: r,
|
|
130
|
+
data: y.value.chartData,
|
|
131
|
+
x: (d, p) => p + y.value.positions[r],
|
|
132
|
+
y: y.value.bars[r],
|
|
133
|
+
color: y.value.colorFunctions[r],
|
|
134
|
+
"rounded-corners": e.radius ?? 0,
|
|
135
|
+
"group-padding": e.groupPadding ?? 0,
|
|
136
|
+
"bar-padding": e.barPadding,
|
|
137
|
+
orientation: e.orientation ?? a(g).Vertical
|
|
138
|
+
}, null, 8, ["data", "x", "y", "color", "rounded-corners", "group-padding", "bar-padding", "orientation"]))), 128)) : e.stacked ? (l(), c(a(F), {
|
|
139
|
+
key: 3,
|
|
140
|
+
data: e.data,
|
|
141
|
+
x: (r, d) => d,
|
|
142
|
+
y: A.value,
|
|
143
|
+
color: B,
|
|
144
|
+
"rounded-corners": e.radius ?? 0,
|
|
145
|
+
"group-padding": e.groupPadding ?? 0,
|
|
146
|
+
"bar-padding": e.barPadding ?? 0.2,
|
|
147
|
+
orientation: e.orientation ?? a(g).Vertical
|
|
148
|
+
}, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])) : (l(), c(a(te), {
|
|
149
|
+
key: 2,
|
|
150
|
+
data: e.data,
|
|
151
|
+
x: (r, d) => d,
|
|
152
|
+
y: A.value,
|
|
153
|
+
color: B,
|
|
154
|
+
"rounded-corners": e.radius ?? 0,
|
|
155
|
+
"group-padding": e.groupPadding ?? 0,
|
|
156
|
+
"bar-padding": e.barPadding ?? 0.2,
|
|
157
|
+
orientation: e.orientation ?? a(g).Vertical
|
|
158
|
+
}, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])),
|
|
159
|
+
e.hideXAxis ? f("", !0) : (l(), c(a(V), {
|
|
160
|
+
key: 4,
|
|
161
|
+
type: "x",
|
|
162
|
+
"tick-format": e.xFormatter,
|
|
163
|
+
label: e.xLabel,
|
|
164
|
+
"grid-line": e.xGridLine,
|
|
165
|
+
"domain-line": !!e.xDomainLine,
|
|
166
|
+
"tick-line": e.xTickLine,
|
|
167
|
+
"num-ticks": e.xNumTicks,
|
|
168
|
+
"tick-values": e.xExplicitTicks,
|
|
169
|
+
minMaxTicksOnly: e.minMaxTicksOnly
|
|
170
|
+
}, null, 8, ["tick-format", "label", "grid-line", "domain-line", "tick-line", "num-ticks", "tick-values", "minMaxTicksOnly"])),
|
|
171
|
+
e.hideYAxis ? f("", !0) : (l(), c(a(V), {
|
|
172
|
+
key: 5,
|
|
173
|
+
type: "y",
|
|
174
|
+
label: e.yLabel,
|
|
175
|
+
"grid-line": e.orientation !== a(g).Horizontal && e.yGridLine,
|
|
176
|
+
"domain-line": !!e.yDomainLine,
|
|
177
|
+
"tick-format": e.yFormatter,
|
|
178
|
+
"num-ticks": e.yNumTicks,
|
|
179
|
+
"tick-line": e.yTickLine
|
|
180
|
+
}, null, 8, ["label", "grid-line", "domain-line", "tick-format", "num-ticks", "tick-line"]))
|
|
181
|
+
];
|
|
182
|
+
}),
|
|
150
183
|
_: 1
|
|
151
184
|
}, 8, ["padding", "height"]),
|
|
152
|
-
|
|
185
|
+
t.hideLegend ? f("", !0) : (l(), v("div", {
|
|
153
186
|
key: 0,
|
|
154
|
-
style:
|
|
187
|
+
style: L({
|
|
155
188
|
display: "flex",
|
|
156
|
-
|
|
157
|
-
justifyContent: "flex-end",
|
|
158
|
-
paddingBottom: h.value ? "1rem" : void 0
|
|
189
|
+
justifyContent: D.value
|
|
159
190
|
})
|
|
160
191
|
}, [
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
192
|
+
b(a(ae), {
|
|
193
|
+
style: L([
|
|
194
|
+
t.legendStyle,
|
|
195
|
+
"display: flex; gap: var(--vis-legend-spacing);"
|
|
196
|
+
]),
|
|
197
|
+
items: Object.values(t.categories).map((n) => ({
|
|
198
|
+
...n,
|
|
199
|
+
color: Array.isArray(n.color) ? n.color[0] : n.color
|
|
200
|
+
}))
|
|
201
|
+
}, null, 8, ["style", "items"])
|
|
164
202
|
], 4)),
|
|
165
|
-
|
|
166
|
-
|
|
203
|
+
H("div", oe, [
|
|
204
|
+
a(O).tooltip ? C(i.$slots, "tooltip", {
|
|
167
205
|
key: 0,
|
|
168
|
-
values:
|
|
169
|
-
}) :
|
|
170
|
-
|
|
171
|
-
data:
|
|
172
|
-
categories:
|
|
173
|
-
toolTipTitle:
|
|
174
|
-
yFormatter:
|
|
206
|
+
values: u.value
|
|
207
|
+
}) : u.value ? C(i.$slots, "fallback", { key: 1 }, () => [
|
|
208
|
+
b(ie, {
|
|
209
|
+
data: u.value,
|
|
210
|
+
categories: t.categories,
|
|
211
|
+
toolTipTitle: a(K)(u.value) ?? "",
|
|
212
|
+
yFormatter: t.orientation === a(g).Horizontal ? t.xFormatter : t.yFormatter
|
|
175
213
|
}, null, 8, ["data", "categories", "toolTipTitle", "yFormatter"])
|
|
176
|
-
]) :
|
|
214
|
+
]) : f("", !0)
|
|
177
215
|
], 512)
|
|
178
216
|
], 4));
|
|
179
217
|
}
|
|
180
218
|
});
|
|
181
219
|
export {
|
|
182
|
-
|
|
220
|
+
ye as default
|
|
183
221
|
};
|