vue-data-ui 3.22.6 → 3.22.7

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 (191) hide show
  1. package/dist/{Arrow-Ds4xmpiQ.js → Arrow-DaGI9u-b.js} +1 -1
  2. package/dist/{BaseDraggableDialog-VbypEaAa.js → BaseDraggableDialog-1wwwdwV2.js} +2 -2
  3. package/dist/{BaseIcon-DcUvOfxf.js → BaseIcon-_-BX7be3.js} +1 -1
  4. package/dist/{BaseLegendToggle-DFwIY5bE.js → BaseLegendToggle-CHnlKalt.js} +1 -1
  5. package/dist/{BaseZoomControls-DwolSINF.js → BaseZoomControls-C9bdZSCj.js} +2 -2
  6. package/dist/{ColorPicker-UVDPcrjE.js → ColorPicker-TB3KhY3j.js} +2 -2
  7. package/dist/{DataTable-CXfvIulC.js → DataTable-CVF7DoZn.js} +2 -2
  8. package/dist/{Legend-D-635Kag.js → Legend-kAr7Vqqu.js} +2 -2
  9. package/dist/{NonSvgPenAndPaper-pR_1qp3s.js → NonSvgPenAndPaper-CEiv7_gM.js} +29 -29
  10. package/dist/{PackageVersion-Da7hl-34.js → PackageVersion-Dse0n05o.js} +1 -1
  11. package/dist/{PenAndPaper-Bk2-E7V4.js → PenAndPaper-gaV1QPpP.js} +18 -18
  12. package/dist/{Shape-BSetplwm.js → Shape-CiQIxyyT.js} +1 -1
  13. package/dist/{Slicer-ClIGOuoX.js → Slicer-6FOtg9py.js} +2 -2
  14. package/dist/{SlicerPreview-D1n9AW39.js → SlicerPreview-DUywypFu.js} +4 -4
  15. package/dist/{SparkTooltip-CjDAyolg.js → SparkTooltip-B-qsPj68.js} +1 -1
  16. package/dist/{Title-C-p0ilWB.js → Title-PiTKr6sp.js} +1 -1
  17. package/dist/{Tooltip-YabpoXo1.js → Tooltip-B8yYfISA.js} +1 -1
  18. package/dist/{UserOptions-BO4VFL8O.js → UserOptions-BL9VlHop.js} +2 -2
  19. package/dist/components/arrow.js +1 -1
  20. package/dist/components/vue-ui-3d-bar.js +1 -1
  21. package/dist/components/vue-ui-accordion.js +1 -1
  22. package/dist/components/vue-ui-age-pyramid.js +1 -1
  23. package/dist/components/vue-ui-annotator.js +1 -1
  24. package/dist/components/vue-ui-bullet.js +1 -1
  25. package/dist/components/vue-ui-bump.js +1 -1
  26. package/dist/components/vue-ui-candlestick.js +1 -1
  27. package/dist/components/vue-ui-carousel-table.js +1 -1
  28. package/dist/components/vue-ui-chestnut.js +1 -1
  29. package/dist/components/vue-ui-chord.js +1 -1
  30. package/dist/components/vue-ui-circle-pack.js +1 -1
  31. package/dist/components/vue-ui-cursor.js +1 -1
  32. package/dist/components/vue-ui-dag.js +1 -1
  33. package/dist/components/vue-ui-dashboard.js +1 -1
  34. package/dist/components/vue-ui-digits.js +1 -1
  35. package/dist/components/vue-ui-donut-evolution.js +1 -1
  36. package/dist/components/vue-ui-donut.js +1 -1
  37. package/dist/components/vue-ui-dumbbell.js +1 -1
  38. package/dist/components/vue-ui-flow.js +1 -1
  39. package/dist/components/vue-ui-funnel.js +1 -1
  40. package/dist/components/vue-ui-galaxy.js +1 -1
  41. package/dist/components/vue-ui-gauge.js +1 -1
  42. package/dist/components/vue-ui-geo.js +1 -1
  43. package/dist/components/vue-ui-gizmo.js +1 -1
  44. package/dist/components/vue-ui-heatmap.js +1 -1
  45. package/dist/components/vue-ui-history-plot.js +1 -1
  46. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  47. package/dist/components/vue-ui-icon.js +1 -1
  48. package/dist/components/vue-ui-kpi.js +1 -1
  49. package/dist/components/vue-ui-mini-loader.js +1 -1
  50. package/dist/components/vue-ui-molecule.js +1 -1
  51. package/dist/components/vue-ui-mood-radar.js +1 -1
  52. package/dist/components/vue-ui-nested-donuts.js +1 -1
  53. package/dist/components/vue-ui-onion.js +1 -1
  54. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  55. package/dist/components/vue-ui-quadrant.js +1 -1
  56. package/dist/components/vue-ui-quick-chart.js +1 -1
  57. package/dist/components/vue-ui-radar.js +1 -1
  58. package/dist/components/vue-ui-rating.js +1 -1
  59. package/dist/components/vue-ui-relation-circle.js +1 -1
  60. package/dist/components/vue-ui-ridgeline.js +1 -1
  61. package/dist/components/vue-ui-rings.js +1 -1
  62. package/dist/components/vue-ui-scatter.js +1 -1
  63. package/dist/components/vue-ui-skeleton.js +1 -1
  64. package/dist/components/vue-ui-smiley.js +1 -1
  65. package/dist/components/vue-ui-spark-trend.js +1 -1
  66. package/dist/components/vue-ui-sparkbar.js +1 -1
  67. package/dist/components/vue-ui-sparkgauge.js +1 -1
  68. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  69. package/dist/components/vue-ui-sparkline.js +1 -1
  70. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  71. package/dist/components/vue-ui-stackbar.js +1 -1
  72. package/dist/components/vue-ui-stackline.js +1 -1
  73. package/dist/components/vue-ui-strip-plot.js +1 -1
  74. package/dist/components/vue-ui-table-heatmap.js +1 -1
  75. package/dist/components/vue-ui-table-sparkline.js +1 -1
  76. package/dist/components/vue-ui-table.js +1 -1
  77. package/dist/components/vue-ui-thermometer.js +1 -1
  78. package/dist/components/vue-ui-timer.js +1 -1
  79. package/dist/components/vue-ui-tiremarks.js +1 -1
  80. package/dist/components/vue-ui-treemap.js +1 -1
  81. package/dist/components/vue-ui-vertical-bar.js +1 -1
  82. package/dist/components/vue-ui-waffle.js +1 -1
  83. package/dist/components/vue-ui-wheel.js +1 -1
  84. package/dist/components/vue-ui-word-cloud.js +1 -1
  85. package/dist/components/vue-ui-world.js +1 -1
  86. package/dist/components/vue-ui-xy-canvas.js +1 -1
  87. package/dist/components/vue-ui-xy.js +1 -1
  88. package/dist/{dom-to-png-CVJfsfwL.js → dom-to-png-BZjYWNEg.js} +1 -1
  89. package/dist/exposedLib-Be0ifkti.js +19 -0
  90. package/dist/{img-B_y5qDdm.js → img-B_abIg0o.js} +1 -1
  91. package/dist/{labelUtils-CyVwqXSh.js → labelUtils-CTDRZdP1.js} +1 -1
  92. package/dist/{lib-DRBJCmHW.js → lib-EAmk-PgA.js} +14 -1
  93. package/dist/{package-DyQ_PQis.js → package-DeMimPej.js} +1 -1
  94. package/dist/{pdf-CG02qhAH.js → pdf-B6qrdEqB.js} +1 -1
  95. package/dist/{render-common-CUAlQvAQ.js → render-common-DMai0gHB.js} +2 -2
  96. package/dist/ssr/vue-ui-donut.js +1 -1
  97. package/dist/ssr/vue-ui-xy.js +1 -1
  98. package/dist/ssr.js +2 -2
  99. package/dist/style.css +1 -1
  100. package/dist/{useAutoSizeLabelsInsideViewbox-DPMOys9n.js → useAutoSizeLabelsInsideViewbox-CyOGrdD_.js} +1 -1
  101. package/dist/{useNestedProp-BEo2N1Db.js → useNestedProp-D8XqxgOU.js} +1 -1
  102. package/dist/{usePrinter-CRp5IW3v.js → usePrinter-DnGzpp6Q.js} +2 -2
  103. package/dist/utils.js +10 -10
  104. package/dist/{vue-data-ui-Bpu4kxlm.js → vue-data-ui-D6qVWloL.js} +68 -68
  105. package/dist/vue-data-ui.js +72 -72
  106. package/dist/vue-ui-3d-bar-CjNuWXoA.js +1757 -0
  107. package/dist/{vue-ui-accordion-CfMrbDoq.js → vue-ui-accordion-Dzz8XhX3.js} +3 -3
  108. package/dist/{vue-ui-age-pyramid-BF5ZuuyI.js → vue-ui-age-pyramid-CC7Dxli-.js} +21 -21
  109. package/dist/{vue-ui-annotator-CG6rhFpy.js → vue-ui-annotator-DXZumSP8.js} +67 -67
  110. package/dist/{vue-ui-bullet-C_oBS1cr.js → vue-ui-bullet-Dde6FhbR.js} +17 -17
  111. package/dist/{vue-ui-bump-BZB1Na8h.js → vue-ui-bump-C5pni1JV.js} +243 -243
  112. package/dist/{vue-ui-candlestick-8d_1xO8X.js → vue-ui-candlestick-Ctw65O4_.js} +449 -446
  113. package/dist/{vue-ui-carousel-table-BfZNcwmY.js → vue-ui-carousel-table-BEUvhUH0.js} +42 -42
  114. package/dist/vue-ui-chestnut-C3IbAdkQ.js +2010 -0
  115. package/dist/vue-ui-chord-5eCWG4br.js +1391 -0
  116. package/dist/{vue-ui-circle-pack-BLh8HnGK.js → vue-ui-circle-pack-Cq4lkmee.js} +31 -31
  117. package/dist/{vue-ui-cursor-DVsEm_4l.js → vue-ui-cursor-DLJcFwRZ.js} +3 -3
  118. package/dist/{vue-ui-dag-Cfi0b9qm.js → vue-ui-dag-DemsIecS.js} +23 -23
  119. package/dist/{vue-ui-dashboard-F_NZ1xoQ.js → vue-ui-dashboard-DWHD_wNN.js} +69 -69
  120. package/dist/{vue-ui-digits-BfP1kbj3.js → vue-ui-digits-sIKc85vS.js} +3 -3
  121. package/dist/{vue-ui-donut-BwAyvV3-.js → vue-ui-donut-CLheJPcO.js} +414 -414
  122. package/dist/{vue-ui-donut-DlVRnVr_.js → vue-ui-donut-Dp6GW0dw.js} +85 -85
  123. package/dist/{vue-ui-donut-evolution-D1k4u6cA.js → vue-ui-donut-evolution-zmRPpJLj.js} +419 -419
  124. package/dist/vue-ui-dumbbell-bSbgHd0U.js +1530 -0
  125. package/dist/{vue-ui-flow-D_7Idmmw.js → vue-ui-flow-q_M7O1BK.js} +83 -83
  126. package/dist/vue-ui-funnel-BEZUEuuh.js +777 -0
  127. package/dist/{vue-ui-galaxy-Bjxbg5_B.js → vue-ui-galaxy-DCCWmIyH.js} +250 -250
  128. package/dist/{vue-ui-gauge-Dt0H7DgC.js → vue-ui-gauge-B1ljgfE1.js} +216 -216
  129. package/dist/{vue-ui-geo-89DEQb5l.js → vue-ui-geo-CM59rpnj.js} +17 -17
  130. package/dist/{vue-ui-gizmo-CQyLK18v.js → vue-ui-gizmo-D2RL6IVp.js} +62 -62
  131. package/dist/{vue-ui-heatmap-o6MvoxBK.js → vue-ui-heatmap-BX6PQxML.js} +245 -245
  132. package/dist/vue-ui-history-plot-DaHAeQph.js +1715 -0
  133. package/dist/{vue-ui-horizontal-bar-CwB4sc6M.js → vue-ui-horizontal-bar-CTW6l4n3.js} +274 -274
  134. package/dist/{vue-ui-kpi-4C-j92D-.js → vue-ui-kpi-DLbP7lJR.js} +3 -3
  135. package/dist/{vue-ui-mini-loader-Bj4Wv-i8.js → vue-ui-mini-loader-DPHzHsM7.js} +2 -2
  136. package/dist/vue-ui-molecule-aD0SMTiX.js +925 -0
  137. package/dist/{vue-ui-mood-radar-B5W35Fvp.js → vue-ui-mood-radar-CCWaPr0P.js} +29 -29
  138. package/dist/{vue-ui-nested-donuts-wfesrzle.js → vue-ui-nested-donuts--BCPWkl7.js} +104 -104
  139. package/dist/{vue-ui-onion-B8-psLbF.js → vue-ui-onion-s4iMCGAP.js} +39 -39
  140. package/dist/vue-ui-parallel-coordinate-plot-CfgvpyoC.js +1416 -0
  141. package/dist/vue-ui-quadrant-T_UmRAAy.js +1978 -0
  142. package/dist/vue-ui-quick-chart-D1OWBgQJ.js +2469 -0
  143. package/dist/{vue-ui-radar-5fQ5AAWD.js → vue-ui-radar-CHjeGOMC.js} +78 -78
  144. package/dist/{vue-ui-rating-CKWHDKOT.js → vue-ui-rating-Bek8Tgr-.js} +33 -33
  145. package/dist/vue-ui-relation-circle-DRZGQ_UX.js +924 -0
  146. package/dist/{vue-ui-ridgeline-DVbYznRz.js → vue-ui-ridgeline-DIODGiu8.js} +101 -101
  147. package/dist/vue-ui-rings-CcdUSXGG.js +1246 -0
  148. package/dist/vue-ui-scatter-CixnqLoi.js +2413 -0
  149. package/dist/{vue-ui-skeleton-BkxB6Dik.js → vue-ui-skeleton-Fmue6DAG.js} +3 -3
  150. package/dist/{vue-ui-smiley-C4g0iaF7.js → vue-ui-smiley-BVMI5vUy.js} +9 -9
  151. package/dist/{vue-ui-spark-trend-0FELlq4x.js → vue-ui-spark-trend-DfZeLiWA.js} +98 -98
  152. package/dist/{vue-ui-sparkbar-D-i_VLO6.js → vue-ui-sparkbar-Cl1e49sw.js} +87 -87
  153. package/dist/{vue-ui-sparkgauge-CWw6w_ng.js → vue-ui-sparkgauge-DDNNBIdf.js} +48 -48
  154. package/dist/{vue-ui-sparkhistogram-DuGpkfma.js → vue-ui-sparkhistogram-ny_liYa6.js} +104 -104
  155. package/dist/{vue-ui-sparkline-Bi06lHQd.js → vue-ui-sparkline-BNxdO-Bx.js} +268 -268
  156. package/dist/vue-ui-sparkstackbar-BfF5-Wg2.js +662 -0
  157. package/dist/vue-ui-stackbar-B-2Me3d-.js +2332 -0
  158. package/dist/{vue-ui-stackline-C0NHBUaE.js → vue-ui-stackline-CdvVPQUM.js} +697 -694
  159. package/dist/{vue-ui-strip-plot-_6LL45i9.js → vue-ui-strip-plot-CRXPXA5V.js} +368 -368
  160. package/dist/{vue-ui-table-DBlZswRi.js → vue-ui-table-Dr1dK3d_.js} +25 -25
  161. package/dist/{vue-ui-table-heatmap-3xYIDKcP.js → vue-ui-table-heatmap-D-Qrm3oX.js} +5 -5
  162. package/dist/{vue-ui-table-sparkline-BH5PzEnJ.js → vue-ui-table-sparkline-C31Q32My.js} +201 -201
  163. package/dist/{vue-ui-thermometer-BxMzAqoT.js → vue-ui-thermometer-BUrtIfuo.js} +119 -119
  164. package/dist/{vue-ui-timer-ONSitYDm.js → vue-ui-timer-B5bkNNHS.js} +29 -29
  165. package/dist/{vue-ui-tiremarks-DWXM-9nR.js → vue-ui-tiremarks-Bn8b-ZSz.js} +14 -14
  166. package/dist/vue-ui-treemap-LMWiicop.js +1713 -0
  167. package/dist/{vue-ui-waffle-afa8HSxz.js → vue-ui-waffle-B_L3gkky.js} +306 -306
  168. package/dist/{vue-ui-wheel-DRP7X8S2.js → vue-ui-wheel-CeVwXtEX.js} +36 -36
  169. package/dist/{vue-ui-word-cloud-AKpMO97a.js → vue-ui-word-cloud-D81-qJLw.js} +37 -37
  170. package/dist/{vue-ui-world-CqS-HhZl.js → vue-ui-world-B7npRmTa.js} +399 -399
  171. package/dist/{vue-ui-xy-Bmd11BxR.js → vue-ui-xy-C2p9H2IX.js} +1438 -1436
  172. package/dist/{vue-ui-xy-DJ8YKPgs.js → vue-ui-xy-OhwS0kcZ.js} +218 -218
  173. package/dist/{vue-ui-xy-canvas-DO_PDGKf.js → vue-ui-xy-canvas-DLKDdH35.js} +420 -417
  174. package/package.json +1 -1
  175. package/dist/exposedLib-CjwriUaG.js +0 -19
  176. package/dist/vue-ui-3d-bar-BAH0jNtT.js +0 -1757
  177. package/dist/vue-ui-chestnut-Cx8T3NEl.js +0 -2010
  178. package/dist/vue-ui-chord-B-sauvLo.js +0 -1391
  179. package/dist/vue-ui-dumbbell-DgmvPpK2.js +0 -1530
  180. package/dist/vue-ui-funnel-BYCFV5TD.js +0 -777
  181. package/dist/vue-ui-history-plot-B7zuCfdg.js +0 -1715
  182. package/dist/vue-ui-molecule-BDrRmwmm.js +0 -925
  183. package/dist/vue-ui-parallel-coordinate-plot-DBpHCFxa.js +0 -1416
  184. package/dist/vue-ui-quadrant-BzyGOJR2.js +0 -1978
  185. package/dist/vue-ui-quick-chart-so_8PzvS.js +0 -2469
  186. package/dist/vue-ui-relation-circle-Bd_ONHCz.js +0 -924
  187. package/dist/vue-ui-rings-c-yLWFHr.js +0 -1246
  188. package/dist/vue-ui-scatter-QhmE7n1H.js +0 -2413
  189. package/dist/vue-ui-sparkstackbar-DrKgBUmt.js +0 -662
  190. package/dist/vue-ui-stackbar-DDvuDGQ_.js +0 -2329
  191. package/dist/vue-ui-treemap-B03c4RIy.js +0 -1713
