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