@adyen/lume 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +280 -0
- package/dist/index.js +1345 -1281
- package/dist/index.js.map +1 -1
- package/dist/scss/components/lume-tooltip.scss +4 -0
- 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 w, 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__ */ w({
|
|
6
6
|
__name: "lume-tick",
|
|
7
7
|
props: {
|
|
8
8
|
value: {
|
|
@@ -44,56 +44,56 @@ const Vt = /* @__PURE__ */ E({
|
|
|
44
44
|
return e({ ref: n }), { __sfc: !0, emit: r, labelRef: n };
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
function
|
|
47
|
+
function E(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(
|
|
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__ */ E(
|
|
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,41 +101,41 @@ const Wt = zt.exports, Zt = [
|
|
|
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()) || [];
|
|
111
111
|
}
|
|
112
|
-
function
|
|
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)
|
|
@@ -145,17 +145,17 @@ const Kt = (t, e) => {
|
|
|
145
145
|
throw new Error("Index exceeds length of at least one of the datasets");
|
|
146
146
|
});
|
|
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 Oe(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,7 +222,7 @@ 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: () => ({})
|
|
@@ -230,42 +230,42 @@ const pe = (t) => {
|
|
|
230
230
|
});
|
|
231
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
|
|
261
|
-
const
|
|
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
|
+
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 O = {
|
|
|
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 gt = {
|
|
|
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 gt = {
|
|
|
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 gt = {
|
|
|
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 gt = {
|
|
|
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 gt = {
|
|
|
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 Ee = /* @__PURE__ */ ((t) => (t.bandScale = "band-scale-axis", t.linearScale = "linear-scale-axis", t))(Ee || {}), we = /* @__PURE__ */ ((t) => (t.left = "left", t.bottom = "bottom", t))(we || {}), he = /* @__PURE__ */ ((t) => (t.x = "bottom", t.y = "left", t))(he || {});
|
|
471
|
+
const xn = /* @__PURE__ */ w({
|
|
472
472
|
__name: "lume-axis",
|
|
473
473
|
props: {
|
|
474
474
|
scale: {
|
|
@@ -478,12 +478,12 @@ const hn = /* @__PURE__ */ E({
|
|
|
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 we
|
|
487
487
|
},
|
|
488
488
|
containerSize: {
|
|
489
489
|
type: Object,
|
|
@@ -495,141 +495,141 @@ const hn = /* @__PURE__ */ E({
|
|
|
495
495
|
},
|
|
496
496
|
orientation: {
|
|
497
497
|
type: String,
|
|
498
|
-
default:
|
|
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 ?
|
|
506
|
-
),
|
|
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
|
+
), g = d(
|
|
507
507
|
() => r.type || (f.value === "left" ? "y" : "x")
|
|
508
|
-
),
|
|
509
|
-
() =>
|
|
510
|
-
), { allOptions:
|
|
508
|
+
), y = d(
|
|
509
|
+
() => g.value === "x" && u.value === L.VERTICAL || g.value === "y" && u.value === L.HORIZONTAL
|
|
510
|
+
), { allOptions: p } = Z(
|
|
511
511
|
i,
|
|
512
|
-
|
|
513
|
-
), { showTick:
|
|
514
|
-
var $,
|
|
515
|
-
return
|
|
516
|
-
}),
|
|
517
|
-
if (
|
|
518
|
-
return
|
|
519
|
-
const { tickCount: $ } =
|
|
520
|
-
return
|
|
521
|
-
}),
|
|
522
|
-
const { tickFormat: $ } =
|
|
523
|
-
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
|
+
}), k = d(() => {
|
|
522
|
+
const { tickFormat: $ } = p.value;
|
|
523
|
+
return ge($);
|
|
524
524
|
}), C = d(
|
|
525
|
-
() =>
|
|
526
|
-
),
|
|
527
|
-
() =>
|
|
528
|
-
),
|
|
525
|
+
() => p.value.withHover && y.value && l.value > -1
|
|
526
|
+
), D = d(
|
|
527
|
+
() => p.value.tickPadding + pe || n
|
|
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
|
-
var
|
|
534
|
-
return ((
|
|
533
|
+
var h, O;
|
|
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
|
-
var
|
|
544
|
-
return ((
|
|
543
|
+
var h, O;
|
|
544
|
+
return ((O = (h = $.ref).getBBox) == null ? void 0 : O.call(h).width) + D.value;
|
|
545
545
|
}
|
|
546
546
|
)
|
|
547
547
|
)
|
|
548
548
|
));
|
|
549
549
|
function B($) {
|
|
550
|
-
const { showTicks:
|
|
551
|
-
return
|
|
550
|
+
const { showTicks: h } = p.value;
|
|
551
|
+
return h === !1 ? "" : k.value($);
|
|
552
552
|
}
|
|
553
|
-
function
|
|
554
|
-
e("mouseenter", { index:
|
|
553
|
+
function J($, h, O) {
|
|
554
|
+
e("mouseenter", { index: y.value ? $ : null, value: h, event: O });
|
|
555
555
|
}
|
|
556
|
-
function
|
|
557
|
-
e("click", { index: $, value:
|
|
556
|
+
function G($, h, O) {
|
|
557
|
+
e("click", { index: $, value: h, event: O });
|
|
558
558
|
}
|
|
559
|
-
function
|
|
560
|
-
var
|
|
561
|
-
if (!(!
|
|
562
|
-
return (
|
|
559
|
+
function M($) {
|
|
560
|
+
var h;
|
|
561
|
+
if (!(!s.value || !s.value.length))
|
|
562
|
+
return (h = s.value[$]) == null ? void 0 : h.ref;
|
|
563
563
|
}
|
|
564
|
-
function
|
|
565
|
-
|
|
566
|
-
($,
|
|
564
|
+
function Q() {
|
|
565
|
+
m.value = x.value.map(
|
|
566
|
+
($, h) => ({
|
|
567
567
|
value: B($),
|
|
568
|
-
group: v.getTickGroupAttributes($,
|
|
569
|
-
ghost: v.getTickGhostAttributes(
|
|
568
|
+
group: v.getTickGroupAttributes($, h),
|
|
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(
|
|
578
|
-
([
|
|
579
|
-
v[
|
|
575
|
+
function U() {
|
|
576
|
+
const $ = o.value.step ? "bandScale" : "linearScale", h = Tn[`${g.value}-${Ee[$]}`];
|
|
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: Ee, POSITIONS: we, 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__ */ E(
|
|
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 En(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 wn = /* @__PURE__ */ w({
|
|
633
633
|
__name: "lume-bar",
|
|
634
634
|
props: {
|
|
635
635
|
x: {
|
|
@@ -667,13 +667,13 @@ const Tn = /* @__PURE__ */ E({
|
|
|
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 = En(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 Ln = 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__ */ E(
|
|
694
|
+
wn,
|
|
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__ */ w({
|
|
719
719
|
__name: "lume-chart-container",
|
|
720
720
|
props: {
|
|
721
721
|
margins: {
|
|
@@ -737,115 +737,115 @@ const wn = /* @__PURE__ */ E({
|
|
|
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
|
-
e("resize",
|
|
756
|
-
}), { __sfc: !0, props: r, emit: e, margins: n, containerSize:
|
|
755
|
+
e("resize", m);
|
|
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__ */ E(
|
|
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__ */ w({
|
|
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__ */ E(
|
|
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__ */ E(
|
|
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__ */ E(
|
|
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__ */ w({
|
|
849
849
|
__name: "lume-tooltip-item",
|
|
850
850
|
props: {
|
|
851
851
|
color: {
|
|
@@ -857,20 +857,20 @@ const Un = Xn.exports, Yn = /* @__PURE__ */ E({
|
|
|
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__ */ E(
|
|
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__ */ w({
|
|
874
874
|
__name: "lume-tooltip",
|
|
875
875
|
props: {
|
|
876
876
|
targetElement: {
|
|
@@ -884,7 +884,7 @@ const qn = Qn.exports, er = /* @__PURE__ */ E({
|
|
|
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 qn = Qn.exports, er = /* @__PURE__ */ E({
|
|
|
902
902
|
type: String,
|
|
903
903
|
default: null
|
|
904
904
|
},
|
|
905
|
-
...
|
|
905
|
+
..._e()
|
|
906
906
|
},
|
|
907
|
-
emits: ["opened", "moved", "closed"],
|
|
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,40 +925,46 @@ const qn = Qn.exports, er = /* @__PURE__ */ E({
|
|
|
925
925
|
...r.modifiers || []
|
|
926
926
|
]), _ = d(
|
|
927
927
|
() => u.value.showTitle !== !1 && r.title != null
|
|
928
|
-
),
|
|
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
|
-
),
|
|
936
|
-
function
|
|
937
|
-
r.targetElement && n.value && (i.value =
|
|
935
|
+
), y = d(() => l.summary || g.value.label);
|
|
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
|
-
function
|
|
943
|
+
function T() {
|
|
944
944
|
i.value && (i.value.destroy(), e("closed"));
|
|
945
945
|
}
|
|
946
|
-
function
|
|
947
|
-
i.value && (n.value.classList.add("lume-tooltip--animated"), r.targetElement ? function() {
|
|
946
|
+
function A() {
|
|
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
|
-
!
|
|
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
|
-
return r("div", { directives: [{ name: "show", rawName: "v-show", value: e.targetElement, expression: "targetElement" }], ref: "root", staticClass: "lume-tooltip lume-typography--caption",
|
|
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
|
+
"lume-tooltip--pointer-events": n.options.withPointerEvents
|
|
963
|
+
}, attrs: { "data-j-tooltip": "" }, on: { mouseenter: function(o) {
|
|
964
|
+
return n.emit("tooltip-mouseenter");
|
|
965
|
+
}, mouseleave: function(o) {
|
|
966
|
+
return n.emit("tooltip-mouseleave");
|
|
967
|
+
} } }, [e._t("default", function() {
|
|
962
968
|
return [e._t("title", function() {
|
|
963
969
|
return [n.showTitle ? r(n.LumeTooltipTitle, [e._v(" " + e._s(n.formatTitle(e.title)) + " ")]) : e._e()];
|
|
964
970
|
}), r("ul", { staticClass: "lume-tooltip__items" }, [e._t("summary", function() {
|
|
@@ -966,75 +972,75 @@ var tr = function() {
|
|
|
966
972
|
return [e._v(" " + e._s(n.formatValue(n.summaryItem.value)) + " ")];
|
|
967
973
|
}, proxy: !0 } : null], null, !0) }, [e._v(" " + e._s(n.summaryItem.label) + " ")]) : e._e()];
|
|
968
974
|
}), n.hasSummary ? r("li", { staticClass: "lume-tooltip__break" }, [r("hr")]) : e._e(), e._t("items", function() {
|
|
969
|
-
return e._l(n.items, function(
|
|
970
|
-
return r(n.LumeTooltipItem, { key:
|
|
971
|
-
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) + " ")];
|
|
972
978
|
}, proxy: !0 }, { key: "value", fn: function() {
|
|
973
|
-
return [e._v(" " + e._s(n.formatValue(
|
|
979
|
+
return [e._v(" " + e._s(n.formatValue(o.value)) + " ")];
|
|
974
980
|
}, proxy: !0 }], null, !0) });
|
|
975
981
|
});
|
|
976
982
|
})], 2)];
|
|
977
983
|
})], 2);
|
|
978
|
-
},
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
984
|
+
}, ir = [], sr = /* @__PURE__ */ E(
|
|
985
|
+
lr,
|
|
986
|
+
ur,
|
|
987
|
+
ir,
|
|
982
988
|
!1,
|
|
983
989
|
null,
|
|
984
|
-
"
|
|
990
|
+
"8ec11304",
|
|
985
991
|
null,
|
|
986
992
|
null
|
|
987
993
|
);
|
|
988
|
-
const
|
|
989
|
-
var
|
|
990
|
-
const
|
|
991
|
-
function
|
|
992
|
-
return t ===
|
|
993
|
-
}
|
|
994
|
-
function
|
|
995
|
-
return Object.values(
|
|
996
|
-
}
|
|
997
|
-
function
|
|
998
|
-
return e ===
|
|
999
|
-
...
|
|
1000
|
-
...
|
|
1001
|
-
...
|
|
1002
|
-
...
|
|
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
|
+
}
|
|
1000
|
+
function pr(t) {
|
|
1001
|
+
return Object.values(Ve).includes(t);
|
|
1002
|
+
}
|
|
1003
|
+
function Je(t, e) {
|
|
1004
|
+
return e === te.Divergent ? Object.values(Ge).includes(t) : Object.values({
|
|
1005
|
+
...j,
|
|
1006
|
+
...gt,
|
|
1007
|
+
...yt,
|
|
1008
|
+
...Ve
|
|
1003
1009
|
}).includes(t);
|
|
1004
1010
|
}
|
|
1005
|
-
function
|
|
1006
|
-
const r = Object.values(
|
|
1007
|
-
return
|
|
1011
|
+
function fr(t, e) {
|
|
1012
|
+
const r = Object.values(j).indexOf(t);
|
|
1013
|
+
return ln(Object.values(j), r > -1 ? r : 0)[e];
|
|
1008
1014
|
}
|
|
1009
|
-
function
|
|
1015
|
+
function mr(t, e) {
|
|
1010
1016
|
const r = 50 + e * 10;
|
|
1011
1017
|
return `${t}-${r}`;
|
|
1012
1018
|
}
|
|
1013
|
-
function
|
|
1019
|
+
function hr(t, e) {
|
|
1014
1020
|
const r = (e + 1) * 10;
|
|
1015
1021
|
return `${t}-${r}`;
|
|
1016
1022
|
}
|
|
1017
|
-
function
|
|
1023
|
+
function Qe(t, e, r) {
|
|
1018
1024
|
switch (e) {
|
|
1019
1025
|
default:
|
|
1020
|
-
case
|
|
1021
|
-
return
|
|
1022
|
-
case
|
|
1023
|
-
return
|
|
1024
|
-
case
|
|
1025
|
-
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);
|
|
1026
1032
|
}
|
|
1027
1033
|
}
|
|
1028
|
-
function
|
|
1029
|
-
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));
|
|
1030
1036
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return t.map((e) =>
|
|
1037
|
+
function yr(t) {
|
|
1038
|
+
return t.map((e) => en(e) ? e : { value: e });
|
|
1033
1039
|
}
|
|
1034
|
-
function
|
|
1040
|
+
function br(t) {
|
|
1035
1041
|
return t.__internal === !0;
|
|
1036
1042
|
}
|
|
1037
|
-
const
|
|
1043
|
+
const Me = (t = null) => ({
|
|
1038
1044
|
data: {
|
|
1039
1045
|
type: Array,
|
|
1040
1046
|
required: !0,
|
|
@@ -1046,51 +1052,51 @@ const Ve = (t = null) => ({
|
|
|
1046
1052
|
},
|
|
1047
1053
|
color: {
|
|
1048
1054
|
type: String,
|
|
1049
|
-
default:
|
|
1055
|
+
default: j.Skyblue
|
|
1050
1056
|
},
|
|
1051
1057
|
title: {
|
|
1052
1058
|
type: String,
|
|
1053
1059
|
default: null
|
|
1054
1060
|
}
|
|
1055
1061
|
});
|
|
1056
|
-
function
|
|
1057
|
-
const
|
|
1062
|
+
function ze(t, e, r, n, o) {
|
|
1063
|
+
const a = ye({
|
|
1058
1064
|
width: 0,
|
|
1059
1065
|
height: 0
|
|
1060
|
-
}), l =
|
|
1066
|
+
}), l = sn(12), i = d(() => {
|
|
1061
1067
|
var v;
|
|
1062
|
-
return t.value.length > 5 &&
|
|
1063
|
-
(
|
|
1064
|
-
if (
|
|
1065
|
-
return
|
|
1066
|
-
const
|
|
1067
|
-
|
|
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,
|
|
1068
1074
|
r == null ? void 0 : r.value,
|
|
1069
1075
|
n == null ? void 0 : n.value.colorPalette,
|
|
1070
1076
|
_
|
|
1071
1077
|
);
|
|
1072
1078
|
return {
|
|
1073
|
-
...
|
|
1074
|
-
values:
|
|
1079
|
+
...s,
|
|
1080
|
+
values: m,
|
|
1075
1081
|
color: f,
|
|
1076
1082
|
__internal: !0
|
|
1077
1083
|
};
|
|
1078
1084
|
}
|
|
1079
1085
|
);
|
|
1080
|
-
}), u = d(() => Array.isArray(e.value) ? e.value :
|
|
1081
|
-
function
|
|
1082
|
-
const
|
|
1083
|
-
|
|
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;
|
|
1084
1090
|
}
|
|
1085
1091
|
return {
|
|
1086
1092
|
chartID: l,
|
|
1087
1093
|
computedLabels: u,
|
|
1088
|
-
containerSize:
|
|
1094
|
+
containerSize: a,
|
|
1089
1095
|
internalData: i,
|
|
1090
|
-
updateSize:
|
|
1096
|
+
updateSize: c
|
|
1091
1097
|
};
|
|
1092
1098
|
}
|
|
1093
|
-
const
|
|
1099
|
+
const kr = () => ({
|
|
1094
1100
|
xScale: {
|
|
1095
1101
|
type: Function,
|
|
1096
1102
|
default: null
|
|
@@ -1100,69 +1106,69 @@ const pr = () => ({
|
|
|
1100
1106
|
default: null
|
|
1101
1107
|
}
|
|
1102
1108
|
});
|
|
1103
|
-
function
|
|
1104
|
-
const
|
|
1109
|
+
function Tr(t, e, r, n, o) {
|
|
1110
|
+
const a = I(null), l = I(null);
|
|
1105
1111
|
function i() {
|
|
1106
|
-
const { width: u, height:
|
|
1107
|
-
!u && !
|
|
1112
|
+
const { width: u, height: c } = r;
|
|
1113
|
+
!u && !c || !e.value || !t.value || (n.value === L.HORIZONTAL ? (a.value = et(
|
|
1108
1114
|
t.value,
|
|
1109
1115
|
u,
|
|
1110
1116
|
n.value,
|
|
1111
|
-
|
|
1112
|
-
), l.value =
|
|
1117
|
+
o.value.startOnZero
|
|
1118
|
+
), l.value = qe(
|
|
1113
1119
|
e.value,
|
|
1114
|
-
|
|
1120
|
+
c,
|
|
1115
1121
|
n.value,
|
|
1116
|
-
|
|
1117
|
-
)) : (
|
|
1122
|
+
o.value
|
|
1123
|
+
)) : (a.value = qe(
|
|
1118
1124
|
e.value,
|
|
1119
1125
|
u,
|
|
1120
1126
|
n.value,
|
|
1121
|
-
|
|
1122
|
-
), l.value =
|
|
1127
|
+
o.value
|
|
1128
|
+
), l.value = et(
|
|
1123
1129
|
t.value,
|
|
1124
|
-
|
|
1130
|
+
c,
|
|
1125
1131
|
n.value,
|
|
1126
|
-
|
|
1132
|
+
o.value.startOnZero
|
|
1127
1133
|
)));
|
|
1128
1134
|
}
|
|
1129
|
-
return
|
|
1135
|
+
return pt(i), { xScale: a, yScale: l };
|
|
1130
1136
|
}
|
|
1131
|
-
function
|
|
1132
|
-
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);
|
|
1133
1139
|
return Object.assign(
|
|
1134
|
-
|
|
1140
|
+
ce().range(o).paddingInner(l ?? u).paddingOuter(i ?? u).domain(t.map((c, v) => v)),
|
|
1135
1141
|
{ labels: t }
|
|
1136
1142
|
);
|
|
1137
1143
|
}
|
|
1138
|
-
function
|
|
1139
|
-
const
|
|
1140
|
-
if (
|
|
1141
|
-
return
|
|
1142
|
-
const l = Math.min(...
|
|
1143
|
-
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();
|
|
1144
1150
|
}
|
|
1145
|
-
function
|
|
1151
|
+
function tt(t) {
|
|
1146
1152
|
return (t == null ? void 0 : t.range) !== void 0 || (t == null ? void 0 : t.copy) !== void 0;
|
|
1147
1153
|
}
|
|
1148
|
-
function
|
|
1149
|
-
return
|
|
1154
|
+
function Ne(t, e) {
|
|
1155
|
+
return oe(t) ? t.bandwidth() / 2 + t(t.domain()[e]) : t(e);
|
|
1150
1156
|
}
|
|
1151
|
-
function
|
|
1157
|
+
function nt(t, e, {
|
|
1152
1158
|
padding: r,
|
|
1153
1159
|
paddingInner: n,
|
|
1154
|
-
paddingOuter:
|
|
1160
|
+
paddingOuter: o
|
|
1155
1161
|
} = {}) {
|
|
1156
|
-
const
|
|
1157
|
-
return t.copy().paddingInner(n ??
|
|
1162
|
+
const a = r ?? (e === L.HORIZONTAL ? Tt : kt);
|
|
1163
|
+
return t.copy().paddingInner(n ?? a).paddingOuter(o ?? a);
|
|
1158
1164
|
}
|
|
1159
|
-
function
|
|
1160
|
-
return Object.values(
|
|
1165
|
+
function Lt(t) {
|
|
1166
|
+
return Object.values(L).includes(t);
|
|
1161
1167
|
}
|
|
1162
|
-
const
|
|
1163
|
-
...
|
|
1164
|
-
...
|
|
1165
|
-
...
|
|
1168
|
+
const ue = (t, e = !0) => ({
|
|
1169
|
+
...Me(t),
|
|
1170
|
+
...kr(),
|
|
1171
|
+
..._e(),
|
|
1166
1172
|
classList: {
|
|
1167
1173
|
type: [String, Array],
|
|
1168
1174
|
default: () => []
|
|
@@ -1174,18 +1180,18 @@ const oe = (t, e = !0) => ({
|
|
|
1174
1180
|
...e ? {
|
|
1175
1181
|
orientation: {
|
|
1176
1182
|
type: String,
|
|
1177
|
-
default:
|
|
1178
|
-
validator:
|
|
1183
|
+
default: L.VERTICAL,
|
|
1184
|
+
validator: Lt
|
|
1179
1185
|
}
|
|
1180
1186
|
} : {}
|
|
1181
|
-
}),
|
|
1182
|
-
...
|
|
1183
|
-
...
|
|
1187
|
+
}), xr = (t) => ({
|
|
1188
|
+
...Me(t),
|
|
1189
|
+
..._e(),
|
|
1184
1190
|
hoveredElement: {
|
|
1185
1191
|
type: [Number, String],
|
|
1186
1192
|
default: null
|
|
1187
1193
|
}
|
|
1188
|
-
}),
|
|
1194
|
+
}), ke = () => ({
|
|
1189
1195
|
data: {
|
|
1190
1196
|
type: Array,
|
|
1191
1197
|
required: !0
|
|
@@ -1200,8 +1206,8 @@ const oe = (t, e = !0) => ({
|
|
|
1200
1206
|
},
|
|
1201
1207
|
orientation: {
|
|
1202
1208
|
type: String,
|
|
1203
|
-
default:
|
|
1204
|
-
validator:
|
|
1209
|
+
default: L.VERTICAL,
|
|
1210
|
+
validator: Lt
|
|
1205
1211
|
},
|
|
1206
1212
|
xScale: {
|
|
1207
1213
|
type: Function,
|
|
@@ -1227,120 +1233,160 @@ const oe = (t, e = !0) => ({
|
|
|
1227
1233
|
type: [String, Array],
|
|
1228
1234
|
default: () => []
|
|
1229
1235
|
}
|
|
1230
|
-
}),
|
|
1236
|
+
}), Ar = /* @__PURE__ */ w({
|
|
1231
1237
|
__name: "lume-overlay-group",
|
|
1232
1238
|
props: {
|
|
1233
|
-
...
|
|
1239
|
+
...ke(),
|
|
1234
1240
|
orientation: {
|
|
1235
1241
|
type: String,
|
|
1236
|
-
default:
|
|
1242
|
+
default: L.VERTICAL
|
|
1237
1243
|
}
|
|
1238
1244
|
},
|
|
1239
1245
|
emits: ["click", "lume__internal--hover", "mouseover"],
|
|
1240
1246
|
setup(t, { emit: e }) {
|
|
1241
|
-
const r = t, { data: n, orientation:
|
|
1242
|
-
function u(
|
|
1243
|
-
var
|
|
1244
|
-
const v =
|
|
1245
|
-
return
|
|
1246
|
-
width: Math.max(...
|
|
1247
|
+
const r = t, { data: n, orientation: o, xScale: a, yScale: l } = S(r), i = d(() => Ie(n));
|
|
1248
|
+
function u(c) {
|
|
1249
|
+
var y;
|
|
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()),
|
|
1247
1253
|
height: _,
|
|
1248
|
-
transform: `translate(0, ${
|
|
1254
|
+
transform: `translate(0, ${g})`
|
|
1249
1255
|
} : {
|
|
1250
1256
|
width: _,
|
|
1251
1257
|
height: Math.max(...l.value.range()),
|
|
1252
|
-
transform: `translate(${
|
|
1258
|
+
transform: `translate(${g}, 0)`
|
|
1253
1259
|
};
|
|
1254
1260
|
}
|
|
1255
|
-
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 };
|
|
1256
1262
|
}
|
|
1257
1263
|
});
|
|
1258
|
-
var
|
|
1264
|
+
var Lr = function() {
|
|
1259
1265
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
1260
|
-
return r("g", { staticClass: "lume-overlay-group" }, e._l(n.overlayData, function(
|
|
1261
|
-
return r(n.LumeBar, e._b({ key: `overlay-${
|
|
1262
|
-
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);
|
|
1263
1269
|
}, click: function(l) {
|
|
1264
|
-
return n.emit("click", { index:
|
|
1265
|
-
} } }, "lume-bar", n.getOverlayBarAttributes(
|
|
1270
|
+
return n.emit("click", { index: a, event: l });
|
|
1271
|
+
} } }, "lume-bar", n.getOverlayBarAttributes(a), !1));
|
|
1266
1272
|
}), 1);
|
|
1267
|
-
},
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1273
|
+
}, Or = [], $r = /* @__PURE__ */ E(
|
|
1274
|
+
Ar,
|
|
1275
|
+
Lr,
|
|
1276
|
+
Or,
|
|
1271
1277
|
!1,
|
|
1272
1278
|
null,
|
|
1273
1279
|
null,
|
|
1274
1280
|
null,
|
|
1275
1281
|
null
|
|
1276
1282
|
);
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1283
|
+
const Ir = $r.exports, Er = [
|
|
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: Er.reduce((l, i) => (l[i] = (u) => t(i, u), l), {}), busEmit: n, busListen: o };
|
|
1323
|
+
};
|
|
1324
|
+
function wr(t) {
|
|
1279
1325
|
return { hasNegativeValues: d(
|
|
1280
|
-
() =>
|
|
1326
|
+
() => mt(t.value).some((r) => r < 0)
|
|
1281
1327
|
) };
|
|
1282
1328
|
}
|
|
1283
|
-
function
|
|
1284
|
-
const
|
|
1285
|
-
() => n.value ===
|
|
1286
|
-
),
|
|
1329
|
+
function Nr(t, e, r, n) {
|
|
1330
|
+
const o = d(
|
|
1331
|
+
() => n.value === L.HORIZONTAL
|
|
1332
|
+
), a = d(
|
|
1287
1333
|
() => {
|
|
1288
|
-
var
|
|
1289
|
-
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);
|
|
1290
1336
|
}
|
|
1291
1337
|
), l = d(
|
|
1292
1338
|
() => {
|
|
1293
|
-
var
|
|
1294
|
-
return
|
|
1339
|
+
var c;
|
|
1340
|
+
return o != null && o.value ? ((c = e.value) == null ? void 0 : c.call(e, 0)) || 0 : t.width;
|
|
1295
1341
|
}
|
|
1296
1342
|
), i = d(
|
|
1297
1343
|
() => {
|
|
1298
|
-
var
|
|
1299
|
-
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})`;
|
|
1300
1346
|
}
|
|
1301
1347
|
);
|
|
1302
1348
|
return { negativeBarAttributes: d(() => ({
|
|
1303
1349
|
width: l.value,
|
|
1304
|
-
height:
|
|
1350
|
+
height: a.value,
|
|
1305
1351
|
transform: i.value
|
|
1306
1352
|
})) };
|
|
1307
1353
|
}
|
|
1308
|
-
function
|
|
1309
|
-
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), []);
|
|
1310
1356
|
}
|
|
1311
|
-
function
|
|
1312
|
-
return t.reduce((e, r) => r.values.map((n,
|
|
1313
|
-
const
|
|
1314
|
-
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;
|
|
1315
1361
|
}), []);
|
|
1316
1362
|
}
|
|
1317
|
-
const
|
|
1318
|
-
"stacked-bar":
|
|
1363
|
+
const rt = {
|
|
1364
|
+
"stacked-bar": Hr
|
|
1319
1365
|
};
|
|
1320
|
-
function
|
|
1366
|
+
function Ot(t, e, r, n, o, a, l) {
|
|
1321
1367
|
const i = d(
|
|
1322
1368
|
() => {
|
|
1323
|
-
var
|
|
1324
|
-
return e.value.withTooltip !== !1 && !((
|
|
1369
|
+
var c;
|
|
1370
|
+
return e.value.withTooltip !== !1 && !((c = e.value.tooltipOptions) != null && c.targetElement);
|
|
1325
1371
|
}
|
|
1326
1372
|
);
|
|
1327
|
-
function u(
|
|
1328
|
-
const v = l != null && l.value &&
|
|
1329
|
-
t.value = v.map((
|
|
1330
|
-
cx: (
|
|
1331
|
-
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)
|
|
1332
1378
|
}));
|
|
1333
1379
|
}
|
|
1334
|
-
return
|
|
1380
|
+
return H(
|
|
1335
1381
|
[r, n],
|
|
1336
1382
|
() => {
|
|
1337
|
-
r.value && n.value && (
|
|
1383
|
+
r.value && n.value && (a != null && a.value) && i.value && u(a.value);
|
|
1338
1384
|
},
|
|
1339
1385
|
{ immediate: !0 }
|
|
1340
1386
|
), { shouldGenerateTooltipAnchors: i, updateTooltipAnchorAttributes: u };
|
|
1341
1387
|
}
|
|
1342
|
-
function
|
|
1343
|
-
const t =
|
|
1388
|
+
function Dr() {
|
|
1389
|
+
const t = ye({
|
|
1344
1390
|
opened: !1,
|
|
1345
1391
|
targetElement: null
|
|
1346
1392
|
});
|
|
@@ -1350,219 +1396,234 @@ function $r() {
|
|
|
1350
1396
|
t.opened = !1, t.targetElement = null;
|
|
1351
1397
|
} };
|
|
1352
1398
|
}
|
|
1353
|
-
function
|
|
1399
|
+
function Rr(t) {
|
|
1354
1400
|
return { getTooltipItems: d(
|
|
1355
|
-
() => (r) => t.value.map(({ color: n, label:
|
|
1401
|
+
() => (r) => t.value.map(({ color: n, label: o, values: a }) => {
|
|
1356
1402
|
var l, i, u;
|
|
1357
1403
|
return {
|
|
1358
|
-
color: ((l =
|
|
1359
|
-
label:
|
|
1360
|
-
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
|
|
1361
1407
|
};
|
|
1362
1408
|
})
|
|
1363
1409
|
) };
|
|
1364
1410
|
}
|
|
1365
|
-
const
|
|
1411
|
+
const Ce = 16, He = 8, De = 28, Re = 24, re = {
|
|
1366
1412
|
VERTICAL: {
|
|
1367
|
-
top:
|
|
1368
|
-
right:
|
|
1369
|
-
bottom:
|
|
1370
|
-
left:
|
|
1413
|
+
top: Ce,
|
|
1414
|
+
right: He,
|
|
1415
|
+
bottom: De,
|
|
1416
|
+
left: Re
|
|
1371
1417
|
},
|
|
1372
1418
|
HORIZONTAL: {
|
|
1373
|
-
top:
|
|
1374
|
-
right:
|
|
1375
|
-
bottom:
|
|
1376
|
-
left:
|
|
1419
|
+
top: Ce,
|
|
1420
|
+
right: He,
|
|
1421
|
+
bottom: De,
|
|
1422
|
+
left: Re
|
|
1377
1423
|
}
|
|
1378
1424
|
};
|
|
1379
|
-
function
|
|
1380
|
-
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;
|
|
1381
1427
|
}
|
|
1382
|
-
function
|
|
1383
|
-
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;
|
|
1384
1430
|
}
|
|
1385
|
-
function
|
|
1386
|
-
return !t || t === "auto" || t.bottom == null || t.bottom === "auto" ? e ||
|
|
1431
|
+
function Br(t, e) {
|
|
1432
|
+
return !t || t === "auto" || t.bottom == null || t.bottom === "auto" ? e || De : t.bottom;
|
|
1387
1433
|
}
|
|
1388
|
-
function
|
|
1389
|
-
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;
|
|
1390
1436
|
}
|
|
1391
|
-
const
|
|
1437
|
+
const Gr = /* @__PURE__ */ w({
|
|
1392
1438
|
__name: "lume-chart",
|
|
1393
1439
|
props: {
|
|
1394
|
-
...
|
|
1440
|
+
...ue(),
|
|
1395
1441
|
chartType: {
|
|
1396
1442
|
type: String,
|
|
1397
1443
|
default: null
|
|
1398
1444
|
}
|
|
1399
1445
|
},
|
|
1400
1446
|
setup(t, { emit: e }) {
|
|
1401
|
-
const r = t, n =
|
|
1402
|
-
|
|
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(
|
|
1448
|
+
T,
|
|
1403
1449
|
A,
|
|
1404
1450
|
x,
|
|
1405
1451
|
u,
|
|
1406
|
-
|
|
1407
|
-
),
|
|
1408
|
-
top:
|
|
1409
|
-
right:
|
|
1410
|
-
bottom:
|
|
1411
|
-
left:
|
|
1412
|
-
})),
|
|
1413
|
-
var
|
|
1414
|
-
return r.xScale ?
|
|
1415
|
-
}),
|
|
1416
|
-
var
|
|
1417
|
-
return r.yScale ?
|
|
1418
|
-
}),
|
|
1419
|
-
...
|
|
1420
|
-
withHover: u.value ===
|
|
1421
|
-
})),
|
|
1422
|
-
...
|
|
1423
|
-
withHover: u.value ===
|
|
1424
|
-
})),
|
|
1425
|
-
var
|
|
1426
|
-
return (
|
|
1427
|
-
}),
|
|
1428
|
-
var
|
|
1429
|
-
return (
|
|
1430
|
-
}),
|
|
1431
|
-
var
|
|
1432
|
-
return ((
|
|
1433
|
-
}),
|
|
1434
|
-
var
|
|
1435
|
-
return ((
|
|
1436
|
-
}),
|
|
1437
|
-
() =>
|
|
1438
|
-
),
|
|
1439
|
-
const
|
|
1440
|
-
return
|
|
1441
|
-
}), { hasNegativeValues:
|
|
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(() => {
|
|
1459
|
+
var b;
|
|
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(() => {
|
|
1462
|
+
var b;
|
|
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,
|
|
1466
|
+
withHover: u.value === L.VERTICAL
|
|
1467
|
+
})), U = d(() => ({
|
|
1468
|
+
...p.value.yAxisOptions,
|
|
1469
|
+
withHover: u.value === L.HORIZONTAL
|
|
1470
|
+
})), $ = d(() => {
|
|
1471
|
+
var b;
|
|
1472
|
+
return (b = p.value.xAxisOptions) == null ? void 0 : b.title;
|
|
1473
|
+
}), h = d(() => {
|
|
1474
|
+
var b;
|
|
1475
|
+
return (b = p.value.yAxisOptions) == null ? void 0 : b.title;
|
|
1476
|
+
}), O = d(() => {
|
|
1477
|
+
var b;
|
|
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)
|
|
1484
|
+
), z = d(() => {
|
|
1485
|
+
const b = [], { noBaseScales: P } = p.value;
|
|
1486
|
+
return P || b.push(() => !!(G.value && M.value)), b.every((ee) => ee() === !0);
|
|
1487
|
+
}), { hasNegativeValues: W } = wr(T), { negativeBarAttributes: Te } = Nr(
|
|
1442
1488
|
x,
|
|
1443
|
-
|
|
1444
|
-
|
|
1489
|
+
G,
|
|
1490
|
+
M,
|
|
1445
1491
|
u
|
|
1446
|
-
), { shouldGenerateTooltipAnchors:
|
|
1447
|
-
p,
|
|
1492
|
+
), { shouldGenerateTooltipAnchors: Ze } = Ot(
|
|
1448
1493
|
m,
|
|
1449
|
-
|
|
1450
|
-
|
|
1494
|
+
p,
|
|
1495
|
+
G,
|
|
1496
|
+
M,
|
|
1451
1497
|
u,
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
), { tooltipConfig:
|
|
1455
|
-
() =>
|
|
1456
|
-
),
|
|
1498
|
+
T,
|
|
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(
|
|
1457
1503
|
() => {
|
|
1458
|
-
var
|
|
1459
|
-
return ((
|
|
1504
|
+
var b;
|
|
1505
|
+
return ((b = p.value.tooltipOptions) == null ? void 0 : b.position) || "top";
|
|
1460
1506
|
}
|
|
1461
|
-
)
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
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);
|
|
1511
|
+
});
|
|
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);
|
|
1467
1517
|
}
|
|
1468
1518
|
}
|
|
1469
|
-
function xe(
|
|
1470
|
-
|
|
1471
|
-
|
|
1519
|
+
function xe() {
|
|
1520
|
+
Ue(), v.value = -1;
|
|
1521
|
+
}
|
|
1522
|
+
function Ae(b) {
|
|
1523
|
+
if (b > o.value[0].values.length - 1) {
|
|
1524
|
+
ne(Y.InvalidHoveredIndex);
|
|
1472
1525
|
return;
|
|
1473
1526
|
}
|
|
1474
|
-
|
|
1527
|
+
me(b);
|
|
1475
1528
|
}
|
|
1476
|
-
function
|
|
1477
|
-
|
|
1529
|
+
function Rt() {
|
|
1530
|
+
setTimeout(() => {
|
|
1531
|
+
Ye.value && xe(), e("chart-mouseleave");
|
|
1532
|
+
}, 0);
|
|
1478
1533
|
}
|
|
1479
|
-
function
|
|
1480
|
-
|
|
1534
|
+
function Pt({ index: b, value: P, event: ee }) {
|
|
1535
|
+
b !== null && me(b), e("axis-mouseenter", { index: b, value: P, event: ee });
|
|
1481
1536
|
}
|
|
1482
|
-
function
|
|
1483
|
-
e("axis-click", { index:
|
|
1537
|
+
function St({ index: b, value: P, event: ee }) {
|
|
1538
|
+
e("axis-click", { index: b, value: P, event: ee });
|
|
1484
1539
|
}
|
|
1485
|
-
return
|
|
1486
|
-
a,
|
|
1487
|
-
(k, F) => e("data-changed", { newValue: k, oldValue: F })
|
|
1488
|
-
), D(
|
|
1540
|
+
return H(
|
|
1489
1541
|
o,
|
|
1490
|
-
(
|
|
1491
|
-
),
|
|
1492
|
-
|
|
1493
|
-
(
|
|
1494
|
-
|
|
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(
|
|
1547
|
+
m,
|
|
1548
|
+
(b) => {
|
|
1549
|
+
b && r.hoveredIndex != null && v.value === -1 && Ae(r.hoveredIndex);
|
|
1495
1550
|
},
|
|
1496
1551
|
{ flush: "post" }
|
|
1497
|
-
),
|
|
1498
|
-
|
|
1499
|
-
}),
|
|
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 };
|
|
1500
1557
|
}
|
|
1501
1558
|
});
|
|
1502
|
-
var
|
|
1559
|
+
var Vr = function() {
|
|
1503
1560
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
1504
|
-
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(
|
|
1505
|
-
return n.emit("chart-click",
|
|
1506
|
-
}, mouseenter: function(
|
|
1507
|
-
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);
|
|
1508
1565
|
}, mouseleave: n.handleMouseleave }, scopedSlots: e._u([{ key: "header", fn: function() {
|
|
1509
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() {
|
|
1510
|
-
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(
|
|
1511
|
-
return n.emit("legend-click",
|
|
1512
|
-
}, mouseenter: function(
|
|
1513
|
-
return n.emit("legend-mouseenter",
|
|
1514
|
-
}, 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) {
|
|
1515
1572
|
return n.emit("legend-mouseleave");
|
|
1516
1573
|
} } }) : e._e()];
|
|
1517
1574
|
}, { data: n.internalData })], 2)])];
|
|
1518
1575
|
}, proxy: !0 }, { key: "footer", fn: function() {
|
|
1519
|
-
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(
|
|
1520
|
-
return n.emit("legend-click",
|
|
1521
|
-
}, mouseenter: function(
|
|
1522
|
-
return n.emit("legend-mouseenter",
|
|
1523
|
-
}, 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) {
|
|
1524
1581
|
return n.emit("legend-mouseleave");
|
|
1525
1582
|
} } }) : e._e()];
|
|
1526
1583
|
}, proxy: !0 }, { key: "extra", fn: function() {
|
|
1527
1584
|
return [e._t("tooltip", function() {
|
|
1528
|
-
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) {
|
|
1529
1586
|
return n.emit("tooltip-opened", {
|
|
1530
1587
|
index: n.internalHoveredIndex,
|
|
1531
|
-
targetElement:
|
|
1588
|
+
targetElement: o
|
|
1532
1589
|
});
|
|
1533
|
-
}, moved: function(
|
|
1590
|
+
}, moved: function(o) {
|
|
1534
1591
|
return n.emit("tooltip-moved", {
|
|
1535
1592
|
index: n.internalHoveredIndex,
|
|
1536
|
-
targetElement:
|
|
1593
|
+
targetElement: o
|
|
1537
1594
|
});
|
|
1538
|
-
}, closed: function(
|
|
1595
|
+
}, closed: function(o) {
|
|
1539
1596
|
return n.emit("tooltip-closed");
|
|
1597
|
+
}, "tooltip-mouseenter": function(o) {
|
|
1598
|
+
n.isHoveringTooltip = !0;
|
|
1599
|
+
}, "tooltip-mouseleave": function(o) {
|
|
1600
|
+
n.isHoveringTooltip = !1;
|
|
1540
1601
|
} } }, "lume-tooltip", n.tooltipConfig, !1), [e._t("tooltip-content", null, { data: n.internalData, labels: n.computedLabels, hoveredIndex: n.internalHoveredIndex })], 2) : e._e()];
|
|
1541
|
-
}, { 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, options: n.allOptions.tooltipOptions }, n.tooltipConfig)];
|
|
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)];
|
|
1542
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() {
|
|
1543
|
-
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) {
|
|
1544
1605
|
return n.emit("axis-mouseleave");
|
|
1545
|
-
}, "lume__internal--axis-size": function(
|
|
1546
|
-
n.xAxisHeight =
|
|
1547
|
-
} } }), 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) {
|
|
1548
1609
|
return n.emit("axis-mouseleave");
|
|
1549
|
-
}, "lume__internal--axis-size": function(
|
|
1550
|
-
n.yAxisWidth =
|
|
1610
|
+
}, "lume__internal--axis-size": function(o) {
|
|
1611
|
+
n.yAxisWidth = o;
|
|
1551
1612
|
} } })];
|
|
1552
|
-
}, { 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(
|
|
1553
|
-
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));
|
|
1554
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);
|
|
1555
|
-
},
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1616
|
+
}, jr = [], Mr = /* @__PURE__ */ E(
|
|
1617
|
+
Gr,
|
|
1618
|
+
Vr,
|
|
1619
|
+
jr,
|
|
1559
1620
|
!1,
|
|
1560
1621
|
null,
|
|
1561
|
-
"
|
|
1622
|
+
"ea1a07b9",
|
|
1562
1623
|
null,
|
|
1563
1624
|
null
|
|
1564
1625
|
);
|
|
1565
|
-
const
|
|
1626
|
+
const ie = Mr.exports, zr = /* @__PURE__ */ w({
|
|
1566
1627
|
__name: "lume-alluvial-node-label",
|
|
1567
1628
|
props: {
|
|
1568
1629
|
bottom: { type: Boolean, default: !1 }
|
|
@@ -1571,20 +1632,20 @@ const le = Sr.exports, Br = /* @__PURE__ */ E({
|
|
|
1571
1632
|
return { __sfc: !0 };
|
|
1572
1633
|
}
|
|
1573
1634
|
});
|
|
1574
|
-
var
|
|
1635
|
+
var Wr = function() {
|
|
1575
1636
|
var e = this, r = e._self._c;
|
|
1576
1637
|
return e._self._setupProxy, r("text", { staticClass: "lume-alluvial-group__node-label", attrs: { dy: e.bottom ? "1.2em" : "" } }, [e._t("default")], 2);
|
|
1577
|
-
},
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1638
|
+
}, Zr = [], Xr = /* @__PURE__ */ E(
|
|
1639
|
+
zr,
|
|
1640
|
+
Wr,
|
|
1641
|
+
Zr,
|
|
1581
1642
|
!1,
|
|
1582
1643
|
null,
|
|
1583
1644
|
"d2a7cb8e",
|
|
1584
1645
|
null,
|
|
1585
1646
|
null
|
|
1586
1647
|
);
|
|
1587
|
-
const
|
|
1648
|
+
const Ur = Xr.exports, Yr = /* @__PURE__ */ w({
|
|
1588
1649
|
__name: "lume-alluvial-node-value",
|
|
1589
1650
|
props: {
|
|
1590
1651
|
bottom: { type: Boolean, default: !0 }
|
|
@@ -1593,21 +1654,21 @@ const Vr = Gr.exports, jr = /* @__PURE__ */ E({
|
|
|
1593
1654
|
return { __sfc: !0 };
|
|
1594
1655
|
}
|
|
1595
1656
|
});
|
|
1596
|
-
var
|
|
1657
|
+
var Kr = function() {
|
|
1597
1658
|
var e = this, r = e._self._c;
|
|
1598
1659
|
return e._self._setupProxy, r("text", { staticClass: "lume-alluvial-group__node-value", attrs: { dy: e.bottom ? "1.2em" : "" } }, [e._t("default")], 2);
|
|
1599
|
-
},
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1660
|
+
}, Jr = [], Qr = /* @__PURE__ */ E(
|
|
1661
|
+
Yr,
|
|
1662
|
+
Kr,
|
|
1663
|
+
Jr,
|
|
1603
1664
|
!1,
|
|
1604
1665
|
null,
|
|
1605
1666
|
"002e2887",
|
|
1606
1667
|
null,
|
|
1607
1668
|
null
|
|
1608
1669
|
);
|
|
1609
|
-
const
|
|
1610
|
-
function
|
|
1670
|
+
const qr = Qr.exports;
|
|
1671
|
+
function ot(t, e) {
|
|
1611
1672
|
return {
|
|
1612
1673
|
x0: 0 + (e ? e.left : 0),
|
|
1613
1674
|
y0: 0 + (e ? e.top : 0),
|
|
@@ -1615,239 +1676,239 @@ function Qe(t, e) {
|
|
|
1615
1676
|
y1: t.height - (e ? e.bottom : 0)
|
|
1616
1677
|
};
|
|
1617
1678
|
}
|
|
1618
|
-
function
|
|
1619
|
-
const e = I(
|
|
1679
|
+
function eo(t) {
|
|
1680
|
+
const e = I(ot(t));
|
|
1620
1681
|
function r(n) {
|
|
1621
|
-
e.value =
|
|
1682
|
+
e.value = ot(t, n);
|
|
1622
1683
|
}
|
|
1623
1684
|
return { extents: e, updateExtents: r };
|
|
1624
1685
|
}
|
|
1625
|
-
var
|
|
1626
|
-
const
|
|
1627
|
-
function
|
|
1628
|
-
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);
|
|
1629
1690
|
}
|
|
1630
|
-
const
|
|
1631
|
-
function
|
|
1691
|
+
const at = 8, ro = 8, oo = 20, ao = 200;
|
|
1692
|
+
function le(t) {
|
|
1632
1693
|
return typeof t == "string" || typeof t == "number" ? t : t.id ?? t.label;
|
|
1633
1694
|
}
|
|
1634
|
-
function
|
|
1695
|
+
function lo(t, e) {
|
|
1635
1696
|
return e.nodes.find((r) => r.id === t);
|
|
1636
1697
|
}
|
|
1637
|
-
function
|
|
1698
|
+
function uo(t, e) {
|
|
1638
1699
|
return e.links.find((r) => r.id === t);
|
|
1639
1700
|
}
|
|
1640
|
-
function
|
|
1701
|
+
function It(t) {
|
|
1641
1702
|
return !!(t.sourceLinks && t.targetLinks);
|
|
1642
1703
|
}
|
|
1643
|
-
function
|
|
1704
|
+
function io(t, e) {
|
|
1644
1705
|
if (!e)
|
|
1645
1706
|
return;
|
|
1646
|
-
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(
|
|
1647
1708
|
(l, i) => Math.max(l, i.getBBox().width),
|
|
1648
1709
|
-1 / 0
|
|
1649
|
-
),
|
|
1710
|
+
), a = e.filter((l) => n.includes(l.dataset.id)).reduce(
|
|
1650
1711
|
(l, i) => Math.max(l, i.getBBox().width),
|
|
1651
1712
|
-1 / 0
|
|
1652
1713
|
);
|
|
1653
1714
|
return {
|
|
1654
|
-
left:
|
|
1715
|
+
left: o,
|
|
1655
1716
|
top: 0,
|
|
1656
|
-
right:
|
|
1717
|
+
right: a,
|
|
1657
1718
|
bottom: 0
|
|
1658
1719
|
};
|
|
1659
1720
|
}
|
|
1660
|
-
function
|
|
1721
|
+
function so(t) {
|
|
1661
1722
|
return t.map((e) => ({
|
|
1662
1723
|
x: e.x0,
|
|
1663
1724
|
y: e.y0,
|
|
1664
1725
|
width: e.x1 - e.x0,
|
|
1665
1726
|
height: e.y1 - e.y0,
|
|
1666
1727
|
textTransform: {
|
|
1667
|
-
x: e.depth > 0 ? e.x1 +
|
|
1728
|
+
x: e.depth > 0 ? e.x1 + at : e.x0 - at,
|
|
1668
1729
|
y: (e.y1 + e.y0) / 2
|
|
1669
1730
|
},
|
|
1670
1731
|
node: e
|
|
1671
1732
|
}));
|
|
1672
1733
|
}
|
|
1673
|
-
function
|
|
1734
|
+
function co(t) {
|
|
1674
1735
|
return [t.source.x1, t.y0];
|
|
1675
1736
|
}
|
|
1676
|
-
function
|
|
1737
|
+
function vo(t) {
|
|
1677
1738
|
return [t.target.x0, t.y1];
|
|
1678
1739
|
}
|
|
1679
|
-
function
|
|
1680
|
-
return t.curveFunction ?
|
|
1740
|
+
function _o(t) {
|
|
1741
|
+
return t.curveFunction ? Gt(t.curveFunction).source(co).target(vo) : zt();
|
|
1681
1742
|
}
|
|
1682
|
-
function
|
|
1743
|
+
function po(t) {
|
|
1683
1744
|
return t.map((e) => {
|
|
1684
1745
|
var r;
|
|
1685
1746
|
return {
|
|
1686
1747
|
id: e.id,
|
|
1687
|
-
color: e.color || ((r = e.source) == null ? void 0 : r.color) ||
|
|
1688
|
-
d:
|
|
1748
|
+
color: e.color || ((r = e.source) == null ? void 0 : r.color) || fe,
|
|
1749
|
+
d: _o(e)(e),
|
|
1689
1750
|
strokeWidth: Math.max(1, e.width),
|
|
1690
1751
|
link: e
|
|
1691
1752
|
};
|
|
1692
1753
|
});
|
|
1693
1754
|
}
|
|
1694
|
-
function
|
|
1755
|
+
function lt(t, e, r, n, o) {
|
|
1695
1756
|
if (n === !1) {
|
|
1696
1757
|
t.node = {
|
|
1697
1758
|
...t.node,
|
|
1698
|
-
transitionValue:
|
|
1759
|
+
transitionValue: o ? void 0 : r
|
|
1699
1760
|
};
|
|
1700
1761
|
return;
|
|
1701
1762
|
}
|
|
1702
|
-
const
|
|
1703
|
-
let
|
|
1704
|
-
|
|
1763
|
+
const a = Date.now(), l = an(e, r), i = () => {
|
|
1764
|
+
let c = (Date.now() - a) / ao;
|
|
1765
|
+
c > 1 && (c = 1), t.node = {
|
|
1705
1766
|
...t.node,
|
|
1706
|
-
transitionValue:
|
|
1707
|
-
},
|
|
1767
|
+
transitionValue: o && c === 1 ? void 0 : l(c)
|
|
1768
|
+
}, c < 1 && requestAnimationFrame(i);
|
|
1708
1769
|
};
|
|
1709
1770
|
requestAnimationFrame(i);
|
|
1710
1771
|
}
|
|
1711
|
-
const
|
|
1772
|
+
const fo = {
|
|
1712
1773
|
nodes: [],
|
|
1713
1774
|
links: []
|
|
1714
1775
|
};
|
|
1715
|
-
function
|
|
1776
|
+
function ut(t, e) {
|
|
1716
1777
|
return e.find((r) => r.every((n) => n.x0 === t.x0));
|
|
1717
1778
|
}
|
|
1718
|
-
function
|
|
1719
|
-
const n = I(null),
|
|
1720
|
-
var
|
|
1721
|
-
return (
|
|
1722
|
-
({ label: _, color:
|
|
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 }) => ({
|
|
1723
1784
|
label: _ || f.toString(),
|
|
1724
|
-
color:
|
|
1725
|
-
fallbackColor:
|
|
1785
|
+
color: m,
|
|
1786
|
+
fallbackColor: m || fe,
|
|
1726
1787
|
id: f,
|
|
1727
|
-
deriveColorFromIncomingLinks:
|
|
1728
|
-
offset:
|
|
1788
|
+
deriveColorFromIncomingLinks: g,
|
|
1789
|
+
offset: y
|
|
1729
1790
|
})
|
|
1730
1791
|
);
|
|
1731
|
-
}),
|
|
1792
|
+
}), a = d(
|
|
1732
1793
|
() => {
|
|
1733
|
-
var
|
|
1734
|
-
return (
|
|
1794
|
+
var s;
|
|
1795
|
+
return (s = t.value) == null ? void 0 : s[0].values.map(
|
|
1735
1796
|
(_) => {
|
|
1736
|
-
var
|
|
1737
|
-
return (
|
|
1738
|
-
({ node: f, value:
|
|
1797
|
+
var m;
|
|
1798
|
+
return (m = _.targets) == null ? void 0 : m.map(
|
|
1799
|
+
({ node: f, value: g, color: y, curveFunction: p }) => ({
|
|
1739
1800
|
id: `${_.value}:${f}`,
|
|
1740
|
-
color:
|
|
1741
|
-
curveFunction:
|
|
1801
|
+
color: y,
|
|
1802
|
+
curveFunction: p,
|
|
1742
1803
|
source: _.value ?? _.label,
|
|
1743
1804
|
target: f,
|
|
1744
|
-
value:
|
|
1805
|
+
value: g
|
|
1745
1806
|
})
|
|
1746
1807
|
);
|
|
1747
1808
|
}
|
|
1748
1809
|
).filter(Boolean).flat();
|
|
1749
1810
|
}
|
|
1750
|
-
), l = d(() =>
|
|
1751
|
-
var
|
|
1752
|
-
return (
|
|
1753
|
-
(_,
|
|
1754
|
-
const f =
|
|
1755
|
-
return f ? (f.push(
|
|
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(
|
|
1814
|
+
(_, m) => {
|
|
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]), _;
|
|
1756
1817
|
},
|
|
1757
1818
|
[]
|
|
1758
1819
|
);
|
|
1759
1820
|
});
|
|
1760
|
-
function u(
|
|
1761
|
-
const { offset: _ } =
|
|
1762
|
-
if (!
|
|
1821
|
+
function u(s) {
|
|
1822
|
+
const { offset: _ } = s, m = ut(s, i.value);
|
|
1823
|
+
if (!m)
|
|
1763
1824
|
return;
|
|
1764
|
-
const f =
|
|
1765
|
-
|
|
1766
|
-
}
|
|
1767
|
-
function s
|
|
1768
|
-
const { id:
|
|
1769
|
-
(
|
|
1770
|
-
),
|
|
1771
|
-
(
|
|
1772
|
-
),
|
|
1773
|
-
|
|
1774
|
-
}
|
|
1775
|
-
const v = d(() => (n.value &&
|
|
1776
|
-
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));
|
|
1777
1838
|
}), n.value));
|
|
1778
|
-
return
|
|
1839
|
+
return H([l, r], () => {
|
|
1779
1840
|
try {
|
|
1780
|
-
const { x0:
|
|
1841
|
+
const { x0: s, y0: _, x1: m, y1: f } = r.value;
|
|
1781
1842
|
n.value = l.value.extent([
|
|
1782
|
-
[
|
|
1783
|
-
[
|
|
1784
|
-
])({ nodes:
|
|
1785
|
-
} catch (
|
|
1786
|
-
|
|
1843
|
+
[s, _],
|
|
1844
|
+
[m, f]
|
|
1845
|
+
])({ nodes: o.value, links: a.value });
|
|
1846
|
+
} catch (s) {
|
|
1847
|
+
no($t.GraphProblem, s), n.value = fo;
|
|
1787
1848
|
}
|
|
1788
1849
|
}), { columns: i, graph: v };
|
|
1789
1850
|
}
|
|
1790
|
-
function
|
|
1851
|
+
function Pe(t, e) {
|
|
1791
1852
|
return e || (e = {}), t.targetLinks && t.targetLinks.forEach(({ source: r, value: n }) => {
|
|
1792
|
-
e[r.id] = n,
|
|
1853
|
+
e[r.id] = n, Pe(
|
|
1793
1854
|
r,
|
|
1794
1855
|
e
|
|
1795
1856
|
);
|
|
1796
1857
|
}), e;
|
|
1797
1858
|
}
|
|
1798
|
-
function
|
|
1859
|
+
function Se(t, e) {
|
|
1799
1860
|
return e || (e = {}), t.sourceLinks && t.sourceLinks.forEach(({ target: r, value: n }) => {
|
|
1800
|
-
e[r.id] = n,
|
|
1861
|
+
e[r.id] = n, Se(
|
|
1801
1862
|
r,
|
|
1802
1863
|
e
|
|
1803
1864
|
);
|
|
1804
1865
|
}), e;
|
|
1805
1866
|
}
|
|
1806
|
-
function
|
|
1867
|
+
function ho(t, e) {
|
|
1807
1868
|
return e.links.reduce((r, n) => (n.source.id in t && n.target.id in t && r.push(n.id), r), []);
|
|
1808
1869
|
}
|
|
1809
|
-
const
|
|
1870
|
+
const go = (t, e) => {
|
|
1810
1871
|
let r;
|
|
1811
|
-
|
|
1872
|
+
It(t) ? r = {
|
|
1812
1873
|
[t.id]: t.value,
|
|
1813
|
-
...
|
|
1814
|
-
...
|
|
1874
|
+
...Pe(t),
|
|
1875
|
+
...Se(t)
|
|
1815
1876
|
} : r = {
|
|
1816
1877
|
[t.source.id]: t.source.value,
|
|
1817
1878
|
[t.target.id]: t.target.value,
|
|
1818
|
-
...
|
|
1819
|
-
...
|
|
1879
|
+
...Pe(t.source),
|
|
1880
|
+
...Se(t.target)
|
|
1820
1881
|
};
|
|
1821
|
-
const n =
|
|
1882
|
+
const n = ho(r, e);
|
|
1822
1883
|
return { nodes: r, links: n };
|
|
1823
|
-
},
|
|
1824
|
-
if (
|
|
1884
|
+
}, yo = (t) => {
|
|
1885
|
+
if (It(t)) {
|
|
1825
1886
|
const e = [...t.sourceLinks, ...t.targetLinks];
|
|
1826
1887
|
return {
|
|
1827
1888
|
nodes: e.reduce(
|
|
1828
|
-
(r, { source: n, target:
|
|
1829
|
-
{ [
|
|
1889
|
+
(r, { source: n, target: o, value: a }) => n === t ? { ...r, [le(o)]: a } : { ...r, [le(n)]: a },
|
|
1890
|
+
{ [le(t)]: t.value }
|
|
1830
1891
|
),
|
|
1831
1892
|
links: e.map(({ id: r }) => r)
|
|
1832
1893
|
};
|
|
1833
1894
|
}
|
|
1834
1895
|
return {
|
|
1835
1896
|
nodes: {
|
|
1836
|
-
[
|
|
1837
|
-
[
|
|
1897
|
+
[le(t.target)]: t.value,
|
|
1898
|
+
[le(t.source)]: t.source.value
|
|
1838
1899
|
},
|
|
1839
1900
|
links: [t.id]
|
|
1840
1901
|
};
|
|
1841
1902
|
};
|
|
1842
|
-
function
|
|
1843
|
-
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(
|
|
1844
1905
|
n.value,
|
|
1845
1906
|
r.value
|
|
1846
|
-
) : e.value.highlightedElements === "closest" ?
|
|
1847
|
-
return
|
|
1848
|
-
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) {
|
|
1849
1910
|
t.value.forEach((i) => {
|
|
1850
|
-
i.node.id in l.nodes &&
|
|
1911
|
+
i.node.id in l.nodes && lt(
|
|
1851
1912
|
i,
|
|
1852
1913
|
l.nodes[i.node.id],
|
|
1853
1914
|
i.node.value,
|
|
@@ -1858,19 +1919,19 @@ function va(t, e, r) {
|
|
|
1858
1919
|
return;
|
|
1859
1920
|
}
|
|
1860
1921
|
t.value.forEach((i) => {
|
|
1861
|
-
i.node.id in
|
|
1922
|
+
i.node.id in a.nodes && lt(
|
|
1862
1923
|
i,
|
|
1863
1924
|
i.node.value,
|
|
1864
|
-
|
|
1925
|
+
a.nodes[i.node.id],
|
|
1865
1926
|
e.value.withTransition
|
|
1866
1927
|
);
|
|
1867
1928
|
});
|
|
1868
|
-
}), { highlightedElements:
|
|
1929
|
+
}), { highlightedElements: o, hoveredElement: n };
|
|
1869
1930
|
}
|
|
1870
|
-
const
|
|
1931
|
+
const ko = /* @__PURE__ */ w({
|
|
1871
1932
|
__name: "lume-alluvial-group",
|
|
1872
1933
|
props: {
|
|
1873
|
-
...
|
|
1934
|
+
...ke(),
|
|
1874
1935
|
hoveredElementId: {
|
|
1875
1936
|
type: [Number, String],
|
|
1876
1937
|
default: null
|
|
@@ -1878,169 +1939,169 @@ const _a = /* @__PURE__ */ E({
|
|
|
1878
1939
|
},
|
|
1879
1940
|
emits: ["node-click", "node-mouseenter", "node-mouseleave", "link-click", "link-mouseenter", "link-mouseleave"],
|
|
1880
1941
|
setup(t, { emit: e }) {
|
|
1881
|
-
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(
|
|
1882
1943
|
l,
|
|
1883
|
-
|
|
1944
|
+
a,
|
|
1884
1945
|
_
|
|
1885
|
-
),
|
|
1946
|
+
), g = d(() => ge(a.value.valueFormat)), y = d(
|
|
1886
1947
|
() => Object.keys(f.value.nodes)
|
|
1887
|
-
),
|
|
1888
|
-
(
|
|
1889
|
-
) : []),
|
|
1890
|
-
if (!(!
|
|
1891
|
-
return
|
|
1892
|
-
label:
|
|
1893
|
-
x:
|
|
1948
|
+
), p = d(() => s.value ? s.value.map(
|
|
1949
|
+
(h) => h[0].x0 + a.value.nodeWidth / 2
|
|
1950
|
+
) : []), T = d(() => {
|
|
1951
|
+
if (!(!a.value.nodeHeaders || !a.value.nodeHeaders.length))
|
|
1952
|
+
return a.value.nodeHeaders.slice(0, p.value.length).map((h, O) => ({
|
|
1953
|
+
label: h,
|
|
1954
|
+
x: p.value[O]
|
|
1894
1955
|
}));
|
|
1895
|
-
}),
|
|
1896
|
-
() =>
|
|
1897
|
-
),
|
|
1898
|
-
if (!(!
|
|
1899
|
-
return _.value.links.reduce((
|
|
1900
|
-
const { source: N, target:
|
|
1901
|
-
return
|
|
1956
|
+
}), A = d(
|
|
1957
|
+
() => a.value.nodeHeaderPadding ?? oo
|
|
1958
|
+
), x = d(() => {
|
|
1959
|
+
if (!(!a.value.gradient || !_.value))
|
|
1960
|
+
return _.value.links.reduce((h, O) => {
|
|
1961
|
+
const { source: N, target: F } = O, z = N.color || N.fallbackColor, W = F.deriveColorFromIncomingLinks ? z : F.color || F.fallbackColor;
|
|
1962
|
+
return h[O.id] = {
|
|
1902
1963
|
source: z,
|
|
1903
1964
|
target: W,
|
|
1904
1965
|
x1: N.x1,
|
|
1905
|
-
x2:
|
|
1906
|
-
},
|
|
1966
|
+
x2: F.x0
|
|
1967
|
+
}, h;
|
|
1907
1968
|
}, {});
|
|
1908
|
-
}),
|
|
1909
|
-
const
|
|
1910
|
-
(N) =>
|
|
1911
|
-
),
|
|
1912
|
-
return
|
|
1913
|
-
const
|
|
1969
|
+
}), k = d(() => {
|
|
1970
|
+
const h = l.value.filter(
|
|
1971
|
+
(N) => G(N)
|
|
1972
|
+
), O = [];
|
|
1973
|
+
return h.forEach((N) => {
|
|
1974
|
+
const F = [];
|
|
1914
1975
|
i.value.filter(({ link: z }) => z.target.id === N.node.id).reverse().reduce((z, W) => {
|
|
1915
|
-
const
|
|
1916
|
-
return
|
|
1976
|
+
const Te = W.link.target.y1 - W.link.target.y0, q = W.link.value / N.node.value * Te;
|
|
1977
|
+
return F.push({
|
|
1917
1978
|
x: N.x,
|
|
1918
1979
|
y: N.y + z,
|
|
1919
|
-
height:
|
|
1980
|
+
height: q,
|
|
1920
1981
|
width: N.width,
|
|
1921
1982
|
key: `node-block-${N.node.id}-source-link-${W.link.source.id}`,
|
|
1922
|
-
class: `lume-alluvial-group__node-block lume-fill--${W.link.source.color ||
|
|
1923
|
-
}), z +
|
|
1924
|
-
}, 0),
|
|
1983
|
+
class: `lume-alluvial-group__node-block lume-fill--${W.link.source.color || fe}`
|
|
1984
|
+
}), z + q;
|
|
1985
|
+
}, 0), O.push({
|
|
1925
1986
|
id: N.node.id,
|
|
1926
|
-
subNodes:
|
|
1987
|
+
subNodes: F
|
|
1927
1988
|
});
|
|
1928
|
-
}),
|
|
1989
|
+
}), O;
|
|
1929
1990
|
});
|
|
1930
|
-
function C(
|
|
1931
|
-
return
|
|
1991
|
+
function C(h) {
|
|
1992
|
+
return a.value.gradient && `url('#${n}_${h.id}')`;
|
|
1932
1993
|
}
|
|
1933
|
-
function
|
|
1934
|
-
return
|
|
1994
|
+
function D(h) {
|
|
1995
|
+
return y.value.length > 0 && !y.value.includes(h.toString());
|
|
1935
1996
|
}
|
|
1936
|
-
function
|
|
1937
|
-
return
|
|
1997
|
+
function R(h) {
|
|
1998
|
+
return y.value.length > 0 && y.value.includes(h.toString());
|
|
1938
1999
|
}
|
|
1939
|
-
function B(
|
|
1940
|
-
return f.value.links.length > 0 && !f.value.links.includes(
|
|
2000
|
+
function B(h) {
|
|
2001
|
+
return f.value.links.length > 0 && !f.value.links.includes(h);
|
|
1941
2002
|
}
|
|
1942
|
-
function
|
|
1943
|
-
return f.value.links.length > 0 && f.value.links.includes(
|
|
2003
|
+
function J(h) {
|
|
2004
|
+
return f.value.links.length > 0 && f.value.links.includes(h);
|
|
1944
2005
|
}
|
|
1945
|
-
function
|
|
1946
|
-
return !
|
|
2006
|
+
function G(h) {
|
|
2007
|
+
return !h.node.color && h.node.deriveColorFromIncomingLinks;
|
|
1947
2008
|
}
|
|
1948
|
-
function
|
|
1949
|
-
|
|
2009
|
+
function M(h, O) {
|
|
2010
|
+
h !== m.value && (m.value = h, e("link-mouseenter", { link: h, event: O }));
|
|
1950
2011
|
}
|
|
1951
|
-
function
|
|
1952
|
-
const
|
|
1953
|
-
|
|
2012
|
+
function Q(h) {
|
|
2013
|
+
const O = m.value;
|
|
2014
|
+
m.value = null, e("link-mouseleave", { link: O, event: h });
|
|
1954
2015
|
}
|
|
1955
|
-
function
|
|
1956
|
-
if (
|
|
1957
|
-
|
|
2016
|
+
function U(h) {
|
|
2017
|
+
if (h == null) {
|
|
2018
|
+
m.value = null;
|
|
1958
2019
|
return;
|
|
1959
2020
|
}
|
|
1960
|
-
const
|
|
1961
|
-
if (!
|
|
1962
|
-
|
|
2021
|
+
const O = lo(h, _.value) || uo(h, _.value);
|
|
2022
|
+
if (!O) {
|
|
2023
|
+
ne(Y.InvalidHoveredElement);
|
|
1963
2024
|
return;
|
|
1964
2025
|
}
|
|
1965
|
-
|
|
2026
|
+
m.value = O;
|
|
1966
2027
|
}
|
|
1967
|
-
function $(
|
|
1968
|
-
var
|
|
1969
|
-
return ((
|
|
2028
|
+
function $(h) {
|
|
2029
|
+
var O;
|
|
2030
|
+
return ((O = k.value.find(({ id: N }) => h === N)) == null ? void 0 : O.subNodes) ?? [];
|
|
1970
2031
|
}
|
|
1971
|
-
return
|
|
1972
|
-
l.value =
|
|
1973
|
-
}),
|
|
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], () => {
|
|
1974
2035
|
if (r.containerSize.width && r.containerSize.height) {
|
|
1975
|
-
const
|
|
1976
|
-
v(
|
|
2036
|
+
const h = io(_.value, u.value);
|
|
2037
|
+
v(h);
|
|
1977
2038
|
}
|
|
1978
|
-
}),
|
|
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 };
|
|
1979
2040
|
}
|
|
1980
2041
|
});
|
|
1981
|
-
var
|
|
2042
|
+
var To = function() {
|
|
1982
2043
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
1983
|
-
return r("g", { staticClass: "lume-alluvial-group", attrs: { "data-j-alluvial-group": "" } }, [n.nodeHeaders ? r("g", e._l(n.nodeHeaders, function(
|
|
1984
|
-
return r("text", { key: `header_${
|
|
1985
|
-
}), 0) : e._e(), r("g", { staticClass: "lume-alluvial-link-group", on: { mouseleave: n.handleLinkMouseleave } }, [n.options.gradient ? r("defs", e._l(n.gradients, function(
|
|
1986
|
-
return r("linearGradient", { key:
|
|
1987
|
-
}), 1) : e._e(), e._l(n.linkPaths, function(
|
|
1988
|
-
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: [
|
|
1989
2050
|
"lume-stroke--transparent",
|
|
1990
2051
|
"lume-alluvial-group__link--ghost"
|
|
1991
|
-
], attrs: { d:
|
|
1992
|
-
return n.emit("link-click", { link:
|
|
1993
|
-
}, mouseover: function(
|
|
1994
|
-
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);
|
|
1995
2056
|
} } });
|
|
1996
|
-
}), e._l(n.linkPaths, function(
|
|
1997
|
-
return r("path", { key: `link_${
|
|
1998
|
-
[`lume-stroke--${
|
|
1999
|
-
"lume-alluvial-group__link--faded": n.isLinkFaded(
|
|
2000
|
-
"lume-alluvial-group__link--focused": n.isLinkFocused(
|
|
2001
|
-
}, attrs: { d:
|
|
2002
|
-
return n.emit("link-click", { link:
|
|
2003
|
-
}, mouseover: function(
|
|
2004
|
-
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);
|
|
2005
2066
|
} } });
|
|
2006
|
-
})], 2), e._l(n.nodeBlocks, function(
|
|
2007
|
-
return r("g", { key: `node-block_${
|
|
2008
|
-
"lume-alluvial-group__node--faded": n.isNodeFaded(
|
|
2009
|
-
"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)
|
|
2010
2071
|
}, attrs: { "data-j-alluvial-group__node-block": "" } }, [r("g", { on: { click: function(l) {
|
|
2011
|
-
return n.emit("node-click", { node:
|
|
2072
|
+
return n.emit("node-click", { node: o.node, event: l });
|
|
2012
2073
|
}, mouseenter: function(l) {
|
|
2013
|
-
return n.emit("node-mouseenter", { node:
|
|
2074
|
+
return n.emit("node-mouseenter", { node: o.node, event: l });
|
|
2014
2075
|
}, mouseleave: function(l) {
|
|
2015
|
-
return n.emit("node-mouseleave", { node:
|
|
2076
|
+
return n.emit("node-mouseleave", { node: o.node, event: l });
|
|
2016
2077
|
}, mouseover: function(l) {
|
|
2017
|
-
n.hoveredElement =
|
|
2078
|
+
n.hoveredElement = o.node;
|
|
2018
2079
|
}, mouseout: function(l) {
|
|
2019
2080
|
n.hoveredElement = null;
|
|
2020
|
-
} } }, [n.shouldDeriveNodeColorFromIncomingLinks(
|
|
2021
|
-
|
|
2081
|
+
} } }, [n.shouldDeriveNodeColorFromIncomingLinks(o) ? e._l(n.getSubNodesDerivingColorFromIncomingLinks(
|
|
2082
|
+
o.node.id
|
|
2022
2083
|
), function(l) {
|
|
2023
2084
|
return r("rect", e._b({ key: l.key, attrs: { "data-j-alluvial-sub-nodes": "" } }, "rect", l, !1));
|
|
2024
|
-
}) : r("rect", { staticClass: "lume-alluvial-group__node-block", class: `lume-fill--${
|
|
2025
|
-
"lume-alluvial-group__node-text--left":
|
|
2026
|
-
}, attrs: { transform: `translate(${
|
|
2027
|
-
return [r(n.LumeAlluvialNodeLabel, { attrs: { bottom: n.options.switchText } }, [e._v(" " + e._s(
|
|
2028
|
-
}, { node:
|
|
2029
|
-
|
|
2030
|
-
|
|
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
|
|
2031
2092
|
) })], 2)], 2)]);
|
|
2032
2093
|
})], 2);
|
|
2033
|
-
},
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2094
|
+
}, xo = [], Ao = /* @__PURE__ */ E(
|
|
2095
|
+
ko,
|
|
2096
|
+
To,
|
|
2097
|
+
xo,
|
|
2037
2098
|
!1,
|
|
2038
2099
|
null,
|
|
2039
2100
|
"6fe8c153",
|
|
2040
2101
|
null,
|
|
2041
2102
|
null
|
|
2042
2103
|
);
|
|
2043
|
-
const
|
|
2104
|
+
const Lo = Ao.exports, Oo = {
|
|
2044
2105
|
margins: {
|
|
2045
2106
|
top: 0,
|
|
2046
2107
|
right: 0,
|
|
@@ -2056,323 +2117,323 @@ const ha = ma.exports, ga = {
|
|
|
2056
2117
|
highlightedElements: "closest",
|
|
2057
2118
|
nodePadding: 16,
|
|
2058
2119
|
nodeWidth: 16,
|
|
2059
|
-
nodeAlign:
|
|
2120
|
+
nodeAlign: Zt,
|
|
2060
2121
|
valueFormat: (t) => String(t),
|
|
2061
2122
|
iterations: 6
|
|
2062
|
-
},
|
|
2123
|
+
}, $o = /* @__PURE__ */ w({
|
|
2063
2124
|
__name: "lume-alluvial-diagram",
|
|
2064
2125
|
props: {
|
|
2065
|
-
...
|
|
2126
|
+
...xr(Fe)
|
|
2066
2127
|
},
|
|
2067
|
-
setup(t) {
|
|
2068
|
-
const
|
|
2069
|
-
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) {
|
|
2070
2131
|
return {
|
|
2071
|
-
...
|
|
2132
|
+
...c,
|
|
2072
2133
|
noBaseScales: !0
|
|
2073
2134
|
// Alluvial chart never uses base scales
|
|
2074
2135
|
};
|
|
2075
2136
|
}
|
|
2076
|
-
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 };
|
|
2077
2138
|
}
|
|
2078
2139
|
});
|
|
2079
|
-
var
|
|
2140
|
+
var Io = function() {
|
|
2080
2141
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2081
|
-
return r(n.LumeChart, e._b({ attrs: { options: n.getAlluvialDiagramOptions(n.allOptions), "data-j-alluvial-diagram": "" }, scopedSlots: e._u([{ key: "groups", fn: function(
|
|
2082
|
-
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) {
|
|
2083
2144
|
return { key: l, fn: function(i) {
|
|
2084
2145
|
return [e._t(l, null, null, i || {})];
|
|
2085
2146
|
} };
|
|
2086
|
-
})], null, !0) }, "lume-alluvial-group",
|
|
2087
|
-
} }, e._l(n.slots, function(
|
|
2088
|
-
return { key:
|
|
2089
|
-
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 || {})];
|
|
2090
2151
|
} };
|
|
2091
|
-
})], null, !0) }, "lume-chart", n.props, !1));
|
|
2092
|
-
},
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2152
|
+
})], null, !0) }, "lume-chart", n.props, !1), n.componentEventPropagator));
|
|
2153
|
+
}, Eo = [], wo = /* @__PURE__ */ E(
|
|
2154
|
+
$o,
|
|
2155
|
+
Io,
|
|
2156
|
+
Eo,
|
|
2096
2157
|
!1,
|
|
2097
2158
|
null,
|
|
2098
2159
|
null,
|
|
2099
2160
|
null,
|
|
2100
2161
|
null
|
|
2101
2162
|
);
|
|
2102
|
-
const
|
|
2103
|
-
var
|
|
2104
|
-
const
|
|
2163
|
+
const Va = wo.exports;
|
|
2164
|
+
var Be = /* @__PURE__ */ ((t) => (t.grouped = "grouped", t.stacked = "stacked", t))(Be || {});
|
|
2165
|
+
const No = /* @__PURE__ */ w({
|
|
2105
2166
|
__name: "lume-bar-chart",
|
|
2106
2167
|
props: {
|
|
2107
|
-
...
|
|
2168
|
+
...ue(),
|
|
2108
2169
|
type: {
|
|
2109
2170
|
type: String,
|
|
2110
2171
|
default: null,
|
|
2111
|
-
validator: (t) => t in
|
|
2172
|
+
validator: (t) => t in Be || t == null
|
|
2112
2173
|
}
|
|
2113
2174
|
},
|
|
2114
|
-
setup(t) {
|
|
2115
|
-
const
|
|
2175
|
+
setup(t, { emit: e }) {
|
|
2176
|
+
const r = t, n = Oe(
|
|
2116
2177
|
() => import("./common/42f5d2fc.js")
|
|
2117
|
-
),
|
|
2178
|
+
), o = Oe(
|
|
2118
2179
|
() => import("./common/abc9d23d.js")
|
|
2119
|
-
), a =
|
|
2180
|
+
), a = Oe(
|
|
2120
2181
|
() => import("./common/0664fd4d.js")
|
|
2121
|
-
),
|
|
2122
|
-
["single",
|
|
2123
|
-
["grouped",
|
|
2182
|
+
), l = /* @__PURE__ */ new Map([
|
|
2183
|
+
["single", n],
|
|
2184
|
+
["grouped", o],
|
|
2124
2185
|
["stacked", a]
|
|
2125
|
-
]),
|
|
2126
|
-
function
|
|
2186
|
+
]), { componentEventPropagator: i } = X(e), u = ae(V());
|
|
2187
|
+
function c(s) {
|
|
2127
2188
|
return {
|
|
2128
2189
|
...s,
|
|
2129
2190
|
startOnZero: !0,
|
|
2130
2191
|
// Bar chart always starts on zero,
|
|
2131
2192
|
tooltipOptions: {
|
|
2132
2193
|
...(s == null ? void 0 : s.tooltipOptions) || {},
|
|
2133
|
-
position:
|
|
2194
|
+
position: r.orientation === L.HORIZONTAL && "right"
|
|
2134
2195
|
}
|
|
2135
2196
|
};
|
|
2136
2197
|
}
|
|
2137
|
-
const
|
|
2138
|
-
if (
|
|
2139
|
-
if (
|
|
2140
|
-
return
|
|
2141
|
-
if (!
|
|
2198
|
+
const v = d(() => {
|
|
2199
|
+
if (r.data) {
|
|
2200
|
+
if (Fe(r.data))
|
|
2201
|
+
return l.get("single");
|
|
2202
|
+
if (!r.type)
|
|
2142
2203
|
throw new Error("Bar chart needs a type when there's multiple datasets.");
|
|
2143
|
-
return
|
|
2204
|
+
return l.get(r.type);
|
|
2144
2205
|
}
|
|
2145
2206
|
});
|
|
2146
|
-
return { __sfc: !0, TYPES:
|
|
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 };
|
|
2147
2208
|
}
|
|
2148
2209
|
});
|
|
2149
|
-
var
|
|
2210
|
+
var Co = function() {
|
|
2150
2211
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2151
|
-
return r(n.component, e._b({ tag: "component", attrs: { options: n.getBarChartOptions(e.options) }, scopedSlots: e._u([e._l(n.slots, function(
|
|
2152
|
-
return { key:
|
|
2153
|
-
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 || {})];
|
|
2154
2215
|
} };
|
|
2155
|
-
})], null, !0) }, "component", { ...n.props, ...e.$attrs }, !1));
|
|
2156
|
-
},
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2216
|
+
})], null, !0) }, "component", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
|
|
2217
|
+
}, Ho = [], Do = /* @__PURE__ */ E(
|
|
2218
|
+
No,
|
|
2219
|
+
Co,
|
|
2220
|
+
Ho,
|
|
2160
2221
|
!1,
|
|
2161
2222
|
null,
|
|
2162
2223
|
null,
|
|
2163
2224
|
null,
|
|
2164
2225
|
null
|
|
2165
2226
|
);
|
|
2166
|
-
const
|
|
2167
|
-
function
|
|
2168
|
-
return Object.values(
|
|
2227
|
+
const ja = Do.exports;
|
|
2228
|
+
function Ro(t) {
|
|
2229
|
+
return Object.values(_n).includes(t) || t == null;
|
|
2169
2230
|
}
|
|
2170
|
-
function
|
|
2171
|
-
return Object.values(
|
|
2231
|
+
function Po(t) {
|
|
2232
|
+
return Object.values(L).includes(t);
|
|
2172
2233
|
}
|
|
2173
|
-
const
|
|
2234
|
+
const So = (t = !1) => ({
|
|
2174
2235
|
type: {
|
|
2175
2236
|
type: String,
|
|
2176
2237
|
default: null,
|
|
2177
|
-
validator:
|
|
2238
|
+
validator: Ro
|
|
2178
2239
|
},
|
|
2179
2240
|
...t ? {
|
|
2180
2241
|
orientation: {
|
|
2181
2242
|
type: String,
|
|
2182
|
-
default:
|
|
2183
|
-
validator:
|
|
2243
|
+
default: L.VERTICAL,
|
|
2244
|
+
validator: Po
|
|
2184
2245
|
}
|
|
2185
2246
|
} : {}
|
|
2186
2247
|
});
|
|
2187
|
-
function
|
|
2248
|
+
function Et(t) {
|
|
2188
2249
|
const e = d(() => t.value.map((n) => ({
|
|
2189
2250
|
...n,
|
|
2190
|
-
values: n.values.map((
|
|
2191
|
-
...
|
|
2192
|
-
value: (
|
|
2251
|
+
values: n.values.map((o) => ({
|
|
2252
|
+
...o,
|
|
2253
|
+
value: (o == null ? void 0 : o.value) || 0
|
|
2193
2254
|
}))
|
|
2194
2255
|
}))), r = d(() => {
|
|
2195
2256
|
var n;
|
|
2196
|
-
return (n = e.value) == null ? void 0 : n.reduce((
|
|
2197
|
-
|
|
2198
|
-
}),
|
|
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), []);
|
|
2199
2260
|
});
|
|
2200
2261
|
return { multiBarData: e, groupedData: r };
|
|
2201
2262
|
}
|
|
2202
|
-
function
|
|
2263
|
+
function Bo(t, e) {
|
|
2203
2264
|
return t.value.length === 1 ? "single" : e.value;
|
|
2204
2265
|
}
|
|
2205
|
-
function
|
|
2266
|
+
function Fo(t, e, r) {
|
|
2206
2267
|
const n = d(
|
|
2207
|
-
() => r.value ===
|
|
2268
|
+
() => r.value === L.HORIZONTAL
|
|
2208
2269
|
);
|
|
2209
|
-
function
|
|
2270
|
+
function o(i) {
|
|
2210
2271
|
Math.min(...i.domain()) > 0 && console.error("Bar linear scale domain cannot start above 0!");
|
|
2211
2272
|
}
|
|
2212
|
-
const
|
|
2213
|
-
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 };
|
|
2214
2275
|
}
|
|
2215
|
-
function
|
|
2276
|
+
function Go(t, e, r, n, o, a) {
|
|
2216
2277
|
const l = d(
|
|
2217
|
-
() => n.value ===
|
|
2278
|
+
() => n.value === L.HORIZONTAL
|
|
2218
2279
|
);
|
|
2219
|
-
function i(
|
|
2220
|
-
let
|
|
2221
|
-
return l.value ? (
|
|
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 };
|
|
2222
2283
|
}
|
|
2223
|
-
function u(
|
|
2224
|
-
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();
|
|
2225
2286
|
}
|
|
2226
|
-
function s
|
|
2227
|
-
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);
|
|
2228
2289
|
}
|
|
2229
|
-
function v(
|
|
2230
|
-
const { value: f, color:
|
|
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);
|
|
2231
2292
|
return {
|
|
2232
|
-
classList: [`lume-fill--${
|
|
2233
|
-
x:
|
|
2234
|
-
y:
|
|
2235
|
-
width:
|
|
2236
|
-
height:
|
|
2237
|
-
isFaded:
|
|
2293
|
+
classList: [`lume-fill--${y}`, ...a],
|
|
2294
|
+
x: p,
|
|
2295
|
+
y: T,
|
|
2296
|
+
width: A,
|
|
2297
|
+
height: x,
|
|
2298
|
+
isFaded: o.value !== -1 && o.value !== m,
|
|
2238
2299
|
isNegative: f < 0
|
|
2239
2300
|
};
|
|
2240
2301
|
}
|
|
2241
2302
|
return { barAttributeGenerator: v };
|
|
2242
2303
|
}
|
|
2243
|
-
function
|
|
2304
|
+
function Vo(t, e, r, n, o, a) {
|
|
2244
2305
|
const l = d(
|
|
2245
|
-
() => n.value ===
|
|
2246
|
-
), i = d(() =>
|
|
2247
|
-
function
|
|
2306
|
+
() => n.value === L.HORIZONTAL
|
|
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) {
|
|
2248
2309
|
if (l.value)
|
|
2249
2310
|
return f >= 0 ? e.value(0) : e.value(f);
|
|
2250
|
-
const
|
|
2251
|
-
return e.value(
|
|
2311
|
+
const p = e.value.domain();
|
|
2312
|
+
return e.value(p[g]) + i.value(y);
|
|
2252
2313
|
}
|
|
2253
|
-
function v(f,
|
|
2314
|
+
function v(f, g, y) {
|
|
2254
2315
|
if (l.value) {
|
|
2255
|
-
const
|
|
2256
|
-
return r.value(
|
|
2316
|
+
const p = r.value.domain();
|
|
2317
|
+
return r.value(p[g]) + u.value(y);
|
|
2257
2318
|
}
|
|
2258
2319
|
return f < 0 ? r.value(0) : r.value(f);
|
|
2259
2320
|
}
|
|
2260
|
-
function
|
|
2321
|
+
function s(f) {
|
|
2261
2322
|
return l.value ? f < 0 ? e.value(0) - e.value(f) : e.value(f) - e.value(0) : i.value.bandwidth();
|
|
2262
2323
|
}
|
|
2263
2324
|
function _(f) {
|
|
2264
2325
|
return l.value ? u.value.bandwidth() : f < 0 ? r.value(f) - r.value(0) : r.value(0) - r.value(f);
|
|
2265
2326
|
}
|
|
2266
|
-
function
|
|
2267
|
-
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);
|
|
2268
2329
|
return {
|
|
2269
|
-
classList: [`lume-fill--${
|
|
2270
|
-
x
|
|
2271
|
-
y:
|
|
2330
|
+
classList: [`lume-fill--${A}`, ...a],
|
|
2331
|
+
x,
|
|
2332
|
+
y: k,
|
|
2272
2333
|
width: C,
|
|
2273
|
-
height:
|
|
2274
|
-
isFaded:
|
|
2275
|
-
isNegative:
|
|
2334
|
+
height: D,
|
|
2335
|
+
isFaded: o.value !== -1 && o.value !== y,
|
|
2336
|
+
isNegative: p < 0
|
|
2276
2337
|
};
|
|
2277
2338
|
}
|
|
2278
|
-
return { barAttributeGenerator:
|
|
2339
|
+
return { barAttributeGenerator: m };
|
|
2279
2340
|
}
|
|
2280
|
-
function
|
|
2341
|
+
function jo(t, e, r) {
|
|
2281
2342
|
const n = d(
|
|
2282
|
-
() => e.value ===
|
|
2283
|
-
),
|
|
2343
|
+
() => e.value === L.HORIZONTAL
|
|
2344
|
+
), o = d(() => {
|
|
2284
2345
|
const u = t.value.map(
|
|
2285
|
-
(
|
|
2346
|
+
(c) => c.filter((v) => v.value < 0).reduce((v, s) => v + s.value, 0)
|
|
2286
2347
|
);
|
|
2287
2348
|
return Math.min(...u);
|
|
2288
|
-
}),
|
|
2349
|
+
}), a = d(() => {
|
|
2289
2350
|
const u = t.value.map(
|
|
2290
|
-
(
|
|
2291
|
-
(v,
|
|
2351
|
+
(c) => c.reduce(
|
|
2352
|
+
(v, s) => s.value >= 0 ? v + s.value : v,
|
|
2292
2353
|
0
|
|
2293
2354
|
)
|
|
2294
2355
|
);
|
|
2295
2356
|
return Math.max(...u);
|
|
2296
2357
|
});
|
|
2297
|
-
function l(u,
|
|
2298
|
-
return n.value ?
|
|
2299
|
-
|
|
2300
|
-
|
|
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]),
|
|
2301
2362
|
e.value,
|
|
2302
2363
|
r.value
|
|
2303
2364
|
),
|
|
2304
|
-
{ labels:
|
|
2365
|
+
{ labels: c }
|
|
2305
2366
|
);
|
|
2306
2367
|
}
|
|
2307
|
-
function i(u,
|
|
2368
|
+
function i(u, c, v) {
|
|
2308
2369
|
return n.value ? Object.assign(
|
|
2309
|
-
|
|
2310
|
-
|
|
2370
|
+
nt(
|
|
2371
|
+
ce().domain(c.map((s, _) => _)).range([0, v.height]),
|
|
2311
2372
|
e.value,
|
|
2312
2373
|
r.value
|
|
2313
2374
|
),
|
|
2314
|
-
{ labels:
|
|
2315
|
-
) :
|
|
2375
|
+
{ labels: c }
|
|
2376
|
+
) : de().domain([a.value, o.value]).range([0, v.height]);
|
|
2316
2377
|
}
|
|
2317
2378
|
return { stackedXScaleGenerator: l, stackedYScaleGenerator: i };
|
|
2318
2379
|
}
|
|
2319
|
-
function
|
|
2380
|
+
function Mo(t, e, r, n, o, a) {
|
|
2320
2381
|
const l = d(
|
|
2321
|
-
() => n.value ===
|
|
2382
|
+
() => n.value === L.HORIZONTAL
|
|
2322
2383
|
), i = d(
|
|
2323
2384
|
() => l.value ? r.value.domain() : e.value.domain()
|
|
2324
2385
|
), u = d(
|
|
2325
|
-
() => t.value.map((
|
|
2386
|
+
() => t.value.map((p) => p.values.map((T) => T == null ? void 0 : T.value))
|
|
2326
2387
|
);
|
|
2327
|
-
function
|
|
2328
|
-
let
|
|
2329
|
-
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 };
|
|
2330
2391
|
}
|
|
2331
|
-
function v(
|
|
2332
|
-
return l.value ? e.value(
|
|
2392
|
+
function v(p) {
|
|
2393
|
+
return l.value ? e.value(p) - e.value(0) : e.value.bandwidth();
|
|
2333
2394
|
}
|
|
2334
|
-
function
|
|
2335
|
-
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();
|
|
2336
2397
|
}
|
|
2337
|
-
function _(
|
|
2338
|
-
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);
|
|
2339
2400
|
}
|
|
2340
|
-
function p
|
|
2341
|
-
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);
|
|
2342
2403
|
}
|
|
2343
|
-
function f(
|
|
2344
|
-
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;
|
|
2345
2406
|
}
|
|
2346
|
-
function
|
|
2347
|
-
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;
|
|
2348
2409
|
}
|
|
2349
|
-
function
|
|
2350
|
-
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);
|
|
2351
2412
|
return {
|
|
2352
|
-
classList: [`lume-fill--${
|
|
2413
|
+
classList: [`lume-fill--${k ?? t.value[T].color ?? Object.values(j)[T]}`, ...a],
|
|
2353
2414
|
width: C,
|
|
2354
|
-
height:
|
|
2415
|
+
height: D,
|
|
2355
2416
|
x: B,
|
|
2356
|
-
y:
|
|
2357
|
-
isFaded:
|
|
2358
|
-
isNegative:
|
|
2417
|
+
y: J,
|
|
2418
|
+
isFaded: o.value !== -1 && o.value !== A,
|
|
2419
|
+
isNegative: x < 0
|
|
2359
2420
|
};
|
|
2360
2421
|
}
|
|
2361
|
-
return { barAttributeGenerator:
|
|
2422
|
+
return { barAttributeGenerator: y };
|
|
2362
2423
|
}
|
|
2363
|
-
const
|
|
2364
|
-
single:
|
|
2365
|
-
grouped:
|
|
2366
|
-
stacked:
|
|
2367
|
-
},
|
|
2424
|
+
const it = {
|
|
2425
|
+
single: Go,
|
|
2426
|
+
grouped: Vo,
|
|
2427
|
+
stacked: Mo
|
|
2428
|
+
}, zo = /* @__PURE__ */ w({
|
|
2368
2429
|
__name: "lume-bar-group",
|
|
2369
2430
|
props: {
|
|
2370
|
-
...
|
|
2431
|
+
...ke(),
|
|
2371
2432
|
classList: {
|
|
2372
2433
|
type: [String, Array],
|
|
2373
2434
|
default: () => []
|
|
2374
2435
|
},
|
|
2375
|
-
...
|
|
2436
|
+
...So(!0),
|
|
2376
2437
|
transition: {
|
|
2377
2438
|
type: Boolean,
|
|
2378
2439
|
default: !0
|
|
@@ -2382,203 +2443,206 @@ const nt = {
|
|
|
2382
2443
|
setup(t, { emit: e }) {
|
|
2383
2444
|
const r = t, {
|
|
2384
2445
|
data: n,
|
|
2385
|
-
hoveredIndex:
|
|
2386
|
-
orientation:
|
|
2446
|
+
hoveredIndex: o,
|
|
2447
|
+
orientation: a,
|
|
2387
2448
|
transition: l,
|
|
2388
2449
|
type: i,
|
|
2389
2450
|
xScale: u,
|
|
2390
|
-
yScale:
|
|
2451
|
+
yScale: c,
|
|
2391
2452
|
classList: v
|
|
2392
|
-
} =
|
|
2393
|
-
const
|
|
2453
|
+
} = S(r), s = ve("chartID"), { busEmit: _ } = X(e, s), { groupedData: m } = Et(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](
|
|
2394
2455
|
n,
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
o,
|
|
2456
|
+
f,
|
|
2457
|
+
g,
|
|
2398
2458
|
a,
|
|
2399
|
-
|
|
2459
|
+
o,
|
|
2460
|
+
y.value
|
|
2400
2461
|
);
|
|
2401
|
-
return
|
|
2402
|
-
}),
|
|
2462
|
+
return k;
|
|
2463
|
+
}), T = d(() => {
|
|
2403
2464
|
if (l.value)
|
|
2404
|
-
return
|
|
2465
|
+
return a.value === L.HORIZONTAL ? "width" : "height";
|
|
2405
2466
|
});
|
|
2406
|
-
|
|
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 };
|
|
2407
2471
|
}
|
|
2408
2472
|
});
|
|
2409
|
-
var
|
|
2473
|
+
var Wo = function() {
|
|
2410
2474
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2411
|
-
return r("g", { staticClass: "lume-bar-group", attrs: { "data-j-bars-group": "" } }, e._l(n.groupedData, function(
|
|
2412
|
-
return r("g", { key:
|
|
2413
|
-
return n.
|
|
2414
|
-
} } }, 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) {
|
|
2415
2479
|
return r(n.LumeBar, e._b({ key: `bar-${i}`, attrs: { transition: n.computedTransition, "data-j-lume-bar": "" }, on: { click: function(u) {
|
|
2416
2480
|
return n.emit("bar-click", {
|
|
2417
|
-
index:
|
|
2481
|
+
index: a,
|
|
2418
2482
|
datasetIndex: i,
|
|
2419
2483
|
event: u
|
|
2420
2484
|
});
|
|
2421
|
-
} } }, "lume-bar", n.getBarAttributes(l, i,
|
|
2485
|
+
} } }, "lume-bar", n.getBarAttributes(l, i, a, o), !1));
|
|
2422
2486
|
}), 1);
|
|
2423
2487
|
}), 0);
|
|
2424
|
-
},
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2488
|
+
}, Zo = [], Xo = /* @__PURE__ */ E(
|
|
2489
|
+
zo,
|
|
2490
|
+
Wo,
|
|
2491
|
+
Zo,
|
|
2428
2492
|
!1,
|
|
2429
2493
|
null,
|
|
2430
2494
|
null,
|
|
2431
2495
|
null,
|
|
2432
2496
|
null
|
|
2433
2497
|
);
|
|
2434
|
-
const
|
|
2435
|
-
[
|
|
2498
|
+
const We = Xo.exports, Uo = {
|
|
2499
|
+
[L.VERTICAL]: {
|
|
2436
2500
|
withTooltip: !0,
|
|
2437
2501
|
xAxisOptions: {},
|
|
2438
2502
|
yAxisOptions: { gridLines: !0 },
|
|
2439
|
-
margins:
|
|
2503
|
+
margins: re.VERTICAL
|
|
2440
2504
|
},
|
|
2441
|
-
[
|
|
2505
|
+
[L.HORIZONTAL]: {
|
|
2442
2506
|
withTooltip: !0,
|
|
2443
2507
|
xAxisOptions: { gridLines: !0 },
|
|
2444
2508
|
yAxisOptions: { gridLines: !1 },
|
|
2445
|
-
margins:
|
|
2509
|
+
margins: re.HORIZONTAL
|
|
2446
2510
|
}
|
|
2447
|
-
},
|
|
2511
|
+
}, Yo = /* @__PURE__ */ w({
|
|
2448
2512
|
__name: "lume-single-bar-chart",
|
|
2449
2513
|
props: {
|
|
2450
|
-
...
|
|
2514
|
+
...ue(Fe)
|
|
2451
2515
|
},
|
|
2452
|
-
setup(t) {
|
|
2453
|
-
const
|
|
2454
|
-
() =>
|
|
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]
|
|
2455
2519
|
// needs to be computed so that default options are reactive
|
|
2456
|
-
), { allOptions:
|
|
2457
|
-
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 };
|
|
2458
2522
|
}
|
|
2459
2523
|
});
|
|
2460
|
-
var
|
|
2524
|
+
var Ko = function() {
|
|
2461
2525
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2462
|
-
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(
|
|
2463
|
-
return [r(n.LumeBarGroup, e._b({ attrs: { orientation: n.orientation } }, "lume-bar-group",
|
|
2464
|
-
} }, e._l(n.slots, function(
|
|
2465
|
-
return { key:
|
|
2466
|
-
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 || {})];
|
|
2467
2531
|
} };
|
|
2468
|
-
})], null, !0) }, "lume-chart", n.props, !1));
|
|
2469
|
-
},
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2532
|
+
})], null, !0) }, "lume-chart", n.props, !1), n.componentEventPropagator));
|
|
2533
|
+
}, Jo = [], Qo = /* @__PURE__ */ E(
|
|
2534
|
+
Yo,
|
|
2535
|
+
Ko,
|
|
2536
|
+
Jo,
|
|
2473
2537
|
!1,
|
|
2474
2538
|
null,
|
|
2475
2539
|
null,
|
|
2476
2540
|
null,
|
|
2477
2541
|
null
|
|
2478
2542
|
);
|
|
2479
|
-
const
|
|
2480
|
-
[
|
|
2543
|
+
const Ma = Qo.exports, qo = {
|
|
2544
|
+
[L.VERTICAL]: {
|
|
2481
2545
|
withTooltip: !0,
|
|
2482
2546
|
xAxisOptions: {},
|
|
2483
2547
|
yAxisOptions: { gridLines: !0 },
|
|
2484
|
-
margins:
|
|
2548
|
+
margins: re.VERTICAL
|
|
2485
2549
|
},
|
|
2486
|
-
[
|
|
2550
|
+
[L.HORIZONTAL]: {
|
|
2487
2551
|
withTooltip: !0,
|
|
2488
2552
|
xAxisOptions: { gridLines: !0 },
|
|
2489
2553
|
yAxisOptions: { gridLines: !1 },
|
|
2490
|
-
margins:
|
|
2554
|
+
margins: re.HORIZONTAL,
|
|
2491
2555
|
tooltipOptions: { position: "right" }
|
|
2492
2556
|
}
|
|
2493
|
-
},
|
|
2557
|
+
}, ea = /* @__PURE__ */ w({
|
|
2494
2558
|
__name: "lume-grouped-bar-chart",
|
|
2495
2559
|
props: {
|
|
2496
|
-
...
|
|
2560
|
+
...ue()
|
|
2497
2561
|
},
|
|
2498
|
-
setup(t) {
|
|
2499
|
-
const
|
|
2500
|
-
() =>
|
|
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]
|
|
2501
2565
|
// needs to be computed so that default options are reactive
|
|
2502
|
-
), { allOptions:
|
|
2503
|
-
|
|
2504
|
-
|
|
2566
|
+
), { allOptions: u } = Z(
|
|
2567
|
+
l,
|
|
2568
|
+
i
|
|
2505
2569
|
);
|
|
2506
|
-
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 };
|
|
2507
2571
|
}
|
|
2508
2572
|
});
|
|
2509
|
-
var
|
|
2573
|
+
var ta = function() {
|
|
2510
2574
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2511
|
-
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(
|
|
2512
|
-
return [r(n.LumeBarGroup, e._b({ attrs: { type: "grouped" } }, "lume-bar-group",
|
|
2513
|
-
} }, e._l(n.slots, function(
|
|
2514
|
-
return { key:
|
|
2515
|
-
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 || {})];
|
|
2516
2580
|
} };
|
|
2517
|
-
})], null, !0) }, "lume-chart", n.props, !1));
|
|
2518
|
-
},
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2581
|
+
})], null, !0) }, "lume-chart", n.props, !1), n.componentEventPropagator));
|
|
2582
|
+
}, na = [], ra = /* @__PURE__ */ E(
|
|
2583
|
+
ea,
|
|
2584
|
+
ta,
|
|
2585
|
+
na,
|
|
2522
2586
|
!1,
|
|
2523
2587
|
null,
|
|
2524
2588
|
null,
|
|
2525
2589
|
null,
|
|
2526
2590
|
null
|
|
2527
2591
|
);
|
|
2528
|
-
const
|
|
2529
|
-
[
|
|
2592
|
+
const za = ra.exports, oa = {
|
|
2593
|
+
[L.VERTICAL]: {
|
|
2530
2594
|
withTooltip: !0,
|
|
2531
2595
|
xAxisOptions: {},
|
|
2532
2596
|
yAxisOptions: { gridLines: !0 },
|
|
2533
|
-
margins:
|
|
2597
|
+
margins: re.VERTICAL
|
|
2534
2598
|
},
|
|
2535
|
-
[
|
|
2599
|
+
[L.HORIZONTAL]: {
|
|
2536
2600
|
withTooltip: !0,
|
|
2537
2601
|
xAxisOptions: { gridLines: !0 },
|
|
2538
2602
|
yAxisOptions: { gridLines: !1 },
|
|
2539
|
-
margins:
|
|
2603
|
+
margins: re.HORIZONTAL,
|
|
2540
2604
|
tooltipOptions: { position: "right" }
|
|
2541
2605
|
}
|
|
2542
|
-
},
|
|
2606
|
+
}, aa = /* @__PURE__ */ w({
|
|
2543
2607
|
__name: "lume-stacked-bar-chart",
|
|
2544
2608
|
props: {
|
|
2545
|
-
...
|
|
2609
|
+
...ue()
|
|
2546
2610
|
},
|
|
2547
|
-
setup(t) {
|
|
2548
|
-
const
|
|
2549
|
-
() =>
|
|
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]
|
|
2550
2614
|
// needs to be computed so that default options are reactive
|
|
2551
|
-
), { allOptions:
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
), { internalData:
|
|
2615
|
+
), { allOptions: c } = Z(
|
|
2616
|
+
i,
|
|
2617
|
+
u
|
|
2618
|
+
), { internalData: v } = ze(a), { groupedData: s } = Et(v), { stackedXScaleGenerator: _, stackedYScaleGenerator: m } = jo(
|
|
2555
2619
|
s,
|
|
2556
|
-
|
|
2557
|
-
|
|
2620
|
+
l,
|
|
2621
|
+
i
|
|
2558
2622
|
);
|
|
2559
|
-
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 };
|
|
2560
2624
|
}
|
|
2561
2625
|
});
|
|
2562
|
-
var
|
|
2626
|
+
var la = function() {
|
|
2563
2627
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2564
|
-
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(
|
|
2565
|
-
return [r(n.LumeBarGroup, e._b({ attrs: { type: "stacked" } }, "lume-bar-group",
|
|
2566
|
-
} }, e._l(n.slots, function(
|
|
2567
|
-
return { key:
|
|
2568
|
-
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 || {})];
|
|
2569
2633
|
} };
|
|
2570
|
-
})], null, !0) }, "lume-chart", n.props, !1));
|
|
2571
|
-
},
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2634
|
+
})], null, !0) }, "lume-chart", n.props, !1), n.componentEventPropagator));
|
|
2635
|
+
}, ua = [], ia = /* @__PURE__ */ E(
|
|
2636
|
+
aa,
|
|
2637
|
+
la,
|
|
2638
|
+
ua,
|
|
2575
2639
|
!1,
|
|
2576
2640
|
null,
|
|
2577
2641
|
null,
|
|
2578
2642
|
null,
|
|
2579
2643
|
null
|
|
2580
2644
|
);
|
|
2581
|
-
const
|
|
2645
|
+
const Wa = ia.exports, st = 2, sa = /* @__PURE__ */ w({
|
|
2582
2646
|
__name: "lume-line",
|
|
2583
2647
|
props: {
|
|
2584
2648
|
pathDefinition: {
|
|
@@ -2587,11 +2651,11 @@ const Fo = eo.exports, rt = 2, to = /* @__PURE__ */ E({
|
|
|
2587
2651
|
},
|
|
2588
2652
|
width: {
|
|
2589
2653
|
type: Number,
|
|
2590
|
-
default:
|
|
2654
|
+
default: st
|
|
2591
2655
|
},
|
|
2592
2656
|
color: {
|
|
2593
2657
|
type: String,
|
|
2594
|
-
default:
|
|
2658
|
+
default: j.Skyblue
|
|
2595
2659
|
},
|
|
2596
2660
|
dashed: {
|
|
2597
2661
|
type: Boolean,
|
|
@@ -2613,10 +2677,10 @@ const Fo = eo.exports, rt = 2, to = /* @__PURE__ */ E({
|
|
|
2613
2677
|
emits: ["click"],
|
|
2614
2678
|
setup(t, { emit: e }) {
|
|
2615
2679
|
const r = I(null);
|
|
2616
|
-
return
|
|
2680
|
+
return K(() => be(r.value)), { __sfc: !0, DEFAULT_LINE_WIDTH: st, emit: e, root: r };
|
|
2617
2681
|
}
|
|
2618
2682
|
});
|
|
2619
|
-
var
|
|
2683
|
+
var ca = function() {
|
|
2620
2684
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2621
2685
|
return r("path", { ref: "root", staticClass: "lume-line", class: {
|
|
2622
2686
|
[`lume-stroke--${e.color}`]: !0,
|
|
@@ -2625,31 +2689,31 @@ var no = function() {
|
|
|
2625
2689
|
}, style: {
|
|
2626
2690
|
animationDelay: e.transition && e.animationDelay + "s",
|
|
2627
2691
|
animationDuration: e.transition && e.animationDuration + "s"
|
|
2628
|
-
}, attrs: { d: e.pathDefinition, "stroke-width": e.width, "data-j-line": "" }, on: { click: function(
|
|
2629
|
-
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);
|
|
2630
2694
|
} } });
|
|
2631
|
-
},
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2695
|
+
}, da = [], va = /* @__PURE__ */ E(
|
|
2696
|
+
sa,
|
|
2697
|
+
ca,
|
|
2698
|
+
da,
|
|
2635
2699
|
!1,
|
|
2636
2700
|
null,
|
|
2637
2701
|
"08896455",
|
|
2638
2702
|
null,
|
|
2639
2703
|
null
|
|
2640
2704
|
);
|
|
2641
|
-
const
|
|
2705
|
+
const _a = va.exports, ct = 4, pa = /* @__PURE__ */ w({
|
|
2642
2706
|
__name: "lume-point",
|
|
2643
2707
|
props: {
|
|
2644
2708
|
x: { type: Number, required: !0 },
|
|
2645
2709
|
y: { type: Number, required: !0 },
|
|
2646
2710
|
color: {
|
|
2647
2711
|
type: String,
|
|
2648
|
-
default:
|
|
2712
|
+
default: j.Skyblue
|
|
2649
2713
|
},
|
|
2650
2714
|
radius: {
|
|
2651
2715
|
type: Number,
|
|
2652
|
-
default:
|
|
2716
|
+
default: ct
|
|
2653
2717
|
},
|
|
2654
2718
|
active: {
|
|
2655
2719
|
type: Boolean,
|
|
@@ -2658,63 +2722,63 @@ const oo = ao.exports, at = 4, lo = /* @__PURE__ */ E({
|
|
|
2658
2722
|
},
|
|
2659
2723
|
emits: ["click"],
|
|
2660
2724
|
setup(t, { emit: e }) {
|
|
2661
|
-
const r = t, n = I(null),
|
|
2662
|
-
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 };
|
|
2663
2727
|
}
|
|
2664
2728
|
});
|
|
2665
|
-
var
|
|
2729
|
+
var fa = function() {
|
|
2666
2730
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2667
|
-
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(
|
|
2668
|
-
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);
|
|
2669
2733
|
} } });
|
|
2670
|
-
},
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2734
|
+
}, ma = [], ha = /* @__PURE__ */ E(
|
|
2735
|
+
pa,
|
|
2736
|
+
fa,
|
|
2737
|
+
ma,
|
|
2674
2738
|
!1,
|
|
2675
2739
|
null,
|
|
2676
2740
|
"9bacbd7d",
|
|
2677
2741
|
null,
|
|
2678
2742
|
null
|
|
2679
2743
|
);
|
|
2680
|
-
const
|
|
2681
|
-
function
|
|
2682
|
-
function e(
|
|
2744
|
+
const ga = ha.exports;
|
|
2745
|
+
function wt(t) {
|
|
2746
|
+
function e(a) {
|
|
2683
2747
|
let l = null;
|
|
2684
|
-
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), []);
|
|
2685
2749
|
}
|
|
2686
|
-
function r(
|
|
2687
|
-
const
|
|
2688
|
-
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;
|
|
2689
2753
|
}
|
|
2690
|
-
function n(
|
|
2754
|
+
function n(a) {
|
|
2691
2755
|
return function(i) {
|
|
2692
|
-
return !!
|
|
2756
|
+
return !!a.find(
|
|
2693
2757
|
(u) => u.includes(i) || u.includes(i - 1)
|
|
2694
2758
|
);
|
|
2695
2759
|
};
|
|
2696
2760
|
}
|
|
2697
|
-
return { computedLineData: d(() => t.value.map((
|
|
2698
|
-
const l = e(
|
|
2761
|
+
return { computedLineData: d(() => t.value.map((a) => {
|
|
2762
|
+
const l = e(a.values);
|
|
2699
2763
|
return {
|
|
2700
|
-
...
|
|
2764
|
+
...a,
|
|
2701
2765
|
isDashed: n(l),
|
|
2702
|
-
values:
|
|
2703
|
-
var v,
|
|
2704
|
-
const
|
|
2766
|
+
values: a.values.map((i, u) => {
|
|
2767
|
+
var v, s;
|
|
2768
|
+
const c = l.find(
|
|
2705
2769
|
(_) => _.includes(u)
|
|
2706
2770
|
);
|
|
2707
|
-
if (
|
|
2708
|
-
const _ =
|
|
2709
|
-
let f = (v =
|
|
2710
|
-
return f == null && (f =
|
|
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), {
|
|
2711
2775
|
value: r(
|
|
2712
2776
|
f,
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2777
|
+
g,
|
|
2778
|
+
c.length,
|
|
2779
|
+
c.indexOf(u)
|
|
2716
2780
|
),
|
|
2717
|
-
label:
|
|
2781
|
+
label: bt
|
|
2718
2782
|
};
|
|
2719
2783
|
}
|
|
2720
2784
|
return i;
|
|
@@ -2722,22 +2786,22 @@ function Tt(t) {
|
|
|
2722
2786
|
};
|
|
2723
2787
|
})) };
|
|
2724
2788
|
}
|
|
2725
|
-
function
|
|
2789
|
+
function ya(t, e) {
|
|
2726
2790
|
const r = t.bandwidth() / 2;
|
|
2727
|
-
return (n,
|
|
2791
|
+
return (n, o) => t(t.domain()[e + (o - 1)]) + r;
|
|
2728
2792
|
}
|
|
2729
|
-
function
|
|
2793
|
+
function ba(t, e) {
|
|
2730
2794
|
return (r, n) => t(e + (n - 1));
|
|
2731
2795
|
}
|
|
2732
|
-
function
|
|
2733
|
-
return
|
|
2734
|
-
|
|
2735
|
-
).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);
|
|
2736
2800
|
}
|
|
2737
|
-
const
|
|
2801
|
+
const dt = 1, Ta = /* @__PURE__ */ w({
|
|
2738
2802
|
__name: "lume-line-group",
|
|
2739
2803
|
props: {
|
|
2740
|
-
...
|
|
2804
|
+
...ke(),
|
|
2741
2805
|
withPoints: {
|
|
2742
2806
|
type: Boolean,
|
|
2743
2807
|
default: !0
|
|
@@ -2749,151 +2813,151 @@ const ot = 1, po = /* @__PURE__ */ E({
|
|
|
2749
2813
|
},
|
|
2750
2814
|
emits: ["line-click", "point-click", "lume__internal--hover"],
|
|
2751
2815
|
setup(t, { emit: e }) {
|
|
2752
|
-
const r = t, { data: n, options:
|
|
2816
|
+
const r = t, { data: n, options: o, xScale: a, yScale: l } = S(r), i = ve(
|
|
2753
2817
|
"tooltipAnchorAttributes",
|
|
2754
2818
|
null
|
|
2755
|
-
), { updateTooltipAnchorAttributes: u } =
|
|
2819
|
+
), { updateTooltipAnchorAttributes: u } = Ot(
|
|
2756
2820
|
i,
|
|
2757
|
-
a,
|
|
2758
2821
|
o,
|
|
2822
|
+
a,
|
|
2759
2823
|
l
|
|
2760
|
-
),
|
|
2824
|
+
), c = d(() => {
|
|
2761
2825
|
if (n.value.every((C) => C.isDashed))
|
|
2762
2826
|
return n.value;
|
|
2763
|
-
const { computedLineData:
|
|
2764
|
-
return
|
|
2827
|
+
const { computedLineData: k } = wt(n);
|
|
2828
|
+
return o.value.withTooltip !== !1 && (i != null && i.value) && u(k.value), k.value;
|
|
2765
2829
|
}), v = d(() => {
|
|
2766
2830
|
if (r.hoveredIndex === -1)
|
|
2767
2831
|
return;
|
|
2768
|
-
const
|
|
2769
|
-
|
|
2832
|
+
const k = rn(
|
|
2833
|
+
c.value,
|
|
2770
2834
|
r.hoveredIndex
|
|
2771
2835
|
);
|
|
2772
2836
|
return {
|
|
2773
|
-
d: `M ${
|
|
2774
|
-
V ${l.value(
|
|
2837
|
+
d: `M ${Ne(a.value, r.hoveredIndex)},${l.value.range()[1]}
|
|
2838
|
+
V ${l.value(k)}`
|
|
2775
2839
|
// Move to X index, Vertical line to the highest point
|
|
2776
2840
|
};
|
|
2777
|
-
}),
|
|
2778
|
-
() =>
|
|
2841
|
+
}), s = d(
|
|
2842
|
+
() => a.value && dt / (on(a.value) - 1)
|
|
2779
2843
|
// Subtracting the first line (read below)
|
|
2780
2844
|
), _ = d(
|
|
2781
2845
|
() => {
|
|
2782
|
-
var
|
|
2783
|
-
return ((
|
|
2846
|
+
var k;
|
|
2847
|
+
return ((k = o.value) == null ? void 0 : k.lineWidth) * 2 || void 0;
|
|
2784
2848
|
}
|
|
2785
2849
|
// If no `lineWidth`, returns NaN which needs to be undefined
|
|
2786
|
-
),
|
|
2787
|
-
() =>
|
|
2788
|
-
), f = d(() =>
|
|
2789
|
-
() =>
|
|
2850
|
+
), m = d(
|
|
2851
|
+
() => a.value.bandwidth() / 2
|
|
2852
|
+
), f = d(() => a.value.domain()), g = d(
|
|
2853
|
+
() => o.value.withPoints ?? r.withPoints
|
|
2790
2854
|
);
|
|
2791
|
-
function
|
|
2792
|
-
return
|
|
2855
|
+
function y(k) {
|
|
2856
|
+
return c.value[k].values;
|
|
2793
2857
|
}
|
|
2794
|
-
function
|
|
2795
|
-
var
|
|
2796
|
-
const
|
|
2797
|
-
(
|
|
2798
|
-
(B =
|
|
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
|
|
2799
2863
|
];
|
|
2800
|
-
return
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2864
|
+
return ka(
|
|
2865
|
+
k,
|
|
2866
|
+
D,
|
|
2867
|
+
a.value,
|
|
2804
2868
|
l.value
|
|
2805
2869
|
) || "";
|
|
2806
2870
|
}
|
|
2807
|
-
function
|
|
2871
|
+
function T(k) {
|
|
2808
2872
|
return {
|
|
2809
|
-
animationDelay:
|
|
2810
|
-
animationDuration:
|
|
2873
|
+
animationDelay: k < 2 ? 0 : (k - 1) * s.value,
|
|
2874
|
+
animationDuration: s.value
|
|
2811
2875
|
};
|
|
2812
2876
|
}
|
|
2813
|
-
function
|
|
2814
|
-
var
|
|
2815
|
-
const
|
|
2877
|
+
function A(k, C) {
|
|
2878
|
+
var R;
|
|
2879
|
+
const D = (R = y(C)[k]) == null ? void 0 : R.value;
|
|
2816
2880
|
return {
|
|
2817
|
-
x:
|
|
2818
|
-
y: l.value(
|
|
2881
|
+
x: oe(a.value) ? r.xScale(f.value[k]) + m.value : r.xScale(k),
|
|
2882
|
+
y: l.value(D)
|
|
2819
2883
|
};
|
|
2820
2884
|
}
|
|
2821
|
-
function
|
|
2822
|
-
return r.hoveredIndex ===
|
|
2885
|
+
function x(k) {
|
|
2886
|
+
return r.hoveredIndex === k;
|
|
2823
2887
|
}
|
|
2824
|
-
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 };
|
|
2825
2889
|
}
|
|
2826
2890
|
});
|
|
2827
|
-
var
|
|
2891
|
+
var xa = function() {
|
|
2828
2892
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2829
|
-
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(
|
|
2830
|
-
return r("g", { key:
|
|
2831
|
-
return r(n.LumeLine, e._b({ key: `line-${i}`, attrs: { color:
|
|
2832
|
-
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 });
|
|
2833
2897
|
} } }, "lume-line", n.getLineTransitionParams(i), !1));
|
|
2834
|
-
}), 1), n.computedWithPoints ? r("g", { staticClass: "lume-line-group__points", attrs: { "data-j-lume-line-group__points": "" } }, e._l(
|
|
2835
|
-
return r(n.LumePoint, e._b({ key: `point-${i}`, attrs: { active: n.isPointActive(i), color:
|
|
2836
|
-
return n.emit("point-click", { index: i, datasetIndex:
|
|
2837
|
-
} } }, "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));
|
|
2838
2902
|
}), 1) : e._e()]);
|
|
2839
2903
|
})], 2);
|
|
2840
|
-
},
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2904
|
+
}, Aa = [], La = /* @__PURE__ */ E(
|
|
2905
|
+
Ta,
|
|
2906
|
+
xa,
|
|
2907
|
+
Aa,
|
|
2844
2908
|
!1,
|
|
2845
2909
|
null,
|
|
2846
2910
|
"c4d7f0ca",
|
|
2847
2911
|
null,
|
|
2848
2912
|
null
|
|
2849
2913
|
);
|
|
2850
|
-
const
|
|
2851
|
-
margins:
|
|
2914
|
+
const Nt = La.exports, Oa = {
|
|
2915
|
+
margins: re.VERTICAL,
|
|
2852
2916
|
startOnZero: !0,
|
|
2853
2917
|
withTooltip: !0,
|
|
2854
2918
|
xAxisOptions: {},
|
|
2855
2919
|
yAxisOptions: { gridLines: !0 }
|
|
2856
|
-
},
|
|
2920
|
+
}, $a = /* @__PURE__ */ w({
|
|
2857
2921
|
__name: "lume-line-chart",
|
|
2858
2922
|
props: {
|
|
2859
|
-
...
|
|
2923
|
+
...ue(null, !1)
|
|
2860
2924
|
},
|
|
2861
|
-
setup(t) {
|
|
2862
|
-
const
|
|
2863
|
-
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 };
|
|
2864
2928
|
}
|
|
2865
2929
|
});
|
|
2866
|
-
var
|
|
2930
|
+
var Ia = function() {
|
|
2867
2931
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2868
|
-
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(
|
|
2869
|
-
return [r(n.LumeLineGroup, e._b({}, "lume-line-group",
|
|
2870
|
-
} }, e._l(n.slots, function(
|
|
2871
|
-
return { key:
|
|
2872
|
-
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 || {})];
|
|
2873
2937
|
} };
|
|
2874
|
-
})], null, !0) }, "lume-chart", n.props, !1));
|
|
2875
|
-
},
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2938
|
+
})], null, !0) }, "lume-chart", n.props, !1), n.componentEventPropagator));
|
|
2939
|
+
}, Ea = [], wa = /* @__PURE__ */ E(
|
|
2940
|
+
$a,
|
|
2941
|
+
Ia,
|
|
2942
|
+
Ea,
|
|
2879
2943
|
!1,
|
|
2880
2944
|
null,
|
|
2881
2945
|
null,
|
|
2882
2946
|
null,
|
|
2883
2947
|
null
|
|
2884
2948
|
);
|
|
2885
|
-
const
|
|
2886
|
-
function
|
|
2949
|
+
const Za = wa.exports;
|
|
2950
|
+
function Na(t) {
|
|
2887
2951
|
return { areaPathDefinition: d(
|
|
2888
2952
|
() => function(r, n) {
|
|
2889
2953
|
if (!r || !n)
|
|
2890
2954
|
return;
|
|
2891
|
-
const
|
|
2892
|
-
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);
|
|
2893
2957
|
}
|
|
2894
2958
|
) };
|
|
2895
2959
|
}
|
|
2896
|
-
const
|
|
2960
|
+
const Ca = {
|
|
2897
2961
|
margins: {
|
|
2898
2962
|
top: 0,
|
|
2899
2963
|
right: 0,
|
|
@@ -2907,79 +2971,79 @@ const Lo = {
|
|
|
2907
2971
|
tooltipOptions: {
|
|
2908
2972
|
showTitle: !1
|
|
2909
2973
|
}
|
|
2910
|
-
},
|
|
2974
|
+
}, Ha = /* @__PURE__ */ w({
|
|
2911
2975
|
__name: "lume-sparkline-chart",
|
|
2912
2976
|
props: {
|
|
2913
|
-
...
|
|
2914
|
-
...
|
|
2977
|
+
...Me(null),
|
|
2978
|
+
..._e()
|
|
2915
2979
|
},
|
|
2916
|
-
setup(t, { expose: e }) {
|
|
2917
|
-
const
|
|
2918
|
-
() =>
|
|
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 } = wt(u), { areaPathDefinition: s } = Na(v), _ = d(() => u.value[0].color), m = d(
|
|
2982
|
+
() => l.value[0].areaColor || _.value
|
|
2919
2983
|
);
|
|
2920
|
-
function
|
|
2984
|
+
function f(y) {
|
|
2921
2985
|
return {
|
|
2922
|
-
...
|
|
2986
|
+
...y,
|
|
2923
2987
|
noMinSize: !0
|
|
2924
2988
|
};
|
|
2925
2989
|
}
|
|
2926
|
-
function
|
|
2927
|
-
return
|
|
2990
|
+
function g(y, p, T) {
|
|
2991
|
+
return de().range([0, T.width]).domain([0, y[0].values.length - 1]);
|
|
2928
2992
|
}
|
|
2929
2993
|
return e({
|
|
2930
2994
|
areaPathDefinition: s
|
|
2931
|
-
}), { __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 };
|
|
2932
2996
|
}
|
|
2933
2997
|
});
|
|
2934
|
-
var
|
|
2998
|
+
var Da = function() {
|
|
2935
2999
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
2936
|
-
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) {
|
|
2937
3001
|
return [n.allOptions.showArea ? r("path", { class: [
|
|
2938
3002
|
"sparkline-chart__area",
|
|
2939
3003
|
n.options.withTransition !== !1 ? "sparkline-chart__area--transition" : "",
|
|
2940
3004
|
`lume-fill--${n.areaColor || n.computedColor}`,
|
|
2941
3005
|
"lume-fill--faded"
|
|
2942
|
-
], attrs: { d: n.areaPathDefinition(
|
|
2943
|
-
} }, e._l(n.slots, function(
|
|
2944
|
-
return { key:
|
|
2945
|
-
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 || {})];
|
|
2946
3010
|
} };
|
|
2947
|
-
})], null, !0) }, "lume-chart", n.props, !1));
|
|
2948
|
-
},
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
3011
|
+
})], null, !0) }, "lume-chart", n.props, !1), n.componentEventPropagator));
|
|
3012
|
+
}, Ra = [], Pa = /* @__PURE__ */ E(
|
|
3013
|
+
Ha,
|
|
3014
|
+
Da,
|
|
3015
|
+
Ra,
|
|
2952
3016
|
!1,
|
|
2953
3017
|
null,
|
|
2954
|
-
"
|
|
3018
|
+
"c681fff6",
|
|
2955
3019
|
null,
|
|
2956
3020
|
null
|
|
2957
3021
|
);
|
|
2958
|
-
const
|
|
3022
|
+
const Xa = Pa.exports;
|
|
2959
3023
|
export {
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
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
|
|
2984
3048
|
};
|
|
2985
3049
|
//# sourceMappingURL=index.js.map
|