@adyen/lume-vue3 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1724 -1709
- 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
|
|
3
|
-
import { createPopper as
|
|
4
|
-
import { sankeyLinkHorizontal as
|
|
5
|
-
const
|
|
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 ln, withCtx as V, createSlots as se, vShow as rn, pushScopeId as un, popScopeId as sn, provide as Fe, createVNode as re, toHandlers as ae, normalizeProps as ve, guardReactiveProps as me, defineAsyncComponent as ze, resolveDynamicComponent as cn } from "vue";
|
|
2
|
+
import { format as dn, ticks as vn, scaleBand as we, scaleLinear as Ee, link as mn, line as pn, area as fn } from "d3";
|
|
3
|
+
import { createPopper as hn } from "@popperjs/core";
|
|
4
|
+
import { sankeyLinkHorizontal as gn, sankey as _n, sankeyJustify as yn } from "d3-sankey";
|
|
5
|
+
const kn = {
|
|
6
6
|
class: "axis__tick-label lume-typography--axis",
|
|
7
7
|
"pointer-events": "all",
|
|
8
8
|
"data-j-axis__tick-label": ""
|
|
9
|
-
},
|
|
9
|
+
}, bn = /* @__PURE__ */ W({
|
|
10
10
|
__name: "lume-tick",
|
|
11
11
|
props: {
|
|
12
12
|
value: {
|
|
@@ -43,38 +43,38 @@ const gn = {
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
emits: ["click", "mouseenter"],
|
|
46
|
-
setup(e, { expose:
|
|
47
|
-
const o =
|
|
48
|
-
return
|
|
46
|
+
setup(e, { expose: n, emit: t }) {
|
|
47
|
+
const o = t, a = R(null);
|
|
48
|
+
return n({ 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", kn, [
|
|
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
|
|
73
|
-
const
|
|
74
|
-
for (const [o,
|
|
75
|
-
|
|
76
|
-
return
|
|
77
|
-
},
|
|
72
|
+
const q = (e, n) => {
|
|
73
|
+
const t = e.__vccOpts || e;
|
|
74
|
+
for (const [o, a] of n)
|
|
75
|
+
t[o] = a;
|
|
76
|
+
return t;
|
|
77
|
+
}, ht = /* @__PURE__ */ q(bn, [["__scopeId", "data-v-59ddc0a6"]]), An = [
|
|
78
78
|
"controls",
|
|
79
79
|
"legend",
|
|
80
80
|
"axes",
|
|
@@ -82,171 +82,171 @@ 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
|
+
(n) => n.values.map((t) => t == null ? void 0 : t.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 Tn(e) {
|
|
97
97
|
return !!e && e.every(
|
|
98
|
-
(
|
|
98
|
+
(n) => "color" in n
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function We(e) {
|
|
102
102
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
const
|
|
106
|
-
return Object.entries(
|
|
107
|
-
|
|
108
|
-
}),
|
|
104
|
+
function St(e, n) {
|
|
105
|
+
const t = { ...e };
|
|
106
|
+
return Object.entries(n).forEach(([o, a]) => {
|
|
107
|
+
t[o] = We(e[o]) && We(a) ? St(e[o], a) : a;
|
|
108
|
+
}), t;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return e != null &&
|
|
110
|
+
function Ln(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 On(e) {
|
|
117
|
+
return be(e) ? e.step() : Math.max(...e.range()) / Math.max(...e.domain());
|
|
118
118
|
}
|
|
119
|
-
const
|
|
119
|
+
const $n = (e, n) => {
|
|
120
120
|
if (!e)
|
|
121
121
|
throw new Error("Data is not a valid array");
|
|
122
122
|
if (e.length === 0)
|
|
123
123
|
throw new Error("Cannot get highest value from empty array");
|
|
124
124
|
if (!e.some(
|
|
125
|
-
({ values: o }) => o.length - 1 >=
|
|
125
|
+
({ values: o }) => o.length - 1 >= n
|
|
126
126
|
))
|
|
127
127
|
throw new Error("Index exceeds length of all of the datasets");
|
|
128
128
|
};
|
|
129
|
-
function
|
|
130
|
-
var
|
|
131
|
-
return
|
|
132
|
-
(o,
|
|
133
|
-
var
|
|
134
|
-
return (((
|
|
129
|
+
function xn(e, n) {
|
|
130
|
+
var t;
|
|
131
|
+
return $n(e, n), ((t = e.reduce(
|
|
132
|
+
(o, a) => {
|
|
133
|
+
var r, l;
|
|
134
|
+
return (((r = o.values[n]) == null ? void 0 : r.value) ?? 0) > (((l = a.values[n]) == null ? void 0 : l.value) ?? 0) ? o : a;
|
|
135
135
|
}
|
|
136
|
-
).values[
|
|
136
|
+
).values[n]) == null ? void 0 : t.value) || 0;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
const
|
|
140
|
-
if (!
|
|
138
|
+
function Ue(e) {
|
|
139
|
+
const n = Nt(e) ? e.value : e;
|
|
140
|
+
if (!n)
|
|
141
141
|
throw new Error("No empty array can be created from specified data value");
|
|
142
|
-
const
|
|
143
|
-
...
|
|
142
|
+
const t = Math.max(
|
|
143
|
+
...n.map((o) => o.values.length),
|
|
144
144
|
0
|
|
145
145
|
);
|
|
146
|
-
return Array(
|
|
146
|
+
return Array(t).fill(null);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
return
|
|
148
|
+
function In(e) {
|
|
149
|
+
return be(e) ? e.domain().length : Math.max(...e.domain());
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
return (
|
|
151
|
+
function wn(e, n) {
|
|
152
|
+
return (t) => Math.round(e * (1 - t) + n * t);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
const o =
|
|
156
|
-
return e.slice(o).concat(
|
|
154
|
+
function En(e, n, t) {
|
|
155
|
+
const o = t ? e.length - n : n, 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
|
-
const
|
|
160
|
+
const n = Object.keys(e);
|
|
161
161
|
return Object.assign(
|
|
162
162
|
{},
|
|
163
|
-
...
|
|
163
|
+
...n.map((t) => t !== "groups" ? { [t]: e[t] } : {})
|
|
164
164
|
);
|
|
165
165
|
}
|
|
166
166
|
return e;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Nn(e) {
|
|
169
169
|
return Object.assign(
|
|
170
170
|
{},
|
|
171
171
|
...Object.keys(e).map(
|
|
172
|
-
(
|
|
172
|
+
(n) => An.includes(n) ? {} : { [n]: e[n] }
|
|
173
173
|
)
|
|
174
174
|
);
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
(
|
|
176
|
+
const Dn = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce(
|
|
177
|
+
(n, t) => n += (t &= 63) < 36 ? t.toString(36) : t < 62 ? (t - 26).toString(36).toUpperCase() : t > 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
|
-
|
|
182
|
+
const Hn = "[lume] ";
|
|
183
|
+
function ye(e, n = !0) {
|
|
184
|
+
n && Mt() || console.warn(Hn + "Warning: " + e);
|
|
185
185
|
}
|
|
186
|
-
const
|
|
187
|
-
let
|
|
186
|
+
const Se = (e) => {
|
|
187
|
+
let n = null;
|
|
188
188
|
switch (typeof e) {
|
|
189
189
|
case "string":
|
|
190
190
|
try {
|
|
191
|
-
|
|
191
|
+
n = dn(e);
|
|
192
192
|
} catch {
|
|
193
|
-
|
|
193
|
+
ye(pe.InvalidFormat), n = null;
|
|
194
194
|
}
|
|
195
195
|
break;
|
|
196
196
|
case "function":
|
|
197
|
-
|
|
197
|
+
n = e;
|
|
198
198
|
break;
|
|
199
199
|
default:
|
|
200
|
-
|
|
200
|
+
n = null;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
return
|
|
202
|
+
function t(...o) {
|
|
203
|
+
return n ? n(...o) : o[0];
|
|
204
204
|
}
|
|
205
|
-
return
|
|
206
|
-
},
|
|
205
|
+
return t;
|
|
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, n) {
|
|
213
|
+
return { allOptions: v(() => {
|
|
214
|
+
const o = Nt(n) ? n == null ? void 0 : n.value : n;
|
|
215
|
+
return o ? St(o, e.value) : e.value;
|
|
216
216
|
}) };
|
|
217
217
|
}
|
|
218
|
-
const
|
|
219
|
-
function
|
|
220
|
-
const o =
|
|
221
|
-
function
|
|
222
|
-
if (!
|
|
218
|
+
const Bn = 0.2;
|
|
219
|
+
function Mn(e, n, t) {
|
|
220
|
+
const o = R(), a = v(() => Math.max(...e.value.range())), r = v(() => n.value.length);
|
|
221
|
+
function l() {
|
|
222
|
+
if (!n.value)
|
|
223
223
|
return;
|
|
224
|
-
const s =
|
|
225
|
-
(
|
|
224
|
+
const s = n.value.reduce(
|
|
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 * Bn;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
if (!
|
|
230
|
+
function i(s) {
|
|
231
|
+
if (!n.value)
|
|
232
232
|
return !0;
|
|
233
|
-
const
|
|
233
|
+
const c = n.value.length;
|
|
234
234
|
if (s === 0)
|
|
235
235
|
return !0;
|
|
236
|
-
const
|
|
237
|
-
return s %
|
|
236
|
+
const p = a.value / c, u = typeof t == "number" && t > 0 && t + 1 || Math.ceil(o.value / p);
|
|
237
|
+
return s % u === 0;
|
|
238
238
|
}
|
|
239
|
-
return
|
|
239
|
+
return K(n, 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
|
+
}, Rn = {
|
|
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, Sn = 1, Cn = [
|
|
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,193 +282,193 @@ const Pt = {
|
|
|
282
282
|
tickFormat: null,
|
|
283
283
|
/** Space between the tick label and the axis line. */
|
|
284
284
|
tickPadding: 8
|
|
285
|
-
},
|
|
286
|
-
...
|
|
285
|
+
}, Gn = {
|
|
286
|
+
...Ft,
|
|
287
287
|
withTitle: !1,
|
|
288
288
|
skip: !0
|
|
289
|
-
},
|
|
290
|
-
...
|
|
289
|
+
}, jn = {
|
|
290
|
+
...Ft,
|
|
291
291
|
gridLines: !0
|
|
292
|
-
},
|
|
293
|
-
const o =
|
|
294
|
-
function
|
|
292
|
+
}, Pn = function(e, n, t) {
|
|
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:
|
|
306
|
+
x: -(c - e.value.step()) / 2,
|
|
307
|
+
width: c,
|
|
308
|
+
height: t.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,
|
|
315
315
|
x2: s,
|
|
316
|
-
y1: -
|
|
316
|
+
y1: -n.value.height
|
|
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
|
-
y:
|
|
323
|
+
y: t.value.tickPadding,
|
|
324
324
|
dy: "0.8em",
|
|
325
325
|
"text-anchor": "middle"
|
|
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
|
+
}, Vn = function(e, n, t) {
|
|
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) + t.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,
|
|
354
354
|
y2: s,
|
|
355
|
-
x1:
|
|
355
|
+
x1: n.value.width
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function i() {
|
|
359
359
|
return {
|
|
360
|
-
x: -
|
|
360
|
+
x: -t.value.tickPadding,
|
|
361
361
|
y: e.value.step() / 2,
|
|
362
362
|
"text-anchor": "end",
|
|
363
363
|
"alignment-baseline": "middle"
|
|
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
|
+
}, Fn = function(e, n, t) {
|
|
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:
|
|
384
|
+
height: t.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
|
-
y1: -
|
|
391
|
+
y1: -n.value.height
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function i() {
|
|
395
395
|
return {
|
|
396
|
-
y:
|
|
396
|
+
y: t.value.tickPadding,
|
|
397
397
|
dy: "0.8em",
|
|
398
398
|
"text-anchor": "middle"
|
|
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
|
+
}, zn = function(e, n, t) {
|
|
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) + t.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
|
-
x1:
|
|
429
|
+
x1: n.value.width
|
|
430
430
|
};
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function i() {
|
|
433
433
|
return {
|
|
434
|
-
x: -
|
|
434
|
+
x: -t.value.tickPadding,
|
|
435
435
|
dy: "0.4em",
|
|
436
436
|
"text-anchor": "end"
|
|
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": Pn,
|
|
447
|
+
"y-band-scale-axis": Vn,
|
|
448
|
+
"x-linear-scale-axis": Fn,
|
|
449
|
+
"y-linear-scale-axis": zn
|
|
450
|
+
}, Wn = ["transform"], Un = { key: 0 }, Xn = /* @__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), Yn = [
|
|
468
|
+
Xn
|
|
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 mt = /* @__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 mt = /* @__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
|
-
setup(e, { emit:
|
|
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
|
-
),
|
|
503
|
+
setup(e, { emit: n }) {
|
|
504
|
+
const o = e, a = n, { 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" ? Gn : jn
|
|
513
|
+
), { showTick: $ } = Mn(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 vn(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", Un, Yn)) : 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, Wn)) : z("", !0);
|
|
614
614
|
}
|
|
615
615
|
});
|
|
616
|
-
function
|
|
617
|
-
const
|
|
616
|
+
function Kn(e, n, t, o) {
|
|
617
|
+
const a = v(() => t.value > 0 && t.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 ? n.value - 0.5 : n.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 Jn(e, n, t, o) {
|
|
629
|
+
const a = R(0), r = R(0), l = v(() => `${e.value + t.value / 2}px ${n.value + o.value / 2}px`);
|
|
630
630
|
return fe(() => {
|
|
631
|
-
|
|
632
|
-
}),
|
|
631
|
+
a.value = t.value, r.value = o.value;
|
|
632
|
+
}), K(t, (i) => a.value = i), K(o, (i) => r.value = i), { computedWidth: a, computedHeight: r, transformOrigin: l };
|
|
633
633
|
}
|
|
634
|
-
const
|
|
634
|
+
const Qn = ["x", "y", "width", "height"], qn = /* @__PURE__ */ W({
|
|
635
635
|
__name: "lume-bar",
|
|
636
636
|
props: {
|
|
637
637
|
x: {
|
|
@@ -668,50 +668,50 @@ const Yn = ["x", "y", "width", "height"], Kn = /* @__PURE__ */ Z({
|
|
|
668
668
|
}
|
|
669
669
|
},
|
|
670
670
|
emits: ["click", "mouseover", "mouseleave"],
|
|
671
|
-
setup(e, { emit:
|
|
672
|
-
const
|
|
673
|
-
() => typeof
|
|
674
|
-
),
|
|
675
|
-
return fe(() =>
|
|
671
|
+
setup(e, { emit: n }) {
|
|
672
|
+
const t = e, o = n, { x: a, y: r, width: l, height: i, transition: s, classList: c } = ee(t), 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 = Jn(a, r, l, i), { computedX: T, computedY: O, shouldHaveMinWidth: b, shouldHaveMinHeight: h } = Kn(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, Qn));
|
|
697
697
|
}
|
|
698
698
|
});
|
|
699
|
-
const
|
|
700
|
-
function
|
|
701
|
-
const e =
|
|
699
|
+
const rt = /* @__PURE__ */ q(qn, [["__scopeId", "data-v-8e8f732a"]]);
|
|
700
|
+
function eo() {
|
|
701
|
+
const e = R(), n = Ce({
|
|
702
702
|
dimensions: {}
|
|
703
|
-
}),
|
|
704
|
-
o.forEach((
|
|
705
|
-
|
|
703
|
+
}), t = new ResizeObserver((o) => {
|
|
704
|
+
o.forEach((a) => {
|
|
705
|
+
n.dimensions = a.contentRect;
|
|
706
706
|
});
|
|
707
707
|
});
|
|
708
708
|
return fe(() => {
|
|
709
|
-
|
|
710
|
-
}),
|
|
711
|
-
|
|
712
|
-
}), { resizeState:
|
|
709
|
+
t.observe(e.value);
|
|
710
|
+
}), Ht(() => {
|
|
711
|
+
t.unobserve(e.value);
|
|
712
|
+
}), { resizeState: n, resizeRef: e };
|
|
713
713
|
}
|
|
714
|
-
const
|
|
714
|
+
const to = ["height"], no = ["transform"], oo = /* @__PURE__ */ W({
|
|
715
715
|
__name: "lume-chart-container",
|
|
716
716
|
props: {
|
|
717
717
|
margins: {
|
|
@@ -732,124 +732,124 @@ const Qn = ["height"], qn = ["transform"], eo = /* @__PURE__ */ Z({
|
|
|
732
732
|
}
|
|
733
733
|
},
|
|
734
734
|
emits: ["click", "mouseenter", "mouseleave", "resize"],
|
|
735
|
-
setup(e, { emit:
|
|
736
|
-
const
|
|
737
|
-
() =>
|
|
735
|
+
setup(e, { emit: n }) {
|
|
736
|
+
const t = e, o = n, { margins: a, containerSize: r } = ee(t), l = R(null), { resizeRef: i, resizeState: s } = eo(), 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, no)
|
|
780
|
+
], 42, to)),
|
|
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 ao = /* @__PURE__ */ q(oo, [["__scopeId", "data-v-36870bc4"]]), lo = ["onClick", "onMouseenter"], ro = /* @__PURE__ */ W({
|
|
787
787
|
__name: "lume-chart-legend",
|
|
788
788
|
props: {
|
|
789
789
|
data: {
|
|
790
790
|
type: Array,
|
|
791
|
-
validator:
|
|
791
|
+
validator: Tn,
|
|
792
792
|
required: !0
|
|
793
793
|
}
|
|
794
794
|
},
|
|
795
795
|
emits: ["click", "mouseenter", "mouseleave"],
|
|
796
|
-
setup(e, { emit:
|
|
797
|
-
const n =
|
|
798
|
-
return (
|
|
796
|
+
setup(e, { emit: n }) {
|
|
797
|
+
const t = n, 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) => t("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) => t("click", { index: i, dataset: l, event: s }),
|
|
810
|
+
onMouseenter: (s) => t("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, lo))), 128))
|
|
818
818
|
], 32));
|
|
819
819
|
}
|
|
820
820
|
});
|
|
821
|
-
const
|
|
822
|
-
const
|
|
821
|
+
const yt = /* @__PURE__ */ q(ro, [["__scopeId", "data-v-4710298b"]]);
|
|
822
|
+
const uo = {}, io = {
|
|
823
823
|
class: "lume-tooltip__title",
|
|
824
824
|
"data-j-tooltip__title": ""
|
|
825
825
|
};
|
|
826
|
-
function
|
|
827
|
-
return y(),
|
|
826
|
+
function so(e, n) {
|
|
827
|
+
return y(), x("div", io, [
|
|
828
828
|
S(e.$slots, "default", {}, void 0, !0)
|
|
829
829
|
]);
|
|
830
830
|
}
|
|
831
|
-
const
|
|
832
|
-
const
|
|
831
|
+
const co = /* @__PURE__ */ q(uo, [["render", so], ["__scopeId", "data-v-8af3fac6"]]);
|
|
832
|
+
const vo = {}, mo = {
|
|
833
833
|
class: "lume-tooltip__item",
|
|
834
834
|
"data-j-tooltip__summary-item": ""
|
|
835
|
-
},
|
|
836
|
-
function
|
|
837
|
-
return y(),
|
|
838
|
-
|
|
835
|
+
}, po = { class: "lume-tooltip__value" };
|
|
836
|
+
function fo(e, n) {
|
|
837
|
+
return y(), x("li", mo, [
|
|
838
|
+
j("span", null, [
|
|
839
839
|
S(e.$slots, "default", {}, void 0, !0)
|
|
840
840
|
]),
|
|
841
|
-
|
|
841
|
+
j("strong", po, [
|
|
842
842
|
S(e.$slots, "value", {}, void 0, !0)
|
|
843
843
|
])
|
|
844
844
|
]);
|
|
845
845
|
}
|
|
846
|
-
const
|
|
846
|
+
const ho = /* @__PURE__ */ q(vo, [["render", fo], ["__scopeId", "data-v-4ed7ec1b"]]), go = {
|
|
847
847
|
class: "lume-tooltip__item",
|
|
848
848
|
"data-j-tooltip__item": ""
|
|
849
|
-
},
|
|
849
|
+
}, _o = { "data-j-tooltip__item__label": "" }, yo = {
|
|
850
850
|
class: "lume-tooltip__value",
|
|
851
851
|
"data-j-tooltip__item__value": ""
|
|
852
|
-
},
|
|
852
|
+
}, ko = /* @__PURE__ */ W({
|
|
853
853
|
__name: "lume-tooltip-item",
|
|
854
854
|
props: {
|
|
855
855
|
color: {
|
|
@@ -858,27 +858,27 @@ const po = /* @__PURE__ */ Q(io, [["render", vo], ["__scopeId", "data-v-4ed7ec1b
|
|
|
858
858
|
}
|
|
859
859
|
},
|
|
860
860
|
setup(e) {
|
|
861
|
-
return (
|
|
862
|
-
e.color ? (y(),
|
|
861
|
+
return (n, t) => (y(), x("li", go, [
|
|
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
|
-
|
|
868
|
-
S(
|
|
866
|
+
}, null, 2)) : z("", !0),
|
|
867
|
+
j("span", _o, [
|
|
868
|
+
S(n.$slots, "label", {}, void 0, !0)
|
|
869
869
|
]),
|
|
870
|
-
|
|
871
|
-
S(
|
|
870
|
+
j("strong", yo, [
|
|
871
|
+
S(n.$slots, "value", {}, void 0, !0)
|
|
872
872
|
])
|
|
873
873
|
]));
|
|
874
874
|
}
|
|
875
875
|
});
|
|
876
|
-
const
|
|
876
|
+
const bo = /* @__PURE__ */ q(ko, [["__scopeId", "data-v-4f995c3c"]]), Ao = (e) => (un("data-v-8ec11304"), e = e(), sn(), e), To = { class: "lume-tooltip__items" }, Lo = {
|
|
877
877
|
key: 0,
|
|
878
878
|
class: "lume-tooltip__break"
|
|
879
|
-
},
|
|
880
|
-
|
|
881
|
-
],
|
|
879
|
+
}, Oo = /* @__PURE__ */ Ao(() => /* @__PURE__ */ j("hr", null, null, -1)), $o = [
|
|
880
|
+
Oo
|
|
881
|
+
], xo = /* @__PURE__ */ W({
|
|
882
882
|
__name: "lume-tooltip",
|
|
883
883
|
props: {
|
|
884
884
|
targetElement: {
|
|
@@ -892,7 +892,7 @@ const _o = /* @__PURE__ */ Q(go, [["__scopeId", "data-v-4f995c3c"]]), yo = (e) =
|
|
|
892
892
|
position: {
|
|
893
893
|
type: String,
|
|
894
894
|
default: "auto",
|
|
895
|
-
validator: (e) =>
|
|
895
|
+
validator: (e) => Cn.includes(e)
|
|
896
896
|
},
|
|
897
897
|
fixedPositioning: {
|
|
898
898
|
type: Boolean,
|
|
@@ -910,15 +910,15 @@ const _o = /* @__PURE__ */ Q(go, [["__scopeId", "data-v-4f995c3c"]]), yo = (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
|
-
setup(e, { emit:
|
|
917
|
-
const
|
|
918
|
-
() =>
|
|
919
|
-
),
|
|
920
|
-
() =>
|
|
921
|
-
),
|
|
916
|
+
setup(e, { emit: n }) {
|
|
917
|
+
const t = e, o = n, a = R(null), { items: r, options: l } = ee(t), i = le(), s = R(null), { allOptions: c } = ce(l), p = v(
|
|
918
|
+
() => c.value.fixedPositioning ?? t.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 _o = /* @__PURE__ */ Q(go, [["__scopeId", "data-v-4f995c3c"]]), yo = (e) =
|
|
|
928
928
|
},
|
|
929
929
|
{
|
|
930
930
|
name: "offset",
|
|
931
|
-
options: { offset: [0,
|
|
931
|
+
options: { offset: [0, c.value.offset || 8] }
|
|
932
932
|
},
|
|
933
|
-
...
|
|
934
|
-
]),
|
|
935
|
-
() =>
|
|
936
|
-
),
|
|
933
|
+
...t.modifiers || []
|
|
934
|
+
]), g = v(
|
|
935
|
+
() => c.value.showTitle !== !1 && t.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 ?? t.summary
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
|
-
),
|
|
944
|
-
function
|
|
945
|
-
|
|
946
|
-
placement:
|
|
947
|
-
strategy:
|
|
948
|
-
modifiers:
|
|
949
|
-
}),
|
|
943
|
+
), b = v(() => i.summary || O.value.label);
|
|
944
|
+
function h() {
|
|
945
|
+
t.targetElement && a.value && (s.value = hn(t.targetElement, a.value, {
|
|
946
|
+
placement: t.position,
|
|
947
|
+
strategy: u.value,
|
|
948
|
+
modifiers: f.value
|
|
949
|
+
}), o("opened", t.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"), t.targetElement ? function() {
|
|
956
|
+
s.value.state.elements.reference = t.targetElement, s.value.update(), o("moved", t.targetElement);
|
|
957
|
+
}() : $());
|
|
958
958
|
}
|
|
959
|
-
return
|
|
960
|
-
() =>
|
|
961
|
-
(
|
|
962
|
-
!
|
|
959
|
+
return K(
|
|
960
|
+
() => t.targetElement,
|
|
961
|
+
(D, N) => {
|
|
962
|
+
!N && D ? h() : w();
|
|
963
963
|
}
|
|
964
|
-
), fe(
|
|
964
|
+
), fe(h), Ht($), (D, N) => ln((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(co), { 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", To, [
|
|
984
|
+
S(D.$slots, "summary", {}, () => [
|
|
985
|
+
b.value ? (y(), X(d(ho), { 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", Lo, $o)) : z("", !0),
|
|
1001
|
+
S(D.$slots, "items", {}, () => [
|
|
1002
|
+
(y(!0), x(Q, null, Z(d(r), (H) => (y(), X(d(bo), {
|
|
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 _o = /* @__PURE__ */ Q(go, [["__scopeId", "data-v-4f995c3c"]]), yo = (e) =
|
|
|
1015
1015
|
])
|
|
1016
1016
|
], !0)
|
|
1017
1017
|
], 34)), [
|
|
1018
|
-
[
|
|
1018
|
+
[rn, e.targetElement]
|
|
1019
1019
|
]);
|
|
1020
1020
|
}
|
|
1021
1021
|
});
|
|
1022
|
-
const
|
|
1023
|
-
var
|
|
1024
|
-
const
|
|
1025
|
-
function
|
|
1026
|
-
return e ===
|
|
1027
|
-
}
|
|
1028
|
-
function
|
|
1029
|
-
return Object.values(
|
|
1030
|
-
}
|
|
1031
|
-
function
|
|
1032
|
-
return
|
|
1033
|
-
...
|
|
1034
|
-
...
|
|
1035
|
-
...
|
|
1036
|
-
...
|
|
1022
|
+
const Io = /* @__PURE__ */ q(xo, [["__scopeId", "data-v-8ec11304"]]);
|
|
1023
|
+
var _e = /* @__PURE__ */ ((e) => (e.Categorical = "categorical", e.Sequential = "sequential", e.Divergent = "divergent", e))(_e || {});
|
|
1024
|
+
const wo = _e.Categorical, Be = ue.Skyblue, Eo = ot.SkyTeal;
|
|
1025
|
+
function No(e) {
|
|
1026
|
+
return e === _e.Divergent ? Eo : Be;
|
|
1027
|
+
}
|
|
1028
|
+
function Do(e) {
|
|
1029
|
+
return Object.values(lt).includes(e);
|
|
1030
|
+
}
|
|
1031
|
+
function kt(e, n) {
|
|
1032
|
+
return n === _e.Divergent ? Object.values(ot).includes(e) : Object.values({
|
|
1033
|
+
...ue,
|
|
1034
|
+
...Ct,
|
|
1035
|
+
...at,
|
|
1036
|
+
...lt
|
|
1037
1037
|
}).includes(e);
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1040
|
-
const
|
|
1041
|
-
return
|
|
1039
|
+
function Ho(e, n) {
|
|
1040
|
+
const t = Object.values(ue).indexOf(e);
|
|
1041
|
+
return En(Object.values(ue), t > -1 ? t : 0)[n];
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1044
|
-
const
|
|
1045
|
-
return `${e}-${
|
|
1043
|
+
function Bo(e, n) {
|
|
1044
|
+
const t = 50 + n * 10;
|
|
1045
|
+
return `${e}-${t}`;
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1048
|
-
const
|
|
1049
|
-
return `${e}-${
|
|
1047
|
+
function Mo(e, n) {
|
|
1048
|
+
const t = (n + 1) * 10;
|
|
1049
|
+
return `${e}-${t}`;
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1052
|
-
switch (
|
|
1051
|
+
function bt(e, n, t) {
|
|
1052
|
+
switch (n) {
|
|
1053
1053
|
default:
|
|
1054
|
-
case
|
|
1055
|
-
return
|
|
1056
|
-
case
|
|
1057
|
-
return
|
|
1058
|
-
case
|
|
1059
|
-
return
|
|
1054
|
+
case _e.Categorical:
|
|
1055
|
+
return Do(e) ? e : Ho(e, t);
|
|
1056
|
+
case _e.Sequential:
|
|
1057
|
+
return Bo(e, t);
|
|
1058
|
+
case _e.Divergent:
|
|
1059
|
+
return Mo(e, t);
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1063
|
-
return
|
|
1062
|
+
function Ro(e, n, t = wo, o) {
|
|
1063
|
+
return kt(e, t) ? e : (o > 4 && (ye(pe.ColorLoop), o = o % 5), kt(n, t) ? bt(n, t, o) : bt(No(t), t, o));
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1066
|
-
return e.map((
|
|
1065
|
+
function So(e) {
|
|
1066
|
+
return e.map((n) => Ln(n) ? n : { value: n });
|
|
1067
1067
|
}
|
|
1068
|
-
function
|
|
1068
|
+
function Co(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 at = (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, n, t, 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
|
-
|
|
1102
|
-
|
|
1094
|
+
}), l = Dn(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 (Co(u))
|
|
1099
|
+
return u;
|
|
1100
|
+
const g = So(u.values), m = Ro(
|
|
1101
|
+
u.color,
|
|
1102
|
+
t == null ? void 0 : t.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(n.value) ? n.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 Go = () => ({
|
|
1128
1128
|
xScale: {
|
|
1129
1129
|
type: Function,
|
|
1130
1130
|
default: null
|
|
@@ -1134,69 +1134,69 @@ const Mo = () => ({
|
|
|
1134
1134
|
default: null
|
|
1135
1135
|
}
|
|
1136
1136
|
});
|
|
1137
|
-
function
|
|
1138
|
-
const
|
|
1139
|
-
function
|
|
1140
|
-
const { width: s, height:
|
|
1141
|
-
!s && !
|
|
1137
|
+
function jo(e, n, t, o, a) {
|
|
1138
|
+
const r = R(null), l = R(null);
|
|
1139
|
+
function i() {
|
|
1140
|
+
const { width: s, height: c } = t;
|
|
1141
|
+
!s && !c || !n.value || !e.value || (o.value === B.HORIZONTAL ? (r.value = Tt(
|
|
1142
1142
|
e.value,
|
|
1143
1143
|
s,
|
|
1144
1144
|
o.value,
|
|
1145
|
-
|
|
1146
|
-
),
|
|
1147
|
-
|
|
1148
|
-
|
|
1145
|
+
a.value.startOnZero
|
|
1146
|
+
), l.value = At(
|
|
1147
|
+
n.value,
|
|
1148
|
+
c,
|
|
1149
1149
|
o.value,
|
|
1150
|
-
|
|
1151
|
-
)) : (
|
|
1152
|
-
|
|
1150
|
+
a.value
|
|
1151
|
+
)) : (r.value = At(
|
|
1152
|
+
n.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, n, t, o) {
|
|
1166
|
+
const a = [0, n], { padding: r, paddingInner: l, paddingOuter: i } = o, s = r ?? (t === B.HORIZONTAL ? Pt : jt);
|
|
1167
1167
|
return Object.assign(
|
|
1168
|
-
|
|
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, n, t, o) {
|
|
1173
|
+
const a = Rt(e).filter((p) => p != null), r = [0, n];
|
|
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 = t === 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, n) {
|
|
1183
|
+
return be(e) ? e.bandwidth() / 2 + e(e.domain()[n]) : e(n);
|
|
1184
1184
|
}
|
|
1185
|
-
function
|
|
1186
|
-
padding:
|
|
1185
|
+
function Ot(e, n, {
|
|
1186
|
+
padding: t,
|
|
1187
1187
|
paddingInner: o,
|
|
1188
|
-
paddingOuter:
|
|
1188
|
+
paddingOuter: a
|
|
1189
1189
|
} = {}) {
|
|
1190
|
-
const
|
|
1191
|
-
return e.copy().paddingInner(o ??
|
|
1190
|
+
const r = t ?? (n === 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, n = !0) => ({
|
|
1197
|
+
...ut(e),
|
|
1198
|
+
...Go(),
|
|
1199
|
+
...De(),
|
|
1200
1200
|
classList: {
|
|
1201
1201
|
type: [String, Array],
|
|
1202
1202
|
default: () => []
|
|
@@ -1205,21 +1205,21 @@ const $e = (e, t = !0) => ({
|
|
|
1205
1205
|
type: Number,
|
|
1206
1206
|
default: null
|
|
1207
1207
|
},
|
|
1208
|
-
...
|
|
1208
|
+
...n ? {
|
|
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
|
+
}), Po = (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,115 +1261,125 @@ const $e = (e, t = !0) => ({
|
|
|
1261
1261
|
type: [String, Array],
|
|
1262
1262
|
default: () => []
|
|
1263
1263
|
}
|
|
1264
|
-
}),
|
|
1264
|
+
}), Vo = { class: "lume-overlay-group" }, Fo = /* @__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
|
-
setup(e, { emit:
|
|
1275
|
-
const
|
|
1276
|
-
function
|
|
1277
|
-
var
|
|
1278
|
-
const
|
|
1279
|
-
return
|
|
1280
|
-
width: Math.max(...
|
|
1281
|
-
height:
|
|
1282
|
-
transform: `translate(0, ${
|
|
1274
|
+
setup(e, { emit: n }) {
|
|
1275
|
+
const t = e, o = n, { data: a, orientation: r, xScale: l, yScale: i } = ee(t), 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 = On(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", Vo, [
|
|
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
|
-
function
|
|
1300
|
+
}), he = (e, n) => {
|
|
1301
|
+
function t(r, ...l) {
|
|
1302
1302
|
}
|
|
1303
|
-
function o(
|
|
1303
|
+
function o(r, l) {
|
|
1304
1304
|
}
|
|
1305
|
-
return { componentEventPropagator: {}, emitInternalEvent:
|
|
1305
|
+
return { componentEventPropagator: {}, emitInternalEvent: t, listenInternalEvent: o };
|
|
1306
1306
|
};
|
|
1307
|
-
function
|
|
1308
|
-
return { hasNegativeValues:
|
|
1309
|
-
() =>
|
|
1307
|
+
function zo(e) {
|
|
1308
|
+
return { hasNegativeValues: v(
|
|
1309
|
+
() => Rt(e.value).some((t) => t < 0)
|
|
1310
1310
|
) };
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1313
|
-
const
|
|
1314
|
-
() => o.value ===
|
|
1315
|
-
),
|
|
1312
|
+
function Zo(e, n, t, o) {
|
|
1313
|
+
const a = v(
|
|
1314
|
+
() => o.value === B.HORIZONTAL
|
|
1315
|
+
), r = v(
|
|
1316
1316
|
() => {
|
|
1317
|
-
var
|
|
1318
|
-
return e.height - (
|
|
1317
|
+
var c;
|
|
1318
|
+
return e.height - (a != null && a.value ? 0 : ((c = t.value) == null ? void 0 : c.call(t, 0)) || 0);
|
|
1319
1319
|
}
|
|
1320
|
-
),
|
|
1320
|
+
), l = v(
|
|
1321
1321
|
() => {
|
|
1322
|
-
var
|
|
1323
|
-
return
|
|
1322
|
+
var c;
|
|
1323
|
+
return a != null && a.value ? ((c = n.value) == null ? void 0 : c.call(n, 0)) || 0 : e.width;
|
|
1324
1324
|
}
|
|
1325
|
-
),
|
|
1325
|
+
), i = v(
|
|
1326
1326
|
() => {
|
|
1327
|
-
var
|
|
1328
|
-
return
|
|
1327
|
+
var c;
|
|
1328
|
+
return a != null && a.value ? "translate(0, 0)" : `translate(0, ${((c = t.value) == null ? void 0 : c.call(t, 0)) || 0})`;
|
|
1329
1329
|
}
|
|
1330
1330
|
);
|
|
1331
|
-
return { negativeBarAttributes:
|
|
1332
|
-
width:
|
|
1333
|
-
height:
|
|
1334
|
-
transform:
|
|
1331
|
+
return { negativeBarAttributes: v(() => ({
|
|
1332
|
+
width: l.value,
|
|
1333
|
+
height: r.value,
|
|
1334
|
+
transform: i.value
|
|
1335
1335
|
})) };
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1338
|
-
|
|
1337
|
+
function Ut(e, n) {
|
|
1338
|
+
const t = n - e.length;
|
|
1339
|
+
return t > 0 ? [...e, ...Array(t).fill({ value: null })] : e;
|
|
1339
1340
|
}
|
|
1340
|
-
function
|
|
1341
|
-
return e.reduce((t,
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1341
|
+
function Wo(e, n) {
|
|
1342
|
+
return e.reduce((t, o) => Ut(o.values, n).map((a, r) => t[r] ? a.value > t[r] ? a.value : t[r] : a.value ?? 0), []);
|
|
1343
|
+
}
|
|
1344
|
+
function Uo(e, n) {
|
|
1345
|
+
return e.reduce((t, o) => Ut(o.values, n).map(
|
|
1346
|
+
(a, r) => {
|
|
1347
|
+
const l = a.value == null || a.value < 0 ? 0 : a.value;
|
|
1348
|
+
return t[r] ? t[r] + l : l;
|
|
1349
|
+
}
|
|
1350
|
+
), []);
|
|
1345
1351
|
}
|
|
1346
|
-
const
|
|
1347
|
-
"stacked-bar":
|
|
1352
|
+
const $t = {
|
|
1353
|
+
"stacked-bar": Uo
|
|
1348
1354
|
};
|
|
1349
|
-
function
|
|
1350
|
-
const
|
|
1355
|
+
function Xt(e, n, t, o, a, r, l, i) {
|
|
1356
|
+
const s = v(
|
|
1351
1357
|
() => {
|
|
1352
|
-
var
|
|
1353
|
-
return
|
|
1358
|
+
var p;
|
|
1359
|
+
return n.value.withTooltip !== !1 && !((p = n.value.tooltipOptions) != null && p.targetElement);
|
|
1354
1360
|
}
|
|
1355
1361
|
);
|
|
1356
|
-
function
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1362
|
+
function c(p) {
|
|
1363
|
+
var g;
|
|
1364
|
+
const u = ((g = i == null ? void 0 : i.value) == null ? void 0 : g.length) ?? 0, f = l != null && l.value && $t[l.value] ? $t[l.value](
|
|
1365
|
+
p,
|
|
1366
|
+
u
|
|
1367
|
+
) : Wo(p, u);
|
|
1368
|
+
e.value = f.map((m, T) => ({
|
|
1369
|
+
cx: (a == null ? void 0 : a.value) === B.HORIZONTAL ? t.value(m) : Ye(t.value, T),
|
|
1370
|
+
cy: (a == null ? void 0 : a.value) === B.HORIZONTAL ? Ye(o.value, T) : o.value(m)
|
|
1361
1371
|
}));
|
|
1362
1372
|
}
|
|
1363
|
-
return
|
|
1364
|
-
[
|
|
1373
|
+
return K(
|
|
1374
|
+
[t, o],
|
|
1365
1375
|
() => {
|
|
1366
|
-
|
|
1376
|
+
t.value && o.value && (r != null && r.value) && s.value && c(r.value);
|
|
1367
1377
|
},
|
|
1368
1378
|
{ immediate: !0 }
|
|
1369
|
-
), { shouldGenerateTooltipAnchors:
|
|
1379
|
+
), { shouldGenerateTooltipAnchors: s, updateTooltipAnchorAttributes: c };
|
|
1370
1380
|
}
|
|
1371
|
-
function
|
|
1372
|
-
const e =
|
|
1381
|
+
function Xo() {
|
|
1382
|
+
const e = Ce({
|
|
1373
1383
|
opened: !1,
|
|
1374
1384
|
targetElement: null
|
|
1375
1385
|
});
|
|
@@ -1379,851 +1389,856 @@ function Zo() {
|
|
|
1379
1389
|
e.opened = !1, e.targetElement = null;
|
|
1380
1390
|
} };
|
|
1381
1391
|
}
|
|
1382
|
-
function
|
|
1383
|
-
return { getTooltipItems:
|
|
1384
|
-
() => (
|
|
1385
|
-
var
|
|
1392
|
+
function Yo(e) {
|
|
1393
|
+
return { getTooltipItems: v(
|
|
1394
|
+
() => (t) => e.value.map(({ color: o, label: a, values: r }) => {
|
|
1395
|
+
var l, i, s;
|
|
1386
1396
|
return {
|
|
1387
|
-
color: ((
|
|
1388
|
-
label:
|
|
1389
|
-
value: ((
|
|
1397
|
+
color: ((l = r[t]) == null ? void 0 : l.color) || o,
|
|
1398
|
+
label: a,
|
|
1399
|
+
value: ((i = r[t]) == null ? void 0 : i.label) ?? ((s = r[t]) == null ? void 0 : s.value) ?? Gt
|
|
1390
1400
|
};
|
|
1391
1401
|
})
|
|
1392
1402
|
) };
|
|
1393
1403
|
}
|
|
1394
|
-
const
|
|
1404
|
+
const Ke = 16, Je = 8, Qe = 28, qe = 24, ke = {
|
|
1395
1405
|
VERTICAL: {
|
|
1396
|
-
top:
|
|
1397
|
-
right:
|
|
1398
|
-
bottom:
|
|
1399
|
-
left:
|
|
1406
|
+
top: Ke,
|
|
1407
|
+
right: Je,
|
|
1408
|
+
bottom: Qe,
|
|
1409
|
+
left: qe
|
|
1400
1410
|
},
|
|
1401
1411
|
HORIZONTAL: {
|
|
1402
|
-
top:
|
|
1403
|
-
right:
|
|
1404
|
-
bottom:
|
|
1405
|
-
left:
|
|
1412
|
+
top: Ke,
|
|
1413
|
+
right: Je,
|
|
1414
|
+
bottom: Qe,
|
|
1415
|
+
left: qe
|
|
1406
1416
|
}
|
|
1407
1417
|
};
|
|
1408
|
-
function
|
|
1409
|
-
return !e || e === "auto" || e.top == null || e.top === "auto" ?
|
|
1418
|
+
function Ko(e) {
|
|
1419
|
+
return !e || e === "auto" || e.top == null || e.top === "auto" ? Ke : e.top;
|
|
1410
1420
|
}
|
|
1411
|
-
function
|
|
1412
|
-
return !e || e === "auto" || e.right == null || e.right === "auto" ?
|
|
1421
|
+
function Jo(e) {
|
|
1422
|
+
return !e || e === "auto" || e.right == null || e.right === "auto" ? Je : e.right;
|
|
1413
1423
|
}
|
|
1414
|
-
function
|
|
1415
|
-
return !e || e === "auto" || e.bottom == null || e.bottom === "auto" ?
|
|
1424
|
+
function Qo(e, n) {
|
|
1425
|
+
return !e || e === "auto" || e.bottom == null || e.bottom === "auto" ? n || Qe : e.bottom;
|
|
1416
1426
|
}
|
|
1417
|
-
function
|
|
1418
|
-
return !e || e === "auto" || e.left == null || e.left === "auto" ?
|
|
1427
|
+
function qo(e, n) {
|
|
1428
|
+
return !e || e === "auto" || e.left == null || e.left === "auto" ? n || qe : e.left;
|
|
1419
1429
|
}
|
|
1420
|
-
const
|
|
1430
|
+
const ea = { class: "lume-chart__header" }, ta = { class: "lume-chart__header-section" }, na = {
|
|
1421
1431
|
key: 0,
|
|
1422
1432
|
class: "lume-chart__title lume-chart-title lume-typography--display"
|
|
1423
|
-
},
|
|
1433
|
+
}, oa = { class: "lume-chart__controls" }, aa = { class: "lume-chart__header-section" }, la = {
|
|
1424
1434
|
key: 0,
|
|
1425
1435
|
class: "lume-chart__axis-title lume-axis-title lume-typography--body"
|
|
1426
|
-
},
|
|
1436
|
+
}, ra = { key: 3 }, ua = ["r"], ia = {
|
|
1427
1437
|
key: 0,
|
|
1428
1438
|
class: "lume-chart__axis-title lume-chart__axis-title--centered lume-axis-title lume-typography--body"
|
|
1429
|
-
},
|
|
1439
|
+
}, sa = /* @__PURE__ */ W({
|
|
1430
1440
|
__name: "lume-chart",
|
|
1431
1441
|
props: {
|
|
1432
|
-
|
|
1442
|
+
...xe(),
|
|
1433
1443
|
chartType: {
|
|
1434
1444
|
type: String,
|
|
1435
1445
|
default: null
|
|
1436
1446
|
}
|
|
1437
1447
|
},
|
|
1438
|
-
setup(e, { emit:
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
),
|
|
1446
|
-
top:
|
|
1447
|
-
right:
|
|
1448
|
-
bottom:
|
|
1449
|
-
left:
|
|
1450
|
-
})),
|
|
1451
|
-
var
|
|
1452
|
-
return
|
|
1453
|
-
}),
|
|
1454
|
-
var
|
|
1455
|
-
return
|
|
1456
|
-
}),
|
|
1457
|
-
...
|
|
1458
|
-
withHover:
|
|
1459
|
-
})),
|
|
1460
|
-
...
|
|
1461
|
-
withHover:
|
|
1462
|
-
})),
|
|
1463
|
-
var
|
|
1464
|
-
return (
|
|
1465
|
-
}),
|
|
1466
|
-
var
|
|
1467
|
-
return (
|
|
1468
|
-
}), k =
|
|
1469
|
-
var
|
|
1470
|
-
return ((
|
|
1471
|
-
}),
|
|
1472
|
-
var
|
|
1473
|
-
return ((
|
|
1474
|
-
}), _ =
|
|
1475
|
-
() =>
|
|
1476
|
-
),
|
|
1477
|
-
const
|
|
1478
|
-
return A ||
|
|
1479
|
-
}), { hasNegativeValues:
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
), { shouldGenerateTooltipAnchors:
|
|
1448
|
+
setup(e, { emit: n }) {
|
|
1449
|
+
const t = e, o = le(), a = n, { data: r, labels: l, color: i, options: s, orientation: c, chartType: p } = ee(t), 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 } = jo(
|
|
1450
|
+
$,
|
|
1451
|
+
w,
|
|
1452
|
+
D,
|
|
1453
|
+
c,
|
|
1454
|
+
h
|
|
1455
|
+
), te = v(() => ({
|
|
1456
|
+
top: Ko(h.value.margins),
|
|
1457
|
+
right: Jo(h.value.margins),
|
|
1458
|
+
bottom: Qo(h.value.margins, O.value),
|
|
1459
|
+
left: qo(h.value.margins, b.value)
|
|
1460
|
+
})), F = v(() => {
|
|
1461
|
+
var L;
|
|
1462
|
+
return t.xScale ? Lt(t.xScale) ? t.xScale : (L = t.xScale) == null ? void 0 : L.call(t, $.value, l.value, D) : G.value;
|
|
1463
|
+
}), J = v(() => {
|
|
1464
|
+
var L;
|
|
1465
|
+
return t.yScale ? Lt(t.yScale) ? t.yScale : (L = t.yScale) == null ? void 0 : L.call(t, $.value, l.value, D) : U.value;
|
|
1466
|
+
}), Te = v(() => ({
|
|
1467
|
+
...h.value.xAxisOptions,
|
|
1468
|
+
withHover: c.value === B.VERTICAL
|
|
1469
|
+
})), Le = v(() => ({
|
|
1470
|
+
...h.value.yAxisOptions,
|
|
1471
|
+
withHover: c.value === B.HORIZONTAL
|
|
1472
|
+
})), ge = v(() => {
|
|
1473
|
+
var L;
|
|
1474
|
+
return (L = h.value.xAxisOptions) == null ? void 0 : L.title;
|
|
1475
|
+
}), M = v(() => {
|
|
1476
|
+
var L;
|
|
1477
|
+
return (L = h.value.yAxisOptions) == null ? void 0 : L.title;
|
|
1478
|
+
}), k = v(() => {
|
|
1479
|
+
var L;
|
|
1480
|
+
return ((L = h.value.xAxisOptions) == null ? void 0 : L.withTitle) !== !1 && ge.value;
|
|
1481
|
+
}), E = v(() => {
|
|
1482
|
+
var L;
|
|
1483
|
+
return ((L = h.value.yAxisOptions) == null ? void 0 : L.withTitle) !== !1 && M.value;
|
|
1484
|
+
}), _ = v(
|
|
1485
|
+
() => r.value.every((L) => !L.values.length)
|
|
1486
|
+
), P = v(() => {
|
|
1487
|
+
const L = [], { noBaseScales: A } = h.value;
|
|
1488
|
+
return A || L.push(() => !!(F.value && J.value)), L.every((I) => I() === !0);
|
|
1489
|
+
}), { hasNegativeValues: Y } = zo($), { negativeBarAttributes: ie } = Zo(
|
|
1490
|
+
D,
|
|
1491
|
+
F,
|
|
1492
|
+
J,
|
|
1493
|
+
c
|
|
1494
|
+
), { shouldGenerateTooltipAnchors: Pe } = Xt(
|
|
1495
|
+
m,
|
|
1485
1496
|
h,
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
), { tooltipConfig:
|
|
1493
|
-
() =>
|
|
1494
|
-
),
|
|
1497
|
+
F,
|
|
1498
|
+
J,
|
|
1499
|
+
c,
|
|
1500
|
+
$,
|
|
1501
|
+
p,
|
|
1502
|
+
l
|
|
1503
|
+
), { tooltipConfig: Oe, showTooltip: Me, hideTooltip: tn } = Xo(), { getTooltipItems: ct } = Yo($), nn = v(
|
|
1504
|
+
() => h.value.withTooltip !== !1 && Oe.opened
|
|
1505
|
+
), dt = v(
|
|
1495
1506
|
() => {
|
|
1496
|
-
var
|
|
1497
|
-
return ((
|
|
1507
|
+
var L;
|
|
1508
|
+
return ((L = h.value.tooltipOptions) == null ? void 0 : L.position) || "top";
|
|
1498
1509
|
}
|
|
1499
|
-
),
|
|
1510
|
+
), on = v(() => {
|
|
1500
1511
|
var A;
|
|
1501
|
-
const
|
|
1502
|
-
return
|
|
1512
|
+
const L = (A = h.value.tooltipOptions) == null ? void 0 : A.withPointerEvents;
|
|
1513
|
+
return Oe.opened && (!L || L && T.value === !1);
|
|
1503
1514
|
});
|
|
1504
|
-
function Re(
|
|
1505
|
-
var
|
|
1506
|
-
if (
|
|
1515
|
+
function Re(L) {
|
|
1516
|
+
var I;
|
|
1517
|
+
if (L === u.value)
|
|
1507
1518
|
return;
|
|
1508
|
-
const A =
|
|
1509
|
-
if (
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1519
|
+
const A = u.value;
|
|
1520
|
+
if (h.value.withHover !== !1 && (u.value = L), h.value.withTooltip !== !1) {
|
|
1521
|
+
const Ve = (I = h.value.tooltipOptions) != null && I.targetElement ? h.value.tooltipOptions.targetElement === "self" ? g.value.$el : h.value.tooltipOptions.targetElement : f.value[L];
|
|
1522
|
+
Me(Ve);
|
|
1512
1523
|
}
|
|
1513
|
-
|
|
1524
|
+
a("hovered-index-changed", { newIndex: L, oldIndex: A });
|
|
1514
1525
|
}
|
|
1515
|
-
function
|
|
1516
|
-
|
|
1526
|
+
function vt() {
|
|
1527
|
+
tn(), u.value = -1;
|
|
1517
1528
|
}
|
|
1518
|
-
function
|
|
1519
|
-
if (
|
|
1520
|
-
|
|
1529
|
+
function mt(L) {
|
|
1530
|
+
if (L > r.value[0].values.length - 1) {
|
|
1531
|
+
ye(pe.InvalidHoveredIndex);
|
|
1521
1532
|
return;
|
|
1522
1533
|
}
|
|
1523
|
-
Re(
|
|
1534
|
+
Re(L);
|
|
1524
1535
|
}
|
|
1525
|
-
function
|
|
1536
|
+
function an() {
|
|
1526
1537
|
setTimeout(() => {
|
|
1527
|
-
|
|
1538
|
+
on.value && vt(), a("chart-mouseleave");
|
|
1528
1539
|
}, 0);
|
|
1529
1540
|
}
|
|
1530
|
-
function
|
|
1531
|
-
|
|
1541
|
+
function pt({ index: L, value: A, event: I }) {
|
|
1542
|
+
L !== null && Re(L), a("axis-mouseenter", { index: L, value: A, event: I });
|
|
1532
1543
|
}
|
|
1533
|
-
function
|
|
1534
|
-
|
|
1544
|
+
function ft({ index: L, value: A, event: I }) {
|
|
1545
|
+
a("axis-click", { index: L, value: A, event: I });
|
|
1535
1546
|
}
|
|
1536
|
-
return
|
|
1547
|
+
return K(
|
|
1548
|
+
r,
|
|
1549
|
+
(L, A) => a("data-changed", { newValue: L, oldValue: A })
|
|
1550
|
+
), K(
|
|
1537
1551
|
l,
|
|
1538
|
-
(
|
|
1539
|
-
),
|
|
1540
|
-
|
|
1541
|
-
(
|
|
1542
|
-
|
|
1543
|
-
h,
|
|
1544
|
-
(T) => {
|
|
1545
|
-
T && n.hoveredIndex != null && v.value === -1 && ct(n.hoveredIndex);
|
|
1552
|
+
(L, A) => a("labels-changed", { newValue: L, oldValue: A })
|
|
1553
|
+
), K(_, (L) => L && ye(pe.Empty), { immediate: !0 }), K(() => t.hoveredIndex, mt), K(
|
|
1554
|
+
m,
|
|
1555
|
+
(L) => {
|
|
1556
|
+
L && t.hoveredIndex != null && u.value === -1 && mt(t.hoveredIndex);
|
|
1546
1557
|
},
|
|
1547
1558
|
{ flush: "post" }
|
|
1548
|
-
),
|
|
1549
|
-
|
|
1559
|
+
), K(T, (L) => {
|
|
1560
|
+
L === !1 && Oe.opened && vt();
|
|
1550
1561
|
}), fe(async () => {
|
|
1551
|
-
|
|
1552
|
-
}),
|
|
1553
|
-
id: `lume-chart_${
|
|
1562
|
+
a("rendered"), o.groups || console.error('"groups" `<slot>` must have content.');
|
|
1563
|
+
}), Fe("chartID", H), Fe("isEmpty", _), Fe("tooltipAnchorAttributes", m), (L, A) => (y(), X(d(ao), {
|
|
1564
|
+
id: `lume-chart_${d(H)}`,
|
|
1554
1565
|
ref_key: "chartContainer",
|
|
1555
|
-
ref:
|
|
1556
|
-
margins:
|
|
1557
|
-
"container-size":
|
|
1558
|
-
"no-min-size":
|
|
1559
|
-
"transparent-background":
|
|
1566
|
+
ref: g,
|
|
1567
|
+
margins: te.value,
|
|
1568
|
+
"container-size": d(D),
|
|
1569
|
+
"no-min-size": d(h).noMinSize,
|
|
1570
|
+
"transparent-background": d(h).transparentBackground,
|
|
1560
1571
|
"data-j-lume-chart": "",
|
|
1561
|
-
onResize:
|
|
1562
|
-
onClick: A[24] || (A[24] = (
|
|
1563
|
-
onMouseenter: A[25] || (A[25] = (
|
|
1564
|
-
onMouseleave:
|
|
1572
|
+
onResize: d(N),
|
|
1573
|
+
onClick: A[24] || (A[24] = (I) => a("chart-click", I)),
|
|
1574
|
+
onMouseenter: A[25] || (A[25] = (I) => a("chart-mouseenter", I)),
|
|
1575
|
+
onMouseleave: an
|
|
1565
1576
|
}, {
|
|
1566
|
-
header:
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
S(
|
|
1577
|
+
header: V(() => [
|
|
1578
|
+
j("div", ea, [
|
|
1579
|
+
j("div", ta, [
|
|
1580
|
+
L.title ? (y(), x("h1", na, oe(L.title), 1)) : z("", !0),
|
|
1581
|
+
j("div", oa, [
|
|
1582
|
+
S(L.$slots, "controls", {}, void 0, !0)
|
|
1572
1583
|
])
|
|
1573
1584
|
]),
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
S(
|
|
1577
|
-
|
|
1585
|
+
j("div", aa, [
|
|
1586
|
+
E.value ? (y(), x("h3", la, oe(M.value), 1)) : z("", !0),
|
|
1587
|
+
S(L.$slots, "legend", { data: d($) }, () => [
|
|
1588
|
+
d(h).withLegend !== !1 && d(h).legendPosition !== "bottom" ? (y(), X(d(yt), {
|
|
1578
1589
|
key: 0,
|
|
1579
|
-
data:
|
|
1590
|
+
data: d($),
|
|
1580
1591
|
class: "lume-chart__legend",
|
|
1581
1592
|
"data-j-lume-chart__legend": "",
|
|
1582
|
-
onClick: A[0] || (A[0] = (
|
|
1583
|
-
onMouseenter: A[1] || (A[1] = (
|
|
1584
|
-
onMouseleave: A[2] || (A[2] = (
|
|
1585
|
-
}, null, 8, ["data"])) :
|
|
1593
|
+
onClick: A[0] || (A[0] = (I) => a("legend-click", I)),
|
|
1594
|
+
onMouseenter: A[1] || (A[1] = (I) => a("legend-mouseenter", I)),
|
|
1595
|
+
onMouseleave: A[2] || (A[2] = (I) => a("legend-mouseleave"))
|
|
1596
|
+
}, null, 8, ["data"])) : z("", !0)
|
|
1586
1597
|
], !0)
|
|
1587
1598
|
])
|
|
1588
1599
|
])
|
|
1589
1600
|
]),
|
|
1590
|
-
footer:
|
|
1591
|
-
|
|
1592
|
-
|
|
1601
|
+
footer: V(() => [
|
|
1602
|
+
k.value ? (y(), x("h3", ia, oe(ge.value), 1)) : z("", !0),
|
|
1603
|
+
d(h).withLegend !== !1 && d(h).legendPosition == "bottom" ? (y(), X(d(yt), {
|
|
1593
1604
|
key: 1,
|
|
1594
|
-
data:
|
|
1605
|
+
data: d($),
|
|
1595
1606
|
class: "lume-chart__legend lume-chart__legend--bottom",
|
|
1596
1607
|
"data-j-lume-chart__legend": "",
|
|
1597
|
-
onClick: A[16] || (A[16] = (
|
|
1598
|
-
onMouseenter: A[17] || (A[17] = (
|
|
1599
|
-
onMouseleave: A[18] || (A[18] = (
|
|
1600
|
-
}, null, 8, ["data"])) :
|
|
1608
|
+
onClick: A[16] || (A[16] = (I) => a("legend-click", I)),
|
|
1609
|
+
onMouseenter: A[17] || (A[17] = (I) => a("legend-mouseenter", I)),
|
|
1610
|
+
onMouseleave: A[18] || (A[18] = (I) => a("legend-mouseleave"))
|
|
1611
|
+
}, null, 8, ["data"])) : z("", !0)
|
|
1601
1612
|
]),
|
|
1602
|
-
extra:
|
|
1603
|
-
S(
|
|
1604
|
-
data:
|
|
1605
|
-
labels:
|
|
1606
|
-
title:
|
|
1607
|
-
items:
|
|
1608
|
-
position:
|
|
1609
|
-
withTooltip:
|
|
1610
|
-
hoveredIndex:
|
|
1611
|
-
handleMouseEnter: () =>
|
|
1612
|
-
handleMouseLeave: () =>
|
|
1613
|
-
options:
|
|
1613
|
+
extra: V(() => [
|
|
1614
|
+
S(L.$slots, "tooltip", C(d(Oe), {
|
|
1615
|
+
data: d($),
|
|
1616
|
+
labels: d(w),
|
|
1617
|
+
title: d(w)[u.value],
|
|
1618
|
+
items: d(ct)(u.value),
|
|
1619
|
+
position: dt.value,
|
|
1620
|
+
withTooltip: d(h).withTooltip !== !1,
|
|
1621
|
+
hoveredIndex: u.value,
|
|
1622
|
+
handleMouseEnter: () => T.value = !0,
|
|
1623
|
+
handleMouseLeave: () => T.value = !1,
|
|
1624
|
+
options: d(h).tooltipOptions
|
|
1614
1625
|
}), () => [
|
|
1615
|
-
|
|
1616
|
-
position:
|
|
1617
|
-
title:
|
|
1618
|
-
items:
|
|
1619
|
-
options:
|
|
1626
|
+
nn.value ? (y(), X(d(Io), C({ key: 0 }, d(Oe), {
|
|
1627
|
+
position: dt.value,
|
|
1628
|
+
title: d(w)[u.value],
|
|
1629
|
+
items: d(ct)(u.value),
|
|
1630
|
+
options: d(h).tooltipOptions,
|
|
1620
1631
|
"data-j-lume-chart__tooltip": "",
|
|
1621
|
-
onOpened: A[19] || (A[19] = (
|
|
1622
|
-
index:
|
|
1623
|
-
targetElement:
|
|
1632
|
+
onOpened: A[19] || (A[19] = (I) => a("tooltip-opened", {
|
|
1633
|
+
index: u.value,
|
|
1634
|
+
targetElement: I
|
|
1624
1635
|
})),
|
|
1625
|
-
onMoved: A[20] || (A[20] = (
|
|
1626
|
-
index:
|
|
1627
|
-
targetElement:
|
|
1636
|
+
onMoved: A[20] || (A[20] = (I) => a("tooltip-moved", {
|
|
1637
|
+
index: u.value,
|
|
1638
|
+
targetElement: I
|
|
1628
1639
|
})),
|
|
1629
|
-
onClosed: A[21] || (A[21] = (
|
|
1630
|
-
onTooltipMouseenter: A[22] || (A[22] = (
|
|
1631
|
-
onTooltipMouseleave: A[23] || (A[23] = (
|
|
1640
|
+
onClosed: A[21] || (A[21] = (I) => a("tooltip-closed")),
|
|
1641
|
+
onTooltipMouseenter: A[22] || (A[22] = (I) => T.value = !0),
|
|
1642
|
+
onTooltipMouseleave: A[23] || (A[23] = (I) => T.value = !1)
|
|
1632
1643
|
}), {
|
|
1633
|
-
default:
|
|
1634
|
-
S(
|
|
1635
|
-
data:
|
|
1636
|
-
labels:
|
|
1637
|
-
hoveredIndex:
|
|
1644
|
+
default: V(() => [
|
|
1645
|
+
S(L.$slots, "tooltip-content", {
|
|
1646
|
+
data: d($),
|
|
1647
|
+
labels: d(w),
|
|
1648
|
+
hoveredIndex: u.value
|
|
1638
1649
|
}, void 0, !0)
|
|
1639
1650
|
]),
|
|
1640
1651
|
_: 3
|
|
1641
|
-
}, 16, ["position", "title", "items", "options"])) :
|
|
1652
|
+
}, 16, ["position", "title", "items", "options"])) : z("", !0)
|
|
1642
1653
|
], !0)
|
|
1643
1654
|
]),
|
|
1644
|
-
default:
|
|
1645
|
-
|
|
1646
|
-
|
|
1655
|
+
default: V(() => [
|
|
1656
|
+
P.value ? (y(), x(Q, { key: 0 }, [
|
|
1657
|
+
d(Y) ? (y(), X(d(rt), C({ key: 0 }, d(ie), {
|
|
1647
1658
|
"class-list": "lume-fill--negative",
|
|
1648
1659
|
transition: !1,
|
|
1649
1660
|
"data-j-lume-chart__negative-values": ""
|
|
1650
|
-
}), null, 16)) :
|
|
1651
|
-
|
|
1661
|
+
}), null, 16)) : z("", !0),
|
|
1662
|
+
d(h).withAxes !== !1 ? S(L.$slots, "axes", {
|
|
1652
1663
|
key: 1,
|
|
1653
|
-
xScale:
|
|
1654
|
-
yScale:
|
|
1655
|
-
containerSize:
|
|
1656
|
-
options:
|
|
1657
|
-
hoveredIndex:
|
|
1664
|
+
xScale: F.value,
|
|
1665
|
+
yScale: J.value,
|
|
1666
|
+
containerSize: d(D),
|
|
1667
|
+
options: d(h),
|
|
1668
|
+
hoveredIndex: u.value
|
|
1658
1669
|
}, () => [
|
|
1659
|
-
re(
|
|
1670
|
+
re(d(_t), {
|
|
1660
1671
|
type: "x",
|
|
1661
|
-
scale:
|
|
1662
|
-
"container-size":
|
|
1663
|
-
options:
|
|
1664
|
-
"hovered-index":
|
|
1665
|
-
orientation:
|
|
1672
|
+
scale: F.value,
|
|
1673
|
+
"container-size": d(D),
|
|
1674
|
+
options: Te.value,
|
|
1675
|
+
"hovered-index": u.value,
|
|
1676
|
+
orientation: d(c),
|
|
1666
1677
|
"data-j-lume-chart__x-axis": "",
|
|
1667
|
-
onClick:
|
|
1668
|
-
onMouseenter:
|
|
1669
|
-
onMouseleave: A[3] || (A[3] = (
|
|
1670
|
-
"onLume__internal-AxisSize": A[4] || (A[4] = (
|
|
1678
|
+
onClick: ft,
|
|
1679
|
+
onMouseenter: pt,
|
|
1680
|
+
onMouseleave: A[3] || (A[3] = (I) => a("axis-mouseleave")),
|
|
1681
|
+
"onLume__internal-AxisSize": A[4] || (A[4] = (I) => O.value = I)
|
|
1671
1682
|
}, null, 8, ["scale", "container-size", "options", "hovered-index", "orientation"]),
|
|
1672
|
-
re(
|
|
1683
|
+
re(d(_t), {
|
|
1673
1684
|
type: "y",
|
|
1674
|
-
scale:
|
|
1675
|
-
"container-size":
|
|
1676
|
-
options:
|
|
1677
|
-
"hovered-index":
|
|
1678
|
-
orientation:
|
|
1685
|
+
scale: J.value,
|
|
1686
|
+
"container-size": d(D),
|
|
1687
|
+
options: Le.value,
|
|
1688
|
+
"hovered-index": u.value,
|
|
1689
|
+
orientation: d(c),
|
|
1679
1690
|
"data-j-lume-chart__y-axis": "",
|
|
1680
|
-
onClick:
|
|
1681
|
-
onMouseenter:
|
|
1682
|
-
onMouseleave: A[5] || (A[5] = (
|
|
1683
|
-
"onLume__internal-AxisSize": A[6] || (A[6] = (
|
|
1691
|
+
onClick: ft,
|
|
1692
|
+
onMouseenter: pt,
|
|
1693
|
+
onMouseleave: A[5] || (A[5] = (I) => a("axis-mouseleave")),
|
|
1694
|
+
"onLume__internal-AxisSize": A[6] || (A[6] = (I) => b.value = I)
|
|
1684
1695
|
}, null, 8, ["scale", "container-size", "options", "hovered-index", "orientation"])
|
|
1685
|
-
], !0) :
|
|
1686
|
-
|
|
1696
|
+
], !0) : z("", !0),
|
|
1697
|
+
d(h).withHover !== !1 ? (y(), X(d(Fo), {
|
|
1687
1698
|
key: 2,
|
|
1688
|
-
data:
|
|
1689
|
-
orientation:
|
|
1690
|
-
"x-scale":
|
|
1691
|
-
"y-scale":
|
|
1699
|
+
data: d($),
|
|
1700
|
+
orientation: d(c),
|
|
1701
|
+
"x-scale": F.value,
|
|
1702
|
+
"y-scale": J.value,
|
|
1692
1703
|
"data-j-lume-chart__overlay-group": "",
|
|
1693
1704
|
"onLume__internal-Hover": Re
|
|
1694
|
-
}, null, 8, ["data", "orientation", "x-scale", "y-scale"])) :
|
|
1695
|
-
|
|
1696
|
-
(y(!0),
|
|
1705
|
+
}, null, 8, ["data", "orientation", "x-scale", "y-scale"])) : z("", !0),
|
|
1706
|
+
d(Pe) ? (y(), x("g", ra, [
|
|
1707
|
+
(y(!0), x(Q, null, Z(m.value, (I, Ve) => (y(), x("circle", C(I, {
|
|
1697
1708
|
ref_for: !0,
|
|
1698
1709
|
ref_key: "tooltipAnchor",
|
|
1699
|
-
ref:
|
|
1700
|
-
key: `anchor_${
|
|
1701
|
-
r:
|
|
1710
|
+
ref: f,
|
|
1711
|
+
key: `anchor_${Ve}`,
|
|
1712
|
+
r: d(Sn),
|
|
1702
1713
|
class: "lume-fill--transparent"
|
|
1703
|
-
}), null, 16,
|
|
1704
|
-
])) :
|
|
1705
|
-
S(
|
|
1706
|
-
data:
|
|
1707
|
-
labels:
|
|
1708
|
-
options:
|
|
1709
|
-
orientation:
|
|
1710
|
-
xScale:
|
|
1711
|
-
yScale:
|
|
1712
|
-
hoveredIndex:
|
|
1713
|
-
containerSize:
|
|
1714
|
-
transition:
|
|
1715
|
-
classList:
|
|
1716
|
-
onNodeClick: A[7] || (A[7] = (
|
|
1717
|
-
onNodeMouseenter: A[8] || (A[8] = (
|
|
1718
|
-
onNodeMouseleave: A[9] || (A[9] = (
|
|
1719
|
-
onLinkClick: A[10] || (A[10] = (
|
|
1720
|
-
onLinkMouseenter: A[11] || (A[11] = (
|
|
1721
|
-
onLinkMouseleave: A[12] || (A[12] = (
|
|
1722
|
-
onBarClick: A[13] || (A[13] = (
|
|
1723
|
-
onLineClick: A[14] || (A[14] = (
|
|
1724
|
-
onPointClick: A[15] || (A[15] = (
|
|
1714
|
+
}), null, 16, ua))), 128))
|
|
1715
|
+
])) : z("", !0),
|
|
1716
|
+
S(L.$slots, "groups", {
|
|
1717
|
+
data: d($),
|
|
1718
|
+
labels: d(w),
|
|
1719
|
+
options: d(h),
|
|
1720
|
+
orientation: d(c),
|
|
1721
|
+
xScale: F.value,
|
|
1722
|
+
yScale: J.value,
|
|
1723
|
+
hoveredIndex: u.value,
|
|
1724
|
+
containerSize: d(D),
|
|
1725
|
+
transition: d(h).withTransition !== !1,
|
|
1726
|
+
classList: L.classList,
|
|
1727
|
+
onNodeClick: A[7] || (A[7] = (I) => a("node-click", I)),
|
|
1728
|
+
onNodeMouseenter: A[8] || (A[8] = (I) => a("node-mouseenter", I)),
|
|
1729
|
+
onNodeMouseleave: A[9] || (A[9] = (I) => a("node-mouseleave", I)),
|
|
1730
|
+
onLinkClick: A[10] || (A[10] = (I) => a("link-click", I)),
|
|
1731
|
+
onLinkMouseenter: A[11] || (A[11] = (I) => a("link-mouseenter", I)),
|
|
1732
|
+
onLinkMouseleave: A[12] || (A[12] = (I) => a("link-mouseleave", I)),
|
|
1733
|
+
onBarClick: A[13] || (A[13] = (I) => a("bar-click", I)),
|
|
1734
|
+
onLineClick: A[14] || (A[14] = (I) => a("line-click", I)),
|
|
1735
|
+
onPointClick: A[15] || (A[15] = (I) => a("point-click", I)),
|
|
1725
1736
|
"onLume__internal-Hover": Re
|
|
1726
1737
|
}, void 0, !0)
|
|
1727
|
-
], 64)) :
|
|
1738
|
+
], 64)) : z("", !0)
|
|
1728
1739
|
]),
|
|
1729
1740
|
_: 3
|
|
1730
1741
|
}, 8, ["id", "margins", "container-size", "no-min-size", "transparent-background", "onResize"]));
|
|
1731
1742
|
}
|
|
1732
1743
|
});
|
|
1733
|
-
const
|
|
1744
|
+
const Ie = /* @__PURE__ */ q(sa, [["__scopeId", "data-v-42aac599"]]), ca = ["dy"], da = /* @__PURE__ */ W({
|
|
1734
1745
|
__name: "lume-alluvial-node-label",
|
|
1735
1746
|
props: {
|
|
1736
1747
|
bottom: { type: Boolean, default: !1 }
|
|
1737
1748
|
},
|
|
1738
1749
|
setup(e) {
|
|
1739
|
-
return (
|
|
1750
|
+
return (n, t) => (y(), x("text", {
|
|
1740
1751
|
class: "lume-alluvial-group__node-label",
|
|
1741
1752
|
dy: e.bottom ? "1.2em" : ""
|
|
1742
1753
|
}, [
|
|
1743
|
-
S(
|
|
1744
|
-
], 8,
|
|
1754
|
+
S(n.$slots, "default", {}, void 0, !0)
|
|
1755
|
+
], 8, ca));
|
|
1745
1756
|
}
|
|
1746
1757
|
});
|
|
1747
|
-
const
|
|
1758
|
+
const va = /* @__PURE__ */ q(da, [["__scopeId", "data-v-d2a7cb8e"]]), ma = ["dy"], pa = /* @__PURE__ */ W({
|
|
1748
1759
|
__name: "lume-alluvial-node-value",
|
|
1749
1760
|
props: {
|
|
1750
1761
|
bottom: { type: Boolean, default: !0 }
|
|
1751
1762
|
},
|
|
1752
1763
|
setup(e) {
|
|
1753
|
-
return (
|
|
1764
|
+
return (n, t) => (y(), x("text", {
|
|
1754
1765
|
class: "lume-alluvial-group__node-value",
|
|
1755
1766
|
dy: e.bottom ? "1.2em" : ""
|
|
1756
1767
|
}, [
|
|
1757
|
-
S(
|
|
1758
|
-
], 8,
|
|
1768
|
+
S(n.$slots, "default", {}, void 0, !0)
|
|
1769
|
+
], 8, ma));
|
|
1759
1770
|
}
|
|
1760
1771
|
});
|
|
1761
|
-
const
|
|
1762
|
-
function
|
|
1772
|
+
const fa = /* @__PURE__ */ q(pa, [["__scopeId", "data-v-002e2887"]]);
|
|
1773
|
+
function xt(e, n) {
|
|
1763
1774
|
return {
|
|
1764
|
-
x0: 0 + (
|
|
1765
|
-
y0: 0 + (
|
|
1766
|
-
x1: e.width - (
|
|
1767
|
-
y1: e.height - (
|
|
1775
|
+
x0: 0 + (n ? n.left : 0),
|
|
1776
|
+
y0: 0 + (n ? n.top : 0),
|
|
1777
|
+
x1: e.width - (n ? n.right : 0),
|
|
1778
|
+
y1: e.height - (n ? n.bottom : 0)
|
|
1768
1779
|
};
|
|
1769
1780
|
}
|
|
1770
|
-
function
|
|
1771
|
-
const
|
|
1772
|
-
function
|
|
1773
|
-
|
|
1781
|
+
function ha(e) {
|
|
1782
|
+
const n = R(xt(e));
|
|
1783
|
+
function t(o) {
|
|
1784
|
+
n.value = xt(e, o);
|
|
1774
1785
|
}
|
|
1775
|
-
return { extents:
|
|
1786
|
+
return { extents: n, updateExtents: t };
|
|
1776
1787
|
}
|
|
1777
|
-
var
|
|
1778
|
-
const
|
|
1779
|
-
function
|
|
1780
|
-
|
|
1788
|
+
var Yt = /* @__PURE__ */ ((e) => (e.GraphProblem = "There was an issue generating your alluvial graph.", e))(Yt || {});
|
|
1789
|
+
const ga = "[lume] ";
|
|
1790
|
+
function _a(e, n, t = !0) {
|
|
1791
|
+
t && Mt() || console.error(ga + "Error: " + e, n);
|
|
1781
1792
|
}
|
|
1782
|
-
const
|
|
1783
|
-
function
|
|
1793
|
+
const It = 8, ya = 8, ka = 20, Ze = 2, ba = 200;
|
|
1794
|
+
function $e(e) {
|
|
1784
1795
|
return typeof e == "string" || typeof e == "number" ? e : e.id ?? e.label;
|
|
1785
1796
|
}
|
|
1786
|
-
function
|
|
1787
|
-
return
|
|
1797
|
+
function Aa(e, n) {
|
|
1798
|
+
return n.nodes.find((t) => t.id === e);
|
|
1788
1799
|
}
|
|
1789
|
-
function
|
|
1790
|
-
return
|
|
1800
|
+
function Ta(e, n) {
|
|
1801
|
+
return n.links.find((t) => t.id === e);
|
|
1791
1802
|
}
|
|
1792
|
-
function
|
|
1803
|
+
function Kt(e) {
|
|
1793
1804
|
return !!(e.sourceLinks && e.targetLinks);
|
|
1794
1805
|
}
|
|
1795
|
-
function
|
|
1796
|
-
if (!
|
|
1806
|
+
function La(e, n) {
|
|
1807
|
+
if (!n)
|
|
1797
1808
|
return;
|
|
1798
|
-
const
|
|
1799
|
-
(
|
|
1809
|
+
const t = 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 = n.filter((l) => t.includes(l.dataset.id)).reduce(
|
|
1810
|
+
(l, i) => Math.max(l, i.getBBox().width),
|
|
1800
1811
|
-1 / 0
|
|
1801
|
-
),
|
|
1802
|
-
(
|
|
1812
|
+
), r = n.filter((l) => o.includes(l.dataset.id)).reduce(
|
|
1813
|
+
(l, i) => Math.max(l, i.getBBox().width),
|
|
1803
1814
|
-1 / 0
|
|
1804
1815
|
);
|
|
1805
1816
|
return {
|
|
1806
|
-
left:
|
|
1817
|
+
left: a,
|
|
1807
1818
|
top: 0,
|
|
1808
|
-
right:
|
|
1819
|
+
right: r,
|
|
1809
1820
|
bottom: 0
|
|
1810
1821
|
};
|
|
1811
1822
|
}
|
|
1812
|
-
function
|
|
1813
|
-
return e.map((
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1823
|
+
function Oa(e) {
|
|
1824
|
+
return e.map((n) => {
|
|
1825
|
+
const t = n.y1 - n.y0 < Ze;
|
|
1826
|
+
return {
|
|
1827
|
+
x: n.x0,
|
|
1828
|
+
y: n.y0 - (t ? Ze / 2 : 0),
|
|
1829
|
+
// Negative offset to account for the min. height
|
|
1830
|
+
width: n.x1 - n.x0,
|
|
1831
|
+
height: t ? Ze : n.y1 - n.y0,
|
|
1832
|
+
textTransform: {
|
|
1833
|
+
x: n.depth > 0 ? n.x1 + It : n.x0 - It,
|
|
1834
|
+
y: (n.y1 + n.y0) / 2
|
|
1835
|
+
},
|
|
1836
|
+
node: n
|
|
1837
|
+
};
|
|
1838
|
+
});
|
|
1824
1839
|
}
|
|
1825
|
-
function
|
|
1840
|
+
function $a(e) {
|
|
1826
1841
|
return [e.source.x1, e.y0];
|
|
1827
1842
|
}
|
|
1828
|
-
function
|
|
1843
|
+
function xa(e) {
|
|
1829
1844
|
return [e.target.x0, e.y1];
|
|
1830
1845
|
}
|
|
1831
|
-
function
|
|
1832
|
-
return e.curveFunction ?
|
|
1846
|
+
function Ia(e) {
|
|
1847
|
+
return e.curveFunction ? mn(e.curveFunction).source($a).target(xa) : gn();
|
|
1833
1848
|
}
|
|
1834
|
-
function
|
|
1835
|
-
return e.map((
|
|
1836
|
-
var
|
|
1849
|
+
function wa(e) {
|
|
1850
|
+
return e.map((n) => {
|
|
1851
|
+
var t;
|
|
1837
1852
|
return {
|
|
1838
|
-
id:
|
|
1839
|
-
color:
|
|
1840
|
-
d:
|
|
1841
|
-
strokeWidth: Math.max(1,
|
|
1842
|
-
link:
|
|
1853
|
+
id: n.id,
|
|
1854
|
+
color: n.color || ((t = n.source) == null ? void 0 : t.color) || Be,
|
|
1855
|
+
d: Ia(n)(n),
|
|
1856
|
+
strokeWidth: Math.max(1, n.width),
|
|
1857
|
+
link: n
|
|
1843
1858
|
};
|
|
1844
1859
|
});
|
|
1845
1860
|
}
|
|
1846
|
-
function
|
|
1861
|
+
function wt(e, n, t, o, a) {
|
|
1847
1862
|
if (o === !1) {
|
|
1848
1863
|
e.node = {
|
|
1849
1864
|
...e.node,
|
|
1850
|
-
transitionValue:
|
|
1865
|
+
transitionValue: a ? void 0 : t
|
|
1851
1866
|
};
|
|
1852
1867
|
return;
|
|
1853
1868
|
}
|
|
1854
|
-
const
|
|
1855
|
-
let
|
|
1856
|
-
|
|
1869
|
+
const r = Date.now(), l = wn(n, t), i = () => {
|
|
1870
|
+
let c = (Date.now() - r) / ba;
|
|
1871
|
+
c > 1 && (c = 1), e.node = {
|
|
1857
1872
|
...e.node,
|
|
1858
|
-
transitionValue:
|
|
1859
|
-
},
|
|
1873
|
+
transitionValue: a && c === 1 ? void 0 : l(c)
|
|
1874
|
+
}, c < 1 && requestAnimationFrame(i);
|
|
1860
1875
|
};
|
|
1861
|
-
requestAnimationFrame(
|
|
1876
|
+
requestAnimationFrame(i);
|
|
1862
1877
|
}
|
|
1863
|
-
const
|
|
1878
|
+
const Ea = {
|
|
1864
1879
|
nodes: [],
|
|
1865
1880
|
links: []
|
|
1866
1881
|
};
|
|
1867
|
-
function
|
|
1868
|
-
return
|
|
1869
|
-
}
|
|
1870
|
-
function
|
|
1871
|
-
const o =
|
|
1872
|
-
var
|
|
1873
|
-
return (
|
|
1874
|
-
({ label:
|
|
1875
|
-
label:
|
|
1876
|
-
color:
|
|
1877
|
-
fallbackColor:
|
|
1878
|
-
id:
|
|
1879
|
-
deriveColorFromIncomingLinks:
|
|
1880
|
-
offset:
|
|
1882
|
+
function Et(e, n) {
|
|
1883
|
+
return n.find((t) => t.every((o) => o.x0 === e.x0));
|
|
1884
|
+
}
|
|
1885
|
+
function Na(e, n, t) {
|
|
1886
|
+
const o = R(null), a = v(() => {
|
|
1887
|
+
var u;
|
|
1888
|
+
return (u = e.value) == null ? void 0 : u[0].values.map(
|
|
1889
|
+
({ label: f, color: g, value: m, deriveColorFromIncomingLinks: T, offset: O }) => ({
|
|
1890
|
+
label: f || m.toString(),
|
|
1891
|
+
color: g,
|
|
1892
|
+
fallbackColor: g || Be,
|
|
1893
|
+
id: m,
|
|
1894
|
+
deriveColorFromIncomingLinks: T,
|
|
1895
|
+
offset: O
|
|
1881
1896
|
})
|
|
1882
1897
|
);
|
|
1883
|
-
}),
|
|
1898
|
+
}), r = v(
|
|
1884
1899
|
() => {
|
|
1885
|
-
var
|
|
1886
|
-
return (
|
|
1887
|
-
(
|
|
1888
|
-
var
|
|
1889
|
-
return (
|
|
1890
|
-
({ node:
|
|
1891
|
-
id: `${
|
|
1892
|
-
color:
|
|
1893
|
-
curveFunction:
|
|
1894
|
-
source:
|
|
1895
|
-
target:
|
|
1896
|
-
value:
|
|
1900
|
+
var u;
|
|
1901
|
+
return (u = e.value) == null ? void 0 : u[0].values.map(
|
|
1902
|
+
(f) => {
|
|
1903
|
+
var g;
|
|
1904
|
+
return (g = f.targets) == null ? void 0 : g.map(
|
|
1905
|
+
({ node: m, value: T, color: O, curveFunction: b }) => ({
|
|
1906
|
+
id: `${f.value}:${m}`,
|
|
1907
|
+
color: O,
|
|
1908
|
+
curveFunction: b,
|
|
1909
|
+
source: f.value ?? f.label,
|
|
1910
|
+
target: m,
|
|
1911
|
+
value: T
|
|
1897
1912
|
})
|
|
1898
1913
|
);
|
|
1899
1914
|
}
|
|
1900
1915
|
).filter(Boolean).flat();
|
|
1901
1916
|
}
|
|
1902
|
-
),
|
|
1903
|
-
var
|
|
1904
|
-
return (
|
|
1905
|
-
(
|
|
1906
|
-
const
|
|
1907
|
-
return
|
|
1917
|
+
), l = v(() => _n().nodeId($e).nodeAlign(n.value.nodeAlign).nodePadding(n.value.nodePadding).nodeSort(n.value.nodeSort).nodeWidth(n.value.nodeWidth).linkSort(n.value.linkSort).iterations(n.value.iterations)), i = v(() => {
|
|
1918
|
+
var u;
|
|
1919
|
+
return (u = o.value) == null ? void 0 : u.nodes.reduce(
|
|
1920
|
+
(f, g) => {
|
|
1921
|
+
const m = Et(g, f);
|
|
1922
|
+
return m ? (m.push(g), m.sort((T, O) => (T._y0 || T.y0) - (O._y0 || O.y0))) : f.push([g]), f;
|
|
1908
1923
|
},
|
|
1909
1924
|
[]
|
|
1910
1925
|
);
|
|
1911
1926
|
});
|
|
1912
|
-
function s(
|
|
1913
|
-
const { offset:
|
|
1914
|
-
if (!
|
|
1927
|
+
function s(u) {
|
|
1928
|
+
const { offset: f } = u, g = Et(u, i.value);
|
|
1929
|
+
if (!g)
|
|
1915
1930
|
return;
|
|
1916
|
-
const
|
|
1917
|
-
|
|
1918
|
-
}
|
|
1919
|
-
function
|
|
1920
|
-
const { id:
|
|
1921
|
-
(
|
|
1922
|
-
),
|
|
1923
|
-
(
|
|
1924
|
-
),
|
|
1925
|
-
|
|
1926
|
-
}
|
|
1927
|
-
const
|
|
1928
|
-
typeof
|
|
1931
|
+
const m = g[g.findIndex((O) => O.id === u.id) - 1], T = m && g.length !== 1 ? m.y1 + f : f;
|
|
1932
|
+
u._y0 = u.y0, u._y1 = u.y1, u.y0 = T, u.y1 = u.y0 + (u._y1 - u._y0);
|
|
1933
|
+
}
|
|
1934
|
+
function c(u, f) {
|
|
1935
|
+
const { id: g, _y0: m, y0: T } = u, O = f.links.filter(
|
|
1936
|
+
($) => $.source.id === g
|
|
1937
|
+
), b = f.links.filter(
|
|
1938
|
+
($) => $.target.id === g
|
|
1939
|
+
), h = T - m;
|
|
1940
|
+
O.forEach(($) => $.y0 += h), b.forEach(($) => $.y1 += h);
|
|
1941
|
+
}
|
|
1942
|
+
const p = v(() => (o.value && a.value.forEach((u) => {
|
|
1943
|
+
u.value === 0 && (u.fallbackColor = at.Grey), typeof u.offset == "number" && (s(u), c(u, o.value));
|
|
1929
1944
|
}), o.value));
|
|
1930
|
-
return
|
|
1945
|
+
return K([l, t], () => {
|
|
1931
1946
|
try {
|
|
1932
|
-
const { x0:
|
|
1933
|
-
o.value =
|
|
1934
|
-
[
|
|
1935
|
-
[
|
|
1936
|
-
])({ nodes:
|
|
1937
|
-
} catch (
|
|
1938
|
-
|
|
1947
|
+
const { x0: u, y0: f, x1: g, y1: m } = t.value;
|
|
1948
|
+
o.value = l.value.extent([
|
|
1949
|
+
[u, f],
|
|
1950
|
+
[g, m]
|
|
1951
|
+
])({ nodes: a.value, links: r.value });
|
|
1952
|
+
} catch (u) {
|
|
1953
|
+
_a(Yt.GraphProblem, u), o.value = Ea;
|
|
1939
1954
|
}
|
|
1940
|
-
}), { columns:
|
|
1955
|
+
}), { columns: i, graph: p };
|
|
1941
1956
|
}
|
|
1942
|
-
function
|
|
1943
|
-
return
|
|
1944
|
-
t
|
|
1945
|
-
|
|
1946
|
-
|
|
1957
|
+
function et(e, n) {
|
|
1958
|
+
return n || (n = {}), e.targetLinks && e.targetLinks.forEach(({ source: t, value: o }) => {
|
|
1959
|
+
n[t.id] = o, et(
|
|
1960
|
+
t,
|
|
1961
|
+
n
|
|
1947
1962
|
);
|
|
1948
|
-
}),
|
|
1963
|
+
}), n;
|
|
1949
1964
|
}
|
|
1950
|
-
function
|
|
1951
|
-
return
|
|
1952
|
-
t
|
|
1953
|
-
|
|
1954
|
-
|
|
1965
|
+
function tt(e, n) {
|
|
1966
|
+
return n || (n = {}), e.sourceLinks && e.sourceLinks.forEach(({ target: t, value: o }) => {
|
|
1967
|
+
n[t.id] = o, tt(
|
|
1968
|
+
t,
|
|
1969
|
+
n
|
|
1955
1970
|
);
|
|
1956
|
-
}),
|
|
1971
|
+
}), n;
|
|
1957
1972
|
}
|
|
1958
|
-
function
|
|
1959
|
-
return
|
|
1973
|
+
function Da(e, n) {
|
|
1974
|
+
return n.links.reduce((t, o) => (o.source.id in e && o.target.id in e && t.push(o.id), t), []);
|
|
1960
1975
|
}
|
|
1961
|
-
const
|
|
1962
|
-
let
|
|
1963
|
-
|
|
1976
|
+
const Ha = (e, n) => {
|
|
1977
|
+
let t;
|
|
1978
|
+
Kt(e) ? t = {
|
|
1964
1979
|
[e.id]: e.value,
|
|
1965
|
-
...
|
|
1966
|
-
...
|
|
1967
|
-
} :
|
|
1980
|
+
...et(e),
|
|
1981
|
+
...tt(e)
|
|
1982
|
+
} : t = {
|
|
1968
1983
|
[e.source.id]: e.source.value,
|
|
1969
1984
|
[e.target.id]: e.target.value,
|
|
1970
|
-
...
|
|
1971
|
-
...
|
|
1985
|
+
...et(e.source),
|
|
1986
|
+
...tt(e.target)
|
|
1972
1987
|
};
|
|
1973
|
-
const o =
|
|
1974
|
-
return { nodes:
|
|
1975
|
-
},
|
|
1976
|
-
if (
|
|
1977
|
-
const
|
|
1988
|
+
const o = Da(t, n);
|
|
1989
|
+
return { nodes: t, links: o };
|
|
1990
|
+
}, Ba = (e) => {
|
|
1991
|
+
if (Kt(e)) {
|
|
1992
|
+
const n = [...e.sourceLinks, ...e.targetLinks];
|
|
1978
1993
|
return {
|
|
1979
|
-
nodes:
|
|
1980
|
-
(
|
|
1981
|
-
{ [
|
|
1994
|
+
nodes: n.reduce(
|
|
1995
|
+
(t, { source: o, target: a, value: r }) => o === e ? { ...t, [$e(a)]: r } : { ...t, [$e(o)]: r },
|
|
1996
|
+
{ [$e(e)]: e.value }
|
|
1982
1997
|
),
|
|
1983
|
-
links:
|
|
1998
|
+
links: n.map(({ id: t }) => t)
|
|
1984
1999
|
};
|
|
1985
2000
|
}
|
|
1986
2001
|
return {
|
|
1987
2002
|
nodes: {
|
|
1988
|
-
[
|
|
1989
|
-
[
|
|
2003
|
+
[$e(e.target)]: e.value,
|
|
2004
|
+
[$e(e.source)]: e.source.value
|
|
1990
2005
|
},
|
|
1991
2006
|
links: [e.id]
|
|
1992
2007
|
};
|
|
1993
2008
|
};
|
|
1994
|
-
function
|
|
1995
|
-
const o =
|
|
2009
|
+
function Ma(e, n, t) {
|
|
2010
|
+
const o = R(null), a = v(() => o.value ? typeof n.value.highlightedElements == "function" ? n.value.highlightedElements(
|
|
1996
2011
|
o.value,
|
|
1997
|
-
|
|
1998
|
-
) :
|
|
1999
|
-
return
|
|
2000
|
-
if (
|
|
2001
|
-
e.value.forEach((
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2012
|
+
t.value
|
|
2013
|
+
) : n.value.highlightedElements === "closest" ? Ba(o.value, t.value) : Ha(o.value, t.value) : { nodes: {}, links: [] });
|
|
2014
|
+
return K(a, (r, l) => {
|
|
2015
|
+
if (r.links.length === 0 && Object.keys(r.nodes).length === 0) {
|
|
2016
|
+
e.value.forEach((i) => {
|
|
2017
|
+
i.node.id in l.nodes && wt(
|
|
2018
|
+
i,
|
|
2019
|
+
l.nodes[i.node.id],
|
|
2020
|
+
i.node.value,
|
|
2021
|
+
n.value.withTransition,
|
|
2007
2022
|
!0
|
|
2008
2023
|
);
|
|
2009
2024
|
});
|
|
2010
2025
|
return;
|
|
2011
2026
|
}
|
|
2012
|
-
e.value.forEach((
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2027
|
+
e.value.forEach((i) => {
|
|
2028
|
+
i.node.id in r.nodes && wt(
|
|
2029
|
+
i,
|
|
2030
|
+
i.node.value,
|
|
2031
|
+
r.nodes[i.node.id],
|
|
2032
|
+
n.value.withTransition
|
|
2018
2033
|
);
|
|
2019
2034
|
});
|
|
2020
|
-
}), { highlightedElements:
|
|
2035
|
+
}), { highlightedElements: a, hoveredElement: o };
|
|
2021
2036
|
}
|
|
2022
|
-
const
|
|
2037
|
+
const Ra = {
|
|
2023
2038
|
class: "lume-alluvial-group",
|
|
2024
2039
|
"data-j-alluvial-group": ""
|
|
2025
|
-
},
|
|
2040
|
+
}, Sa = { key: 0 }, Ca = ["x", "y"], Ga = { key: 0 }, ja = ["id", "x1", "x2"], Pa = ["stop-color"], Va = ["stop-color"], Fa = ["d", "stroke-width", "onClick", "onMouseover"], za = ["d", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-width", "data-id", "onClick", "onMouseover"], Za = ["onClick", "onMouseenter", "onMouseleave", "onMouseover"], Wa = ["x", "y", "height", "width"], Ua = ["transform", "data-id"], Xa = /* @__PURE__ */ W({
|
|
2026
2041
|
__name: "lume-alluvial-group",
|
|
2027
2042
|
props: {
|
|
2028
|
-
...
|
|
2043
|
+
...je(),
|
|
2029
2044
|
hoveredElementId: {
|
|
2030
2045
|
type: [Number, String],
|
|
2031
2046
|
default: null
|
|
2032
2047
|
}
|
|
2033
2048
|
},
|
|
2034
2049
|
emits: ["node-click", "node-mouseenter", "node-mouseleave", "link-click", "link-mouseenter", "link-mouseleave"],
|
|
2035
|
-
setup(e, { emit:
|
|
2036
|
-
const
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
),
|
|
2041
|
-
() => Object.keys(
|
|
2042
|
-
),
|
|
2043
|
-
(k) => k[0].x0 +
|
|
2044
|
-
) : []),
|
|
2045
|
-
if (!(!
|
|
2046
|
-
return
|
|
2050
|
+
setup(e, { emit: n }) {
|
|
2051
|
+
const t = e, o = n, a = Ne("chartID"), { data: r, options: l } = ee(t), i = R([]), s = R([]), c = R(null), { extents: p, updateExtents: u } = ha(t.containerSize), { columns: f, graph: g } = Na(r, l, p), { hoveredElement: m, highlightedElements: T } = Ma(
|
|
2052
|
+
i,
|
|
2053
|
+
l,
|
|
2054
|
+
g
|
|
2055
|
+
), O = v(() => Se(l.value.valueFormat)), b = v(
|
|
2056
|
+
() => Object.keys(T.value.nodes)
|
|
2057
|
+
), h = v(() => f.value ? f.value.map(
|
|
2058
|
+
(k) => k[0].x0 + l.value.nodeWidth / 2
|
|
2059
|
+
) : []), $ = v(() => {
|
|
2060
|
+
if (!(!l.value.nodeHeaders || !l.value.nodeHeaders.length))
|
|
2061
|
+
return l.value.nodeHeaders.slice(0, h.value.length).map((k, E) => ({
|
|
2047
2062
|
label: k,
|
|
2048
|
-
x:
|
|
2063
|
+
x: h.value[E]
|
|
2049
2064
|
}));
|
|
2050
|
-
}),
|
|
2051
|
-
() =>
|
|
2052
|
-
),
|
|
2053
|
-
if (!(!
|
|
2054
|
-
return
|
|
2055
|
-
const { source: _, target:
|
|
2056
|
-
return k[
|
|
2057
|
-
source:
|
|
2058
|
-
target:
|
|
2065
|
+
}), w = v(
|
|
2066
|
+
() => l.value.nodeHeaderPadding ?? ka
|
|
2067
|
+
), D = v(() => {
|
|
2068
|
+
if (!(!l.value.gradient || !g.value))
|
|
2069
|
+
return g.value.links.reduce((k, E) => {
|
|
2070
|
+
const { source: _, target: P } = E, Y = _.color || _.fallbackColor, ie = P.deriveColorFromIncomingLinks ? Y : P.color || P.fallbackColor;
|
|
2071
|
+
return k[E.id] = {
|
|
2072
|
+
source: Y,
|
|
2073
|
+
target: ie,
|
|
2059
2074
|
x1: _.x1,
|
|
2060
|
-
x2:
|
|
2075
|
+
x2: P.x0
|
|
2061
2076
|
}, k;
|
|
2062
2077
|
}, {});
|
|
2063
|
-
}),
|
|
2064
|
-
const k =
|
|
2065
|
-
(_) =>
|
|
2066
|
-
),
|
|
2078
|
+
}), N = v(() => {
|
|
2079
|
+
const k = i.value.filter(
|
|
2080
|
+
(_) => J(_)
|
|
2081
|
+
), E = [];
|
|
2067
2082
|
return k.forEach((_) => {
|
|
2068
|
-
const
|
|
2069
|
-
|
|
2070
|
-
const
|
|
2071
|
-
return
|
|
2083
|
+
const P = [];
|
|
2084
|
+
s.value.filter(({ link: Y }) => Y.target.id === _.node.id).reverse().reduce((Y, ie) => {
|
|
2085
|
+
const Pe = ie.link.target.y1 - ie.link.target.y0, Me = ie.link.value / _.node.value * Pe;
|
|
2086
|
+
return P.push({
|
|
2072
2087
|
x: _.x,
|
|
2073
|
-
y: _.y +
|
|
2074
|
-
height:
|
|
2088
|
+
y: _.y + Y,
|
|
2089
|
+
height: Me,
|
|
2075
2090
|
width: _.width,
|
|
2076
|
-
key: `node-block-${_.node.id}-source-link-${
|
|
2077
|
-
class: `lume-alluvial-group__node-block lume-fill--${
|
|
2078
|
-
}),
|
|
2079
|
-
}, 0),
|
|
2091
|
+
key: `node-block-${_.node.id}-source-link-${ie.link.source.id}`,
|
|
2092
|
+
class: `lume-alluvial-group__node-block lume-fill--${ie.link.source.color || Be}`
|
|
2093
|
+
}), Y + Me;
|
|
2094
|
+
}, 0), E.push({
|
|
2080
2095
|
id: _.node.id,
|
|
2081
|
-
subNodes:
|
|
2096
|
+
subNodes: P
|
|
2082
2097
|
});
|
|
2083
|
-
}),
|
|
2098
|
+
}), E;
|
|
2084
2099
|
});
|
|
2085
|
-
function
|
|
2086
|
-
return
|
|
2100
|
+
function H(k) {
|
|
2101
|
+
return l.value.gradient && `url('#${a}_${k.id}')`;
|
|
2087
2102
|
}
|
|
2088
|
-
function
|
|
2089
|
-
return
|
|
2103
|
+
function G(k) {
|
|
2104
|
+
return b.value.length > 0 && !b.value.includes(k.toString());
|
|
2090
2105
|
}
|
|
2091
|
-
function
|
|
2092
|
-
return
|
|
2106
|
+
function U(k) {
|
|
2107
|
+
return b.value.length > 0 && b.value.includes(k.toString());
|
|
2093
2108
|
}
|
|
2094
|
-
function
|
|
2095
|
-
return
|
|
2109
|
+
function te(k) {
|
|
2110
|
+
return T.value.links.length > 0 && !T.value.links.includes(k);
|
|
2096
2111
|
}
|
|
2097
|
-
function
|
|
2098
|
-
return
|
|
2112
|
+
function F(k) {
|
|
2113
|
+
return T.value.links.length > 0 && T.value.links.includes(k);
|
|
2099
2114
|
}
|
|
2100
|
-
function
|
|
2115
|
+
function J(k) {
|
|
2101
2116
|
return !k.node.color && k.node.deriveColorFromIncomingLinks;
|
|
2102
2117
|
}
|
|
2103
|
-
function
|
|
2104
|
-
k !==
|
|
2118
|
+
function Te(k, E) {
|
|
2119
|
+
k !== m.value && (m.value = k, o("link-mouseenter", { link: k, event: E }));
|
|
2105
2120
|
}
|
|
2106
|
-
function
|
|
2107
|
-
const
|
|
2108
|
-
|
|
2121
|
+
function Le(k) {
|
|
2122
|
+
const E = m.value;
|
|
2123
|
+
m.value = null, o("link-mouseleave", { link: E, event: k });
|
|
2109
2124
|
}
|
|
2110
|
-
function
|
|
2125
|
+
function ge(k) {
|
|
2111
2126
|
if (k == null) {
|
|
2112
|
-
|
|
2127
|
+
m.value = null;
|
|
2113
2128
|
return;
|
|
2114
2129
|
}
|
|
2115
|
-
const
|
|
2116
|
-
if (!
|
|
2117
|
-
|
|
2130
|
+
const E = Aa(k, g.value) || Ta(k, g.value);
|
|
2131
|
+
if (!E) {
|
|
2132
|
+
ye(pe.InvalidHoveredElement);
|
|
2118
2133
|
return;
|
|
2119
2134
|
}
|
|
2120
|
-
|
|
2135
|
+
m.value = E;
|
|
2121
2136
|
}
|
|
2122
|
-
function
|
|
2123
|
-
var
|
|
2124
|
-
return ((
|
|
2137
|
+
function M(k) {
|
|
2138
|
+
var E;
|
|
2139
|
+
return ((E = N.value.find(({ id: _ }) => k === _)) == null ? void 0 : E.subNodes) ?? [];
|
|
2125
2140
|
}
|
|
2126
|
-
return
|
|
2127
|
-
|
|
2128
|
-
}),
|
|
2129
|
-
if (
|
|
2130
|
-
const k =
|
|
2131
|
-
|
|
2141
|
+
return K(g, (k) => {
|
|
2142
|
+
i.value = Oa(k.nodes), s.value = wa(k.links).reverse(), m.value == null && t.hoveredElementId != null && ge(t.hoveredElementId);
|
|
2143
|
+
}), K([t.containerSize, c], () => {
|
|
2144
|
+
if (t.containerSize.width && t.containerSize.height) {
|
|
2145
|
+
const k = La(g.value, c.value);
|
|
2146
|
+
u(k);
|
|
2132
2147
|
}
|
|
2133
|
-
}),
|
|
2134
|
-
|
|
2135
|
-
(y(!0),
|
|
2148
|
+
}), K(() => t.hoveredElementId, ge), (k, E) => (y(), x("g", Ra, [
|
|
2149
|
+
$.value ? (y(), x("g", Sa, [
|
|
2150
|
+
(y(!0), x(Q, null, Z($.value, (_) => (y(), x("text", {
|
|
2136
2151
|
key: `header_${_.x}`,
|
|
2137
2152
|
x: _.x,
|
|
2138
|
-
y: -
|
|
2153
|
+
y: -w.value,
|
|
2139
2154
|
class: "lume-alluvial-group__node-header lume-typography--caption"
|
|
2140
|
-
},
|
|
2141
|
-
])) :
|
|
2142
|
-
|
|
2155
|
+
}, oe(_.label), 9, Ca))), 128))
|
|
2156
|
+
])) : z("", !0),
|
|
2157
|
+
j("g", {
|
|
2143
2158
|
class: "lume-alluvial-link-group",
|
|
2144
|
-
onMouseleave:
|
|
2159
|
+
onMouseleave: Le
|
|
2145
2160
|
}, [
|
|
2146
|
-
|
|
2147
|
-
(y(!0),
|
|
2148
|
-
id: `${
|
|
2149
|
-
key:
|
|
2161
|
+
d(l).gradient ? (y(), x("defs", Ga, [
|
|
2162
|
+
(y(!0), x(Q, null, Z(D.value, (_, P) => (y(), x("linearGradient", {
|
|
2163
|
+
id: `${d(a)}_${P}`,
|
|
2164
|
+
key: P,
|
|
2150
2165
|
gradientUnits: "userSpaceOnUse",
|
|
2151
2166
|
x1: _.x1,
|
|
2152
2167
|
x2: _.x2
|
|
2153
2168
|
}, [
|
|
2154
|
-
|
|
2169
|
+
j("stop", {
|
|
2155
2170
|
offset: "0%",
|
|
2156
2171
|
"stop-color": `var(--lume-color--${_.source})`
|
|
2157
|
-
}, null, 8,
|
|
2158
|
-
|
|
2172
|
+
}, null, 8, Pa),
|
|
2173
|
+
j("stop", {
|
|
2159
2174
|
offset: "100%",
|
|
2160
2175
|
"stop-color": `var(--lume-color--${_.target})`
|
|
2161
|
-
}, null, 8,
|
|
2162
|
-
], 8,
|
|
2163
|
-
])) :
|
|
2164
|
-
(y(!0),
|
|
2176
|
+
}, null, 8, Va)
|
|
2177
|
+
], 8, ja))), 128))
|
|
2178
|
+
])) : z("", !0),
|
|
2179
|
+
(y(!0), x(Q, null, Z(s.value, (_) => (y(), x("path", {
|
|
2165
2180
|
key: `link-ghost_${_.id}`,
|
|
2166
|
-
class:
|
|
2181
|
+
class: ne(["lume-alluvial-group__link", [
|
|
2167
2182
|
"lume-stroke--transparent",
|
|
2168
2183
|
"lume-alluvial-group__link--ghost"
|
|
2169
2184
|
]]),
|
|
2170
2185
|
d: _.d,
|
|
2171
|
-
"stroke-width": _.strokeWidth +
|
|
2186
|
+
"stroke-width": _.strokeWidth + d(ya),
|
|
2172
2187
|
"data-j-alluvial-ghost": "",
|
|
2173
|
-
onClick: (
|
|
2174
|
-
onMouseover: (
|
|
2175
|
-
}, null, 40,
|
|
2176
|
-
(y(!0),
|
|
2188
|
+
onClick: (P) => o("link-click", { link: _.link, event: P }),
|
|
2189
|
+
onMouseover: (P) => Te(_.link, P)
|
|
2190
|
+
}, null, 40, Fa))), 128)),
|
|
2191
|
+
(y(!0), x(Q, null, Z(s.value, (_) => (y(), x("path", {
|
|
2177
2192
|
key: `link_${_.id}`,
|
|
2178
|
-
class:
|
|
2179
|
-
[`lume-stroke--${_.color}`]: !
|
|
2180
|
-
"lume-alluvial-group__link--faded":
|
|
2181
|
-
"lume-alluvial-group__link--focused":
|
|
2193
|
+
class: ne(["lume-alluvial-group__link", {
|
|
2194
|
+
[`lume-stroke--${_.color}`]: !d(l).gradient && _.color,
|
|
2195
|
+
"lume-alluvial-group__link--faded": te(_.id),
|
|
2196
|
+
"lume-alluvial-group__link--focused": F(_.id)
|
|
2182
2197
|
}]),
|
|
2183
2198
|
d: _.d,
|
|
2184
|
-
stroke:
|
|
2199
|
+
stroke: H(_.link),
|
|
2185
2200
|
"stroke-dasharray": k.containerSize.width,
|
|
2186
2201
|
"stroke-dashoffset": k.containerSize.width,
|
|
2187
2202
|
"stroke-width": _.strokeWidth,
|
|
2188
2203
|
"data-j-alluvial-path": "",
|
|
2189
2204
|
"data-id": _.id,
|
|
2190
|
-
onClick: (
|
|
2191
|
-
onMouseover: (
|
|
2192
|
-
}, null, 42,
|
|
2205
|
+
onClick: (P) => o("link-click", { link: _.link, event: P }),
|
|
2206
|
+
onMouseover: (P) => Te(_.link, P)
|
|
2207
|
+
}, null, 42, za))), 128))
|
|
2193
2208
|
], 32),
|
|
2194
|
-
(y(!0),
|
|
2195
|
-
key: `node-block_${
|
|
2196
|
-
class:
|
|
2197
|
-
"lume-alluvial-group__node--faded":
|
|
2198
|
-
"lume-alluvial-group__node--focused":
|
|
2209
|
+
(y(!0), x(Q, null, Z(i.value, (_, P) => (y(), x("g", {
|
|
2210
|
+
key: `node-block_${P}`,
|
|
2211
|
+
class: ne(["lume-alluvial-group__node", {
|
|
2212
|
+
"lume-alluvial-group__node--faded": G(_.node.id),
|
|
2213
|
+
"lume-alluvial-group__node--focused": U(_.node.id)
|
|
2199
2214
|
}]),
|
|
2200
2215
|
"data-j-alluvial-group__node-block": ""
|
|
2201
2216
|
}, [
|
|
2202
|
-
|
|
2203
|
-
onClick: (
|
|
2204
|
-
onMouseenter: (
|
|
2205
|
-
onMouseleave: (
|
|
2206
|
-
onMouseover: (
|
|
2207
|
-
onMouseout:
|
|
2217
|
+
j("g", {
|
|
2218
|
+
onClick: (Y) => o("node-click", { node: _.node, event: Y }),
|
|
2219
|
+
onMouseenter: (Y) => o("node-mouseenter", { node: _.node, event: Y }),
|
|
2220
|
+
onMouseleave: (Y) => o("node-mouseleave", { node: _.node, event: Y }),
|
|
2221
|
+
onMouseover: (Y) => m.value = _.node,
|
|
2222
|
+
onMouseout: E[0] || (E[0] = (Y) => m.value = null)
|
|
2208
2223
|
}, [
|
|
2209
|
-
|
|
2224
|
+
J(_) ? (y(!0), x(Q, { key: 0 }, Z(M(
|
|
2210
2225
|
_.node.id
|
|
2211
|
-
), (
|
|
2212
|
-
key:
|
|
2226
|
+
), (Y) => (y(), x("rect", C(Y, {
|
|
2227
|
+
key: Y.key,
|
|
2213
2228
|
"data-j-alluvial-sub-nodes": ""
|
|
2214
|
-
}), null, 16))), 128)) : (y(),
|
|
2229
|
+
}), null, 16))), 128)) : (y(), x("rect", {
|
|
2215
2230
|
key: 1,
|
|
2216
|
-
class:
|
|
2231
|
+
class: ne(["lume-alluvial-group__node-block", `lume-fill--${_.node.color || _.node.fallbackColor}`]),
|
|
2217
2232
|
x: _.x,
|
|
2218
2233
|
y: _.y,
|
|
2219
2234
|
height: _.height,
|
|
2220
2235
|
width: _.width
|
|
2221
|
-
}, null, 10,
|
|
2222
|
-
|
|
2236
|
+
}, null, 10, Wa)),
|
|
2237
|
+
j("g", {
|
|
2223
2238
|
ref_for: !0,
|
|
2224
2239
|
ref_key: "nodeTextRefs",
|
|
2225
|
-
ref:
|
|
2226
|
-
class:
|
|
2240
|
+
ref: c,
|
|
2241
|
+
class: ne(["lume-alluvial-group__node-text lume-typography--caption", {
|
|
2227
2242
|
"lume-alluvial-group__node-text--left": _.node.depth === 0
|
|
2228
2243
|
}]),
|
|
2229
2244
|
transform: `translate(${_.textTransform.x},${_.textTransform.y})`,
|
|
@@ -2231,24 +2246,24 @@ const Ha = {
|
|
|
2231
2246
|
}, [
|
|
2232
2247
|
S(k.$slots, `node-text-${_.node.id}`, {
|
|
2233
2248
|
node: _.node,
|
|
2234
|
-
value:
|
|
2249
|
+
value: O.value(
|
|
2235
2250
|
_.node.transitionValue || _.node.value,
|
|
2236
2251
|
_.node.value
|
|
2237
2252
|
)
|
|
2238
2253
|
}, () => [
|
|
2239
|
-
re(
|
|
2240
|
-
bottom:
|
|
2254
|
+
re(d(va), {
|
|
2255
|
+
bottom: d(l).switchText
|
|
2241
2256
|
}, {
|
|
2242
|
-
default:
|
|
2243
|
-
|
|
2257
|
+
default: V(() => [
|
|
2258
|
+
de(oe(_.node.label), 1)
|
|
2244
2259
|
]),
|
|
2245
2260
|
_: 2
|
|
2246
2261
|
}, 1032, ["bottom"]),
|
|
2247
|
-
re(
|
|
2248
|
-
bottom: !
|
|
2262
|
+
re(d(fa), {
|
|
2263
|
+
bottom: !d(l).switchText
|
|
2249
2264
|
}, {
|
|
2250
|
-
default:
|
|
2251
|
-
|
|
2265
|
+
default: V(() => [
|
|
2266
|
+
de(oe(O.value(
|
|
2252
2267
|
_.node.transitionValue || _.node.value,
|
|
2253
2268
|
_.node.value
|
|
2254
2269
|
)), 1)
|
|
@@ -2256,13 +2271,13 @@ const Ha = {
|
|
|
2256
2271
|
_: 2
|
|
2257
2272
|
}, 1032, ["bottom"])
|
|
2258
2273
|
], !0)
|
|
2259
|
-
], 10,
|
|
2260
|
-
], 40,
|
|
2274
|
+
], 10, Ua)
|
|
2275
|
+
], 40, Za)
|
|
2261
2276
|
], 2))), 128))
|
|
2262
2277
|
]));
|
|
2263
2278
|
}
|
|
2264
2279
|
});
|
|
2265
|
-
const
|
|
2280
|
+
const Ya = /* @__PURE__ */ q(Xa, [["__scopeId", "data-v-6fe8c153"]]), Ka = {
|
|
2266
2281
|
margins: {
|
|
2267
2282
|
top: 0,
|
|
2268
2283
|
right: 0,
|
|
@@ -2278,506 +2293,506 @@ const Wa = /* @__PURE__ */ Q(Za, [["__scopeId", "data-v-6fe8c153"]]), Ua = {
|
|
|
2278
2293
|
highlightedElements: "closest",
|
|
2279
2294
|
nodePadding: 16,
|
|
2280
2295
|
nodeWidth: 16,
|
|
2281
|
-
nodeAlign:
|
|
2296
|
+
nodeAlign: yn,
|
|
2282
2297
|
valueFormat: (e) => String(e),
|
|
2283
2298
|
iterations: 6
|
|
2284
|
-
},
|
|
2299
|
+
}, Sl = /* @__PURE__ */ W({
|
|
2285
2300
|
__name: "lume-alluvial-diagram",
|
|
2286
2301
|
props: {
|
|
2287
|
-
...
|
|
2302
|
+
...Po(nt)
|
|
2288
2303
|
},
|
|
2289
|
-
setup(e, { emit:
|
|
2290
|
-
const
|
|
2291
|
-
function s(
|
|
2304
|
+
setup(e, { emit: n }) {
|
|
2305
|
+
const t = e, { componentEventPropagator: o } = he(), a = Ae(le()), r = Nn(le()), { options: l } = ee(t), { allOptions: i } = ce(l, Ka);
|
|
2306
|
+
function s(c) {
|
|
2292
2307
|
return {
|
|
2293
|
-
...
|
|
2308
|
+
...c,
|
|
2294
2309
|
noBaseScales: !0
|
|
2295
2310
|
// Alluvial chart never uses base scales
|
|
2296
2311
|
};
|
|
2297
2312
|
}
|
|
2298
|
-
return (
|
|
2299
|
-
options: s(
|
|
2313
|
+
return (c, p) => (y(), X(d(Ie), C(t, {
|
|
2314
|
+
options: s(d(i)),
|
|
2300
2315
|
"data-j-alluvial-diagram": ""
|
|
2301
|
-
},
|
|
2302
|
-
groups:
|
|
2303
|
-
re(
|
|
2304
|
-
|
|
2305
|
-
name:
|
|
2306
|
-
fn:
|
|
2307
|
-
S(
|
|
2316
|
+
}, ae(d(o))), se({
|
|
2317
|
+
groups: V((u) => [
|
|
2318
|
+
re(d(Ya), C(u, { "hovered-element-id": c.hoveredElement }, ae(d(o))), se({ _: 2 }, [
|
|
2319
|
+
Z(d(r), (f, g) => ({
|
|
2320
|
+
name: g,
|
|
2321
|
+
fn: V((m) => [
|
|
2322
|
+
S(c.$slots, g, ve(me(m || {})))
|
|
2308
2323
|
])
|
|
2309
2324
|
}))
|
|
2310
2325
|
]), 1040, ["hovered-element-id"])
|
|
2311
2326
|
]),
|
|
2312
2327
|
_: 2
|
|
2313
2328
|
}, [
|
|
2314
|
-
|
|
2315
|
-
name:
|
|
2316
|
-
fn:
|
|
2317
|
-
S(
|
|
2329
|
+
Z(d(a), (u, f) => ({
|
|
2330
|
+
name: f,
|
|
2331
|
+
fn: V((g) => [
|
|
2332
|
+
S(c.$slots, f, ve(me(g || {})))
|
|
2318
2333
|
])
|
|
2319
2334
|
}))
|
|
2320
2335
|
]), 1040, ["options"]));
|
|
2321
2336
|
}
|
|
2322
2337
|
});
|
|
2323
|
-
var
|
|
2324
|
-
const
|
|
2338
|
+
var Jt = /* @__PURE__ */ ((e) => (e.grouped = "grouped", e.stacked = "stacked", e))(Jt || {});
|
|
2339
|
+
const Cl = /* @__PURE__ */ W({
|
|
2325
2340
|
__name: "lume-bar-chart",
|
|
2326
2341
|
props: {
|
|
2327
|
-
|
|
2342
|
+
...xe(),
|
|
2328
2343
|
type: {
|
|
2329
2344
|
type: String,
|
|
2330
2345
|
default: null,
|
|
2331
|
-
validator: (e) => e in
|
|
2346
|
+
validator: (e) => e in Jt || e == null
|
|
2332
2347
|
}
|
|
2333
2348
|
},
|
|
2334
|
-
setup(e, { emit:
|
|
2335
|
-
const
|
|
2349
|
+
setup(e, { emit: n }) {
|
|
2350
|
+
const t = ze(
|
|
2336
2351
|
() => import("./common/42f5d2fc.js")
|
|
2337
|
-
),
|
|
2352
|
+
), o = ze(
|
|
2338
2353
|
() => import("./common/abc9d23d.js")
|
|
2339
|
-
), a =
|
|
2354
|
+
), a = ze(
|
|
2340
2355
|
() => import("./common/0664fd4d.js")
|
|
2341
|
-
),
|
|
2342
|
-
["single",
|
|
2343
|
-
["grouped",
|
|
2356
|
+
), r = /* @__PURE__ */ new Map([
|
|
2357
|
+
["single", t],
|
|
2358
|
+
["grouped", o],
|
|
2344
2359
|
["stacked", a]
|
|
2345
|
-
]), { componentEventPropagator:
|
|
2346
|
-
function
|
|
2360
|
+
]), l = e, { componentEventPropagator: i } = he(), s = Ae(le());
|
|
2361
|
+
function c(u) {
|
|
2347
2362
|
return {
|
|
2348
|
-
...
|
|
2363
|
+
...u,
|
|
2349
2364
|
startOnZero: !0,
|
|
2350
2365
|
// Bar chart always starts on zero,
|
|
2351
2366
|
tooltipOptions: {
|
|
2352
|
-
...(
|
|
2353
|
-
position:
|
|
2367
|
+
...(u == null ? void 0 : u.tooltipOptions) || {},
|
|
2368
|
+
position: l.orientation === B.HORIZONTAL && "right"
|
|
2354
2369
|
}
|
|
2355
2370
|
};
|
|
2356
2371
|
}
|
|
2357
|
-
const
|
|
2358
|
-
if (
|
|
2359
|
-
if (
|
|
2360
|
-
return
|
|
2361
|
-
if (!
|
|
2372
|
+
const p = v(() => {
|
|
2373
|
+
if (l.data) {
|
|
2374
|
+
if (nt(l.data))
|
|
2375
|
+
return r.get("single");
|
|
2376
|
+
if (!l.type)
|
|
2362
2377
|
throw new Error("Bar chart needs a type when there's multiple datasets.");
|
|
2363
|
-
return
|
|
2378
|
+
return r.get(l.type);
|
|
2364
2379
|
}
|
|
2365
2380
|
});
|
|
2366
|
-
return (
|
|
2367
|
-
options:
|
|
2368
|
-
},
|
|
2369
|
-
|
|
2370
|
-
name:
|
|
2371
|
-
fn:
|
|
2372
|
-
S(
|
|
2381
|
+
return (u, f) => (y(), X(cn(p.value), C({ ...l, ...u.$attrs }, {
|
|
2382
|
+
options: c(u.options)
|
|
2383
|
+
}, ae(d(i))), se({ _: 2 }, [
|
|
2384
|
+
Z(d(s), (g, m) => ({
|
|
2385
|
+
name: m,
|
|
2386
|
+
fn: V((T) => [
|
|
2387
|
+
S(u.$slots, m, ve(me(T || {})))
|
|
2373
2388
|
])
|
|
2374
2389
|
}))
|
|
2375
2390
|
]), 1040, ["options"]));
|
|
2376
2391
|
}
|
|
2377
2392
|
});
|
|
2378
|
-
function
|
|
2379
|
-
return Object.values(
|
|
2393
|
+
function Ja(e) {
|
|
2394
|
+
return Object.values(Rn).includes(e) || e == null;
|
|
2380
2395
|
}
|
|
2381
|
-
function
|
|
2382
|
-
return Object.values(
|
|
2396
|
+
function Qa(e) {
|
|
2397
|
+
return Object.values(B).includes(e);
|
|
2383
2398
|
}
|
|
2384
|
-
const
|
|
2399
|
+
const qa = (e = !1) => ({
|
|
2385
2400
|
type: {
|
|
2386
2401
|
type: String,
|
|
2387
2402
|
default: null,
|
|
2388
|
-
validator:
|
|
2403
|
+
validator: Ja
|
|
2389
2404
|
},
|
|
2390
2405
|
...e ? {
|
|
2391
2406
|
orientation: {
|
|
2392
2407
|
type: String,
|
|
2393
|
-
default:
|
|
2394
|
-
validator:
|
|
2408
|
+
default: B.VERTICAL,
|
|
2409
|
+
validator: Qa
|
|
2395
2410
|
}
|
|
2396
2411
|
} : {}
|
|
2397
2412
|
});
|
|
2398
|
-
function
|
|
2399
|
-
const
|
|
2413
|
+
function Qt(e) {
|
|
2414
|
+
const n = v(() => e.value.map((o) => ({
|
|
2400
2415
|
...o,
|
|
2401
|
-
values: o.values.map((
|
|
2402
|
-
...
|
|
2403
|
-
value: (
|
|
2416
|
+
values: o.values.map((a) => ({
|
|
2417
|
+
...a,
|
|
2418
|
+
value: (a == null ? void 0 : a.value) || 0
|
|
2404
2419
|
}))
|
|
2405
|
-
}))),
|
|
2420
|
+
}))), t = v(() => {
|
|
2406
2421
|
var o;
|
|
2407
|
-
return (o =
|
|
2408
|
-
|
|
2409
|
-
}),
|
|
2422
|
+
return (o = n.value) == null ? void 0 : o.reduce((a, r) => (r.values.forEach((l, i) => {
|
|
2423
|
+
a[i] ? a[i].push(l) : a[i] = [l];
|
|
2424
|
+
}), a), []);
|
|
2410
2425
|
});
|
|
2411
|
-
return { multiBarData:
|
|
2426
|
+
return { multiBarData: n, groupedData: t };
|
|
2412
2427
|
}
|
|
2413
|
-
function
|
|
2414
|
-
return e.value.length === 1 ? "single" :
|
|
2428
|
+
function el(e, n) {
|
|
2429
|
+
return e.value.length === 1 ? "single" : n.value;
|
|
2415
2430
|
}
|
|
2416
|
-
function
|
|
2417
|
-
const o =
|
|
2418
|
-
() =>
|
|
2431
|
+
function tl(e, n, t) {
|
|
2432
|
+
const o = v(
|
|
2433
|
+
() => t.value === B.HORIZONTAL
|
|
2419
2434
|
);
|
|
2420
|
-
function
|
|
2421
|
-
Math.min(...
|
|
2435
|
+
function a(i) {
|
|
2436
|
+
Math.min(...i.domain()) > 0 && console.error("Bar linear scale domain cannot start above 0!");
|
|
2422
2437
|
}
|
|
2423
|
-
const
|
|
2424
|
-
return { barXScale:
|
|
2438
|
+
const r = v(() => o.value ? (() => (a(e.value), e.value))() : e.value), l = v(() => o.value ? n.value : (() => (a(n.value), n.value))());
|
|
2439
|
+
return { barXScale: r, barYScale: l };
|
|
2425
2440
|
}
|
|
2426
|
-
function
|
|
2427
|
-
const
|
|
2428
|
-
() => o.value ===
|
|
2441
|
+
function nl(e, n, t, o, a, r) {
|
|
2442
|
+
const l = v(
|
|
2443
|
+
() => o.value === B.HORIZONTAL
|
|
2429
2444
|
);
|
|
2430
|
-
function
|
|
2431
|
-
let
|
|
2432
|
-
return
|
|
2445
|
+
function i(u, f) {
|
|
2446
|
+
let g, m;
|
|
2447
|
+
return l.value ? (g = u >= 0 ? n.value(0) : n.value(u), m = t.value(t.value.domain()[f])) : (g = n.value(n.value.domain()[f]), m = u < 0 ? t.value(0) : t.value(u)), { x: g, y: m };
|
|
2433
2448
|
}
|
|
2434
|
-
function s(
|
|
2435
|
-
return
|
|
2449
|
+
function s(u) {
|
|
2450
|
+
return l.value ? u < 0 ? n.value(0) - n.value(u) : n.value(u) - n.value(0) : n.value.bandwidth();
|
|
2436
2451
|
}
|
|
2437
|
-
function
|
|
2438
|
-
return
|
|
2452
|
+
function c(u) {
|
|
2453
|
+
return l.value ? t.value.bandwidth() : u < 0 ? t.value(u) - t.value(0) : t.value(0) - t.value(u);
|
|
2439
2454
|
}
|
|
2440
|
-
function
|
|
2441
|
-
const { value:
|
|
2455
|
+
function p(u, f, g) {
|
|
2456
|
+
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);
|
|
2442
2457
|
return {
|
|
2443
|
-
classList: [`lume-fill--${
|
|
2444
|
-
x:
|
|
2445
|
-
y:
|
|
2446
|
-
width:
|
|
2447
|
-
height:
|
|
2448
|
-
isFaded:
|
|
2449
|
-
isNegative:
|
|
2458
|
+
classList: [`lume-fill--${O}`, ...r],
|
|
2459
|
+
x: b,
|
|
2460
|
+
y: h,
|
|
2461
|
+
width: $,
|
|
2462
|
+
height: w,
|
|
2463
|
+
isFaded: a.value !== -1 && a.value !== g,
|
|
2464
|
+
isNegative: m < 0
|
|
2450
2465
|
};
|
|
2451
2466
|
}
|
|
2452
|
-
return { barAttributeGenerator:
|
|
2453
|
-
}
|
|
2454
|
-
function
|
|
2455
|
-
const
|
|
2456
|
-
() => o.value ===
|
|
2457
|
-
),
|
|
2458
|
-
function
|
|
2459
|
-
if (
|
|
2460
|
-
return
|
|
2461
|
-
const
|
|
2462
|
-
return
|
|
2463
|
-
}
|
|
2464
|
-
function
|
|
2465
|
-
if (
|
|
2466
|
-
const
|
|
2467
|
-
return
|
|
2467
|
+
return { barAttributeGenerator: p };
|
|
2468
|
+
}
|
|
2469
|
+
function ol(e, n, t, o, a, r) {
|
|
2470
|
+
const l = v(
|
|
2471
|
+
() => o.value === B.HORIZONTAL
|
|
2472
|
+
), i = v(() => we().domain(e.value.map((m, T) => T)).range([0, n.value.bandwidth()]).padding(0)), s = v(() => we().domain(e.value.map((m, T) => T)).range([0, t.value.bandwidth()]).padding(0));
|
|
2473
|
+
function c(m, T, O) {
|
|
2474
|
+
if (l.value)
|
|
2475
|
+
return m >= 0 ? n.value(0) : n.value(m);
|
|
2476
|
+
const b = n.value.domain();
|
|
2477
|
+
return n.value(b[T]) + i.value(O);
|
|
2478
|
+
}
|
|
2479
|
+
function p(m, T, O) {
|
|
2480
|
+
if (l.value) {
|
|
2481
|
+
const b = t.value.domain();
|
|
2482
|
+
return t.value(b[T]) + s.value(O);
|
|
2468
2483
|
}
|
|
2469
|
-
return
|
|
2484
|
+
return m < 0 ? t.value(0) : t.value(m);
|
|
2470
2485
|
}
|
|
2471
|
-
function
|
|
2472
|
-
return
|
|
2486
|
+
function u(m) {
|
|
2487
|
+
return l.value ? m < 0 ? n.value(0) - n.value(m) : n.value(m) - n.value(0) : i.value.bandwidth();
|
|
2473
2488
|
}
|
|
2474
|
-
function m
|
|
2475
|
-
return
|
|
2489
|
+
function f(m) {
|
|
2490
|
+
return l.value ? s.value.bandwidth() : m < 0 ? t.value(m) - t.value(0) : t.value(0) - t.value(m);
|
|
2476
2491
|
}
|
|
2477
|
-
function
|
|
2478
|
-
const { value:
|
|
2492
|
+
function g(m, T, O) {
|
|
2493
|
+
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);
|
|
2479
2494
|
return {
|
|
2480
|
-
classList: [`lume-fill--${
|
|
2481
|
-
x,
|
|
2482
|
-
y:
|
|
2483
|
-
width:
|
|
2484
|
-
height:
|
|
2485
|
-
isFaded:
|
|
2486
|
-
isNegative:
|
|
2495
|
+
classList: [`lume-fill--${$}`, ...r],
|
|
2496
|
+
x: w,
|
|
2497
|
+
y: D,
|
|
2498
|
+
width: N,
|
|
2499
|
+
height: H,
|
|
2500
|
+
isFaded: a.value !== -1 && a.value !== O,
|
|
2501
|
+
isNegative: b < 0
|
|
2487
2502
|
};
|
|
2488
2503
|
}
|
|
2489
|
-
return { barAttributeGenerator:
|
|
2504
|
+
return { barAttributeGenerator: g };
|
|
2490
2505
|
}
|
|
2491
|
-
function
|
|
2492
|
-
const o =
|
|
2493
|
-
() =>
|
|
2494
|
-
),
|
|
2506
|
+
function al(e, n, t) {
|
|
2507
|
+
const o = v(
|
|
2508
|
+
() => n.value === B.HORIZONTAL
|
|
2509
|
+
), a = v(() => {
|
|
2495
2510
|
const s = e.value.map(
|
|
2496
|
-
(
|
|
2511
|
+
(c) => c.filter((p) => p.value < 0).reduce((p, u) => p + u.value, 0)
|
|
2497
2512
|
);
|
|
2498
2513
|
return Math.min(...s);
|
|
2499
|
-
}),
|
|
2514
|
+
}), r = v(() => {
|
|
2500
2515
|
const s = e.value.map(
|
|
2501
|
-
(
|
|
2502
|
-
(
|
|
2516
|
+
(c) => c.reduce(
|
|
2517
|
+
(p, u) => u.value >= 0 ? p + u.value : p,
|
|
2503
2518
|
0
|
|
2504
2519
|
)
|
|
2505
2520
|
);
|
|
2506
2521
|
return Math.max(...s);
|
|
2507
2522
|
});
|
|
2508
|
-
function
|
|
2509
|
-
return o.value ?
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2523
|
+
function l(s, c, p) {
|
|
2524
|
+
return o.value ? Ee().domain([a.value, r.value]).range([0, p.width]) : Object.assign(
|
|
2525
|
+
Ot(
|
|
2526
|
+
we().domain(c.map((u, f) => f)).range([0, p.width]),
|
|
2527
|
+
n.value,
|
|
2528
|
+
t.value
|
|
2514
2529
|
),
|
|
2515
|
-
{ labels:
|
|
2530
|
+
{ labels: c }
|
|
2516
2531
|
);
|
|
2517
2532
|
}
|
|
2518
|
-
function
|
|
2533
|
+
function i(s, c, p) {
|
|
2519
2534
|
return o.value ? Object.assign(
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2535
|
+
Ot(
|
|
2536
|
+
we().domain(c.map((u, f) => f)).range([0, p.height]),
|
|
2537
|
+
n.value,
|
|
2538
|
+
t.value
|
|
2524
2539
|
),
|
|
2525
|
-
{ labels:
|
|
2526
|
-
) :
|
|
2527
|
-
}
|
|
2528
|
-
return { stackedXScaleGenerator:
|
|
2529
|
-
}
|
|
2530
|
-
function
|
|
2531
|
-
const
|
|
2532
|
-
() => o.value ===
|
|
2533
|
-
),
|
|
2534
|
-
() =>
|
|
2535
|
-
), s =
|
|
2536
|
-
() => e.value.map((
|
|
2540
|
+
{ labels: c }
|
|
2541
|
+
) : Ee().domain([r.value, a.value]).range([0, p.height]);
|
|
2542
|
+
}
|
|
2543
|
+
return { stackedXScaleGenerator: l, stackedYScaleGenerator: i };
|
|
2544
|
+
}
|
|
2545
|
+
function ll(e, n, t, o, a, r) {
|
|
2546
|
+
const l = v(
|
|
2547
|
+
() => o.value === B.HORIZONTAL
|
|
2548
|
+
), i = v(
|
|
2549
|
+
() => l.value ? t.value.domain() : n.value.domain()
|
|
2550
|
+
), s = v(
|
|
2551
|
+
() => e.value.map((b) => b.values.map((h) => h == null ? void 0 : h.value))
|
|
2537
2552
|
);
|
|
2538
|
-
function
|
|
2539
|
-
let
|
|
2540
|
-
return
|
|
2553
|
+
function c(b, h, $) {
|
|
2554
|
+
let w, D;
|
|
2555
|
+
return l.value ? (w = n.value(b >= 0 ? 0 + $ : b + $), D = t.value(i.value[h])) : (w = n.value(i.value[h]), D = t.value(b >= 0 ? b + $ : 0 + $)), { x: w, y: D };
|
|
2541
2556
|
}
|
|
2542
|
-
function
|
|
2543
|
-
return
|
|
2557
|
+
function p(b) {
|
|
2558
|
+
return l.value ? n.value(b) - n.value(0) : n.value.bandwidth();
|
|
2544
2559
|
}
|
|
2545
|
-
function
|
|
2546
|
-
return
|
|
2560
|
+
function u(b) {
|
|
2561
|
+
return l.value ? n.value(0) - n.value(b) : n.value.bandwidth();
|
|
2547
2562
|
}
|
|
2548
|
-
function
|
|
2549
|
-
return
|
|
2563
|
+
function f(b) {
|
|
2564
|
+
return l.value ? t.value.bandwidth() : t.value(0) - t.value(b);
|
|
2550
2565
|
}
|
|
2551
|
-
function
|
|
2552
|
-
return
|
|
2566
|
+
function g(b) {
|
|
2567
|
+
return l.value ? t.value.bandwidth() : t.value(b) - t.value(0);
|
|
2553
2568
|
}
|
|
2554
|
-
function
|
|
2555
|
-
return
|
|
2569
|
+
function m(b, h) {
|
|
2570
|
+
return b ? s.value.reduce(($, w, D) => (D < b && w[h] >= 0 && ($ += w[h]), $), 0) : 0;
|
|
2556
2571
|
}
|
|
2557
|
-
function b
|
|
2558
|
-
return
|
|
2572
|
+
function T(b, h) {
|
|
2573
|
+
return b ? s.value.reduce(($, w, D) => (D < b && w[h] < 0 && ($ += w[h]), $), 0) : 0;
|
|
2559
2574
|
}
|
|
2560
|
-
function
|
|
2561
|
-
const { value:
|
|
2575
|
+
function O(b, h, $) {
|
|
2576
|
+
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);
|
|
2562
2577
|
return {
|
|
2563
|
-
classList: [`lume-fill--${
|
|
2564
|
-
width:
|
|
2565
|
-
height:
|
|
2566
|
-
x:
|
|
2567
|
-
y:
|
|
2568
|
-
isFaded:
|
|
2569
|
-
isNegative:
|
|
2578
|
+
classList: [`lume-fill--${D ?? e.value[h].color ?? Object.values(ue)[h]}`, ...r],
|
|
2579
|
+
width: N,
|
|
2580
|
+
height: H,
|
|
2581
|
+
x: U,
|
|
2582
|
+
y: te,
|
|
2583
|
+
isFaded: a.value !== -1 && a.value !== $,
|
|
2584
|
+
isNegative: w < 0
|
|
2570
2585
|
};
|
|
2571
2586
|
}
|
|
2572
|
-
return { barAttributeGenerator:
|
|
2587
|
+
return { barAttributeGenerator: O };
|
|
2573
2588
|
}
|
|
2574
|
-
const
|
|
2589
|
+
const rl = {
|
|
2575
2590
|
class: "lume-bar-group",
|
|
2576
2591
|
"data-j-bars-group": ""
|
|
2577
|
-
},
|
|
2578
|
-
single:
|
|
2579
|
-
grouped:
|
|
2580
|
-
stacked:
|
|
2581
|
-
},
|
|
2592
|
+
}, ul = ["onMouseenter"], il = {
|
|
2593
|
+
single: nl,
|
|
2594
|
+
grouped: ol,
|
|
2595
|
+
stacked: ll
|
|
2596
|
+
}, st = /* @__PURE__ */ W({
|
|
2582
2597
|
__name: "lume-bar-group",
|
|
2583
2598
|
props: {
|
|
2584
|
-
...
|
|
2599
|
+
...je(),
|
|
2585
2600
|
classList: {
|
|
2586
2601
|
type: [String, Array],
|
|
2587
2602
|
default: () => []
|
|
2588
2603
|
},
|
|
2589
|
-
...
|
|
2604
|
+
...qa(!0),
|
|
2590
2605
|
transition: {
|
|
2591
2606
|
type: Boolean,
|
|
2592
2607
|
default: !0
|
|
2593
2608
|
}
|
|
2594
2609
|
},
|
|
2595
2610
|
emits: ["bar-click", "lume__internal--hover"],
|
|
2596
|
-
setup(e, { emit:
|
|
2597
|
-
const
|
|
2598
|
-
data:
|
|
2599
|
-
hoveredIndex:
|
|
2600
|
-
orientation:
|
|
2601
|
-
transition:
|
|
2602
|
-
type:
|
|
2603
|
-
xScale:
|
|
2604
|
-
yScale:
|
|
2605
|
-
classList:
|
|
2606
|
-
} =
|
|
2607
|
-
|
|
2608
|
-
const { emitInternalEvent:
|
|
2609
|
-
const
|
|
2610
|
-
o,
|
|
2611
|
-
h,
|
|
2612
|
-
g,
|
|
2611
|
+
setup(e, { emit: n }) {
|
|
2612
|
+
const t = e, o = n, {
|
|
2613
|
+
data: a,
|
|
2614
|
+
hoveredIndex: r,
|
|
2615
|
+
orientation: l,
|
|
2616
|
+
transition: i,
|
|
2617
|
+
type: s,
|
|
2618
|
+
xScale: c,
|
|
2619
|
+
yScale: p,
|
|
2620
|
+
classList: u
|
|
2621
|
+
} = ee(t);
|
|
2622
|
+
Ne("chartID");
|
|
2623
|
+
const { emitInternalEvent: f } = he(), { groupedData: g } = Qt(a), { barXScale: m, barYScale: T } = tl(c, p, l), O = v(() => typeof u.value == "string" ? [u.value] : u.value), b = v(() => {
|
|
2624
|
+
const w = el(a, s), { barAttributeGenerator: D } = il[w](
|
|
2613
2625
|
a,
|
|
2626
|
+
m,
|
|
2627
|
+
T,
|
|
2614
2628
|
l,
|
|
2615
|
-
|
|
2629
|
+
r,
|
|
2630
|
+
O.value
|
|
2616
2631
|
);
|
|
2617
|
-
return
|
|
2618
|
-
}),
|
|
2619
|
-
if (
|
|
2620
|
-
return
|
|
2632
|
+
return D;
|
|
2633
|
+
}), h = v(() => {
|
|
2634
|
+
if (i.value)
|
|
2635
|
+
return l.value === B.HORIZONTAL ? "width" : "height";
|
|
2621
2636
|
});
|
|
2622
|
-
async function
|
|
2623
|
-
|
|
2637
|
+
async function $(w) {
|
|
2638
|
+
o("lume__internal--hover", w), f("lume__internal--hover", w);
|
|
2624
2639
|
}
|
|
2625
|
-
return (
|
|
2626
|
-
(y(!0),
|
|
2627
|
-
key:
|
|
2628
|
-
onMouseenter: (
|
|
2640
|
+
return (w, D) => (y(), x("g", rl, [
|
|
2641
|
+
(y(!0), x(Q, null, Z(d(g), (N, H) => (y(), x("g", {
|
|
2642
|
+
key: H,
|
|
2643
|
+
onMouseenter: (G) => $(H)
|
|
2629
2644
|
}, [
|
|
2630
|
-
(y(!0),
|
|
2631
|
-
key: `bar-${
|
|
2632
|
-
transition:
|
|
2645
|
+
(y(!0), x(Q, null, Z(N, (G, U) => (y(), X(d(rt), C(b.value(G, U, H, N), {
|
|
2646
|
+
key: `bar-${U}`,
|
|
2647
|
+
transition: h.value,
|
|
2633
2648
|
"data-j-lume-bar": "",
|
|
2634
|
-
onClick: (
|
|
2635
|
-
index:
|
|
2636
|
-
datasetIndex:
|
|
2637
|
-
event:
|
|
2649
|
+
onClick: (te) => o("bar-click", {
|
|
2650
|
+
index: H,
|
|
2651
|
+
datasetIndex: U,
|
|
2652
|
+
event: te
|
|
2638
2653
|
})
|
|
2639
2654
|
}), null, 16, ["transition", "onClick"]))), 128))
|
|
2640
|
-
], 40,
|
|
2655
|
+
], 40, ul))), 128))
|
|
2641
2656
|
]));
|
|
2642
2657
|
}
|
|
2643
|
-
}),
|
|
2644
|
-
[
|
|
2658
|
+
}), sl = {
|
|
2659
|
+
[B.VERTICAL]: {
|
|
2645
2660
|
withTooltip: !0,
|
|
2646
2661
|
xAxisOptions: {},
|
|
2647
2662
|
yAxisOptions: { gridLines: !0 },
|
|
2648
|
-
margins:
|
|
2663
|
+
margins: ke.VERTICAL
|
|
2649
2664
|
},
|
|
2650
|
-
[
|
|
2665
|
+
[B.HORIZONTAL]: {
|
|
2651
2666
|
withTooltip: !0,
|
|
2652
2667
|
xAxisOptions: { gridLines: !0 },
|
|
2653
2668
|
yAxisOptions: { gridLines: !1 },
|
|
2654
|
-
margins:
|
|
2669
|
+
margins: ke.HORIZONTAL
|
|
2655
2670
|
}
|
|
2656
|
-
},
|
|
2671
|
+
}, Gl = /* @__PURE__ */ W({
|
|
2657
2672
|
__name: "lume-single-bar-chart",
|
|
2658
2673
|
props: {
|
|
2659
|
-
|
|
2674
|
+
...xe(nt)
|
|
2660
2675
|
},
|
|
2661
|
-
setup(e, { emit:
|
|
2662
|
-
const
|
|
2663
|
-
() =>
|
|
2676
|
+
setup(e, { emit: n }) {
|
|
2677
|
+
const t = e, { componentEventPropagator: o } = he(), a = Ae(le()), { orientation: r, options: l } = ee(t), i = v(
|
|
2678
|
+
() => sl[r.value || B.VERTICAL]
|
|
2664
2679
|
// needs to be computed so that default options are reactive
|
|
2665
|
-
), { allOptions: s } =
|
|
2666
|
-
return (
|
|
2680
|
+
), { allOptions: s } = ce(l, i);
|
|
2681
|
+
return (c, p) => (y(), X(d(Ie), C(t, {
|
|
2667
2682
|
"chart-type": "single-bar",
|
|
2668
|
-
options:
|
|
2683
|
+
options: d(s),
|
|
2669
2684
|
"data-j-single-bar-chart": ""
|
|
2670
|
-
},
|
|
2671
|
-
groups:
|
|
2672
|
-
re(
|
|
2685
|
+
}, ae(d(o))), se({
|
|
2686
|
+
groups: V((u) => [
|
|
2687
|
+
re(d(st), C(u, { orientation: d(r) }, ae(d(o))), null, 16, ["orientation"])
|
|
2673
2688
|
]),
|
|
2674
2689
|
_: 2
|
|
2675
2690
|
}, [
|
|
2676
|
-
|
|
2677
|
-
name:
|
|
2678
|
-
fn:
|
|
2679
|
-
S(
|
|
2691
|
+
Z(d(a), (u, f) => ({
|
|
2692
|
+
name: f,
|
|
2693
|
+
fn: V((g) => [
|
|
2694
|
+
S(c.$slots, f, ve(me(g || {})))
|
|
2680
2695
|
])
|
|
2681
2696
|
}))
|
|
2682
2697
|
]), 1040, ["options"]));
|
|
2683
2698
|
}
|
|
2684
|
-
}),
|
|
2685
|
-
[
|
|
2699
|
+
}), cl = {
|
|
2700
|
+
[B.VERTICAL]: {
|
|
2686
2701
|
withTooltip: !0,
|
|
2687
2702
|
xAxisOptions: {},
|
|
2688
2703
|
yAxisOptions: { gridLines: !0 },
|
|
2689
|
-
margins:
|
|
2704
|
+
margins: ke.VERTICAL
|
|
2690
2705
|
},
|
|
2691
|
-
[
|
|
2706
|
+
[B.HORIZONTAL]: {
|
|
2692
2707
|
withTooltip: !0,
|
|
2693
2708
|
xAxisOptions: { gridLines: !0 },
|
|
2694
2709
|
yAxisOptions: { gridLines: !1 },
|
|
2695
|
-
margins:
|
|
2710
|
+
margins: ke.HORIZONTAL,
|
|
2696
2711
|
tooltipOptions: { position: "right" }
|
|
2697
2712
|
}
|
|
2698
|
-
},
|
|
2713
|
+
}, jl = /* @__PURE__ */ W({
|
|
2699
2714
|
__name: "lume-grouped-bar-chart",
|
|
2700
2715
|
props: {
|
|
2701
|
-
|
|
2716
|
+
...xe()
|
|
2702
2717
|
},
|
|
2703
|
-
setup(e, { emit:
|
|
2704
|
-
const
|
|
2705
|
-
() =>
|
|
2718
|
+
setup(e, { emit: n }) {
|
|
2719
|
+
const t = e, { componentEventPropagator: o } = he(), a = Ae(le()), { orientation: r, options: l } = ee(t), i = v(
|
|
2720
|
+
() => cl[r.value || B.VERTICAL]
|
|
2706
2721
|
// needs to be computed so that default options are reactive
|
|
2707
|
-
), { allOptions: s } =
|
|
2708
|
-
|
|
2709
|
-
|
|
2722
|
+
), { allOptions: s } = ce(
|
|
2723
|
+
l,
|
|
2724
|
+
i
|
|
2710
2725
|
);
|
|
2711
|
-
return (
|
|
2726
|
+
return (c, p) => (y(), X(d(Ie), C(t, {
|
|
2712
2727
|
"chart-type": "grouped-bar",
|
|
2713
|
-
options:
|
|
2728
|
+
options: d(s),
|
|
2714
2729
|
"data-j-grouped-bar-chart": ""
|
|
2715
|
-
},
|
|
2716
|
-
groups:
|
|
2717
|
-
re(
|
|
2730
|
+
}, ae(d(o))), se({
|
|
2731
|
+
groups: V((u) => [
|
|
2732
|
+
re(d(st), C(u, { type: "grouped" }, ae(d(o))), null, 16)
|
|
2718
2733
|
]),
|
|
2719
2734
|
_: 2
|
|
2720
2735
|
}, [
|
|
2721
|
-
|
|
2722
|
-
name:
|
|
2723
|
-
fn:
|
|
2724
|
-
S(
|
|
2736
|
+
Z(d(a), (u, f) => ({
|
|
2737
|
+
name: f,
|
|
2738
|
+
fn: V((g) => [
|
|
2739
|
+
S(c.$slots, f, ve(me(g || {})))
|
|
2725
2740
|
])
|
|
2726
2741
|
}))
|
|
2727
2742
|
]), 1040, ["options"]));
|
|
2728
2743
|
}
|
|
2729
|
-
}),
|
|
2730
|
-
[
|
|
2744
|
+
}), dl = {
|
|
2745
|
+
[B.VERTICAL]: {
|
|
2731
2746
|
withTooltip: !0,
|
|
2732
2747
|
xAxisOptions: {},
|
|
2733
2748
|
yAxisOptions: { gridLines: !0 },
|
|
2734
|
-
margins:
|
|
2749
|
+
margins: ke.VERTICAL
|
|
2735
2750
|
},
|
|
2736
|
-
[
|
|
2751
|
+
[B.HORIZONTAL]: {
|
|
2737
2752
|
withTooltip: !0,
|
|
2738
2753
|
xAxisOptions: { gridLines: !0 },
|
|
2739
2754
|
yAxisOptions: { gridLines: !1 },
|
|
2740
|
-
margins:
|
|
2755
|
+
margins: ke.HORIZONTAL,
|
|
2741
2756
|
tooltipOptions: { position: "right" }
|
|
2742
2757
|
}
|
|
2743
|
-
},
|
|
2758
|
+
}, Pl = /* @__PURE__ */ W({
|
|
2744
2759
|
__name: "lume-stacked-bar-chart",
|
|
2745
2760
|
props: {
|
|
2746
|
-
|
|
2761
|
+
...xe()
|
|
2747
2762
|
},
|
|
2748
|
-
setup(e, { emit:
|
|
2749
|
-
const
|
|
2750
|
-
() =>
|
|
2763
|
+
setup(e, { emit: n }) {
|
|
2764
|
+
const t = e, { componentEventPropagator: o } = he(), a = Ae(le()), { data: r, orientation: l, options: i } = ee(t), s = v(
|
|
2765
|
+
() => dl[l.value || B.VERTICAL]
|
|
2751
2766
|
// needs to be computed so that default options are reactive
|
|
2752
|
-
), { allOptions:
|
|
2753
|
-
c,
|
|
2754
|
-
s
|
|
2755
|
-
), { internalData: v } = rt(a), { groupedData: i } = Yt(v), { stackedXScaleGenerator: m, stackedYScaleGenerator: h } = tr(
|
|
2767
|
+
), { allOptions: c } = ce(
|
|
2756
2768
|
i,
|
|
2769
|
+
s
|
|
2770
|
+
), { internalData: p } = it(r), { groupedData: u } = Qt(p), { stackedXScaleGenerator: f, stackedYScaleGenerator: g } = al(
|
|
2757
2771
|
u,
|
|
2758
|
-
|
|
2772
|
+
l,
|
|
2773
|
+
i
|
|
2759
2774
|
);
|
|
2760
|
-
return (
|
|
2775
|
+
return (m, T) => (y(), X(d(Ie), C(t, {
|
|
2761
2776
|
"chart-type": "stacked-bar",
|
|
2762
|
-
options:
|
|
2763
|
-
"x-scale":
|
|
2764
|
-
"y-scale":
|
|
2777
|
+
options: d(c),
|
|
2778
|
+
"x-scale": d(f),
|
|
2779
|
+
"y-scale": d(g),
|
|
2765
2780
|
"data-j-stacked-bar-chart": ""
|
|
2766
|
-
},
|
|
2767
|
-
groups:
|
|
2768
|
-
re(
|
|
2781
|
+
}, ae(d(o))), se({
|
|
2782
|
+
groups: V((O) => [
|
|
2783
|
+
re(d(st), C(O, { type: "stacked" }, ae(d(o))), null, 16)
|
|
2769
2784
|
]),
|
|
2770
2785
|
_: 2
|
|
2771
2786
|
}, [
|
|
2772
|
-
|
|
2773
|
-
name:
|
|
2774
|
-
fn:
|
|
2775
|
-
S(
|
|
2787
|
+
Z(d(a), (O, b) => ({
|
|
2788
|
+
name: b,
|
|
2789
|
+
fn: V((h) => [
|
|
2790
|
+
S(m.$slots, b, ve(me(h || {})))
|
|
2776
2791
|
])
|
|
2777
2792
|
}))
|
|
2778
2793
|
]), 1040, ["options", "x-scale", "y-scale"]));
|
|
2779
2794
|
}
|
|
2780
|
-
}),
|
|
2795
|
+
}), vl = ["d", "stroke-width"], ml = 2, pl = /* @__PURE__ */ W({
|
|
2781
2796
|
__name: "lume-line",
|
|
2782
2797
|
props: {
|
|
2783
2798
|
pathDefinition: {
|
|
@@ -2786,11 +2801,11 @@ const or = {
|
|
|
2786
2801
|
},
|
|
2787
2802
|
width: {
|
|
2788
2803
|
type: Number,
|
|
2789
|
-
default:
|
|
2804
|
+
default: ml
|
|
2790
2805
|
},
|
|
2791
2806
|
color: {
|
|
2792
2807
|
type: String,
|
|
2793
|
-
default:
|
|
2808
|
+
default: ue.Skyblue
|
|
2794
2809
|
},
|
|
2795
2810
|
dashed: {
|
|
2796
2811
|
type: Boolean,
|
|
@@ -2810,39 +2825,39 @@ const or = {
|
|
|
2810
2825
|
}
|
|
2811
2826
|
},
|
|
2812
2827
|
emits: ["click"],
|
|
2813
|
-
setup(e, { emit:
|
|
2814
|
-
const n =
|
|
2815
|
-
return fe(() =>
|
|
2828
|
+
setup(e, { emit: n }) {
|
|
2829
|
+
const t = n, o = R(null);
|
|
2830
|
+
return fe(() => Ge(o.value)), (a, r) => (y(), x("path", {
|
|
2816
2831
|
ref_key: "root",
|
|
2817
|
-
ref:
|
|
2818
|
-
class:
|
|
2832
|
+
ref: o,
|
|
2833
|
+
class: ne(["lume-line", {
|
|
2819
2834
|
[`lume-stroke--${e.color}`]: !0,
|
|
2820
2835
|
"lume-line--dashed": e.dashed,
|
|
2821
2836
|
"lume-line--transition": e.transition
|
|
2822
2837
|
}]),
|
|
2823
2838
|
d: e.pathDefinition,
|
|
2824
2839
|
"stroke-width": e.width,
|
|
2825
|
-
style:
|
|
2840
|
+
style: Dt({
|
|
2826
2841
|
animationDelay: e.transition && e.animationDelay + "s",
|
|
2827
2842
|
animationDuration: e.transition && e.animationDuration + "s"
|
|
2828
2843
|
}),
|
|
2829
2844
|
"data-j-line": "",
|
|
2830
|
-
onClick:
|
|
2831
|
-
}, null, 14,
|
|
2845
|
+
onClick: r[0] || (r[0] = (l) => t("click", l))
|
|
2846
|
+
}, null, 14, vl));
|
|
2832
2847
|
}
|
|
2833
2848
|
});
|
|
2834
|
-
const
|
|
2849
|
+
const fl = /* @__PURE__ */ q(pl, [["__scopeId", "data-v-08896455"]]), hl = ["cx", "cy", "r", "stroke-width"], gl = 4, _l = /* @__PURE__ */ W({
|
|
2835
2850
|
__name: "lume-point",
|
|
2836
2851
|
props: {
|
|
2837
2852
|
x: { type: Number, required: !0 },
|
|
2838
2853
|
y: { type: Number, required: !0 },
|
|
2839
2854
|
color: {
|
|
2840
2855
|
type: String,
|
|
2841
|
-
default:
|
|
2856
|
+
default: ue.Skyblue
|
|
2842
2857
|
},
|
|
2843
2858
|
radius: {
|
|
2844
2859
|
type: Number,
|
|
2845
|
-
default:
|
|
2860
|
+
default: gl
|
|
2846
2861
|
},
|
|
2847
2862
|
active: {
|
|
2848
2863
|
type: Boolean,
|
|
@@ -2850,89 +2865,89 @@ const vr = /* @__PURE__ */ Q(dr, [["__scopeId", "data-v-08896455"]]), pr = ["cx"
|
|
|
2850
2865
|
}
|
|
2851
2866
|
},
|
|
2852
2867
|
emits: ["click"],
|
|
2853
|
-
setup(e, { emit:
|
|
2854
|
-
const
|
|
2855
|
-
return fe(() =>
|
|
2868
|
+
setup(e, { emit: n }) {
|
|
2869
|
+
const t = e, o = n, a = R(null), r = v(() => t.radius / 2);
|
|
2870
|
+
return fe(() => Ge(a.value)), (l, i) => (y(), x("circle", {
|
|
2856
2871
|
ref_key: "root",
|
|
2857
|
-
ref:
|
|
2858
|
-
class:
|
|
2872
|
+
ref: a,
|
|
2873
|
+
class: ne(["lume-point", `lume-stroke--${e.color}`]),
|
|
2859
2874
|
cx: e.x,
|
|
2860
2875
|
cy: e.y,
|
|
2861
2876
|
r: e.active ? e.radius : 0,
|
|
2862
|
-
"stroke-width": r
|
|
2877
|
+
"stroke-width": r.value,
|
|
2863
2878
|
"data-j-point": "",
|
|
2864
|
-
onClick:
|
|
2865
|
-
}, null, 10,
|
|
2879
|
+
onClick: i[0] || (i[0] = (s) => o("click", s))
|
|
2880
|
+
}, null, 10, hl));
|
|
2866
2881
|
}
|
|
2867
2882
|
});
|
|
2868
|
-
const
|
|
2869
|
-
function
|
|
2870
|
-
function
|
|
2871
|
-
let
|
|
2872
|
-
return
|
|
2873
|
-
}
|
|
2874
|
-
function
|
|
2875
|
-
const
|
|
2876
|
-
return
|
|
2877
|
-
}
|
|
2878
|
-
function o(
|
|
2879
|
-
return function(
|
|
2880
|
-
return !!
|
|
2881
|
-
(s) => s.includes(
|
|
2883
|
+
const yl = /* @__PURE__ */ q(_l, [["__scopeId", "data-v-9bacbd7d"]]);
|
|
2884
|
+
function qt(e) {
|
|
2885
|
+
function n(r) {
|
|
2886
|
+
let l = null;
|
|
2887
|
+
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), []);
|
|
2888
|
+
}
|
|
2889
|
+
function t(r, l, i, s) {
|
|
2890
|
+
const u = Math.abs(r - l) / (i + 1) * (s + 1);
|
|
2891
|
+
return r > l ? r - u : r + u;
|
|
2892
|
+
}
|
|
2893
|
+
function o(r) {
|
|
2894
|
+
return function(i) {
|
|
2895
|
+
return !!r.find(
|
|
2896
|
+
(s) => s.includes(i) || s.includes(i - 1)
|
|
2882
2897
|
);
|
|
2883
2898
|
};
|
|
2884
2899
|
}
|
|
2885
|
-
return { computedLineData:
|
|
2886
|
-
const
|
|
2900
|
+
return { computedLineData: v(() => e.value.map((r) => {
|
|
2901
|
+
const l = n(r.values);
|
|
2887
2902
|
return {
|
|
2888
|
-
...
|
|
2889
|
-
isDashed: o(
|
|
2890
|
-
values:
|
|
2891
|
-
var
|
|
2892
|
-
const
|
|
2893
|
-
(
|
|
2903
|
+
...r,
|
|
2904
|
+
isDashed: o(l),
|
|
2905
|
+
values: r.values.map((i, s) => {
|
|
2906
|
+
var p, u;
|
|
2907
|
+
const c = l.find(
|
|
2908
|
+
(f) => f.includes(s)
|
|
2894
2909
|
);
|
|
2895
|
-
if (
|
|
2896
|
-
const
|
|
2897
|
-
let
|
|
2898
|
-
return
|
|
2899
|
-
value:
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2910
|
+
if (c) {
|
|
2911
|
+
const f = c[0] - 1, g = c[c.length - 1] + 1;
|
|
2912
|
+
let m = (p = r.values[f]) == null ? void 0 : p.value, T = (u = r.values[g]) == null ? void 0 : u.value;
|
|
2913
|
+
return m == null && (m = T), T == null && (T = m), {
|
|
2914
|
+
value: t(
|
|
2915
|
+
m,
|
|
2916
|
+
T,
|
|
2917
|
+
c.length,
|
|
2918
|
+
c.indexOf(s)
|
|
2904
2919
|
),
|
|
2905
|
-
label:
|
|
2920
|
+
label: Gt
|
|
2906
2921
|
};
|
|
2907
2922
|
}
|
|
2908
|
-
return
|
|
2923
|
+
return i;
|
|
2909
2924
|
})
|
|
2910
2925
|
};
|
|
2911
2926
|
})) };
|
|
2912
2927
|
}
|
|
2913
|
-
function
|
|
2914
|
-
const
|
|
2915
|
-
return (o,
|
|
2928
|
+
function kl(e, n) {
|
|
2929
|
+
const t = e.bandwidth() / 2;
|
|
2930
|
+
return (o, a) => e(e.domain()[n + (a - 1)]) + t;
|
|
2916
2931
|
}
|
|
2917
|
-
function
|
|
2918
|
-
return (
|
|
2932
|
+
function bl(e, n) {
|
|
2933
|
+
return (t, o) => e(n + (o - 1));
|
|
2919
2934
|
}
|
|
2920
|
-
function
|
|
2921
|
-
return
|
|
2922
|
-
|
|
2923
|
-
).y((
|
|
2935
|
+
function Al(e, n, t, o) {
|
|
2936
|
+
return pn().x(
|
|
2937
|
+
be(t) ? kl(t, e) : bl(t, e)
|
|
2938
|
+
).y((r) => o(r))(n);
|
|
2924
2939
|
}
|
|
2925
|
-
const
|
|
2940
|
+
const Tl = {
|
|
2926
2941
|
class: "lume-line-group",
|
|
2927
2942
|
"data-j-lume-line-group": ""
|
|
2928
|
-
},
|
|
2943
|
+
}, Ll = { class: "lume-line-group__lines" }, Ol = {
|
|
2929
2944
|
key: 0,
|
|
2930
2945
|
class: "lume-line-group__points",
|
|
2931
2946
|
"data-j-lume-line-group__points": ""
|
|
2932
|
-
},
|
|
2947
|
+
}, $l = 1, xl = /* @__PURE__ */ W({
|
|
2933
2948
|
__name: "lume-line-group",
|
|
2934
2949
|
props: {
|
|
2935
|
-
...
|
|
2950
|
+
...je(),
|
|
2936
2951
|
withPoints: {
|
|
2937
2952
|
type: Boolean,
|
|
2938
2953
|
default: !0
|
|
@@ -2943,156 +2958,156 @@ const kr = {
|
|
|
2943
2958
|
}
|
|
2944
2959
|
},
|
|
2945
2960
|
emits: ["line-click", "point-click", "lume__internal--hover"],
|
|
2946
|
-
setup(e, { emit:
|
|
2947
|
-
const
|
|
2961
|
+
setup(e, { emit: n }) {
|
|
2962
|
+
const t = e, o = n, { data: a, options: r, xScale: l, yScale: i } = ee(t), s = Ne(
|
|
2948
2963
|
"tooltipAnchorAttributes",
|
|
2949
2964
|
null
|
|
2950
|
-
), { updateTooltipAnchorAttributes:
|
|
2951
|
-
|
|
2965
|
+
), { updateTooltipAnchorAttributes: c } = Xt(
|
|
2966
|
+
s,
|
|
2967
|
+
r,
|
|
2952
2968
|
l,
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
if (n.hoveredIndex === -1)
|
|
2969
|
+
i
|
|
2970
|
+
), p = v(() => {
|
|
2971
|
+
if (a.value.every((H) => H.isDashed))
|
|
2972
|
+
return a.value;
|
|
2973
|
+
const { computedLineData: N } = qt(a);
|
|
2974
|
+
return r.value.withTooltip !== !1 && (s != null && s.value) && c(N.value), N.value;
|
|
2975
|
+
}), u = v(() => {
|
|
2976
|
+
if (t.hoveredIndex === -1)
|
|
2962
2977
|
return;
|
|
2963
|
-
const
|
|
2964
|
-
|
|
2965
|
-
|
|
2978
|
+
const N = xn(
|
|
2979
|
+
p.value,
|
|
2980
|
+
t.hoveredIndex
|
|
2966
2981
|
);
|
|
2967
2982
|
return {
|
|
2968
|
-
d: `M ${
|
|
2969
|
-
V ${
|
|
2983
|
+
d: `M ${Ye(l.value, t.hoveredIndex)},${i.value.range()[1]}
|
|
2984
|
+
V ${i.value(N)}`
|
|
2970
2985
|
// Move to X index, Vertical line to the highest point
|
|
2971
2986
|
};
|
|
2972
|
-
}),
|
|
2973
|
-
() =>
|
|
2987
|
+
}), f = v(
|
|
2988
|
+
() => l.value && $l / (In(l.value) - 1)
|
|
2974
2989
|
// Subtracting the first line (read below)
|
|
2975
|
-
),
|
|
2990
|
+
), g = v(
|
|
2976
2991
|
() => {
|
|
2977
|
-
var
|
|
2978
|
-
return ((
|
|
2992
|
+
var N;
|
|
2993
|
+
return ((N = r.value) == null ? void 0 : N.lineWidth) * 2 || void 0;
|
|
2979
2994
|
}
|
|
2980
2995
|
// If no `lineWidth`, returns NaN which needs to be undefined
|
|
2981
|
-
),
|
|
2982
|
-
() =>
|
|
2983
|
-
),
|
|
2984
|
-
() =>
|
|
2996
|
+
), m = v(
|
|
2997
|
+
() => l.value.bandwidth() / 2
|
|
2998
|
+
), T = v(() => l.value.domain()), O = v(
|
|
2999
|
+
() => r.value.withPoints ?? t.withPoints
|
|
2985
3000
|
);
|
|
2986
|
-
function
|
|
2987
|
-
return
|
|
3001
|
+
function b(N) {
|
|
3002
|
+
return p.value[N].values;
|
|
2988
3003
|
}
|
|
2989
|
-
function
|
|
2990
|
-
var
|
|
2991
|
-
const
|
|
2992
|
-
(
|
|
2993
|
-
(
|
|
3004
|
+
function h(N, H) {
|
|
3005
|
+
var U, te;
|
|
3006
|
+
const G = N === 0 ? [] : [
|
|
3007
|
+
(U = b(H)[N - 1]) == null ? void 0 : U.value,
|
|
3008
|
+
(te = b(H)[N]) == null ? void 0 : te.value
|
|
2994
3009
|
];
|
|
2995
|
-
return
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3010
|
+
return Al(
|
|
3011
|
+
N,
|
|
3012
|
+
G,
|
|
3013
|
+
l.value,
|
|
3014
|
+
i.value
|
|
3000
3015
|
) || "";
|
|
3001
3016
|
}
|
|
3002
|
-
function
|
|
3017
|
+
function $(N) {
|
|
3003
3018
|
return {
|
|
3004
|
-
animationDelay:
|
|
3005
|
-
animationDuration:
|
|
3019
|
+
animationDelay: N < 2 ? 0 : (N - 1) * f.value,
|
|
3020
|
+
animationDuration: f.value
|
|
3006
3021
|
};
|
|
3007
3022
|
}
|
|
3008
|
-
function
|
|
3009
|
-
var
|
|
3010
|
-
const
|
|
3023
|
+
function w(N, H) {
|
|
3024
|
+
var U;
|
|
3025
|
+
const G = (U = b(H)[N]) == null ? void 0 : U.value;
|
|
3011
3026
|
return {
|
|
3012
|
-
x:
|
|
3013
|
-
y:
|
|
3027
|
+
x: be(l.value) ? t.xScale(T.value[N]) + m.value : t.xScale(N),
|
|
3028
|
+
y: i.value(G)
|
|
3014
3029
|
};
|
|
3015
3030
|
}
|
|
3016
|
-
function
|
|
3017
|
-
return
|
|
3031
|
+
function D(N) {
|
|
3032
|
+
return t.hoveredIndex === N;
|
|
3018
3033
|
}
|
|
3019
|
-
return (
|
|
3020
|
-
|
|
3034
|
+
return (N, H) => (y(), x("g", Tl, [
|
|
3035
|
+
j("path", C(u.value, {
|
|
3021
3036
|
class: "lume-line-group__overlay-line",
|
|
3022
3037
|
"data-j-lume-line-group__overlay-line": ""
|
|
3023
3038
|
}), null, 16),
|
|
3024
|
-
(y(!0),
|
|
3025
|
-
key:
|
|
3039
|
+
(y(!0), x(Q, null, Z(p.value, (G, U) => (y(), x("g", {
|
|
3040
|
+
key: G.label,
|
|
3026
3041
|
class: "lume-line-group__group"
|
|
3027
3042
|
}, [
|
|
3028
|
-
|
|
3029
|
-
(y(!0),
|
|
3030
|
-
key: `line-${
|
|
3031
|
-
color:
|
|
3032
|
-
dashed:
|
|
3033
|
-
"path-definition":
|
|
3043
|
+
j("g", Ll, [
|
|
3044
|
+
(y(!0), x(Q, null, Z(G.values, (te, F) => (y(), X(d(fl), C($(F), {
|
|
3045
|
+
key: `line-${F}`,
|
|
3046
|
+
color: G.color,
|
|
3047
|
+
dashed: G.isDashed(F),
|
|
3048
|
+
"path-definition": h(F, U),
|
|
3034
3049
|
transition: e.transition,
|
|
3035
|
-
width: r
|
|
3036
|
-
onClick: (
|
|
3050
|
+
width: d(r).lineWidth,
|
|
3051
|
+
onClick: (J) => o("line-click", { index: F, datasetIndex: U, event: J })
|
|
3037
3052
|
}), null, 16, ["color", "dashed", "path-definition", "transition", "width", "onClick"]))), 128))
|
|
3038
3053
|
]),
|
|
3039
|
-
|
|
3040
|
-
(y(!0),
|
|
3041
|
-
key: `point-${
|
|
3042
|
-
active:
|
|
3043
|
-
color:
|
|
3044
|
-
index:
|
|
3045
|
-
radius:
|
|
3046
|
-
onClick: (
|
|
3054
|
+
O.value ? (y(), x("g", Ol, [
|
|
3055
|
+
(y(!0), x(Q, null, Z(G.values, (te, F) => (y(), X(d(yl), C(w(F, U), {
|
|
3056
|
+
key: `point-${F}`,
|
|
3057
|
+
active: D(F),
|
|
3058
|
+
color: G.color,
|
|
3059
|
+
index: F,
|
|
3060
|
+
radius: g.value,
|
|
3061
|
+
onClick: (J) => o("point-click", { index: F, datasetIndex: U, event: J })
|
|
3047
3062
|
}), null, 16, ["active", "color", "index", "radius", "onClick"]))), 128))
|
|
3048
|
-
])) :
|
|
3063
|
+
])) : z("", !0)
|
|
3049
3064
|
]))), 128))
|
|
3050
3065
|
]));
|
|
3051
3066
|
}
|
|
3052
3067
|
});
|
|
3053
|
-
const
|
|
3054
|
-
margins:
|
|
3068
|
+
const en = /* @__PURE__ */ q(xl, [["__scopeId", "data-v-c4d7f0ca"]]), Il = {
|
|
3069
|
+
margins: ke.VERTICAL,
|
|
3055
3070
|
startOnZero: !0,
|
|
3056
3071
|
withTooltip: !0,
|
|
3057
3072
|
xAxisOptions: {},
|
|
3058
3073
|
yAxisOptions: { gridLines: !0 }
|
|
3059
|
-
},
|
|
3074
|
+
}, Vl = /* @__PURE__ */ W({
|
|
3060
3075
|
__name: "lume-line-chart",
|
|
3061
3076
|
props: {
|
|
3062
|
-
|
|
3077
|
+
...xe(null, !1)
|
|
3063
3078
|
},
|
|
3064
|
-
setup(e, { emit:
|
|
3065
|
-
const
|
|
3066
|
-
return (
|
|
3079
|
+
setup(e, { emit: n }) {
|
|
3080
|
+
const t = e, { componentEventPropagator: o } = he(), a = Ae(le()), { options: r } = ee(t), { allOptions: l } = ce(r, Il);
|
|
3081
|
+
return (i, s) => (y(), X(d(Ie), C(t, {
|
|
3067
3082
|
"chart-type": "line",
|
|
3068
|
-
options:
|
|
3083
|
+
options: d(l),
|
|
3069
3084
|
"data-j-lume-line-chart": ""
|
|
3070
|
-
},
|
|
3071
|
-
groups:
|
|
3072
|
-
re(
|
|
3085
|
+
}, ae(d(o))), se({
|
|
3086
|
+
groups: V((c) => [
|
|
3087
|
+
re(d(en), C(c, ae(d(o))), null, 16)
|
|
3073
3088
|
]),
|
|
3074
3089
|
_: 2
|
|
3075
3090
|
}, [
|
|
3076
|
-
|
|
3077
|
-
name:
|
|
3078
|
-
fn:
|
|
3079
|
-
S(
|
|
3091
|
+
Z(d(a), (c, p) => ({
|
|
3092
|
+
name: p,
|
|
3093
|
+
fn: V((u) => [
|
|
3094
|
+
S(i.$slots, p, ve(me(u || {})))
|
|
3080
3095
|
])
|
|
3081
3096
|
}))
|
|
3082
3097
|
]), 1040, ["options"]));
|
|
3083
3098
|
}
|
|
3084
3099
|
});
|
|
3085
|
-
function
|
|
3086
|
-
return { areaPathDefinition:
|
|
3087
|
-
() => function(
|
|
3088
|
-
if (!
|
|
3100
|
+
function wl(e) {
|
|
3101
|
+
return { areaPathDefinition: v(
|
|
3102
|
+
() => function(t, o) {
|
|
3103
|
+
if (!t || !o)
|
|
3089
3104
|
return;
|
|
3090
|
-
const
|
|
3091
|
-
return
|
|
3105
|
+
const a = e.value[0].values;
|
|
3106
|
+
return fn().x((r, l) => t(l)).y0(o(Math.min(...o.domain()))).y1((r) => o(r.value))(a);
|
|
3092
3107
|
}
|
|
3093
3108
|
) };
|
|
3094
3109
|
}
|
|
3095
|
-
const
|
|
3110
|
+
const El = {
|
|
3096
3111
|
margins: {
|
|
3097
3112
|
top: 0,
|
|
3098
3113
|
right: 0,
|
|
@@ -3106,82 +3121,82 @@ const xr = {
|
|
|
3106
3121
|
tooltipOptions: {
|
|
3107
3122
|
showTitle: !1
|
|
3108
3123
|
}
|
|
3109
|
-
},
|
|
3124
|
+
}, Nl = ["d"], Dl = /* @__PURE__ */ W({
|
|
3110
3125
|
__name: "lume-sparkline-chart",
|
|
3111
3126
|
props: {
|
|
3112
|
-
...
|
|
3113
|
-
...
|
|
3127
|
+
...ut(null),
|
|
3128
|
+
...De()
|
|
3114
3129
|
},
|
|
3115
|
-
setup(e, { expose:
|
|
3116
|
-
const o = e, { componentEventPropagator:
|
|
3117
|
-
() =>
|
|
3130
|
+
setup(e, { expose: n, emit: t }) {
|
|
3131
|
+
const o = e, { componentEventPropagator: a } = he(), r = Ae(le()), { data: l, options: i } = ee(o), { internalData: s } = it(l), { allOptions: c } = ce(i, El), { computedLineData: p } = qt(s), { areaPathDefinition: u } = wl(p), f = v(() => s.value[0].color), g = v(
|
|
3132
|
+
() => l.value[0].areaColor || f.value
|
|
3118
3133
|
);
|
|
3119
|
-
function
|
|
3134
|
+
function m(O) {
|
|
3120
3135
|
return {
|
|
3121
|
-
|
|
3136
|
+
...O,
|
|
3122
3137
|
noMinSize: !0
|
|
3123
3138
|
};
|
|
3124
3139
|
}
|
|
3125
|
-
function
|
|
3126
|
-
return
|
|
3140
|
+
function T(O, b, h) {
|
|
3141
|
+
return Ee().range([0, h.width]).domain([0, O[0].values.length - 1]);
|
|
3127
3142
|
}
|
|
3128
|
-
return
|
|
3129
|
-
areaPathDefinition:
|
|
3130
|
-
}), (
|
|
3143
|
+
return n({
|
|
3144
|
+
areaPathDefinition: u
|
|
3145
|
+
}), (O, b) => (y(), X(d(Ie), C(o, {
|
|
3131
3146
|
"chart-type": "line",
|
|
3132
|
-
options:
|
|
3133
|
-
"x-scale":
|
|
3134
|
-
},
|
|
3135
|
-
groups:
|
|
3136
|
-
|
|
3147
|
+
options: m(d(c)),
|
|
3148
|
+
"x-scale": T
|
|
3149
|
+
}, ae(d(a))), se({
|
|
3150
|
+
groups: V((h) => [
|
|
3151
|
+
d(c).showArea ? (y(), x("path", {
|
|
3137
3152
|
key: 0,
|
|
3138
|
-
class:
|
|
3153
|
+
class: ne([
|
|
3139
3154
|
"sparkline-chart__area",
|
|
3140
|
-
|
|
3141
|
-
`lume-fill--${
|
|
3155
|
+
d(i).withTransition !== !1 ? "sparkline-chart__area--transition" : "",
|
|
3156
|
+
`lume-fill--${g.value || f.value}`,
|
|
3142
3157
|
"lume-fill--faded"
|
|
3143
3158
|
]),
|
|
3144
|
-
d:
|
|
3159
|
+
d: d(u)(h.xScale, h.yScale),
|
|
3145
3160
|
"data-j-sparkline__area": ""
|
|
3146
|
-
}, null, 10,
|
|
3147
|
-
re(
|
|
3161
|
+
}, null, 10, Nl)) : z("", !0),
|
|
3162
|
+
re(d(en), C(h, { "with-points": !1 }, ae(d(a))), null, 16)
|
|
3148
3163
|
]),
|
|
3149
3164
|
_: 2
|
|
3150
3165
|
}, [
|
|
3151
|
-
|
|
3152
|
-
name:
|
|
3153
|
-
fn:
|
|
3154
|
-
S(
|
|
3166
|
+
Z(d(r), (h, $) => ({
|
|
3167
|
+
name: $,
|
|
3168
|
+
fn: V((w) => [
|
|
3169
|
+
S(O.$slots, $, ve(me(w || {})), void 0, !0)
|
|
3155
3170
|
])
|
|
3156
3171
|
}))
|
|
3157
3172
|
]), 1040, ["options"]));
|
|
3158
3173
|
}
|
|
3159
3174
|
});
|
|
3160
|
-
const
|
|
3175
|
+
const Fl = /* @__PURE__ */ q(Dl, [["__scopeId", "data-v-c681fff6"]]);
|
|
3161
3176
|
export {
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3177
|
+
Sl as LumeAlluvialDiagram,
|
|
3178
|
+
Ya as LumeAlluvialGroup,
|
|
3179
|
+
va as LumeAlluvialNodeLabel,
|
|
3180
|
+
fa as LumeAlluvialNodeValue,
|
|
3181
|
+
_t as LumeAxis,
|
|
3182
|
+
rt as LumeBar,
|
|
3183
|
+
Cl as LumeBarChart,
|
|
3184
|
+
st as LumeBarGroup,
|
|
3185
|
+
Ie as LumeChart,
|
|
3186
|
+
ao as LumeChartContainer,
|
|
3187
|
+
yt as LumeChartLegend,
|
|
3188
|
+
jl as LumeGroupedBarChart,
|
|
3189
|
+
fl as LumeLine,
|
|
3190
|
+
Vl as LumeLineChart,
|
|
3191
|
+
en as LumeLineGroup,
|
|
3192
|
+
Fo as LumeOverlayGroup,
|
|
3193
|
+
yl as LumePoint,
|
|
3194
|
+
Gl as LumeSingleBarChart,
|
|
3195
|
+
Fl as LumeSparklineChart,
|
|
3196
|
+
Pl as LumeStackedBarChart,
|
|
3197
|
+
Io as LumeTooltip,
|
|
3198
|
+
bo as LumeTooltipItem,
|
|
3199
|
+
ho as LumeTooltipSummary,
|
|
3200
|
+
co as LumeTooltipTitle
|
|
3186
3201
|
};
|
|
3187
3202
|
//# sourceMappingURL=index.js.map
|