vue-data-ui 3.0.0-next.9 → 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-B6OlqyCG.js → Arrow-r2f8Bpd-.js} +1 -1
  3. package/dist/{BaseDraggableDialog-CA8QOk7L.js → BaseDraggableDialog-CGGcf8d8.js} +4 -4
  4. package/dist/{BaseIcon-DxUUKVlt.js → BaseIcon-CXtL10fo.js} +1 -1
  5. package/dist/{ColorPicker-Bh1dfgXt.js → ColorPicker-H91bBsqM.js} +2 -2
  6. package/dist/{DataTable--paavNqF.js → DataTable-BSSXpM7w.js} +2 -2
  7. package/dist/{Legend-BZ06qU55.js → Legend-BUk0WvWJ.js} +2 -2
  8. package/dist/{NonSvgPenAndPaper-DN9XjEHv.js → NonSvgPenAndPaper-DQDgPoW8.js} +3 -3
  9. package/dist/{PackageVersion-2QvaZf9_.js → PackageVersion-CJ6Vd7V5.js} +3 -3
  10. package/dist/{PenAndPaper-hGgW0EHz.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-Mr1eIp_G.js → Shape-BRzOzubn.js} +43 -37
  15. package/dist/Slicer-MID8pgT3.js +602 -0
  16. package/dist/{SparkTooltip-Czhz446b.js → SparkTooltip-DATI1fGZ.js} +7 -7
  17. package/dist/{Title-B2dA6-uH.js → Title-BGu6gEd2.js} +1 -1
  18. package/dist/{Tooltip-O_hCvqgF.js → Tooltip-Bh2zYSoM.js} +23 -19
  19. package/dist/{UserOptions-Bk03FRqW.js → UserOptions-Ck8fz9f4.js} +2 -2
  20. package/dist/{dom-to-png-Bt5F9TXw.js → dom-to-png-DhIh24Ti.js} +1 -1
  21. package/dist/{img-C_9wps3s.js → img-DrR839Ot.js} +1 -1
  22. package/dist/{index-CgShIRes.js → index-BtNwOUja.js} +2885 -2010
  23. package/dist/{pdf-CXdbjyRJ.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-rIrqBbbm.js → usePrinter-DUNjpQNe.js} +2 -2
  33. package/dist/useTimeLabelCollider-CIsgDrl9.js +78 -0
  34. package/dist/{useTimeLabels-DG97x2hL.js → useTimeLabels-DkzmKfZn.js} +208 -156
  35. package/dist/{vue-data-ui-DiwfJSwC.js → vue-data-ui-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-hlzscmAS.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-BHwBUNRO.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-6MTDYf-H.js → vue-ui-carousel-table-DGz0nw28.js} +29 -29
  44. package/dist/{vue-ui-chestnut-Cr6dK21e.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-Ch5yUxNn.js → vue-ui-cursor-Dd-HtWzG.js} +2 -2
  48. package/dist/{vue-ui-dashboard-tVZ9aEHo.js → vue-ui-dashboard-6R8udDY3.js} +64 -64
  49. package/dist/{vue-ui-digits-BOlYLluF.js → vue-ui-digits-zKn3uhGN.js} +2 -2
  50. package/dist/{vue-ui-donut-BKwAnTKA.js → vue-ui-donut-BtnIwS_E.js} +431 -422
  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-CAV6A--C.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-DjHXc1Z9.js → vue-ui-kpi-hmqSCvxr.js} +26 -26
  61. package/dist/{vue-ui-mini-loader-C68r9wbr.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-ULvVhjjq.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-CkdVnYpj.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-BsBaCvoE.js → vue-ui-skeleton-oG4Bm5nL.js} +13 -13
  76. package/dist/{vue-ui-smiley-B2sBY2Q-.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-DaE8lQuo.js → vue-ui-table-BXOLZXuz.js} +17 -17
  86. package/dist/{vue-ui-table-heatmap--dSEG8cU.js → vue-ui-table-heatmap-7YT7VF2H.js} +5 -5
  87. package/dist/{vue-ui-table-sparkline-D4DkGvDP.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-CYXTAh6x.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-CO9eR1ty.js → vue-ui-vertical-bar-C-i2dRnU.js} +104 -102
  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-P45Plcqw.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-DgNBgUak.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-3t0HimeE.js +0 -577
  102. package/dist/useLoading-Bt5Doa8m.js +0 -28
  103. package/dist/useNestedProp-BC4Ciblw.js +0 -13
  104. package/dist/usePanZoom-BQMvRXEQ.js +0 -115
  105. package/dist/vue-ui-3d-bar-BqmzX9u4.js +0 -1227
  106. package/dist/vue-ui-age-pyramid-eRPt0BJb.js +0 -746
  107. package/dist/vue-ui-bullet-BSnF2gql.js +0 -513
  108. package/dist/vue-ui-candlestick-kMbNnoYe.js +0 -873
  109. package/dist/vue-ui-chord-Dxy_bfIE.js +0 -949
  110. package/dist/vue-ui-circle-pack-I_p4FPiW.js +0 -673
  111. package/dist/vue-ui-donut-evolution-DQhZJ4Sa.js +0 -903
  112. package/dist/vue-ui-dumbbell-DdN-7b3g.js +0 -753
  113. package/dist/vue-ui-flow-MvORTthN.js +0 -765
  114. package/dist/vue-ui-galaxy-B0PLMAn8.js +0 -617
  115. package/dist/vue-ui-gauge-C4FTzDFt.js +0 -738
  116. package/dist/vue-ui-gizmo-Dl5FHFb4.js +0 -192
  117. package/dist/vue-ui-heatmap-C3dee43W.js +0 -877
  118. package/dist/vue-ui-history-plot-dqv4u1Oa.js +0 -924
  119. package/dist/vue-ui-molecule-DtRAlfhC.js +0 -597
  120. package/dist/vue-ui-mood-radar-BZj2G0zE.js +0 -670
  121. package/dist/vue-ui-nested-donuts-OqJTwMb2.js +0 -1212
  122. package/dist/vue-ui-onion-DXLokGec.js +0 -701
  123. package/dist/vue-ui-parallel-coordinate-plot-tg7QhtIE.js +0 -807
  124. package/dist/vue-ui-quick-chart-4EODniQ3.js +0 -1612
  125. package/dist/vue-ui-radar-Dt5p5oSy.js +0 -741
  126. package/dist/vue-ui-relation-circle-_SysXj9T.js +0 -542
  127. package/dist/vue-ui-ridgeline-Cs5UihNN.js +0 -969
  128. package/dist/vue-ui-rings-Duay-EmS.js +0 -685
  129. package/dist/vue-ui-scatter-C6oGQcbL.js +0 -1045
  130. package/dist/vue-ui-spark-trend-CEAqGu3d.js +0 -291
  131. package/dist/vue-ui-sparkbar-ByPUDc6x.js +0 -301
  132. package/dist/vue-ui-sparkgauge-C-GKwevJ.js +0 -201
  133. package/dist/vue-ui-sparkhistogram-Dz0DdaVW.js +0 -313
  134. package/dist/vue-ui-sparkline-BULntz_U.js +0 -459
  135. package/dist/vue-ui-sparkstackbar-DXjHOeeU.js +0 -381
  136. package/dist/vue-ui-stackbar-CeP9n7zy.js +0 -1207
  137. package/dist/vue-ui-strip-plot-CaFQkWV8.js +0 -761
  138. package/dist/vue-ui-thermometer-BXf14CYH.js +0 -495
  139. package/dist/vue-ui-tiremarks-D6hJ1cd4.js +0 -358
  140. package/dist/vue-ui-treemap-tBurCrdn.js +0 -965
  141. package/dist/vue-ui-waffle-BNzs_BxY.js +0 -863
  142. package/dist/vue-ui-wheel-tydUATi8.js +0 -352
  143. package/dist/vue-ui-word-cloud-DUUc_tj6.js +0 -659
  144. package/dist/vue-ui-xy--HToGdle.js +0 -2982
