vue-data-ui 3.0.0-next.9 → 3.0.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 (144) hide show
  1. package/README.md +32 -30
  2. package/dist/{Arrow-B6OlqyCG.js → Arrow-DQoWnUfD.js} +1 -1
  3. package/dist/{BaseDraggableDialog-CA8QOk7L.js → BaseDraggableDialog-DEw6oieL.js} +4 -4
  4. package/dist/{BaseIcon-DxUUKVlt.js → BaseIcon-DEl03NUZ.js} +1 -1
  5. package/dist/{ColorPicker-Bh1dfgXt.js → ColorPicker-CrivFZqC.js} +2 -2
  6. package/dist/{DataTable--paavNqF.js → DataTable-ClgCsiJA.js} +2 -2
  7. package/dist/{Legend-BZ06qU55.js → Legend-CMvJ6X5j.js} +2 -2
  8. package/dist/{NonSvgPenAndPaper-DN9XjEHv.js → NonSvgPenAndPaper-B2Wvbl3p.js} +3 -3
  9. package/dist/{PackageVersion-2QvaZf9_.js → PackageVersion-CD5VH_Al.js} +3 -3
  10. package/dist/{PenAndPaper-hGgW0EHz.js → PenAndPaper-D3WRn-G2.js} +32 -32
  11. package/dist/{RecursiveCircles-Dn3TGoL6.js → RecursiveCircles-BcLb1aRS.js} +15 -13
  12. package/dist/RecursiveLabels-Bgcv0pzu.js +50 -0
  13. package/dist/{RecursiveLinks-ld_gDZH4.js → RecursiveLinks-00zGWPf9.js} +20 -18
  14. package/dist/{Shape-Mr1eIp_G.js → Shape-Adi9i_-f.js} +43 -37
  15. package/dist/Slicer-t6e1t2iM.js +602 -0
  16. package/dist/{SparkTooltip-Czhz446b.js → SparkTooltip-B8OnBSvk.js} +7 -7
  17. package/dist/{Title-B2dA6-uH.js → Title-xTWR-Vil.js} +1 -1
  18. package/dist/{Tooltip-O_hCvqgF.js → Tooltip-BH3CiANh.js} +23 -19
  19. package/dist/{UserOptions-Bk03FRqW.js → UserOptions-CKKPgDLV.js} +2 -2
  20. package/dist/{dom-to-png-Bt5F9TXw.js → dom-to-png-C4hj491O.js} +1 -1
  21. package/dist/{img-C_9wps3s.js → img-Vb4QHAHI.js} +1 -1
  22. package/dist/{index-CgShIRes.js → index-Dzc2Gi60.js} +2885 -2010
  23. package/dist/{pdf-CXdbjyRJ.js → pdf-ddpqw-dt.js} +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/types/vue-data-ui.d.cts +753 -65
  26. package/dist/types/vue-data-ui.d.ts +753 -65
  27. package/dist/useAutoSizeLabelsInsideViewbox-CN_Jh8Hr.js +81 -0
  28. package/dist/useFitSvgText-2crs6Fv5.js +69 -0
  29. package/dist/useLoading-D7YHNtLX.js +29 -0
  30. package/dist/useNestedProp-CjnS13nF.js +13 -0
  31. package/dist/usePanZoom-BVca3eMk.js +122 -0
  32. package/dist/{usePrinter-rIrqBbbm.js → usePrinter-DBRh8ZvS.js} +2 -2
  33. package/dist/useTimeLabelCollider-CIsgDrl9.js +78 -0
  34. package/dist/{useTimeLabels-DG97x2hL.js → useTimeLabels-DkzmKfZn.js} +208 -156
  35. package/dist/{vue-data-ui-DiwfJSwC.js → vue-data-ui-B7ztqj9-.js} +105 -100
  36. package/dist/vue-data-ui.js +26 -25
  37. package/dist/vue-ui-3d-bar-DUmYPtHl.js +1323 -0
  38. package/dist/{vue-ui-accordion-hlzscmAS.js → vue-ui-accordion-CPk8wAuj.js} +3 -3
  39. package/dist/vue-ui-age-pyramid-Bv5HmeXj.js +835 -0
  40. package/dist/{vue-ui-annotator-BHwBUNRO.js → vue-ui-annotator-KXWlIhtd.js} +12 -12
  41. package/dist/vue-ui-bullet-B4N4mBk9.js +571 -0
  42. package/dist/vue-ui-candlestick-DENvPnUO.js +1000 -0
  43. package/dist/{vue-ui-carousel-table-6MTDYf-H.js → vue-ui-carousel-table-vC2bHBaY.js} +29 -29
  44. package/dist/{vue-ui-chestnut-Cr6dK21e.js → vue-ui-chestnut-2nS0StrY.js} +664 -536
  45. package/dist/vue-ui-chord-CyfS6vNM.js +1038 -0
  46. package/dist/vue-ui-circle-pack-C4JR-0fx.js +709 -0
  47. package/dist/{vue-ui-cursor-Ch5yUxNn.js → vue-ui-cursor-BgeSDtQh.js} +2 -2
  48. package/dist/{vue-ui-dashboard-tVZ9aEHo.js → vue-ui-dashboard-9DWUBJ-I.js} +64 -64
  49. package/dist/{vue-ui-digits-BOlYLluF.js → vue-ui-digits-BQO7IBFA.js} +2 -2
  50. package/dist/{vue-ui-donut-BKwAnTKA.js → vue-ui-donut-C-ZJXJ74.js} +431 -422
  51. package/dist/vue-ui-donut-evolution-B870IrQA.js +1076 -0
  52. package/dist/vue-ui-dumbbell-Cfs2Uotx.js +1120 -0
  53. package/dist/vue-ui-flow-DnaUVVAD.js +841 -0
  54. package/dist/{vue-ui-funnel-CAV6A--C.js → vue-ui-funnel-B9s-H5ZG.js} +16 -16
  55. package/dist/vue-ui-galaxy-BoJOczdh.js +680 -0
  56. package/dist/vue-ui-gauge-qjm4BqZR.js +791 -0
  57. package/dist/vue-ui-gizmo-fn7ZaMTI.js +210 -0
  58. package/dist/vue-ui-heatmap-CIBDKhh8.js +1078 -0
  59. package/dist/vue-ui-history-plot-bbNxldYG.js +1074 -0
  60. package/dist/{vue-ui-kpi-DjHXc1Z9.js → vue-ui-kpi-BX-2jhLx.js} +26 -26
  61. package/dist/{vue-ui-mini-loader-C68r9wbr.js → vue-ui-mini-loader-Bn1Bb8-J.js} +2 -2
  62. package/dist/vue-ui-molecule-DQ3qFtBq.js +656 -0
  63. package/dist/vue-ui-mood-radar-Cf-ehIo1.js +785 -0
  64. package/dist/vue-ui-nested-donuts-CWg5BEi-.js +1284 -0
  65. package/dist/vue-ui-onion-sHgQTYfa.js +776 -0
  66. package/dist/vue-ui-parallel-coordinate-plot-Ki3ITp_s.js +916 -0
  67. package/dist/{vue-ui-quadrant-ULvVhjjq.js → vue-ui-quadrant-BIVqW7U7.js} +512 -459
  68. package/dist/vue-ui-quick-chart-C_hvHc1b.js +1762 -0
  69. package/dist/vue-ui-radar-RZUPyPwB.js +796 -0
  70. package/dist/{vue-ui-rating-CkdVnYpj.js → vue-ui-rating-BI8Vk7dO.js} +2 -2
  71. package/dist/vue-ui-relation-circle-TVMUEtxK.js +598 -0
  72. package/dist/vue-ui-ridgeline-DQeXHQG4.js +1157 -0
  73. package/dist/vue-ui-rings-BH81WmMS.js +728 -0
  74. package/dist/vue-ui-scatter-Cy7Tz_An.js +1178 -0
  75. package/dist/{vue-ui-skeleton-BsBaCvoE.js → vue-ui-skeleton-CF50qQxr.js} +13 -13
  76. package/dist/{vue-ui-smiley-B2sBY2Q-.js → vue-ui-smiley-CrFXEbJs.js} +46 -46
  77. package/dist/vue-ui-spark-trend-DtHArnot.js +315 -0
  78. package/dist/vue-ui-sparkbar-CIOwFFgA.js +351 -0
  79. package/dist/vue-ui-sparkgauge-E0DdGotz.js +232 -0
  80. package/dist/vue-ui-sparkhistogram-Dm7WoyjY.js +380 -0
  81. package/dist/vue-ui-sparkline-DoW6DDKT.js +513 -0
  82. package/dist/vue-ui-sparkstackbar-BJnPUWY4.js +421 -0
  83. package/dist/vue-ui-stackbar-Du42smPs.js +1371 -0
  84. package/dist/vue-ui-strip-plot-DnenGI-d.js +916 -0
  85. package/dist/{vue-ui-table-DaE8lQuo.js → vue-ui-table-BQOQVlHr.js} +17 -17
  86. package/dist/{vue-ui-table-heatmap--dSEG8cU.js → vue-ui-table-heatmap-BzK4_gsP.js} +5 -5
  87. package/dist/{vue-ui-table-sparkline-D4DkGvDP.js → vue-ui-table-sparkline-B-IwcT8I.js} +19 -16
  88. package/dist/vue-ui-thermometer-06ao_Pj5.js +541 -0
  89. package/dist/{vue-ui-timer-CYXTAh6x.js → vue-ui-timer-CxQq4roK.js} +5 -5
  90. package/dist/vue-ui-tiremarks-CuTxkByj.js +406 -0
  91. package/dist/vue-ui-treemap-BgHhRpiV.js +1035 -0
  92. package/dist/{vue-ui-vertical-bar-CO9eR1ty.js → vue-ui-vertical-bar-CAcsUUCo.js} +104 -102
  93. package/dist/vue-ui-waffle-Ct3Upw3m.js +910 -0
  94. package/dist/vue-ui-wheel-oz06Kt-p.js +379 -0
  95. package/dist/vue-ui-word-cloud-BRy7fg4S.js +765 -0
  96. package/dist/{vue-ui-world-P45Plcqw.js → vue-ui-world-CTV-YfFN.js} +364 -327
  97. package/dist/vue-ui-xy-DqCy9dpa.js +3808 -0
  98. package/dist/{vue-ui-xy-canvas-DgNBgUak.js → vue-ui-xy-canvas-BZdhKUIp.js} +265 -264
  99. package/package.json +4 -4
  100. package/dist/RecursiveLabels-NTMB9w5C.js +0 -49
  101. package/dist/Slicer-3t0HimeE.js +0 -577
  102. package/dist/useLoading-Bt5Doa8m.js +0 -28
  103. package/dist/useNestedProp-BC4Ciblw.js +0 -13
  104. package/dist/usePanZoom-BQMvRXEQ.js +0 -115
  105. package/dist/vue-ui-3d-bar-BqmzX9u4.js +0 -1227
  106. package/dist/vue-ui-age-pyramid-eRPt0BJb.js +0 -746
  107. package/dist/vue-ui-bullet-BSnF2gql.js +0 -513
  108. package/dist/vue-ui-candlestick-kMbNnoYe.js +0 -873
  109. package/dist/vue-ui-chord-Dxy_bfIE.js +0 -949
  110. package/dist/vue-ui-circle-pack-I_p4FPiW.js +0 -673
  111. package/dist/vue-ui-donut-evolution-DQhZJ4Sa.js +0 -903
  112. package/dist/vue-ui-dumbbell-DdN-7b3g.js +0 -753
  113. package/dist/vue-ui-flow-MvORTthN.js +0 -765
  114. package/dist/vue-ui-galaxy-B0PLMAn8.js +0 -617
  115. package/dist/vue-ui-gauge-C4FTzDFt.js +0 -738
  116. package/dist/vue-ui-gizmo-Dl5FHFb4.js +0 -192
  117. package/dist/vue-ui-heatmap-C3dee43W.js +0 -877
  118. package/dist/vue-ui-history-plot-dqv4u1Oa.js +0 -924
  119. package/dist/vue-ui-molecule-DtRAlfhC.js +0 -597
  120. package/dist/vue-ui-mood-radar-BZj2G0zE.js +0 -670
  121. package/dist/vue-ui-nested-donuts-OqJTwMb2.js +0 -1212
  122. package/dist/vue-ui-onion-DXLokGec.js +0 -701
  123. package/dist/vue-ui-parallel-coordinate-plot-tg7QhtIE.js +0 -807
  124. package/dist/vue-ui-quick-chart-4EODniQ3.js +0 -1612
  125. package/dist/vue-ui-radar-Dt5p5oSy.js +0 -741
  126. package/dist/vue-ui-relation-circle-_SysXj9T.js +0 -542
  127. package/dist/vue-ui-ridgeline-Cs5UihNN.js +0 -969
  128. package/dist/vue-ui-rings-Duay-EmS.js +0 -685
  129. package/dist/vue-ui-scatter-C6oGQcbL.js +0 -1045
  130. package/dist/vue-ui-spark-trend-CEAqGu3d.js +0 -291
  131. package/dist/vue-ui-sparkbar-ByPUDc6x.js +0 -301
  132. package/dist/vue-ui-sparkgauge-C-GKwevJ.js +0 -201
  133. package/dist/vue-ui-sparkhistogram-Dz0DdaVW.js +0 -313
  134. package/dist/vue-ui-sparkline-BULntz_U.js +0 -459
  135. package/dist/vue-ui-sparkstackbar-DXjHOeeU.js +0 -381
  136. package/dist/vue-ui-stackbar-CeP9n7zy.js +0 -1207
  137. package/dist/vue-ui-strip-plot-CaFQkWV8.js +0 -761
  138. package/dist/vue-ui-thermometer-BXf14CYH.js +0 -495
  139. package/dist/vue-ui-tiremarks-D6hJ1cd4.js +0 -358
  140. package/dist/vue-ui-treemap-tBurCrdn.js +0 -965
  141. package/dist/vue-ui-waffle-BNzs_BxY.js +0 -863
  142. package/dist/vue-ui-wheel-tydUATi8.js +0 -352
  143. package/dist/vue-ui-word-cloud-DUUc_tj6.js +0 -659
  144. package/dist/vue-ui-xy--HToGdle.js +0 -2982
@@ -1,659 +0,0 @@
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, al 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-CgShIRes.js";
3
- import { t as rt, u as ut, d as ct } from "./useResponsive-DfdjqQps.js";
4
- import { u as Ne } from "./useNestedProp-BC4Ciblw.js";
5
- import { u as dt } from "./usePrinter-rIrqBbbm.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-B2dA6-uH.js";
10
- import pt from "./img-C_9wps3s.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
- "50cddfce": t.slicerColor
151
- }));
152
- const u = H(() => import("./vue-ui-accordion-hlzscmAS.js")), f = H(() => import("./BaseIcon-DxUUKVlt.js")), c = H(() => import("./DataTable--paavNqF.js")), m = H(() => import("./PackageVersion-2QvaZf9_.js")), l = H(() => import("./PenAndPaper-hGgW0EHz.js")), a = H(() => import("./Tooltip-O_hCvqgF.js")), i = H(() => import("./UserOptions-Bk03FRqW.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-8c6de0fa"]]);
657
- export {
658
- Et as default
659
- };