vue-data-ui 2.16.6 → 2.17.1

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 (94) hide show
  1. package/README.md +84 -53
  2. package/dist/{Arrow-DCqxVwey.js → Arrow-BDCVJzQB.js} +1 -1
  3. package/dist/{BaseDraggableDialog-6DIKXIBU.js → BaseDraggableDialog-BvuWrldK.js} +2 -2
  4. package/dist/{BaseIcon-Bn996RXm.js → BaseIcon-D9Tz8ARD.js} +1 -1
  5. package/dist/{ColorPicker-OFfLkKNb.js → ColorPicker-wGf46G2G.js} +2 -2
  6. package/dist/{DataTable-CHBLjKtZ.js → DataTable-Dt-TIOyY.js} +2 -2
  7. package/dist/{Legend-nBXoxXJH.js → Legend-3LNqqLDg.js} +2 -2
  8. package/dist/{NonSvgPenAndPaper-Cls2idJS.js → NonSvgPenAndPaper-iDdMuUEo.js} +3 -3
  9. package/dist/{PackageVersion-Bg_9KCU-.js → PackageVersion-C-4Ee8BQ.js} +1 -1
  10. package/dist/{PenAndPaper-BPTpbnay.js → PenAndPaper-Cde-wJ3N.js} +32 -32
  11. package/dist/{Shape-Bnf512BA.js → Shape-C75836Jl.js} +1 -1
  12. package/dist/{Slicer-BrqtJG2E.js → Slicer-CpSu7plp.js} +2 -2
  13. package/dist/{SparkTooltip-C-rLATAw.js → SparkTooltip-B_GXa2tb.js} +1 -1
  14. package/dist/{Title-Gi81VwUM.js → Title-DpERl1yr.js} +1 -1
  15. package/dist/{Tooltip-CJxVw7-T.js → Tooltip-DA0bYKFG.js} +1 -1
  16. package/dist/{UserOptions-CBEK6_jo.js → UserOptions-DTEJ3UM_.js} +2 -2
  17. package/dist/{dom-to-png-CRHNL8VU.js → dom-to-png-DWDGYXFL.js} +1 -1
  18. package/dist/{img-BgOg8opa.js → img-utitT2Gd.js} +1 -1
  19. package/dist/{index-DvIXJm6t.js → index-CobsZUkv.js} +22 -8
  20. package/dist/{pdf-DhTxBrbJ.js → pdf-DWZ8IB56.js} +1 -1
  21. package/dist/style.css +1 -1
  22. package/dist/types/vue-data-ui.d.cts +999 -160
  23. package/dist/types/vue-data-ui.d.ts +999 -160
  24. package/dist/{useNestedProp-DrYHm61t.js → useNestedProp-BwL5wmVa.js} +1 -1
  25. package/dist/{usePrinter-CWnXbGMb.js → usePrinter-DPh6U_Qk.js} +2 -2
  26. package/dist/vue-data-ui-D7ZgRDQ_.js +312 -0
  27. package/dist/vue-data-ui.js +1 -1
  28. package/dist/{vue-ui-3d-bar-CtlB4p7i.js → vue-ui-3d-bar-ORUAjkg7.js} +246 -231
  29. package/dist/{vue-ui-accordion-D55kCO5G.js → vue-ui-accordion-UewqY6OI.js} +3 -3
  30. package/dist/{vue-ui-age-pyramid-DSshyUn-.js → vue-ui-age-pyramid-Yl4aRpNc.js} +225 -210
  31. package/dist/{vue-ui-annotator-DQSMv_k2.js → vue-ui-annotator-B1gqiBqq.js} +2 -2
  32. package/dist/{vue-ui-bullet-FeScjj7q.js → vue-ui-bullet-C307lCPt.js} +168 -153
  33. package/dist/{vue-ui-candlestick-Drupgyoi.js → vue-ui-candlestick-BE6PcEdh.js} +218 -203
  34. package/dist/{vue-ui-carousel-table-BTZQRZfO.js → vue-ui-carousel-table-Cpvjr677.js} +4 -4
  35. package/dist/{vue-ui-chestnut-DLWjPwRL.js → vue-ui-chestnut-CUw74AgC.js} +412 -397
  36. package/dist/{vue-ui-chord-BgLbFBT9.js → vue-ui-chord-CCPGeAiY.js} +202 -187
  37. package/dist/{vue-ui-circle-pack-VXcRh2gy.js → vue-ui-circle-pack-dfyPiQmy.js} +222 -207
  38. package/dist/{vue-ui-cursor-DWmfnM25.js → vue-ui-cursor-C2zmfeoD.js} +2 -2
  39. package/dist/{vue-ui-dashboard-CGIocEHj.js → vue-ui-dashboard-CotAqRbX.js} +62 -62
  40. package/dist/{vue-ui-digits-BgQch3Fc.js → vue-ui-digits-7qJFCuoI.js} +2 -2
  41. package/dist/{vue-ui-donut-B59bCV5_.js → vue-ui-donut-D41WeqQU.js} +420 -411
  42. package/dist/{vue-ui-donut-evolution-CI8qBIQd.js → vue-ui-donut-evolution-Deg0dsYg.js} +352 -340
  43. package/dist/{vue-ui-dumbbell-CXv7sk88.js → vue-ui-dumbbell-DDwNoTPG.js} +214 -199
  44. package/dist/{vue-ui-flow-DxF0ELtv.js → vue-ui-flow-6oR7IMyi.js} +215 -200
  45. package/dist/{vue-ui-funnel-Bco8rqF8.js → vue-ui-funnel-BnXtOJmh.js} +212 -197
  46. package/dist/{vue-ui-galaxy-CaPJwwOj.js → vue-ui-galaxy-75XC8SpV.js} +213 -201
  47. package/dist/{vue-ui-gauge-D7arhDmb.js → vue-ui-gauge-w31j915C.js} +218 -203
  48. package/dist/{vue-ui-gizmo-Dwli-Mip.js → vue-ui-gizmo-bZqk6oZS.js} +3 -3
  49. package/dist/{vue-ui-heatmap-Cyn-ahGO.js → vue-ui-heatmap-BfU62tMW.js} +242 -223
  50. package/dist/{vue-ui-history-plot-C2AEToqx.js → vue-ui-history-plot-CFfco-Yj.js} +267 -252
  51. package/dist/{vue-ui-kpi-DKDibSdl.js → vue-ui-kpi-DaJ1U3wf.js} +3 -3
  52. package/dist/{vue-ui-mini-loader-B8OVutUx.js → vue-ui-mini-loader-CF_2jAI8.js} +2 -2
  53. package/dist/{vue-ui-molecule-BVSrqIGw.js → vue-ui-molecule-Tdk3Gd8M.js} +207 -192
  54. package/dist/{vue-ui-mood-radar-DvlyS3RN.js → vue-ui-mood-radar-Dg5wS7W5.js} +204 -189
  55. package/dist/{vue-ui-nested-donuts-D9ssSus6.js → vue-ui-nested-donuts-CpRe0sQB.js} +248 -240
  56. package/dist/{vue-ui-onion-Buu4VX3u.js → vue-ui-onion-B8o4ft2v.js} +184 -169
  57. package/dist/{vue-ui-parallel-coordinate-plot-DFLUvhxD.js → vue-ui-parallel-coordinate-plot-zW-CNqWC.js} +192 -177
  58. package/dist/{vue-ui-quadrant-BMC7NBGd.js → vue-ui-quadrant-DiRtZ16w.js} +259 -244
  59. package/dist/{vue-ui-quick-chart-DB9RKUkb.js → vue-ui-quick-chart-BRlYC_yT.js} +324 -309
  60. package/dist/{vue-ui-radar-68NMPxxQ.js → vue-ui-radar-DKgX1Ibx.js} +195 -180
  61. package/dist/{vue-ui-rating-swH9kRr3.js → vue-ui-rating-DlklKr-X.js} +2 -2
  62. package/dist/{vue-ui-relation-circle-CT-EdSjO.js → vue-ui-relation-circle-MHiAp8dC.js} +186 -171
  63. package/dist/{vue-ui-ridgeline-DftROPaX.js → vue-ui-ridgeline-DA8verAe.js} +227 -212
  64. package/dist/{vue-ui-rings-M-9dPI5D.js → vue-ui-rings-Dh6lFqun.js} +214 -202
  65. package/dist/{vue-ui-scatter-CsGhaFJh.js → vue-ui-scatter-CLC5sTOi.js} +270 -256
  66. package/dist/{vue-ui-skeleton-BAOt2neL.js → vue-ui-skeleton-8s4xts8z.js} +3 -3
  67. package/dist/{vue-ui-smiley-7_kIgPg-.js → vue-ui-smiley-utuzw8uI.js} +2 -2
  68. package/dist/{vue-ui-spark-trend-DHlQQpwz.js → vue-ui-spark-trend-BODEqGRr.js} +3 -3
  69. package/dist/{vue-ui-sparkbar-BnHhzuKf.js → vue-ui-sparkbar-B8MB-kn9.js} +3 -3
  70. package/dist/{vue-ui-sparkgauge-WtfkCK8g.js → vue-ui-sparkgauge-CuD7kTS3.js} +3 -3
  71. package/dist/{vue-ui-sparkhistogram-B2u4XLVd.js → vue-ui-sparkhistogram-BYJszvna.js} +4 -4
  72. package/dist/{vue-ui-sparkline-DKIyUlSm.js → vue-ui-sparkline-D77GyWzG.js} +3 -3
  73. package/dist/{vue-ui-sparkstackbar-BLGz2qIb.js → vue-ui-sparkstackbar-DNb1yD64.js} +3 -3
  74. package/dist/{vue-ui-stackbar-BDpMsTYe.js → vue-ui-stackbar-C6rjCYDD.js} +251 -236
  75. package/dist/{vue-ui-strip-plot-5qDcYPnR.js → vue-ui-strip-plot-B6cYojHQ.js} +239 -224
  76. package/dist/{vue-ui-table-Bg5HIQ3O.js → vue-ui-table-IC7SmWVd.js} +3 -3
  77. package/dist/{vue-ui-table-heatmap-DmjNy1q1.js → vue-ui-table-heatmap-DHFpJMpA.js} +5 -5
  78. package/dist/{vue-ui-table-sparkline-CnkJkBk5.js → vue-ui-table-sparkline-D7wz-sCj.js} +4 -4
  79. package/dist/{vue-ui-thermometer-RlD-9mJf.js → vue-ui-thermometer-D-oiVT3n.js} +168 -153
  80. package/dist/{vue-ui-timer-Bes74INL.js → vue-ui-timer-C9jVyX5l.js} +5 -5
  81. package/dist/vue-ui-tiremarks-B1bM9Aoo.js +358 -0
  82. package/dist/{vue-ui-treemap-BG1Omm38.js → vue-ui-treemap-DX48YlU5.js} +374 -362
  83. package/dist/{vue-ui-vertical-bar-CwqQyZFX.js → vue-ui-vertical-bar-6SjKPQWR.js} +252 -237
  84. package/dist/{vue-ui-waffle-Ce3T4BPp.js → vue-ui-waffle-CYao9MMw.js} +232 -220
  85. package/dist/vue-ui-wheel-USuDhMwW.js +352 -0
  86. package/dist/vue-ui-word-cloud-TOBTs7yF.js +659 -0
  87. package/dist/{vue-ui-world-B9PxVO4n.js → vue-ui-world-C2qikqBa.js} +237 -222
  88. package/dist/{vue-ui-xy-DtJ7qJib.js → vue-ui-xy-DxwgKoO-.js} +557 -544
  89. package/dist/{vue-ui-xy-canvas-S6YpFgzs.js → vue-ui-xy-canvas-N69OpVn8.js} +395 -380
  90. package/package.json +1 -1
  91. package/dist/vue-data-ui-B8EWlMIK.js +0 -301
  92. package/dist/vue-ui-tiremarks-DiLS3akQ.js +0 -343
  93. package/dist/vue-ui-wheel-6B0WTkf2.js +0 -337
  94. package/dist/vue-ui-word-cloud-ByYZCOh7.js +0 -644
