vue-data-ui 3.4.2 → 3.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-CRe_nKB4.js → Arrow-BGVin3AS.js} +1 -1
- package/dist/{BaseDraggableDialog-CbuLbfrc.js → BaseDraggableDialog-ymf2sfB8.js} +2 -2
- package/dist/{BaseIcon-B5KaGWWC.js → BaseIcon-BmMbm4d0.js} +1 -1
- package/dist/{ColorPicker-BMztHpBp.js → ColorPicker-J5wOPCeB.js} +2 -2
- package/dist/{DataTable-DOx3zgih.js → DataTable-BT7VF2ua.js} +2 -2
- package/dist/{Legend-C8u37J42.js → Legend-G6GMcdAc.js} +2 -2
- package/dist/{NonSvgPenAndPaper-BcxfJ-r2.js → NonSvgPenAndPaper-C7TRn0_3.js} +3 -3
- package/dist/{PackageVersion-C6RwvG8P.js → PackageVersion-TgflyMpU.js} +1 -1
- package/dist/{PenAndPaper-Dj2diYr0.js → PenAndPaper-DSvu9dwa.js} +3 -3
- package/dist/{Shape-BhNvlGIN.js → Shape-CNXKB8O0.js} +1 -1
- package/dist/{Slicer-BHgEsIBU.js → Slicer-D2wm0coO.js} +2 -2
- package/dist/{SlicerPreview-Cobmb_1S.js → SlicerPreview-ij72TAs6.js} +2 -2
- package/dist/{SparkTooltip-CL3cNRQ_.js → SparkTooltip-BEewz-_Q.js} +1 -1
- package/dist/{Title-CFmv95In.js → Title-BWp-37K_.js} +1 -1
- package/dist/{Tooltip-Cs4v8OnI.js → Tooltip-68Yi_FFl.js} +1 -1
- package/dist/{UserOptions-C0YT60JN.js → UserOptions-1OZ3jcm6.js} +2 -2
- package/dist/components/arrow.js +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-icon.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/{dom-to-png-xQ7LXrxp.js → dom-to-png--BNgrTZV.js} +1 -1
- package/dist/{img-CFY3JivG.js → img-BecE5qXd.js} +1 -1
- package/dist/{lib-BcBZIm6u.js → lib-C_mNZmhD.js} +311 -303
- package/dist/{pdf-O34i6EQX.js → pdf-DuG5j3Wv.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{themes-Dw-dDudK.js → themes-AUNCOb2G.js} +5 -5
- package/dist/types/vue-data-ui.d.ts +16 -0
- package/dist/{useAutoSizeLabelsInsideViewbox-BHq4FD8x.js → useAutoSizeLabelsInsideViewbox-BhzfwQ_k.js} +1 -1
- package/dist/{useNestedProp-B7CiTRDS.js → useNestedProp-dJX_8vvZ.js} +14 -4
- package/dist/{usePrinter-C1GiglOH.js → usePrinter-DTzqpYKF.js} +2 -2
- package/dist/{vue-data-ui-CzLP2rN0.js → vue-data-ui-Cx68QDfQ.js} +64 -64
- package/dist/vue-data-ui.js +73 -73
- package/dist/{vue-ui-3d-bar-D0b-iURl.js → vue-ui-3d-bar-C777yFCa.js} +7 -7
- package/dist/{vue-ui-accordion-BKkTS12x.js → vue-ui-accordion-UpZ765hd.js} +3 -3
- package/dist/{vue-ui-age-pyramid-Bd9FocGT.js → vue-ui-age-pyramid-Dob7mIkZ.js} +7 -7
- package/dist/{vue-ui-annotator-DkSYrnwb.js → vue-ui-annotator--8upDtTs.js} +7 -7
- package/dist/{vue-ui-bullet-DjQMFX7b.js → vue-ui-bullet-K2J31pN0.js} +8 -8
- package/dist/{vue-ui-candlestick-C0B0r7Nv.js → vue-ui-candlestick-BYAtu5ns.js} +482 -459
- package/dist/{vue-ui-carousel-table-Csg8asJF.js → vue-ui-carousel-table-D4mU7lyU.js} +4 -4
- package/dist/{vue-ui-chestnut-Ffn8vxbh.js → vue-ui-chestnut-DCxYsgRF.js} +6 -6
- package/dist/{vue-ui-chord-kdRc-Q-q.js → vue-ui-chord-jzC9Ioet.js} +9 -9
- package/dist/{vue-ui-circle-pack-C0kAjLnX.js → vue-ui-circle-pack-y8KHilxj.js} +7 -7
- package/dist/{vue-ui-cursor-iuati4v1.js → vue-ui-cursor-BqWDtj2I.js} +2 -2
- package/dist/{vue-ui-dashboard-D6F9BaXG.js → vue-ui-dashboard-BbXfbRd0.js} +67 -67
- package/dist/{vue-ui-digits-eYxf3UFN.js → vue-ui-digits-Cdn6EcYe.js} +2 -2
- package/dist/{vue-ui-donut-BrfxHSjb.js → vue-ui-donut-DCMaXKHe.js} +9 -9
- package/dist/{vue-ui-donut-evolution-eTmI2x_r.js → vue-ui-donut-evolution-BUu-RAkz.js} +9 -9
- package/dist/{vue-ui-dumbbell-Cw9zO8Mn.js → vue-ui-dumbbell-BeH9PPMc.js} +8 -8
- package/dist/{vue-ui-flow-B0RDvOVg.js → vue-ui-flow-ITp7cFEx.js} +8 -8
- package/dist/{vue-ui-funnel-Dsr0GCoj.js → vue-ui-funnel-DMyu3e5n.js} +7 -7
- package/dist/{vue-ui-galaxy-pZn1NOt3.js → vue-ui-galaxy-BGMtscCZ.js} +8 -8
- package/dist/{vue-ui-gauge-BjLEfS3a.js → vue-ui-gauge-DmRrw6oc.js} +8 -8
- package/dist/{vue-ui-gizmo-CxJXz4nC.js → vue-ui-gizmo-BhyYpiEW.js} +3 -3
- package/dist/{vue-ui-heatmap-DZe-8jxm.js → vue-ui-heatmap-DBDUKIjw.js} +8 -8
- package/dist/{vue-ui-history-plot-mKwh56x-.js → vue-ui-history-plot-CBhE_gIp.js} +8 -8
- package/dist/{vue-ui-kpi-N8s0i48S.js → vue-ui-kpi-CVpJH51G.js} +3 -3
- package/dist/{vue-ui-mini-loader-Db-9iQcC.js → vue-ui-mini-loader-b4D0tPsD.js} +2 -2
- package/dist/{vue-ui-molecule-NSKEl9DU.js → vue-ui-molecule-D1TlMhn-.js} +6 -6
- package/dist/{vue-ui-mood-radar-D0P9U7A2.js → vue-ui-mood-radar-CUYY-Szv.js} +8 -8
- package/dist/{vue-ui-nested-donuts-CsoawOMw.js → vue-ui-nested-donuts-D2Po_PPW.js} +8 -8
- package/dist/{vue-ui-onion-CB81rQHr.js → vue-ui-onion-CfzTGHTz.js} +9 -9
- package/dist/{vue-ui-parallel-coordinate-plot-Bfqdsh29.js → vue-ui-parallel-coordinate-plot-Ci8_8l5O.js} +9 -9
- package/dist/{vue-ui-quadrant-B6S8er0z.js → vue-ui-quadrant-BO_6zkWH.js} +9 -9
- package/dist/{vue-ui-quick-chart-BEJz4IrK.js → vue-ui-quick-chart-BGsUTlN6.js} +7 -7
- package/dist/{vue-ui-radar-CfVWwJ9O.js → vue-ui-radar-Cb4NhTp9.js} +9 -9
- package/dist/{vue-ui-rating-fR2WRHYO.js → vue-ui-rating-CvJlfRvs.js} +2 -2
- package/dist/{vue-ui-relation-circle-CDrFFs7x.js → vue-ui-relation-circle-gKV4FDiD.js} +8 -8
- package/dist/{vue-ui-ridgeline-HctkhJNL.js → vue-ui-ridgeline-B5Z_H1U_.js} +9 -9
- package/dist/{vue-ui-rings-DNdvT73I.js → vue-ui-rings-DXYT08cN.js} +9 -9
- package/dist/{vue-ui-scatter-tqqXVlml.js → vue-ui-scatter-B_e_aVVt.js} +125 -116
- package/dist/{vue-ui-skeleton-CIFKbc2Z.js → vue-ui-skeleton-oFjhyDNo.js} +3 -3
- package/dist/{vue-ui-smiley-BKXuAviQ.js → vue-ui-smiley-D3k4b6h1.js} +2 -2
- package/dist/{vue-ui-spark-trend-ClzBuy9g.js → vue-ui-spark-trend-CAMWrCuF.js} +4 -4
- package/dist/{vue-ui-sparkbar-DOC0sinb.js → vue-ui-sparkbar-VN-3rFCT.js} +4 -4
- package/dist/{vue-ui-sparkgauge-CtRGuXYE.js → vue-ui-sparkgauge-B1QNNxyJ.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-CH5SQ49i.js → vue-ui-sparkhistogram-Cb7ACr7x.js} +5 -5
- package/dist/{vue-ui-sparkline-C1ANB_RH.js → vue-ui-sparkline-DA40psbw.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-DJZvIWb3.js → vue-ui-sparkstackbar-CJ_L5xwe.js} +4 -4
- package/dist/{vue-ui-stackbar-DzT3xjPg.js → vue-ui-stackbar-CJgS4kt9.js} +56 -51
- package/dist/{vue-ui-strip-plot-DdgSGxqd.js → vue-ui-strip-plot-DQ8uM3vL.js} +8 -8
- package/dist/{vue-ui-table-DpSVU3nR.js → vue-ui-table-DXJzV47E.js} +5 -5
- package/dist/{vue-ui-table-heatmap-DU6GKPVy.js → vue-ui-table-heatmap-zbRs5HKh.js} +6 -6
- package/dist/{vue-ui-table-sparkline-DNiqSZPO.js → vue-ui-table-sparkline-DCll7_tQ.js} +5 -5
- package/dist/{vue-ui-thermometer-BEg7V1Pf.js → vue-ui-thermometer-BamrnCX9.js} +8 -8
- package/dist/{vue-ui-timer-GYpb3XQc.js → vue-ui-timer-ClzIo0W7.js} +5 -5
- package/dist/{vue-ui-tiremarks-vkoU5KYk.js → vue-ui-tiremarks-zcoGGB82.js} +7 -7
- package/dist/vue-ui-treemap-B-Jt_hzH.js +1289 -0
- package/dist/{vue-ui-vertical-bar-CFCfwBWt.js → vue-ui-vertical-bar-B5lTNJP2.js} +10 -10
- package/dist/{vue-ui-waffle-yn1j310A.js → vue-ui-waffle-CLN7Vhv2.js} +9 -9
- package/dist/{vue-ui-wheel-0aFR982b.js → vue-ui-wheel-Cc7zjB8c.js} +7 -7
- package/dist/{vue-ui-word-cloud-CkV8cGp6.js → vue-ui-word-cloud-BW8UT3gD.js} +165 -154
- package/dist/{vue-ui-world-DD5SbHCe.js → vue-ui-world-BKaac8Ew.js} +6 -6
- package/dist/{vue-ui-xy-BJiDW7Os.js → vue-ui-xy-DXMbNkHe.js} +845 -839
- package/dist/{vue-ui-xy-canvas-Dct7tf8w.js → vue-ui-xy-canvas-Dm-LZ-LP.js} +11 -11
- package/package.json +1 -1
- package/dist/vue-ui-treemap-Bikx-ODr.js +0 -1131
|
@@ -0,0 +1,1289 @@
|
|
|
1
|
+
import { defineAsyncComponent as ge, useSlots as Hl, onMounted as Qt, computed as y, ref as b, shallowRef as J, toRefs as El, watch as Ue, onBeforeUnmount as Wl, createElementBlock as w, openBlock as h, unref as p, normalizeStyle as ue, normalizeClass as yt, createBlock as re, createCommentVNode as M, createElementVNode as R, createVNode as Ge, createSlots as el, withCtx as A, renderSlot as S, normalizeProps as me, guardReactiveProps as ye, Fragment as Xe, renderList as bt, withKeys as tl, withModifiers as wt, mergeProps as kt, createTextVNode as qe, toDisplayString as Ye, Teleport as Ul, resolveDynamicComponent as Gl, nextTick as Xl } from "vue";
|
|
2
|
+
import { c as je, t as ql, b as Yl, p as L, e as jl, o as ll, f as Zl, h as Le, a as Ze, d as De, X as Ct, S as ol, J as al, G as nl, P as Kl, Q as Jl, H as Ql, ap as $t, aq as Ke } from "./lib-C_mNZmhD.js";
|
|
3
|
+
import { t as eo, u as to } from "./useResponsive-DfdjqQps.js";
|
|
4
|
+
import { u as lo, a as sl } from "./useNestedProp-dJX_8vvZ.js";
|
|
5
|
+
import { u as oo, B as ao } from "./BaseScanner-BgWxam9d.js";
|
|
6
|
+
import { u as no } from "./usePrinter-DTzqpYKF.js";
|
|
7
|
+
import { u as so } from "./useUserOptionState-BIvW1Kz7.js";
|
|
8
|
+
import { u as uo } from "./useChartAccessibility-9icAAmYg.js";
|
|
9
|
+
import ro from "./img-BecE5qXd.js";
|
|
10
|
+
import io from "./Title-BWp-37K_.js";
|
|
11
|
+
import { t as co } from "./themes-AUNCOb2G.js";
|
|
12
|
+
import vo from "./Legend-G6GMcdAc.js";
|
|
13
|
+
import ul from "./BaseIcon-BmMbm4d0.js";
|
|
14
|
+
import { u as ho } from "./useSvgExport-DrjCWun4.js";
|
|
15
|
+
import { _ as fo } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
|
+
function rl(n, i) {
|
|
17
|
+
const u = n.length;
|
|
18
|
+
if (u === 0)
|
|
19
|
+
throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);
|
|
20
|
+
{
|
|
21
|
+
let c = 1 / 0, r = -1 / 0, f = 0;
|
|
22
|
+
for (let m = 0; m < u; m += 1) {
|
|
23
|
+
const g = n[m].normalizedValue;
|
|
24
|
+
g < c && (c = g), g > r && (r = g), f += g;
|
|
25
|
+
}
|
|
26
|
+
return Math.max(
|
|
27
|
+
i ** 2 * r / f ** 2,
|
|
28
|
+
f ** 2 / (i ** 2 * c)
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function il(n) {
|
|
33
|
+
const { xOffset: i, yOffset: u, width: c, height: r } = n;
|
|
34
|
+
return {
|
|
35
|
+
x0: i,
|
|
36
|
+
y0: u,
|
|
37
|
+
x1: i + c,
|
|
38
|
+
y1: u + r
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function po(n, i, u) {
|
|
42
|
+
if (n.length === 0)
|
|
43
|
+
return !0;
|
|
44
|
+
{
|
|
45
|
+
const c = n.concat(i), r = rl(
|
|
46
|
+
n,
|
|
47
|
+
u
|
|
48
|
+
), f = rl(c, u);
|
|
49
|
+
return r >= f;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function go(n) {
|
|
53
|
+
const i = [], u = n.length;
|
|
54
|
+
for (let c = 0; c < u; c += 1) {
|
|
55
|
+
const r = n[c], f = r.length;
|
|
56
|
+
for (let d = 0; d < f; d += 1)
|
|
57
|
+
i.push(r[d]);
|
|
58
|
+
}
|
|
59
|
+
return i;
|
|
60
|
+
}
|
|
61
|
+
function mo(n, i) {
|
|
62
|
+
const u = {
|
|
63
|
+
...i,
|
|
64
|
+
children: n
|
|
65
|
+
};
|
|
66
|
+
return vl(u);
|
|
67
|
+
}
|
|
68
|
+
function yo(n) {
|
|
69
|
+
return (n.x1 - n.x0) * (n.y1 - n.y0);
|
|
70
|
+
}
|
|
71
|
+
function cl(n, i) {
|
|
72
|
+
const { width: u, height: c, xOffset: r, yOffset: f } = xt(i), d = n.length, m = n.map((x) => x.normalizedValue || 0).reduce((x, D) => x + D, 0), g = m / c, Q = m / u;
|
|
73
|
+
let E = r, $ = f;
|
|
74
|
+
const _ = [];
|
|
75
|
+
if (u >= c) {
|
|
76
|
+
for (let x = 0; x < d; x += 1) {
|
|
77
|
+
const D = n[x], q = $ + D.normalizedValue / g, I = {
|
|
78
|
+
x0: E,
|
|
79
|
+
y0: $,
|
|
80
|
+
x1: E + g,
|
|
81
|
+
y1: q
|
|
82
|
+
}, P = Object.assign({}, D, I);
|
|
83
|
+
$ = q, _.push(P);
|
|
84
|
+
}
|
|
85
|
+
return _;
|
|
86
|
+
} else {
|
|
87
|
+
for (let x = 0; x < d; x += 1) {
|
|
88
|
+
const D = n[x], q = E + D.normalizedValue / Q, I = {
|
|
89
|
+
x0: E,
|
|
90
|
+
y0: $,
|
|
91
|
+
x1: q,
|
|
92
|
+
y1: $ + Q
|
|
93
|
+
}, P = Object.assign({}, D, I);
|
|
94
|
+
E = q, _.push(P);
|
|
95
|
+
}
|
|
96
|
+
return _;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function bo(n) {
|
|
100
|
+
const i = xt(n), u = i.width, c = i.height;
|
|
101
|
+
return Math.min(u, c);
|
|
102
|
+
}
|
|
103
|
+
function wo(n, i) {
|
|
104
|
+
const u = n.length, c = n.map((g) => g.value ?? 0).reduce((g, Q) => g + Q, 0), r = i / c, f = [];
|
|
105
|
+
let d, m;
|
|
106
|
+
for (let g = 0; g < u; g += 1)
|
|
107
|
+
m = n[g], d = Object.assign({}, m, {
|
|
108
|
+
normalizedValue: m.value * (r || 0)
|
|
109
|
+
}), f.push(d);
|
|
110
|
+
return f;
|
|
111
|
+
}
|
|
112
|
+
function xt(n) {
|
|
113
|
+
const { x0: i, y0: u, x1: c, y1: r } = n;
|
|
114
|
+
return {
|
|
115
|
+
xOffset: i,
|
|
116
|
+
yOffset: u,
|
|
117
|
+
width: c - i,
|
|
118
|
+
height: r - u
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function ko(n, i, u, c) {
|
|
122
|
+
let r = n, f = i, d = u, m = c;
|
|
123
|
+
for (; ; ) {
|
|
124
|
+
const g = r.length;
|
|
125
|
+
if (g === 0) {
|
|
126
|
+
const _ = cl(f, d);
|
|
127
|
+
return m.concat(_);
|
|
128
|
+
}
|
|
129
|
+
const Q = bo(d), E = r[0], $ = r.slice(1, g);
|
|
130
|
+
if (po(f, E, Q)) {
|
|
131
|
+
const _ = f.concat(E);
|
|
132
|
+
r = $, f = _, d = d, m = m;
|
|
133
|
+
} else {
|
|
134
|
+
const _ = f.length;
|
|
135
|
+
let x = 0;
|
|
136
|
+
for (let P = 0; P < _; P += 1)
|
|
137
|
+
x += f[P].normalizedValue;
|
|
138
|
+
const D = Co(d, x), q = cl(f, d), I = m.concat(q);
|
|
139
|
+
r = r, f = [], d = D, m = I;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function vl(n) {
|
|
144
|
+
if (typeof n.children > "u" || !n.children.length)
|
|
145
|
+
return [n];
|
|
146
|
+
{
|
|
147
|
+
const i = wo(
|
|
148
|
+
n.children,
|
|
149
|
+
yo(n)
|
|
150
|
+
), u = ko(i, [], n, []), c = u.length, r = [];
|
|
151
|
+
for (let d = 0; d < c; d += 1)
|
|
152
|
+
r.push(vl(u[d]));
|
|
153
|
+
return go(r);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function Co(n, i) {
|
|
157
|
+
const { width: u, height: c, xOffset: r, yOffset: f } = xt(n);
|
|
158
|
+
if (u >= c) {
|
|
159
|
+
const d = i / c, m = u - d, g = {
|
|
160
|
+
xOffset: r + d,
|
|
161
|
+
yOffset: f,
|
|
162
|
+
width: m,
|
|
163
|
+
height: c
|
|
164
|
+
};
|
|
165
|
+
return il(g);
|
|
166
|
+
} else {
|
|
167
|
+
const d = i / u, m = c - d, g = {
|
|
168
|
+
xOffset: r,
|
|
169
|
+
yOffset: f + d,
|
|
170
|
+
width: u,
|
|
171
|
+
height: m
|
|
172
|
+
};
|
|
173
|
+
return il(g);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const $o = ["id"], xo = ["id"], To = ["tabindex", "onClick", "onKeydown", "data-last-crumb", "onMouseenter", "onFocus"], So = { class: "vue-ui-treemap-crumb-unit" }, _o = { class: "vue-ui-treemap-crumb-unit-label" }, Oo = {
|
|
177
|
+
key: 0,
|
|
178
|
+
style: { width: "24px", display: "flex", "align-items": "center" }
|
|
179
|
+
}, Ao = {
|
|
180
|
+
key: 0,
|
|
181
|
+
class: "vue-ui-treemap-crumb-unit-arrow"
|
|
182
|
+
}, Fo = ["xmlns", "viewBox"], Mo = { key: 0 }, Io = ["id"], No = ["stop-color"], Lo = ["stop-color"], Do = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width", "onClick", "onMouseenter", "onMouseleave"], zo = ["innerHTML"], Ro = ["x", "y", "height", "width"], Po = {
|
|
183
|
+
key: 5,
|
|
184
|
+
class: "vue-data-ui-watermark"
|
|
185
|
+
}, Bo = ["id"], Vo = ["onClick"], Ho = ["innerHTML"], Eo = {
|
|
186
|
+
__name: "vue-ui-treemap",
|
|
187
|
+
props: {
|
|
188
|
+
config: {
|
|
189
|
+
type: Object,
|
|
190
|
+
default() {
|
|
191
|
+
return {};
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
dataset: {
|
|
195
|
+
type: Array,
|
|
196
|
+
default() {
|
|
197
|
+
return [];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
emits: ["selectLegend", "selectDatapoint"],
|
|
202
|
+
setup(n, { expose: i, emit: u }) {
|
|
203
|
+
const c = ge(() => import("./DataTable-BT7VF2ua.js")), r = ge(() => import("./PenAndPaper-DSvu9dwa.js")), f = ge(() => import("./vue-ui-accordion-UpZ765hd.js")), d = ge(() => import("./Tooltip-68Yi_FFl.js")), m = ge(() => import("./UserOptions-1OZ3jcm6.js")), g = ge(() => import("./PackageVersion-TgflyMpU.js")), Q = ge(() => import("./BaseDraggableDialog-ymf2sfB8.js")), { vue_ui_treemap: E } = lo(), $ = n, _ = u, x = Hl();
|
|
204
|
+
Qt(() => {
|
|
205
|
+
x["chart-background"] && console.warn("VueUiTreemap does not support the #chart-background slot.");
|
|
206
|
+
});
|
|
207
|
+
const D = y(() => !!$.dataset && $.dataset.length), q = y(() => /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), I = b(je()), P = b(!1), Je = b(""), ie = b(!1), Tt = b(0), W = b([]), U = J(null), St = J(null), _t = J(null), Ot = J(null), At = J(null), Ft = b(0), Qe = b(0), et = b(0), F = b([]), tt = b(null), Mt = b(!1), Ae = b(null), lt = b(null), t = b(st()), { loading: be, FINAL_DATASET: ot, manualLoading: dl } = oo({
|
|
208
|
+
...El($),
|
|
209
|
+
FINAL_CONFIG: t,
|
|
210
|
+
prepareConfig: st,
|
|
211
|
+
skeletonDataset: [
|
|
212
|
+
{
|
|
213
|
+
name: "_",
|
|
214
|
+
value: 53,
|
|
215
|
+
color: "#CACACA90",
|
|
216
|
+
children: [
|
|
217
|
+
{ name: "_", value: 21 },
|
|
218
|
+
{ name: "_", value: 13 },
|
|
219
|
+
{ name: "_", value: 8 },
|
|
220
|
+
{ name: "_", value: 5 },
|
|
221
|
+
{ name: "_", value: 3 },
|
|
222
|
+
{ name: "_", value: 2 },
|
|
223
|
+
{ name: "_", value: 1 }
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
],
|
|
227
|
+
skeletonConfig: ql({
|
|
228
|
+
defaultConfig: t.value,
|
|
229
|
+
userConfig: {
|
|
230
|
+
userOptions: { show: !1 },
|
|
231
|
+
style: {
|
|
232
|
+
chart: {
|
|
233
|
+
backgroundColor: "#999999",
|
|
234
|
+
layout: {
|
|
235
|
+
labels: {
|
|
236
|
+
showDefaultLabels: !1
|
|
237
|
+
},
|
|
238
|
+
rects: {
|
|
239
|
+
stroke: "#6A6A6A"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
legend: {
|
|
243
|
+
backgroundColor: "transparent"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
}), { userOptionsVisible: at, setUserOptionsVisibility: It, keepUserOptionState: Nt } = so({ config: t.value }), { svgRef: nt } = uo({ config: t.value.style.chart.title });
|
|
250
|
+
function st() {
|
|
251
|
+
const e = sl({
|
|
252
|
+
userConfig: $.config,
|
|
253
|
+
defaultConfig: E
|
|
254
|
+
});
|
|
255
|
+
return e.theme ? {
|
|
256
|
+
...sl({
|
|
257
|
+
userConfig: co.vue_ui_treemap[e.theme] || $.config,
|
|
258
|
+
defaultConfig: e
|
|
259
|
+
}),
|
|
260
|
+
customPalette: Yl[e.theme] || L
|
|
261
|
+
} : e;
|
|
262
|
+
}
|
|
263
|
+
Ue(() => $.config, (e) => {
|
|
264
|
+
be.value || (t.value = st()), at.value = !t.value.userOptions.showOnChartHover, Ft.value += 1, Qe.value += 1, et.value += 1, z.value.showTable = t.value.table.show, z.value.showTooltip = t.value.style.chart.tooltip.show;
|
|
265
|
+
}, { deep: !0 });
|
|
266
|
+
const { isPrinting: Lt, isImaging: Dt, generatePdf: zt, generateImage: Rt } = no({
|
|
267
|
+
elementId: `treemap_${I.value}`,
|
|
268
|
+
fileName: t.value.style.chart.title.text || "vue-ui-treemap",
|
|
269
|
+
options: t.value.userOptions.print
|
|
270
|
+
}), hl = y(() => t.value.userOptions.show && !t.value.style.chart.title.text), ze = y(() => jl(t.value.customPalette)), z = b({
|
|
271
|
+
showTable: t.value.table.show,
|
|
272
|
+
showTooltip: t.value.style.chart.tooltip.show
|
|
273
|
+
});
|
|
274
|
+
Ue(t, () => {
|
|
275
|
+
z.value = {
|
|
276
|
+
showTable: t.value.table.show,
|
|
277
|
+
showTooltip: t.value.style.chart.tooltip.show
|
|
278
|
+
};
|
|
279
|
+
}, { immediate: !0 });
|
|
280
|
+
const Fe = b({
|
|
281
|
+
height: t.value.style.chart.height,
|
|
282
|
+
width: t.value.style.chart.width
|
|
283
|
+
});
|
|
284
|
+
function fl(e) {
|
|
285
|
+
const o = U.value, l = Fe.value.height;
|
|
286
|
+
if (!o || !l) return e;
|
|
287
|
+
const a = o.getBoundingClientRect();
|
|
288
|
+
return e * (l / a.height);
|
|
289
|
+
}
|
|
290
|
+
function pl() {
|
|
291
|
+
if (!tt.value || Y.value.length <= 1) return 0;
|
|
292
|
+
const e = tt.value, o = getComputedStyle(e), l = e.offsetHeight + parseFloat(o.marginTop || "0") + parseFloat(o.marginBottom || "0") + parseFloat(o.paddingTop || "0") + parseFloat(o.paddingBottom || "0");
|
|
293
|
+
return fl(l);
|
|
294
|
+
}
|
|
295
|
+
const B = y(() => {
|
|
296
|
+
const e = t.value.style.chart.padding, o = Fe.value.width, l = Fe.value.height, a = pl(), s = e.left, v = o - e.right, k = e.top, N = l - e.bottom - a;
|
|
297
|
+
return {
|
|
298
|
+
left: s,
|
|
299
|
+
top: k,
|
|
300
|
+
right: v,
|
|
301
|
+
bottom: N,
|
|
302
|
+
width: v - s,
|
|
303
|
+
height: Math.max(0, N - k),
|
|
304
|
+
vbWidth: o,
|
|
305
|
+
vbHeight: l - a,
|
|
306
|
+
offsetY: a
|
|
307
|
+
};
|
|
308
|
+
}), V = b(ot.value), ee = b(V.value), Pt = J(/* @__PURE__ */ new Map());
|
|
309
|
+
function Bt(e) {
|
|
310
|
+
Array.isArray(e) && e.forEach((o, l) => {
|
|
311
|
+
o.id || (o.id = je());
|
|
312
|
+
let a = Le(o.color) || Pt.value.get(o.id) || ze.value[l] || L[l] || L[l % L.length];
|
|
313
|
+
a = Le(a), Pt.value.set(o.id, a), o.color = a, Vt(o, a);
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function Vt(e, o) {
|
|
317
|
+
Array.isArray(e.children) && e.children.forEach((l) => {
|
|
318
|
+
l.id || (l.id = je()), l.parentId = e.id, l.color = o, Vt(l, o);
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
function gl() {
|
|
322
|
+
if (!F.value.length)
|
|
323
|
+
ee.value = V.value.slice();
|
|
324
|
+
else {
|
|
325
|
+
const e = F.value[F.value.length - 1], o = le(e);
|
|
326
|
+
ee.value = o?.children?.slice() || [];
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
Ue(
|
|
330
|
+
() => ot.value,
|
|
331
|
+
() => {
|
|
332
|
+
V.value = ot.value, Bt(V.value), gl(), et.value += 1, Qe.value += 1;
|
|
333
|
+
},
|
|
334
|
+
{ deep: !0, immediate: !0, flush: "post" }
|
|
335
|
+
);
|
|
336
|
+
const te = J(null), we = J(null);
|
|
337
|
+
Qt(() => {
|
|
338
|
+
Mt.value = !0, yl();
|
|
339
|
+
});
|
|
340
|
+
const ml = y(() => t.value.debug);
|
|
341
|
+
function yl() {
|
|
342
|
+
if (ll($.dataset) && Zl({
|
|
343
|
+
componentName: "VueUiTreemap",
|
|
344
|
+
type: "dataset",
|
|
345
|
+
debug: ml.value
|
|
346
|
+
}), Bt(V.value), ll($.dataset) || (dl.value = t.value.loading), t.value.responsive) {
|
|
347
|
+
const e = eo(() => {
|
|
348
|
+
const { width: o, height: l } = to({
|
|
349
|
+
chart: U.value,
|
|
350
|
+
title: t.value.style.chart.title.text ? St.value : null,
|
|
351
|
+
legend: t.value.style.chart.legend.show ? _t.value : null,
|
|
352
|
+
source: Ot.value,
|
|
353
|
+
noTitle: At.value
|
|
354
|
+
});
|
|
355
|
+
requestAnimationFrame(() => {
|
|
356
|
+
Fe.value.width = o, Fe.value.height = l - 12;
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
te.value && (we.value && te.value.unobserve(we.value), te.value.disconnect()), te.value = new ResizeObserver(e), we.value = U.value.parentNode, te.value.observe(we.value);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
Wl(() => {
|
|
363
|
+
te.value && (we.value && te.value.unobserve(we.value), te.value.disconnect());
|
|
364
|
+
});
|
|
365
|
+
const Me = y(() => ee.value.map((e, o) => ({
|
|
366
|
+
...e,
|
|
367
|
+
color: Le(e.color) || ze.value[o] || L[o] || L[o % L.length]
|
|
368
|
+
})).filter((e) => !W.value.includes(e.id))), ke = y(() => V.value.filter((e) => !W.value.includes(e.id)).map((e) => e.value || 0).reduce((e, o) => e + o, 0)), ut = y({
|
|
369
|
+
get() {
|
|
370
|
+
let e = [...Me.value];
|
|
371
|
+
return t.value.style.chart.layout.sorted && (e = [...Me.value].sort((o, l) => l.value - o.value)), e.map((o) => ({
|
|
372
|
+
...o
|
|
373
|
+
}));
|
|
374
|
+
},
|
|
375
|
+
set(e) {
|
|
376
|
+
return e;
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
function Ht(e, o) {
|
|
380
|
+
return e.value / o;
|
|
381
|
+
}
|
|
382
|
+
function bl(e, o, l) {
|
|
383
|
+
const a = t.value.style.chart.layout.rects.colorRatio - Ht(o, l);
|
|
384
|
+
return ol(e, a < 0 ? 0 : a);
|
|
385
|
+
}
|
|
386
|
+
function Et(e, o, l, a) {
|
|
387
|
+
return e.map((s, v) => {
|
|
388
|
+
const k = bl(Le(o) || ze.value[v] || L[v] || L[v % L.length], s, a), N = Ht(s, a);
|
|
389
|
+
return {
|
|
390
|
+
...s,
|
|
391
|
+
color: k,
|
|
392
|
+
proportion: N,
|
|
393
|
+
parentName: l,
|
|
394
|
+
children: s.children ? Et(s.children, k, s.name, a) : void 0
|
|
395
|
+
};
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
const Ie = y(() => {
|
|
399
|
+
const e = ut.value.map((o) => Number(o.value) || 0).reduce((o, l) => o + l, 0) || 1;
|
|
400
|
+
return mo(
|
|
401
|
+
ut.value.map((o) => {
|
|
402
|
+
const l = o.children ? o.children.reduce((a, s) => a + (Number(s.value) || 0), 0) : o.value;
|
|
403
|
+
return {
|
|
404
|
+
value: o.value,
|
|
405
|
+
id: o.id || je(),
|
|
406
|
+
proportion: (Number(o.value) || 0) / e,
|
|
407
|
+
children: o.children ? Et(
|
|
408
|
+
o.children.sort((a, s) => (s.value || 0) - (a.value || 0)),
|
|
409
|
+
o.color,
|
|
410
|
+
o.name,
|
|
411
|
+
l || 1
|
|
412
|
+
) : void 0,
|
|
413
|
+
color: o.color,
|
|
414
|
+
name: o.name
|
|
415
|
+
};
|
|
416
|
+
}),
|
|
417
|
+
{
|
|
418
|
+
x0: B.value.left,
|
|
419
|
+
y0: B.value.top,
|
|
420
|
+
x1: B.value.left + B.value.width,
|
|
421
|
+
y1: B.value.top + B.value.height
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
});
|
|
425
|
+
function Ce({ y0: e, y1: o }) {
|
|
426
|
+
return o - e <= 0 ? 1e-4 : o - e;
|
|
427
|
+
}
|
|
428
|
+
function $e({ x0: e, x1: o }) {
|
|
429
|
+
return o - e <= 0 ? 1e-4 : o - e;
|
|
430
|
+
}
|
|
431
|
+
function xe(e) {
|
|
432
|
+
const o = t.value.style.chart.layout.labels;
|
|
433
|
+
console.log(o);
|
|
434
|
+
const l = o.fontSize, a = o.minFontSize, s = o.fontSize * 2, v = 0.5, k = 0.6, N = 1, ce = 0.9;
|
|
435
|
+
let oe = e.proportion;
|
|
436
|
+
if (!(typeof oe == "number" && isFinite(oe))) {
|
|
437
|
+
const Ee = Math.max(1e-6, $e(e) * Ce(e)), ve = Math.max(1e-6, B.value.width * B.value.height);
|
|
438
|
+
oe = Ee / ve;
|
|
439
|
+
}
|
|
440
|
+
const He = Math.pow(Math.min(1, Math.max(0, oe)), v), ae = k + (N - k) * He;
|
|
441
|
+
let ne = l * ae;
|
|
442
|
+
const dt = Math.max(1e-4, Math.min($e(e), Ce(e)));
|
|
443
|
+
return ne = Math.min(ne, dt * ce), ne = Math.max(a, Math.min(s, ne)), ne;
|
|
444
|
+
}
|
|
445
|
+
function Wt(e) {
|
|
446
|
+
ie.value = e, Tt.value += 1;
|
|
447
|
+
}
|
|
448
|
+
const Te = y(() => ({
|
|
449
|
+
startX: 0,
|
|
450
|
+
startY: 0,
|
|
451
|
+
width: B.value.vbWidth,
|
|
452
|
+
height: B.value.vbHeight
|
|
453
|
+
}));
|
|
454
|
+
function le(e, o = V.value) {
|
|
455
|
+
for (const l of o) {
|
|
456
|
+
if (l.id === e)
|
|
457
|
+
return l;
|
|
458
|
+
if (l.children) {
|
|
459
|
+
const a = le(e, l.children);
|
|
460
|
+
if (a)
|
|
461
|
+
return a;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return null;
|
|
465
|
+
}
|
|
466
|
+
const Se = y(() => F.value.length > 0);
|
|
467
|
+
function Re(e, o) {
|
|
468
|
+
if (!e) {
|
|
469
|
+
ee.value = V.value.slice(), _("selectDatapoint", void 0), F.value = [];
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
t.value.events.datapointClick && t.value.events.datapointClick({ datapoint: e, seriesIndex: o });
|
|
473
|
+
const l = le(e.id);
|
|
474
|
+
if (l && l.children?.length)
|
|
475
|
+
F.value.push(l.id), ee.value = l.children.slice(), _("selectDatapoint", e);
|
|
476
|
+
else if (e.parentId) {
|
|
477
|
+
F.value.push(e.parentId);
|
|
478
|
+
const a = le(e.parentId);
|
|
479
|
+
ee.value = a.children.slice(), _("selectDatapoint", e);
|
|
480
|
+
} else if (F.value.length > 0) {
|
|
481
|
+
F.value.pop();
|
|
482
|
+
const a = F.value[F.value.length - 1];
|
|
483
|
+
if (a) {
|
|
484
|
+
const s = le(a);
|
|
485
|
+
ee.value = s.children.slice();
|
|
486
|
+
} else
|
|
487
|
+
ee.value = V.value.slice(), F.value = [], _("selectDatapoint", void 0);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
function wl(e) {
|
|
491
|
+
return !!(le(e.id)?.children?.length || e.parentId);
|
|
492
|
+
}
|
|
493
|
+
const Y = y(() => {
|
|
494
|
+
const e = [
|
|
495
|
+
{ id: null, label: "All" }
|
|
496
|
+
];
|
|
497
|
+
if (F.value.length > 0) {
|
|
498
|
+
let o = le(F.value[F.value.length - 1]);
|
|
499
|
+
const l = [];
|
|
500
|
+
for (; o; )
|
|
501
|
+
l.unshift(o), o = o.parentId ? le(o.parentId) : null;
|
|
502
|
+
for (const a of l)
|
|
503
|
+
e.push({
|
|
504
|
+
id: a.id,
|
|
505
|
+
label: a.name,
|
|
506
|
+
node: a
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
return e;
|
|
510
|
+
}), G = J(null), rt = y(() => V.value.map((e, o) => ({
|
|
511
|
+
...e,
|
|
512
|
+
color: Le(e.color) || ze.value[o] || L[o] || L[o % L.length],
|
|
513
|
+
shape: "square"
|
|
514
|
+
})).sort((e, o) => o.value - e.value).map((e, o) => {
|
|
515
|
+
const l = e.value / V.value.map((a) => a.value).reduce((a, s) => a + s, 0);
|
|
516
|
+
return {
|
|
517
|
+
...e,
|
|
518
|
+
proportion: l,
|
|
519
|
+
opacity: W.value.includes(e.id) ? 0.5 : 1,
|
|
520
|
+
display: `${e.name}${t.value.style.chart.legend.showPercentage || t.value.style.chart.legend.showValue ? ": " : ""}${t.value.style.chart.legend.showValue ? Ze(
|
|
521
|
+
t.value.style.chart.layout.labels.formatter,
|
|
522
|
+
e.value,
|
|
523
|
+
De({
|
|
524
|
+
p: t.value.style.chart.layout.labels.prefix,
|
|
525
|
+
v: e.value,
|
|
526
|
+
s: t.value.style.chart.layout.labels.suffix,
|
|
527
|
+
r: t.value.style.chart.legend.roundingValue
|
|
528
|
+
}),
|
|
529
|
+
{ datapoint: e }
|
|
530
|
+
) : ""}${t.value.style.chart.legend.showPercentage ? W.value.includes(e.id) ? `${t.value.style.chart.legend.showValue ? " (" : ""}- %${t.value.style.chart.legend.showValue ? ")" : ""}` : `${t.value.style.chart.legend.showValue ? " (" : ""}${isNaN(e.value / ke.value) ? "-" : (e.value / ke.value * 100).toFixed(t.value.style.chart.legend.roundingPercentage)}%${t.value.style.chart.legend.showValue ? ")" : ""}` : ""}`
|
|
531
|
+
};
|
|
532
|
+
})), kl = y(() => ({
|
|
533
|
+
cy: "treemap-div-legend",
|
|
534
|
+
backgroundColor: t.value.style.chart.legend.backgroundColor,
|
|
535
|
+
color: t.value.style.chart.legend.color,
|
|
536
|
+
fontSize: t.value.style.chart.legend.fontSize,
|
|
537
|
+
paddingBottom: 12,
|
|
538
|
+
fontWeight: t.value.style.chart.legend.bold ? "bold" : ""
|
|
539
|
+
}));
|
|
540
|
+
function Ut(e) {
|
|
541
|
+
G.value = null, W.value.includes(e.id) ? W.value = W.value.filter((o) => o !== e.id) : W.value.length < $.dataset.length - 1 && W.value.push(e.id), _("selectLegend", ut.value);
|
|
542
|
+
}
|
|
543
|
+
function Cl({ datapoint: e, seriesIndex: o }) {
|
|
544
|
+
G.value = null, P.value = !1, t.value.events.datapointLeave && t.value.events.datapointLeave({ datapoint: e, seriesIndex: o });
|
|
545
|
+
}
|
|
546
|
+
const it = b(null);
|
|
547
|
+
function $l({ datapoint: e, seriesIndex: o }) {
|
|
548
|
+
t.value.events.datapointEnter && t.value.events.datapointEnter({ datapoint: e, seriesIndex: o }), G.value = e, it.value = { datapoint: e, seriesIndex: o, config: t.value, series: Me.value };
|
|
549
|
+
const l = t.value.style.chart.tooltip.customFormat;
|
|
550
|
+
if (nl(l) && Ql(() => l({
|
|
551
|
+
seriesIndex: o,
|
|
552
|
+
datapoint: e,
|
|
553
|
+
series: Me.value,
|
|
554
|
+
config: t.value
|
|
555
|
+
})))
|
|
556
|
+
Je.value = l({
|
|
557
|
+
seriesIndex: o,
|
|
558
|
+
datapoint: e,
|
|
559
|
+
series: Me.value,
|
|
560
|
+
config: t.value
|
|
561
|
+
});
|
|
562
|
+
else {
|
|
563
|
+
let a = "";
|
|
564
|
+
a += `<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`, a += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${e.color}"/></svg>`, a += `<b>${Ze(
|
|
565
|
+
t.value.style.chart.layout.labels.formatter,
|
|
566
|
+
e.value,
|
|
567
|
+
De({
|
|
568
|
+
p: t.value.style.chart.layout.labels.prefix,
|
|
569
|
+
v: e.value,
|
|
570
|
+
s: t.value.style.chart.layout.labels.suffix,
|
|
571
|
+
r: t.value.style.chart.tooltip.roundingValue
|
|
572
|
+
}),
|
|
573
|
+
{ datapoint: e, seriesIndex: o }
|
|
574
|
+
)}</b>`, Je.value = `<div>${a}</div>`;
|
|
575
|
+
}
|
|
576
|
+
P.value = !0;
|
|
577
|
+
}
|
|
578
|
+
const j = y(() => {
|
|
579
|
+
const e = Ie.value.map((l) => ({
|
|
580
|
+
name: l.name,
|
|
581
|
+
color: l.color
|
|
582
|
+
})), o = Ie.value.map((l) => l.value);
|
|
583
|
+
return { head: e, body: o };
|
|
584
|
+
});
|
|
585
|
+
function ct(e = null) {
|
|
586
|
+
Xl(() => {
|
|
587
|
+
const o = j.value.head.map((s, v) => [[
|
|
588
|
+
s.name
|
|
589
|
+
], [j.value.body[v]], [isNaN(j.value.body[v] / ke.value) ? "-" : j.value.body[v] / ke.value * 100]]), l = [[t.value.style.chart.title.text], [t.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(o), a = Kl(l);
|
|
590
|
+
e ? e(a) : Jl({ csvContent: a, title: t.value.style.chart.title.text || "vue-ui-treemap" });
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
const Pe = y(() => {
|
|
594
|
+
const e = [
|
|
595
|
+
t.value.table.columnNames.series,
|
|
596
|
+
t.value.table.columnNames.value,
|
|
597
|
+
t.value.table.columnNames.percentage
|
|
598
|
+
], o = j.value.head.map((s, v) => {
|
|
599
|
+
const k = Ze(
|
|
600
|
+
t.value.style.chart.layout.labels.formatter,
|
|
601
|
+
j.value.body[v],
|
|
602
|
+
De({
|
|
603
|
+
p: t.value.style.chart.layout.labels.prefix,
|
|
604
|
+
v: j.value.body[v],
|
|
605
|
+
s: t.value.style.chart.layout.labels.suffix,
|
|
606
|
+
r: t.value.table.td.roundingValue
|
|
607
|
+
})
|
|
608
|
+
);
|
|
609
|
+
return [
|
|
610
|
+
{
|
|
611
|
+
color: s.color,
|
|
612
|
+
name: s.name,
|
|
613
|
+
shape: "square"
|
|
614
|
+
},
|
|
615
|
+
k,
|
|
616
|
+
isNaN(j.value.body[v] / ke.value) ? "-" : De({
|
|
617
|
+
v: j.value.body[v] / ke.value * 100,
|
|
618
|
+
s: "%",
|
|
619
|
+
r: t.value.table.td.roundingPercentage
|
|
620
|
+
})
|
|
621
|
+
];
|
|
622
|
+
}), l = {
|
|
623
|
+
th: {
|
|
624
|
+
backgroundColor: t.value.table.th.backgroundColor,
|
|
625
|
+
color: t.value.table.th.color,
|
|
626
|
+
outline: t.value.table.th.outline
|
|
627
|
+
},
|
|
628
|
+
td: {
|
|
629
|
+
backgroundColor: t.value.table.td.backgroundColor,
|
|
630
|
+
color: t.value.table.td.color,
|
|
631
|
+
outline: t.value.table.td.outline
|
|
632
|
+
},
|
|
633
|
+
breakpoint: t.value.table.responsiveBreakpoint
|
|
634
|
+
};
|
|
635
|
+
return {
|
|
636
|
+
colNames: [
|
|
637
|
+
t.value.table.columnNames.series,
|
|
638
|
+
t.value.table.columnNames.value
|
|
639
|
+
],
|
|
640
|
+
head: e,
|
|
641
|
+
body: o,
|
|
642
|
+
config: l
|
|
643
|
+
};
|
|
644
|
+
});
|
|
645
|
+
function xl() {
|
|
646
|
+
return Ie.value;
|
|
647
|
+
}
|
|
648
|
+
function Gt() {
|
|
649
|
+
z.value.showTable = !z.value.showTable;
|
|
650
|
+
}
|
|
651
|
+
function Xt() {
|
|
652
|
+
z.value.showTooltip = !z.value.showTooltip;
|
|
653
|
+
}
|
|
654
|
+
const Be = b(!1);
|
|
655
|
+
function vt() {
|
|
656
|
+
Be.value = !Be.value;
|
|
657
|
+
}
|
|
658
|
+
const Ve = b(null);
|
|
659
|
+
function qt(e) {
|
|
660
|
+
Ve.value = e;
|
|
661
|
+
}
|
|
662
|
+
function Yt() {
|
|
663
|
+
Ve.value = null;
|
|
664
|
+
}
|
|
665
|
+
async function Tl({ scale: e = 2 } = {}) {
|
|
666
|
+
if (!U.value) return;
|
|
667
|
+
const { width: o, height: l } = U.value.getBoundingClientRect(), a = o / l, { imageUri: s, base64: v } = await ro({ domElement: U.value, base64: !0, img: !0, scale: e });
|
|
668
|
+
return {
|
|
669
|
+
imageUri: s,
|
|
670
|
+
base64: v,
|
|
671
|
+
title: t.value.style.chart.title.text,
|
|
672
|
+
width: o,
|
|
673
|
+
height: l,
|
|
674
|
+
aspectRatio: a
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
const Ne = y(() => {
|
|
678
|
+
const e = t.value.table.useDialog && !t.value.table.show, o = z.value.showTable;
|
|
679
|
+
return {
|
|
680
|
+
component: e ? Q : f,
|
|
681
|
+
title: `${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text ? `: ${t.value.style.chart.title.subtitle.text}` : ""}`,
|
|
682
|
+
props: e ? {
|
|
683
|
+
backgroundColor: t.value.table.th.backgroundColor,
|
|
684
|
+
color: t.value.table.th.color,
|
|
685
|
+
headerColor: t.value.table.th.color,
|
|
686
|
+
headerBg: t.value.table.th.backgroundColor,
|
|
687
|
+
isFullscreen: ie.value,
|
|
688
|
+
fullscreenParent: U.value,
|
|
689
|
+
forcedWidth: Math.min(800, window.innerWidth * 0.8)
|
|
690
|
+
} : {
|
|
691
|
+
hideDetails: !0,
|
|
692
|
+
config: {
|
|
693
|
+
open: o,
|
|
694
|
+
maxHeight: 1e4,
|
|
695
|
+
body: {
|
|
696
|
+
backgroundColor: t.value.style.chart.backgroundColor,
|
|
697
|
+
color: t.value.style.chart.color
|
|
698
|
+
},
|
|
699
|
+
head: {
|
|
700
|
+
backgroundColor: t.value.style.chart.backgroundColor,
|
|
701
|
+
color: t.value.style.chart.color
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
});
|
|
707
|
+
Ue(() => z.value.showTable, (e) => {
|
|
708
|
+
t.value.table.show || (e && t.value.table.useDialog && Ae.value ? Ae.value.open() : "close" in Ae.value && Ae.value.close());
|
|
709
|
+
});
|
|
710
|
+
function jt() {
|
|
711
|
+
z.value.showTable = !1, lt.value && lt.value.setTableIconState(!1);
|
|
712
|
+
}
|
|
713
|
+
const Sl = y(() => rt.value.map((e) => ({
|
|
714
|
+
...e,
|
|
715
|
+
name: e.display
|
|
716
|
+
}))), _l = y(() => t.value.style.chart.backgroundColor), Ol = y(() => t.value.style.chart.legend), Al = y(() => t.value.style.chart.title), { exportSvg: Fl, getSvg: Ml } = ho({
|
|
717
|
+
svg: nt,
|
|
718
|
+
title: Al,
|
|
719
|
+
legend: Ol,
|
|
720
|
+
legendItems: Sl,
|
|
721
|
+
backgroundColor: _l
|
|
722
|
+
});
|
|
723
|
+
async function Zt({ isCb: e }) {
|
|
724
|
+
if (e) {
|
|
725
|
+
const { blob: o, url: l, text: a, dataUrl: s } = await Ml();
|
|
726
|
+
t.value.userOptions.callbacks.svg({ blob: o, url: l, text: a, dataUrl: s });
|
|
727
|
+
} else
|
|
728
|
+
Fl();
|
|
729
|
+
}
|
|
730
|
+
function Il({ rect: e, seriesIndex: o }) {
|
|
731
|
+
const l = t.value.style.chart.layout.labels.name.show, a = t.value.style.chart.layout.labels.value.show;
|
|
732
|
+
if (!l && !a) return "";
|
|
733
|
+
const s = Math.max(2, xe(e) / 3), v = Math.max(8, xe(e)), k = v * 1.2, N = Math.max(0, $e(e) - s * 2), ce = Math.max(0, Ce(e) - s * 2);
|
|
734
|
+
if (N <= 2 || ce <= v * 0.8) return "";
|
|
735
|
+
const oe = t.value.style.fontFamily, He = t.value.style.chart.layout.labels.name.bold ? "600" : "400", ae = t.value.style.chart.layout.labels.value.bold ? "600" : "400", ne = al(e.color), dt = l ? String(e.name ?? "") : "", Ee = a ? Ze(
|
|
736
|
+
t.value.style.chart.layout.labels.formatter,
|
|
737
|
+
e.value,
|
|
738
|
+
De({
|
|
739
|
+
p: t.value.style.chart.layout.labels.prefix,
|
|
740
|
+
v: e.value,
|
|
741
|
+
s: t.value.style.chart.layout.labels.suffix,
|
|
742
|
+
r: t.value.style.chart.layout.labels.rounding
|
|
743
|
+
}),
|
|
744
|
+
{ datapoint: e, seriesIndex: o }
|
|
745
|
+
) : "";
|
|
746
|
+
function ve(he, fe = v, Oe = "400") {
|
|
747
|
+
const H = document.createElementNS(Ct, "svg");
|
|
748
|
+
H.setAttribute("width", "0"), H.setAttribute("height", "0"), H.style.position = "absolute", H.style.visibility = "hidden", H.style.pointerEvents = "none";
|
|
749
|
+
const X = document.createElementNS(Ct, "text");
|
|
750
|
+
X.setAttribute("font-size", String(fe)), X.setAttribute("font-family", oe), X.setAttribute("font-weight", String(Oe)), X.textContent = he || "", H.appendChild(X), document.body.appendChild(H);
|
|
751
|
+
const Jt = X.getComputedTextLength();
|
|
752
|
+
return document.body.removeChild(H), Jt;
|
|
753
|
+
}
|
|
754
|
+
function Ll(he, fe, Oe, H, X, Jt) {
|
|
755
|
+
const Rl = String(he).split(/\s+/).filter(Boolean), O = [];
|
|
756
|
+
let se = "";
|
|
757
|
+
function pe(T) {
|
|
758
|
+
return ve(T, Oe, H) <= fe;
|
|
759
|
+
}
|
|
760
|
+
function Pl(T) {
|
|
761
|
+
if (pe(T)) return [T];
|
|
762
|
+
const K = [];
|
|
763
|
+
let C = 0;
|
|
764
|
+
for (; C < T.length; ) {
|
|
765
|
+
let pt = 1, gt = T.length - C, mt = 1;
|
|
766
|
+
for (; pt <= gt; ) {
|
|
767
|
+
const We = pt + gt >> 1, Vl = T.slice(C, C + We);
|
|
768
|
+
pe(Vl) ? (mt = We, pt = We + 1) : gt = We - 1;
|
|
769
|
+
}
|
|
770
|
+
K.push(T.slice(C, C + mt)), C += mt;
|
|
771
|
+
}
|
|
772
|
+
return K;
|
|
773
|
+
}
|
|
774
|
+
const Bl = Rl.flatMap((T) => Pl(T));
|
|
775
|
+
for (const T of Bl) {
|
|
776
|
+
const K = se ? se + " " + T : T;
|
|
777
|
+
if (pe(K))
|
|
778
|
+
se = K;
|
|
779
|
+
else if (se && O.push(se), se = T, O.length === X - 1) break;
|
|
780
|
+
}
|
|
781
|
+
if (se && O.length < X && O.push(se), O.length === X) {
|
|
782
|
+
const T = O[O.length - 1];
|
|
783
|
+
if (!pe(T)) {
|
|
784
|
+
let C = T;
|
|
785
|
+
for (; C.length && !pe(C); ) C = C.slice(0, -1);
|
|
786
|
+
O[O.length - 1] = C;
|
|
787
|
+
}
|
|
788
|
+
let K = O[O.length - 1] + "…";
|
|
789
|
+
if (!pe(K)) {
|
|
790
|
+
let C = O[O.length - 1];
|
|
791
|
+
for (; C.length && !pe(C + "…"); ) C = C.slice(0, -1);
|
|
792
|
+
K = C + "…";
|
|
793
|
+
}
|
|
794
|
+
O[O.length - 1] = K;
|
|
795
|
+
}
|
|
796
|
+
return O;
|
|
797
|
+
}
|
|
798
|
+
const Dl = a ? 1 : 0, Kt = Math.max(0, Math.floor(ce / k) - Dl);
|
|
799
|
+
if (Kt <= 0) {
|
|
800
|
+
if (!a) return "";
|
|
801
|
+
const he = e.x0 + s, fe = e.y0 + s + v, Oe = $t(Ee);
|
|
802
|
+
return ve(Oe, v, ae) <= N ? `
|
|
803
|
+
<text
|
|
804
|
+
x="${he}"
|
|
805
|
+
y="${fe}"
|
|
806
|
+
font-size="${v}"
|
|
807
|
+
font-family="${Ke(oe)}"
|
|
808
|
+
font-weight="${ae}"
|
|
809
|
+
fill="${Ke(ne)}"
|
|
810
|
+
>
|
|
811
|
+
${Oe}
|
|
812
|
+
</text>` : "";
|
|
813
|
+
}
|
|
814
|
+
const de = l ? Ll(dt, N, v, He, Kt) : [];
|
|
815
|
+
let _e = v, Z = String(Ee);
|
|
816
|
+
if (a) {
|
|
817
|
+
for (; ve(Z, _e, ae) > N && _e > Math.max(8, v * 0.75); )
|
|
818
|
+
_e -= 1;
|
|
819
|
+
if (ve(Z, _e, ae) > N) {
|
|
820
|
+
for (; Z.length && ve(Z + "…", _e, ae) > N; )
|
|
821
|
+
Z = Z.slice(0, -1);
|
|
822
|
+
if (Z += "…", !Z.length) return "";
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (de.length * k + (a ? k : 0) > ce) {
|
|
826
|
+
for (; de.length && de.length * k + (a ? k : 0) > ce; )
|
|
827
|
+
de.pop();
|
|
828
|
+
if (!de.length && (!a || k > ce)) return "";
|
|
829
|
+
}
|
|
830
|
+
const ht = e.x0 + s, zl = e.y0 + s + v, ft = [];
|
|
831
|
+
return l && de.forEach((he, fe) => {
|
|
832
|
+
ft.push(
|
|
833
|
+
`
|
|
834
|
+
<tspan
|
|
835
|
+
x="${ht}"
|
|
836
|
+
dy="${fe === 0 ? 0 : k}"
|
|
837
|
+
font-weight="${He}"
|
|
838
|
+
>
|
|
839
|
+
${$t(he)}
|
|
840
|
+
</tspan>`
|
|
841
|
+
);
|
|
842
|
+
}), a && ft.push(
|
|
843
|
+
`
|
|
844
|
+
<tspan
|
|
845
|
+
x="${ht}"
|
|
846
|
+
dy="${de.length ? k : 0}"
|
|
847
|
+
font-weight="${ae}"
|
|
848
|
+
font-size="${_e}"
|
|
849
|
+
>
|
|
850
|
+
${$t(Z)}
|
|
851
|
+
</tspan>`
|
|
852
|
+
), `<text
|
|
853
|
+
x="${ht}"
|
|
854
|
+
y="${zl}"
|
|
855
|
+
font-size="${v}"
|
|
856
|
+
font-family="${Ke(oe)}"
|
|
857
|
+
fill="${Ke(ne)}"
|
|
858
|
+
paint-order="stroke"
|
|
859
|
+
stroke="transparent"
|
|
860
|
+
stroke-width="0"
|
|
861
|
+
style="transition: all 0.2s ease-in-out;"
|
|
862
|
+
>
|
|
863
|
+
${ft.join("")}
|
|
864
|
+
</text>`;
|
|
865
|
+
}
|
|
866
|
+
function Nl(e) {
|
|
867
|
+
const o = t.value.style.chart.layout.rects.borderRadius, l = $e(e), a = Ce(e);
|
|
868
|
+
return Math.min(o, Math.min(l, a) / 6);
|
|
869
|
+
}
|
|
870
|
+
return i({
|
|
871
|
+
getData: xl,
|
|
872
|
+
getImage: Tl,
|
|
873
|
+
generateCsv: ct,
|
|
874
|
+
generateImage: Rt,
|
|
875
|
+
generateSvg: Zt,
|
|
876
|
+
generatePdf: zt,
|
|
877
|
+
toggleTable: Gt,
|
|
878
|
+
toggleTooltip: Xt,
|
|
879
|
+
toggleAnnotator: vt,
|
|
880
|
+
toggleFullscreen: Wt
|
|
881
|
+
}), (e, o) => (h(), w("div", {
|
|
882
|
+
ref_key: "treemapChart",
|
|
883
|
+
ref: U,
|
|
884
|
+
class: yt(`vue-data-ui-component vue-ui-treemap ${ie.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${t.value.useCssAnimation ? "" : "vue-ui-dna"}`),
|
|
885
|
+
style: ue(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive ? "height: 100%;" : ""} text-align:center;background:${t.value.style.chart.backgroundColor}`),
|
|
886
|
+
id: `treemap_${I.value}`,
|
|
887
|
+
onMouseenter: o[2] || (o[2] = () => p(It)(!0)),
|
|
888
|
+
onMouseleave: o[3] || (o[3] = () => p(It)(!1))
|
|
889
|
+
}, [
|
|
890
|
+
t.value.userOptions.buttons.annotator ? (h(), re(p(r), {
|
|
891
|
+
key: 0,
|
|
892
|
+
svgRef: p(nt),
|
|
893
|
+
backgroundColor: t.value.style.chart.backgroundColor,
|
|
894
|
+
color: t.value.style.chart.color,
|
|
895
|
+
active: Be.value,
|
|
896
|
+
onClose: vt
|
|
897
|
+
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : M("", !0),
|
|
898
|
+
hl.value ? (h(), w("div", {
|
|
899
|
+
key: 1,
|
|
900
|
+
ref_key: "noTitle",
|
|
901
|
+
ref: At,
|
|
902
|
+
class: "vue-data-ui-no-title-space",
|
|
903
|
+
style: "height:36px; width: 100%;background:transparent"
|
|
904
|
+
}, null, 512)) : M("", !0),
|
|
905
|
+
t.value.style.chart.title.text ? (h(), w("div", {
|
|
906
|
+
key: 2,
|
|
907
|
+
ref_key: "chartTitle",
|
|
908
|
+
ref: St,
|
|
909
|
+
style: ue(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)
|
|
910
|
+
}, [
|
|
911
|
+
(h(), re(io, {
|
|
912
|
+
key: `title_${Ft.value}`,
|
|
913
|
+
config: {
|
|
914
|
+
title: {
|
|
915
|
+
cy: "treemap-div-title",
|
|
916
|
+
...t.value.style.chart.title
|
|
917
|
+
},
|
|
918
|
+
subtitle: {
|
|
919
|
+
cy: "treemap-div-subtitle",
|
|
920
|
+
...t.value.style.chart.title.subtitle
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}, null, 8, ["config"]))
|
|
924
|
+
], 4)) : M("", !0),
|
|
925
|
+
R("div", {
|
|
926
|
+
id: `legend-top-${I.value}`
|
|
927
|
+
}, null, 8, xo),
|
|
928
|
+
t.value.userOptions.show && D.value && (p(Nt) || p(at)) ? (h(), re(p(m), {
|
|
929
|
+
ref_key: "userOptionsRef",
|
|
930
|
+
ref: lt,
|
|
931
|
+
key: `user_option_${Tt.value}`,
|
|
932
|
+
backgroundColor: t.value.style.chart.backgroundColor,
|
|
933
|
+
color: t.value.style.chart.color,
|
|
934
|
+
isPrinting: p(Lt),
|
|
935
|
+
isImaging: p(Dt),
|
|
936
|
+
uid: I.value,
|
|
937
|
+
hasTooltip: t.value.userOptions.buttons.tooltip && t.value.style.chart.tooltip.show,
|
|
938
|
+
hasPdf: t.value.userOptions.buttons.pdf,
|
|
939
|
+
hasXls: t.value.userOptions.buttons.csv,
|
|
940
|
+
hasImg: t.value.userOptions.buttons.img,
|
|
941
|
+
hasSvg: t.value.userOptions.buttons.svg,
|
|
942
|
+
hasTable: t.value.userOptions.buttons.table,
|
|
943
|
+
hasFullscreen: t.value.userOptions.buttons.fullscreen,
|
|
944
|
+
isFullscreen: ie.value,
|
|
945
|
+
isTooltip: z.value.showTooltip,
|
|
946
|
+
titles: { ...t.value.userOptions.buttonTitles },
|
|
947
|
+
chartElement: U.value,
|
|
948
|
+
position: t.value.userOptions.position,
|
|
949
|
+
hasAnnotator: t.value.userOptions.buttons.annotator,
|
|
950
|
+
isAnnotation: Be.value,
|
|
951
|
+
callbacks: t.value.userOptions.callbacks,
|
|
952
|
+
printScale: t.value.userOptions.print.scale,
|
|
953
|
+
tableDialog: t.value.table.useDialog,
|
|
954
|
+
onToggleFullscreen: Wt,
|
|
955
|
+
onGeneratePdf: p(zt),
|
|
956
|
+
onGenerateCsv: ct,
|
|
957
|
+
onGenerateImage: p(Rt),
|
|
958
|
+
onGenerateSvg: Zt,
|
|
959
|
+
onToggleTable: Gt,
|
|
960
|
+
onToggleTooltip: Xt,
|
|
961
|
+
onToggleAnnotator: vt,
|
|
962
|
+
style: ue({
|
|
963
|
+
visibility: p(Nt) ? p(at) ? "visible" : "hidden" : "visible"
|
|
964
|
+
})
|
|
965
|
+
}, el({ _: 2 }, [
|
|
966
|
+
e.$slots.menuIcon ? {
|
|
967
|
+
name: "menuIcon",
|
|
968
|
+
fn: A(({ isOpen: l, color: a }) => [
|
|
969
|
+
S(e.$slots, "menuIcon", me(ye({ isOpen: l, color: a })), void 0, !0)
|
|
970
|
+
]),
|
|
971
|
+
key: "0"
|
|
972
|
+
} : void 0,
|
|
973
|
+
e.$slots.optionTooltip ? {
|
|
974
|
+
name: "optionTooltip",
|
|
975
|
+
fn: A(() => [
|
|
976
|
+
S(e.$slots, "optionTooltip", {}, void 0, !0)
|
|
977
|
+
]),
|
|
978
|
+
key: "1"
|
|
979
|
+
} : void 0,
|
|
980
|
+
e.$slots.optionPdf ? {
|
|
981
|
+
name: "optionPdf",
|
|
982
|
+
fn: A(() => [
|
|
983
|
+
S(e.$slots, "optionPdf", {}, void 0, !0)
|
|
984
|
+
]),
|
|
985
|
+
key: "2"
|
|
986
|
+
} : void 0,
|
|
987
|
+
e.$slots.optionCsv ? {
|
|
988
|
+
name: "optionCsv",
|
|
989
|
+
fn: A(() => [
|
|
990
|
+
S(e.$slots, "optionCsv", {}, void 0, !0)
|
|
991
|
+
]),
|
|
992
|
+
key: "3"
|
|
993
|
+
} : void 0,
|
|
994
|
+
e.$slots.optionImg ? {
|
|
995
|
+
name: "optionImg",
|
|
996
|
+
fn: A(() => [
|
|
997
|
+
S(e.$slots, "optionImg", {}, void 0, !0)
|
|
998
|
+
]),
|
|
999
|
+
key: "4"
|
|
1000
|
+
} : void 0,
|
|
1001
|
+
e.$slots.optionTable ? {
|
|
1002
|
+
name: "optionTable",
|
|
1003
|
+
fn: A(() => [
|
|
1004
|
+
S(e.$slots, "optionTable", {}, void 0, !0)
|
|
1005
|
+
]),
|
|
1006
|
+
key: "5"
|
|
1007
|
+
} : void 0,
|
|
1008
|
+
e.$slots.optionFullscreen ? {
|
|
1009
|
+
name: "optionFullscreen",
|
|
1010
|
+
fn: A(({ toggleFullscreen: l, isFullscreen: a }) => [
|
|
1011
|
+
S(e.$slots, "optionFullscreen", me(ye({ toggleFullscreen: l, isFullscreen: a })), void 0, !0)
|
|
1012
|
+
]),
|
|
1013
|
+
key: "6"
|
|
1014
|
+
} : void 0,
|
|
1015
|
+
e.$slots.optionAnnotator ? {
|
|
1016
|
+
name: "optionAnnotator",
|
|
1017
|
+
fn: A(({ toggleAnnotator: l, isAnnotator: a }) => [
|
|
1018
|
+
S(e.$slots, "optionAnnotator", me(ye({ toggleAnnotator: l, isAnnotator: a })), void 0, !0)
|
|
1019
|
+
]),
|
|
1020
|
+
key: "7"
|
|
1021
|
+
} : void 0
|
|
1022
|
+
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasSvg", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "tableDialog", "onGeneratePdf", "onGenerateImage", "style"])) : M("", !0),
|
|
1023
|
+
Y.value.length > 1 ? (h(), w("nav", {
|
|
1024
|
+
key: 4,
|
|
1025
|
+
class: "vue-ui-treemap-breadcrumbs",
|
|
1026
|
+
"data-dom-to-png-ignore": "",
|
|
1027
|
+
ref_key: "breadcrumbsNav",
|
|
1028
|
+
ref: tt
|
|
1029
|
+
}, [
|
|
1030
|
+
(h(!0), w(Xe, null, bt(Y.value, (l, a) => (h(), w("span", {
|
|
1031
|
+
role: "button",
|
|
1032
|
+
tabindex: a < Y.value.length - 1 ? 0 : void 0,
|
|
1033
|
+
key: l.id || "root",
|
|
1034
|
+
onClick: (s) => a === Y.value.length - 1 ? () => {
|
|
1035
|
+
} : Re(l.node),
|
|
1036
|
+
onKeydown: [
|
|
1037
|
+
tl(wt((s) => a === Y.value.length - 1 ? void 0 : Re(l.node), ["prevent"]), ["enter"]),
|
|
1038
|
+
tl(wt((s) => a === Y.value.length - 1 ? void 0 : Re(l.node), ["prevent"]), ["space"])
|
|
1039
|
+
],
|
|
1040
|
+
class: "vue-ui-treemap-crumb",
|
|
1041
|
+
"data-last-crumb": a === Y.value.length - 1,
|
|
1042
|
+
style: ue({
|
|
1043
|
+
color: t.value.style.chart.color
|
|
1044
|
+
}),
|
|
1045
|
+
onMouseenter: (s) => qt(a),
|
|
1046
|
+
onMouseleave: Yt,
|
|
1047
|
+
onFocus: (s) => qt(a),
|
|
1048
|
+
onBlur: Yt
|
|
1049
|
+
}, [
|
|
1050
|
+
R("span", So, [
|
|
1051
|
+
R("span", _o, [
|
|
1052
|
+
S(e.$slots, "breadcrumb-label", kt({ ref_for: !0 }, { crumb: l, isRoot: a === 0, isFocus: Ve.value === a }), () => [
|
|
1053
|
+
a === 0 ? (h(), w("div", Oo, [
|
|
1054
|
+
Ge(ul, {
|
|
1055
|
+
name: Ve.value === 0 ? "homeFilled" : "home",
|
|
1056
|
+
stroke: t.value.style.chart.color
|
|
1057
|
+
}, null, 8, ["name", "stroke"])
|
|
1058
|
+
])) : (h(), w(Xe, { key: 1 }, [
|
|
1059
|
+
qe(Ye(l.label), 1)
|
|
1060
|
+
], 64))
|
|
1061
|
+
], !0)
|
|
1062
|
+
]),
|
|
1063
|
+
a < Y.value.length - 1 ? (h(), w("span", Ao, [
|
|
1064
|
+
S(e.$slots, "breadcrumb-arrow", {}, () => [
|
|
1065
|
+
o[4] || (o[4] = qe(" › ", -1))
|
|
1066
|
+
], !0)
|
|
1067
|
+
])) : M("", !0)
|
|
1068
|
+
])
|
|
1069
|
+
], 44, To))), 128))
|
|
1070
|
+
], 512)) : M("", !0),
|
|
1071
|
+
(h(), w("svg", {
|
|
1072
|
+
ref_key: "svgRef",
|
|
1073
|
+
ref: nt,
|
|
1074
|
+
xmlns: p(Ct),
|
|
1075
|
+
class: yt({ "vue-data-ui-fullscreen--on": ie.value, "vue-data-ui-fulscreen--off": !ie.value, "vue-data-ui-zoom-plus": !Se.value, "vue-data-ui-zoom-minus": Se.value, loading: p(be) }),
|
|
1076
|
+
viewBox: `${Te.value.startX} ${Te.value.startY} ${Te.value.width <= 0 ? 10 : Te.value.width} ${Te.value.height <= 0 ? 10 : Te.value.height}`,
|
|
1077
|
+
style: ue(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)
|
|
1078
|
+
}, [
|
|
1079
|
+
Ge(p(g)),
|
|
1080
|
+
(h(!0), w(Xe, null, bt(Ie.value, (l, a) => (h(), w("g", {
|
|
1081
|
+
key: `tgrad_${l.id}`
|
|
1082
|
+
}, [
|
|
1083
|
+
t.value.style.chart.layout.rects.gradient.show ? (h(), w("defs", Mo, [
|
|
1084
|
+
R("radialGradient", {
|
|
1085
|
+
id: `tgrad_${l.id}`,
|
|
1086
|
+
gradientTransform: "translate(-1, -1.000001) scale(2, 2)"
|
|
1087
|
+
}, [
|
|
1088
|
+
R("stop", {
|
|
1089
|
+
offset: "18%",
|
|
1090
|
+
"stop-color": l.color
|
|
1091
|
+
}, null, 8, No),
|
|
1092
|
+
R("stop", {
|
|
1093
|
+
offset: "100%",
|
|
1094
|
+
"stop-color": p(ol)(l.color, t.value.style.chart.layout.rects.gradient.intensity / 100)
|
|
1095
|
+
}, null, 8, Lo)
|
|
1096
|
+
], 8, Io)
|
|
1097
|
+
])) : M("", !0)
|
|
1098
|
+
]))), 128)),
|
|
1099
|
+
(h(!0), w(Xe, null, bt(Ie.value, (l, a) => (h(), w("g", {
|
|
1100
|
+
key: `k_${l.id}`
|
|
1101
|
+
}, [
|
|
1102
|
+
R("rect", {
|
|
1103
|
+
x: l.x0,
|
|
1104
|
+
y: l.y0,
|
|
1105
|
+
height: Ce(l),
|
|
1106
|
+
width: $e(l),
|
|
1107
|
+
fill: q.value ? l.color : t.value.style.chart.layout.rects.gradient.show ? `url(#tgrad_${l.id})` : l.color,
|
|
1108
|
+
rx: Nl(l),
|
|
1109
|
+
stroke: G.value && G.value.id === l.id ? t.value.style.chart.layout.rects.selected.stroke : t.value.style.chart.layout.rects.stroke,
|
|
1110
|
+
"stroke-width": G.value && G.value.id === l.id ? t.value.style.chart.layout.rects.selected.strokeWidth : t.value.style.chart.layout.rects.strokeWidth,
|
|
1111
|
+
onClick: wt((s) => Re(l, a), ["stop"]),
|
|
1112
|
+
onMouseenter: () => $l({
|
|
1113
|
+
datapoint: l,
|
|
1114
|
+
seriesIndex: a
|
|
1115
|
+
}),
|
|
1116
|
+
onMouseleave: (s) => Cl({ datapoint: l, seriesIndex: a }),
|
|
1117
|
+
style: ue(`opacity:${G.value ? G.value.id === l.id ? 1 : t.value.style.chart.layout.rects.selected.unselectedOpacity : 1}`),
|
|
1118
|
+
class: yt([
|
|
1119
|
+
"vue-ui-treemap-rect",
|
|
1120
|
+
wl(l) ? "vue-data-ui-zoom-plus" : Se.value ? "vue-data-ui-zoom-minus" : ""
|
|
1121
|
+
])
|
|
1122
|
+
}, null, 46, Do),
|
|
1123
|
+
!e.$slots.rect && !p(be) && t.value.style.chart.layout.labels.showDefaultLabels ? (h(), w("g", {
|
|
1124
|
+
key: 0,
|
|
1125
|
+
style: { "pointer-events": "none" },
|
|
1126
|
+
innerHTML: Il({ rect: l, seriesIndex: a })
|
|
1127
|
+
}, null, 8, zo)) : M("", !0),
|
|
1128
|
+
(h(), w("foreignObject", {
|
|
1129
|
+
x: l.x0,
|
|
1130
|
+
y: l.y0,
|
|
1131
|
+
height: Ce(l),
|
|
1132
|
+
width: $e(l),
|
|
1133
|
+
class: "vue-ui-treemap-cell-foreignObject"
|
|
1134
|
+
}, [
|
|
1135
|
+
R("div", {
|
|
1136
|
+
style: ue({
|
|
1137
|
+
width: `calc(100% - ${xe(l) / 1.5}px)`,
|
|
1138
|
+
height: `calc(100% - ${xe(l) / 1.5}px)`,
|
|
1139
|
+
padding: `${xe(l) / 3}px`
|
|
1140
|
+
}),
|
|
1141
|
+
class: "vue-ui-treemap-cell"
|
|
1142
|
+
}, [
|
|
1143
|
+
p(be) ? M("", !0) : S(e.$slots, "rect", kt({
|
|
1144
|
+
key: 0,
|
|
1145
|
+
ref_for: !0
|
|
1146
|
+
}, {
|
|
1147
|
+
rect: l,
|
|
1148
|
+
shouldShow: l.proportion > t.value.style.chart.layout.labels.hideUnderProportion || Se.value,
|
|
1149
|
+
fontSize: xe(l),
|
|
1150
|
+
isZoom: Se.value,
|
|
1151
|
+
textColor: p(al)(l.color)
|
|
1152
|
+
}), void 0, !0)
|
|
1153
|
+
], 4)
|
|
1154
|
+
], 8, Ro))
|
|
1155
|
+
]))), 128)),
|
|
1156
|
+
S(e.$slots, "svg", me(ye({ svg: B.value, isZoom: Se.value, rect: G.value, config: t.value })), void 0, !0)
|
|
1157
|
+
], 14, Fo)),
|
|
1158
|
+
e.$slots.watermark ? (h(), w("div", Po, [
|
|
1159
|
+
S(e.$slots, "watermark", me(ye({ isPrinting: p(Lt) || p(Dt) })), void 0, !0)
|
|
1160
|
+
])) : M("", !0),
|
|
1161
|
+
R("div", {
|
|
1162
|
+
id: `legend-bottom-${I.value}`
|
|
1163
|
+
}, null, 8, Bo),
|
|
1164
|
+
Mt.value ? (h(), re(Ul, {
|
|
1165
|
+
key: 6,
|
|
1166
|
+
to: t.value.style.chart.legend.position === "top" ? `#legend-top-${I.value}` : `#legend-bottom-${I.value}`
|
|
1167
|
+
}, [
|
|
1168
|
+
R("div", {
|
|
1169
|
+
ref_key: "chartLegend",
|
|
1170
|
+
ref: _t
|
|
1171
|
+
}, [
|
|
1172
|
+
t.value.style.chart.legend.show ? (h(), re(vo, {
|
|
1173
|
+
key: `legend_${et.value}`,
|
|
1174
|
+
legendSet: rt.value,
|
|
1175
|
+
config: kl.value,
|
|
1176
|
+
id: `treemap_legend_${I.value}`,
|
|
1177
|
+
onClickMarker: o[0] || (o[0] = ({ legend: l }) => Ut(l))
|
|
1178
|
+
}, {
|
|
1179
|
+
item: A(({ legend: l, index: a }) => [
|
|
1180
|
+
p(be) ? M("", !0) : (h(), w("div", {
|
|
1181
|
+
key: 0,
|
|
1182
|
+
onClick: (s) => Ut(l),
|
|
1183
|
+
style: ue(`opacity:${W.value.includes(l.id) ? 0.5 : 1}`)
|
|
1184
|
+
}, Ye(l.display), 13, Vo))
|
|
1185
|
+
]),
|
|
1186
|
+
_: 1
|
|
1187
|
+
}, 8, ["legendSet", "config", "id"])) : S(e.$slots, "legend", {
|
|
1188
|
+
key: 1,
|
|
1189
|
+
legend: rt.value
|
|
1190
|
+
}, void 0, !0)
|
|
1191
|
+
], 512)
|
|
1192
|
+
], 8, ["to"])) : M("", !0),
|
|
1193
|
+
e.$slots.source ? (h(), w("div", {
|
|
1194
|
+
key: 7,
|
|
1195
|
+
ref_key: "source",
|
|
1196
|
+
ref: Ot,
|
|
1197
|
+
dir: "auto"
|
|
1198
|
+
}, [
|
|
1199
|
+
S(e.$slots, "source", {}, void 0, !0)
|
|
1200
|
+
], 512)) : M("", !0),
|
|
1201
|
+
Ge(p(d), {
|
|
1202
|
+
show: z.value.showTooltip && P.value,
|
|
1203
|
+
backgroundColor: t.value.style.chart.tooltip.backgroundColor,
|
|
1204
|
+
color: t.value.style.chart.tooltip.color,
|
|
1205
|
+
fontSize: t.value.style.chart.tooltip.fontSize,
|
|
1206
|
+
borderRadius: t.value.style.chart.tooltip.borderRadius,
|
|
1207
|
+
borderColor: t.value.style.chart.tooltip.borderColor,
|
|
1208
|
+
borderWidth: t.value.style.chart.tooltip.borderWidth,
|
|
1209
|
+
backgroundOpacity: t.value.style.chart.tooltip.backgroundOpacity,
|
|
1210
|
+
position: t.value.style.chart.tooltip.position,
|
|
1211
|
+
offsetY: t.value.style.chart.tooltip.offsetY,
|
|
1212
|
+
parent: U.value,
|
|
1213
|
+
content: Je.value,
|
|
1214
|
+
isFullscreen: ie.value,
|
|
1215
|
+
isCustom: p(nl)(t.value.style.chart.tooltip.customFormat),
|
|
1216
|
+
smooth: t.value.style.chart.tooltip.smooth,
|
|
1217
|
+
backdropFilter: t.value.style.chart.tooltip.backdropFilter,
|
|
1218
|
+
smoothForce: t.value.style.chart.tooltip.smoothForce,
|
|
1219
|
+
smoothSnapThreshold: t.value.style.chart.tooltip.smoothSnapThreshold
|
|
1220
|
+
}, {
|
|
1221
|
+
"tooltip-before": A(() => [
|
|
1222
|
+
S(e.$slots, "tooltip-before", me(ye({ ...it.value })), void 0, !0)
|
|
1223
|
+
]),
|
|
1224
|
+
"tooltip-after": A(() => [
|
|
1225
|
+
S(e.$slots, "tooltip-after", me(ye({ ...it.value })), void 0, !0)
|
|
1226
|
+
]),
|
|
1227
|
+
_: 3
|
|
1228
|
+
}, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom", "smooth", "backdropFilter", "smoothForce", "smoothSnapThreshold"]),
|
|
1229
|
+
D.value && t.value.userOptions.buttons.table ? (h(), re(Gl(Ne.value.component), kt({ key: 8 }, Ne.value.props, {
|
|
1230
|
+
ref_key: "tableUnit",
|
|
1231
|
+
ref: Ae,
|
|
1232
|
+
onClose: jt
|
|
1233
|
+
}), el({
|
|
1234
|
+
content: A(() => [
|
|
1235
|
+
(h(), re(p(c), {
|
|
1236
|
+
key: `table_${Qe.value}`,
|
|
1237
|
+
colNames: Pe.value.colNames,
|
|
1238
|
+
head: Pe.value.head,
|
|
1239
|
+
body: Pe.value.body,
|
|
1240
|
+
config: Pe.value.config,
|
|
1241
|
+
title: t.value.table.useDialog ? "" : Ne.value.title,
|
|
1242
|
+
withCloseButton: !t.value.table.useDialog,
|
|
1243
|
+
onClose: jt
|
|
1244
|
+
}, {
|
|
1245
|
+
th: A(({ th: l }) => [
|
|
1246
|
+
R("div", {
|
|
1247
|
+
innerHTML: l,
|
|
1248
|
+
style: { display: "flex", "align-items": "center" }
|
|
1249
|
+
}, null, 8, Ho)
|
|
1250
|
+
]),
|
|
1251
|
+
td: A(({ td: l }) => [
|
|
1252
|
+
qe(Ye(l.name || l), 1)
|
|
1253
|
+
]),
|
|
1254
|
+
_: 1
|
|
1255
|
+
}, 8, ["colNames", "head", "body", "config", "title", "withCloseButton"]))
|
|
1256
|
+
]),
|
|
1257
|
+
_: 2
|
|
1258
|
+
}, [
|
|
1259
|
+
t.value.table.useDialog ? {
|
|
1260
|
+
name: "title",
|
|
1261
|
+
fn: A(() => [
|
|
1262
|
+
qe(Ye(Ne.value.title), 1)
|
|
1263
|
+
]),
|
|
1264
|
+
key: "0"
|
|
1265
|
+
} : void 0,
|
|
1266
|
+
t.value.table.useDialog ? {
|
|
1267
|
+
name: "actions",
|
|
1268
|
+
fn: A(() => [
|
|
1269
|
+
R("button", {
|
|
1270
|
+
tabindex: "0",
|
|
1271
|
+
class: "vue-ui-user-options-button",
|
|
1272
|
+
onClick: o[1] || (o[1] = (l) => ct(t.value.userOptions.callbacks.csv))
|
|
1273
|
+
}, [
|
|
1274
|
+
Ge(ul, {
|
|
1275
|
+
name: "excel",
|
|
1276
|
+
stroke: Ne.value.props.color
|
|
1277
|
+
}, null, 8, ["stroke"])
|
|
1278
|
+
])
|
|
1279
|
+
]),
|
|
1280
|
+
key: "1"
|
|
1281
|
+
} : void 0
|
|
1282
|
+
]), 1040)) : M("", !0),
|
|
1283
|
+
p(be) ? (h(), re(ao, { key: 9 })) : M("", !0)
|
|
1284
|
+
], 46, $o));
|
|
1285
|
+
}
|
|
1286
|
+
}, na = /* @__PURE__ */ fo(Eo, [["__scopeId", "data-v-9e0d065c"]]);
|
|
1287
|
+
export {
|
|
1288
|
+
na as default
|
|
1289
|
+
};
|