vue-data-ui 3.0.0-next.57 → 3.0.0-next.59

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/dist/{Arrow-D6qi05Xe.js → Arrow-Cy3DXLKh.js} +1 -1
  2. package/dist/{BaseDraggableDialog-CQyUv5Af.js → BaseDraggableDialog-BMX7Vs05.js} +2 -2
  3. package/dist/{BaseIcon-3PL8sPji.js → BaseIcon-CY5cKZco.js} +1 -1
  4. package/dist/{ColorPicker-VyJUgPOO.js → ColorPicker-B6qnvRPP.js} +2 -2
  5. package/dist/{DataTable-B4_im8hi.js → DataTable-0vMEKXyc.js} +2 -2
  6. package/dist/{Legend-Clb_m4Rb.js → Legend-CxcYd88T.js} +2 -2
  7. package/dist/{NonSvgPenAndPaper-D3B8A264.js → NonSvgPenAndPaper-B9VyAH8V.js} +3 -3
  8. package/dist/{PackageVersion-DibkYC-M.js → PackageVersion-Drk6yOgG.js} +1 -1
  9. package/dist/{PenAndPaper-DwEs21-8.js → PenAndPaper-BSBB3lDR.js} +3 -3
  10. package/dist/{Shape-BNM3sYvz.js → Shape--XKRrfTm.js} +1 -1
  11. package/dist/{Slicer-CxfK8Ooe.js → Slicer-DCDucxqY.js} +2 -2
  12. package/dist/{SparkTooltip-Cz6oxVUe.js → SparkTooltip-CjvxSe5t.js} +1 -1
  13. package/dist/{Title-9W8vYOTf.js → Title-D0LcJx9c.js} +1 -1
  14. package/dist/{Tooltip-BsvF9Fzt.js → Tooltip-A0rXVeCS.js} +1 -1
  15. package/dist/{UserOptions-BsuG6h2S.js → UserOptions-B6pdFvnh.js} +2 -2
  16. package/dist/{dom-to-png-CHstuqXx.js → dom-to-png-soMc4J-O.js} +1 -1
  17. package/dist/{img-C2UO2LmT.js → img-XQW68ydk.js} +1 -1
  18. package/dist/{index-Dyu8fp8E.js → index-3dwsQVpJ.js} +29 -2
  19. package/dist/{pdf-D-6h1v42.js → pdf-uuJ9bA-G.js} +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/types/vue-data-ui.d.cts +16 -0
  22. package/dist/types/vue-data-ui.d.ts +16 -0
  23. package/dist/{useAutoSizeLabelsInsideViewbox-Bwp5Va3D.js → useAutoSizeLabelsInsideViewbox-BD2VwIW8.js} +1 -1
  24. package/dist/{useNestedProp-DQ1VA96r.js → useNestedProp-gsSGb_lz.js} +1 -1
  25. package/dist/usePanZoom-BVca3eMk.js +122 -0
  26. package/dist/{usePrinter-BXgpLrO7.js → usePrinter-eX-mHqpH.js} +2 -2
  27. package/dist/{vue-data-ui-BcGZE1NF.js → vue-data-ui-vW4TPl3U.js} +105 -100
  28. package/dist/vue-data-ui.js +1 -1
  29. package/dist/{vue-ui-3d-bar-DBV9xXzw.js → vue-ui-3d-bar-f6DERIfX.js} +6 -6
  30. package/dist/{vue-ui-accordion-CYSqT9wk.js → vue-ui-accordion-B8nt3TxA.js} +3 -3
  31. package/dist/{vue-ui-age-pyramid-Bt_VI_8S.js → vue-ui-age-pyramid-CMTrjr66.js} +6 -6
  32. package/dist/{vue-ui-annotator-CGxQiP9g.js → vue-ui-annotator-DQ7W33jU.js} +2 -2
  33. package/dist/{vue-ui-bullet-CCuyAayk.js → vue-ui-bullet-DZpiGlT4.js} +7 -7
  34. package/dist/{vue-ui-candlestick-CP-aj92I.js → vue-ui-candlestick-D_-OKcLB.js} +7 -7
  35. package/dist/{vue-ui-carousel-table-Ex0jv_6m.js → vue-ui-carousel-table-Kc13xumV.js} +4 -4
  36. package/dist/{vue-ui-chestnut-CaZecahE.js → vue-ui-chestnut-BzDu3Rn6.js} +5 -5
  37. package/dist/{vue-ui-chord-iGGuwS7b.js → vue-ui-chord-U669mk50.js} +8 -8
  38. package/dist/{vue-ui-circle-pack-BgV0RWhP.js → vue-ui-circle-pack-xw5KQZU-.js} +6 -6
  39. package/dist/{vue-ui-cursor-xOs-TnqL.js → vue-ui-cursor-Ce7aQLHI.js} +2 -2
  40. package/dist/{vue-ui-dashboard-DzcY4hbK.js → vue-ui-dashboard-y82bZlmD.js} +62 -62
  41. package/dist/{vue-ui-digits-B80NHDW4.js → vue-ui-digits-KEMPMv_F.js} +2 -2
  42. package/dist/{vue-ui-donut-kET9X3KC.js → vue-ui-donut-DE6uXbjC.js} +8 -8
  43. package/dist/{vue-ui-donut-evolution-NAhqQJBq.js → vue-ui-donut-evolution-CnqbDlWb.js} +8 -8
  44. package/dist/{vue-ui-dumbbell-BOUbsZjz.js → vue-ui-dumbbell-BxQn3t4G.js} +7 -7
  45. package/dist/{vue-ui-flow-CVqTTlL7.js → vue-ui-flow-94-MPmDY.js} +7 -7
  46. package/dist/{vue-ui-funnel-JWgW9aXa.js → vue-ui-funnel-CwlWwL3n.js} +6 -6
  47. package/dist/{vue-ui-galaxy-CNTGks21.js → vue-ui-galaxy-CNf7tCih.js} +5 -5
  48. package/dist/{vue-ui-gauge-DfEfHCii.js → vue-ui-gauge-Cew9UDzz.js} +7 -7
  49. package/dist/{vue-ui-gizmo-B2gTveWE.js → vue-ui-gizmo--xaQAnQu.js} +3 -3
  50. package/dist/{vue-ui-heatmap-CSPCmw07.js → vue-ui-heatmap-D6cGvObH.js} +7 -7
  51. package/dist/{vue-ui-history-plot-BJCl3rcg.js → vue-ui-history-plot-DW5MxS_b.js} +7 -7
  52. package/dist/{vue-ui-kpi-BKYRlE0D.js → vue-ui-kpi-BatAZ4-E.js} +3 -3
  53. package/dist/{vue-ui-mini-loader-BWURIXU2.js → vue-ui-mini-loader-GPIqVVO1.js} +2 -2
  54. package/dist/{vue-ui-molecule-DvtojfS8.js → vue-ui-molecule-k7qyYVdZ.js} +6 -6
  55. package/dist/{vue-ui-mood-radar-kRYl1mlL.js → vue-ui-mood-radar-BabL_H73.js} +7 -7
  56. package/dist/{vue-ui-nested-donuts-BfQYcOge.js → vue-ui-nested-donuts-WKD01a1O.js} +9 -9
  57. package/dist/{vue-ui-onion-aLDBwsee.js → vue-ui-onion-BkyATCmO.js} +8 -8
  58. package/dist/{vue-ui-parallel-coordinate-plot-D0fVIT8m.js → vue-ui-parallel-coordinate-plot-jm-azRXI.js} +8 -8
  59. package/dist/{vue-ui-quadrant-CKrLowD8.js → vue-ui-quadrant-DBd4oVbT.js} +8 -8
  60. package/dist/{vue-ui-quick-chart-76IrbNQV.js → vue-ui-quick-chart-CwBj1P_V.js} +6 -6
  61. package/dist/{vue-ui-radar-DHrkAutJ.js → vue-ui-radar-CSv_3sN3.js} +7 -7
  62. package/dist/{vue-ui-rating-DWBdOyTl.js → vue-ui-rating-C6KezTXl.js} +2 -2
  63. package/dist/{vue-ui-relation-circle-CjZzfe3p.js → vue-ui-relation-circle-DUzsyxP3.js} +6 -6
  64. package/dist/{vue-ui-ridgeline-BkbB0t3y.js → vue-ui-ridgeline-BCHnAtYx.js} +8 -8
  65. package/dist/{vue-ui-rings-B8TYCohi.js → vue-ui-rings-I6pUXmJJ.js} +8 -8
  66. package/dist/{vue-ui-scatter-DxqxLSoK.js → vue-ui-scatter-CIbgIR2N.js} +8 -8
  67. package/dist/{vue-ui-skeleton-D0jRJnYr.js → vue-ui-skeleton-DfTWTIRD.js} +3 -3
  68. package/dist/{vue-ui-smiley-5WAirs-Y.js → vue-ui-smiley-D-jjuB_S.js} +2 -2
  69. package/dist/{vue-ui-spark-trend-B0iaLZgG.js → vue-ui-spark-trend-CTEVFB0f.js} +3 -3
  70. package/dist/vue-ui-sparkbar-BmrXpZdR.js +351 -0
  71. package/dist/{vue-ui-sparkgauge-BrmviQdq.js → vue-ui-sparkgauge-EkEm4AS9.js} +3 -3
  72. package/dist/{vue-ui-sparkhistogram-mQcXsCgr.js → vue-ui-sparkhistogram-CvzKB01S.js} +4 -4
  73. package/dist/{vue-ui-sparkline-i5YBzZm-.js → vue-ui-sparkline-B76XhHl5.js} +3 -3
  74. package/dist/{vue-ui-sparkstackbar-Dfziml1d.js → vue-ui-sparkstackbar-BJ-rHvP2.js} +3 -3
  75. package/dist/{vue-ui-stackbar-DNXJScbf.js → vue-ui-stackbar-D1cu4co4.js} +9 -9
  76. package/dist/{vue-ui-strip-plot-Bdenoo21.js → vue-ui-strip-plot-Ch1NtN_S.js} +7 -7
  77. package/dist/{vue-ui-table-BmsE_-AB.js → vue-ui-table-DCJDWKjJ.js} +3 -3
  78. package/dist/{vue-ui-table-heatmap-TMZpd9nw.js → vue-ui-table-heatmap-CNOFepne.js} +5 -5
  79. package/dist/{vue-ui-table-sparkline-DDP0Zqh6.js → vue-ui-table-sparkline-B4caHVFQ.js} +4 -4
  80. package/dist/{vue-ui-thermometer-BI5VkftQ.js → vue-ui-thermometer-ApFwWbAJ.js} +7 -7
  81. package/dist/{vue-ui-timer-NptMB21z.js → vue-ui-timer-CXFlnQWL.js} +5 -5
  82. package/dist/{vue-ui-tiremarks-BV7fbbN4.js → vue-ui-tiremarks-Co2nDZn0.js} +6 -6
  83. package/dist/{vue-ui-treemap-UPMVTEwz.js → vue-ui-treemap-CPqRKKv9.js} +8 -8
  84. package/dist/{vue-ui-vertical-bar-Cxx8GGKW.js → vue-ui-vertical-bar-D6PiL6Hm.js} +9 -9
  85. package/dist/{vue-ui-waffle-CUbeYnnT.js → vue-ui-waffle-DTf2hN2Q.js} +8 -8
  86. package/dist/{vue-ui-wheel-D8FqSx-P.js → vue-ui-wheel-CO06fgiJ.js} +6 -6
  87. package/dist/vue-ui-word-cloud-B13xfkXT.js +765 -0
  88. package/dist/{vue-ui-world-Daog4Afo.js → vue-ui-world-C5S4zyBs.js} +6 -6
  89. package/dist/{vue-ui-xy-SradgwzX.js → vue-ui-xy-DQTFeS0H.js} +9 -9
  90. package/dist/{vue-ui-xy-canvas-BPIlcbK3.js → vue-ui-xy-canvas-CUpEoeSY.js} +8 -8
  91. package/package.json +1 -1
  92. package/dist/usePanZoom-BQMvRXEQ.js +0 -115
  93. package/dist/vue-ui-sparkbar-CGPhKrdn.js +0 -301
  94. package/dist/vue-ui-word-cloud-dGsJ8VGE.js +0 -661
