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