@adyen/lume-vue3 1.10.0 → 1.10.2
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/core/lume-bar/composables/bar-transition.d.ts.map +1 -1
- package/dist/@types/components/core/lume-chart-container/lume-chart-container.vue.d.ts +13 -1
- package/dist/@types/components/core/lume-chart-container/lume-chart-container.vue.d.ts.map +1 -1
- package/dist/index.js +521 -510
- package/dist/index.js.map +1 -1
- package/dist/scss/main.scss +4 -4
- package/dist/styles/main.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as Z, ref as
|
|
2
|
-
import { format as mn, ticks as fn, scaleBand as Be, scaleLinear as
|
|
1
|
+
import { defineComponent as Z, ref as R, openBlock as y, createElementBlock as O, mergeProps as j, createElementVNode as G, toDisplayString as oe, createCommentVNode as z, isRef as jt, computed as v, watch as U, toRefs as te, inject as Pe, reactive as Fe, onMounted as _e, unref as d, Fragment as q, renderList as W, createBlock as X, normalizeClass as ne, normalizeStyle as Vt, watchEffect as Ct, onBeforeUnmount as Pt, renderSlot as S, createTextVNode as ce, useSlots as re, nextTick as Qe, withCtx as C, createSlots as de, pushScopeId as cn, popScopeId as dn, provide as Ke, createVNode as ie, toHandlers as ae, normalizeProps as pe, guardReactiveProps as he, defineAsyncComponent as Je, resolveDynamicComponent as vn } from "vue";
|
|
2
|
+
import { format as mn, ticks as fn, scaleBand as Be, scaleLinear as Se, link as pn, line as hn, area as gn } from "d3";
|
|
3
3
|
import { createPopper as _n } from "@popperjs/core";
|
|
4
4
|
import { sankeyLinkHorizontal as yn, sankey as kn, sankeyJustify as bn } from "d3-sankey";
|
|
5
5
|
const An = {
|
|
@@ -44,7 +44,7 @@ const An = {
|
|
|
44
44
|
},
|
|
45
45
|
emits: ["click", "mouseenter"],
|
|
46
46
|
setup(e, { expose: n, emit: t }) {
|
|
47
|
-
const o = t, a =
|
|
47
|
+
const o = t, a = R(null);
|
|
48
48
|
return n({ ref: a }), (u, l) => (y(), O("g", j(e.group, {
|
|
49
49
|
class: ["axis__tick", {
|
|
50
50
|
"axis__tick--hovered": e.isHovered,
|
|
@@ -54,12 +54,12 @@ const An = {
|
|
|
54
54
|
onMouseenter: l[0] || (l[0] = (i) => o("mouseenter", i)),
|
|
55
55
|
onClick: l[1] || (l[1] = (i) => o("click", i))
|
|
56
56
|
}), [
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
G("g", An, [
|
|
58
|
+
G("rect", j(e.ghost, {
|
|
59
59
|
class: "axis__ghost",
|
|
60
60
|
fill: "url(#lume-tick-gradient)"
|
|
61
61
|
}), null, 16),
|
|
62
|
-
|
|
62
|
+
G("text", j(e.label, {
|
|
63
63
|
ref_key: "labelRef",
|
|
64
64
|
ref: a,
|
|
65
65
|
class: "axis__label"
|
|
@@ -74,7 +74,7 @@ const ee = (e, n) => {
|
|
|
74
74
|
for (const [o, a] of n)
|
|
75
75
|
t[o] = a;
|
|
76
76
|
return t;
|
|
77
|
-
},
|
|
77
|
+
}, At = /* @__PURE__ */ ee(Tn, [["__scopeId", "data-v-59ddc0a6"]]), Ln = [
|
|
78
78
|
"controls",
|
|
79
79
|
"legend",
|
|
80
80
|
"axes",
|
|
@@ -82,10 +82,10 @@ const ee = (e, n) => {
|
|
|
82
82
|
"tooltip",
|
|
83
83
|
"tooltip-content"
|
|
84
84
|
];
|
|
85
|
-
function
|
|
85
|
+
function Ft() {
|
|
86
86
|
return process.env.NODE_ENV === "production";
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function zt(e) {
|
|
89
89
|
return (e == null ? void 0 : e.map(
|
|
90
90
|
(n) => n.values.map((t) => t == null ? void 0 : t.value).flat()
|
|
91
91
|
).flat()) || [];
|
|
@@ -101,10 +101,10 @@ function $n(e) {
|
|
|
101
101
|
function qe(e) {
|
|
102
102
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Wt(e, n) {
|
|
105
105
|
const t = { ...e };
|
|
106
106
|
return Object.entries(n).forEach(([o, a]) => {
|
|
107
|
-
t[o] = qe(e[o]) && qe(a) ?
|
|
107
|
+
t[o] = qe(e[o]) && qe(a) ? Wt(e[o], a) : a;
|
|
108
108
|
}), t;
|
|
109
109
|
}
|
|
110
110
|
function xn(e) {
|
|
@@ -116,7 +116,7 @@ function ve(e) {
|
|
|
116
116
|
function On(e) {
|
|
117
117
|
return ve(e) ? e.step() : Math.max(...e.range()) / Math.max(...e.domain());
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Tt(e) {
|
|
120
120
|
const [n, t] = e.domain();
|
|
121
121
|
return n == null || t == null || n === 0 && t === 0;
|
|
122
122
|
}
|
|
@@ -138,8 +138,8 @@ function wn(e, n) {
|
|
|
138
138
|
}
|
|
139
139
|
).values[n]) == null ? void 0 : t.value) || 0;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
const n =
|
|
141
|
+
function Zt(e) {
|
|
142
|
+
const n = jt(e) ? e.value : e;
|
|
143
143
|
if (!n)
|
|
144
144
|
throw new Error("No empty array can be created from specified data value");
|
|
145
145
|
const t = Math.max(
|
|
@@ -186,9 +186,9 @@ function ct(e, n) {
|
|
|
186
186
|
}
|
|
187
187
|
var me = /* @__PURE__ */ ((e) => (e.DatasetLength = `Our guidelines highly recommend not having more than 5 datasets in one chart.
|
|
188
188
|
Learn more: https://lume.design/guidelines/datasets`, e.ColorLoop = "Colors will loop around after the 5th dataset. You can prevent this by setting specific colors for your datasets.", e.Empty = "The dataset(s) provided are empty.", e.InvalidFormat = "The string provided to format is invalid. Please refer to https://github.com/d3/d3-format for valid arguments.", e.NotContainedInSvg = "This component is an `SVGElement`, thus it is required to be inside an `<svg>` container.", e.InvalidHoveredIndex = "The provided hovered index is not valid for the data of this chart.", e.InvalidHoveredElement = "The provided hovered element is not valid for the data of this diagram.", e.IndexExceedsLengthOfDataSets = "Index exceeds length of all of the datasets", e))(me || {});
|
|
189
|
-
const
|
|
189
|
+
const Sn = "[lume] ";
|
|
190
190
|
function ge(e, n = !0) {
|
|
191
|
-
n &&
|
|
191
|
+
n && Ft() || console.warn(Sn + "Warning: " + e);
|
|
192
192
|
}
|
|
193
193
|
const Ve = (e) => {
|
|
194
194
|
let n = null;
|
|
@@ -210,7 +210,7 @@ const Ve = (e) => {
|
|
|
210
210
|
return n ? n(...o) : o[0];
|
|
211
211
|
}
|
|
212
212
|
return t;
|
|
213
|
-
},
|
|
213
|
+
}, Me = () => ({
|
|
214
214
|
options: {
|
|
215
215
|
type: Object,
|
|
216
216
|
default: () => ({})
|
|
@@ -218,13 +218,13 @@ const Ve = (e) => {
|
|
|
218
218
|
});
|
|
219
219
|
function fe(e, n) {
|
|
220
220
|
return { allOptions: v(() => {
|
|
221
|
-
const o =
|
|
222
|
-
return o ?
|
|
221
|
+
const o = jt(n) ? n == null ? void 0 : n.value : n;
|
|
222
|
+
return o ? Wt(o, e.value) : e.value;
|
|
223
223
|
}) };
|
|
224
224
|
}
|
|
225
|
-
const
|
|
226
|
-
function
|
|
227
|
-
const o =
|
|
225
|
+
const Mn = 0.2;
|
|
226
|
+
function Rn(e, n, t) {
|
|
227
|
+
const o = R(), a = v(() => Math.max(...e.value.range())), u = v(() => n.value.length);
|
|
228
228
|
function l() {
|
|
229
229
|
if (!n.value)
|
|
230
230
|
return;
|
|
@@ -232,7 +232,7 @@ function Sn(e, n, t) {
|
|
|
232
232
|
(f, r) => f + r.ref.getBoundingClientRect().width,
|
|
233
233
|
0
|
|
234
234
|
), s = Math.ceil(c / u.value);
|
|
235
|
-
o.value = s + s *
|
|
235
|
+
o.value = s + s * Mn;
|
|
236
236
|
}
|
|
237
237
|
function i(c) {
|
|
238
238
|
if (!n.value)
|
|
@@ -245,14 +245,14 @@ function Sn(e, n, t) {
|
|
|
245
245
|
}
|
|
246
246
|
return U(n, l), { showTick: i };
|
|
247
247
|
}
|
|
248
|
-
const
|
|
248
|
+
const H = {
|
|
249
249
|
HORIZONTAL: "horizontal",
|
|
250
250
|
VERTICAL: "vertical"
|
|
251
|
-
},
|
|
251
|
+
}, Gn = {
|
|
252
252
|
SINGLE: "single",
|
|
253
253
|
GROUPED: "grouped",
|
|
254
254
|
STACKED: "stacked"
|
|
255
|
-
},
|
|
255
|
+
}, Ut = "No data", Lt = 20, Xt = 0.33, Yt = 0.5, Kt = 12, Re = 8, jn = 1, Vn = [
|
|
256
256
|
"auto",
|
|
257
257
|
"auto-start",
|
|
258
258
|
"auto-end",
|
|
@@ -272,7 +272,7 @@ const B = {
|
|
|
272
272
|
function ze(e) {
|
|
273
273
|
e != null && e.closest("svg") || ge(me.NotContainedInSvg);
|
|
274
274
|
}
|
|
275
|
-
const
|
|
275
|
+
const Jt = {
|
|
276
276
|
/** Displays a line for each tick. */
|
|
277
277
|
gridLines: !1,
|
|
278
278
|
/** Displays the axis title. */
|
|
@@ -289,11 +289,11 @@ const Kt = {
|
|
|
289
289
|
/** Space between the tick label and the axis line. */
|
|
290
290
|
tickPadding: 12
|
|
291
291
|
}, Cn = {
|
|
292
|
-
...
|
|
292
|
+
...Jt,
|
|
293
293
|
withTitle: !1,
|
|
294
294
|
skip: !0
|
|
295
295
|
}, Pn = {
|
|
296
|
-
...
|
|
296
|
+
...Jt,
|
|
297
297
|
gridLines: !0
|
|
298
298
|
}, Fn = function(e, n, t) {
|
|
299
299
|
const o = v(() => e.value.step() * e.value.paddingInner() / 2);
|
|
@@ -311,7 +311,7 @@ const Kt = {
|
|
|
311
311
|
return {
|
|
312
312
|
x: -(s - e.value.step()) / 2,
|
|
313
313
|
width: s,
|
|
314
|
-
height: t.value.tickPadding +
|
|
314
|
+
height: t.value.tickPadding + Kt + Re
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
317
|
function l() {
|
|
@@ -346,7 +346,7 @@ const Kt = {
|
|
|
346
346
|
}
|
|
347
347
|
function u(c) {
|
|
348
348
|
var f;
|
|
349
|
-
const s = (c ? (f = c.getComputedTextLength) == null ? void 0 : f.call(c) : 42) + t.value.tickPadding +
|
|
349
|
+
const s = (c ? (f = c.getComputedTextLength) == null ? void 0 : f.call(c) : 42) + t.value.tickPadding + Re;
|
|
350
350
|
return {
|
|
351
351
|
x: -s,
|
|
352
352
|
width: s,
|
|
@@ -387,7 +387,7 @@ const Kt = {
|
|
|
387
387
|
}
|
|
388
388
|
function u() {
|
|
389
389
|
return {
|
|
390
|
-
height: t.value.tickPadding +
|
|
390
|
+
height: t.value.tickPadding + Kt + Re,
|
|
391
391
|
width: o.value,
|
|
392
392
|
x: -(o.value / 2)
|
|
393
393
|
};
|
|
@@ -422,7 +422,7 @@ const Kt = {
|
|
|
422
422
|
}
|
|
423
423
|
function u(c) {
|
|
424
424
|
var f;
|
|
425
|
-
const s = (((f = c == null ? void 0 : c.getComputedTextLength) == null ? void 0 : f.call(c)) || 0) + t.value.tickPadding +
|
|
425
|
+
const s = (((f = c == null ? void 0 : c.getComputedTextLength) == null ? void 0 : f.call(c)) || 0) + t.value.tickPadding + Re;
|
|
426
426
|
return {
|
|
427
427
|
width: s,
|
|
428
428
|
height: o.value,
|
|
@@ -453,28 +453,28 @@ const Kt = {
|
|
|
453
453
|
"y-band-scale-axis": zn,
|
|
454
454
|
"x-linear-scale-axis": Wn,
|
|
455
455
|
"y-linear-scale-axis": Zn
|
|
456
|
-
}, Xn = ["transform"], Yn = { key: 0 }, Kn = /* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
456
|
+
}, Xn = ["transform"], Yn = { key: 0 }, Kn = /* @__PURE__ */ G("linearGradient", { id: "lume-tick-gradient" }, [
|
|
457
|
+
/* @__PURE__ */ G("stop", {
|
|
458
458
|
offset: "0%",
|
|
459
459
|
"stop-color": "rgba(255,255,255,0)"
|
|
460
460
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ G("stop", {
|
|
462
462
|
offset: "10%",
|
|
463
463
|
"stop-color": "var(--lume-chart-background-color)"
|
|
464
464
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ G("stop", {
|
|
466
466
|
offset: "90%",
|
|
467
467
|
"stop-color": "var(--lume-chart-background-color)"
|
|
468
468
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ G("stop", {
|
|
470
470
|
offset: "100%",
|
|
471
471
|
"stop-color": "rgba(255,255,255,0)"
|
|
472
472
|
})
|
|
473
473
|
], -1), Jn = [
|
|
474
474
|
Kn
|
|
475
475
|
];
|
|
476
|
-
var
|
|
477
|
-
const
|
|
476
|
+
var Qt = /* @__PURE__ */ ((e) => (e.bandScale = "band-scale-axis", e.linearScale = "linear-scale-axis", e))(Qt || {}), qt = /* @__PURE__ */ ((e) => (e.left = "left", e.bottom = "bottom", e))(qt || {}), et = /* @__PURE__ */ ((e) => (e.x = "bottom", e.y = "left", e))(et || {});
|
|
477
|
+
const $t = /* @__PURE__ */ Z({
|
|
478
478
|
__name: "lume-axis",
|
|
479
479
|
props: {
|
|
480
480
|
scale: {
|
|
@@ -489,7 +489,7 @@ const Lt = /* @__PURE__ */ Z({
|
|
|
489
489
|
position: {
|
|
490
490
|
type: String,
|
|
491
491
|
default: void 0,
|
|
492
|
-
validator: (e) => e in
|
|
492
|
+
validator: (e) => e in qt
|
|
493
493
|
},
|
|
494
494
|
containerSize: {
|
|
495
495
|
type: Object,
|
|
@@ -501,45 +501,45 @@ const Lt = /* @__PURE__ */ Z({
|
|
|
501
501
|
},
|
|
502
502
|
orientation: {
|
|
503
503
|
type: String,
|
|
504
|
-
default:
|
|
504
|
+
default: H.VERTICAL
|
|
505
505
|
},
|
|
506
|
-
...
|
|
506
|
+
...Me()
|
|
507
507
|
},
|
|
508
508
|
emits: ["mouseenter", "click", "mouseleave", "lume__internal--axis-size"],
|
|
509
509
|
setup(e, { emit: n }) {
|
|
510
|
-
const o = e, a = n, { scale: u, containerSize: l, hoveredIndex: i, options: c, orientation: s } = te(o), f = Pe("isEmpty",
|
|
510
|
+
const o = e, a = n, { scale: u, containerSize: l, hoveredIndex: i, options: c, orientation: s } = te(o), f = Pe("isEmpty", R(!1)), r = Fe({}), m = R(null), g = R(null), p = R(null), b = v(
|
|
511
511
|
() => o.type ? et[o.type] : o.position
|
|
512
512
|
), $ = v(
|
|
513
513
|
() => o.type || (b.value === "left" ? "y" : "x")
|
|
514
514
|
), A = v(
|
|
515
|
-
() => $.value === "x" && s.value ===
|
|
515
|
+
() => $.value === "x" && s.value === H.VERTICAL || $.value === "y" && s.value === H.HORIZONTAL
|
|
516
516
|
), { allOptions: h } = fe(
|
|
517
517
|
c,
|
|
518
518
|
$.value === "x" ? Cn : Pn
|
|
519
|
-
), { showTick: x } =
|
|
520
|
-
var
|
|
521
|
-
return $.value === "y" && f.value && (!u.value ||
|
|
519
|
+
), { showTick: x } = Rn(u, m, h), N = v(() => {
|
|
520
|
+
var M, k, E, _;
|
|
521
|
+
return $.value === "y" && f.value && (!u.value || Tt(u.value)) ? `translate(0, ${((M = l.value) == null ? void 0 : M.height) / 2})` : $.value === "x" && f.value && (!u.value || Tt(u.value)) ? `translate(-${((k = l.value) == null ? void 0 : k.width) / 2}, ${(E = l.value) == null ? void 0 : E.height})` : `translate(0, ${$.value === "x" ? (_ = l.value) == null ? void 0 : _.height : 0})`;
|
|
522
522
|
}), D = v(() => {
|
|
523
523
|
if (!u.value)
|
|
524
524
|
return [];
|
|
525
525
|
if (ve(u.value))
|
|
526
526
|
return u.value.labels || u.value.domain();
|
|
527
|
-
const { tickCount:
|
|
528
|
-
return fn(k, E,
|
|
527
|
+
const { tickCount: M } = h.value, [k, E] = u.value.domain();
|
|
528
|
+
return fn(k, E, M);
|
|
529
529
|
}), P = v(() => {
|
|
530
|
-
const { tickFormat:
|
|
531
|
-
return Ve(
|
|
530
|
+
const { tickFormat: M } = h.value;
|
|
531
|
+
return Ve(M);
|
|
532
532
|
}), w = v(
|
|
533
533
|
() => h.value.withHover && A.value && i.value > -1
|
|
534
|
-
),
|
|
535
|
-
() => h.value.tickPadding +
|
|
534
|
+
), B = v(
|
|
535
|
+
() => h.value.tickPadding + Re || 16
|
|
536
536
|
), Y = v(() => $.value === "x" ? (
|
|
537
537
|
// If x axis, get the tick height
|
|
538
538
|
Math.max(
|
|
539
539
|
...(m.value || []).map(
|
|
540
|
-
(
|
|
540
|
+
(M) => {
|
|
541
541
|
var k, E;
|
|
542
|
-
return ((E = (k =
|
|
542
|
+
return ((E = (k = M.ref).getBBox) == null ? void 0 : E.call(k).height) + B.value;
|
|
543
543
|
}
|
|
544
544
|
)
|
|
545
545
|
)
|
|
@@ -547,33 +547,33 @@ const Lt = /* @__PURE__ */ Z({
|
|
|
547
547
|
// If y axis, get the tick width
|
|
548
548
|
Math.max(
|
|
549
549
|
...(m.value || []).map(
|
|
550
|
-
(
|
|
550
|
+
(M) => {
|
|
551
551
|
var k, E;
|
|
552
|
-
return ((E = (k =
|
|
552
|
+
return ((E = (k = M.ref).getBBox) == null ? void 0 : E.call(k).width) + B.value;
|
|
553
553
|
}
|
|
554
554
|
)
|
|
555
555
|
)
|
|
556
556
|
));
|
|
557
|
-
function K(
|
|
557
|
+
function K(M) {
|
|
558
558
|
const { showTicks: k } = h.value;
|
|
559
|
-
return k === !1 ? "" : P.value(
|
|
559
|
+
return k === !1 ? "" : P.value(M);
|
|
560
560
|
}
|
|
561
|
-
function Q(
|
|
562
|
-
a("mouseenter", { index: A.value ?
|
|
561
|
+
function Q(M, k, E) {
|
|
562
|
+
a("mouseenter", { index: A.value ? M : null, value: k, event: E });
|
|
563
563
|
}
|
|
564
|
-
function F(
|
|
565
|
-
a("click", { index:
|
|
564
|
+
function F(M, k, E) {
|
|
565
|
+
a("click", { index: M, value: k, event: E });
|
|
566
566
|
}
|
|
567
|
-
function ue(
|
|
567
|
+
function ue(M) {
|
|
568
568
|
var k;
|
|
569
569
|
if (!(!m.value || !m.value.length))
|
|
570
|
-
return (k = m.value[
|
|
570
|
+
return (k = m.value[M]) == null ? void 0 : k.ref;
|
|
571
571
|
}
|
|
572
572
|
function Le() {
|
|
573
573
|
p.value = D.value.map(
|
|
574
|
-
(
|
|
575
|
-
value: K(
|
|
576
|
-
group: r.getTickGroupAttributes(
|
|
574
|
+
(M, k) => ({
|
|
575
|
+
value: K(M),
|
|
576
|
+
group: r.getTickGroupAttributes(M, k),
|
|
577
577
|
ghost: r.getTickGhostAttributes(ue(k)),
|
|
578
578
|
label: r.getTickLabelAttributes(),
|
|
579
579
|
gridline: r.getGridLinesAttributes()
|
|
@@ -581,19 +581,19 @@ const Lt = /* @__PURE__ */ Z({
|
|
|
581
581
|
);
|
|
582
582
|
}
|
|
583
583
|
function ke() {
|
|
584
|
-
p.value && p.value.map((
|
|
584
|
+
p.value && p.value.map((M) => (M.gridline = r.getGridLinesAttributes(), M));
|
|
585
585
|
}
|
|
586
586
|
function $e() {
|
|
587
587
|
if (!u.value)
|
|
588
588
|
return;
|
|
589
|
-
const
|
|
589
|
+
const M = u.value.step ? "bandScale" : "linearScale", k = Un[`${$.value}-${Qt[M]}`];
|
|
590
590
|
Object.entries(k(u, l, h) || []).forEach(
|
|
591
591
|
([E, _]) => {
|
|
592
592
|
r[E] = _;
|
|
593
593
|
}
|
|
594
594
|
);
|
|
595
595
|
}
|
|
596
|
-
return U(u, $e, { flush: "sync", immediate: !0 }), U(u, Le, { immediate: !0 }), U(m, Le), U(Y, (
|
|
596
|
+
return U(u, $e, { flush: "sync", immediate: !0 }), U(u, Le, { immediate: !0 }), U(m, Le), U(Y, (M) => a("lume__internal--axis-size", M)), U(o.containerSize, ke), _e(() => ze(g.value)), (M, k) => d(u) ? (y(), O("g", {
|
|
597
597
|
key: 0,
|
|
598
598
|
ref_key: "root",
|
|
599
599
|
ref: g,
|
|
@@ -603,7 +603,7 @@ const Lt = /* @__PURE__ */ Z({
|
|
|
603
603
|
onMouseleave: k[1] || (k[1] = (E) => a("mouseleave", E))
|
|
604
604
|
}, [
|
|
605
605
|
$.value === "x" ? (y(), O("defs", Yn, Jn)) : z("", !0),
|
|
606
|
-
(y(!0), O(q, null, W(p.value, (E, _) => (y(), X(d(
|
|
606
|
+
(y(!0), O(q, null, W(p.value, (E, _) => (y(), X(d(At), j({
|
|
607
607
|
key: `${E.value}_${_}`,
|
|
608
608
|
ref_for: !0,
|
|
609
609
|
ref_key: "tickRefs",
|
|
@@ -614,7 +614,7 @@ const Lt = /* @__PURE__ */ Z({
|
|
|
614
614
|
onMouseenter: (V) => Q(_, E.value, V),
|
|
615
615
|
onClick: (V) => F(_, E.value, V)
|
|
616
616
|
}), null, 16, ["is-hidden", "with-gridlines", "onMouseenter", "onClick"]))), 128)),
|
|
617
|
-
w.value ? (y(), X(d(
|
|
617
|
+
w.value ? (y(), X(d(At), j({ key: 1 }, p.value[d(i)], {
|
|
618
618
|
"with-gridlines": !1,
|
|
619
619
|
"is-hovered": "",
|
|
620
620
|
onClick: k[0] || (k[0] = (E) => F(
|
|
@@ -639,7 +639,12 @@ function Qn(e, n, t, o) {
|
|
|
639
639
|
return { computedX: l, computedY: i, shouldHaveMinWidth: a, shouldHaveMinHeight: u };
|
|
640
640
|
}
|
|
641
641
|
function qn(e, n, t, o) {
|
|
642
|
-
const a =
|
|
642
|
+
const a = R(0), u = R(0), l = v(() => {
|
|
643
|
+
const i = parseFloat(
|
|
644
|
+
getComputedStyle(document.documentElement).fontSize
|
|
645
|
+
), c = (e.value + t.value / 2) / i, s = (n.value + o.value / 2) / i;
|
|
646
|
+
return `${c}rem ${s}rem`;
|
|
647
|
+
});
|
|
643
648
|
return _e(() => {
|
|
644
649
|
a.value = t.value, u.value = o.value;
|
|
645
650
|
}), U(t, (i) => a.value = i), U(o, (i) => u.value = i), { computedWidth: a, computedHeight: u, transformOrigin: l };
|
|
@@ -682,7 +687,7 @@ const eo = ["x", "y", "width", "height"], to = /* @__PURE__ */ Z({
|
|
|
682
687
|
},
|
|
683
688
|
emits: ["click", "mouseover", "mouseleave"],
|
|
684
689
|
setup(e, { emit: n }) {
|
|
685
|
-
const t = e, o = n, { x: a, y: u, width: l, height: i, transition: c, classList: s } = te(t), f =
|
|
690
|
+
const t = e, o = n, { x: a, y: u, width: l, height: i, transition: c, classList: s } = te(t), f = R(null), r = v(
|
|
686
691
|
() => typeof s.value == "string" ? [s.value] : s.value
|
|
687
692
|
), m = v(() => c.value === "width"), g = v(() => c.value === "height"), p = qn(a, u, l, i), { computedX: b, computedY: $, shouldHaveMinWidth: A, shouldHaveMinHeight: h } = Qn(a, u, l, i), x = v(() => A.value ? 1 : (m.value ? p.computedWidth : l).value), N = v(() => h.value ? 1 : (g.value ? p.computedHeight : i).value), D = m.value || g.value ? p.transformOrigin : null;
|
|
688
693
|
return _e(() => ze(f.value)), (P, w) => (y(), O("rect", {
|
|
@@ -697,21 +702,222 @@ const eo = ["x", "y", "width", "height"], to = /* @__PURE__ */ Z({
|
|
|
697
702
|
},
|
|
698
703
|
...r.value
|
|
699
704
|
]]),
|
|
700
|
-
style:
|
|
705
|
+
style: Vt({ transformOrigin: d(D) }),
|
|
701
706
|
x: d(b),
|
|
702
707
|
y: d($),
|
|
703
708
|
width: x.value,
|
|
704
709
|
height: N.value,
|
|
705
710
|
"data-j-bar": "",
|
|
706
|
-
onClick: w[0] || (w[0] = (
|
|
707
|
-
onMouseover: w[1] || (w[1] = (
|
|
708
|
-
onMouseleave: w[2] || (w[2] = (
|
|
711
|
+
onClick: w[0] || (w[0] = (B) => o("click", B)),
|
|
712
|
+
onMouseover: w[1] || (w[1] = (B) => o("mouseover", B)),
|
|
713
|
+
onMouseleave: w[2] || (w[2] = (B) => o("mouseleave", B))
|
|
709
714
|
}, null, 46, eo));
|
|
710
715
|
}
|
|
711
716
|
});
|
|
712
717
|
const dt = /* @__PURE__ */ ee(to, [["__scopeId", "data-v-8e8f732a"]]);
|
|
713
|
-
|
|
714
|
-
|
|
718
|
+
var be = /* @__PURE__ */ ((e) => (e.Categorical = "categorical", e.Sequential = "sequential", e.Divergent = "divergent", e))(be || {}), se = /* @__PURE__ */ ((e) => (e.Skyblue = "skyblue", e.Royalblue = "royalblue", e.Violet = "violet", e.Darkteal = "darkteal", e.Gold = "gold", e))(se || {}), en = /* @__PURE__ */ ((e) => (e.Skyblue10 = "skyblue-10", e.Skyblue20 = "skyblue-20", e.Skyblue30 = "skyblue-30", e.Skyblue40 = "skyblue-40", e.Skyblue50 = "skyblue-50", e.Skyblue60 = "skyblue-60", e.Skyblue70 = "skyblue-70", e.Skyblue80 = "skyblue-80", e.Skyblue90 = "skyblue-90", e.Skyblue100 = "skyblue-100", e.Royalblue10 = "royalblue-10", e.Royalblue20 = "royalblue-20", e.Royalblue30 = "royalblue-30", e.Royalblue40 = "royalblue-40", e.Royalblue50 = "royalblue-50", e.Royalblue60 = "royalblue-60", e.Royalblue70 = "royalblue-70", e.Royalblue80 = "royalblue-80", e.Royalblue90 = "royalblue-90", e.Royalblue100 = "royalblue-100", e.Violet10 = "violet-10", e.Violet20 = "violet-20", e.Violet30 = "violet-30", e.Violet40 = "violet-40", e.Violet50 = "violet-50", e.Violet60 = "violet-60", e.Violet70 = "violet-70", e.Violet80 = "violet-80", e.Violet90 = "violet-90", e.Violet100 = "violet-100", e.Darkteal10 = "darkteal-10", e.Darkteal20 = "darkteal-20", e.Darkteal30 = "darkteal-30", e.Darkteal40 = "darkteal-40", e.Darkteal50 = "darkteal-50", e.Darkteal60 = "darkteal-60", e.Darkteal70 = "darkteal-70", e.Darkteal80 = "darkteal-80", e.Darkteal90 = "darkteal-90", e.Darkteal100 = "darkteal-100", e.Gold10 = "gold-10", e.Gold20 = "gold-20", e.Gold30 = "gold-30", e.Gold40 = "gold-40", e.Gold50 = "gold-50", e.Gold60 = "gold-60", e.Gold70 = "gold-70", e.Gold80 = "gold-80", e.Gold90 = "gold-90", e.Gold100 = "gold-100", e))(en || {}), vt = /* @__PURE__ */ ((e) => (e.SkyTeal = "skyblue-darkteal", e.VioletRoyal = "violet-royalblue", e.VioletTeal = "violet-darkteal", e.GoldTeal = "gold-darkteal", e.GoldRoyal = "gold-royalblue", e))(vt || {}), mt = /* @__PURE__ */ ((e) => (e.White = "white", e.Black = "black", e.Green = "green", e.Orange = "orange", e.Red = "red", e.Grey = "grey", e.Grey10 = "grey-10", e.Grey20 = "grey-20", e.Grey30 = "grey-30", e.Grey40 = "grey-40", e.Grey50 = "grey-50", e.Grey60 = "grey-60", e.Grey70 = "grey-70", e.Grey80 = "grey-80", e.Grey90 = "grey-90", e.Grey100 = "grey-100", e))(mt || {}), ft = /* @__PURE__ */ ((e) => (e["01"] = "01", e["02"] = "02", e["03"] = "03", e["04"] = "04", e["05"] = "05", e["06"] = "06", e["07"] = "07", e["08"] = "08", e["09"] = "09", e))(ft || {});
|
|
719
|
+
const no = be.Categorical, Ge = se.Skyblue, oo = vt.SkyTeal;
|
|
720
|
+
function ao(e) {
|
|
721
|
+
return e === be.Divergent ? oo : Ge;
|
|
722
|
+
}
|
|
723
|
+
function lo(e) {
|
|
724
|
+
return Object.values(ft).includes(e);
|
|
725
|
+
}
|
|
726
|
+
function xt(e, n) {
|
|
727
|
+
return n === be.Divergent ? Object.values(vt).includes(e) : Object.values({
|
|
728
|
+
...se,
|
|
729
|
+
...en,
|
|
730
|
+
...mt,
|
|
731
|
+
...ft
|
|
732
|
+
}).includes(e);
|
|
733
|
+
}
|
|
734
|
+
function uo(e, n) {
|
|
735
|
+
const t = Object.values(se).indexOf(e);
|
|
736
|
+
return Dn(Object.values(se), t > -1 ? t : 0)[n];
|
|
737
|
+
}
|
|
738
|
+
function ro(e, n) {
|
|
739
|
+
const t = 50 + n * 10;
|
|
740
|
+
return `${e}-${t}`;
|
|
741
|
+
}
|
|
742
|
+
function io(e, n) {
|
|
743
|
+
const t = (n + 1) * 10;
|
|
744
|
+
return `${e}-${t}`;
|
|
745
|
+
}
|
|
746
|
+
function Ot(e, n, t) {
|
|
747
|
+
switch (n) {
|
|
748
|
+
default:
|
|
749
|
+
case be.Categorical:
|
|
750
|
+
return lo(e) ? e : uo(e, t);
|
|
751
|
+
case be.Sequential:
|
|
752
|
+
return ro(e, t);
|
|
753
|
+
case be.Divergent:
|
|
754
|
+
return io(e, t);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
function so(e, n, t = no, o) {
|
|
758
|
+
return xt(e, t) ? e : (o > 4 && (ge(me.ColorLoop), o = o % 5), xt(n, t) ? Ot(n, t, o) : Ot(ao(t), t, o));
|
|
759
|
+
}
|
|
760
|
+
function co(e) {
|
|
761
|
+
return e.map((n) => xn(n) ? n : { value: n });
|
|
762
|
+
}
|
|
763
|
+
function vo(e) {
|
|
764
|
+
return e.__internal === !0;
|
|
765
|
+
}
|
|
766
|
+
const pt = (e = null) => ({
|
|
767
|
+
data: {
|
|
768
|
+
type: Array,
|
|
769
|
+
required: !0,
|
|
770
|
+
validator: e || void 0
|
|
771
|
+
},
|
|
772
|
+
labels: {
|
|
773
|
+
type: Array,
|
|
774
|
+
default: void 0
|
|
775
|
+
},
|
|
776
|
+
color: {
|
|
777
|
+
type: String,
|
|
778
|
+
default: se.Skyblue
|
|
779
|
+
},
|
|
780
|
+
title: {
|
|
781
|
+
type: String,
|
|
782
|
+
default: null
|
|
783
|
+
}
|
|
784
|
+
});
|
|
785
|
+
function ht(e, n, t, o, a) {
|
|
786
|
+
const u = Fe({
|
|
787
|
+
width: 0,
|
|
788
|
+
height: 0
|
|
789
|
+
}), l = Bn(12), i = v(() => {
|
|
790
|
+
var f;
|
|
791
|
+
return e.value.length > 5 && ge(me.DatasetLength), (f = e.value) == null ? void 0 : f.map(
|
|
792
|
+
(r, m) => {
|
|
793
|
+
if (vo(r))
|
|
794
|
+
return r;
|
|
795
|
+
const g = co(r.values), p = so(
|
|
796
|
+
r.color,
|
|
797
|
+
t == null ? void 0 : t.value,
|
|
798
|
+
o == null ? void 0 : o.value.colorPalette,
|
|
799
|
+
m
|
|
800
|
+
);
|
|
801
|
+
return {
|
|
802
|
+
...r,
|
|
803
|
+
values: g,
|
|
804
|
+
color: p,
|
|
805
|
+
__internal: !0
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
);
|
|
809
|
+
}), c = v(() => Array.isArray(n.value) ? n.value : Zt(e.value).map((f, r) => r));
|
|
810
|
+
function s(f) {
|
|
811
|
+
const r = (a == null ? void 0 : a.value) === H.HORIZONTAL && c.value.length * (((o == null ? void 0 : o.value.barHeight) || Lt) * 2) + ((o == null ? void 0 : o.value.barHeight) || Lt) || f.height;
|
|
812
|
+
u.width = f.width, u.height = r;
|
|
813
|
+
}
|
|
814
|
+
return {
|
|
815
|
+
chartID: l,
|
|
816
|
+
computedLabels: c,
|
|
817
|
+
containerSize: u,
|
|
818
|
+
internalData: i,
|
|
819
|
+
updateSize: s
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
const mo = () => ({
|
|
823
|
+
xScale: {
|
|
824
|
+
type: Function,
|
|
825
|
+
default: null
|
|
826
|
+
},
|
|
827
|
+
yScale: {
|
|
828
|
+
type: Function,
|
|
829
|
+
default: null
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
function fo(e, n, t, o, a) {
|
|
833
|
+
const u = R(null), l = R(null);
|
|
834
|
+
function i() {
|
|
835
|
+
var f, r, m, g;
|
|
836
|
+
const { width: c, height: s } = t;
|
|
837
|
+
!c && !s || (o.value === H.HORIZONTAL ? (u.value = (f = e.value) != null && f.length ? wt(
|
|
838
|
+
e.value,
|
|
839
|
+
c,
|
|
840
|
+
o.value,
|
|
841
|
+
a.value.startOnZero
|
|
842
|
+
) : null, l.value = (r = n.value) != null && r.length ? It(
|
|
843
|
+
n.value,
|
|
844
|
+
s,
|
|
845
|
+
o.value,
|
|
846
|
+
a.value
|
|
847
|
+
) : null) : (u.value = (m = n.value) != null && m.length ? It(
|
|
848
|
+
n.value,
|
|
849
|
+
c,
|
|
850
|
+
o.value,
|
|
851
|
+
a.value
|
|
852
|
+
) : null, l.value = (g = e.value) != null && g.length ? wt(
|
|
853
|
+
e.value,
|
|
854
|
+
s,
|
|
855
|
+
o.value,
|
|
856
|
+
a.value.startOnZero
|
|
857
|
+
) : null));
|
|
858
|
+
}
|
|
859
|
+
return Ct(i), { xScale: u, yScale: l };
|
|
860
|
+
}
|
|
861
|
+
function It(e, n, t, o) {
|
|
862
|
+
const a = [0, n], { padding: u, paddingInner: l, paddingOuter: i } = o, c = u ?? (t === H.HORIZONTAL ? Yt : Xt);
|
|
863
|
+
return Object.assign(
|
|
864
|
+
Be().range(a).paddingInner(l ?? c).paddingOuter(i ?? c).domain(e.map((s, f) => f)),
|
|
865
|
+
{ labels: e }
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
function wt(e, n, t, o) {
|
|
869
|
+
const a = zt(e).filter((f) => f != null), u = [0, n];
|
|
870
|
+
if (a.length === 0)
|
|
871
|
+
return Se().range(u).domain([0, 0]).nice();
|
|
872
|
+
const l = Math.min(...a), i = o && l > 0 ? 0 : l, c = Math.max(...a), s = t === H.HORIZONTAL ? [i, c] : [c, i];
|
|
873
|
+
return Se().range(u).domain(s).nice();
|
|
874
|
+
}
|
|
875
|
+
function Et(e) {
|
|
876
|
+
return (e == null ? void 0 : e.range) !== void 0 || (e == null ? void 0 : e.copy) !== void 0;
|
|
877
|
+
}
|
|
878
|
+
function tt(e, n) {
|
|
879
|
+
return ve(e) ? e.bandwidth() / 2 + e(e.domain()[n]) : e(n);
|
|
880
|
+
}
|
|
881
|
+
function Nt(e, n, {
|
|
882
|
+
padding: t,
|
|
883
|
+
paddingInner: o,
|
|
884
|
+
paddingOuter: a
|
|
885
|
+
} = {}) {
|
|
886
|
+
const u = t ?? (n === H.HORIZONTAL ? Yt : Xt);
|
|
887
|
+
return e.copy().paddingInner(o ?? u).paddingOuter(a ?? u);
|
|
888
|
+
}
|
|
889
|
+
function gt(e) {
|
|
890
|
+
return Object.values(H).includes(e);
|
|
891
|
+
}
|
|
892
|
+
const Ee = (e, n = !0) => ({
|
|
893
|
+
...pt(e),
|
|
894
|
+
...mo(),
|
|
895
|
+
...Me(),
|
|
896
|
+
classList: {
|
|
897
|
+
type: [String, Array],
|
|
898
|
+
default: () => []
|
|
899
|
+
},
|
|
900
|
+
hoveredIndex: {
|
|
901
|
+
type: Number,
|
|
902
|
+
default: null
|
|
903
|
+
},
|
|
904
|
+
...n ? {
|
|
905
|
+
orientation: {
|
|
906
|
+
type: String,
|
|
907
|
+
default: H.VERTICAL,
|
|
908
|
+
validator: gt
|
|
909
|
+
}
|
|
910
|
+
} : {}
|
|
911
|
+
}), po = (e) => ({
|
|
912
|
+
...pt(e),
|
|
913
|
+
...Me(),
|
|
914
|
+
hoveredElement: {
|
|
915
|
+
type: [Number, String],
|
|
916
|
+
default: null
|
|
917
|
+
}
|
|
918
|
+
});
|
|
919
|
+
function ho() {
|
|
920
|
+
const e = R(), n = Fe({
|
|
715
921
|
dimensions: {}
|
|
716
922
|
}), t = new ResizeObserver((o) => {
|
|
717
923
|
o.forEach((a) => {
|
|
@@ -720,11 +926,11 @@ function no() {
|
|
|
720
926
|
});
|
|
721
927
|
return _e(() => {
|
|
722
928
|
t.observe(e.value);
|
|
723
|
-
}),
|
|
929
|
+
}), Pt(() => {
|
|
724
930
|
t.unobserve(e.value);
|
|
725
931
|
}), { resizeState: n, resizeRef: e };
|
|
726
932
|
}
|
|
727
|
-
const
|
|
933
|
+
const go = ["height"], _o = ["transform"], yo = /* @__PURE__ */ Z({
|
|
728
934
|
__name: "lume-chart-container",
|
|
729
935
|
props: {
|
|
730
936
|
margins: {
|
|
@@ -742,18 +948,23 @@ const oo = ["height"], ao = ["transform"], lo = /* @__PURE__ */ Z({
|
|
|
742
948
|
noMinSize: {
|
|
743
949
|
type: Boolean,
|
|
744
950
|
default: !1
|
|
951
|
+
},
|
|
952
|
+
orientation: {
|
|
953
|
+
type: String,
|
|
954
|
+
default: H.VERTICAL,
|
|
955
|
+
validator: gt
|
|
745
956
|
}
|
|
746
957
|
},
|
|
747
958
|
emits: ["click", "mouseenter", "mouseleave", "resize"],
|
|
748
959
|
setup(e, { emit: n }) {
|
|
749
|
-
const t = e, o = n, { margins: a, containerSize: u } = te(t), l =
|
|
960
|
+
const t = e, o = n, { margins: a, containerSize: u } = te(t), l = R(null), { resizeRef: i, resizeState: c } = ho(), s = v(
|
|
750
961
|
() => u.value.height + a.value.top + a.value.bottom
|
|
751
962
|
);
|
|
752
963
|
return Ct(() => {
|
|
753
964
|
if (!l.value)
|
|
754
965
|
return;
|
|
755
966
|
const { width: f } = c.dimensions, { height: r } = l.value.getBoundingClientRect();
|
|
756
|
-
if (!f || !r)
|
|
967
|
+
if (!f || t.orientation === H.VERTICAL && !r)
|
|
757
968
|
return;
|
|
758
969
|
const m = f - a.value.left - a.value.right, g = r - a.value.top - a.value.bottom, p = {
|
|
759
970
|
width: m > 0 ? m : 0,
|
|
@@ -770,7 +981,7 @@ const oo = ["height"], ao = ["transform"], lo = /* @__PURE__ */ Z({
|
|
|
770
981
|
}]),
|
|
771
982
|
"data-j-chart-container": ""
|
|
772
983
|
}, [
|
|
773
|
-
|
|
984
|
+
S(f.$slots, "header", {}, void 0, !0),
|
|
774
985
|
(y(), O("svg", {
|
|
775
986
|
ref_key: "root",
|
|
776
987
|
ref: l,
|
|
@@ -783,20 +994,20 @@ const oo = ["height"], ao = ["transform"], lo = /* @__PURE__ */ Z({
|
|
|
783
994
|
onMouseenter: r[1] || (r[1] = (m) => o("mouseenter", m)),
|
|
784
995
|
onMouseleave: r[2] || (r[2] = (m) => o("mouseleave", m))
|
|
785
996
|
}, [
|
|
786
|
-
|
|
997
|
+
G("g", {
|
|
787
998
|
transform: `translate(${d(a).left}, ${d(a).top})`,
|
|
788
999
|
class: "lume-chart-container__group",
|
|
789
1000
|
"data-j-chart-container__group": ""
|
|
790
1001
|
}, [
|
|
791
|
-
|
|
792
|
-
], 8,
|
|
793
|
-
], 42,
|
|
794
|
-
|
|
795
|
-
|
|
1002
|
+
S(f.$slots, "default", {}, void 0, !0)
|
|
1003
|
+
], 8, _o)
|
|
1004
|
+
], 42, go)),
|
|
1005
|
+
S(f.$slots, "footer", {}, void 0, !0),
|
|
1006
|
+
S(f.$slots, "extra", {}, void 0, !0)
|
|
796
1007
|
], 2));
|
|
797
1008
|
}
|
|
798
1009
|
});
|
|
799
|
-
const
|
|
1010
|
+
const ko = /* @__PURE__ */ ee(yo, [["__scopeId", "data-v-d53cdc3e"]]), bo = ["onClick", "onMouseenter"], Ao = /* @__PURE__ */ Z({
|
|
800
1011
|
__name: "lume-chart-legend",
|
|
801
1012
|
props: {
|
|
802
1013
|
data: {
|
|
@@ -821,47 +1032,47 @@ const uo = /* @__PURE__ */ ee(lo, [["__scopeId", "data-v-c82b22db"]]), ro = ["on
|
|
|
821
1032
|
onClick: (i) => t("click", { index: l, dataset: u, event: i }),
|
|
822
1033
|
onMouseenter: (i) => t("mouseenter", { index: l, dataset: u, event: i })
|
|
823
1034
|
}, [
|
|
824
|
-
|
|
1035
|
+
G("span", {
|
|
825
1036
|
class: ne(["lume-chart-legend__symbol", `lume-background-color--${u.color}`]),
|
|
826
1037
|
"data-j-chart-legend__symbol": ""
|
|
827
1038
|
}, null, 2),
|
|
828
1039
|
ce(" " + oe(u.label || l), 1)
|
|
829
|
-
], 40,
|
|
1040
|
+
], 40, bo))), 128))
|
|
830
1041
|
], 32));
|
|
831
1042
|
}
|
|
832
1043
|
});
|
|
833
|
-
const
|
|
834
|
-
const
|
|
1044
|
+
const Dt = /* @__PURE__ */ ee(Ao, [["__scopeId", "data-v-6f1d1c44"]]);
|
|
1045
|
+
const To = {}, Lo = {
|
|
835
1046
|
class: "lume-tooltip__title",
|
|
836
1047
|
"data-j-tooltip__title": ""
|
|
837
1048
|
};
|
|
838
|
-
function
|
|
839
|
-
return y(), O("div",
|
|
840
|
-
|
|
1049
|
+
function $o(e, n) {
|
|
1050
|
+
return y(), O("div", Lo, [
|
|
1051
|
+
S(e.$slots, "default", {}, void 0, !0)
|
|
841
1052
|
]);
|
|
842
1053
|
}
|
|
843
|
-
const
|
|
844
|
-
const
|
|
1054
|
+
const xo = /* @__PURE__ */ ee(To, [["render", $o], ["__scopeId", "data-v-8af3fac6"]]);
|
|
1055
|
+
const Oo = {}, Io = {
|
|
845
1056
|
class: "lume-tooltip__item",
|
|
846
1057
|
"data-j-tooltip__summary-item": ""
|
|
847
|
-
},
|
|
848
|
-
function
|
|
849
|
-
return y(), O("li",
|
|
850
|
-
|
|
851
|
-
|
|
1058
|
+
}, wo = { class: "lume-tooltip__value" };
|
|
1059
|
+
function Eo(e, n) {
|
|
1060
|
+
return y(), O("li", Io, [
|
|
1061
|
+
G("span", null, [
|
|
1062
|
+
S(e.$slots, "default", {}, void 0, !0)
|
|
852
1063
|
]),
|
|
853
|
-
|
|
854
|
-
|
|
1064
|
+
G("strong", wo, [
|
|
1065
|
+
S(e.$slots, "value", {}, void 0, !0)
|
|
855
1066
|
])
|
|
856
1067
|
]);
|
|
857
1068
|
}
|
|
858
|
-
const
|
|
1069
|
+
const No = /* @__PURE__ */ ee(Oo, [["render", Eo], ["__scopeId", "data-v-4ed7ec1b"]]), Do = {
|
|
859
1070
|
class: "lume-tooltip__item",
|
|
860
1071
|
"data-j-tooltip__item": ""
|
|
861
|
-
},
|
|
1072
|
+
}, Ho = { "data-j-tooltip__item__label": "" }, Bo = {
|
|
862
1073
|
class: "lume-tooltip__value",
|
|
863
1074
|
"data-j-tooltip__item__value": ""
|
|
864
|
-
},
|
|
1075
|
+
}, So = /* @__PURE__ */ Z({
|
|
865
1076
|
__name: "lume-tooltip-item",
|
|
866
1077
|
props: {
|
|
867
1078
|
color: {
|
|
@@ -870,27 +1081,27 @@ const _o = /* @__PURE__ */ ee(fo, [["render", go], ["__scopeId", "data-v-4ed7ec1
|
|
|
870
1081
|
}
|
|
871
1082
|
},
|
|
872
1083
|
setup(e) {
|
|
873
|
-
return (n, t) => (y(), O("li",
|
|
1084
|
+
return (n, t) => (y(), O("li", Do, [
|
|
874
1085
|
e.color ? (y(), O("span", {
|
|
875
1086
|
key: 0,
|
|
876
1087
|
class: ne([[`lume-background-color--${e.color}`], "lume-tooltip__symbol"]),
|
|
877
1088
|
"data-j-tooltip__item__symbol": ""
|
|
878
1089
|
}, null, 2)) : z("", !0),
|
|
879
|
-
|
|
880
|
-
|
|
1090
|
+
G("span", Ho, [
|
|
1091
|
+
S(n.$slots, "label", {}, void 0, !0)
|
|
881
1092
|
]),
|
|
882
|
-
|
|
883
|
-
|
|
1093
|
+
G("strong", Bo, [
|
|
1094
|
+
S(n.$slots, "value", {}, void 0, !0)
|
|
884
1095
|
])
|
|
885
1096
|
]));
|
|
886
1097
|
}
|
|
887
1098
|
});
|
|
888
|
-
const
|
|
1099
|
+
const Mo = /* @__PURE__ */ ee(So, [["__scopeId", "data-v-4f995c3c"]]), Ro = (e) => (cn("data-v-e7c90551"), e = e(), dn(), e), Go = { class: "lume-tooltip__items" }, jo = {
|
|
889
1100
|
key: 0,
|
|
890
1101
|
class: "lume-tooltip__break"
|
|
891
|
-
},
|
|
892
|
-
|
|
893
|
-
],
|
|
1102
|
+
}, Vo = /* @__PURE__ */ Ro(() => /* @__PURE__ */ G("hr", null, null, -1)), Co = [
|
|
1103
|
+
Vo
|
|
1104
|
+
], Po = /* @__PURE__ */ Z({
|
|
894
1105
|
__name: "lume-tooltip",
|
|
895
1106
|
props: {
|
|
896
1107
|
opened: {
|
|
@@ -930,11 +1141,11 @@ const To = /* @__PURE__ */ ee(Ao, [["__scopeId", "data-v-4f995c3c"]]), Lo = (e)
|
|
|
930
1141
|
type: String,
|
|
931
1142
|
default: null
|
|
932
1143
|
},
|
|
933
|
-
...
|
|
1144
|
+
...Me()
|
|
934
1145
|
},
|
|
935
1146
|
emits: ["opened", "moved", "closed", "tooltip-mouseenter", "tooltip-mouseleave"],
|
|
936
1147
|
setup(e, { emit: n }) {
|
|
937
|
-
const t = e, o = n, a =
|
|
1148
|
+
const t = e, o = n, a = R(null), { items: u, options: l } = te(t), i = re(), c = R(null), { allOptions: s } = fe(l), f = v(
|
|
938
1149
|
() => s.value.fixedPositioning ?? t.fixedPositioning
|
|
939
1150
|
), r = v(
|
|
940
1151
|
() => f.value ? "fixed" : "absolute"
|
|
@@ -981,7 +1192,7 @@ const To = /* @__PURE__ */ ee(Ao, [["__scopeId", "data-v-4f995c3c"]]), Lo = (e)
|
|
|
981
1192
|
async (P, w) => {
|
|
982
1193
|
!w && P ? (await Qe(), x()) : D();
|
|
983
1194
|
}
|
|
984
|
-
), _e(x),
|
|
1195
|
+
), _e(x), Pt(N), (P, w) => e.opened && e.targetElement ? (y(), O("div", {
|
|
985
1196
|
key: 0,
|
|
986
1197
|
ref_key: "root",
|
|
987
1198
|
ref: a,
|
|
@@ -989,21 +1200,21 @@ const To = /* @__PURE__ */ ee(Ao, [["__scopeId", "data-v-4f995c3c"]]), Lo = (e)
|
|
|
989
1200
|
"lume-tooltip--pointer-events": d(l).withPointerEvents
|
|
990
1201
|
}]),
|
|
991
1202
|
"data-j-tooltip": "",
|
|
992
|
-
onMouseenter: w[0] || (w[0] = (
|
|
993
|
-
onMouseleave: w[1] || (w[1] = (
|
|
1203
|
+
onMouseenter: w[0] || (w[0] = (B) => o("tooltip-mouseenter")),
|
|
1204
|
+
onMouseleave: w[1] || (w[1] = (B) => o("tooltip-mouseleave"))
|
|
994
1205
|
}, [
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
g.value ? (y(), X(d(
|
|
1206
|
+
S(P.$slots, "default", {}, () => [
|
|
1207
|
+
S(P.$slots, "title", {}, () => [
|
|
1208
|
+
g.value ? (y(), X(d(xo), { key: 0 }, {
|
|
998
1209
|
default: C(() => [
|
|
999
1210
|
ce(oe(b.value(e.title)), 1)
|
|
1000
1211
|
]),
|
|
1001
1212
|
_: 1
|
|
1002
1213
|
})) : z("", !0)
|
|
1003
1214
|
], !0),
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
A.value ? (y(), X(d(
|
|
1215
|
+
G("ul", Go, [
|
|
1216
|
+
S(P.$slots, "summary", {}, () => [
|
|
1217
|
+
A.value ? (y(), X(d(No), { key: 0 }, de({
|
|
1007
1218
|
default: C(() => [
|
|
1008
1219
|
ce(oe($.value.label) + " ", 1)
|
|
1009
1220
|
]),
|
|
@@ -1018,17 +1229,17 @@ const To = /* @__PURE__ */ ee(Ao, [["__scopeId", "data-v-4f995c3c"]]), Lo = (e)
|
|
|
1018
1229
|
} : void 0
|
|
1019
1230
|
]), 1024)) : z("", !0)
|
|
1020
1231
|
], !0),
|
|
1021
|
-
A.value ? (y(), O("li",
|
|
1022
|
-
|
|
1023
|
-
(y(!0), O(q, null, W(h.value, (
|
|
1024
|
-
key:
|
|
1025
|
-
color:
|
|
1232
|
+
A.value ? (y(), O("li", jo, Co)) : z("", !0),
|
|
1233
|
+
S(P.$slots, "items", {}, () => [
|
|
1234
|
+
(y(!0), O(q, null, W(h.value, (B) => (y(), X(d(Mo), {
|
|
1235
|
+
key: B.label,
|
|
1236
|
+
color: B.color
|
|
1026
1237
|
}, {
|
|
1027
1238
|
label: C(() => [
|
|
1028
|
-
ce(oe(
|
|
1239
|
+
ce(oe(B.label), 1)
|
|
1029
1240
|
]),
|
|
1030
1241
|
value: C(() => [
|
|
1031
|
-
ce(oe(p.value(
|
|
1242
|
+
ce(oe(p.value(B.value)), 1)
|
|
1032
1243
|
]),
|
|
1033
1244
|
_: 2
|
|
1034
1245
|
}, 1032, ["color"]))), 128))
|
|
@@ -1038,208 +1249,7 @@ const To = /* @__PURE__ */ ee(Ao, [["__scopeId", "data-v-4f995c3c"]]), Lo = (e)
|
|
|
1038
1249
|
], 34)) : z("", !0);
|
|
1039
1250
|
}
|
|
1040
1251
|
});
|
|
1041
|
-
const
|
|
1042
|
-
var be = /* @__PURE__ */ ((e) => (e.Categorical = "categorical", e.Sequential = "sequential", e.Divergent = "divergent", e))(be || {}), se = /* @__PURE__ */ ((e) => (e.Skyblue = "skyblue", e.Royalblue = "royalblue", e.Violet = "violet", e.Darkteal = "darkteal", e.Gold = "gold", e))(se || {}), qt = /* @__PURE__ */ ((e) => (e.Skyblue10 = "skyblue-10", e.Skyblue20 = "skyblue-20", e.Skyblue30 = "skyblue-30", e.Skyblue40 = "skyblue-40", e.Skyblue50 = "skyblue-50", e.Skyblue60 = "skyblue-60", e.Skyblue70 = "skyblue-70", e.Skyblue80 = "skyblue-80", e.Skyblue90 = "skyblue-90", e.Skyblue100 = "skyblue-100", e.Royalblue10 = "royalblue-10", e.Royalblue20 = "royalblue-20", e.Royalblue30 = "royalblue-30", e.Royalblue40 = "royalblue-40", e.Royalblue50 = "royalblue-50", e.Royalblue60 = "royalblue-60", e.Royalblue70 = "royalblue-70", e.Royalblue80 = "royalblue-80", e.Royalblue90 = "royalblue-90", e.Royalblue100 = "royalblue-100", e.Violet10 = "violet-10", e.Violet20 = "violet-20", e.Violet30 = "violet-30", e.Violet40 = "violet-40", e.Violet50 = "violet-50", e.Violet60 = "violet-60", e.Violet70 = "violet-70", e.Violet80 = "violet-80", e.Violet90 = "violet-90", e.Violet100 = "violet-100", e.Darkteal10 = "darkteal-10", e.Darkteal20 = "darkteal-20", e.Darkteal30 = "darkteal-30", e.Darkteal40 = "darkteal-40", e.Darkteal50 = "darkteal-50", e.Darkteal60 = "darkteal-60", e.Darkteal70 = "darkteal-70", e.Darkteal80 = "darkteal-80", e.Darkteal90 = "darkteal-90", e.Darkteal100 = "darkteal-100", e.Gold10 = "gold-10", e.Gold20 = "gold-20", e.Gold30 = "gold-30", e.Gold40 = "gold-40", e.Gold50 = "gold-50", e.Gold60 = "gold-60", e.Gold70 = "gold-70", e.Gold80 = "gold-80", e.Gold90 = "gold-90", e.Gold100 = "gold-100", e))(qt || {}), vt = /* @__PURE__ */ ((e) => (e.SkyTeal = "skyblue-darkteal", e.VioletRoyal = "violet-royalblue", e.VioletTeal = "violet-darkteal", e.GoldTeal = "gold-darkteal", e.GoldRoyal = "gold-royalblue", e))(vt || {}), mt = /* @__PURE__ */ ((e) => (e.White = "white", e.Black = "black", e.Green = "green", e.Orange = "orange", e.Red = "red", e.Grey = "grey", e.Grey10 = "grey-10", e.Grey20 = "grey-20", e.Grey30 = "grey-30", e.Grey40 = "grey-40", e.Grey50 = "grey-50", e.Grey60 = "grey-60", e.Grey70 = "grey-70", e.Grey80 = "grey-80", e.Grey90 = "grey-90", e.Grey100 = "grey-100", e))(mt || {}), ft = /* @__PURE__ */ ((e) => (e["01"] = "01", e["02"] = "02", e["03"] = "03", e["04"] = "04", e["05"] = "05", e["06"] = "06", e["07"] = "07", e["08"] = "08", e["09"] = "09", e))(ft || {});
|
|
1043
|
-
const No = be.Categorical, Re = se.Skyblue, Do = vt.SkyTeal;
|
|
1044
|
-
function Ho(e) {
|
|
1045
|
-
return e === be.Divergent ? Do : Re;
|
|
1046
|
-
}
|
|
1047
|
-
function Bo(e) {
|
|
1048
|
-
return Object.values(ft).includes(e);
|
|
1049
|
-
}
|
|
1050
|
-
function xt(e, n) {
|
|
1051
|
-
return n === be.Divergent ? Object.values(vt).includes(e) : Object.values({
|
|
1052
|
-
...se,
|
|
1053
|
-
...qt,
|
|
1054
|
-
...mt,
|
|
1055
|
-
...ft
|
|
1056
|
-
}).includes(e);
|
|
1057
|
-
}
|
|
1058
|
-
function Mo(e, n) {
|
|
1059
|
-
const t = Object.values(se).indexOf(e);
|
|
1060
|
-
return Dn(Object.values(se), t > -1 ? t : 0)[n];
|
|
1061
|
-
}
|
|
1062
|
-
function Go(e, n) {
|
|
1063
|
-
const t = 50 + n * 10;
|
|
1064
|
-
return `${e}-${t}`;
|
|
1065
|
-
}
|
|
1066
|
-
function So(e, n) {
|
|
1067
|
-
const t = (n + 1) * 10;
|
|
1068
|
-
return `${e}-${t}`;
|
|
1069
|
-
}
|
|
1070
|
-
function Ot(e, n, t) {
|
|
1071
|
-
switch (n) {
|
|
1072
|
-
default:
|
|
1073
|
-
case be.Categorical:
|
|
1074
|
-
return Bo(e) ? e : Mo(e, t);
|
|
1075
|
-
case be.Sequential:
|
|
1076
|
-
return Go(e, t);
|
|
1077
|
-
case be.Divergent:
|
|
1078
|
-
return So(e, t);
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
function Ro(e, n, t = No, o) {
|
|
1082
|
-
return xt(e, t) ? e : (o > 4 && (ge(me.ColorLoop), o = o % 5), xt(n, t) ? Ot(n, t, o) : Ot(Ho(t), t, o));
|
|
1083
|
-
}
|
|
1084
|
-
function jo(e) {
|
|
1085
|
-
return e.map((n) => xn(n) ? n : { value: n });
|
|
1086
|
-
}
|
|
1087
|
-
function Vo(e) {
|
|
1088
|
-
return e.__internal === !0;
|
|
1089
|
-
}
|
|
1090
|
-
const pt = (e = null) => ({
|
|
1091
|
-
data: {
|
|
1092
|
-
type: Array,
|
|
1093
|
-
required: !0,
|
|
1094
|
-
validator: e || void 0
|
|
1095
|
-
},
|
|
1096
|
-
labels: {
|
|
1097
|
-
type: Array,
|
|
1098
|
-
default: void 0
|
|
1099
|
-
},
|
|
1100
|
-
color: {
|
|
1101
|
-
type: String,
|
|
1102
|
-
default: se.Skyblue
|
|
1103
|
-
},
|
|
1104
|
-
title: {
|
|
1105
|
-
type: String,
|
|
1106
|
-
default: null
|
|
1107
|
-
}
|
|
1108
|
-
});
|
|
1109
|
-
function ht(e, n, t, o, a) {
|
|
1110
|
-
const u = Fe({
|
|
1111
|
-
width: 0,
|
|
1112
|
-
height: 0
|
|
1113
|
-
}), l = Bn(12), i = v(() => {
|
|
1114
|
-
var f;
|
|
1115
|
-
return e.value.length > 5 && ge(me.DatasetLength), (f = e.value) == null ? void 0 : f.map(
|
|
1116
|
-
(r, m) => {
|
|
1117
|
-
if (Vo(r))
|
|
1118
|
-
return r;
|
|
1119
|
-
const g = jo(r.values), p = Ro(
|
|
1120
|
-
r.color,
|
|
1121
|
-
t == null ? void 0 : t.value,
|
|
1122
|
-
o == null ? void 0 : o.value.colorPalette,
|
|
1123
|
-
m
|
|
1124
|
-
);
|
|
1125
|
-
return {
|
|
1126
|
-
...r,
|
|
1127
|
-
values: g,
|
|
1128
|
-
color: p,
|
|
1129
|
-
__internal: !0
|
|
1130
|
-
};
|
|
1131
|
-
}
|
|
1132
|
-
);
|
|
1133
|
-
}), c = v(() => Array.isArray(n.value) ? n.value : Wt(e.value).map((f, r) => r));
|
|
1134
|
-
function s(f) {
|
|
1135
|
-
const r = (a == null ? void 0 : a.value) === B.HORIZONTAL && c.value.length * (((o == null ? void 0 : o.value.barHeight) || Tt) * 2) + ((o == null ? void 0 : o.value.barHeight) || Tt) || f.height;
|
|
1136
|
-
u.width = f.width, u.height = r;
|
|
1137
|
-
}
|
|
1138
|
-
return {
|
|
1139
|
-
chartID: l,
|
|
1140
|
-
computedLabels: c,
|
|
1141
|
-
containerSize: u,
|
|
1142
|
-
internalData: i,
|
|
1143
|
-
updateSize: s
|
|
1144
|
-
};
|
|
1145
|
-
}
|
|
1146
|
-
const Co = () => ({
|
|
1147
|
-
xScale: {
|
|
1148
|
-
type: Function,
|
|
1149
|
-
default: null
|
|
1150
|
-
},
|
|
1151
|
-
yScale: {
|
|
1152
|
-
type: Function,
|
|
1153
|
-
default: null
|
|
1154
|
-
}
|
|
1155
|
-
});
|
|
1156
|
-
function Po(e, n, t, o, a) {
|
|
1157
|
-
const u = S(null), l = S(null);
|
|
1158
|
-
function i() {
|
|
1159
|
-
var f, r, m, g;
|
|
1160
|
-
const { width: c, height: s } = t;
|
|
1161
|
-
!c && !s || (o.value === B.HORIZONTAL ? (u.value = (f = e.value) != null && f.length ? wt(
|
|
1162
|
-
e.value,
|
|
1163
|
-
c,
|
|
1164
|
-
o.value,
|
|
1165
|
-
a.value.startOnZero
|
|
1166
|
-
) : null, l.value = (r = n.value) != null && r.length ? It(
|
|
1167
|
-
n.value,
|
|
1168
|
-
s,
|
|
1169
|
-
o.value,
|
|
1170
|
-
a.value
|
|
1171
|
-
) : null) : (u.value = (m = n.value) != null && m.length ? It(
|
|
1172
|
-
n.value,
|
|
1173
|
-
c,
|
|
1174
|
-
o.value,
|
|
1175
|
-
a.value
|
|
1176
|
-
) : null, l.value = (g = e.value) != null && g.length ? wt(
|
|
1177
|
-
e.value,
|
|
1178
|
-
s,
|
|
1179
|
-
o.value,
|
|
1180
|
-
a.value.startOnZero
|
|
1181
|
-
) : null));
|
|
1182
|
-
}
|
|
1183
|
-
return Ct(i), { xScale: u, yScale: l };
|
|
1184
|
-
}
|
|
1185
|
-
function It(e, n, t, o) {
|
|
1186
|
-
const a = [0, n], { padding: u, paddingInner: l, paddingOuter: i } = o, c = u ?? (t === B.HORIZONTAL ? Xt : Ut);
|
|
1187
|
-
return Object.assign(
|
|
1188
|
-
Be().range(a).paddingInner(l ?? c).paddingOuter(i ?? c).domain(e.map((s, f) => f)),
|
|
1189
|
-
{ labels: e }
|
|
1190
|
-
);
|
|
1191
|
-
}
|
|
1192
|
-
function wt(e, n, t, o) {
|
|
1193
|
-
const a = Ft(e).filter((f) => f != null), u = [0, n];
|
|
1194
|
-
if (a.length === 0)
|
|
1195
|
-
return Me().range(u).domain([0, 0]).nice();
|
|
1196
|
-
const l = Math.min(...a), i = o && l > 0 ? 0 : l, c = Math.max(...a), s = t === B.HORIZONTAL ? [i, c] : [c, i];
|
|
1197
|
-
return Me().range(u).domain(s).nice();
|
|
1198
|
-
}
|
|
1199
|
-
function Et(e) {
|
|
1200
|
-
return (e == null ? void 0 : e.range) !== void 0 || (e == null ? void 0 : e.copy) !== void 0;
|
|
1201
|
-
}
|
|
1202
|
-
function tt(e, n) {
|
|
1203
|
-
return ve(e) ? e.bandwidth() / 2 + e(e.domain()[n]) : e(n);
|
|
1204
|
-
}
|
|
1205
|
-
function Nt(e, n, {
|
|
1206
|
-
padding: t,
|
|
1207
|
-
paddingInner: o,
|
|
1208
|
-
paddingOuter: a
|
|
1209
|
-
} = {}) {
|
|
1210
|
-
const u = t ?? (n === B.HORIZONTAL ? Xt : Ut);
|
|
1211
|
-
return e.copy().paddingInner(o ?? u).paddingOuter(a ?? u);
|
|
1212
|
-
}
|
|
1213
|
-
function en(e) {
|
|
1214
|
-
return Object.values(B).includes(e);
|
|
1215
|
-
}
|
|
1216
|
-
const Ee = (e, n = !0) => ({
|
|
1217
|
-
...pt(e),
|
|
1218
|
-
...Co(),
|
|
1219
|
-
...Ge(),
|
|
1220
|
-
classList: {
|
|
1221
|
-
type: [String, Array],
|
|
1222
|
-
default: () => []
|
|
1223
|
-
},
|
|
1224
|
-
hoveredIndex: {
|
|
1225
|
-
type: Number,
|
|
1226
|
-
default: null
|
|
1227
|
-
},
|
|
1228
|
-
...n ? {
|
|
1229
|
-
orientation: {
|
|
1230
|
-
type: String,
|
|
1231
|
-
default: B.VERTICAL,
|
|
1232
|
-
validator: en
|
|
1233
|
-
}
|
|
1234
|
-
} : {}
|
|
1235
|
-
}), Fo = (e) => ({
|
|
1236
|
-
...pt(e),
|
|
1237
|
-
...Ge(),
|
|
1238
|
-
hoveredElement: {
|
|
1239
|
-
type: [Number, String],
|
|
1240
|
-
default: null
|
|
1241
|
-
}
|
|
1242
|
-
}), We = () => ({
|
|
1252
|
+
const Fo = /* @__PURE__ */ ee(Po, [["__scopeId", "data-v-e7c90551"]]), We = () => ({
|
|
1243
1253
|
data: {
|
|
1244
1254
|
type: Array,
|
|
1245
1255
|
required: !0
|
|
@@ -1254,8 +1264,8 @@ const Ee = (e, n = !0) => ({
|
|
|
1254
1264
|
},
|
|
1255
1265
|
orientation: {
|
|
1256
1266
|
type: String,
|
|
1257
|
-
default:
|
|
1258
|
-
validator:
|
|
1267
|
+
default: H.VERTICAL,
|
|
1268
|
+
validator: gt
|
|
1259
1269
|
},
|
|
1260
1270
|
xScale: {
|
|
1261
1271
|
type: Function,
|
|
@@ -1287,16 +1297,16 @@ const Ee = (e, n = !0) => ({
|
|
|
1287
1297
|
...We(),
|
|
1288
1298
|
orientation: {
|
|
1289
1299
|
type: String,
|
|
1290
|
-
default:
|
|
1300
|
+
default: H.VERTICAL
|
|
1291
1301
|
}
|
|
1292
1302
|
},
|
|
1293
1303
|
emits: ["click", "lume__internal--hover", "mouseover"],
|
|
1294
1304
|
setup(e, { emit: n }) {
|
|
1295
|
-
const t = e, o = n, { data: a, orientation: u, xScale: l, yScale: i } = te(t), c = v(() =>
|
|
1305
|
+
const t = e, o = n, { data: a, orientation: u, xScale: l, yScale: i } = te(t), c = v(() => Zt(a));
|
|
1296
1306
|
function s(f) {
|
|
1297
1307
|
var A;
|
|
1298
|
-
const r = u.value ===
|
|
1299
|
-
return u.value ===
|
|
1308
|
+
const r = u.value === H.HORIZONTAL ? i.value : l.value, m = r.domain(), g = On(r), p = ((A = r.paddingInner) == null ? void 0 : A.call(r)) ?? 0, b = g * p, $ = ve(r) ? r(m[f]) - b / 2 : r(f) - g / 2;
|
|
1309
|
+
return u.value === H.HORIZONTAL ? {
|
|
1300
1310
|
width: Math.max(...l.value.range()),
|
|
1301
1311
|
height: g,
|
|
1302
1312
|
transform: `translate(0, ${$})`
|
|
@@ -1326,12 +1336,12 @@ const Ee = (e, n = !0) => ({
|
|
|
1326
1336
|
};
|
|
1327
1337
|
function Zo(e) {
|
|
1328
1338
|
return { hasNegativeValues: v(
|
|
1329
|
-
() =>
|
|
1339
|
+
() => zt(e.value).some((t) => t < 0)
|
|
1330
1340
|
) };
|
|
1331
1341
|
}
|
|
1332
1342
|
function Uo(e, n, t, o) {
|
|
1333
1343
|
const a = v(
|
|
1334
|
-
() => o.value ===
|
|
1344
|
+
() => o.value === H.HORIZONTAL
|
|
1335
1345
|
), u = v(
|
|
1336
1346
|
() => {
|
|
1337
1347
|
var s;
|
|
@@ -1367,7 +1377,7 @@ function Yo(e, n) {
|
|
|
1367
1377
|
}
|
|
1368
1378
|
), []);
|
|
1369
1379
|
}
|
|
1370
|
-
const
|
|
1380
|
+
const Ht = {
|
|
1371
1381
|
"stacked-bar": Yo
|
|
1372
1382
|
};
|
|
1373
1383
|
function tn(e, n, t, o, a, u, l, i) {
|
|
@@ -1379,13 +1389,13 @@ function tn(e, n, t, o, a, u, l, i) {
|
|
|
1379
1389
|
);
|
|
1380
1390
|
function s(f) {
|
|
1381
1391
|
var g;
|
|
1382
|
-
const r = ((g = a == null ? void 0 : a.value) == null ? void 0 : g.length) ?? 0, m = i != null && i.value &&
|
|
1392
|
+
const r = ((g = a == null ? void 0 : a.value) == null ? void 0 : g.length) ?? 0, m = i != null && i.value && Ht[i.value] ? Ht[i.value](
|
|
1383
1393
|
f,
|
|
1384
1394
|
r
|
|
1385
1395
|
) : Xo(f, r);
|
|
1386
1396
|
e.value = m.map((p, b) => ({
|
|
1387
|
-
cx: (u == null ? void 0 : u.value) ===
|
|
1388
|
-
cy: (u == null ? void 0 : u.value) ===
|
|
1397
|
+
cx: (u == null ? void 0 : u.value) === H.HORIZONTAL ? t.value(p) : tt(t.value, b),
|
|
1398
|
+
cy: (u == null ? void 0 : u.value) === H.HORIZONTAL ? tt(o.value, b) : o.value(p)
|
|
1389
1399
|
}));
|
|
1390
1400
|
}
|
|
1391
1401
|
return U(
|
|
@@ -1414,7 +1424,7 @@ function Jo(e) {
|
|
|
1414
1424
|
return {
|
|
1415
1425
|
color: ((l = u[t]) == null ? void 0 : l.color) || o,
|
|
1416
1426
|
label: a,
|
|
1417
|
-
value: ((i = u[t]) == null ? void 0 : i.label) ?? ((c = u[t]) == null ? void 0 : c.value) ??
|
|
1427
|
+
value: ((i = u[t]) == null ? void 0 : i.label) ?? ((c = u[t]) == null ? void 0 : c.value) ?? Ut
|
|
1418
1428
|
};
|
|
1419
1429
|
})
|
|
1420
1430
|
) };
|
|
@@ -1464,7 +1474,7 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1464
1474
|
}
|
|
1465
1475
|
},
|
|
1466
1476
|
setup(e, { emit: n }) {
|
|
1467
|
-
const t = e, o = re(), a = n, { data: u, labels: l, color: i, options: c, orientation: s, chartType: f } = te(t), r =
|
|
1477
|
+
const t = e, o = re(), a = n, { data: u, labels: l, color: i, options: c, orientation: s, chartType: f } = te(t), r = R(-1), m = R(null), g = R(null), p = R([]), b = R(null), $ = R(0), A = R(0), { allOptions: h } = fe(c), { internalData: x, computedLabels: N, containerSize: D, updateSize: P, chartID: w } = ht(u, l, i, h, s), { xScale: B, yScale: Y } = fo(
|
|
1468
1478
|
x,
|
|
1469
1479
|
N,
|
|
1470
1480
|
D,
|
|
@@ -1477,23 +1487,23 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1477
1487
|
left: ta(h.value.margins, A.value)
|
|
1478
1488
|
})), Q = v(() => {
|
|
1479
1489
|
var T;
|
|
1480
|
-
return t.xScale ? Et(t.xScale) ? t.xScale : (T = t.xScale) == null ? void 0 : T.call(t, x.value, l.value, D) :
|
|
1490
|
+
return t.xScale ? Et(t.xScale) ? t.xScale : (T = t.xScale) == null ? void 0 : T.call(t, x.value, l.value, D) : B.value;
|
|
1481
1491
|
}), F = v(() => {
|
|
1482
1492
|
var T;
|
|
1483
1493
|
return t.yScale ? Et(t.yScale) ? t.yScale : (T = t.yScale) == null ? void 0 : T.call(t, x.value, l.value, D) : Y.value;
|
|
1484
1494
|
}), ue = v(() => ({
|
|
1485
1495
|
...h.value.xAxisOptions,
|
|
1486
|
-
withHover: s.value ===
|
|
1496
|
+
withHover: s.value === H.VERTICAL
|
|
1487
1497
|
})), Le = v(() => ({
|
|
1488
1498
|
...h.value.yAxisOptions,
|
|
1489
|
-
withHover: s.value ===
|
|
1499
|
+
withHover: s.value === H.HORIZONTAL
|
|
1490
1500
|
})), ke = v(() => {
|
|
1491
1501
|
var T;
|
|
1492
1502
|
return (T = h.value.xAxisOptions) == null ? void 0 : T.title;
|
|
1493
1503
|
}), $e = v(() => {
|
|
1494
1504
|
var T;
|
|
1495
1505
|
return (T = h.value.yAxisOptions) == null ? void 0 : T.title;
|
|
1496
|
-
}),
|
|
1506
|
+
}), M = v(() => {
|
|
1497
1507
|
var T;
|
|
1498
1508
|
return ((T = h.value.xAxisOptions) == null ? void 0 : T.withTitle) !== !1 && ke.value;
|
|
1499
1509
|
}), k = v(() => {
|
|
@@ -1542,7 +1552,7 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1542
1552
|
function Xe() {
|
|
1543
1553
|
Ue(), r.value = -1, a("update:hoveredIndex", -1);
|
|
1544
1554
|
}
|
|
1545
|
-
function
|
|
1555
|
+
function yt(T) {
|
|
1546
1556
|
if (!u.value.some(
|
|
1547
1557
|
({ values: I }) => T <= I.length - 1
|
|
1548
1558
|
)) {
|
|
@@ -1559,10 +1569,10 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1559
1569
|
function sn(T) {
|
|
1560
1570
|
P(T), a("resize", T);
|
|
1561
1571
|
}
|
|
1562
|
-
function
|
|
1572
|
+
function kt({ index: T, value: L, event: I }) {
|
|
1563
1573
|
T !== null && je(T), a("axis-mouseenter", { index: T, value: L, event: I });
|
|
1564
1574
|
}
|
|
1565
|
-
function
|
|
1575
|
+
function bt({ index: T, value: L, event: I }) {
|
|
1566
1576
|
a("axis-click", { index: T, value: L, event: I });
|
|
1567
1577
|
}
|
|
1568
1578
|
return U(
|
|
@@ -1571,17 +1581,17 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1571
1581
|
), U(
|
|
1572
1582
|
l,
|
|
1573
1583
|
(T, L) => a("labels-changed", { newValue: T, oldValue: L })
|
|
1574
|
-
), U(E, (T) => T && ge(me.Empty), { immediate: !0 }), U(() => t.hoveredIndex,
|
|
1584
|
+
), U(E, (T) => T && ge(me.Empty), { immediate: !0 }), U(() => t.hoveredIndex, yt), U(
|
|
1575
1585
|
p,
|
|
1576
1586
|
(T) => {
|
|
1577
|
-
T && t.hoveredIndex != null && r.value === -1 &&
|
|
1587
|
+
T && t.hoveredIndex != null && r.value === -1 && yt(t.hoveredIndex);
|
|
1578
1588
|
},
|
|
1579
1589
|
{ flush: "post" }
|
|
1580
1590
|
), U(b, (T) => {
|
|
1581
1591
|
T === !1 && De.opened && Xe();
|
|
1582
1592
|
}), _e(async () => {
|
|
1583
1593
|
a("rendered"), o.groups || console.error('"groups" `<slot>` must have content.');
|
|
1584
|
-
}), Ke("chartID", w), Ke("isEmpty", E), Ke("tooltipAnchorAttributes", p), (T, L) => (y(), X(d(
|
|
1594
|
+
}), Ke("chartID", w), Ke("isEmpty", E), Ke("tooltipAnchorAttributes", p), (T, L) => (y(), X(d(ko), {
|
|
1585
1595
|
id: `lume-chart_${d(w)}`,
|
|
1586
1596
|
ref_key: "chartContainer",
|
|
1587
1597
|
ref: g,
|
|
@@ -1589,6 +1599,7 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1589
1599
|
"container-size": d(D),
|
|
1590
1600
|
"no-min-size": d(h).noMinSize,
|
|
1591
1601
|
"transparent-background": d(h).transparentBackground,
|
|
1602
|
+
orientation: d(s),
|
|
1592
1603
|
"data-j-lume-chart": "",
|
|
1593
1604
|
onResize: sn,
|
|
1594
1605
|
onClick: L[24] || (L[24] = (I) => a("chart-click", I)),
|
|
@@ -1596,17 +1607,17 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1596
1607
|
onMouseleave: rn
|
|
1597
1608
|
}, {
|
|
1598
1609
|
header: C(() => [
|
|
1599
|
-
|
|
1600
|
-
|
|
1610
|
+
G("div", na, [
|
|
1611
|
+
G("div", oa, [
|
|
1601
1612
|
T.title ? (y(), O("h1", aa, oe(T.title), 1)) : z("", !0),
|
|
1602
|
-
|
|
1603
|
-
|
|
1613
|
+
G("div", la, [
|
|
1614
|
+
S(T.$slots, "controls", {}, void 0, !0)
|
|
1604
1615
|
])
|
|
1605
1616
|
]),
|
|
1606
|
-
|
|
1617
|
+
G("div", ua, [
|
|
1607
1618
|
k.value ? (y(), O("h3", ra, oe($e.value), 1)) : z("", !0),
|
|
1608
|
-
|
|
1609
|
-
d(h).withLegend !== !1 && d(h).legendPosition !== "bottom" ? (y(), X(d(
|
|
1619
|
+
S(T.$slots, "legend", { data: d(x) }, () => [
|
|
1620
|
+
d(h).withLegend !== !1 && d(h).legendPosition !== "bottom" ? (y(), X(d(Dt), {
|
|
1610
1621
|
key: 0,
|
|
1611
1622
|
data: d(x),
|
|
1612
1623
|
class: "lume-chart__legend",
|
|
@@ -1620,8 +1631,8 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1620
1631
|
])
|
|
1621
1632
|
]),
|
|
1622
1633
|
footer: C(() => [
|
|
1623
|
-
|
|
1624
|
-
d(h).withLegend !== !1 && d(h).legendPosition == "bottom" ? (y(), X(d(
|
|
1634
|
+
M.value ? (y(), O("h3", ca, oe(ke.value), 1)) : z("", !0),
|
|
1635
|
+
d(h).withLegend !== !1 && d(h).legendPosition == "bottom" ? (y(), X(d(Dt), {
|
|
1625
1636
|
key: 1,
|
|
1626
1637
|
data: d(x),
|
|
1627
1638
|
class: "lume-chart__legend lume-chart__legend--bottom",
|
|
@@ -1632,7 +1643,7 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1632
1643
|
}, null, 8, ["data"])) : z("", !0)
|
|
1633
1644
|
]),
|
|
1634
1645
|
extra: C(() => [
|
|
1635
|
-
|
|
1646
|
+
S(T.$slots, "tooltip", j(d(De), {
|
|
1636
1647
|
data: d(x),
|
|
1637
1648
|
labels: d(N),
|
|
1638
1649
|
title: d(N)[r.value],
|
|
@@ -1644,7 +1655,7 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1644
1655
|
handleMouseLeave: () => b.value = !1,
|
|
1645
1656
|
options: d(h).tooltipOptions
|
|
1646
1657
|
}), () => [
|
|
1647
|
-
d(h).withTooltip !== !1 ? (y(), X(d(
|
|
1658
|
+
d(h).withTooltip !== !1 ? (y(), X(d(Fo), j({ key: 0 }, d(De), {
|
|
1648
1659
|
position: He.value,
|
|
1649
1660
|
title: d(N)[r.value],
|
|
1650
1661
|
items: d(xe)(r.value),
|
|
@@ -1663,7 +1674,7 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1663
1674
|
onTooltipMouseleave: L[23] || (L[23] = (I) => b.value = !1)
|
|
1664
1675
|
}), {
|
|
1665
1676
|
default: C(() => [
|
|
1666
|
-
|
|
1677
|
+
S(T.$slots, "tooltip-content", {
|
|
1667
1678
|
data: d(x),
|
|
1668
1679
|
labels: d(N),
|
|
1669
1680
|
hoveredIndex: r.value
|
|
@@ -1680,7 +1691,7 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1680
1691
|
transition: !1,
|
|
1681
1692
|
"data-j-lume-chart__negative-values": ""
|
|
1682
1693
|
}), null, 16)) : z("", !0),
|
|
1683
|
-
d(h).withAxes !== !1 ?
|
|
1694
|
+
d(h).withAxes !== !1 ? S(T.$slots, "axes", {
|
|
1684
1695
|
key: 1,
|
|
1685
1696
|
xScale: Q.value,
|
|
1686
1697
|
yScale: F.value,
|
|
@@ -1688,7 +1699,7 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1688
1699
|
options: d(h),
|
|
1689
1700
|
hoveredIndex: r.value
|
|
1690
1701
|
}, () => [
|
|
1691
|
-
ie(d(
|
|
1702
|
+
ie(d($t), {
|
|
1692
1703
|
type: "x",
|
|
1693
1704
|
scale: Q.value,
|
|
1694
1705
|
"container-size": d(D),
|
|
@@ -1696,12 +1707,12 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1696
1707
|
"hovered-index": r.value,
|
|
1697
1708
|
orientation: d(s),
|
|
1698
1709
|
"data-j-lume-chart__x-axis": "",
|
|
1699
|
-
onClick:
|
|
1700
|
-
onMouseenter:
|
|
1710
|
+
onClick: bt,
|
|
1711
|
+
onMouseenter: kt,
|
|
1701
1712
|
onMouseleave: L[3] || (L[3] = (I) => a("axis-mouseleave")),
|
|
1702
1713
|
"onLume__internal-AxisSize": L[4] || (L[4] = (I) => $.value = I)
|
|
1703
1714
|
}, null, 8, ["scale", "container-size", "options", "hovered-index", "orientation"]),
|
|
1704
|
-
ie(d(
|
|
1715
|
+
ie(d($t), {
|
|
1705
1716
|
type: "y",
|
|
1706
1717
|
scale: F.value,
|
|
1707
1718
|
"container-size": d(D),
|
|
@@ -1709,8 +1720,8 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1709
1720
|
"hovered-index": r.value,
|
|
1710
1721
|
orientation: d(s),
|
|
1711
1722
|
"data-j-lume-chart__y-axis": "",
|
|
1712
|
-
onClick:
|
|
1713
|
-
onMouseenter:
|
|
1723
|
+
onClick: bt,
|
|
1724
|
+
onMouseenter: kt,
|
|
1714
1725
|
onMouseleave: L[5] || (L[5] = (I) => a("axis-mouseleave")),
|
|
1715
1726
|
"onLume__internal-AxisSize": L[6] || (L[6] = (I) => A.value = I)
|
|
1716
1727
|
}, null, 8, ["scale", "container-size", "options", "hovered-index", "orientation"])
|
|
@@ -1734,7 +1745,7 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1734
1745
|
class: "lume-fill--transparent"
|
|
1735
1746
|
}), null, 16, sa))), 128))
|
|
1736
1747
|
])) : z("", !0),
|
|
1737
|
-
|
|
1748
|
+
S(T.$slots, "groups", {
|
|
1738
1749
|
data: d(x),
|
|
1739
1750
|
labels: d(N),
|
|
1740
1751
|
options: d(h),
|
|
@@ -1759,10 +1770,10 @@ const na = { class: "lume-chart__header" }, oa = { class: "lume-chart__header-se
|
|
|
1759
1770
|
], 64)) : z("", !0)
|
|
1760
1771
|
]),
|
|
1761
1772
|
_: 3
|
|
1762
|
-
}, 8, ["id", "margins", "container-size", "no-min-size", "transparent-background"]));
|
|
1773
|
+
}, 8, ["id", "margins", "container-size", "no-min-size", "transparent-background", "orientation"]));
|
|
1763
1774
|
}
|
|
1764
1775
|
});
|
|
1765
|
-
const Ne = /* @__PURE__ */ ee(da, [["__scopeId", "data-v-
|
|
1776
|
+
const Ne = /* @__PURE__ */ ee(da, [["__scopeId", "data-v-cffc1135"]]), Bt = 8, va = 8, ma = 20, we = 2, St = 2, fa = ["dy", "dominant-baseline"], pa = ["y", "x", "width", "height"], ha = { class: "lume-alluvial-group__label-wrapper" }, ga = /* @__PURE__ */ Z({
|
|
1766
1777
|
__name: "lume-alluvial-node-label",
|
|
1767
1778
|
props: {
|
|
1768
1779
|
bottom: { type: Boolean, default: !1 },
|
|
@@ -1771,14 +1782,14 @@ const Ne = /* @__PURE__ */ ee(da, [["__scopeId", "data-v-4eac6847"]]), Ht = 8, v
|
|
|
1771
1782
|
},
|
|
1772
1783
|
emits: ["lume__internal--node-resize"],
|
|
1773
1784
|
setup(e, { emit: n }) {
|
|
1774
|
-
const t = e, o = n, a =
|
|
1785
|
+
const t = e, o = n, a = R(null), u = R(t.maxWidth), l = R(1);
|
|
1775
1786
|
return U(
|
|
1776
1787
|
[a, () => t.maxWidth],
|
|
1777
1788
|
async ([i, c]) => {
|
|
1778
1789
|
if (i && c) {
|
|
1779
1790
|
u.value = c, await Qe();
|
|
1780
1791
|
const { width: s, height: f } = i.getBoundingClientRect();
|
|
1781
|
-
u.value = s +
|
|
1792
|
+
u.value = s + St > c ? c : s + St, l.value = Math.ceil(f);
|
|
1782
1793
|
}
|
|
1783
1794
|
},
|
|
1784
1795
|
{ immediate: !0 }
|
|
@@ -1792,13 +1803,13 @@ const Ne = /* @__PURE__ */ ee(da, [["__scopeId", "data-v-4eac6847"]]), Ht = 8, v
|
|
|
1792
1803
|
width: u.value,
|
|
1793
1804
|
height: l.value
|
|
1794
1805
|
}, [
|
|
1795
|
-
|
|
1796
|
-
|
|
1806
|
+
G("div", ha, [
|
|
1807
|
+
G("span", {
|
|
1797
1808
|
ref_key: "text",
|
|
1798
1809
|
ref: a,
|
|
1799
1810
|
class: "lume-alluvial-group__node-label"
|
|
1800
1811
|
}, [
|
|
1801
|
-
|
|
1812
|
+
S(i.$slots, "default", {}, void 0, !0)
|
|
1802
1813
|
], 512)
|
|
1803
1814
|
])
|
|
1804
1815
|
], 8, pa)) : (y(), O("text", {
|
|
@@ -1807,7 +1818,7 @@ const Ne = /* @__PURE__ */ ee(da, [["__scopeId", "data-v-4eac6847"]]), Ht = 8, v
|
|
|
1807
1818
|
dy: e.bottom ? ".2em" : "-.2em",
|
|
1808
1819
|
"dominant-baseline": e.bottom ? "hanging" : "auto"
|
|
1809
1820
|
}, [
|
|
1810
|
-
|
|
1821
|
+
S(i.$slots, "default", {}, void 0, !0)
|
|
1811
1822
|
], 8, fa));
|
|
1812
1823
|
}
|
|
1813
1824
|
});
|
|
@@ -1822,7 +1833,7 @@ const _a = /* @__PURE__ */ ee(ga, [["__scopeId", "data-v-7126dfdb"]]), ya = ["y"
|
|
|
1822
1833
|
y: e.bottom ? ".2em" : "-.2em",
|
|
1823
1834
|
"dominant-baseline": e.bottom ? "hanging" : "auto"
|
|
1824
1835
|
}, [
|
|
1825
|
-
|
|
1836
|
+
S(n.$slots, "default", {}, void 0, !0)
|
|
1826
1837
|
], 8, ya));
|
|
1827
1838
|
}
|
|
1828
1839
|
});
|
|
@@ -1833,7 +1844,7 @@ const ba = /* @__PURE__ */ ee(ka, [["__scopeId", "data-v-b4fc758b"]]), Aa = ["tr
|
|
|
1833
1844
|
y: { type: Number, required: !0 }
|
|
1834
1845
|
},
|
|
1835
1846
|
setup(e) {
|
|
1836
|
-
const n =
|
|
1847
|
+
const n = R(null), t = v(
|
|
1837
1848
|
() => n.value && `translate(${-n.value.getBBox().width / 2}, 0)`
|
|
1838
1849
|
), o = v(
|
|
1839
1850
|
() => n.value && `translate(${n.value.getBBox().width / 2}, 0)`
|
|
@@ -1841,18 +1852,18 @@ const ba = /* @__PURE__ */ ee(ka, [["__scopeId", "data-v-b4fc758b"]]), Aa = ["tr
|
|
|
1841
1852
|
return (a, u) => (y(), O("g", {
|
|
1842
1853
|
transform: `translate(${e.x}, ${e.y})`
|
|
1843
1854
|
}, [
|
|
1844
|
-
|
|
1845
|
-
|
|
1855
|
+
G("g", { transform: t.value }, [
|
|
1856
|
+
S(a.$slots, "before", {}, void 0, !0)
|
|
1846
1857
|
], 8, Ta),
|
|
1847
|
-
|
|
1858
|
+
G("text", {
|
|
1848
1859
|
ref_key: "textRef",
|
|
1849
1860
|
ref: n,
|
|
1850
1861
|
class: "lume-alluvial-group__node-header lume-typography--caption"
|
|
1851
1862
|
}, [
|
|
1852
|
-
|
|
1863
|
+
S(a.$slots, "default", {}, void 0, !0)
|
|
1853
1864
|
], 512),
|
|
1854
|
-
|
|
1855
|
-
|
|
1865
|
+
G("g", { transform: o.value }, [
|
|
1866
|
+
S(a.$slots, "after", {}, void 0, !0)
|
|
1856
1867
|
], 8, La)
|
|
1857
1868
|
], 8, Aa));
|
|
1858
1869
|
}
|
|
@@ -1867,7 +1878,7 @@ function Mt(e, n) {
|
|
|
1867
1878
|
};
|
|
1868
1879
|
}
|
|
1869
1880
|
function Oa(e) {
|
|
1870
|
-
const n =
|
|
1881
|
+
const n = R(Mt(e));
|
|
1871
1882
|
function t(o) {
|
|
1872
1883
|
n.value = Mt(e, o);
|
|
1873
1884
|
}
|
|
@@ -1876,7 +1887,7 @@ function Oa(e) {
|
|
|
1876
1887
|
var Ce = /* @__PURE__ */ ((e) => (e.GraphProblem = "There was an issue generating your alluvial graph.", e.BarScaleDomainAbove0 = "Bar linear scale domain cannot start above 0!", e.BarScaleNull = "Bar linear scale cannot be `null`", e))(Ce || {});
|
|
1877
1888
|
const Ia = "[lume] ";
|
|
1878
1889
|
function ut(e, n, t = !0) {
|
|
1879
|
-
t &&
|
|
1890
|
+
t && Ft() || console.error(Ia + "Error: " + e, n);
|
|
1880
1891
|
}
|
|
1881
1892
|
const wa = 200;
|
|
1882
1893
|
function Ie(e) {
|
|
@@ -1918,7 +1929,7 @@ function Ha(e) {
|
|
|
1918
1929
|
width: n.x1 - n.x0,
|
|
1919
1930
|
height: t ? we : n.y1 - n.y0,
|
|
1920
1931
|
textTransform: {
|
|
1921
|
-
x: n.depth > 0 ? n.x1 +
|
|
1932
|
+
x: n.depth > 0 ? n.x1 + Bt : n.x0 - Bt,
|
|
1922
1933
|
y: (n.y1 + n.y0) / 2
|
|
1923
1934
|
},
|
|
1924
1935
|
node: n
|
|
@@ -1928,25 +1939,25 @@ function Ha(e) {
|
|
|
1928
1939
|
function Ba(e) {
|
|
1929
1940
|
return [e.source.x1, e.y0];
|
|
1930
1941
|
}
|
|
1931
|
-
function
|
|
1942
|
+
function Sa(e) {
|
|
1932
1943
|
return [e.target.x0, e.y1];
|
|
1933
1944
|
}
|
|
1934
|
-
function
|
|
1935
|
-
return e.curveFunction ? pn(e.curveFunction).source(Ba).target(
|
|
1945
|
+
function Ma(e) {
|
|
1946
|
+
return e.curveFunction ? pn(e.curveFunction).source(Ba).target(Sa) : yn();
|
|
1936
1947
|
}
|
|
1937
|
-
function
|
|
1948
|
+
function Ra(e) {
|
|
1938
1949
|
return e.map((n) => {
|
|
1939
1950
|
var t;
|
|
1940
1951
|
return {
|
|
1941
1952
|
id: n.id,
|
|
1942
|
-
color: n.color || ((t = n.source) == null ? void 0 : t.color) ||
|
|
1943
|
-
d:
|
|
1953
|
+
color: n.color || ((t = n.source) == null ? void 0 : t.color) || Ge,
|
|
1954
|
+
d: Ma(n)(n),
|
|
1944
1955
|
strokeWidth: Math.max(1, n.width),
|
|
1945
1956
|
link: n
|
|
1946
1957
|
};
|
|
1947
1958
|
});
|
|
1948
1959
|
}
|
|
1949
|
-
function
|
|
1960
|
+
function Rt(e, n, t, o, a) {
|
|
1950
1961
|
if (o === !1) {
|
|
1951
1962
|
e.node = {
|
|
1952
1963
|
...e.node,
|
|
@@ -1963,21 +1974,21 @@ function Gt(e, n, t, o, a) {
|
|
|
1963
1974
|
};
|
|
1964
1975
|
requestAnimationFrame(i);
|
|
1965
1976
|
}
|
|
1966
|
-
const
|
|
1977
|
+
const Ga = {
|
|
1967
1978
|
nodes: [],
|
|
1968
1979
|
links: []
|
|
1969
1980
|
};
|
|
1970
|
-
function
|
|
1981
|
+
function Gt(e, n) {
|
|
1971
1982
|
return n.find((t) => t.every((o) => o.x0 === e.x0));
|
|
1972
1983
|
}
|
|
1973
1984
|
function ja(e, n, t) {
|
|
1974
|
-
const o =
|
|
1985
|
+
const o = R(null), a = v(() => {
|
|
1975
1986
|
var r, m;
|
|
1976
1987
|
return (m = (r = e.value) == null ? void 0 : r[0]) == null ? void 0 : m.values.map(
|
|
1977
1988
|
({ label: g, color: p, value: b, deriveColorFromIncomingLinks: $, offset: A }) => ({
|
|
1978
1989
|
label: g || b.toString(),
|
|
1979
1990
|
color: p,
|
|
1980
|
-
fallbackColor: p ||
|
|
1991
|
+
fallbackColor: p || Ge,
|
|
1981
1992
|
id: b,
|
|
1982
1993
|
deriveColorFromIncomingLinks: $,
|
|
1983
1994
|
offset: A
|
|
@@ -2006,14 +2017,14 @@ function ja(e, n, t) {
|
|
|
2006
2017
|
var r;
|
|
2007
2018
|
return (r = o.value) == null ? void 0 : r.nodes.reduce(
|
|
2008
2019
|
(m, g) => {
|
|
2009
|
-
const p =
|
|
2020
|
+
const p = Gt(g, m);
|
|
2010
2021
|
return p ? (p.push(g), p.sort((b, $) => (b._y0 || b.y0) - ($._y0 || $.y0))) : m.push([g]), m;
|
|
2011
2022
|
},
|
|
2012
2023
|
[]
|
|
2013
2024
|
);
|
|
2014
2025
|
});
|
|
2015
2026
|
function c(r) {
|
|
2016
|
-
const { offset: m } = r, g =
|
|
2027
|
+
const { offset: m } = r, g = Gt(r, i.value);
|
|
2017
2028
|
if (!g)
|
|
2018
2029
|
return;
|
|
2019
2030
|
const p = g[g.findIndex(($) => $.id === r.id) - 1], b = p && g.length !== 1 ? p.y1 + m : m;
|
|
@@ -2041,7 +2052,7 @@ function ja(e, n, t) {
|
|
|
2041
2052
|
[g, p]
|
|
2042
2053
|
])({ nodes: a.value, links: u.value });
|
|
2043
2054
|
} catch (r) {
|
|
2044
|
-
ut(Ce.GraphProblem, r), o.value =
|
|
2055
|
+
ut(Ce.GraphProblem, r), o.value = Ga;
|
|
2045
2056
|
}
|
|
2046
2057
|
}), { columns: i, graph: f };
|
|
2047
2058
|
}
|
|
@@ -2098,14 +2109,14 @@ const Ca = (e, n) => {
|
|
|
2098
2109
|
};
|
|
2099
2110
|
};
|
|
2100
2111
|
function Fa(e, n, t) {
|
|
2101
|
-
const o =
|
|
2112
|
+
const o = R(null), a = v(() => o.value ? typeof n.value.highlightedElements == "function" ? n.value.highlightedElements(
|
|
2102
2113
|
o.value,
|
|
2103
2114
|
t.value
|
|
2104
2115
|
) : n.value.highlightedElements === "closest" ? Pa(o.value, t.value) : Ca(o.value, t.value) : { nodes: {}, links: [] });
|
|
2105
2116
|
return U(a, (u, l) => {
|
|
2106
2117
|
if (u.links.length === 0 && Object.keys(u.nodes).length === 0) {
|
|
2107
2118
|
e.value.forEach((i) => {
|
|
2108
|
-
i.node.id in l.nodes &&
|
|
2119
|
+
i.node.id in l.nodes && Rt(
|
|
2109
2120
|
i,
|
|
2110
2121
|
l.nodes[i.node.id],
|
|
2111
2122
|
i.node.value,
|
|
@@ -2116,7 +2127,7 @@ function Fa(e, n, t) {
|
|
|
2116
2127
|
return;
|
|
2117
2128
|
}
|
|
2118
2129
|
e.value.forEach((i) => {
|
|
2119
|
-
i.node.id in u.nodes &&
|
|
2130
|
+
i.node.id in u.nodes && Rt(
|
|
2120
2131
|
i,
|
|
2121
2132
|
i.node.value,
|
|
2122
2133
|
u.nodes[i.node.id],
|
|
@@ -2139,7 +2150,7 @@ const za = {
|
|
|
2139
2150
|
},
|
|
2140
2151
|
emits: ["node-click", "node-mouseenter", "node-mouseleave", "link-click", "link-mouseenter", "link-mouseleave"],
|
|
2141
2152
|
setup(e, { emit: n }) {
|
|
2142
|
-
const t = e, o = n, a = Pe("chartID"), { data: u, options: l } = te(t), i =
|
|
2153
|
+
const t = e, o = n, a = Pe("chartID"), { data: u, options: l } = te(t), i = R([]), c = R([]), s = R(null), { extents: f, updateExtents: r } = Oa(t.containerSize), { columns: m, graph: g } = ja(u, l, f), { hoveredElement: p, highlightedElements: b } = Fa(
|
|
2143
2154
|
i,
|
|
2144
2155
|
l,
|
|
2145
2156
|
g
|
|
@@ -2181,7 +2192,7 @@ const za = {
|
|
|
2181
2192
|
height: Oe,
|
|
2182
2193
|
width: _.width,
|
|
2183
2194
|
key: `node-block-${_.node.id}-source-link-${le.link.source.id}`,
|
|
2184
|
-
class: `lume-alluvial-group__node-block lume-fill--${le.link.source.color ||
|
|
2195
|
+
class: `lume-alluvial-group__node-block lume-fill--${le.link.source.color || Ge}`
|
|
2185
2196
|
}), J + Oe;
|
|
2186
2197
|
}, 0), E.push({
|
|
2187
2198
|
id: _.node.id,
|
|
@@ -2192,7 +2203,7 @@ const za = {
|
|
|
2192
2203
|
function w(k) {
|
|
2193
2204
|
return l.value.gradient && `url('#${a}_${k.id}')`;
|
|
2194
2205
|
}
|
|
2195
|
-
function
|
|
2206
|
+
function B(k) {
|
|
2196
2207
|
return A.value.length > 0 && !A.value.includes(k.toString());
|
|
2197
2208
|
}
|
|
2198
2209
|
function Y(k) {
|
|
@@ -2230,17 +2241,17 @@ const za = {
|
|
|
2230
2241
|
var E;
|
|
2231
2242
|
return ((E = P.value.find(({ id: _ }) => k === _)) == null ? void 0 : E.subNodes) ?? [];
|
|
2232
2243
|
}
|
|
2233
|
-
function
|
|
2244
|
+
function M() {
|
|
2234
2245
|
const k = Da(g.value, s.value);
|
|
2235
2246
|
r(k);
|
|
2236
2247
|
}
|
|
2237
2248
|
return U(g, (k) => {
|
|
2238
|
-
i.value = Ha(k.nodes), c.value =
|
|
2249
|
+
i.value = Ha(k.nodes), c.value = Ra(k.links).reverse(), p.value == null && t.hoveredElementId != null && ke(t.hoveredElementId);
|
|
2239
2250
|
}), U([t.containerSize, s], () => {
|
|
2240
|
-
t.containerSize.width && t.containerSize.height &&
|
|
2251
|
+
t.containerSize.width && t.containerSize.height && M();
|
|
2241
2252
|
}), U(() => t.hoveredElementId, ke), (k, E) => (y(), O("g", za, [
|
|
2242
2253
|
x.value ? (y(), O("g", Wa, [
|
|
2243
|
-
(y(!0), O(q, null, W(x.value, (_, V) =>
|
|
2254
|
+
(y(!0), O(q, null, W(x.value, (_, V) => S(k.$slots, `node-header-${V}`, {
|
|
2244
2255
|
x: _.x,
|
|
2245
2256
|
y: -N.value
|
|
2246
2257
|
}, () => [
|
|
@@ -2256,7 +2267,7 @@ const za = {
|
|
|
2256
2267
|
}, 1032, ["x", "y"]))
|
|
2257
2268
|
], !0)), 256))
|
|
2258
2269
|
])) : z("", !0),
|
|
2259
|
-
|
|
2270
|
+
G("g", {
|
|
2260
2271
|
class: "lume-alluvial-link-group",
|
|
2261
2272
|
onMouseleave: Le
|
|
2262
2273
|
}, [
|
|
@@ -2268,11 +2279,11 @@ const za = {
|
|
|
2268
2279
|
x1: _.x1,
|
|
2269
2280
|
x2: _.x2
|
|
2270
2281
|
}, [
|
|
2271
|
-
|
|
2282
|
+
G("stop", {
|
|
2272
2283
|
offset: "0%",
|
|
2273
2284
|
"stop-color": `var(--lume-color--${_.source})`
|
|
2274
2285
|
}, null, 8, Xa),
|
|
2275
|
-
|
|
2286
|
+
G("stop", {
|
|
2276
2287
|
offset: "100%",
|
|
2277
2288
|
"stop-color": `var(--lume-color--${_.target})`
|
|
2278
2289
|
}, null, 8, Ya)
|
|
@@ -2311,12 +2322,12 @@ const za = {
|
|
|
2311
2322
|
(y(!0), O(q, null, W(i.value, (_, V) => (y(), O("g", {
|
|
2312
2323
|
key: `node-block_${V}`,
|
|
2313
2324
|
class: ne(["lume-alluvial-group__node", {
|
|
2314
|
-
"lume-alluvial-group__node--faded":
|
|
2325
|
+
"lume-alluvial-group__node--faded": B(_.node.id),
|
|
2315
2326
|
"lume-alluvial-group__node--focused": Y(_.node.id)
|
|
2316
2327
|
}]),
|
|
2317
2328
|
"data-j-alluvial-group__node-block": ""
|
|
2318
2329
|
}, [
|
|
2319
|
-
|
|
2330
|
+
G("g", {
|
|
2320
2331
|
onClick: (J) => o("node-click", { node: _.node, event: J }),
|
|
2321
2332
|
onMouseenter: (J) => o("node-mouseenter", { node: _.node, event: J }),
|
|
2322
2333
|
onMouseleave: (J) => o("node-mouseleave", { node: _.node, event: J }),
|
|
@@ -2336,7 +2347,7 @@ const za = {
|
|
|
2336
2347
|
height: _.height,
|
|
2337
2348
|
width: _.width
|
|
2338
2349
|
}, null, 10, qa)),
|
|
2339
|
-
|
|
2350
|
+
G("g", {
|
|
2340
2351
|
ref_for: !0,
|
|
2341
2352
|
ref_key: "nodeTextRefs",
|
|
2342
2353
|
ref: s,
|
|
@@ -2347,7 +2358,7 @@ const za = {
|
|
|
2347
2358
|
"data-id": _.node.id,
|
|
2348
2359
|
width: d(l).nodeLabelMaxWidth
|
|
2349
2360
|
}, [
|
|
2350
|
-
|
|
2361
|
+
S(k.$slots, `node-text-${_.node.id}`, {
|
|
2351
2362
|
node: _.node,
|
|
2352
2363
|
value: $.value(
|
|
2353
2364
|
_.node.transitionValue || _.node.value,
|
|
@@ -2358,7 +2369,7 @@ const za = {
|
|
|
2358
2369
|
bottom: d(l).switchText,
|
|
2359
2370
|
left: _.node.depth === 0,
|
|
2360
2371
|
"max-width": d(l).nodeLabelMaxWidth,
|
|
2361
|
-
"onLume__internal-NodeResize":
|
|
2372
|
+
"onLume__internal-NodeResize": M
|
|
2362
2373
|
}, {
|
|
2363
2374
|
default: C(() => [
|
|
2364
2375
|
ce(oe(_.node.label), 1)
|
|
@@ -2405,7 +2416,7 @@ const nl = /* @__PURE__ */ ee(tl, [["__scopeId", "data-v-ea53c3da"]]), ol = {
|
|
|
2405
2416
|
}, Zl = /* @__PURE__ */ Z({
|
|
2406
2417
|
__name: "lume-alluvial-diagram",
|
|
2407
2418
|
props: {
|
|
2408
|
-
...
|
|
2419
|
+
...po(st)
|
|
2409
2420
|
},
|
|
2410
2421
|
setup(e, { emit: n }) {
|
|
2411
2422
|
const t = e, { componentEventPropagator: o } = ye(), a = Te(re()), u = Hn(re()), { options: l } = te(t), { allOptions: i } = fe(l, ol);
|
|
@@ -2425,7 +2436,7 @@ const nl = /* @__PURE__ */ ee(tl, [["__scopeId", "data-v-ea53c3da"]]), ol = {
|
|
|
2425
2436
|
W(d(u), (m, g) => ({
|
|
2426
2437
|
name: g,
|
|
2427
2438
|
fn: C((p) => [
|
|
2428
|
-
|
|
2439
|
+
S(s.$slots, g, pe(he(p || {})))
|
|
2429
2440
|
])
|
|
2430
2441
|
}))
|
|
2431
2442
|
]), 1040, ["hovered-element-id"])
|
|
@@ -2435,7 +2446,7 @@ const nl = /* @__PURE__ */ ee(tl, [["__scopeId", "data-v-ea53c3da"]]), ol = {
|
|
|
2435
2446
|
W(d(a), (r, m) => ({
|
|
2436
2447
|
name: m,
|
|
2437
2448
|
fn: C((g) => [
|
|
2438
|
-
|
|
2449
|
+
S(s.$slots, m, pe(he(g || {})))
|
|
2439
2450
|
])
|
|
2440
2451
|
}))
|
|
2441
2452
|
]), 1040, ["options"]));
|
|
@@ -2471,7 +2482,7 @@ const Ul = /* @__PURE__ */ Z({
|
|
|
2471
2482
|
// Bar chart always starts on zero,
|
|
2472
2483
|
tooltipOptions: {
|
|
2473
2484
|
...(r == null ? void 0 : r.tooltipOptions) || {},
|
|
2474
|
-
position: l.orientation ===
|
|
2485
|
+
position: l.orientation === H.HORIZONTAL ? "right" : void 0
|
|
2475
2486
|
}
|
|
2476
2487
|
};
|
|
2477
2488
|
}
|
|
@@ -2488,17 +2499,17 @@ const Ul = /* @__PURE__ */ Z({
|
|
|
2488
2499
|
W(d(c), (g, p) => ({
|
|
2489
2500
|
name: p,
|
|
2490
2501
|
fn: C((b) => [
|
|
2491
|
-
|
|
2502
|
+
S(r.$slots, p, pe(he(b || {})))
|
|
2492
2503
|
])
|
|
2493
2504
|
}))
|
|
2494
2505
|
]), 1040, ["options"]));
|
|
2495
2506
|
}
|
|
2496
2507
|
});
|
|
2497
2508
|
function al(e) {
|
|
2498
|
-
return Object.values(
|
|
2509
|
+
return Object.values(Gn).includes(e) || e == null;
|
|
2499
2510
|
}
|
|
2500
2511
|
function ll(e) {
|
|
2501
|
-
return Object.values(
|
|
2512
|
+
return Object.values(H).includes(e);
|
|
2502
2513
|
}
|
|
2503
2514
|
const ul = (e = !1) => ({
|
|
2504
2515
|
type: {
|
|
@@ -2509,7 +2520,7 @@ const ul = (e = !1) => ({
|
|
|
2509
2520
|
...e ? {
|
|
2510
2521
|
orientation: {
|
|
2511
2522
|
type: String,
|
|
2512
|
-
default:
|
|
2523
|
+
default: H.VERTICAL,
|
|
2513
2524
|
validator: ll
|
|
2514
2525
|
}
|
|
2515
2526
|
} : {}
|
|
@@ -2540,7 +2551,7 @@ function rl(e, n) {
|
|
|
2540
2551
|
}
|
|
2541
2552
|
function il(e, n, t) {
|
|
2542
2553
|
const o = v(
|
|
2543
|
-
() => t.value ===
|
|
2554
|
+
() => t.value === H.HORIZONTAL
|
|
2544
2555
|
);
|
|
2545
2556
|
function a(i) {
|
|
2546
2557
|
i || ut(Ce.BarScaleNull), Math.min(...i.domain()) > 0 && ut(Ce.BarScaleDomainAbove0);
|
|
@@ -2556,7 +2567,7 @@ const sl = {
|
|
|
2556
2567
|
};
|
|
2557
2568
|
function cl(e, n, t, o, a, u) {
|
|
2558
2569
|
const l = v(
|
|
2559
|
-
() => o.value ===
|
|
2570
|
+
() => o.value === H.HORIZONTAL
|
|
2560
2571
|
);
|
|
2561
2572
|
function i(r, m) {
|
|
2562
2573
|
let g, p;
|
|
@@ -2571,7 +2582,7 @@ function cl(e, n, t, o, a, u) {
|
|
|
2571
2582
|
function f(r, m, g) {
|
|
2572
2583
|
if (!(n.value && t.value))
|
|
2573
2584
|
return sl;
|
|
2574
|
-
const { value: b, color: $ } = r, A = $ ?? e.value[m].color ??
|
|
2585
|
+
const { value: b, color: $ } = r, A = $ ?? e.value[m].color ?? Ge, { x: h, y: x } = i(b, g), N = c(b), D = s(b);
|
|
2575
2586
|
return {
|
|
2576
2587
|
classList: [`lume-fill--${A}`, ...u],
|
|
2577
2588
|
x: h,
|
|
@@ -2592,7 +2603,7 @@ const dl = {
|
|
|
2592
2603
|
};
|
|
2593
2604
|
function vl(e, n, t, o, a, u) {
|
|
2594
2605
|
const l = v(
|
|
2595
|
-
() => o.value ===
|
|
2606
|
+
() => o.value === H.HORIZONTAL
|
|
2596
2607
|
), i = v(() => Be().domain(e.value.map((p, b) => b)).range([0, n.value.bandwidth()]).padding(0)), c = v(() => Be().domain(e.value.map((p, b) => b)).range([0, t.value.bandwidth()]).padding(0));
|
|
2597
2608
|
function s(p, b, $) {
|
|
2598
2609
|
if (l.value)
|
|
@@ -2616,13 +2627,13 @@ function vl(e, n, t, o, a, u) {
|
|
|
2616
2627
|
function g(p, b, $) {
|
|
2617
2628
|
if (!(n.value && t.value))
|
|
2618
2629
|
return dl;
|
|
2619
|
-
const { value: h, color: x } = p, N = x ?? e.value[b].color ?? Object.values(se)[b], D = s(h, $, b), P = f(h, $, b), w = r(h),
|
|
2630
|
+
const { value: h, color: x } = p, N = x ?? e.value[b].color ?? Object.values(se)[b], D = s(h, $, b), P = f(h, $, b), w = r(h), B = m(h);
|
|
2620
2631
|
return {
|
|
2621
2632
|
classList: [`lume-fill--${N}`, ...u],
|
|
2622
2633
|
x: D,
|
|
2623
2634
|
y: P,
|
|
2624
2635
|
width: w,
|
|
2625
|
-
height:
|
|
2636
|
+
height: B,
|
|
2626
2637
|
isFaded: a.value !== -1 && a.value !== $,
|
|
2627
2638
|
isNegative: h < 0
|
|
2628
2639
|
};
|
|
@@ -2631,7 +2642,7 @@ function vl(e, n, t, o, a, u) {
|
|
|
2631
2642
|
}
|
|
2632
2643
|
function ml(e, n, t) {
|
|
2633
2644
|
const o = v(
|
|
2634
|
-
() => n.value ===
|
|
2645
|
+
() => n.value === H.HORIZONTAL
|
|
2635
2646
|
), a = v(() => {
|
|
2636
2647
|
const c = e.value.map(
|
|
2637
2648
|
(s) => s.filter((f) => f.value < 0).reduce((f, r) => f + r.value, 0)
|
|
@@ -2647,7 +2658,7 @@ function ml(e, n, t) {
|
|
|
2647
2658
|
return Math.max(...c);
|
|
2648
2659
|
});
|
|
2649
2660
|
function l(c, s, f) {
|
|
2650
|
-
return s.length ? o.value ?
|
|
2661
|
+
return s.length ? o.value ? Se().domain([a.value, u.value]).range([0, f.width]) : Object.assign(
|
|
2651
2662
|
Nt(
|
|
2652
2663
|
Be().domain(s.map((r, m) => m)).range([0, f.width]),
|
|
2653
2664
|
n.value,
|
|
@@ -2664,13 +2675,13 @@ function ml(e, n, t) {
|
|
|
2664
2675
|
t.value
|
|
2665
2676
|
),
|
|
2666
2677
|
{ labels: s }
|
|
2667
|
-
) :
|
|
2678
|
+
) : Se().domain([u.value, a.value]).range([0, f.height]) : null;
|
|
2668
2679
|
}
|
|
2669
2680
|
return { stackedXScaleGenerator: l, stackedYScaleGenerator: i };
|
|
2670
2681
|
}
|
|
2671
2682
|
function fl(e, n, t, o, a, u) {
|
|
2672
2683
|
const l = v(
|
|
2673
|
-
() => o.value ===
|
|
2684
|
+
() => o.value === H.HORIZONTAL
|
|
2674
2685
|
), i = v(
|
|
2675
2686
|
() => l.value ? t.value.domain() : n.value.domain()
|
|
2676
2687
|
), c = v(
|
|
@@ -2699,7 +2710,7 @@ function fl(e, n, t, o, a, u) {
|
|
|
2699
2710
|
return A ? c.value.reduce((x, N, D) => (D < A && N[h] < 0 && (x += N[h]), x), 0) : 0;
|
|
2700
2711
|
}
|
|
2701
2712
|
function $(A, h, x) {
|
|
2702
|
-
const { value: N, color: D } = A, P = N >= 0 ? f(N) : r(N), w = N >= 0 ? m(N) : g(N),
|
|
2713
|
+
const { value: N, color: D } = A, P = N >= 0 ? f(N) : r(N), w = N >= 0 ? m(N) : g(N), B = N >= 0 ? p(h, x) : b(h, x), { x: Y, y: K } = s(N, x, B);
|
|
2703
2714
|
return {
|
|
2704
2715
|
classList: [`lume-fill--${D ?? e.value[h].color ?? Object.values(se)[h]}`, ...u],
|
|
2705
2716
|
width: P,
|
|
@@ -2719,7 +2730,7 @@ const pl = {
|
|
|
2719
2730
|
single: cl,
|
|
2720
2731
|
grouped: vl,
|
|
2721
2732
|
stacked: fl
|
|
2722
|
-
},
|
|
2733
|
+
}, _t = /* @__PURE__ */ Z({
|
|
2723
2734
|
__name: "lume-bar-group",
|
|
2724
2735
|
props: {
|
|
2725
2736
|
...We(),
|
|
@@ -2759,22 +2770,22 @@ const pl = {
|
|
|
2759
2770
|
return P;
|
|
2760
2771
|
}), x = v(() => {
|
|
2761
2772
|
if (i.value)
|
|
2762
|
-
return l.value ===
|
|
2773
|
+
return l.value === H.HORIZONTAL ? "width" : "height";
|
|
2763
2774
|
});
|
|
2764
2775
|
async function N(D) {
|
|
2765
2776
|
o("lume__internal--hover", D), g("lume__internal--hover", D);
|
|
2766
2777
|
}
|
|
2767
2778
|
return (D, P) => (y(), O("g", pl, [
|
|
2768
|
-
(y(!0), O(q, null, W(d(p), (w,
|
|
2769
|
-
key:
|
|
2770
|
-
onMouseenter: (Y) => N(
|
|
2779
|
+
(y(!0), O(q, null, W(d(p), (w, B) => (y(), O("g", {
|
|
2780
|
+
key: B,
|
|
2781
|
+
onMouseenter: (Y) => N(B)
|
|
2771
2782
|
}, [
|
|
2772
|
-
(y(!0), O(q, null, W(w, (Y, K) => (y(), X(d(dt), j(h.value(Y, K,
|
|
2783
|
+
(y(!0), O(q, null, W(w, (Y, K) => (y(), X(d(dt), j(h.value(Y, K, B, w), {
|
|
2773
2784
|
key: `bar-${K}`,
|
|
2774
2785
|
transition: x.value,
|
|
2775
2786
|
"data-j-lume-bar": "",
|
|
2776
2787
|
onClick: (Q) => o("bar-click", {
|
|
2777
|
-
index:
|
|
2788
|
+
index: B,
|
|
2778
2789
|
datasetIndex: K,
|
|
2779
2790
|
event: Q
|
|
2780
2791
|
})
|
|
@@ -2783,13 +2794,13 @@ const pl = {
|
|
|
2783
2794
|
]));
|
|
2784
2795
|
}
|
|
2785
2796
|
}), _l = {
|
|
2786
|
-
[
|
|
2797
|
+
[H.VERTICAL]: {
|
|
2787
2798
|
withTooltip: !0,
|
|
2788
2799
|
xAxisOptions: {},
|
|
2789
2800
|
yAxisOptions: { gridLines: !0 },
|
|
2790
2801
|
margins: Ae.VERTICAL
|
|
2791
2802
|
},
|
|
2792
|
-
[
|
|
2803
|
+
[H.HORIZONTAL]: {
|
|
2793
2804
|
withTooltip: !0,
|
|
2794
2805
|
xAxisOptions: { gridLines: !0 },
|
|
2795
2806
|
yAxisOptions: { gridLines: !1 },
|
|
@@ -2802,7 +2813,7 @@ const pl = {
|
|
|
2802
2813
|
},
|
|
2803
2814
|
setup(e, { emit: n }) {
|
|
2804
2815
|
const t = e, { componentEventPropagator: o } = ye(), a = Te(re()), { orientation: u, options: l } = te(t), i = v(
|
|
2805
|
-
() => _l[u.value ||
|
|
2816
|
+
() => _l[u.value || H.VERTICAL]
|
|
2806
2817
|
// needs to be computed so that default options are reactive
|
|
2807
2818
|
), { allOptions: c } = fe(l, i);
|
|
2808
2819
|
return (s, f) => (y(), X(d(Ne), j({ ...t, ...s.$attrs }, {
|
|
@@ -2811,26 +2822,26 @@ const pl = {
|
|
|
2811
2822
|
"data-j-single-bar-chart": ""
|
|
2812
2823
|
}, ae(d(o))), de({
|
|
2813
2824
|
groups: C((r) => [
|
|
2814
|
-
ie(d(
|
|
2825
|
+
ie(d(_t), j(r, { orientation: d(u) }, ae(d(o))), null, 16, ["orientation"])
|
|
2815
2826
|
]),
|
|
2816
2827
|
_: 2
|
|
2817
2828
|
}, [
|
|
2818
2829
|
W(d(a), (r, m) => ({
|
|
2819
2830
|
name: m,
|
|
2820
2831
|
fn: C((g) => [
|
|
2821
|
-
|
|
2832
|
+
S(s.$slots, m, pe(he(g || {})))
|
|
2822
2833
|
])
|
|
2823
2834
|
}))
|
|
2824
2835
|
]), 1040, ["options"]));
|
|
2825
2836
|
}
|
|
2826
2837
|
}), yl = {
|
|
2827
|
-
[
|
|
2838
|
+
[H.VERTICAL]: {
|
|
2828
2839
|
withTooltip: !0,
|
|
2829
2840
|
xAxisOptions: {},
|
|
2830
2841
|
yAxisOptions: { gridLines: !0 },
|
|
2831
2842
|
margins: Ae.VERTICAL
|
|
2832
2843
|
},
|
|
2833
|
-
[
|
|
2844
|
+
[H.HORIZONTAL]: {
|
|
2834
2845
|
withTooltip: !0,
|
|
2835
2846
|
xAxisOptions: { gridLines: !0 },
|
|
2836
2847
|
yAxisOptions: { gridLines: !1 },
|
|
@@ -2844,7 +2855,7 @@ const pl = {
|
|
|
2844
2855
|
},
|
|
2845
2856
|
setup(e, { emit: n }) {
|
|
2846
2857
|
const t = e, { componentEventPropagator: o } = ye(), a = Te(re()), { orientation: u, options: l } = te(t), i = v(
|
|
2847
|
-
() => yl[u.value ||
|
|
2858
|
+
() => yl[u.value || H.VERTICAL]
|
|
2848
2859
|
// needs to be computed so that default options are reactive
|
|
2849
2860
|
), { allOptions: c } = fe(
|
|
2850
2861
|
l,
|
|
@@ -2856,27 +2867,27 @@ const pl = {
|
|
|
2856
2867
|
"data-j-grouped-bar-chart": ""
|
|
2857
2868
|
}, ae(d(o))), de({
|
|
2858
2869
|
groups: C((r) => [
|
|
2859
|
-
ie(d(
|
|
2870
|
+
ie(d(_t), j(r, { type: "grouped" }, ae(d(o))), null, 16)
|
|
2860
2871
|
]),
|
|
2861
2872
|
_: 2
|
|
2862
2873
|
}, [
|
|
2863
2874
|
W(d(a), (r, m) => ({
|
|
2864
2875
|
name: m,
|
|
2865
2876
|
fn: C((g) => [
|
|
2866
|
-
|
|
2877
|
+
S(s.$slots, m, pe(he(g || {})))
|
|
2867
2878
|
])
|
|
2868
2879
|
}))
|
|
2869
2880
|
]), 1040, ["options"]));
|
|
2870
2881
|
}
|
|
2871
2882
|
}), kl = {
|
|
2872
|
-
[
|
|
2883
|
+
[H.VERTICAL]: {
|
|
2873
2884
|
withTooltip: !0,
|
|
2874
2885
|
xAxisOptions: {},
|
|
2875
2886
|
yAxisOptions: { gridLines: !0 },
|
|
2876
2887
|
margins: Ae.VERTICAL,
|
|
2877
2888
|
tooltipOptions: { inverse: !0 }
|
|
2878
2889
|
},
|
|
2879
|
-
[
|
|
2890
|
+
[H.HORIZONTAL]: {
|
|
2880
2891
|
withTooltip: !0,
|
|
2881
2892
|
xAxisOptions: { gridLines: !0 },
|
|
2882
2893
|
yAxisOptions: { gridLines: !1 },
|
|
@@ -2890,7 +2901,7 @@ const pl = {
|
|
|
2890
2901
|
},
|
|
2891
2902
|
setup(e, { emit: n }) {
|
|
2892
2903
|
const t = e, { componentEventPropagator: o } = ye(), a = Te(re()), { data: u, orientation: l, options: i, labels: c } = te(t), s = v(
|
|
2893
|
-
() => kl[l.value ||
|
|
2904
|
+
() => kl[l.value || H.VERTICAL]
|
|
2894
2905
|
// needs to be computed so that default options are reactive
|
|
2895
2906
|
), { allOptions: f } = fe(
|
|
2896
2907
|
i,
|
|
@@ -2908,14 +2919,14 @@ const pl = {
|
|
|
2908
2919
|
"data-j-stacked-bar-chart": ""
|
|
2909
2920
|
}, ae(d(o))), de({
|
|
2910
2921
|
groups: C((x) => [
|
|
2911
|
-
ie(d(
|
|
2922
|
+
ie(d(_t), j(x, { type: "stacked" }, ae(d(o))), null, 16)
|
|
2912
2923
|
]),
|
|
2913
2924
|
_: 2
|
|
2914
2925
|
}, [
|
|
2915
2926
|
W(d(a), (x, N) => ({
|
|
2916
2927
|
name: N,
|
|
2917
2928
|
fn: C((D) => [
|
|
2918
|
-
|
|
2929
|
+
S(A.$slots, N, pe(he(D || {})))
|
|
2919
2930
|
])
|
|
2920
2931
|
}))
|
|
2921
2932
|
]), 1040, ["options", "x-scale", "y-scale"]));
|
|
@@ -2954,7 +2965,7 @@ const pl = {
|
|
|
2954
2965
|
},
|
|
2955
2966
|
emits: ["click"],
|
|
2956
2967
|
setup(e, { emit: n }) {
|
|
2957
|
-
const t = n, o =
|
|
2968
|
+
const t = n, o = R(null);
|
|
2958
2969
|
return _e(() => ze(o.value)), (a, u) => (y(), O("path", {
|
|
2959
2970
|
ref_key: "root",
|
|
2960
2971
|
ref: o,
|
|
@@ -2965,7 +2976,7 @@ const pl = {
|
|
|
2965
2976
|
}]),
|
|
2966
2977
|
d: e.pathDefinition,
|
|
2967
2978
|
"stroke-width": e.width,
|
|
2968
|
-
style:
|
|
2979
|
+
style: Vt({
|
|
2969
2980
|
animationDelay: e.transition && e.animationDelay + "s",
|
|
2970
2981
|
animationDuration: e.transition && e.animationDuration + "s"
|
|
2971
2982
|
}),
|
|
@@ -2994,7 +3005,7 @@ const Ll = /* @__PURE__ */ ee(Tl, [["__scopeId", "data-v-59449838"]]), $l = ["cx
|
|
|
2994
3005
|
},
|
|
2995
3006
|
emits: ["click"],
|
|
2996
3007
|
setup(e, { emit: n }) {
|
|
2997
|
-
const t = e, o = n, a =
|
|
3008
|
+
const t = e, o = n, a = R(null), u = v(() => t.radius / 2);
|
|
2998
3009
|
return _e(() => ze(a.value)), (l, i) => (y(), O("circle", {
|
|
2999
3010
|
ref_key: "root",
|
|
3000
3011
|
ref: a,
|
|
@@ -3045,7 +3056,7 @@ function ln(e) {
|
|
|
3045
3056
|
s.length,
|
|
3046
3057
|
s.indexOf(c)
|
|
3047
3058
|
),
|
|
3048
|
-
label:
|
|
3059
|
+
label: Ut
|
|
3049
3060
|
};
|
|
3050
3061
|
}
|
|
3051
3062
|
return i;
|
|
@@ -3073,7 +3084,7 @@ const Dl = {
|
|
|
3073
3084
|
key: 0,
|
|
3074
3085
|
class: "lume-line-group__points",
|
|
3075
3086
|
"data-j-lume-line-group__points": ""
|
|
3076
|
-
},
|
|
3087
|
+
}, Sl = 1, Ml = /* @__PURE__ */ Z({
|
|
3077
3088
|
__name: "lume-line-group",
|
|
3078
3089
|
props: {
|
|
3079
3090
|
...We(),
|
|
@@ -3098,7 +3109,7 @@ const Dl = {
|
|
|
3098
3109
|
i,
|
|
3099
3110
|
c
|
|
3100
3111
|
), r = v(() => {
|
|
3101
|
-
if (a.value.every((
|
|
3112
|
+
if (a.value.every((B) => B.isDashed))
|
|
3102
3113
|
return a.value;
|
|
3103
3114
|
const { computedLineData: w } = ln(a);
|
|
3104
3115
|
return u.value.withTooltip !== !1 && (s != null && s.value) && f(w.value), w.value;
|
|
@@ -3115,7 +3126,7 @@ const Dl = {
|
|
|
3115
3126
|
// Move to X index, Vertical line to the highest point
|
|
3116
3127
|
};
|
|
3117
3128
|
}), g = v(
|
|
3118
|
-
() => l.value &&
|
|
3129
|
+
() => l.value && Sl / (En(l.value) - 1)
|
|
3119
3130
|
// Subtracting the first line (read below)
|
|
3120
3131
|
), p = v(
|
|
3121
3132
|
() => {
|
|
@@ -3131,11 +3142,11 @@ const Dl = {
|
|
|
3131
3142
|
function h(w) {
|
|
3132
3143
|
return r.value[w].values;
|
|
3133
3144
|
}
|
|
3134
|
-
function x(w,
|
|
3145
|
+
function x(w, B) {
|
|
3135
3146
|
var K, Q;
|
|
3136
3147
|
const Y = w === 0 ? [] : [
|
|
3137
|
-
(K = h(
|
|
3138
|
-
(Q = h(
|
|
3148
|
+
(K = h(B)[w - 1]) == null ? void 0 : K.value,
|
|
3149
|
+
(Q = h(B)[w]) == null ? void 0 : Q.value
|
|
3139
3150
|
];
|
|
3140
3151
|
return Nl(
|
|
3141
3152
|
w,
|
|
@@ -3150,9 +3161,9 @@ const Dl = {
|
|
|
3150
3161
|
animationDuration: g.value
|
|
3151
3162
|
};
|
|
3152
3163
|
}
|
|
3153
|
-
function D(w,
|
|
3164
|
+
function D(w, B) {
|
|
3154
3165
|
var K;
|
|
3155
|
-
const Y = (K = h(
|
|
3166
|
+
const Y = (K = h(B)[w]) == null ? void 0 : K.value;
|
|
3156
3167
|
return {
|
|
3157
3168
|
x: ve(l.value) ? t.xScale($.value[w]) + b.value : t.xScale(w),
|
|
3158
3169
|
y: Y === null ? i.value(i.value.domain()[1]) : i.value(Y)
|
|
@@ -3161,8 +3172,8 @@ const Dl = {
|
|
|
3161
3172
|
function P(w) {
|
|
3162
3173
|
return t.hoveredIndex === w;
|
|
3163
3174
|
}
|
|
3164
|
-
return (w,
|
|
3165
|
-
|
|
3175
|
+
return (w, B) => (y(), O("g", Dl, [
|
|
3176
|
+
G("path", j(m.value, {
|
|
3166
3177
|
class: "lume-line-group__overlay-line",
|
|
3167
3178
|
"data-j-lume-line-group__overlay-line": ""
|
|
3168
3179
|
}), null, 16),
|
|
@@ -3170,7 +3181,7 @@ const Dl = {
|
|
|
3170
3181
|
key: Y.label,
|
|
3171
3182
|
class: "lume-line-group__group"
|
|
3172
3183
|
}, [
|
|
3173
|
-
|
|
3184
|
+
G("g", Hl, [
|
|
3174
3185
|
(y(!0), O(q, null, W(Y.values, (Q, F) => (y(), X(d(Ll), j(N(F), {
|
|
3175
3186
|
key: `line-${F}`,
|
|
3176
3187
|
color: Y.color,
|
|
@@ -3195,7 +3206,7 @@ const Dl = {
|
|
|
3195
3206
|
]));
|
|
3196
3207
|
}
|
|
3197
3208
|
});
|
|
3198
|
-
const un = /* @__PURE__ */ ee(
|
|
3209
|
+
const un = /* @__PURE__ */ ee(Ml, [["__scopeId", "data-v-23492507"]]), Rl = {
|
|
3199
3210
|
margins: Ae.VERTICAL,
|
|
3200
3211
|
startOnZero: !0,
|
|
3201
3212
|
withTooltip: !0,
|
|
@@ -3207,7 +3218,7 @@ const un = /* @__PURE__ */ ee(Gl, [["__scopeId", "data-v-23492507"]]), Sl = {
|
|
|
3207
3218
|
...Ee(null, !1)
|
|
3208
3219
|
},
|
|
3209
3220
|
setup(e, { emit: n }) {
|
|
3210
|
-
const t = e, { componentEventPropagator: o } = ye(), a = Te(re()), { options: u } = te(t), { allOptions: l } = fe(u,
|
|
3221
|
+
const t = e, { componentEventPropagator: o } = ye(), a = Te(re()), { options: u } = te(t), { allOptions: l } = fe(u, Rl);
|
|
3211
3222
|
return (i, c) => (y(), X(d(Ne), j({ ...t, ...i.$attrs }, {
|
|
3212
3223
|
"chart-type": "line",
|
|
3213
3224
|
options: d(l),
|
|
@@ -3221,13 +3232,13 @@ const un = /* @__PURE__ */ ee(Gl, [["__scopeId", "data-v-23492507"]]), Sl = {
|
|
|
3221
3232
|
W(d(a), (s, f) => ({
|
|
3222
3233
|
name: f,
|
|
3223
3234
|
fn: C((r) => [
|
|
3224
|
-
|
|
3235
|
+
S(i.$slots, f, pe(he(r || {})))
|
|
3225
3236
|
])
|
|
3226
3237
|
}))
|
|
3227
3238
|
]), 1040, ["options"]));
|
|
3228
3239
|
}
|
|
3229
3240
|
});
|
|
3230
|
-
function
|
|
3241
|
+
function Gl(e) {
|
|
3231
3242
|
return { areaPathDefinition: v(
|
|
3232
3243
|
() => function(t, o) {
|
|
3233
3244
|
if (!t || !o || ve(t) || ve(o))
|
|
@@ -3255,10 +3266,10 @@ const jl = {
|
|
|
3255
3266
|
__name: "lume-sparkline-chart",
|
|
3256
3267
|
props: {
|
|
3257
3268
|
...pt(null),
|
|
3258
|
-
...
|
|
3269
|
+
...Me()
|
|
3259
3270
|
},
|
|
3260
3271
|
setup(e, { expose: n, emit: t }) {
|
|
3261
|
-
const o = e, { componentEventPropagator: a } = ye(), u = Te(re()), { data: l, options: i } = te(o), { internalData: c } = ht(l), { allOptions: s } = fe(i, jl), { computedLineData: f } = ln(c), { areaPathDefinition: r } =
|
|
3272
|
+
const o = e, { componentEventPropagator: a } = ye(), u = Te(re()), { data: l, options: i } = te(o), { internalData: c } = ht(l), { allOptions: s } = fe(i, jl), { computedLineData: f } = ln(c), { areaPathDefinition: r } = Gl(f), m = v(() => {
|
|
3262
3273
|
var $, A;
|
|
3263
3274
|
return (A = ($ = c.value) == null ? void 0 : $[0]) == null ? void 0 : A.color;
|
|
3264
3275
|
}), g = v(
|
|
@@ -3275,7 +3286,7 @@ const jl = {
|
|
|
3275
3286
|
}
|
|
3276
3287
|
function b($, A, h) {
|
|
3277
3288
|
if ($.length)
|
|
3278
|
-
return
|
|
3289
|
+
return Se().range([0, h.width]).domain([0, $[0].values.length - 1]);
|
|
3279
3290
|
}
|
|
3280
3291
|
return n({
|
|
3281
3292
|
areaPathDefinition: r
|
|
@@ -3303,7 +3314,7 @@ const jl = {
|
|
|
3303
3314
|
W(d(u), (h, x) => ({
|
|
3304
3315
|
name: x,
|
|
3305
3316
|
fn: C((N) => [
|
|
3306
|
-
|
|
3317
|
+
S($.$slots, x, pe(he(N || {})), void 0, !0)
|
|
3307
3318
|
])
|
|
3308
3319
|
}))
|
|
3309
3320
|
]), 1040, ["options"]));
|
|
@@ -3320,13 +3331,13 @@ export {
|
|
|
3320
3331
|
xa as LumeAlluvialNodeHeader,
|
|
3321
3332
|
_a as LumeAlluvialNodeLabel,
|
|
3322
3333
|
ba as LumeAlluvialNodeValue,
|
|
3323
|
-
|
|
3334
|
+
$t as LumeAxis,
|
|
3324
3335
|
dt as LumeBar,
|
|
3325
3336
|
Ul as LumeBarChart,
|
|
3326
|
-
|
|
3337
|
+
_t as LumeBarGroup,
|
|
3327
3338
|
Ne as LumeChart,
|
|
3328
|
-
|
|
3329
|
-
|
|
3339
|
+
ko as LumeChartContainer,
|
|
3340
|
+
Dt as LumeChartLegend,
|
|
3330
3341
|
Yl as LumeGroupedBarChart,
|
|
3331
3342
|
Ll as LumeLine,
|
|
3332
3343
|
Jl as LumeLineChart,
|
|
@@ -3336,11 +3347,11 @@ export {
|
|
|
3336
3347
|
Xl as LumeSingleBarChart,
|
|
3337
3348
|
Ql as LumeSparklineChart,
|
|
3338
3349
|
Kl as LumeStackedBarChart,
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3350
|
+
Fo as LumeTooltip,
|
|
3351
|
+
Mo as LumeTooltipItem,
|
|
3352
|
+
No as LumeTooltipSummary,
|
|
3353
|
+
xo as LumeTooltipTitle,
|
|
3343
3354
|
mt as OtherColors,
|
|
3344
|
-
|
|
3355
|
+
en as SequentialColors
|
|
3345
3356
|
};
|
|
3346
3357
|
//# sourceMappingURL=index.js.map
|