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