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