vue-data-ui 3.0.23 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/{Arrow-B1Op9F3x.js → Arrow-DvG07exK.js} +1 -1
  2. package/dist/{BaseDraggableDialog-B4OaMIom.js → BaseDraggableDialog-O7900pGp.js} +72 -59
  3. package/dist/{BaseIcon-CgUOIGjr.js → BaseIcon-DHtro8us.js} +1 -1
  4. package/dist/{useLoading-D7YHNtLX.js → BaseScanner-BgWxam9d.js} +11 -11
  5. package/dist/{ColorPicker-C0nf8VH0.js → ColorPicker-CpWzNn4r.js} +2 -2
  6. package/dist/DataTable-DJjA2_wf.js +140 -0
  7. package/dist/{Legend-CyYXMSsW.js → Legend-2-dC7DVb.js} +2 -2
  8. package/dist/{NonSvgPenAndPaper-D63qeScu.js → NonSvgPenAndPaper-DHeE4Yuv.js} +3 -3
  9. package/dist/{PackageVersion-B6M-3jRt.js → PackageVersion-DU12WH3O.js} +1 -1
  10. package/dist/{PenAndPaper-zym5uEeN.js → PenAndPaper-B7QEDgx4.js} +3 -3
  11. package/dist/{Shape-CYVs2kYz.js → Shape-Dj2Hl33H.js} +1 -1
  12. package/dist/{Slicer-BTIFUO4x.js → Slicer-D99HytqX.js} +2 -2
  13. package/dist/{SparkTooltip-CNz7AYUL.js → SparkTooltip-B-wL07rI.js} +1 -1
  14. package/dist/{Title-D_e0SFWS.js → Title-Dq2_Z9kR.js} +1 -1
  15. package/dist/{Tooltip-DjVoFYj1.js → Tooltip-Y219DXZO.js} +1 -1
  16. package/dist/{UserOptions-z0NWZ7aQ.js → UserOptions-BuGfCdAY.js} +2 -2
  17. package/dist/{dom-to-png-DD0au3Qz.js → dom-to-png-BhciAKaM.js} +1 -1
  18. package/dist/{img-z5p1gGfY.js → img-JOqdlnUs.js} +1 -1
  19. package/dist/{index-BEuUtONc.js → index-CDQbCd41.js} +37 -2
  20. package/dist/{pdf-BmUjVBni.js → pdf-Dd-LIJqz.js} +1 -1
  21. package/dist/style.css +1 -1
  22. package/dist/types/vue-data-ui.d.cts +35 -0
  23. package/dist/types/vue-data-ui.d.ts +35 -0
  24. package/dist/{useAutoSizeLabelsInsideViewbox-CchB8S-o.js → useAutoSizeLabelsInsideViewbox-Bky5KGFZ.js} +1 -1
  25. package/dist/{useNestedProp-DhLFhguL.js → useNestedProp-BPEHGiYX.js} +1 -1
  26. package/dist/{usePrinter-DiB0_UNt.js → usePrinter-Bnl1YeUU.js} +2 -2
  27. package/dist/{vue-data-ui-DJIAas-7.js → vue-data-ui-DcNYz3cZ.js} +64 -64
  28. package/dist/vue-data-ui.js +1 -1
  29. package/dist/vue-ui-3d-bar-BNIFAeN-.js +1369 -0
  30. package/dist/{vue-ui-accordion-B4YfUjZ5.js → vue-ui-accordion-Bf_LHFFX.js} +3 -3
  31. package/dist/{vue-ui-age-pyramid-CkXXNN79.js → vue-ui-age-pyramid-Bz-l1afR.js} +333 -286
  32. package/dist/{vue-ui-annotator-DnSsIkvU.js → vue-ui-annotator-BcfRH2BF.js} +2 -2
  33. package/dist/{vue-ui-bullet-kZkBsWPY.js → vue-ui-bullet-DK1aM9fX.js} +8 -8
  34. package/dist/{vue-ui-candlestick-CIn0xZm0.js → vue-ui-candlestick-D6mMjvtu.js} +453 -406
  35. package/dist/{vue-ui-carousel-table-f1FDOAqH.js → vue-ui-carousel-table-Vp5f238W.js} +4 -4
  36. package/dist/{vue-ui-chestnut-B-jSj7FT.js → vue-ui-chestnut-BKc4v-lf.js} +509 -459
  37. package/dist/vue-ui-chord-CquhRjf0.js +1100 -0
  38. package/dist/vue-ui-circle-pack-D6zLgxa3.js +755 -0
  39. package/dist/{vue-ui-cursor-DdBrui6i.js → vue-ui-cursor-DIXb2S93.js} +2 -2
  40. package/dist/{vue-ui-dashboard-DSUfW7mI.js → vue-ui-dashboard-DmiriAK7.js} +62 -62
  41. package/dist/{vue-ui-digits-Cb3Wq5WR.js → vue-ui-digits-CLAIo9gW.js} +2 -2
  42. package/dist/{vue-ui-donut-BCZqlAO3.js → vue-ui-donut-C8h_tCSO.js} +477 -431
  43. package/dist/{vue-ui-donut-evolution-HmQBq9VP.js → vue-ui-donut-evolution-C3r0YhKz.js} +482 -435
  44. package/dist/{vue-ui-dumbbell-B5w2oqNO.js → vue-ui-dumbbell-D-t4M00E.js} +443 -398
  45. package/dist/vue-ui-flow-D7_D_UNm.js +900 -0
  46. package/dist/vue-ui-funnel-B0QOfZRz.js +666 -0
  47. package/dist/vue-ui-galaxy-Ccw5uNes.js +744 -0
  48. package/dist/{vue-ui-gauge-C_KLPWk2.js → vue-ui-gauge-DvW7nFmK.js} +8 -8
  49. package/dist/{vue-ui-gizmo-CsPX25Ti.js → vue-ui-gizmo-WGQxvGPy.js} +4 -4
  50. package/dist/vue-ui-heatmap-BQkLujyp.js +1127 -0
  51. package/dist/{vue-ui-history-plot-DgpYiaUD.js → vue-ui-history-plot-eU33r_Ot.js} +408 -361
  52. package/dist/{vue-ui-kpi-DOgibU7W.js → vue-ui-kpi-CKg2i71M.js} +3 -3
  53. package/dist/{vue-ui-mini-loader-BjsQAxDx.js → vue-ui-mini-loader-BmkGQsm_.js} +2 -2
  54. package/dist/vue-ui-molecule-Dlu0hjSg.js +702 -0
  55. package/dist/{vue-ui-mood-radar-DMwVl3wz.js → vue-ui-mood-radar-DQaxfw9R.js} +342 -291
  56. package/dist/{vue-ui-nested-donuts-H0GzIAF0.js → vue-ui-nested-donuts-Djj9Aw_i.js} +548 -502
  57. package/dist/{vue-ui-onion-A6nKcus1.js → vue-ui-onion-ZgsErXis.js} +363 -317
  58. package/dist/vue-ui-parallel-coordinate-plot-B5fB22Jc.js +979 -0
  59. package/dist/vue-ui-quadrant-CMevCtXH.js +1483 -0
  60. package/dist/{vue-ui-quick-chart-mwXE3w_o.js → vue-ui-quick-chart-DcparKSX.js} +7 -7
  61. package/dist/vue-ui-radar-DFbxoKCK.js +858 -0
  62. package/dist/{vue-ui-rating-CleNHFo5.js → vue-ui-rating-ZUpxCWrk.js} +2 -2
  63. package/dist/{vue-ui-relation-circle-CMCH7Ia6.js → vue-ui-relation-circle-eNKJY4Sx.js} +8 -8
  64. package/dist/vue-ui-ridgeline-D4shpQZd.js +1204 -0
  65. package/dist/vue-ui-rings-TdTHMbsa.js +785 -0
  66. package/dist/{vue-ui-scatter-kv28dsT3.js → vue-ui-scatter-CVuV9ljU.js} +594 -548
  67. package/dist/{vue-ui-skeleton-DCNOYh9x.js → vue-ui-skeleton-CFxBU2-p.js} +3 -3
  68. package/dist/{vue-ui-smiley-DcS0CM-z.js → vue-ui-smiley-Har3B3aQ.js} +2 -2
  69. package/dist/{vue-ui-spark-trend-LHgReXth.js → vue-ui-spark-trend-FPk-XEwI.js} +4 -4
  70. package/dist/{vue-ui-sparkbar-Da315uRq.js → vue-ui-sparkbar-V3eJ0w0t.js} +4 -4
  71. package/dist/{vue-ui-sparkgauge-BeAkjGap.js → vue-ui-sparkgauge-DKTGkWnJ.js} +4 -4
  72. package/dist/{vue-ui-sparkhistogram-Cy19W3y1.js → vue-ui-sparkhistogram-DJsgFwHs.js} +5 -5
  73. package/dist/{vue-ui-sparkline-IjlQWgs3.js → vue-ui-sparkline-Dmrm5SL5.js} +4 -4
  74. package/dist/{vue-ui-sparkstackbar-CoFgOa3r.js → vue-ui-sparkstackbar-B0Pl7VMI.js} +4 -4
  75. package/dist/{vue-ui-stackbar-fbCs4sHF.js → vue-ui-stackbar-CNsgBPhj.js} +525 -479
  76. package/dist/{vue-ui-strip-plot-Cm8Zr6RE.js → vue-ui-strip-plot-CYAWwYOM.js} +390 -343
  77. package/dist/{vue-ui-table-q7jWgS26.js → vue-ui-table-Dn6H98rP.js} +3 -3
  78. package/dist/{vue-ui-table-heatmap-CsK9gR1G.js → vue-ui-table-heatmap-COI9LRqC.js} +5 -5
  79. package/dist/{vue-ui-table-sparkline-CXTPucPr.js → vue-ui-table-sparkline-B7Gg5FfJ.js} +4 -4
  80. package/dist/{vue-ui-thermometer-BFxdNgrd.js → vue-ui-thermometer-Bgynq5El.js} +8 -8
  81. package/dist/{vue-ui-timer-BsoeDFjK.js → vue-ui-timer-CXng51v5.js} +5 -5
  82. package/dist/{vue-ui-tiremarks-BW_jSayT.js → vue-ui-tiremarks-Cy1U3hO1.js} +7 -7
  83. package/dist/vue-ui-treemap-BsvIvRmE.js +1092 -0
  84. package/dist/{vue-ui-vertical-bar-OrLV4CxH.js → vue-ui-vertical-bar-DHqWeDIf.js} +512 -464
  85. package/dist/{vue-ui-waffle-BA6rNfVs.js → vue-ui-waffle-D1Mscj3N.js} +416 -370
  86. package/dist/{vue-ui-wheel-B_BkI-5f.js → vue-ui-wheel-DpV-N5tF.js} +7 -7
  87. package/dist/vue-ui-word-cloud-MaNQ3Kdk.js +811 -0
  88. package/dist/{vue-ui-world-B4mKuSSn.js → vue-ui-world-DYz6zw3x.js} +512 -466
  89. package/dist/{vue-ui-xy-m1SWJk77.js → vue-ui-xy-B1nqNbzw.js} +1551 -1500
  90. package/dist/vue-ui-xy-canvas-D4wd-Asd.js +1291 -0
  91. package/package.json +1 -1
  92. package/dist/DataTable-nO6ydJO2.js +0 -133
  93. package/dist/vue-ui-3d-bar-B56WqLJ-.js +0 -1323
  94. package/dist/vue-ui-chord-Ck4yV3Tb.js +0 -1049
  95. package/dist/vue-ui-circle-pack-BAfRk_Hd.js +0 -709
  96. package/dist/vue-ui-flow-BXkxtUoF.js +0 -852
  97. package/dist/vue-ui-funnel-DFvDO--q.js +0 -620
  98. package/dist/vue-ui-galaxy-BXNLLc3U.js +0 -691
  99. package/dist/vue-ui-heatmap-BHq6hBaL.js +0 -1078
  100. package/dist/vue-ui-molecule-BtyMTwEn.js +0 -656
  101. package/dist/vue-ui-parallel-coordinate-plot-DZ9_0F5c.js +0 -927
  102. package/dist/vue-ui-quadrant-CUggSeUN.js +0 -1432
  103. package/dist/vue-ui-radar-BRKZ8e_X.js +0 -807
  104. package/dist/vue-ui-ridgeline-xW7UrSfR.js +0 -1157
  105. package/dist/vue-ui-rings-D3NfFMaO.js +0 -739
  106. package/dist/vue-ui-treemap-DhAYSVB9.js +0 -1046
  107. package/dist/vue-ui-word-cloud-CrSLGFOK.js +0 -765
  108. package/dist/vue-ui-xy-canvas-CX2JT6T3.js +0 -1243
