@adyen/lume 1.11.1 → 1.11.3

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