vue-data-ui 2.16.6 → 2.17.1

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