vue-data-ui 3.0.0-next.8 → 3.0.0

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-BRtNjitS.js → Arrow-r2f8Bpd-.js} +1 -1
  3. package/dist/{BaseDraggableDialog-CO9ok1PR.js → BaseDraggableDialog-CGGcf8d8.js} +4 -4
  4. package/dist/{BaseIcon-BuOIF6t5.js → BaseIcon-CXtL10fo.js} +1 -1
  5. package/dist/{ColorPicker-FH6oc0mS.js → ColorPicker-H91bBsqM.js} +2 -2
  6. package/dist/{DataTable-D36ZRtpU.js → DataTable-BSSXpM7w.js} +2 -2
  7. package/dist/{Legend-DInM-hku.js → Legend-BUk0WvWJ.js} +2 -2
  8. package/dist/{NonSvgPenAndPaper-B60MxEaz.js → NonSvgPenAndPaper-DQDgPoW8.js} +3 -3
  9. package/dist/{PackageVersion-CGQlqnmq.js → PackageVersion-CJ6Vd7V5.js} +3 -3
  10. package/dist/{PenAndPaper-B5slIHlh.js → PenAndPaper-D3zudcNI.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-BGr3dQKt.js → Shape-BRzOzubn.js} +43 -37
  15. package/dist/Slicer-MID8pgT3.js +602 -0
  16. package/dist/{SparkTooltip-BWA23VgJ.js → SparkTooltip-DATI1fGZ.js} +7 -7
  17. package/dist/{Title-BSlAPr_H.js → Title-BGu6gEd2.js} +1 -1
  18. package/dist/{Tooltip-lPcsweXz.js → Tooltip-Bh2zYSoM.js} +23 -19
  19. package/dist/{UserOptions-Dn5TCQxg.js → UserOptions-Ck8fz9f4.js} +2 -2
  20. package/dist/{dom-to-png-Br-eVhJZ.js → dom-to-png-DhIh24Ti.js} +1 -1
  21. package/dist/{img-CgMUOQnb.js → img-DrR839Ot.js} +1 -1
  22. package/dist/{index-Cfm5-hMQ.js → index-BtNwOUja.js} +2885 -2010
  23. package/dist/{pdf-BMVHBLq5.js → pdf-DoShrdT5.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-FmDQyX4z.js +81 -0
  28. package/dist/useFitSvgText-2crs6Fv5.js +69 -0
  29. package/dist/useLoading-D7YHNtLX.js +29 -0
  30. package/dist/useNestedProp-f2H3m6Yj.js +13 -0
  31. package/dist/usePanZoom-BVca3eMk.js +122 -0
  32. package/dist/{usePrinter-B1Hgs47c.js → usePrinter-DUNjpQNe.js} +2 -2
  33. package/dist/useTimeLabelCollider-CIsgDrl9.js +78 -0
  34. package/dist/{useTimeLabels-Mrr0jrpL.js → useTimeLabels-DkzmKfZn.js} +211 -152
  35. package/dist/{vue-data-ui-CD674-M3.js → vue-data-ui-D7QVxNhO.js} +105 -100
  36. package/dist/vue-data-ui.js +26 -25
  37. package/dist/vue-ui-3d-bar-ITaF-6Kn.js +1323 -0
  38. package/dist/{vue-ui-accordion-CEDGlyKI.js → vue-ui-accordion-BKUrAowe.js} +3 -3
  39. package/dist/vue-ui-age-pyramid-DxsuDr6o.js +835 -0
  40. package/dist/{vue-ui-annotator-CosgP-Fl.js → vue-ui-annotator-B06QtxgJ.js} +12 -12
  41. package/dist/vue-ui-bullet-B7Fy45tA.js +571 -0
  42. package/dist/vue-ui-candlestick-Dw0U4uIQ.js +1000 -0
  43. package/dist/{vue-ui-carousel-table-BG1ItsAb.js → vue-ui-carousel-table-DGz0nw28.js} +29 -29
  44. package/dist/{vue-ui-chestnut-6uKesZW9.js → vue-ui-chestnut-CFfKYm9i.js} +664 -536
  45. package/dist/vue-ui-chord-EhlQhMSs.js +1038 -0
  46. package/dist/vue-ui-circle-pack-BHrrEUUd.js +709 -0
  47. package/dist/{vue-ui-cursor-CkVnNEGn.js → vue-ui-cursor-Dd-HtWzG.js} +2 -2
  48. package/dist/{vue-ui-dashboard-D07ivGS7.js → vue-ui-dashboard-6R8udDY3.js} +64 -64
  49. package/dist/{vue-ui-digits-Doidl3Lz.js → vue-ui-digits-zKn3uhGN.js} +2 -2
  50. package/dist/{vue-ui-donut-CWvzqAAa.js → vue-ui-donut-BtnIwS_E.js} +433 -424
  51. package/dist/vue-ui-donut-evolution-DHo1MuMM.js +1076 -0
  52. package/dist/vue-ui-dumbbell-Czi9r9Na.js +1120 -0
  53. package/dist/vue-ui-flow-jOfM0RZY.js +841 -0
  54. package/dist/{vue-ui-funnel-D1pFzjJa.js → vue-ui-funnel-tBvVpdhy.js} +16 -16
  55. package/dist/vue-ui-galaxy-IdoY2oqG.js +680 -0
  56. package/dist/vue-ui-gauge-DR6Xm_Hz.js +791 -0
  57. package/dist/vue-ui-gizmo-Dto73UsB.js +210 -0
  58. package/dist/vue-ui-heatmap-zmFv-0z1.js +1078 -0
  59. package/dist/vue-ui-history-plot-ILemyyYw.js +1074 -0
  60. package/dist/{vue-ui-kpi-DTeZbrJk.js → vue-ui-kpi-hmqSCvxr.js} +26 -26
  61. package/dist/{vue-ui-mini-loader-itpDcfZU.js → vue-ui-mini-loader-CbD-E8ci.js} +2 -2
  62. package/dist/vue-ui-molecule-mTy6YIm6.js +656 -0
  63. package/dist/vue-ui-mood-radar-BEnSYV3Q.js +785 -0
  64. package/dist/vue-ui-nested-donuts-CGE9dmJK.js +1284 -0
  65. package/dist/vue-ui-onion-Dh2J9GV0.js +776 -0
  66. package/dist/vue-ui-parallel-coordinate-plot-xsgmMIJK.js +916 -0
  67. package/dist/{vue-ui-quadrant-0milmSNS.js → vue-ui-quadrant-DA0Kw6eq.js} +512 -459
  68. package/dist/vue-ui-quick-chart-DKbxF5Yt.js +1762 -0
  69. package/dist/vue-ui-radar-BFY9bN_h.js +796 -0
  70. package/dist/{vue-ui-rating-C3QUdrMw.js → vue-ui-rating-Bh35aujf.js} +2 -2
  71. package/dist/vue-ui-relation-circle-B-05kQ_l.js +598 -0
  72. package/dist/vue-ui-ridgeline-CuGfF83t.js +1157 -0
  73. package/dist/vue-ui-rings-DrQXXzAM.js +728 -0
  74. package/dist/vue-ui-scatter-CWn9c7e9.js +1178 -0
  75. package/dist/{vue-ui-skeleton-P-1SRvsT.js → vue-ui-skeleton-oG4Bm5nL.js} +13 -13
  76. package/dist/{vue-ui-smiley-Cd1bhDuU.js → vue-ui-smiley-Cnwba_gV.js} +46 -46
  77. package/dist/vue-ui-spark-trend-D9iNCf4o.js +315 -0
  78. package/dist/vue-ui-sparkbar-iJkiubZC.js +351 -0
  79. package/dist/vue-ui-sparkgauge-BH3uA5rh.js +232 -0
  80. package/dist/vue-ui-sparkhistogram-B3kR62pf.js +380 -0
  81. package/dist/vue-ui-sparkline-DczR2ZAf.js +513 -0
  82. package/dist/vue-ui-sparkstackbar-Cg0ItRGH.js +421 -0
  83. package/dist/vue-ui-stackbar-d4PrzcGS.js +1371 -0
  84. package/dist/vue-ui-strip-plot-BXBpN5rl.js +916 -0
  85. package/dist/{vue-ui-table-B1tjuVi0.js → vue-ui-table-BXOLZXuz.js} +17 -17
  86. package/dist/{vue-ui-table-heatmap-BI8eIQG7.js → vue-ui-table-heatmap-7YT7VF2H.js} +5 -5
  87. package/dist/{vue-ui-table-sparkline-CqBD7xhZ.js → vue-ui-table-sparkline-BfgqajJ2.js} +19 -16
  88. package/dist/vue-ui-thermometer-C7Tg6HLz.js +541 -0
  89. package/dist/{vue-ui-timer-sgO_Z6ja.js → vue-ui-timer-Ch5JP1pQ.js} +5 -5
  90. package/dist/vue-ui-tiremarks-fY-4pWAK.js +406 -0
  91. package/dist/vue-ui-treemap-DTSX6suB.js +1035 -0
  92. package/dist/{vue-ui-vertical-bar-BPay31_q.js → vue-ui-vertical-bar-C-i2dRnU.js} +107 -105
  93. package/dist/vue-ui-waffle-BbgLlhGH.js +910 -0
  94. package/dist/vue-ui-wheel-waZf462K.js +379 -0
  95. package/dist/vue-ui-word-cloud-DtLK91Dk.js +765 -0
  96. package/dist/{vue-ui-world-DWskeHfE.js → vue-ui-world-Cx4uuwTY.js} +364 -327
  97. package/dist/vue-ui-xy-DDOT8cyx.js +3808 -0
  98. package/dist/{vue-ui-xy-canvas-Dkmsguo1.js → vue-ui-xy-canvas-CUCsC8vD.js} +265 -264
  99. package/package.json +4 -4
  100. package/dist/RecursiveLabels-NTMB9w5C.js +0 -49
  101. package/dist/Slicer-O07lQwRC.js +0 -577
  102. package/dist/useLoading-Bt5Doa8m.js +0 -28
  103. package/dist/useNestedProp-Hh7nGEjp.js +0 -13
  104. package/dist/usePanZoom-BQMvRXEQ.js +0 -115
  105. package/dist/vue-ui-3d-bar-DWtJoryQ.js +0 -1227
  106. package/dist/vue-ui-age-pyramid-DbrA1G0r.js +0 -746
  107. package/dist/vue-ui-bullet-9IB3mGon.js +0 -513
  108. package/dist/vue-ui-candlestick-CWqPF_zW.js +0 -873
  109. package/dist/vue-ui-chord-Crd3l1b6.js +0 -949
  110. package/dist/vue-ui-circle-pack-CAm2gxBi.js +0 -673
  111. package/dist/vue-ui-donut-evolution-Djp_eBqw.js +0 -903
  112. package/dist/vue-ui-dumbbell-B7GySnYf.js +0 -753
  113. package/dist/vue-ui-flow-XDpZAYWI.js +0 -765
  114. package/dist/vue-ui-galaxy-DBQy21se.js +0 -617
  115. package/dist/vue-ui-gauge-FBZaUrBD.js +0 -738
  116. package/dist/vue-ui-gizmo-CDbPxUzE.js +0 -192
  117. package/dist/vue-ui-heatmap-DsDWxYOS.js +0 -877
  118. package/dist/vue-ui-history-plot-CzO1Z1FH.js +0 -924
  119. package/dist/vue-ui-molecule-Ddd3FgID.js +0 -597
  120. package/dist/vue-ui-mood-radar-24XAq8mg.js +0 -670
  121. package/dist/vue-ui-nested-donuts-DjWASp62.js +0 -1212
  122. package/dist/vue-ui-onion-B9thdF_c.js +0 -701
  123. package/dist/vue-ui-parallel-coordinate-plot-DT-GhOaA.js +0 -807
  124. package/dist/vue-ui-quick-chart-D0DukVN6.js +0 -1612
  125. package/dist/vue-ui-radar-DY8y6oRc.js +0 -741
  126. package/dist/vue-ui-relation-circle-8Gd7_fxt.js +0 -542
  127. package/dist/vue-ui-ridgeline-iPtG1McW.js +0 -969
  128. package/dist/vue-ui-rings-BXPo4MMo.js +0 -685
  129. package/dist/vue-ui-scatter-26d0eebx.js +0 -1045
  130. package/dist/vue-ui-spark-trend-Dt3ctzpl.js +0 -291
  131. package/dist/vue-ui-sparkbar-RrxErqrU.js +0 -301
  132. package/dist/vue-ui-sparkgauge-CyNi1b0O.js +0 -201
  133. package/dist/vue-ui-sparkhistogram-DPpZCPuE.js +0 -313
  134. package/dist/vue-ui-sparkline-BMjQ_uYx.js +0 -459
  135. package/dist/vue-ui-sparkstackbar-CjO8pfE-.js +0 -381
  136. package/dist/vue-ui-stackbar-wgyvMlE6.js +0 -1207
  137. package/dist/vue-ui-strip-plot-BF1o8lvY.js +0 -761
  138. package/dist/vue-ui-thermometer-CtuxuYVt.js +0 -495
  139. package/dist/vue-ui-tiremarks-DOwj4ZE-.js +0 -358
  140. package/dist/vue-ui-treemap-C4LtyFug.js +0 -965
  141. package/dist/vue-ui-waffle-D8mzGTeo.js +0 -863
  142. package/dist/vue-ui-wheel-C6uAotal.js +0 -352
  143. package/dist/vue-ui-word-cloud-Bge2211V.js +0 -659
  144. package/dist/vue-ui-xy-UzQacbnA.js +0 -2982
@@ -1,673 +0,0 @@
1
- import { useCssVars as at, computed as z, defineAsyncComponent as V, ref as b, watch as Re, shallowRef as Ee, onMounted as ot, onBeforeUnmount as st, watchEffect as nt, createElementBlock as g, openBlock as y, unref as u, normalizeStyle as le, normalizeClass as Me, createBlock as B, createCommentVNode as k, renderSlot as x, createSlots as rt, withCtx as $, normalizeProps as W, guardReactiveProps as X, createVNode as ut, Fragment as ae, renderList as it, createElementVNode as _, mergeProps as Ae, toDisplayString as Y, createTextVNode as ct, nextTick as De } from "vue";
2
- import { u as vt, c as Le, t as de, p as oe, a as dt, o as ht, e as ft, b as yt, d as mt, h as Ve, f as he, X as pt, l as bt, F as Z, aj as gt, q as kt, r as xt, i as Be } from "./index-Cfm5-hMQ.js";
3
- import { u as He } from "./useNestedProp-Hh7nGEjp.js";
4
- import { u as wt } from "./usePrinter-B1Hgs47c.js";
5
- import { u as Ct } from "./useUserOptionState-BIvW1Kz7.js";
6
- import { u as zt } from "./useChartAccessibility-9icAAmYg.js";
7
- import { t as _t, u as $t } from "./useResponsive-DfdjqQps.js";
8
- import Tt from "./Title-BSlAPr_H.js";
9
- import Pt from "./img-CgMUOQnb.js";
10
- import { _ as St } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
- function Ue(r, i = 0) {
12
- const f = r.reduce((a, { x: n, r: v }) => Math.min(a, n - v - i), 1 / 0), m = r.reduce((a, { x: n, r: v }) => Math.max(a, n + v + i), -1 / 0), c = r.reduce((a, { y: n, r: v }) => Math.min(a, n - v - i), 1 / 0), o = r.reduce((a, { y: n, r: v }) => Math.max(a, n + v + i), -1 / 0);
13
- return [f, c, m - f, o - c];
14
- }
15
- function Ot(r, i, f) {
16
- const m = r._, c = r.next._, o = m.r + c.r, a = (m.x * c.r + c.x * m.r) / o, n = (m.y * c.r + c.y * m.r) / o;
17
- return Math.max(Math.abs(a * f), Math.abs(n * i));
18
- }
19
- function je(r, i, f) {
20
- const m = Ot, c = r.length;
21
- if (!c) return r;
22
- let o, a, n;
23
- if (o = r[0], o.x = 0, o.y = 0, !(c > 1) || (a = r[1], o.x = -a.r, a.x = o.r, a.y = 0, !(c > 2))) return r;
24
- Ge(a, o, n = r[2]), o = new se(o), a = new se(a), n = new se(n), o.next = n.previous = a, a.next = o.previous = n, n.next = a.previous = o;
25
- e: for (let v = 3; v < c; ++v) {
26
- Ge(o._, a._, n = r[v]), n = new se(n);
27
- let p = a.next, T = o.previous, J = a._.r, N = o._.r;
28
- do
29
- if (J <= N) {
30
- if (qe(p._, n._)) {
31
- a = p, o.next = a, a.previous = o, --v;
32
- continue e;
33
- }
34
- J += p._.r, p = p.next;
35
- } else {
36
- if (qe(T._, n._)) {
37
- o = T, o.next = a, a.previous = o, --v;
38
- continue e;
39
- }
40
- N += T._.r, T = T.previous;
41
- }
42
- while (p !== T.next);
43
- n.previous = o, n.next = a, o.next = a.previous = a = n;
44
- let P = m(o, f, i), w;
45
- for (; (n = n.next) !== a; )
46
- (w = m(n, f, i)) < P && (o = n, P = w);
47
- a = o.next;
48
- }
49
- return r;
50
- }
51
- function Ge(r, i, f) {
52
- const m = r.x - i.x, c = r.y - i.y, o = m * m + c * c;
53
- if (o) {
54
- const a = (i.r + f.r) ** 2, n = (r.r + f.r) ** 2;
55
- if (a > n) {
56
- const v = (o + n - a) / (2 * o), p = Math.sqrt(Math.max(0, n / o - v * v));
57
- f.x = r.x - v * m - p * c, f.y = r.y - v * c + p * m;
58
- } else {
59
- const v = (o + a - n) / (2 * o), p = Math.sqrt(Math.max(0, a / o - v * v));
60
- f.x = i.x + v * m - p * c, f.y = i.y + v * c + p * m;
61
- }
62
- } else
63
- f.x = i.x + f.r, f.y = i.y;
64
- }
65
- function qe(r, i) {
66
- const f = r.r + i.r - 1e-6, m = i.x - r.x, c = i.y - r.y;
67
- return f > 0 && f * f > m * m + c * c;
68
- }
69
- class se {
70
- constructor(i) {
71
- this._ = i, this.next = null, this.previous = null;
72
- }
73
- }
74
- const It = ["id"], Ft = ["xmlns", "viewBox", "height", "width"], Nt = ["x", "y", "width", "height"], Rt = ["id"], Et = ["stop-color"], Mt = ["stop-color"], At = ["stop-color"], Dt = { key: 0 }, Lt = ["x", "y", "width", "height", "stroke", "stroke-width", "fill", "rx", "onMouseenter", "onClick"], Vt = ["x", "y", "width", "height", "stroke", "stroke-width", "fill", "rx"], Bt = ["opacity", "x", "y", "font-size", "fill", "font-weight"], Ht = ["opacity", "x", "y", "font-size", "fill", "font-weight"], Ut = ["cx", "cy", "r", "opacity", "stroke", "stroke-width", "fill"], jt = {
75
- key: 0,
76
- style: { pointerEvents: "none" }
77
- }, Gt = { key: 1 }, qt = ["opacity", "x", "y", "font-size", "fill", "font-weight"], Wt = ["opacity", "x", "y", "font-size", "fill", "font-weight"], Xt = {
78
- key: 6,
79
- class: "vue-data-ui-watermark"
80
- }, Yt = ["innerHTML"], Zt = {
81
- __name: "vue-ui-circle-pack",
82
- props: {
83
- config: {
84
- type: Object,
85
- default() {
86
- return {};
87
- }
88
- },
89
- dataset: {
90
- type: Array,
91
- default() {
92
- return [];
93
- }
94
- }
95
- },
96
- emits: ["selectDatapoint"],
97
- setup(r, { expose: i, emit: f }) {
98
- at((t) => ({
99
- "1096c176": L.value,
100
- "329ac07e": ue.value
101
- }));
102
- const m = V(() => import("./vue-ui-accordion-CEDGlyKI.js")), c = V(() => import("./DataTable-D36ZRtpU.js")), o = V(() => import("./PackageVersion-CGQlqnmq.js")), a = V(() => import("./PenAndPaper-B5slIHlh.js")), n = V(() => import("./vue-ui-skeleton-P-1SRvsT.js")), v = V(() => import("./UserOptions-Dn5TCQxg.js")), p = r, T = f, { vue_ui_circle_pack: J } = vt(), N = z(() => !!p.dataset && p.dataset.length), P = b(Le()), w = b(null), fe = b(null), ye = b(null), me = b(0), pe = b(0), be = b(0), We = b(null), e = z({
103
- get: () => we(),
104
- set: (t) => t
105
- }), { svgRef: ge } = zt({ config: e.value.style.chart.title }), {
106
- userOptionsVisible: ne,
107
- setUserOptionsVisibility: ke,
108
- keepUserOptionState: xe
109
- } = Ct({ config: e.value });
110
- function we() {
111
- const t = He({
112
- userConfig: p.config,
113
- defaultConfig: J
114
- });
115
- return t.theme ? {
116
- ...He({
117
- userConfig: dt.vue_ui_circle_pack[t.theme] || p.config,
118
- defaultConfig: t
119
- }),
120
- customPalette: de[t.theme] || oe
121
- } : t;
122
- }
123
- Re(() => p.config, (t) => {
124
- e.value = we(), ne.value = !e.value.userOptions.showOnChartHover, re(), me.value += 1, pe.value += 1, H.value.showTable = e.value.table.show;
125
- }, { deep: !0 });
126
- const { isPrinting: Ce, isImaging: ze, generatePdf: _e, generateImage: $e } = wt({
127
- elementId: `vue-ui-circle-pack_${P.value}`,
128
- fileName: e.value.style.chart.title.text || "vue-ui-circle-pack",
129
- options: e.value.userOptions.print
130
- }), Xe = z(() => e.value.userOptions.show && !e.value.style.chart.title.text), H = b({
131
- showTable: e.value.table.show
132
- }), S = Ee(null), E = Ee(null), M = b({ h: 10, w: 10 }), Te = b(0), A = b([0, 0, 100, 100]), K = b({ h: 0, w: 0 });
133
- async function re() {
134
- ht(p.dataset) && ft({
135
- componentName: "VueUiCirclePack",
136
- type: "dataset"
137
- }), D.value = await je(Q.value), O.value = Ue(D.value, 1).join(" "), K.value = Pe(w.value);
138
- const t = _t(() => {
139
- const { width: s, height: l, heightTitle: h, heightNoTitle: C } = $t({
140
- chart: w.value,
141
- title: fe.value,
142
- noTitle: ye.value
143
- }), R = s || 10, ve = l && l > 10 ? l : 10;
144
- Te.value = e.value.style.chart.title.text ? h : C, requestAnimationFrame(() => {
145
- M.value.w = R, M.value.h = ve - Te.value, De(async () => {
146
- const tt = Q.value.map((lt) => ({ ...lt }));
147
- D.value = await je(tt, M.value.h, M.value.w), A.value = Ue(D.value, 1), O.value = A.value.join(" "), K.value = Pe(w.value);
148
- });
149
- });
150
- });
151
- S.value && (E.value && S.value.unobserve(E.value), S.value.disconnect()), S.value = new ResizeObserver(t), E.value = w.value.parentNode, S.value.observe(E.value);
152
- }
153
- ot(re), st(() => {
154
- S.value && (E.value && S.value.unobserve(E.value), S.value.disconnect());
155
- });
156
- function Pe(t) {
157
- if (!t || !t.parentElement)
158
- return console.warn("Component or parent element is missing."), { w: 0, h: 0 };
159
- const s = t.parentElement;
160
- if (s.offsetWidth > 0 && s.offsetHeight > 0)
161
- return { w: s.offsetWidth, h: s.offsetHeight };
162
- const l = window.getComputedStyle(s), h = l.width, C = l.height;
163
- return h !== "auto" && C !== "auto" && parseFloat(h) > 0 && parseFloat(C) > 0 ? { w: parseFloat(h), h: parseFloat(C) } : { w: 0, h: 0 };
164
- }
165
- Re(() => p.dataset, async (t) => {
166
- await re();
167
- }, { deep: !0 });
168
- const Ye = z(() => yt(e.value.customPalette)), Q = z(() => p.dataset.map((t, s) => {
169
- const l = mt(t.color) || Ye.value[s] || de[e.value.theme || "default"][s % de[e.value.theme || "default"].length] || oe[s] || oe[s % oe.length];
170
- return {
171
- ...t,
172
- r: t.value,
173
- id: Le(),
174
- color: l
175
- };
176
- }).filter((t) => ![null, void 0, 1 / 0, -1 / 0].includes(t.value))), D = b([]), O = b("0 0 100 100"), U = z(() => Math.max(...D.value.map((t) => t.r)));
177
- function Se(t, s) {
178
- return s / U.value * t;
179
- }
180
- const d = b(null);
181
- function Ze(t) {
182
- e.value.style.chart.circles.zoom.show && (d.value = t);
183
- }
184
- const L = z(() => d.value ? d.value.r : 0), ue = z(() => F.value ? L.value : d.value ? d.value.r > A.value[3] / 6 * e.value.style.chart.circles.zoom.zoomRatio ? d.value.r : A.value[3] / 6 * e.value.style.chart.circles.zoom.zoomRatio : 0), I = b(0), Je = z(() => ({
185
- pointerEvents: "none",
186
- opacity: I.value,
187
- filter: `drop-shadow(0px 0px 6px ${Ve(d.value.color, e.value.style.chart.circles.zoom.shadowForce)})`
188
- })), j = b(L.value);
189
- nt(() => {
190
- j.value = L.value, I.value = 0;
191
- let t = null;
192
- function s(l) {
193
- t || (t = l);
194
- const h = (l - t) / e.value.style.chart.circles.zoom.animationFrameMs;
195
- h < 1 ? (j.value = L.value + (ue.value - L.value) * h, I.value = 0 + e.value.style.chart.circles.zoom.opacity * h, requestAnimationFrame(s)) : (j.value = ue.value, I.value = e.value.style.chart.circles.zoom.opacity);
196
- }
197
- requestAnimationFrame(s);
198
- });
199
- const G = z(() => ({
200
- name: e.value.style.chart.circles.zoom.label.name.fontSize * A.value[3] / 300,
201
- value: e.value.style.chart.circles.zoom.label.value.fontSize * A.value[3] / 300
202
- }));
203
- function ie(t) {
204
- return Be(
205
- e.value.style.chart.circles.labels.value.formatter,
206
- t.value,
207
- he({
208
- p: e.value.style.chart.circles.labels.value.prefix,
209
- v: t.value,
210
- s: e.value.style.chart.circles.labels.value.suffix,
211
- r: e.value.style.chart.circles.labels.value.rounding
212
- })
213
- );
214
- }
215
- function Ke() {
216
- return Be(
217
- e.value.style.chart.circles.zoom.label.value.formatter,
218
- d.value.value,
219
- he({
220
- p: e.value.style.chart.circles.zoom.label.value.prefix,
221
- v: d.value.value,
222
- s: e.value.style.chart.circles.zoom.label.value.suffix,
223
- r: e.value.style.chart.circles.zoom.label.value.rounding
224
- })
225
- );
226
- }
227
- function Oe(t) {
228
- if (!t)
229
- return 0;
230
- const s = t.r / ie(t).length * (ie(t).length === 1 ? 1 : 2);
231
- return Math.min(t.r / 2.5, s);
232
- }
233
- const q = b(!1);
234
- function Ie(t) {
235
- q.value = t, be.value += 1;
236
- }
237
- const F = b(!1);
238
- function ce() {
239
- F.value = !F.value;
240
- }
241
- const ee = z(() => {
242
- const t = Q.value.map((l) => ({
243
- name: l.name,
244
- value: l.value,
245
- color: l.color
246
- })).toSorted((l, h) => h.value - l.value), s = t.map((l) => l.value);
247
- return { head: t, body: s };
248
- });
249
- function Fe(t = null) {
250
- De(() => {
251
- const s = ee.value.head.map((C, R) => [[
252
- C.name
253
- ], [ee.value.body[R]]]), l = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], [e.value.table.columnNames.value]]].concat(s), h = kt(l);
254
- t ? t(h) : xt({ csvContent: h, title: e.value.style.chart.title.text || "vue-ui-circle-pack" });
255
- });
256
- }
257
- const te = z(() => {
258
- const t = [
259
- e.value.table.columnNames.datapoint,
260
- e.value.table.columnNames.value
261
- ], s = ee.value.head.map((C, R) => {
262
- const ve = he({
263
- p: e.value.style.chart.circles.labels.value.prefix,
264
- v: ee.value.body[R],
265
- s: e.value.style.chart.circles.labels.value.suffix,
266
- r: e.value.style.chart.circles.labels.value.rounding
267
- });
268
- return [
269
- {
270
- color: C.color,
271
- name: C.name
272
- },
273
- ve
274
- ];
275
- }), l = {
276
- th: {
277
- backgroundColor: e.value.table.th.backgroundColor,
278
- color: e.value.table.th.color,
279
- outline: e.value.table.th.outline
280
- },
281
- td: {
282
- backgroundColor: e.value.table.td.backgroundColor,
283
- color: e.value.table.td.color,
284
- outline: e.value.table.td.outline
285
- },
286
- breakpoint: e.value.table.responsiveBreakpoint
287
- };
288
- return {
289
- colNames: [
290
- e.value.table.columnNames.datapoint,
291
- e.value.table.columnNames.value
292
- ],
293
- head: t,
294
- body: s,
295
- config: l
296
- };
297
- });
298
- function Ne() {
299
- H.value.showTable = !H.value.showTable;
300
- }
301
- function Qe() {
302
- return Q.value;
303
- }
304
- async function et({ scale: t = 2 } = {}) {
305
- if (!w.value) return;
306
- const { width: s, height: l } = w.value.getBoundingClientRect(), h = s / l, { imageUri: C, base64: R } = await Pt({ domElement: w.value, base64: !0, img: !0, scale: t });
307
- return {
308
- imageUri: C,
309
- base64: R,
310
- title: e.value.style.chart.title.text,
311
- width: s,
312
- height: l,
313
- aspectRatio: h
314
- };
315
- }
316
- return i({
317
- getData: Qe,
318
- getImage: et,
319
- generateCsv: Fe,
320
- generatePdf: _e,
321
- generateImage: $e,
322
- toggleTable: Ne,
323
- toggleAnnotator: ce,
324
- toggleFullscreen: Ie
325
- }), (t, s) => (y(), g("div", {
326
- id: `vue-ui-circle-pack_${P.value}`,
327
- class: Me(`vue-ui-circle-pack ${q.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
328
- ref_key: "circlePackChart",
329
- ref: w,
330
- style: le(`font-family:${e.value.style.fontFamily};text-align:center;background:${e.value.style.chart.backgroundColor}; height: ${K.value.h}px; width:${K.value.w}px`),
331
- onMouseenter: s[2] || (s[2] = () => u(ke)(!0)),
332
- onMouseleave: s[3] || (s[3] = () => u(ke)(!1))
333
- }, [
334
- e.value.userOptions.buttons.annotator ? (y(), B(u(a), {
335
- key: 0,
336
- svgRef: u(ge),
337
- backgroundColor: e.value.style.chart.backgroundColor,
338
- color: e.value.style.chart.color,
339
- active: F.value,
340
- scale: U.value / 100,
341
- onClose: ce
342
- }, null, 8, ["svgRef", "backgroundColor", "color", "active", "scale"])) : k("", !0),
343
- x(t.$slots, "userConfig", {}, void 0, !0),
344
- Xe.value ? (y(), g("div", {
345
- key: 1,
346
- ref_key: "noTitle",
347
- ref: ye,
348
- class: "vue-data-ui-no-title-space",
349
- style: "height:36px; width: 100%;background:transparent"
350
- }, null, 512)) : k("", !0),
351
- e.value.style.chart.title.text ? (y(), g("div", {
352
- key: 2,
353
- ref_key: "chartTitle",
354
- ref: fe,
355
- style: "width:100%;background:transparent;padding-bottom:12px"
356
- }, [
357
- (y(), B(Tt, {
358
- key: `title_${me.value}`,
359
- config: {
360
- title: {
361
- cy: "donut-div-title",
362
- ...e.value.style.chart.title
363
- },
364
- subtitle: {
365
- cy: "donut-div-subtitle",
366
- ...e.value.style.chart.title.subtitle
367
- }
368
- }
369
- }, null, 8, ["config"]))
370
- ], 512)) : k("", !0),
371
- e.value.userOptions.show && N.value && (u(xe) || u(ne)) ? (y(), B(u(v), {
372
- ref: "details",
373
- key: `user_option_${be.value}`,
374
- backgroundColor: e.value.style.chart.backgroundColor,
375
- color: e.value.style.chart.color,
376
- isPrinting: u(Ce),
377
- isImaging: u(ze),
378
- uid: P.value,
379
- hasTooltip: !1,
380
- hasLabel: !1,
381
- hasPdf: e.value.userOptions.buttons.pdf,
382
- hasImg: e.value.userOptions.buttons.img,
383
- hasXls: e.value.userOptions.buttons.csv,
384
- hasTable: e.value.userOptions.buttons.table,
385
- hasFullscreen: e.value.userOptions.buttons.fullscreen,
386
- isFullscreen: q.value,
387
- chartElement: w.value,
388
- position: e.value.userOptions.position,
389
- callbacks: e.value.userOptions.callbacks,
390
- printScale: e.value.userOptions.print.scale,
391
- titles: { ...e.value.userOptions.buttonTitles },
392
- hasAnnotator: e.value.userOptions.buttons.annotator,
393
- isAnnotation: F.value,
394
- onToggleFullscreen: Ie,
395
- onGeneratePdf: u(_e),
396
- onGenerateCsv: Fe,
397
- onGenerateImage: u($e),
398
- onToggleTable: Ne,
399
- onToggleAnnotator: ce,
400
- style: le({
401
- visibility: u(xe) ? u(ne) ? "visible" : "hidden" : "visible"
402
- })
403
- }, rt({ _: 2 }, [
404
- t.$slots.menuIcon ? {
405
- name: "menuIcon",
406
- fn: $(({ isOpen: l, color: h }) => [
407
- x(t.$slots, "menuIcon", W(X({ isOpen: l, color: h })), void 0, !0)
408
- ]),
409
- key: "0"
410
- } : void 0,
411
- t.$slots.optionPdf ? {
412
- name: "optionPdf",
413
- fn: $(() => [
414
- x(t.$slots, "optionPdf", {}, void 0, !0)
415
- ]),
416
- key: "1"
417
- } : void 0,
418
- t.$slots.optionCsv ? {
419
- name: "optionCsv",
420
- fn: $(() => [
421
- x(t.$slots, "optionCsv", {}, void 0, !0)
422
- ]),
423
- key: "2"
424
- } : void 0,
425
- t.$slots.optionImg ? {
426
- name: "optionImg",
427
- fn: $(() => [
428
- x(t.$slots, "optionImg", {}, void 0, !0)
429
- ]),
430
- key: "3"
431
- } : void 0,
432
- t.$slots.optionTable ? {
433
- name: "optionTable",
434
- fn: $(() => [
435
- x(t.$slots, "optionTable", {}, void 0, !0)
436
- ]),
437
- key: "4"
438
- } : void 0,
439
- t.$slots.optionFullscreen ? {
440
- name: "optionFullscreen",
441
- fn: $(({ toggleFullscreen: l, isFullscreen: h }) => [
442
- x(t.$slots, "optionFullscreen", W(X({ toggleFullscreen: l, isFullscreen: h })), void 0, !0)
443
- ]),
444
- key: "5"
445
- } : void 0,
446
- t.$slots.optionAnnotator ? {
447
- name: "optionAnnotator",
448
- fn: $(({ toggleAnnotator: l, isAnnotator: h }) => [
449
- x(t.$slots, "optionAnnotator", W(X({ toggleAnnotator: l, isAnnotator: h })), void 0, !0)
450
- ]),
451
- key: "6"
452
- } : void 0
453
- ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "chartElement", "position", "callbacks", "printScale", "titles", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : k("", !0),
454
- N.value ? (y(), g("svg", {
455
- key: 4,
456
- ref_key: "svgRef",
457
- ref: ge,
458
- xmlns: u(pt),
459
- viewBox: O.value,
460
- height: M.value.h,
461
- width: M.value.w,
462
- class: Me({ "vue-data-ui-fullscreen--on": q.value, "vue-data-ui-fulscreen--off": !q.value }),
463
- style: le(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color};background:${e.value.style.chart.backgroundColor};`)
464
- }, [
465
- ut(u(o)),
466
- t.$slots["chart-background"] ? (y(), g("foreignObject", {
467
- key: 0,
468
- x: O.value.x,
469
- y: O.value.y,
470
- width: O.value.width,
471
- height: O.value.height,
472
- style: {
473
- pointerEvents: "none"
474
- }
475
- }, [
476
- x(t.$slots, "chart-background", {}, void 0, !0)
477
- ], 8, Nt)) : k("", !0),
478
- (y(!0), g(ae, null, it(D.value, (l) => (y(), g(ae, null, [
479
- _("defs", null, [
480
- _("radialGradient", {
481
- id: l.id,
482
- fy: "30%"
483
- }, [
484
- _("stop", {
485
- offset: "10%",
486
- "stop-color": u(bt)(l.color, e.value.style.chart.circles.gradient.intensity / 100)
487
- }, null, 8, Et),
488
- _("stop", {
489
- offset: "90%",
490
- "stop-color": u(Ve)(l.color, 0.1)
491
- }, null, 8, Mt),
492
- _("stop", {
493
- offset: "100%",
494
- "stop-color": l.color
495
- }, null, 8, At)
496
- ], 8, Rt)
497
- ]),
498
- t.$slots.pattern ? (y(), g("g", Dt, [
499
- _("defs", null, [
500
- x(t.$slots, "pattern", Ae({ ref_for: !0 }, { ...l, patternId: `pattern_${P.value}_${l.id}` }), void 0, !0)
501
- ])
502
- ])) : k("", !0),
503
- _("rect", {
504
- x: l.x - l.r,
505
- y: l.y - l.r,
506
- width: l.r * 2,
507
- height: l.r * 2,
508
- stroke: e.value.style.chart.circles.stroke,
509
- "stroke-width": e.value.style.chart.circles.strokeWidth * U.value / 100,
510
- fill: e.value.style.chart.circles.gradient.show ? `url(#${l.id})` : l.color,
511
- rx: l.r,
512
- onMouseenter: () => Ze(l),
513
- onMouseout: s[0] || (s[0] = (h) => d.value = null),
514
- onClick: (h) => T("selectDatapoint", l)
515
- }, null, 40, Lt),
516
- t.$slots.pattern ? (y(), g("rect", {
517
- key: 1,
518
- x: l.x - l.r,
519
- y: l.y - l.r,
520
- width: l.r * 2,
521
- height: l.r * 2,
522
- stroke: e.value.style.chart.circles.stroke,
523
- "stroke-width": e.value.style.chart.circles.strokeWidth * U.value / 100,
524
- fill: `url(#pattern_${P.value}_${l.id})`,
525
- rx: l.r,
526
- style: {
527
- pointerEvents: "none"
528
- }
529
- }, null, 8, Vt)) : k("", !0),
530
- t.$slots["data-label"] ? x(t.$slots, "data-label", Ae({
531
- key: 2,
532
- ref_for: !0
533
- }, { ...l, createTSpans: u(gt), fontSize: { name: l.r / 3 * e.value.style.chart.circles.labels.name.fontSizeRatio, value: Oe(l) * e.value.style.chart.circles.labels.value.fontSizeRatio }, color: e.value.style.chart.circles.labels.name.color ? e.value.style.chart.circles.labels.name.color : u(Z)(l.color) }), void 0, !0) : (y(), g(ae, { key: 3 }, [
534
- e.value.style.chart.circles.labels.name.show && l.name ? (y(), g("text", {
535
- key: 0,
536
- style: {
537
- pointerEvents: "none",
538
- transition: "opacity 0.2s ease-in-out"
539
- },
540
- opacity: d.value && !F.value ? 0.2 : 1,
541
- x: l.x,
542
- y: l.y + Se(l.r, e.value.style.chart.circles.labels.name.offsetY) - l.r / 10,
543
- "font-size": l.r / 3 * e.value.style.chart.circles.labels.name.fontSizeRatio,
544
- fill: e.value.style.chart.circles.labels.name.color ? e.value.style.chart.circles.labels.name.color : u(Z)(l.color),
545
- "font-weight": e.value.style.chart.circles.labels.name.bold ? "bold" : "normal",
546
- "text-anchor": "middle"
547
- }, Y(l.name), 9, Bt)) : k("", !0),
548
- e.value.style.chart.circles.labels.value.show ? (y(), g("text", {
549
- key: 1,
550
- style: {
551
- pointerEvents: "none",
552
- transition: "opacity 0.2s ease-in-out"
553
- },
554
- opacity: d.value && !F.value ? 0.2 : 1,
555
- x: l.x,
556
- y: l.y + Se(l.r, e.value.style.chart.circles.labels.value.offsetY) + l.r / 2.5,
557
- "font-size": Oe(l) * e.value.style.chart.circles.labels.value.fontSizeRatio,
558
- fill: e.value.style.chart.circles.labels.value.color ? e.value.style.chart.circles.labels.value.color : u(Z)(l.color),
559
- "font-weight": e.value.style.chart.circles.labels.value.bold ? "bold" : "normal",
560
- "text-anchor": "middle"
561
- }, Y(ie(l)), 9, Ht)) : k("", !0)
562
- ], 64))
563
- ], 64))), 256)),
564
- d.value && e.value.style.chart.circles.zoom.show && !F.value ? (y(), g(ae, { key: 1 }, [
565
- _("circle", {
566
- style: le(Je.value),
567
- cx: d.value.x,
568
- cy: d.value.y,
569
- r: j.value,
570
- opacity: I.value,
571
- stroke: e.value.style.chart.circles.stroke,
572
- "stroke-width": e.value.style.chart.circles.strokeWidth * U.value / 100,
573
- fill: e.value.style.chart.circles.gradient.show ? `url(#${d.value.id})` : d.value.color
574
- }, null, 12, Ut),
575
- t.$slots["zoom-label"] ? (y(), g("g", jt, [
576
- x(t.$slots, "zoom-label", W(X({ ...d.value, zoomOpacity: I.value, currentRadius: j.value, fontSize: G.value })), void 0, !0)
577
- ])) : (y(), g("g", Gt, [
578
- _("text", {
579
- style: {
580
- pointerEvents: "none"
581
- },
582
- opacity: I.value,
583
- x: d.value.x,
584
- y: d.value.y + e.value.style.chart.circles.zoom.label.name.offsetY - G.value.name / 4,
585
- "text-anchor": "middle",
586
- "font-size": G.value.name,
587
- fill: e.value.style.chart.circles.zoom.label.name.color ? e.value.style.chart.circles.zoom.label.name.color : u(Z)(d.value.color),
588
- "font-weight": e.value.style.chart.circles.zoom.label.name.bold ? "bold" : "normal"
589
- }, Y(d.value.name), 9, qt),
590
- _("text", {
591
- style: {
592
- pointerEvents: "none"
593
- },
594
- opacity: I.value,
595
- x: d.value.x,
596
- y: d.value.y + G.value.value + e.value.style.chart.circles.zoom.label.value.offsetY,
597
- "text-anchor": "middle",
598
- "font-size": G.value.value,
599
- fill: e.value.style.chart.circles.zoom.label.value.color ? e.value.style.chart.circles.zoom.label.value.color : u(Z)(d.value.color),
600
- "font-weight": e.value.style.chart.circles.zoom.label.value.bold ? "bold" : "normal"
601
- }, Y(Ke()), 9, Wt)
602
- ]))
603
- ], 64)) : k("", !0),
604
- x(t.$slots, "svg", {
605
- svg: { ...O.value }
606
- }, void 0, !0)
607
- ], 14, Ft)) : k("", !0),
608
- N.value ? k("", !0) : (y(), B(u(n), {
609
- key: 5,
610
- config: {
611
- type: "circlePack",
612
- style: {
613
- color: "#CCCCCC"
614
- }
615
- }
616
- })),
617
- t.$slots.watermark ? (y(), g("div", Xt, [
618
- x(t.$slots, "watermark", W(X({ isPrinting: u(Ce) || u(ze) })), void 0, !0)
619
- ])) : k("", !0),
620
- t.$slots.source ? (y(), g("div", {
621
- key: 7,
622
- ref_key: "source",
623
- ref: We,
624
- dir: "auto"
625
- }, [
626
- x(t.$slots, "source", {}, void 0, !0)
627
- ], 512)) : k("", !0),
628
- N.value ? (y(), B(u(m), {
629
- key: 8,
630
- hideDetails: "",
631
- config: {
632
- open: H.value.showTable,
633
- maxHeight: 1e4,
634
- body: {
635
- backgroundColor: e.value.style.chart.backgroundColor,
636
- color: e.value.style.chart.color
637
- },
638
- head: {
639
- backgroundColor: e.value.style.chart.backgroundColor,
640
- color: e.value.style.chart.color
641
- }
642
- }
643
- }, {
644
- content: $(() => [
645
- (y(), B(u(c), {
646
- key: `table_${pe.value}`,
647
- colNames: te.value.colNames,
648
- head: te.value.head,
649
- body: te.value.body,
650
- config: te.value.config,
651
- title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
652
- onClose: s[1] || (s[1] = (l) => H.value.showTable = !1)
653
- }, {
654
- th: $(({ th: l }) => [
655
- _("div", {
656
- innerHTML: l,
657
- style: { display: "flex", "align-items": "center" }
658
- }, null, 8, Yt)
659
- ]),
660
- td: $(({ td: l }) => [
661
- ct(Y(l.name || l), 1)
662
- ]),
663
- _: 1
664
- }, 8, ["colNames", "head", "body", "config", "title"]))
665
- ]),
666
- _: 1
667
- }, 8, ["config"])) : k("", !0)
668
- ], 46, It));
669
- }
670
- }, rl = /* @__PURE__ */ St(Zt, [["__scopeId", "data-v-49649767"]]);
671
- export {
672
- rl as default
673
- };