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