@@ -1,661 +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, an as Je, h as Ke, a as Qe, p as me, b as et, o as tt, f as Ie, g as ot, i as at, X as lt, v as nt, w as st, y as it } from "./index-Dyu8fp8E.js";
3
- import { t as rt, u as ut, d as ct } from "./useResponsive-DfdjqQps.js";
4
- import { u as Ne } from "./useNestedProp-DQ1VA96r.js";
5
- import { u as dt } from "./usePrinter-BXgpLrO7.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-9W8vYOTf.js";
10
- import pt from "./img-C2UO2LmT.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
- a75532be: t.slicerColor
151
- }));
152
- const u = H(() => import("./vue-ui-accordion-CYSqT9wk.js")), f = H(() => import("./BaseIcon-3PL8sPji.js")), c = H(() => import("./DataTable-B4_im8hi.js")), m = H(() => import("./PackageVersion-DibkYC-M.js")), l = H(() => import("./PenAndPaper-DwEs21-8.js")), a = H(() => import("./Tooltip-BsvF9Fzt.js")), i = H(() => import("./UserOptions-BsuG6h2S.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
- smooth: e.value.style.chart.tooltip.smooth,
598
- backdropFilter: e.value.style.chart.tooltip.backdropFilter
599
- }, {
600
- "tooltip-before": A(() => [
601
- M(t.$slots, "tooltip-before", Q(ee({ ...ye.value })), void 0, !0)
602
- ]),
603
- "tooltip-after": A(() => [
604
- M(t.$slots, "tooltip-after", Q(ee({ ...ye.value })), void 0, !0)
605
- ]),
606
- _: 3
607
- }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom", "smooth", "backdropFilter"]),
608
- t.$slots.source ? (T(), N("div", {
609
- key: 6,
610
- ref_key: "source",
611
- ref: R,
612
- dir: "auto"
613
- }, [
614
- M(t.$slots, "source", {}, void 0, !0)
615
- ], 512)) : Y("", !0),
616
- h.value ? (T(), ie(r(u), {
617
- key: 7,
618
- hideDetails: "",
619
- config: {
620
- open: v.value.showTable,
621
- maxHeight: 1e4,
622
- body: {
623
- backgroundColor: e.value.style.chart.backgroundColor,
624
- color: e.value.style.chart.color
625
- },
626
- head: {
627
- backgroundColor: e.value.style.chart.backgroundColor,
628
- color: e.value.style.chart.color
629
- }
630
- }
631
- }, {
632
- content: A(() => [
633
- (T(), ie(r(c), {
634
- key: `table_${re.value}`,
635
- colNames: ce.value.colNames,
636
- head: ce.value.head,
637
- body: ce.value.body,
638
- config: ce.value.config,
639
- title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
640
- onClose: n[2] || (n[2] = (o) => v.value.showTable = !1)
641
- }, {
642
- th: A(({ th: o }) => [
643
- ke("div", {
644
- innerHTML: o,
645
- style: { display: "flex", "align-items": "center" }
646
- }, null, 8, Pt)
647
- ]),
648
- td: A(({ td: o }) => [
649
- qe(ze(o.name || o), 1)
650
- ]),
651
- _: 1
652
- }, 8, ["colNames", "head", "body", "config", "title"]))
653
- ]),
654
- _: 1
655
- }, 8, ["config"])) : Y("", !0)
656
- ], 44, kt));
657
- }
658
- }, Et = /* @__PURE__ */ gt(zt, [["__scopeId", "data-v-a27ac136"]]);
659
- export {
660
- Et as default
661
- };