@@ -1,709 +0,0 @@
1
- import { useCssVars as rt, computed as _, defineAsyncComponent as X, ref as p, toRefs as it, watch as he, shallowRef as Ne, onMounted as ct, onBeforeUnmount as vt, watchEffect as dt, createElementBlock as b, openBlock as m, unref as i, normalizeStyle as ae, normalizeClass as Re, createBlock as B, createCommentVNode as w, renderSlot as k, createSlots as ht, withCtx as $, normalizeProps as Y, guardReactiveProps as Z, createVNode as ft, Fragment as le, renderList as mt, createElementVNode as z, mergeProps as De, toDisplayString as J, createTextVNode as yt, nextTick as Le } from "vue";
2
- import { u as pt, c as Be, t as bt, a as fe, p as oe, b as gt, o as kt, f as xt, d as wt, e as Ct, j as Ve, i as me, X as _t, l as zt, F as K, al as $t, v as Tt, w as St, k as He } from "./index-BEuUtONc.js";
3
- import { t as Ft, u as Ot } from "./useResponsive-DfdjqQps.js";
4
- import { u as It } from "./usePrinter-DiB0_UNt.js";
5
- import { u as Pt, B as At } from "./useLoading-D7YHNtLX.js";
6
- import { u as Ue } from "./useNestedProp-DhLFhguL.js";
7
- import { u as Mt } from "./useUserOptionState-BIvW1Kz7.js";
8
- import { u as Et } from "./useChartAccessibility-9icAAmYg.js";
9
- import Nt from "./img-z5p1gGfY.js";
10
- import Rt from "./Title-D_e0SFWS.js";
11
- import { _ as Dt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
- function je(r, v = 0) {
13
- const f = r.reduce((o, { x: s, r: u }) => Math.min(o, s - u - v), 1 / 0), y = r.reduce((o, { x: s, r: u }) => Math.max(o, s + u + v), -1 / 0), d = r.reduce((o, { y: s, r: u }) => Math.min(o, s - u - v), 1 / 0), n = r.reduce((o, { y: s, r: u }) => Math.max(o, s + u + v), -1 / 0);
14
- return [f, d, y - f, n - d];
15
- }
16
- function Lt(r, v, f) {
17
- const y = r._, d = r.next._, n = y.r + d.r, o = (y.x * d.r + d.x * y.r) / n, s = (y.y * d.r + d.y * y.r) / n;
18
- return Math.max(Math.abs(o * f), Math.abs(s * v));
19
- }
20
- function Ge(r, v, f) {
21
- const y = Lt, d = r.length;
22
- if (!d) return r;
23
- let n, o, s;
24
- if (n = r[0], n.x = 0, n.y = 0, !(d > 1) || (o = r[1], n.x = -o.r, o.x = n.r, o.y = 0, !(d > 2))) return r;
25
- We(o, n, s = r[2]), n = new ne(n), o = new ne(o), s = new ne(s), n.next = s.previous = o, o.next = n.previous = s, s.next = o.previous = n;
26
- e: for (let u = 3; u < d; ++u) {
27
- We(n._, o._, s = r[u]), s = new ne(s);
28
- let x = o.next, T = n.previous, V = o._.r, S = n._.r;
29
- do
30
- if (V <= S) {
31
- if (qe(x._, s._)) {
32
- o = x, n.next = o, o.previous = n, --u;
33
- continue e;
34
- }
35
- V += x._.r, x = x.next;
36
- } else {
37
- if (qe(T._, s._)) {
38
- n = T, n.next = o, o.previous = n, --u;
39
- continue e;
40
- }
41
- S += T._.r, T = T.previous;
42
- }
43
- while (x !== T.next);
44
- s.previous = n, s.next = o, n.next = o.previous = o = s;
45
- let C = y(n, f, v), H;
46
- for (; (s = s.next) !== o; )
47
- (H = y(s, f, v)) < C && (n = s, C = H);
48
- o = n.next;
49
- }
50
- return r;
51
- }
52
- function We(r, v, f) {
53
- const y = r.x - v.x, d = r.y - v.y, n = y * y + d * d;
54
- if (n) {
55
- const o = (v.r + f.r) ** 2, s = (r.r + f.r) ** 2;
56
- if (o > s) {
57
- const u = (n + s - o) / (2 * n), x = Math.sqrt(Math.max(0, s / n - u * u));
58
- f.x = r.x - u * y - x * d, f.y = r.y - u * d + x * y;
59
- } else {
60
- const u = (n + o - s) / (2 * n), x = Math.sqrt(Math.max(0, o / n - u * u));
61
- f.x = v.x + u * y - x * d, f.y = v.y + u * d + x * y;
62
- }
63
- } else
64
- f.x = v.x + f.r, f.y = v.y;
65
- }
66
- function qe(r, v) {
67
- const f = r.r + v.r - 1e-6, y = v.x - r.x, d = v.y - r.y;
68
- return f > 0 && f * f > y * y + d * d;
69
- }
70
- class ne {
71
- constructor(v) {
72
- this._ = v, this.next = null, this.previous = null;
73
- }
74
- }
75
- const Bt = ["id"], Vt = ["xmlns", "viewBox", "height", "width"], Ht = ["x", "y", "width", "height"], Ut = ["id"], jt = ["stop-color"], Gt = ["stop-color"], Wt = ["stop-color"], qt = { key: 0 }, Xt = ["x", "y", "width", "height", "stroke", "stroke-width", "fill", "rx", "onMouseenter", "onMouseout", "onClick"], Yt = ["x", "y", "width", "height", "stroke", "stroke-width", "fill", "rx"], Zt = ["opacity", "x", "y", "font-size", "fill", "font-weight"], Jt = ["opacity", "x", "y", "font-size", "fill", "font-weight"], Kt = ["cx", "cy", "r", "opacity", "stroke", "stroke-width", "fill"], Qt = {
76
- key: 0,
77
- style: { pointerEvents: "none" }
78
- }, ea = { key: 1 }, ta = ["opacity", "x", "y", "font-size", "fill", "font-weight"], aa = ["opacity", "x", "y", "font-size", "fill", "font-weight"], la = {
79
- key: 4,
80
- class: "vue-data-ui-watermark"
81
- }, oa = ["innerHTML"], na = {
82
- __name: "vue-ui-circle-pack",
83
- props: {
84
- config: {
85
- type: Object,
86
- default() {
87
- return {};
88
- }
89
- },
90
- dataset: {
91
- type: Array,
92
- default() {
93
- return [];
94
- }
95
- }
96
- },
97
- emits: ["selectDatapoint"],
98
- setup(r, { expose: v, emit: f }) {
99
- rt((t) => ({
100
- "336045f2": L.value,
101
- b72ba32a: ie.value
102
- }));
103
- const y = X(() => import("./vue-ui-accordion-B4YfUjZ5.js")), d = X(() => import("./DataTable-nO6ydJO2.js")), n = X(() => import("./UserOptions-z0NWZ7aQ.js")), o = X(() => import("./PenAndPaper-zym5uEeN.js")), s = X(() => import("./PackageVersion-B6M-3jRt.js")), u = r, x = f, { vue_ui_circle_pack: T } = pt(), V = _(() => !!u.dataset && u.dataset.length), S = p(Be()), C = p(null), H = p(null), ye = p(null), pe = p(0), be = p(0), ge = p(0), Xe = p(null), e = p(ue()), { loading: ke, FINAL_DATASET: xe } = Pt({
104
- ...it(u),
105
- FINAL_CONFIG: e,
106
- prepareConfig: ue,
107
- skeletonDataset: [
108
- { name: "_", value: 13, color: "#F2F2F2" },
109
- { name: "_", value: 8, color: "#DBDBDB" },
110
- { name: "_", value: 5, color: "#ADADAD" },
111
- { name: "_", value: 3, color: "#969696" },
112
- { name: "_", value: 2, color: "#808080" },
113
- { name: "_", value: 1, color: "#696969" }
114
- ],
115
- skeletonConfig: bt({
116
- defaultConfig: e.value,
117
- userConfig: {
118
- userOptions: { show: !1 },
119
- table: { show: !1 },
120
- style: {
121
- chart: {
122
- backgroundColor: "#99999930",
123
- circles: {
124
- stroke: "#6A6A6A",
125
- labels: {
126
- name: { show: !1 },
127
- value: { show: !1 }
128
- }
129
- }
130
- }
131
- }
132
- }
133
- })
134
- }), { svgRef: we } = Et({ config: e.value.style.chart.title }), {
135
- userOptionsVisible: se,
136
- setUserOptionsVisibility: Ce,
137
- keepUserOptionState: _e
138
- } = Mt({ config: e.value });
139
- function ue() {
140
- const t = Ue({
141
- userConfig: u.config,
142
- defaultConfig: T
143
- });
144
- return t.theme ? {
145
- ...Ue({
146
- userConfig: gt.vue_ui_circle_pack[t.theme] || u.config,
147
- defaultConfig: t
148
- }),
149
- customPalette: fe[t.theme] || oe
150
- } : t;
151
- }
152
- he(() => u.config, (t) => {
153
- e.value = ue(), se.value = !e.value.userOptions.showOnChartHover, re(), pe.value += 1, be.value += 1, N.value.showTable = e.value.table.show;
154
- }, { deep: !0 });
155
- const { isPrinting: ze, isImaging: $e, generatePdf: Te, generateImage: Se } = It({
156
- elementId: `vue-ui-circle-pack_${S.value}`,
157
- fileName: e.value.style.chart.title.text || "vue-ui-circle-pack",
158
- options: e.value.userOptions.print
159
- }), Ye = _(() => e.value.userOptions.show && !e.value.style.chart.title.text), N = p({
160
- showTable: e.value.table.show
161
- });
162
- he(e, () => {
163
- N.value = {
164
- showTable: e.value.table.show
165
- };
166
- }, { immediate: !0 });
167
- const F = Ne(null), R = Ne(null), A = p({ h: 10, w: 10 }), Fe = p(0), M = p([0, 0, 100, 100]), U = p({ h: 0, w: 0 }), Ze = _(() => e.value.debug);
168
- async function re() {
169
- kt(u.dataset) && xt({
170
- componentName: "VueUiCirclePack",
171
- type: "dataset",
172
- debug: Ze.value
173
- }), A.value = { h: 10, w: 10 }, M.value = [0, 0, 100, 100], U.value = { h: 0, w: 0 }, D.value = await Ge(Q.value), O.value = je(D.value, 1).join(" "), U.value = Oe(C.value);
174
- const t = Ft(() => {
175
- const { width: l, height: a, heightTitle: c, heightNoTitle: g } = Ot({
176
- chart: C.value,
177
- title: H.value,
178
- noTitle: ye.value
179
- }), E = Math.max(10, l), de = Math.max(10, a - 12);
180
- Fe.value = e.value.style.chart.title.text ? c : g, requestAnimationFrame(() => {
181
- A.value.w = E, A.value.h = de - Fe.value, Le(async () => {
182
- const st = Q.value.map((ut) => ({ ...ut }));
183
- D.value = await Ge(st, A.value.h, A.value.w), M.value = je(D.value, 1), O.value = M.value.join(" "), U.value = Oe(C.value);
184
- });
185
- });
186
- });
187
- F.value && (R.value && F.value.unobserve(R.value), F.value.disconnect()), F.value = new ResizeObserver(t), R.value = C.value.parentNode, F.value.observe(R.value);
188
- }
189
- ct(re), vt(() => {
190
- F.value && (R.value && F.value.unobserve(R.value), F.value.disconnect());
191
- });
192
- function Oe(t) {
193
- if (!t || !t.parentElement)
194
- return console.warn("Component or parent element is missing."), { w: 0, h: 0 };
195
- const l = t.parentElement;
196
- if (l.offsetWidth > 0 && l.offsetHeight > 0)
197
- return { w: l.offsetWidth, h: l.offsetHeight };
198
- const a = window.getComputedStyle(l), c = a.width, g = a.height;
199
- return c !== "auto" && g !== "auto" && parseFloat(c) > 0 && parseFloat(g) > 0 ? { w: parseFloat(c), h: parseFloat(g) } : { w: 0, h: 0 };
200
- }
201
- he(() => xe.value, async (t) => {
202
- await re();
203
- }, { deep: !0 });
204
- const Je = _(() => wt(e.value.customPalette)), Q = _(() => xe.value.map((t, l) => {
205
- const a = Ct(t.color) || Je.value[l] || fe[e.value.theme || "default"][l % fe[e.value.theme || "default"].length] || oe[l] || oe[l % oe.length];
206
- return {
207
- ...t,
208
- r: t.value,
209
- id: Be(),
210
- color: a
211
- };
212
- }).filter((t) => ![null, void 0, 1 / 0, -1 / 0].includes(t.value))), D = p([]), O = p("0 0 100 100"), j = _(() => Math.max(...D.value.map((t) => t.r)));
213
- function Ie(t, l) {
214
- return l / j.value * t;
215
- }
216
- function Ke(t, l) {
217
- h.value = null, e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: t, seriesIndex: l });
218
- }
219
- function Qe(t, l) {
220
- x("selectDatapoint", t), e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: t, seriesIndex: l });
221
- }
222
- function et(t, l) {
223
- tt(t), e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: t, seriesIndex: l });
224
- }
225
- const h = p(null);
226
- function tt(t) {
227
- e.value.style.chart.circles.zoom.show && (h.value = t);
228
- }
229
- const L = _(() => h.value ? h.value.r : 0), ie = _(() => P.value ? L.value : h.value ? h.value.r > M.value[3] / 6 * e.value.style.chart.circles.zoom.zoomRatio ? h.value.r : M.value[3] / 6 * e.value.style.chart.circles.zoom.zoomRatio : 0), I = p(0), at = _(() => ({
230
- pointerEvents: "none",
231
- opacity: I.value,
232
- filter: `drop-shadow(0px 0px 6px ${Ve(h.value.color, e.value.style.chart.circles.zoom.shadowForce)})`
233
- })), G = p(L.value);
234
- dt(() => {
235
- G.value = L.value, I.value = 0;
236
- let t = null;
237
- function l(a) {
238
- t || (t = a);
239
- const c = (a - t) / e.value.style.chart.circles.zoom.animationFrameMs;
240
- c < 1 ? (G.value = L.value + (ie.value - L.value) * c, I.value = 0 + e.value.style.chart.circles.zoom.opacity * c, requestAnimationFrame(l)) : (G.value = ie.value, I.value = e.value.style.chart.circles.zoom.opacity);
241
- }
242
- requestAnimationFrame(l);
243
- });
244
- const W = _(() => ({
245
- name: e.value.style.chart.circles.zoom.label.name.fontSize * M.value[3] / 300,
246
- value: e.value.style.chart.circles.zoom.label.value.fontSize * M.value[3] / 300
247
- }));
248
- function ce(t) {
249
- return He(
250
- e.value.style.chart.circles.labels.value.formatter,
251
- t.value,
252
- me({
253
- p: e.value.style.chart.circles.labels.value.prefix,
254
- v: t.value,
255
- s: e.value.style.chart.circles.labels.value.suffix,
256
- r: e.value.style.chart.circles.labels.value.rounding
257
- })
258
- );
259
- }
260
- function lt() {
261
- return He(
262
- e.value.style.chart.circles.zoom.label.value.formatter,
263
- h.value.value,
264
- me({
265
- p: e.value.style.chart.circles.zoom.label.value.prefix,
266
- v: h.value.value,
267
- s: e.value.style.chart.circles.zoom.label.value.suffix,
268
- r: e.value.style.chart.circles.zoom.label.value.rounding
269
- })
270
- );
271
- }
272
- function Pe(t) {
273
- if (!t)
274
- return 0;
275
- const l = t.r / ce(t).length * (ce(t).length === 1 ? 1 : 2);
276
- return Math.min(t.r / 2.5, l);
277
- }
278
- const q = p(!1);
279
- function Ae(t) {
280
- q.value = t, ge.value += 1;
281
- }
282
- const P = p(!1);
283
- function ve() {
284
- P.value = !P.value;
285
- }
286
- const ee = _(() => {
287
- const t = Q.value.map((a) => ({
288
- name: a.name,
289
- value: a.value,
290
- color: a.color
291
- })).toSorted((a, c) => c.value - a.value), l = t.map((a) => a.value);
292
- return { head: t, body: l };
293
- });
294
- function Me(t = null) {
295
- Le(() => {
296
- const l = ee.value.head.map((g, E) => [[
297
- g.name
298
- ], [ee.value.body[E]]]), a = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], [e.value.table.columnNames.value]]].concat(l), c = Tt(a);
299
- t ? t(c) : St({ csvContent: c, title: e.value.style.chart.title.text || "vue-ui-circle-pack" });
300
- });
301
- }
302
- const te = _(() => {
303
- const t = [
304
- e.value.table.columnNames.datapoint,
305
- e.value.table.columnNames.value
306
- ], l = ee.value.head.map((g, E) => {
307
- const de = me({
308
- p: e.value.style.chart.circles.labels.value.prefix,
309
- v: ee.value.body[E],
310
- s: e.value.style.chart.circles.labels.value.suffix,
311
- r: e.value.style.chart.circles.labels.value.rounding
312
- });
313
- return [
314
- {
315
- color: g.color,
316
- name: g.name
317
- },
318
- de
319
- ];
320
- }), a = {
321
- th: {
322
- backgroundColor: e.value.table.th.backgroundColor,
323
- color: e.value.table.th.color,
324
- outline: e.value.table.th.outline
325
- },
326
- td: {
327
- backgroundColor: e.value.table.td.backgroundColor,
328
- color: e.value.table.td.color,
329
- outline: e.value.table.td.outline
330
- },
331
- breakpoint: e.value.table.responsiveBreakpoint
332
- };
333
- return {
334
- colNames: [
335
- e.value.table.columnNames.datapoint,
336
- e.value.table.columnNames.value
337
- ],
338
- head: t,
339
- body: l,
340
- config: a
341
- };
342
- });
343
- function Ee() {
344
- N.value.showTable = !N.value.showTable;
345
- }
346
- function ot() {
347
- return Q.value;
348
- }
349
- async function nt({ scale: t = 2 } = {}) {
350
- if (!C.value) return;
351
- const { width: l, height: a } = C.value.getBoundingClientRect(), c = l / a, { imageUri: g, base64: E } = await Nt({ domElement: C.value, base64: !0, img: !0, scale: t });
352
- return {
353
- imageUri: g,
354
- base64: E,
355
- title: e.value.style.chart.title.text,
356
- width: l,
357
- height: a,
358
- aspectRatio: c
359
- };
360
- }
361
- return v({
362
- getData: ot,
363
- getImage: nt,
364
- generateCsv: Me,
365
- generatePdf: Te,
366
- generateImage: Se,
367
- toggleTable: Ee,
368
- toggleAnnotator: ve,
369
- toggleFullscreen: Ae
370
- }), (t, l) => (m(), b("div", {
371
- id: `vue-ui-circle-pack_${S.value}`,
372
- class: Re(`vue-ui-circle-pack ${q.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${i(ke) ? "loading" : ""}`),
373
- ref_key: "circlePackChart",
374
- ref: C,
375
- style: ae(`font-family:${e.value.style.fontFamily};text-align:center;background:${e.value.style.chart.backgroundColor}; height: ${U.value.h}px; width:${U.value.w}px`),
376
- onMouseenter: l[1] || (l[1] = () => i(Ce)(!0)),
377
- onMouseleave: l[2] || (l[2] = () => i(Ce)(!1))
378
- }, [
379
- e.value.userOptions.buttons.annotator ? (m(), B(i(o), {
380
- key: 0,
381
- svgRef: i(we),
382
- backgroundColor: e.value.style.chart.backgroundColor,
383
- color: e.value.style.chart.color,
384
- active: P.value,
385
- scale: j.value / 100,
386
- onClose: ve
387
- }, null, 8, ["svgRef", "backgroundColor", "color", "active", "scale"])) : w("", !0),
388
- k(t.$slots, "userConfig", {}, void 0, !0),
389
- Ye.value ? (m(), b("div", {
390
- key: 1,
391
- ref_key: "noTitle",
392
- ref: ye,
393
- class: "vue-data-ui-no-title-space",
394
- style: "height:36px; width: 100%;background:transparent"
395
- }, null, 512)) : w("", !0),
396
- e.value.style.chart.title.text ? (m(), b("div", {
397
- key: 2,
398
- ref_key: "chartTitle",
399
- ref: H,
400
- style: "width:100%;background:transparent;padding-bottom:12px"
401
- }, [
402
- (m(), B(Rt, {
403
- key: `title_${pe.value}`,
404
- config: {
405
- title: {
406
- cy: "donut-div-title",
407
- ...e.value.style.chart.title
408
- },
409
- subtitle: {
410
- cy: "donut-div-subtitle",
411
- ...e.value.style.chart.title.subtitle
412
- }
413
- }
414
- }, null, 8, ["config"]))
415
- ], 512)) : w("", !0),
416
- e.value.userOptions.show && V.value && (i(_e) || i(se)) ? (m(), B(i(n), {
417
- ref: "details",
418
- key: `user_option_${ge.value}`,
419
- backgroundColor: e.value.style.chart.backgroundColor,
420
- color: e.value.style.chart.color,
421
- isPrinting: i(ze),
422
- isImaging: i($e),
423
- uid: S.value,
424
- hasTooltip: !1,
425
- hasLabel: !1,
426
- hasPdf: e.value.userOptions.buttons.pdf,
427
- hasImg: e.value.userOptions.buttons.img,
428
- hasXls: e.value.userOptions.buttons.csv,
429
- hasTable: e.value.userOptions.buttons.table,
430
- hasFullscreen: e.value.userOptions.buttons.fullscreen,
431
- isFullscreen: q.value,
432
- chartElement: C.value,
433
- position: e.value.userOptions.position,
434
- callbacks: e.value.userOptions.callbacks,
435
- printScale: e.value.userOptions.print.scale,
436
- titles: { ...e.value.userOptions.buttonTitles },
437
- hasAnnotator: e.value.userOptions.buttons.annotator,
438
- isAnnotation: P.value,
439
- onToggleFullscreen: Ae,
440
- onGeneratePdf: i(Te),
441
- onGenerateCsv: Me,
442
- onGenerateImage: i(Se),
443
- onToggleTable: Ee,
444
- onToggleAnnotator: ve,
445
- style: ae({
446
- visibility: i(_e) ? i(se) ? "visible" : "hidden" : "visible"
447
- })
448
- }, ht({ _: 2 }, [
449
- t.$slots.menuIcon ? {
450
- name: "menuIcon",
451
- fn: $(({ isOpen: a, color: c }) => [
452
- k(t.$slots, "menuIcon", Y(Z({ isOpen: a, color: c })), void 0, !0)
453
- ]),
454
- key: "0"
455
- } : void 0,
456
- t.$slots.optionPdf ? {
457
- name: "optionPdf",
458
- fn: $(() => [
459
- k(t.$slots, "optionPdf", {}, void 0, !0)
460
- ]),
461
- key: "1"
462
- } : void 0,
463
- t.$slots.optionCsv ? {
464
- name: "optionCsv",
465
- fn: $(() => [
466
- k(t.$slots, "optionCsv", {}, void 0, !0)
467
- ]),
468
- key: "2"
469
- } : void 0,
470
- t.$slots.optionImg ? {
471
- name: "optionImg",
472
- fn: $(() => [
473
- k(t.$slots, "optionImg", {}, void 0, !0)
474
- ]),
475
- key: "3"
476
- } : void 0,
477
- t.$slots.optionTable ? {
478
- name: "optionTable",
479
- fn: $(() => [
480
- k(t.$slots, "optionTable", {}, void 0, !0)
481
- ]),
482
- key: "4"
483
- } : void 0,
484
- t.$slots.optionFullscreen ? {
485
- name: "optionFullscreen",
486
- fn: $(({ toggleFullscreen: a, isFullscreen: c }) => [
487
- k(t.$slots, "optionFullscreen", Y(Z({ toggleFullscreen: a, isFullscreen: c })), void 0, !0)
488
- ]),
489
- key: "5"
490
- } : void 0,
491
- t.$slots.optionAnnotator ? {
492
- name: "optionAnnotator",
493
- fn: $(({ toggleAnnotator: a, isAnnotator: c }) => [
494
- k(t.$slots, "optionAnnotator", Y(Z({ toggleAnnotator: a, isAnnotator: c })), void 0, !0)
495
- ]),
496
- key: "6"
497
- } : void 0
498
- ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "chartElement", "position", "callbacks", "printScale", "titles", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : w("", !0),
499
- (m(), b("svg", {
500
- ref_key: "svgRef",
501
- ref: we,
502
- xmlns: i(_t),
503
- viewBox: O.value,
504
- height: Math.max(10, A.value.h),
505
- width: Math.max(10, A.value.w),
506
- class: Re({ "vue-data-ui-fullscreen--on": q.value, "vue-data-ui-fulscreen--off": !q.value }),
507
- style: ae(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color};background:${e.value.style.chart.backgroundColor};`)
508
- }, [
509
- ft(i(s)),
510
- t.$slots["chart-background"] ? (m(), b("foreignObject", {
511
- key: 0,
512
- x: O.value.x,
513
- y: O.value.y,
514
- width: O.value.width,
515
- height: O.value.height,
516
- style: {
517
- pointerEvents: "none"
518
- }
519
- }, [
520
- k(t.$slots, "chart-background", {}, void 0, !0)
521
- ], 8, Ht)) : w("", !0),
522
- (m(!0), b(le, null, mt(D.value, (a, c) => (m(), b(le, null, [
523
- z("defs", null, [
524
- z("radialGradient", {
525
- id: a.id,
526
- fy: "30%"
527
- }, [
528
- z("stop", {
529
- offset: "10%",
530
- "stop-color": i(zt)(a.color, e.value.style.chart.circles.gradient.intensity / 100)
531
- }, null, 8, jt),
532
- z("stop", {
533
- offset: "90%",
534
- "stop-color": i(Ve)(a.color, 0.1)
535
- }, null, 8, Gt),
536
- z("stop", {
537
- offset: "100%",
538
- "stop-color": a.color
539
- }, null, 8, Wt)
540
- ], 8, Ut)
541
- ]),
542
- t.$slots.pattern ? (m(), b("g", qt, [
543
- z("defs", null, [
544
- k(t.$slots, "pattern", De({ ref_for: !0 }, { ...a, patternId: `pattern_${S.value}_${a.id}` }), void 0, !0)
545
- ])
546
- ])) : w("", !0),
547
- z("rect", {
548
- x: a.x - a.r,
549
- y: a.y - a.r,
550
- width: a.r * 2,
551
- height: a.r * 2,
552
- stroke: e.value.style.chart.circles.stroke,
553
- "stroke-width": e.value.style.chart.circles.strokeWidth * j.value / 100,
554
- fill: e.value.style.chart.circles.gradient.show ? `url(#${a.id})` : a.color,
555
- rx: a.r,
556
- onMouseenter: (g) => et(a, c),
557
- onMouseout: (g) => Ke(a, c),
558
- onClick: (g) => Qe(a, c)
559
- }, null, 40, Xt),
560
- t.$slots.pattern ? (m(), b("rect", {
561
- key: 1,
562
- x: a.x - a.r,
563
- y: a.y - a.r,
564
- width: a.r * 2,
565
- height: a.r * 2,
566
- stroke: e.value.style.chart.circles.stroke,
567
- "stroke-width": e.value.style.chart.circles.strokeWidth * j.value / 100,
568
- fill: `url(#pattern_${S.value}_${a.id})`,
569
- rx: a.r,
570
- style: {
571
- pointerEvents: "none"
572
- }
573
- }, null, 8, Yt)) : w("", !0),
574
- t.$slots["data-label"] ? k(t.$slots, "data-label", De({
575
- key: 2,
576
- ref_for: !0
577
- }, { ...a, createTSpans: i($t), fontSize: { name: a.r / 3 * e.value.style.chart.circles.labels.name.fontSizeRatio, value: Pe(a) * e.value.style.chart.circles.labels.value.fontSizeRatio }, color: e.value.style.chart.circles.labels.name.color ? e.value.style.chart.circles.labels.name.color : i(K)(a.color) }), void 0, !0) : (m(), b(le, { key: 3 }, [
578
- e.value.style.chart.circles.labels.name.show && a.name ? (m(), b("text", {
579
- key: 0,
580
- style: {
581
- pointerEvents: "none",
582
- transition: "opacity 0.2s ease-in-out"
583
- },
584
- opacity: h.value && !P.value ? 0.2 : 1,
585
- x: a.x,
586
- y: a.y + Ie(a.r, e.value.style.chart.circles.labels.name.offsetY) - a.r / 10,
587
- "font-size": a.r / 3 * e.value.style.chart.circles.labels.name.fontSizeRatio,
588
- fill: e.value.style.chart.circles.labels.name.color ? e.value.style.chart.circles.labels.name.color : i(K)(a.color),
589
- "font-weight": e.value.style.chart.circles.labels.name.bold ? "bold" : "normal",
590
- "text-anchor": "middle"
591
- }, J(a.name), 9, Zt)) : w("", !0),
592
- e.value.style.chart.circles.labels.value.show ? (m(), b("text", {
593
- key: 1,
594
- style: {
595
- pointerEvents: "none",
596
- transition: "opacity 0.2s ease-in-out"
597
- },
598
- opacity: h.value && !P.value ? 0.2 : 1,
599
- x: a.x,
600
- y: a.y + Ie(a.r, e.value.style.chart.circles.labels.value.offsetY) + a.r / 2.5,
601
- "font-size": Pe(a) * e.value.style.chart.circles.labels.value.fontSizeRatio,
602
- fill: e.value.style.chart.circles.labels.value.color ? e.value.style.chart.circles.labels.value.color : i(K)(a.color),
603
- "font-weight": e.value.style.chart.circles.labels.value.bold ? "bold" : "normal",
604
- "text-anchor": "middle"
605
- }, J(ce(a)), 9, Jt)) : w("", !0)
606
- ], 64))
607
- ], 64))), 256)),
608
- h.value && e.value.style.chart.circles.zoom.show && !P.value ? (m(), b(le, { key: 1 }, [
609
- z("circle", {
610
- style: ae(at.value),
611
- cx: h.value.x,
612
- cy: h.value.y,
613
- r: G.value,
614
- opacity: I.value,
615
- stroke: e.value.style.chart.circles.stroke,
616
- "stroke-width": e.value.style.chart.circles.strokeWidth * j.value / 100,
617
- fill: e.value.style.chart.circles.gradient.show ? `url(#${h.value.id})` : h.value.color
618
- }, null, 12, Kt),
619
- t.$slots["zoom-label"] ? (m(), b("g", Qt, [
620
- k(t.$slots, "zoom-label", Y(Z({ ...h.value, zoomOpacity: I.value, currentRadius: G.value, fontSize: W.value })), void 0, !0)
621
- ])) : (m(), b("g", ea, [
622
- z("text", {
623
- style: {
624
- pointerEvents: "none"
625
- },
626
- opacity: I.value,
627
- x: h.value.x,
628
- y: h.value.y + e.value.style.chart.circles.zoom.label.name.offsetY - W.value.name / 4,
629
- "text-anchor": "middle",
630
- "font-size": W.value.name,
631
- fill: e.value.style.chart.circles.zoom.label.name.color ? e.value.style.chart.circles.zoom.label.name.color : i(K)(h.value.color),
632
- "font-weight": e.value.style.chart.circles.zoom.label.name.bold ? "bold" : "normal"
633
- }, J(h.value.name), 9, ta),
634
- z("text", {
635
- style: {
636
- pointerEvents: "none"
637
- },
638
- opacity: I.value,
639
- x: h.value.x,
640
- y: h.value.y + W.value.value + e.value.style.chart.circles.zoom.label.value.offsetY,
641
- "text-anchor": "middle",
642
- "font-size": W.value.value,
643
- fill: e.value.style.chart.circles.zoom.label.value.color ? e.value.style.chart.circles.zoom.label.value.color : i(K)(h.value.color),
644
- "font-weight": e.value.style.chart.circles.zoom.label.value.bold ? "bold" : "normal"
645
- }, J(lt()), 9, aa)
646
- ]))
647
- ], 64)) : w("", !0),
648
- k(t.$slots, "svg", {
649
- svg: { ...O.value }
650
- }, void 0, !0)
651
- ], 14, Vt)),
652
- t.$slots.watermark ? (m(), b("div", la, [
653
- k(t.$slots, "watermark", Y(Z({ isPrinting: i(ze) || i($e) })), void 0, !0)
654
- ])) : w("", !0),
655
- t.$slots.source ? (m(), b("div", {
656
- key: 5,
657
- ref_key: "source",
658
- ref: Xe,
659
- dir: "auto"
660
- }, [
661
- k(t.$slots, "source", {}, void 0, !0)
662
- ], 512)) : w("", !0),
663
- V.value ? (m(), B(i(y), {
664
- key: 6,
665
- hideDetails: "",
666
- config: {
667
- open: N.value.showTable,
668
- maxHeight: 1e4,
669
- body: {
670
- backgroundColor: e.value.style.chart.backgroundColor,
671
- color: e.value.style.chart.color
672
- },
673
- head: {
674
- backgroundColor: e.value.style.chart.backgroundColor,
675
- color: e.value.style.chart.color
676
- }
677
- }
678
- }, {
679
- content: $(() => [
680
- (m(), B(i(d), {
681
- key: `table_${be.value}`,
682
- colNames: te.value.colNames,
683
- head: te.value.head,
684
- body: te.value.body,
685
- config: te.value.config,
686
- title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
687
- onClose: l[0] || (l[0] = (a) => N.value.showTable = !1)
688
- }, {
689
- th: $(({ th: a }) => [
690
- z("div", {
691
- innerHTML: a,
692
- style: { display: "flex", "align-items": "center" }
693
- }, null, 8, oa)
694
- ]),
695
- td: $(({ td: a }) => [
696
- yt(J(a.name || a), 1)
697
- ]),
698
- _: 1
699
- }, 8, ["colNames", "head", "body", "config", "title"]))
700
- ]),
701
- _: 1
702
- }, 8, ["config"])) : w("", !0),
703
- i(ke) ? (m(), B(At, { key: 7 })) : w("", !0)
704
- ], 46, Bt));
705
- }
706
- }, pa = /* @__PURE__ */ Dt(na, [["__scopeId", "data-v-4906f000"]]);
707
- export {
708
- pa as default
709
- };