@adyen/lume-vue3 1.6.5 → 1.7.0
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/@types/components/charts/lume-bar-chart/lume-bar-chart.vue.d.ts.map +1 -1
- package/dist/@types/components/charts/lume-sparkline-chart/lume-sparkline-chart.vue.d.ts.map +1 -1
- package/dist/@types/components/charts/lume-stacked-bar-chart/defaults.d.ts +5 -1
- package/dist/@types/components/charts/lume-stacked-bar-chart/defaults.d.ts.map +1 -1
- package/dist/@types/components/charts/lume-stacked-bar-chart/lume-stacked-bar-chart.vue.d.ts.map +1 -1
- package/dist/@types/components/core/lume-axis/lume-axis.vue.d.ts +3 -2
- package/dist/@types/components/core/lume-axis/lume-axis.vue.d.ts.map +1 -1
- package/dist/@types/components/core/lume-chart/lume-chart.vue.d.ts.map +1 -1
- package/dist/@types/components/core/lume-chart-legend/lume-chart-legend.vue.d.ts.map +1 -1
- package/dist/@types/components/core/lume-tooltip/lume-tooltip.vue.d.ts +9 -0
- package/dist/@types/components/core/lume-tooltip/lume-tooltip.vue.d.ts.map +1 -1
- package/dist/@types/components/groups/lume-bar-group/composables/bar-mixin.d.ts.map +1 -1
- package/dist/@types/components/groups/lume-bar-group/composables/grouped-mixin.d.ts +5 -0
- package/dist/@types/components/groups/lume-bar-group/composables/grouped-mixin.d.ts.map +1 -1
- package/dist/@types/components/groups/lume-bar-group/composables/single-mixin.d.ts +5 -0
- package/dist/@types/components/groups/lume-bar-group/composables/single-mixin.d.ts.map +1 -1
- package/dist/@types/components/groups/lume-bar-group/composables/stacked-mixin.d.ts.map +1 -1
- package/dist/@types/composables/options.d.ts +2 -1
- package/dist/@types/composables/options.d.ts.map +1 -1
- package/dist/@types/composables/scales.d.ts.map +1 -1
- package/dist/@types/docs/storybook-data/alluvial-data.d.ts +1 -3
- package/dist/@types/docs/storybook-data/alluvial-data.d.ts.map +1 -1
- package/dist/@types/docs/storybook-data/base-data.d.ts +1 -3
- package/dist/@types/docs/storybook-data/base-data.d.ts.map +1 -1
- package/dist/@types/docs/storybook-data/sparkline-data.d.ts +1 -3
- package/dist/@types/docs/storybook-data/sparkline-data.d.ts.map +1 -1
- package/dist/@types/utils/errors.d.ts +4 -2
- package/dist/@types/utils/errors.d.ts.map +1 -1
- package/dist/@types/utils/helpers.d.ts +1 -0
- package/dist/@types/utils/helpers.d.ts.map +1 -1
- package/dist/index.js +1309 -1269
- package/dist/index.js.map +1 -1
- package/dist/scss/main.scss +1 -1
- package/dist/styles/main.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { format as
|
|
3
|
-
import { createPopper as
|
|
4
|
-
import { sankeyLinkHorizontal as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as U, ref as S, openBlock as y, createElementBlock as $, mergeProps as G, createElementVNode as C, toDisplayString as oe, createCommentVNode as W, isRef as Ct, computed as v, watch as Z, toRefs as te, inject as Pe, reactive as Fe, onMounted as _e, unref as d, Fragment as q, renderList as z, createBlock as K, normalizeClass as ne, normalizeStyle as Gt, onBeforeUnmount as jt, watchEffect as Vt, renderSlot as R, createTextVNode as fe, useSlots as re, withDirectives as cn, withCtx as V, createSlots as ce, vShow as dn, pushScopeId as vn, popScopeId as mn, provide as Ke, createVNode as ie, nextTick as kt, toHandlers as le, normalizeProps as pe, guardReactiveProps as he, defineAsyncComponent as Je, resolveDynamicComponent as fn } from "vue";
|
|
2
|
+
import { format as pn, ticks as hn, scaleBand as He, scaleLinear as Be, link as gn, line as _n, area as yn } from "d3";
|
|
3
|
+
import { createPopper as kn } from "@popperjs/core";
|
|
4
|
+
import { sankeyLinkHorizontal as bn, sankey as An, sankeyJustify as Tn } from "d3-sankey";
|
|
5
|
+
const Ln = {
|
|
6
6
|
class: "axis__tick-label lume-typography--axis",
|
|
7
7
|
"pointer-events": "all",
|
|
8
8
|
"data-j-axis__tick-label": ""
|
|
9
|
-
},
|
|
9
|
+
}, On = /* @__PURE__ */ U({
|
|
10
10
|
__name: "lume-tick",
|
|
11
11
|
props: {
|
|
12
12
|
value: {
|
|
@@ -44,8 +44,8 @@ const An = {
|
|
|
44
44
|
},
|
|
45
45
|
emits: ["click", "mouseenter"],
|
|
46
46
|
setup(e, { expose: n, emit: t }) {
|
|
47
|
-
const o = t, l =
|
|
48
|
-
return n({ ref: l }), (u, a) => (
|
|
47
|
+
const o = t, l = S(null);
|
|
48
|
+
return n({ ref: l }), (u, a) => (y(), $("g", G(e.group, {
|
|
49
49
|
class: ["axis__tick", {
|
|
50
50
|
"axis__tick--hovered": e.isHovered,
|
|
51
51
|
"axis__tick--hidden": e.isHidden
|
|
@@ -54,27 +54,27 @@ const An = {
|
|
|
54
54
|
onMouseenter: a[0] || (a[0] = (i) => o("mouseenter", i)),
|
|
55
55
|
onClick: a[1] || (a[1] = (i) => o("click", i))
|
|
56
56
|
}), [
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
C("g", Ln, [
|
|
58
|
+
C("rect", G(e.ghost, {
|
|
59
59
|
class: "axis__ghost",
|
|
60
60
|
fill: "url(#lume-tick-gradient)"
|
|
61
61
|
}), null, 16),
|
|
62
|
-
|
|
62
|
+
C("text", G(e.label, {
|
|
63
63
|
ref_key: "labelRef",
|
|
64
64
|
ref: l,
|
|
65
65
|
class: "axis__label"
|
|
66
|
-
}),
|
|
66
|
+
}), oe(e.value), 17)
|
|
67
67
|
]),
|
|
68
|
-
e.withGridlines ? (
|
|
68
|
+
e.withGridlines ? (y(), $("line", G({ key: 0 }, e.gridline, { class: "axis__grid-line" }), null, 16)) : W("", !0)
|
|
69
69
|
], 16));
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
const
|
|
72
|
+
const ee = (e, n) => {
|
|
73
73
|
const t = e.__vccOpts || e;
|
|
74
74
|
for (const [o, l] of n)
|
|
75
75
|
t[o] = l;
|
|
76
76
|
return t;
|
|
77
|
-
},
|
|
77
|
+
}, bt = /* @__PURE__ */ ee(On, [["__scopeId", "data-v-59ddc0a6"]]), xn = [
|
|
78
78
|
"controls",
|
|
79
79
|
"legend",
|
|
80
80
|
"axes",
|
|
@@ -82,60 +82,64 @@ const te = (e, n) => {
|
|
|
82
82
|
"tooltip",
|
|
83
83
|
"tooltip-content"
|
|
84
84
|
];
|
|
85
|
-
function
|
|
85
|
+
function Pt() {
|
|
86
86
|
return process.env.NODE_ENV === "production";
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Ft(e) {
|
|
89
89
|
return (e == null ? void 0 : e.map(
|
|
90
90
|
(n) => n.values.map((t) => t == null ? void 0 : t.value).flat()
|
|
91
91
|
).flat()) || [];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function it(e) {
|
|
94
94
|
return e.length === 1;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function $n(e) {
|
|
97
97
|
return !!e && e.every(
|
|
98
98
|
(n) => "color" in n
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function Qe(e) {
|
|
102
102
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function zt(e, n) {
|
|
105
105
|
const t = { ...e };
|
|
106
106
|
return Object.entries(n).forEach(([o, l]) => {
|
|
107
|
-
t[o] =
|
|
107
|
+
t[o] = Qe(e[o]) && Qe(l) ? zt(e[o], l) : l;
|
|
108
108
|
}), t;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return e != null &&
|
|
110
|
+
function In(e) {
|
|
111
|
+
return e != null && Qe(e) && "value" in e;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function de(e) {
|
|
114
114
|
return (e == null ? void 0 : e.bandwidth) !== void 0;
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
116
|
+
function wn(e) {
|
|
117
|
+
return de(e) ? e.step() : Math.max(...e.range()) / Math.max(...e.domain());
|
|
118
|
+
}
|
|
119
|
+
function At(e) {
|
|
120
|
+
const [n, t] = e.domain();
|
|
121
|
+
return n == null || t == null || n === 0 && t === 0;
|
|
118
122
|
}
|
|
119
|
-
const
|
|
123
|
+
const En = (e, n) => {
|
|
120
124
|
if (!e)
|
|
121
125
|
throw new Error("Data is not a valid array");
|
|
122
126
|
if (e.length === 0)
|
|
123
127
|
throw new Error("Cannot get highest value from empty array");
|
|
124
128
|
e.some(
|
|
125
129
|
({ values: o }) => o.length - 1 >= n
|
|
126
|
-
) ||
|
|
130
|
+
) || ge(ve.IndexExceedsLengthOfDataSets);
|
|
127
131
|
};
|
|
128
|
-
function
|
|
132
|
+
function Nn(e, n) {
|
|
129
133
|
var t;
|
|
130
|
-
return
|
|
134
|
+
return En(e, n), ((t = e.reduce(
|
|
131
135
|
(o, l) => {
|
|
132
136
|
var u, a;
|
|
133
137
|
return (((u = o.values[n]) == null ? void 0 : u.value) ?? 0) > (((a = l.values[n]) == null ? void 0 : a.value) ?? 0) ? o : l;
|
|
134
138
|
}
|
|
135
139
|
).values[n]) == null ? void 0 : t.value) || 0;
|
|
136
140
|
}
|
|
137
|
-
function
|
|
138
|
-
const n =
|
|
141
|
+
function Wt(e) {
|
|
142
|
+
const n = Ct(e) ? e.value : e;
|
|
139
143
|
if (!n)
|
|
140
144
|
throw new Error("No empty array can be created from specified data value");
|
|
141
145
|
const t = Math.max(
|
|
@@ -144,17 +148,17 @@ function Je(e) {
|
|
|
144
148
|
);
|
|
145
149
|
return Array(t).fill(null);
|
|
146
150
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
151
|
+
function Dn(e) {
|
|
152
|
+
return de(e) ? e.domain().length : Math.max(...e.domain());
|
|
149
153
|
}
|
|
150
|
-
function
|
|
154
|
+
function Hn(e, n) {
|
|
151
155
|
return (t) => Math.round(e * (1 - t) + n * t);
|
|
152
156
|
}
|
|
153
|
-
function
|
|
157
|
+
function Bn(e, n, t) {
|
|
154
158
|
const o = t ? e.length - n : n, l = e.slice(0, o);
|
|
155
159
|
return e.slice(o).concat(l);
|
|
156
160
|
}
|
|
157
|
-
function
|
|
161
|
+
function Le(e) {
|
|
158
162
|
if (e.groups) {
|
|
159
163
|
const n = Object.keys(e);
|
|
160
164
|
return Object.assign(
|
|
@@ -164,36 +168,36 @@ function Oe(e) {
|
|
|
164
168
|
}
|
|
165
169
|
return e;
|
|
166
170
|
}
|
|
167
|
-
function
|
|
171
|
+
function Mn(e) {
|
|
168
172
|
return Object.assign(
|
|
169
173
|
{},
|
|
170
174
|
...Object.keys(e).map(
|
|
171
|
-
(n) =>
|
|
175
|
+
(n) => xn.includes(n) ? {} : { [n]: e[n] }
|
|
172
176
|
)
|
|
173
177
|
);
|
|
174
178
|
}
|
|
175
|
-
const
|
|
179
|
+
const Sn = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce(
|
|
176
180
|
(n, t) => n += (t &= 63) < 36 ? t.toString(36) : t < 62 ? (t - 26).toString(36).toUpperCase() : t > 62 ? "-" : "_",
|
|
177
181
|
""
|
|
178
182
|
);
|
|
179
|
-
function
|
|
183
|
+
function st(e, n) {
|
|
180
184
|
const t = n - e.length;
|
|
181
185
|
return t > 0 ? [...e, ...Array(t).fill({ value: null })] : e;
|
|
182
186
|
}
|
|
183
|
-
var
|
|
184
|
-
Learn more: https://lume.design/guidelines/datasets`, e.ColorLoop = "Colors will loop around after the 5th dataset. You can prevent this by setting specific colors for your datasets.", e.Empty = "The dataset(s) provided are empty.", e.InvalidFormat = "The string provided to format is invalid. Please refer to https://github.com/d3/d3-format for valid arguments.", e.NotContainedInSvg = "This component is an `SVGElement`, thus it is required to be inside an `<svg>` container.", e.InvalidHoveredIndex = "The provided hovered index is not valid for the data of this chart.", e.InvalidHoveredElement = "The provided hovered element is not valid for the data of this diagram.", e.IndexExceedsLengthOfDataSets = "Index exceeds length of all of the datasets", e))(
|
|
185
|
-
const
|
|
186
|
-
function
|
|
187
|
-
n &&
|
|
187
|
+
var ve = /* @__PURE__ */ ((e) => (e.DatasetLength = `Our guidelines highly recommend not having more than 5 datasets in one chart.
|
|
188
|
+
Learn more: https://lume.design/guidelines/datasets`, e.ColorLoop = "Colors will loop around after the 5th dataset. You can prevent this by setting specific colors for your datasets.", e.Empty = "The dataset(s) provided are empty.", e.InvalidFormat = "The string provided to format is invalid. Please refer to https://github.com/d3/d3-format for valid arguments.", e.NotContainedInSvg = "This component is an `SVGElement`, thus it is required to be inside an `<svg>` container.", e.InvalidHoveredIndex = "The provided hovered index is not valid for the data of this chart.", e.InvalidHoveredElement = "The provided hovered element is not valid for the data of this diagram.", e.IndexExceedsLengthOfDataSets = "Index exceeds length of all of the datasets", e))(ve || {});
|
|
189
|
+
const Rn = "[lume] ";
|
|
190
|
+
function ge(e, n = !0) {
|
|
191
|
+
n && Pt() || console.warn(Rn + "Warning: " + e);
|
|
188
192
|
}
|
|
189
|
-
const
|
|
193
|
+
const je = (e) => {
|
|
190
194
|
let n = null;
|
|
191
195
|
switch (typeof e) {
|
|
192
196
|
case "string":
|
|
193
197
|
try {
|
|
194
|
-
n =
|
|
198
|
+
n = pn(e);
|
|
195
199
|
} catch {
|
|
196
|
-
|
|
200
|
+
ge(ve.InvalidFormat), n = null;
|
|
197
201
|
}
|
|
198
202
|
break;
|
|
199
203
|
case "function":
|
|
@@ -206,50 +210,50 @@ const Ve = (e) => {
|
|
|
206
210
|
return n ? n(...o) : o[0];
|
|
207
211
|
}
|
|
208
212
|
return t;
|
|
209
|
-
},
|
|
213
|
+
}, Me = () => ({
|
|
210
214
|
options: {
|
|
211
215
|
type: Object,
|
|
212
216
|
default: () => ({})
|
|
213
217
|
}
|
|
214
218
|
});
|
|
215
|
-
function
|
|
219
|
+
function me(e, n) {
|
|
216
220
|
return { allOptions: v(() => {
|
|
217
|
-
const o =
|
|
218
|
-
return o ?
|
|
221
|
+
const o = Ct(n) ? n == null ? void 0 : n.value : n;
|
|
222
|
+
return o ? zt(o, e.value) : e.value;
|
|
219
223
|
}) };
|
|
220
224
|
}
|
|
221
|
-
const
|
|
222
|
-
function
|
|
223
|
-
const o =
|
|
225
|
+
const Cn = 0.2;
|
|
226
|
+
function Gn(e, n, t) {
|
|
227
|
+
const o = S(), l = v(() => Math.max(...e.value.range())), u = v(() => n.value.length);
|
|
224
228
|
function a() {
|
|
225
229
|
if (!n.value)
|
|
226
230
|
return;
|
|
227
231
|
const s = n.value.reduce(
|
|
228
|
-
(
|
|
232
|
+
(f, r) => f + r.ref.getBoundingClientRect().width,
|
|
229
233
|
0
|
|
230
234
|
), c = Math.ceil(s / u.value);
|
|
231
|
-
o.value = c + c *
|
|
235
|
+
o.value = c + c * Cn;
|
|
232
236
|
}
|
|
233
237
|
function i(s) {
|
|
234
238
|
if (!n.value)
|
|
235
239
|
return !0;
|
|
236
|
-
const c = t.value.skip,
|
|
240
|
+
const c = t.value.skip, f = n.value.length;
|
|
237
241
|
if (s === 0)
|
|
238
242
|
return !0;
|
|
239
|
-
const r = l.value /
|
|
240
|
-
return s %
|
|
243
|
+
const r = l.value / f, m = typeof c == "number" && c > 0 && c + 1 || Math.ceil(o.value / r);
|
|
244
|
+
return s % m === 0;
|
|
241
245
|
}
|
|
242
|
-
return
|
|
246
|
+
return Z(n, a), { showTick: i };
|
|
243
247
|
}
|
|
244
|
-
var
|
|
245
|
-
const
|
|
248
|
+
var se = /* @__PURE__ */ ((e) => (e.Skyblue = "skyblue", e.Royalblue = "royalblue", e.Violet = "violet", e.Darkteal = "darkteal", e.Gold = "gold", e))(se || {}), Zt = /* @__PURE__ */ ((e) => (e.Skyblue10 = "skyblue-10", e.Skyblue20 = "skyblue-20", e.Skyblue30 = "skyblue-30", e.Skyblue40 = "skyblue-40", e.Skyblue50 = "skyblue-50", e.Skyblue60 = "skyblue-60", e.Skyblue70 = "skyblue-70", e.Skyblue80 = "skyblue-80", e.Skyblue90 = "skyblue-90", e.Skyblue100 = "skyblue-100", e.Royalblue10 = "royalblue-10", e.Royalblue20 = "royalblue-20", e.Royalblue30 = "royalblue-30", e.Royalblue40 = "royalblue-40", e.Royalblue50 = "royalblue-50", e.Royalblue60 = "royalblue-60", e.Royalblue70 = "royalblue-70", e.Royalblue80 = "royalblue-80", e.Royalblue90 = "royalblue-90", e.Royalblue100 = "royalblue-100", e.Violet10 = "violet-10", e.Violet20 = "violet-20", e.Violet30 = "violet-30", e.Violet40 = "violet-40", e.Violet50 = "violet-50", e.Violet60 = "violet-60", e.Violet70 = "violet-70", e.Violet80 = "violet-80", e.Violet90 = "violet-90", e.Violet100 = "violet-100", e.Darkteal10 = "darkteal-10", e.Darkteal20 = "darkteal-20", e.Darkteal30 = "darkteal-30", e.Darkteal40 = "darkteal-40", e.Darkteal50 = "darkteal-50", e.Darkteal60 = "darkteal-60", e.Darkteal70 = "darkteal-70", e.Darkteal80 = "darkteal-80", e.Darkteal90 = "darkteal-90", e.Darkteal100 = "darkteal-100", e.Gold10 = "gold-10", e.Gold20 = "gold-20", e.Gold30 = "gold-30", e.Gold40 = "gold-40", e.Gold50 = "gold-50", e.Gold60 = "gold-60", e.Gold70 = "gold-70", e.Gold80 = "gold-80", e.Gold90 = "gold-90", e.Gold100 = "gold-100", e))(Zt || {}), ct = /* @__PURE__ */ ((e) => (e.SkyTeal = "skyblue-darkteal", e.VioletRoyal = "violet-royalblue", e.VioletTeal = "violet-darkteal", e.GoldTeal = "gold-darkteal", e.GoldRoyal = "gold-royalblue", e))(ct || {}), dt = /* @__PURE__ */ ((e) => (e.Grey = "grey", e.Green = "green", e.Orange = "orange", e.Red = "red", e))(dt || {}), vt = /* @__PURE__ */ ((e) => (e["01"] = "01", e["02"] = "02", e["03"] = "03", e["04"] = "04", e["05"] = "05", e["06"] = "06", e["07"] = "07", e["08"] = "08", e["09"] = "09", e))(vt || {});
|
|
249
|
+
const B = {
|
|
246
250
|
HORIZONTAL: "horizontal",
|
|
247
251
|
VERTICAL: "vertical"
|
|
248
|
-
},
|
|
252
|
+
}, jn = {
|
|
249
253
|
SINGLE: "single",
|
|
250
254
|
GROUPED: "grouped",
|
|
251
255
|
STACKED: "stacked"
|
|
252
|
-
},
|
|
256
|
+
}, Ut = "No data", Tt = 20, Xt = 0.33, Yt = 0.5, Kt = 12, Se = 8, Vn = 1, Pn = [
|
|
253
257
|
"auto",
|
|
254
258
|
"auto-start",
|
|
255
259
|
"auto-end",
|
|
@@ -266,10 +270,10 @@ const D = {
|
|
|
266
270
|
"left-start",
|
|
267
271
|
"left-end"
|
|
268
272
|
];
|
|
269
|
-
function
|
|
270
|
-
e != null && e.closest("svg") ||
|
|
273
|
+
function ze(e) {
|
|
274
|
+
e != null && e.closest("svg") || ge(ve.NotContainedInSvg);
|
|
271
275
|
}
|
|
272
|
-
const
|
|
276
|
+
const Jt = {
|
|
273
277
|
/** Displays a line for each tick. */
|
|
274
278
|
gridLines: !1,
|
|
275
279
|
/** Displays the axis title. */
|
|
@@ -285,14 +289,14 @@ const Xt = {
|
|
|
285
289
|
tickFormat: null,
|
|
286
290
|
/** Space between the tick label and the axis line. */
|
|
287
291
|
tickPadding: 8
|
|
288
|
-
},
|
|
289
|
-
...
|
|
292
|
+
}, Fn = {
|
|
293
|
+
...Jt,
|
|
290
294
|
withTitle: !1,
|
|
291
295
|
skip: !0
|
|
292
|
-
},
|
|
293
|
-
...
|
|
296
|
+
}, zn = {
|
|
297
|
+
...Jt,
|
|
294
298
|
gridLines: !0
|
|
295
|
-
},
|
|
299
|
+
}, Wn = function(e, n, t) {
|
|
296
300
|
const o = v(() => e.value.step() * e.value.paddingInner() / 2);
|
|
297
301
|
function l(s, c) {
|
|
298
302
|
return {
|
|
@@ -300,15 +304,15 @@ const Xt = {
|
|
|
300
304
|
};
|
|
301
305
|
}
|
|
302
306
|
function u(s) {
|
|
303
|
-
var
|
|
307
|
+
var f;
|
|
304
308
|
const c = Math.max(
|
|
305
309
|
e.value.step(),
|
|
306
|
-
(s ? (
|
|
310
|
+
(s ? (f = s.getComputedTextLength) == null ? void 0 : f.call(s) : e.value.step()) + 20
|
|
307
311
|
);
|
|
308
312
|
return {
|
|
309
313
|
x: -(c - e.value.step()) / 2,
|
|
310
314
|
width: c,
|
|
311
|
-
height: t.value.tickPadding +
|
|
315
|
+
height: t.value.tickPadding + Kt + Se
|
|
312
316
|
};
|
|
313
317
|
}
|
|
314
318
|
function a() {
|
|
@@ -334,7 +338,7 @@ const Xt = {
|
|
|
334
338
|
getTickGroupAttributes: l,
|
|
335
339
|
getTickLabelAttributes: i
|
|
336
340
|
};
|
|
337
|
-
},
|
|
341
|
+
}, Zn = function(e, n, t) {
|
|
338
342
|
const o = v(() => e.value.step() * e.value.paddingInner() / 2);
|
|
339
343
|
function l(s, c) {
|
|
340
344
|
return {
|
|
@@ -342,8 +346,8 @@ const Xt = {
|
|
|
342
346
|
};
|
|
343
347
|
}
|
|
344
348
|
function u(s) {
|
|
345
|
-
var
|
|
346
|
-
const c = (s ? (
|
|
349
|
+
var f;
|
|
350
|
+
const c = (s ? (f = s.getComputedTextLength) == null ? void 0 : f.call(s) : 42) + t.value.tickPadding + Se;
|
|
347
351
|
return {
|
|
348
352
|
x: -c,
|
|
349
353
|
width: c,
|
|
@@ -372,7 +376,7 @@ const Xt = {
|
|
|
372
376
|
getTickGroupAttributes: l,
|
|
373
377
|
getTickLabelAttributes: i
|
|
374
378
|
};
|
|
375
|
-
},
|
|
379
|
+
}, Un = function(e, n, t) {
|
|
376
380
|
const o = v(() => {
|
|
377
381
|
const s = e.value.ticks();
|
|
378
382
|
return s.length > 1 ? e.value(s[1]) - e.value(s[0]) : 0;
|
|
@@ -384,7 +388,7 @@ const Xt = {
|
|
|
384
388
|
}
|
|
385
389
|
function u() {
|
|
386
390
|
return {
|
|
387
|
-
height: t.value.tickPadding +
|
|
391
|
+
height: t.value.tickPadding + Kt + Se,
|
|
388
392
|
width: o.value,
|
|
389
393
|
x: -(o.value / 2)
|
|
390
394
|
};
|
|
@@ -407,7 +411,7 @@ const Xt = {
|
|
|
407
411
|
getTickGroupAttributes: l,
|
|
408
412
|
getTickLabelAttributes: i
|
|
409
413
|
};
|
|
410
|
-
},
|
|
414
|
+
}, Xn = function(e, n, t) {
|
|
411
415
|
const o = v(() => {
|
|
412
416
|
const s = e.value.ticks();
|
|
413
417
|
return s.length > 1 ? e.value(s[1]) - e.value(s[0]) : 0;
|
|
@@ -418,8 +422,8 @@ const Xt = {
|
|
|
418
422
|
};
|
|
419
423
|
}
|
|
420
424
|
function u(s) {
|
|
421
|
-
var
|
|
422
|
-
const c = (((
|
|
425
|
+
var f;
|
|
426
|
+
const c = (((f = s == null ? void 0 : s.getComputedTextLength) == null ? void 0 : f.call(s)) || 0) + t.value.tickPadding + Se;
|
|
423
427
|
return {
|
|
424
428
|
width: c,
|
|
425
429
|
height: o.value,
|
|
@@ -445,48 +449,48 @@ const Xt = {
|
|
|
445
449
|
getTickGroupAttributes: l,
|
|
446
450
|
getTickLabelAttributes: i
|
|
447
451
|
};
|
|
448
|
-
},
|
|
449
|
-
"x-band-scale-axis":
|
|
450
|
-
"y-band-scale-axis":
|
|
451
|
-
"x-linear-scale-axis":
|
|
452
|
-
"y-linear-scale-axis":
|
|
453
|
-
},
|
|
454
|
-
/* @__PURE__ */
|
|
452
|
+
}, Yn = {
|
|
453
|
+
"x-band-scale-axis": Wn,
|
|
454
|
+
"y-band-scale-axis": Zn,
|
|
455
|
+
"x-linear-scale-axis": Un,
|
|
456
|
+
"y-linear-scale-axis": Xn
|
|
457
|
+
}, Kn = ["transform"], Jn = { key: 0 }, Qn = /* @__PURE__ */ C("linearGradient", { id: "lume-tick-gradient" }, [
|
|
458
|
+
/* @__PURE__ */ C("stop", {
|
|
455
459
|
offset: "0%",
|
|
456
460
|
"stop-color": "rgba(255,255,255,0)"
|
|
457
461
|
}),
|
|
458
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ C("stop", {
|
|
459
463
|
offset: "10%",
|
|
460
464
|
"stop-color": "var(--lume-chart-background-color)"
|
|
461
465
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ C("stop", {
|
|
463
467
|
offset: "90%",
|
|
464
468
|
"stop-color": "var(--lume-chart-background-color)"
|
|
465
469
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ C("stop", {
|
|
467
471
|
offset: "100%",
|
|
468
472
|
"stop-color": "rgba(255,255,255,0)"
|
|
469
473
|
})
|
|
470
|
-
], -1),
|
|
471
|
-
|
|
474
|
+
], -1), qn = [
|
|
475
|
+
Qn
|
|
472
476
|
];
|
|
473
|
-
var
|
|
474
|
-
const
|
|
477
|
+
var Qt = /* @__PURE__ */ ((e) => (e.bandScale = "band-scale-axis", e.linearScale = "linear-scale-axis", e))(Qt || {}), qt = /* @__PURE__ */ ((e) => (e.left = "left", e.bottom = "bottom", e))(qt || {}), qe = /* @__PURE__ */ ((e) => (e.x = "bottom", e.y = "left", e))(qe || {});
|
|
478
|
+
const Lt = /* @__PURE__ */ U({
|
|
475
479
|
__name: "lume-axis",
|
|
476
480
|
props: {
|
|
477
481
|
scale: {
|
|
478
482
|
type: Function,
|
|
479
|
-
|
|
483
|
+
default: null
|
|
480
484
|
},
|
|
481
485
|
type: {
|
|
482
486
|
type: String,
|
|
483
487
|
default: void 0,
|
|
484
|
-
validator: (e) => e in
|
|
488
|
+
validator: (e) => e in qe
|
|
485
489
|
},
|
|
486
490
|
position: {
|
|
487
491
|
type: String,
|
|
488
492
|
default: void 0,
|
|
489
|
-
validator: (e) => e in
|
|
493
|
+
validator: (e) => e in qt
|
|
490
494
|
},
|
|
491
495
|
containerSize: {
|
|
492
496
|
type: Object,
|
|
@@ -498,125 +502,132 @@ const At = /* @__PURE__ */ Z({
|
|
|
498
502
|
},
|
|
499
503
|
orientation: {
|
|
500
504
|
type: String,
|
|
501
|
-
default:
|
|
505
|
+
default: B.VERTICAL
|
|
502
506
|
},
|
|
503
|
-
...
|
|
507
|
+
...Me()
|
|
504
508
|
},
|
|
505
509
|
emits: ["mouseenter", "click", "mouseleave", "lume__internal--axis-size"],
|
|
506
510
|
setup(e, { emit: n }) {
|
|
507
|
-
const o = e, l = n, { scale: u, containerSize: a, hoveredIndex: i, options: s, orientation: c } =
|
|
508
|
-
() => o.type ?
|
|
509
|
-
),
|
|
510
|
-
() => o.type || (
|
|
511
|
-
),
|
|
512
|
-
() =>
|
|
513
|
-
), { allOptions:
|
|
511
|
+
const o = e, l = n, { scale: u, containerSize: a, hoveredIndex: i, options: s, orientation: c } = te(o), f = Pe("isEmpty", S(!1)), r = Fe({}), m = S(null), g = S(null), p = S(null), b = v(
|
|
512
|
+
() => o.type ? qe[o.type] : o.position
|
|
513
|
+
), L = v(
|
|
514
|
+
() => o.type || (b.value === "left" ? "y" : "x")
|
|
515
|
+
), A = v(
|
|
516
|
+
() => L.value === "x" && c.value === B.VERTICAL || L.value === "y" && c.value === B.HORIZONTAL
|
|
517
|
+
), { allOptions: h } = me(
|
|
514
518
|
s,
|
|
515
|
-
|
|
516
|
-
), { showTick:
|
|
517
|
-
var
|
|
518
|
-
return
|
|
519
|
-
}),
|
|
520
|
-
if (
|
|
519
|
+
L.value === "x" ? Fn : zn
|
|
520
|
+
), { showTick: x } = Gn(u, m, h), N = v(() => {
|
|
521
|
+
var M, k, E, _;
|
|
522
|
+
return L.value === "y" && f.value && (!u.value || At(u.value)) ? `translate(0, ${((M = a.value) == null ? void 0 : M.height) / 2})` : L.value === "x" && f.value && (!u.value || At(u.value)) ? `translate(-${((k = a.value) == null ? void 0 : k.width) / 2}, ${(E = a.value) == null ? void 0 : E.height})` : `translate(0, ${L.value === "x" ? (_ = a.value) == null ? void 0 : _.height : 0})`;
|
|
523
|
+
}), D = v(() => {
|
|
524
|
+
if (!u.value)
|
|
525
|
+
return [];
|
|
526
|
+
if (de(u.value))
|
|
521
527
|
return u.value.labels || u.value.domain();
|
|
522
|
-
const { tickCount:
|
|
523
|
-
return
|
|
524
|
-
}),
|
|
525
|
-
const { tickFormat:
|
|
526
|
-
return
|
|
528
|
+
const { tickCount: M } = h.value, [k, E] = u.value.domain();
|
|
529
|
+
return hn(k, E, M);
|
|
530
|
+
}), P = v(() => {
|
|
531
|
+
const { tickFormat: M } = h.value;
|
|
532
|
+
return je(M);
|
|
527
533
|
}), w = v(
|
|
528
|
-
() =>
|
|
529
|
-
),
|
|
530
|
-
() =>
|
|
531
|
-
),
|
|
534
|
+
() => h.value.withHover && A.value && i.value > -1
|
|
535
|
+
), H = v(
|
|
536
|
+
() => h.value.tickPadding + Se || 16
|
|
537
|
+
), X = v(() => L.value === "x" ? (
|
|
532
538
|
// If x axis, get the tick height
|
|
533
539
|
Math.max(
|
|
534
|
-
...(
|
|
535
|
-
(
|
|
536
|
-
var
|
|
537
|
-
return ((
|
|
540
|
+
...(m.value || []).map(
|
|
541
|
+
(M) => {
|
|
542
|
+
var k, E;
|
|
543
|
+
return ((E = (k = M.ref).getBBox) == null ? void 0 : E.call(k).height) + H.value;
|
|
538
544
|
}
|
|
539
545
|
)
|
|
540
546
|
)
|
|
541
547
|
) : (
|
|
542
548
|
// If y axis, get the tick width
|
|
543
549
|
Math.max(
|
|
544
|
-
...(
|
|
545
|
-
(
|
|
546
|
-
var
|
|
547
|
-
return ((
|
|
550
|
+
...(m.value || []).map(
|
|
551
|
+
(M) => {
|
|
552
|
+
var k, E;
|
|
553
|
+
return ((E = (k = M.ref).getBBox) == null ? void 0 : E.call(k).width) + H.value;
|
|
548
554
|
}
|
|
549
555
|
)
|
|
550
556
|
)
|
|
551
557
|
));
|
|
552
|
-
function
|
|
553
|
-
const { showTicks:
|
|
554
|
-
return
|
|
558
|
+
function Y(M) {
|
|
559
|
+
const { showTicks: k } = h.value;
|
|
560
|
+
return k === !1 ? "" : P.value(M);
|
|
555
561
|
}
|
|
556
|
-
function
|
|
557
|
-
l("mouseenter", { index:
|
|
562
|
+
function Q(M, k, E) {
|
|
563
|
+
l("mouseenter", { index: A.value ? M : null, value: k, event: E });
|
|
558
564
|
}
|
|
559
|
-
function
|
|
560
|
-
l("click", { index:
|
|
565
|
+
function F(M, k, E) {
|
|
566
|
+
l("click", { index: M, value: k, event: E });
|
|
561
567
|
}
|
|
562
|
-
function
|
|
563
|
-
var
|
|
564
|
-
if (!(!
|
|
565
|
-
return (
|
|
568
|
+
function ue(M) {
|
|
569
|
+
var k;
|
|
570
|
+
if (!(!m.value || !m.value.length))
|
|
571
|
+
return (k = m.value[M]) == null ? void 0 : k.ref;
|
|
566
572
|
}
|
|
567
|
-
function
|
|
568
|
-
|
|
569
|
-
(
|
|
570
|
-
value:
|
|
571
|
-
group: r.getTickGroupAttributes(
|
|
572
|
-
ghost: r.getTickGhostAttributes(
|
|
573
|
+
function Oe() {
|
|
574
|
+
p.value = D.value.map(
|
|
575
|
+
(M, k) => ({
|
|
576
|
+
value: Y(M),
|
|
577
|
+
group: r.getTickGroupAttributes(M, k),
|
|
578
|
+
ghost: r.getTickGhostAttributes(ue(k)),
|
|
573
579
|
label: r.getTickLabelAttributes(),
|
|
574
580
|
gridline: r.getGridLinesAttributes()
|
|
575
581
|
})
|
|
576
582
|
);
|
|
577
583
|
}
|
|
578
|
-
function
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
584
|
+
function ke() {
|
|
585
|
+
p.value && p.value.map((M) => (M.gridline = r.getGridLinesAttributes(), M));
|
|
586
|
+
}
|
|
587
|
+
function xe() {
|
|
588
|
+
if (!u.value)
|
|
589
|
+
return;
|
|
590
|
+
const M = u.value.step ? "bandScale" : "linearScale", k = Yn[`${L.value}-${Qt[M]}`];
|
|
591
|
+
Object.entries(k(u, a, h) || []).forEach(
|
|
592
|
+
([E, _]) => {
|
|
593
|
+
r[E] = _;
|
|
583
594
|
}
|
|
584
595
|
);
|
|
585
596
|
}
|
|
586
|
-
return
|
|
597
|
+
return Z(u, xe, { flush: "sync", immediate: !0 }), Z(u, Oe, { immediate: !0 }), Z(m, Oe), Z(X, (M) => l("lume__internal--axis-size", M)), Z(o.containerSize, ke), _e(() => ze(g.value)), (M, k) => d(u) ? (y(), $("g", {
|
|
587
598
|
key: 0,
|
|
588
599
|
ref_key: "root",
|
|
589
600
|
ref: g,
|
|
590
601
|
class: "axis",
|
|
591
602
|
transform: N.value,
|
|
592
603
|
"data-j-axis": "",
|
|
593
|
-
onMouseleave:
|
|
604
|
+
onMouseleave: k[1] || (k[1] = (E) => l("mouseleave", E))
|
|
594
605
|
}, [
|
|
595
|
-
|
|
596
|
-
(
|
|
597
|
-
key: `${
|
|
606
|
+
L.value === "x" ? (y(), $("defs", Jn, qn)) : W("", !0),
|
|
607
|
+
(y(!0), $(q, null, z(p.value, (E, _) => (y(), K(d(bt), G({
|
|
608
|
+
key: `${E.value}_${_}`,
|
|
598
609
|
ref_for: !0,
|
|
599
610
|
ref_key: "tickRefs",
|
|
600
|
-
ref:
|
|
601
|
-
},
|
|
602
|
-
"is-hidden": d(
|
|
603
|
-
"with-gridlines": d(
|
|
604
|
-
onMouseenter: (
|
|
605
|
-
onClick: (
|
|
611
|
+
ref: m
|
|
612
|
+
}, E, {
|
|
613
|
+
"is-hidden": d(h).skip && !d(x)(_),
|
|
614
|
+
"with-gridlines": d(h).gridLines,
|
|
615
|
+
onMouseenter: (j) => Q(_, E.value, j),
|
|
616
|
+
onClick: (j) => F(_, E.value, j)
|
|
606
617
|
}), null, 16, ["is-hidden", "with-gridlines", "onMouseenter", "onClick"]))), 128)),
|
|
607
|
-
w.value ? (
|
|
618
|
+
w.value ? (y(), K(d(bt), G({ key: 1 }, p.value[d(i)], {
|
|
608
619
|
"with-gridlines": !1,
|
|
609
620
|
"is-hovered": "",
|
|
610
|
-
onClick:
|
|
621
|
+
onClick: k[0] || (k[0] = (E) => F(
|
|
611
622
|
d(i),
|
|
612
|
-
|
|
613
|
-
|
|
623
|
+
p.value[d(i)].value,
|
|
624
|
+
E
|
|
614
625
|
))
|
|
615
|
-
}), null, 16)) :
|
|
616
|
-
], 40,
|
|
626
|
+
}), null, 16)) : W("", !0)
|
|
627
|
+
], 40, Kn)) : W("", !0);
|
|
617
628
|
}
|
|
618
629
|
});
|
|
619
|
-
function
|
|
630
|
+
function eo(e, n, t, o) {
|
|
620
631
|
const l = v(() => t.value > 0 && t.value < 1), u = v(
|
|
621
632
|
() => o.value > 0 && o.value < 1
|
|
622
633
|
), a = v(
|
|
@@ -628,13 +639,13 @@ function Qn(e, n, t, o) {
|
|
|
628
639
|
);
|
|
629
640
|
return { computedX: a, computedY: i, shouldHaveMinWidth: l, shouldHaveMinHeight: u };
|
|
630
641
|
}
|
|
631
|
-
function
|
|
632
|
-
const l =
|
|
633
|
-
return
|
|
642
|
+
function to(e, n, t, o) {
|
|
643
|
+
const l = S(0), u = S(0), a = v(() => `${e.value + t.value / 2}px ${n.value + o.value / 2}px`);
|
|
644
|
+
return _e(() => {
|
|
634
645
|
l.value = t.value, u.value = o.value;
|
|
635
|
-
}),
|
|
646
|
+
}), Z(t, (i) => l.value = i), Z(o, (i) => u.value = i), { computedWidth: l, computedHeight: u, transformOrigin: a };
|
|
636
647
|
}
|
|
637
|
-
const
|
|
648
|
+
const no = ["x", "y", "width", "height"], oo = /* @__PURE__ */ U({
|
|
638
649
|
__name: "lume-bar",
|
|
639
650
|
props: {
|
|
640
651
|
x: {
|
|
@@ -672,49 +683,49 @@ const eo = ["x", "y", "width", "height"], to = /* @__PURE__ */ Z({
|
|
|
672
683
|
},
|
|
673
684
|
emits: ["click", "mouseover", "mouseleave"],
|
|
674
685
|
setup(e, { emit: n }) {
|
|
675
|
-
const t = e, o = n, { x: l, y: u, width: a, height: i, transition: s, classList: c } =
|
|
686
|
+
const t = e, o = n, { x: l, y: u, width: a, height: i, transition: s, classList: c } = te(t), f = S(null), r = v(
|
|
676
687
|
() => typeof c.value == "string" ? [c.value] : c.value
|
|
677
|
-
),
|
|
678
|
-
return
|
|
688
|
+
), m = v(() => s.value === "width"), g = v(() => s.value === "height"), p = to(l, u, a, i), { computedX: b, computedY: L, shouldHaveMinWidth: A, shouldHaveMinHeight: h } = eo(l, u, a, i), x = v(() => A.value ? 1 : (m.value ? p.computedWidth : a).value), N = v(() => h.value ? 1 : (g.value ? p.computedHeight : i).value), D = m.value || g.value ? p.transformOrigin : null;
|
|
689
|
+
return _e(() => ze(f.value)), (P, w) => (y(), $("rect", {
|
|
679
690
|
ref_key: "root",
|
|
680
|
-
ref:
|
|
681
|
-
class:
|
|
691
|
+
ref: f,
|
|
692
|
+
class: ne(["lume-bar", [
|
|
682
693
|
{
|
|
683
694
|
"lume-fill--faded": e.isFaded,
|
|
684
695
|
"lume-bar--negative": e.isNegative,
|
|
685
|
-
"lume-bar--transition-width":
|
|
696
|
+
"lume-bar--transition-width": m.value,
|
|
686
697
|
"lume-bar--transition-height": g.value
|
|
687
698
|
},
|
|
688
699
|
...r.value
|
|
689
700
|
]]),
|
|
690
|
-
style:
|
|
691
|
-
x: d(
|
|
692
|
-
y: d(
|
|
693
|
-
width:
|
|
701
|
+
style: Gt({ transformOrigin: d(D) }),
|
|
702
|
+
x: d(b),
|
|
703
|
+
y: d(L),
|
|
704
|
+
width: x.value,
|
|
694
705
|
height: N.value,
|
|
695
706
|
"data-j-bar": "",
|
|
696
|
-
onClick: w[0] || (w[0] = (
|
|
697
|
-
onMouseover: w[1] || (w[1] = (
|
|
698
|
-
onMouseleave: w[2] || (w[2] = (
|
|
699
|
-
}, null, 46,
|
|
707
|
+
onClick: w[0] || (w[0] = (H) => o("click", H)),
|
|
708
|
+
onMouseover: w[1] || (w[1] = (H) => o("mouseover", H)),
|
|
709
|
+
onMouseleave: w[2] || (w[2] = (H) => o("mouseleave", H))
|
|
710
|
+
}, null, 46, no));
|
|
700
711
|
}
|
|
701
712
|
});
|
|
702
|
-
const
|
|
703
|
-
function
|
|
704
|
-
const e =
|
|
713
|
+
const mt = /* @__PURE__ */ ee(oo, [["__scopeId", "data-v-8e8f732a"]]);
|
|
714
|
+
function lo() {
|
|
715
|
+
const e = S(), n = Fe({
|
|
705
716
|
dimensions: {}
|
|
706
717
|
}), t = new ResizeObserver((o) => {
|
|
707
718
|
o.forEach((l) => {
|
|
708
719
|
n.dimensions = l.contentRect;
|
|
709
720
|
});
|
|
710
721
|
});
|
|
711
|
-
return
|
|
722
|
+
return _e(() => {
|
|
712
723
|
t.observe(e.value);
|
|
713
|
-
}),
|
|
724
|
+
}), jt(() => {
|
|
714
725
|
t.unobserve(e.value);
|
|
715
726
|
}), { resizeState: n, resizeRef: e };
|
|
716
727
|
}
|
|
717
|
-
const
|
|
728
|
+
const ao = ["height"], uo = ["transform"], ro = /* @__PURE__ */ U({
|
|
718
729
|
__name: "lume-chart-container",
|
|
719
730
|
props: {
|
|
720
731
|
margins: {
|
|
@@ -736,123 +747,122 @@ const oo = ["height"], ao = ["transform"], lo = /* @__PURE__ */ Z({
|
|
|
736
747
|
},
|
|
737
748
|
emits: ["click", "mouseenter", "mouseleave", "resize"],
|
|
738
749
|
setup(e, { emit: n }) {
|
|
739
|
-
const t = e, o = n, { margins: l, containerSize: u } =
|
|
750
|
+
const t = e, o = n, { margins: l, containerSize: u } = te(t), a = S(null), { resizeRef: i, resizeState: s } = lo(), c = v(
|
|
740
751
|
() => u.value.height + l.value.top + l.value.bottom
|
|
741
752
|
);
|
|
742
|
-
return
|
|
753
|
+
return Vt(() => {
|
|
743
754
|
if (!a.value)
|
|
744
755
|
return;
|
|
745
|
-
const { width:
|
|
746
|
-
if (!
|
|
756
|
+
const { width: f } = s.dimensions, { height: r } = a.value.getBoundingClientRect();
|
|
757
|
+
if (!f || !r)
|
|
747
758
|
return;
|
|
748
|
-
const
|
|
749
|
-
width:
|
|
759
|
+
const m = f - l.value.left - l.value.right, g = r - l.value.top - l.value.bottom, p = {
|
|
760
|
+
width: m > 0 ? m : 0,
|
|
750
761
|
height: g > 0 ? g : 0,
|
|
751
|
-
outerWidth:
|
|
762
|
+
outerWidth: f,
|
|
752
763
|
outerHeight: r
|
|
753
764
|
};
|
|
754
|
-
o("resize",
|
|
755
|
-
}), (
|
|
765
|
+
o("resize", p);
|
|
766
|
+
}), (f, r) => (y(), $("div", {
|
|
756
767
|
ref_key: "resizeRef",
|
|
757
768
|
ref: i,
|
|
758
|
-
class:
|
|
769
|
+
class: ne(["lume-chart-container", {
|
|
759
770
|
"lume-chart-container--minimum": !e.noMinSize
|
|
760
771
|
}]),
|
|
761
772
|
"data-j-chart-container": ""
|
|
762
773
|
}, [
|
|
763
|
-
|
|
764
|
-
(
|
|
774
|
+
R(f.$slots, "header", {}, void 0, !0),
|
|
775
|
+
(y(), $("svg", {
|
|
765
776
|
ref_key: "root",
|
|
766
777
|
ref: a,
|
|
767
|
-
class:
|
|
778
|
+
class: ne(["lume-chart-container__svg", {
|
|
768
779
|
"lume-chart-container__svg--transparent": e.transparentBackground
|
|
769
780
|
}]),
|
|
770
781
|
height: c.value,
|
|
771
782
|
"data-j-chart-container__root": "",
|
|
772
|
-
onClick: r[0] || (r[0] = (
|
|
773
|
-
onMouseenter: r[1] || (r[1] = (
|
|
774
|
-
onMouseleave: r[2] || (r[2] = (
|
|
783
|
+
onClick: r[0] || (r[0] = (m) => o("click", m)),
|
|
784
|
+
onMouseenter: r[1] || (r[1] = (m) => o("mouseenter", m)),
|
|
785
|
+
onMouseleave: r[2] || (r[2] = (m) => o("mouseleave", m))
|
|
775
786
|
}, [
|
|
776
|
-
|
|
787
|
+
C("g", {
|
|
777
788
|
transform: `translate(${d(l).left}, ${d(l).top})`,
|
|
778
789
|
class: "lume-chart-container__group",
|
|
779
790
|
"data-j-chart-container__group": ""
|
|
780
791
|
}, [
|
|
781
|
-
|
|
782
|
-
], 8,
|
|
783
|
-
], 42,
|
|
784
|
-
|
|
785
|
-
|
|
792
|
+
R(f.$slots, "default", {}, void 0, !0)
|
|
793
|
+
], 8, uo)
|
|
794
|
+
], 42, ao)),
|
|
795
|
+
R(f.$slots, "footer", {}, void 0, !0),
|
|
796
|
+
R(f.$slots, "extra", {}, void 0, !0)
|
|
786
797
|
], 2));
|
|
787
798
|
}
|
|
788
799
|
});
|
|
789
|
-
const
|
|
800
|
+
const io = /* @__PURE__ */ ee(ro, [["__scopeId", "data-v-2c7d0302"]]), so = ["onClick", "onMouseenter"], co = /* @__PURE__ */ U({
|
|
790
801
|
__name: "lume-chart-legend",
|
|
791
802
|
props: {
|
|
792
803
|
data: {
|
|
793
804
|
type: Array,
|
|
794
|
-
validator:
|
|
805
|
+
validator: $n,
|
|
795
806
|
required: !0
|
|
796
807
|
}
|
|
797
808
|
},
|
|
798
809
|
emits: ["click", "mouseenter", "mouseleave"],
|
|
799
810
|
setup(e, { emit: n }) {
|
|
800
|
-
const t = n
|
|
801
|
-
return (
|
|
802
|
-
key: 0,
|
|
811
|
+
const t = n;
|
|
812
|
+
return (o, l) => (y(), $("div", {
|
|
803
813
|
class: "lume-chart-legend",
|
|
804
814
|
"data-j-chart-legend": "",
|
|
805
|
-
onMouseleave:
|
|
815
|
+
onMouseleave: l[0] || (l[0] = (u) => t("mouseleave"))
|
|
806
816
|
}, [
|
|
807
|
-
(
|
|
808
|
-
key: `legend-item-${
|
|
817
|
+
(y(!0), $(q, null, z(e.data, (u, a) => (y(), $("div", {
|
|
818
|
+
key: `legend-item-${a}`,
|
|
809
819
|
class: "lume-chart-legend__item lume-typography--body",
|
|
810
820
|
tabindex: "0",
|
|
811
821
|
"data-j-chart-legend__symbol-wrapper": "",
|
|
812
|
-
onClick: (
|
|
813
|
-
onMouseenter: (
|
|
822
|
+
onClick: (i) => t("click", { index: a, dataset: u, event: i }),
|
|
823
|
+
onMouseenter: (i) => t("mouseenter", { index: a, dataset: u, event: i })
|
|
814
824
|
}, [
|
|
815
|
-
|
|
816
|
-
class:
|
|
825
|
+
C("span", {
|
|
826
|
+
class: ne(["lume-chart-legend__symbol", `lume-background-color--${u.color}`]),
|
|
817
827
|
"data-j-chart-legend__symbol": ""
|
|
818
828
|
}, null, 2),
|
|
819
|
-
fe(" " +
|
|
820
|
-
], 40,
|
|
829
|
+
fe(" " + oe(u.label || a), 1)
|
|
830
|
+
], 40, so))), 128))
|
|
821
831
|
], 32));
|
|
822
832
|
}
|
|
823
833
|
});
|
|
824
|
-
const
|
|
825
|
-
const
|
|
834
|
+
const Ot = /* @__PURE__ */ ee(co, [["__scopeId", "data-v-f8ebd3b9"]]);
|
|
835
|
+
const vo = {}, mo = {
|
|
826
836
|
class: "lume-tooltip__title",
|
|
827
837
|
"data-j-tooltip__title": ""
|
|
828
838
|
};
|
|
829
|
-
function
|
|
830
|
-
return
|
|
831
|
-
|
|
839
|
+
function fo(e, n) {
|
|
840
|
+
return y(), $("div", mo, [
|
|
841
|
+
R(e.$slots, "default", {}, void 0, !0)
|
|
832
842
|
]);
|
|
833
843
|
}
|
|
834
|
-
const
|
|
835
|
-
const
|
|
844
|
+
const po = /* @__PURE__ */ ee(vo, [["render", fo], ["__scopeId", "data-v-8af3fac6"]]);
|
|
845
|
+
const ho = {}, go = {
|
|
836
846
|
class: "lume-tooltip__item",
|
|
837
847
|
"data-j-tooltip__summary-item": ""
|
|
838
|
-
},
|
|
839
|
-
function
|
|
840
|
-
return
|
|
841
|
-
|
|
842
|
-
|
|
848
|
+
}, _o = { class: "lume-tooltip__value" };
|
|
849
|
+
function yo(e, n) {
|
|
850
|
+
return y(), $("li", go, [
|
|
851
|
+
C("span", null, [
|
|
852
|
+
R(e.$slots, "default", {}, void 0, !0)
|
|
843
853
|
]),
|
|
844
|
-
|
|
845
|
-
|
|
854
|
+
C("strong", _o, [
|
|
855
|
+
R(e.$slots, "value", {}, void 0, !0)
|
|
846
856
|
])
|
|
847
857
|
]);
|
|
848
858
|
}
|
|
849
|
-
const
|
|
859
|
+
const ko = /* @__PURE__ */ ee(ho, [["render", yo], ["__scopeId", "data-v-4ed7ec1b"]]), bo = {
|
|
850
860
|
class: "lume-tooltip__item",
|
|
851
861
|
"data-j-tooltip__item": ""
|
|
852
|
-
},
|
|
862
|
+
}, Ao = { "data-j-tooltip__item__label": "" }, To = {
|
|
853
863
|
class: "lume-tooltip__value",
|
|
854
864
|
"data-j-tooltip__item__value": ""
|
|
855
|
-
},
|
|
865
|
+
}, Lo = /* @__PURE__ */ U({
|
|
856
866
|
__name: "lume-tooltip-item",
|
|
857
867
|
props: {
|
|
858
868
|
color: {
|
|
@@ -861,27 +871,27 @@ const _o = /* @__PURE__ */ te(po, [["render", go], ["__scopeId", "data-v-4ed7ec1
|
|
|
861
871
|
}
|
|
862
872
|
},
|
|
863
873
|
setup(e) {
|
|
864
|
-
return (n, t) => (
|
|
865
|
-
e.color ? (
|
|
874
|
+
return (n, t) => (y(), $("li", bo, [
|
|
875
|
+
e.color ? (y(), $("span", {
|
|
866
876
|
key: 0,
|
|
867
|
-
class:
|
|
877
|
+
class: ne([[`lume-background-color--${e.color}`], "lume-tooltip__symbol"]),
|
|
868
878
|
"data-j-tooltip__item__symbol": ""
|
|
869
|
-
}, null, 2)) :
|
|
870
|
-
|
|
871
|
-
|
|
879
|
+
}, null, 2)) : W("", !0),
|
|
880
|
+
C("span", Ao, [
|
|
881
|
+
R(n.$slots, "label", {}, void 0, !0)
|
|
872
882
|
]),
|
|
873
|
-
|
|
874
|
-
|
|
883
|
+
C("strong", To, [
|
|
884
|
+
R(n.$slots, "value", {}, void 0, !0)
|
|
875
885
|
])
|
|
876
886
|
]));
|
|
877
887
|
}
|
|
878
888
|
});
|
|
879
|
-
const
|
|
889
|
+
const Oo = /* @__PURE__ */ ee(Lo, [["__scopeId", "data-v-4f995c3c"]]), xo = (e) => (vn("data-v-c96a2010"), e = e(), mn(), e), $o = { class: "lume-tooltip__items" }, Io = {
|
|
880
890
|
key: 0,
|
|
881
891
|
class: "lume-tooltip__break"
|
|
882
|
-
},
|
|
883
|
-
|
|
884
|
-
],
|
|
892
|
+
}, wo = /* @__PURE__ */ xo(() => /* @__PURE__ */ C("hr", null, null, -1)), Eo = [
|
|
893
|
+
wo
|
|
894
|
+
], No = /* @__PURE__ */ U({
|
|
885
895
|
__name: "lume-tooltip",
|
|
886
896
|
props: {
|
|
887
897
|
targetElement: {
|
|
@@ -895,12 +905,16 @@ const To = /* @__PURE__ */ te(Ao, [["__scopeId", "data-v-4f995c3c"]]), Lo = (e)
|
|
|
895
905
|
position: {
|
|
896
906
|
type: String,
|
|
897
907
|
default: "auto",
|
|
898
|
-
validator: (e) =>
|
|
908
|
+
validator: (e) => Pn.includes(e)
|
|
899
909
|
},
|
|
900
910
|
fixedPositioning: {
|
|
901
911
|
type: Boolean,
|
|
902
912
|
default: !1
|
|
903
913
|
},
|
|
914
|
+
inverse: {
|
|
915
|
+
type: Boolean,
|
|
916
|
+
default: !1
|
|
917
|
+
},
|
|
904
918
|
modifiers: {
|
|
905
919
|
type: Array,
|
|
906
920
|
default: null
|
|
@@ -913,15 +927,15 @@ const To = /* @__PURE__ */ te(Ao, [["__scopeId", "data-v-4f995c3c"]]), Lo = (e)
|
|
|
913
927
|
type: String,
|
|
914
928
|
default: null
|
|
915
929
|
},
|
|
916
|
-
...
|
|
930
|
+
...Me()
|
|
917
931
|
},
|
|
918
932
|
emits: ["opened", "moved", "closed", "tooltip-mouseenter", "tooltip-mouseleave"],
|
|
919
933
|
setup(e, { emit: n }) {
|
|
920
|
-
const t = e, o = n, l =
|
|
934
|
+
const t = e, o = n, l = S(null), { items: u, options: a } = te(t), i = re(), s = S(null), { allOptions: c } = me(a), f = v(
|
|
921
935
|
() => c.value.fixedPositioning ?? t.fixedPositioning
|
|
922
936
|
), r = v(
|
|
923
|
-
() =>
|
|
924
|
-
),
|
|
937
|
+
() => f.value ? "fixed" : "absolute"
|
|
938
|
+
), m = v(() => [
|
|
925
939
|
{
|
|
926
940
|
name: "computeStyles",
|
|
927
941
|
options: {
|
|
@@ -936,81 +950,81 @@ const To = /* @__PURE__ */ te(Ao, [["__scopeId", "data-v-4f995c3c"]]), Lo = (e)
|
|
|
936
950
|
...t.modifiers || []
|
|
937
951
|
]), g = v(
|
|
938
952
|
() => c.value.showTitle !== !1 && t.title != null
|
|
939
|
-
),
|
|
953
|
+
), p = v(() => je(c.value.valueFormat)), b = v(() => je(c.value.titleFormat)), L = v(
|
|
940
954
|
() => {
|
|
941
|
-
var
|
|
942
|
-
return ((
|
|
955
|
+
var P;
|
|
956
|
+
return ((P = u.value) == null ? void 0 : P.find((w) => w.isSummary)) || {
|
|
943
957
|
label: c.value.summary ?? t.summary
|
|
944
958
|
};
|
|
945
959
|
}
|
|
946
|
-
),
|
|
947
|
-
function
|
|
948
|
-
t.targetElement && l.value && (s.value =
|
|
960
|
+
), A = v(() => i.summary || L.value.label), h = v(() => t.inverse || c.value.inverse ? [...u.value].reverse() : u.value);
|
|
961
|
+
function x() {
|
|
962
|
+
t.targetElement && l.value && (s.value = kn(t.targetElement, l.value, {
|
|
949
963
|
placement: t.position,
|
|
950
964
|
strategy: r.value,
|
|
951
|
-
modifiers:
|
|
965
|
+
modifiers: m.value
|
|
952
966
|
}), o("opened", t.targetElement));
|
|
953
967
|
}
|
|
954
|
-
function
|
|
968
|
+
function N() {
|
|
955
969
|
s.value && (s.value.destroy(), o("closed"));
|
|
956
970
|
}
|
|
957
|
-
function
|
|
971
|
+
function D() {
|
|
958
972
|
s.value && (c.value.withAnimation !== !1 && l.value.classList.add("lume-tooltip--animated"), t.targetElement ? function() {
|
|
959
973
|
s.value.state.elements.reference = t.targetElement, s.value.update(), o("moved", t.targetElement);
|
|
960
|
-
}() :
|
|
974
|
+
}() : N());
|
|
961
975
|
}
|
|
962
|
-
return
|
|
976
|
+
return Z(
|
|
963
977
|
() => t.targetElement,
|
|
964
|
-
(
|
|
965
|
-
!
|
|
978
|
+
(P, w) => {
|
|
979
|
+
!w && P ? x() : D();
|
|
966
980
|
}
|
|
967
|
-
),
|
|
981
|
+
), _e(x), jt(N), (P, w) => cn((y(), $("div", {
|
|
968
982
|
ref_key: "root",
|
|
969
983
|
ref: l,
|
|
970
|
-
class:
|
|
984
|
+
class: ne(["lume-tooltip lume-typography--caption", {
|
|
971
985
|
"lume-tooltip--pointer-events": d(a).withPointerEvents
|
|
972
986
|
}]),
|
|
973
987
|
"data-j-tooltip": "",
|
|
974
|
-
onMouseenter:
|
|
975
|
-
onMouseleave:
|
|
988
|
+
onMouseenter: w[0] || (w[0] = (H) => o("tooltip-mouseenter")),
|
|
989
|
+
onMouseleave: w[1] || (w[1] = (H) => o("tooltip-mouseleave"))
|
|
976
990
|
}, [
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
g.value ? (
|
|
991
|
+
R(P.$slots, "default", {}, () => [
|
|
992
|
+
R(P.$slots, "title", {}, () => [
|
|
993
|
+
g.value ? (y(), K(d(po), { key: 0 }, {
|
|
980
994
|
default: V(() => [
|
|
981
|
-
fe(
|
|
995
|
+
fe(oe(b.value(e.title)), 1)
|
|
982
996
|
]),
|
|
983
997
|
_: 1
|
|
984
|
-
})) :
|
|
998
|
+
})) : W("", !0)
|
|
985
999
|
], !0),
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1000
|
+
C("ul", $o, [
|
|
1001
|
+
R(P.$slots, "summary", {}, () => [
|
|
1002
|
+
A.value ? (y(), K(d(ko), { key: 0 }, ce({
|
|
989
1003
|
default: V(() => [
|
|
990
|
-
fe(
|
|
1004
|
+
fe(oe(L.value.label) + " ", 1)
|
|
991
1005
|
]),
|
|
992
1006
|
_: 2
|
|
993
1007
|
}, [
|
|
994
|
-
|
|
1008
|
+
L.value.value ? {
|
|
995
1009
|
name: "value",
|
|
996
1010
|
fn: V(() => [
|
|
997
|
-
fe(
|
|
1011
|
+
fe(oe(p.value(L.value.value)), 1)
|
|
998
1012
|
]),
|
|
999
1013
|
key: "0"
|
|
1000
1014
|
} : void 0
|
|
1001
|
-
]), 1024)) :
|
|
1015
|
+
]), 1024)) : W("", !0)
|
|
1002
1016
|
], !0),
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
(
|
|
1006
|
-
key:
|
|
1007
|
-
color:
|
|
1017
|
+
A.value ? (y(), $("li", Io, Eo)) : W("", !0),
|
|
1018
|
+
R(P.$slots, "items", {}, () => [
|
|
1019
|
+
(y(!0), $(q, null, z(h.value, (H) => (y(), K(d(Oo), {
|
|
1020
|
+
key: H.label,
|
|
1021
|
+
color: H.color
|
|
1008
1022
|
}, {
|
|
1009
1023
|
label: V(() => [
|
|
1010
|
-
fe(
|
|
1024
|
+
fe(oe(H.label), 1)
|
|
1011
1025
|
]),
|
|
1012
1026
|
value: V(() => [
|
|
1013
|
-
fe(
|
|
1027
|
+
fe(oe(p.value(H.value)), 1)
|
|
1014
1028
|
]),
|
|
1015
1029
|
_: 2
|
|
1016
1030
|
}, 1032, ["color"]))), 128))
|
|
@@ -1018,60 +1032,60 @@ const To = /* @__PURE__ */ te(Ao, [["__scopeId", "data-v-4f995c3c"]]), Lo = (e)
|
|
|
1018
1032
|
])
|
|
1019
1033
|
], !0)
|
|
1020
1034
|
], 34)), [
|
|
1021
|
-
[
|
|
1035
|
+
[dn, e.targetElement]
|
|
1022
1036
|
]);
|
|
1023
1037
|
}
|
|
1024
1038
|
});
|
|
1025
|
-
const
|
|
1026
|
-
var
|
|
1027
|
-
const
|
|
1028
|
-
function Ho(e) {
|
|
1029
|
-
return e === Te.Divergent ? Do : Ce;
|
|
1030
|
-
}
|
|
1039
|
+
const Do = /* @__PURE__ */ ee(No, [["__scopeId", "data-v-c96a2010"]]);
|
|
1040
|
+
var Ae = /* @__PURE__ */ ((e) => (e.Categorical = "categorical", e.Sequential = "sequential", e.Divergent = "divergent", e))(Ae || {});
|
|
1041
|
+
const Ho = Ae.Categorical, Re = se.Skyblue, Bo = ct.SkyTeal;
|
|
1031
1042
|
function Mo(e) {
|
|
1032
|
-
return
|
|
1033
|
-
}
|
|
1034
|
-
function
|
|
1035
|
-
return
|
|
1036
|
-
...ce,
|
|
1037
|
-
...Ft,
|
|
1038
|
-
...st,
|
|
1039
|
-
...ct
|
|
1040
|
-
}).includes(e);
|
|
1043
|
+
return e === Ae.Divergent ? Bo : Re;
|
|
1044
|
+
}
|
|
1045
|
+
function So(e) {
|
|
1046
|
+
return Object.values(vt).includes(e);
|
|
1041
1047
|
}
|
|
1042
|
-
function
|
|
1043
|
-
|
|
1044
|
-
|
|
1048
|
+
function xt(e, n) {
|
|
1049
|
+
return n === Ae.Divergent ? Object.values(ct).includes(e) : Object.values({
|
|
1050
|
+
...se,
|
|
1051
|
+
...Zt,
|
|
1052
|
+
...dt,
|
|
1053
|
+
...vt
|
|
1054
|
+
}).includes(e);
|
|
1045
1055
|
}
|
|
1046
1056
|
function Ro(e, n) {
|
|
1057
|
+
const t = Object.values(se).indexOf(e);
|
|
1058
|
+
return Bn(Object.values(se), t > -1 ? t : 0)[n];
|
|
1059
|
+
}
|
|
1060
|
+
function Co(e, n) {
|
|
1047
1061
|
const t = 50 + n * 10;
|
|
1048
1062
|
return `${e}-${t}`;
|
|
1049
1063
|
}
|
|
1050
|
-
function
|
|
1064
|
+
function Go(e, n) {
|
|
1051
1065
|
const t = (n + 1) * 10;
|
|
1052
1066
|
return `${e}-${t}`;
|
|
1053
1067
|
}
|
|
1054
|
-
function
|
|
1068
|
+
function $t(e, n, t) {
|
|
1055
1069
|
switch (n) {
|
|
1056
1070
|
default:
|
|
1057
|
-
case
|
|
1058
|
-
return
|
|
1059
|
-
case
|
|
1060
|
-
return
|
|
1061
|
-
case
|
|
1062
|
-
return
|
|
1071
|
+
case Ae.Categorical:
|
|
1072
|
+
return So(e) ? e : Ro(e, t);
|
|
1073
|
+
case Ae.Sequential:
|
|
1074
|
+
return Co(e, t);
|
|
1075
|
+
case Ae.Divergent:
|
|
1076
|
+
return Go(e, t);
|
|
1063
1077
|
}
|
|
1064
1078
|
}
|
|
1065
|
-
function
|
|
1066
|
-
return
|
|
1079
|
+
function jo(e, n, t = Ho, o) {
|
|
1080
|
+
return xt(e, t) ? e : (o > 4 && (ge(ve.ColorLoop), o = o % 5), xt(n, t) ? $t(n, t, o) : $t(Mo(t), t, o));
|
|
1067
1081
|
}
|
|
1068
|
-
function
|
|
1069
|
-
return e.map((n) =>
|
|
1082
|
+
function Vo(e) {
|
|
1083
|
+
return e.map((n) => In(n) ? n : { value: n });
|
|
1070
1084
|
}
|
|
1071
|
-
function
|
|
1085
|
+
function Po(e) {
|
|
1072
1086
|
return e.__internal === !0;
|
|
1073
1087
|
}
|
|
1074
|
-
const
|
|
1088
|
+
const ft = (e = null) => ({
|
|
1075
1089
|
data: {
|
|
1076
1090
|
type: Array,
|
|
1077
1091
|
required: !0,
|
|
@@ -1083,41 +1097,41 @@ const vt = (e = null) => ({
|
|
|
1083
1097
|
},
|
|
1084
1098
|
color: {
|
|
1085
1099
|
type: String,
|
|
1086
|
-
default:
|
|
1100
|
+
default: se.Skyblue
|
|
1087
1101
|
},
|
|
1088
1102
|
title: {
|
|
1089
1103
|
type: String,
|
|
1090
1104
|
default: null
|
|
1091
1105
|
}
|
|
1092
1106
|
});
|
|
1093
|
-
function
|
|
1094
|
-
const u =
|
|
1107
|
+
function pt(e, n, t, o, l) {
|
|
1108
|
+
const u = Fe({
|
|
1095
1109
|
width: 0,
|
|
1096
1110
|
height: 0
|
|
1097
|
-
}), a =
|
|
1098
|
-
var
|
|
1099
|
-
return e.value.length > 5 &&
|
|
1100
|
-
(r,
|
|
1101
|
-
if (
|
|
1111
|
+
}), a = Sn(12), i = v(() => {
|
|
1112
|
+
var f;
|
|
1113
|
+
return e.value.length > 5 && ge(ve.DatasetLength), (f = e.value) == null ? void 0 : f.map(
|
|
1114
|
+
(r, m) => {
|
|
1115
|
+
if (Po(r))
|
|
1102
1116
|
return r;
|
|
1103
|
-
const g =
|
|
1117
|
+
const g = Vo(r.values), p = jo(
|
|
1104
1118
|
r.color,
|
|
1105
1119
|
t == null ? void 0 : t.value,
|
|
1106
1120
|
o == null ? void 0 : o.value.colorPalette,
|
|
1107
|
-
|
|
1121
|
+
m
|
|
1108
1122
|
);
|
|
1109
1123
|
return {
|
|
1110
1124
|
...r,
|
|
1111
1125
|
values: g,
|
|
1112
|
-
color:
|
|
1126
|
+
color: p,
|
|
1113
1127
|
__internal: !0
|
|
1114
1128
|
};
|
|
1115
1129
|
}
|
|
1116
1130
|
);
|
|
1117
|
-
}), s = v(() => Array.isArray(n.value) ? n.value :
|
|
1118
|
-
function c(
|
|
1119
|
-
const r = (l == null ? void 0 : l.value) ===
|
|
1120
|
-
u.width =
|
|
1131
|
+
}), s = v(() => Array.isArray(n.value) ? n.value : Wt(e.value).map((f, r) => r));
|
|
1132
|
+
function c(f) {
|
|
1133
|
+
const r = (l == null ? void 0 : l.value) === B.HORIZONTAL && s.value.length * (((o == null ? void 0 : o.value.barHeight) || Tt) * 2) + ((o == null ? void 0 : o.value.barHeight) || Tt) || f.height;
|
|
1134
|
+
u.width = f.width, u.height = r;
|
|
1121
1135
|
}
|
|
1122
1136
|
return {
|
|
1123
1137
|
chartID: a,
|
|
@@ -1127,7 +1141,7 @@ function mt(e, n, t, o, l) {
|
|
|
1127
1141
|
updateSize: c
|
|
1128
1142
|
};
|
|
1129
1143
|
}
|
|
1130
|
-
const
|
|
1144
|
+
const Fo = () => ({
|
|
1131
1145
|
xScale: {
|
|
1132
1146
|
type: Function,
|
|
1133
1147
|
default: null
|
|
@@ -1137,69 +1151,70 @@ const Vo = () => ({
|
|
|
1137
1151
|
default: null
|
|
1138
1152
|
}
|
|
1139
1153
|
});
|
|
1140
|
-
function
|
|
1141
|
-
const u =
|
|
1154
|
+
function zo(e, n, t, o, l) {
|
|
1155
|
+
const u = S(null), a = S(null);
|
|
1142
1156
|
function i() {
|
|
1157
|
+
var f, r, m, g;
|
|
1143
1158
|
const { width: s, height: c } = t;
|
|
1144
|
-
!s && !c ||
|
|
1159
|
+
!s && !c || (o.value === B.HORIZONTAL ? (u.value = (f = e.value) != null && f.length ? wt(
|
|
1145
1160
|
e.value,
|
|
1146
1161
|
s,
|
|
1147
1162
|
o.value,
|
|
1148
1163
|
l.value.startOnZero
|
|
1149
|
-
), a.value =
|
|
1164
|
+
) : null, a.value = (r = n.value) != null && r.length ? It(
|
|
1150
1165
|
n.value,
|
|
1151
1166
|
c,
|
|
1152
1167
|
o.value,
|
|
1153
1168
|
l.value
|
|
1154
|
-
)) : (u.value =
|
|
1169
|
+
) : null) : (u.value = (m = n.value) != null && m.length ? It(
|
|
1155
1170
|
n.value,
|
|
1156
1171
|
s,
|
|
1157
1172
|
o.value,
|
|
1158
1173
|
l.value
|
|
1159
|
-
), a.value =
|
|
1174
|
+
) : null, a.value = (g = e.value) != null && g.length ? wt(
|
|
1160
1175
|
e.value,
|
|
1161
1176
|
c,
|
|
1162
1177
|
o.value,
|
|
1163
1178
|
l.value.startOnZero
|
|
1164
|
-
)));
|
|
1179
|
+
) : null));
|
|
1165
1180
|
}
|
|
1166
|
-
return
|
|
1181
|
+
return Vt(i), { xScale: u, yScale: a };
|
|
1167
1182
|
}
|
|
1168
|
-
function
|
|
1169
|
-
const l = [0, n], { padding: u, paddingInner: a, paddingOuter: i } = o, s = u ?? (t ===
|
|
1183
|
+
function It(e, n, t, o) {
|
|
1184
|
+
const l = [0, n], { padding: u, paddingInner: a, paddingOuter: i } = o, s = u ?? (t === B.HORIZONTAL ? Yt : Xt);
|
|
1170
1185
|
return Object.assign(
|
|
1171
|
-
He().range(l).paddingInner(a ?? s).paddingOuter(i ?? s).domain(e.map((c,
|
|
1186
|
+
He().range(l).paddingInner(a ?? s).paddingOuter(i ?? s).domain(e.map((c, f) => f)),
|
|
1172
1187
|
{ labels: e }
|
|
1173
1188
|
);
|
|
1174
1189
|
}
|
|
1175
|
-
function
|
|
1176
|
-
const l =
|
|
1190
|
+
function wt(e, n, t, o) {
|
|
1191
|
+
const l = Ft(e).filter((f) => f != null), u = [0, n];
|
|
1177
1192
|
if (l.length === 0)
|
|
1178
|
-
return
|
|
1179
|
-
const a = Math.min(...l), i = o && a > 0 ? 0 : a, s = Math.max(...l), c = t ===
|
|
1180
|
-
return
|
|
1193
|
+
return Be().range(u).domain([0, 0]).nice();
|
|
1194
|
+
const a = Math.min(...l), i = o && a > 0 ? 0 : a, s = Math.max(...l), c = t === B.HORIZONTAL ? [i, s] : [s, i];
|
|
1195
|
+
return Be().range(u).domain(c).nice();
|
|
1181
1196
|
}
|
|
1182
|
-
function
|
|
1197
|
+
function Et(e) {
|
|
1183
1198
|
return (e == null ? void 0 : e.range) !== void 0 || (e == null ? void 0 : e.copy) !== void 0;
|
|
1184
1199
|
}
|
|
1185
|
-
function
|
|
1186
|
-
return
|
|
1200
|
+
function et(e, n) {
|
|
1201
|
+
return de(e) ? e.bandwidth() / 2 + e(e.domain()[n]) : e(n);
|
|
1187
1202
|
}
|
|
1188
|
-
function
|
|
1203
|
+
function Nt(e, n, {
|
|
1189
1204
|
padding: t,
|
|
1190
1205
|
paddingInner: o,
|
|
1191
1206
|
paddingOuter: l
|
|
1192
1207
|
} = {}) {
|
|
1193
|
-
const u = t ?? (n ===
|
|
1208
|
+
const u = t ?? (n === B.HORIZONTAL ? Yt : Xt);
|
|
1194
1209
|
return e.copy().paddingInner(o ?? u).paddingOuter(l ?? u);
|
|
1195
1210
|
}
|
|
1196
|
-
function
|
|
1197
|
-
return Object.values(
|
|
1211
|
+
function en(e) {
|
|
1212
|
+
return Object.values(B).includes(e);
|
|
1198
1213
|
}
|
|
1199
1214
|
const Ne = (e, n = !0) => ({
|
|
1200
|
-
...
|
|
1201
|
-
...
|
|
1202
|
-
...
|
|
1215
|
+
...ft(e),
|
|
1216
|
+
...Fo(),
|
|
1217
|
+
...Me(),
|
|
1203
1218
|
classList: {
|
|
1204
1219
|
type: [String, Array],
|
|
1205
1220
|
default: () => []
|
|
@@ -1211,18 +1226,18 @@ const Ne = (e, n = !0) => ({
|
|
|
1211
1226
|
...n ? {
|
|
1212
1227
|
orientation: {
|
|
1213
1228
|
type: String,
|
|
1214
|
-
default:
|
|
1215
|
-
validator:
|
|
1229
|
+
default: B.VERTICAL,
|
|
1230
|
+
validator: en
|
|
1216
1231
|
}
|
|
1217
1232
|
} : {}
|
|
1218
|
-
}),
|
|
1219
|
-
...
|
|
1220
|
-
...
|
|
1233
|
+
}), Wo = (e) => ({
|
|
1234
|
+
...ft(e),
|
|
1235
|
+
...Me(),
|
|
1221
1236
|
hoveredElement: {
|
|
1222
1237
|
type: [Number, String],
|
|
1223
1238
|
default: null
|
|
1224
1239
|
}
|
|
1225
|
-
}),
|
|
1240
|
+
}), We = () => ({
|
|
1226
1241
|
data: {
|
|
1227
1242
|
type: Array,
|
|
1228
1243
|
required: !0
|
|
@@ -1237,8 +1252,8 @@ const Ne = (e, n = !0) => ({
|
|
|
1237
1252
|
},
|
|
1238
1253
|
orientation: {
|
|
1239
1254
|
type: String,
|
|
1240
|
-
default:
|
|
1241
|
-
validator:
|
|
1255
|
+
default: B.VERTICAL,
|
|
1256
|
+
validator: en
|
|
1242
1257
|
},
|
|
1243
1258
|
xScale: {
|
|
1244
1259
|
type: Function,
|
|
@@ -1264,57 +1279,57 @@ const Ne = (e, n = !0) => ({
|
|
|
1264
1279
|
type: [String, Array],
|
|
1265
1280
|
default: () => []
|
|
1266
1281
|
}
|
|
1267
|
-
}),
|
|
1282
|
+
}), Zo = { class: "lume-overlay-group" }, Uo = /* @__PURE__ */ U({
|
|
1268
1283
|
__name: "lume-overlay-group",
|
|
1269
1284
|
props: {
|
|
1270
|
-
...
|
|
1285
|
+
...We(),
|
|
1271
1286
|
orientation: {
|
|
1272
1287
|
type: String,
|
|
1273
|
-
default:
|
|
1288
|
+
default: B.VERTICAL
|
|
1274
1289
|
}
|
|
1275
1290
|
},
|
|
1276
1291
|
emits: ["click", "lume__internal--hover", "mouseover"],
|
|
1277
1292
|
setup(e, { emit: n }) {
|
|
1278
|
-
const t = e, o = n, { data: l, orientation: u, xScale: a, yScale: i } =
|
|
1279
|
-
function c(
|
|
1280
|
-
var
|
|
1281
|
-
const r = u.value ===
|
|
1282
|
-
return u.value ===
|
|
1293
|
+
const t = e, o = n, { data: l, orientation: u, xScale: a, yScale: i } = te(t), s = v(() => Wt(l));
|
|
1294
|
+
function c(f) {
|
|
1295
|
+
var A;
|
|
1296
|
+
const r = u.value === B.HORIZONTAL ? i.value : a.value, m = r.domain(), g = wn(r), p = ((A = r.paddingInner) == null ? void 0 : A.call(r)) ?? 0, b = g * p, L = de(r) ? r(m[f]) - b / 2 : r(f) - g / 2;
|
|
1297
|
+
return u.value === B.HORIZONTAL ? {
|
|
1283
1298
|
width: Math.max(...a.value.range()),
|
|
1284
1299
|
height: g,
|
|
1285
|
-
transform: `translate(0, ${
|
|
1300
|
+
transform: `translate(0, ${L})`
|
|
1286
1301
|
} : {
|
|
1287
1302
|
width: g,
|
|
1288
1303
|
height: Math.max(...i.value.range()),
|
|
1289
|
-
transform: `translate(${
|
|
1304
|
+
transform: `translate(${L}, 0)`
|
|
1290
1305
|
};
|
|
1291
1306
|
}
|
|
1292
|
-
return (
|
|
1293
|
-
(
|
|
1307
|
+
return (f, r) => (y(), $("g", Zo, [
|
|
1308
|
+
(y(!0), $(q, null, z(s.value, (m, g) => (y(), K(d(mt), G(c(g), {
|
|
1294
1309
|
key: `overlay-${g}`,
|
|
1295
1310
|
"data-j-lume-overlay-group": g,
|
|
1296
1311
|
transition: !1,
|
|
1297
1312
|
"class-list": "lume-fill--transparent",
|
|
1298
|
-
onMouseover: (
|
|
1299
|
-
onClick: (
|
|
1313
|
+
onMouseover: (p) => o("lume__internal--hover", g),
|
|
1314
|
+
onClick: (p) => o("click", { index: g, event: p })
|
|
1300
1315
|
}), null, 16, ["data-j-lume-overlay-group", "onMouseover", "onClick"]))), 128))
|
|
1301
1316
|
]));
|
|
1302
1317
|
}
|
|
1303
|
-
}),
|
|
1318
|
+
}), ye = (e, n) => {
|
|
1304
1319
|
function t(u, ...a) {
|
|
1305
1320
|
}
|
|
1306
1321
|
function o(u, a) {
|
|
1307
1322
|
}
|
|
1308
1323
|
return { componentEventPropagator: {}, emitInternalEvent: t, listenInternalEvent: o };
|
|
1309
1324
|
};
|
|
1310
|
-
function
|
|
1325
|
+
function Xo(e) {
|
|
1311
1326
|
return { hasNegativeValues: v(
|
|
1312
|
-
() =>
|
|
1327
|
+
() => Ft(e.value).some((t) => t < 0)
|
|
1313
1328
|
) };
|
|
1314
1329
|
}
|
|
1315
|
-
function
|
|
1330
|
+
function Yo(e, n, t, o) {
|
|
1316
1331
|
const l = v(
|
|
1317
|
-
() => o.value ===
|
|
1332
|
+
() => o.value === B.HORIZONTAL
|
|
1318
1333
|
), u = v(
|
|
1319
1334
|
() => {
|
|
1320
1335
|
var c;
|
|
@@ -1337,41 +1352,41 @@ function Uo(e, n, t, o) {
|
|
|
1337
1352
|
transform: i.value
|
|
1338
1353
|
})) };
|
|
1339
1354
|
}
|
|
1340
|
-
function
|
|
1341
|
-
return e.reduce((t, o) =>
|
|
1355
|
+
function Ko(e, n) {
|
|
1356
|
+
return e.reduce((t, o) => st(o.values, n).map(
|
|
1342
1357
|
(l, u) => t[u] ? l.value > t[u] ? l.value : t[u] : l.value ?? 0
|
|
1343
1358
|
), []);
|
|
1344
1359
|
}
|
|
1345
|
-
function
|
|
1346
|
-
return e.reduce((t, o) =>
|
|
1360
|
+
function Jo(e, n) {
|
|
1361
|
+
return e.reduce((t, o) => st(o.values, n).map(
|
|
1347
1362
|
(l, u) => {
|
|
1348
1363
|
const a = l.value == null || l.value < 0 ? 0 : l.value;
|
|
1349
1364
|
return t[u] ? t[u] + a : a;
|
|
1350
1365
|
}
|
|
1351
1366
|
), []);
|
|
1352
1367
|
}
|
|
1353
|
-
const
|
|
1354
|
-
"stacked-bar":
|
|
1368
|
+
const Dt = {
|
|
1369
|
+
"stacked-bar": Jo
|
|
1355
1370
|
};
|
|
1356
|
-
function
|
|
1371
|
+
function tn(e, n, t, o, l, u, a, i) {
|
|
1357
1372
|
const s = v(
|
|
1358
1373
|
() => {
|
|
1359
|
-
var
|
|
1360
|
-
return n.value.withTooltip !== !1 && !((
|
|
1374
|
+
var f;
|
|
1375
|
+
return n.value.withTooltip !== !1 && !((f = n.value.tooltipOptions) != null && f.targetElement);
|
|
1361
1376
|
}
|
|
1362
1377
|
);
|
|
1363
|
-
function c(
|
|
1378
|
+
function c(f) {
|
|
1364
1379
|
var g;
|
|
1365
|
-
const r = ((g = l == null ? void 0 : l.value) == null ? void 0 : g.length) ?? 0,
|
|
1366
|
-
|
|
1380
|
+
const r = ((g = l == null ? void 0 : l.value) == null ? void 0 : g.length) ?? 0, m = i != null && i.value && Dt[i.value] ? Dt[i.value](
|
|
1381
|
+
f,
|
|
1367
1382
|
r
|
|
1368
|
-
) :
|
|
1369
|
-
e.value =
|
|
1370
|
-
cx: (u == null ? void 0 : u.value) ===
|
|
1371
|
-
cy: (u == null ? void 0 : u.value) ===
|
|
1383
|
+
) : Ko(f, r);
|
|
1384
|
+
e.value = m.map((p, b) => ({
|
|
1385
|
+
cx: (u == null ? void 0 : u.value) === B.HORIZONTAL ? t.value(p) : et(t.value, b),
|
|
1386
|
+
cy: (u == null ? void 0 : u.value) === B.HORIZONTAL ? et(o.value, b) : o.value(p)
|
|
1372
1387
|
}));
|
|
1373
1388
|
}
|
|
1374
|
-
return
|
|
1389
|
+
return Z(
|
|
1375
1390
|
[t, o],
|
|
1376
1391
|
() => {
|
|
1377
1392
|
t.value && o.value && (a != null && a.value) && s.value && c(a.value);
|
|
@@ -1379,8 +1394,8 @@ function Qt(e, n, t, o, l, u, a, i) {
|
|
|
1379
1394
|
{ immediate: !0 }
|
|
1380
1395
|
), { shouldGenerateTooltipAnchors: s, updateTooltipAnchorAttributes: c };
|
|
1381
1396
|
}
|
|
1382
|
-
function
|
|
1383
|
-
const e =
|
|
1397
|
+
function Qo() {
|
|
1398
|
+
const e = Fe({
|
|
1384
1399
|
opened: !1,
|
|
1385
1400
|
targetElement: null
|
|
1386
1401
|
});
|
|
@@ -1390,54 +1405,54 @@ function Ko() {
|
|
|
1390
1405
|
e.opened = !1, e.targetElement = null;
|
|
1391
1406
|
} };
|
|
1392
1407
|
}
|
|
1393
|
-
function
|
|
1408
|
+
function qo(e) {
|
|
1394
1409
|
return { getTooltipItems: v(
|
|
1395
1410
|
() => (t) => e.value.map(({ color: o, label: l, values: u }) => {
|
|
1396
1411
|
var a, i, s;
|
|
1397
1412
|
return {
|
|
1398
1413
|
color: ((a = u[t]) == null ? void 0 : a.color) || o,
|
|
1399
1414
|
label: l,
|
|
1400
|
-
value: ((i = u[t]) == null ? void 0 : i.label) ?? ((s = u[t]) == null ? void 0 : s.value) ??
|
|
1415
|
+
value: ((i = u[t]) == null ? void 0 : i.label) ?? ((s = u[t]) == null ? void 0 : s.value) ?? Ut
|
|
1401
1416
|
};
|
|
1402
1417
|
})
|
|
1403
1418
|
) };
|
|
1404
1419
|
}
|
|
1405
|
-
const
|
|
1420
|
+
const tt = 16, nt = 8, ot = 28, lt = 24, Te = {
|
|
1406
1421
|
VERTICAL: {
|
|
1407
|
-
top:
|
|
1408
|
-
right:
|
|
1409
|
-
bottom:
|
|
1410
|
-
left:
|
|
1422
|
+
top: tt,
|
|
1423
|
+
right: nt,
|
|
1424
|
+
bottom: ot,
|
|
1425
|
+
left: lt
|
|
1411
1426
|
},
|
|
1412
1427
|
HORIZONTAL: {
|
|
1413
|
-
top:
|
|
1414
|
-
right:
|
|
1415
|
-
bottom:
|
|
1416
|
-
left:
|
|
1428
|
+
top: tt,
|
|
1429
|
+
right: nt,
|
|
1430
|
+
bottom: ot,
|
|
1431
|
+
left: lt
|
|
1417
1432
|
}
|
|
1418
1433
|
};
|
|
1419
|
-
function
|
|
1420
|
-
return !e || e === "auto" || e.top == null || e.top === "auto" ?
|
|
1434
|
+
function el(e) {
|
|
1435
|
+
return !e || e === "auto" || e.top == null || e.top === "auto" ? tt : e.top;
|
|
1421
1436
|
}
|
|
1422
|
-
function
|
|
1423
|
-
return !e || e === "auto" || e.right == null || e.right === "auto" ?
|
|
1437
|
+
function tl(e) {
|
|
1438
|
+
return !e || e === "auto" || e.right == null || e.right === "auto" ? nt : e.right;
|
|
1424
1439
|
}
|
|
1425
|
-
function
|
|
1426
|
-
return !e || e === "auto" || e.bottom == null || e.bottom === "auto" ? n ||
|
|
1440
|
+
function nl(e, n) {
|
|
1441
|
+
return !e || e === "auto" || e.bottom == null || e.bottom === "auto" ? n || ot : e.bottom;
|
|
1427
1442
|
}
|
|
1428
|
-
function
|
|
1429
|
-
return !e || e === "auto" || e.left == null || e.left === "auto" ? n ||
|
|
1443
|
+
function ol(e, n) {
|
|
1444
|
+
return !e || e === "auto" || e.left == null || e.left === "auto" ? n || lt : e.left;
|
|
1430
1445
|
}
|
|
1431
|
-
const
|
|
1446
|
+
const ll = { class: "lume-chart__header" }, al = { class: "lume-chart__header-section" }, ul = {
|
|
1432
1447
|
key: 0,
|
|
1433
1448
|
class: "lume-chart__title lume-chart-title lume-typography--display"
|
|
1434
|
-
},
|
|
1449
|
+
}, rl = { class: "lume-chart__controls" }, il = { class: "lume-chart__header-section" }, sl = {
|
|
1435
1450
|
key: 0,
|
|
1436
1451
|
class: "lume-chart__axis-title lume-axis-title lume-typography--body"
|
|
1437
|
-
},
|
|
1452
|
+
}, cl = { key: 3 }, dl = ["r"], vl = {
|
|
1438
1453
|
key: 0,
|
|
1439
1454
|
class: "lume-chart__axis-title lume-chart__axis-title--centered lume-axis-title lume-typography--body"
|
|
1440
|
-
},
|
|
1455
|
+
}, ml = /* @__PURE__ */ U({
|
|
1441
1456
|
__name: "lume-chart",
|
|
1442
1457
|
props: {
|
|
1443
1458
|
...Ne(),
|
|
@@ -1447,304 +1462,304 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1447
1462
|
}
|
|
1448
1463
|
},
|
|
1449
1464
|
setup(e, { emit: n }) {
|
|
1450
|
-
const t = e, o =
|
|
1451
|
-
|
|
1465
|
+
const t = e, o = re(), l = n, { data: u, labels: a, color: i, options: s, orientation: c, chartType: f } = te(t), r = S(-1), m = S(null), g = S(null), p = S([]), b = S(null), L = S(0), A = S(0), { allOptions: h } = me(s), { internalData: x, computedLabels: N, containerSize: D, updateSize: P, chartID: w } = pt(u, a, i, h, c), { xScale: H, yScale: X } = zo(
|
|
1466
|
+
x,
|
|
1452
1467
|
N,
|
|
1453
|
-
|
|
1468
|
+
D,
|
|
1454
1469
|
c,
|
|
1455
|
-
|
|
1456
|
-
),
|
|
1457
|
-
top:
|
|
1458
|
-
right:
|
|
1459
|
-
bottom:
|
|
1460
|
-
left:
|
|
1461
|
-
})),
|
|
1462
|
-
var
|
|
1463
|
-
return t.xScale ?
|
|
1464
|
-
}),
|
|
1465
|
-
var
|
|
1466
|
-
return t.yScale ?
|
|
1467
|
-
}),
|
|
1468
|
-
...
|
|
1469
|
-
withHover: c.value ===
|
|
1470
|
-
})),
|
|
1471
|
-
...
|
|
1472
|
-
withHover: c.value ===
|
|
1473
|
-
})),
|
|
1474
|
-
var
|
|
1475
|
-
return (
|
|
1476
|
-
}),
|
|
1477
|
-
var
|
|
1478
|
-
return (
|
|
1479
|
-
}),
|
|
1480
|
-
var
|
|
1481
|
-
return ((
|
|
1470
|
+
h
|
|
1471
|
+
), Y = v(() => ({
|
|
1472
|
+
top: el(h.value.margins),
|
|
1473
|
+
right: tl(h.value.margins),
|
|
1474
|
+
bottom: nl(h.value.margins, L.value),
|
|
1475
|
+
left: ol(h.value.margins, A.value)
|
|
1476
|
+
})), Q = v(() => {
|
|
1477
|
+
var O;
|
|
1478
|
+
return t.xScale ? Et(t.xScale) ? t.xScale : (O = t.xScale) == null ? void 0 : O.call(t, x.value, a.value, D) : H.value;
|
|
1479
|
+
}), F = v(() => {
|
|
1480
|
+
var O;
|
|
1481
|
+
return t.yScale ? Et(t.yScale) ? t.yScale : (O = t.yScale) == null ? void 0 : O.call(t, x.value, a.value, D) : X.value;
|
|
1482
|
+
}), ue = v(() => ({
|
|
1483
|
+
...h.value.xAxisOptions,
|
|
1484
|
+
withHover: c.value === B.VERTICAL
|
|
1485
|
+
})), Oe = v(() => ({
|
|
1486
|
+
...h.value.yAxisOptions,
|
|
1487
|
+
withHover: c.value === B.HORIZONTAL
|
|
1488
|
+
})), ke = v(() => {
|
|
1489
|
+
var O;
|
|
1490
|
+
return (O = h.value.xAxisOptions) == null ? void 0 : O.title;
|
|
1491
|
+
}), xe = v(() => {
|
|
1492
|
+
var O;
|
|
1493
|
+
return (O = h.value.yAxisOptions) == null ? void 0 : O.title;
|
|
1494
|
+
}), M = v(() => {
|
|
1495
|
+
var O;
|
|
1496
|
+
return ((O = h.value.xAxisOptions) == null ? void 0 : O.withTitle) !== !1 && ke.value;
|
|
1482
1497
|
}), k = v(() => {
|
|
1483
|
-
var
|
|
1484
|
-
return ((
|
|
1485
|
-
}),
|
|
1486
|
-
() => u.value.every((
|
|
1487
|
-
),
|
|
1488
|
-
const
|
|
1489
|
-
return
|
|
1490
|
-
}), { hasNegativeValues:
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1498
|
+
var O;
|
|
1499
|
+
return ((O = h.value.yAxisOptions) == null ? void 0 : O.withTitle) !== !1 && xe.value;
|
|
1500
|
+
}), E = v(
|
|
1501
|
+
() => u.value.every((O) => !O.values.length)
|
|
1502
|
+
), _ = v(() => {
|
|
1503
|
+
const O = [], { noBaseScales: T } = h.value;
|
|
1504
|
+
return !T && !E.value && O.push(() => !!(Q.value && F.value)), O.every((I) => I() === !0);
|
|
1505
|
+
}), { hasNegativeValues: j } = Xo(x), { negativeBarAttributes: J } = Yo(
|
|
1506
|
+
D,
|
|
1507
|
+
Q,
|
|
1508
|
+
F,
|
|
1494
1509
|
c
|
|
1495
|
-
), { shouldGenerateTooltipAnchors:
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1510
|
+
), { shouldGenerateTooltipAnchors: ae } = tn(
|
|
1511
|
+
p,
|
|
1512
|
+
h,
|
|
1513
|
+
Q,
|
|
1514
|
+
F,
|
|
1500
1515
|
a,
|
|
1501
1516
|
c,
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
), { tooltipConfig: $e, showTooltip:
|
|
1505
|
-
() =>
|
|
1506
|
-
),
|
|
1517
|
+
x,
|
|
1518
|
+
f
|
|
1519
|
+
), { tooltipConfig: $e, showTooltip: Ze, hideTooltip: Ue } = Qo(), { getTooltipItems: Ie } = qo(x), Ce = v(
|
|
1520
|
+
() => h.value.withTooltip !== !1 && $e.opened
|
|
1521
|
+
), be = v(
|
|
1507
1522
|
() => {
|
|
1508
|
-
var
|
|
1509
|
-
return ((
|
|
1523
|
+
var O;
|
|
1524
|
+
return ((O = h.value.tooltipOptions) == null ? void 0 : O.position) || "top";
|
|
1510
1525
|
}
|
|
1511
|
-
),
|
|
1512
|
-
var
|
|
1513
|
-
const
|
|
1514
|
-
return $e.opened && (!
|
|
1526
|
+
), rn = v(() => {
|
|
1527
|
+
var T;
|
|
1528
|
+
const O = (T = h.value.tooltipOptions) == null ? void 0 : T.withPointerEvents;
|
|
1529
|
+
return $e.opened && (!O || O && b.value === !1);
|
|
1515
1530
|
});
|
|
1516
|
-
function
|
|
1531
|
+
function Ge(O) {
|
|
1517
1532
|
var I;
|
|
1518
|
-
if (
|
|
1533
|
+
if (O === r.value)
|
|
1519
1534
|
return;
|
|
1520
|
-
const
|
|
1521
|
-
if (
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1535
|
+
const T = r.value;
|
|
1536
|
+
if (h.value.withHover !== !1 && (r.value = O), h.value.withTooltip !== !1) {
|
|
1537
|
+
const Ye = (I = h.value.tooltipOptions) != null && I.targetElement ? h.value.tooltipOptions.targetElement === "self" ? g.value.$el : h.value.tooltipOptions.targetElement : m.value[O];
|
|
1538
|
+
Ze(Ye);
|
|
1524
1539
|
}
|
|
1525
|
-
l("hovered-index-changed", { newIndex:
|
|
1540
|
+
l("hovered-index-changed", { newIndex: O, oldIndex: T });
|
|
1526
1541
|
}
|
|
1527
|
-
function
|
|
1528
|
-
|
|
1542
|
+
function Xe() {
|
|
1543
|
+
Ue(), r.value = -1;
|
|
1529
1544
|
}
|
|
1530
|
-
function
|
|
1545
|
+
function gt(O) {
|
|
1531
1546
|
if (!u.value.some(
|
|
1532
|
-
({ values: I }) =>
|
|
1547
|
+
({ values: I }) => O <= I.length - 1
|
|
1533
1548
|
)) {
|
|
1534
|
-
|
|
1549
|
+
ge(ve.InvalidHoveredIndex);
|
|
1535
1550
|
return;
|
|
1536
1551
|
}
|
|
1537
|
-
|
|
1552
|
+
O == null || O === -1 ? Xe() : Ge(O);
|
|
1538
1553
|
}
|
|
1539
|
-
function
|
|
1554
|
+
function sn() {
|
|
1540
1555
|
setTimeout(() => {
|
|
1541
|
-
|
|
1556
|
+
rn.value && Xe(), l("chart-mouseleave");
|
|
1542
1557
|
}, 0);
|
|
1543
1558
|
}
|
|
1544
|
-
function
|
|
1545
|
-
|
|
1559
|
+
function _t({ index: O, value: T, event: I }) {
|
|
1560
|
+
O !== null && Ge(O), l("axis-mouseenter", { index: O, value: T, event: I });
|
|
1546
1561
|
}
|
|
1547
|
-
function
|
|
1548
|
-
l("axis-click", { index:
|
|
1562
|
+
function yt({ index: O, value: T, event: I }) {
|
|
1563
|
+
l("axis-click", { index: O, value: T, event: I });
|
|
1549
1564
|
}
|
|
1550
|
-
return
|
|
1565
|
+
return Z(
|
|
1551
1566
|
u,
|
|
1552
|
-
(
|
|
1553
|
-
),
|
|
1567
|
+
(O, T) => l("data-changed", { newValue: O, oldValue: T })
|
|
1568
|
+
), Z(
|
|
1554
1569
|
a,
|
|
1555
|
-
(
|
|
1556
|
-
),
|
|
1557
|
-
|
|
1558
|
-
(
|
|
1559
|
-
|
|
1570
|
+
(O, T) => l("labels-changed", { newValue: O, oldValue: T })
|
|
1571
|
+
), Z(E, (O) => O && ge(ve.Empty), { immediate: !0 }), Z(() => t.hoveredIndex, gt), Z(
|
|
1572
|
+
p,
|
|
1573
|
+
(O) => {
|
|
1574
|
+
O && t.hoveredIndex != null && r.value === -1 && gt(t.hoveredIndex);
|
|
1560
1575
|
},
|
|
1561
1576
|
{ flush: "post" }
|
|
1562
|
-
),
|
|
1563
|
-
|
|
1564
|
-
}),
|
|
1577
|
+
), Z(b, (O) => {
|
|
1578
|
+
O === !1 && $e.opened && Xe();
|
|
1579
|
+
}), _e(async () => {
|
|
1565
1580
|
l("rendered"), o.groups || console.error('"groups" `<slot>` must have content.');
|
|
1566
|
-
}),
|
|
1581
|
+
}), Ke("chartID", w), Ke("isEmpty", E), Ke("tooltipAnchorAttributes", p), (O, T) => (y(), K(d(io), {
|
|
1567
1582
|
id: `lume-chart_${d(w)}`,
|
|
1568
1583
|
ref_key: "chartContainer",
|
|
1569
1584
|
ref: g,
|
|
1570
|
-
margins:
|
|
1571
|
-
"container-size": d(
|
|
1572
|
-
"no-min-size": d(
|
|
1573
|
-
"transparent-background": d(
|
|
1585
|
+
margins: Y.value,
|
|
1586
|
+
"container-size": d(D),
|
|
1587
|
+
"no-min-size": d(h).noMinSize,
|
|
1588
|
+
"transparent-background": d(h).transparentBackground,
|
|
1574
1589
|
"data-j-lume-chart": "",
|
|
1575
|
-
onResize: d(
|
|
1576
|
-
onClick:
|
|
1577
|
-
onMouseenter:
|
|
1578
|
-
onMouseleave:
|
|
1590
|
+
onResize: d(P),
|
|
1591
|
+
onClick: T[24] || (T[24] = (I) => l("chart-click", I)),
|
|
1592
|
+
onMouseenter: T[25] || (T[25] = (I) => l("chart-mouseenter", I)),
|
|
1593
|
+
onMouseleave: sn
|
|
1579
1594
|
}, {
|
|
1580
1595
|
header: V(() => [
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1596
|
+
C("div", ll, [
|
|
1597
|
+
C("div", al, [
|
|
1598
|
+
O.title ? (y(), $("h1", ul, oe(O.title), 1)) : W("", !0),
|
|
1599
|
+
C("div", rl, [
|
|
1600
|
+
R(O.$slots, "controls", {}, void 0, !0)
|
|
1586
1601
|
])
|
|
1587
1602
|
]),
|
|
1588
|
-
|
|
1589
|
-
k.value ? (
|
|
1590
|
-
|
|
1591
|
-
d(
|
|
1603
|
+
C("div", il, [
|
|
1604
|
+
k.value ? (y(), $("h3", sl, oe(xe.value), 1)) : W("", !0),
|
|
1605
|
+
R(O.$slots, "legend", { data: d(x) }, () => [
|
|
1606
|
+
d(h).withLegend !== !1 && d(h).legendPosition !== "bottom" ? (y(), K(d(Ot), {
|
|
1592
1607
|
key: 0,
|
|
1593
|
-
data: d(
|
|
1608
|
+
data: d(x),
|
|
1594
1609
|
class: "lume-chart__legend",
|
|
1595
1610
|
"data-j-lume-chart__legend": "",
|
|
1596
|
-
onClick:
|
|
1597
|
-
onMouseenter:
|
|
1598
|
-
onMouseleave:
|
|
1599
|
-
}, null, 8, ["data"])) :
|
|
1611
|
+
onClick: T[0] || (T[0] = (I) => l("legend-click", I)),
|
|
1612
|
+
onMouseenter: T[1] || (T[1] = (I) => l("legend-mouseenter", I)),
|
|
1613
|
+
onMouseleave: T[2] || (T[2] = (I) => l("legend-mouseleave"))
|
|
1614
|
+
}, null, 8, ["data"])) : W("", !0)
|
|
1600
1615
|
], !0)
|
|
1601
1616
|
])
|
|
1602
1617
|
])
|
|
1603
1618
|
]),
|
|
1604
1619
|
footer: V(() => [
|
|
1605
|
-
|
|
1606
|
-
d(
|
|
1620
|
+
M.value ? (y(), $("h3", vl, oe(ke.value), 1)) : W("", !0),
|
|
1621
|
+
d(h).withLegend !== !1 && d(h).legendPosition == "bottom" ? (y(), K(d(Ot), {
|
|
1607
1622
|
key: 1,
|
|
1608
|
-
data: d(
|
|
1623
|
+
data: d(x),
|
|
1609
1624
|
class: "lume-chart__legend lume-chart__legend--bottom",
|
|
1610
1625
|
"data-j-lume-chart__legend": "",
|
|
1611
|
-
onClick:
|
|
1612
|
-
onMouseenter:
|
|
1613
|
-
onMouseleave:
|
|
1614
|
-
}, null, 8, ["data"])) :
|
|
1626
|
+
onClick: T[16] || (T[16] = (I) => l("legend-click", I)),
|
|
1627
|
+
onMouseenter: T[17] || (T[17] = (I) => l("legend-mouseenter", I)),
|
|
1628
|
+
onMouseleave: T[18] || (T[18] = (I) => l("legend-mouseleave"))
|
|
1629
|
+
}, null, 8, ["data"])) : W("", !0)
|
|
1615
1630
|
]),
|
|
1616
1631
|
extra: V(() => [
|
|
1617
|
-
|
|
1618
|
-
data: d(
|
|
1632
|
+
R(O.$slots, "tooltip", G(d($e), {
|
|
1633
|
+
data: d(x),
|
|
1619
1634
|
labels: d(N),
|
|
1620
1635
|
title: d(N)[r.value],
|
|
1621
1636
|
items: d(Ie)(r.value),
|
|
1622
|
-
position:
|
|
1623
|
-
withTooltip: d(
|
|
1637
|
+
position: be.value,
|
|
1638
|
+
withTooltip: d(h).withTooltip !== !1,
|
|
1624
1639
|
hoveredIndex: r.value,
|
|
1625
|
-
handleMouseEnter: () =>
|
|
1626
|
-
handleMouseLeave: () =>
|
|
1627
|
-
options: d(
|
|
1640
|
+
handleMouseEnter: () => b.value = !0,
|
|
1641
|
+
handleMouseLeave: () => b.value = !1,
|
|
1642
|
+
options: d(h).tooltipOptions
|
|
1628
1643
|
}), () => [
|
|
1629
|
-
|
|
1630
|
-
position:
|
|
1644
|
+
Ce.value ? (y(), K(d(Do), G({ key: 0 }, d($e), {
|
|
1645
|
+
position: be.value,
|
|
1631
1646
|
title: d(N)[r.value],
|
|
1632
1647
|
items: d(Ie)(r.value),
|
|
1633
|
-
options: d(
|
|
1648
|
+
options: d(h).tooltipOptions,
|
|
1634
1649
|
"data-j-lume-chart__tooltip": "",
|
|
1635
|
-
onOpened:
|
|
1650
|
+
onOpened: T[19] || (T[19] = (I) => l("tooltip-opened", {
|
|
1636
1651
|
index: r.value,
|
|
1637
1652
|
targetElement: I
|
|
1638
1653
|
})),
|
|
1639
|
-
onMoved:
|
|
1654
|
+
onMoved: T[20] || (T[20] = (I) => l("tooltip-moved", {
|
|
1640
1655
|
index: r.value,
|
|
1641
1656
|
targetElement: I
|
|
1642
1657
|
})),
|
|
1643
|
-
onClosed:
|
|
1644
|
-
onTooltipMouseenter:
|
|
1645
|
-
onTooltipMouseleave:
|
|
1658
|
+
onClosed: T[21] || (T[21] = (I) => l("tooltip-closed")),
|
|
1659
|
+
onTooltipMouseenter: T[22] || (T[22] = (I) => b.value = !0),
|
|
1660
|
+
onTooltipMouseleave: T[23] || (T[23] = (I) => b.value = !1)
|
|
1646
1661
|
}), {
|
|
1647
1662
|
default: V(() => [
|
|
1648
|
-
|
|
1649
|
-
data: d(
|
|
1663
|
+
R(O.$slots, "tooltip-content", {
|
|
1664
|
+
data: d(x),
|
|
1650
1665
|
labels: d(N),
|
|
1651
1666
|
hoveredIndex: r.value
|
|
1652
1667
|
}, void 0, !0)
|
|
1653
1668
|
]),
|
|
1654
1669
|
_: 3
|
|
1655
|
-
}, 16, ["position", "title", "items", "options"])) :
|
|
1670
|
+
}, 16, ["position", "title", "items", "options"])) : W("", !0)
|
|
1656
1671
|
], !0)
|
|
1657
1672
|
]),
|
|
1658
1673
|
default: V(() => [
|
|
1659
|
-
|
|
1660
|
-
d(
|
|
1674
|
+
_.value ? (y(), $(q, { key: 0 }, [
|
|
1675
|
+
d(j) ? (y(), K(d(mt), G({ key: 0 }, d(J), {
|
|
1661
1676
|
"class-list": "lume-fill--negative",
|
|
1662
1677
|
transition: !1,
|
|
1663
1678
|
"data-j-lume-chart__negative-values": ""
|
|
1664
|
-
}), null, 16)) :
|
|
1665
|
-
d(
|
|
1679
|
+
}), null, 16)) : W("", !0),
|
|
1680
|
+
d(h).withAxes !== !1 ? R(O.$slots, "axes", {
|
|
1666
1681
|
key: 1,
|
|
1667
|
-
xScale:
|
|
1668
|
-
yScale:
|
|
1669
|
-
containerSize: d(
|
|
1670
|
-
options: d(
|
|
1682
|
+
xScale: Q.value,
|
|
1683
|
+
yScale: F.value,
|
|
1684
|
+
containerSize: d(D),
|
|
1685
|
+
options: d(h),
|
|
1671
1686
|
hoveredIndex: r.value
|
|
1672
1687
|
}, () => [
|
|
1673
|
-
|
|
1688
|
+
ie(d(Lt), {
|
|
1674
1689
|
type: "x",
|
|
1675
|
-
scale:
|
|
1676
|
-
"container-size": d(
|
|
1677
|
-
options:
|
|
1690
|
+
scale: Q.value,
|
|
1691
|
+
"container-size": d(D),
|
|
1692
|
+
options: ue.value,
|
|
1678
1693
|
"hovered-index": r.value,
|
|
1679
1694
|
orientation: d(c),
|
|
1680
1695
|
"data-j-lume-chart__x-axis": "",
|
|
1681
|
-
onClick:
|
|
1682
|
-
onMouseenter:
|
|
1683
|
-
onMouseleave:
|
|
1684
|
-
"onLume__internal-AxisSize":
|
|
1696
|
+
onClick: yt,
|
|
1697
|
+
onMouseenter: _t,
|
|
1698
|
+
onMouseleave: T[3] || (T[3] = (I) => l("axis-mouseleave")),
|
|
1699
|
+
"onLume__internal-AxisSize": T[4] || (T[4] = (I) => L.value = I)
|
|
1685
1700
|
}, null, 8, ["scale", "container-size", "options", "hovered-index", "orientation"]),
|
|
1686
|
-
|
|
1701
|
+
ie(d(Lt), {
|
|
1687
1702
|
type: "y",
|
|
1688
|
-
scale:
|
|
1689
|
-
"container-size": d(
|
|
1690
|
-
options:
|
|
1703
|
+
scale: F.value,
|
|
1704
|
+
"container-size": d(D),
|
|
1705
|
+
options: Oe.value,
|
|
1691
1706
|
"hovered-index": r.value,
|
|
1692
1707
|
orientation: d(c),
|
|
1693
1708
|
"data-j-lume-chart__y-axis": "",
|
|
1694
|
-
onClick:
|
|
1695
|
-
onMouseenter:
|
|
1696
|
-
onMouseleave:
|
|
1697
|
-
"onLume__internal-AxisSize":
|
|
1709
|
+
onClick: yt,
|
|
1710
|
+
onMouseenter: _t,
|
|
1711
|
+
onMouseleave: T[5] || (T[5] = (I) => l("axis-mouseleave")),
|
|
1712
|
+
"onLume__internal-AxisSize": T[6] || (T[6] = (I) => A.value = I)
|
|
1698
1713
|
}, null, 8, ["scale", "container-size", "options", "hovered-index", "orientation"])
|
|
1699
|
-
], !0) :
|
|
1700
|
-
d(
|
|
1714
|
+
], !0) : W("", !0),
|
|
1715
|
+
d(h).withHover !== !1 ? (y(), K(d(Uo), {
|
|
1701
1716
|
key: 2,
|
|
1702
|
-
data: d(
|
|
1717
|
+
data: d(x),
|
|
1703
1718
|
orientation: d(c),
|
|
1704
|
-
"x-scale":
|
|
1705
|
-
"y-scale":
|
|
1719
|
+
"x-scale": Q.value,
|
|
1720
|
+
"y-scale": F.value,
|
|
1706
1721
|
"data-j-lume-chart__overlay-group": "",
|
|
1707
|
-
"onLume__internal-Hover":
|
|
1708
|
-
}, null, 8, ["data", "orientation", "x-scale", "y-scale"])) :
|
|
1709
|
-
d(
|
|
1710
|
-
(
|
|
1722
|
+
"onLume__internal-Hover": Ge
|
|
1723
|
+
}, null, 8, ["data", "orientation", "x-scale", "y-scale"])) : W("", !0),
|
|
1724
|
+
d(ae) ? (y(), $("g", cl, [
|
|
1725
|
+
(y(!0), $(q, null, z(p.value, (I, Ye) => (y(), $("circle", G(I, {
|
|
1711
1726
|
ref_for: !0,
|
|
1712
1727
|
ref_key: "tooltipAnchor",
|
|
1713
|
-
ref:
|
|
1714
|
-
key: `anchor_${
|
|
1715
|
-
r: d(
|
|
1728
|
+
ref: m,
|
|
1729
|
+
key: `anchor_${Ye}`,
|
|
1730
|
+
r: d(Vn),
|
|
1716
1731
|
class: "lume-fill--transparent"
|
|
1717
|
-
}), null, 16,
|
|
1718
|
-
])) :
|
|
1719
|
-
|
|
1720
|
-
data: d(
|
|
1732
|
+
}), null, 16, dl))), 128))
|
|
1733
|
+
])) : W("", !0),
|
|
1734
|
+
R(O.$slots, "groups", {
|
|
1735
|
+
data: d(x),
|
|
1721
1736
|
labels: d(N),
|
|
1722
|
-
options: d(
|
|
1737
|
+
options: d(h),
|
|
1723
1738
|
orientation: d(c),
|
|
1724
|
-
xScale:
|
|
1725
|
-
yScale:
|
|
1739
|
+
xScale: Q.value,
|
|
1740
|
+
yScale: F.value,
|
|
1726
1741
|
hoveredIndex: r.value,
|
|
1727
|
-
containerSize: d(
|
|
1728
|
-
transition: d(
|
|
1729
|
-
classList:
|
|
1730
|
-
onNodeClick:
|
|
1731
|
-
onNodeMouseenter:
|
|
1732
|
-
onNodeMouseleave:
|
|
1733
|
-
onLinkClick:
|
|
1734
|
-
onLinkMouseenter:
|
|
1735
|
-
onLinkMouseleave:
|
|
1736
|
-
onBarClick:
|
|
1737
|
-
onLineClick:
|
|
1738
|
-
onPointClick:
|
|
1739
|
-
"onLume__internal-Hover":
|
|
1742
|
+
containerSize: d(D),
|
|
1743
|
+
transition: d(h).withTransition !== !1,
|
|
1744
|
+
classList: O.classList,
|
|
1745
|
+
onNodeClick: T[7] || (T[7] = (I) => l("node-click", I)),
|
|
1746
|
+
onNodeMouseenter: T[8] || (T[8] = (I) => l("node-mouseenter", I)),
|
|
1747
|
+
onNodeMouseleave: T[9] || (T[9] = (I) => l("node-mouseleave", I)),
|
|
1748
|
+
onLinkClick: T[10] || (T[10] = (I) => l("link-click", I)),
|
|
1749
|
+
onLinkMouseenter: T[11] || (T[11] = (I) => l("link-mouseenter", I)),
|
|
1750
|
+
onLinkMouseleave: T[12] || (T[12] = (I) => l("link-mouseleave", I)),
|
|
1751
|
+
onBarClick: T[13] || (T[13] = (I) => l("bar-click", I)),
|
|
1752
|
+
onLineClick: T[14] || (T[14] = (I) => l("line-click", I)),
|
|
1753
|
+
onPointClick: T[15] || (T[15] = (I) => l("point-click", I)),
|
|
1754
|
+
"onLume__internal-Hover": Ge
|
|
1740
1755
|
}, void 0, !0)
|
|
1741
|
-
], 64)) :
|
|
1756
|
+
], 64)) : W("", !0)
|
|
1742
1757
|
]),
|
|
1743
1758
|
_: 3
|
|
1744
1759
|
}, 8, ["id", "margins", "container-size", "no-min-size", "transparent-background", "onResize"]));
|
|
1745
1760
|
}
|
|
1746
1761
|
});
|
|
1747
|
-
const De = /* @__PURE__ */
|
|
1762
|
+
const De = /* @__PURE__ */ ee(ml, [["__scopeId", "data-v-84133075"]]), Ht = 8, fl = 8, pl = 20, Ee = 2, Bt = 2, hl = ["dy", "dominant-baseline"], gl = ["y", "x", "width", "height"], _l = { class: "lume-alluvial-group__label-wrapper" }, yl = /* @__PURE__ */ U({
|
|
1748
1763
|
__name: "lume-alluvial-node-label",
|
|
1749
1764
|
props: {
|
|
1750
1765
|
bottom: { type: Boolean, default: !1 },
|
|
@@ -1753,20 +1768,20 @@ const De = /* @__PURE__ */ te(da, [["__scopeId", "data-v-15099487"]]), Nt = 8, v
|
|
|
1753
1768
|
},
|
|
1754
1769
|
emits: ["lume__internal--node-resize"],
|
|
1755
1770
|
setup(e, { emit: n }) {
|
|
1756
|
-
const t = e, o = n, l =
|
|
1757
|
-
return
|
|
1771
|
+
const t = e, o = n, l = S(null), u = S(t.maxWidth), a = S(1);
|
|
1772
|
+
return Z(
|
|
1758
1773
|
[l, () => t.maxWidth],
|
|
1759
1774
|
async ([i, s]) => {
|
|
1760
1775
|
if (i && s) {
|
|
1761
|
-
u.value = s, await
|
|
1762
|
-
const { width: c, height:
|
|
1763
|
-
u.value = c +
|
|
1776
|
+
u.value = s, await kt();
|
|
1777
|
+
const { width: c, height: f } = i.getBoundingClientRect();
|
|
1778
|
+
u.value = c + Bt > s ? s : c + Bt, a.value = Math.ceil(f);
|
|
1764
1779
|
}
|
|
1765
1780
|
},
|
|
1766
1781
|
{ immediate: !0 }
|
|
1767
|
-
),
|
|
1768
|
-
i !== t.maxWidth && (await
|
|
1769
|
-
}), (i, s) => e.maxWidth ? (
|
|
1782
|
+
), Z(u, async (i) => {
|
|
1783
|
+
i !== t.maxWidth && (await kt(), o("lume__internal--node-resize"));
|
|
1784
|
+
}), (i, s) => e.maxWidth ? (y(), $("foreignObject", {
|
|
1770
1785
|
key: 1,
|
|
1771
1786
|
class: "lume-alluvial-group__node-foreign",
|
|
1772
1787
|
y: e.bottom ? "0.1em" : -a.value + 1,
|
|
@@ -1774,42 +1789,42 @@ const De = /* @__PURE__ */ te(da, [["__scopeId", "data-v-15099487"]]), Nt = 8, v
|
|
|
1774
1789
|
width: u.value,
|
|
1775
1790
|
height: a.value
|
|
1776
1791
|
}, [
|
|
1777
|
-
|
|
1778
|
-
|
|
1792
|
+
C("div", _l, [
|
|
1793
|
+
C("span", {
|
|
1779
1794
|
ref_key: "text",
|
|
1780
1795
|
ref: l,
|
|
1781
1796
|
class: "lume-alluvial-group__node-label"
|
|
1782
1797
|
}, [
|
|
1783
|
-
|
|
1798
|
+
R(i.$slots, "default", {}, void 0, !0)
|
|
1784
1799
|
], 512)
|
|
1785
1800
|
])
|
|
1786
|
-
], 8,
|
|
1801
|
+
], 8, gl)) : (y(), $("text", {
|
|
1787
1802
|
key: 0,
|
|
1788
1803
|
class: "lume-alluvial-group__node-label",
|
|
1789
1804
|
dy: e.bottom ? ".2em" : "-.2em",
|
|
1790
1805
|
"dominant-baseline": e.bottom ? "hanging" : "auto"
|
|
1791
1806
|
}, [
|
|
1792
|
-
|
|
1793
|
-
], 8,
|
|
1807
|
+
R(i.$slots, "default", {}, void 0, !0)
|
|
1808
|
+
], 8, hl));
|
|
1794
1809
|
}
|
|
1795
1810
|
});
|
|
1796
|
-
const
|
|
1811
|
+
const kl = /* @__PURE__ */ ee(yl, [["__scopeId", "data-v-7126dfdb"]]), bl = ["y", "dominant-baseline"], Al = /* @__PURE__ */ U({
|
|
1797
1812
|
__name: "lume-alluvial-node-value",
|
|
1798
1813
|
props: {
|
|
1799
1814
|
bottom: { type: Boolean, default: !0 }
|
|
1800
1815
|
},
|
|
1801
1816
|
setup(e) {
|
|
1802
|
-
return (n, t) => (
|
|
1817
|
+
return (n, t) => (y(), $("text", {
|
|
1803
1818
|
class: "lume-alluvial-group__node-value",
|
|
1804
1819
|
y: e.bottom ? ".2em" : "-.2em",
|
|
1805
1820
|
"dominant-baseline": e.bottom ? "hanging" : "auto"
|
|
1806
1821
|
}, [
|
|
1807
|
-
|
|
1808
|
-
], 8,
|
|
1822
|
+
R(n.$slots, "default", {}, void 0, !0)
|
|
1823
|
+
], 8, bl));
|
|
1809
1824
|
}
|
|
1810
1825
|
});
|
|
1811
|
-
const
|
|
1812
|
-
function
|
|
1826
|
+
const Tl = /* @__PURE__ */ ee(Al, [["__scopeId", "data-v-b4fc758b"]]);
|
|
1827
|
+
function Mt(e, n) {
|
|
1813
1828
|
return {
|
|
1814
1829
|
x0: 0 + (n ? n.left : 0),
|
|
1815
1830
|
y0: 0 + (n ? n.top : 0),
|
|
@@ -1817,32 +1832,32 @@ function Ht(e, n) {
|
|
|
1817
1832
|
y1: e.height - (n ? n.bottom : 0)
|
|
1818
1833
|
};
|
|
1819
1834
|
}
|
|
1820
|
-
function
|
|
1821
|
-
const n =
|
|
1835
|
+
function Ll(e) {
|
|
1836
|
+
const n = S(Mt(e));
|
|
1822
1837
|
function t(o) {
|
|
1823
|
-
n.value =
|
|
1838
|
+
n.value = Mt(e, o);
|
|
1824
1839
|
}
|
|
1825
1840
|
return { extents: n, updateExtents: t };
|
|
1826
1841
|
}
|
|
1827
|
-
var
|
|
1828
|
-
const
|
|
1829
|
-
function
|
|
1830
|
-
t &&
|
|
1842
|
+
var Ve = /* @__PURE__ */ ((e) => (e.GraphProblem = "There was an issue generating your alluvial graph.", e.BarScaleDomainAbove0 = "Bar linear scale domain cannot start above 0!", e.BarScaleNull = "Bar linear scale cannot be `null`", e))(Ve || {});
|
|
1843
|
+
const Ol = "[lume] ";
|
|
1844
|
+
function at(e, n, t = !0) {
|
|
1845
|
+
t && Pt() || console.error(Ol + "Error: " + e, n);
|
|
1831
1846
|
}
|
|
1832
|
-
const
|
|
1847
|
+
const xl = 200;
|
|
1833
1848
|
function we(e) {
|
|
1834
1849
|
return typeof e == "string" || typeof e == "number" ? e : e.id ?? e.label;
|
|
1835
1850
|
}
|
|
1836
|
-
function
|
|
1851
|
+
function $l(e, n) {
|
|
1837
1852
|
return n.nodes.find((t) => t.id === e);
|
|
1838
1853
|
}
|
|
1839
|
-
function
|
|
1854
|
+
function Il(e, n) {
|
|
1840
1855
|
return n.links.find((t) => t.id === e);
|
|
1841
1856
|
}
|
|
1842
|
-
function
|
|
1857
|
+
function nn(e) {
|
|
1843
1858
|
return !!(e.sourceLinks && e.targetLinks);
|
|
1844
1859
|
}
|
|
1845
|
-
function
|
|
1860
|
+
function wl(e, n) {
|
|
1846
1861
|
if (!n)
|
|
1847
1862
|
return;
|
|
1848
1863
|
const t = e.nodes.filter((a) => a.targetLinks.length === 0).map((a) => `${a.id}`), o = e.nodes.filter((a) => a.sourceLinks.length === 0).map((a) => `${a.id}`), l = n.filter((a) => t.includes(a.dataset.id)).reduce(
|
|
@@ -1859,7 +1874,7 @@ function Ia(e, n) {
|
|
|
1859
1874
|
bottom: 0
|
|
1860
1875
|
};
|
|
1861
1876
|
}
|
|
1862
|
-
function
|
|
1877
|
+
function El(e) {
|
|
1863
1878
|
return e.map((n) => {
|
|
1864
1879
|
const t = n.y1 - n.y0 < Ee;
|
|
1865
1880
|
return {
|
|
@@ -1869,35 +1884,35 @@ function wa(e) {
|
|
|
1869
1884
|
width: n.x1 - n.x0,
|
|
1870
1885
|
height: t ? Ee : n.y1 - n.y0,
|
|
1871
1886
|
textTransform: {
|
|
1872
|
-
x: n.depth > 0 ? n.x1 +
|
|
1887
|
+
x: n.depth > 0 ? n.x1 + Ht : n.x0 - Ht,
|
|
1873
1888
|
y: (n.y1 + n.y0) / 2
|
|
1874
1889
|
},
|
|
1875
1890
|
node: n
|
|
1876
1891
|
};
|
|
1877
1892
|
});
|
|
1878
1893
|
}
|
|
1879
|
-
function
|
|
1894
|
+
function Nl(e) {
|
|
1880
1895
|
return [e.source.x1, e.y0];
|
|
1881
1896
|
}
|
|
1882
|
-
function
|
|
1897
|
+
function Dl(e) {
|
|
1883
1898
|
return [e.target.x0, e.y1];
|
|
1884
1899
|
}
|
|
1885
|
-
function
|
|
1886
|
-
return e.curveFunction ?
|
|
1900
|
+
function Hl(e) {
|
|
1901
|
+
return e.curveFunction ? gn(e.curveFunction).source(Nl).target(Dl) : bn();
|
|
1887
1902
|
}
|
|
1888
|
-
function
|
|
1903
|
+
function Bl(e) {
|
|
1889
1904
|
return e.map((n) => {
|
|
1890
1905
|
var t;
|
|
1891
1906
|
return {
|
|
1892
1907
|
id: n.id,
|
|
1893
|
-
color: n.color || ((t = n.source) == null ? void 0 : t.color) ||
|
|
1894
|
-
d:
|
|
1908
|
+
color: n.color || ((t = n.source) == null ? void 0 : t.color) || Re,
|
|
1909
|
+
d: Hl(n)(n),
|
|
1895
1910
|
strokeWidth: Math.max(1, n.width),
|
|
1896
1911
|
link: n
|
|
1897
1912
|
};
|
|
1898
1913
|
});
|
|
1899
1914
|
}
|
|
1900
|
-
function
|
|
1915
|
+
function St(e, n, t, o, l) {
|
|
1901
1916
|
if (o === !1) {
|
|
1902
1917
|
e.node = {
|
|
1903
1918
|
...e.node,
|
|
@@ -1905,8 +1920,8 @@ function Mt(e, n, t, o, l) {
|
|
|
1905
1920
|
};
|
|
1906
1921
|
return;
|
|
1907
1922
|
}
|
|
1908
|
-
const u = Date.now(), a =
|
|
1909
|
-
let c = (Date.now() - u) /
|
|
1923
|
+
const u = Date.now(), a = Hn(n, t), i = () => {
|
|
1924
|
+
let c = (Date.now() - u) / xl;
|
|
1910
1925
|
c > 1 && (c = 1), e.node = {
|
|
1911
1926
|
...e.node,
|
|
1912
1927
|
transitionValue: l && c === 1 ? void 0 : a(c)
|
|
@@ -1914,120 +1929,123 @@ function Mt(e, n, t, o, l) {
|
|
|
1914
1929
|
};
|
|
1915
1930
|
requestAnimationFrame(i);
|
|
1916
1931
|
}
|
|
1917
|
-
const
|
|
1932
|
+
const Ml = {
|
|
1918
1933
|
nodes: [],
|
|
1919
1934
|
links: []
|
|
1920
1935
|
};
|
|
1921
|
-
function
|
|
1936
|
+
function Rt(e, n) {
|
|
1922
1937
|
return n.find((t) => t.every((o) => o.x0 === e.x0));
|
|
1923
1938
|
}
|
|
1924
|
-
function
|
|
1925
|
-
const o =
|
|
1926
|
-
var r;
|
|
1927
|
-
return (r = e.value) == null ? void 0 : r[0].values.map(
|
|
1928
|
-
({ label:
|
|
1929
|
-
label:
|
|
1930
|
-
color:
|
|
1931
|
-
fallbackColor:
|
|
1932
|
-
id:
|
|
1933
|
-
deriveColorFromIncomingLinks:
|
|
1934
|
-
offset:
|
|
1939
|
+
function Sl(e, n, t) {
|
|
1940
|
+
const o = S(null), l = v(() => {
|
|
1941
|
+
var r, m;
|
|
1942
|
+
return (m = (r = e.value) == null ? void 0 : r[0]) == null ? void 0 : m.values.map(
|
|
1943
|
+
({ label: g, color: p, value: b, deriveColorFromIncomingLinks: L, offset: A }) => ({
|
|
1944
|
+
label: g || b.toString(),
|
|
1945
|
+
color: p,
|
|
1946
|
+
fallbackColor: p || Re,
|
|
1947
|
+
id: b,
|
|
1948
|
+
deriveColorFromIncomingLinks: L,
|
|
1949
|
+
offset: A
|
|
1935
1950
|
})
|
|
1936
1951
|
);
|
|
1937
1952
|
}), u = v(
|
|
1938
1953
|
() => {
|
|
1939
|
-
var r;
|
|
1940
|
-
return (r = e.value) == null ? void 0 : r[0].values.map(
|
|
1941
|
-
(
|
|
1942
|
-
var
|
|
1943
|
-
return (
|
|
1944
|
-
({ node:
|
|
1945
|
-
id: `${
|
|
1946
|
-
color:
|
|
1947
|
-
curveFunction:
|
|
1948
|
-
source:
|
|
1949
|
-
target:
|
|
1950
|
-
value:
|
|
1954
|
+
var r, m;
|
|
1955
|
+
return (m = (r = e.value) == null ? void 0 : r[0]) == null ? void 0 : m.values.map(
|
|
1956
|
+
(g) => {
|
|
1957
|
+
var p;
|
|
1958
|
+
return (p = g.targets) == null ? void 0 : p.map(
|
|
1959
|
+
({ node: b, value: L, color: A, curveFunction: h }) => ({
|
|
1960
|
+
id: `${g.value}:${b}`,
|
|
1961
|
+
color: A,
|
|
1962
|
+
curveFunction: h,
|
|
1963
|
+
source: g.value ?? g.label,
|
|
1964
|
+
target: b,
|
|
1965
|
+
value: L
|
|
1951
1966
|
})
|
|
1952
1967
|
);
|
|
1953
1968
|
}
|
|
1954
1969
|
).filter(Boolean).flat();
|
|
1955
1970
|
}
|
|
1956
|
-
), a = v(() =>
|
|
1971
|
+
), a = v(() => An().nodeId(we).nodeAlign(n.value.nodeAlign).nodePadding(n.value.nodePadding).nodeSort(n.value.nodeSort).nodeWidth(n.value.nodeWidth).linkSort(n.value.linkSort).iterations(n.value.iterations)), i = v(() => {
|
|
1957
1972
|
var r;
|
|
1958
1973
|
return (r = o.value) == null ? void 0 : r.nodes.reduce(
|
|
1959
|
-
(
|
|
1960
|
-
const
|
|
1961
|
-
return
|
|
1974
|
+
(m, g) => {
|
|
1975
|
+
const p = Rt(g, m);
|
|
1976
|
+
return p ? (p.push(g), p.sort((b, L) => (b._y0 || b.y0) - (L._y0 || L.y0))) : m.push([g]), m;
|
|
1962
1977
|
},
|
|
1963
1978
|
[]
|
|
1964
1979
|
);
|
|
1965
1980
|
});
|
|
1966
1981
|
function s(r) {
|
|
1967
|
-
const { offset:
|
|
1982
|
+
const { offset: m } = r, g = Rt(r, i.value);
|
|
1968
1983
|
if (!g)
|
|
1969
1984
|
return;
|
|
1970
|
-
const
|
|
1971
|
-
r._y0 = r.y0, r._y1 = r.y1, r.y0 =
|
|
1972
|
-
}
|
|
1973
|
-
function c(r,
|
|
1974
|
-
const { id: g, _y0:
|
|
1975
|
-
(
|
|
1976
|
-
),
|
|
1977
|
-
(
|
|
1978
|
-
),
|
|
1979
|
-
|
|
1980
|
-
}
|
|
1981
|
-
const
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
+
const p = g[g.findIndex((L) => L.id === r.id) - 1], b = p && g.length !== 1 ? p.y1 + m : m;
|
|
1986
|
+
r._y0 = r.y0, r._y1 = r.y1, r.y0 = b, r.y1 = r.y0 + (r._y1 - r._y0);
|
|
1987
|
+
}
|
|
1988
|
+
function c(r, m) {
|
|
1989
|
+
const { id: g, _y0: p, y0: b } = r, L = m.links.filter(
|
|
1990
|
+
(x) => x.source.id === g
|
|
1991
|
+
), A = m.links.filter(
|
|
1992
|
+
(x) => x.target.id === g
|
|
1993
|
+
), h = b - p;
|
|
1994
|
+
L.forEach((x) => x.y0 += h), A.forEach((x) => x.y1 += h);
|
|
1995
|
+
}
|
|
1996
|
+
const f = v(() => {
|
|
1997
|
+
var r;
|
|
1998
|
+
return o.value && ((r = l.value) == null || r.forEach((m) => {
|
|
1999
|
+
m.value === 0 && (m.fallbackColor = dt.Grey), typeof m.offset == "number" && (s(m), c(m, o.value));
|
|
2000
|
+
})), o.value;
|
|
2001
|
+
});
|
|
2002
|
+
return Z([a, t], () => {
|
|
1985
2003
|
try {
|
|
1986
|
-
const { x0: r, y0:
|
|
2004
|
+
const { x0: r, y0: m, x1: g, y1: p } = t.value;
|
|
1987
2005
|
o.value = a.value.extent([
|
|
1988
|
-
[r,
|
|
1989
|
-
[g,
|
|
2006
|
+
[r, m],
|
|
2007
|
+
[g, p]
|
|
1990
2008
|
])({ nodes: l.value, links: u.value });
|
|
1991
2009
|
} catch (r) {
|
|
1992
|
-
|
|
2010
|
+
at(Ve.GraphProblem, r), o.value = Ml;
|
|
1993
2011
|
}
|
|
1994
|
-
}), { columns: i, graph:
|
|
2012
|
+
}), { columns: i, graph: f };
|
|
1995
2013
|
}
|
|
1996
|
-
function
|
|
2014
|
+
function ut(e, n) {
|
|
1997
2015
|
return n || (n = {}), e.targetLinks && e.targetLinks.forEach(({ source: t, value: o }) => {
|
|
1998
|
-
n[t.id] = o,
|
|
2016
|
+
n[t.id] = o, ut(
|
|
1999
2017
|
t,
|
|
2000
2018
|
n
|
|
2001
2019
|
);
|
|
2002
2020
|
}), n;
|
|
2003
2021
|
}
|
|
2004
|
-
function
|
|
2022
|
+
function rt(e, n) {
|
|
2005
2023
|
return n || (n = {}), e.sourceLinks && e.sourceLinks.forEach(({ target: t, value: o }) => {
|
|
2006
|
-
n[t.id] = o,
|
|
2024
|
+
n[t.id] = o, rt(
|
|
2007
2025
|
t,
|
|
2008
2026
|
n
|
|
2009
2027
|
);
|
|
2010
2028
|
}), n;
|
|
2011
2029
|
}
|
|
2012
|
-
function
|
|
2030
|
+
function Rl(e, n) {
|
|
2013
2031
|
return n.links.reduce((t, o) => (o.source.id in e && o.target.id in e && t.push(o.id), t), []);
|
|
2014
2032
|
}
|
|
2015
|
-
const
|
|
2033
|
+
const Cl = (e, n) => {
|
|
2016
2034
|
let t;
|
|
2017
|
-
|
|
2035
|
+
nn(e) ? t = {
|
|
2018
2036
|
[e.id]: e.value,
|
|
2019
|
-
...
|
|
2020
|
-
...
|
|
2037
|
+
...ut(e),
|
|
2038
|
+
...rt(e)
|
|
2021
2039
|
} : t = {
|
|
2022
2040
|
[e.source.id]: e.source.value,
|
|
2023
2041
|
[e.target.id]: e.target.value,
|
|
2024
|
-
...
|
|
2025
|
-
...
|
|
2042
|
+
...ut(e.source),
|
|
2043
|
+
...rt(e.target)
|
|
2026
2044
|
};
|
|
2027
|
-
const o =
|
|
2045
|
+
const o = Rl(t, n);
|
|
2028
2046
|
return { nodes: t, links: o };
|
|
2029
|
-
},
|
|
2030
|
-
if (
|
|
2047
|
+
}, Gl = (e) => {
|
|
2048
|
+
if (nn(e)) {
|
|
2031
2049
|
const n = [...e.sourceLinks, ...e.targetLinks];
|
|
2032
2050
|
return {
|
|
2033
2051
|
nodes: n.reduce(
|
|
@@ -2045,15 +2063,15 @@ const Sa = (e, n) => {
|
|
|
2045
2063
|
links: [e.id]
|
|
2046
2064
|
};
|
|
2047
2065
|
};
|
|
2048
|
-
function
|
|
2049
|
-
const o =
|
|
2066
|
+
function jl(e, n, t) {
|
|
2067
|
+
const o = S(null), l = v(() => o.value ? typeof n.value.highlightedElements == "function" ? n.value.highlightedElements(
|
|
2050
2068
|
o.value,
|
|
2051
2069
|
t.value
|
|
2052
|
-
) : n.value.highlightedElements === "closest" ?
|
|
2053
|
-
return
|
|
2070
|
+
) : n.value.highlightedElements === "closest" ? Gl(o.value, t.value) : Cl(o.value, t.value) : { nodes: {}, links: [] });
|
|
2071
|
+
return Z(l, (u, a) => {
|
|
2054
2072
|
if (u.links.length === 0 && Object.keys(u.nodes).length === 0) {
|
|
2055
2073
|
e.value.forEach((i) => {
|
|
2056
|
-
i.node.id in a.nodes &&
|
|
2074
|
+
i.node.id in a.nodes && St(
|
|
2057
2075
|
i,
|
|
2058
2076
|
a.nodes[i.node.id],
|
|
2059
2077
|
i.node.value,
|
|
@@ -2064,7 +2082,7 @@ function Ga(e, n, t) {
|
|
|
2064
2082
|
return;
|
|
2065
2083
|
}
|
|
2066
2084
|
e.value.forEach((i) => {
|
|
2067
|
-
i.node.id in u.nodes &&
|
|
2085
|
+
i.node.id in u.nodes && St(
|
|
2068
2086
|
i,
|
|
2069
2087
|
i.node.value,
|
|
2070
2088
|
u.nodes[i.node.id],
|
|
@@ -2073,13 +2091,13 @@ function Ga(e, n, t) {
|
|
|
2073
2091
|
});
|
|
2074
2092
|
}), { highlightedElements: l, hoveredElement: o };
|
|
2075
2093
|
}
|
|
2076
|
-
const
|
|
2094
|
+
const Vl = {
|
|
2077
2095
|
class: "lume-alluvial-group",
|
|
2078
2096
|
"data-j-alluvial-group": ""
|
|
2079
|
-
},
|
|
2097
|
+
}, Pl = { key: 0 }, Fl = ["x", "y"], zl = { key: 0 }, Wl = ["id", "x1", "x2"], Zl = ["stop-color"], Ul = ["stop-color"], Xl = ["d", "stroke-width", "onClick", "onMouseover"], Yl = ["d", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-width", "data-id", "onClick", "onMouseover"], Kl = ["onClick", "onMouseenter", "onMouseleave", "onMouseover"], Jl = ["x", "y", "height", "width"], Ql = ["transform", "data-id", "width"], ql = /* @__PURE__ */ U({
|
|
2080
2098
|
__name: "lume-alluvial-group",
|
|
2081
2099
|
props: {
|
|
2082
|
-
...
|
|
2100
|
+
...We(),
|
|
2083
2101
|
hoveredElementId: {
|
|
2084
2102
|
type: [Number, String],
|
|
2085
2103
|
default: null
|
|
@@ -2087,242 +2105,242 @@ const ja = {
|
|
|
2087
2105
|
},
|
|
2088
2106
|
emits: ["node-click", "node-mouseenter", "node-mouseleave", "link-click", "link-mouseenter", "link-mouseleave"],
|
|
2089
2107
|
setup(e, { emit: n }) {
|
|
2090
|
-
const t = e, o = n, l =
|
|
2108
|
+
const t = e, o = n, l = Pe("chartID"), { data: u, options: a } = te(t), i = S([]), s = S([]), c = S(null), { extents: f, updateExtents: r } = Ll(t.containerSize), { columns: m, graph: g } = Sl(u, a, f), { hoveredElement: p, highlightedElements: b } = jl(
|
|
2091
2109
|
i,
|
|
2092
2110
|
a,
|
|
2093
2111
|
g
|
|
2094
|
-
),
|
|
2095
|
-
() => Object.keys(
|
|
2096
|
-
),
|
|
2112
|
+
), L = v(() => je(a.value.valueFormat)), A = v(
|
|
2113
|
+
() => Object.keys(b.value.nodes)
|
|
2114
|
+
), h = v(() => m.value ? m.value.map(
|
|
2097
2115
|
(k) => k[0].x0 + a.value.nodeWidth / 2
|
|
2098
|
-
) : []),
|
|
2116
|
+
) : []), x = v(() => {
|
|
2099
2117
|
if (!(!a.value.nodeHeaders || !a.value.nodeHeaders.length))
|
|
2100
|
-
return a.value.nodeHeaders.slice(0,
|
|
2118
|
+
return a.value.nodeHeaders.slice(0, h.value.length).map((k, E) => ({
|
|
2101
2119
|
label: k,
|
|
2102
|
-
x:
|
|
2120
|
+
x: h.value[E]
|
|
2103
2121
|
}));
|
|
2104
2122
|
}), N = v(
|
|
2105
|
-
() => a.value.nodeHeaderPadding ??
|
|
2106
|
-
),
|
|
2123
|
+
() => a.value.nodeHeaderPadding ?? pl
|
|
2124
|
+
), D = v(() => {
|
|
2107
2125
|
if (!(!a.value.gradient || !g.value))
|
|
2108
|
-
return g.value.links.reduce((k,
|
|
2109
|
-
const { source:
|
|
2110
|
-
return k[
|
|
2111
|
-
source:
|
|
2112
|
-
target:
|
|
2113
|
-
x1:
|
|
2114
|
-
x2:
|
|
2126
|
+
return g.value.links.reduce((k, E) => {
|
|
2127
|
+
const { source: _, target: j } = E, J = _.color || _.fallbackColor, ae = j.deriveColorFromIncomingLinks ? J : j.color || j.fallbackColor;
|
|
2128
|
+
return k[E.id] = {
|
|
2129
|
+
source: J,
|
|
2130
|
+
target: ae,
|
|
2131
|
+
x1: _.x1,
|
|
2132
|
+
x2: j.x0
|
|
2115
2133
|
}, k;
|
|
2116
2134
|
}, {});
|
|
2117
|
-
}),
|
|
2135
|
+
}), P = v(() => {
|
|
2118
2136
|
const k = i.value.filter(
|
|
2119
|
-
(
|
|
2120
|
-
),
|
|
2121
|
-
return k.forEach((
|
|
2122
|
-
const
|
|
2123
|
-
s.value.filter(({ link:
|
|
2124
|
-
const
|
|
2125
|
-
let Ie,
|
|
2126
|
-
return
|
|
2127
|
-
x:
|
|
2128
|
-
y:
|
|
2129
|
-
height:
|
|
2130
|
-
width:
|
|
2131
|
-
key: `node-block-${
|
|
2132
|
-
class: `lume-alluvial-group__node-block lume-fill--${
|
|
2133
|
-
}),
|
|
2134
|
-
}, 0),
|
|
2135
|
-
id:
|
|
2136
|
-
subNodes:
|
|
2137
|
+
(_) => F(_)
|
|
2138
|
+
), E = [];
|
|
2139
|
+
return k.forEach((_) => {
|
|
2140
|
+
const j = [];
|
|
2141
|
+
s.value.filter(({ link: J }) => J.target.id === _.node.id).reverse().reduce((J, ae, $e, Ze) => {
|
|
2142
|
+
const Ue = ae.link.target.y1 - ae.link.target.y0 > Ee;
|
|
2143
|
+
let Ie, Ce, be;
|
|
2144
|
+
return Ue ? (Ie = ae.link.target.y1 - ae.link.target.y0, Ce = ae.link.value / _.node.value, be = Ce * Ie) : (Ie = Ee, be = Ee / Ze.length), j.push({
|
|
2145
|
+
x: _.x,
|
|
2146
|
+
y: _.y + J,
|
|
2147
|
+
height: be,
|
|
2148
|
+
width: _.width,
|
|
2149
|
+
key: `node-block-${_.node.id}-source-link-${ae.link.source.id}`,
|
|
2150
|
+
class: `lume-alluvial-group__node-block lume-fill--${ae.link.source.color || Re}`
|
|
2151
|
+
}), J + be;
|
|
2152
|
+
}, 0), E.push({
|
|
2153
|
+
id: _.node.id,
|
|
2154
|
+
subNodes: j
|
|
2137
2155
|
});
|
|
2138
|
-
}),
|
|
2156
|
+
}), E;
|
|
2139
2157
|
});
|
|
2140
2158
|
function w(k) {
|
|
2141
2159
|
return a.value.gradient && `url('#${l}_${k.id}')`;
|
|
2142
2160
|
}
|
|
2143
|
-
function
|
|
2144
|
-
return
|
|
2145
|
-
}
|
|
2146
|
-
function U(k) {
|
|
2147
|
-
return T.value.length > 0 && T.value.includes(k.toString());
|
|
2161
|
+
function H(k) {
|
|
2162
|
+
return A.value.length > 0 && !A.value.includes(k.toString());
|
|
2148
2163
|
}
|
|
2149
2164
|
function X(k) {
|
|
2150
|
-
return A.value.
|
|
2165
|
+
return A.value.length > 0 && A.value.includes(k.toString());
|
|
2166
|
+
}
|
|
2167
|
+
function Y(k) {
|
|
2168
|
+
return b.value.links.length > 0 && !b.value.links.includes(k);
|
|
2151
2169
|
}
|
|
2152
|
-
function
|
|
2153
|
-
return
|
|
2170
|
+
function Q(k) {
|
|
2171
|
+
return b.value.links.length > 0 && b.value.links.includes(k);
|
|
2154
2172
|
}
|
|
2155
|
-
function
|
|
2173
|
+
function F(k) {
|
|
2156
2174
|
return !k.node.color && k.node.deriveColorFromIncomingLinks;
|
|
2157
2175
|
}
|
|
2158
|
-
function
|
|
2159
|
-
k !==
|
|
2176
|
+
function ue(k, E) {
|
|
2177
|
+
k !== p.value && (p.value = k, o("link-mouseenter", { link: k, event: E }));
|
|
2160
2178
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const
|
|
2163
|
-
|
|
2179
|
+
function Oe(k) {
|
|
2180
|
+
const E = p.value;
|
|
2181
|
+
p.value = null, o("link-mouseleave", { link: E, event: k });
|
|
2164
2182
|
}
|
|
2165
|
-
function
|
|
2183
|
+
function ke(k) {
|
|
2166
2184
|
if (k == null) {
|
|
2167
|
-
|
|
2185
|
+
p.value = null;
|
|
2168
2186
|
return;
|
|
2169
2187
|
}
|
|
2170
|
-
const
|
|
2171
|
-
if (!
|
|
2172
|
-
|
|
2188
|
+
const E = $l(k, g.value) || Il(k, g.value);
|
|
2189
|
+
if (!E) {
|
|
2190
|
+
ge(ve.InvalidHoveredElement);
|
|
2173
2191
|
return;
|
|
2174
2192
|
}
|
|
2175
|
-
|
|
2193
|
+
p.value = E;
|
|
2176
2194
|
}
|
|
2177
|
-
function
|
|
2178
|
-
var
|
|
2179
|
-
return ((
|
|
2195
|
+
function xe(k) {
|
|
2196
|
+
var E;
|
|
2197
|
+
return ((E = P.value.find(({ id: _ }) => k === _)) == null ? void 0 : E.subNodes) ?? [];
|
|
2180
2198
|
}
|
|
2181
|
-
function
|
|
2182
|
-
const k =
|
|
2199
|
+
function M() {
|
|
2200
|
+
const k = wl(g.value, c.value);
|
|
2183
2201
|
r(k);
|
|
2184
2202
|
}
|
|
2185
|
-
return
|
|
2186
|
-
i.value =
|
|
2187
|
-
}),
|
|
2188
|
-
t.containerSize.width && t.containerSize.height &&
|
|
2189
|
-
}),
|
|
2190
|
-
|
|
2191
|
-
(
|
|
2192
|
-
key: `header_${
|
|
2193
|
-
x:
|
|
2203
|
+
return Z(g, (k) => {
|
|
2204
|
+
i.value = El(k.nodes), s.value = Bl(k.links).reverse(), p.value == null && t.hoveredElementId != null && ke(t.hoveredElementId);
|
|
2205
|
+
}), Z([t.containerSize, c], () => {
|
|
2206
|
+
t.containerSize.width && t.containerSize.height && M();
|
|
2207
|
+
}), Z(() => t.hoveredElementId, ke), (k, E) => (y(), $("g", Vl, [
|
|
2208
|
+
x.value ? (y(), $("g", Pl, [
|
|
2209
|
+
(y(!0), $(q, null, z(x.value, (_) => (y(), $("text", {
|
|
2210
|
+
key: `header_${_.x}`,
|
|
2211
|
+
x: _.x,
|
|
2194
2212
|
y: -N.value,
|
|
2195
2213
|
class: "lume-alluvial-group__node-header lume-typography--caption"
|
|
2196
|
-
},
|
|
2197
|
-
])) :
|
|
2198
|
-
|
|
2214
|
+
}, oe(_.label), 9, Fl))), 128))
|
|
2215
|
+
])) : W("", !0),
|
|
2216
|
+
C("g", {
|
|
2199
2217
|
class: "lume-alluvial-link-group",
|
|
2200
|
-
onMouseleave:
|
|
2218
|
+
onMouseleave: Oe
|
|
2201
2219
|
}, [
|
|
2202
|
-
d(a).gradient ? (
|
|
2203
|
-
(
|
|
2204
|
-
id: `${d(l)}_${
|
|
2205
|
-
key:
|
|
2220
|
+
d(a).gradient ? (y(), $("defs", zl, [
|
|
2221
|
+
(y(!0), $(q, null, z(D.value, (_, j) => (y(), $("linearGradient", {
|
|
2222
|
+
id: `${d(l)}_${j}`,
|
|
2223
|
+
key: j,
|
|
2206
2224
|
gradientUnits: "userSpaceOnUse",
|
|
2207
|
-
x1:
|
|
2208
|
-
x2:
|
|
2225
|
+
x1: _.x1,
|
|
2226
|
+
x2: _.x2
|
|
2209
2227
|
}, [
|
|
2210
|
-
|
|
2228
|
+
C("stop", {
|
|
2211
2229
|
offset: "0%",
|
|
2212
|
-
"stop-color": `var(--lume-color--${
|
|
2213
|
-
}, null, 8,
|
|
2214
|
-
|
|
2230
|
+
"stop-color": `var(--lume-color--${_.source})`
|
|
2231
|
+
}, null, 8, Zl),
|
|
2232
|
+
C("stop", {
|
|
2215
2233
|
offset: "100%",
|
|
2216
|
-
"stop-color": `var(--lume-color--${
|
|
2217
|
-
}, null, 8,
|
|
2218
|
-
], 8,
|
|
2219
|
-
])) :
|
|
2220
|
-
(
|
|
2221
|
-
key: `link-ghost_${
|
|
2222
|
-
class:
|
|
2234
|
+
"stop-color": `var(--lume-color--${_.target})`
|
|
2235
|
+
}, null, 8, Ul)
|
|
2236
|
+
], 8, Wl))), 128))
|
|
2237
|
+
])) : W("", !0),
|
|
2238
|
+
(y(!0), $(q, null, z(s.value, (_) => (y(), $("path", {
|
|
2239
|
+
key: `link-ghost_${_.id}`,
|
|
2240
|
+
class: ne(["lume-alluvial-group__link", [
|
|
2223
2241
|
"lume-stroke--transparent",
|
|
2224
2242
|
"lume-alluvial-group__link--ghost"
|
|
2225
2243
|
]]),
|
|
2226
|
-
d:
|
|
2227
|
-
"stroke-width":
|
|
2244
|
+
d: _.d,
|
|
2245
|
+
"stroke-width": _.strokeWidth + d(fl),
|
|
2228
2246
|
"data-j-alluvial-ghost": "",
|
|
2229
|
-
onClick: (
|
|
2230
|
-
onMouseover: (
|
|
2231
|
-
}, null, 40,
|
|
2232
|
-
(
|
|
2233
|
-
key: `link_${
|
|
2234
|
-
class:
|
|
2235
|
-
[`lume-stroke--${
|
|
2236
|
-
"lume-alluvial-group__link--faded":
|
|
2237
|
-
"lume-alluvial-group__link--focused":
|
|
2247
|
+
onClick: (j) => o("link-click", { link: _.link, event: j }),
|
|
2248
|
+
onMouseover: (j) => ue(_.link, j)
|
|
2249
|
+
}, null, 40, Xl))), 128)),
|
|
2250
|
+
(y(!0), $(q, null, z(s.value, (_) => (y(), $("path", {
|
|
2251
|
+
key: `link_${_.id}`,
|
|
2252
|
+
class: ne(["lume-alluvial-group__link", {
|
|
2253
|
+
[`lume-stroke--${_.color}`]: !d(a).gradient && _.color,
|
|
2254
|
+
"lume-alluvial-group__link--faded": Y(_.id),
|
|
2255
|
+
"lume-alluvial-group__link--focused": Q(_.id)
|
|
2238
2256
|
}]),
|
|
2239
|
-
d:
|
|
2240
|
-
stroke: w(
|
|
2257
|
+
d: _.d,
|
|
2258
|
+
stroke: w(_.link),
|
|
2241
2259
|
"stroke-dasharray": k.containerSize.width,
|
|
2242
2260
|
"stroke-dashoffset": k.containerSize.width,
|
|
2243
|
-
"stroke-width":
|
|
2261
|
+
"stroke-width": _.strokeWidth,
|
|
2244
2262
|
"data-j-alluvial-path": "",
|
|
2245
|
-
"data-id":
|
|
2246
|
-
onClick: (
|
|
2247
|
-
onMouseover: (
|
|
2248
|
-
}, null, 42,
|
|
2263
|
+
"data-id": _.id,
|
|
2264
|
+
onClick: (j) => o("link-click", { link: _.link, event: j }),
|
|
2265
|
+
onMouseover: (j) => ue(_.link, j)
|
|
2266
|
+
}, null, 42, Yl))), 128))
|
|
2249
2267
|
], 32),
|
|
2250
|
-
(
|
|
2251
|
-
key: `node-block_${
|
|
2252
|
-
class:
|
|
2253
|
-
"lume-alluvial-group__node--faded":
|
|
2254
|
-
"lume-alluvial-group__node--focused":
|
|
2268
|
+
(y(!0), $(q, null, z(i.value, (_, j) => (y(), $("g", {
|
|
2269
|
+
key: `node-block_${j}`,
|
|
2270
|
+
class: ne(["lume-alluvial-group__node", {
|
|
2271
|
+
"lume-alluvial-group__node--faded": H(_.node.id),
|
|
2272
|
+
"lume-alluvial-group__node--focused": X(_.node.id)
|
|
2255
2273
|
}]),
|
|
2256
2274
|
"data-j-alluvial-group__node-block": ""
|
|
2257
2275
|
}, [
|
|
2258
|
-
|
|
2259
|
-
onClick: (
|
|
2260
|
-
onMouseenter: (
|
|
2261
|
-
onMouseleave: (
|
|
2262
|
-
onMouseover: (
|
|
2263
|
-
onMouseout:
|
|
2276
|
+
C("g", {
|
|
2277
|
+
onClick: (J) => o("node-click", { node: _.node, event: J }),
|
|
2278
|
+
onMouseenter: (J) => o("node-mouseenter", { node: _.node, event: J }),
|
|
2279
|
+
onMouseleave: (J) => o("node-mouseleave", { node: _.node, event: J }),
|
|
2280
|
+
onMouseover: (J) => p.value = _.node,
|
|
2281
|
+
onMouseout: E[0] || (E[0] = (J) => p.value = null)
|
|
2264
2282
|
}, [
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
), (
|
|
2268
|
-
key:
|
|
2283
|
+
F(_) ? (y(!0), $(q, { key: 0 }, z(xe(
|
|
2284
|
+
_.node.id
|
|
2285
|
+
), (J) => (y(), $("rect", G(J, {
|
|
2286
|
+
key: J.key,
|
|
2269
2287
|
"data-j-alluvial-sub-nodes": ""
|
|
2270
|
-
}), null, 16))), 128)) : (
|
|
2288
|
+
}), null, 16))), 128)) : (y(), $("rect", {
|
|
2271
2289
|
key: 1,
|
|
2272
|
-
class:
|
|
2273
|
-
x:
|
|
2274
|
-
y:
|
|
2275
|
-
height:
|
|
2276
|
-
width:
|
|
2277
|
-
}, null, 10,
|
|
2278
|
-
|
|
2290
|
+
class: ne(["lume-alluvial-group__node-block", `lume-fill--${_.node.color || _.node.fallbackColor}`]),
|
|
2291
|
+
x: _.x,
|
|
2292
|
+
y: _.y,
|
|
2293
|
+
height: _.height,
|
|
2294
|
+
width: _.width
|
|
2295
|
+
}, null, 10, Jl)),
|
|
2296
|
+
C("g", {
|
|
2279
2297
|
ref_for: !0,
|
|
2280
2298
|
ref_key: "nodeTextRefs",
|
|
2281
2299
|
ref: c,
|
|
2282
|
-
class:
|
|
2283
|
-
"lume-alluvial-group__node-text--left":
|
|
2300
|
+
class: ne(["lume-alluvial-group__node-text lume-typography--caption", {
|
|
2301
|
+
"lume-alluvial-group__node-text--left": _.node.depth === 0
|
|
2284
2302
|
}]),
|
|
2285
|
-
transform: `translate(${
|
|
2286
|
-
"data-id":
|
|
2303
|
+
transform: `translate(${_.textTransform.x},${_.textTransform.y})`,
|
|
2304
|
+
"data-id": _.node.id,
|
|
2287
2305
|
width: d(a).nodeLabelMaxWidth
|
|
2288
2306
|
}, [
|
|
2289
|
-
|
|
2290
|
-
node:
|
|
2291
|
-
value:
|
|
2292
|
-
|
|
2293
|
-
|
|
2307
|
+
R(k.$slots, `node-text-${_.node.id}`, {
|
|
2308
|
+
node: _.node,
|
|
2309
|
+
value: L.value(
|
|
2310
|
+
_.node.transitionValue || _.node.value,
|
|
2311
|
+
_.node.value
|
|
2294
2312
|
)
|
|
2295
2313
|
}, () => [
|
|
2296
|
-
|
|
2314
|
+
ie(d(kl), {
|
|
2297
2315
|
bottom: d(a).switchText,
|
|
2298
|
-
left:
|
|
2316
|
+
left: _.node.depth === 0,
|
|
2299
2317
|
"max-width": d(a).nodeLabelMaxWidth,
|
|
2300
|
-
"onLume__internal-NodeResize":
|
|
2318
|
+
"onLume__internal-NodeResize": M
|
|
2301
2319
|
}, {
|
|
2302
2320
|
default: V(() => [
|
|
2303
|
-
fe(
|
|
2321
|
+
fe(oe(_.node.label), 1)
|
|
2304
2322
|
]),
|
|
2305
2323
|
_: 2
|
|
2306
2324
|
}, 1032, ["bottom", "left", "max-width"]),
|
|
2307
|
-
|
|
2325
|
+
ie(d(Tl), {
|
|
2308
2326
|
bottom: !d(a).switchText
|
|
2309
2327
|
}, {
|
|
2310
2328
|
default: V(() => [
|
|
2311
|
-
fe(
|
|
2312
|
-
|
|
2313
|
-
|
|
2329
|
+
fe(oe(L.value(
|
|
2330
|
+
_.node.transitionValue || _.node.value,
|
|
2331
|
+
_.node.value
|
|
2314
2332
|
)), 1)
|
|
2315
2333
|
]),
|
|
2316
2334
|
_: 2
|
|
2317
2335
|
}, 1032, ["bottom"])
|
|
2318
2336
|
], !0)
|
|
2319
|
-
], 10,
|
|
2320
|
-
], 40,
|
|
2337
|
+
], 10, Ql)
|
|
2338
|
+
], 40, Kl)
|
|
2321
2339
|
], 2))), 128))
|
|
2322
2340
|
]));
|
|
2323
2341
|
}
|
|
2324
2342
|
});
|
|
2325
|
-
const
|
|
2343
|
+
const ea = /* @__PURE__ */ ee(ql, [["__scopeId", "data-v-f004e5fb"]]), ta = {
|
|
2326
2344
|
margins: {
|
|
2327
2345
|
top: 0,
|
|
2328
2346
|
right: 0,
|
|
@@ -2338,16 +2356,16 @@ const qa = /* @__PURE__ */ te(Qa, [["__scopeId", "data-v-f004e5fb"]]), el = {
|
|
|
2338
2356
|
highlightedElements: "closest",
|
|
2339
2357
|
nodePadding: 16,
|
|
2340
2358
|
nodeWidth: 16,
|
|
2341
|
-
nodeAlign:
|
|
2359
|
+
nodeAlign: Tn,
|
|
2342
2360
|
valueFormat: (e) => String(e),
|
|
2343
2361
|
iterations: 6
|
|
2344
|
-
},
|
|
2362
|
+
}, za = /* @__PURE__ */ U({
|
|
2345
2363
|
__name: "lume-alluvial-diagram",
|
|
2346
2364
|
props: {
|
|
2347
|
-
...
|
|
2365
|
+
...Wo(it)
|
|
2348
2366
|
},
|
|
2349
2367
|
setup(e, { emit: n }) {
|
|
2350
|
-
const t = e, { componentEventPropagator: o } =
|
|
2368
|
+
const t = e, { componentEventPropagator: o } = ye(), l = Le(re()), u = Mn(re()), { options: a } = te(t), { allOptions: i } = me(a, ta);
|
|
2351
2369
|
function s(c) {
|
|
2352
2370
|
return {
|
|
2353
2371
|
...c,
|
|
@@ -2355,54 +2373,54 @@ const qa = /* @__PURE__ */ te(Qa, [["__scopeId", "data-v-f004e5fb"]]), el = {
|
|
|
2355
2373
|
// Alluvial chart never uses base scales
|
|
2356
2374
|
};
|
|
2357
2375
|
}
|
|
2358
|
-
return (c,
|
|
2376
|
+
return (c, f) => (y(), K(d(De), G(t, {
|
|
2359
2377
|
options: s(d(i)),
|
|
2360
2378
|
"data-j-alluvial-diagram": ""
|
|
2361
|
-
}, le(d(o))),
|
|
2379
|
+
}, le(d(o))), ce({
|
|
2362
2380
|
groups: V((r) => [
|
|
2363
|
-
|
|
2364
|
-
|
|
2381
|
+
ie(d(ea), G(r, { "hovered-element-id": c.hoveredElement }, le(d(o))), ce({ _: 2 }, [
|
|
2382
|
+
z(d(u), (m, g) => ({
|
|
2365
2383
|
name: g,
|
|
2366
|
-
fn: V((
|
|
2367
|
-
|
|
2384
|
+
fn: V((p) => [
|
|
2385
|
+
R(c.$slots, g, pe(he(p || {})))
|
|
2368
2386
|
])
|
|
2369
2387
|
}))
|
|
2370
2388
|
]), 1040, ["hovered-element-id"])
|
|
2371
2389
|
]),
|
|
2372
2390
|
_: 2
|
|
2373
2391
|
}, [
|
|
2374
|
-
|
|
2375
|
-
name:
|
|
2392
|
+
z(d(l), (r, m) => ({
|
|
2393
|
+
name: m,
|
|
2376
2394
|
fn: V((g) => [
|
|
2377
|
-
|
|
2395
|
+
R(c.$slots, m, pe(he(g || {})))
|
|
2378
2396
|
])
|
|
2379
2397
|
}))
|
|
2380
2398
|
]), 1040, ["options"]));
|
|
2381
2399
|
}
|
|
2382
2400
|
});
|
|
2383
|
-
var
|
|
2384
|
-
const
|
|
2401
|
+
var on = /* @__PURE__ */ ((e) => (e.grouped = "grouped", e.stacked = "stacked", e))(on || {});
|
|
2402
|
+
const Wa = /* @__PURE__ */ U({
|
|
2385
2403
|
__name: "lume-bar-chart",
|
|
2386
2404
|
props: {
|
|
2387
2405
|
...Ne(),
|
|
2388
2406
|
type: {
|
|
2389
2407
|
type: String,
|
|
2390
2408
|
default: null,
|
|
2391
|
-
validator: (e) => e in
|
|
2409
|
+
validator: (e) => e in on || e == null
|
|
2392
2410
|
}
|
|
2393
2411
|
},
|
|
2394
2412
|
setup(e, { emit: n }) {
|
|
2395
|
-
const t =
|
|
2413
|
+
const t = Je(
|
|
2396
2414
|
() => import("./common/42f5d2fc.js")
|
|
2397
|
-
), o =
|
|
2415
|
+
), o = Je(
|
|
2398
2416
|
() => import("./common/abc9d23d.js")
|
|
2399
|
-
), l =
|
|
2417
|
+
), l = Je(
|
|
2400
2418
|
() => import("./common/0664fd4d.js")
|
|
2401
2419
|
), u = /* @__PURE__ */ new Map([
|
|
2402
2420
|
["single", t],
|
|
2403
2421
|
["grouped", o],
|
|
2404
2422
|
["stacked", l]
|
|
2405
|
-
]), a = e, { componentEventPropagator: i } =
|
|
2423
|
+
]), a = e, { componentEventPropagator: i } = ye(), s = Le(re());
|
|
2406
2424
|
function c(r) {
|
|
2407
2425
|
return {
|
|
2408
2426
|
...r,
|
|
@@ -2410,57 +2428,55 @@ const Pl = /* @__PURE__ */ Z({
|
|
|
2410
2428
|
// Bar chart always starts on zero,
|
|
2411
2429
|
tooltipOptions: {
|
|
2412
2430
|
...(r == null ? void 0 : r.tooltipOptions) || {},
|
|
2413
|
-
position: a.orientation ===
|
|
2431
|
+
position: a.orientation === B.HORIZONTAL ? "right" : void 0
|
|
2414
2432
|
}
|
|
2415
2433
|
};
|
|
2416
2434
|
}
|
|
2417
|
-
const
|
|
2418
|
-
if (a.data)
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
return u.get(a.type);
|
|
2424
|
-
}
|
|
2435
|
+
const f = v(() => {
|
|
2436
|
+
if (it(a.data))
|
|
2437
|
+
return u.get("single");
|
|
2438
|
+
if (!a.type)
|
|
2439
|
+
throw new Error("Bar chart needs a type when there's multiple datasets.");
|
|
2440
|
+
return u.get(a.type);
|
|
2425
2441
|
});
|
|
2426
|
-
return (r,
|
|
2442
|
+
return (r, m) => (y(), K(fn(f.value), G({ ...a, ...r.$attrs }, {
|
|
2427
2443
|
options: c(r.options)
|
|
2428
|
-
}, le(d(i))),
|
|
2429
|
-
|
|
2430
|
-
name:
|
|
2431
|
-
fn: V((
|
|
2432
|
-
|
|
2444
|
+
}, le(d(i))), ce({ _: 2 }, [
|
|
2445
|
+
z(d(s), (g, p) => ({
|
|
2446
|
+
name: p,
|
|
2447
|
+
fn: V((b) => [
|
|
2448
|
+
R(r.$slots, p, pe(he(b || {})))
|
|
2433
2449
|
])
|
|
2434
2450
|
}))
|
|
2435
2451
|
]), 1040, ["options"]));
|
|
2436
2452
|
}
|
|
2437
2453
|
});
|
|
2438
|
-
function
|
|
2439
|
-
return Object.values(
|
|
2454
|
+
function na(e) {
|
|
2455
|
+
return Object.values(jn).includes(e) || e == null;
|
|
2440
2456
|
}
|
|
2441
|
-
function
|
|
2442
|
-
return Object.values(
|
|
2457
|
+
function oa(e) {
|
|
2458
|
+
return Object.values(B).includes(e);
|
|
2443
2459
|
}
|
|
2444
|
-
const
|
|
2460
|
+
const la = (e = !1) => ({
|
|
2445
2461
|
type: {
|
|
2446
2462
|
type: String,
|
|
2447
2463
|
default: null,
|
|
2448
|
-
validator:
|
|
2464
|
+
validator: na
|
|
2449
2465
|
},
|
|
2450
2466
|
...e ? {
|
|
2451
2467
|
orientation: {
|
|
2452
2468
|
type: String,
|
|
2453
|
-
default:
|
|
2454
|
-
validator:
|
|
2469
|
+
default: B.VERTICAL,
|
|
2470
|
+
validator: oa
|
|
2455
2471
|
}
|
|
2456
2472
|
} : {}
|
|
2457
2473
|
});
|
|
2458
|
-
function
|
|
2474
|
+
function ln(e, n) {
|
|
2459
2475
|
const t = v(() => e.value.map((l) => {
|
|
2460
2476
|
var u;
|
|
2461
2477
|
return {
|
|
2462
2478
|
...l,
|
|
2463
|
-
values:
|
|
2479
|
+
values: st(
|
|
2464
2480
|
l.values,
|
|
2465
2481
|
((u = n == null ? void 0 : n.value) == null ? void 0 : u.length) ?? 0
|
|
2466
2482
|
).map((a) => ({
|
|
@@ -2476,26 +2492,32 @@ function nn(e, n) {
|
|
|
2476
2492
|
});
|
|
2477
2493
|
return { multiBarData: t, groupedData: o };
|
|
2478
2494
|
}
|
|
2479
|
-
function
|
|
2495
|
+
function aa(e, n) {
|
|
2480
2496
|
return e.value.length === 1 ? "single" : n.value;
|
|
2481
2497
|
}
|
|
2482
|
-
function
|
|
2498
|
+
function ua(e, n, t) {
|
|
2483
2499
|
const o = v(
|
|
2484
|
-
() => t.value ===
|
|
2500
|
+
() => t.value === B.HORIZONTAL
|
|
2485
2501
|
);
|
|
2486
2502
|
function l(i) {
|
|
2487
|
-
Math.min(...i.domain()) > 0 &&
|
|
2503
|
+
i || at(Ve.BarScaleNull), Math.min(...i.domain()) > 0 && at(Ve.BarScaleDomainAbove0);
|
|
2488
2504
|
}
|
|
2489
2505
|
const u = v(() => o.value ? (() => (l(e.value), e.value))() : e.value), a = v(() => o.value ? n.value : (() => (l(n.value), n.value))());
|
|
2490
2506
|
return { barXScale: u, barYScale: a };
|
|
2491
2507
|
}
|
|
2492
|
-
|
|
2508
|
+
const ra = {
|
|
2509
|
+
x: 0,
|
|
2510
|
+
y: 0,
|
|
2511
|
+
width: 0,
|
|
2512
|
+
height: 0
|
|
2513
|
+
};
|
|
2514
|
+
function ia(e, n, t, o, l, u) {
|
|
2493
2515
|
const a = v(
|
|
2494
|
-
() => o.value ===
|
|
2516
|
+
() => o.value === B.HORIZONTAL
|
|
2495
2517
|
);
|
|
2496
|
-
function i(r,
|
|
2497
|
-
let g,
|
|
2498
|
-
return a.value ? (g = r >= 0 ? n.value(0) : n.value(r),
|
|
2518
|
+
function i(r, m) {
|
|
2519
|
+
let g, p;
|
|
2520
|
+
return a.value ? (g = r >= 0 ? n.value(0) : n.value(r), p = t.value(t.value.domain()[m])) : (g = n.value(n.value.domain()[m]), p = r < 0 ? t.value(0) : t.value(r)), { x: g, y: p };
|
|
2499
2521
|
}
|
|
2500
2522
|
function s(r) {
|
|
2501
2523
|
return a.value ? r < 0 ? n.value(0) - n.value(r) : n.value(r) - n.value(0) : n.value.bandwidth();
|
|
@@ -2503,156 +2525,166 @@ function ul(e, n, t, o, l, u) {
|
|
|
2503
2525
|
function c(r) {
|
|
2504
2526
|
return a.value ? t.value.bandwidth() : r < 0 ? t.value(r) - t.value(0) : t.value(0) - t.value(r);
|
|
2505
2527
|
}
|
|
2506
|
-
function
|
|
2507
|
-
|
|
2528
|
+
function f(r, m, g) {
|
|
2529
|
+
if (!(n.value && t.value))
|
|
2530
|
+
return ra;
|
|
2531
|
+
const { value: b, color: L } = r, A = L ?? e.value[m].color ?? Re, { x: h, y: x } = i(b, g), N = s(b), D = c(b);
|
|
2508
2532
|
return {
|
|
2509
|
-
classList: [`lume-fill--${
|
|
2510
|
-
x:
|
|
2511
|
-
y:
|
|
2512
|
-
width:
|
|
2513
|
-
height:
|
|
2533
|
+
classList: [`lume-fill--${A}`, ...u],
|
|
2534
|
+
x: h,
|
|
2535
|
+
y: x,
|
|
2536
|
+
width: N,
|
|
2537
|
+
height: D,
|
|
2514
2538
|
isFaded: l.value !== -1 && l.value !== g,
|
|
2515
|
-
isNegative:
|
|
2539
|
+
isNegative: b < 0
|
|
2516
2540
|
};
|
|
2517
2541
|
}
|
|
2518
|
-
return { barAttributeGenerator:
|
|
2542
|
+
return { barAttributeGenerator: f };
|
|
2519
2543
|
}
|
|
2520
|
-
|
|
2544
|
+
const sa = {
|
|
2545
|
+
x: 0,
|
|
2546
|
+
y: 0,
|
|
2547
|
+
width: 0,
|
|
2548
|
+
height: 0
|
|
2549
|
+
};
|
|
2550
|
+
function ca(e, n, t, o, l, u) {
|
|
2521
2551
|
const a = v(
|
|
2522
|
-
() => o.value ===
|
|
2523
|
-
), i = v(() => He().domain(e.value.map((
|
|
2524
|
-
function c(
|
|
2552
|
+
() => o.value === B.HORIZONTAL
|
|
2553
|
+
), i = v(() => He().domain(e.value.map((p, b) => b)).range([0, n.value.bandwidth()]).padding(0)), s = v(() => He().domain(e.value.map((p, b) => b)).range([0, t.value.bandwidth()]).padding(0));
|
|
2554
|
+
function c(p, b, L) {
|
|
2525
2555
|
if (a.value)
|
|
2526
|
-
return
|
|
2527
|
-
const
|
|
2528
|
-
return n.value(
|
|
2556
|
+
return p >= 0 ? n.value(0) : n.value(p);
|
|
2557
|
+
const A = n.value.domain();
|
|
2558
|
+
return n.value(A[b]) + i.value(L);
|
|
2529
2559
|
}
|
|
2530
|
-
function p
|
|
2560
|
+
function f(p, b, L) {
|
|
2531
2561
|
if (a.value) {
|
|
2532
|
-
const
|
|
2533
|
-
return t.value(
|
|
2562
|
+
const A = t.value.domain();
|
|
2563
|
+
return t.value(A[b]) + s.value(L);
|
|
2534
2564
|
}
|
|
2535
|
-
return
|
|
2565
|
+
return p < 0 ? t.value(0) : t.value(p);
|
|
2536
2566
|
}
|
|
2537
|
-
function r(
|
|
2538
|
-
return a.value ?
|
|
2567
|
+
function r(p) {
|
|
2568
|
+
return a.value ? p < 0 ? n.value(0) - n.value(p) : n.value(p) - n.value(0) : i.value.bandwidth();
|
|
2539
2569
|
}
|
|
2540
|
-
function
|
|
2541
|
-
return a.value ? s.value.bandwidth() :
|
|
2570
|
+
function m(p) {
|
|
2571
|
+
return a.value ? s.value.bandwidth() : p < 0 ? t.value(p) - t.value(0) : t.value(0) - t.value(p);
|
|
2542
2572
|
}
|
|
2543
|
-
function g(
|
|
2544
|
-
|
|
2573
|
+
function g(p, b, L) {
|
|
2574
|
+
if (!(n.value && t.value))
|
|
2575
|
+
return sa;
|
|
2576
|
+
const { value: h, color: x } = p, N = x ?? e.value[b].color ?? Object.values(se)[b], D = c(h, L, b), P = f(h, L, b), w = r(h), H = m(h);
|
|
2545
2577
|
return {
|
|
2546
|
-
classList: [`lume-fill--${
|
|
2547
|
-
x:
|
|
2548
|
-
y:
|
|
2549
|
-
width:
|
|
2550
|
-
height:
|
|
2551
|
-
isFaded: l.value !== -1 && l.value !==
|
|
2552
|
-
isNegative:
|
|
2578
|
+
classList: [`lume-fill--${N}`, ...u],
|
|
2579
|
+
x: D,
|
|
2580
|
+
y: P,
|
|
2581
|
+
width: w,
|
|
2582
|
+
height: H,
|
|
2583
|
+
isFaded: l.value !== -1 && l.value !== L,
|
|
2584
|
+
isNegative: h < 0
|
|
2553
2585
|
};
|
|
2554
2586
|
}
|
|
2555
2587
|
return { barAttributeGenerator: g };
|
|
2556
2588
|
}
|
|
2557
|
-
function
|
|
2589
|
+
function da(e, n, t) {
|
|
2558
2590
|
const o = v(
|
|
2559
|
-
() => n.value ===
|
|
2591
|
+
() => n.value === B.HORIZONTAL
|
|
2560
2592
|
), l = v(() => {
|
|
2561
2593
|
const s = e.value.map(
|
|
2562
|
-
(c) => c.filter((
|
|
2594
|
+
(c) => c.filter((f) => f.value < 0).reduce((f, r) => f + r.value, 0)
|
|
2563
2595
|
);
|
|
2564
2596
|
return Math.min(...s);
|
|
2565
2597
|
}), u = v(() => {
|
|
2566
2598
|
const s = e.value.map(
|
|
2567
2599
|
(c) => c.reduce(
|
|
2568
|
-
(
|
|
2600
|
+
(f, r) => r.value >= 0 ? f + r.value : f,
|
|
2569
2601
|
0
|
|
2570
2602
|
)
|
|
2571
2603
|
);
|
|
2572
2604
|
return Math.max(...s);
|
|
2573
2605
|
});
|
|
2574
|
-
function a(s, c,
|
|
2575
|
-
return o.value ?
|
|
2576
|
-
|
|
2577
|
-
He().domain(c.map((r,
|
|
2606
|
+
function a(s, c, f) {
|
|
2607
|
+
return c.length ? o.value ? Be().domain([l.value, u.value]).range([0, f.width]) : Object.assign(
|
|
2608
|
+
Nt(
|
|
2609
|
+
He().domain(c.map((r, m) => m)).range([0, f.width]),
|
|
2578
2610
|
n.value,
|
|
2579
2611
|
t.value
|
|
2580
2612
|
),
|
|
2581
2613
|
{ labels: c }
|
|
2582
|
-
);
|
|
2614
|
+
) : null;
|
|
2583
2615
|
}
|
|
2584
|
-
function i(s, c,
|
|
2585
|
-
return o.value ? Object.assign(
|
|
2586
|
-
|
|
2587
|
-
He().domain(c.map((r,
|
|
2616
|
+
function i(s, c, f) {
|
|
2617
|
+
return c.length ? o.value ? Object.assign(
|
|
2618
|
+
Nt(
|
|
2619
|
+
He().domain(c.map((r, m) => m)).range([0, f.height]),
|
|
2588
2620
|
n.value,
|
|
2589
2621
|
t.value
|
|
2590
2622
|
),
|
|
2591
2623
|
{ labels: c }
|
|
2592
|
-
) :
|
|
2624
|
+
) : Be().domain([u.value, l.value]).range([0, f.height]) : null;
|
|
2593
2625
|
}
|
|
2594
2626
|
return { stackedXScaleGenerator: a, stackedYScaleGenerator: i };
|
|
2595
2627
|
}
|
|
2596
|
-
function
|
|
2628
|
+
function va(e, n, t, o, l, u) {
|
|
2597
2629
|
const a = v(
|
|
2598
|
-
() => o.value ===
|
|
2630
|
+
() => o.value === B.HORIZONTAL
|
|
2599
2631
|
), i = v(
|
|
2600
2632
|
() => a.value ? t.value.domain() : n.value.domain()
|
|
2601
2633
|
), s = v(
|
|
2602
|
-
() => e.value.map((
|
|
2634
|
+
() => e.value.map((A) => A.values.map((h) => h == null ? void 0 : h.value))
|
|
2603
2635
|
);
|
|
2604
|
-
function c(
|
|
2605
|
-
let N,
|
|
2606
|
-
return a.value ? (N = n.value(
|
|
2636
|
+
function c(A, h, x) {
|
|
2637
|
+
let N, D;
|
|
2638
|
+
return a.value ? (N = n.value(A >= 0 ? 0 + x : A + x), D = t.value(i.value[h])) : (N = n.value(i.value[h]), D = t.value(A >= 0 ? A + x : 0 + x)), { x: N, y: D };
|
|
2607
2639
|
}
|
|
2608
|
-
function
|
|
2609
|
-
return a.value ? n.value(
|
|
2640
|
+
function f(A) {
|
|
2641
|
+
return a.value ? n.value(A) - n.value(0) : n.value.bandwidth();
|
|
2610
2642
|
}
|
|
2611
|
-
function r(
|
|
2612
|
-
return a.value ? n.value(0) - n.value(
|
|
2643
|
+
function r(A) {
|
|
2644
|
+
return a.value ? n.value(0) - n.value(A) : n.value.bandwidth();
|
|
2613
2645
|
}
|
|
2614
|
-
function
|
|
2615
|
-
return a.value ? t.value.bandwidth() : t.value(0) - t.value(
|
|
2646
|
+
function m(A) {
|
|
2647
|
+
return a.value ? t.value.bandwidth() : t.value(0) - t.value(A);
|
|
2616
2648
|
}
|
|
2617
|
-
function g(
|
|
2618
|
-
return a.value ? t.value.bandwidth() : t.value(
|
|
2649
|
+
function g(A) {
|
|
2650
|
+
return a.value ? t.value.bandwidth() : t.value(A) - t.value(0);
|
|
2619
2651
|
}
|
|
2620
|
-
function
|
|
2621
|
-
return
|
|
2652
|
+
function p(A, h) {
|
|
2653
|
+
return A ? s.value.reduce((x, N, D) => (D < A && N[h] >= 0 && (x += N[h]), x), 0) : 0;
|
|
2622
2654
|
}
|
|
2623
|
-
function A
|
|
2624
|
-
return
|
|
2655
|
+
function b(A, h) {
|
|
2656
|
+
return A ? s.value.reduce((x, N, D) => (D < A && N[h] < 0 && (x += N[h]), x), 0) : 0;
|
|
2625
2657
|
}
|
|
2626
|
-
function
|
|
2627
|
-
const { value: N, color:
|
|
2658
|
+
function L(A, h, x) {
|
|
2659
|
+
const { value: N, color: D } = A, P = N >= 0 ? f(N) : r(N), w = N >= 0 ? m(N) : g(N), H = N >= 0 ? p(h, x) : b(h, x), { x: X, y: Y } = c(N, x, H);
|
|
2628
2660
|
return {
|
|
2629
|
-
classList: [`lume-fill--${
|
|
2630
|
-
width:
|
|
2661
|
+
classList: [`lume-fill--${D ?? e.value[h].color ?? Object.values(se)[h]}`, ...u],
|
|
2662
|
+
width: P,
|
|
2631
2663
|
height: w,
|
|
2632
|
-
x:
|
|
2633
|
-
y:
|
|
2634
|
-
isFaded: l.value !== -1 && l.value !==
|
|
2664
|
+
x: X,
|
|
2665
|
+
y: Y,
|
|
2666
|
+
isFaded: l.value !== -1 && l.value !== x,
|
|
2635
2667
|
isNegative: N < 0
|
|
2636
2668
|
};
|
|
2637
2669
|
}
|
|
2638
|
-
return { barAttributeGenerator:
|
|
2670
|
+
return { barAttributeGenerator: L };
|
|
2639
2671
|
}
|
|
2640
|
-
const
|
|
2672
|
+
const ma = {
|
|
2641
2673
|
class: "lume-bar-group",
|
|
2642
2674
|
"data-j-bars-group": ""
|
|
2643
|
-
},
|
|
2644
|
-
single:
|
|
2645
|
-
grouped:
|
|
2646
|
-
stacked:
|
|
2647
|
-
},
|
|
2675
|
+
}, fa = ["onMouseenter"], pa = {
|
|
2676
|
+
single: ia,
|
|
2677
|
+
grouped: ca,
|
|
2678
|
+
stacked: va
|
|
2679
|
+
}, ht = /* @__PURE__ */ U({
|
|
2648
2680
|
__name: "lume-bar-group",
|
|
2649
2681
|
props: {
|
|
2650
|
-
...
|
|
2682
|
+
...We(),
|
|
2651
2683
|
classList: {
|
|
2652
2684
|
type: [String, Array],
|
|
2653
2685
|
default: () => []
|
|
2654
2686
|
},
|
|
2655
|
-
...
|
|
2687
|
+
...la(!0),
|
|
2656
2688
|
transition: {
|
|
2657
2689
|
type: Boolean,
|
|
2658
2690
|
default: !0
|
|
@@ -2667,184 +2699,185 @@ const cl = {
|
|
|
2667
2699
|
transition: i,
|
|
2668
2700
|
type: s,
|
|
2669
2701
|
xScale: c,
|
|
2670
|
-
yScale:
|
|
2702
|
+
yScale: f,
|
|
2671
2703
|
classList: r,
|
|
2672
|
-
labels:
|
|
2673
|
-
} =
|
|
2674
|
-
|
|
2675
|
-
const { emitInternalEvent: g } =
|
|
2676
|
-
const
|
|
2704
|
+
labels: m
|
|
2705
|
+
} = te(t);
|
|
2706
|
+
Pe("chartID");
|
|
2707
|
+
const { emitInternalEvent: g } = ye(), { groupedData: p } = ln(l, m), { barXScale: b, barYScale: L } = ua(c, f, a), A = v(() => typeof r.value == "string" ? [r.value] : r.value), h = v(() => {
|
|
2708
|
+
const D = aa(l, s), { barAttributeGenerator: P } = pa[D](
|
|
2677
2709
|
l,
|
|
2678
|
-
|
|
2679
|
-
|
|
2710
|
+
b,
|
|
2711
|
+
L,
|
|
2680
2712
|
a,
|
|
2681
2713
|
u,
|
|
2682
|
-
|
|
2714
|
+
A.value
|
|
2683
2715
|
);
|
|
2684
|
-
return
|
|
2685
|
-
}),
|
|
2716
|
+
return P;
|
|
2717
|
+
}), x = v(() => {
|
|
2686
2718
|
if (i.value)
|
|
2687
|
-
return a.value ===
|
|
2719
|
+
return a.value === B.HORIZONTAL ? "width" : "height";
|
|
2688
2720
|
});
|
|
2689
|
-
async function N(
|
|
2690
|
-
o("lume__internal--hover",
|
|
2721
|
+
async function N(D) {
|
|
2722
|
+
o("lume__internal--hover", D), g("lume__internal--hover", D);
|
|
2691
2723
|
}
|
|
2692
|
-
return (
|
|
2693
|
-
(
|
|
2694
|
-
key:
|
|
2695
|
-
onMouseenter: (
|
|
2724
|
+
return (D, P) => (y(), $("g", ma, [
|
|
2725
|
+
(y(!0), $(q, null, z(d(p), (w, H) => (y(), $("g", {
|
|
2726
|
+
key: H,
|
|
2727
|
+
onMouseenter: (X) => N(H)
|
|
2696
2728
|
}, [
|
|
2697
|
-
(
|
|
2698
|
-
key: `bar-${
|
|
2699
|
-
transition:
|
|
2729
|
+
(y(!0), $(q, null, z(w, (X, Y) => (y(), K(d(mt), G(h.value(X, Y, H, w), {
|
|
2730
|
+
key: `bar-${Y}`,
|
|
2731
|
+
transition: x.value,
|
|
2700
2732
|
"data-j-lume-bar": "",
|
|
2701
|
-
onClick: (
|
|
2702
|
-
index:
|
|
2703
|
-
datasetIndex:
|
|
2704
|
-
event:
|
|
2733
|
+
onClick: (Q) => o("bar-click", {
|
|
2734
|
+
index: H,
|
|
2735
|
+
datasetIndex: Y,
|
|
2736
|
+
event: Q
|
|
2705
2737
|
})
|
|
2706
2738
|
}), null, 16, ["transition", "onClick"]))), 128))
|
|
2707
|
-
], 40,
|
|
2739
|
+
], 40, fa))), 128))
|
|
2708
2740
|
]));
|
|
2709
2741
|
}
|
|
2710
|
-
}),
|
|
2711
|
-
[
|
|
2742
|
+
}), ha = {
|
|
2743
|
+
[B.VERTICAL]: {
|
|
2712
2744
|
withTooltip: !0,
|
|
2713
2745
|
xAxisOptions: {},
|
|
2714
2746
|
yAxisOptions: { gridLines: !0 },
|
|
2715
|
-
margins:
|
|
2747
|
+
margins: Te.VERTICAL
|
|
2716
2748
|
},
|
|
2717
|
-
[
|
|
2749
|
+
[B.HORIZONTAL]: {
|
|
2718
2750
|
withTooltip: !0,
|
|
2719
2751
|
xAxisOptions: { gridLines: !0 },
|
|
2720
2752
|
yAxisOptions: { gridLines: !1 },
|
|
2721
|
-
margins:
|
|
2753
|
+
margins: Te.HORIZONTAL
|
|
2722
2754
|
}
|
|
2723
|
-
},
|
|
2755
|
+
}, Za = /* @__PURE__ */ U({
|
|
2724
2756
|
__name: "lume-single-bar-chart",
|
|
2725
2757
|
props: {
|
|
2726
|
-
...Ne(
|
|
2758
|
+
...Ne(it)
|
|
2727
2759
|
},
|
|
2728
2760
|
setup(e, { emit: n }) {
|
|
2729
|
-
const t = e, { componentEventPropagator: o } =
|
|
2730
|
-
() =>
|
|
2761
|
+
const t = e, { componentEventPropagator: o } = ye(), l = Le(re()), { orientation: u, options: a } = te(t), i = v(
|
|
2762
|
+
() => ha[u.value || B.VERTICAL]
|
|
2731
2763
|
// needs to be computed so that default options are reactive
|
|
2732
|
-
), { allOptions: s } =
|
|
2733
|
-
return (c,
|
|
2764
|
+
), { allOptions: s } = me(a, i);
|
|
2765
|
+
return (c, f) => (y(), K(d(De), G(t, {
|
|
2734
2766
|
"chart-type": "single-bar",
|
|
2735
2767
|
options: d(s),
|
|
2736
2768
|
"data-j-single-bar-chart": ""
|
|
2737
|
-
}, le(d(o))),
|
|
2769
|
+
}, le(d(o))), ce({
|
|
2738
2770
|
groups: V((r) => [
|
|
2739
|
-
|
|
2771
|
+
ie(d(ht), G(r, { orientation: d(u) }, le(d(o))), null, 16, ["orientation"])
|
|
2740
2772
|
]),
|
|
2741
2773
|
_: 2
|
|
2742
2774
|
}, [
|
|
2743
|
-
|
|
2744
|
-
name:
|
|
2775
|
+
z(d(l), (r, m) => ({
|
|
2776
|
+
name: m,
|
|
2745
2777
|
fn: V((g) => [
|
|
2746
|
-
|
|
2778
|
+
R(c.$slots, m, pe(he(g || {})))
|
|
2747
2779
|
])
|
|
2748
2780
|
}))
|
|
2749
2781
|
]), 1040, ["options"]));
|
|
2750
2782
|
}
|
|
2751
|
-
}),
|
|
2752
|
-
[
|
|
2783
|
+
}), ga = {
|
|
2784
|
+
[B.VERTICAL]: {
|
|
2753
2785
|
withTooltip: !0,
|
|
2754
2786
|
xAxisOptions: {},
|
|
2755
2787
|
yAxisOptions: { gridLines: !0 },
|
|
2756
|
-
margins:
|
|
2788
|
+
margins: Te.VERTICAL
|
|
2757
2789
|
},
|
|
2758
|
-
[
|
|
2790
|
+
[B.HORIZONTAL]: {
|
|
2759
2791
|
withTooltip: !0,
|
|
2760
2792
|
xAxisOptions: { gridLines: !0 },
|
|
2761
2793
|
yAxisOptions: { gridLines: !1 },
|
|
2762
|
-
margins:
|
|
2794
|
+
margins: Te.HORIZONTAL,
|
|
2763
2795
|
tooltipOptions: { position: "right" }
|
|
2764
2796
|
}
|
|
2765
|
-
},
|
|
2797
|
+
}, Ua = /* @__PURE__ */ U({
|
|
2766
2798
|
__name: "lume-grouped-bar-chart",
|
|
2767
2799
|
props: {
|
|
2768
2800
|
...Ne()
|
|
2769
2801
|
},
|
|
2770
2802
|
setup(e, { emit: n }) {
|
|
2771
|
-
const t = e, { componentEventPropagator: o } =
|
|
2772
|
-
() =>
|
|
2803
|
+
const t = e, { componentEventPropagator: o } = ye(), l = Le(re()), { orientation: u, options: a } = te(t), i = v(
|
|
2804
|
+
() => ga[u.value || B.VERTICAL]
|
|
2773
2805
|
// needs to be computed so that default options are reactive
|
|
2774
|
-
), { allOptions: s } =
|
|
2806
|
+
), { allOptions: s } = me(
|
|
2775
2807
|
a,
|
|
2776
2808
|
i
|
|
2777
2809
|
);
|
|
2778
|
-
return (c,
|
|
2810
|
+
return (c, f) => (y(), K(d(De), G(t, {
|
|
2779
2811
|
"chart-type": "grouped-bar",
|
|
2780
2812
|
options: d(s),
|
|
2781
2813
|
"data-j-grouped-bar-chart": ""
|
|
2782
|
-
}, le(d(o))),
|
|
2814
|
+
}, le(d(o))), ce({
|
|
2783
2815
|
groups: V((r) => [
|
|
2784
|
-
|
|
2816
|
+
ie(d(ht), G(r, { type: "grouped" }, le(d(o))), null, 16)
|
|
2785
2817
|
]),
|
|
2786
2818
|
_: 2
|
|
2787
2819
|
}, [
|
|
2788
|
-
|
|
2789
|
-
name:
|
|
2820
|
+
z(d(l), (r, m) => ({
|
|
2821
|
+
name: m,
|
|
2790
2822
|
fn: V((g) => [
|
|
2791
|
-
|
|
2823
|
+
R(c.$slots, m, pe(he(g || {})))
|
|
2792
2824
|
])
|
|
2793
2825
|
}))
|
|
2794
2826
|
]), 1040, ["options"]));
|
|
2795
2827
|
}
|
|
2796
|
-
}),
|
|
2797
|
-
[
|
|
2828
|
+
}), _a = {
|
|
2829
|
+
[B.VERTICAL]: {
|
|
2798
2830
|
withTooltip: !0,
|
|
2799
2831
|
xAxisOptions: {},
|
|
2800
2832
|
yAxisOptions: { gridLines: !0 },
|
|
2801
|
-
margins:
|
|
2833
|
+
margins: Te.VERTICAL,
|
|
2834
|
+
tooltipOptions: { inverse: !0 }
|
|
2802
2835
|
},
|
|
2803
|
-
[
|
|
2836
|
+
[B.HORIZONTAL]: {
|
|
2804
2837
|
withTooltip: !0,
|
|
2805
2838
|
xAxisOptions: { gridLines: !0 },
|
|
2806
2839
|
yAxisOptions: { gridLines: !1 },
|
|
2807
|
-
margins:
|
|
2808
|
-
tooltipOptions: { position: "right" }
|
|
2840
|
+
margins: Te.HORIZONTAL,
|
|
2841
|
+
tooltipOptions: { position: "right", inverse: !0 }
|
|
2809
2842
|
}
|
|
2810
|
-
},
|
|
2843
|
+
}, Xa = /* @__PURE__ */ U({
|
|
2811
2844
|
__name: "lume-stacked-bar-chart",
|
|
2812
2845
|
props: {
|
|
2813
2846
|
...Ne()
|
|
2814
2847
|
},
|
|
2815
2848
|
setup(e, { emit: n }) {
|
|
2816
|
-
const t = e, { componentEventPropagator: o } =
|
|
2817
|
-
() =>
|
|
2849
|
+
const t = e, { componentEventPropagator: o } = ye(), l = Le(re()), { data: u, orientation: a, options: i, labels: s } = te(t), c = v(
|
|
2850
|
+
() => _a[a.value || B.VERTICAL]
|
|
2818
2851
|
// needs to be computed so that default options are reactive
|
|
2819
|
-
), { allOptions:
|
|
2852
|
+
), { allOptions: f } = me(
|
|
2820
2853
|
i,
|
|
2821
2854
|
c
|
|
2822
|
-
), { internalData: r } =
|
|
2823
|
-
|
|
2855
|
+
), { internalData: r } = pt(u), { groupedData: m } = ln(r, s), { stackedXScaleGenerator: g, stackedYScaleGenerator: p } = da(
|
|
2856
|
+
m,
|
|
2824
2857
|
a,
|
|
2825
2858
|
i
|
|
2826
|
-
);
|
|
2827
|
-
return (A,
|
|
2859
|
+
), b = v(() => t.xScale || g), L = v(() => t.yScale || p);
|
|
2860
|
+
return (A, h) => (y(), K(d(De), G(t, {
|
|
2828
2861
|
"chart-type": "stacked-bar",
|
|
2829
|
-
options: d(
|
|
2830
|
-
"x-scale":
|
|
2831
|
-
"y-scale":
|
|
2862
|
+
options: d(f),
|
|
2863
|
+
"x-scale": b.value,
|
|
2864
|
+
"y-scale": L.value,
|
|
2832
2865
|
"data-j-stacked-bar-chart": ""
|
|
2833
|
-
}, le(d(o))),
|
|
2834
|
-
groups: V((
|
|
2835
|
-
|
|
2866
|
+
}, le(d(o))), ce({
|
|
2867
|
+
groups: V((x) => [
|
|
2868
|
+
ie(d(ht), G(x, { type: "stacked" }, le(d(o))), null, 16)
|
|
2836
2869
|
]),
|
|
2837
2870
|
_: 2
|
|
2838
2871
|
}, [
|
|
2839
|
-
|
|
2840
|
-
name:
|
|
2841
|
-
fn: V((
|
|
2842
|
-
|
|
2872
|
+
z(d(l), (x, N) => ({
|
|
2873
|
+
name: N,
|
|
2874
|
+
fn: V((D) => [
|
|
2875
|
+
R(A.$slots, N, pe(he(D || {})))
|
|
2843
2876
|
])
|
|
2844
2877
|
}))
|
|
2845
2878
|
]), 1040, ["options", "x-scale", "y-scale"]));
|
|
2846
2879
|
}
|
|
2847
|
-
}),
|
|
2880
|
+
}), ya = ["d", "stroke-width"], ka = 2, ba = /* @__PURE__ */ U({
|
|
2848
2881
|
__name: "lume-line",
|
|
2849
2882
|
props: {
|
|
2850
2883
|
pathDefinition: {
|
|
@@ -2853,11 +2886,11 @@ const cl = {
|
|
|
2853
2886
|
},
|
|
2854
2887
|
width: {
|
|
2855
2888
|
type: Number,
|
|
2856
|
-
default:
|
|
2889
|
+
default: ka
|
|
2857
2890
|
},
|
|
2858
2891
|
color: {
|
|
2859
2892
|
type: String,
|
|
2860
|
-
default:
|
|
2893
|
+
default: se.Skyblue
|
|
2861
2894
|
},
|
|
2862
2895
|
dashed: {
|
|
2863
2896
|
type: Boolean,
|
|
@@ -2878,38 +2911,38 @@ const cl = {
|
|
|
2878
2911
|
},
|
|
2879
2912
|
emits: ["click"],
|
|
2880
2913
|
setup(e, { emit: n }) {
|
|
2881
|
-
const t = n, o =
|
|
2882
|
-
return
|
|
2914
|
+
const t = n, o = S(null);
|
|
2915
|
+
return _e(() => ze(o.value)), (l, u) => (y(), $("path", {
|
|
2883
2916
|
ref_key: "root",
|
|
2884
2917
|
ref: o,
|
|
2885
|
-
class:
|
|
2918
|
+
class: ne(["lume-line", {
|
|
2886
2919
|
[`lume-stroke--${e.color}`]: !0,
|
|
2887
2920
|
"lume-line--dashed": e.dashed,
|
|
2888
2921
|
"lume-line--transition": e.transition
|
|
2889
2922
|
}]),
|
|
2890
2923
|
d: e.pathDefinition,
|
|
2891
2924
|
"stroke-width": e.width,
|
|
2892
|
-
style:
|
|
2925
|
+
style: Gt({
|
|
2893
2926
|
animationDelay: e.transition && e.animationDelay + "s",
|
|
2894
2927
|
animationDuration: e.transition && e.animationDuration + "s"
|
|
2895
2928
|
}),
|
|
2896
2929
|
"data-j-line": "",
|
|
2897
2930
|
onClick: u[0] || (u[0] = (a) => t("click", a))
|
|
2898
|
-
}, null, 14,
|
|
2931
|
+
}, null, 14, ya));
|
|
2899
2932
|
}
|
|
2900
2933
|
});
|
|
2901
|
-
const
|
|
2934
|
+
const Aa = /* @__PURE__ */ ee(ba, [["__scopeId", "data-v-08896455"]]), Ta = ["cx", "cy", "r", "stroke-width"], La = 4, Oa = /* @__PURE__ */ U({
|
|
2902
2935
|
__name: "lume-point",
|
|
2903
2936
|
props: {
|
|
2904
2937
|
x: { type: Number, required: !0 },
|
|
2905
2938
|
y: { type: Number, required: !0 },
|
|
2906
2939
|
color: {
|
|
2907
2940
|
type: String,
|
|
2908
|
-
default:
|
|
2941
|
+
default: se.Skyblue
|
|
2909
2942
|
},
|
|
2910
2943
|
radius: {
|
|
2911
2944
|
type: Number,
|
|
2912
|
-
default:
|
|
2945
|
+
default: La
|
|
2913
2946
|
},
|
|
2914
2947
|
active: {
|
|
2915
2948
|
type: Boolean,
|
|
@@ -2918,22 +2951,22 @@ const yl = /* @__PURE__ */ te(_l, [["__scopeId", "data-v-08896455"]]), kl = ["cx
|
|
|
2918
2951
|
},
|
|
2919
2952
|
emits: ["click"],
|
|
2920
2953
|
setup(e, { emit: n }) {
|
|
2921
|
-
const t = e, o = n, l =
|
|
2922
|
-
return
|
|
2954
|
+
const t = e, o = n, l = S(null), u = v(() => t.radius / 2);
|
|
2955
|
+
return _e(() => ze(l.value)), (a, i) => (y(), $("circle", {
|
|
2923
2956
|
ref_key: "root",
|
|
2924
2957
|
ref: l,
|
|
2925
|
-
class:
|
|
2958
|
+
class: ne(["lume-point", `lume-stroke--${e.color}`]),
|
|
2926
2959
|
cx: e.x,
|
|
2927
2960
|
cy: e.y,
|
|
2928
2961
|
r: e.active ? e.radius : 0,
|
|
2929
2962
|
"stroke-width": u.value,
|
|
2930
2963
|
"data-j-point": "",
|
|
2931
2964
|
onClick: i[0] || (i[0] = (s) => o("click", s))
|
|
2932
|
-
}, null, 10,
|
|
2965
|
+
}, null, 10, Ta));
|
|
2933
2966
|
}
|
|
2934
2967
|
});
|
|
2935
|
-
const
|
|
2936
|
-
function
|
|
2968
|
+
const xa = /* @__PURE__ */ ee(Oa, [["__scopeId", "data-v-b6745177"]]);
|
|
2969
|
+
function an(e) {
|
|
2937
2970
|
function n(u) {
|
|
2938
2971
|
let a = null;
|
|
2939
2972
|
return u == null ? void 0 : u.reduce((i, s, c) => (s == null || s.value == null ? (a ? a.push(c) : a = [c], c === (u == null ? void 0 : u.length) - 1 && i.push(a)) : a && (i.push(a), a = null), i), []);
|
|
@@ -2955,21 +2988,21 @@ function on(e) {
|
|
|
2955
2988
|
...u,
|
|
2956
2989
|
isDashed: o(a),
|
|
2957
2990
|
values: u.values.map((i, s) => {
|
|
2958
|
-
var
|
|
2991
|
+
var f, r;
|
|
2959
2992
|
const c = a.find(
|
|
2960
|
-
(
|
|
2993
|
+
(m) => m.includes(s)
|
|
2961
2994
|
);
|
|
2962
2995
|
if (c) {
|
|
2963
|
-
const
|
|
2964
|
-
let
|
|
2965
|
-
return
|
|
2996
|
+
const m = c[0] - 1, g = c[c.length - 1] + 1;
|
|
2997
|
+
let p = (f = u.values[m]) == null ? void 0 : f.value, b = (r = u.values[g]) == null ? void 0 : r.value;
|
|
2998
|
+
return p == null && (p = b), b == null && (b = p), {
|
|
2966
2999
|
value: t(
|
|
2967
|
-
|
|
2968
|
-
|
|
3000
|
+
p,
|
|
3001
|
+
b,
|
|
2969
3002
|
c.length,
|
|
2970
3003
|
c.indexOf(s)
|
|
2971
3004
|
),
|
|
2972
|
-
label:
|
|
3005
|
+
label: Ut
|
|
2973
3006
|
};
|
|
2974
3007
|
}
|
|
2975
3008
|
return i;
|
|
@@ -2977,30 +3010,30 @@ function on(e) {
|
|
|
2977
3010
|
};
|
|
2978
3011
|
})) };
|
|
2979
3012
|
}
|
|
2980
|
-
function
|
|
3013
|
+
function $a(e, n) {
|
|
2981
3014
|
const t = e.bandwidth() / 2;
|
|
2982
3015
|
return (o, l) => e(e.domain()[n + (l - 1)]) + t;
|
|
2983
3016
|
}
|
|
2984
|
-
function
|
|
3017
|
+
function Ia(e, n) {
|
|
2985
3018
|
return (t, o) => e(n + (o - 1));
|
|
2986
3019
|
}
|
|
2987
|
-
function
|
|
2988
|
-
const l =
|
|
2989
|
-
|
|
3020
|
+
function wa(e, n, t, o) {
|
|
3021
|
+
const l = _n().x(
|
|
3022
|
+
de(t) ? $a(t, e) : Ia(t, e)
|
|
2990
3023
|
).y((u) => o(u));
|
|
2991
3024
|
return n.every((u) => u == null) ? null : l(n);
|
|
2992
3025
|
}
|
|
2993
|
-
const
|
|
3026
|
+
const Ea = {
|
|
2994
3027
|
class: "lume-line-group",
|
|
2995
3028
|
"data-j-lume-line-group": ""
|
|
2996
|
-
},
|
|
3029
|
+
}, Na = { class: "lume-line-group__lines" }, Da = {
|
|
2997
3030
|
key: 0,
|
|
2998
3031
|
class: "lume-line-group__points",
|
|
2999
3032
|
"data-j-lume-line-group__points": ""
|
|
3000
|
-
},
|
|
3033
|
+
}, Ha = 1, Ba = /* @__PURE__ */ U({
|
|
3001
3034
|
__name: "lume-line-group",
|
|
3002
3035
|
props: {
|
|
3003
|
-
...
|
|
3036
|
+
...We(),
|
|
3004
3037
|
withPoints: {
|
|
3005
3038
|
type: Boolean,
|
|
3006
3039
|
default: !0
|
|
@@ -3012,58 +3045,58 @@ const $l = {
|
|
|
3012
3045
|
},
|
|
3013
3046
|
emits: ["line-click", "point-click", "lume__internal--hover"],
|
|
3014
3047
|
setup(e, { emit: n }) {
|
|
3015
|
-
const t = e, o = n, { data: l, options: u, xScale: a, yScale: i, labels: s } =
|
|
3048
|
+
const t = e, o = n, { data: l, options: u, xScale: a, yScale: i, labels: s } = te(t), c = Pe(
|
|
3016
3049
|
"tooltipAnchorAttributes",
|
|
3017
3050
|
null
|
|
3018
|
-
), { updateTooltipAnchorAttributes:
|
|
3051
|
+
), { updateTooltipAnchorAttributes: f } = tn(
|
|
3019
3052
|
c,
|
|
3020
3053
|
u,
|
|
3021
3054
|
a,
|
|
3022
3055
|
i,
|
|
3023
3056
|
s
|
|
3024
3057
|
), r = v(() => {
|
|
3025
|
-
if (l.value.every((
|
|
3058
|
+
if (l.value.every((H) => H.isDashed))
|
|
3026
3059
|
return l.value;
|
|
3027
|
-
const { computedLineData: w } =
|
|
3028
|
-
return u.value.withTooltip !== !1 && (c != null && c.value) &&
|
|
3029
|
-
}),
|
|
3060
|
+
const { computedLineData: w } = an(l);
|
|
3061
|
+
return u.value.withTooltip !== !1 && (c != null && c.value) && f(w.value), w.value;
|
|
3062
|
+
}), m = v(() => {
|
|
3030
3063
|
if (t.hoveredIndex === -1)
|
|
3031
3064
|
return;
|
|
3032
|
-
const w =
|
|
3065
|
+
const w = Nn(
|
|
3033
3066
|
r.value,
|
|
3034
3067
|
t.hoveredIndex
|
|
3035
3068
|
);
|
|
3036
3069
|
return {
|
|
3037
|
-
d: `M ${
|
|
3070
|
+
d: `M ${et(a.value, t.hoveredIndex)},${i.value.range()[1]}
|
|
3038
3071
|
V ${i.value(w)}`
|
|
3039
3072
|
// Move to X index, Vertical line to the highest point
|
|
3040
3073
|
};
|
|
3041
3074
|
}), g = v(
|
|
3042
|
-
() => a.value &&
|
|
3075
|
+
() => a.value && Ha / (Dn(a.value) - 1)
|
|
3043
3076
|
// Subtracting the first line (read below)
|
|
3044
|
-
),
|
|
3077
|
+
), p = v(
|
|
3045
3078
|
() => {
|
|
3046
3079
|
var w;
|
|
3047
3080
|
return ((w = u.value) == null ? void 0 : w.lineWidth) * 2 || void 0;
|
|
3048
3081
|
}
|
|
3049
3082
|
// If no `lineWidth`, returns NaN which needs to be undefined
|
|
3050
|
-
),
|
|
3083
|
+
), b = v(
|
|
3051
3084
|
() => a.value.bandwidth() / 2
|
|
3052
|
-
),
|
|
3085
|
+
), L = v(() => a.value.domain()), A = v(
|
|
3053
3086
|
() => u.value.withPoints ?? t.withPoints
|
|
3054
3087
|
);
|
|
3055
|
-
function
|
|
3088
|
+
function h(w) {
|
|
3056
3089
|
return r.value[w].values;
|
|
3057
3090
|
}
|
|
3058
|
-
function
|
|
3059
|
-
var
|
|
3060
|
-
const
|
|
3061
|
-
(
|
|
3062
|
-
(
|
|
3091
|
+
function x(w, H) {
|
|
3092
|
+
var Y, Q;
|
|
3093
|
+
const X = w === 0 ? [] : [
|
|
3094
|
+
(Y = h(H)[w - 1]) == null ? void 0 : Y.value,
|
|
3095
|
+
(Q = h(H)[w]) == null ? void 0 : Q.value
|
|
3063
3096
|
];
|
|
3064
|
-
return
|
|
3097
|
+
return wa(
|
|
3065
3098
|
w,
|
|
3066
|
-
|
|
3099
|
+
X,
|
|
3067
3100
|
a.value,
|
|
3068
3101
|
i.value
|
|
3069
3102
|
) || "";
|
|
@@ -3074,94 +3107,94 @@ const $l = {
|
|
|
3074
3107
|
animationDuration: g.value
|
|
3075
3108
|
};
|
|
3076
3109
|
}
|
|
3077
|
-
function
|
|
3078
|
-
var
|
|
3079
|
-
const
|
|
3110
|
+
function D(w, H) {
|
|
3111
|
+
var Y;
|
|
3112
|
+
const X = (Y = h(H)[w]) == null ? void 0 : Y.value;
|
|
3080
3113
|
return {
|
|
3081
|
-
x:
|
|
3082
|
-
y:
|
|
3114
|
+
x: de(a.value) ? t.xScale(L.value[w]) + b.value : t.xScale(w),
|
|
3115
|
+
y: X === null ? i.value(i.value.domain()[1]) : i.value(X)
|
|
3083
3116
|
};
|
|
3084
3117
|
}
|
|
3085
|
-
function
|
|
3118
|
+
function P(w) {
|
|
3086
3119
|
return t.hoveredIndex === w;
|
|
3087
3120
|
}
|
|
3088
|
-
return (w,
|
|
3089
|
-
|
|
3121
|
+
return (w, H) => (y(), $("g", Ea, [
|
|
3122
|
+
C("path", G(m.value, {
|
|
3090
3123
|
class: "lume-line-group__overlay-line",
|
|
3091
3124
|
"data-j-lume-line-group__overlay-line": ""
|
|
3092
3125
|
}), null, 16),
|
|
3093
|
-
(
|
|
3094
|
-
key:
|
|
3126
|
+
(y(!0), $(q, null, z(r.value, (X, Y) => (y(), $("g", {
|
|
3127
|
+
key: X.label,
|
|
3095
3128
|
class: "lume-line-group__group"
|
|
3096
3129
|
}, [
|
|
3097
|
-
|
|
3098
|
-
(
|
|
3099
|
-
key: `line-${
|
|
3100
|
-
color:
|
|
3101
|
-
dashed:
|
|
3102
|
-
"path-definition":
|
|
3130
|
+
C("g", Na, [
|
|
3131
|
+
(y(!0), $(q, null, z(X.values, (Q, F) => (y(), K(d(Aa), G(N(F), {
|
|
3132
|
+
key: `line-${F}`,
|
|
3133
|
+
color: X.color,
|
|
3134
|
+
dashed: X.isDashed(F),
|
|
3135
|
+
"path-definition": x(F, Y),
|
|
3103
3136
|
transition: e.transition,
|
|
3104
3137
|
width: d(u).lineWidth,
|
|
3105
|
-
onClick: (
|
|
3138
|
+
onClick: (ue) => o("line-click", { index: F, datasetIndex: Y, event: ue })
|
|
3106
3139
|
}), null, 16, ["color", "dashed", "path-definition", "transition", "width", "onClick"]))), 128))
|
|
3107
3140
|
]),
|
|
3108
|
-
|
|
3109
|
-
(
|
|
3110
|
-
key: `point-${
|
|
3111
|
-
active: F
|
|
3112
|
-
color:
|
|
3113
|
-
index:
|
|
3114
|
-
radius:
|
|
3115
|
-
onClick: (
|
|
3141
|
+
A.value ? (y(), $("g", Da, [
|
|
3142
|
+
(y(!0), $(q, null, z(X.values, (Q, F) => (y(), K(d(xa), G(D(F, Y), {
|
|
3143
|
+
key: `point-${F}`,
|
|
3144
|
+
active: P(F),
|
|
3145
|
+
color: X.color,
|
|
3146
|
+
index: F,
|
|
3147
|
+
radius: p.value,
|
|
3148
|
+
onClick: (ue) => o("point-click", { index: F, datasetIndex: Y, event: ue })
|
|
3116
3149
|
}), null, 16, ["active", "color", "index", "radius", "onClick"]))), 128))
|
|
3117
|
-
])) :
|
|
3150
|
+
])) : W("", !0)
|
|
3118
3151
|
]))), 128))
|
|
3119
3152
|
]));
|
|
3120
3153
|
}
|
|
3121
3154
|
});
|
|
3122
|
-
const
|
|
3123
|
-
margins:
|
|
3155
|
+
const un = /* @__PURE__ */ ee(Ba, [["__scopeId", "data-v-44ba7be1"]]), Ma = {
|
|
3156
|
+
margins: Te.VERTICAL,
|
|
3124
3157
|
startOnZero: !0,
|
|
3125
3158
|
withTooltip: !0,
|
|
3126
3159
|
xAxisOptions: {},
|
|
3127
3160
|
yAxisOptions: { gridLines: !0 }
|
|
3128
|
-
},
|
|
3161
|
+
}, Ya = /* @__PURE__ */ U({
|
|
3129
3162
|
__name: "lume-line-chart",
|
|
3130
3163
|
props: {
|
|
3131
3164
|
...Ne(null, !1)
|
|
3132
3165
|
},
|
|
3133
3166
|
setup(e, { emit: n }) {
|
|
3134
|
-
const t = e, { componentEventPropagator: o } =
|
|
3135
|
-
return (i, s) => (
|
|
3167
|
+
const t = e, { componentEventPropagator: o } = ye(), l = Le(re()), { options: u } = te(t), { allOptions: a } = me(u, Ma);
|
|
3168
|
+
return (i, s) => (y(), K(d(De), G(t, {
|
|
3136
3169
|
"chart-type": "line",
|
|
3137
3170
|
options: d(a),
|
|
3138
3171
|
"data-j-lume-line-chart": ""
|
|
3139
|
-
}, le(d(o))),
|
|
3172
|
+
}, le(d(o))), ce({
|
|
3140
3173
|
groups: V((c) => [
|
|
3141
|
-
|
|
3174
|
+
ie(d(un), G(c, le(d(o))), null, 16)
|
|
3142
3175
|
]),
|
|
3143
3176
|
_: 2
|
|
3144
3177
|
}, [
|
|
3145
|
-
|
|
3146
|
-
name:
|
|
3178
|
+
z(d(l), (c, f) => ({
|
|
3179
|
+
name: f,
|
|
3147
3180
|
fn: V((r) => [
|
|
3148
|
-
|
|
3181
|
+
R(i.$slots, f, pe(he(r || {})))
|
|
3149
3182
|
])
|
|
3150
3183
|
}))
|
|
3151
3184
|
]), 1040, ["options"]));
|
|
3152
3185
|
}
|
|
3153
3186
|
});
|
|
3154
|
-
function
|
|
3187
|
+
function Sa(e) {
|
|
3155
3188
|
return { areaPathDefinition: v(
|
|
3156
3189
|
() => function(t, o) {
|
|
3157
|
-
if (!t || !o ||
|
|
3190
|
+
if (!t || !o || de(t) || de(o))
|
|
3158
3191
|
return;
|
|
3159
3192
|
const l = e.value[0].values;
|
|
3160
|
-
return
|
|
3193
|
+
return yn().x((u, a) => t(a)).y0(o(Math.min(...o.domain()))).y1((u) => o(u.value))(l);
|
|
3161
3194
|
}
|
|
3162
3195
|
) };
|
|
3163
3196
|
}
|
|
3164
|
-
const
|
|
3197
|
+
const Ra = {
|
|
3165
3198
|
margins: {
|
|
3166
3199
|
top: 0,
|
|
3167
3200
|
right: 0,
|
|
@@ -3175,82 +3208,89 @@ const Ml = {
|
|
|
3175
3208
|
tooltipOptions: {
|
|
3176
3209
|
showTitle: !1
|
|
3177
3210
|
}
|
|
3178
|
-
},
|
|
3211
|
+
}, Ca = ["d"], Ga = /* @__PURE__ */ U({
|
|
3179
3212
|
__name: "lume-sparkline-chart",
|
|
3180
3213
|
props: {
|
|
3181
|
-
...
|
|
3182
|
-
...
|
|
3214
|
+
...ft(null),
|
|
3215
|
+
...Me()
|
|
3183
3216
|
},
|
|
3184
3217
|
setup(e, { expose: n, emit: t }) {
|
|
3185
|
-
const o = e, { componentEventPropagator: l } =
|
|
3186
|
-
|
|
3218
|
+
const o = e, { componentEventPropagator: l } = ye(), u = Le(re()), { data: a, options: i } = te(o), { internalData: s } = pt(a), { allOptions: c } = me(i, Ra), { computedLineData: f } = an(s), { areaPathDefinition: r } = Sa(f), m = v(() => {
|
|
3219
|
+
var L, A;
|
|
3220
|
+
return (A = (L = s.value) == null ? void 0 : L[0]) == null ? void 0 : A.color;
|
|
3221
|
+
}), g = v(
|
|
3222
|
+
() => {
|
|
3223
|
+
var L, A;
|
|
3224
|
+
return ((A = (L = a.value) == null ? void 0 : L[0]) == null ? void 0 : A.areaColor) || m.value;
|
|
3225
|
+
}
|
|
3187
3226
|
);
|
|
3188
|
-
function
|
|
3227
|
+
function p(L) {
|
|
3189
3228
|
return {
|
|
3190
|
-
...
|
|
3229
|
+
...L,
|
|
3191
3230
|
noMinSize: !0
|
|
3192
3231
|
};
|
|
3193
3232
|
}
|
|
3194
|
-
function
|
|
3195
|
-
|
|
3233
|
+
function b(L, A, h) {
|
|
3234
|
+
if (L.length)
|
|
3235
|
+
return Be().range([0, h.width]).domain([0, L[0].values.length - 1]);
|
|
3196
3236
|
}
|
|
3197
3237
|
return n({
|
|
3198
3238
|
areaPathDefinition: r
|
|
3199
|
-
}), (
|
|
3239
|
+
}), (L, A) => (y(), K(d(De), G(o, {
|
|
3200
3240
|
"chart-type": "line",
|
|
3201
|
-
options:
|
|
3202
|
-
"x-scale":
|
|
3203
|
-
}, le(d(l))),
|
|
3204
|
-
groups: V((
|
|
3205
|
-
d(c).showArea ? (
|
|
3241
|
+
options: p(d(c)),
|
|
3242
|
+
"x-scale": b
|
|
3243
|
+
}, le(d(l))), ce({
|
|
3244
|
+
groups: V((h) => [
|
|
3245
|
+
d(c).showArea ? (y(), $("path", {
|
|
3206
3246
|
key: 0,
|
|
3207
|
-
class:
|
|
3247
|
+
class: ne([
|
|
3208
3248
|
"sparkline-chart__area",
|
|
3209
3249
|
d(i).withTransition !== !1 ? "sparkline-chart__area--transition" : "",
|
|
3210
|
-
`lume-fill--${g.value ||
|
|
3250
|
+
`lume-fill--${g.value || m.value}`,
|
|
3211
3251
|
"lume-fill--faded"
|
|
3212
3252
|
]),
|
|
3213
|
-
d: d(r)(
|
|
3253
|
+
d: d(r)(h.xScale, h.yScale),
|
|
3214
3254
|
"data-j-sparkline__area": ""
|
|
3215
|
-
}, null, 10,
|
|
3216
|
-
|
|
3255
|
+
}, null, 10, Ca)) : W("", !0),
|
|
3256
|
+
ie(d(un), G(h, { "with-points": !1 }, le(d(l))), null, 16)
|
|
3217
3257
|
]),
|
|
3218
3258
|
_: 2
|
|
3219
3259
|
}, [
|
|
3220
|
-
|
|
3221
|
-
name:
|
|
3260
|
+
z(d(u), (h, x) => ({
|
|
3261
|
+
name: x,
|
|
3222
3262
|
fn: V((N) => [
|
|
3223
|
-
|
|
3263
|
+
R(L.$slots, x, pe(he(N || {})), void 0, !0)
|
|
3224
3264
|
])
|
|
3225
3265
|
}))
|
|
3226
3266
|
]), 1040, ["options"]));
|
|
3227
3267
|
}
|
|
3228
3268
|
});
|
|
3229
|
-
const
|
|
3269
|
+
const Ka = /* @__PURE__ */ ee(Ga, [["__scopeId", "data-v-bda226a1"]]);
|
|
3230
3270
|
export {
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3271
|
+
za as LumeAlluvialDiagram,
|
|
3272
|
+
ea as LumeAlluvialGroup,
|
|
3273
|
+
kl as LumeAlluvialNodeLabel,
|
|
3274
|
+
Tl as LumeAlluvialNodeValue,
|
|
3275
|
+
Lt as LumeAxis,
|
|
3276
|
+
mt as LumeBar,
|
|
3277
|
+
Wa as LumeBarChart,
|
|
3278
|
+
ht as LumeBarGroup,
|
|
3239
3279
|
De as LumeChart,
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3280
|
+
io as LumeChartContainer,
|
|
3281
|
+
Ot as LumeChartLegend,
|
|
3282
|
+
Ua as LumeGroupedBarChart,
|
|
3283
|
+
Aa as LumeLine,
|
|
3284
|
+
Ya as LumeLineChart,
|
|
3285
|
+
un as LumeLineGroup,
|
|
3286
|
+
Uo as LumeOverlayGroup,
|
|
3287
|
+
xa as LumePoint,
|
|
3288
|
+
Za as LumeSingleBarChart,
|
|
3289
|
+
Ka as LumeSparklineChart,
|
|
3290
|
+
Xa as LumeStackedBarChart,
|
|
3291
|
+
Do as LumeTooltip,
|
|
3292
|
+
Oo as LumeTooltipItem,
|
|
3293
|
+
ko as LumeTooltipSummary,
|
|
3294
|
+
po as LumeTooltipTitle
|
|
3255
3295
|
};
|
|
3256
3296
|
//# sourceMappingURL=index.js.map
|