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