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