vue-data-ui 3.0.0-next.0 → 3.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -67
- package/dist/{Arrow-CzFtSJ1v.js → Arrow-Dck2Ea5K.js} +1 -1
- package/dist/{BaseDraggableDialog-0S5xhs2P.js → BaseDraggableDialog-CatHZ1ns.js} +2 -2
- package/dist/{BaseIcon-DoDjTdD5.js → BaseIcon-BmZ4MREl.js} +1 -1
- package/dist/{ColorPicker-BGRchgqQ.js → ColorPicker-C1MXyD9Q.js} +2 -2
- package/dist/{DataTable-BBbOgI-a.js → DataTable-CgL0Rz0x.js} +2 -2
- package/dist/{Legend-Q4bOb-Nf.js → Legend-CYbP3Kfg.js} +12 -11
- package/dist/{NonSvgPenAndPaper-DNKRvsBB.js → NonSvgPenAndPaper-CcbcJm_U.js} +3 -3
- package/dist/{PackageVersion-D0VPY8-5.js → PackageVersion-CAkNkiIG.js} +1 -1
- package/dist/{PenAndPaper-DhBJsnob.js → PenAndPaper-Cx1-5zdD.js} +32 -32
- package/dist/{Shape-DbsLJ-SE.js → Shape-DBXkGxKt.js} +1 -1
- package/dist/{Slicer-DZEFp2GU.js → Slicer-nrMi5hzj.js} +2 -2
- package/dist/{SparkTooltip-CoOJR62O.js → SparkTooltip-fNzL4pIU.js} +1 -1
- package/dist/{Title-D29apS4l.js → Title-pVYRzQXY.js} +1 -1
- package/dist/Tooltip-NwATo4ZJ.js +157 -0
- package/dist/{UserOptions-Bdit7AWO.js → UserOptions-DAsRxxrf.js} +137 -129
- package/dist/{dom-to-png-BdPIrHOF.js → dom-to-png-BF_4H_6u.js} +1 -1
- package/dist/img-ku4zevVD.js +33 -0
- package/dist/{index-DMqAxz7R.js → index-BzfnuLnw.js} +1199 -1135
- package/dist/pdf-CguiIsUc.js +58 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +1051 -217
- package/dist/types/vue-data-ui.d.ts +1051 -217
- package/dist/useLoading-Bt5Doa8m.js +28 -0
- package/dist/{useNestedProp-YgN3FV_8.js → useNestedProp-DorElw91.js} +1 -1
- package/dist/{usePrinter-COkTjv6C.js → usePrinter-C9qkgv0r.js} +2 -2
- package/dist/vue-data-ui-DQef_oFO.js +314 -0
- package/dist/vue-data-ui.js +13 -13
- package/dist/{vue-ui-3d-bar-Ojgjl20n.js → vue-ui-3d-bar-DPSamIA-.js} +261 -245
- package/dist/{vue-ui-accordion-P6eFHGQp.js → vue-ui-accordion-DgZK-qDz.js} +3 -3
- package/dist/{vue-ui-age-pyramid-IcMpAhiw.js → vue-ui-age-pyramid-DVeGKvf9.js} +233 -217
- package/dist/{vue-ui-annotator-Bk7d86-x.js → vue-ui-annotator-6ikkK-FK.js} +2 -2
- package/dist/{vue-ui-bullet-DCvWbCPk.js → vue-ui-bullet-Bg4hfFk2.js} +172 -156
- package/dist/{vue-ui-candlestick-DCf-88Yv.js → vue-ui-candlestick-Bi59FGXn.js} +271 -254
- package/dist/{vue-ui-carousel-table-DEsl0XUh.js → vue-ui-carousel-table-DitKhrFT.js} +17 -16
- package/dist/{vue-ui-chestnut-Cg10-3wu.js → vue-ui-chestnut-D8wGAZod.js} +419 -403
- package/dist/{vue-ui-chord-BWYzR6vf.js → vue-ui-chord-C-uTVCDP.js} +256 -240
- package/dist/{vue-ui-circle-pack-CO2Ra2-5.js → vue-ui-circle-pack-CPy6xcxv.js} +230 -214
- package/dist/{vue-ui-cursor-BbYHJDbV.js → vue-ui-cursor-Dd7vUd0q.js} +2 -2
- package/dist/{vue-ui-dashboard-DkCnNuse.js → vue-ui-dashboard-CKurbu8M.js} +62 -62
- package/dist/{vue-ui-digits-DRsphHt2.js → vue-ui-digits-DfdZI11G.js} +2 -2
- package/dist/{vue-ui-donut-evolution-B5F2-0bh.js → vue-ui-donut-evolution-CKbLO8yR.js} +370 -357
- package/dist/vue-ui-donut-tECBFvud.js +1532 -0
- package/dist/{vue-ui-dumbbell-DqqSxoSh.js → vue-ui-dumbbell-DI5Lj3r_.js} +216 -200
- package/dist/{vue-ui-flow-CTIcUJgV.js → vue-ui-flow-CjU48s9z.js} +217 -201
- package/dist/{vue-ui-funnel-k7KD7Xoc.js → vue-ui-funnel-DM_5vHZ4.js} +213 -197
- package/dist/{vue-ui-galaxy-C9EHaP4I.js → vue-ui-galaxy-ocvZgZJx.js} +215 -202
- package/dist/{vue-ui-gauge-CBiM_1-n.js → vue-ui-gauge-DajNoY-D.js} +220 -204
- package/dist/{vue-ui-gizmo-CAc7b2oK.js → vue-ui-gizmo-DTnzeQbm.js} +3 -3
- package/dist/{vue-ui-heatmap-B3ubrP2v.js → vue-ui-heatmap-CfBS8jQe.js} +244 -224
- package/dist/{vue-ui-history-plot-XCqccO3b.js → vue-ui-history-plot-BuOPWQoP.js} +268 -252
- package/dist/{vue-ui-kpi-DTGMDjaZ.js → vue-ui-kpi-DLGHOIRj.js} +3 -3
- package/dist/{vue-ui-mini-loader-Cn_7nvVq.js → vue-ui-mini-loader-CHAHi4c9.js} +2 -2
- package/dist/{vue-ui-molecule-BugMXFAK.js → vue-ui-molecule-R5-oDFeW.js} +204 -188
- package/dist/{vue-ui-mood-radar-Cv4dHZPL.js → vue-ui-mood-radar-Ddf2gaES.js} +206 -190
- package/dist/vue-ui-nested-donuts-CksklV83.js +1177 -0
- package/dist/{vue-ui-onion-Bha2hRAb.js → vue-ui-onion-D2n4zUkV.js} +196 -180
- package/dist/{vue-ui-parallel-coordinate-plot-DWJ2DWx4.js → vue-ui-parallel-coordinate-plot-CNWQqlxf.js} +194 -178
- package/dist/{vue-ui-quadrant-BKHZoTml.js → vue-ui-quadrant-CxNj2FEx.js} +321 -305
- package/dist/{vue-ui-quick-chart-D_k3lbU8.js → vue-ui-quick-chart-Bm_VmhJR.js} +347 -331
- package/dist/{vue-ui-radar-Co4EOjSk.js → vue-ui-radar-DSYMQJ6K.js} +193 -177
- package/dist/{vue-ui-rating-dtNN0EdX.js → vue-ui-rating-BiQpwXnc.js} +2 -2
- package/dist/{vue-ui-relation-circle-CR4UpQzM.js → vue-ui-relation-circle-Cdxe78Bm.js} +188 -172
- package/dist/{vue-ui-ridgeline-BKX97EnR.js → vue-ui-ridgeline-DpeM2hRi.js} +212 -196
- package/dist/{vue-ui-rings-EPTwyt6D.js → vue-ui-rings-BenmQHKv.js} +223 -210
- package/dist/{vue-ui-scatter-BlxzblSR.js → vue-ui-scatter-mDMY1H6U.js} +288 -273
- package/dist/{vue-ui-skeleton-CjN2ZdgT.js → vue-ui-skeleton-Ch_XkFuP.js} +3 -3
- package/dist/{vue-ui-smiley-DdF_ErYG.js → vue-ui-smiley-DTig5lTU.js} +2 -2
- package/dist/{vue-ui-spark-trend-RdOlCuT9.js → vue-ui-spark-trend-BkDsp8E0.js} +3 -3
- package/dist/{vue-ui-sparkbar-DWufRGcN.js → vue-ui-sparkbar-CgqoyBOm.js} +3 -3
- package/dist/{vue-ui-sparkgauge-IP1O3qyT.js → vue-ui-sparkgauge-B4jR_Y62.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-Cnv9xZ8H.js → vue-ui-sparkhistogram-DfxjglLy.js} +4 -4
- package/dist/{vue-ui-sparkline-CYgeD5V3.js → vue-ui-sparkline-M3QR8xJE.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-BCwoK9xd.js → vue-ui-sparkstackbar-B2Ls-Mb8.js} +3 -3
- package/dist/{vue-ui-stackbar-CqFIvfrK.js → vue-ui-stackbar-DIHkn6__.js} +497 -474
- package/dist/{vue-ui-strip-plot-Dq-kDRai.js → vue-ui-strip-plot-B_ZLbu2D.js} +241 -225
- package/dist/{vue-ui-table-vaIdQnPl.js → vue-ui-table-BhymhDOh.js} +3 -3
- package/dist/{vue-ui-table-heatmap-U_Td0cdh.js → vue-ui-table-heatmap-DokRh4dS.js} +26 -25
- package/dist/{vue-ui-table-sparkline-DkOaHx5L.js → vue-ui-table-sparkline-DxBZGKZJ.js} +8 -7
- package/dist/{vue-ui-thermometer-CzckBZgs.js → vue-ui-thermometer-e2L6IdF-.js} +170 -154
- package/dist/{vue-ui-timer-DSdUshUs.js → vue-ui-timer-BG2EwK3o.js} +5 -5
- package/dist/vue-ui-tiremarks-nzQH7woJ.js +358 -0
- package/dist/vue-ui-treemap-CZxyi6fl.js +965 -0
- package/dist/{vue-ui-vertical-bar-Dd4sYeAC.js → vue-ui-vertical-bar-DahdX1Sn.js} +382 -360
- package/dist/{vue-ui-waffle-DusUVY6y.js → vue-ui-waffle-D399D4UE.js} +234 -221
- package/dist/vue-ui-wheel-DtcwtHzJ.js +352 -0
- package/dist/{vue-ui-word-cloud-_7uYjJ5A.js → vue-ui-word-cloud-CTDceQsf.js} +249 -233
- package/dist/{vue-ui-world-COIyBHII.js → vue-ui-world-BjNSbqMZ.js} +239 -223
- package/dist/vue-ui-xy-BkTP-JpK.js +2958 -0
- package/dist/{vue-ui-xy-canvas-CuYRyub2.js → vue-ui-xy-canvas-BKAowbe0.js} +447 -431
- package/package.json +2 -2
- package/dist/Tooltip-hVZUY_s5.js +0 -149
- package/dist/img-BeMVTwmF.js +0 -20
- package/dist/pdf-DPxOdzfi.js +0 -51
- package/dist/useMouse-AicQS8Vf.js +0 -13
- package/dist/vue-data-ui-nceqWRts.js +0 -301
- package/dist/vue-ui-donut-DSE7ubVv.js +0 -1315
- package/dist/vue-ui-nested-donuts-CYe0Are_.js +0 -1154
- package/dist/vue-ui-tiremarks-B2WWklqG.js +0 -342
- package/dist/vue-ui-treemap-D1dgDhjG.js +0 -952
- package/dist/vue-ui-wheel-ClsKBh52.js +0 -336
- package/dist/vue-ui-xy-C_OUyzTC.js +0 -3135
|
@@ -0,0 +1,965 @@
|
|
|
1
|
+
import { defineAsyncComponent as J, useSlots as Ot, onMounted as st, computed as b, ref as $, shallowRef as B, watch as _t, onBeforeUnmount as St, createElementBlock as y, openBlock as h, unref as d, normalizeStyle as L, normalizeClass as $e, createBlock as Q, createCommentVNode as _, createElementVNode as S, createVNode as xe, createSlots as It, withCtx as O, renderSlot as w, normalizeProps as ee, guardReactiveProps as te, Fragment as ge, renderList as Te, withKeys as ut, withModifiers as Oe, mergeProps as rt, createTextVNode as _e, toDisplayString as X, nextTick as Ft } from "vue";
|
|
2
|
+
import { u as Nt, c as Se, t as Pt, p as I, a as zt, b as At, o as Rt, e as Vt, d as ye, i as me, f as ie, X as Lt, l as it, F as ct, x as dt, q as Mt, r as Dt, y as Bt } from "./index-BzfnuLnw.js";
|
|
3
|
+
import { t as Ht, u as Ut } from "./useResponsive-DfdjqQps.js";
|
|
4
|
+
import { u as vt } from "./useNestedProp-DorElw91.js";
|
|
5
|
+
import { u as Et } from "./usePrinter-C9qkgv0r.js";
|
|
6
|
+
import { u as Wt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
7
|
+
import { u as qt } from "./useChartAccessibility-9icAAmYg.js";
|
|
8
|
+
import Gt from "./BaseIcon-BmZ4MREl.js";
|
|
9
|
+
import Xt from "./Title-pVYRzQXY.js";
|
|
10
|
+
import jt from "./Legend-CYbP3Kfg.js";
|
|
11
|
+
import Yt from "./img-ku4zevVD.js";
|
|
12
|
+
import { _ as Kt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
|
+
function ht(n, r) {
|
|
14
|
+
const s = n.length;
|
|
15
|
+
if (s === 0)
|
|
16
|
+
throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);
|
|
17
|
+
{
|
|
18
|
+
let i = 1 / 0, u = -1 / 0, v = 0;
|
|
19
|
+
for (let g = 0; g < s; g += 1) {
|
|
20
|
+
const p = n[g].normalizedValue;
|
|
21
|
+
p < i && (i = p), p > u && (u = p), v += p;
|
|
22
|
+
}
|
|
23
|
+
return Math.max(
|
|
24
|
+
r ** 2 * u / v ** 2,
|
|
25
|
+
v ** 2 / (r ** 2 * i)
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function pt(n) {
|
|
30
|
+
const { xOffset: r, yOffset: s, width: i, height: u } = n;
|
|
31
|
+
return {
|
|
32
|
+
x0: r,
|
|
33
|
+
y0: s,
|
|
34
|
+
x1: r + i,
|
|
35
|
+
y1: s + u
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function Zt(n, r, s) {
|
|
39
|
+
if (n.length === 0)
|
|
40
|
+
return !0;
|
|
41
|
+
{
|
|
42
|
+
const i = n.concat(r), u = ht(
|
|
43
|
+
n,
|
|
44
|
+
s
|
|
45
|
+
), v = ht(i, s);
|
|
46
|
+
return u >= v;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function Jt(n) {
|
|
50
|
+
const r = [], s = n.length;
|
|
51
|
+
for (let i = 0; i < s; i += 1) {
|
|
52
|
+
const u = n[i], v = u.length;
|
|
53
|
+
for (let c = 0; c < v; c += 1)
|
|
54
|
+
r.push(u[c]);
|
|
55
|
+
}
|
|
56
|
+
return r;
|
|
57
|
+
}
|
|
58
|
+
function Qt(n, r) {
|
|
59
|
+
const s = {
|
|
60
|
+
...r,
|
|
61
|
+
children: n
|
|
62
|
+
};
|
|
63
|
+
return gt(s);
|
|
64
|
+
}
|
|
65
|
+
function el(n) {
|
|
66
|
+
return (n.x1 - n.x0) * (n.y1 - n.y0);
|
|
67
|
+
}
|
|
68
|
+
function ft(n, r) {
|
|
69
|
+
const { width: s, height: i, xOffset: u, yOffset: v } = Ie(r), c = n.length, g = n.map((m) => m.normalizedValue || 0).reduce((m, x) => m + x, 0), p = g / i, H = g / s;
|
|
70
|
+
let P = u, k = v;
|
|
71
|
+
const C = [];
|
|
72
|
+
if (s >= i) {
|
|
73
|
+
for (let m = 0; m < c; m += 1) {
|
|
74
|
+
const x = n[m], M = k + x.normalizedValue / p, z = {
|
|
75
|
+
x0: P,
|
|
76
|
+
y0: k,
|
|
77
|
+
x1: P + p,
|
|
78
|
+
y1: M
|
|
79
|
+
}, N = Object.assign({}, x, z);
|
|
80
|
+
k = M, C.push(N);
|
|
81
|
+
}
|
|
82
|
+
return C;
|
|
83
|
+
} else {
|
|
84
|
+
for (let m = 0; m < c; m += 1) {
|
|
85
|
+
const x = n[m], M = P + x.normalizedValue / H, z = {
|
|
86
|
+
x0: P,
|
|
87
|
+
y0: k,
|
|
88
|
+
x1: M,
|
|
89
|
+
y1: k + H
|
|
90
|
+
}, N = Object.assign({}, x, z);
|
|
91
|
+
P = M, C.push(N);
|
|
92
|
+
}
|
|
93
|
+
return C;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function tl(n) {
|
|
97
|
+
const r = Ie(n), s = r.width, i = r.height;
|
|
98
|
+
return Math.min(s, i);
|
|
99
|
+
}
|
|
100
|
+
function ll(n, r) {
|
|
101
|
+
const s = n.length, i = n.map((p) => p.value ?? 0).reduce((p, H) => p + H, 0), u = r / i, v = [];
|
|
102
|
+
let c, g;
|
|
103
|
+
for (let p = 0; p < s; p += 1)
|
|
104
|
+
g = n[p], c = Object.assign({}, g, {
|
|
105
|
+
normalizedValue: g.value * (u || 0)
|
|
106
|
+
}), v.push(c);
|
|
107
|
+
return v;
|
|
108
|
+
}
|
|
109
|
+
function Ie(n) {
|
|
110
|
+
const { x0: r, y0: s, x1: i, y1: u } = n;
|
|
111
|
+
return {
|
|
112
|
+
xOffset: r,
|
|
113
|
+
yOffset: s,
|
|
114
|
+
width: i - r,
|
|
115
|
+
height: u - s
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function ol(n, r, s, i) {
|
|
119
|
+
let u = n, v = r, c = s, g = i;
|
|
120
|
+
for (; ; ) {
|
|
121
|
+
const p = u.length;
|
|
122
|
+
if (p === 0) {
|
|
123
|
+
const C = ft(v, c);
|
|
124
|
+
return g.concat(C);
|
|
125
|
+
}
|
|
126
|
+
const H = tl(c), P = u[0], k = u.slice(1, p);
|
|
127
|
+
if (Zt(v, P, H)) {
|
|
128
|
+
const C = v.concat(P);
|
|
129
|
+
u = k, v = C, c = c, g = g;
|
|
130
|
+
} else {
|
|
131
|
+
const C = v.length;
|
|
132
|
+
let m = 0;
|
|
133
|
+
for (let N = 0; N < C; N += 1)
|
|
134
|
+
m += v[N].normalizedValue;
|
|
135
|
+
const x = al(c, m), M = ft(v, c), z = g.concat(M);
|
|
136
|
+
u = u, v = [], c = x, g = z;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function gt(n) {
|
|
141
|
+
if (typeof n.children > "u" || !n.children.length)
|
|
142
|
+
return [n];
|
|
143
|
+
{
|
|
144
|
+
const r = ll(
|
|
145
|
+
n.children,
|
|
146
|
+
el(n)
|
|
147
|
+
), s = ol(r, [], n, []), i = s.length, u = [];
|
|
148
|
+
for (let c = 0; c < i; c += 1)
|
|
149
|
+
u.push(gt(s[c]));
|
|
150
|
+
return Jt(u);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function al(n, r) {
|
|
154
|
+
const { width: s, height: i, xOffset: u, yOffset: v } = Ie(n);
|
|
155
|
+
if (s >= i) {
|
|
156
|
+
const c = r / i, g = s - c, p = {
|
|
157
|
+
xOffset: u + c,
|
|
158
|
+
yOffset: v,
|
|
159
|
+
width: g,
|
|
160
|
+
height: i
|
|
161
|
+
};
|
|
162
|
+
return pt(p);
|
|
163
|
+
} else {
|
|
164
|
+
const c = r / s, g = i - c, p = {
|
|
165
|
+
xOffset: u,
|
|
166
|
+
yOffset: v + c,
|
|
167
|
+
width: s,
|
|
168
|
+
height: g
|
|
169
|
+
};
|
|
170
|
+
return pt(p);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const nl = ["id"], sl = {
|
|
174
|
+
key: 4,
|
|
175
|
+
class: "vue-ui-treemap-breadcrumbs",
|
|
176
|
+
"data-dom-to-png-ignore": ""
|
|
177
|
+
}, ul = ["tabindex", "onClick", "onKeydown", "data-last-crumb", "onMouseenter", "onFocus"], rl = { class: "vue-ui-treemap-crumb-unit" }, il = { class: "vue-ui-treemap-crumb-unit-label" }, cl = {
|
|
178
|
+
key: 0,
|
|
179
|
+
style: { width: "24px", display: "flex", "align-items": "center" }
|
|
180
|
+
}, dl = {
|
|
181
|
+
key: 0,
|
|
182
|
+
class: "vue-ui-treemap-crumb-unit-arrow"
|
|
183
|
+
}, vl = ["xmlns", "viewBox"], hl = { key: 0 }, pl = ["id"], fl = ["stop-color"], gl = ["stop-color"], yl = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width", "onClick", "onMouseenter"], ml = ["x", "y", "height", "width"], bl = {
|
|
184
|
+
style: { width: "100%", height: "100%" },
|
|
185
|
+
class: "vue-ui-treemap-cell"
|
|
186
|
+
}, wl = {
|
|
187
|
+
key: 6,
|
|
188
|
+
class: "vue-data-ui-watermark"
|
|
189
|
+
}, kl = ["onClick"], Cl = ["innerHTML"], $l = {
|
|
190
|
+
__name: "vue-ui-treemap",
|
|
191
|
+
props: {
|
|
192
|
+
config: {
|
|
193
|
+
type: Object,
|
|
194
|
+
default() {
|
|
195
|
+
return {};
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
dataset: {
|
|
199
|
+
type: Array,
|
|
200
|
+
default() {
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
emits: ["selectLegend", "selectDatapoint"],
|
|
206
|
+
setup(n, { expose: r, emit: s }) {
|
|
207
|
+
const i = J(() => import("./DataTable-CgL0Rz0x.js")), u = J(() => import("./PenAndPaper-Cx1-5zdD.js")), v = J(() => import("./vue-ui-accordion-DgZK-qDz.js")), c = J(() => import("./vue-ui-skeleton-Ch_XkFuP.js")), g = J(() => import("./Tooltip-NwATo4ZJ.js")), p = J(() => import("./UserOptions-DAsRxxrf.js")), H = J(() => import("./PackageVersion-CAkNkiIG.js")), { vue_ui_treemap: P } = Nt(), k = n, C = s, m = Ot();
|
|
208
|
+
st(() => {
|
|
209
|
+
m["chart-background"] && console.warn("VueUiTreemap does not support the #chart-background slot.");
|
|
210
|
+
});
|
|
211
|
+
const x = b(() => !!k.dataset && k.dataset.length), M = b(() => /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), z = $(Se()), N = $(!1), be = $(""), le = $(!1), Fe = $(0), A = $([]), U = B(null), Ne = B(null), Pe = B(null), ze = B(null), Ae = B(null), Re = $(0), Ve = $(0), Le = $(0), e = b({
|
|
212
|
+
get: () => He(),
|
|
213
|
+
set: (t) => t
|
|
214
|
+
}), { userOptionsVisible: we, setUserOptionsVisibility: Me, keepUserOptionState: De } = Wt({ config: e.value }), { svgRef: Be } = qt({ config: e.value.style.chart.title });
|
|
215
|
+
function He() {
|
|
216
|
+
const t = vt({
|
|
217
|
+
userConfig: k.config,
|
|
218
|
+
defaultConfig: P
|
|
219
|
+
});
|
|
220
|
+
return t.theme ? {
|
|
221
|
+
...vt({
|
|
222
|
+
userConfig: zt.vue_ui_treemap[t.theme] || k.config,
|
|
223
|
+
defaultConfig: t
|
|
224
|
+
}),
|
|
225
|
+
customPalette: Pt[t.theme] || I
|
|
226
|
+
} : t;
|
|
227
|
+
}
|
|
228
|
+
_t(() => k.config, (t) => {
|
|
229
|
+
e.value = He(), we.value = !e.value.userOptions.showOnChartHover, Re.value += 1, Ve.value += 1, Le.value += 1, R.value.showTable = e.value.table.show, R.value.showTooltip = e.value.style.chart.tooltip.show;
|
|
230
|
+
}, { deep: !0 });
|
|
231
|
+
const { isPrinting: Ue, isImaging: Ee, generatePdf: We, generateImage: qe } = Et({
|
|
232
|
+
elementId: `treemap_${z.value}`,
|
|
233
|
+
fileName: e.value.style.chart.title.text || "vue-ui-treemap",
|
|
234
|
+
options: e.value.userOptions.print
|
|
235
|
+
}), yt = b(() => e.value.userOptions.show && !e.value.style.chart.title.text), ce = b(() => At(e.value.customPalette)), R = $({
|
|
236
|
+
showTable: e.value.table.show,
|
|
237
|
+
showTooltip: e.value.style.chart.tooltip.show
|
|
238
|
+
}), E = $({
|
|
239
|
+
height: e.value.style.chart.height,
|
|
240
|
+
width: e.value.style.chart.width
|
|
241
|
+
}), j = b(() => ({
|
|
242
|
+
bottom: E.value.height - e.value.style.chart.padding.bottom,
|
|
243
|
+
height: E.value.height - e.value.style.chart.padding.top - e.value.style.chart.padding.bottom,
|
|
244
|
+
left: e.value.style.chart.padding.left,
|
|
245
|
+
right: E.value.width - e.value.style.chart.padding.right,
|
|
246
|
+
top: e.value.style.chart.padding.top,
|
|
247
|
+
vbHeight: E.value.height,
|
|
248
|
+
vbWidth: E.value.width,
|
|
249
|
+
width: E.value.width - e.value.style.chart.padding.left - e.value.style.chart.padding.right
|
|
250
|
+
}));
|
|
251
|
+
function Ge(t) {
|
|
252
|
+
t.forEach((o, l) => {
|
|
253
|
+
o.id = Se(), o.color = ye(o.color) || ce.value[l] || I[l] || I[l % I.length], o.children && (o.children.forEach((a) => {
|
|
254
|
+
a.parentId = o.id, a.color = o.color;
|
|
255
|
+
}), Ge(o.children));
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
const W = B(k.dataset), q = B(null), oe = B(null);
|
|
259
|
+
st(() => {
|
|
260
|
+
mt();
|
|
261
|
+
});
|
|
262
|
+
function mt() {
|
|
263
|
+
if (Rt(k.dataset) && Vt({
|
|
264
|
+
componentName: "VueUiTreemap",
|
|
265
|
+
type: "dataset"
|
|
266
|
+
}), Ge(W.value), e.value.responsive) {
|
|
267
|
+
const t = Ht(() => {
|
|
268
|
+
const { width: o, height: l } = Ut({
|
|
269
|
+
chart: U.value,
|
|
270
|
+
title: e.value.style.chart.title.text ? Ne.value : null,
|
|
271
|
+
legend: e.value.style.chart.legend.show ? Pe.value : null,
|
|
272
|
+
source: ze.value,
|
|
273
|
+
noTitle: Ae.value
|
|
274
|
+
});
|
|
275
|
+
requestAnimationFrame(() => {
|
|
276
|
+
E.value.width = o, E.value.height = l;
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
q.value && (oe.value && q.value.unobserve(oe.value), q.value.disconnect()), q.value = new ResizeObserver(t), oe.value = U.value.parentNode, q.value.observe(oe.value);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
St(() => {
|
|
283
|
+
q.value && (oe.value && q.value.unobserve(oe.value), q.value.disconnect());
|
|
284
|
+
});
|
|
285
|
+
const ae = $(W.value), ue = b(() => ae.value.map((t, o) => ({
|
|
286
|
+
...t,
|
|
287
|
+
color: ye(t.color) || ce.value[o] || I[o] || I[o % I.length]
|
|
288
|
+
})).filter((t) => !A.value.includes(t.id))), ne = b(() => W.value.filter((t) => !A.value.includes(t.id)).map((t) => t.value || 0).reduce((t, o) => t + o, 0)), Xe = b({
|
|
289
|
+
get() {
|
|
290
|
+
let t = [...ue.value];
|
|
291
|
+
return e.value.style.chart.layout.sorted && (t = [...ue.value].sort((o, l) => l.value - o.value)), t.map((o) => ({
|
|
292
|
+
...o
|
|
293
|
+
}));
|
|
294
|
+
},
|
|
295
|
+
set(t) {
|
|
296
|
+
return t;
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
function je(t, o) {
|
|
300
|
+
return t.value / o;
|
|
301
|
+
}
|
|
302
|
+
function bt(t, o, l) {
|
|
303
|
+
const a = e.value.style.chart.layout.rects.colorRatio - je(o, l);
|
|
304
|
+
return it(t, a < 0 ? 0 : a);
|
|
305
|
+
}
|
|
306
|
+
function Ye(t, o, l, a) {
|
|
307
|
+
return t.map((f, T) => {
|
|
308
|
+
const fe = bt(ye(o) || ce.value[T] || I[T] || I[T % I.length], f, a), Tt = je(f, a);
|
|
309
|
+
return {
|
|
310
|
+
...f,
|
|
311
|
+
color: fe,
|
|
312
|
+
proportion: Tt,
|
|
313
|
+
parentName: l,
|
|
314
|
+
children: f.children ? Ye(f.children, fe, f.name, a) : void 0
|
|
315
|
+
};
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
const re = b(() => Qt(
|
|
319
|
+
Xe.value.map((t, o) => {
|
|
320
|
+
const l = t.children ? t.children.reduce((a, f) => a + f.value, 0) : t.value;
|
|
321
|
+
return {
|
|
322
|
+
value: t.value,
|
|
323
|
+
id: t.id || Se(),
|
|
324
|
+
children: t.children ? Ye(t.children.sort((a, f) => f.value - a.value), t.color, t.name, l) : void 0,
|
|
325
|
+
color: t.color,
|
|
326
|
+
name: t.name
|
|
327
|
+
};
|
|
328
|
+
}),
|
|
329
|
+
{ x0: j.value.left * 2, y0: j.value.top, x1: j.value.width, y1: j.value.height }
|
|
330
|
+
));
|
|
331
|
+
function Ke({ y0: t, y1: o }) {
|
|
332
|
+
return o - t <= 0 ? 1e-4 : o - t;
|
|
333
|
+
}
|
|
334
|
+
function Ze({ x0: t, x1: o }) {
|
|
335
|
+
return o - t <= 0 ? 1e-4 : o - t;
|
|
336
|
+
}
|
|
337
|
+
function Y(t) {
|
|
338
|
+
const o = e.value.style.chart.layout.labels.fontSize * (t.proportion * 2 > 1 ? 1 : t.proportion * 2);
|
|
339
|
+
return o < e.value.style.chart.layout.labels.minFontSize ? e.value.style.chart.layout.labels.minFontSize : o;
|
|
340
|
+
}
|
|
341
|
+
function Je(t) {
|
|
342
|
+
le.value = t, Fe.value += 1;
|
|
343
|
+
}
|
|
344
|
+
const se = b(() => ({
|
|
345
|
+
startX: 0,
|
|
346
|
+
startY: 0,
|
|
347
|
+
width: j.value.vbWidth,
|
|
348
|
+
height: j.value.vbHeight
|
|
349
|
+
}));
|
|
350
|
+
function K(t, o = W.value) {
|
|
351
|
+
for (const l of o) {
|
|
352
|
+
if (l.id === t)
|
|
353
|
+
return l;
|
|
354
|
+
if (l.children) {
|
|
355
|
+
const a = K(t, l.children);
|
|
356
|
+
if (a)
|
|
357
|
+
return a;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
const F = $([]), Z = b(() => F.value.length > 0);
|
|
363
|
+
function de(t) {
|
|
364
|
+
if (!t) {
|
|
365
|
+
ae.value = W.value.slice(), C("selectDatapoint", void 0), F.value = [];
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
const o = K(t.id);
|
|
369
|
+
if (o && o.children?.length)
|
|
370
|
+
F.value.push(o.id), ae.value = o.children.slice(), C("selectDatapoint", t);
|
|
371
|
+
else if (t.parentId) {
|
|
372
|
+
F.value.push(t.parentId);
|
|
373
|
+
const l = K(t.parentId);
|
|
374
|
+
ae.value = l.children.slice(), C("selectDatapoint", t);
|
|
375
|
+
} else if (F.value.length > 0) {
|
|
376
|
+
F.value.pop();
|
|
377
|
+
const l = F.value[F.value.length - 1];
|
|
378
|
+
if (l) {
|
|
379
|
+
const a = K(l);
|
|
380
|
+
ae.value = a.children.slice();
|
|
381
|
+
} else
|
|
382
|
+
ae.value = W.value.slice(), F.value = [], C("selectDatapoint", void 0);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
function wt(t) {
|
|
386
|
+
return !!(K(t.id)?.children?.length || t.parentId);
|
|
387
|
+
}
|
|
388
|
+
const G = b(() => {
|
|
389
|
+
const t = [
|
|
390
|
+
{ id: null, label: "All" }
|
|
391
|
+
];
|
|
392
|
+
if (F.value.length > 0) {
|
|
393
|
+
let o = K(F.value[F.value.length - 1]);
|
|
394
|
+
const l = [];
|
|
395
|
+
for (; o; )
|
|
396
|
+
l.unshift(o), o = o.parentId ? K(o.parentId) : null;
|
|
397
|
+
for (const a of l)
|
|
398
|
+
t.push({
|
|
399
|
+
id: a.id,
|
|
400
|
+
label: a.name,
|
|
401
|
+
node: a
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
return t;
|
|
405
|
+
}), V = B(null), Qe = b(() => W.value.map((t, o) => ({
|
|
406
|
+
...t,
|
|
407
|
+
color: ye(t.color) || ce.value[o] || I[o] || I[o % I.length],
|
|
408
|
+
shape: "square"
|
|
409
|
+
})).sort((t, o) => o.value - t.value).map((t, o) => ({
|
|
410
|
+
...t,
|
|
411
|
+
proportion: t.value / W.value.map((l) => l.value).reduce((l, a) => l + a, 0),
|
|
412
|
+
opacity: A.value.includes(t.id) ? 0.5 : 1
|
|
413
|
+
}))), kt = b(() => ({
|
|
414
|
+
cy: "treemap-div-legend",
|
|
415
|
+
backgroundColor: e.value.style.chart.legend.backgroundColor,
|
|
416
|
+
color: e.value.style.chart.legend.color,
|
|
417
|
+
fontSize: e.value.style.chart.legend.fontSize,
|
|
418
|
+
paddingBottom: 12,
|
|
419
|
+
fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
|
|
420
|
+
}));
|
|
421
|
+
function et(t) {
|
|
422
|
+
V.value = null, A.value.includes(t.id) ? A.value = A.value.filter((o) => o !== t.id) : A.value.length < k.dataset.length - 1 && A.value.push(t.id), C("selectLegend", Xe.value);
|
|
423
|
+
}
|
|
424
|
+
const ke = $(null);
|
|
425
|
+
function Ct({ datapoint: t, seriesIndex: o }) {
|
|
426
|
+
V.value = t, ke.value = { datapoint: t, seriesIndex: o, config: e.value, series: ue.value };
|
|
427
|
+
const l = e.value.style.chart.tooltip.customFormat;
|
|
428
|
+
if (dt(l) && Bt(() => l({
|
|
429
|
+
seriesIndex: o,
|
|
430
|
+
datapoint: t,
|
|
431
|
+
series: ue.value,
|
|
432
|
+
config: e.value
|
|
433
|
+
})))
|
|
434
|
+
be.value = l({
|
|
435
|
+
seriesIndex: o,
|
|
436
|
+
datapoint: t,
|
|
437
|
+
series: ue.value,
|
|
438
|
+
config: e.value
|
|
439
|
+
});
|
|
440
|
+
else {
|
|
441
|
+
let a = "";
|
|
442
|
+
a += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${t.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="${t.color}"/></svg>`, a += `<b>${me(
|
|
443
|
+
e.value.style.chart.layout.labels.formatter,
|
|
444
|
+
t.value,
|
|
445
|
+
ie({
|
|
446
|
+
p: e.value.style.chart.layout.labels.prefix,
|
|
447
|
+
v: t.value,
|
|
448
|
+
s: e.value.style.chart.layout.labels.suffix,
|
|
449
|
+
r: e.value.style.chart.tooltip.roundingValue
|
|
450
|
+
}),
|
|
451
|
+
{ datapoint: t, seriesIndex: o }
|
|
452
|
+
)}</b>`, be.value = `<div>${a}</div>`;
|
|
453
|
+
}
|
|
454
|
+
N.value = !0;
|
|
455
|
+
}
|
|
456
|
+
const D = b(() => {
|
|
457
|
+
const t = re.value.map((l) => ({
|
|
458
|
+
name: l.name,
|
|
459
|
+
color: l.color
|
|
460
|
+
})), o = re.value.map((l) => l.value);
|
|
461
|
+
return { head: t, body: o };
|
|
462
|
+
});
|
|
463
|
+
function tt(t = null) {
|
|
464
|
+
Ft(() => {
|
|
465
|
+
const o = D.value.head.map((f, T) => [[
|
|
466
|
+
f.name
|
|
467
|
+
], [D.value.body[T]], [isNaN(D.value.body[T] / ne.value) ? "-" : D.value.body[T] / ne.value * 100]]), l = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(o), a = Mt(l);
|
|
468
|
+
t ? t(a) : Dt({ csvContent: a, title: e.value.style.chart.title.text || "vue-ui-treemap" });
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
const ve = b(() => {
|
|
472
|
+
const t = [
|
|
473
|
+
e.value.table.columnNames.series,
|
|
474
|
+
e.value.table.columnNames.value,
|
|
475
|
+
e.value.table.columnNames.percentage
|
|
476
|
+
], o = D.value.head.map((f, T) => {
|
|
477
|
+
const fe = me(
|
|
478
|
+
e.value.style.chart.layout.labels.formatter,
|
|
479
|
+
D.value.body[T],
|
|
480
|
+
ie({
|
|
481
|
+
p: e.value.style.chart.layout.labels.prefix,
|
|
482
|
+
v: D.value.body[T],
|
|
483
|
+
s: e.value.style.chart.layout.labels.suffix,
|
|
484
|
+
r: e.value.table.td.roundingValue
|
|
485
|
+
})
|
|
486
|
+
);
|
|
487
|
+
return [
|
|
488
|
+
{
|
|
489
|
+
color: f.color,
|
|
490
|
+
name: f.name,
|
|
491
|
+
shape: "square"
|
|
492
|
+
},
|
|
493
|
+
fe,
|
|
494
|
+
isNaN(D.value.body[T] / ne.value) ? "-" : ie({
|
|
495
|
+
v: D.value.body[T] / ne.value * 100,
|
|
496
|
+
s: "%",
|
|
497
|
+
r: e.value.table.td.roundingPercentage
|
|
498
|
+
})
|
|
499
|
+
];
|
|
500
|
+
}), l = {
|
|
501
|
+
th: {
|
|
502
|
+
backgroundColor: e.value.table.th.backgroundColor,
|
|
503
|
+
color: e.value.table.th.color,
|
|
504
|
+
outline: e.value.table.th.outline
|
|
505
|
+
},
|
|
506
|
+
td: {
|
|
507
|
+
backgroundColor: e.value.table.td.backgroundColor,
|
|
508
|
+
color: e.value.table.td.color,
|
|
509
|
+
outline: e.value.table.td.outline
|
|
510
|
+
},
|
|
511
|
+
breakpoint: e.value.table.responsiveBreakpoint
|
|
512
|
+
};
|
|
513
|
+
return {
|
|
514
|
+
colNames: [
|
|
515
|
+
e.value.table.columnNames.series,
|
|
516
|
+
e.value.table.columnNames.value
|
|
517
|
+
],
|
|
518
|
+
head: t,
|
|
519
|
+
body: o,
|
|
520
|
+
config: l
|
|
521
|
+
};
|
|
522
|
+
});
|
|
523
|
+
function $t() {
|
|
524
|
+
return re.value;
|
|
525
|
+
}
|
|
526
|
+
function lt() {
|
|
527
|
+
R.value.showTable = !R.value.showTable;
|
|
528
|
+
}
|
|
529
|
+
function ot() {
|
|
530
|
+
R.value.showTooltip = !R.value.showTooltip;
|
|
531
|
+
}
|
|
532
|
+
const he = $(!1);
|
|
533
|
+
function Ce() {
|
|
534
|
+
he.value = !he.value;
|
|
535
|
+
}
|
|
536
|
+
const pe = $(null);
|
|
537
|
+
function at(t) {
|
|
538
|
+
pe.value = t;
|
|
539
|
+
}
|
|
540
|
+
function nt() {
|
|
541
|
+
pe.value = null;
|
|
542
|
+
}
|
|
543
|
+
async function xt({ scale: t = 2 } = {}) {
|
|
544
|
+
if (!U.value) return;
|
|
545
|
+
const { width: o, height: l } = U.value.getBoundingClientRect(), a = o / l, { imageUri: f, base64: T } = await Yt({ domElement: U.value, base64: !0, img: !0, scale: t });
|
|
546
|
+
return {
|
|
547
|
+
imageUri: f,
|
|
548
|
+
base64: T,
|
|
549
|
+
title: e.value.style.chart.title.text,
|
|
550
|
+
width: o,
|
|
551
|
+
height: l,
|
|
552
|
+
aspectRatio: a
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
return r({
|
|
556
|
+
getData: $t,
|
|
557
|
+
getImage: xt,
|
|
558
|
+
generateCsv: tt,
|
|
559
|
+
generateImage: qe,
|
|
560
|
+
generatePdf: We,
|
|
561
|
+
toggleTable: lt,
|
|
562
|
+
toggleTooltip: ot,
|
|
563
|
+
toggleAnnotator: Ce,
|
|
564
|
+
toggleFullscreen: Je
|
|
565
|
+
}), (t, o) => (h(), y("div", {
|
|
566
|
+
ref_key: "treemapChart",
|
|
567
|
+
ref: U,
|
|
568
|
+
class: $e(`vue-ui-treemap ${le.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
|
|
569
|
+
style: L(`font-family:${e.value.style.fontFamily};width:100%; ${e.value.responsive ? "height: 100%;" : ""} text-align:center;background:${e.value.style.chart.backgroundColor}`),
|
|
570
|
+
id: `treemap_${z.value}`,
|
|
571
|
+
onMouseenter: o[3] || (o[3] = () => d(Me)(!0)),
|
|
572
|
+
onMouseleave: o[4] || (o[4] = () => d(Me)(!1))
|
|
573
|
+
}, [
|
|
574
|
+
e.value.userOptions.buttons.annotator ? (h(), Q(d(u), {
|
|
575
|
+
key: 0,
|
|
576
|
+
svgRef: d(Be),
|
|
577
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
578
|
+
color: e.value.style.chart.color,
|
|
579
|
+
active: he.value,
|
|
580
|
+
onClose: Ce
|
|
581
|
+
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : _("", !0),
|
|
582
|
+
yt.value ? (h(), y("div", {
|
|
583
|
+
key: 1,
|
|
584
|
+
ref_key: "noTitle",
|
|
585
|
+
ref: Ae,
|
|
586
|
+
class: "vue-data-ui-no-title-space",
|
|
587
|
+
style: "height:36px; width: 100%;background:transparent"
|
|
588
|
+
}, null, 512)) : _("", !0),
|
|
589
|
+
e.value.style.chart.title.text ? (h(), y("div", {
|
|
590
|
+
key: 2,
|
|
591
|
+
ref_key: "chartTitle",
|
|
592
|
+
ref: Ne,
|
|
593
|
+
style: L(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:6px`)
|
|
594
|
+
}, [
|
|
595
|
+
(h(), Q(Xt, {
|
|
596
|
+
key: `title_${Re.value}`,
|
|
597
|
+
config: {
|
|
598
|
+
title: {
|
|
599
|
+
cy: "treemap-div-title",
|
|
600
|
+
...e.value.style.chart.title
|
|
601
|
+
},
|
|
602
|
+
subtitle: {
|
|
603
|
+
cy: "treemap-div-subtitle",
|
|
604
|
+
...e.value.style.chart.title.subtitle
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}, null, 8, ["config"]))
|
|
608
|
+
], 4)) : _("", !0),
|
|
609
|
+
e.value.userOptions.show && x.value && (d(De) || d(we)) ? (h(), Q(d(p), {
|
|
610
|
+
ref: "details",
|
|
611
|
+
key: `user_option_${Fe.value}`,
|
|
612
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
613
|
+
color: e.value.style.chart.color,
|
|
614
|
+
isPrinting: d(Ue),
|
|
615
|
+
isImaging: d(Ee),
|
|
616
|
+
uid: z.value,
|
|
617
|
+
hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
|
|
618
|
+
hasPdf: e.value.userOptions.buttons.pdf,
|
|
619
|
+
hasXls: e.value.userOptions.buttons.csv,
|
|
620
|
+
hasImg: e.value.userOptions.buttons.img,
|
|
621
|
+
hasTable: e.value.userOptions.buttons.table,
|
|
622
|
+
hasFullscreen: e.value.userOptions.buttons.fullscreen,
|
|
623
|
+
isFullscreen: le.value,
|
|
624
|
+
isTooltip: R.value.showTooltip,
|
|
625
|
+
titles: { ...e.value.userOptions.buttonTitles },
|
|
626
|
+
chartElement: U.value,
|
|
627
|
+
position: e.value.userOptions.position,
|
|
628
|
+
hasAnnotator: e.value.userOptions.buttons.annotator,
|
|
629
|
+
isAnnotation: he.value,
|
|
630
|
+
callbacks: e.value.userOptions.callbacks,
|
|
631
|
+
printScale: e.value.userOptions.print.scale,
|
|
632
|
+
onToggleFullscreen: Je,
|
|
633
|
+
onGeneratePdf: d(We),
|
|
634
|
+
onGenerateCsv: tt,
|
|
635
|
+
onGenerateImage: d(qe),
|
|
636
|
+
onToggleTable: lt,
|
|
637
|
+
onToggleTooltip: ot,
|
|
638
|
+
onToggleAnnotator: Ce,
|
|
639
|
+
style: L({
|
|
640
|
+
visibility: d(De) ? d(we) ? "visible" : "hidden" : "visible"
|
|
641
|
+
})
|
|
642
|
+
}, It({ _: 2 }, [
|
|
643
|
+
t.$slots.menuIcon ? {
|
|
644
|
+
name: "menuIcon",
|
|
645
|
+
fn: O(({ isOpen: l, color: a }) => [
|
|
646
|
+
w(t.$slots, "menuIcon", ee(te({ isOpen: l, color: a })), void 0, !0)
|
|
647
|
+
]),
|
|
648
|
+
key: "0"
|
|
649
|
+
} : void 0,
|
|
650
|
+
t.$slots.optionTooltip ? {
|
|
651
|
+
name: "optionTooltip",
|
|
652
|
+
fn: O(() => [
|
|
653
|
+
w(t.$slots, "optionTooltip", {}, void 0, !0)
|
|
654
|
+
]),
|
|
655
|
+
key: "1"
|
|
656
|
+
} : void 0,
|
|
657
|
+
t.$slots.optionPdf ? {
|
|
658
|
+
name: "optionPdf",
|
|
659
|
+
fn: O(() => [
|
|
660
|
+
w(t.$slots, "optionPdf", {}, void 0, !0)
|
|
661
|
+
]),
|
|
662
|
+
key: "2"
|
|
663
|
+
} : void 0,
|
|
664
|
+
t.$slots.optionCsv ? {
|
|
665
|
+
name: "optionCsv",
|
|
666
|
+
fn: O(() => [
|
|
667
|
+
w(t.$slots, "optionCsv", {}, void 0, !0)
|
|
668
|
+
]),
|
|
669
|
+
key: "3"
|
|
670
|
+
} : void 0,
|
|
671
|
+
t.$slots.optionImg ? {
|
|
672
|
+
name: "optionImg",
|
|
673
|
+
fn: O(() => [
|
|
674
|
+
w(t.$slots, "optionImg", {}, void 0, !0)
|
|
675
|
+
]),
|
|
676
|
+
key: "4"
|
|
677
|
+
} : void 0,
|
|
678
|
+
t.$slots.optionTable ? {
|
|
679
|
+
name: "optionTable",
|
|
680
|
+
fn: O(() => [
|
|
681
|
+
w(t.$slots, "optionTable", {}, void 0, !0)
|
|
682
|
+
]),
|
|
683
|
+
key: "5"
|
|
684
|
+
} : void 0,
|
|
685
|
+
t.$slots.optionFullscreen ? {
|
|
686
|
+
name: "optionFullscreen",
|
|
687
|
+
fn: O(({ toggleFullscreen: l, isFullscreen: a }) => [
|
|
688
|
+
w(t.$slots, "optionFullscreen", ee(te({ toggleFullscreen: l, isFullscreen: a })), void 0, !0)
|
|
689
|
+
]),
|
|
690
|
+
key: "6"
|
|
691
|
+
} : void 0,
|
|
692
|
+
t.$slots.optionAnnotator ? {
|
|
693
|
+
name: "optionAnnotator",
|
|
694
|
+
fn: O(({ toggleAnnotator: l, isAnnotator: a }) => [
|
|
695
|
+
w(t.$slots, "optionAnnotator", ee(te({ toggleAnnotator: l, isAnnotator: a })), void 0, !0)
|
|
696
|
+
]),
|
|
697
|
+
key: "7"
|
|
698
|
+
} : void 0
|
|
699
|
+
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : _("", !0),
|
|
700
|
+
G.value.length > 1 ? (h(), y("nav", sl, [
|
|
701
|
+
(h(!0), y(ge, null, Te(G.value, (l, a) => (h(), y("span", {
|
|
702
|
+
role: "button",
|
|
703
|
+
tabindex: a < G.value.length - 1 ? 0 : void 0,
|
|
704
|
+
key: l.id || "root",
|
|
705
|
+
onClick: (f) => a === G.value.length - 1 ? () => {
|
|
706
|
+
} : de(l.node),
|
|
707
|
+
onKeydown: [
|
|
708
|
+
ut(Oe((f) => a === G.value.length - 1 ? void 0 : de(l.node), ["prevent"]), ["enter"]),
|
|
709
|
+
ut(Oe((f) => a === G.value.length - 1 ? void 0 : de(l.node), ["prevent"]), ["space"])
|
|
710
|
+
],
|
|
711
|
+
class: "vue-ui-treemap-crumb",
|
|
712
|
+
"data-last-crumb": a === G.value.length - 1,
|
|
713
|
+
style: L({
|
|
714
|
+
color: e.value.style.chart.color
|
|
715
|
+
}),
|
|
716
|
+
onMouseenter: (f) => at(a),
|
|
717
|
+
onMouseleave: nt,
|
|
718
|
+
onFocus: (f) => at(a),
|
|
719
|
+
onBlur: nt
|
|
720
|
+
}, [
|
|
721
|
+
S("span", rl, [
|
|
722
|
+
S("span", il, [
|
|
723
|
+
w(t.$slots, "breadcrumb-label", rt({ ref_for: !0 }, { crumb: l, isRoot: a === 0, isFocus: pe.value === a }), () => [
|
|
724
|
+
a === 0 ? (h(), y("div", cl, [
|
|
725
|
+
xe(Gt, {
|
|
726
|
+
name: pe.value === 0 ? "homeFilled" : "home",
|
|
727
|
+
stroke: e.value.style.chart.color
|
|
728
|
+
}, null, 8, ["name", "stroke"])
|
|
729
|
+
])) : (h(), y(ge, { key: 1 }, [
|
|
730
|
+
_e(X(l.label), 1)
|
|
731
|
+
], 64))
|
|
732
|
+
], !0)
|
|
733
|
+
]),
|
|
734
|
+
a < G.value.length - 1 ? (h(), y("span", dl, [
|
|
735
|
+
w(t.$slots, "breadcrumb-arrow", {}, () => [
|
|
736
|
+
o[5] || (o[5] = _e(" › "))
|
|
737
|
+
], !0)
|
|
738
|
+
])) : _("", !0)
|
|
739
|
+
])
|
|
740
|
+
], 44, ul))), 128))
|
|
741
|
+
])) : _("", !0),
|
|
742
|
+
x.value ? (h(), y("svg", {
|
|
743
|
+
key: 5,
|
|
744
|
+
ref_key: "svgRef",
|
|
745
|
+
ref: Be,
|
|
746
|
+
xmlns: d(Lt),
|
|
747
|
+
class: $e({ "vue-data-ui-fullscreen--on": le.value, "vue-data-ui-fulscreen--off": !le.value, "vue-data-ui-zoom-plus": !Z.value, "vue-data-ui-zoom-minus": Z.value }),
|
|
748
|
+
viewBox: `${se.value.startX} ${se.value.startY} ${se.value.width <= 0 ? 10 : se.value.width} ${se.value.height <= 0 ? 10 : se.value.height}`,
|
|
749
|
+
style: L(`max-width:100%; overflow: hidden; background:transparent;color:${e.value.style.chart.color}`)
|
|
750
|
+
}, [
|
|
751
|
+
xe(d(H)),
|
|
752
|
+
(h(!0), y(ge, null, Te(re.value, (l, a) => (h(), y("g", {
|
|
753
|
+
key: `tgrad_${l.id}`
|
|
754
|
+
}, [
|
|
755
|
+
e.value.style.chart.layout.rects.gradient.show ? (h(), y("defs", hl, [
|
|
756
|
+
S("radialGradient", {
|
|
757
|
+
id: `tgrad_${l.id}`,
|
|
758
|
+
gradientTransform: "translate(-1, -1.000001) scale(2, 2)"
|
|
759
|
+
}, [
|
|
760
|
+
S("stop", {
|
|
761
|
+
offset: "18%",
|
|
762
|
+
"stop-color": l.color
|
|
763
|
+
}, null, 8, fl),
|
|
764
|
+
S("stop", {
|
|
765
|
+
offset: "100%",
|
|
766
|
+
"stop-color": d(it)(l.color, e.value.style.chart.layout.rects.gradient.intensity / 100)
|
|
767
|
+
}, null, 8, gl)
|
|
768
|
+
], 8, pl)
|
|
769
|
+
])) : _("", !0)
|
|
770
|
+
]))), 128)),
|
|
771
|
+
(h(!0), y(ge, null, Te(re.value, (l, a) => (h(), y("g", {
|
|
772
|
+
key: `k_${l.id}`
|
|
773
|
+
}, [
|
|
774
|
+
S("rect", {
|
|
775
|
+
x: l.x0,
|
|
776
|
+
y: l.y0,
|
|
777
|
+
height: Ke(l),
|
|
778
|
+
width: Ze(l),
|
|
779
|
+
fill: M.value ? l.color : e.value.style.chart.layout.rects.gradient.show ? `url(#tgrad_${l.id})` : l.color,
|
|
780
|
+
rx: e.value.style.chart.layout.rects.borderRadius,
|
|
781
|
+
stroke: V.value && V.value.id === l.id ? e.value.style.chart.layout.rects.selected.stroke : e.value.style.chart.layout.rects.stroke,
|
|
782
|
+
"stroke-width": V.value && V.value.id === l.id ? e.value.style.chart.layout.rects.selected.strokeWidth : e.value.style.chart.layout.rects.strokeWidth,
|
|
783
|
+
onClick: Oe((f) => de(l), ["stop"]),
|
|
784
|
+
onMouseenter: () => Ct({
|
|
785
|
+
datapoint: l,
|
|
786
|
+
seriesIndex: a
|
|
787
|
+
}),
|
|
788
|
+
onMouseleave: o[0] || (o[0] = (f) => {
|
|
789
|
+
V.value = null, N.value = !1;
|
|
790
|
+
}),
|
|
791
|
+
style: L(`opacity:${V.value ? V.value.id === l.id ? 1 : e.value.style.chart.layout.rects.selected.unselectedOpacity : 1}`),
|
|
792
|
+
class: $e([
|
|
793
|
+
"vue-ui-treemap-rect",
|
|
794
|
+
wt(l) ? "vue-data-ui-zoom-plus" : Z.value ? "vue-data-ui-zoom-minus" : ""
|
|
795
|
+
])
|
|
796
|
+
}, null, 46, yl),
|
|
797
|
+
(h(), y("foreignObject", {
|
|
798
|
+
x: l.x0,
|
|
799
|
+
y: l.y0,
|
|
800
|
+
height: Ke(l),
|
|
801
|
+
width: Ze(l),
|
|
802
|
+
class: "vue-ui-treemap-cell-foreignObject"
|
|
803
|
+
}, [
|
|
804
|
+
S("div", bl, [
|
|
805
|
+
e.value.style.chart.layout.labels.showDefaultLabels && (l.proportion > e.value.style.chart.layout.labels.hideUnderProportion || Z.value) ? (h(), y("div", {
|
|
806
|
+
key: 0,
|
|
807
|
+
class: "vue-ui-treemap-cell-default",
|
|
808
|
+
style: L(`width:calc(100% - ${Y(l) / 1.5}px);text-align:left;line-height:${Y(l) < 14 ? 14 : Y(l)}px;padding:${Y(l) / 3}px; color:${d(ct)(l.color)}`)
|
|
809
|
+
}, [
|
|
810
|
+
S("span", {
|
|
811
|
+
style: L(`width:100%;font-size:${Y(l)}px;`)
|
|
812
|
+
}, X(l.name), 5),
|
|
813
|
+
o[6] || (o[6] = S("br", null, null, -1)),
|
|
814
|
+
S("span", {
|
|
815
|
+
style: L(`width:100%;font-size:${Y(l)}px;`)
|
|
816
|
+
}, X(d(me)(
|
|
817
|
+
e.value.style.chart.layout.labels.formatter,
|
|
818
|
+
l.value,
|
|
819
|
+
d(ie)({
|
|
820
|
+
p: e.value.style.chart.layout.labels.prefix,
|
|
821
|
+
v: l.value,
|
|
822
|
+
s: e.value.style.chart.layout.labels.suffix,
|
|
823
|
+
r: e.value.style.chart.layout.labels.rounding
|
|
824
|
+
}),
|
|
825
|
+
{ datapoint: l }
|
|
826
|
+
)), 5)
|
|
827
|
+
], 4)) : _("", !0),
|
|
828
|
+
w(t.$slots, "rect", rt({ ref_for: !0 }, {
|
|
829
|
+
rect: l,
|
|
830
|
+
shouldShow: l.proportion > e.value.style.chart.layout.labels.hideUnderProportion || Z.value,
|
|
831
|
+
fontSize: Y(l),
|
|
832
|
+
isZoom: Z.value,
|
|
833
|
+
textColor: d(ct)(l.color)
|
|
834
|
+
}), void 0, !0)
|
|
835
|
+
])
|
|
836
|
+
], 8, ml))
|
|
837
|
+
]))), 128)),
|
|
838
|
+
w(t.$slots, "svg", ee(te({ svg: j.value, isZoom: Z.value, rect: V.value, config: e.value })), void 0, !0)
|
|
839
|
+
], 14, vl)) : _("", !0),
|
|
840
|
+
t.$slots.watermark ? (h(), y("div", wl, [
|
|
841
|
+
w(t.$slots, "watermark", ee(te({ isPrinting: d(Ue) || d(Ee) })), void 0, !0)
|
|
842
|
+
])) : _("", !0),
|
|
843
|
+
x.value ? _("", !0) : (h(), Q(d(c), {
|
|
844
|
+
key: 7,
|
|
845
|
+
config: {
|
|
846
|
+
type: "treemap",
|
|
847
|
+
style: {
|
|
848
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
849
|
+
treemap: {
|
|
850
|
+
color: "#CCCCCC"
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}, null, 8, ["config"])),
|
|
855
|
+
S("div", {
|
|
856
|
+
ref_key: "chartLegend",
|
|
857
|
+
ref: Pe
|
|
858
|
+
}, [
|
|
859
|
+
e.value.style.chart.legend.show ? (h(), Q(jt, {
|
|
860
|
+
key: `legend_${Le.value}`,
|
|
861
|
+
legendSet: Qe.value,
|
|
862
|
+
config: kt.value,
|
|
863
|
+
id: `treemap_legend_${z.value}`,
|
|
864
|
+
onClickMarker: o[1] || (o[1] = ({ legend: l }) => et(l))
|
|
865
|
+
}, {
|
|
866
|
+
item: O(({ legend: l, index: a }) => [
|
|
867
|
+
S("div", {
|
|
868
|
+
onClick: (f) => et(l),
|
|
869
|
+
style: L(`opacity:${A.value.includes(l.id) ? 0.5 : 1}`)
|
|
870
|
+
}, X(l.name) + X(e.value.style.chart.legend.showPercentage || e.value.style.chart.legend.showValue ? ":" : "") + " " + X(e.value.style.chart.legend.showValue ? d(me)(
|
|
871
|
+
e.value.style.chart.layout.labels.formatter,
|
|
872
|
+
l.value,
|
|
873
|
+
d(ie)({
|
|
874
|
+
p: e.value.style.chart.layout.labels.prefix,
|
|
875
|
+
v: l.value,
|
|
876
|
+
s: e.value.style.chart.layout.labels.suffix,
|
|
877
|
+
r: e.value.style.chart.legend.roundingValue
|
|
878
|
+
}),
|
|
879
|
+
{ datapoint: l }
|
|
880
|
+
) : "") + " " + X(e.value.style.chart.legend.showPercentage ? A.value.includes(l.id) ? `${e.value.style.chart.legend.showValue ? "(" : ""}- %${e.value.style.chart.legend.showValue ? ")" : ""}` : `${e.value.style.chart.legend.showValue ? "(" : ""}${isNaN(l.value / ne.value) ? "-" : (l.value / ne.value * 100).toFixed(e.value.style.chart.legend.roundingPercentage)}%${e.value.style.chart.legend.showValue ? ")" : ""}` : ""), 13, kl)
|
|
881
|
+
]),
|
|
882
|
+
_: 1
|
|
883
|
+
}, 8, ["legendSet", "config", "id"])) : w(t.$slots, "legend", {
|
|
884
|
+
key: 1,
|
|
885
|
+
legend: Qe.value
|
|
886
|
+
}, void 0, !0)
|
|
887
|
+
], 512),
|
|
888
|
+
t.$slots.source ? (h(), y("div", {
|
|
889
|
+
key: 8,
|
|
890
|
+
ref_key: "source",
|
|
891
|
+
ref: ze,
|
|
892
|
+
dir: "auto"
|
|
893
|
+
}, [
|
|
894
|
+
w(t.$slots, "source", {}, void 0, !0)
|
|
895
|
+
], 512)) : _("", !0),
|
|
896
|
+
xe(d(g), {
|
|
897
|
+
show: R.value.showTooltip && N.value,
|
|
898
|
+
backgroundColor: e.value.style.chart.tooltip.backgroundColor,
|
|
899
|
+
color: e.value.style.chart.tooltip.color,
|
|
900
|
+
fontSize: e.value.style.chart.tooltip.fontSize,
|
|
901
|
+
borderRadius: e.value.style.chart.tooltip.borderRadius,
|
|
902
|
+
borderColor: e.value.style.chart.tooltip.borderColor,
|
|
903
|
+
borderWidth: e.value.style.chart.tooltip.borderWidth,
|
|
904
|
+
backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
|
|
905
|
+
position: e.value.style.chart.tooltip.position,
|
|
906
|
+
offsetY: e.value.style.chart.tooltip.offsetY,
|
|
907
|
+
parent: U.value,
|
|
908
|
+
content: be.value,
|
|
909
|
+
isFullscreen: le.value,
|
|
910
|
+
isCustom: d(dt)(e.value.style.chart.tooltip.customFormat)
|
|
911
|
+
}, {
|
|
912
|
+
"tooltip-before": O(() => [
|
|
913
|
+
w(t.$slots, "tooltip-before", ee(te({ ...ke.value })), void 0, !0)
|
|
914
|
+
]),
|
|
915
|
+
"tooltip-after": O(() => [
|
|
916
|
+
w(t.$slots, "tooltip-after", ee(te({ ...ke.value })), void 0, !0)
|
|
917
|
+
]),
|
|
918
|
+
_: 3
|
|
919
|
+
}, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
|
|
920
|
+
x.value ? (h(), Q(d(v), {
|
|
921
|
+
key: 9,
|
|
922
|
+
hideDetails: "",
|
|
923
|
+
config: {
|
|
924
|
+
open: R.value.showTable,
|
|
925
|
+
maxHeight: 1e4,
|
|
926
|
+
body: {
|
|
927
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
928
|
+
color: e.value.style.chart.color
|
|
929
|
+
},
|
|
930
|
+
head: {
|
|
931
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
932
|
+
color: e.value.style.chart.color
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
}, {
|
|
936
|
+
content: O(() => [
|
|
937
|
+
(h(), Q(d(i), {
|
|
938
|
+
key: `table_${Ve.value}`,
|
|
939
|
+
colNames: ve.value.colNames,
|
|
940
|
+
head: ve.value.head,
|
|
941
|
+
body: ve.value.body,
|
|
942
|
+
config: ve.value.config,
|
|
943
|
+
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
|
|
944
|
+
onClose: o[2] || (o[2] = (l) => R.value.showTable = !1)
|
|
945
|
+
}, {
|
|
946
|
+
th: O(({ th: l }) => [
|
|
947
|
+
S("div", {
|
|
948
|
+
innerHTML: l,
|
|
949
|
+
style: { display: "flex", "align-items": "center" }
|
|
950
|
+
}, null, 8, Cl)
|
|
951
|
+
]),
|
|
952
|
+
td: O(({ td: l }) => [
|
|
953
|
+
_e(X(l.name || l), 1)
|
|
954
|
+
]),
|
|
955
|
+
_: 1
|
|
956
|
+
}, 8, ["colNames", "head", "body", "config", "title"]))
|
|
957
|
+
]),
|
|
958
|
+
_: 1
|
|
959
|
+
}, 8, ["config"])) : _("", !0)
|
|
960
|
+
], 46, nl));
|
|
961
|
+
}
|
|
962
|
+
}, Vl = /* @__PURE__ */ Kt($l, [["__scopeId", "data-v-69c6df1d"]]);
|
|
963
|
+
export {
|
|
964
|
+
Vl as default
|
|
965
|
+
};
|