@@ -0,0 +1,659 @@
1
+ import { useCssVars as Ue, defineAsyncComponent as H, computed as se, ref as g, watch as be, shallowRef as Me, onMounted as De, onBeforeUnmount as Ge, createElementBlock as N, openBlock as T, unref as r, normalizeStyle as he, createBlock as ie, createCommentVNode as Y, createVNode as we, createSlots as Le, withCtx as A, renderSlot as M, normalizeProps as Q, guardReactiveProps as ee, normalizeClass as Pe, createElementVNode as ke, Fragment as He, renderList as je, toDisplayString as ze, createTextVNode as qe, nextTick as Oe } from "vue";
2
+ import { u as Ze, c as Ae, ak as Je, v as Ke, t as Qe, p as me, a as et, o as tt, e as Ie, g as ot, f as at, X as lt, q as nt, r as st, x as it } from "./index-CobsZUkv.js";
3
+ import { t as rt, u as ut, d as ct } from "./useResponsive-DfdjqQps.js";
4
+ import { u as Ne } from "./useNestedProp-BwL5wmVa.js";
5
+ import { u as dt } from "./usePrinter-DPh6U_Qk.js";
6
+ import { u as vt } from "./useUserOptionState-BIvW1Kz7.js";
7
+ import { u as ht } from "./useChartAccessibility-9icAAmYg.js";
8
+ import { u as mt } from "./usePanZoom-BQMvRXEQ.js";
9
+ import ft from "./Title-DpERl1yr.js";
10
+ import pt from "./img-utitT2Gd.js";
11
+ import { _ as gt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
+ function yt(C, p) {
13
+ const { width: u, height: f } = C, m = p.getImageData(0, 0, u, f).data;
14
+ let l = u, a = f, i = 0, x = 0, d = !1;
15
+ for (let h = 0; h < f; h += 1)
16
+ for (let y = 0; y < u; y += 1)
17
+ m[(h * u + y) * 4 + 3] > 1 && (d = !0, y < l && (l = y), y > i && (i = y), h < a && (a = h), h > x && (x = h));
18
+ return d ? [l, a, i, x] : [0, 0, 0, 0];
19
+ }
20
+ function _e({
21
+ word: C,
22
+ fontSize: p,
23
+ pad: u,
24
+ canvas: f,
25
+ ctx: c,
26
+ svg: m
27
+ }) {
28
+ c.save(), c.font = `${m.style && m.style.bold ? "bold " : ""}${p}px Arial`;
29
+ const l = c.measureText(C.name), a = Math.ceil(l.width) + 2 + (u ? u * 2 : 0), i = Math.ceil(p) + 2 + (u ? u * 2 : 0);
30
+ f.width = a, f.height = i, c.clearRect(0, 0, a, i), c.font = `${m.style && m.style.bold ? "bold " : ""}${p}px Arial`, c.textAlign = "center", c.textBaseline = "middle", c.fillStyle = "black", c.fillText(C.name, a / 2, i / 2);
31
+ const d = c.getImageData(0, 0, a, i).data, h = [];
32
+ for (let R = 0; R < i; R += 1)
33
+ for (let E = 0; E < a; E += 1)
34
+ d[(R * a + E) * 4 + 3] > 1 && h.push([E, R]);
35
+ const [y, U, S, _] = yt(f, c);
36
+ return c.restore(), { w: a, h: i, wordMask: h, minX: y, minY: U, maxX: S, maxY: _ };
37
+ }
38
+ function Re({ mask: C, maskW: p, maskH: u, wx: f, wy: c, wordMask: m }) {
39
+ for (let l = 0; l < m.length; l += 1) {
40
+ const a = f + m[l][0], i = c + m[l][1];
41
+ if (a < 0 || i < 0 || a >= p || i >= u || C[i * p + a]) return !1;
42
+ }
43
+ return !0;
44
+ }
45
+ function Xe({ mask: C, maskW: p, maskH: u, wx: f, wy: c, wordMask: m }) {
46
+ for (let l = 0; l < m.length; l += 1) {
47
+ const a = f + m[l][0], i = c + m[l][1];
48
+ a >= 0 && i >= 0 && a < p && i < u && (C[i * p + a] = 1);
49
+ }
50
+ }
51
+ function bt({ wordMask: C, w: p, h: u, dilation: f }) {
52
+ const c = new Set(C.map(([l, a]) => `${l},${a}`)), m = new Set(c);
53
+ for (let [l, a] of C)
54
+ for (let i = -f; i <= f; i += 1)
55
+ for (let x = -f; x <= f; x += 1) {
56
+ if (i === 0 && x === 0) continue;
57
+ const d = l + i, h = a + x;
58
+ d >= 0 && d < p && h >= 0 && h < u && m.add(`${d},${h}`);
59
+ }
60
+ return Array.from(m).map((l) => l.split(",").map(Number));
61
+ }
62
+ function wt({
63
+ words: C,
64
+ proximity: p = 0,
65
+ svg: u,
66
+ strictPixelPadding: f
67
+ }) {
68
+ const { width: c, height: m } = u, l = Math.round(c), a = Math.round(m), i = 1, x = u.minFontSize, d = Math.min(u.maxFontSize, 100), h = C.map((F) => F.value), y = Math.min(...h), U = Math.max(...h), S = new Uint8Array(l * a), _ = document.createElement("canvas"), R = _.getContext("2d", { willReadFrequently: !0 });
69
+ _.width = l, _.height = a;
70
+ const E = 6, re = 2, te = 2, e = 1, G = Math.floor(l / 2), oe = Math.floor(a / 2), ae = [...C].sort((F, z) => z.value - F.value), j = [];
71
+ for (const F of ae) {
72
+ let z = x;
73
+ U !== y && (z = (F.value - y) / (U - y) * (d - x) + x), z = Math.max(x, Math.min(d, z));
74
+ let X = !1, s = z;
75
+ for (; !X && s >= i; ) {
76
+ let { w: V, h: W, wordMask: $, minX: B, minY: q, maxX: Z, maxY: J } = _e({
77
+ word: F,
78
+ fontSize: s,
79
+ pad: p,
80
+ canvas: _,
81
+ ctx: R,
82
+ svg: u
83
+ });
84
+ f && ($ = bt({ wordMask: $, w: V, h: W, dilation: 1 }));
85
+ let O = 0, D = 0;
86
+ for (; O < Math.max(l, a) && !X && D < 1e4; ) {
87
+ for (let v = 0; v < 360; v += E) {
88
+ D += 1;
89
+ const P = Math.round(G + O * Math.cos(v * Math.PI / 180) - V / 2), b = Math.round(oe + O * Math.sin(v * Math.PI / 180) - W / 2);
90
+ if (!(P < 0 || b < 0 || P + V > l || b + W > a) && Re({ mask: S, maskW: l, maskH: a, wx: P, wy: b, wordMask: $ })) {
91
+ j.push({ ...F, x: P - l / 2, y: b - a / 2, fontSize: s, width: V, height: W, angle: 0, minX: B, minY: q, maxX: Z, maxY: J }), Xe({ mask: S, maskW: l, maskH: a, wx: P, wy: b, wordMask: $ }), X = !0;
92
+ break;
93
+ }
94
+ }
95
+ O += re;
96
+ }
97
+ X || (s -= 1);
98
+ }
99
+ if (!X && s < i) {
100
+ s = i;
101
+ const { w: V, h: W, wordMask: $, minX: B, minY: q, maxX: Z, maxY: J } = _e({
102
+ word: F,
103
+ fontSize: s,
104
+ pad: p,
105
+ canvas: _,
106
+ ctx: R,
107
+ svg: u
108
+ });
109
+ let O = 0, D = 0;
110
+ for (; O < Math.max(l, a) && !X && D < 25e3; ) {
111
+ for (let v = 0; v < 360; v += te) {
112
+ D += 1;
113
+ const P = Math.round(G + O * Math.cos(v * Math.PI / 180) - V / 2), b = Math.round(oe + O * Math.sin(v * Math.PI / 180) - W / 2);
114
+ if (!(P < 0 || b < 0 || P + V > l || b + W > a) && Re({ mask: S, maskW: l, maskH: a, wx: P, wy: b, wordMask: $ })) {
115
+ j.push({ ...F, x: P - l / 2, y: b - a / 2, fontSize: s, width: V, height: W, angle: 0, minX: B, minY: q, maxX: Z, maxY: J }), Xe({ mask: S, maskW: l, maskH: a, wx: P, wy: b, wordMask: $ }), X = !0;
116
+ break;
117
+ }
118
+ }
119
+ O += e;
120
+ }
121
+ }
122
+ }
123
+ return j.sort((F, z) => z.fontSize - F.fontSize);
124
+ }
125
+ const kt = ["id"], Ct = ["xmlns", "viewBox"], xt = ["width", "height"], $t = ["transform"], Tt = ["x", "y", "width", "height", "onMouseover"], St = ["fill", "font-weight", "x", "y", "font-size", "transform"], Ft = {
126
+ key: 4,
127
+ class: "vue-data-ui-watermark"
128
+ }, Mt = {
129
+ key: 5,
130
+ "data-dom-to-png-ignore": "",
131
+ class: "reset-wrapper"
132
+ }, Pt = ["innerHTML"], zt = {
133
+ __name: "vue-ui-word-cloud",
134
+ props: {
135
+ config: {
136
+ type: Object,
137
+ default() {
138
+ return {};
139
+ }
140
+ },
141
+ dataset: {
142
+ type: [Array, String],
143
+ default() {
144
+ return [];
145
+ }
146
+ }
147
+ },
148
+ setup(C, { expose: p }) {
149
+ Ue((t) => ({
150
+ "3ca772b1": t.slicerColor
151
+ }));
152
+ const u = H(() => import("./vue-ui-accordion-UewqY6OI.js")), f = H(() => import("./BaseIcon-D9Tz8ARD.js")), c = H(() => import("./DataTable-Dt-TIOyY.js")), m = H(() => import("./PackageVersion-C-4Ee8BQ.js")), l = H(() => import("./PenAndPaper-Cde-wJ3N.js")), a = H(() => import("./Tooltip-DA0bYKFG.js")), i = H(() => import("./UserOptions-DTEJ3UM_.js")), { vue_ui_word_cloud: x } = Ze(), d = C, h = se({
153
+ get() {
154
+ return !!d.dataset && d.dataset.length;
155
+ },
156
+ set(t) {
157
+ return t;
158
+ }
159
+ }), y = g(Ae()), U = g(0), S = g(null), _ = g(null), R = g(null), E = g(0), re = g(0), te = g(!1), e = se({
160
+ get: () => X(),
161
+ set: (t) => t
162
+ }), G = g(oe());
163
+ function oe() {
164
+ return typeof d.dataset == "string" ? Je(d.dataset) : d.dataset.map((t, n) => ({
165
+ ...t,
166
+ value: Ke(t.value)
167
+ }));
168
+ }
169
+ be(() => d.dataset, () => {
170
+ G.value = oe(), fe();
171
+ });
172
+ const { userOptionsVisible: ae, setUserOptionsVisibility: j, keepUserOptionState: F } = vt({ config: e.value }), { svgRef: z } = ht({ config: e.value.style.chart.title });
173
+ function X() {
174
+ const t = Ne({
175
+ userConfig: d.config,
176
+ defaultConfig: x
177
+ });
178
+ return t.theme ? {
179
+ ...Ne({
180
+ userConfig: et.vue_ui_word_cloud[t.theme] || d.config,
181
+ defaultConfig: t
182
+ }),
183
+ customPalette: Qe[t.theme] || me
184
+ } : t;
185
+ }
186
+ be(() => d.config, (t) => {
187
+ e.value = X(), ae.value = !e.value.userOptions.showOnChartHover, q(), E.value += 1, re.value += 1, v.value.showTable = e.value.table.show, v.value.showTooltip = e.value.style.chart.tooltip.show;
188
+ }, { deep: !0 });
189
+ const s = g({
190
+ width: e.value.style.chart.width,
191
+ height: e.value.style.chart.height,
192
+ maxFontSize: e.value.style.chart.words.maxFontSize,
193
+ minFontSize: e.value.style.chart.words.minFontSize,
194
+ bold: e.value.style.chart.words.bold
195
+ }), V = ct(() => {
196
+ fe();
197
+ }, 10), W = rt(() => {
198
+ const { width: t, height: n } = ut({
199
+ chart: S.value,
200
+ title: e.value.style.chart.title.text ? _.value : null,
201
+ source: R.value
202
+ });
203
+ requestAnimationFrame(() => {
204
+ s.value.width = t, s.value.height = n, Oe(V);
205
+ });
206
+ }), $ = Me(null), B = Me(null);
207
+ De(q);
208
+ function q() {
209
+ tt(d.dataset) ? Ie({
210
+ componentName: "VueUiWordCloud",
211
+ type: "dataset"
212
+ }) : G.value.forEach((t, n) => {
213
+ ot({
214
+ datasetObject: t,
215
+ requiredAttributes: ["name", "value"]
216
+ }).forEach((o) => {
217
+ h.value = !1, Ie({
218
+ componentName: "VueUiWordCloud",
219
+ type: "datasetSerieAttribute",
220
+ property: o,
221
+ index: n
222
+ });
223
+ });
224
+ }), e.value.responsive && ($.value && (B.value && $.value.unobserve(B.value), $.value.disconnect()), $.value = new ResizeObserver(W), B.value = S.value.parentNode, $.value.observe(B.value));
225
+ }
226
+ Ge(() => {
227
+ $.value && (B.value && $.value.unobserve(B.value), $.value.disconnect());
228
+ });
229
+ const { isPrinting: Z, isImaging: J, generatePdf: O, generateImage: D } = dt({
230
+ elementId: `wordCloud_${y.value}`,
231
+ fileName: e.value.style.chart.title.text || "vue-ui-word-cloud",
232
+ options: e.value.userOptions.print
233
+ }), v = g({
234
+ showTable: e.value.table.show,
235
+ showTooltip: e.value.style.chart.tooltip.show
236
+ });
237
+ function P(t, n, o = "Arial") {
238
+ const k = document.createElement("canvas").getContext("2d");
239
+ return k.font = `${n}px ${e.value.style.chart.words.bold ? "bold" : "normal"} ${o}`, {
240
+ width: k.measureText(t).width + e.value.style.chart.words.proximity,
241
+ height: n
242
+ };
243
+ }
244
+ const b = g([]);
245
+ be(() => d.dataset, fe, { immediate: !0 });
246
+ function fe() {
247
+ const t = [...G.value].map((k) => k.value), n = Math.max(...t), o = Math.min(...t), w = [...G.value].map((k, I) => {
248
+ let L = (k.value - o) / (n - o) * (s.value.maxFontSize - s.value.minFontSize) + s.value.minFontSize;
249
+ L = isNaN(L) ? s.value.minFontSize : L;
250
+ const Fe = P(k.name, L);
251
+ return {
252
+ ...k,
253
+ id: Ae(),
254
+ fontSize: L,
255
+ width: Fe.width,
256
+ height: Fe.height,
257
+ color: e.value.style.chart.words.usePalette ? e.value.customPalette[I] || e.value.customPalette[I % e.value.customPalette.length] || me[I] || me[I % me.length] : e.value.style.chart.words.color
258
+ };
259
+ });
260
+ b.value = wt({
261
+ words: w,
262
+ svg: s.value,
263
+ proximity: e.value.style.chart.words.proximity,
264
+ strictPixelPadding: e.value.strictPixelPadding
265
+ });
266
+ }
267
+ const ue = se(() => {
268
+ const t = b.value.map((o) => ({
269
+ name: o.name,
270
+ color: o.color
271
+ })), n = b.value.map((o) => o.value);
272
+ return { head: t, body: n };
273
+ });
274
+ function Ce(t = null) {
275
+ Oe(() => {
276
+ const n = ue.value.head.map((k, I) => [[
277
+ k.name
278
+ ], [ue.value.body[I]]]), o = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], [e.value.table.columnNames.value]]].concat(n), w = nt(o);
279
+ t ? t(w) : st({ csvContent: w, title: e.value.style.chart.title.text || "vue-ui-word-cloud" });
280
+ });
281
+ }
282
+ const ce = se(() => {
283
+ const t = [
284
+ e.value.table.columnNames.series,
285
+ e.value.table.columnNames.value
286
+ ], n = ue.value.head.map((k, I) => {
287
+ const L = at({ p: e.value.table.td.prefix, v: ue.value.body[I], s: e.value.table.td.suffix, r: e.value.table.td.roundingValue });
288
+ return [
289
+ {
290
+ color: k.color,
291
+ name: k.name
292
+ },
293
+ L
294
+ ];
295
+ }), o = {
296
+ th: {
297
+ backgroundColor: e.value.table.th.backgroundColor,
298
+ color: e.value.table.th.color,
299
+ outline: e.value.table.th.outline
300
+ },
301
+ td: {
302
+ backgroundColor: e.value.table.td.backgroundColor,
303
+ color: e.value.table.td.color,
304
+ outline: e.value.table.td.outline
305
+ },
306
+ breakpoint: e.value.table.responsiveBreakpoint
307
+ };
308
+ return {
309
+ colNames: [
310
+ e.value.table.columnNames.series,
311
+ e.value.table.columnNames.value
312
+ ],
313
+ head: t,
314
+ body: n,
315
+ config: o
316
+ };
317
+ }), de = g(!1);
318
+ function xe(t) {
319
+ de.value = t, U.value += 1;
320
+ }
321
+ function Ve() {
322
+ return b.value;
323
+ }
324
+ function $e() {
325
+ v.value.showTable = !v.value.showTable;
326
+ }
327
+ function Te() {
328
+ v.value.showTooltip = !v.value.showTooltip;
329
+ }
330
+ const le = g(!1);
331
+ function pe() {
332
+ le.value = !le.value;
333
+ }
334
+ const We = se(() => !le.value && e.value.style.chart.zoom.show), { viewBox: ve, resetZoom: Se, isZoom: Be } = mt(z, {
335
+ x: 0,
336
+ y: 0,
337
+ width: s.value.width <= 0 ? 10 : s.value.width,
338
+ height: s.value.height <= 0 ? 10 : s.value.height
339
+ }, 1, We);
340
+ async function Ye({ scale: t = 2 } = {}) {
341
+ if (!S.value) return;
342
+ const { width: n, height: o } = S.value.getBoundingClientRect(), w = n / o, { imageUri: k, base64: I } = await pt({ domElement: S.value, base64: !0, img: !0, scale: t });
343
+ return {
344
+ imageUri: k,
345
+ base64: I,
346
+ title: e.value.style.chart.title.text,
347
+ width: n,
348
+ height: o,
349
+ aspectRatio: w
350
+ };
351
+ }
352
+ p({
353
+ getData: Ve,
354
+ getImage: Ye,
355
+ generateCsv: Ce,
356
+ generatePdf: O,
357
+ generateImage: D,
358
+ toggleTable: $e,
359
+ toggleTooltip: Te,
360
+ toggleAnnotator: pe,
361
+ toggleFullscreen: xe
362
+ });
363
+ const K = g(null), ne = g(!1), ge = g(""), ye = g(null);
364
+ function Ee(t) {
365
+ if (!v.value.showTooltip) return;
366
+ K.value = t.id, ye.value = { datapoint: t, config: e.value };
367
+ const n = e.value.style.chart.tooltip.customFormat;
368
+ if (ne.value = !1, it(n))
369
+ try {
370
+ const o = n({
371
+ datapoint: t,
372
+ config: e.value
373
+ });
374
+ typeof o == "string" && (ge.value = o, ne.value = !0);
375
+ } catch {
376
+ console.warn("Custom format cannot be applied."), ne.value = !1;
377
+ }
378
+ if (!ne.value) {
379
+ 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>`;
380
+ ge.value = `<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${o}</div>`;
381
+ }
382
+ te.value = !0;
383
+ }
384
+ return (t, n) => (T(), N("div", {
385
+ class: "vue-ui-word-cloud",
386
+ ref_key: "wordCloudChart",
387
+ ref: S,
388
+ id: `wordCloud_${y.value}`,
389
+ style: he(`width: 100%; font-family:${e.value.style.fontFamily};background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
390
+ onMouseenter: n[3] || (n[3] = () => r(j)(!0)),
391
+ onMouseleave: n[4] || (n[4] = () => r(j)(!1))
392
+ }, [
393
+ e.value.userOptions.buttons.annotator ? (T(), ie(r(l), {
394
+ key: 0,
395
+ svgRef: r(z),
396
+ backgroundColor: e.value.style.chart.backgroundColor,
397
+ color: e.value.style.chart.color,
398
+ active: le.value,
399
+ onClose: pe
400
+ }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : Y("", !0),
401
+ e.value.style.chart.title.text ? (T(), N("div", {
402
+ key: 1,
403
+ ref_key: "chartTitle",
404
+ ref: _,
405
+ style: "width:100%;background:transparent;padding-bottom:24px"
406
+ }, [
407
+ (T(), ie(ft, {
408
+ key: `title_${E.value}`,
409
+ config: {
410
+ title: {
411
+ ...e.value.style.chart.title
412
+ },
413
+ subtitle: {
414
+ ...e.value.style.chart.title.subtitle
415
+ }
416
+ }
417
+ }, null, 8, ["config"]))
418
+ ], 512)) : Y("", !0),
419
+ e.value.userOptions.show && h.value && (r(F) || r(ae)) ? (T(), ie(r(i), {
420
+ ref: "details",
421
+ key: `user_option_${U.value}`,
422
+ backgroundColor: e.value.style.chart.backgroundColor,
423
+ color: e.value.style.chart.color,
424
+ isPrinting: r(Z),
425
+ isImaging: r(J),
426
+ uid: y.value,
427
+ hasPdf: e.value.userOptions.buttons.pdf,
428
+ hasXls: e.value.userOptions.buttons.csv,
429
+ hasImg: e.value.userOptions.buttons.img,
430
+ hasTable: e.value.userOptions.buttons.table,
431
+ hasFullscreen: e.value.userOptions.buttons.fullscreen,
432
+ isFullscreen: de.value,
433
+ titles: { ...e.value.userOptions.buttonTitles },
434
+ chartElement: S.value,
435
+ position: e.value.userOptions.position,
436
+ hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
437
+ isTooltip: v.value.showTooltip,
438
+ hasAnnotator: e.value.userOptions.buttons.annotator,
439
+ isAnnotation: le.value,
440
+ callbacks: e.value.userOptions.callbacks,
441
+ printScale: e.value.userOptions.print.scale,
442
+ onToggleFullscreen: xe,
443
+ onGeneratePdf: r(O),
444
+ onGenerateCsv: Ce,
445
+ onGenerateImage: r(D),
446
+ onToggleTable: $e,
447
+ onToggleTooltip: Te,
448
+ onToggleAnnotator: pe,
449
+ style: he({
450
+ visibility: r(F) ? r(ae) ? "visible" : "hidden" : "visible"
451
+ })
452
+ }, Le({ _: 2 }, [
453
+ t.$slots.menuIcon ? {
454
+ name: "menuIcon",
455
+ fn: A(({ isOpen: o, color: w }) => [
456
+ M(t.$slots, "menuIcon", Q(ee({ isOpen: o, color: w })), void 0, !0)
457
+ ]),
458
+ key: "0"
459
+ } : void 0,
460
+ t.$slots.optionPdf ? {
461
+ name: "optionPdf",
462
+ fn: A(() => [
463
+ M(t.$slots, "optionPdf", {}, void 0, !0)
464
+ ]),
465
+ key: "1"
466
+ } : void 0,
467
+ t.$slots.optionCsv ? {
468
+ name: "optionCsv",
469
+ fn: A(() => [
470
+ M(t.$slots, "optionCsv", {}, void 0, !0)
471
+ ]),
472
+ key: "2"
473
+ } : void 0,
474
+ t.$slots.optionImg ? {
475
+ name: "optionImg",
476
+ fn: A(() => [
477
+ M(t.$slots, "optionImg", {}, void 0, !0)
478
+ ]),
479
+ key: "3"
480
+ } : void 0,
481
+ t.$slots.optionTable ? {
482
+ name: "optionTable",
483
+ fn: A(() => [
484
+ M(t.$slots, "optionTable", {}, void 0, !0)
485
+ ]),
486
+ key: "4"
487
+ } : void 0,
488
+ t.$slots.optionFullscreen ? {
489
+ name: "optionFullscreen",
490
+ fn: A(({ toggleFullscreen: o, isFullscreen: w }) => [
491
+ M(t.$slots, "optionFullscreen", Q(ee({ toggleFullscreen: o, isFullscreen: w })), void 0, !0)
492
+ ]),
493
+ key: "5"
494
+ } : void 0,
495
+ t.$slots.optionAnnotator ? {
496
+ name: "optionAnnotator",
497
+ fn: A(({ toggleAnnotator: o, isAnnotator: w }) => [
498
+ M(t.$slots, "optionAnnotator", Q(ee({ toggleAnnotator: o, isAnnotator: w })), void 0, !0)
499
+ ]),
500
+ key: "6"
501
+ } : void 0
502
+ ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasTooltip", "isTooltip", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : Y("", !0),
503
+ h.value ? (T(), N("svg", {
504
+ key: 3,
505
+ ref_key: "svgRef",
506
+ ref: z,
507
+ class: Pe({ "vue-data-ui-fullscreen--on": de.value, "vue-data-ui-fulscreen--off": !de.value }),
508
+ xmlns: r(lt),
509
+ viewBox: `${r(ve).x} ${r(ve).y} ${r(ve).width} ${r(ve).height}`,
510
+ style: "overflow:hidden;background:transparent;"
511
+ }, [
512
+ we(r(m)),
513
+ t.$slots["chart-background"] ? (T(), N("foreignObject", {
514
+ key: 0,
515
+ x: 0,
516
+ y: 0,
517
+ width: s.value.width <= 0 ? 10 : s.value.width,
518
+ height: s.value.height <= 0 ? 10 : s.value.height,
519
+ style: {
520
+ pointerEvents: "none"
521
+ }
522
+ }, [
523
+ M(t.$slots, "chart-background", {}, void 0, !0)
524
+ ], 8, xt)) : Y("", !0),
525
+ ke("g", {
526
+ transform: `translate(${(s.value.width <= 0 ? 10 : s.value.width) / 2}, ${(s.value.height <= 0 ? 10 : s.value.height) / 2})`
527
+ }, [
528
+ (T(!0), N(He, null, je(b.value, (o, w) => (T(), N("g", null, [
529
+ o.minX !== void 0 ? (T(), N("rect", {
530
+ key: 0,
531
+ x: o.x + o.minX,
532
+ y: o.y + o.minY * 1.25,
533
+ width: o.maxX - o.minX,
534
+ height: o.maxY - o.minY,
535
+ fill: "transparent",
536
+ "pointer-events": "visiblePainted",
537
+ onMouseover: (k) => Ee(o),
538
+ onMouseleave: n[0] || (n[0] = (k) => {
539
+ K.value = null, te.value = !1;
540
+ })
541
+ }, null, 40, Tt)) : Y("", !0),
542
+ (T(), N("text", {
543
+ fill: o.color,
544
+ "font-weight": e.value.style.chart.words.bold ? "bold" : "normal",
545
+ key: w,
546
+ x: o.x,
547
+ y: o.y,
548
+ "font-size": o.fontSize,
549
+ transform: `translate(${o.width / 2}, ${o.height / 2})`,
550
+ class: Pe({ 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 }),
551
+ "text-anchor": "middle",
552
+ "dominant-baseline": "central",
553
+ style: he(`animation-delay:${w * e.value.animationDelayMs}ms !important; pointer-events:none;`)
554
+ }, ze(o.name), 15, St))
555
+ ]))), 256))
556
+ ], 8, $t),
557
+ M(t.$slots, "svg", {
558
+ svg: { height: s.value.height, width: s.value.width }
559
+ }, void 0, !0)
560
+ ], 10, Ct)) : Y("", !0),
561
+ t.$slots.watermark ? (T(), N("div", Ft, [
562
+ M(t.$slots, "watermark", Q(ee({ isPrinting: r(Z) || r(J) })), void 0, !0)
563
+ ])) : Y("", !0),
564
+ r(Be) ? (T(), N("div", Mt, [
565
+ M(t.$slots, "reset-action", { reset: r(Se) }, () => [
566
+ ke("button", {
567
+ "data-cy-reset": "",
568
+ tabindex: "0",
569
+ role: "button",
570
+ class: "vue-data-ui-refresh-button",
571
+ style: he({
572
+ background: e.value.style.chart.backgroundColor
573
+ }),
574
+ onClick: n[1] || (n[1] = (o) => r(Se)(!0))
575
+ }, [
576
+ we(r(f), {
577
+ name: "refresh",
578
+ stroke: e.value.style.chart.color
579
+ }, null, 8, ["stroke"])
580
+ ], 4)
581
+ ], !0)
582
+ ])) : Y("", !0),
583
+ we(r(a), {
584
+ show: v.value.showTooltip && te.value,
585
+ backgroundColor: e.value.style.chart.tooltip.backgroundColor,
586
+ color: e.value.style.chart.tooltip.color,
587
+ fontSize: e.value.style.chart.tooltip.fontSize,
588
+ borderRadius: e.value.style.chart.tooltip.borderRadius,
589
+ borderColor: e.value.style.chart.tooltip.borderColor,
590
+ borderWidth: e.value.style.chart.tooltip.borderWidth,
591
+ backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
592
+ position: e.value.style.chart.tooltip.position,
593
+ offsetY: e.value.style.chart.tooltip.offsetY,
594
+ parent: S.value,
595
+ content: ge.value,
596
+ isCustom: ne.value
597
+ }, {
598
+ "tooltip-before": A(() => [
599
+ M(t.$slots, "tooltip-before", Q(ee({ ...ye.value })), void 0, !0)
600
+ ]),
601
+ "tooltip-after": A(() => [
602
+ M(t.$slots, "tooltip-after", Q(ee({ ...ye.value })), void 0, !0)
603
+ ]),
604
+ _: 3
605
+ }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"]),
606
+ t.$slots.source ? (T(), N("div", {
607
+ key: 6,
608
+ ref_key: "source",
609
+ ref: R,
610
+ dir: "auto"
611
+ }, [
612
+ M(t.$slots, "source", {}, void 0, !0)
613
+ ], 512)) : Y("", !0),
614
+ h.value ? (T(), ie(r(u), {
615
+ key: 7,
616
+ hideDetails: "",
617
+ config: {
618
+ open: v.value.showTable,
619
+ maxHeight: 1e4,
620
+ body: {
621
+ backgroundColor: e.value.style.chart.backgroundColor,
622
+ color: e.value.style.chart.color
623
+ },
624
+ head: {
625
+ backgroundColor: e.value.style.chart.backgroundColor,
626
+ color: e.value.style.chart.color
627
+ }
628
+ }
629
+ }, {
630
+ content: A(() => [
631
+ (T(), ie(r(c), {
632
+ key: `table_${re.value}`,
633
+ colNames: ce.value.colNames,
634
+ head: ce.value.head,
635
+ body: ce.value.body,
636
+ config: ce.value.config,
637
+ title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
638
+ onClose: n[2] || (n[2] = (o) => v.value.showTable = !1)
639
+ }, {
640
+ th: A(({ th: o }) => [
641
+ ke("div", {
642
+ innerHTML: o,
643
+ style: { display: "flex", "align-items": "center" }
644
+ }, null, 8, Pt)
645
+ ]),
646
+ td: A(({ td: o }) => [
647
+ qe(ze(o.name || o), 1)
648
+ ]),
649
+ _: 1
650
+ }, 8, ["colNames", "head", "body", "config", "title"]))
651
+ ]),
652
+ _: 1
653
+ }, 8, ["config"])) : Y("", !0)
654
+ ], 44, kt));
655
+ }
656
+ }, Et = /* @__PURE__ */ gt(zt, [["__scopeId", "data-v-1c33b161"]]);
657
+ export {
658
+ Et as default
659
+ };