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