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