vue-data-ui 3.0.0-next.2 → 3.0.0-next.21
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 +1 -1
- package/dist/{Arrow-Dck2Ea5K.js → Arrow-C3yKQTJs.js} +1 -1
- package/dist/{BaseDraggableDialog-CatHZ1ns.js → BaseDraggableDialog-B2wP_11m.js} +2 -2
- package/dist/{BaseIcon-BmZ4MREl.js → BaseIcon-_brgsjLG.js} +1 -1
- package/dist/{useLoading-Bt5Doa8m.js → BaseScanner-DIK2NTdp.js} +11 -11
- package/dist/{ColorPicker-C1MXyD9Q.js → ColorPicker-CCG8G1nd.js} +2 -2
- package/dist/{DataTable-CgL0Rz0x.js → DataTable-C3ve--z6.js} +2 -2
- package/dist/{Legend-CYbP3Kfg.js → Legend-CX874XJp.js} +2 -2
- package/dist/{NonSvgPenAndPaper-CcbcJm_U.js → NonSvgPenAndPaper-CnTtK3iB.js} +3 -3
- package/dist/{PackageVersion-CAkNkiIG.js → PackageVersion-5l2M4Zh4.js} +1 -1
- package/dist/{PenAndPaper-Cx1-5zdD.js → PenAndPaper-CYEXrj4q.js} +3 -3
- package/dist/{Shape-DBXkGxKt.js → Shape-Du8dC9QE.js} +1 -1
- package/dist/{Slicer-nrMi5hzj.js → Slicer-D06CTSaX.js} +2 -2
- package/dist/{SparkTooltip-fNzL4pIU.js → SparkTooltip-DcX30xns.js} +1 -1
- package/dist/{Title-pVYRzQXY.js → Title-CItmidxn.js} +1 -1
- package/dist/{Tooltip-NwATo4ZJ.js → Tooltip-lhQXI9xT.js} +1 -1
- package/dist/{UserOptions-DAsRxxrf.js → UserOptions-mGHinyKk.js} +2 -2
- package/dist/{dom-to-png-BF_4H_6u.js → dom-to-png-juWKTR2G.js} +1 -1
- package/dist/{img-ku4zevVD.js → img-2Cyzq02w.js} +1 -1
- package/dist/{index-BzfnuLnw.js → index-DyWXkFFm.js} +799 -735
- package/dist/{pdf-CguiIsUc.js → pdf-C9bVIzob.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +113 -15
- package/dist/types/vue-data-ui.d.ts +113 -15
- package/dist/{useNestedProp-DorElw91.js → useNestedProp-5rJrnAmD.js} +1 -1
- package/dist/{usePrinter-C9qkgv0r.js → usePrinter-YV36Zq2L.js} +2 -2
- package/dist/useTimeLabelCollider-V7AOiPLB.js +71 -0
- package/dist/{useTimeLabels-Mrr0jrpL.js → useTimeLabels-DFkUfjfs.js} +211 -152
- package/dist/{vue-data-ui-DQef_oFO.js → vue-data-ui-Br6XzNcY.js} +80 -74
- package/dist/vue-data-ui.js +54 -52
- package/dist/{vue-ui-3d-bar-DPSamIA-.js → vue-ui-3d-bar-BeZ4UXj1.js} +6 -6
- package/dist/{vue-ui-accordion-DgZK-qDz.js → vue-ui-accordion-_T76roov.js} +3 -3
- package/dist/{vue-ui-age-pyramid-DVeGKvf9.js → vue-ui-age-pyramid-DyILZmL1.js} +6 -6
- package/dist/{vue-ui-annotator-6ikkK-FK.js → vue-ui-annotator-D6vtgVKu.js} +2 -2
- package/dist/{vue-ui-bullet-Bg4hfFk2.js → vue-ui-bullet-CRL0nm0H.js} +7 -7
- package/dist/vue-ui-candlestick-Lv87ukLK.js +973 -0
- package/dist/{vue-ui-carousel-table-DitKhrFT.js → vue-ui-carousel-table-bQiT7iYL.js} +4 -4
- package/dist/{vue-ui-chestnut-D8wGAZod.js → vue-ui-chestnut-CshEgUb5.js} +5 -5
- package/dist/{vue-ui-chord-C-uTVCDP.js → vue-ui-chord-C_Gurj0k.js} +8 -8
- package/dist/{vue-ui-circle-pack-CPy6xcxv.js → vue-ui-circle-pack-DcDbc0cs.js} +6 -6
- package/dist/{vue-ui-cursor-Dd7vUd0q.js → vue-ui-cursor-BlANSWeT.js} +2 -2
- package/dist/{vue-ui-dashboard-CKurbu8M.js → vue-ui-dashboard-Dylth91b.js} +62 -62
- package/dist/{vue-ui-digits-DfdZI11G.js → vue-ui-digits-BISvEvKG.js} +2 -2
- package/dist/{vue-ui-donut-tECBFvud.js → vue-ui-donut-DJYRCCLe.js} +416 -401
- package/dist/{vue-ui-donut-evolution-CKbLO8yR.js → vue-ui-donut-evolution--nHID422.js} +9 -9
- package/dist/{vue-ui-dumbbell-DI5Lj3r_.js → vue-ui-dumbbell-CsZa3YKC.js} +7 -7
- package/dist/{vue-ui-flow-CjU48s9z.js → vue-ui-flow-D1YZHLf1.js} +7 -7
- package/dist/{vue-ui-funnel-DM_5vHZ4.js → vue-ui-funnel-KScJM0Sk.js} +6 -6
- package/dist/{vue-ui-galaxy-ocvZgZJx.js → vue-ui-galaxy-7I6nMU7k.js} +5 -5
- package/dist/{vue-ui-gauge-DajNoY-D.js → vue-ui-gauge-BWOeGXdp.js} +6 -6
- package/dist/{vue-ui-gizmo-DTnzeQbm.js → vue-ui-gizmo-C7Oci8xf.js} +3 -3
- package/dist/{vue-ui-heatmap-CfBS8jQe.js → vue-ui-heatmap-CeQq5YFh.js} +7 -7
- package/dist/{vue-ui-history-plot-BuOPWQoP.js → vue-ui-history-plot-C1R46zuZ.js} +7 -7
- package/dist/{vue-ui-kpi-DLGHOIRj.js → vue-ui-kpi-CXXCCBoi.js} +3 -3
- package/dist/{vue-ui-mini-loader-CHAHi4c9.js → vue-ui-mini-loader-BDeMu-HG.js} +2 -2
- package/dist/{vue-ui-molecule-R5-oDFeW.js → vue-ui-molecule-BG_Vm9Z-.js} +5 -5
- package/dist/{vue-ui-mood-radar-Ddf2gaES.js → vue-ui-mood-radar-68rvpqSe.js} +7 -7
- package/dist/vue-ui-nested-donuts-y7DnbLj7.js +1282 -0
- package/dist/{vue-ui-onion-D2n4zUkV.js → vue-ui-onion-cpCWH8CY.js} +7 -7
- package/dist/{vue-ui-parallel-coordinate-plot-CNWQqlxf.js → vue-ui-parallel-coordinate-plot-AXeySjsk.js} +8 -8
- package/dist/{vue-ui-quadrant-CxNj2FEx.js → vue-ui-quadrant-9-wXsL9m.js} +8 -8
- package/dist/{vue-ui-quick-chart-Bm_VmhJR.js → vue-ui-quick-chart-B_SOReEM.js} +7 -7
- package/dist/{vue-ui-radar-DSYMQJ6K.js → vue-ui-radar-BryqHi8h.js} +7 -7
- package/dist/{vue-ui-rating-BiQpwXnc.js → vue-ui-rating-Cm4WHdIj.js} +2 -2
- package/dist/{vue-ui-relation-circle-Cdxe78Bm.js → vue-ui-relation-circle-D-wNj3HG.js} +6 -6
- package/dist/{vue-ui-ridgeline-DpeM2hRi.js → vue-ui-ridgeline-B5y-Z_xt.js} +9 -9
- package/dist/{vue-ui-rings-BenmQHKv.js → vue-ui-rings-D-TtSoDJ.js} +8 -8
- package/dist/{vue-ui-scatter-mDMY1H6U.js → vue-ui-scatter-DzPgW23k.js} +8 -8
- package/dist/{vue-ui-skeleton-Ch_XkFuP.js → vue-ui-skeleton-QZs3A3_K.js} +3 -3
- package/dist/{vue-ui-smiley-DTig5lTU.js → vue-ui-smiley-ka3aFa0e.js} +2 -2
- package/dist/{vue-ui-spark-trend-BkDsp8E0.js → vue-ui-spark-trend-CJhdQ9Ls.js} +3 -3
- package/dist/{vue-ui-sparkbar-CgqoyBOm.js → vue-ui-sparkbar-CL5ZGdHd.js} +3 -3
- package/dist/{vue-ui-sparkgauge-B4jR_Y62.js → vue-ui-sparkgauge-C5Jdp3zp.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-DfxjglLy.js → vue-ui-sparkhistogram-CHRRpkm0.js} +4 -4
- package/dist/{vue-ui-sparkline-M3QR8xJE.js → vue-ui-sparkline-B0r89-4E.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-B2Ls-Mb8.js → vue-ui-sparkstackbar-l35guX1R.js} +3 -3
- package/dist/vue-ui-stackbar-AKs4GMxY.js +1354 -0
- package/dist/{vue-ui-strip-plot-B_ZLbu2D.js → vue-ui-strip-plot-uhUjZcif.js} +7 -7
- package/dist/{vue-ui-table-BhymhDOh.js → vue-ui-table-BbRxUiDQ.js} +3 -3
- package/dist/{vue-ui-table-heatmap-DokRh4dS.js → vue-ui-table-heatmap-CVdmaPTJ.js} +5 -5
- package/dist/{vue-ui-table-sparkline-DxBZGKZJ.js → vue-ui-table-sparkline-DJfVAI5W.js} +4 -4
- package/dist/{vue-ui-thermometer-e2L6IdF-.js → vue-ui-thermometer-BYx0gV05.js} +6 -6
- package/dist/{vue-ui-timer-BG2EwK3o.js → vue-ui-timer-DL2v49kR.js} +5 -5
- package/dist/{vue-ui-tiremarks-nzQH7woJ.js → vue-ui-tiremarks-LlgdqzTU.js} +6 -6
- package/dist/{vue-ui-treemap-CZxyi6fl.js → vue-ui-treemap-B2v9uGdI.js} +8 -8
- package/dist/vue-ui-vertical-bar-DSCAkzDF.js +1106 -0
- package/dist/{vue-ui-waffle-D399D4UE.js → vue-ui-waffle-DmNJRK-_.js} +8 -8
- package/dist/{vue-ui-wheel-DtcwtHzJ.js → vue-ui-wheel-ChRAwecI.js} +6 -6
- package/dist/{vue-ui-word-cloud-CTDceQsf.js → vue-ui-word-cloud-CELkzbyr.js} +6 -6
- package/dist/{vue-ui-world-BjNSbqMZ.js → vue-ui-world-BOJa-cTu.js} +6 -6
- package/dist/vue-ui-xy-DfeP_T81.js +3000 -0
- package/dist/{vue-ui-xy-canvas-BKAowbe0.js → vue-ui-xy-canvas-Dijs3J4M.js} +9 -9
- package/package.json +1 -1
- package/dist/vue-ui-candlestick-Bi59FGXn.js +0 -873
- package/dist/vue-ui-nested-donuts-CksklV83.js +0 -1177
- package/dist/vue-ui-stackbar-DIHkn6__.js +0 -1207
- package/dist/vue-ui-vertical-bar-DahdX1Sn.js +0 -980
- package/dist/vue-ui-xy-BkTP-JpK.js +0 -2958
|
@@ -0,0 +1,1282 @@
|
|
|
1
|
+
import { defineAsyncComponent as U, computed as L, ref as h, toRefs as Yt, watch as re, onMounted as Xt, shallowRef as ct, onBeforeUnmount as Wt, createElementBlock as r, openBlock as n, unref as i, normalizeStyle as ie, normalizeClass as z, createBlock as G, createCommentVNode as w, createVNode as vt, createSlots as qt, withCtx as C, renderSlot as x, normalizeProps as H, guardReactiveProps as J, createElementVNode as y, Fragment as _, renderList as A, toDisplayString as O, withDirectives as ht, vShow as ft, createTextVNode as Ht, nextTick as yt } from "vue";
|
|
2
|
+
import { u as Jt, c as Kt, A as Qt, t as Zt, p as Fe, a as jt, o as el, e as K, b as tl, G as M, d as ll, m as Ie, f as N, X as al, s as ol, L as pt, k as Ve, n as Q, i as j, x as bt, q as sl, r as ul, y as nl, T as gt, v as Pe } from "./index-DyWXkFFm.js";
|
|
3
|
+
import { t as rl, u as il } from "./useResponsive-DfdjqQps.js";
|
|
4
|
+
import { u as mt } from "./useNestedProp-5rJrnAmD.js";
|
|
5
|
+
import { u as dl } from "./usePrinter-YV36Zq2L.js";
|
|
6
|
+
import { u as cl } from "./useUserOptionState-BIvW1Kz7.js";
|
|
7
|
+
import { u as vl } from "./useChartAccessibility-9icAAmYg.js";
|
|
8
|
+
import hl from "./Title-CItmidxn.js";
|
|
9
|
+
import fl from "./Legend-CX874XJp.js";
|
|
10
|
+
import yl from "./img-2Cyzq02w.js";
|
|
11
|
+
import { u as pl, B as bl } from "./BaseScanner-DIK2NTdp.js";
|
|
12
|
+
import { _ as gl } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
|
+
const ml = ["id"], wl = ["xmlns", "viewBox"], $l = ["width", "height"], kl = ["id"], Ll = ["offset", "stop-color"], Cl = ["offset", "stop-opacity"], xl = ["id"], _l = ["id"], Al = ["id"], Tl = ["flood-color"], Nl = ["id", "d"], Ol = ["d", "fill", "stroke", "stroke-width", "filter"], Sl = ["d", "fill", "stroke", "stroke-width"], Fl = { key: 1 }, Il = ["d", "fill"], Vl = { key: 2 }, Pl = ["font-size", "font-weight", "fill", "dy"], Dl = ["href"], zl = ["x", "y", "font-size", "font-weight", "fill"], Ml = { key: 3 }, Bl = ["filter"], El = ["opacity", "text-anchor", "x", "y", "fill", "font-size", "font-weight"], Rl = ["opacity", "text-anchor", "x", "y", "fill", "font-size", "font-weight"], Ul = ["text-anchor", "x", "y", "fill", "font-size", "font-weight"], Gl = ["d", "fill", "onMouseenter", "onClick"], Yl = {
|
|
14
|
+
key: 4,
|
|
15
|
+
class: "vue-data-ui-watermark"
|
|
16
|
+
}, Xl = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "vue-ui-nested-donuts-legend-title"
|
|
19
|
+
}, Wl = ["onClick"], ql = ["innerHTML"], Hl = {
|
|
20
|
+
__name: "vue-ui-nested-donuts",
|
|
21
|
+
props: {
|
|
22
|
+
config: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default() {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
dataset: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default() {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ["selectLegend", "selectDatapoint"],
|
|
36
|
+
setup(wt, { expose: $t, emit: kt }) {
|
|
37
|
+
const Lt = U(() => import("./vue-ui-accordion-_T76roov.js")), Ct = U(() => import("./DataTable-C3ve--z6.js")), xt = U(() => import("./PackageVersion-5l2M4Zh4.js")), _t = U(() => import("./PenAndPaper-CYEXrj4q.js"));
|
|
38
|
+
U(() => import("./vue-ui-skeleton-QZs3A3_K.js"));
|
|
39
|
+
const At = U(() => import("./Tooltip-lhQXI9xT.js")), Tt = U(() => import("./UserOptions-mGHinyKk.js")), { vue_ui_nested_donuts: Nt } = Jt(), S = wt, de = L({
|
|
40
|
+
get() {
|
|
41
|
+
return !!S.dataset && S.dataset.length;
|
|
42
|
+
},
|
|
43
|
+
set(l) {
|
|
44
|
+
return l;
|
|
45
|
+
}
|
|
46
|
+
}), p = h(Kt()), ce = h(!1), ve = h(""), he = h(null), De = h(0), V = h(null), ze = h(null), fe = h(null), Me = h(null), Be = h(null), Ee = h(0), Re = h(0), Ue = h(0), B = h(!0), E = h([]), Z = h([]), Y = h(!1);
|
|
47
|
+
function Ge(l) {
|
|
48
|
+
Y.value = l, De.value += 1;
|
|
49
|
+
}
|
|
50
|
+
const e = h(ge()), Ye = {
|
|
51
|
+
name: "",
|
|
52
|
+
series: [
|
|
53
|
+
{
|
|
54
|
+
name: "",
|
|
55
|
+
values: [3],
|
|
56
|
+
color: "#BABABA"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "",
|
|
60
|
+
values: [2],
|
|
61
|
+
color: "#AAAAAA"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "",
|
|
65
|
+
values: [1],
|
|
66
|
+
color: "#CACACA"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}, { loading: ye, FINAL_DATASET: R, manualLoading: pe } = pl({
|
|
70
|
+
...Yt(S),
|
|
71
|
+
FINAL_CONFIG: e,
|
|
72
|
+
prepareConfig: ge,
|
|
73
|
+
callback: () => {
|
|
74
|
+
Promise.resolve().then(async () => {
|
|
75
|
+
await He();
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
skeletonDataset: [Ye, Ye],
|
|
79
|
+
skeletonConfig: Qt({
|
|
80
|
+
defaultConfig: e.value,
|
|
81
|
+
userConfig: {
|
|
82
|
+
useCssAnimation: !1,
|
|
83
|
+
table: { show: !1 },
|
|
84
|
+
startAnimation: { show: !1 },
|
|
85
|
+
userOptions: { show: !1 },
|
|
86
|
+
style: {
|
|
87
|
+
chart: {
|
|
88
|
+
backgroundColor: "#99999930",
|
|
89
|
+
layout: {
|
|
90
|
+
labels: {
|
|
91
|
+
dataLabels: { show: !1 }
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
legend: { backgroundColor: "transparent", showValue: !1, showPercentage: !1 },
|
|
95
|
+
title: {
|
|
96
|
+
color: "#1A1A1A",
|
|
97
|
+
subtitle: {
|
|
98
|
+
color: "#5A5A5A"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
}), { userOptionsVisible: be, setUserOptionsVisibility: Xe, keepUserOptionState: We } = cl({ config: e.value }), { svgRef: ee } = vl({
|
|
106
|
+
config: e.value.style.chart.title
|
|
107
|
+
});
|
|
108
|
+
function ge() {
|
|
109
|
+
const l = mt({
|
|
110
|
+
userConfig: S.config,
|
|
111
|
+
defaultConfig: Nt
|
|
112
|
+
});
|
|
113
|
+
return l.theme ? {
|
|
114
|
+
...mt({
|
|
115
|
+
userConfig: jt.vue_ui_nested_donuts[l.theme] || S.config,
|
|
116
|
+
defaultConfig: l
|
|
117
|
+
}),
|
|
118
|
+
customPalette: Zt[l.theme] || Fe
|
|
119
|
+
} : l;
|
|
120
|
+
}
|
|
121
|
+
re(
|
|
122
|
+
() => S.config,
|
|
123
|
+
(l) => {
|
|
124
|
+
ye.value || (e.value = ge()), be.value = !e.value.userOptions.showOnChartHover, Je(), Ee.value += 1, Re.value += 1, Ue.value += 1, $.value.dataLabels.show = e.value.style.chart.layout.labels.dataLabels.show, $.value.showTable = e.value.table.show, $.value.showTooltip = e.value.style.chart.tooltip.show, v.value.width = e.value.style.chart.width, v.value.height = e.value.style.chart.height;
|
|
125
|
+
},
|
|
126
|
+
{ deep: !0 }
|
|
127
|
+
);
|
|
128
|
+
const qe = L(() => {
|
|
129
|
+
const { top: l, right: s, bottom: o, left: a } = e.value.style.chart.padding;
|
|
130
|
+
return {
|
|
131
|
+
css: `padding:${l}px ${s}px ${o}px ${a}px`,
|
|
132
|
+
top: l,
|
|
133
|
+
right: s,
|
|
134
|
+
bottom: o,
|
|
135
|
+
left: a
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
function Ot(l, s = 1e3, o = 50) {
|
|
139
|
+
return new Promise((a) => {
|
|
140
|
+
const t = l.length;
|
|
141
|
+
E.value = Array(t).fill(0), Z.value = [];
|
|
142
|
+
let u = 0;
|
|
143
|
+
l.forEach((c, f) => {
|
|
144
|
+
setTimeout(() => {
|
|
145
|
+
const m = performance.now();
|
|
146
|
+
function d(b) {
|
|
147
|
+
const T = Math.min((b - m) / s, 1), xe = gt(T), _e = c * xe;
|
|
148
|
+
E.value[f] = _e, E.value = [...E.value];
|
|
149
|
+
const ue = [];
|
|
150
|
+
let Ae = 0;
|
|
151
|
+
S.dataset.forEach((ne, Te) => {
|
|
152
|
+
const Et = Pe(ne.series.reduce(
|
|
153
|
+
(Oe, Se) => Oe + Pe(M(Se.values).reduce((Ut, Gt) => Ut + Gt, 0)),
|
|
154
|
+
0
|
|
155
|
+
)), Rt = Pe(E.value.slice(Ae, Ae + ne.series.length).reduce((Oe, Se) => Oe + Se, 0)), Ne = Et - Rt;
|
|
156
|
+
Ne > Number.MIN_VALUE && ue.push({
|
|
157
|
+
name: "__ghost__",
|
|
158
|
+
arcOf: ne.name,
|
|
159
|
+
arcOfId: `${p.value}_${Te}`,
|
|
160
|
+
id: `ghost_${p.value}_${Te}`,
|
|
161
|
+
seriesIndex: -1,
|
|
162
|
+
datasetIndex: Te,
|
|
163
|
+
color: "transparent",
|
|
164
|
+
value: Ne,
|
|
165
|
+
fullValue: Ne,
|
|
166
|
+
absoluteValues: [],
|
|
167
|
+
ghost: !0
|
|
168
|
+
}), Ae += ne.series.length;
|
|
169
|
+
}), Z.value = ue, T < 1 ? requestAnimationFrame(d) : (u += 1, u === t && a());
|
|
170
|
+
}
|
|
171
|
+
requestAnimationFrame(d);
|
|
172
|
+
}, f * o);
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
async function He() {
|
|
177
|
+
if (e.value.startAnimation?.show) {
|
|
178
|
+
const s = R.value.flatMap((o) => o.series).map(
|
|
179
|
+
(o) => M(o.values).reduce((a, t) => a + t, 0)
|
|
180
|
+
);
|
|
181
|
+
E.value = s.map(() => 0), B.value = !0, Z.value = R.value.map((o, a) => {
|
|
182
|
+
const t = o.series.reduce(
|
|
183
|
+
(u, c) => u + M(c.values).reduce((f, m) => f + m, 0),
|
|
184
|
+
0
|
|
185
|
+
);
|
|
186
|
+
return {
|
|
187
|
+
name: "__ghost__",
|
|
188
|
+
arcOf: o.name,
|
|
189
|
+
arcOfId: `${p.value}_${a}`,
|
|
190
|
+
id: `ghost_${p.value}_${a}`,
|
|
191
|
+
seriesIndex: -1,
|
|
192
|
+
datasetIndex: a,
|
|
193
|
+
color: "transparent",
|
|
194
|
+
value: t,
|
|
195
|
+
fullValue: t,
|
|
196
|
+
absoluteValues: [],
|
|
197
|
+
ghost: !0
|
|
198
|
+
};
|
|
199
|
+
}), await yt(), Ot(
|
|
200
|
+
s,
|
|
201
|
+
e.value.startAnimation.durationMs,
|
|
202
|
+
e.value.startAnimation.staggerMs
|
|
203
|
+
).then(() => {
|
|
204
|
+
B.value = !1, Z.value = [];
|
|
205
|
+
});
|
|
206
|
+
} else
|
|
207
|
+
B.value = !1;
|
|
208
|
+
}
|
|
209
|
+
Xt(async () => {
|
|
210
|
+
Je(), await He();
|
|
211
|
+
});
|
|
212
|
+
const P = ct(null), X = ct(null), W = L(() => !!e.value.debug);
|
|
213
|
+
function Je() {
|
|
214
|
+
if (el(S.dataset) ? (K({
|
|
215
|
+
componentName: "VueUiNestedDonuts",
|
|
216
|
+
type: "dataset",
|
|
217
|
+
debug: W.value
|
|
218
|
+
}), de.value = !1, pe.value = !0) : pe.value = e.value.loading, e.value.responsive) {
|
|
219
|
+
const l = rl(() => {
|
|
220
|
+
const { width: s, height: o } = il({
|
|
221
|
+
chart: V.value,
|
|
222
|
+
title: e.value.style.chart.title.text ? ze.value : null,
|
|
223
|
+
legend: e.value.style.chart.legend.show ? fe.value : null,
|
|
224
|
+
source: Me.value,
|
|
225
|
+
noTitle: Be.value,
|
|
226
|
+
padding: qe.value
|
|
227
|
+
});
|
|
228
|
+
requestAnimationFrame(() => {
|
|
229
|
+
v.value.width = s, v.value.height = o;
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
P.value && (X.value && P.value.unobserve(X.value), P.value.disconnect()), P.value = new ResizeObserver(l), X.value = V.value.parentNode, P.value.observe(X.value);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
Wt(() => {
|
|
236
|
+
P.value && (X.value && P.value.unobserve(X.value), P.value.disconnect());
|
|
237
|
+
});
|
|
238
|
+
const { isPrinting: Ke, isImaging: Qe, generatePdf: Ze, generateImage: je } = dl({
|
|
239
|
+
elementId: `nested_donuts_${p.value}`,
|
|
240
|
+
fileName: e.value.style.chart.title.text || "vue-ui-nested-donuts",
|
|
241
|
+
options: e.value.userOptions.print
|
|
242
|
+
}), St = L(() => e.value.userOptions.show && !e.value.style.chart.title.text), Ft = L(() => tl(e.value.customPalette)), $ = h({
|
|
243
|
+
dataLabels: {
|
|
244
|
+
show: e.value.style.chart.layout.labels.dataLabels.show
|
|
245
|
+
},
|
|
246
|
+
showTable: e.value.table.show,
|
|
247
|
+
showTooltip: e.value.style.chart.tooltip.show
|
|
248
|
+
});
|
|
249
|
+
re(e, () => {
|
|
250
|
+
$.value = {
|
|
251
|
+
dataLabels: {
|
|
252
|
+
show: e.value.style.chart.layout.labels.dataLabels.show
|
|
253
|
+
},
|
|
254
|
+
showTable: e.value.table.show,
|
|
255
|
+
showTooltip: e.value.style.chart.tooltip.show
|
|
256
|
+
};
|
|
257
|
+
}, { immediate: !0 });
|
|
258
|
+
const v = h({
|
|
259
|
+
width: e.value.style.chart.width,
|
|
260
|
+
height: e.value.style.chart.height
|
|
261
|
+
}), et = kt;
|
|
262
|
+
function It({ datapoint: l, index: s }) {
|
|
263
|
+
et("selectDatapoint", { datapoint: l, index: s });
|
|
264
|
+
}
|
|
265
|
+
function tt({
|
|
266
|
+
from: l,
|
|
267
|
+
to: s,
|
|
268
|
+
duration: o,
|
|
269
|
+
onUpdate: a,
|
|
270
|
+
onDone: t,
|
|
271
|
+
easing: u = gt
|
|
272
|
+
}) {
|
|
273
|
+
const c = performance.now();
|
|
274
|
+
function f(m) {
|
|
275
|
+
const d = Math.min((m - c) / o, 1), b = u(d), T = l + (s - l) * b;
|
|
276
|
+
a(T, d), d < 1 ? requestAnimationFrame(f) : (a(s, 1), t && t());
|
|
277
|
+
}
|
|
278
|
+
requestAnimationFrame(f);
|
|
279
|
+
}
|
|
280
|
+
const k = h([]), F = L(() => {
|
|
281
|
+
ye.value, R.value.forEach((s, o) => {
|
|
282
|
+
[null, void 0].includes(s.name) && K({
|
|
283
|
+
componentName: "VueUiNestedDonuts",
|
|
284
|
+
type: "datasetSerieAttribute",
|
|
285
|
+
property: "name",
|
|
286
|
+
index: o,
|
|
287
|
+
debug: W.value
|
|
288
|
+
}), [null, void 0].includes(s.series) ? K({
|
|
289
|
+
componentName: "VueUiNestedDonuts",
|
|
290
|
+
type: "datasetSerieAttribute",
|
|
291
|
+
property: "series",
|
|
292
|
+
index: o,
|
|
293
|
+
debug: W.value
|
|
294
|
+
}) : s.series.length === 0 ? K({
|
|
295
|
+
componentName: "VueUiNestedDonuts",
|
|
296
|
+
type: "datasetAttributeEmpty",
|
|
297
|
+
property: `series at index ${o}`,
|
|
298
|
+
debug: W.value
|
|
299
|
+
}) : s.series.forEach((a, t) => {
|
|
300
|
+
[null, void 0].includes(a.name) && K({
|
|
301
|
+
componentName: "VueUiNestedDonuts",
|
|
302
|
+
type: "datasetSerieAttribute",
|
|
303
|
+
property: "name",
|
|
304
|
+
index: t,
|
|
305
|
+
key: "serie",
|
|
306
|
+
debug: W.value
|
|
307
|
+
}), [null, void 0].includes(a.values) && K({
|
|
308
|
+
componentName: "VueUiNestedDonuts",
|
|
309
|
+
type: "datasetSerieAttribute",
|
|
310
|
+
property: "values",
|
|
311
|
+
index: t,
|
|
312
|
+
key: "serie",
|
|
313
|
+
debug: W.value
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
let l = 0;
|
|
318
|
+
return R.value.map((s, o) => ({
|
|
319
|
+
...s,
|
|
320
|
+
total: s.series.filter((a) => !k.value.includes(a.id)).map((a) => M(a.values).reduce((t, u) => t + u, 0)).reduce((a, t) => a + t, 0),
|
|
321
|
+
datasetIndex: o,
|
|
322
|
+
id: `${p.value}_${o}`,
|
|
323
|
+
series: s.series.map((a, t) => {
|
|
324
|
+
const u = M(a.values).reduce((c, f) => c + f, 0);
|
|
325
|
+
return {
|
|
326
|
+
name: a.name,
|
|
327
|
+
arcOf: s.name,
|
|
328
|
+
arcOfId: `${p.value}_${o}`,
|
|
329
|
+
id: `${p.value}_${o}_${t}`,
|
|
330
|
+
seriesIndex: t,
|
|
331
|
+
datasetIndex: o,
|
|
332
|
+
color: ll(a.color) || Ft.value[t] || Fe[t % Fe.length],
|
|
333
|
+
value: B.value ? E.value[l++] ?? 0 : u,
|
|
334
|
+
absoluteValues: a.values || []
|
|
335
|
+
};
|
|
336
|
+
})
|
|
337
|
+
}));
|
|
338
|
+
});
|
|
339
|
+
re(() => S.dataset, (l) => {
|
|
340
|
+
Array.isArray(l) && l.length > 0 && (pe.value = !1);
|
|
341
|
+
}, { immediate: !0 });
|
|
342
|
+
const I = L(() => Math.min(v.value.height, v.value.width) * (e.value.style.chart.layout.donut.strokeWidth / 512)), lt = L(() => [...F.value].map((l, s) => {
|
|
343
|
+
const o = l.series.filter((a) => !k.value.includes(a.id)).map((a) => a.value).reduce((a, t) => a + t, 0);
|
|
344
|
+
return {
|
|
345
|
+
...l,
|
|
346
|
+
total: o,
|
|
347
|
+
series: l.series.filter((a) => !k.value.includes(a.id)).map((a) => ({
|
|
348
|
+
...a,
|
|
349
|
+
proportion: a.value / o
|
|
350
|
+
}))
|
|
351
|
+
};
|
|
352
|
+
}));
|
|
353
|
+
function Vt(l, s, o) {
|
|
354
|
+
let a = 0;
|
|
355
|
+
for (let t = 0; t < l.length; t += 1)
|
|
356
|
+
o.includes(l[t]) && (a += 1);
|
|
357
|
+
return a < s;
|
|
358
|
+
}
|
|
359
|
+
const g = h(lt.value);
|
|
360
|
+
re(
|
|
361
|
+
() => lt.value,
|
|
362
|
+
(l) => g.value = l
|
|
363
|
+
);
|
|
364
|
+
function me(l) {
|
|
365
|
+
et("selectLegend", l);
|
|
366
|
+
const s = S.dataset.flatMap(
|
|
367
|
+
(d, b) => d.series.map((T, xe) => ({
|
|
368
|
+
value: M(T.values).reduce((_e, ue) => _e + ue, 0),
|
|
369
|
+
id: `${p.value}_${b}_${xe}`,
|
|
370
|
+
arcOfId: `${p.value}_${b}`
|
|
371
|
+
}))
|
|
372
|
+
).find((d) => d.id === l.id);
|
|
373
|
+
if (!s) return;
|
|
374
|
+
const o = F.value.flatMap((d) => d.series).find((d) => d.id === l.id)?.value ?? 0, a = g.value.flatMap((d) => d.series).find((d) => d.id === l.id);
|
|
375
|
+
let u = a ? a.value : 0;
|
|
376
|
+
const c = F.value.find(
|
|
377
|
+
(d) => d.id === s.arcOfId
|
|
378
|
+
);
|
|
379
|
+
if (!c) return;
|
|
380
|
+
const f = c.series.map((d) => d.id), m = Vt(
|
|
381
|
+
f,
|
|
382
|
+
f.length - 1,
|
|
383
|
+
k.value
|
|
384
|
+
);
|
|
385
|
+
k.value.includes(l.id) ? (k.value = k.value.filter((d) => d !== l.id), e.value.serieToggleAnimation.show ? tt({
|
|
386
|
+
from: u,
|
|
387
|
+
to: o,
|
|
388
|
+
duration: e.value.serieToggleAnimation.durationMs,
|
|
389
|
+
onUpdate: (d) => {
|
|
390
|
+
g.value = g.value.map((b) => ({
|
|
391
|
+
...b,
|
|
392
|
+
series: b.series.map((T) => T.id === l.id ? { ...T, value: d } : T)
|
|
393
|
+
}));
|
|
394
|
+
}
|
|
395
|
+
}) : g.value = g.value.map((d) => ({
|
|
396
|
+
...d,
|
|
397
|
+
series: d.series.map((b) => b.id === l.id ? { ...b, value: o } : b)
|
|
398
|
+
}))) : m && (e.value.serieToggleAnimation.show ? tt({
|
|
399
|
+
from: u,
|
|
400
|
+
to: 0,
|
|
401
|
+
duration: e.value.serieToggleAnimation.durationMs,
|
|
402
|
+
onUpdate: (d) => {
|
|
403
|
+
g.value = g.value.map((b) => ({
|
|
404
|
+
...b,
|
|
405
|
+
series: b.series.map((T) => T.id === l.id ? { ...T, value: d } : T)
|
|
406
|
+
}));
|
|
407
|
+
},
|
|
408
|
+
onDone: () => {
|
|
409
|
+
k.value.push(l.id);
|
|
410
|
+
}
|
|
411
|
+
}) : (g.value = g.value.map((d) => ({
|
|
412
|
+
...d,
|
|
413
|
+
series: d.series.map((b) => b.id === l.id ? { ...b, value: 0 } : b)
|
|
414
|
+
})), k.value.push(l.id)));
|
|
415
|
+
}
|
|
416
|
+
const te = L(() => I.value / F.value.length * e.value.style.chart.layout.donut.spacingRatio), at = L(() => g.value.map((l, s) => I.value - s * I.value / F.value.length)), q = L(() => g.value.map((l, s) => {
|
|
417
|
+
const o = Math.abs(l.series.map((m) => m.value).reduce((m, d) => m + d, 0)) > 0, a = I.value - s * I.value / g.value.length, t = B.value ? Z.value.find((m) => m.datasetIndex === s) : null, u = [...l.series, ...t ? [t] : []].map((m) => ({
|
|
418
|
+
...m,
|
|
419
|
+
value: m.value < 1e-11 ? Number.MIN_VALUE : m.value
|
|
420
|
+
})), c = Ie(
|
|
421
|
+
{ series: [
|
|
422
|
+
{ name: "_", color: e.value.style.chart.layout.donut.emptyFill, value: 1 }
|
|
423
|
+
] },
|
|
424
|
+
v.value.width / 2,
|
|
425
|
+
v.value.height / 2,
|
|
426
|
+
a,
|
|
427
|
+
a,
|
|
428
|
+
1.99999,
|
|
429
|
+
2,
|
|
430
|
+
1,
|
|
431
|
+
360,
|
|
432
|
+
105.25,
|
|
433
|
+
te.value
|
|
434
|
+
), f = `M ${v.value.width / 2},${v.value.height / 2 + a}
|
|
435
|
+
a ${a},${a} 0 1,1 0,${-2 * a}
|
|
436
|
+
a ${a},${a} 0 1,1 0,${2 * a}`;
|
|
437
|
+
return {
|
|
438
|
+
...l,
|
|
439
|
+
hasData: o,
|
|
440
|
+
radius: a,
|
|
441
|
+
skeleton: c,
|
|
442
|
+
fullCirclePath: f,
|
|
443
|
+
donut: Ie(
|
|
444
|
+
{ series: u },
|
|
445
|
+
v.value.width / 2,
|
|
446
|
+
v.value.height / 2,
|
|
447
|
+
a,
|
|
448
|
+
a,
|
|
449
|
+
1.99999,
|
|
450
|
+
2,
|
|
451
|
+
1,
|
|
452
|
+
360,
|
|
453
|
+
105.25,
|
|
454
|
+
te.value
|
|
455
|
+
)
|
|
456
|
+
};
|
|
457
|
+
})), ot = L(() => [...F.value].map((l, s) => {
|
|
458
|
+
const o = s * I.value / F.value.length;
|
|
459
|
+
return {
|
|
460
|
+
sizeRatio: o,
|
|
461
|
+
donut: Ie(
|
|
462
|
+
{ series: [{ value: 1 }] },
|
|
463
|
+
v.value.width / 2,
|
|
464
|
+
v.value.height / 2,
|
|
465
|
+
I.value - o,
|
|
466
|
+
I.value - o,
|
|
467
|
+
1.99999,
|
|
468
|
+
2,
|
|
469
|
+
1,
|
|
470
|
+
360,
|
|
471
|
+
105.25,
|
|
472
|
+
I.value / F.value.length * e.value.style.chart.layout.donut.spacingRatio
|
|
473
|
+
)[0]
|
|
474
|
+
};
|
|
475
|
+
})), st = h(null), le = h(null), ae = h(null), we = h(null);
|
|
476
|
+
function Pt({ datapoint: l, _relativeIndex: s, seriesIndex: o }) {
|
|
477
|
+
st.value = l.arcOfId, le.value = l.id, ae.value = o, he.value = l.id, we.value = {
|
|
478
|
+
datapoint: l,
|
|
479
|
+
seriesIndex: o,
|
|
480
|
+
series: g.value,
|
|
481
|
+
config: e.value
|
|
482
|
+
};
|
|
483
|
+
const a = e.value.style.chart.tooltip.customFormat;
|
|
484
|
+
if (bt(a) && nl(
|
|
485
|
+
() => a({
|
|
486
|
+
seriesIndex: o,
|
|
487
|
+
datapoint: l,
|
|
488
|
+
series: g.value,
|
|
489
|
+
config: e.value
|
|
490
|
+
})
|
|
491
|
+
))
|
|
492
|
+
ve.value = a({
|
|
493
|
+
seriesIndex: o,
|
|
494
|
+
datapoint: l,
|
|
495
|
+
series: g.value,
|
|
496
|
+
config: e.value
|
|
497
|
+
});
|
|
498
|
+
else {
|
|
499
|
+
let t = "";
|
|
500
|
+
if (e.value.style.chart.tooltip.showAllItemsAtIndex && k.value.length === 0) {
|
|
501
|
+
const u = g.value.map((c) => c.series.find((f) => f.seriesIndex === o));
|
|
502
|
+
u.forEach((c, f) => {
|
|
503
|
+
if (!c) return "";
|
|
504
|
+
t += `
|
|
505
|
+
<div style="display:flex; flex-direction: column; justify-content:flex-start; align-items:flex-start;padding:6px 0; ${f < u.length - 1 ? `border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor}` : ""}">
|
|
506
|
+
<div style="display:flex; flex-direction: row; gap: 3px; justify-content:flex-start; align-items:center;">
|
|
507
|
+
<svg viewBox="0 0 20 20" height="${e.value.style.chart.tooltip.fontSize}" width="${e.value.style.chart.tooltip.fontSize}">
|
|
508
|
+
<circle cx="10" cy="10" r="10" fill="${c.color}"/>
|
|
509
|
+
</svg>
|
|
510
|
+
<span>
|
|
511
|
+
${c.arcOf ?? ""} - ${c.name}
|
|
512
|
+
</span>
|
|
513
|
+
</div>
|
|
514
|
+
<span>
|
|
515
|
+
${e.value.style.chart.tooltip.showValue ? `<b>${j(
|
|
516
|
+
e.value.style.chart.layout.labels.dataLabels.formatter,
|
|
517
|
+
l.value,
|
|
518
|
+
N({
|
|
519
|
+
p: e.value.style.chart.layout.labels.dataLabels.prefix,
|
|
520
|
+
v: l.value,
|
|
521
|
+
s: e.value.style.chart.layout.labels.dataLabels.suffix,
|
|
522
|
+
r: e.value.style.chart.tooltip.roundingValue
|
|
523
|
+
}),
|
|
524
|
+
{ datapoint: l, seriesIndex: o }
|
|
525
|
+
)}
|
|
526
|
+
</b>` : ""}
|
|
527
|
+
${e.value.style.chart.tooltip.showPercentage ? `(${N({
|
|
528
|
+
v: c.proportion * 100,
|
|
529
|
+
s: "%",
|
|
530
|
+
r: e.value.style.chart.tooltip.roundingPercentage
|
|
531
|
+
})})` : ""}
|
|
532
|
+
</span>
|
|
533
|
+
</div>
|
|
534
|
+
`;
|
|
535
|
+
});
|
|
536
|
+
} else
|
|
537
|
+
t += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.arcOf ?? ""} - ${l.name}</div>`, t += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`, e.value.style.chart.tooltip.showValue && (t += `<b>${j(
|
|
538
|
+
e.value.style.chart.layout.labels.dataLabels.formatter,
|
|
539
|
+
l.value,
|
|
540
|
+
N({
|
|
541
|
+
p: e.value.style.chart.layout.labels.dataLabels.prefix,
|
|
542
|
+
v: l.value,
|
|
543
|
+
s: e.value.style.chart.layout.labels.dataLabels.suffix,
|
|
544
|
+
r: e.value.style.chart.tooltip.roundingValue
|
|
545
|
+
}),
|
|
546
|
+
{ datapoint: l, seriesIndex: o }
|
|
547
|
+
)}</b>`), e.value.style.chart.tooltip.showPercentage && (e.value.style.chart.tooltip.showValue ? t += `<span>(${N({
|
|
548
|
+
v: l.proportion * 100,
|
|
549
|
+
s: "%",
|
|
550
|
+
r: e.value.style.chart.tooltip.roundingPercentage
|
|
551
|
+
})})</span></div>` : t += `<b>${N({
|
|
552
|
+
v: l.proportion * 100,
|
|
553
|
+
s: "%",
|
|
554
|
+
r: e.value.style.chart.tooltip.roundingPercentage
|
|
555
|
+
})}</b></div>`);
|
|
556
|
+
ve.value = `<div style="font-size:${e.value.style.chart.tooltip.fontSize}px">${t}</div>`;
|
|
557
|
+
}
|
|
558
|
+
ce.value = !0;
|
|
559
|
+
}
|
|
560
|
+
function $e(l) {
|
|
561
|
+
return l.proportion * 100 > e.value.style.chart.layout.labels.dataLabels.hideUnderValue;
|
|
562
|
+
}
|
|
563
|
+
function ut(l, s) {
|
|
564
|
+
if (!e.value.useBlurOnHover)
|
|
565
|
+
return "";
|
|
566
|
+
if (e.value.style.chart.tooltip.showAllItemsAtIndex && k.value.length === 0)
|
|
567
|
+
return [null, void 0].includes(ae.value) || ae.value === s ? "" : `url(#blur_${p.value})`;
|
|
568
|
+
if (!e.value.style.chart.tooltip.showAllItemsAtIndex || k.value.length)
|
|
569
|
+
return [null, void 0].includes(le.value) || le.value === l.id ? "" : `url(#blur_${p.value})`;
|
|
570
|
+
}
|
|
571
|
+
const ke = L(() => F.value.map((l, s) => {
|
|
572
|
+
const o = l.series.filter(
|
|
573
|
+
(t) => !k.value.includes(t.id)
|
|
574
|
+
), a = B.value ? o.map((t) => {
|
|
575
|
+
const u = R.value[s].series.findIndex(
|
|
576
|
+
(c) => c.name === t.name
|
|
577
|
+
);
|
|
578
|
+
return M(
|
|
579
|
+
R.value[s].series[u].values
|
|
580
|
+
).reduce((c, f) => c + f, 0);
|
|
581
|
+
}).reduce((t, u) => t + u, 0) : o.map((t) => t.value).reduce((t, u) => t + u, 0);
|
|
582
|
+
return l.series.map((t, u) => {
|
|
583
|
+
const c = M(R.value[s].series[u].values).reduce(
|
|
584
|
+
(m, d) => m + d,
|
|
585
|
+
0
|
|
586
|
+
), f = B.value ? c : t.value;
|
|
587
|
+
return {
|
|
588
|
+
name: t.name,
|
|
589
|
+
color: t.color,
|
|
590
|
+
value: f,
|
|
591
|
+
shape: "circle",
|
|
592
|
+
arcOf: t.arcOf,
|
|
593
|
+
id: t.id,
|
|
594
|
+
seriesIndex: u,
|
|
595
|
+
datasetIndex: s,
|
|
596
|
+
total: a,
|
|
597
|
+
opacity: k.value.includes(t.id) ? 0.5 : 1,
|
|
598
|
+
segregate: () => me(t),
|
|
599
|
+
isSegregated: k.value.includes(t.id)
|
|
600
|
+
};
|
|
601
|
+
});
|
|
602
|
+
})), Dt = L(() => ({
|
|
603
|
+
cy: "nested-donuts-legend",
|
|
604
|
+
backgroundColor: e.value.style.chart.legend.backgroundColor,
|
|
605
|
+
color: e.value.style.chart.legend.color,
|
|
606
|
+
fontSize: e.value.style.chart.legend.fontSize,
|
|
607
|
+
paddingBottom: 12,
|
|
608
|
+
fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
|
|
609
|
+
})), D = L(() => {
|
|
610
|
+
const l = g.value.flatMap((o) => o.series.map((a) => ({
|
|
611
|
+
name: `${o.name} - ${a.name}`,
|
|
612
|
+
color: a.color,
|
|
613
|
+
total: o.total
|
|
614
|
+
}))), s = g.value.flatMap((o) => o.series.map((a) => a.value));
|
|
615
|
+
return { head: l, body: s };
|
|
616
|
+
});
|
|
617
|
+
function nt(l = null) {
|
|
618
|
+
yt(() => {
|
|
619
|
+
const s = D.value.head.map((t, u) => [
|
|
620
|
+
[t.name],
|
|
621
|
+
[D.value.body[u]],
|
|
622
|
+
[
|
|
623
|
+
isNaN(D.value.body[u] / t.total) ? "-" : D.value.body[u] / t.total * 100
|
|
624
|
+
]
|
|
625
|
+
]), o = [
|
|
626
|
+
[e.value.style.chart.title.text],
|
|
627
|
+
[e.value.style.chart.title.subtitle.text],
|
|
628
|
+
[[""], ["val"], ["%"]]
|
|
629
|
+
].concat(s), a = sl(o);
|
|
630
|
+
l ? l(a) : ul({
|
|
631
|
+
csvContent: a,
|
|
632
|
+
title: e.value.style.chart.title.text || "vue-ui-nested-donuts"
|
|
633
|
+
});
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
const oe = L(() => {
|
|
637
|
+
const l = [
|
|
638
|
+
e.value.table.columnNames.series,
|
|
639
|
+
e.value.table.columnNames.value,
|
|
640
|
+
e.value.table.columnNames.percentage
|
|
641
|
+
], s = D.value.head.map((t, u) => {
|
|
642
|
+
const c = N({
|
|
643
|
+
p: e.value.style.chart.layout.labels.dataLabels.prefix,
|
|
644
|
+
v: D.value.body[u],
|
|
645
|
+
s: e.value.style.chart.layout.labels.dataLabels.suffix,
|
|
646
|
+
r: e.value.table.td.roundingValue
|
|
647
|
+
});
|
|
648
|
+
return [
|
|
649
|
+
{
|
|
650
|
+
color: t.color,
|
|
651
|
+
name: t.name
|
|
652
|
+
},
|
|
653
|
+
c,
|
|
654
|
+
isNaN(D.value.body[u] / t.total) ? "-" : N({
|
|
655
|
+
v: D.value.body[u] / t.total * 100,
|
|
656
|
+
s: "%",
|
|
657
|
+
r: e.value.table.td.roundingPercentage
|
|
658
|
+
})
|
|
659
|
+
];
|
|
660
|
+
}), o = {
|
|
661
|
+
th: {
|
|
662
|
+
backgroundColor: e.value.table.th.backgroundColor,
|
|
663
|
+
color: e.value.table.th.color,
|
|
664
|
+
outline: e.value.table.th.outline
|
|
665
|
+
},
|
|
666
|
+
td: {
|
|
667
|
+
backgroundColor: e.value.table.td.backgroundColor,
|
|
668
|
+
color: e.value.table.td.color,
|
|
669
|
+
outline: e.value.table.td.outline
|
|
670
|
+
},
|
|
671
|
+
breakpoint: e.value.table.responsiveBreakpoint
|
|
672
|
+
};
|
|
673
|
+
return {
|
|
674
|
+
colNames: [
|
|
675
|
+
e.value.table.columnNames.series,
|
|
676
|
+
e.value.table.columnNames.value,
|
|
677
|
+
e.value.table.columnNames.percentage
|
|
678
|
+
],
|
|
679
|
+
head: l,
|
|
680
|
+
body: s,
|
|
681
|
+
config: o
|
|
682
|
+
};
|
|
683
|
+
});
|
|
684
|
+
function zt() {
|
|
685
|
+
return F.value;
|
|
686
|
+
}
|
|
687
|
+
function rt() {
|
|
688
|
+
$.value.showTable = !$.value.showTable;
|
|
689
|
+
}
|
|
690
|
+
function it() {
|
|
691
|
+
$.value.dataLabels.show = !$.value.dataLabels.show;
|
|
692
|
+
}
|
|
693
|
+
function dt() {
|
|
694
|
+
$.value.showTooltip = !$.value.showTooltip;
|
|
695
|
+
}
|
|
696
|
+
const se = h(!1);
|
|
697
|
+
function Le() {
|
|
698
|
+
se.value = !se.value;
|
|
699
|
+
}
|
|
700
|
+
async function Mt({ scale: l = 2 } = {}) {
|
|
701
|
+
if (!V.value) return;
|
|
702
|
+
const { width: s, height: o } = V.value.getBoundingClientRect(), a = s / o, { imageUri: t, base64: u } = await yl({ domElement: V.value, base64: !0, img: !0, scale: l });
|
|
703
|
+
return {
|
|
704
|
+
imageUri: t,
|
|
705
|
+
base64: u,
|
|
706
|
+
title: e.value.style.chart.title.text,
|
|
707
|
+
width: s,
|
|
708
|
+
height: o,
|
|
709
|
+
aspectRatio: a
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
const Ce = h(null);
|
|
713
|
+
function Bt() {
|
|
714
|
+
if (!Ce.value) return;
|
|
715
|
+
const { x: l, y: s, width: o, height: a } = Ce.value.getBBox();
|
|
716
|
+
ee.value && ee.value.setAttribute("viewBox", `${l} ${s} ${o + Math.min(0, l)} ${a + Math.min(0, s)}`);
|
|
717
|
+
}
|
|
718
|
+
return $t({
|
|
719
|
+
autoSize: Bt,
|
|
720
|
+
getData: zt,
|
|
721
|
+
getImage: Mt,
|
|
722
|
+
generatePdf: Ze,
|
|
723
|
+
generateCsv: nt,
|
|
724
|
+
generateImage: je,
|
|
725
|
+
toggleTable: rt,
|
|
726
|
+
toggleLabels: it,
|
|
727
|
+
toggleTooltip: dt,
|
|
728
|
+
toggleAnnotator: Le,
|
|
729
|
+
toggleFullscreen: Ge
|
|
730
|
+
}), (l, s) => (n(), r("div", {
|
|
731
|
+
ref_key: "nestedDonutsChart",
|
|
732
|
+
ref: V,
|
|
733
|
+
class: z(`vue-ui-nested-donuts ${Y.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
|
|
734
|
+
style: ie(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor}`),
|
|
735
|
+
id: `nested_donuts_${p.value}`,
|
|
736
|
+
onMouseenter: s[3] || (s[3] = () => i(Xe)(!0)),
|
|
737
|
+
onMouseleave: s[4] || (s[4] = () => i(Xe)(!1))
|
|
738
|
+
}, [
|
|
739
|
+
e.value.userOptions.buttons.annotator ? (n(), G(i(_t), {
|
|
740
|
+
key: 0,
|
|
741
|
+
svgRef: i(ee),
|
|
742
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
743
|
+
color: e.value.style.chart.color,
|
|
744
|
+
active: se.value,
|
|
745
|
+
onClose: Le
|
|
746
|
+
}, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : w("", !0),
|
|
747
|
+
St.value ? (n(), r("div", {
|
|
748
|
+
key: 1,
|
|
749
|
+
ref_key: "noTitle",
|
|
750
|
+
ref: Be,
|
|
751
|
+
class: "vue-data-ui-no-title-space",
|
|
752
|
+
style: "height:36px; width: 100%;background:transparent"
|
|
753
|
+
}, null, 512)) : w("", !0),
|
|
754
|
+
e.value.style.chart.title.text ? (n(), r("div", {
|
|
755
|
+
key: 2,
|
|
756
|
+
ref_key: "chartTitle",
|
|
757
|
+
ref: ze
|
|
758
|
+
}, [
|
|
759
|
+
(n(), G(hl, {
|
|
760
|
+
key: `title_${Ee.value}`,
|
|
761
|
+
config: {
|
|
762
|
+
title: {
|
|
763
|
+
cy: "donut-div-title",
|
|
764
|
+
...e.value.style.chart.title
|
|
765
|
+
},
|
|
766
|
+
subtitle: {
|
|
767
|
+
cy: "donut-div-subtitle",
|
|
768
|
+
...e.value.style.chart.title.subtitle
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}, null, 8, ["config"]))
|
|
772
|
+
], 512)) : w("", !0),
|
|
773
|
+
e.value.userOptions.show && de.value && (i(We) || i(be)) ? (n(), G(i(Tt), {
|
|
774
|
+
ref: "details",
|
|
775
|
+
key: `user_option_${De.value}`,
|
|
776
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
777
|
+
color: e.value.style.chart.color,
|
|
778
|
+
isPrinting: i(Ke),
|
|
779
|
+
isImaging: i(Qe),
|
|
780
|
+
uid: p.value,
|
|
781
|
+
hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
|
|
782
|
+
hasPdf: e.value.userOptions.buttons.pdf,
|
|
783
|
+
hasXls: e.value.userOptions.buttons.csv,
|
|
784
|
+
hasImg: e.value.userOptions.buttons.img,
|
|
785
|
+
hasTable: e.value.userOptions.buttons.table,
|
|
786
|
+
hasLabel: e.value.userOptions.buttons.labels,
|
|
787
|
+
hasFullscreen: e.value.userOptions.buttons.fullscreen,
|
|
788
|
+
isFullscreen: Y.value,
|
|
789
|
+
isTooltip: $.value.showTooltip,
|
|
790
|
+
titles: { ...e.value.userOptions.buttonTitles },
|
|
791
|
+
chartElement: V.value,
|
|
792
|
+
position: e.value.userOptions.position,
|
|
793
|
+
hasAnnotator: e.value.userOptions.buttons.annotator,
|
|
794
|
+
isAnnotation: se.value,
|
|
795
|
+
callbacks: e.value.userOptions.callbacks,
|
|
796
|
+
printScale: e.value.userOptions.print.scale,
|
|
797
|
+
onToggleFullscreen: Ge,
|
|
798
|
+
onGeneratePdf: i(Ze),
|
|
799
|
+
onGenerateCsv: nt,
|
|
800
|
+
onGenerateImage: i(je),
|
|
801
|
+
onToggleTable: rt,
|
|
802
|
+
onToggleLabels: it,
|
|
803
|
+
onToggleTooltip: dt,
|
|
804
|
+
onToggleAnnotator: Le,
|
|
805
|
+
style: ie({
|
|
806
|
+
visibility: i(We) ? i(be) ? "visible" : "hidden" : "visible"
|
|
807
|
+
})
|
|
808
|
+
}, qt({ _: 2 }, [
|
|
809
|
+
l.$slots.menuIcon ? {
|
|
810
|
+
name: "menuIcon",
|
|
811
|
+
fn: C(({ isOpen: o, color: a }) => [
|
|
812
|
+
x(l.$slots, "menuIcon", H(J({ isOpen: o, color: a })), void 0, !0)
|
|
813
|
+
]),
|
|
814
|
+
key: "0"
|
|
815
|
+
} : void 0,
|
|
816
|
+
l.$slots.optionTooltip ? {
|
|
817
|
+
name: "optionTooltip",
|
|
818
|
+
fn: C(() => [
|
|
819
|
+
x(l.$slots, "optionTooltip", {}, void 0, !0)
|
|
820
|
+
]),
|
|
821
|
+
key: "1"
|
|
822
|
+
} : void 0,
|
|
823
|
+
l.$slots.optionPdf ? {
|
|
824
|
+
name: "optionPdf",
|
|
825
|
+
fn: C(() => [
|
|
826
|
+
x(l.$slots, "optionPdf", {}, void 0, !0)
|
|
827
|
+
]),
|
|
828
|
+
key: "2"
|
|
829
|
+
} : void 0,
|
|
830
|
+
l.$slots.optionCsv ? {
|
|
831
|
+
name: "optionCsv",
|
|
832
|
+
fn: C(() => [
|
|
833
|
+
x(l.$slots, "optionCsv", {}, void 0, !0)
|
|
834
|
+
]),
|
|
835
|
+
key: "3"
|
|
836
|
+
} : void 0,
|
|
837
|
+
l.$slots.optionImg ? {
|
|
838
|
+
name: "optionImg",
|
|
839
|
+
fn: C(() => [
|
|
840
|
+
x(l.$slots, "optionImg", {}, void 0, !0)
|
|
841
|
+
]),
|
|
842
|
+
key: "4"
|
|
843
|
+
} : void 0,
|
|
844
|
+
l.$slots.optionTable ? {
|
|
845
|
+
name: "optionTable",
|
|
846
|
+
fn: C(() => [
|
|
847
|
+
x(l.$slots, "optionTable", {}, void 0, !0)
|
|
848
|
+
]),
|
|
849
|
+
key: "5"
|
|
850
|
+
} : void 0,
|
|
851
|
+
l.$slots.optionLabels ? {
|
|
852
|
+
name: "optionLabels",
|
|
853
|
+
fn: C(() => [
|
|
854
|
+
x(l.$slots, "optionLabels", {}, void 0, !0)
|
|
855
|
+
]),
|
|
856
|
+
key: "6"
|
|
857
|
+
} : void 0,
|
|
858
|
+
l.$slots.optionFullscreen ? {
|
|
859
|
+
name: "optionFullscreen",
|
|
860
|
+
fn: C(({ toggleFullscreen: o, isFullscreen: a }) => [
|
|
861
|
+
x(l.$slots, "optionFullscreen", H(J({ toggleFullscreen: o, isFullscreen: a })), void 0, !0)
|
|
862
|
+
]),
|
|
863
|
+
key: "7"
|
|
864
|
+
} : void 0,
|
|
865
|
+
l.$slots.optionAnnotator ? {
|
|
866
|
+
name: "optionAnnotator",
|
|
867
|
+
fn: C(({ toggleAnnotator: o, isAnnotator: a }) => [
|
|
868
|
+
x(l.$slots, "optionAnnotator", H(J({ toggleAnnotator: o, isAnnotator: a })), void 0, !0)
|
|
869
|
+
]),
|
|
870
|
+
key: "8"
|
|
871
|
+
} : void 0
|
|
872
|
+
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : w("", !0),
|
|
873
|
+
(n(), r("svg", {
|
|
874
|
+
ref_key: "svgRef",
|
|
875
|
+
ref: ee,
|
|
876
|
+
xmlns: i(al),
|
|
877
|
+
class: z({
|
|
878
|
+
"vue-data-ui-fullscreen--on": Y.value,
|
|
879
|
+
"vue-data-ui-fulscreen--off": !Y.value,
|
|
880
|
+
"vue-data-ui-svg": !0
|
|
881
|
+
}),
|
|
882
|
+
viewBox: `0 0 ${v.value.width <= 0 ? 1e-3 : v.value.width} ${v.value.height < 0 ? 1e-3 : v.value.height}`,
|
|
883
|
+
style: ie(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color};${qe.value.css}`)
|
|
884
|
+
}, [
|
|
885
|
+
y("g", {
|
|
886
|
+
ref_key: "G",
|
|
887
|
+
ref: Ce,
|
|
888
|
+
class: "vue-data-ui-g"
|
|
889
|
+
}, [
|
|
890
|
+
vt(i(xt)),
|
|
891
|
+
l.$slots["chart-background"] ? (n(), r("foreignObject", {
|
|
892
|
+
key: 0,
|
|
893
|
+
x: 0,
|
|
894
|
+
y: 0,
|
|
895
|
+
width: v.value.width <= 0 ? 1e-3 : v.value.width,
|
|
896
|
+
height: v.value.height < 0 ? 1e-3 : v.value.height,
|
|
897
|
+
style: {
|
|
898
|
+
pointerEvents: "none"
|
|
899
|
+
}
|
|
900
|
+
}, [
|
|
901
|
+
x(l.$slots, "chart-background", {}, void 0, !0)
|
|
902
|
+
], 8, $l)) : w("", !0),
|
|
903
|
+
y("defs", null, [
|
|
904
|
+
(n(!0), r(_, null, A(ot.value, (o, a) => (n(), r("radialGradient", {
|
|
905
|
+
id: `radial_${p.value}_${a}`
|
|
906
|
+
}, [
|
|
907
|
+
s[5] || (s[5] = y("stop", {
|
|
908
|
+
offset: "0%",
|
|
909
|
+
"stop-color": "#FFFFFF",
|
|
910
|
+
"stop-opacity": "0"
|
|
911
|
+
}, null, -1)),
|
|
912
|
+
y("stop", {
|
|
913
|
+
offset: `${(1 - te.value / at.value[a]) * 100}%`,
|
|
914
|
+
"stop-color": i(ol)("#FFFFFF", 0),
|
|
915
|
+
"stop-opacity": "0"
|
|
916
|
+
}, null, 8, Ll),
|
|
917
|
+
y("stop", {
|
|
918
|
+
offset: `${(1 - te.value / at.value[a] / 2) * 100}%`,
|
|
919
|
+
"stop-color": "#FFFFFF",
|
|
920
|
+
"stop-opacity": e.value.style.chart.gradientIntensity / 100
|
|
921
|
+
}, null, 8, Cl),
|
|
922
|
+
s[6] || (s[6] = y("stop", {
|
|
923
|
+
offset: "100%",
|
|
924
|
+
"stop-color": "#FFFFFF",
|
|
925
|
+
"stop-opacity": "0"
|
|
926
|
+
}, null, -1))
|
|
927
|
+
], 8, kl))), 256))
|
|
928
|
+
]),
|
|
929
|
+
y("defs", null, [
|
|
930
|
+
y("filter", {
|
|
931
|
+
id: `blur_${p.value}`,
|
|
932
|
+
x: "-50%",
|
|
933
|
+
y: "-50%",
|
|
934
|
+
width: "200%",
|
|
935
|
+
height: "200%"
|
|
936
|
+
}, [
|
|
937
|
+
y("feGaussianBlur", {
|
|
938
|
+
in: "SourceGraphic",
|
|
939
|
+
stdDeviation: 2,
|
|
940
|
+
id: `blur_std_${p.value}`
|
|
941
|
+
}, null, 8, _l),
|
|
942
|
+
s[7] || (s[7] = y("feColorMatrix", {
|
|
943
|
+
type: "saturate",
|
|
944
|
+
values: "0"
|
|
945
|
+
}, null, -1))
|
|
946
|
+
], 8, xl),
|
|
947
|
+
y("filter", {
|
|
948
|
+
id: `shadow_${p.value}`,
|
|
949
|
+
"color-interpolation-filters": "sRGB"
|
|
950
|
+
}, [
|
|
951
|
+
y("feDropShadow", {
|
|
952
|
+
dx: "0",
|
|
953
|
+
dy: "0",
|
|
954
|
+
stdDeviation: "10",
|
|
955
|
+
"flood-opacity": "0.5",
|
|
956
|
+
"flood-color": e.value.style.chart.layout.donut.shadowColor
|
|
957
|
+
}, null, 8, Tl)
|
|
958
|
+
], 8, Al)
|
|
959
|
+
]),
|
|
960
|
+
y("defs", null, [
|
|
961
|
+
(n(!0), r(_, null, A(q.value, (o, a) => (n(), r("path", {
|
|
962
|
+
key: `path-full-${a}`,
|
|
963
|
+
id: `path-full-${a}-${p.value}`,
|
|
964
|
+
d: o.fullCirclePath,
|
|
965
|
+
fill: "none"
|
|
966
|
+
}, null, 8, Nl))), 128))
|
|
967
|
+
]),
|
|
968
|
+
(n(!0), r(_, null, A(q.value, (o, a) => (n(), r("g", null, [
|
|
969
|
+
o.hasData ? (n(!0), r(_, { key: 0 }, A(o.donut.filter((t) => !t.ghost), (t, u) => (n(), r("g", null, [
|
|
970
|
+
y("path", {
|
|
971
|
+
class: "vue-ui-donut-arc-path",
|
|
972
|
+
d: t.arcSlice,
|
|
973
|
+
fill: t.color,
|
|
974
|
+
stroke: e.value.style.chart.layout.donut.borderColorAuto ? e.value.style.chart.backgroundColor : e.value.style.chart.layout.donut.borderColor,
|
|
975
|
+
"stroke-width": e.value.style.chart.layout.donut.borderWidth,
|
|
976
|
+
filter: ut(t, u)
|
|
977
|
+
}, null, 8, Ol)
|
|
978
|
+
]))), 256)) : (n(!0), r(_, { key: 1 }, A(o.skeleton, (t, u) => (n(), r("g", null, [
|
|
979
|
+
y("path", {
|
|
980
|
+
class: "vue-ui-donut-arc-path",
|
|
981
|
+
d: t.arcSlice,
|
|
982
|
+
fill: t.color,
|
|
983
|
+
stroke: e.value.style.chart.layout.donut.borderColorAuto ? e.value.style.chart.backgroundColor : e.value.style.chart.layout.donut.borderColor,
|
|
984
|
+
"stroke-width": e.value.style.chart.layout.donut.borderWidth
|
|
985
|
+
}, null, 8, Sl)
|
|
986
|
+
]))), 256))
|
|
987
|
+
]))), 256)),
|
|
988
|
+
e.value.style.chart.useGradient ? (n(), r("g", Fl, [
|
|
989
|
+
(n(!0), r(_, null, A(ot.value, (o, a) => (n(), r("g", null, [
|
|
990
|
+
y("path", {
|
|
991
|
+
d: o.donut.arcSlice,
|
|
992
|
+
fill: `url(#radial_${p.value}_${a})`,
|
|
993
|
+
stroke: "transparent",
|
|
994
|
+
"stroke-width": "0"
|
|
995
|
+
}, null, 8, Il)
|
|
996
|
+
]))), 256))
|
|
997
|
+
])) : w("", !0),
|
|
998
|
+
e.value.style.chart.layout.labels.dataLabels.showDonutName ? (n(), r("g", Vl, [
|
|
999
|
+
e.value.style.chart.layout.labels.dataLabels.curvedDonutName ? (n(!0), r(_, { key: 0 }, A(q.value, (o, a) => (n(), r("g", null, [
|
|
1000
|
+
(n(!0), r(_, null, A(o.donut, (t, u) => (n(), r("g", null, [
|
|
1001
|
+
u === 0 && v.value.width && v.value.height ? (n(), r("text", {
|
|
1002
|
+
key: 0,
|
|
1003
|
+
class: z({ animated: e.value.useCssAnimation }),
|
|
1004
|
+
"text-anchor": "middle",
|
|
1005
|
+
"font-size": e.value.style.chart.layout.labels.dataLabels.fontSize,
|
|
1006
|
+
"font-weight": e.value.style.chart.layout.labels.dataLabels.boldDonutName ? "bold" : "normal",
|
|
1007
|
+
fill: e.value.style.chart.layout.labels.dataLabels.color,
|
|
1008
|
+
dy: e.value.style.chart.layout.labels.dataLabels.donutNameOffsetY
|
|
1009
|
+
}, [
|
|
1010
|
+
y("textPath", {
|
|
1011
|
+
href: `#path-full-${a}-${p.value}`,
|
|
1012
|
+
startOffset: "50%",
|
|
1013
|
+
"text-anchor": "middle",
|
|
1014
|
+
method: "align",
|
|
1015
|
+
spacing: "auto",
|
|
1016
|
+
side: "right"
|
|
1017
|
+
}, O(e.value.style.chart.layout.labels.dataLabels.donutNameAbbreviation ? i(pt)({
|
|
1018
|
+
source: o.name,
|
|
1019
|
+
length: e.value.style.chart.layout.labels.dataLabels.donutNameMaxAbbreviationSize
|
|
1020
|
+
}) : o.name), 9, Dl)
|
|
1021
|
+
], 10, Pl)) : w("", !0)
|
|
1022
|
+
]))), 256))
|
|
1023
|
+
]))), 256)) : (n(!0), r(_, { key: 1 }, A(q.value, (o, a) => (n(), r("g", null, [
|
|
1024
|
+
(n(!0), r(_, null, A(o.donut, (t, u) => (n(), r("g", null, [
|
|
1025
|
+
u === 0 && v.value.width && v.value.height ? (n(), r("text", {
|
|
1026
|
+
key: 0,
|
|
1027
|
+
class: z({ animated: e.value.useCssAnimation }),
|
|
1028
|
+
x: v.value.width / 2,
|
|
1029
|
+
y: t.startY - e.value.style.chart.layout.labels.dataLabels.fontSize + e.value.style.chart.layout.labels.dataLabels.donutNameOffsetY,
|
|
1030
|
+
"text-anchor": "middle",
|
|
1031
|
+
"font-size": e.value.style.chart.layout.labels.dataLabels.fontSize,
|
|
1032
|
+
"font-weight": e.value.style.chart.layout.labels.dataLabels.boldDonutName ? "bold" : "normal",
|
|
1033
|
+
fill: e.value.style.chart.layout.labels.dataLabels.color
|
|
1034
|
+
}, O(e.value.style.chart.layout.labels.dataLabels.donutNameAbbreviation ? i(pt)({
|
|
1035
|
+
source: o.name,
|
|
1036
|
+
length: e.value.style.chart.layout.labels.dataLabels.donutNameMaxAbbreviationSize
|
|
1037
|
+
}) : o.name), 11, zl)) : w("", !0)
|
|
1038
|
+
]))), 256))
|
|
1039
|
+
]))), 256))
|
|
1040
|
+
])) : w("", !0),
|
|
1041
|
+
e.value.style.chart.layout.labels.dataLabels.show ? (n(), r("g", Ml, [
|
|
1042
|
+
(n(!0), r(_, null, A(q.value, (o, a) => (n(), r("g", null, [
|
|
1043
|
+
(n(!0), r(_, null, A(o.donut.filter((t) => !t.ghost), (t, u) => (n(), r("g", {
|
|
1044
|
+
filter: ut(t, u)
|
|
1045
|
+
}, [
|
|
1046
|
+
ht(y("text", {
|
|
1047
|
+
class: z({ animated: e.value.useCssAnimation }),
|
|
1048
|
+
opacity: $e(t) ? 1 : 0,
|
|
1049
|
+
"text-anchor": i(Q)(t, !0).anchor,
|
|
1050
|
+
x: i(Q)(
|
|
1051
|
+
t,
|
|
1052
|
+
!1,
|
|
1053
|
+
e.value.style.chart.layout.labels.dataLabels.offsetX
|
|
1054
|
+
).x || 0,
|
|
1055
|
+
y: i(Ve)(
|
|
1056
|
+
t,
|
|
1057
|
+
e.value.style.chart.layout.labels.dataLabels.offsetY,
|
|
1058
|
+
e.value.style.chart.layout.labels.dataLabels.offsetY
|
|
1059
|
+
),
|
|
1060
|
+
fill: e.value.style.chart.layout.labels.dataLabels.useSerieColor ? t.color : e.value.style.chart.layout.labels.dataLabels.color,
|
|
1061
|
+
"font-size": e.value.style.chart.layout.labels.dataLabels.fontSize,
|
|
1062
|
+
"font-weight": e.value.style.chart.layout.labels.dataLabels.boldPercentage ? "bold" : "normal"
|
|
1063
|
+
}, O(i(N)({
|
|
1064
|
+
v: t.proportion * 100,
|
|
1065
|
+
s: "%",
|
|
1066
|
+
r: e.value.style.chart.layout.labels.dataLabels.roundingPercentage
|
|
1067
|
+
})), 11, El), [
|
|
1068
|
+
[
|
|
1069
|
+
ft,
|
|
1070
|
+
$.value.dataLabels.show && e.value.style.chart.layout.labels.dataLabels.showPercentage
|
|
1071
|
+
]
|
|
1072
|
+
]),
|
|
1073
|
+
ht(y("text", {
|
|
1074
|
+
class: z({ animated: e.value.useCssAnimation }),
|
|
1075
|
+
opacity: $e(t) ? 1 : 0,
|
|
1076
|
+
"text-anchor": i(Q)(t, !0).anchor,
|
|
1077
|
+
x: i(Q)(
|
|
1078
|
+
t,
|
|
1079
|
+
!1,
|
|
1080
|
+
e.value.style.chart.layout.labels.dataLabels.offsetX
|
|
1081
|
+
).x || 0,
|
|
1082
|
+
y: i(Ve)(
|
|
1083
|
+
t,
|
|
1084
|
+
e.value.style.chart.layout.labels.dataLabels.offsetY,
|
|
1085
|
+
e.value.style.chart.layout.labels.dataLabels.offsetY
|
|
1086
|
+
) + e.value.style.chart.layout.labels.dataLabels.fontSize,
|
|
1087
|
+
fill: e.value.style.chart.layout.labels.dataLabels.useSerieColor ? t.color : e.value.style.chart.layout.labels.dataLabels.color,
|
|
1088
|
+
"font-size": e.value.style.chart.layout.labels.dataLabels.fontSize,
|
|
1089
|
+
"font-weight": e.value.style.chart.layout.labels.dataLabels.boldValue ? "bold" : "normal"
|
|
1090
|
+
}, " (" + O(i(j)(
|
|
1091
|
+
e.value.style.chart.layout.labels.dataLabels.formatter,
|
|
1092
|
+
t.value,
|
|
1093
|
+
i(N)({
|
|
1094
|
+
p: e.value.style.chart.layout.labels.dataLabels.prefix,
|
|
1095
|
+
v: t.value,
|
|
1096
|
+
s: e.value.style.chart.layout.labels.dataLabels.suffix,
|
|
1097
|
+
r: e.value.style.chart.layout.labels.dataLabels.roundingValue
|
|
1098
|
+
}),
|
|
1099
|
+
{ datapoint: t, seriesIndex: a, datapointIndex: u }
|
|
1100
|
+
)) + ") ", 11, Rl), [
|
|
1101
|
+
[
|
|
1102
|
+
ft,
|
|
1103
|
+
$.value.dataLabels.show && e.value.style.chart.layout.labels.dataLabels.showPercentage && e.value.style.chart.layout.labels.dataLabels.showValue
|
|
1104
|
+
]
|
|
1105
|
+
]),
|
|
1106
|
+
$e(t) && $.value.dataLabels.show && !e.value.style.chart.layout.labels.dataLabels.showPercentage && e.value.style.chart.layout.labels.dataLabels.showValue ? (n(), r("text", {
|
|
1107
|
+
key: 0,
|
|
1108
|
+
class: z({ animated: e.value.useCssAnimation }),
|
|
1109
|
+
"text-anchor": i(Q)(t, !0).anchor,
|
|
1110
|
+
x: i(Q)(
|
|
1111
|
+
t,
|
|
1112
|
+
!1,
|
|
1113
|
+
e.value.style.chart.layout.labels.dataLabels.offsetX
|
|
1114
|
+
).x || 0,
|
|
1115
|
+
y: i(Ve)(
|
|
1116
|
+
t,
|
|
1117
|
+
e.value.style.chart.layout.labels.dataLabels.offsetY,
|
|
1118
|
+
e.value.style.chart.layout.labels.dataLabels.offsetY
|
|
1119
|
+
),
|
|
1120
|
+
fill: e.value.style.chart.layout.labels.dataLabels.useSerieColor ? t.color : e.value.style.chart.layout.labels.dataLabels.color,
|
|
1121
|
+
"font-size": e.value.style.chart.layout.labels.dataLabels.fontSize,
|
|
1122
|
+
"font-weight": e.value.style.chart.layout.labels.dataLabels.boldValue ? "bold" : "normal"
|
|
1123
|
+
}, O(i(j)(
|
|
1124
|
+
e.value.style.chart.layout.labels.dataLabels.formatter,
|
|
1125
|
+
t.value,
|
|
1126
|
+
i(N)({
|
|
1127
|
+
p: e.value.style.chart.layout.labels.dataLabels.prefix,
|
|
1128
|
+
v: t.value,
|
|
1129
|
+
s: e.value.style.chart.layout.labels.dataLabels.suffix,
|
|
1130
|
+
r: e.value.style.chart.layout.labels.dataLabels.roundingValue
|
|
1131
|
+
}),
|
|
1132
|
+
{ datapoint: t, seriesIndex: a, datapointIndex: u }
|
|
1133
|
+
)), 11, Ul)) : w("", !0)
|
|
1134
|
+
], 8, Bl))), 256))
|
|
1135
|
+
]))), 256))
|
|
1136
|
+
])) : w("", !0),
|
|
1137
|
+
(n(!0), r(_, null, A(q.value, (o, a) => (n(), r("g", null, [
|
|
1138
|
+
(n(!0), r(_, null, A(o.donut, (t, u) => (n(), r("g", null, [
|
|
1139
|
+
y("path", {
|
|
1140
|
+
d: t.arcSlice,
|
|
1141
|
+
fill: he.value === t.id ? e.value.style.chart.layout.donut.selectedColor : "transparent",
|
|
1142
|
+
onMouseenter: (c) => Pt({
|
|
1143
|
+
datapoint: t,
|
|
1144
|
+
seriesIndex: t.seriesIndex
|
|
1145
|
+
}),
|
|
1146
|
+
onClick: (c) => It({ datapoint: t, index: u }),
|
|
1147
|
+
onMouseleave: s[0] || (s[0] = (c) => {
|
|
1148
|
+
ce.value = !1, st.value = null, le.value = null, ae.value = null, he.value = null;
|
|
1149
|
+
})
|
|
1150
|
+
}, null, 40, Gl)
|
|
1151
|
+
]))), 256))
|
|
1152
|
+
]))), 256)),
|
|
1153
|
+
x(l.$slots, "svg", { svg: v.value }, void 0, !0)
|
|
1154
|
+
], 512)
|
|
1155
|
+
], 14, wl)),
|
|
1156
|
+
l.$slots.watermark ? (n(), r("div", Yl, [
|
|
1157
|
+
x(l.$slots, "watermark", H(J({ isPrinting: i(Ke) || i(Qe) })), void 0, !0)
|
|
1158
|
+
])) : w("", !0),
|
|
1159
|
+
vt(i(At), {
|
|
1160
|
+
show: $.value.showTooltip && ce.value,
|
|
1161
|
+
backgroundColor: e.value.style.chart.tooltip.backgroundColor,
|
|
1162
|
+
color: e.value.style.chart.tooltip.color,
|
|
1163
|
+
borderRadius: e.value.style.chart.tooltip.borderRadius,
|
|
1164
|
+
borderColor: e.value.style.chart.tooltip.borderColor,
|
|
1165
|
+
borderWidth: e.value.style.chart.tooltip.borderWidth,
|
|
1166
|
+
fontSize: e.value.style.chart.tooltip.fontSize,
|
|
1167
|
+
backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
|
|
1168
|
+
position: e.value.style.chart.tooltip.position,
|
|
1169
|
+
offsetY: e.value.style.chart.tooltip.offsetY,
|
|
1170
|
+
parent: V.value,
|
|
1171
|
+
content: ve.value,
|
|
1172
|
+
isFullscreen: Y.value,
|
|
1173
|
+
isCustom: i(bt)(e.value.style.chart.tooltip.customFormat)
|
|
1174
|
+
}, {
|
|
1175
|
+
"tooltip-before": C(() => [
|
|
1176
|
+
x(l.$slots, "tooltip-before", H(J({ ...we.value })), void 0, !0)
|
|
1177
|
+
]),
|
|
1178
|
+
"tooltip-after": C(() => [
|
|
1179
|
+
x(l.$slots, "tooltip-after", H(J({ ...we.value })), void 0, !0)
|
|
1180
|
+
]),
|
|
1181
|
+
_: 3
|
|
1182
|
+
}, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
|
|
1183
|
+
e.value.style.chart.legend.show ? (n(), r("div", {
|
|
1184
|
+
key: 5,
|
|
1185
|
+
ref_key: "chartLegend",
|
|
1186
|
+
ref: fe,
|
|
1187
|
+
class: z({ "vue-ui-nested-donuts-legend": ke.value.length > 1 })
|
|
1188
|
+
}, [
|
|
1189
|
+
(n(!0), r(_, null, A(ke.value, (o, a) => (n(), G(fl, {
|
|
1190
|
+
key: `legend_${a}_${Ue.value}`,
|
|
1191
|
+
legendSet: o,
|
|
1192
|
+
config: Dt.value,
|
|
1193
|
+
onClickMarker: s[1] || (s[1] = ({ legend: t }) => me(t))
|
|
1194
|
+
}, {
|
|
1195
|
+
legendTitle: C(({ titleSet: t }) => [
|
|
1196
|
+
t[0] && t[0].arcOf ? (n(), r("div", Xl, O(t[0].arcOf), 1)) : w("", !0)
|
|
1197
|
+
]),
|
|
1198
|
+
item: C(({ legend: t, index: u }) => [
|
|
1199
|
+
y("div", {
|
|
1200
|
+
onClick: (c) => me(t),
|
|
1201
|
+
style: ie(`opacity:${k.value.includes(t.id) ? 0.5 : 1}`)
|
|
1202
|
+
}, O(t.name) + O(e.value.style.chart.legend.showPercentage || e.value.style.chart.legend.showValue ? ":" : "") + " " + O(e.value.style.chart.legend.showValue ? i(j)(
|
|
1203
|
+
e.value.style.chart.layout.labels.dataLabels.formatter,
|
|
1204
|
+
t.value,
|
|
1205
|
+
i(N)({
|
|
1206
|
+
p: e.value.style.chart.layout.labels.dataLabels.prefix,
|
|
1207
|
+
v: t.value,
|
|
1208
|
+
s: e.value.style.chart.layout.labels.dataLabels.suffix,
|
|
1209
|
+
r: e.value.style.chart.legend.roundingValue
|
|
1210
|
+
}),
|
|
1211
|
+
{ datapoint: t, seriesIndex: u }
|
|
1212
|
+
) : "") + " " + O(e.value.style.chart.legend.showPercentage ? k.value.includes(t.id) ? `${e.value.style.chart.legend.showValue ? "(" : ""}- %${e.value.style.chart.legend.showValue ? ")" : ""}` : `${e.value.style.chart.legend.showValue ? "(" : ""}${isNaN(t.value / t.total) ? "-" : i(N)({
|
|
1213
|
+
v: t.value / t.total * 100,
|
|
1214
|
+
s: "%",
|
|
1215
|
+
r: e.value.style.chart.legend.roundingPercentage
|
|
1216
|
+
})}${e.value.style.chart.legend.showValue ? ")" : ""}` : ""), 13, Wl)
|
|
1217
|
+
]),
|
|
1218
|
+
_: 2
|
|
1219
|
+
}, 1032, ["legendSet", "config"]))), 128))
|
|
1220
|
+
], 2)) : w("", !0),
|
|
1221
|
+
e.value.style.chart.legend.show ? w("", !0) : (n(), r("div", {
|
|
1222
|
+
key: 6,
|
|
1223
|
+
ref_key: "chartLegend",
|
|
1224
|
+
ref: fe
|
|
1225
|
+
}, [
|
|
1226
|
+
x(l.$slots, "legend", { legend: ke.value }, void 0, !0)
|
|
1227
|
+
], 512)),
|
|
1228
|
+
l.$slots.source ? (n(), r("div", {
|
|
1229
|
+
key: 7,
|
|
1230
|
+
ref_key: "source",
|
|
1231
|
+
ref: Me,
|
|
1232
|
+
dir: "auto"
|
|
1233
|
+
}, [
|
|
1234
|
+
x(l.$slots, "source", {}, void 0, !0)
|
|
1235
|
+
], 512)) : w("", !0),
|
|
1236
|
+
de.value ? (n(), G(i(Lt), {
|
|
1237
|
+
key: 8,
|
|
1238
|
+
hideDetails: "",
|
|
1239
|
+
config: {
|
|
1240
|
+
open: $.value.showTable,
|
|
1241
|
+
maxHeight: 1e4,
|
|
1242
|
+
body: {
|
|
1243
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
1244
|
+
color: e.value.style.chart.color
|
|
1245
|
+
},
|
|
1246
|
+
head: {
|
|
1247
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
1248
|
+
color: e.value.style.chart.color
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
}, {
|
|
1252
|
+
content: C(() => [
|
|
1253
|
+
(n(), G(i(Ct), {
|
|
1254
|
+
key: `table_${Re.value}`,
|
|
1255
|
+
colNames: oe.value.colNames,
|
|
1256
|
+
head: oe.value.head,
|
|
1257
|
+
body: oe.value.body,
|
|
1258
|
+
config: oe.value.config,
|
|
1259
|
+
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
|
|
1260
|
+
onClose: s[2] || (s[2] = (o) => $.value.showTable = !1)
|
|
1261
|
+
}, {
|
|
1262
|
+
th: C(({ th: o }) => [
|
|
1263
|
+
y("div", {
|
|
1264
|
+
innerHTML: o,
|
|
1265
|
+
style: { display: "flex", "align-items": "center" }
|
|
1266
|
+
}, null, 8, ql)
|
|
1267
|
+
]),
|
|
1268
|
+
td: C(({ td: o }) => [
|
|
1269
|
+
Ht(O(o.name || o), 1)
|
|
1270
|
+
]),
|
|
1271
|
+
_: 1
|
|
1272
|
+
}, 8, ["colNames", "head", "body", "config", "title"]))
|
|
1273
|
+
]),
|
|
1274
|
+
_: 1
|
|
1275
|
+
}, 8, ["config"])) : w("", !0),
|
|
1276
|
+
i(ye) ? (n(), G(bl, { key: 9 })) : w("", !0)
|
|
1277
|
+
], 46, ml));
|
|
1278
|
+
}
|
|
1279
|
+
}, na = /* @__PURE__ */ gl(Hl, [["__scopeId", "data-v-9070d068"]]);
|
|
1280
|
+
export {
|
|
1281
|
+
na as default
|
|
1282
|
+
};
|