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