vue-data-ui 2.12.6 → 2.12.7-beta.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 (109) hide show
  1. package/dist/{Arrow-Bd9ZVBnX.js → Arrow-CmqjRRUl.js} +1 -1
  2. package/dist/BaseDraggableDialog-BMlyvt7E.js +180 -0
  3. package/dist/{BaseIcon-CNbwMh_-.js → BaseIcon-CZdMutjs.js} +1 -1
  4. package/dist/{ColorPicker-B_FoQwtO.js → ColorPicker-DvVKgyAl.js} +23 -24
  5. package/dist/{DataTable-Rajdtaf6.js → DataTable-Cv9CIz-a.js} +11 -11
  6. package/dist/{Legend-BxtDQCIv.js → Legend-DFunFf8i.js} +8 -8
  7. package/dist/NonSvgPenAndPaper-pVuHj6_A.js +467 -0
  8. package/dist/PackageVersion-CLY-udAA.js +10 -0
  9. package/dist/{PenAndPaper-BkP3J-Ft.js → PenAndPaper-B9na2mbr.js} +8 -10
  10. package/dist/RecursiveCircles-Dn3TGoL6.js +96 -0
  11. package/dist/RecursiveLabels-NTMB9w5C.js +49 -0
  12. package/dist/RecursiveLinks-ld_gDZH4.js +64 -0
  13. package/dist/{Shape-C69a0f29.js → Shape-D3w9qas1.js} +2 -2
  14. package/dist/{Slicer-7qFdY-bT.js → Slicer-ncY8krrM.js} +2 -2
  15. package/dist/SparkTooltip-CwThutH2.js +68 -0
  16. package/dist/{Title-CzaCeCOm.js → Title-B5qqUI3M.js} +2 -2
  17. package/dist/Tooltip-C9rxJ-Ru.js +149 -0
  18. package/dist/{usePrinter-C5bLp34h.js → UserOptions-Ddy6CuLC.js} +172 -231
  19. package/dist/{dom-to-png-Bm0D0yPL.js → dom-to-png-DDlooC9r.js} +1 -1
  20. package/dist/{img-BN9AzqUr.js → img-m9g7lR5d.js} +1 -1
  21. package/dist/{index-BFzQMJda.js → index-BiHmNd1-.js} +21 -21
  22. package/dist/{pdf-uTbs813M.js → pdf-BqM953uL.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/useChartAccessibility-9icAAmYg.js +12 -0
  25. package/dist/useMouse-AicQS8Vf.js +13 -0
  26. package/dist/{useNestedProp-v7KPpwuP.js → useNestedProp-tRqS0ZAM.js} +1 -1
  27. package/dist/{usePanZoom-CUkkqW81.js → usePanZoom-BQMvRXEQ.js} +16 -17
  28. package/dist/usePrinter-CRCbl1WG.js +53 -0
  29. package/dist/vClickOutside-C6WiFswA.js +13 -0
  30. package/dist/{vue-data-ui-D1k8FeRp.js → vue-data-ui-D9uTDt73.js} +63 -63
  31. package/dist/vue-data-ui.js +19 -19
  32. package/dist/{vue-ui-3d-bar-DoklA4DT.js → vue-ui-3d-bar-rtuSc8FS.js} +397 -402
  33. package/dist/{vue-ui-accordion-BUz4JIIX.js → vue-ui-accordion-CmCs2yR2.js} +3 -3
  34. package/dist/{vue-ui-age-pyramid-4kyBq-Dy.js → vue-ui-age-pyramid-BrzMSiyu.js} +215 -218
  35. package/dist/{vue-ui-annotator-Bq1ZeFfb.js → vue-ui-annotator-CYxmTpf6.js} +2 -2
  36. package/dist/{vue-ui-bullet-DU10avvA.js → vue-ui-bullet-D25qNQfb.js} +137 -140
  37. package/dist/{vue-ui-candlestick-BI1t3flz.js → vue-ui-candlestick-BuerNa-r.js} +265 -271
  38. package/dist/{vue-ui-carousel-table-VowLf_oc.js → vue-ui-carousel-table-aN0HLsOO.js} +137 -137
  39. package/dist/{vue-ui-chestnut-BHjV3d94.js → vue-ui-chestnut-oUj2ocsZ.js} +397 -400
  40. package/dist/{vue-ui-chord-CPr7r-2_.js → vue-ui-chord-C4evlXYB.js} +356 -365
  41. package/dist/vue-ui-circle-pack-CWrNiKTY.js +656 -0
  42. package/dist/{vue-ui-cursor-C9teAbVI.js → vue-ui-cursor-DgpSttlt.js} +2 -2
  43. package/dist/{vue-ui-dashboard-CwDYB8tP.js → vue-ui-dashboard-BN2ha1Eh.js} +62 -62
  44. package/dist/{vue-ui-digits-CHmkL0hn.js → vue-ui-digits-BhjAxXgm.js} +2 -2
  45. package/dist/vue-ui-donut-D3_z61HI.js +1291 -0
  46. package/dist/vue-ui-donut-evolution-oKtmZPx4.js +864 -0
  47. package/dist/{vue-ui-dumbbell-DTKLLd1N.js → vue-ui-dumbbell-C8Lokx-F.js} +265 -270
  48. package/dist/{vue-ui-flow-BLBhsU2n.js → vue-ui-flow-BVRkH0PS.js} +291 -300
  49. package/dist/{vue-ui-funnel-CIrWdeBk.js → vue-ui-funnel-DFxcmAB5.js} +216 -219
  50. package/dist/{vue-ui-galaxy-ByhKyIV4.js → vue-ui-galaxy-CGE0hlBC.js} +227 -235
  51. package/dist/{vue-ui-gauge-BbfBMpng.js → vue-ui-gauge-B48eMvOR.js} +240 -243
  52. package/dist/{vue-ui-gizmo-BM-_QfHM.js → vue-ui-gizmo-zTKNpjvv.js} +57 -58
  53. package/dist/{vue-ui-heatmap-BA4z4hsw.js → vue-ui-heatmap-UNfTt8SM.js} +239 -242
  54. package/dist/{vue-ui-history-plot-8vM_IUy8.js → vue-ui-history-plot-CbCWmvtg.js} +257 -262
  55. package/dist/{vue-ui-kpi-D57QLK6A.js → vue-ui-kpi-Drf_lrlh.js} +29 -30
  56. package/dist/{vue-ui-mini-loader-CR4c-xJQ.js → vue-ui-mini-loader-DU3G6BVs.js} +2 -2
  57. package/dist/vue-ui-molecule-B5MOXYEA.js +580 -0
  58. package/dist/{vue-ui-mood-radar-Brc9cxoD.js → vue-ui-mood-radar-CC_CVLvn.js} +180 -186
  59. package/dist/{vue-ui-nested-donuts-W3Z5F--L.js → vue-ui-nested-donuts-D_H962kk.js} +366 -374
  60. package/dist/{vue-ui-onion-BNBlGNlF.js → vue-ui-onion-P8k6T724.js} +252 -258
  61. package/dist/{vue-ui-parallel-coordinate-plot-B5G3jyvg.js → vue-ui-parallel-coordinate-plot-B5Los0vX.js} +296 -303
  62. package/dist/{vue-ui-quadrant-CUy9mVIA.js → vue-ui-quadrant-B3wzCTxK.js} +402 -409
  63. package/dist/{vue-ui-quick-chart-D4_8mRXU.js → vue-ui-quick-chart-oucj6hXk.js} +611 -616
  64. package/dist/{vue-ui-radar-BUk56jGL.js → vue-ui-radar-Cjqlyu6d.js} +270 -277
  65. package/dist/{vue-ui-rating-B9TQl5KP.js → vue-ui-rating-gryk_h_6.js} +2 -2
  66. package/dist/vue-ui-relation-circle-ielvWC-1.js +525 -0
  67. package/dist/{vue-ui-ridgeline-Cl06bGom.js → vue-ui-ridgeline-Dydqo68b.js} +321 -326
  68. package/dist/{vue-ui-rings-B6bpFlFp.js → vue-ui-rings-BRBXektJ.js} +262 -269
  69. package/dist/{vue-ui-scatter--WUuVw5G.js → vue-ui-scatter-Df-BM7Ts.js} +372 -379
  70. package/dist/{vue-ui-skeleton-B_YI7Yuc.js → vue-ui-skeleton-CbYQYRvD.js} +19 -19
  71. package/dist/{vue-ui-smiley-Bbam2fDz.js → vue-ui-smiley-BfHaQMaW.js} +2 -2
  72. package/dist/{vue-ui-spark-trend-DavXuwGt.js → vue-ui-spark-trend-z3fUChs_.js} +114 -117
  73. package/dist/{vue-ui-sparkbar-9N1FU9-J.js → vue-ui-sparkbar-ChtFIugH.js} +104 -106
  74. package/dist/{vue-ui-sparkgauge-_9ntq4EK.js → vue-ui-sparkgauge-DtpODCww.js} +72 -74
  75. package/dist/{vue-ui-sparkhistogram-BEzOV4HV.js → vue-ui-sparkhistogram-C3XnYiXI.js} +83 -86
  76. package/dist/vue-ui-sparkline-CoL8jiX8.js +459 -0
  77. package/dist/{vue-ui-sparkstackbar-BSWcs3v0.js → vue-ui-sparkstackbar-CYk3mZJH.js} +102 -105
  78. package/dist/{vue-ui-stackbar-gG5BLlAr.js → vue-ui-stackbar-D9LGbuG5.js} +433 -437
  79. package/dist/{vue-ui-strip-plot-BJouRmxh.js → vue-ui-strip-plot-C5r1Ee2R.js} +245 -252
  80. package/dist/{vue-ui-table-D9Ry8s4N.js → vue-ui-table-DBaT_TfA.js} +3 -3
  81. package/dist/{vue-ui-table-heatmap-Bizzpi31.js → vue-ui-table-heatmap-CYW4YfKN.js} +93 -94
  82. package/dist/{vue-ui-table-sparkline-Dg54Ovs2.js → vue-ui-table-sparkline-Di0MYR4p.js} +212 -212
  83. package/dist/{vue-ui-thermometer-6MSdF_Gm.js → vue-ui-thermometer-BF1btHY2.js} +154 -157
  84. package/dist/{vue-ui-timer-ByaKokk8.js → vue-ui-timer-D9FfRWN5.js} +180 -181
  85. package/dist/vue-ui-tiremarks-CQ0lk8fJ.js +341 -0
  86. package/dist/vue-ui-treemap-1Lx7YRtc.js +947 -0
  87. package/dist/{vue-ui-vertical-bar-CE4oBwBv.js → vue-ui-vertical-bar-DdVVQ1ED.js} +397 -403
  88. package/dist/{vue-ui-waffle-DNEEnY_G.js → vue-ui-waffle-BhnuPiRD.js} +317 -324
  89. package/dist/vue-ui-wheel-BIjJ0fg8.js +335 -0
  90. package/dist/vue-ui-word-cloud-3-r8HwO_.js +642 -0
  91. package/dist/{vue-ui-world-Brhq17TE.js → vue-ui-world-CPIGEswq.js} +430 -442
  92. package/dist/{vue-ui-xy-K2G7QQxG.js → vue-ui-xy-9e_epIN4.js} +845 -846
  93. package/dist/vue-ui-xy-canvas-DcGgQ7s4.js +1206 -0
  94. package/package.json +6 -6
  95. package/dist/BaseDraggableDialog-Bzwlfmy1.js +0 -186
  96. package/dist/PackageVersion-BjrblLPQ.js +0 -10
  97. package/dist/Tooltip-CWmRmhJr.js +0 -158
  98. package/dist/useChartAccessibility-BWojgys7.js +0 -13
  99. package/dist/vue-ui-circle-pack-D_jYpsuD.js +0 -659
  100. package/dist/vue-ui-donut-WRUDvvZa.js +0 -1292
  101. package/dist/vue-ui-donut-evolution-BQxV5D_L.js +0 -871
  102. package/dist/vue-ui-molecule-Bq69N7rC.js +0 -782
  103. package/dist/vue-ui-relation-circle-T6aTibIU.js +0 -528
  104. package/dist/vue-ui-sparkline-D__GCUAz.js +0 -519
  105. package/dist/vue-ui-tiremarks-Z8pjUT1g.js +0 -344
  106. package/dist/vue-ui-treemap-pRJ3be5l.js +0 -956
  107. package/dist/vue-ui-wheel-DWPYZxdT.js +0 -338
  108. package/dist/vue-ui-word-cloud-DAR7R8F8.js +0 -648
  109. package/dist/vue-ui-xy-canvas-ml44sPHS.js +0 -1673
@@ -0,0 +1,642 @@
1
+ import { useCssVars as De, defineAsyncComponent as j, computed as se, ref as g, watch as be, shallowRef as Fe, onMounted as Ee, onBeforeUnmount as Ue, createElementBlock as N, openBlock as x, unref as r, normalizeStyle as he, createBlock as ie, createCommentVNode as B, createVNode as we, createSlots as Ge, withCtx as O, renderSlot as F, normalizeProps as Q, guardReactiveProps as ee, normalizeClass as Me, createElementVNode as Ce, Fragment as Le, renderList as je, toDisplayString as Pe, createTextVNode as He, nextTick as ze } from "vue";
2
+ import { u as qe, c as Ae, aj as Ze, v as Je, t as Ke, p as me, a as Qe, o as et, e as Oe, g as tt, f as ot, X as at, q as lt, r as nt, x as st } from "./index-BiHmNd1-.js";
3
+ import { t as it, u as rt, d as ut } from "./useResponsive-JZ9xq-JV.js";
4
+ import { u as Ne } from "./useNestedProp-tRqS0ZAM.js";
5
+ import { u as ct } from "./usePrinter-CRCbl1WG.js";
6
+ import { u as dt } from "./useUserOptionState-BIvW1Kz7.js";
7
+ import { u as vt } from "./useChartAccessibility-9icAAmYg.js";
8
+ import { u as ht } from "./usePanZoom-BQMvRXEQ.js";
9
+ import mt from "./Title-B5qqUI3M.js";
10
+ import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
+ function pt(w, p) {
12
+ const { width: u, height: f } = w, m = p.getImageData(0, 0, u, f).data;
13
+ let l = u, a = f, s = 0, C = 0, d = !1;
14
+ for (let h = 0; h < f; h += 1)
15
+ for (let y = 0; y < u; y += 1)
16
+ m[(h * u + y) * 4 + 3] > 1 && (d = !0, y < l && (l = y), y > s && (s = y), h < a && (a = h), h > C && (C = h));
17
+ return d ? [l, a, s, C] : [0, 0, 0, 0];
18
+ }
19
+ function Ie({
20
+ word: w,
21
+ fontSize: p,
22
+ pad: u,
23
+ canvas: f,
24
+ ctx: c,
25
+ svg: m
26
+ }) {
27
+ c.save(), c.font = `${m.style && m.style.bold ? "bold " : ""}${p}px Arial`;
28
+ const l = c.measureText(w.name), a = Math.ceil(l.width) + 2 + (u ? u * 2 : 0), s = Math.ceil(p) + 2 + (u ? u * 2 : 0);
29
+ f.width = a, f.height = s, c.clearRect(0, 0, a, s), c.font = `${m.style && m.style.bold ? "bold " : ""}${p}px Arial`, c.textAlign = "center", c.textBaseline = "middle", c.fillStyle = "black", c.fillText(w.name, a / 2, s / 2);
30
+ const d = c.getImageData(0, 0, a, s).data, h = [];
31
+ for (let _ = 0; _ < s; _ += 1)
32
+ for (let Y = 0; Y < a; Y += 1)
33
+ d[(_ * a + Y) * 4 + 3] > 1 && h.push([Y, _]);
34
+ const [y, D, P, I] = pt(f, c);
35
+ return c.restore(), { w: a, h: s, wordMask: h, minX: y, minY: D, maxX: P, maxY: I };
36
+ }
37
+ function _e({ mask: w, maskW: p, maskH: u, wx: f, wy: c, wordMask: m }) {
38
+ for (let l = 0; l < m.length; l += 1) {
39
+ const a = f + m[l][0], s = c + m[l][1];
40
+ if (a < 0 || s < 0 || a >= p || s >= u || w[s * p + a]) return !1;
41
+ }
42
+ return !0;
43
+ }
44
+ function Re({ mask: w, maskW: p, maskH: u, wx: f, wy: c, wordMask: m }) {
45
+ for (let l = 0; l < m.length; l += 1) {
46
+ const a = f + m[l][0], s = c + m[l][1];
47
+ a >= 0 && s >= 0 && a < p && s < u && (w[s * p + a] = 1);
48
+ }
49
+ }
50
+ function gt({ wordMask: w, w: p, h: u, dilation: f }) {
51
+ const c = new Set(w.map(([l, a]) => `${l},${a}`)), m = new Set(c);
52
+ for (let [l, a] of w)
53
+ for (let s = -f; s <= f; s += 1)
54
+ for (let C = -f; C <= f; C += 1) {
55
+ if (s === 0 && C === 0) continue;
56
+ const d = l + s, h = a + C;
57
+ d >= 0 && d < p && h >= 0 && h < u && m.add(`${d},${h}`);
58
+ }
59
+ return Array.from(m).map((l) => l.split(",").map(Number));
60
+ }
61
+ function yt({
62
+ words: w,
63
+ proximity: p = 0,
64
+ svg: u,
65
+ strictPixelPadding: f
66
+ }) {
67
+ const { width: c, height: m } = u, l = Math.round(c), a = Math.round(m), s = 1, C = u.minFontSize, d = Math.min(u.maxFontSize, 100), h = w.map((T) => T.value), y = Math.min(...h), D = Math.max(...h), P = new Uint8Array(l * a), I = document.createElement("canvas"), _ = I.getContext("2d", { willReadFrequently: !0 });
68
+ I.width = l, I.height = a;
69
+ const Y = 6, re = 2, te = 2, e = 1, U = Math.floor(l / 2), oe = Math.floor(a / 2), ae = [...w].sort((T, z) => z.value - T.value), H = [];
70
+ for (const T of ae) {
71
+ let z = C;
72
+ D !== y && (z = (T.value - y) / (D - y) * (d - C) + C), z = Math.max(C, Math.min(d, z));
73
+ let R = !1, n = z;
74
+ for (; !R && n >= s; ) {
75
+ let { w: X, h: V, wordMask: k, minX: W, minY: q, maxX: Z, maxY: J } = Ie({
76
+ word: T,
77
+ fontSize: n,
78
+ pad: p,
79
+ canvas: I,
80
+ ctx: _,
81
+ svg: u
82
+ });
83
+ f && (k = gt({ wordMask: k, w: X, h: V, dilation: 1 }));
84
+ let A = 0, E = 0;
85
+ for (; A < Math.max(l, a) && !R && E < 1e4; ) {
86
+ for (let v = 0; v < 360; v += Y) {
87
+ E += 1;
88
+ const M = Math.round(U + A * Math.cos(v * Math.PI / 180) - X / 2), b = Math.round(oe + A * Math.sin(v * Math.PI / 180) - V / 2);
89
+ if (!(M < 0 || b < 0 || M + X > l || b + V > a) && _e({ mask: P, maskW: l, maskH: a, wx: M, wy: b, wordMask: k })) {
90
+ H.push({ ...T, x: M - l / 2, y: b - a / 2, fontSize: n, width: X, height: V, angle: 0, minX: W, minY: q, maxX: Z, maxY: J }), Re({ mask: P, maskW: l, maskH: a, wx: M, wy: b, wordMask: k }), R = !0;
91
+ break;
92
+ }
93
+ }
94
+ A += re;
95
+ }
96
+ R || (n -= 1);
97
+ }
98
+ if (!R && n < s) {
99
+ n = s;
100
+ const { w: X, h: V, wordMask: k, minX: W, minY: q, maxX: Z, maxY: J } = Ie({
101
+ word: T,
102
+ fontSize: n,
103
+ pad: p,
104
+ canvas: I,
105
+ ctx: _,
106
+ svg: u
107
+ });
108
+ let A = 0, E = 0;
109
+ for (; A < Math.max(l, a) && !R && E < 25e3; ) {
110
+ for (let v = 0; v < 360; v += te) {
111
+ E += 1;
112
+ const M = Math.round(U + A * Math.cos(v * Math.PI / 180) - X / 2), b = Math.round(oe + A * Math.sin(v * Math.PI / 180) - V / 2);
113
+ if (!(M < 0 || b < 0 || M + X > l || b + V > a) && _e({ mask: P, maskW: l, maskH: a, wx: M, wy: b, wordMask: k })) {
114
+ H.push({ ...T, x: M - l / 2, y: b - a / 2, fontSize: n, width: X, height: V, angle: 0, minX: W, minY: q, maxX: Z, maxY: J }), Re({ mask: P, maskW: l, maskH: a, wx: M, wy: b, wordMask: k }), R = !0;
115
+ break;
116
+ }
117
+ }
118
+ A += e;
119
+ }
120
+ }
121
+ }
122
+ return H.sort((T, z) => z.fontSize - T.fontSize);
123
+ }
124
+ const bt = ["id"], wt = ["xmlns", "viewBox"], Ct = ["width", "height"], kt = ["transform"], xt = ["x", "y", "width", "height", "onMouseover"], $t = ["fill", "font-weight", "x", "y", "font-size", "transform"], Tt = {
125
+ key: 4,
126
+ class: "vue-data-ui-watermark"
127
+ }, St = {
128
+ key: 5,
129
+ "data-dom-to-png-ignore": "",
130
+ class: "reset-wrapper"
131
+ }, Ft = ["innerHTML"], Mt = {
132
+ __name: "vue-ui-word-cloud",
133
+ props: {
134
+ config: {
135
+ type: Object,
136
+ default() {
137
+ return {};
138
+ }
139
+ },
140
+ dataset: {
141
+ type: [Array, String],
142
+ default() {
143
+ return [];
144
+ }
145
+ }
146
+ },
147
+ setup(w, { expose: p }) {
148
+ De((t) => ({
149
+ c9496d9a: t.slicerColor
150
+ }));
151
+ const u = j(() => import("./vue-ui-accordion-CmCs2yR2.js")), f = j(() => import("./BaseIcon-CZdMutjs.js")), c = j(() => import("./DataTable-Cv9CIz-a.js")), m = j(() => import("./PackageVersion-CLY-udAA.js")), l = j(() => import("./PenAndPaper-B9na2mbr.js")), a = j(() => import("./Tooltip-C9rxJ-Ru.js")), s = j(() => import("./UserOptions-Ddy6CuLC.js")), { vue_ui_word_cloud: C } = qe(), d = w, h = se({
152
+ get() {
153
+ return !!d.dataset && d.dataset.length;
154
+ },
155
+ set(t) {
156
+ return t;
157
+ }
158
+ }), y = g(Ae()), D = g(0), P = g(null), I = g(null), _ = g(null), Y = g(0), re = g(0), te = g(!1), e = se({
159
+ get: () => R(),
160
+ set: (t) => t
161
+ }), U = g(oe());
162
+ function oe() {
163
+ return typeof d.dataset == "string" ? Ze(d.dataset) : d.dataset.map((t, i) => ({
164
+ ...t,
165
+ value: Je(t.value)
166
+ }));
167
+ }
168
+ be(() => d.dataset, () => {
169
+ U.value = oe(), fe();
170
+ });
171
+ const { userOptionsVisible: ae, setUserOptionsVisibility: H, keepUserOptionState: T } = dt({ config: e.value }), { svgRef: z } = vt({ config: e.value.style.chart.title });
172
+ function R() {
173
+ const t = Ne({
174
+ userConfig: d.config,
175
+ defaultConfig: C
176
+ });
177
+ return t.theme ? {
178
+ ...Ne({
179
+ userConfig: Qe.vue_ui_word_cloud[t.theme] || d.config,
180
+ defaultConfig: t
181
+ }),
182
+ customPalette: Ke[t.theme] || me
183
+ } : t;
184
+ }
185
+ be(() => d.config, (t) => {
186
+ e.value = R(), ae.value = !e.value.userOptions.showOnChartHover, q(), Y.value += 1, re.value += 1, v.value.showTable = e.value.table.show, v.value.showTooltip = e.value.style.chart.tooltip.show;
187
+ }, { deep: !0 });
188
+ const n = g({
189
+ width: e.value.style.chart.width,
190
+ height: e.value.style.chart.height,
191
+ maxFontSize: e.value.style.chart.words.maxFontSize,
192
+ minFontSize: e.value.style.chart.words.minFontSize,
193
+ bold: e.value.style.chart.words.bold
194
+ }), X = ut(() => {
195
+ fe();
196
+ }, 10), V = it(() => {
197
+ const { width: t, height: i } = rt({
198
+ chart: P.value,
199
+ title: e.value.style.chart.title.text ? I.value : null,
200
+ source: _.value
201
+ });
202
+ requestAnimationFrame(() => {
203
+ n.value.width = t, n.value.height = i, ze(X);
204
+ });
205
+ }), k = Fe(null), W = Fe(null);
206
+ Ee(q);
207
+ function q() {
208
+ et(d.dataset) ? Oe({
209
+ componentName: "VueUiWordCloud",
210
+ type: "dataset"
211
+ }) : U.value.forEach((t, i) => {
212
+ tt({
213
+ datasetObject: t,
214
+ requiredAttributes: ["name", "value"]
215
+ }).forEach((o) => {
216
+ h.value = !1, Oe({
217
+ componentName: "VueUiWordCloud",
218
+ type: "datasetSerieAttribute",
219
+ property: o,
220
+ index: i
221
+ });
222
+ });
223
+ }), e.value.responsive && (k.value && (W.value && k.value.unobserve(W.value), k.value.disconnect()), k.value = new ResizeObserver(V), W.value = P.value.parentNode, k.value.observe(W.value));
224
+ }
225
+ Ue(() => {
226
+ k.value && (W.value && k.value.unobserve(W.value), k.value.disconnect());
227
+ });
228
+ const { isPrinting: Z, isImaging: J, generatePdf: A, generateImage: E } = ct({
229
+ elementId: `wordCloud_${y.value}`,
230
+ fileName: e.value.style.chart.title.text || "vue-ui-word-cloud",
231
+ options: e.value.userOptions.print
232
+ }), v = g({
233
+ showTable: e.value.table.show,
234
+ showTooltip: e.value.style.chart.tooltip.show
235
+ });
236
+ function M(t, i, o = "Arial") {
237
+ const $ = document.createElement("canvas").getContext("2d");
238
+ return $.font = `${i}px ${e.value.style.chart.words.bold ? "bold" : "normal"} ${o}`, {
239
+ width: $.measureText(t).width + e.value.style.chart.words.proximity,
240
+ height: i
241
+ };
242
+ }
243
+ const b = g([]);
244
+ be(() => d.dataset, fe, { immediate: !0 });
245
+ function fe() {
246
+ const t = [...U.value].map(($) => $.value), i = Math.max(...t), o = Math.min(...t), S = [...U.value].map(($, G) => {
247
+ let L = ($.value - o) / (i - o) * (n.value.maxFontSize - n.value.minFontSize) + n.value.minFontSize;
248
+ L = isNaN(L) ? n.value.minFontSize : L;
249
+ const Se = M($.name, L);
250
+ return {
251
+ ...$,
252
+ id: Ae(),
253
+ fontSize: L,
254
+ width: Se.width,
255
+ height: Se.height,
256
+ color: e.value.style.chart.words.usePalette ? e.value.customPalette[G] || e.value.customPalette[G % e.value.customPalette.length] || me[G] || me[G % me.length] : e.value.style.chart.words.color
257
+ };
258
+ });
259
+ b.value = yt({
260
+ words: S,
261
+ svg: n.value,
262
+ proximity: e.value.style.chart.words.proximity,
263
+ strictPixelPadding: e.value.strictPixelPadding
264
+ });
265
+ }
266
+ const ue = se(() => {
267
+ const t = b.value.map((o) => ({
268
+ name: o.name,
269
+ color: o.color
270
+ })), i = b.value.map((o) => o.value);
271
+ return { head: t, body: i };
272
+ });
273
+ function ke() {
274
+ ze(() => {
275
+ const t = ue.value.head.map((S, $) => [[
276
+ S.name
277
+ ], [ue.value.body[$]]]), i = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], [e.value.table.columnNames.value]]].concat(t), o = lt(i);
278
+ nt({ csvContent: o, title: e.value.style.chart.title.text || "vue-ui-word-cloud" });
279
+ });
280
+ }
281
+ const ce = se(() => {
282
+ const t = [
283
+ e.value.table.columnNames.series,
284
+ e.value.table.columnNames.value
285
+ ], i = ue.value.head.map(($, G) => {
286
+ const L = ot({ p: e.value.table.td.prefix, v: ue.value.body[G], s: e.value.table.td.suffix, r: e.value.table.td.roundingValue });
287
+ return [
288
+ {
289
+ color: $.color,
290
+ name: $.name
291
+ },
292
+ L
293
+ ];
294
+ }), o = {
295
+ th: {
296
+ backgroundColor: e.value.table.th.backgroundColor,
297
+ color: e.value.table.th.color,
298
+ outline: e.value.table.th.outline
299
+ },
300
+ td: {
301
+ backgroundColor: e.value.table.td.backgroundColor,
302
+ color: e.value.table.td.color,
303
+ outline: e.value.table.td.outline
304
+ },
305
+ breakpoint: e.value.table.responsiveBreakpoint
306
+ };
307
+ return {
308
+ colNames: [
309
+ e.value.table.columnNames.series,
310
+ e.value.table.columnNames.value
311
+ ],
312
+ head: t,
313
+ body: i,
314
+ config: o
315
+ };
316
+ }), de = g(!1);
317
+ function Xe(t) {
318
+ de.value = t, D.value += 1;
319
+ }
320
+ function Ve() {
321
+ return b.value;
322
+ }
323
+ function xe() {
324
+ v.value.showTable = !v.value.showTable;
325
+ }
326
+ function $e() {
327
+ v.value.showTooltip = !v.value.showTooltip;
328
+ }
329
+ const le = g(!1);
330
+ function pe() {
331
+ le.value = !le.value;
332
+ }
333
+ const We = se(() => !le.value && e.value.style.chart.zoom.show), { viewBox: ve, resetZoom: Te, isZoom: Be } = ht(z, {
334
+ x: 0,
335
+ y: 0,
336
+ width: n.value.width <= 0 ? 10 : n.value.width,
337
+ height: n.value.height <= 0 ? 10 : n.value.height
338
+ }, 1, We);
339
+ p({
340
+ getData: Ve,
341
+ generateCsv: ke,
342
+ generatePdf: A,
343
+ generateImage: E,
344
+ toggleTable: xe,
345
+ toggleTooltip: $e,
346
+ toggleAnnotator: pe
347
+ });
348
+ const K = g(null), ne = g(!1), ge = g(""), ye = g(null);
349
+ function Ye(t) {
350
+ if (!v.value.showTooltip) return;
351
+ K.value = t.id, ye.value = { datapoint: t, config: e.value };
352
+ const i = e.value.style.chart.tooltip.customFormat;
353
+ if (ne.value = !1, st(i))
354
+ try {
355
+ const o = i({
356
+ datapoint: t,
357
+ config: e.value
358
+ });
359
+ typeof o == "string" && (ge.value = o, ne.value = !0);
360
+ } catch {
361
+ console.warn("Custom format cannot be applied."), ne.value = !1;
362
+ }
363
+ if (!ne.value) {
364
+ let o = `<svg viewBox="0 0 10 10" height="${e.value.style.chart.tooltip.fontSize}"><circle cx="5" cy="5" r="5" fill="${t.color}"/></svg><span>${t.name}:</span><b>${(t.value || 0).toFixed(e.value.style.chart.tooltip.roundingValue)}</b>`;
365
+ ge.value = `<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${o}</div>`;
366
+ }
367
+ te.value = !0;
368
+ }
369
+ return (t, i) => (x(), N("div", {
370
+ class: "vue-ui-word-cloud",
371
+ ref_key: "wordCloudChart",
372
+ ref: P,
373
+ id: `wordCloud_${y.value}`,
374
+ style: he(`width: 100%; font-family:${e.value.style.fontFamily};background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
375
+ onMouseenter: i[3] || (i[3] = () => r(H)(!0)),
376
+ onMouseleave: i[4] || (i[4] = () => r(H)(!1))
377
+ }, [
378
+ e.value.userOptions.buttons.annotator ? (x(), ie(r(l), {
379
+ key: 0,
380
+ svgRef: r(z),
381
+ backgroundColor: e.value.style.chart.backgroundColor,
382
+ color: e.value.style.chart.color,
383
+ active: le.value,
384
+ onClose: pe
385
+ }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : B("", !0),
386
+ e.value.style.chart.title.text ? (x(), N("div", {
387
+ key: 1,
388
+ ref_key: "chartTitle",
389
+ ref: I,
390
+ style: "width:100%;background:transparent;padding-bottom:24px"
391
+ }, [
392
+ (x(), ie(mt, {
393
+ key: `title_${Y.value}`,
394
+ config: {
395
+ title: {
396
+ ...e.value.style.chart.title
397
+ },
398
+ subtitle: {
399
+ ...e.value.style.chart.title.subtitle
400
+ }
401
+ }
402
+ }, null, 8, ["config"]))
403
+ ], 512)) : B("", !0),
404
+ e.value.userOptions.show && h.value && (r(T) || r(ae)) ? (x(), ie(r(s), {
405
+ ref: "details",
406
+ key: `user_option_${D.value}`,
407
+ backgroundColor: e.value.style.chart.backgroundColor,
408
+ color: e.value.style.chart.color,
409
+ isPrinting: r(Z),
410
+ isImaging: r(J),
411
+ uid: y.value,
412
+ hasPdf: e.value.userOptions.buttons.pdf,
413
+ hasXls: e.value.userOptions.buttons.csv,
414
+ hasImg: e.value.userOptions.buttons.img,
415
+ hasTable: e.value.userOptions.buttons.table,
416
+ hasFullscreen: e.value.userOptions.buttons.fullscreen,
417
+ isFullscreen: de.value,
418
+ titles: { ...e.value.userOptions.buttonTitles },
419
+ chartElement: P.value,
420
+ position: e.value.userOptions.position,
421
+ hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
422
+ isTooltip: v.value.showTooltip,
423
+ hasAnnotator: e.value.userOptions.buttons.annotator,
424
+ isAnnotation: le.value,
425
+ onToggleFullscreen: Xe,
426
+ onGeneratePdf: r(A),
427
+ onGenerateCsv: ke,
428
+ onGenerateImage: r(E),
429
+ onToggleTable: xe,
430
+ onToggleTooltip: $e,
431
+ onToggleAnnotator: pe,
432
+ style: he({
433
+ visibility: r(T) ? r(ae) ? "visible" : "hidden" : "visible"
434
+ })
435
+ }, Ge({ _: 2 }, [
436
+ t.$slots.menuIcon ? {
437
+ name: "menuIcon",
438
+ fn: O(({ isOpen: o, color: S }) => [
439
+ F(t.$slots, "menuIcon", Q(ee({ isOpen: o, color: S })), void 0, !0)
440
+ ]),
441
+ key: "0"
442
+ } : void 0,
443
+ t.$slots.optionPdf ? {
444
+ name: "optionPdf",
445
+ fn: O(() => [
446
+ F(t.$slots, "optionPdf", {}, void 0, !0)
447
+ ]),
448
+ key: "1"
449
+ } : void 0,
450
+ t.$slots.optionCsv ? {
451
+ name: "optionCsv",
452
+ fn: O(() => [
453
+ F(t.$slots, "optionCsv", {}, void 0, !0)
454
+ ]),
455
+ key: "2"
456
+ } : void 0,
457
+ t.$slots.optionImg ? {
458
+ name: "optionImg",
459
+ fn: O(() => [
460
+ F(t.$slots, "optionImg", {}, void 0, !0)
461
+ ]),
462
+ key: "3"
463
+ } : void 0,
464
+ t.$slots.optionTable ? {
465
+ name: "optionTable",
466
+ fn: O(() => [
467
+ F(t.$slots, "optionTable", {}, void 0, !0)
468
+ ]),
469
+ key: "4"
470
+ } : void 0,
471
+ t.$slots.optionFullscreen ? {
472
+ name: "optionFullscreen",
473
+ fn: O(({ toggleFullscreen: o, isFullscreen: S }) => [
474
+ F(t.$slots, "optionFullscreen", Q(ee({ toggleFullscreen: o, isFullscreen: S })), void 0, !0)
475
+ ]),
476
+ key: "5"
477
+ } : void 0,
478
+ t.$slots.optionAnnotator ? {
479
+ name: "optionAnnotator",
480
+ fn: O(({ toggleAnnotator: o, isAnnotator: S }) => [
481
+ F(t.$slots, "optionAnnotator", Q(ee({ toggleAnnotator: o, isAnnotator: S })), void 0, !0)
482
+ ]),
483
+ key: "6"
484
+ } : void 0
485
+ ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasTooltip", "isTooltip", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : B("", !0),
486
+ h.value ? (x(), N("svg", {
487
+ key: 3,
488
+ ref_key: "svgRef",
489
+ ref: z,
490
+ class: Me({ "vue-data-ui-fullscreen--on": de.value, "vue-data-ui-fulscreen--off": !de.value }),
491
+ xmlns: r(at),
492
+ viewBox: `${r(ve).x} ${r(ve).y} ${r(ve).width} ${r(ve).height}`,
493
+ style: "overflow:hidden;background:transparent;"
494
+ }, [
495
+ we(r(m)),
496
+ t.$slots["chart-background"] ? (x(), N("foreignObject", {
497
+ key: 0,
498
+ x: 0,
499
+ y: 0,
500
+ width: n.value.width <= 0 ? 10 : n.value.width,
501
+ height: n.value.height <= 0 ? 10 : n.value.height,
502
+ style: {
503
+ pointerEvents: "none"
504
+ }
505
+ }, [
506
+ F(t.$slots, "chart-background", {}, void 0, !0)
507
+ ], 8, Ct)) : B("", !0),
508
+ Ce("g", {
509
+ transform: `translate(${(n.value.width <= 0 ? 10 : n.value.width) / 2}, ${(n.value.height <= 0 ? 10 : n.value.height) / 2})`
510
+ }, [
511
+ (x(!0), N(Le, null, je(b.value, (o, S) => (x(), N("g", null, [
512
+ o.minX !== void 0 ? (x(), N("rect", {
513
+ key: 0,
514
+ x: o.x + o.minX,
515
+ y: o.y + o.minY * 1.25,
516
+ width: o.maxX - o.minX,
517
+ height: o.maxY - o.minY,
518
+ fill: "transparent",
519
+ "pointer-events": "visiblePainted",
520
+ onMouseover: ($) => Ye(o),
521
+ onMouseleave: i[0] || (i[0] = ($) => {
522
+ K.value = null, te.value = !1;
523
+ })
524
+ }, null, 40, xt)) : B("", !0),
525
+ (x(), N("text", {
526
+ fill: o.color,
527
+ "font-weight": e.value.style.chart.words.bold ? "bold" : "normal",
528
+ key: S,
529
+ x: o.x,
530
+ y: o.y,
531
+ "font-size": o.fontSize,
532
+ transform: `translate(${o.width / 2}, ${o.height / 2})`,
533
+ class: Me({ animated: e.value.useCssAnimation, "word-selected": K.value && K.value === o.id && v.value.showTooltip, "word-not-selected": K.value && K.value !== o.id && v.value.showTooltip }),
534
+ "text-anchor": "middle",
535
+ "dominant-baseline": "central",
536
+ style: he(`animation-delay:${S * e.value.animationDelayMs}ms !important; pointer-events:none;`)
537
+ }, Pe(o.name), 15, $t))
538
+ ]))), 256))
539
+ ], 8, kt),
540
+ F(t.$slots, "svg", {
541
+ svg: { height: n.value.height, width: n.value.width }
542
+ }, void 0, !0)
543
+ ], 10, wt)) : B("", !0),
544
+ t.$slots.watermark ? (x(), N("div", Tt, [
545
+ F(t.$slots, "watermark", Q(ee({ isPrinting: r(Z) || r(J) })), void 0, !0)
546
+ ])) : B("", !0),
547
+ r(Be) ? (x(), N("div", St, [
548
+ F(t.$slots, "reset-action", { reset: r(Te) }, () => [
549
+ Ce("button", {
550
+ "data-cy-reset": "",
551
+ tabindex: "0",
552
+ role: "button",
553
+ class: "vue-data-ui-refresh-button",
554
+ style: he({
555
+ background: e.value.style.chart.backgroundColor
556
+ }),
557
+ onClick: i[1] || (i[1] = (o) => r(Te)(!0))
558
+ }, [
559
+ we(r(f), {
560
+ name: "refresh",
561
+ stroke: e.value.style.chart.color
562
+ }, null, 8, ["stroke"])
563
+ ], 4)
564
+ ], !0)
565
+ ])) : B("", !0),
566
+ we(r(a), {
567
+ show: v.value.showTooltip && te.value,
568
+ backgroundColor: e.value.style.chart.tooltip.backgroundColor,
569
+ color: e.value.style.chart.tooltip.color,
570
+ fontSize: e.value.style.chart.tooltip.fontSize,
571
+ borderRadius: e.value.style.chart.tooltip.borderRadius,
572
+ borderColor: e.value.style.chart.tooltip.borderColor,
573
+ borderWidth: e.value.style.chart.tooltip.borderWidth,
574
+ backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
575
+ position: e.value.style.chart.tooltip.position,
576
+ offsetY: e.value.style.chart.tooltip.offsetY,
577
+ parent: P.value,
578
+ content: ge.value,
579
+ isCustom: ne.value
580
+ }, {
581
+ "tooltip-before": O(() => [
582
+ F(t.$slots, "tooltip-before", Q(ee({ ...ye.value })), void 0, !0)
583
+ ]),
584
+ "tooltip-after": O(() => [
585
+ F(t.$slots, "tooltip-after", Q(ee({ ...ye.value })), void 0, !0)
586
+ ]),
587
+ _: 3
588
+ }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"]),
589
+ t.$slots.source ? (x(), N("div", {
590
+ key: 6,
591
+ ref_key: "source",
592
+ ref: _,
593
+ dir: "auto"
594
+ }, [
595
+ F(t.$slots, "source", {}, void 0, !0)
596
+ ], 512)) : B("", !0),
597
+ h.value ? (x(), ie(r(u), {
598
+ key: 7,
599
+ hideDetails: "",
600
+ config: {
601
+ open: v.value.showTable,
602
+ maxHeight: 1e4,
603
+ body: {
604
+ backgroundColor: e.value.style.chart.backgroundColor,
605
+ color: e.value.style.chart.color
606
+ },
607
+ head: {
608
+ backgroundColor: e.value.style.chart.backgroundColor,
609
+ color: e.value.style.chart.color
610
+ }
611
+ }
612
+ }, {
613
+ content: O(() => [
614
+ (x(), ie(r(c), {
615
+ key: `table_${re.value}`,
616
+ colNames: ce.value.colNames,
617
+ head: ce.value.head,
618
+ body: ce.value.body,
619
+ config: ce.value.config,
620
+ title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
621
+ onClose: i[2] || (i[2] = (o) => v.value.showTable = !1)
622
+ }, {
623
+ th: O(({ th: o }) => [
624
+ Ce("div", {
625
+ innerHTML: o,
626
+ style: { display: "flex", "align-items": "center" }
627
+ }, null, 8, Ft)
628
+ ]),
629
+ td: O(({ td: o }) => [
630
+ He(Pe(o.name || o), 1)
631
+ ]),
632
+ _: 1
633
+ }, 8, ["colNames", "head", "body", "config", "title"]))
634
+ ]),
635
+ _: 1
636
+ }, 8, ["config"])) : B("", !0)
637
+ ], 44, bt));
638
+ }
639
+ }, Wt = /* @__PURE__ */ ft(Mt, [["__scopeId", "data-v-2f9957bf"]]);
640
+ export {
641
+ Wt as default
642
+ };