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