@@ -1,1713 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { At as t, Dt as n, Ht as r, J as i, Q as a, S as o, W as s, Wt as c, X as l, _t as u, at as d, b as f, i as ee, q as te, r as ne, t as re, w as ie, wt as ae } from "./lib-DRBJCmHW.js";
3
- import { t as oe } from "./useConfig-DYM3f6EI.js";
4
- import { t as se } from "./usePrinter-CRp5IW3v.js";
5
- import { n as ce, t as le } from "./BaseScanner-DZvpgOjM.js";
6
- import { t as ue } from "./useSvgExport-SVIsDot8.js";
7
- import { t as de } from "./useNestedProp-BEo2N1Db.js";
8
- import { t as fe } from "./useThemeCheck-C43Tcqmk.js";
9
- import { t as pe } from "./img-B_y5qDdm.js";
10
- import { n as me } from "./Title-C-p0ilWB.js";
11
- import { t as he } from "./_plugin-vue_export-helper-B3ysoDQm.js";
12
- import { c as ge } from "./canvas-lib-BOP_HS11.js";
13
- import { t as _e } from "./useResponsive-BfnK0KxU.js";
14
- import { t as ve } from "./BaseIcon-DcUvOfxf.js";
15
- import { t as ye } from "./BaseLegendToggle-DFwIY5bE.js";
16
- import { t as be } from "./A11yDataTable-DdRsVULz.js";
17
- import { t as xe } from "./useUserOptionState-DK-_1ddE.js";
18
- import { t as Se } from "./useChartAccessibility-DYqac8yF.js";
19
- import { t as Ce } from "./Legend-D-635Kag.js";
20
- import { t as we } from "./usePrefersMotion-BC-CsqR1.js";
21
- import { t as Te } from "./usePanZoom-CYU3B4T3.js";
22
- import { t as Ee } from "./vue_ui_treemap-DoEtkRN6.js";
23
- import { Fragment as p, Teleport as De, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createSlots as Oe, createTextVNode as ke, createVNode as Ae, defineAsyncComponent as je, guardReactiveProps as y, mergeProps as Me, nextTick as Ne, normalizeClass as Pe, normalizeProps as b, normalizeStyle as x, onBeforeUnmount as Fe, onMounted as Ie, openBlock as S, ref as C, renderList as Le, renderSlot as w, resolveDynamicComponent as Re, shallowRef as T, toDisplayString as ze, toRefs as Be, unref as E, useCssVars as Ve, useSlots as He, watch as D, withCtx as O, withKeys as Ue, withModifiers as We } from "vue";
24
- //#region src/treemap.js
25
- function Ge(e, t) {
26
- let n = e.length;
27
- if (n === 0) throw Error(`Max aspect ratio cannot be computed: ${e} is an empty array`);
28
- {
29
- let r = Infinity, i = -Infinity, a = 0;
30
- for (let t = 0; t < n; t += 1) {
31
- let n = e[t].normalizedValue;
32
- n < r && (r = n), n > i && (i = n), a += n;
33
- }
34
- return Math.max(t ** 2 * i / a ** 2, a ** 2 / (t ** 2 * r));
35
- }
36
- }
37
- function Ke(e) {
38
- let { xOffset: t, yOffset: n, width: r, height: i } = e;
39
- return {
40
- x0: t,
41
- y0: n,
42
- x1: t + r,
43
- y1: n + i
44
- };
45
- }
46
- function qe(e, t, n) {
47
- if (e.length === 0) return !0;
48
- {
49
- let r = e.concat(t);
50
- return Ge(e, n) >= Ge(r, n);
51
- }
52
- }
53
- function Je(e) {
54
- let t = [], n = e.length;
55
- for (let r = 0; r < n; r += 1) {
56
- let n = e[r], i = n.length;
57
- for (let e = 0; e < i; e += 1) t.push(n[e]);
58
- }
59
- return t;
60
- }
61
- function Ye(e, t) {
62
- return nt({
63
- ...t,
64
- children: e
65
- });
66
- }
67
- function Xe(e) {
68
- return (e.x1 - e.x0) * (e.y1 - e.y0);
69
- }
70
- function Ze(e, t) {
71
- let { width: n, height: r, xOffset: i, yOffset: a } = et(t), o = e.length, s = e.map((e) => e.normalizedValue || 0).reduce((e, t) => e + t, 0), c = s / r, l = s / n, u = i, d = a, f = [];
72
- if (n >= r) {
73
- for (let t = 0; t < o; t += 1) {
74
- let n = e[t], r = d + n.normalizedValue / c, i = {
75
- x0: u,
76
- y0: d,
77
- x1: u + c,
78
- y1: r
79
- }, a = Object.assign({}, n, i);
80
- d = r, f.push(a);
81
- }
82
- return f;
83
- } else {
84
- for (let t = 0; t < o; t += 1) {
85
- let n = e[t], r = u + n.normalizedValue / l, i = {
86
- x0: u,
87
- y0: d,
88
- x1: r,
89
- y1: d + l
90
- }, a = Object.assign({}, n, i);
91
- u = r, f.push(a);
92
- }
93
- return f;
94
- }
95
- }
96
- function Qe(e) {
97
- let t = et(e), n = t.width, r = t.height;
98
- return Math.min(n, r);
99
- }
100
- function $e(e, t) {
101
- let n = e.length, r = t / e.map((e) => e.value ?? 0).reduce((e, t) => e + t, 0), i = [], a, o;
102
- for (let t = 0; t < n; t += 1) o = e[t], a = Object.assign({}, o, { normalizedValue: o.value * (r || 0) }), i.push(a);
103
- return i;
104
- }
105
- function et(e) {
106
- let { x0: t, y0: n, x1: r, y1: i } = e;
107
- return {
108
- xOffset: t,
109
- yOffset: n,
110
- width: r - t,
111
- height: i - n
112
- };
113
- }
114
- function tt(e, t, n, r) {
115
- let i = e, a = t, o = n, s = r;
116
- for (;;) {
117
- let e = i.length;
118
- if (e === 0) {
119
- let e = Ze(a, o);
120
- return s.concat(e);
121
- }
122
- let t = Qe(o), n = i[0], r = i.slice(1, e);
123
- if (qe(a, n, t)) {
124
- let e = a.concat(n);
125
- i = r, a = e, o = o, s = s;
126
- } else {
127
- let e = a.length, t = 0;
128
- for (let n = 0; n < e; n += 1) t += a[n].normalizedValue;
129
- let n = k(o, t), r = Ze(a, o), c = s.concat(r);
130
- i = i, a = [], o = n, s = c;
131
- }
132
- }
133
- }
134
- function nt(e) {
135
- if (e.children === void 0 || !e.children.length) return [e];
136
- {
137
- let t = tt($e(e.children, Xe(e)), [], e, []), n = t.length, r = [];
138
- for (let e = 0; e < n; e += 1) r.push(nt(t[e]));
139
- return Je(r);
140
- }
141
- }
142
- function k(e, t) {
143
- let { width: n, height: r, xOffset: i, yOffset: a } = et(e);
144
- if (n >= r) {
145
- let e = t / r, o = n - e;
146
- return Ke({
147
- xOffset: i + e,
148
- yOffset: a,
149
- width: o,
150
- height: r
151
- });
152
- } else {
153
- let e = t / n, o = r - e;
154
- return Ke({
155
- xOffset: i,
156
- yOffset: a + e,
157
- width: n,
158
- height: o
159
- });
160
- }
161
- }
162
- //#endregion
163
- //#region src/components/vue-ui-treemap.vue
164
- var rt = /* @__PURE__ */ e({ default: () => Nt }), it = ["id"], at = ["id"], ot = ["id"], st = [
165
- "tabindex",
166
- "onClick",
167
- "onKeydown",
168
- "data-last-crumb",
169
- "onMouseenter",
170
- "onFocus"
171
- ], ct = { class: "vue-ui-treemap-crumb-unit" }, lt = { class: "vue-ui-treemap-crumb-unit-label" }, ut = {
172
- key: 0,
173
- style: {
174
- width: "24px",
175
- display: "flex",
176
- "align-items": "center"
177
- }
178
- }, dt = {
179
- key: 0,
180
- class: "vue-ui-treemap-crumb-unit-arrow"
181
- }, ft = { style: { position: "relative" } }, pt = [
182
- "xmlns",
183
- "aria-describedby",
184
- "viewBox"
185
- ], mt = { key: 0 }, ht = ["id"], gt = ["stop-color"], _t = ["stop-color"], vt = [
186
- "x",
187
- "y",
188
- "height",
189
- "width",
190
- "fill",
191
- "rx",
192
- "stroke",
193
- "stroke-width",
194
- "onClick",
195
- "onMouseenter",
196
- "onMouseleave"
197
- ], yt = ["id"], bt = [
198
- "x",
199
- "y",
200
- "width",
201
- "height"
202
- ], xt = ["clip-path"], St = [
203
- "transform",
204
- "fill",
205
- "font-size",
206
- "font-family",
207
- "font-weight"
208
- ], Ct = { key: 0 }, wt = [
209
- "x",
210
- "y",
211
- "height",
212
- "width"
213
- ], Tt = {
214
- style: {
215
- width: "100%",
216
- height: "100%",
217
- overflow: "hidden"
218
- },
219
- class: "vue-ui-treemap-cell"
220
- }, Et = {
221
- key: 0,
222
- "data-dom-to-png-ignore": "",
223
- class: "reset-wrapper"
224
- }, Dt = {
225
- key: 1,
226
- style: {
227
- position: "absolute",
228
- top: "100%",
229
- left: "0",
230
- width: "100%"
231
- },
232
- "data-dom-to-png-ignore": "",
233
- "aria-hidden": "true"
234
- }, Ot = {
235
- key: 6,
236
- class: "vue-data-ui-watermark"
237
- }, kt = ["id"], At = ["onClick"], jt = ["innerHTML"], Mt = 4, Nt = /*#__PURE__*/ he({
238
- __name: "vue-ui-treemap",
239
- props: {
240
- config: {
241
- type: Object,
242
- default() {
243
- return {};
244
- }
245
- },
246
- dataset: {
247
- type: Array,
248
- default() {
249
- return [];
250
- }
251
- }
252
- },
253
- emits: [
254
- "selectLegend",
255
- "selectDatapoint",
256
- "copyAlt"
257
- ],
258
- setup(e, { expose: he, emit: Ge }) {
259
- Ve((e) => ({ v76935d24: pi.value }));
260
- let Ke = je(() => import("./DataTable-CXfvIulC.js")), qe = je(() => import("./PenAndPaper-Bk2-E7V4.js").then((e) => e.t)), Je = je(() => import("./vue-ui-accordion-CfMrbDoq.js").then((e) => e.n)), Xe = je(() => import("./Tooltip-YabpoXo1.js")), Ze = je(() => import("./UserOptions-BO4VFL8O.js").then((e) => e.n)), Qe = je(() => import("./PackageVersion-Da7hl-34.js").then((e) => e.t)), $e = je(() => import("./BaseDraggableDialog-VbypEaAa.js").then((e) => e.n)), { vue_ui_treemap: et } = oe(), { isThemeValid: tt, warnInvalidTheme: nt } = fe(), k = e, rt = Ge, Nt = He(), Pt = we();
261
- Ie(() => {
262
- Nt["chart-background"] && console.warn("VueUiTreemap does not support the #chart-background slot.");
263
- });
264
- let Ft = m(() => !!k.dataset && k.dataset.length), It = m(() => /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), A = C(s()), Lt = C(!1), Rt = C(""), zt = C(!1), Bt = C(0), j = C([]), M = T(null), Vt = T(null), Ht = T(null), Ut = T(null), Wt = T(null), Gt = C(0), Kt = C(0), qt = C(0), N = C([]), Jt = C(null), Yt = C(!1), Xt = C(null), Zt = C(null), Qt = C(null), $t = C(/* @__PURE__ */ new Map()), en = C(!1), tn = C(!1), P = C(null), nn = C({
265
- x: 0,
266
- y: 0
267
- }), rn = C("pointer"), an = C(!1), F = C(fn()), I = m(() => F.value.userOptions.useCursorPointer), on = m(() => c({
268
- defaultConfig: {
269
- userOptions: { show: !1 },
270
- style: { chart: {
271
- backgroundColor: "#999999",
272
- layout: {
273
- labels: { showDefaultLabels: !1 },
274
- rects: { stroke: "#6A6A6A" }
275
- },
276
- legend: { backgroundColor: "transparent" }
277
- } }
278
- },
279
- userConfig: F.value.skeletonConfig ?? {}
280
- })), { loading: L, FINAL_DATASET: sn, manualLoading: cn } = ce({
281
- ...Be(k),
282
- FINAL_CONFIG: F,
283
- prepareConfig: fn,
284
- skeletonDataset: k.config?.skeletonDataset ?? [{
285
- name: "_",
286
- value: 53,
287
- color: "#CACACA90",
288
- children: [
289
- {
290
- name: "_",
291
- value: 21
292
- },
293
- {
294
- name: "_",
295
- value: 13
296
- },
297
- {
298
- name: "_",
299
- value: 8
300
- },
301
- {
302
- name: "_",
303
- value: 5
304
- },
305
- {
306
- name: "_",
307
- value: 3
308
- },
309
- {
310
- name: "_",
311
- value: 2
312
- },
313
- {
314
- name: "_",
315
- value: 1
316
- }
317
- ]
318
- }],
319
- skeletonConfig: c({
320
- defaultConfig: F.value,
321
- userConfig: on.value
322
- })
323
- }), { userOptionsVisible: ln, setUserOptionsVisibility: un, keepUserOptionState: dn } = xe({ config: F.value }), { svgRef: R } = Se({ config: F.value.style.chart.title });
324
- function fn() {
325
- let e = de({
326
- userConfig: k.config,
327
- defaultConfig: et
328
- }), n = e.theme;
329
- if (!n) return e;
330
- if (!tt.value(e)) return nt(e), e;
331
- let i = de({
332
- userConfig: Ee[n] || k.config,
333
- defaultConfig: e
334
- }), a = de({
335
- userConfig: k.config,
336
- defaultConfig: i
337
- });
338
- return {
339
- ...a,
340
- customPalette: a.customPalette.length ? a.customPalette : r[n] || t
341
- };
342
- }
343
- D(() => k.config, (e) => {
344
- L.value || (F.value = fn()), ln.value = !F.value.userOptions.showOnChartHover, Gt.value += 1, Kt.value += 1, qt.value += 1, z.value.showTable = F.value.table.show, z.value.showTooltip = F.value.style.chart.tooltip.show, z.value.showZoom = F.value.style.chart.zoom?.show ?? !1;
345
- }, { deep: !0 });
346
- let { isPrinting: pn, isImaging: mn, generatePdf: hn, generateImage: gn } = se({
347
- elementId: `treemap_${A.value}`,
348
- fileName: F.value.style.chart.title.text || "vue-ui-treemap",
349
- options: F.value.userOptions.print
350
- }), _n = m(() => F.value.userOptions.show && !F.value.style.chart.title.text), vn = m(() => o(F.value.customPalette)), z = C({
351
- showTable: F.value.table.show,
352
- showTooltip: F.value.style.chart.tooltip.show,
353
- showZoom: F.value.style.chart.zoom?.show ?? !1
354
- });
355
- D(F, () => {
356
- z.value = {
357
- showTable: F.value.table.show,
358
- showTooltip: F.value.style.chart.tooltip.show,
359
- showZoom: F.value.style.chart.zoom?.show ?? !1
360
- };
361
- }, { immediate: !0 });
362
- let B = C({
363
- height: F.value.style.chart.height,
364
- width: F.value.style.chart.width
365
- });
366
- function yn(e) {
367
- let t = M.value, n = B.value.height;
368
- return !t || !n ? e : e * (n / t.getBoundingClientRect().height);
369
- }
370
- function bn() {
371
- if (!Jt.value || X.value.length <= 1) return 0;
372
- let e = Jt.value, t = getComputedStyle(e);
373
- return yn(e.offsetHeight + parseFloat(t.marginTop || "0") + parseFloat(t.marginBottom || "0") + parseFloat(t.paddingTop || "0") + parseFloat(t.paddingBottom || "0"));
374
- }
375
- let V = m(() => {
376
- let e = F.value.style.chart.padding, t = B.value.width, n = B.value.height, r = bn(), i = e.left, a = t - e.right, o = e.top, s = n - e.bottom - r;
377
- return {
378
- left: i,
379
- top: o,
380
- right: a,
381
- bottom: s,
382
- width: a - i,
383
- height: Math.max(0, s - o),
384
- vbWidth: t,
385
- vbHeight: n - r,
386
- offsetY: r
387
- };
388
- }), H = C(i(sn.value)), U = C(H.value), xn = T(/* @__PURE__ */ new Map());
389
- D([H, () => F.value], () => {
390
- Qt.value = null, $t.value = /* @__PURE__ */ new Map();
391
- }, { deep: !0 }), D(() => j.value, () => {
392
- Qt.value = null, $t.value = /* @__PURE__ */ new Map(), Tn(), qt.value += 1, Kt.value += 1;
393
- }, { deep: !0 }), D([() => B.value.width, () => B.value.height], () => {
394
- $t.value = /* @__PURE__ */ new Map();
395
- });
396
- function Sn(e) {
397
- Array.isArray(e) && e.forEach((e, n) => {
398
- e.id ||= s(), e.sourceColor === void 0 && (e.sourceColor = f(e.color) || null);
399
- let r = e.sourceColor || xn.value.get(e.id) || vn.value[n] || t[n] || t[n % t.length];
400
- r = f(r), xn.value.set(e.id, r), e.color = r, Cn(e, r);
401
- });
402
- }
403
- function Cn(e, t) {
404
- Array.isArray(e.children) && e.children.forEach((n) => {
405
- n.id ||= s(), n.parentId = e.id, n.sourceColor === void 0 && (n.sourceColor = f(n.color) || null);
406
- let r = n.sourceColor || t;
407
- n.color = r, Cn(n, r);
408
- });
409
- }
410
- function wn(e) {
411
- let t = Y(e);
412
- for (; t?.parentId;) t = Y(t.parentId);
413
- return t?.id ?? null;
414
- }
415
- function Tn() {
416
- let e = H.value.filter((e) => !j.value.includes(e.id));
417
- if (!N.value.length) {
418
- U.value = e;
419
- return;
420
- }
421
- let t = N.value[N.value.length - 1], n = Y(t);
422
- if (!n) {
423
- N.value = [], U.value = e;
424
- return;
425
- }
426
- let r = wn(n.id);
427
- if (r && j.value.includes(r)) {
428
- N.value = [], U.value = e;
429
- return;
430
- }
431
- U.value = [n];
432
- }
433
- D(() => sn.value, () => {
434
- H.value = i(sn.value), Sn(H.value), Tn(), qt.value += 1, Kt.value += 1;
435
- }, {
436
- deep: !0,
437
- immediate: !0,
438
- flush: "post"
439
- });
440
- let W = T(null), En = T(null);
441
- Ie(() => {
442
- Yt.value = !0, On();
443
- });
444
- let Dn = m(() => F.value.debug);
445
- function On() {
446
- if (n(k.dataset) && a({
447
- componentName: "VueUiTreemap",
448
- type: "dataset",
449
- debug: Dn.value
450
- }), Sn(H.value), n(k.dataset) || (cn.value = F.value.loading), F.value.responsive) {
451
- let e = ge(() => {
452
- let { width: e, height: t } = _e({
453
- chart: M.value,
454
- title: F.value.style.chart.title.text ? Vt.value : null,
455
- legend: F.value.style.chart.legend.show ? Ht.value : null,
456
- source: Ut.value,
457
- noTitle: Wt.value
458
- });
459
- requestAnimationFrame(() => {
460
- B.value.width = e, B.value.height = t - 12;
461
- });
462
- });
463
- W.value && (En.value && W.value.unobserve(En.value), W.value.disconnect()), W.value = new ResizeObserver(e), En.value = M.value.parentNode, W.value.observe(En.value);
464
- }
465
- }
466
- Fe(() => {
467
- W.value && (En.value && W.value.unobserve(En.value), W.value.disconnect());
468
- });
469
- let kn = m(() => U.value.map((e, n) => ({
470
- ...e,
471
- color: f(e.color) || vn.value[n] || t[n] || t[n % t.length]
472
- })).filter((e) => !j.value.includes(e.id))), An = m(() => H.value.filter((e) => !j.value.includes(e.id)).map((e) => e.value || 0).reduce((e, t) => e + t, 0)), jn = m({
473
- get() {
474
- let e = [...kn.value];
475
- return F.value.style.chart.layout.sorted && (e = [...kn.value].sort((e, t) => t.value - e.value)), e.map((e) => ({ ...e }));
476
- },
477
- set(e) {
478
- return e;
479
- }
480
- });
481
- function Mn(e, t) {
482
- return e.value / t;
483
- }
484
- function Nn(e, t, n) {
485
- let r = F.value.style.chart.layout.rects.colorRatio - Mn(t, n);
486
- return ae(e, r < 0 ? 0 : r);
487
- }
488
- function Pn(e) {
489
- return Array.isArray(e.children) && e.children.length > 0;
490
- }
491
- function Fn(e) {
492
- return [...e].sort((e, t) => {
493
- let n = Pn(e), r = Pn(t);
494
- if (n !== r) return n - r;
495
- let i = Number(e.value) || 0;
496
- return (Number(t.value) || 0) - i;
497
- });
498
- }
499
- function In(e, n, r, i, a) {
500
- return Fn(e).map((e, o) => {
501
- let s = e.sourceColor || f(e.color) || f(n) || vn.value[o] || t[o] || t[o % t.length], c = e.sourceColor ? e.sourceColor : Nn(s, e, i), l = Mn(e, i), u = a ?? e.parentId ?? e.id, d = Array.isArray(e.children) && e.children.length && e.children.reduce((e, t) => e + (Number(t.value) || 0), 0) || 1;
502
- return {
503
- ...e,
504
- color: c,
505
- proportion: l,
506
- parentName: r,
507
- rootId: u,
508
- children: Array.isArray(e.children) && e.children.length ? In(e.children, s, e.name, d, u) : void 0
509
- };
510
- });
511
- }
512
- function Ln(e) {
513
- let t = Yn(e), n = Rn(e), r = t * .55, i = t * .55, a = t * 1.05, o = t * 1.05, s = t * .35, c = n ? a + o + s : t * .45, l = e.x0 + r, u = e.x1 - r, d = e.y0 + c, f = e.y1 - i;
514
- return u <= l || f <= d ? null : {
515
- x0: l,
516
- y0: d,
517
- x1: u,
518
- y1: f
519
- };
520
- }
521
- function Rn(e) {
522
- return zn(e);
523
- }
524
- function zn(e) {
525
- let t = Number(F.value.style.chart.layout.labels.hideUnderProportion);
526
- return !Number.isFinite(t) || t <= 0 ? !0 : e.proportion > t;
527
- }
528
- function Bn(e, t, n = 0, r = null) {
529
- if (!Array.isArray(e) || !e.length) return [];
530
- let i = e.map((e) => {
531
- let { children: t, ...n } = e;
532
- return { ...n };
533
- }), a = new Map(e.map((e) => [e.id, Array.isArray(e.children) ? e.children : []])), o = new Map(e.map((e) => [e.id, e])), s = Ye(i, t), c = [];
534
- for (let e of s) {
535
- let t = a.get(e.id) || [], i = o.get(e.id), s = {
536
- ...e,
537
- depth: n,
538
- parentId: r ?? e.parentId ?? null,
539
- color: i?.color ?? e.color ?? null,
540
- children: t,
541
- isVisibleNode: !0,
542
- showLabel: Rn(e)
543
- };
544
- if (c.push(s), t.length) {
545
- let r = Ln(s);
546
- r && c.push(...Bn(t, r, n + 1, e.id));
547
- }
548
- }
549
- return c;
550
- }
551
- let Vn = m(() => {
552
- let e = U.value.length ? U.value : jn.value, n = e.map((e) => Number(e.value) || 0).reduce((e, t) => e + t, 0) || 1;
553
- return Bn(e.map((e, r) => {
554
- let i = e.children ? e.children.reduce((e, t) => e + (Number(t.value) || 0), 0) : e.value, { children: a, ...o } = e, c = e.sourceColor || f(e.color) || xn.value.get(e.id) || vn.value[r] || t[r] || t[r % t.length], l = e.sourceColor ? e.sourceColor : Nn(c, e, n);
555
- return {
556
- ...o,
557
- id: e.id || s(),
558
- parentId: e.parentId ?? null,
559
- name: e.name,
560
- value: e.value,
561
- color: l,
562
- proportion: (Number(e.value) || 0) / n,
563
- children: Array.isArray(e.children) && e.children.length ? In(e.children, c, e.name, i || 1) : void 0
564
- };
565
- }), {
566
- x0: V.value.left,
567
- y0: V.value.top,
568
- x1: V.value.left + V.value.width,
569
- y1: V.value.top + V.value.height
570
- });
571
- }), G = m(() => Vn.value);
572
- function K({ y0: e, y1: t }) {
573
- return t - e <= 0 ? 1e-4 : t - e;
574
- }
575
- function q({ x0: e, x1: t }) {
576
- return t - e <= 0 ? 1e-4 : t - e;
577
- }
578
- function Hn() {
579
- let e = F.value.style.chart.layout.labels, t = Number(e.minFontSize), n = Number(e.fontSize), r = Math.max(0, Math.min(Number.isFinite(t) ? t : 0, Number.isFinite(n) ? n : 0));
580
- return {
581
- lowerBound: r,
582
- upperBound: Math.max(r, Number.isFinite(n) ? n : r)
583
- };
584
- }
585
- function Un(e) {
586
- let t = Math.min(4, Math.max(e * .25, .5));
587
- return {
588
- paddingX: t,
589
- paddingTop: t
590
- };
591
- }
592
- function Wn(e, t) {
593
- let { paddingX: n, paddingTop: r } = Un(t), i = t * 1.1;
594
- return {
595
- x: e.x0 + n,
596
- y: e.y0 + r,
597
- width: Math.max(q(e) - n * 2, 0),
598
- height: Math.max(K(e) - r * 2, 0),
599
- lineHeight: i
600
- };
601
- }
602
- function Gn(e, t) {
603
- return ee(F.value.style.chart.layout.labels.formatter, e.value, te({
604
- p: F.value.style.chart.layout.labels.prefix,
605
- v: e.value,
606
- s: F.value.style.chart.layout.labels.suffix,
607
- r: F.value.style.chart.tooltip.roundingValue
608
- }), {
609
- datapoint: e,
610
- seriesIndex: t
611
- });
612
- }
613
- function Kn(e, t) {
614
- let n = Gn(e, t);
615
- return Array.isArray(e.children) && e.children.length ? [`${e.name} (${n})`] : [`${e.name}`, n].filter((e) => `${e}`.length);
616
- }
617
- function qn(e, t, n) {
618
- let r = Kn(e, n), i = Wn(e, t);
619
- return !r.length || i.width <= 0 || i.height <= 0 || r.length * i.lineHeight > i.height ? !1 : r.every((e, n) => ri(e, t, n === 0 ? 500 : 400) <= i.width);
620
- }
621
- function Jn(e, t, n, r) {
622
- let i = Kn(e, t), a = Math.max(1, ...i.map((e) => String(e).length)), o = Math.min(18, Math.max(10, Math.ceil(a * .7))), s = Math.max(1, i.length), c = Math.max(q(e) - 1, 1e-4), l = Math.max(K(e) - 1, 1e-4), u = c / (o * .58), d = l / (s * 1.35);
623
- return Math.max(n, Math.min(r, u, d));
624
- }
625
- function Yn(e, t) {
626
- let { lowerBound: n, upperBound: r } = Hn(), i = Math.max(1e-4, Math.min(q(e), K(e))), a = Math.max(n, Math.min(r, i * .9)), o = Math.min(a, Jn(e, t, n, r));
627
- if (qn(e, o, t) || !qn(e, n, t)) return o;
628
- let s = n, c = o, l = n;
629
- for (let n = 0; n < 8; n += 1) {
630
- let n = (s + c) / 2;
631
- qn(e, n, t) ? (l = n, s = n) : c = n;
632
- }
633
- let u = Math.max(n, o * .7);
634
- return l >= u ? l : o;
635
- }
636
- function Xn(e) {
637
- zt.value = e, Bt.value += 1;
638
- }
639
- let J = m(() => ({
640
- x: 0,
641
- y: 0,
642
- width: V.value.vbWidth,
643
- height: V.value.vbHeight
644
- }));
645
- function Y(e, t = H.value) {
646
- for (let n of t) {
647
- if (n.id === e) return n;
648
- if (n.children) {
649
- let t = Y(e, n.children);
650
- if (t) return t;
651
- }
652
- }
653
- return null;
654
- }
655
- function Zn(e) {
656
- let t = [], n = Y(e);
657
- for (; n && n.parentId;) {
658
- let e = Y(n.parentId);
659
- if (!e) break;
660
- t.unshift(e.id), n = e;
661
- }
662
- return t;
663
- }
664
- let Qn = m(() => N.value.length > 0);
665
- function $n() {
666
- U.value = H.value.slice(), N.value = [], rt("selectDatapoint", void 0);
667
- }
668
- function er() {
669
- return N.value[N.value.length - 1] ?? null;
670
- }
671
- function tr(e, t, n) {
672
- N.value = [...Zn(e.id), e.id], U.value = [e], F.value.events.datapointClick && F.value.events.datapointClick({
673
- datapoint: t ?? e,
674
- seriesIndex: n
675
- }), rt("selectDatapoint", t ?? e);
676
- }
677
- function nr(e, t) {
678
- let n = er();
679
- if (!n) {
680
- $n();
681
- return;
682
- }
683
- let r = Y(n);
684
- if (!r?.parentId) {
685
- F.value.events.datapointClick && F.value.events.datapointClick({
686
- datapoint: e,
687
- seriesIndex: t
688
- }), $n();
689
- return;
690
- }
691
- let i = Y(r.parentId);
692
- if (!i) {
693
- $n();
694
- return;
695
- }
696
- N.value = [...Zn(i.id), i.id], U.value = [i], F.value.events.datapointClick && F.value.events.datapointClick({
697
- datapoint: e,
698
- seriesIndex: t
699
- }), rt("selectDatapoint", e);
700
- }
701
- function rr(e, t) {
702
- if (!e) {
703
- $n();
704
- return;
705
- }
706
- let n = Y(e.id);
707
- if (n) {
708
- if (er() === n.id) {
709
- nr(e, t);
710
- return;
711
- }
712
- tr(n, e, t);
713
- }
714
- }
715
- function ir(e) {
716
- return e ? er() === e.id : !1;
717
- }
718
- let X = m(() => {
719
- let e = [{
720
- id: null,
721
- label: "All"
722
- }];
723
- if (N.value.length > 0) {
724
- let t = Y(N.value[N.value.length - 1]), n = [];
725
- for (; t;) n.unshift(t), t = t.parentId ? Y(t.parentId) : null;
726
- for (let t of n) e.push({
727
- id: t.id,
728
- label: t.name,
729
- node: t
730
- });
731
- }
732
- return e;
733
- }), Z = T(null), ar = m(() => H.value.map((e, n) => ({
734
- ...e,
735
- color: f(e.color) || vn.value[n] || t[n] || t[n % t.length],
736
- shape: "square"
737
- })).sort((e, t) => t.value - e.value).map((e, t) => {
738
- let n = e.value / H.value.map((e) => e.value).reduce((e, t) => e + t, 0);
739
- return {
740
- ...e,
741
- proportion: n,
742
- isSegregated: j.value.includes(e.id),
743
- segregate: () => lr(e),
744
- opacity: j.value.includes(e.id) ? .5 : 1,
745
- display: `${e.name}${F.value.style.chart.legend.showPercentage || F.value.style.chart.legend.showValue ? ": " : ""}${F.value.style.chart.legend.showValue ? ee(F.value.style.chart.layout.labels.formatter, e.value, te({
746
- p: F.value.style.chart.layout.labels.prefix,
747
- v: e.value,
748
- s: F.value.style.chart.layout.labels.suffix,
749
- r: F.value.style.chart.legend.roundingValue
750
- }), { datapoint: e }) : ""}${F.value.style.chart.legend.showPercentage ? j.value.includes(e.id) ? `${F.value.style.chart.legend.showValue ? " (" : ""}- %${F.value.style.chart.legend.showValue ? ")" : ""}` : `${F.value.style.chart.legend.showValue ? " (" : ""}${isNaN(e.value / An.value) ? "-" : (e.value / An.value * 100).toFixed(F.value.style.chart.legend.roundingPercentage)}%${F.value.style.chart.legend.showValue ? ")" : ""}` : ""}`
751
- };
752
- })), or = m(() => ({
753
- cy: "treemap-div-legend",
754
- backgroundColor: F.value.style.chart.legend.backgroundColor,
755
- color: F.value.style.chart.legend.color,
756
- fontSize: F.value.style.chart.legend.fontSize,
757
- paddingBottom: 12,
758
- fontWeight: F.value.style.chart.legend.bold ? "bold" : ""
759
- })), sr = m(() => j.value.length === ar.value.length);
760
- function cr() {
761
- j.value.length ? j.value = [] : ar.value.forEach((e) => {
762
- j.value.push(e.id);
763
- }), rt("selectLegend", H.value.filter((e) => !j.value.includes(e.id)));
764
- }
765
- function lr(e) {
766
- Z.value = null, j.value.includes(e.id) ? j.value = j.value.filter((t) => t !== e.id) : j.value.length < k.dataset.length - 1 && j.value.push(e.id), rt("selectLegend", H.value.filter((e) => !j.value.includes(e.id)));
767
- }
768
- function ur(e) {
769
- return H.value.length ? H.value.find((t) => t.name === e) || (F.value.debug && console.warn(`VueUiTreemap - Series name not found "${e}"`), null) : (F.value.debug && console.warn("VueUiTreemap - There are no series to show."), null);
770
- }
771
- function dr(e) {
772
- let t = ur(e);
773
- t !== null && j.value.includes(t.id) && lr({ id: t.id });
774
- }
775
- function fr(e) {
776
- let t = ur(e);
777
- t !== null && (j.value.includes(t.id) || lr({ id: t.id }));
778
- }
779
- function pr({ datapoint: e, seriesIndex: t }) {
780
- Z.value = null, Lt.value = !1, P.value = null, rn.value = "pointer", F.value.events.datapointLeave && F.value.events.datapointLeave({
781
- datapoint: e,
782
- seriesIndex: t
783
- });
784
- }
785
- let mr = C(null);
786
- function hr({ datapoint: e, seriesIndex: t, triggerMode: n = "pointer" }) {
787
- if (sr.value || n === "pointer" && Tr.value) return;
788
- F.value.events.datapointEnter && F.value.events.datapointEnter({
789
- datapoint: e,
790
- seriesIndex: t
791
- }), P.value = t, rn.value = n, Z.value = e, mr.value = {
792
- datapoint: e,
793
- seriesIndex: t,
794
- config: F.value,
795
- series: kn.value
796
- };
797
- let r = F.value.style.chart.tooltip.customFormat;
798
- if (u(r) && d(() => r({
799
- seriesIndex: t,
800
- datapoint: e,
801
- series: kn.value,
802
- config: F.value
803
- }))) Rt.value = r({
804
- seriesIndex: t,
805
- datapoint: e,
806
- series: kn.value,
807
- config: F.value
808
- });
809
- else {
810
- let n = "";
811
- n += `<div style="width:100%;text-align:center;border-bottom:1px solid ${F.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`, n += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${e.color}"/></svg>`, n += `<b>${ee(F.value.style.chart.layout.labels.formatter, e.value, te({
812
- p: F.value.style.chart.layout.labels.prefix,
813
- v: e.value,
814
- s: F.value.style.chart.layout.labels.suffix,
815
- r: F.value.style.chart.tooltip.roundingValue
816
- }), {
817
- datapoint: e,
818
- seriesIndex: t
819
- })}</b>`, Rt.value = `<div>${n}</div>`;
820
- }
821
- Lt.value = !0;
822
- }
823
- let Q = m(() => ({
824
- head: G.value.map((e) => ({
825
- name: e.name,
826
- color: e.color
827
- })),
828
- body: G.value.map((e) => e.value)
829
- }));
830
- function gr(e = null) {
831
- Ne(() => {
832
- let t = Q.value.head.map((e, t) => [
833
- [e.name],
834
- [Q.value.body[t]],
835
- [isNaN(Q.value.body[t] / An.value) ? "-" : Q.value.body[t] / An.value * 100]
836
- ]), n = ie([
837
- [F.value.style.chart.title.text],
838
- [F.value.style.chart.title.subtitle.text],
839
- [
840
- [""],
841
- ["val"],
842
- ["%"]
843
- ]
844
- ].concat(t));
845
- e ? e(n) : l({
846
- csvContent: n,
847
- title: F.value.style.chart.title.text || "vue-ui-treemap"
848
- });
849
- });
850
- }
851
- let _r = m(() => {
852
- let e = [
853
- F.value.table.columnNames.series,
854
- F.value.table.columnNames.value,
855
- F.value.table.columnNames.percentage
856
- ], t = Q.value.head.map((e, t) => {
857
- let n = ee(F.value.style.chart.layout.labels.formatter, Q.value.body[t], te({
858
- p: F.value.style.chart.layout.labels.prefix,
859
- v: Q.value.body[t],
860
- s: F.value.style.chart.layout.labels.suffix,
861
- r: F.value.table.td.roundingValue
862
- }));
863
- return [
864
- {
865
- color: e.color,
866
- name: e.name,
867
- shape: "square"
868
- },
869
- n,
870
- isNaN(Q.value.body[t] / An.value) ? "-" : te({
871
- v: Q.value.body[t] / An.value * 100,
872
- s: "%",
873
- r: F.value.table.td.roundingPercentage
874
- })
875
- ];
876
- }), n = {
877
- th: {
878
- backgroundColor: F.value.table.th.backgroundColor,
879
- color: F.value.table.th.color,
880
- outline: F.value.table.th.outline
881
- },
882
- td: {
883
- backgroundColor: F.value.table.td.backgroundColor,
884
- color: F.value.table.td.color,
885
- outline: F.value.table.td.outline
886
- },
887
- breakpoint: F.value.table.responsiveBreakpoint
888
- };
889
- return {
890
- colNames: [F.value.table.columnNames.series, F.value.table.columnNames.value],
891
- head: e,
892
- body: t,
893
- config: n
894
- };
895
- });
896
- function vr() {
897
- return G.value;
898
- }
899
- function yr() {
900
- z.value.showTable = !z.value.showTable;
901
- }
902
- function br() {
903
- z.value.showTooltip = !z.value.showTooltip;
904
- }
905
- function xr() {
906
- z.value.showZoom = !z.value.showZoom;
907
- }
908
- let Sr = C(!1);
909
- function Cr() {
910
- Sr.value = !Sr.value;
911
- }
912
- let wr = m(() => !Sr.value && z.value.showZoom), Tr = C(null), Er = C(!1), { viewBox: $, resetZoom: Dr, isZoom: Or, setInitialViewBox: kr } = Te(R, {
913
- x: J.value.x,
914
- y: J.value.y,
915
- width: Math.max(10, J.value.width),
916
- height: Math.max(10, J.value.height)
917
- }, 1, wr), Ar = m(() => z.value.showZoom || Or.value);
918
- D([
919
- () => J.value.x,
920
- () => J.value.y,
921
- () => J.value.width,
922
- () => J.value.height
923
- ], () => {
924
- Ne(() => {
925
- kr({
926
- x: J.value.x,
927
- y: J.value.y,
928
- width: Math.max(10, J.value.width),
929
- height: Math.max(10, J.value.height)
930
- });
931
- });
932
- }, { immediate: !0 });
933
- function jr(e) {
934
- wr.value && (e.button !== void 0 && e.button !== 0 || (Tr.value = {
935
- x: e.clientX,
936
- y: e.clientY
937
- }, Er.value = !1));
938
- }
939
- function Mr(e) {
940
- if (!wr.value || !Tr.value) return;
941
- let t = e.clientX - Tr.value.x, n = e.clientY - Tr.value.y;
942
- Math.hypot(t, n) > Mt && (Er.value = !0);
943
- }
944
- function Nr() {
945
- Tr.value = null, Er.value && window.setTimeout(() => {
946
- Er.value = !1;
947
- }, 0);
948
- }
949
- function Pr(e, t) {
950
- Er.value || rr(e, t);
951
- }
952
- let Fr = C(null);
953
- function Ir(e) {
954
- Fr.value = e;
955
- }
956
- function Lr() {
957
- Fr.value = null;
958
- }
959
- async function Rr({ scale: e = 2 } = {}) {
960
- if (!M.value) return;
961
- let { width: t, height: n } = M.value.getBoundingClientRect(), r = t / n, { imageUri: i, base64: a } = await pe({
962
- domElement: M.value,
963
- base64: !0,
964
- img: !0,
965
- scale: e
966
- });
967
- return {
968
- imageUri: i,
969
- base64: a,
970
- title: F.value.style.chart.title.text,
971
- width: t,
972
- height: n,
973
- aspectRatio: r
974
- };
975
- }
976
- let zr = m(() => {
977
- let e = F.value.table.useDialog && !F.value.table.show, t = z.value.showTable;
978
- return {
979
- component: e ? $e : Je,
980
- title: `${F.value.style.chart.title.text}${F.value.style.chart.title.subtitle.text ? `: ${F.value.style.chart.title.subtitle.text}` : ""}`,
981
- props: e ? {
982
- backgroundColor: F.value.table.th.backgroundColor,
983
- color: F.value.table.th.color,
984
- headerColor: F.value.table.th.color,
985
- headerBg: F.value.table.th.backgroundColor,
986
- isFullscreen: zt.value,
987
- fullscreenParent: M.value,
988
- forcedWidth: Math.min(800, window.innerWidth * .8),
989
- isCursorPointer: I.value
990
- } : {
991
- hideDetails: !0,
992
- config: {
993
- open: t,
994
- maxHeight: 1e4,
995
- body: {
996
- backgroundColor: F.value.style.chart.backgroundColor,
997
- color: F.value.style.chart.color
998
- },
999
- head: {
1000
- backgroundColor: F.value.style.chart.backgroundColor,
1001
- color: F.value.style.chart.color
1002
- }
1003
- }
1004
- }
1005
- };
1006
- });
1007
- D(() => z.value.showTable, (e) => {
1008
- F.value.table.show || (e && F.value.table.useDialog && Xt.value ? Xt.value.open() : "close" in Xt.value && Xt.value.close());
1009
- });
1010
- function Br() {
1011
- z.value.showTable = !1, Zt.value && Zt.value.setTableIconState(!1);
1012
- }
1013
- let Vr = m(() => ar.value.map((e) => ({
1014
- ...e,
1015
- name: e.display
1016
- }))), Hr = m(() => F.value.style.chart.backgroundColor), Ur = m(() => F.value.style.chart.legend), { exportSvg: Wr, getSvg: Gr } = ue({
1017
- svg: R,
1018
- title: m(() => F.value.style.chart.title),
1019
- legend: Ur,
1020
- legendItems: Vr,
1021
- backgroundColor: Hr
1022
- });
1023
- async function Kr({ isCb: e }) {
1024
- tn.value = !0, await Ne();
1025
- try {
1026
- if (e) {
1027
- let { blob: e, url: t, text: n, dataUrl: r } = await Gr();
1028
- await Promise.resolve(F.value.userOptions.callbacks.svg({
1029
- blob: e,
1030
- url: t,
1031
- text: n,
1032
- dataUrl: r
1033
- }));
1034
- } else await Promise.resolve(Wr());
1035
- } finally {
1036
- tn.value = !1;
1037
- }
1038
- }
1039
- function qr(e) {
1040
- if (e?.stage === "start") {
1041
- en.value = !0;
1042
- return;
1043
- }
1044
- if (e?.stage === "end") {
1045
- en.value = !1;
1046
- return;
1047
- }
1048
- gn();
1049
- }
1050
- function Jr(e, t) {
1051
- let n = Yn(e, t), { paddingX: r, paddingTop: i } = Un(n);
1052
- return {
1053
- fontSize: n,
1054
- paddingX: r,
1055
- paddingTop: i,
1056
- lineHeight: n * 1.1
1057
- };
1058
- }
1059
- function Yr(e, t) {
1060
- return Wn(e, Jr(e, t).fontSize);
1061
- }
1062
- function Xr(e) {
1063
- return ne(e.color ?? F.value.style.chart.backgroundColor);
1064
- }
1065
- function Zr(e, t) {
1066
- let { fontSize: n, lineHeight: r } = Jr(e, t), i = ii(e, t), a = ai(e, t);
1067
- if (i <= 0 || a <= 0) return [];
1068
- let o = Math.max(Math.floor(a / Math.max(r, 1e-4)), 1);
1069
- return Kn(e, t).slice(0, o).map((e) => String(e ?? "")).filter(Boolean);
1070
- }
1071
- function Qr({ rect: e, seriesIndex: t }) {
1072
- if (!e || !F.value.style.chart.layout.labels.showDefaultLabels || !Rn(e)) return null;
1073
- let { fontSize: n } = Jr(e, t), r = Xr(e), i = Zr(e, t), a = Yr(e, t);
1074
- if (!i.length || a.width <= 0 || a.height <= 0) return null;
1075
- let o = `treemap_clip_${A.value}_${e.id}`, s = e.x0, c = e.y0, l = Math.max(q(e), 0), u = Math.max(K(e), 0);
1076
- return {
1077
- key: $r(e),
1078
- clipId: o,
1079
- clipX: s,
1080
- clipY: c,
1081
- clipWidth: l,
1082
- clipHeight: u,
1083
- lines: i.map((t, i) => ({
1084
- key: `${e.id}_${i}`,
1085
- text: t,
1086
- x: a.x,
1087
- y: a.y + a.lineHeight * i,
1088
- fill: r,
1089
- fontSize: n,
1090
- fontFamily: F.value.style.fontFamily,
1091
- fontWeight: i === 0 ? 500 : 400
1092
- }))
1093
- };
1094
- }
1095
- function $r(e) {
1096
- return `${e.id}`;
1097
- }
1098
- let ei = m(() => Nt.rect || L.value || !F.value.style.chart.layout.labels.showDefaultLabels || sr.value ? [] : G.value.map((e, t) => e.showLabel ? Qr({
1099
- rect: e,
1100
- seriesIndex: t
1101
- }) : null).filter(Boolean)), ti;
1102
- function ni() {
1103
- return typeof document > "u" ? null : (ti ||= document.createElement("canvas"), ti.getContext("2d"));
1104
- }
1105
- function ri(e, t, n = 400) {
1106
- let r = ni();
1107
- return r ? (r.font = `${n} ${t}px ${F.value.style.fontFamily}`, r.measureText(String(e)).width) : e.length * t * .6;
1108
- }
1109
- function ii(e, t) {
1110
- return Yr(e, t).width;
1111
- }
1112
- function ai(e, t) {
1113
- return Yr(e, t).height;
1114
- }
1115
- function oi(e) {
1116
- let t = F.value.style.chart.layout.rects.borderRadius, n = q(e), r = K(e);
1117
- return Math.min(t, Math.min(n, r) / 6);
1118
- }
1119
- async function si() {
1120
- if (rt("copyAlt", {
1121
- config: F.value,
1122
- dataset: G.value
1123
- }), !F.value.userOptions.callbacks.altCopy) {
1124
- console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");
1125
- return;
1126
- }
1127
- await Promise.resolve(F.value.userOptions.callbacks.altCopy({
1128
- config: F.value,
1129
- dataset: G.value
1130
- }));
1131
- }
1132
- function ci() {
1133
- P.value = null, an.value = !0;
1134
- }
1135
- function li() {
1136
- P.value = null, rn.value = "pointer", Lt.value = !1, Z.value = null, an.value = !1;
1137
- }
1138
- function ui(e) {
1139
- if (!R.value || Sr.value || document.activeElement !== R.value || !G.value.length || sr.value) return;
1140
- let t = ["ArrowLeft", "ArrowUp"].includes(e.key), n = ["ArrowRight", "ArrowDown"].includes(e.key), r = e.key === "Enter" || e.key === " ", i = e.key === "Escape";
1141
- if (!t && !n && !r && !i) return;
1142
- if (e.preventDefault(), e.stopPropagation(), i) {
1143
- P.value = null, rn.value = "pointer", Lt.value = !1, Z.value = null;
1144
- return;
1145
- }
1146
- if (r) {
1147
- if (P.value === null) return;
1148
- let e = G.value[P.value];
1149
- if (!e) return;
1150
- rr(e, P.value);
1151
- return;
1152
- }
1153
- let a = P.value, o = Z.value ? G.value.findIndex((e) => e.id === Z.value.id) : null, s = a !== null && a >= 0 && a < G.value.length, c = o !== null && o >= 0 && o < G.value.length;
1154
- s ? n ? (a += 1, a >= G.value.length && (a = 0)) : t && (--a, a < 0 && (a = G.value.length - 1)) : c ? (a = n ? o + 1 : o - 1, a >= G.value.length && (a = 0), a < 0 && (a = G.value.length - 1)) : a = n ? 0 : G.value.length - 1;
1155
- let l = G.value[a];
1156
- l && (di(a), hr({
1157
- datapoint: l,
1158
- seriesIndex: a,
1159
- triggerMode: "keyboard"
1160
- }));
1161
- }
1162
- function di(e) {
1163
- if (!Number.isFinite(e) || !R.value) return;
1164
- let t = G.value[e];
1165
- if (!t) return;
1166
- let n = t.x0 + q(t) / 2, r = t.y0 + K(t) / 2, i = R.value.getBoundingClientRect();
1167
- nn.value = {
1168
- x: i.left + (n - $.value.x) / $.value.width * i.width,
1169
- y: i.top + (r - $.value.y) / $.value.height * i.height
1170
- };
1171
- }
1172
- let fi = m(() => ({
1173
- headers: _r.value?.colNames ?? [],
1174
- rows: _r.value?.body ?? []
1175
- })), pi = m(() => F.value.style.chart.color);
1176
- return he({
1177
- getData: vr,
1178
- getImage: Rr,
1179
- generateCsv: gr,
1180
- generateImage: gn,
1181
- generateSvg: Kr,
1182
- generatePdf: hn,
1183
- hideSeries: fr,
1184
- showSeries: dr,
1185
- toggleTable: yr,
1186
- toggleTooltip: br,
1187
- toggleZoom: xr,
1188
- toggleAnnotator: Cr,
1189
- toggleFullscreen: Xn,
1190
- resetZoom: Dr,
1191
- copyAlt: si
1192
- }), (e, t) => (S(), _("div", {
1193
- ref_key: "treemapChart",
1194
- ref: M,
1195
- class: Pe(`vue-data-ui-component vue-ui-treemap ${zt.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${F.value.useCssAnimation ? "" : "vue-ui-dna"}`),
1196
- style: x(`font-family:${F.value.style.fontFamily};width:100%; ${F.value.responsive ? "height: 100%;" : ""} text-align:center;background:${F.value.style.chart.backgroundColor}`),
1197
- id: `treemap_${A.value}`,
1198
- onMouseenter: t[3] ||= () => E(un)(!0),
1199
- onMouseleave: t[4] ||= () => E(un)(!1)
1200
- }, [
1201
- v("div", {
1202
- id: `chart-instructions-${A.value}`,
1203
- class: "sr-only"
1204
- }, [v("p", null, ze(F.value.a11y.translations.keyboardNavigation), 1)], 8, at),
1205
- fi.value?.rows?.length ? (S(), h(be, {
1206
- key: 0,
1207
- uid: A.value,
1208
- head: fi.value.headers,
1209
- body: fi.value.rows,
1210
- notice: F.value.a11y.translations.tableAvailable,
1211
- caption: F.value.a11y.translations.tableCaption
1212
- }, null, 8, [
1213
- "uid",
1214
- "head",
1215
- "body",
1216
- "notice",
1217
- "caption"
1218
- ])) : g("", !0),
1219
- F.value.userOptions.buttons.annotator ? (S(), h(E(qe), {
1220
- key: 1,
1221
- svgRef: E(R),
1222
- backgroundColor: F.value.style.chart.backgroundColor,
1223
- color: F.value.style.chart.color,
1224
- active: Sr.value,
1225
- isCursorPointer: I.value,
1226
- onClose: Cr
1227
- }, {
1228
- "annotator-action-close": O(() => [w(e.$slots, "annotator-action-close", {}, void 0, !0)]),
1229
- "annotator-action-color": O(({ color: t }) => [w(e.$slots, "annotator-action-color", b(y({ color: t })), void 0, !0)]),
1230
- "annotator-action-draw": O(({ mode: t }) => [w(e.$slots, "annotator-action-draw", b(y({ mode: t })), void 0, !0)]),
1231
- "annotator-action-undo": O(({ disabled: t }) => [w(e.$slots, "annotator-action-undo", b(y({ disabled: t })), void 0, !0)]),
1232
- "annotator-action-redo": O(({ disabled: t }) => [w(e.$slots, "annotator-action-redo", b(y({ disabled: t })), void 0, !0)]),
1233
- "annotator-action-delete": O(({ disabled: t }) => [w(e.$slots, "annotator-action-delete", b(y({ disabled: t })), void 0, !0)]),
1234
- _: 3
1235
- }, 8, [
1236
- "svgRef",
1237
- "backgroundColor",
1238
- "color",
1239
- "active",
1240
- "isCursorPointer"
1241
- ])) : g("", !0),
1242
- _n.value ? (S(), _("div", {
1243
- key: 2,
1244
- ref_key: "noTitle",
1245
- ref: Wt,
1246
- class: "vue-data-ui-no-title-space",
1247
- style: "height:36px; width: 100%;background:transparent"
1248
- }, null, 512)) : g("", !0),
1249
- F.value.style.chart.title.text ? (S(), _("div", {
1250
- key: 3,
1251
- ref_key: "chartTitle",
1252
- ref: Vt,
1253
- style: x(`width:100%;background:${F.value.style.chart.backgroundColor};padding-bottom:6px`)
1254
- }, [(S(), h(me, {
1255
- key: `title_${Gt.value}`,
1256
- config: {
1257
- title: {
1258
- cy: "treemap-div-title",
1259
- ...F.value.style.chart.title
1260
- },
1261
- subtitle: {
1262
- cy: "treemap-div-subtitle",
1263
- ...F.value.style.chart.title.subtitle
1264
- }
1265
- }
1266
- }, null, 8, ["config"]))], 4)) : g("", !0),
1267
- v("div", { id: `legend-top-${A.value}` }, null, 8, ot),
1268
- F.value.userOptions.show && Ft.value && (E(dn) || E(ln)) ? (S(), h(E(Ze), {
1269
- ref_key: "userOptionsRef",
1270
- ref: Zt,
1271
- key: `user_option_${Bt.value}`,
1272
- backgroundColor: F.value.style.chart.backgroundColor,
1273
- color: F.value.style.chart.color,
1274
- isPrinting: E(pn),
1275
- isImaging: E(mn),
1276
- uid: A.value,
1277
- hasTooltip: F.value.userOptions.buttons.tooltip && F.value.style.chart.tooltip.show,
1278
- hasPdf: F.value.userOptions.buttons.pdf,
1279
- hasXls: F.value.userOptions.buttons.csv,
1280
- hasImg: F.value.userOptions.buttons.img,
1281
- hasSvg: F.value.userOptions.buttons.svg,
1282
- hasTable: F.value.userOptions.buttons.table,
1283
- hasFullscreen: F.value.userOptions.buttons.fullscreen,
1284
- hasAltCopy: F.value.userOptions.buttons.altCopy,
1285
- isFullscreen: zt.value,
1286
- isTooltip: z.value.showTooltip,
1287
- titles: { ...F.value.userOptions.buttonTitles },
1288
- chartElement: M.value,
1289
- position: F.value.userOptions.position,
1290
- hasAnnotator: F.value.userOptions.buttons.annotator,
1291
- isAnnotation: Sr.value,
1292
- callbacks: F.value.userOptions.callbacks,
1293
- printScale: F.value.userOptions.print.scale,
1294
- tableDialog: F.value.table.useDialog,
1295
- isCursorPointer: I.value,
1296
- hasZoom: F.value.userOptions.buttons.zoom,
1297
- isZoom: z.value.showZoom,
1298
- onToggleFullscreen: Xn,
1299
- onGeneratePdf: E(hn),
1300
- onGenerateCsv: gr,
1301
- onGenerateImage: qr,
1302
- onGenerateSvg: Kr,
1303
- onToggleTable: yr,
1304
- onToggleTooltip: br,
1305
- onToggleAnnotator: Cr,
1306
- onToggleZoom: xr,
1307
- onCopyAlt: si,
1308
- style: x({ visibility: E(dn) ? E(ln) ? "visible" : "hidden" : "visible" })
1309
- }, Oe({ _: 2 }, [
1310
- e.$slots.menuIcon ? {
1311
- name: "menuIcon",
1312
- fn: O(({ isOpen: t, color: n }) => [w(e.$slots, "menuIcon", b(y({
1313
- isOpen: t,
1314
- color: n
1315
- })), void 0, !0)]),
1316
- key: "0"
1317
- } : void 0,
1318
- e.$slots.optionTooltip ? {
1319
- name: "optionTooltip",
1320
- fn: O(() => [w(e.$slots, "optionTooltip", {}, void 0, !0)]),
1321
- key: "1"
1322
- } : void 0,
1323
- e.$slots.optionPdf ? {
1324
- name: "optionPdf",
1325
- fn: O(() => [w(e.$slots, "optionPdf", {}, void 0, !0)]),
1326
- key: "2"
1327
- } : void 0,
1328
- e.$slots.optionCsv ? {
1329
- name: "optionCsv",
1330
- fn: O(() => [w(e.$slots, "optionCsv", {}, void 0, !0)]),
1331
- key: "3"
1332
- } : void 0,
1333
- e.$slots.optionImg ? {
1334
- name: "optionImg",
1335
- fn: O(() => [w(e.$slots, "optionImg", {}, void 0, !0)]),
1336
- key: "4"
1337
- } : void 0,
1338
- e.$slots.optionSvg ? {
1339
- name: "optionSvg",
1340
- fn: O(() => [w(e.$slots, "optionSvg", {}, void 0, !0)]),
1341
- key: "5"
1342
- } : void 0,
1343
- e.$slots.optionTable ? {
1344
- name: "optionTable",
1345
- fn: O(() => [w(e.$slots, "optionTable", {}, void 0, !0)]),
1346
- key: "6"
1347
- } : void 0,
1348
- e.$slots.optionFullscreen ? {
1349
- name: "optionFullscreen",
1350
- fn: O(({ toggleFullscreen: t, isFullscreen: n }) => [w(e.$slots, "optionFullscreen", b(y({
1351
- toggleFullscreen: t,
1352
- isFullscreen: n
1353
- })), void 0, !0)]),
1354
- key: "7"
1355
- } : void 0,
1356
- e.$slots.optionAnnotator ? {
1357
- name: "optionAnnotator",
1358
- fn: O(({ toggleAnnotator: t, isAnnotator: n }) => [w(e.$slots, "optionAnnotator", b(y({
1359
- toggleAnnotator: t,
1360
- isAnnotator: n
1361
- })), void 0, !0)]),
1362
- key: "8"
1363
- } : void 0,
1364
- e.$slots.optionZoom ? {
1365
- name: "optionZoom",
1366
- fn: O(({ toggleZoom: t, isZoomLocked: n }) => [w(e.$slots, "optionZoom", b(y({
1367
- toggleZoom: t,
1368
- isZoomLocked: n
1369
- })), void 0, !0)]),
1370
- key: "9"
1371
- } : void 0,
1372
- e.$slots.optionAltCopy ? {
1373
- name: "optionAltCopy",
1374
- fn: O(({ altCopy: t }) => [w(e.$slots, "optionAltCopy", b(y({ altCopy: t })), void 0, !0)]),
1375
- key: "10"
1376
- } : void 0,
1377
- e.$slots["custom-menu-before"] ? {
1378
- name: "custom-menu-before",
1379
- fn: O(() => [w(e.$slots, "custom-menu-before", {}, void 0, !0)]),
1380
- key: "11"
1381
- } : void 0,
1382
- e.$slots["custom-menu-after"] ? {
1383
- name: "custom-menu-after",
1384
- fn: O(() => [w(e.$slots, "custom-menu-after", {}, void 0, !0)]),
1385
- key: "12"
1386
- } : void 0
1387
- ]), 1032, /* @__PURE__ */ "backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.hasZoom.isZoom.onGeneratePdf.style".split("."))) : g("", !0),
1388
- X.value.length > 1 ? (S(), _("nav", {
1389
- key: 5,
1390
- class: "vue-ui-treemap-breadcrumbs",
1391
- "data-dom-to-png-ignore": "",
1392
- ref_key: "breadcrumbsNav",
1393
- ref: Jt
1394
- }, [(S(!0), _(p, null, Le(X.value, (n, r) => (S(), _("span", {
1395
- role: "button",
1396
- tabindex: r < X.value.length - 1 ? 0 : void 0,
1397
- key: n.id || "root",
1398
- onClick: (e) => r === X.value.length - 1 ? () => {} : rr(n.node),
1399
- onKeydown: [Ue(We((e) => r === X.value.length - 1 ? void 0 : rr(n.node), ["prevent"]), ["enter"]), Ue(We((e) => r === X.value.length - 1 ? void 0 : rr(n.node), ["prevent"]), ["space"])],
1400
- class: "vue-ui-treemap-crumb",
1401
- "data-last-crumb": r === X.value.length - 1,
1402
- style: x({
1403
- color: F.value.style.chart.color,
1404
- cursor: I.value ? "pointer" : "default"
1405
- }),
1406
- onMouseenter: (e) => Ir(r),
1407
- onMouseleave: Lr,
1408
- onFocus: (e) => Ir(r),
1409
- onBlur: Lr
1410
- }, [v("span", ct, [v("span", lt, [w(e.$slots, "breadcrumb-label", Me({ ref_for: !0 }, {
1411
- crumb: n,
1412
- isRoot: r === 0,
1413
- isFocus: Fr.value === r
1414
- }), () => [r === 0 ? (S(), _("div", ut, [Ae(ve, {
1415
- name: Fr.value === 0 ? "homeFilled" : "home",
1416
- stroke: F.value.style.chart.color
1417
- }, null, 8, ["name", "stroke"])])) : (S(), _(p, { key: 1 }, [ke(ze(n.label), 1)], 64))], !0)]), r < X.value.length - 1 ? (S(), _("span", dt, [w(e.$slots, "breadcrumb-arrow", {}, () => [t[5] ||= ke(" › ", -1)], !0)])) : g("", !0)])], 44, st))), 128))], 512)) : g("", !0),
1418
- v("div", ft, [
1419
- (S(), _("svg", {
1420
- ref_key: "svgRef",
1421
- ref: R,
1422
- xmlns: E(re),
1423
- "aria-describedby": `chart-instructions-${A.value}`,
1424
- class: Pe({
1425
- "vue-data-ui-fullscreen--on": zt.value,
1426
- "vue-data-ui-fulscreen--off": !zt.value,
1427
- "vue-data-ui-zoom-plus": !Qn.value,
1428
- "vue-data-ui-zoom-minus": Qn.value,
1429
- "no-transition": E(Pt),
1430
- loading: E(L)
1431
- }),
1432
- viewBox: `${E($).x} ${E($).y} ${E($).width <= 0 ? 10 : E($).width} ${E($).height <= 0 ? 10 : E($).height}`,
1433
- style: x(`max-width:100%; overflow:${Ar.value ? "hidden" : "visible"}; background:transparent;color:${F.value.style.chart.color}`),
1434
- tabindex: "0",
1435
- onFocus: ci,
1436
- onBlur: li,
1437
- onKeydown: ui,
1438
- onPointerdown: jr,
1439
- onPointermove: Mr,
1440
- onPointerup: Nr,
1441
- onPointercancel: Nr,
1442
- onPointerleave: Nr
1443
- }, [
1444
- Ae(E(Qe)),
1445
- (S(!0), _(p, null, Le(G.value, (e, t) => (S(), _("g", { key: `tgrad_${e.id}` }, [F.value.style.chart.layout.rects.gradient.show ? (S(), _("defs", mt, [v("radialGradient", {
1446
- id: `tgrad_${e.id}`,
1447
- gradientTransform: "translate(-1, -1.000001) scale(2, 2)"
1448
- }, [v("stop", {
1449
- offset: "18%",
1450
- "stop-color": e.color
1451
- }, null, 8, gt), v("stop", {
1452
- offset: "100%",
1453
- "stop-color": E(ae)(e.color, F.value.style.chart.layout.rects.gradient.intensity / 100)
1454
- }, null, 8, _t)], 8, ht)])) : g("", !0)]))), 128)),
1455
- v("g", null, [
1456
- (S(!0), _(p, null, Le(G.value, (e, t) => (S(), _("g", { key: `rect_${e.id}_${e.depth}` }, [v("rect", {
1457
- x: e.x0,
1458
- y: e.y0,
1459
- height: K(e),
1460
- width: q(e),
1461
- fill: It.value ? e.color ?? F.value.style.chart.backgroundColor : F.value.style.chart.layout.rects.gradient.show ? sr.value ? F.value.style.chart.backgroundColor : `url(#tgrad_${e.id})` : e.color ?? F.value.style.chart.backgroundColor,
1462
- rx: oi(e),
1463
- stroke: Z.value && Z.value.id === e.id ? F.value.style.chart.layout.rects.selected.stroke : F.value.style.chart.layout.rects.stroke,
1464
- "stroke-width": Z.value && Z.value.id === e.id ? F.value.style.chart.layout.rects.selected.strokeWidth : F.value.style.chart.layout.rects.strokeWidth,
1465
- onClick: We((n) => Pr(e, t), ["stop"]),
1466
- onMouseenter: () => hr({
1467
- datapoint: e,
1468
- seriesIndex: t,
1469
- triggerMode: "pointer"
1470
- }),
1471
- onMouseleave: (n) => pr({
1472
- datapoint: e,
1473
- seriesIndex: t
1474
- }),
1475
- style: x(`opacity:${Z.value ? Z.value.id === e.id ? 1 : F.value.style.chart.layout.rects.selected.unselectedOpacity : 1}`),
1476
- class: Pe(["vue-ui-treemap-rect", ir(e) ? "vue-data-ui-zoom-minus" : "vue-data-ui-zoom-plus"])
1477
- }, null, 46, vt)]))), 128)),
1478
- (S(!0), _(p, null, Le(ei.value, (e) => (S(), _("g", {
1479
- key: e.key,
1480
- style: { "pointer-events": "none" }
1481
- }, [v("defs", null, [v("clipPath", {
1482
- id: e.clipId,
1483
- clipPathUnits: "userSpaceOnUse"
1484
- }, [v("rect", {
1485
- class: "vue-ui-treemap-data-label-clip",
1486
- x: e.clipX,
1487
- y: e.clipY,
1488
- width: e.clipWidth,
1489
- height: e.clipHeight
1490
- }, null, 8, bt)], 8, yt)]), v("g", { "clip-path": `url(#${e.clipId})` }, [(S(!0), _(p, null, Le(e.lines, (e) => (S(), _("text", {
1491
- key: e.key,
1492
- class: "vue-ui-treemap-data-label",
1493
- transform: `translate(${e.x}, ${e.y})`,
1494
- fill: e.fill,
1495
- "font-size": e.fontSize,
1496
- "font-family": e.fontFamily,
1497
- "font-weight": e.fontWeight,
1498
- "text-anchor": "start",
1499
- "dominant-baseline": "text-before-edge"
1500
- }, ze(e.text), 9, St))), 128))], 8, xt)]))), 128)),
1501
- e.$slots.rect ? (S(), _("g", Ct, [(S(!0), _(p, null, Le(G.value, (t, n) => (S(), _("g", { key: `slot_${t.id}_${t.depth}` }, [(S(), _("foreignObject", {
1502
- x: t.x0,
1503
- y: t.y0,
1504
- height: K(t),
1505
- width: q(t),
1506
- class: "vue-ui-treemap-cell-foreignObject",
1507
- style: {
1508
- "pointer-events": "none",
1509
- overflow: "hidden"
1510
- }
1511
- }, [v("div", Tt, [E(L) ? g("", !0) : w(e.$slots, "rect", Me({
1512
- key: 0,
1513
- ref_for: !0
1514
- }, {
1515
- rect: {
1516
- ...t,
1517
- height: K(t),
1518
- width: q(t),
1519
- isSelected: Z.value ? Z.value.id === t.id : !0
1520
- },
1521
- shouldShow: zn(t) || Qn.value,
1522
- fontSize: Yn(t, n),
1523
- isZoom: Qn.value,
1524
- textColor: E(ne)(t.color)
1525
- }), void 0, !0)])], 8, wt))]))), 128))])) : g("", !0)
1526
- ]),
1527
- w(e.$slots, "svg", b(y({
1528
- svg: V.value,
1529
- isZoom: Qn.value,
1530
- rect: Z.value,
1531
- config: F.value,
1532
- isPrintingImg: E(pn) || E(mn) || en.value,
1533
- isPrintingSvg: tn.value
1534
- })), void 0, !0)
1535
- ], 46, pt)),
1536
- E(Or) ? (S(), _("div", Et, [w(e.$slots, "reset-action", { reset: E(Dr) }, () => [v("button", {
1537
- "data-cy-reset": "",
1538
- tabindex: "0",
1539
- role: "button",
1540
- class: "vue-data-ui-refresh-button",
1541
- style: x({
1542
- background: F.value.style.chart.backgroundColor,
1543
- cursor: I.value ? "pointer" : "default"
1544
- }),
1545
- onClick: t[0] ||= (e) => E(Dr)(!0)
1546
- }, [Ae(ve, {
1547
- name: "refresh",
1548
- stroke: F.value.style.chart.color
1549
- }, null, 8, ["stroke"])], 4)], !0)])) : g("", !0),
1550
- e.$slots.hint ? (S(), _("div", Dt, [w(e.$slots, "hint", b(y({
1551
- hint: F.value.a11y.translations.keyboardNavigation,
1552
- isVisible: an.value
1553
- })), void 0, !0)])) : g("", !0)
1554
- ]),
1555
- e.$slots.watermark ? (S(), _("div", Ot, [w(e.$slots, "watermark", b(y({ isPrinting: E(pn) || E(mn) || en.value || tn.value })), void 0, !0)])) : g("", !0),
1556
- v("div", { id: `legend-bottom-${A.value}` }, null, 8, kt),
1557
- Yt.value && (F.value.style.chart.legend.show || e.$slots.legend) ? (S(), h(De, {
1558
- key: 7,
1559
- to: F.value.style.chart.legend.position === "top" ? `#legend-top-${A.value}` : `#legend-bottom-${A.value}`
1560
- }, [v("div", {
1561
- ref_key: "chartLegend",
1562
- ref: Ht
1563
- }, [w(e.$slots, "legend", { legend: ar.value }, () => [F.value.style.chart.legend.show ? (S(), h(Ce, {
1564
- key: `legend_${qt.value}`,
1565
- legendSet: ar.value,
1566
- config: or.value,
1567
- id: `treemap_legend_${A.value}`,
1568
- isCursorPointer: I.value,
1569
- onClickMarker: t[1] ||= ({ legend: e }) => lr(e)
1570
- }, {
1571
- item: O(({ legend: e, index: t }) => [E(L) ? g("", !0) : (S(), _("div", {
1572
- key: 0,
1573
- onClick: (t) => lr(e),
1574
- style: x(`opacity:${j.value.includes(e.id) ? .5 : 1}`)
1575
- }, ze(e.display), 13, At))]),
1576
- legendToggle: O(() => [ar.value.length > 2 && F.value.style.chart.legend.selectAllToggle.show && !E(L) ? (S(), h(ye, {
1577
- key: 0,
1578
- backgroundColor: F.value.style.chart.legend.selectAllToggle.backgroundColor,
1579
- color: F.value.style.chart.legend.selectAllToggle.color,
1580
- fontSize: F.value.style.chart.legend.fontSize,
1581
- checked: j.value.length > 0,
1582
- isCursorPointer: I.value,
1583
- onToggle: cr
1584
- }, null, 8, [
1585
- "backgroundColor",
1586
- "color",
1587
- "fontSize",
1588
- "checked",
1589
- "isCursorPointer"
1590
- ])) : g("", !0)]),
1591
- _: 1
1592
- }, 8, [
1593
- "legendSet",
1594
- "config",
1595
- "id",
1596
- "isCursorPointer"
1597
- ])) : g("", !0)], !0)], 512)], 8, ["to"])) : g("", !0),
1598
- e.$slots.source ? (S(), _("div", {
1599
- key: 8,
1600
- ref_key: "source",
1601
- ref: Ut,
1602
- dir: "auto"
1603
- }, [w(e.$slots, "source", {}, void 0, !0)], 512)) : g("", !0),
1604
- Ae(E(Xe), {
1605
- teleportTo: F.value.style.chart.tooltip.teleportTo,
1606
- show: z.value.showTooltip && Lt.value,
1607
- backgroundColor: F.value.style.chart.tooltip.backgroundColor,
1608
- color: F.value.style.chart.tooltip.color,
1609
- fontSize: F.value.style.chart.tooltip.fontSize,
1610
- borderRadius: F.value.style.chart.tooltip.borderRadius,
1611
- borderColor: F.value.style.chart.tooltip.borderColor,
1612
- borderWidth: F.value.style.chart.tooltip.borderWidth,
1613
- backgroundOpacity: F.value.style.chart.tooltip.backgroundOpacity,
1614
- position: F.value.style.chart.tooltip.position,
1615
- offsetX: F.value.style.chart.tooltip.offsetX,
1616
- offsetY: F.value.style.chart.tooltip.offsetY,
1617
- parent: M.value,
1618
- content: Rt.value,
1619
- isFullscreen: zt.value,
1620
- isCustom: E(u)(F.value.style.chart.tooltip.customFormat),
1621
- smooth: F.value.style.chart.tooltip.smooth,
1622
- backdropFilter: F.value.style.chart.tooltip.backdropFilter,
1623
- smoothForce: F.value.style.chart.tooltip.smoothForce,
1624
- smoothSnapThreshold: F.value.style.chart.tooltip.smoothSnapThreshold,
1625
- isA11yMode: rn.value === "keyboard",
1626
- a11yPosition: nn.value
1627
- }, {
1628
- "tooltip-before": O(() => [w(e.$slots, "tooltip-before", b(y({ ...mr.value })), void 0, !0)]),
1629
- tooltip: O(() => [w(e.$slots, "tooltip", b(y({ ...mr.value })), void 0, !0)]),
1630
- "tooltip-after": O(() => [w(e.$slots, "tooltip-after", b(y({ ...mr.value })), void 0, !0)]),
1631
- _: 3
1632
- }, 8, [
1633
- "teleportTo",
1634
- "show",
1635
- "backgroundColor",
1636
- "color",
1637
- "fontSize",
1638
- "borderRadius",
1639
- "borderColor",
1640
- "borderWidth",
1641
- "backgroundOpacity",
1642
- "position",
1643
- "offsetX",
1644
- "offsetY",
1645
- "parent",
1646
- "content",
1647
- "isFullscreen",
1648
- "isCustom",
1649
- "smooth",
1650
- "backdropFilter",
1651
- "smoothForce",
1652
- "smoothSnapThreshold",
1653
- "isA11yMode",
1654
- "a11yPosition"
1655
- ]),
1656
- Ft.value && F.value.userOptions.buttons.table ? (S(), h(Re(zr.value.component), Me({ key: 9 }, zr.value.props, {
1657
- ref_key: "tableUnit",
1658
- ref: Xt,
1659
- onClose: Br
1660
- }), Oe({
1661
- content: O(() => [(S(), h(E(Ke), {
1662
- key: `table_${Kt.value}`,
1663
- colNames: _r.value.colNames,
1664
- head: _r.value.head,
1665
- body: _r.value.body,
1666
- config: _r.value.config,
1667
- title: F.value.table.useDialog ? "" : zr.value.title,
1668
- withCloseButton: !F.value.table.useDialog,
1669
- isCursorPointer: I.value,
1670
- onClose: Br
1671
- }, {
1672
- th: O(({ th: e }) => [v("div", {
1673
- innerHTML: e,
1674
- style: {
1675
- display: "flex",
1676
- "align-items": "center"
1677
- }
1678
- }, null, 8, jt)]),
1679
- td: O(({ td: e }) => [ke(ze(e.name || e), 1)]),
1680
- _: 1
1681
- }, 8, [
1682
- "colNames",
1683
- "head",
1684
- "body",
1685
- "config",
1686
- "title",
1687
- "withCloseButton",
1688
- "isCursorPointer"
1689
- ]))]),
1690
- _: 2
1691
- }, [F.value.table.useDialog ? {
1692
- name: "title",
1693
- fn: O(() => [ke(ze(zr.value.title), 1)]),
1694
- key: "0"
1695
- } : void 0, F.value.table.useDialog ? {
1696
- name: "actions",
1697
- fn: O(() => [v("button", {
1698
- tabindex: "0",
1699
- class: "vue-ui-user-options-button",
1700
- onClick: t[2] ||= (e) => gr(F.value.userOptions.callbacks.csv),
1701
- style: x({ cursor: I.value ? "pointer" : "default" })
1702
- }, [Ae(ve, {
1703
- name: "fileCsv",
1704
- stroke: zr.value.props.color
1705
- }, null, 8, ["stroke"])], 4)]),
1706
- key: "1"
1707
- } : void 0]), 1040)) : g("", !0),
1708
- w(e.$slots, "skeleton", {}, () => [E(L) ? (S(), h(le, { key: 0 })) : g("", !0)], !0)
1709
- ], 46, it));
1710
- }
1711
- }, [["__scopeId", "data-v-442b6b44"]]);
1712
- //#endregion
1713
- export { rt as n, Nt as t };