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