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