@@ -1,765 +0,0 @@
1
- import { defineAsyncComponent as E, computed as p, onMounted as it, ref as y, watch as ct, createElementBlock as g, openBlock as d, unref as r, normalizeStyle as L, normalizeClass as He, createBlock as R, createCommentVNode as _, createElementVNode as D, createVNode as de, createSlots as dt, withCtx as w, renderSlot as b, normalizeProps as U, guardReactiveProps as V, Fragment as W, renderList as j, toDisplayString as X, createTextVNode as vt, nextTick as ft } from "vue";
2
- import { u as ht, o as pt, e as gt, c as ve, t as mt, p as S, a as yt, b as bt, v as $, d as kt, f as q, X as Ct, F as Ye, L as wt, i as fe, q as $t, r as xt, x as Tt } from "./index-CgShIRes.js";
3
- import { u as Be } from "./useNestedProp-BC4Ciblw.js";
4
- import { u as _t } from "./usePrinter-rIrqBbbm.js";
5
- import { u as Nt } from "./useUserOptionState-BIvW1Kz7.js";
6
- import { u as Ot } from "./useChartAccessibility-9icAAmYg.js";
7
- import St from "./Legend-BZ06qU55.js";
8
- import Ft from "./Title-B2dA6-uH.js";
9
- import Pt from "./img-C_9wps3s.js";
10
- import { _ as Lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
- const It = ["id"], At = {
12
- key: 1,
13
- ref: "noTitle",
14
- class: "vue-data-ui-no-title-space",
15
- style: "height:36px; width: 100%;background:transparent"
16
- }, Et = {
17
- key: 2,
18
- style: "width:100%;background:transparent;padding-bottom:24px"
19
- }, zt = ["xmlns", "viewBox"], Mt = ["width", "height"], Ht = ["id"], Yt = ["stop-color"], Bt = ["stop-color"], Rt = ["d", "fill", "stroke", "stroke-width"], Dt = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "onMouseenter"], Ut = ["x", "y", "font-size", "fill"], Vt = ["x", "y", "font-size", "fill"], Gt = {
20
- key: 4,
21
- class: "vue-data-ui-watermark"
22
- }, Wt = ["onClick"], jt = {
23
- key: 6,
24
- ref: "source",
25
- dir: "auto"
26
- }, Xt = ["innerHTML"], qt = {
27
- __name: "vue-ui-flow",
28
- props: {
29
- config: {
30
- type: Object,
31
- default() {
32
- return {};
33
- }
34
- },
35
- dataset: {
36
- type: Array,
37
- default() {
38
- return [];
39
- }
40
- }
41
- },
42
- setup(Re, { expose: De }) {
43
- const Ue = E(() => import("./vue-ui-accordion-hlzscmAS.js")), Ve = E(() => import("./DataTable--paavNqF.js")), Ge = E(() => import("./PackageVersion-2QvaZf9_.js")), We = E(() => import("./PenAndPaper-hGgW0EHz.js")), je = E(() => import("./vue-ui-skeleton-BsBaCvoE.js")), Xe = E(() => import("./Tooltip-O_hCvqgF.js")), qe = E(() => import("./UserOptions-Bk03FRqW.js")), { vue_ui_flow: Ze } = ht(), x = Re, te = p(() => !!x.dataset && x.dataset.length);
44
- it(() => {
45
- he();
46
- });
47
- function he() {
48
- pt(x.dataset) && gt({
49
- componentName: "VueUiFlow",
50
- type: "dataset"
51
- });
52
- }
53
- const oe = y(ve()), z = y(null), pe = y(0), ge = y(0), le = y(!1), ae = y(""), Je = y(null), M = y(!1);
54
- function me(t) {
55
- M.value = t, pe.value += 1;
56
- }
57
- const e = p({
58
- get: () => Ce(),
59
- set: (t) => t
60
- }), { userOptionsVisible: ne, setUserOptionsVisibility: ye, keepUserOptionState: be } = Nt({ config: e.value }), { svgRef: ke } = Ot({
61
- config: e.value.style.chart.title
62
- });
63
- function Ce() {
64
- const t = Be({
65
- userConfig: x.config,
66
- defaultConfig: Ze
67
- });
68
- let l = t;
69
- return t.theme ? l = {
70
- ...Be({
71
- userConfig: yt.vue_ui_flow[t.theme] || x.config,
72
- defaultConfig: t
73
- }),
74
- customPalette: mt[t.theme] || S
75
- } : l = t, l.nodeCategories = x.config.nodeCategories || {}, l.nodeCategoryColors = x.config.nodeCategoryColors || {}, l;
76
- }
77
- ct(
78
- () => x.config,
79
- (t) => {
80
- e.value = Ce(), ne.value = !e.value.userOptions.showOnChartHover, he(), ge.value += 1, N.value.showTable = e.value.table.show;
81
- },
82
- { deep: !0 }
83
- );
84
- const { isPrinting: we, isImaging: $e, generatePdf: xe, generateImage: Te } = _t({
85
- elementId: `flow_${oe.value}`,
86
- fileName: e.value.style.chart.title.text || "vue-ui-flow",
87
- options: e.value.userOptions.print
88
- }), Ke = p(() => e.value.userOptions.show && !e.value.style.chart.title.text), Z = p(() => bt(e.value.customPalette)), _e = p(() => e.value.style.chart.nodes.gap), H = p(() => e.value.style.chart.nodes.width), N = y({
89
- showTable: e.value.table.show,
90
- showTooltip: e.value.style.chart.tooltip.show
91
- }), Qe = p(() => e.value.style.chart.links.width), se = p(() => !x.dataset || !x.dataset.length ? [] : x.dataset.map((t, l) => [
92
- t[0],
93
- t[1],
94
- $(t[2]),
95
- t[3] ? kt(t[3]) : Z.value[l] || Z.value[l % Z.value.length] || S[l] || S[l % S.length]
96
- ])), Ne = p(() => {
97
- const t = {};
98
- function l(a) {
99
- t[a] || (t[a] = { inflow: 0, outflow: 0 });
100
- }
101
- se.value.forEach(([a, s, f]) => {
102
- l(a), l(s), t[a].outflow += f, t[s].inflow += f;
103
- });
104
- let o = 0;
105
- for (const a in t) {
106
- const s = Math.max(t[a].inflow, t[a].outflow);
107
- o = Math.max(o, s);
108
- }
109
- return o;
110
- });
111
- function et(t) {
112
- return t / Ne.value * 100 + e.value.style.chart.nodes.minHeight;
113
- }
114
- function tt(t) {
115
- const l = e.value.style.chart.nodes.minHeight;
116
- return (t - l) / 100 * Ne.value;
117
- }
118
- function ot(t) {
119
- const l = {}, o = {};
120
- function a(n, u) {
121
- l[n] || (l[n] = {
122
- height: 0,
123
- level: null,
124
- inflow: 0,
125
- outflow: 0,
126
- uid: ve()
127
- }), l[n].level === null && (l[n].level = u), o[u] || (o[u] = []), o[u].includes(n) || o[u].push(n);
128
- }
129
- t.forEach(([n, u, c]) => {
130
- const v = l[n]?.level ?? 0, C = v + 1;
131
- a(n, v), a(u, C), l[n].children || (l[n].children = []), l[n].children.push({ target: u, value: c }), l[n].outflow += c, l[u].inflow += c;
132
- });
133
- const s = new Set(t.map(([n]) => n)), f = new Set(t.map(([, n]) => n)), F = Array.from(s).filter((n) => !f.has(n)), B = {};
134
- F.forEach((n, u) => {
135
- B[n] = Z.value[u] || S[u % S.length];
136
- });
137
- const T = {};
138
- t.forEach(([n, u, c, v]) => {
139
- v && (T[n] = v, T[u] = v);
140
- }), Object.keys(l).forEach((n, u) => {
141
- const c = e.value.nodeCategories?.[n], v = c ? e.value.nodeCategoryColors?.[c] : null;
142
- l[n].color = T[n] || // 1) explicit
143
- v || // 2) category
144
- (F.includes(n) ? B[n] : null) || // 3) root
145
- S[u % S.length];
146
- });
147
- for (const n in l)
148
- l[n].height = et(
149
- Math.max(l[n].inflow, l[n].outflow)
150
- ), l[n].name = n;
151
- const O = {};
152
- for (const n in o) {
153
- let u = 0;
154
- o[n].forEach((c, v) => {
155
- const C = l[c];
156
- O[c] = {
157
- x: parseInt(n, 10) * Qe.value + e.value.style.chart.padding.left,
158
- y: u,
159
- absoluteY: u,
160
- height: C.height,
161
- i: v,
162
- color: C.color,
163
- value: tt(C.height)
164
- }, u += C.height + _e.value;
165
- });
166
- }
167
- const A = [];
168
- for (const n of Object.keys(l)) {
169
- let u = O[n].absoluteY + e.value.style.chart.padding.top;
170
- const c = l[n], v = O[n];
171
- c.children && c.children.forEach(({ target: C, value: i }) => {
172
- const h = O[C], P = l[C], ee = $(u), ze = $(
173
- u + i / c.outflow * v.height
174
- ), ce = $(
175
- h.y + e.value.style.chart.padding.top
176
- ), Me = $(
177
- ce + i / P.inflow * h.height
178
- );
179
- A.push({
180
- id: ve(),
181
- source: n,
182
- target: C,
183
- path: `M ${$(v.x + H.value)} ${ee} L ${$(v.x + H.value)} ${ze} L ${$(h.x)} ${Me} L ${$(h.x)} ${ce} Z`,
184
- value: i,
185
- sourceColor: c.color,
186
- targetColor: P.color
187
- }), u += ze - ee, O[C].y += Me - ce;
188
- });
189
- }
190
- return { nodeCoordinates: O, links: A };
191
- }
192
- const m = p(() => {
193
- const t = ot(x.dataset);
194
- return {
195
- nodes: Object.keys(t.nodeCoordinates).map((l, o) => ({
196
- ...t.nodeCoordinates[l],
197
- name: l
198
- })),
199
- links: t.links
200
- };
201
- });
202
- p(() => lt(m.value.nodes));
203
- function lt(t) {
204
- const l = {};
205
- for (const a in t) {
206
- const { x: s, height: f } = t[a];
207
- l[s] || (l[s] = 0), l[s] += f + _e.value;
208
- }
209
- return Math.max(...Object.values(l));
210
- }
211
- const G = p(() => {
212
- const { top: t, right: l, bottom: o, left: a } = e.value.style.chart.padding, s = Math.max(...m.value.nodes.map((T) => T.x)), f = a + s + H.value + l, F = Math.max(
213
- ...m.value.nodes.map((T) => T.absoluteY + T.height)
214
- ), B = t + F + o;
215
- return { width: f, height: B };
216
- });
217
- function at(t) {
218
- const l = {}, o = {}, a = /* @__PURE__ */ new Set();
219
- return se.value.forEach(([s, f, F]) => {
220
- l[s] || (l[s] = []), o[f] || (o[f] = []), l[s].push(f), o[f].push(s);
221
- }), l[t] && l[t].forEach((s) => a.add(s)), o[t] && o[t].forEach((s) => a.add(s)), Array.from(a).concat(t);
222
- }
223
- const k = y(null), Y = y(null), re = y(null), J = y(!1);
224
- function nt(t) {
225
- I.value = [], k.value = at(t.name), Y.value = t.name;
226
- const l = t.name, o = se.value;
227
- let a = 0, s = 0, f = [], F = [];
228
- const B = new Set(o.map(([i]) => i)), T = new Set(o.map(([, i]) => i)), Ee = Array.from(B).filter((i) => !T.has(i)), O = o.filter(([i]) => Ee.includes(i)).reduce((i, [h, P, ee]) => i + ee, 0), A = {};
229
- m.value.nodes.forEach((i) => {
230
- A[i.name] = i.color;
231
- }), o.forEach(([i, h, P]) => {
232
- h === l && (a += P, f.push({ source: i, value: P, color: A[i] })), i === l && (s += P, F.push({ target: h, value: P, color: A[h] }));
233
- });
234
- const n = Math.max(a, s), u = O > 0 ? n / O * 100 : 0, c = {
235
- name: l,
236
- inflow: a,
237
- outflow: s,
238
- from: f,
239
- to: F,
240
- percentOfTotal: u,
241
- color: A[l] || "#000000"
242
- };
243
- re.value = { datapoint: c }, le.value = !0;
244
- let v = "";
245
- const C = e.value.style.chart.tooltip.customFormat;
246
- if (J.value = !1, Tt(C))
247
- try {
248
- const i = C({
249
- datapoint: c,
250
- series: m.value,
251
- config: e.value
252
- });
253
- typeof i == "string" && (ae.value = i, J.value = !0);
254
- } catch {
255
- console.warn("Custom format cannot be applied.");
256
- }
257
- if (!J.value) {
258
- const i = e.value.style.chart.tooltip.showPercentage ? `<div>${q({
259
- p: e.value.style.chart.tooltip.translations.percentOfTotal,
260
- v: c.percentOfTotal,
261
- s: "%",
262
- r: e.value.style.chart.tooltip.roundingPercentage
263
- })}</div>` : "";
264
- v += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;"><span style="margin-right:4px; color:${c.color}">⏹</span>${c.name}${i}</div>`, c.from.length && (v += `<div>${e.value.style.chart.tooltip.translations.from}</div>`, c.from.forEach((h) => {
265
- v += `<div><span style="color:${h.color}">⏹←</span> ${h.source}: ${fe(
266
- e.value.style.chart.nodes.labels.formatter,
267
- h.value,
268
- q({
269
- p: e.value.style.chart.nodes.labels.prefix,
270
- v: h.value,
271
- s: e.value.style.chart.nodes.labels.suffix,
272
- r: e.value.style.chart.nodes.labels.rounding
273
- })
274
- )}</div>`;
275
- })), c.to.length && (v += `<div style="margin-top:6px;">${e.value.style.chart.tooltip.translations.to}</div>`, c.to.forEach((h) => {
276
- v += `<div><span style="color:${h.color}">⏹→</span> ${h.target}: ${fe(
277
- e.value.style.chart.nodes.labels.formatter,
278
- h.value,
279
- q({
280
- p: e.value.style.chart.nodes.labels.prefix,
281
- v: h.value,
282
- s: e.value.style.chart.nodes.labels.suffix,
283
- r: e.value.style.chart.nodes.labels.rounding
284
- })
285
- )}</div>`;
286
- })), ae.value = v;
287
- }
288
- }
289
- function Oe() {
290
- k.value = null, Y.value = null, le.value = !1;
291
- }
292
- const Se = p(() => m.value.links.map(
293
- ({ source: t, target: l, sourceColor: o, targetColor: a, value: s }) => ({
294
- source: t,
295
- target: l,
296
- sourceColor: o,
297
- targetColor: a,
298
- value: s
299
- })
300
- ));
301
- function Fe(t = null) {
302
- ft(() => {
303
- const l = Se.value.map((s, f) => [[s.source], [s.target], [s.value]]), o = [
304
- [e.value.style.chart.title.text],
305
- [e.value.style.chart.title.subtitle.text],
306
- [
307
- [e.value.table.columnNames.source],
308
- [e.value.table.columnNames.target],
309
- [e.value.table.columnNames.value]
310
- ]
311
- ].concat(l), a = $t(o);
312
- t ? t(a) : xt({
313
- csvContent: a,
314
- title: e.value.style.chart.title.text || "vue-ui-flow"
315
- });
316
- });
317
- }
318
- const K = p(() => {
319
- const t = [
320
- e.value.table.columnNames.source,
321
- e.value.table.columnNames.target,
322
- e.value.table.columnNames.value
323
- ], l = Se.value.map((s, f) => [
324
- {
325
- color: s.sourceColor,
326
- name: s.source
327
- },
328
- {
329
- color: s.targetColor,
330
- name: s.target
331
- },
332
- q({
333
- p: e.value.style.chart.nodes.labels.prefix,
334
- v: s.value,
335
- s: e.value.style.chart.nodes.labels.suffix,
336
- r: e.value.style.chart.nodes.labels.rounding
337
- })
338
- ]), o = {
339
- th: {
340
- backgroundColor: e.value.table.th.backgroundColor,
341
- color: e.value.table.th.color,
342
- outline: e.value.table.th.outline
343
- },
344
- td: {
345
- backgroundColor: e.value.table.td.backgroundColor,
346
- color: e.value.table.td.color,
347
- outline: e.value.table.td.outline
348
- },
349
- breakpoint: e.value.table.responsiveBreakpoint
350
- };
351
- return {
352
- colNames: [
353
- e.value.table.columnNames.source,
354
- e.value.table.columnNames.target,
355
- e.value.table.columnNames.value
356
- ],
357
- head: t,
358
- body: l,
359
- config: o
360
- };
361
- });
362
- function st() {
363
- return m.value;
364
- }
365
- function Pe() {
366
- N.value.showTable = !N.value.showTable;
367
- }
368
- const Q = y(!1);
369
- function ue() {
370
- Q.value = !Q.value;
371
- }
372
- function Le() {
373
- N.value.showTooltip = !N.value.showTooltip;
374
- }
375
- const Ie = p(() => {
376
- const t = new Set(
377
- m.value.nodes.map(
378
- (l) => e.value.nodeCategories[l.name] || "__uncategorized__"
379
- )
380
- );
381
- return Array.from(t).map((l) => ({
382
- name: l,
383
- color: e.value.nodeCategoryColors[l] || S[0],
384
- shape: "square",
385
- count: m.value.nodes.filter(
386
- (o) => (e.value.nodeCategories[o.name] || "__uncategorized__") === l
387
- ).length
388
- })).map((l, o) => ({
389
- ...l,
390
- segregate: () => ie({ legend: l, i: o }),
391
- opacity: I.value.length ? I.value.includes(o) ? 1 : 0.5 : 1
392
- }));
393
- }), Ae = p(
394
- () => Ie.value.filter((t) => t.name !== "__uncategorized__")
395
- ), I = y([]);
396
- function ie({ legend: t, i: l }) {
397
- const o = t.name;
398
- if (k.value?.every(
399
- (a) => e.value.nodeCategories[a] === o
400
- )) {
401
- k.value = null, Y.value = null, I.value = [];
402
- return;
403
- }
404
- I.value = [l], k.value = m.value.nodes.filter((a) => e.value.nodeCategories[a.name] === o).map((a) => a.name), Y.value = null;
405
- }
406
- const rt = p(() => ({
407
- cy: "flow-legend",
408
- backgroundColor: e.value.style.chart.legend.backgroundColor,
409
- color: e.value.style.chart.legend.color,
410
- fontSize: e.value.style.chart.legend.fontSize,
411
- paddingBottom: e.value.style.chart.legend.paddingBottom,
412
- fontWeight: e.value.style.chart.legend.bold ? "bold" : "normal"
413
- }));
414
- async function ut({ scale: t = 2 } = {}) {
415
- if (!z.value) return;
416
- const { width: l, height: o } = z.value.getBoundingClientRect(), a = l / o, { imageUri: s, base64: f } = await Pt({ domElement: z.value, base64: !0, img: !0, scale: t });
417
- return {
418
- imageUri: s,
419
- base64: f,
420
- title: e.value.style.chart.title.text,
421
- width: l,
422
- height: o,
423
- aspectRatio: a
424
- };
425
- }
426
- return De({
427
- getData: st,
428
- getImage: ut,
429
- generateCsv: Fe,
430
- generateImage: Te,
431
- generatePdf: xe,
432
- toggleTable: Pe,
433
- toggleAnnotator: ue,
434
- toggleTooltip: Le,
435
- drillCategory: ie,
436
- unselectNode: Oe,
437
- toggleFullscreen: me
438
- }), (t, l) => (d(), g("div", {
439
- ref_key: "flowChart",
440
- ref: z,
441
- class: He(`vue-ui-flow ${M.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
442
- style: L(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor}`),
443
- id: `flow_${oe.value}`,
444
- onMouseenter: l[3] || (l[3] = () => r(ye)(!0)),
445
- onMouseleave: l[4] || (l[4] = () => r(ye)(!1))
446
- }, [
447
- e.value.userOptions.buttons.annotator ? (d(), R(r(We), {
448
- key: 0,
449
- svgRef: r(ke),
450
- backgroundColor: e.value.style.chart.backgroundColor,
451
- color: e.value.style.chart.color,
452
- active: Q.value,
453
- onClose: ue
454
- }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : _("", !0),
455
- Ke.value ? (d(), g("div", At, null, 512)) : _("", !0),
456
- e.value.style.chart.title.text ? (d(), g("div", Et, [
457
- (d(), R(Ft, {
458
- key: `title_${ge.value}`,
459
- config: {
460
- title: {
461
- cy: "flow-title",
462
- ...e.value.style.chart.title
463
- },
464
- subtitle: {
465
- cy: "flow-subtitle",
466
- ...e.value.style.chart.title.subtitle
467
- }
468
- }
469
- }, null, 8, ["config"]))
470
- ])) : _("", !0),
471
- e.value.userOptions.show && te.value && (r(be) || r(ne)) ? (d(), R(r(qe), {
472
- ref: "details",
473
- key: `user_option_${pe.value}`,
474
- backgroundColor: e.value.style.chart.backgroundColor,
475
- color: e.value.style.chart.color,
476
- isPrinting: r(we),
477
- isImaging: r($e),
478
- uid: oe.value,
479
- hasPdf: e.value.userOptions.buttons.pdf,
480
- hasXls: e.value.userOptions.buttons.csv,
481
- hasImg: e.value.userOptions.buttons.img,
482
- hasTable: e.value.userOptions.buttons.table,
483
- callbacks: e.value.userOptions.callbacks,
484
- hasFullscreen: e.value.userOptions.buttons.fullscreen,
485
- isFullscreen: M.value,
486
- titles: { ...e.value.userOptions.buttonTitles },
487
- chartElement: z.value,
488
- position: e.value.userOptions.position,
489
- hasAnnotator: e.value.userOptions.buttons.annotator,
490
- printScale: e.value.userOptions.print.scale,
491
- isAnnotation: Q.value,
492
- hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
493
- isTooltip: N.value.showTooltip,
494
- onToggleTooltip: Le,
495
- onToggleFullscreen: me,
496
- onGeneratePdf: r(xe),
497
- onGenerateCsv: Fe,
498
- onGenerateImage: r(Te),
499
- onToggleTable: Pe,
500
- onToggleAnnotator: ue,
501
- style: L({
502
- visibility: r(be) ? r(ne) ? "visible" : "hidden" : "visible"
503
- })
504
- }, dt({ _: 2 }, [
505
- t.$slots.menuIcon ? {
506
- name: "menuIcon",
507
- fn: w(({ isOpen: o, color: a }) => [
508
- b(t.$slots, "menuIcon", U(V({ isOpen: o, color: a })), void 0, !0)
509
- ]),
510
- key: "0"
511
- } : void 0,
512
- t.$slots.optionTooltip ? {
513
- name: "optionTooltip",
514
- fn: w(() => [
515
- b(t.$slots, "optionTooltip", {}, void 0, !0)
516
- ]),
517
- key: "1"
518
- } : void 0,
519
- t.$slots.optionPdf ? {
520
- name: "optionPdf",
521
- fn: w(() => [
522
- b(t.$slots, "optionPdf", {}, void 0, !0)
523
- ]),
524
- key: "2"
525
- } : void 0,
526
- t.$slots.optionCsv ? {
527
- name: "optionCsv",
528
- fn: w(() => [
529
- b(t.$slots, "optionCsv", {}, void 0, !0)
530
- ]),
531
- key: "3"
532
- } : void 0,
533
- t.$slots.optionImg ? {
534
- name: "optionImg",
535
- fn: w(() => [
536
- b(t.$slots, "optionImg", {}, void 0, !0)
537
- ]),
538
- key: "4"
539
- } : void 0,
540
- t.$slots.optionTable ? {
541
- name: "optionTable",
542
- fn: w(() => [
543
- b(t.$slots, "optionTable", {}, void 0, !0)
544
- ]),
545
- key: "5"
546
- } : void 0,
547
- t.$slots.optionFullscreen ? {
548
- name: "optionFullscreen",
549
- fn: w(({ toggleFullscreen: o, isFullscreen: a }) => [
550
- b(t.$slots, "optionFullscreen", U(V({ toggleFullscreen: o, isFullscreen: a })), void 0, !0)
551
- ]),
552
- key: "6"
553
- } : void 0,
554
- t.$slots.optionAnnotator ? {
555
- name: "optionAnnotator",
556
- fn: w(({ toggleAnnotator: o, isAnnotator: a }) => [
557
- b(t.$slots, "optionAnnotator", U(V({ toggleAnnotator: o, isAnnotator: a })), void 0, !0)
558
- ]),
559
- key: "7"
560
- } : void 0
561
- ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "callbacks", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "printScale", "isAnnotation", "hasTooltip", "isTooltip", "onGeneratePdf", "onGenerateImage", "style"])) : _("", !0),
562
- (d(), g("svg", {
563
- ref_key: "svgRef",
564
- ref: ke,
565
- xmlns: r(Ct),
566
- viewBox: `0 0 ${G.value.width} ${G.value.height}`,
567
- class: He({
568
- "vue-data-ui-fullscreen--on": M.value,
569
- "vue-data-ui-fulscreen--off": !M.value
570
- }),
571
- style: L(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
572
- }, [
573
- de(r(Ge)),
574
- t.$slots["chart-background"] ? (d(), g("foreignObject", {
575
- key: 0,
576
- x: 0,
577
- y: 0,
578
- width: G.value.width,
579
- height: G.value.height,
580
- style: {
581
- pointerEvents: "none"
582
- }
583
- }, [
584
- b(t.$slots, "chart-background", {}, void 0, !0)
585
- ], 8, Mt)) : _("", !0),
586
- D("defs", null, [
587
- (d(!0), g(W, null, j(m.value.links, (o, a) => (d(), g("linearGradient", {
588
- id: o.id,
589
- x1: "0%",
590
- y1: "0%",
591
- x2: "100%",
592
- y2: "0%"
593
- }, [
594
- D("stop", {
595
- offset: "0%",
596
- "stop-color": o.sourceColor
597
- }, null, 8, Yt),
598
- D("stop", {
599
- offset: "100%",
600
- "stop-color": o.targetColor
601
- }, null, 8, Bt)
602
- ], 8, Ht))), 256))
603
- ]),
604
- (d(!0), g(W, null, j(m.value.links, (o) => (d(), g("path", {
605
- class: "vue-ui-flow-link",
606
- d: o.path,
607
- fill: `url(#${o.id})`,
608
- stroke: e.value.style.chart.links.stroke,
609
- "stroke-width": e.value.style.chart.links.strokeWidth,
610
- style: L(`
611
- opacity:${k.value ? k.value.includes(o.source) && k.value.includes(o.target) ? 1 : 0.3 : Y.value ? [o.target, o.source].includes(Y.value) ? 1 : 0.3 : e.value.style.chart.links.opacity}
612
- `)
613
- }, null, 12, Rt))), 256)),
614
- (d(!0), g(W, null, j(m.value.nodes, (o, a) => (d(), g("rect", {
615
- class: "vue-ui-flow-node",
616
- x: o.x,
617
- y: r($)(o.absoluteY) + e.value.style.chart.padding.top,
618
- height: r($)(o.height),
619
- width: H.value,
620
- fill: o.color,
621
- stroke: e.value.style.chart.nodes.stroke,
622
- "stroke-width": e.value.style.chart.nodes.strokeWidth,
623
- onMouseenter: (s) => nt(o),
624
- onMouseleave: l[0] || (l[0] = (s) => Oe()),
625
- style: L(`opacity:${k.value ? k.value.includes(o.name) ? 1 : 0.3 : 1}`)
626
- }, null, 44, Dt))), 256)),
627
- (d(!0), g(W, null, j(m.value.nodes, (o, a) => (d(), g("text", {
628
- x: o.x + H.value / 2,
629
- y: r($)(
630
- o.absoluteY + o.height / 2 - e.value.style.chart.nodes.labels.fontSize / 4
631
- ) + e.value.style.chart.padding.top,
632
- "font-size": e.value.style.chart.nodes.labels.fontSize,
633
- fill: r(Ye)(o.color),
634
- "text-anchor": "middle",
635
- style: L(`pointer-events: none; opacity:${k.value ? k.value.includes(o.name) ? 1 : 0 : 1}`)
636
- }, X(e.value.style.chart.nodes.labels.abbreviation.use ? r(wt)({
637
- source: o.name,
638
- length: e.value.style.chart.nodes.labels.abbreviation.length
639
- }) : o.name), 13, Ut))), 256)),
640
- (d(!0), g(W, null, j(m.value.nodes, (o, a) => (d(), g("text", {
641
- x: o.x + H.value / 2,
642
- y: r($)(
643
- o.absoluteY + o.height / 2 + e.value.style.chart.nodes.labels.fontSize
644
- ) + e.value.style.chart.padding.top,
645
- "font-size": e.value.style.chart.nodes.labels.fontSize,
646
- fill: r(Ye)(o.color),
647
- "text-anchor": "middle",
648
- style: L(`pointer-events: none; opacity:${k.value ? k.value.includes(o.name) ? 1 : 0 : 1}`)
649
- }, X(r(fe)(
650
- e.value.style.chart.nodes.labels.formatter,
651
- o.value,
652
- r(q)({
653
- p: e.value.style.chart.nodes.labels.prefix,
654
- v: o.value,
655
- s: e.value.style.chart.nodes.labels.suffix,
656
- r: e.value.style.chart.nodes.labels.rounding
657
- }),
658
- { datapoint: o, seriesIndex: a }
659
- )), 13, Vt))), 256)),
660
- b(t.$slots, "svg", { svg: G.value }, void 0, !0)
661
- ], 14, zt)),
662
- t.$slots.watermark ? (d(), g("div", Gt, [
663
- b(t.$slots, "watermark", U(V({ isPrinting: r(we) || r($e) })), void 0, !0)
664
- ])) : _("", !0),
665
- te.value ? _("", !0) : (d(), R(r(je), {
666
- key: 5,
667
- config: {
668
- type: "flow",
669
- style: {
670
- backgroundColor: e.value.style.chart.backgroundColor
671
- }
672
- }
673
- }, null, 8, ["config"])),
674
- D("div", {
675
- ref_key: "chartLegend",
676
- ref: Je
677
- }, [
678
- e.value.style.chart.legend.show && Ae.value.length ? (d(), R(St, {
679
- key: 0,
680
- legendSet: Ae.value,
681
- config: rt.value,
682
- onClickMarker: l[1] || (l[1] = (o) => ie(o))
683
- }, {
684
- item: w(({ legend: o, index: a }) => [
685
- D("div", {
686
- onClick: (s) => o.segregate(),
687
- style: L(`opacity:${I.value.length ? I.value.includes(a) ? 1 : 0.5 : 1}`)
688
- }, X(o.name) + " (" + X(o.count) + ") ", 13, Wt)
689
- ]),
690
- _: 1
691
- }, 8, ["legendSet", "config"])) : _("", !0),
692
- b(t.$slots, "legend", { legend: Ie.value }, void 0, !0)
693
- ], 512),
694
- t.$slots.source ? (d(), g("div", jt, [
695
- b(t.$slots, "source", {}, void 0, !0)
696
- ], 512)) : _("", !0),
697
- de(r(Xe), {
698
- show: N.value.showTooltip && le.value,
699
- backgroundColor: e.value.style.chart.tooltip.backgroundColor,
700
- color: e.value.style.chart.tooltip.color,
701
- fontSize: e.value.style.chart.tooltip.fontSize,
702
- borderRadius: e.value.style.chart.tooltip.borderRadius,
703
- borderColor: e.value.style.chart.tooltip.borderColor,
704
- borderWidth: e.value.style.chart.tooltip.borderWidth,
705
- backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
706
- position: e.value.style.chart.tooltip.position,
707
- offsetY: e.value.style.chart.tooltip.offsetY,
708
- parent: z.value,
709
- content: ae.value,
710
- isCustom: J.value,
711
- isFullscreen: M.value
712
- }, {
713
- "tooltip-before": w(() => [
714
- b(t.$slots, "tooltip-before", U(V({ ...re.value })), void 0, !0)
715
- ]),
716
- "tooltip-after": w(() => [
717
- b(t.$slots, "tooltip-after", U(V({ ...re.value })), void 0, !0)
718
- ]),
719
- _: 3
720
- }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom", "isFullscreen"]),
721
- te.value ? (d(), R(r(Ue), {
722
- key: 7,
723
- hideDetails: "",
724
- config: {
725
- open: N.value.showTable,
726
- maxHeight: 1e4,
727
- body: {
728
- backgroundColor: e.value.style.chart.backgroundColor,
729
- color: e.value.style.chart.color
730
- },
731
- head: {
732
- backgroundColor: e.value.style.chart.backgroundColor,
733
- color: e.value.style.chart.color
734
- }
735
- }
736
- }, {
737
- content: w(() => [
738
- de(r(Ve), {
739
- colNames: K.value.colNames,
740
- head: K.value.head,
741
- body: K.value.body,
742
- config: K.value.config,
743
- title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
744
- onClose: l[2] || (l[2] = (o) => N.value.showTable = !1)
745
- }, {
746
- th: w(({ th: o }) => [
747
- D("div", {
748
- innerHTML: o,
749
- style: { display: "flex", "align-items": "center" }
750
- }, null, 8, Xt)
751
- ]),
752
- td: w(({ td: o }) => [
753
- vt(X(o.name || o), 1)
754
- ]),
755
- _: 1
756
- }, 8, ["colNames", "head", "body", "config", "title"])
757
- ]),
758
- _: 1
759
- }, 8, ["config"])) : _("", !0)
760
- ], 46, It));
761
- }
762
- }, so = /* @__PURE__ */ Lt(qt, [["__scopeId", "data-v-dbf97adc"]]);
763
- export {
764
- so as default
765
- };