vue-chrts 2.1.0-beta-6 → 2.1.0-beta-8
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 +95 -116
- package/dist/components/AreaChart/types.d.ts +1 -205
- package/dist/components/BarChart/BarChart.js +9 -9
- package/dist/components/BarChart/types.d.ts +1 -191
- package/dist/components/BubbleChart/BubbleChart.js +4 -4
- package/dist/components/BubbleChart/types.d.ts +1 -172
- package/dist/components/DagreGraph/DagreGraph.js +65 -62
- package/dist/components/DagreGraph/types.d.ts +1 -1
- package/dist/components/DonutChart/DonutChart.js +5 -5
- package/dist/components/DonutChart/types.d.ts +2 -68
- package/dist/components/DualChart/DualChart.js +125 -122
- package/dist/components/DualChart/types.d.ts +1 -1
- package/dist/components/GanttChart/GanttChart.js +6 -6
- package/dist/components/GanttChart/types.d.ts +1 -124
- package/dist/components/LineChart/LineChart.js +7 -12
- package/dist/components/LineChart/types.d.ts +1 -2
- package/dist/components/Maps/DottedMap/DottedMap.js +66 -79
- package/dist/components/Maps/DottedMap/DottedMap.vue.d.ts +0 -1
- package/dist/components/Maps/DottedMap/core.js +2 -2
- package/dist/components/Maps/DottedMap/core.vue.d.ts +1 -1
- package/dist/components/Maps/DottedMap/mapUtils.js +1 -1
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap.js +54 -56
- package/dist/components/Maps/TopoJSONMap/types.d.ts +5 -1
- package/dist/components/Maps/types.d.ts +0 -1
- package/dist/components/SankeyChart/SankeyChart.js +59 -56
- package/dist/components/SankeyChart/types.d.ts +1 -1
- package/dist/components/Tooltip.js +5 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/{@turf_boolean-point-in-polygon@7.3.1 → @turf_boolean-point-in-polygon@7.3.2}/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js +1 -1
- package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/orient2d.js +1 -1
- package/dist/packages/shared/dist/donut-chart.js +7 -0
- package/dist/packages/shared/dist/index.js +19 -0
- package/dist/types.d.ts +7 -101
- package/package.json +8 -2
- package/dist/components/DonutChart/types.js +0 -4
- package/dist/components/Maps/DottedMap/MapLegend.vue.d.ts +0 -6
- package/dist/components/Maps/DottedMap/MapZoomControls.js +0 -44
- package/dist/components/Maps/DottedMap/MapZoomControls.vue.d.ts +0 -13
- package/dist/components/Maps/DottedMap/MapZoomControls2.js +0 -4
- package/dist/types.js +0 -6
- /package/dist/node_modules/.pnpm/{@turf_invariant@7.3.1 → @turf_invariant@7.3.2}/node_modules/@turf/invariant/dist/esm/index.js +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as I, useSlots as K, useTemplateRef as q, ref as J, getCurrentInstance as Q, computed as
|
|
2
|
-
import { Position as
|
|
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
3
|
import { createScopedMarkers as ie } from "../../utils.js";
|
|
4
4
|
import oe from "../Tooltip.js";
|
|
5
|
-
import { VisXYContainer as ne, VisTooltip as ae, VisArea as
|
|
6
|
-
import { LegendPosition as
|
|
7
|
-
const
|
|
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 "../../packages/shared/dist/index.js";
|
|
7
|
+
const se = ["id"], ue = {
|
|
8
8
|
ref: "slotWrapper",
|
|
9
9
|
style: { display: "none" }
|
|
10
|
-
},
|
|
10
|
+
}, F = 0.5, N = "#3b82f6", ve = /* @__PURE__ */ I({
|
|
11
11
|
__name: "AreaChart",
|
|
12
12
|
props: {
|
|
13
13
|
data: {},
|
|
@@ -31,16 +31,11 @@ const ce = ["id"], de = {
|
|
|
31
31
|
xNumTicks: {},
|
|
32
32
|
xExplicitTicks: {},
|
|
33
33
|
minMaxTicksOnly: { type: Boolean },
|
|
34
|
-
xMinMaxTicksOnly: { type: Boolean },
|
|
35
|
-
yMinMaxTicksOnly: { type: Boolean },
|
|
36
|
-
minMaxTicksOnlyShowGridLines: { type: Boolean },
|
|
37
|
-
xMinMaxTicksOnlyShowGridLines: { type: Boolean },
|
|
38
|
-
yMinMaxTicksOnlyShowGridLines: { type: Boolean },
|
|
39
34
|
yNumTicks: {},
|
|
40
35
|
yExplicitTicks: {},
|
|
41
36
|
hideLegend: { type: Boolean, default: !1 },
|
|
42
37
|
hideTooltip: { type: Boolean },
|
|
43
|
-
legendPosition: { default:
|
|
38
|
+
legendPosition: { default: ce.BottomCenter },
|
|
44
39
|
legendStyle: { default: void 0 },
|
|
45
40
|
xDomainLine: { type: Boolean },
|
|
46
41
|
yDomainLine: { type: Boolean },
|
|
@@ -64,143 +59,127 @@ const ce = ["id"], de = {
|
|
|
64
59
|
}) }
|
|
65
60
|
},
|
|
66
61
|
emits: ["click"],
|
|
67
|
-
setup(e, { emit:
|
|
62
|
+
setup(e, { emit: V }) {
|
|
68
63
|
var b;
|
|
69
|
-
const
|
|
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(() => {
|
|
70
65
|
const i = Object.values(t.categories).map(
|
|
71
|
-
(
|
|
66
|
+
(o, r) => `var(--vis-color${r})`
|
|
72
67
|
);
|
|
73
68
|
return Object.values(t.categories).map(
|
|
74
|
-
(
|
|
69
|
+
(o, r) => o.color ?? i[r]
|
|
75
70
|
);
|
|
76
|
-
}),
|
|
71
|
+
}), M = u(() => t.yNumTicks !== void 0 ? t.yNumTicks : Math.max(2, Object.keys(t.categories ?? {}).length)), E = u(() => {
|
|
77
72
|
var i;
|
|
78
|
-
return (i = t.markerConfig) != null && i.config ? ie(t.markerConfig,
|
|
79
|
-
}),
|
|
80
|
-
var
|
|
81
|
-
if (!((
|
|
73
|
+
return (i = t.markerConfig) != null && i.config ? ie(t.markerConfig, k) : "";
|
|
74
|
+
}), P = u(() => {
|
|
75
|
+
var o;
|
|
76
|
+
if (!((o = t.markerConfig) != null && o.config)) return {};
|
|
82
77
|
const i = {};
|
|
83
|
-
for (const
|
|
84
|
-
i[`--vis-marker-${
|
|
78
|
+
for (const r of Object.keys(t.markerConfig.config))
|
|
79
|
+
i[`--vis-marker-${r}`] = `url("#${t.markerConfig.id}--${k}--${r}")`;
|
|
85
80
|
return i;
|
|
86
|
-
}),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<stop offset="100%" stop-color="${
|
|
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
|
+
).join("")) ?? "";
|
|
86
|
+
return `
|
|
87
|
+
<linearGradient id="${r}" gradientTransform="rotate(90)">
|
|
88
|
+
${a}
|
|
89
|
+
<stop offset="100%" stop-color="${i}" stop-opacity="0" />
|
|
95
90
|
</linearGradient>
|
|
96
91
|
`;
|
|
97
|
-
|
|
98
|
-
var r;
|
|
99
|
-
return `
|
|
100
|
-
<linearGradient id="gradient${n}-${o}" gradientTransform="rotate(90)">
|
|
101
|
-
|
|
102
|
-
${((r = t.gradientStops) == null ? void 0 : r.map(
|
|
103
|
-
(s) => `
|
|
104
|
-
<stop offset="${s.offset}" style="stop-color:var(${o});stop-opacity:${s.stopOpacity}" />
|
|
105
|
-
`
|
|
106
|
-
).join("")) ?? ""}
|
|
107
|
-
</linearGradient>
|
|
108
|
-
`;
|
|
109
|
-
};
|
|
110
|
-
return g.value.map(
|
|
111
|
-
(n, o) => n != null && n.includes("#") ? i(o, n) : a(o, n ?? C)
|
|
112
|
-
).join("");
|
|
113
|
-
});
|
|
92
|
+
}).join(""));
|
|
114
93
|
function Y(i) {
|
|
115
|
-
var
|
|
94
|
+
var o;
|
|
116
95
|
return {
|
|
117
|
-
y: (
|
|
118
|
-
color: ((
|
|
96
|
+
y: (r) => Number(r[i]),
|
|
97
|
+
color: ((o = t.categories[i]) == null ? void 0 : o.color) ?? N
|
|
119
98
|
};
|
|
120
99
|
}
|
|
121
|
-
const z =
|
|
122
|
-
(i) => (
|
|
123
|
-
)), R =
|
|
100
|
+
const z = u(() => Object.keys(t.categories).map(
|
|
101
|
+
(i) => (o) => Number(o[i])
|
|
102
|
+
)), R = u(() => {
|
|
124
103
|
const i = Object.keys(t.categories);
|
|
125
|
-
return i.map((
|
|
126
|
-
let
|
|
127
|
-
for (let s = 0; s <=
|
|
128
|
-
|
|
129
|
-
return
|
|
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;
|
|
130
109
|
});
|
|
131
|
-
}),
|
|
110
|
+
}), L = u(() => (i, o) => x.value[o] ?? N);
|
|
132
111
|
function U(i) {
|
|
133
|
-
return typeof window > "u" ? "" :
|
|
112
|
+
return typeof window > "u" ? "" : A.value ? A.value.innerHTML : "";
|
|
134
113
|
}
|
|
135
114
|
function H(i) {
|
|
136
115
|
return m.value = i, U();
|
|
137
116
|
}
|
|
138
|
-
return (i,
|
|
139
|
-
var
|
|
117
|
+
return (i, o) => {
|
|
118
|
+
var r;
|
|
140
119
|
return c(), f("div", {
|
|
141
|
-
style:
|
|
120
|
+
style: C({
|
|
142
121
|
display: "flex",
|
|
143
|
-
flexDirection:
|
|
122
|
+
flexDirection: W.value ? "column-reverse" : "column",
|
|
144
123
|
gap: "var(--vis-legend-spacing)",
|
|
145
|
-
...
|
|
124
|
+
...P.value
|
|
146
125
|
}),
|
|
147
126
|
class: Z({ "stacked-area-chart": e.stacked }),
|
|
148
|
-
id: (
|
|
149
|
-
onClick:
|
|
127
|
+
id: (r = e.markerConfig) == null ? void 0 : r.id,
|
|
128
|
+
onClick: o[0] || (o[0] = (a) => j("click", a, m.value))
|
|
150
129
|
}, [
|
|
151
|
-
|
|
130
|
+
g(n(ne), {
|
|
152
131
|
data: e.data,
|
|
153
132
|
height: e.height,
|
|
154
133
|
duration: e.duration,
|
|
155
134
|
padding: e.padding,
|
|
156
|
-
"svg-defs":
|
|
135
|
+
"svg-defs": G.value + E.value,
|
|
157
136
|
"y-domain": e.yDomain,
|
|
158
137
|
"x-domain": e.xDomain
|
|
159
138
|
}, {
|
|
160
|
-
default:
|
|
161
|
-
e.hideTooltip ?
|
|
139
|
+
default: _(() => [
|
|
140
|
+
e.hideTooltip ? d("", !0) : (c(), y(n(ae), {
|
|
162
141
|
key: 0,
|
|
163
|
-
"horizontal-placement":
|
|
164
|
-
"vertical-placement":
|
|
142
|
+
"horizontal-placement": n($).Right,
|
|
143
|
+
"vertical-placement": n($).Top,
|
|
165
144
|
"follow-cursor": t.tooltip.followCursor,
|
|
166
145
|
"show-delay": t.tooltip.showDelay,
|
|
167
146
|
"hide-delay": t.tooltip.hideDelay
|
|
168
147
|
}, null, 8, ["horizontal-placement", "vertical-placement", "follow-cursor", "show-delay", "hide-delay"])),
|
|
169
|
-
e.stacked ? (c(), f(
|
|
170
|
-
e.hideArea ?
|
|
148
|
+
e.stacked ? (c(), f(p, { key: 1 }, [
|
|
149
|
+
e.hideArea ? d("", !0) : (c(), y(n(B), {
|
|
171
150
|
key: 0,
|
|
172
|
-
x: (
|
|
151
|
+
x: (a, l) => l,
|
|
173
152
|
y: z.value,
|
|
174
|
-
color:
|
|
175
|
-
opacity:
|
|
176
|
-
"curve-type": e.curveType ??
|
|
153
|
+
color: L.value,
|
|
154
|
+
opacity: F,
|
|
155
|
+
"curve-type": e.curveType ?? n(h).MonotoneX
|
|
177
156
|
}, null, 8, ["x", "y", "color", "curve-type"])),
|
|
178
|
-
|
|
179
|
-
x: (
|
|
157
|
+
g(n(O), {
|
|
158
|
+
x: (a, l) => l,
|
|
180
159
|
y: R.value,
|
|
181
|
-
color:
|
|
182
|
-
"curve-type": e.curveType ??
|
|
160
|
+
color: L.value,
|
|
161
|
+
"curve-type": e.curveType ?? n(h).MonotoneX,
|
|
183
162
|
"line-width": e.lineWidth
|
|
184
163
|
}, null, 8, ["x", "y", "color", "curve-type", "line-width"])
|
|
185
|
-
], 64)) : (c(!0), f(
|
|
186
|
-
e.hideArea ?
|
|
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({
|
|
187
166
|
key: 0,
|
|
188
|
-
x: (s,
|
|
189
|
-
}, { ref_for: !0 }, Y(
|
|
190
|
-
color: `url(#gradient
|
|
191
|
-
opacity:
|
|
192
|
-
"curve-type": e.curveType ??
|
|
167
|
+
x: (s, T) => T
|
|
168
|
+
}, { ref_for: !0 }, Y(a), {
|
|
169
|
+
color: `url(#gradient-${k}-${l})`,
|
|
170
|
+
opacity: F,
|
|
171
|
+
"curve-type": e.curveType ?? n(h).MonotoneX
|
|
193
172
|
}), null, 16, ["x", "color", "curve-type"])),
|
|
194
|
-
|
|
195
|
-
x: (s,
|
|
196
|
-
y: (s) => s[
|
|
197
|
-
color:
|
|
198
|
-
"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,
|
|
199
178
|
"line-width": e.lineWidth,
|
|
200
|
-
lineDashArray: e.lineDashArray ? e.lineDashArray[
|
|
179
|
+
lineDashArray: e.lineDashArray ? e.lineDashArray[l] : void 0
|
|
201
180
|
}, null, 8, ["x", "y", "color", "curve-type", "line-width", "lineDashArray"])
|
|
202
181
|
], 64))), 128)),
|
|
203
|
-
e.hideXAxis ?
|
|
182
|
+
e.hideXAxis ? d("", !0) : (c(), y(n(w), v({
|
|
204
183
|
key: 3,
|
|
205
184
|
type: "x",
|
|
206
185
|
label: e.xLabel,
|
|
@@ -214,11 +193,11 @@ const ce = ["id"], de = {
|
|
|
214
193
|
"min-max-ticks-only": e.minMaxTicksOnly,
|
|
215
194
|
duration: e.duration
|
|
216
195
|
}, e.xAxisConfig), null, 16, ["label", "num-ticks", "tick-format", "tick-values", "grid-line", "domain-line", "tick-line", "min-max-ticks-only", "duration"])),
|
|
217
|
-
e.hideYAxis ?
|
|
196
|
+
e.hideYAxis ? d("", !0) : (c(), y(n(w), v({
|
|
218
197
|
key: 4,
|
|
219
198
|
type: "y",
|
|
220
199
|
label: e.yLabel,
|
|
221
|
-
"num-ticks":
|
|
200
|
+
"num-ticks": M.value,
|
|
222
201
|
"tick-format": e.yFormatter,
|
|
223
202
|
"tick-values": e.yExplicitTicks,
|
|
224
203
|
"grid-line": e.yGridLine,
|
|
@@ -226,43 +205,43 @@ const ce = ["id"], de = {
|
|
|
226
205
|
"tick-line": e.yTickLine,
|
|
227
206
|
duration: e.duration
|
|
228
207
|
}, e.yAxisConfig), null, 16, ["label", "num-ticks", "tick-format", "tick-values", "grid-line", "domain-line", "tick-line", "duration"])),
|
|
229
|
-
e.hideTooltip ?
|
|
208
|
+
e.hideTooltip ? d("", !0) : (c(), y(n(re), v({ key: 5 }, e.crosshairConfig, { template: H }), null, 16))
|
|
230
209
|
]),
|
|
231
210
|
_: 1
|
|
232
211
|
}, 8, ["data", "height", "duration", "padding", "svg-defs", "y-domain", "x-domain"]),
|
|
233
|
-
t.hideLegend ?
|
|
212
|
+
t.hideLegend ? d("", !0) : (c(), f("div", {
|
|
234
213
|
key: 0,
|
|
235
|
-
style:
|
|
214
|
+
style: C({
|
|
236
215
|
display: "flex",
|
|
237
|
-
justifyContent:
|
|
216
|
+
justifyContent: X.value
|
|
238
217
|
})
|
|
239
218
|
}, [
|
|
240
|
-
|
|
241
|
-
style:
|
|
219
|
+
g(n(le), {
|
|
220
|
+
style: C([
|
|
242
221
|
t.legendStyle,
|
|
243
222
|
"display: flex; gap: var(--vis-legend-spacing);"
|
|
244
223
|
]),
|
|
245
|
-
items: Object.values(t.categories).map((
|
|
246
|
-
...
|
|
247
|
-
color: Array.isArray(
|
|
224
|
+
items: Object.values(t.categories).map((a) => ({
|
|
225
|
+
...a,
|
|
226
|
+
color: Array.isArray(a.color) ? a.color[0] : a.color
|
|
248
227
|
}))
|
|
249
228
|
}, null, 8, ["style", "items"])
|
|
250
229
|
], 4)),
|
|
251
|
-
|
|
252
|
-
|
|
230
|
+
te("div", ue, [
|
|
231
|
+
n(S).tooltip ? D(i.$slots, "tooltip", {
|
|
253
232
|
key: 0,
|
|
254
233
|
values: m.value
|
|
255
|
-
}) : m.value ?
|
|
256
|
-
|
|
234
|
+
}) : m.value ? D(i.$slots, "fallback", { key: 1 }, () => [
|
|
235
|
+
g(oe, {
|
|
257
236
|
data: m.value,
|
|
258
237
|
followCursor: !1,
|
|
259
238
|
categories: e.categories,
|
|
260
239
|
"title-formatter": t.tooltipTitleFormatter,
|
|
261
240
|
yFormatter: t.yFormatter
|
|
262
241
|
}, null, 8, ["data", "categories", "title-formatter", "yFormatter"])
|
|
263
|
-
]) :
|
|
242
|
+
]) : d("", !0)
|
|
264
243
|
], 512)
|
|
265
|
-
], 14,
|
|
244
|
+
], 14, se);
|
|
266
245
|
};
|
|
267
246
|
}
|
|
268
247
|
});
|
|
@@ -1,205 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { BulletLegendItemInterface, CurveType } from '@unovis/ts';
|
|
3
|
-
export interface AreaChartProps<T> {
|
|
4
|
-
/**
|
|
5
|
-
* The data to be displayed in the area chart.
|
|
6
|
-
* Each element of the array represents a data point.
|
|
7
|
-
* The structure of 'T' should be compatible with the chart's rendering logic.
|
|
8
|
-
*/
|
|
9
|
-
data: T[];
|
|
10
|
-
/**
|
|
11
|
-
* The height of the chart in pixels.
|
|
12
|
-
*/
|
|
13
|
-
height: number;
|
|
14
|
-
/**
|
|
15
|
-
* Optional label for the x-axis.
|
|
16
|
-
*/
|
|
17
|
-
xLabel?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Optional label for the y-axis.
|
|
20
|
-
*/
|
|
21
|
-
yLabel?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Optional padding applied to the chart.
|
|
24
|
-
* Allows specifying individual padding values for the top, right, bottom, and left sides.
|
|
25
|
-
*/
|
|
26
|
-
padding?: {
|
|
27
|
-
top: number;
|
|
28
|
-
right: number;
|
|
29
|
-
bottom: number;
|
|
30
|
-
left: number;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* A record mapping category keys to `BulletLegendItemInterface` objects.
|
|
34
|
-
* This defines the visual representation and labels for each category in the chart's legend.
|
|
35
|
-
*/
|
|
36
|
-
categories: Record<string, BulletLegendItemInterface>;
|
|
37
|
-
/**
|
|
38
|
-
* A record mapping marker keys to show custom patterns.
|
|
39
|
-
*/
|
|
40
|
-
markerConfig?: MarkerConfig;
|
|
41
|
-
/**
|
|
42
|
-
* @param {number|Date} tick - The value of the tick. This can be a number or a Date object depending on the scale of the x-axis.
|
|
43
|
-
* @param {number} i - The index of the tick in the `ticks` array.
|
|
44
|
-
* @param {(number[]|Date[])} ticks - An array of all tick values for the x-axis.
|
|
45
|
-
* @returns {string} The formatted string representation of the tick.
|
|
46
|
-
*/
|
|
47
|
-
xFormatter?: axisFormatter;
|
|
48
|
-
/**
|
|
49
|
-
* @param {number|Date} tick - The value of the tick. This can be a number or a Date object depending on the scale of the y-axis.
|
|
50
|
-
* @param {number} i - The index of the tick in the `ticks` array.
|
|
51
|
-
* @param {(number[]|Date[])} ticks - An array of all tick values for the y-axis.
|
|
52
|
-
* @returns {string} The formatted string representation of the tick.
|
|
53
|
-
*/
|
|
54
|
-
yFormatter?: axisFormatter;
|
|
55
|
-
/**
|
|
56
|
-
* Use custom formatter for tooltip titles
|
|
57
|
-
*/
|
|
58
|
-
tooltipTitleFormatter?: (data: T) => string | number;
|
|
59
|
-
/**
|
|
60
|
-
* The type of curve to use for the area chart lines.
|
|
61
|
-
* See `CurveType` for available options.
|
|
62
|
-
*/
|
|
63
|
-
curveType?: CurveType;
|
|
64
|
-
/**
|
|
65
|
-
* If `true`, hides the area fill, displaying only the line.
|
|
66
|
-
*/
|
|
67
|
-
hideArea?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Edit the gradient stops for the area fill.
|
|
70
|
-
*/
|
|
71
|
-
gradientStops?: Array<{
|
|
72
|
-
offset: string;
|
|
73
|
-
stopOpacity: number;
|
|
74
|
-
}>;
|
|
75
|
-
/**
|
|
76
|
-
* The width of the line in pixels. Default is 2px.
|
|
77
|
-
*/
|
|
78
|
-
lineWidth?: number;
|
|
79
|
-
/**
|
|
80
|
-
* Line dash array, see SVG's stroke-dasharray. Default: `undefined`
|
|
81
|
-
*/
|
|
82
|
-
lineDashArray?: number[][];
|
|
83
|
-
/**
|
|
84
|
-
* The desired number of ticks on the x-axis.
|
|
85
|
-
*/
|
|
86
|
-
xNumTicks?: number;
|
|
87
|
-
/**
|
|
88
|
-
* Force specific ticks on the x-axis.
|
|
89
|
-
*/
|
|
90
|
-
xExplicitTicks?: (number | string | Date)[];
|
|
91
|
-
/**
|
|
92
|
-
* Force only first and last ticks on the x-axis.
|
|
93
|
-
*/
|
|
94
|
-
minMaxTicksOnly?: boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Force only first and last ticks on the x-axis.
|
|
97
|
-
*/
|
|
98
|
-
xMinMaxTicksOnly?: boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Force only first and last ticks on the y-axis.
|
|
101
|
-
*/
|
|
102
|
-
yMinMaxTicksOnly?: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Show grid lines for the min and max axis ticks.
|
|
105
|
-
*/
|
|
106
|
-
minMaxTicksOnlyShowGridLines?: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Show grid lines for the min and max x-axis ticks.
|
|
109
|
-
*/
|
|
110
|
-
xMinMaxTicksOnlyShowGridLines?: boolean;
|
|
111
|
-
/**
|
|
112
|
-
* Show grid lines for the min and max y-axis ticks.
|
|
113
|
-
*/
|
|
114
|
-
yMinMaxTicksOnlyShowGridLines?: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* The desired number of ticks on the y-axis.
|
|
117
|
-
*/
|
|
118
|
-
yNumTicks?: number;
|
|
119
|
-
/**
|
|
120
|
-
* Force specific ticks on the y-axis.
|
|
121
|
-
*/
|
|
122
|
-
yExplicitTicks?: (number | string | Date)[];
|
|
123
|
-
/**
|
|
124
|
-
* If `true`, hides the chart legend.
|
|
125
|
-
*/
|
|
126
|
-
hideLegend?: boolean;
|
|
127
|
-
/**
|
|
128
|
-
* If `true`, hides the chart tooltip.
|
|
129
|
-
*/
|
|
130
|
-
hideTooltip?: boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Optional position for the legend, if applicable.
|
|
133
|
-
* See `LegendPosition` for available options.
|
|
134
|
-
*/
|
|
135
|
-
legendPosition?: LegendPosition;
|
|
136
|
-
/**
|
|
137
|
-
* Optional style object for the legend container. Allows custom CSS styling.
|
|
138
|
-
*/
|
|
139
|
-
legendStyle?: string | Record<string, string>;
|
|
140
|
-
/**
|
|
141
|
-
* If `true`, displays a domain line (axis line) along the x-axis.
|
|
142
|
-
*/
|
|
143
|
-
xDomainLine?: boolean;
|
|
144
|
-
/**
|
|
145
|
-
* If `true`, displays a domain line (axis line) along the y-axis.
|
|
146
|
-
*/
|
|
147
|
-
yDomainLine?: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* If `true`, displays tick lines on the x-axis.
|
|
150
|
-
*/
|
|
151
|
-
xTickLine?: boolean;
|
|
152
|
-
/**
|
|
153
|
-
* If `true`, displays tick lines on the y-axis.
|
|
154
|
-
*/
|
|
155
|
-
yTickLine?: boolean;
|
|
156
|
-
/**
|
|
157
|
-
* If `true`, displays grid lines along the x-axis.
|
|
158
|
-
*/
|
|
159
|
-
xGridLine?: boolean;
|
|
160
|
-
/**
|
|
161
|
-
* If `true`, displays grid lines along the y-axis.
|
|
162
|
-
*/
|
|
163
|
-
yGridLine?: boolean;
|
|
164
|
-
/**
|
|
165
|
-
* If `true`, hide the x-axis.
|
|
166
|
-
*/
|
|
167
|
-
hideXAxis?: boolean;
|
|
168
|
-
/**
|
|
169
|
-
* If `true`, hide the y-axis.
|
|
170
|
-
*/
|
|
171
|
-
hideYAxis?: boolean;
|
|
172
|
-
/**
|
|
173
|
-
* Crosshair configuration object for customizing the appearance of the crosshair line.
|
|
174
|
-
*/
|
|
175
|
-
crosshairConfig?: CrosshairConfig;
|
|
176
|
-
/**
|
|
177
|
-
* Axis configuration object for customizing the appearance of the axes.
|
|
178
|
-
*/
|
|
179
|
-
xAxisConfig?: AxisConfig;
|
|
180
|
-
/**
|
|
181
|
-
* Axis configuration object for customizing the appearance of the axes.
|
|
182
|
-
*/
|
|
183
|
-
yAxisConfig?: AxisConfig;
|
|
184
|
-
/**
|
|
185
|
-
* The domain for the y-axis, specified as a tuple of two values.
|
|
186
|
-
*/
|
|
187
|
-
yDomain?: [number | undefined, number | undefined];
|
|
188
|
-
/**
|
|
189
|
-
* The domain for the x-axis, specified as a tuple of two values.
|
|
190
|
-
*/
|
|
191
|
-
xDomain?: [number | undefined, number | undefined];
|
|
192
|
-
/**
|
|
193
|
-
* If `true`, creates a stacked area chart where areas are stacked on top of each other.
|
|
194
|
-
* When false (default), areas are overlaid on top of each other.
|
|
195
|
-
*/
|
|
196
|
-
stacked?: boolean;
|
|
197
|
-
/**
|
|
198
|
-
* Animation duration in milliseconds for the chart components.
|
|
199
|
-
*/
|
|
200
|
-
duration?: number;
|
|
201
|
-
/**
|
|
202
|
-
* Configuration object for the chart tooltip.
|
|
203
|
-
*/
|
|
204
|
-
tooltip?: TooltipConfig;
|
|
205
|
-
}
|
|
1
|
+
export type { AreaChartProps } from '../../../../shared/dist/index.d.ts';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as W, useSlots as X, useTemplateRef as H, ref as Y, computed as k,
|
|
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
2
|
import { Orientation as g, StackedBar as U, GroupedBar as J } from "@unovis/ts";
|
|
3
3
|
import { useStackedGrouped as K } from "./stackedGroupedUtils.js";
|
|
4
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
5
|
import ae from "../Tooltip.js";
|
|
6
|
-
import { LegendPosition as ie } from "../../
|
|
6
|
+
import { LegendPosition as ie } from "../../packages/shared/dist/index.js";
|
|
7
7
|
const ne = {
|
|
8
8
|
ref: "slotWrapper",
|
|
9
9
|
style: { display: "none" }
|
|
@@ -37,10 +37,6 @@ const ne = {
|
|
|
37
37
|
hideTooltip: { type: Boolean, default: !1 },
|
|
38
38
|
orientation: { default: g.Vertical },
|
|
39
39
|
legendPosition: { default: ie.BottomCenter },
|
|
40
|
-
duration: { default: 600 },
|
|
41
|
-
tooltip: { default: () => ({
|
|
42
|
-
followCursor: !0
|
|
43
|
-
}) },
|
|
44
40
|
legendStyle: { default: void 0 },
|
|
45
41
|
xDomainLine: { type: Boolean },
|
|
46
42
|
yDomainLine: { type: Boolean },
|
|
@@ -53,6 +49,10 @@ const ne = {
|
|
|
53
49
|
stackedGroupedSpacing: { default: 0.1 },
|
|
54
50
|
xAxisConfig: {},
|
|
55
51
|
yAxisConfig: {},
|
|
52
|
+
duration: { default: 600 },
|
|
53
|
+
tooltip: { default: () => ({
|
|
54
|
+
followCursor: !0
|
|
55
|
+
}) },
|
|
56
56
|
stackAndGrouped: { type: Boolean },
|
|
57
57
|
valueLabel: {},
|
|
58
58
|
xAxis: {}
|
|
@@ -107,7 +107,7 @@ const ne = {
|
|
|
107
107
|
height: e.height,
|
|
108
108
|
duration: e.duration
|
|
109
109
|
}, {
|
|
110
|
-
default:
|
|
110
|
+
default: j(() => {
|
|
111
111
|
var o, u, f, x;
|
|
112
112
|
return [
|
|
113
113
|
e.valueLabel ? (d(), s(a(Z), {
|
|
@@ -139,7 +139,7 @@ const ne = {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}, null, 8, ["followCursor", "show-delay", "hide-delay", "triggers"])),
|
|
142
|
-
e.stackAndGrouped ? (d(!0), v(
|
|
142
|
+
e.stackAndGrouped ? (d(!0), v($, { key: 2 }, q(m.value.states, (n) => (d(), s(a(G), {
|
|
143
143
|
key: n,
|
|
144
144
|
data: m.value.chartData,
|
|
145
145
|
x: (r, b) => b + m.value.positions[n],
|
|
@@ -216,7 +216,7 @@ const ne = {
|
|
|
216
216
|
}))
|
|
217
217
|
}, null, 8, ["style", "items"])
|
|
218
218
|
], 4)),
|
|
219
|
-
|
|
219
|
+
I("div", ne, [
|
|
220
220
|
a(D).tooltip ? F(i.$slots, "tooltip", {
|
|
221
221
|
key: 0,
|
|
222
222
|
values: y.value
|