vue-data-ui 3.20.0 → 3.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/package.json +120 -120
  2. package/dist/A11yDataTable-BCbtxMU6.js +0 -45
  3. package/dist/Arrow-D6j6ocXm.js +0 -116
  4. package/dist/BaseDraggableDialog-4hDW-Rj2.js +0 -272
  5. package/dist/BaseIcon-DfLoHNUj.js +0 -502
  6. package/dist/BaseLegendToggle-C_Db-y7s.js +0 -56
  7. package/dist/BaseScanner-Dr2a1Msy.js +0 -27
  8. package/dist/BaseZoomControls-CG7hI_1P.js +0 -111
  9. package/dist/ColorPicker-Bjwxnvfh.js +0 -255
  10. package/dist/DataTable-B--IN22e.js +0 -150
  11. package/dist/Legend-Cz2uQ5gs.js +0 -114
  12. package/dist/NonSvgPenAndPaper-gLNJ1Lmr.js +0 -577
  13. package/dist/PackageVersion-xcyrdRmY.js +0 -11
  14. package/dist/PenAndPaper-DqrClVfb.js +0 -461
  15. package/dist/RecursiveCircles-D6aDPmoe.js +0 -117
  16. package/dist/RecursiveLabels-D9rfID6q.js +0 -56
  17. package/dist/RecursiveLinks-BygcpDiT.js +0 -78
  18. package/dist/Shape-BPCJfphn.js +0 -141
  19. package/dist/Slicer-SHBj0VaV.js +0 -1144
  20. package/dist/SlicerPreview-DdihbUSJ.js +0 -1668
  21. package/dist/SparkTooltip-CfE6yCad.js +0 -93
  22. package/dist/Title-NWp4qB4K.js +0 -87
  23. package/dist/Tooltip-BENq327o.js +0 -312
  24. package/dist/UserOptions-C1NgoGu6.js +0 -1411
  25. package/dist/_plugin-vue_export-helper-B3ysoDQm.js +0 -8
  26. package/dist/canvas-lib-BOP_HS11.js +0 -79
  27. package/dist/components/arrow.js +0 -2
  28. package/dist/components/vue-ui-3d-bar.js +0 -2
  29. package/dist/components/vue-ui-accordion.js +0 -2
  30. package/dist/components/vue-ui-age-pyramid.js +0 -2
  31. package/dist/components/vue-ui-annotator.js +0 -2
  32. package/dist/components/vue-ui-bullet.js +0 -2
  33. package/dist/components/vue-ui-bump.js +0 -2
  34. package/dist/components/vue-ui-candlestick.js +0 -2
  35. package/dist/components/vue-ui-carousel-table.js +0 -2
  36. package/dist/components/vue-ui-chestnut.js +0 -2
  37. package/dist/components/vue-ui-chord.js +0 -2
  38. package/dist/components/vue-ui-circle-pack.js +0 -2
  39. package/dist/components/vue-ui-cursor.js +0 -2
  40. package/dist/components/vue-ui-dag.js +0 -2
  41. package/dist/components/vue-ui-dashboard.js +0 -2
  42. package/dist/components/vue-ui-digits.js +0 -2
  43. package/dist/components/vue-ui-donut-evolution.js +0 -2
  44. package/dist/components/vue-ui-donut.js +0 -2
  45. package/dist/components/vue-ui-dumbbell.js +0 -2
  46. package/dist/components/vue-ui-flow.js +0 -2
  47. package/dist/components/vue-ui-funnel.js +0 -2
  48. package/dist/components/vue-ui-galaxy.js +0 -2
  49. package/dist/components/vue-ui-gauge.js +0 -2
  50. package/dist/components/vue-ui-geo.js +0 -2
  51. package/dist/components/vue-ui-gizmo.js +0 -2
  52. package/dist/components/vue-ui-heatmap.js +0 -2
  53. package/dist/components/vue-ui-history-plot.js +0 -2
  54. package/dist/components/vue-ui-horizontal-bar.js +0 -2
  55. package/dist/components/vue-ui-icon.js +0 -2
  56. package/dist/components/vue-ui-kpi.js +0 -2
  57. package/dist/components/vue-ui-mini-loader.js +0 -2
  58. package/dist/components/vue-ui-molecule.js +0 -2
  59. package/dist/components/vue-ui-mood-radar.js +0 -2
  60. package/dist/components/vue-ui-nested-donuts.js +0 -2
  61. package/dist/components/vue-ui-onion.js +0 -2
  62. package/dist/components/vue-ui-parallel-coordinate-plot.js +0 -2
  63. package/dist/components/vue-ui-pattern-seed.js +0 -2
  64. package/dist/components/vue-ui-pattern.js +0 -2
  65. package/dist/components/vue-ui-quadrant.js +0 -2
  66. package/dist/components/vue-ui-quick-chart.js +0 -2
  67. package/dist/components/vue-ui-radar.js +0 -2
  68. package/dist/components/vue-ui-rating.js +0 -2
  69. package/dist/components/vue-ui-relation-circle.js +0 -2
  70. package/dist/components/vue-ui-ridgeline.js +0 -2
  71. package/dist/components/vue-ui-rings.js +0 -2
  72. package/dist/components/vue-ui-scatter.js +0 -2
  73. package/dist/components/vue-ui-skeleton.js +0 -2
  74. package/dist/components/vue-ui-smiley.js +0 -2
  75. package/dist/components/vue-ui-spark-trend.js +0 -2
  76. package/dist/components/vue-ui-sparkbar.js +0 -2
  77. package/dist/components/vue-ui-sparkgauge.js +0 -2
  78. package/dist/components/vue-ui-sparkhistogram.js +0 -2
  79. package/dist/components/vue-ui-sparkline.js +0 -2
  80. package/dist/components/vue-ui-sparkstackbar.js +0 -2
  81. package/dist/components/vue-ui-stackbar.js +0 -2
  82. package/dist/components/vue-ui-stackline.js +0 -2
  83. package/dist/components/vue-ui-strip-plot.js +0 -2
  84. package/dist/components/vue-ui-table-heatmap.js +0 -2
  85. package/dist/components/vue-ui-table-sparkline.js +0 -2
  86. package/dist/components/vue-ui-table.js +0 -2
  87. package/dist/components/vue-ui-thermometer.js +0 -2
  88. package/dist/components/vue-ui-timer.js +0 -2
  89. package/dist/components/vue-ui-tiremarks.js +0 -2
  90. package/dist/components/vue-ui-treemap.js +0 -2
  91. package/dist/components/vue-ui-vertical-bar.js +0 -2
  92. package/dist/components/vue-ui-waffle.js +0 -2
  93. package/dist/components/vue-ui-wheel.js +0 -2
  94. package/dist/components/vue-ui-word-cloud.js +0 -2
  95. package/dist/components/vue-ui-world.js +0 -2
  96. package/dist/components/vue-ui-xy-canvas.js +0 -2
  97. package/dist/components/vue-ui-xy.js +0 -2
  98. package/dist/dom-to-png-BYtB4BF3.js +0 -237
  99. package/dist/exposedLib-CI8ji8G-.js +0 -19
  100. package/dist/geoProjections-Czak6Jn1.js +0 -145
  101. package/dist/img-1cKsci8e.js +0 -74
  102. package/dist/labelUtils-CUctkYoA.js +0 -19
  103. package/dist/lib-DUeYQsS0.js +0 -1882
  104. package/dist/llms.txt +0 -232
  105. package/dist/patternUtils-CS7hn6at.js +0 -258
  106. package/dist/pdf-D0eZ99cP.js +0 -90
  107. package/dist/rolldown-runtime-Dy4uBu1J.js +0 -11
  108. package/dist/style.css +0 -2
  109. package/dist/types/arrow.d.ts +0 -4
  110. package/dist/types/utils.d.ts +0 -551
  111. package/dist/types/vue-data-ui.d.ts +0 -17190
  112. package/dist/types/vue-ui-3d-bar.d.ts +0 -93
  113. package/dist/types/vue-ui-accordion.d.ts +0 -11
  114. package/dist/types/vue-ui-age-pyramid.d.ts +0 -108
  115. package/dist/types/vue-ui-annotator.d.ts +0 -34
  116. package/dist/types/vue-ui-bullet.d.ts +0 -85
  117. package/dist/types/vue-ui-bump.d.ts +0 -92
  118. package/dist/types/vue-ui-candlestick.d.ts +0 -106
  119. package/dist/types/vue-ui-carousel-table.d.ts +0 -59
  120. package/dist/types/vue-ui-chestnut.d.ts +0 -98
  121. package/dist/types/vue-ui-chord.d.ts +0 -110
  122. package/dist/types/vue-ui-circle-pack.d.ts +0 -126
  123. package/dist/types/vue-ui-cursor.d.ts +0 -9
  124. package/dist/types/vue-ui-dag.d.ts +0 -125
  125. package/dist/types/vue-ui-dashboard.d.ts +0 -68
  126. package/dist/types/vue-ui-digits.d.ts +0 -12
  127. package/dist/types/vue-ui-donut-evolution.d.ts +0 -96
  128. package/dist/types/vue-ui-donut.d.ts +0 -123
  129. package/dist/types/vue-ui-dumbbell.d.ts +0 -94
  130. package/dist/types/vue-ui-flow.d.ts +0 -106
  131. package/dist/types/vue-ui-funnel.d.ts +0 -79
  132. package/dist/types/vue-ui-galaxy.d.ts +0 -114
  133. package/dist/types/vue-ui-gauge.d.ts +0 -89
  134. package/dist/types/vue-ui-geo.d.ts +0 -94
  135. package/dist/types/vue-ui-gizmo.d.ts +0 -22
  136. package/dist/types/vue-ui-heatmap.d.ts +0 -101
  137. package/dist/types/vue-ui-history-plot.d.ts +0 -114
  138. package/dist/types/vue-ui-horizontal-bar.d.ts +0 -116
  139. package/dist/types/vue-ui-icon.d.ts +0 -15
  140. package/dist/types/vue-ui-kpi.d.ts +0 -25
  141. package/dist/types/vue-ui-mini-loader.d.ts +0 -15
  142. package/dist/types/vue-ui-molecule.d.ts +0 -112
  143. package/dist/types/vue-ui-mood-radar.d.ts +0 -92
  144. package/dist/types/vue-ui-nested-donuts.d.ts +0 -111
  145. package/dist/types/vue-ui-onion.d.ts +0 -106
  146. package/dist/types/vue-ui-parallel-coordinate-plot.d.ts +0 -125
  147. package/dist/types/vue-ui-pattern-seed.d.ts +0 -14
  148. package/dist/types/vue-ui-pattern.d.ts +0 -15
  149. package/dist/types/vue-ui-quadrant.d.ts +0 -125
  150. package/dist/types/vue-ui-quick-chart.d.ts +0 -108
  151. package/dist/types/vue-ui-radar.d.ts +0 -116
  152. package/dist/types/vue-ui-rating.d.ts +0 -42
  153. package/dist/types/vue-ui-relation-circle.d.ts +0 -92
  154. package/dist/types/vue-ui-ridgeline.d.ts +0 -106
  155. package/dist/types/vue-ui-rings.d.ts +0 -98
  156. package/dist/types/vue-ui-scatter.d.ts +0 -97
  157. package/dist/types/vue-ui-skeleton.d.ts +0 -11
  158. package/dist/types/vue-ui-smiley.d.ts +0 -28
  159. package/dist/types/vue-ui-spark-trend.d.ts +0 -19
  160. package/dist/types/vue-ui-sparkbar.d.ts +0 -49
  161. package/dist/types/vue-ui-sparkgauge.d.ts +0 -28
  162. package/dist/types/vue-ui-sparkhistogram.d.ts +0 -46
  163. package/dist/types/vue-ui-sparkline.d.ts +0 -59
  164. package/dist/types/vue-ui-sparkstackbar.d.ts +0 -60
  165. package/dist/types/vue-ui-stackbar.d.ts +0 -118
  166. package/dist/types/vue-ui-stackline.d.ts +0 -114
  167. package/dist/types/vue-ui-strip-plot.d.ts +0 -96
  168. package/dist/types/vue-ui-table-heatmap.d.ts +0 -62
  169. package/dist/types/vue-ui-table-sparkline.d.ts +0 -53
  170. package/dist/types/vue-ui-table.d.ts +0 -38
  171. package/dist/types/vue-ui-thermometer.d.ts +0 -70
  172. package/dist/types/vue-ui-timer.d.ts +0 -49
  173. package/dist/types/vue-ui-tiremarks.d.ts +0 -70
  174. package/dist/types/vue-ui-treemap.d.ts +0 -104
  175. package/dist/types/vue-ui-vertical-bar.d.ts +0 -22
  176. package/dist/types/vue-ui-waffle.d.ts +0 -101
  177. package/dist/types/vue-ui-wheel.d.ts +0 -70
  178. package/dist/types/vue-ui-word-cloud.d.ts +0 -97
  179. package/dist/types/vue-ui-world.d.ts +0 -98
  180. package/dist/types/vue-ui-xy-canvas.d.ts +0 -101
  181. package/dist/types/vue-ui-xy.d.ts +0 -146
  182. package/dist/useAutoSizeLabelsInsideViewbox-BIVntRZp.js +0 -50
  183. package/dist/useChartAccessibility-DYqac8yF.js +0 -12
  184. package/dist/useConfig-DAyQk86L.js +0 -7479
  185. package/dist/useFitSvgText-CT3nmlaS.js +0 -63
  186. package/dist/useNestedProp-CNcoy38D.js +0 -10
  187. package/dist/useObjectBindings-BI7hP-BC.js +0 -189
  188. package/dist/usePanZoom-CYU3B4T3.js +0 -157
  189. package/dist/usePrefersMotion-BC-CsqR1.js +0 -15
  190. package/dist/usePrinter-C1Gqt_Sp.js +0 -49
  191. package/dist/useResponsive-BfnK0KxU.js +0 -19
  192. package/dist/useStableElementSize-C7KADDKj.js +0 -77
  193. package/dist/useSvgExport-SVIsDot8.js +0 -755
  194. package/dist/useTableResponsive-B24Uwt2E.js +0 -24
  195. package/dist/useThemeCheck-C43Tcqmk.js +0 -24
  196. package/dist/useTimeLabelCollider-AEcY4Ioe.js +0 -57
  197. package/dist/useTimeLabels-BmBRv27Y.js +0 -272
  198. package/dist/useUserOptionState-DK-_1ddE.js +0 -15
  199. package/dist/utils.js +0 -28
  200. package/dist/vClickOutside-DUrZWttG.js +0 -13
  201. package/dist/vue-data-ui-qpQv-4uP.js +0 -274
  202. package/dist/vue-data-ui.js +0 -76
  203. package/dist/vue-ui-3d-bar-C8cputoI.js +0 -1757
  204. package/dist/vue-ui-accordion-Dw4MHKVB.js +0 -81
  205. package/dist/vue-ui-age-pyramid-Cv2Ndbb5.js +0 -1238
  206. package/dist/vue-ui-annotator-DLPUAKlm.js +0 -2899
  207. package/dist/vue-ui-bullet-DLxmtMJ9.js +0 -710
  208. package/dist/vue-ui-bump-DVaqtZbd.js +0 -1249
  209. package/dist/vue-ui-candlestick-CkApimw1.js +0 -1826
  210. package/dist/vue-ui-carousel-table-CbfIBWl3.js +0 -455
  211. package/dist/vue-ui-chestnut-CQT4nCFL.js +0 -2010
  212. package/dist/vue-ui-chord-8IjSrg6f.js +0 -1391
  213. package/dist/vue-ui-circle-pack-B1CpTtpw.js +0 -1608
  214. package/dist/vue-ui-cursor-NaTj5i2-.js +0 -283
  215. package/dist/vue-ui-dag-DH4ocx0S.js +0 -2909
  216. package/dist/vue-ui-dashboard-Ckff1yim.js +0 -513
  217. package/dist/vue-ui-digits-DwLlJqbW.js +0 -209
  218. package/dist/vue-ui-donut-DQdIdwRU.js +0 -2410
  219. package/dist/vue-ui-donut-evolution-MfM5kK6w.js +0 -1510
  220. package/dist/vue-ui-dumbbell-B2T4vlK-.js +0 -1530
  221. package/dist/vue-ui-flow-CJh6f72m.js +0 -1235
  222. package/dist/vue-ui-funnel-C9gfXNCr.js +0 -777
  223. package/dist/vue-ui-galaxy-pBR_FESJ.js +0 -1077
  224. package/dist/vue-ui-gauge-CAemxCGl.js +0 -920
  225. package/dist/vue-ui-geo-BDQqaukJ.js +0 -1516
  226. package/dist/vue-ui-gizmo-B1ppjqPj.js +0 -225
  227. package/dist/vue-ui-heatmap-BiC9xp8L.js +0 -1568
  228. package/dist/vue-ui-history-plot-iAPjlOja.js +0 -1554
  229. package/dist/vue-ui-horizontal-bar-CcgClgLg.js +0 -1681
  230. package/dist/vue-ui-kpi-CJ5oyYLS.js +0 -96
  231. package/dist/vue-ui-mini-loader-CyqBt2g4.js +0 -125
  232. package/dist/vue-ui-molecule-Cg9ZHa6b.js +0 -925
  233. package/dist/vue-ui-mood-radar-N8osOTFR.js +0 -1148
  234. package/dist/vue-ui-nested-donuts-CwH3wKgX.js +0 -1487
  235. package/dist/vue-ui-onion-C56gFjO6.js +0 -1200
  236. package/dist/vue-ui-parallel-coordinate-plot-C-jj819p.js +0 -1416
  237. package/dist/vue-ui-pattern-DKozfnVn.js +0 -154
  238. package/dist/vue-ui-pattern-seed-BB1honLm.js +0 -61
  239. package/dist/vue-ui-quadrant-DYc9xZY3.js +0 -1978
  240. package/dist/vue-ui-quick-chart-BG7kK_-q.js +0 -2469
  241. package/dist/vue-ui-radar-CgKog9Xw.js +0 -1229
  242. package/dist/vue-ui-rating-BG4lf1z8.js +0 -343
  243. package/dist/vue-ui-relation-circle-D-rUk-0P.js +0 -924
  244. package/dist/vue-ui-ridgeline-DPrlVJTW.js +0 -1622
  245. package/dist/vue-ui-rings-CIvvHHsF.js +0 -1246
  246. package/dist/vue-ui-scatter-CeBQJbGx.js +0 -2413
  247. package/dist/vue-ui-skeleton-BKoa_G6d.js +0 -2556
  248. package/dist/vue-ui-smiley-G89TxRU-.js +0 -356
  249. package/dist/vue-ui-spark-trend-DGOrPr9I.js +0 -438
  250. package/dist/vue-ui-sparkbar-BVumo-YD.js +0 -393
  251. package/dist/vue-ui-sparkgauge-BoCwdQcu.js +0 -255
  252. package/dist/vue-ui-sparkhistogram-4qXY1LXW.js +0 -560
  253. package/dist/vue-ui-sparkline-C0kzXrwI.js +0 -1507
  254. package/dist/vue-ui-sparkstackbar-DG7hz_KM.js +0 -662
  255. package/dist/vue-ui-stackbar-Dnq4l5xs.js +0 -2270
  256. package/dist/vue-ui-stackline-CaNOHQYl.js +0 -2398
  257. package/dist/vue-ui-strip-plot-D2CcJw_5.js +0 -1340
  258. package/dist/vue-ui-table-NBQrkVnO.js +0 -1338
  259. package/dist/vue-ui-table-heatmap-CCGjbSzQ.js +0 -344
  260. package/dist/vue-ui-table-sparkline-BZDkOEEl.js +0 -707
  261. package/dist/vue-ui-thermometer-BXyHOQ7T.js +0 -763
  262. package/dist/vue-ui-timer-CcLK1wbi.js +0 -439
  263. package/dist/vue-ui-tiremarks-B6txvBg-.js +0 -552
  264. package/dist/vue-ui-treemap-O3SBpD3K.js +0 -1587
  265. package/dist/vue-ui-waffle-DN5zG3b0.js +0 -1362
  266. package/dist/vue-ui-wheel-CxnJGXkX.js +0 -885
  267. package/dist/vue-ui-word-cloud-CM5yPCXb.js +0 -1656
  268. package/dist/vue-ui-world-DCPgXKxh.js +0 -14264
  269. package/dist/vue-ui-xy-canvas-BUPnRZ3C.js +0 -1787
  270. package/dist/vue-ui-xy-lfMIx0wK.js +0 -4578
  271. package/dist/vue_ui_3d_bar-C4R7o-yX.js +0 -185
  272. package/dist/vue_ui_age_pyramid-BY6c-oX_.js +0 -301
  273. package/dist/vue_ui_bullet-ClzdLoOv.js +0 -186
  274. package/dist/vue_ui_bump-Vl-zYAtG.js +0 -201
  275. package/dist/vue_ui_candlestick-J8jmJvxP.js +0 -374
  276. package/dist/vue_ui_chestnut-D2oUhad6.js +0 -305
  277. package/dist/vue_ui_chord-DPfS1Umc.js +0 -275
  278. package/dist/vue_ui_circle_pack-DZC_rdfn.js +0 -172
  279. package/dist/vue_ui_dag-TsJ_azQq.js +0 -258
  280. package/dist/vue_ui_donut-BDGqG07h.js +0 -358
  281. package/dist/vue_ui_donut_evolution-D1yAAIHr.js +0 -717
  282. package/dist/vue_ui_dumbbell-Bfe_jFyi.js +0 -304
  283. package/dist/vue_ui_flow-BewZjjKG.js +0 -238
  284. package/dist/vue_ui_funnel-_Og4EEkO.js +0 -234
  285. package/dist/vue_ui_galaxy-Ig0cc1_h.js +0 -265
  286. package/dist/vue_ui_gauge-Cf1RZc9q.js +0 -178
  287. package/dist/vue_ui_geo-B8TODs-G.js +0 -248
  288. package/dist/vue_ui_heatmap-B2BBBSWG.js +0 -319
  289. package/dist/vue_ui_history_plot-CuN63VEc.js +0 -413
  290. package/dist/vue_ui_horizontal_bar-C4J4QzXf.js +0 -341
  291. package/dist/vue_ui_molecule-CO9L59SF.js +0 -231
  292. package/dist/vue_ui_mood_radar-BA6LAKhk.js +0 -281
  293. package/dist/vue_ui_nested_donuts-B8csIoVO.js +0 -273
  294. package/dist/vue_ui_onion-1FTFFS46.js +0 -293
  295. package/dist/vue_ui_parallel_coordinate_plot-CBiOBira.js +0 -278
  296. package/dist/vue_ui_quadrant-CDSTKTJz.js +0 -428
  297. package/dist/vue_ui_quick_chart-mZBdml3Z.js +0 -139
  298. package/dist/vue_ui_radar-jafTED5j.js +0 -306
  299. package/dist/vue_ui_relation_circle-D0p4mXmv.js +0 -98
  300. package/dist/vue_ui_ridgeline-VM8_mx4J.js +0 -767
  301. package/dist/vue_ui_rings-BVgD2aMn.js +0 -320
  302. package/dist/vue_ui_scatter-I0POnicu.js +0 -479
  303. package/dist/vue_ui_spark_trend-DxVmpkmC.js +0 -82
  304. package/dist/vue_ui_sparkbar-z6qO--Kf.js +0 -64
  305. package/dist/vue_ui_sparkgauge-BX1MS3bA.js +0 -90
  306. package/dist/vue_ui_sparkhistogram-BRgvKUH6.js +0 -123
  307. package/dist/vue_ui_sparkline-auZhap6Y.js +0 -151
  308. package/dist/vue_ui_sparkstackbar-BOjuQnZd.js +0 -175
  309. package/dist/vue_ui_stackbar-COOrQQdK.js +0 -412
  310. package/dist/vue_ui_stackline-DQqKPA9z.js +0 -460
  311. package/dist/vue_ui_strip_plot-CtJe8_gq.js +0 -301
  312. package/dist/vue_ui_table_heatmap-w8vx5k6f.js +0 -80
  313. package/dist/vue_ui_table_sparkline-DAbkUrNz.js +0 -124
  314. package/dist/vue_ui_thermometer-DxgqWKlE.js +0 -123
  315. package/dist/vue_ui_tiremarks-CdEPieWV.js +0 -122
  316. package/dist/vue_ui_treemap-DoEtkRN6.js +0 -328
  317. package/dist/vue_ui_vertical_bar-CP-MKz1j.js +0 -247
  318. package/dist/vue_ui_waffle-DIARFc7g.js +0 -292
  319. package/dist/vue_ui_wheel-DZ_nR--t.js +0 -133
  320. package/dist/vue_ui_word_cloud-C-qIMNLu.js +0 -254
  321. package/dist/vue_ui_xy-BLUkWEAm.js +0 -482
  322. package/dist/vue_ui_xy_canvas-Cb6dg3eK.js +0 -408
@@ -1,2909 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { Bt as t, Ct as n, H as r, V as i, X as a, lt as o, t as s, y as c } from "./lib-DUeYQsS0.js";
3
- import { t as l } from "./useConfig-DAyQk86L.js";
4
- import { t as u } from "./usePrinter-C1Gqt_Sp.js";
5
- import { n as d, t as f } from "./BaseScanner-Dr2a1Msy.js";
6
- import { t as p } from "./useSvgExport-SVIsDot8.js";
7
- import { t as m } from "./useNestedProp-CNcoy38D.js";
8
- import { t as h } from "./useThemeCheck-C43Tcqmk.js";
9
- import { t as g } from "./img-1cKsci8e.js";
10
- import { n as ee } from "./Title-NWp4qB4K.js";
11
- import { t as te } from "./_plugin-vue_export-helper-B3ysoDQm.js";
12
- import { c as ne } from "./canvas-lib-BOP_HS11.js";
13
- import { t as re } from "./useResponsive-BfnK0KxU.js";
14
- import { t as ie } from "./A11yDataTable-BCbtxMU6.js";
15
- import { t as ae } from "./useUserOptionState-DK-_1ddE.js";
16
- import { t as oe } from "./useChartAccessibility-DYqac8yF.js";
17
- import { t as se } from "./usePanZoom-CYU3B4T3.js";
18
- import { t as ce } from "./BaseZoomControls-CG7hI_1P.js";
19
- import { t as le } from "./vue_ui_dag-TsJ_azQq.js";
20
- import { Fragment as ue, Teleport as de, Transition as fe, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createSlots as pe, createTextVNode as me, createVNode as he, defineAsyncComponent as ge, guardReactiveProps as S, mergeProps as _e, nextTick as ve, normalizeClass as ye, normalizeProps as C, normalizeStyle as be, onBeforeUnmount as xe, onMounted as Se, openBlock as w, ref as T, renderList as Ce, renderSlot as E, toDisplayString as we, toRefs as Te, unref as D, watch as Ee, watchEffect as De, withCtx as O, withModifiers as Oe } from "vue";
21
- //#region src/DAG/graph.js
22
- var ke = "\0", Ae = "\0", je = "", k = class {
23
- _isDirected = !0;
24
- _isMultigraph = !1;
25
- _isCompound = !1;
26
- _label;
27
- _defaultNodeLabelFn = () => void 0;
28
- _defaultEdgeLabelFn = () => void 0;
29
- _nodes = {};
30
- _in = {};
31
- _preds = {};
32
- _out = {};
33
- _sucs = {};
34
- _edgeObjs = {};
35
- _edgeLabels = {};
36
- _nodeCount = 0;
37
- _edgeCount = 0;
38
- _parent;
39
- _children;
40
- constructor(e) {
41
- e && (this._isDirected = Object.hasOwn(e, "directed") ? e.directed : !0, this._isMultigraph = Object.hasOwn(e, "multigraph") ? e.multigraph : !1, this._isCompound = Object.hasOwn(e, "compound") ? e.compound : !1), this._isCompound && (this._parent = {}, this._children = {}, this._children[Ae] = {});
42
- }
43
- isDirected() {
44
- return this._isDirected;
45
- }
46
- isMultigraph() {
47
- return this._isMultigraph;
48
- }
49
- isCompound() {
50
- return this._isCompound;
51
- }
52
- setGraph(e) {
53
- return this._label = e, this;
54
- }
55
- graph() {
56
- return this._label;
57
- }
58
- setDefaultNodeLabel(e) {
59
- return this._defaultNodeLabelFn = e, typeof e != "function" && (this._defaultNodeLabelFn = () => e), this;
60
- }
61
- nodeCount() {
62
- return this._nodeCount;
63
- }
64
- nodes() {
65
- return Object.keys(this._nodes);
66
- }
67
- sources() {
68
- let e = this;
69
- return this.nodes().filter((t) => Object.keys(e._in[t]).length === 0);
70
- }
71
- sinks() {
72
- let e = this;
73
- return this.nodes().filter((t) => Object.keys(e._out[t]).length === 0);
74
- }
75
- setNodes(e, t) {
76
- let n = arguments, r = this;
77
- return e.forEach((e) => {
78
- n.length > 1 ? r.setNode(e, t) : r.setNode(e);
79
- }), this;
80
- }
81
- setNode(e, t) {
82
- return Object.hasOwn(this._nodes, e) ? (arguments.length > 1 && (this._nodes[e] = t), this) : (this._nodes[e] = arguments.length > 1 ? t : this._defaultNodeLabelFn(e), this._isCompound && (this._parent[e] = Ae, this._children[e] = {}, this._children[Ae][e] = !0), this._in[e] = {}, this._preds[e] = {}, this._out[e] = {}, this._sucs[e] = {}, ++this._nodeCount, this);
83
- }
84
- node(e) {
85
- return this._nodes[e];
86
- }
87
- hasNode(e) {
88
- return Object.hasOwn(this._nodes, e);
89
- }
90
- removeNode(e) {
91
- let t = this;
92
- if (Object.hasOwn(this._nodes, e)) {
93
- let n = (e) => t.removeEdge(t._edgeObjs[e]);
94
- delete this._nodes[e], this._isCompound && (this._removeFromParentsChildList(e), delete this._parent[e], this.children(e).forEach((e) => {
95
- t.setParent(e);
96
- }), delete this._children[e]), Object.keys(this._in[e]).forEach(n), delete this._in[e], delete this._preds[e], Object.keys(this._out[e]).forEach(n), delete this._out[e], delete this._sucs[e], --this._nodeCount;
97
- }
98
- return this;
99
- }
100
- setParent(e, t) {
101
- if (!this._isCompound) throw Error("Cannot set parent in a non-compound graph");
102
- if (t === void 0) t = Ae;
103
- else {
104
- t += "";
105
- for (let n = t; n !== void 0; n = this.parent(n)) if (n === e) throw Error("Setting " + t + " as parent of " + e + " would create a cycle");
106
- this.setNode(t);
107
- }
108
- return this.setNode(e), this._removeFromParentsChildList(e), this._parent[e] = t, this._children[t][e] = !0, this;
109
- }
110
- _removeFromParentsChildList(e) {
111
- delete this._children[this._parent[e]][e];
112
- }
113
- parent(e) {
114
- if (this._isCompound) {
115
- let t = this._parent[e];
116
- if (t !== Ae) return t;
117
- }
118
- }
119
- children(e = Ae) {
120
- if (this._isCompound) {
121
- let t = this._children[e];
122
- if (t) return Object.keys(t);
123
- } else if (e === Ae) return this.nodes();
124
- else if (this.hasNode(e)) return [];
125
- }
126
- predecessors(e) {
127
- let t = this._preds[e];
128
- if (t) return Object.keys(t);
129
- }
130
- successors(e) {
131
- let t = this._sucs[e];
132
- if (t) return Object.keys(t);
133
- }
134
- neighbors(e) {
135
- let t = this.predecessors(e);
136
- if (t) {
137
- let n = new Set(t);
138
- for (let t of this.successors(e)) n.add(t);
139
- return Array.from(n.values());
140
- }
141
- }
142
- isLeaf(e) {
143
- let t;
144
- return t = this.isDirected() ? this.successors(e) : this.neighbors(e), t.length === 0;
145
- }
146
- filterNodes(e) {
147
- let t = new this.constructor({
148
- directed: this._isDirected,
149
- multigraph: this._isMultigraph,
150
- compound: this._isCompound
151
- });
152
- t.setGraph(this.graph());
153
- let n = this;
154
- Object.entries(this._nodes).forEach(([n, r]) => {
155
- e(n) && t.setNode(n, r);
156
- }), Object.values(this._edgeObjs).forEach((e) => {
157
- t.hasNode(e.v) && t.hasNode(e.w) && t.setEdge(e, n.edge(e));
158
- });
159
- let r = {};
160
- function i(e) {
161
- let a = n.parent(e);
162
- return a === void 0 || t.hasNode(a) ? (r[e] = a, a) : a in r ? r[a] : i(a);
163
- }
164
- return this._isCompound && t.nodes().forEach((e) => t.setParent(e, i(e))), t;
165
- }
166
- setDefaultEdgeLabel(e) {
167
- return this._defaultEdgeLabelFn = e, typeof e != "function" && (this._defaultEdgeLabelFn = () => e), this;
168
- }
169
- edgeCount() {
170
- return this._edgeCount;
171
- }
172
- edges() {
173
- return Object.values(this._edgeObjs);
174
- }
175
- setPath(e, t) {
176
- let n = this, r = arguments;
177
- return e.reduce((e, i) => (r.length > 1 ? n.setEdge(e, i, t) : n.setEdge(e, i), i)), this;
178
- }
179
- setEdge() {
180
- let e, t, n, r, i = !1, a = arguments[0];
181
- typeof a == "object" && a && "v" in a ? (e = a.v, t = a.w, n = a.name, arguments.length === 2 && (r = arguments[1], i = !0)) : (e = a, t = arguments[1], n = arguments[3], arguments.length > 2 && (r = arguments[2], i = !0)), e = "" + e, t = "" + t, n !== void 0 && (n = "" + n);
182
- let o = j(this._isDirected, e, t, n);
183
- if (Object.hasOwn(this._edgeLabels, o)) return i && (this._edgeLabels[o] = r), this;
184
- if (n !== void 0 && !this._isMultigraph) throw Error("Cannot set a named edge when isMultigraph = false");
185
- this.setNode(e), this.setNode(t), this._edgeLabels[o] = i ? r : this._defaultEdgeLabelFn(e, t, n);
186
- let s = M(this._isDirected, e, t, n);
187
- return e = s.v, t = s.w, Object.freeze(s), this._edgeObjs[o] = s, Me(this._preds[t], e), Me(this._sucs[e], t), this._in[t][o] = s, this._out[e][o] = s, this._edgeCount++, this;
188
- }
189
- edge(e, t, n) {
190
- let r = arguments.length === 1 ? N(this._isDirected, arguments[0]) : j(this._isDirected, e, t, n);
191
- return this._edgeLabels[r];
192
- }
193
- edgeAsObj() {
194
- let e = this.edge(...arguments);
195
- return typeof e == "object" ? e : { label: e };
196
- }
197
- hasEdge(e, t, n) {
198
- let r = arguments.length === 1 ? N(this._isDirected, arguments[0]) : j(this._isDirected, e, t, n);
199
- return Object.hasOwn(this._edgeLabels, r);
200
- }
201
- removeEdge(e, t, n) {
202
- let r = arguments.length === 1 ? N(this._isDirected, arguments[0]) : j(this._isDirected, e, t, n), i = this._edgeObjs[r];
203
- return i && (e = i.v, t = i.w, delete this._edgeLabels[r], delete this._edgeObjs[r], A(this._preds[t], e), A(this._sucs[e], t), delete this._in[t][r], delete this._out[e][r], this._edgeCount--), this;
204
- }
205
- inEdges(e, t) {
206
- let n = this._in[e];
207
- if (n) {
208
- let e = Object.values(n);
209
- return t ? e.filter((e) => e.v === t) : e;
210
- }
211
- }
212
- outEdges(e, t) {
213
- let n = this._out[e];
214
- if (n) {
215
- let e = Object.values(n);
216
- return t ? e.filter((e) => e.w === t) : e;
217
- }
218
- }
219
- nodeEdges(e, t) {
220
- let n = this.inEdges(e, t);
221
- if (n) return n.concat(this.outEdges(e, t));
222
- }
223
- };
224
- function Me(e, t) {
225
- e[t] ? e[t]++ : e[t] = 1;
226
- }
227
- function A(e, t) {
228
- --e[t] || delete e[t];
229
- }
230
- function j(e, t, n, r) {
231
- let i = "" + t, a = "" + n;
232
- if (!e && i > a) {
233
- let e = i;
234
- i = a, a = e;
235
- }
236
- return i + je + a + je + (r === void 0 ? ke : r);
237
- }
238
- function M(e, t, n, r) {
239
- let i = "" + t, a = "" + n;
240
- if (!e && i > a) {
241
- let e = i;
242
- i = a, a = e;
243
- }
244
- let o = {
245
- v: i,
246
- w: a
247
- };
248
- return r && (o.name = r), o;
249
- }
250
- function N(e, t) {
251
- return j(e, t.v, t.w, t.name);
252
- }
253
- //#endregion
254
- //#region src/DAG/data/list.js
255
- var Ne = class {
256
- constructor() {
257
- let e = {};
258
- e._next = e._prev = e, this._sentinel = e;
259
- }
260
- dequeue() {
261
- let e = this._sentinel, t = e._prev;
262
- if (t !== e) return Pe(t), t;
263
- }
264
- enqueue(e) {
265
- let t = this._sentinel;
266
- e._prev && e._next && Pe(e), e._next = t._next, t._next._prev = e, t._next = e, e._prev = t;
267
- }
268
- toString() {
269
- let e = [], t = this._sentinel, n = t._prev;
270
- for (; n !== t;) e.push(JSON.stringify(n, Fe)), n = n._prev;
271
- return "[" + e.join(", ") + "]";
272
- }
273
- };
274
- function Pe(e) {
275
- e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
276
- }
277
- function Fe(e, t) {
278
- if (e !== "_next" && e !== "_prev") return t;
279
- }
280
- //#endregion
281
- //#region src/DAG/greedy-fas.js
282
- var Ie = () => 1;
283
- function Le(e, t) {
284
- if (e.nodeCount() <= 1) return [];
285
- let n = Be(e, t || Ie);
286
- return Re(n.graph, n.buckets, n.zeroIndex).flatMap((t) => e.outEdges(t.v, t.w));
287
- }
288
- function Re(e, t, n) {
289
- let r = [], i = t[t.length - 1], a = t[0], o;
290
- for (; e.nodeCount();) {
291
- for (; o = a.dequeue();) ze(e, t, n, o);
292
- for (; o = i.dequeue();) ze(e, t, n, o);
293
- if (e.nodeCount()) {
294
- for (let i = t.length - 2; i > 0; --i) if (o = t[i].dequeue(), o) {
295
- r = r.concat(ze(e, t, n, o, !0));
296
- break;
297
- }
298
- }
299
- }
300
- return r;
301
- }
302
- function ze(e, t, n, r, i) {
303
- let a = i ? [] : void 0;
304
- return e.inEdges(r.v).forEach((r) => {
305
- let o = e.edge(r), s = e.node(r.v);
306
- i && a.push({
307
- v: r.v,
308
- w: r.w
309
- }), s.out -= o, Ve(t, n, s);
310
- }), e.outEdges(r.v).forEach((r) => {
311
- let i = e.edge(r), a = e.node(r.w);
312
- a.in -= i, Ve(t, n, a);
313
- }), e.removeNode(r.v), a;
314
- }
315
- function Be(e, t) {
316
- let n = new k(), r = 0, i = 0;
317
- e.nodes().forEach((e) => {
318
- n.setNode(e, {
319
- v: e,
320
- in: 0,
321
- out: 0
322
- });
323
- }), e.edges().forEach((e) => {
324
- let a = n.edge(e.v, e.w) || 0, o = t(e), s = a + o;
325
- n.setEdge(e.v, e.w, s), i = Math.max(i, n.node(e.v).out += o), r = Math.max(r, n.node(e.w).in += o);
326
- });
327
- let a = P(i + r + 3).map(() => new Ne()), o = r + 1;
328
- return n.nodes().forEach((e) => {
329
- Ve(a, o, n.node(e));
330
- }), {
331
- graph: n,
332
- buckets: a,
333
- zeroIndex: o
334
- };
335
- }
336
- function Ve(e, t, n) {
337
- n.out ? n.in ? e[n.out - n.in + t].enqueue(n) : e[e.length - 1].enqueue(n) : e[0].enqueue(n);
338
- }
339
- function P(e) {
340
- let t = [];
341
- for (let n = 0; n < e; n++) t.push(n);
342
- return t;
343
- }
344
- //#endregion
345
- //#region src/DAG/util.js
346
- function F(e, t, n, r) {
347
- let i = r;
348
- for (; e.hasNode(i);) i = H(r);
349
- return n.dummy = t, e.setNode(i, n), i;
350
- }
351
- function I(e) {
352
- let t = new k().setGraph(e.graph());
353
- return e.nodes().forEach((n) => {
354
- t.setNode(n, e.node(n));
355
- }), e.edges().forEach((n) => {
356
- let r = t.edge(n.v, n.w) || {
357
- weight: 0,
358
- minlen: 1
359
- }, i = e.edge(n);
360
- t.setEdge(n.v, n.w, {
361
- weight: r.weight + i.weight,
362
- minlen: Math.max(r.minlen, i.minlen)
363
- });
364
- }), t;
365
- }
366
- function L(e) {
367
- let t = new k({ multigraph: e.isMultigraph() }).setGraph(e.graph());
368
- return e.nodes().forEach((n) => {
369
- e.children(n).length || t.setNode(n, e.node(n));
370
- }), e.edges().forEach((n) => {
371
- t.setEdge(n, e.edge(n));
372
- }), t;
373
- }
374
- function He(e) {
375
- let t = e.nodes().map((t) => {
376
- let n = {};
377
- return e.outEdges(t).forEach((t) => {
378
- n[t.w] = (n[t.w] || 0) + e.edge(t).weight;
379
- }), n;
380
- });
381
- return W(e.nodes(), t);
382
- }
383
- function Ue(e) {
384
- let t = e.nodes().map((t) => {
385
- let n = {};
386
- return e.inEdges(t).forEach((t) => {
387
- n[t.v] = (n[t.v] || 0) + e.edge(t).weight;
388
- }), n;
389
- });
390
- return W(e.nodes(), t);
391
- }
392
- function We(e, t) {
393
- let n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2;
394
- if (!i && !a) throw Error("Not possible to find intersection inside of the rectangle");
395
- let c, l;
396
- return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = o * a / i), {
397
- x: n + c,
398
- y: r + l
399
- };
400
- }
401
- function R(e) {
402
- let t = U(Ye(e) + 1).map(() => []);
403
- return e.nodes().forEach((n) => {
404
- let r = e.node(n), i = r.rank;
405
- i !== void 0 && (t[i][r.order] = n);
406
- }), t;
407
- }
408
- function Ge(e) {
409
- let t = e.nodes().map((t) => {
410
- let n = e.node(t).rank;
411
- return n === void 0 ? Number.MAX_VALUE : n;
412
- }), n = B(Math.min, t);
413
- e.nodes().forEach((t) => {
414
- let r = e.node(t);
415
- Object.hasOwn(r, "rank") && (r.rank -= n);
416
- });
417
- }
418
- function Ke(e) {
419
- let t = e.nodes().map((t) => e.node(t).rank).filter((e) => e !== void 0), n = B(Math.min, t), r = [];
420
- e.nodes().forEach((t) => {
421
- let i = e.node(t).rank - n;
422
- r[i] || (r[i] = []), r[i].push(t);
423
- });
424
- let i = 0, a = e.graph().nodeRankFactor;
425
- Array.from(r).forEach((t, n) => {
426
- t === void 0 && n % a !== 0 ? --i : t !== void 0 && i && t.forEach((t) => {
427
- e.node(t).rank += i;
428
- });
429
- });
430
- }
431
- function qe(e, t, n, r) {
432
- let i = {
433
- width: 0,
434
- height: 0
435
- };
436
- return arguments.length >= 4 && (i.rank = n, i.order = r), F(e, "border", i, t);
437
- }
438
- var Je = 65535;
439
- function z(e, t = Je) {
440
- let n = [];
441
- for (let r = 0; r < e.length; r += t) {
442
- let i = e.slice(r, r + t);
443
- n.push(i);
444
- }
445
- return n;
446
- }
447
- function B(e, t) {
448
- if (t.length > Je) {
449
- let n = z(t);
450
- return e.apply(null, n.map((t) => e.apply(null, t)));
451
- } else return e.apply(null, t);
452
- }
453
- function Ye(e) {
454
- let t = e.nodes().map((t) => {
455
- let n = e.node(t).rank;
456
- return n === void 0 ? Number.MIN_VALUE : n;
457
- });
458
- return B(Math.max, t);
459
- }
460
- function Xe(e, t) {
461
- let n = {
462
- lhs: [],
463
- rhs: []
464
- };
465
- return e.forEach((e) => {
466
- t(e) ? n.lhs.push(e) : n.rhs.push(e);
467
- }), n;
468
- }
469
- function V(e, t) {
470
- let n = Date.now();
471
- try {
472
- return t();
473
- } finally {
474
- console.log(e + " time: " + (Date.now() - n) + "ms");
475
- }
476
- }
477
- function Ze(e, t) {
478
- return t();
479
- }
480
- var Qe = 0;
481
- function H(e) {
482
- let t = ++Qe;
483
- return e + String(t);
484
- }
485
- function U(e, t, n = 1) {
486
- t ?? (t = e, e = 0);
487
- let r = (e) => e < t;
488
- n < 0 && (r = (e) => t < e);
489
- let i = [];
490
- for (let t = e; r(t); t += n) i.push(t);
491
- return i;
492
- }
493
- function $e(e, t) {
494
- let n = {};
495
- for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
496
- return n;
497
- }
498
- function et(e, t) {
499
- let n = t;
500
- if (typeof t == "string") {
501
- let e = t;
502
- n = (t) => t[e];
503
- }
504
- return Object.entries(e).reduce((e, [t, r]) => (e[t] = n(r, t), e), {});
505
- }
506
- function W(e, t) {
507
- return e.reduce((e, n, r) => (e[n] = t[r], e), {});
508
- }
509
- var G = {
510
- addBorderNode: qe,
511
- addDummyNode: F,
512
- applyWithChunking: B,
513
- asNonCompoundGraph: L,
514
- buildLayerMatrix: R,
515
- intersectRect: We,
516
- mapValues: et,
517
- maxRank: Ye,
518
- normalizeRanks: Ge,
519
- notime: Ze,
520
- partition: Xe,
521
- pick: $e,
522
- predecessorWeights: Ue,
523
- range: U,
524
- removeEmptyRanks: Ke,
525
- simplify: I,
526
- successorWeights: He,
527
- time: V,
528
- uniqueId: H,
529
- zipObject: W
530
- };
531
- //#endregion
532
- //#region src/DAG/acyclic.js
533
- function K(e) {
534
- (e.graph().acyclicer === "greedy" ? Le(e, t(e)) : nt(e)).forEach((t) => {
535
- let n = e.edge(t);
536
- e.removeEdge(t), n.forwardName = t.name, n.reversed = !0, e.setEdge(t.w, t.v, n, H("rev"));
537
- });
538
- function t(e) {
539
- return (t) => e.edge(t).weight;
540
- }
541
- }
542
- function tt(e) {
543
- e.edges().forEach((t) => {
544
- let n = e.edge(t);
545
- if (n.reversed) {
546
- e.removeEdge(t);
547
- let r = n.forwardName;
548
- delete n.reversed, delete n.forwardName, e.setEdge(t.w, t.v, n, r);
549
- }
550
- });
551
- }
552
- function nt(e) {
553
- let t = [], n = {}, r = {};
554
- function i(a) {
555
- Object.hasOwn(r, a) || (r[a] = !0, n[a] = !0, e.outEdges(a).forEach((e) => {
556
- Object.hasOwn(n, e.w) ? t.push(e) : i(e.w);
557
- }), delete n[a]);
558
- }
559
- return e.nodes().forEach(i), t;
560
- }
561
- //#endregion
562
- //#region src/DAG/normalize.js
563
- function rt(e) {
564
- e.graph().dummyChains = [], e.edges().forEach((t) => q(e, t));
565
- }
566
- function q(e, t) {
567
- let n = t.v, r = e.node(n).rank, i = t.w, a = e.node(i).rank, o = t.name, s = e.edge(t), c = s.labelRank;
568
- if (a === r + 1) return;
569
- e.removeEdge(t);
570
- let l, u, d;
571
- for (d = 0, ++r; r < a; ++d, ++r) s.points = [], u = {
572
- width: 0,
573
- height: 0,
574
- edgeLabel: s,
575
- edgeObj: t,
576
- rank: r
577
- }, l = F(e, "edge", u, "_d"), r === c && (u.width = s.width, u.height = s.height, u.dummy = "edge-label", u.labelpos = s.labelpos), e.setEdge(n, l, { weight: s.weight }, o), d === 0 && e.graph().dummyChains.push(l), n = l;
578
- e.setEdge(n, i, { weight: s.weight }, o);
579
- }
580
- function it(e) {
581
- e.graph().dummyChains.forEach((t) => {
582
- let n = e.node(t), r = n.edgeLabel;
583
- e.setEdge(n.edgeObj, r);
584
- let i;
585
- for (; n.dummy;) i = e.successors(t)[0], e.removeNode(t), r.points.push({
586
- x: n.x,
587
- y: n.y
588
- }), n.dummy === "edge-label" && (r.x = n.x, r.y = n.y, r.width = n.width, r.height = n.height), t = i, n = e.node(t);
589
- });
590
- }
591
- //#endregion
592
- //#region src/DAG/rank/util.js
593
- function at(e) {
594
- function t(n) {
595
- let r = e.node(n);
596
- if (r && Object.prototype.hasOwnProperty.call(r, "rank")) return r.rank;
597
- let i = e.outEdges(n) || [];
598
- if (!i.length) return r && (r.rank = 0), 0;
599
- let a = i.map((n) => e.node(n.w) ? t(n.w) - e.edge(n).minlen : Infinity), o = B(Math.min, a);
600
- return o === Infinity && (o = 0), r && (r.rank = o), o;
601
- }
602
- (e.sources() || []).forEach(t);
603
- }
604
- function ot(e, t) {
605
- return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
606
- }
607
- //#endregion
608
- //#region src/DAG/rank/feasible-tree.js
609
- function st(e) {
610
- ct(e);
611
- let t = new k();
612
- e.nodes().forEach((e) => {
613
- t.setNode(e, {});
614
- });
615
- let n = e.nodes();
616
- if (!n.length) return t;
617
- let r = n[0], i = new Set([r]);
618
- for (; i.size < n.length;) {
619
- let r = lt(e, i);
620
- if (!r) {
621
- let e = n.find((e) => !i.has(e));
622
- i.add(e), t.setNode(e, {});
623
- continue;
624
- }
625
- let { edgeObject: a, delta: o, attachFrom: s, attachTo: c } = r;
626
- ut(e, i, s, o), t.setEdge(a.v, a.w, {}), i.add(c);
627
- }
628
- return t;
629
- }
630
- function ct(e) {
631
- e.nodes().forEach((t) => {
632
- let n = e.node(t) || {};
633
- Object.prototype.hasOwnProperty.call(n, "rank") || (n.rank = 0, e.setNode(t, n));
634
- });
635
- }
636
- function lt(e, t) {
637
- let n = null;
638
- return e.edges().forEach((r) => {
639
- let i = t.has(r.v);
640
- if (i === t.has(r.w)) return;
641
- let a = ot(e, r), o = Math.abs(a);
642
- if (!n || o < n.absoluteSlack) {
643
- let e = i ? r.v : r.w, t = i ? r.w : r.v;
644
- n = {
645
- edgeObject: r,
646
- delta: i ? a : -a,
647
- attachFrom: e,
648
- attachTo: t,
649
- absoluteSlack: o
650
- };
651
- }
652
- }), n;
653
- }
654
- function ut(e, t, n, r) {
655
- r && e.nodes().forEach((n) => {
656
- if (!t.has(n)) {
657
- let t = e.node(n);
658
- t.rank += r;
659
- }
660
- });
661
- }
662
- //#endregion
663
- //#region src/DAG/rank/network-simplex.js
664
- function J(e) {
665
- let t = I(e);
666
- return at(t), t.nodes().forEach((n) => {
667
- let r = t.node(n), i = e.node(n) || {};
668
- i.rank = r.rank, e.setNode(n, i);
669
- }), e;
670
- }
671
- function dt(e, t) {}
672
- function ft(e, t) {}
673
- function pt(e, t, n) {
674
- return 0;
675
- }
676
- function mt(e) {
677
- return null;
678
- }
679
- function ht(e, t) {
680
- return null;
681
- }
682
- J.initLowLimValues = dt, J.initCutValues = ft, J.calcCutValue = pt, J.leaveEdge = mt, J.enterEdge = ht;
683
- //#endregion
684
- //#region src/DAG/rank/index.js
685
- var gt = at;
686
- function _t(e) {
687
- let t = e.graph().ranker;
688
- if (t instanceof Function) return t(e);
689
- switch (e.graph().ranker) {
690
- case "network-simplex":
691
- Y(e);
692
- break;
693
- case "tight-tree":
694
- yt(e);
695
- break;
696
- case "longest-path":
697
- vt(e);
698
- break;
699
- case "none": break;
700
- default: Y(e);
701
- }
702
- }
703
- var vt = gt;
704
- function yt(e) {
705
- gt(e), st(e);
706
- }
707
- function Y(e) {
708
- J(e);
709
- }
710
- //#endregion
711
- //#region src/DAG/parent-dummy-chains.js
712
- function bt(e) {
713
- let t = X(e);
714
- e.graph().dummyChains.forEach((n) => {
715
- let r = e.node(n), i = r.edgeObj, a = xt(e, t, i.v, i.w), o = a.path, s = a.lca, c = 0, l = o[c], u = !0, d = n;
716
- for (; d !== i.w;) {
717
- if (r = e.node(d), u) {
718
- for (; (l = o[c]) !== s && e.node(l).maxRank < r.rank;) c++;
719
- l === s && (u = !1);
720
- }
721
- if (!u) {
722
- for (; c < o.length - 1 && e.node(l = o[c + 1]).minRank <= r.rank;) c++;
723
- l = o[c];
724
- }
725
- e.setParent(d, l), d = e.successors(d)[0];
726
- }
727
- });
728
- }
729
- function xt(e, t, n, r) {
730
- let i = [], a = [], o = Math.min(t[n].low, t[r].low), s = Math.max(t[n].lim, t[r].lim), c, l;
731
- c = n;
732
- do
733
- c = e.parent(c), i.push(c);
734
- while (c && (t[c].low > o || s > t[c].lim));
735
- for (l = c, c = r; (c = e.parent(c)) !== l;) a.push(c);
736
- return {
737
- path: i.concat(a.reverse()),
738
- lca: l
739
- };
740
- }
741
- function X(e) {
742
- let t = {}, n = 0;
743
- function r(i) {
744
- let a = n;
745
- e.children(i).forEach(r), t[i] = {
746
- low: a,
747
- lim: n++
748
- };
749
- }
750
- return e.children().forEach(r), t;
751
- }
752
- //#endregion
753
- //#region src/DAG/nested-graph.js
754
- function St(e) {
755
- let t = G.addDummyNode(e, "root", {}, "_root"), n = wt(e), r = Object.values(n), i = G.applyWithChunking(Math.max, r) - 1, a = 2 * i + 1;
756
- e.graph().nestingRoot = t, e.edges().forEach((t) => {
757
- e.edge(t).minlen *= a;
758
- });
759
- let o = Tt(e) + 1;
760
- e.children().forEach((r) => {
761
- Ct(e, t, a, o, i, n, r);
762
- }), e.graph().nodeRankFactor = a;
763
- }
764
- function Ct(e, t, n, r, i, a, o) {
765
- let s = e.children(o);
766
- if (!s.length) {
767
- o !== t && e.setEdge(t, o, {
768
- weight: 0,
769
- minlen: n
770
- });
771
- return;
772
- }
773
- let c = G.addBorderNode(e, "_bt"), l = G.addBorderNode(e, "_bb"), u = e.node(o);
774
- e.setParent(c, o), u.borderTop = c, e.setParent(l, o), u.borderBottom = l, s.forEach((s) => {
775
- Ct(e, t, n, r, i, a, s);
776
- let u = e.node(s), d = u.borderTop ? u.borderTop : s, f = u.borderBottom ? u.borderBottom : s, p = u.borderTop ? r : 2 * r, m = d === f ? i - a[o] + 1 : 1;
777
- e.setEdge(c, d, {
778
- weight: p,
779
- minlen: m,
780
- nestingEdge: !0
781
- }), e.setEdge(f, l, {
782
- weight: p,
783
- minlen: m,
784
- nestingEdge: !0
785
- });
786
- }), e.parent(o) || e.setEdge(t, c, {
787
- weight: 0,
788
- minlen: i + a[o]
789
- });
790
- }
791
- function wt(e) {
792
- let t = {};
793
- function n(r, i) {
794
- let a = e.children(r);
795
- a && a.length && a.forEach((e) => n(e, i + 1)), t[r] = i;
796
- }
797
- return e.children().forEach((e) => n(e, 1)), t;
798
- }
799
- function Tt(e) {
800
- return e.edges().reduce((t, n) => t + e.edge(n).weight, 0);
801
- }
802
- function Et(e) {
803
- let t = e.graph();
804
- e.removeNode(t.nestingRoot), delete t.nestingRoot, e.edges().forEach((t) => {
805
- e.edge(t).nestingEdge && e.removeEdge(t);
806
- });
807
- }
808
- //#endregion
809
- //#region src/DAG/add-border-segments.js
810
- function Dt(e) {
811
- function t(n) {
812
- let r = e.children(n), i = e.node(n);
813
- if (r.length && r.forEach(t), Object.hasOwn(i, "minRank")) {
814
- i.borderLeft = [], i.borderRight = [];
815
- for (let t = i.minRank, r = i.maxRank + 1; t < r; ++t) Ot(e, "borderLeft", "_bl", n, i, t), Ot(e, "borderRight", "_br", n, i, t);
816
- }
817
- }
818
- e.children().forEach(t);
819
- }
820
- function Ot(e, t, n, r, i, a) {
821
- let o = {
822
- width: 0,
823
- height: 0,
824
- rank: a,
825
- borderType: t
826
- }, s = i[t][a - 1], c = F(e, "border", o, n);
827
- i[t][a] = c, e.setParent(c, r), s && e.setEdge(s, c, { weight: 1 });
828
- }
829
- //#endregion
830
- //#region src/DAG/coordinate-system.js
831
- function kt(e) {
832
- let t = e.graph().rankdir.toLowerCase();
833
- (t === "lr" || t === "rl") && jt(e);
834
- }
835
- function At(e) {
836
- let t = e.graph().rankdir.toLowerCase();
837
- (t === "bt" || t === "rl") && Mt(e), (t === "lr" || t === "rl") && (Pt(e), jt(e));
838
- }
839
- function jt(e) {
840
- e.nodes().forEach((t) => {
841
- Z(e.node(t));
842
- }), e.edges().forEach((t) => {
843
- Z(e.edge(t));
844
- });
845
- }
846
- function Z(e) {
847
- let t = e.width;
848
- e.width = e.height, e.height = t;
849
- }
850
- function Mt(e) {
851
- e.nodes().forEach((t) => {
852
- Nt(e.node(t));
853
- }), e.edges().forEach((t) => {
854
- let n = e.edge(t);
855
- n.points.forEach(Nt), Object.hasOwn(n, "y") && Nt(n);
856
- });
857
- }
858
- function Nt(e) {
859
- e.y = -e.y;
860
- }
861
- function Pt(e) {
862
- e.nodes().forEach((t) => {
863
- Ft(e.node(t));
864
- }), e.edges().forEach((t) => {
865
- let n = e.edge(t);
866
- n.points.forEach(Ft), Object.hasOwn(n, "x") && Ft(n);
867
- });
868
- }
869
- function Ft(e) {
870
- let t = e.x;
871
- e.x = e.y, e.y = t;
872
- }
873
- var It = {
874
- adjust: kt,
875
- undo: At
876
- };
877
- //#endregion
878
- //#region src/DAG/order/init-order.js
879
- function Lt(e) {
880
- let t = {}, n = e.nodes().filter((t) => e.children(t).length === 0), r = n.map((t) => e.node(t).rank), i = U(B(Math.max, r) + 1).map(() => []);
881
- function a(n) {
882
- t[n] || (t[n] = !0, i[e.node(n).rank].push(n), e.successors(n).forEach(a));
883
- }
884
- return n.sort((t, n) => e.node(t).rank - e.node(n).rank).forEach(a), i;
885
- }
886
- //#endregion
887
- //#region src/DAG/order/cross-count.js
888
- function Rt(e, t) {
889
- let n = 0;
890
- for (let r = 1; r < t.length; ++r) n += zt(e, t[r - 1], t[r]);
891
- return n;
892
- }
893
- function zt(e, t, n) {
894
- let r = W(n, n.map((e, t) => t)), i = t.flatMap((t) => e.outEdges(t).map((t) => ({
895
- pos: r[t.w],
896
- weight: e.edge(t).weight
897
- })).sort((e, t) => e.pos - t.pos)), a = 1;
898
- for (; a < n.length;) a <<= 1;
899
- let o = 2 * a - 1;
900
- --a;
901
- let s = Array(o).fill(0), c = 0;
902
- return i.forEach((e) => {
903
- let t = e.pos + a;
904
- s[t] += e.weight;
905
- let n = 0;
906
- for (; t > 0;) t % 2 && (n += s[t + 1]), t = t - 1 >> 1, s[t] += e.weight;
907
- c += e.weight * n;
908
- }), c;
909
- }
910
- //#endregion
911
- //#region src/DAG/order/barycenter.js
912
- function Q(e, t = []) {
913
- return t.map((t) => {
914
- let n = e.inEdges(t);
915
- if (!n.length) return { v: t };
916
- let r = n.reduce((t, n) => {
917
- let r = e.edge(n), i = e.node(n.v);
918
- return {
919
- sum: t.sum + r.weight * i.order,
920
- weight: t.weight + r.weight
921
- };
922
- }, {
923
- sum: 0,
924
- weight: 0
925
- });
926
- return {
927
- v: t,
928
- barycenter: r.sum / r.weight,
929
- weight: r.weight
930
- };
931
- });
932
- }
933
- //#endregion
934
- //#region src/DAG/order/resolve-conflicts.js
935
- function Bt(e, t) {
936
- let n = {};
937
- return e.forEach((e, t) => {
938
- let r = n[e.v] = {
939
- indegree: 0,
940
- in: [],
941
- out: [],
942
- vs: [e.v],
943
- i: t
944
- };
945
- e.barycenter !== void 0 && (r.barycenter = e.barycenter, r.weight = e.weight);
946
- }), t.edges().forEach((e) => {
947
- let t = n[e.v], r = n[e.w];
948
- t !== void 0 && r !== void 0 && (r.indegree++, t.out.push(r));
949
- }), Vt(Object.values(n).filter((e) => !e.indegree));
950
- }
951
- function Vt(e) {
952
- let t = [];
953
- function n(e) {
954
- return (t) => {
955
- t.merged || (t.barycenter === void 0 || e.barycenter === void 0 || t.barycenter >= e.barycenter) && Ht(e, t);
956
- };
957
- }
958
- function r(t) {
959
- return (n) => {
960
- n.in.push(t), --n.indegree === 0 && e.push(n);
961
- };
962
- }
963
- for (; e.length;) {
964
- let i = e.pop();
965
- t.push(i), i.in.reverse().forEach(n(i)), i.out.forEach(r(i));
966
- }
967
- return t.filter((e) => !e.merged).map((e) => $e(e, [
968
- "vs",
969
- "i",
970
- "barycenter",
971
- "weight"
972
- ]));
973
- }
974
- function Ht(e, t) {
975
- let n = 0, r = 0;
976
- e.weight && (n += e.barycenter * e.weight, r += e.weight), t.weight && (n += t.barycenter * t.weight, r += t.weight), e.vs = t.vs.concat(e.vs), e.barycenter = n / r, e.weight = r, e.i = Math.min(t.i, e.i), t.merged = !0;
977
- }
978
- //#endregion
979
- //#region src/DAG/order/sort.js
980
- function Ut(e, t) {
981
- let n = Xe(e, (e) => Object.hasOwn(e, "barycenter")), r = n.lhs, i = n.rhs.sort((e, t) => t.i - e.i), a = [], o = 0, s = 0, c = 0;
982
- r.sort(Gt(!!t)), c = Wt(a, i, c), r.forEach((e) => {
983
- c += e.vs.length, a.push(e.vs), o += e.barycenter * e.weight, s += e.weight, c = Wt(a, i, c);
984
- });
985
- let l = { vs: a.flat(!0) };
986
- return s && (l.barycenter = o / s, l.weight = s), l;
987
- }
988
- function Wt(e, t, n) {
989
- let r;
990
- for (; t.length && (r = t[t.length - 1]).i <= n;) t.pop(), e.push(r.vs), n++;
991
- return n;
992
- }
993
- function Gt(e) {
994
- return (t, n) => t.barycenter < n.barycenter ? -1 : t.barycenter > n.barycenter ? 1 : e ? n.i - t.i : t.i - n.i;
995
- }
996
- //#endregion
997
- //#region src/DAG/order/sort-subgraph.js
998
- function Kt(e, t, n, r) {
999
- let i = e.children(t), a = e.node(t), o = a ? a.borderLeft : void 0, s = a ? a.borderRight : void 0, c = {};
1000
- o && (i = i.filter((e) => e !== o && e !== s));
1001
- let l = Q(e, i);
1002
- l.forEach((t) => {
1003
- if (e.children(t.v).length) {
1004
- let i = Kt(e, t.v, n, r);
1005
- c[t.v] = i, Object.hasOwn(i, "barycenter") && Jt(t, i);
1006
- }
1007
- });
1008
- let u = Bt(l, n);
1009
- qt(u, c);
1010
- let d = Ut(u, r);
1011
- if (o && (d.vs = [
1012
- o,
1013
- d.vs,
1014
- s
1015
- ].flat(!0), e.predecessors(o).length)) {
1016
- let t = e.node(e.predecessors(o)[0]), n = e.node(e.predecessors(s)[0]);
1017
- Object.hasOwn(d, "barycenter") || (d.barycenter = 0, d.weight = 0), d.barycenter = (d.barycenter * d.weight + t.order + n.order) / (d.weight + 2), d.weight += 2;
1018
- }
1019
- return d;
1020
- }
1021
- function qt(e, t) {
1022
- e.forEach((e) => {
1023
- e.vs = e.vs.flatMap((e) => t[e] ? t[e].vs : e);
1024
- });
1025
- }
1026
- function Jt(e, t) {
1027
- e.barycenter === void 0 ? (e.barycenter = t.barycenter, e.weight = t.weight) : (e.barycenter = (e.barycenter * e.weight + t.barycenter * t.weight) / (e.weight + t.weight), e.weight += t.weight);
1028
- }
1029
- //#endregion
1030
- //#region src/DAG/order/build-layer-graph.js
1031
- function Yt(e, t, n, r) {
1032
- r ||= e.nodes();
1033
- let i = Xt(e), a = new k({ compound: !0 }).setGraph({ root: i }).setDefaultNodeLabel((t) => e.node(t));
1034
- return r.forEach((r) => {
1035
- let o = e.node(r), s = e.parent(r);
1036
- (o.rank === t || o.minRank <= t && t <= o.maxRank) && (a.setNode(r), a.setParent(r, s || i), e[n](r).forEach((t) => {
1037
- let n = t.v === r ? t.w : t.v, i = a.edge(n, r), o = i ? i.weight : 0;
1038
- a.setEdge(n, r, { weight: e.edge(t).weight + o });
1039
- }), Object.hasOwn(o, "minRank") && a.setNode(r, {
1040
- borderLeft: o.borderLeft[t],
1041
- borderRight: o.borderRight[t]
1042
- }));
1043
- }), a;
1044
- }
1045
- function Xt(e) {
1046
- let t;
1047
- for (; e.hasNode(t = H("_root")););
1048
- return t;
1049
- }
1050
- //#endregion
1051
- //#region src/DAG/order/add-subgraph-constraints.js
1052
- function Zt(e, t, n) {
1053
- let r = {}, i;
1054
- n.forEach((n) => {
1055
- let a = e.parent(n), o, s;
1056
- for (; a;) {
1057
- if (o = e.parent(a), o ? (s = r[o], r[o] = a) : (s = i, i = a), s && s !== a) {
1058
- t.setEdge(s, a);
1059
- return;
1060
- }
1061
- a = o;
1062
- }
1063
- });
1064
- }
1065
- //#endregion
1066
- //#region src/DAG/order/index.js
1067
- function Qt(e, t = {}) {
1068
- if (typeof t.customOrder == "function") {
1069
- t.customOrder(e, Qt);
1070
- return;
1071
- }
1072
- let n = Ye(e), r = $t(e, U(1, n + 1), "inEdges"), i = $t(e, U(n - 1, -1, -1), "outEdges"), a = Lt(e);
1073
- if (tn(e, a), t.disableOptimalOrderHeuristic) return;
1074
- let o = Infinity, s, c = t.constraints || [];
1075
- for (let t = 0, n = 0; n < 4; ++t, ++n) {
1076
- en(t % 2 == 0 ? r : i, t % 4 >= 2, c), a = R(e);
1077
- let l = Rt(e, a);
1078
- l < o ? (o = l, n = 0, s = structuredClone(a)) : l === o && (s = structuredClone(a));
1079
- }
1080
- tn(e, s);
1081
- }
1082
- function $t(e, t, n) {
1083
- let r = /* @__PURE__ */ new Map();
1084
- function i(e, t) {
1085
- r.has(e) || r.set(e, []), r.get(e).push(t);
1086
- }
1087
- for (let t of e.nodes()) {
1088
- let n = e.node(t);
1089
- if (typeof n.rank == "number" && i(n.rank, t), typeof n.minRank == "number" && typeof n.maxRank == "number") for (let e = n.minRank; e <= n.maxRank; e++) e !== n.rank && i(e, t);
1090
- }
1091
- return t.map((t) => Yt(e, t, n, r.get(t) || []));
1092
- }
1093
- function en(e, t, n) {
1094
- let r = new k();
1095
- e.forEach((e) => {
1096
- n.forEach((e) => r.setEdge(e.left, e.right));
1097
- let i = e.graph().root, a = Kt(e, i, r, t);
1098
- a.vs.forEach((t, n) => {
1099
- e.node(t).order = n;
1100
- }), Zt(e, r, a.vs);
1101
- });
1102
- }
1103
- function tn(e, t) {
1104
- Object.values(t).forEach((t) => {
1105
- t.forEach((t, n) => {
1106
- e.node(t).order = n;
1107
- });
1108
- });
1109
- }
1110
- //#endregion
1111
- //#region src/DAG/position/bk.js
1112
- function $(e, t) {
1113
- let n = {};
1114
- function r(t, r) {
1115
- let i = 0, a = 0, o = t.length, s = r[r.length - 1];
1116
- return r.forEach((t, c) => {
1117
- let l = rn(e, t), u = l ? e.node(l).order : o;
1118
- (l || t === s) && (r.slice(a, c + 1).forEach((t) => {
1119
- e.predecessors(t).forEach((r) => {
1120
- let a = e.node(r), o = a.order;
1121
- (o < i || u < o) && !(a.dummy && e.node(t).dummy) && an(n, r, t);
1122
- });
1123
- }), a = c + 1, i = u);
1124
- }), r;
1125
- }
1126
- return t.length && t.reduce(r), n;
1127
- }
1128
- function nn(e, t) {
1129
- let n = {};
1130
- function r(t, r, i, a, o) {
1131
- let s;
1132
- U(r, i).forEach((r) => {
1133
- s = t[r], e.node(s).dummy && e.predecessors(s).forEach((t) => {
1134
- let r = e.node(t);
1135
- r.dummy && (r.order < a || r.order > o) && an(n, t, s);
1136
- });
1137
- });
1138
- }
1139
- function i(t, n) {
1140
- let i = -1, a, o = 0;
1141
- return n.forEach((s, c) => {
1142
- if (e.node(s).dummy === "border") {
1143
- let t = e.predecessors(s);
1144
- t.length && (a = e.node(t[0]).order, r(n, o, c, i, a), o = c, i = a);
1145
- }
1146
- r(n, o, n.length, a, t.length);
1147
- }), n;
1148
- }
1149
- return t.length && t.reduce(i), n;
1150
- }
1151
- function rn(e, t) {
1152
- if (e.node(t).dummy) return e.predecessors(t).find((t) => e.node(t).dummy);
1153
- }
1154
- function an(e, t, n) {
1155
- if (t > n) {
1156
- let e = t;
1157
- t = n, n = e;
1158
- }
1159
- let r = e[t];
1160
- r || (e[t] = r = {}), r[n] = !0;
1161
- }
1162
- function on(e, t, n) {
1163
- if (t > n) {
1164
- let e = t;
1165
- t = n, n = e;
1166
- }
1167
- return !!e[t] && Object.hasOwn(e[t], n);
1168
- }
1169
- function sn(e, t, n, r) {
1170
- let i = {}, a = {}, o = {};
1171
- return t.forEach((e) => {
1172
- e.forEach((e, t) => {
1173
- i[e] = e, a[e] = e, o[e] = t;
1174
- });
1175
- }), t.forEach((e) => {
1176
- let t = -1;
1177
- e.forEach((e) => {
1178
- let s = r(e);
1179
- if (s.length) {
1180
- s = s.sort((e, t) => o[e] - o[t]);
1181
- let r = (s.length - 1) / 2;
1182
- for (let c = Math.floor(r), l = Math.ceil(r); c <= l; ++c) {
1183
- let r = s[c];
1184
- a[e] === e && t < o[r] && !on(n, e, r) && (a[r] = e, a[e] = i[e] = i[r], t = o[r]);
1185
- }
1186
- }
1187
- });
1188
- }), {
1189
- root: i,
1190
- align: a
1191
- };
1192
- }
1193
- function cn(e, t, n, r, i) {
1194
- let a = {}, o = ln(e, t, n, i), s = i ? "borderLeft" : "borderRight";
1195
- function c(e, t) {
1196
- let n = o.nodes().slice(), r = {}, i = n.pop();
1197
- for (; i;) {
1198
- if (r[i]) e(i);
1199
- else {
1200
- r[i] = !0, n.push(i);
1201
- for (let e of t(i)) n.push(e);
1202
- }
1203
- i = n.pop();
1204
- }
1205
- }
1206
- function l(e) {
1207
- a[e] = o.inEdges(e).reduce((e, t) => Math.max(e, a[t.v] + o.edge(t)), 0);
1208
- }
1209
- function u(t) {
1210
- let n = o.outEdges(t).reduce((e, t) => Math.min(e, a[t.w] - o.edge(t)), Infinity), r = e.node(t);
1211
- n !== Infinity && r.borderType !== s && (a[t] = Math.max(a[t], n));
1212
- }
1213
- return c(l, o.predecessors.bind(o)), c(u, o.successors.bind(o)), Object.keys(r).forEach((e) => {
1214
- a[e] = a[n[e]];
1215
- }), a;
1216
- }
1217
- function ln(e, t, n, r) {
1218
- let i = new e.constructor(), a = e.graph(), o = mn(a.nodesep, a.edgesep, r);
1219
- return t.forEach((t) => {
1220
- let r;
1221
- t.forEach((t) => {
1222
- let a = n[t];
1223
- if (i.setNode(a), r) {
1224
- let s = n[r], c = i.edge(s, a);
1225
- i.setEdge(s, a, Math.max(o(e, t, r), c || 0));
1226
- }
1227
- r = t;
1228
- });
1229
- }), i;
1230
- }
1231
- function un(e, t) {
1232
- return Object.values(t).reduce((t, n) => {
1233
- let r = -Infinity, i = Infinity;
1234
- Object.entries(n).forEach(([t, n]) => {
1235
- let a = hn(e, t) / 2;
1236
- r = Math.max(n + a, r), i = Math.min(n - a, i);
1237
- });
1238
- let a = r - i;
1239
- return a < t[0] && (t = [a, n]), t;
1240
- }, [Infinity, null])[1];
1241
- }
1242
- function dn(e, t) {
1243
- let n = Object.values(t), r = B(Math.min, n), i = B(Math.max, n);
1244
- ["u", "d"].forEach((n) => {
1245
- ["l", "r"].forEach((a) => {
1246
- let o = n + a, s = e[o];
1247
- if (s === t) return;
1248
- let c = Object.values(s), l = r - B(Math.min, c);
1249
- a !== "l" && (l = i - B(Math.max, c)), l && (s = et(s, (e) => e + l), e[o] = s);
1250
- });
1251
- });
1252
- }
1253
- function fn(e, t) {
1254
- return et(e.ul, (n, r) => {
1255
- if (t) return e[t.toLowerCase()][r];
1256
- let i = Object.values(e).map((e) => e[r]).sort((e, t) => e - t);
1257
- return (i[1] + i[2]) / 2;
1258
- });
1259
- }
1260
- function pn(e) {
1261
- let t = R(e), n = Object.assign($(e, t), nn(e, t)), r = {}, i;
1262
- return ["u", "d"].forEach((a) => {
1263
- i = a === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((t) => {
1264
- let o = i;
1265
- t === "r" && (o = o.map((e) => Object.values(e).reverse()));
1266
- let s = (a === "u" ? e.predecessors : e.successors).bind(e), c = sn(e, o, n, s), l = cn(e, o, c.root, c.align, t === "r");
1267
- t === "r" && (l = et(l, (e) => -e)), r[a + t] = l;
1268
- });
1269
- }), dn(r, un(e, r)), fn(r, e.graph().align);
1270
- }
1271
- function mn(e, t, n) {
1272
- return (r, i, a) => {
1273
- let o = r.node(i), s = r.node(a), c = 0, l;
1274
- if (c += o.width / 2, Object.hasOwn(o, "labelpos")) switch (o.labelpos.toLowerCase()) {
1275
- case "l":
1276
- l = -o.width / 2;
1277
- break;
1278
- case "r":
1279
- l = o.width / 2;
1280
- break;
1281
- }
1282
- if (l && (c += n ? l : -l), l = 0, c += (o.dummy ? t : e) / 2, c += (s.dummy ? t : e) / 2, c += s.width / 2, Object.hasOwn(s, "labelpos")) switch (s.labelpos.toLowerCase()) {
1283
- case "l":
1284
- l = s.width / 2;
1285
- break;
1286
- case "r":
1287
- l = -s.width / 2;
1288
- break;
1289
- }
1290
- return l && (c += n ? l : -l), l = 0, c;
1291
- };
1292
- }
1293
- function hn(e, t) {
1294
- return e.node(t).width;
1295
- }
1296
- //#endregion
1297
- //#region src/DAG/position/index.js
1298
- function gn(e) {
1299
- let t = L(e);
1300
- _n(t);
1301
- let n = pn(t);
1302
- Object.entries(n).forEach(([t, n]) => {
1303
- e.node(t).x = n;
1304
- });
1305
- }
1306
- function _n(e) {
1307
- let t = R(e), n = e.graph().ranksep, r = 0;
1308
- t.forEach((t) => {
1309
- let i = t.reduce((t, n) => {
1310
- let r = e.node(n).height;
1311
- return t > r ? t : r;
1312
- }, 0);
1313
- t.forEach((t) => {
1314
- e.node(t).y = r + i / 2;
1315
- }), r += i + n;
1316
- });
1317
- }
1318
- //#endregion
1319
- //#region src/DAG/layout.js
1320
- function vn(e, t = {}) {
1321
- let n = t.debugTiming ? V : Ze;
1322
- return n("layout", () => {
1323
- let r = n(" buildLayoutGraph", () => kn(e));
1324
- return n(" runLayout", () => yn(r, n, t)), n(" updateInputGraph", () => bn(e, r)), r;
1325
- });
1326
- }
1327
- function yn(e, t, n) {
1328
- t(" makeSpaceForEdgeLabels", () => An(e)), t(" removeSelfEdges", () => Bn(e)), t(" acyclic", () => K(e)), t(" nestingGraph.run", () => St(e)), t(" rank", () => _t(L(e))), t(" injectEdgeLabelProxies", () => jn(e)), t(" removeEmptyRanks", () => Ke(e)), t(" nestingGraph.cleanup", () => Et(e)), t(" normalizeRanks", () => Ge(e)), t(" assignRankMinMax", () => Mn(e)), t(" removeEdgeLabelProxies", () => Nn(e)), t(" normalize.run", () => rt(e)), t(" parentDummyChains", () => bt(e)), t(" addBorderSegments", () => Dt(e)), t(" order", () => Qt(e, n)), t(" insertSelfEdges", () => Vn(e)), t(" adjustCoordinateSystem", () => It.adjust(e)), t(" position", () => gn(e)), t(" positionSelfEdges", () => Hn(e)), t(" removeBorderNodes", () => zn(e)), t(" normalize.undo", () => it(e)), t(" fixupEdgeLabelCoords", () => Ln(e)), t(" undoCoordinateSystem", () => It.undo(e)), t(" translateGraph", () => Pn(e)), t(" assignNodeIntersects", () => In(e)), t(" reversePoints", () => Rn(e)), t(" acyclic.undo", () => tt(e));
1329
- }
1330
- function bn(e, t) {
1331
- e.nodes().forEach((n) => {
1332
- let r = e.node(n), i = t.node(n);
1333
- r && (r.x = i.x, r.y = i.y, r.order = i.order, r.rank = i.rank, t.children(n).length && (r.width = i.width, r.height = i.height));
1334
- }), e.edges().forEach((n) => {
1335
- let r = e.edge(n), i = t.edge(n);
1336
- r.points = i.points, Object.hasOwn(i, "x") && (r.x = i.x, r.y = i.y);
1337
- });
1338
- let n = t.graph(), r = e.graph();
1339
- r.width = n.width, r.height = n.height;
1340
- }
1341
- var xn = [
1342
- "nodesep",
1343
- "edgesep",
1344
- "ranksep",
1345
- "marginx",
1346
- "marginy"
1347
- ], Sn = {
1348
- ranksep: 50,
1349
- edgesep: 20,
1350
- nodesep: 50,
1351
- rankdir: "tb"
1352
- }, Cn = [
1353
- "acyclicer",
1354
- "ranker",
1355
- "rankdir",
1356
- "align"
1357
- ], wn = [
1358
- "width",
1359
- "height",
1360
- "rank"
1361
- ], Tn = {
1362
- width: 0,
1363
- height: 0
1364
- }, En = [
1365
- "minlen",
1366
- "weight",
1367
- "width",
1368
- "height",
1369
- "labeloffset"
1370
- ], Dn = {
1371
- minlen: 1,
1372
- weight: 1,
1373
- width: 0,
1374
- height: 0,
1375
- labeloffset: 10,
1376
- labelpos: "r"
1377
- }, On = ["labelpos", "arrowshape"];
1378
- function kn(e) {
1379
- let t = Wn(e.graph()), n = {
1380
- ...Sn,
1381
- ...Un(t, xn),
1382
- ...$e(t, Cn)
1383
- }, r = new k({
1384
- multigraph: !0,
1385
- compound: !0
1386
- });
1387
- return r.setGraph(n), e.nodes().forEach((t) => {
1388
- let n = Un(Wn(e.node(t)), wn);
1389
- Object.keys(Tn).forEach((e) => {
1390
- n[e] === void 0 && (n[e] = Tn[e]);
1391
- }), r.setNode(t, n), r.setParent(t, e.parent(t));
1392
- }), e.edges().forEach((t) => {
1393
- let n = Wn(e.edge(t));
1394
- r.setEdge(t, {
1395
- ...Dn,
1396
- ...Un(n, En),
1397
- ...$e(n, On)
1398
- });
1399
- }), r;
1400
- }
1401
- function An(e) {
1402
- let t = e.graph();
1403
- t.ranksep /= 2, e.edges().forEach((n) => {
1404
- let r = e.edge(n);
1405
- r.minlen *= 2, r.labelpos.toLowerCase() !== "c" && (t.rankdir === "TB" || t.rankdir === "BT" ? r.width += r.labeloffset : r.height += r.labeloffset);
1406
- });
1407
- }
1408
- function jn(e) {
1409
- e.edges().forEach((t) => {
1410
- let n = e.edge(t);
1411
- if (n.width && n.height) {
1412
- let n = e.node(t.v);
1413
- F(e, "edge-proxy", {
1414
- rank: (e.node(t.w).rank - n.rank) / 2 + n.rank,
1415
- e: t
1416
- }, "_ep");
1417
- }
1418
- });
1419
- }
1420
- function Mn(e) {
1421
- let t = 0;
1422
- e.nodes().forEach((n) => {
1423
- let r = e.node(n);
1424
- r.borderTop && (r.minRank = e.node(r.borderTop).rank, r.maxRank = e.node(r.borderBottom).rank, t = Math.max(t, r.maxRank));
1425
- }), e.graph().maxRank = t;
1426
- }
1427
- function Nn(e) {
1428
- e.nodes().forEach((t) => {
1429
- let n = e.node(t);
1430
- n.dummy === "edge-proxy" && (e.edge(n.e).labelRank = n.rank, e.removeNode(t));
1431
- });
1432
- }
1433
- function Pn(e) {
1434
- let t = Infinity, n = 0, r = Infinity, i = 0, a = e.graph(), o = a.marginx || 0, s = a.marginy || 0;
1435
- function c(e) {
1436
- let a = e.x, o = e.y, s = e.width, c = e.height;
1437
- t = Math.min(t, a - s / 2), n = Math.max(n, a + s / 2), r = Math.min(r, o - c / 2), i = Math.max(i, o + c / 2);
1438
- }
1439
- e.nodes().forEach((t) => c(e.node(t))), e.edges().forEach((t) => {
1440
- let n = e.edge(t);
1441
- Object.hasOwn(n, "x") && c(n);
1442
- }), t -= o, r -= s, e.nodes().forEach((n) => {
1443
- let i = e.node(n);
1444
- i.x -= t, i.y -= r;
1445
- }), e.edges().forEach((n) => {
1446
- let i = e.edge(n);
1447
- i.points.forEach((e) => {
1448
- e.x -= t, e.y -= r;
1449
- }), Object.hasOwn(i, "x") && (i.x -= t), Object.hasOwn(i, "y") && (i.y -= r);
1450
- }), a.width = n - t + o, a.height = i - r + s;
1451
- }
1452
- function Fn(e, t, n) {
1453
- if (!n || !t) return e;
1454
- let r = t.x - e.x, i = t.y - e.y, a = Math.sqrt(r * r + i * i);
1455
- if (!a || a <= n) return e;
1456
- let o = n / a;
1457
- return {
1458
- x: e.x + r * o,
1459
- y: e.y + i * o
1460
- };
1461
- }
1462
- function In(e) {
1463
- e.edges().forEach((t) => {
1464
- let n = e.edge(t), r = e.node(t.v), i = e.node(t.w), a, o;
1465
- !n.points || !n.points.length ? (n.points = [], a = i, o = r) : (a = n.points[0], o = n.points[n.points.length - 1]);
1466
- let s = We(r, a), c = We(i, o), l = n.points.length ? n.points[0] : a, u = n.points.length ? n.points[n.points.length - 1] : o, d = n.arrowshape, f = d === "normal" || d === "vee", p = !!n.reversed, m = s, h = c;
1467
- f && (p ? m = Fn(s, l, 4) : h = Fn(c, u, 4)), n.points.unshift(m), n.points.push(h);
1468
- });
1469
- }
1470
- function Ln(e) {
1471
- e.edges().forEach((t) => {
1472
- let n = e.edge(t);
1473
- if (Object.hasOwn(n, "x")) switch ((n.labelpos === "l" || n.labelpos === "r") && (n.width -= n.labeloffset), n.labelpos) {
1474
- case "l":
1475
- n.x -= n.width / 2 + n.labeloffset;
1476
- break;
1477
- case "r":
1478
- n.x += n.width / 2 + n.labeloffset;
1479
- break;
1480
- }
1481
- });
1482
- }
1483
- function Rn(e) {
1484
- e.edges().forEach((t) => {
1485
- let n = e.edge(t);
1486
- n.reversed && n.points.reverse();
1487
- });
1488
- }
1489
- function zn(e) {
1490
- e.nodes().forEach((t) => {
1491
- if (e.children(t).length) {
1492
- let n = e.node(t), r = e.node(n.borderTop), i = e.node(n.borderBottom), a = e.node(n.borderLeft[n.borderLeft.length - 1]), o = e.node(n.borderRight[n.borderRight.length - 1]);
1493
- n.width = Math.abs(o.x - a.x), n.height = Math.abs(i.y - r.y), n.x = a.x + n.width / 2, n.y = r.y + n.height / 2;
1494
- }
1495
- }), e.nodes().forEach((t) => {
1496
- e.node(t).dummy === "border" && e.removeNode(t);
1497
- });
1498
- }
1499
- function Bn(e) {
1500
- e.edges().forEach((t) => {
1501
- if (t.v === t.w) {
1502
- let n = e.node(t.v);
1503
- n.selfEdges ||= [], n.selfEdges.push({
1504
- e: t,
1505
- label: e.edge(t)
1506
- }), e.removeEdge(t);
1507
- }
1508
- });
1509
- }
1510
- function Vn(e) {
1511
- R(e).forEach((t) => {
1512
- let n = 0;
1513
- t.forEach((t, r) => {
1514
- let i = e.node(t);
1515
- i.order = r + n, (i.selfEdges || []).forEach((t) => {
1516
- F(e, "selfedge", {
1517
- width: t.label.width,
1518
- height: t.label.height,
1519
- rank: i.rank,
1520
- order: r + ++n,
1521
- e: t.e,
1522
- label: t.label
1523
- }, "_se");
1524
- }), delete i.selfEdges;
1525
- });
1526
- });
1527
- }
1528
- function Hn(e) {
1529
- e.nodes().forEach((t) => {
1530
- let n = e.node(t);
1531
- if (n.dummy === "selfedge") {
1532
- let r = e.node(n.e.v), i = r.x + r.width / 2, a = r.y, o = n.x - i, s = r.height / 2;
1533
- e.setEdge(n.e, n.label), e.removeNode(t), n.label.points = [
1534
- {
1535
- x: i + 2 * o / 3,
1536
- y: a - s
1537
- },
1538
- {
1539
- x: i + 5 * o / 6,
1540
- y: a - s
1541
- },
1542
- {
1543
- x: i + o,
1544
- y: a
1545
- },
1546
- {
1547
- x: i + 5 * o / 6,
1548
- y: a + s
1549
- },
1550
- {
1551
- x: i + 2 * o / 3,
1552
- y: a + s
1553
- }
1554
- ], n.label.x = n.x, n.label.y = n.y;
1555
- }
1556
- });
1557
- }
1558
- function Un(e, t) {
1559
- return et($e(e, t), Number);
1560
- }
1561
- function Wn(e) {
1562
- let t = {};
1563
- return e && Object.entries(e).forEach(([e, n]) => {
1564
- let r = e;
1565
- typeof r == "string" && (r = r.toLowerCase()), t[r] = n;
1566
- }), t;
1567
- }
1568
- //#endregion
1569
- //#region src/useDag.js
1570
- var Gn = {
1571
- rankDirection: "TB",
1572
- nodeSeparation: 50,
1573
- rankSeparation: 50,
1574
- edgeSeparation: 10,
1575
- align: void 0,
1576
- nodeWidth: 100,
1577
- nodeHeight: 40,
1578
- curvedEdges: !1,
1579
- padding: 20,
1580
- arrowShape: "normal",
1581
- arrowSize: 10
1582
- };
1583
- function Kn(e) {
1584
- return e.length ? e.map((e, t) => `${t === 0 ? "M" : "L"} ${e.x} ${e.y}`).join(" ") : "";
1585
- }
1586
- function qn(e) {
1587
- if (!e.length) return "";
1588
- if (e.length === 1) {
1589
- let t = e[0];
1590
- return `M ${t.x} ${t.y}`;
1591
- }
1592
- if (e.length === 2) return `M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;
1593
- let [t] = e, n = `M ${t.x} ${t.y}`;
1594
- for (let t = 1; t < e.length - 1; t += 1) {
1595
- e[t - 1];
1596
- let r = e[t], i = e[t + 1], a = r.x, o = r.y, s = (r.x + i.x) / 2, c = (r.y + i.y) / 2;
1597
- n += ` Q ${a} ${o} ${s} ${c}`;
1598
- }
1599
- let r = e[e.length - 1];
1600
- return n += ` L ${r.x} ${r.y}`, n;
1601
- }
1602
- function Jn(e) {
1603
- let { nodes: t, edges: n, configuration: i } = e, a = T(null), s = T(null), c = `dag-arrow-${r()}`;
1604
- function l(e, t, n) {
1605
- s.value = null, a.value = null;
1606
- let i = {
1607
- ...Gn,
1608
- ...n
1609
- }, l = new k({
1610
- multigraph: !0,
1611
- compound: !0
1612
- });
1613
- l.setGraph({
1614
- rankdir: i.rankDirection,
1615
- nodesep: i.nodeSeparation,
1616
- ranksep: i.rankSeparation,
1617
- edgesep: i.edgeSeparation,
1618
- align: i.align
1619
- }), e.forEach((e) => {
1620
- l.setNode(e.id, {
1621
- label: e.label,
1622
- width: e.width ?? i.nodeWidth,
1623
- height: e.height ?? i.nodeHeight
1624
- });
1625
- }), t.forEach((e) => {
1626
- l.setEdge(e.from, e.to, {
1627
- weight: e.weight ?? 1,
1628
- minlen: e.minLength ?? 1,
1629
- arrowShape: i.arrowShape ?? "normal"
1630
- });
1631
- }), vn(l);
1632
- let u = e.map((e) => {
1633
- let t = l.node(e.id);
1634
- return {
1635
- id: e.id,
1636
- label: e.label,
1637
- x: t.x,
1638
- y: t.y,
1639
- width: t.width,
1640
- height: t.height,
1641
- original: e
1642
- };
1643
- }), d = l.edges().map((e) => {
1644
- let n = l.edge(e), a = n.points || [];
1645
- if (!a.length) return null;
1646
- let o = i.curvedEdges ? qn(a) : Kn(a), s = i.arrowShape === "undirected" ? null : `url(#${c})`, u = t.find((t) => t?.from === e.v && t?.to === e.w);
1647
- return {
1648
- id: `${e.v}->${e.w}->${r()}`,
1649
- from: e.v,
1650
- to: e.w,
1651
- points: a,
1652
- pathData: o,
1653
- markerEnd: s,
1654
- original: {
1655
- ...u,
1656
- ...n
1657
- }
1658
- };
1659
- }).filter(Boolean), f = i.padding;
1660
- if (!u.length) {
1661
- a.value = {
1662
- nodes: [],
1663
- edges: d,
1664
- viewBox: "0 0 0 0",
1665
- arrowShape: i.arrowShape,
1666
- arrowSize: i.arrowSize
1667
- };
1668
- return;
1669
- }
1670
- let p = u.flatMap((e) => [e.x - e.width / 2, e.x + e.width / 2]), m = u.flatMap((e) => [e.y - e.height / 2, e.y + e.height / 2]), h = Math.min(...p) - f, g = Math.max(...p) + f, ee = Math.min(...m) - f, te = Math.max(...m) + f;
1671
- a.value = {
1672
- nodes: u,
1673
- edges: d.map((e) => ({
1674
- ...e,
1675
- midpoint: e.pathData ? o(e.pathData) : {
1676
- x: 0,
1677
- y: 0
1678
- }
1679
- })),
1680
- viewBox: `${h} ${ee} ${g - h} ${te - ee}`,
1681
- arrowShape: i.arrowShape,
1682
- arrowSize: i.arrowSize
1683
- };
1684
- }
1685
- return De(() => {
1686
- try {
1687
- l(D(t) || [], D(n) || [], D(i) || {});
1688
- } catch (e) {
1689
- console.error("[useDag] layout error:", e), s.value = e, a.value = null;
1690
- }
1691
- }), {
1692
- layoutData: a,
1693
- lastError: s,
1694
- arrowMarkerIdentifier: c,
1695
- recomputeLayout: () => {
1696
- l(D(t) || [], D(n) || [], D(i) || {});
1697
- }
1698
- };
1699
- }
1700
- //#endregion
1701
- //#region src/components/vue-ui-dag.vue
1702
- var Yn = /* @__PURE__ */ e({ default: () => kr }), Xn = ["id"], Zn = ["id"], Qn = {
1703
- key: 1,
1704
- class: "dag-chart-error"
1705
- }, $n = { style: { position: "relative" } }, er = [
1706
- "viewBox",
1707
- "xmlns",
1708
- "aria-describedby"
1709
- ], tr = { key: 0 }, nr = [
1710
- "id",
1711
- "width",
1712
- "height"
1713
- ], rr = [
1714
- "cx",
1715
- "cy",
1716
- "r",
1717
- "fill"
1718
- ], ir = [
1719
- "x",
1720
- "y",
1721
- "width",
1722
- "height",
1723
- "fill"
1724
- ], ar = { key: 2 }, or = [
1725
- "id",
1726
- "markerWidth",
1727
- "markerHeight",
1728
- "refX",
1729
- "refY"
1730
- ], sr = [
1731
- "d",
1732
- "fill",
1733
- "stroke"
1734
- ], cr = [
1735
- "d",
1736
- "fill",
1737
- "stroke"
1738
- ], lr = { class: "vue-ui-dag-edges" }, ur = [
1739
- "data-a11y-midpoint-id",
1740
- "aria-label",
1741
- "onMouseenter"
1742
- ], dr = { class: "vue-ui-dag-nodes" }, fr = [
1743
- "onClick",
1744
- "onMouseenter",
1745
- "onMouseleave"
1746
- ], pr = ["data-a11y-node-id", "aria-label"], mr = [
1747
- "x",
1748
- "y",
1749
- "width",
1750
- "height"
1751
- ], hr = { class: "vue-ui-dag-edges" }, gr = [
1752
- "d",
1753
- "stroke-width",
1754
- "marker-end"
1755
- ], _r = { class: "vue-ui-dag-node-labels" }, vr = [
1756
- "onClick",
1757
- "onMouseenter",
1758
- "onMouseleave"
1759
- ], yr = [
1760
- "x",
1761
- "y",
1762
- "font-size",
1763
- "fill",
1764
- "font-weight"
1765
- ], br = [
1766
- "x",
1767
- "y",
1768
- "font-size",
1769
- "fill",
1770
- "font-weight",
1771
- "innerHTML"
1772
- ], xr = { key: 1 }, Sr = {
1773
- key: 1,
1774
- style: {
1775
- position: "absolute",
1776
- top: "100%",
1777
- left: "0",
1778
- width: "100%"
1779
- },
1780
- "data-dom-to-png-ignore": "",
1781
- "aria-hidden": "true"
1782
- }, Cr = {
1783
- key: 6,
1784
- class: "vue-data-ui-watermark"
1785
- }, wr = ["data-position"], Tr = { key: 0 }, Er = ["data-position"], Dr = { key: 0 }, Or = 1.5, kr = /* @__PURE__ */ te({
1786
- __name: "vue-ui-dag",
1787
- props: {
1788
- dataset: {
1789
- type: Object,
1790
- default() {
1791
- return {
1792
- nodes: [],
1793
- edges: []
1794
- };
1795
- }
1796
- },
1797
- config: {
1798
- type: Object,
1799
- default() {
1800
- return {};
1801
- }
1802
- }
1803
- },
1804
- emits: [
1805
- "onNodeClick",
1806
- "onMidpointEnter",
1807
- "onMidpointLeave",
1808
- "copyAlt",
1809
- "rotate"
1810
- ],
1811
- setup(e, { expose: o, emit: te }) {
1812
- let De = ge(() => import("./PenAndPaper-DqrClVfb.js").then((e) => e.t)), ke = ge(() => import("./UserOptions-C1NgoGu6.js").then((e) => e.n)), Ae = ge(() => import("./PackageVersion-xcyrdRmY.js").then((e) => e.t)), { vue_ui_dag: je } = l(), { isThemeValid: k, warnInvalidTheme: Me } = h(), A = e, j = te, M = T(null), N = T(r()), Ne = T(null), Pe = T(null), Fe = T(null), Ie = T(0), Le = T(0), Re = T(!1), ze = T(!1), Be = T(!1), Ve = T(!1), P = T(null), F = T(null), I = T(null), L = T(null), He = T(null), Ue = T("pointer"), We = T(!1), R = T(ct()), Ge = _(() => R.value.userOptions.useCursorPointer), Ke = T(R.value.style.chart.width), qe = T(R.value.style.chart.height), Je = T({
1813
- x: 0,
1814
- y: 0
1815
- }), z = T(null), B = T(null), Ye = T({
1816
- left: "0px",
1817
- top: "0px"
1818
- }), Xe = T("top"), V = T(!1), Ze = T({
1819
- x: 0,
1820
- y: 0
1821
- }), Qe = T({
1822
- x: 0,
1823
- y: 0
1824
- }), H = T(null), U = T(null), $e = T({
1825
- left: "0px",
1826
- top: "0px"
1827
- }), et = T("top"), W = T(!1), G = T(!1), { svgRef: K } = oe({ config: R.value.style.chart.title }), { userOptionsVisible: tt, setUserOptionsVisibility: nt, keepUserOptionState: rt } = ae({ config: R.value }), q = T(R.value.style.chart.layout.rankDirection), it = _(() => t({
1828
- defaultConfig: {
1829
- userOptions: { show: !1 },
1830
- style: { chart: {
1831
- backgroundColor: "#99999930",
1832
- nodes: {
1833
- stroke: "#CCCCCC",
1834
- backgroundColor: "#DDDDDD50"
1835
- },
1836
- edges: { stroke: "#CCCCCC" },
1837
- midpoints: {
1838
- stroke: "#CCCCCC",
1839
- fill: "#CCCCCC"
1840
- }
1841
- } }
1842
- },
1843
- userConfig: R.value.skeletonConfig ?? {}
1844
- })), { loading: at, FINAL_DATASET: ot, manualLoading: st } = d({
1845
- ...Te(A),
1846
- FINAL_CONFIG: R,
1847
- prepareConfig: ct,
1848
- skeletonDataset: A.config?.skeletonDataset ?? {
1849
- nodes: [
1850
- {
1851
- id: "A",
1852
- label: ""
1853
- },
1854
- {
1855
- id: "B",
1856
- label: ""
1857
- },
1858
- {
1859
- id: "C",
1860
- label: ""
1861
- }
1862
- ],
1863
- edges: [{
1864
- from: "A",
1865
- to: "B"
1866
- }, {
1867
- from: "A",
1868
- to: "C"
1869
- }]
1870
- },
1871
- skeletonConfig: t({
1872
- defaultConfig: R.value,
1873
- userConfig: it.value
1874
- })
1875
- });
1876
- function ct() {
1877
- let e = m({
1878
- userConfig: A.config,
1879
- defaultConfig: je
1880
- }), t = e.theme;
1881
- if (!t) return e;
1882
- if (!k.value(e)) return Me(e), e;
1883
- let n = m({
1884
- userConfig: le[t] || A.config,
1885
- defaultConfig: e
1886
- });
1887
- return m({
1888
- userConfig: A.config,
1889
- defaultConfig: n
1890
- });
1891
- }
1892
- let lt = _(() => !!R.value.debug);
1893
- Se(async () => {
1894
- n(A.dataset) && (a({
1895
- componentName: "VueUiDag",
1896
- type: "dataset",
1897
- debug: lt.value
1898
- }), ze.value = !1, st.value = !0), A.dataset.nodes || (a({
1899
- componentName: "VueUiDag",
1900
- type: "datasetAttributeEmpty",
1901
- property: "nodes",
1902
- index: 0,
1903
- debug: lt.value
1904
- }), ze.value = !1, st.value = !0), ze.value = !0, await ve(), Kt();
1905
- }), Ee(() => A.config, async (e) => {
1906
- at.value || (R.value = ct()), tt.value = !R.value.userOptions.showOnChartHover, Ie.value += 1, q.value = R.value.style.chart.layout.rankDirection, Ke.value = R.value.style.chart.width, qe.value = R.value.style.chart.height, Ct.value = R.value.style.chart.zoom.active, await ve(), Kt();
1907
- }, { deep: !0 });
1908
- let { isPrinting: ut, isImaging: J, generatePdf: dt, generateImage: ft } = u({
1909
- elementId: `dag_${N.value}`,
1910
- fileName: R.value.style.chart.title.text || "vue-ui-dag",
1911
- options: R.value.userOptions.print
1912
- }), pt = _(() => R.value.style.chart.backgroundColor), { exportSvg: mt, getSvg: ht } = p({
1913
- svg: K,
1914
- title: _(() => R.value.style.chart.title),
1915
- legend: void 0,
1916
- legendItems: void 0,
1917
- backgroundColor: pt
1918
- });
1919
- async function gt({ isCb: e }) {
1920
- Ve.value = !0, await ve();
1921
- try {
1922
- if (e) {
1923
- let { blob: e, url: t, text: n, dataUrl: r } = await ht();
1924
- await Promise.resolve(R.value.userOptions.callbacks.svg({
1925
- blob: e,
1926
- url: t,
1927
- text: n,
1928
- dataUrl: r
1929
- }));
1930
- } else await Promise.resolve(mt());
1931
- } finally {
1932
- Ve.value = !1;
1933
- }
1934
- }
1935
- function _t() {
1936
- Re.value = !0, nt(!0);
1937
- }
1938
- function vt() {
1939
- nt(!1), Re.value = !1;
1940
- }
1941
- function yt({ tooltipRef: e, isVisibleRef: t, anchorRef: n, styleRef: r, placementRef: i, offsetRef: a, margin: o = 24 }) {
1942
- return function() {
1943
- let s = e.value;
1944
- if (!s || !t.value) return;
1945
- let c = s.getBoundingClientRect(), l = window.innerWidth, u = window.innerHeight, d = n.value.x, f = n.value.y, p = a?.value?.x ?? 0, m = a?.value?.y ?? 0, h = f - m - c.height - o, g = d - c.width / 2, ee = "top";
1946
- if (h < o) {
1947
- let e = f + m + o;
1948
- e + c.height <= u - o ? (h = e, ee = "bottom") : (h = f - c.height / 2, h < o && (h = o), h + c.height > u - o && (h = u - c.height - o), ee = "center");
1949
- }
1950
- g < o && (g = o), g + c.width > l - o && (g = l - c.width - o);
1951
- let te = g <= o, ne = g + c.width >= l - o;
1952
- if ((te || ne) && ee !== "center") {
1953
- let e, t, n = d - p - o;
1954
- l - (d + p) - o >= n ? (e = "right", t = d + p + o) : (e = "left", t = d - p - o - c.width), t >= o && t + c.width <= l - o && (g = t, h = f - c.height / 2, h < o && (h = o), h + c.height > u - o && (h = u - c.height - o), ee = e);
1955
- }
1956
- i.value = ee, r.value = {
1957
- left: `${g}px`,
1958
- top: `${h}px`
1959
- };
1960
- };
1961
- }
1962
- let { layoutData: Y, lastError: bt, arrowMarkerIdentifier: xt } = Jn({
1963
- nodes: _(() => ot.value.nodes.map((e) => ({
1964
- ...e,
1965
- backgroundColor: e.backgroundColor ? c(e.backgroundColor) : R.value.style.chart.nodes.backgroundColor,
1966
- color: e.color ? c(e.color) : R.value.style.chart.nodes.labels.color
1967
- }))),
1968
- edges: _(() => ot.value.edges),
1969
- configuration: _(() => ({
1970
- ...R.value.style.chart.layout,
1971
- rankDirection: q.value
1972
- }))
1973
- });
1974
- function X(e) {
1975
- return Y.value ? Y.value.nodes.find((t) => t.id === e) : null;
1976
- }
1977
- _(() => {
1978
- if (!Y.value) return [];
1979
- let e = R.value.style.chart.edges.stroke, t = /* @__PURE__ */ new Set();
1980
- return Y.value.edges.forEach((n) => {
1981
- t.add({
1982
- id: n.id,
1983
- from: n.from,
1984
- to: n.to,
1985
- color: n.original?.color || e
1986
- });
1987
- }), Array.from(t);
1988
- });
1989
- let St = _(() => {
1990
- let e = Ke.value, t = qe.value, n = Number(e), r = Number(t), i = Number.isFinite(n) && n > 0, a = Number.isFinite(r) && r > 0;
1991
- return !i && !a ? null : {
1992
- width: i ? n : null,
1993
- height: a ? r : null
1994
- };
1995
- }), Ct = T(R.value.style.chart.zoom.active), { viewBox: wt, resetZoom: Tt, setInitialViewBox: Et, scale: Dt, zoomByFactor: Ot } = se(K, {
1996
- x: 0,
1997
- y: 0,
1998
- width: 100,
1999
- height: 100
2000
- }, 1, Ct, () => {
2001
- V.value = !1;
2002
- });
2003
- function kt() {
2004
- Ct.value = !Ct.value;
2005
- }
2006
- function At() {
2007
- let e = Y.value && Y.value.viewBox;
2008
- if (!e) return;
2009
- let t = String(e).split(" ").map(Number);
2010
- if (t.length !== 4) return;
2011
- let [n, r, i, a] = t;
2012
- if (!Number.isFinite(n) || !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(a)) return;
2013
- let o = i, s = a, c = n, l = r, u = St.value;
2014
- u && (u.width !== null && (o = u.width), u.height !== null && (s = u.height), c = n - (o - i) / 2, l = r - (s - a) / 2), Et({
2015
- x: c,
2016
- y: l,
2017
- width: o,
2018
- height: s
2019
- }, { overwriteCurrentIfNotZoomed: !0 });
2020
- }
2021
- Ee(() => Y.value && Y.value.viewBox, () => {
2022
- At();
2023
- }, { immediate: !0 }), Ee(() => St.value, () => {
2024
- At();
2025
- }), Ee(() => G.value, (e) => {
2026
- Ct.value = !e;
2027
- });
2028
- let jt = _(() => {
2029
- let e = wt.value;
2030
- return e ? `${e.x} ${e.y} ${e.width} ${e.height}` : "0 0 0 0";
2031
- }), Z = T(!1);
2032
- function Mt(e) {
2033
- Z.value = e, Le.value += 1;
2034
- }
2035
- function Nt() {
2036
- G.value = !G.value;
2037
- }
2038
- function Pt() {
2039
- Ot(Or, !0);
2040
- }
2041
- function Ft() {
2042
- Ot(1 / Or, !0);
2043
- }
2044
- let It = [
2045
- "TB",
2046
- "RL",
2047
- "BT",
2048
- "LR"
2049
- ];
2050
- function Lt() {
2051
- q.value = It[(It.indexOf(q.value) + 1) % It.length], Tt(), j("rotate", q.value);
2052
- }
2053
- let Rt = yt({
2054
- tooltipRef: B,
2055
- isVisibleRef: W,
2056
- anchorRef: Je,
2057
- styleRef: Ye,
2058
- placementRef: Xe,
2059
- isNode: !1
2060
- }), zt = yt({
2061
- tooltipRef: U,
2062
- isVisibleRef: V,
2063
- anchorRef: Ze,
2064
- styleRef: $e,
2065
- placementRef: et,
2066
- offsetRef: Qe
2067
- }), Q = T(null);
2068
- async function Bt(e) {
2069
- j("onMidpointEnter", e);
2070
- let t = K.value;
2071
- if (!t || !e?.midpoint) return;
2072
- let n = t.createSVGPoint();
2073
- n.x = e.midpoint.x, n.y = e.midpoint.y;
2074
- let r = t.getScreenCTM();
2075
- if (!r) return;
2076
- let i = n.matrixTransform(r);
2077
- Je.value = {
2078
- x: i.x,
2079
- y: i.y
2080
- }, z.value = e, W.value = !0, R.value.style.chart.midpoints.selectedEdge.animated === !0 && (Q.value = e.id, Qt()), await ve(), Rt();
2081
- }
2082
- function Vt() {
2083
- W.value = !1, z.value = null, j("onMidpointLeave"), R.value.style.chart.midpoints.selectedEdge.animated === !0 && (Q.value = null, Qt());
2084
- }
2085
- async function Ht(e) {
2086
- if (j("onNodeClick", e), !R.value.style.chart.nodes.tooltip.showOnClick) return;
2087
- let t = K.value;
2088
- if (!t) return;
2089
- let n = t.createSVGPoint();
2090
- n.x = e.x, n.y = e.y;
2091
- let r = t.getScreenCTM();
2092
- if (!r) return;
2093
- let i = n.matrixTransform(r), a = R.value.style.chart.layout.nodeWidth, o = R.value.style.chart.layout.nodeHeight, s = r.a, c = r.d, l = a * s, u = o * c;
2094
- Qe.value = {
2095
- x: l / 2,
2096
- y: u / 2
2097
- }, Ze.value = {
2098
- x: i.x,
2099
- y: i.y
2100
- }, H.value = e, V.value = !0, await ve(), zt();
2101
- }
2102
- function Ut() {
2103
- V.value = !1, H.value = null;
2104
- }
2105
- function Wt(e) {
2106
- if (!(V.value || W.value)) return;
2107
- let t = U.value;
2108
- if (t && t.contains(e.target)) return;
2109
- let n = B.value;
2110
- if (n && n.contains(e.target)) return;
2111
- let r = K.value;
2112
- if (r && r.contains(e.target)) {
2113
- let t = e.target.closest(".vue-ui-dag-node"), n = e.target.closest(".vue-ui-dag-edge-midpoint");
2114
- if (t || n) return;
2115
- }
2116
- Ut(), Vt(), We.value || Dn();
2117
- }
2118
- function Gt(e) {
2119
- e.key === "Escape" && (V.value && Ut(), W.value && Vt());
2120
- }
2121
- Se(() => {
2122
- document.addEventListener("mousedown", Wt), document.addEventListener("keydown", Gt);
2123
- }), xe(() => {
2124
- document.removeEventListener("mousedown", Wt), document.removeEventListener("keydown", Gt), P.value && (F.value && P.value.unobserve(F.value), P.value.disconnect());
2125
- });
2126
- function Kt() {
2127
- if (!R.value.responsive) {
2128
- P.value && (F.value && P.value.unobserve(F.value), P.value.disconnect(), P.value = null, F.value = null);
2129
- return;
2130
- }
2131
- let e = ne(() => {
2132
- if (!M.value) return;
2133
- let { width: e, height: t } = re({
2134
- chart: M.value,
2135
- title: R.value.style.chart.title.text ? Ne.value : null,
2136
- legend: R.value.style.chart.controls.show ? Fe.value?.$el : null,
2137
- source: Pe.value
2138
- });
2139
- requestAnimationFrame(() => {
2140
- Ke.value = Math.max(.1, e), qe.value = Math.max(.1, t - 12);
2141
- });
2142
- });
2143
- P.value && (F.value && P.value.unobserve(F.value), P.value.disconnect()), P.value = new ResizeObserver(e), F.value = M.value ? M.value.parentNode : null, F.value && P.value.observe(F.value), e();
2144
- }
2145
- function qt(e, t = {}) {
2146
- let { direction: n = -1, mode: r = "oneLapNearest", dasharray: i = null } = t;
2147
- if (!e || typeof e.getTotalLength != "function") return lt.value && console.warn("VueUiDag @getIdealDashoffsetDelta: invalid path element", e), 0;
2148
- let a = e.getTotalLength(), o = d(i ?? e.getAttribute("stroke-dasharray") ?? (typeof getComputedStyle == "function" ? getComputedStyle(e).strokeDasharray : ""));
2149
- if (!Number.isFinite(o) || o <= 0) return n * a;
2150
- let s = Math.max(1, Math.round(a / o)), c = Math.max(1, Math.ceil(a / o)), l = Math.max(1, Math.floor(a / o)), u;
2151
- return u = r === "pattern" ? o : r === "oneLapCeil" ? c * o : r === "oneLapFloor" ? l * o : s * o, n * u;
2152
- function d(e) {
2153
- if (!e || e === "none") return NaN;
2154
- let t = String(e).replace(/,/g, " ").trim().split(/\s+/).map((e) => Number.parseFloat(e)).filter((e) => Number.isFinite(e));
2155
- if (!t.length) return NaN;
2156
- let n = t.reduce((e, t) => e + t, 0);
2157
- return t.length % 2 == 1 ? n * 2 : n;
2158
- }
2159
- }
2160
- let Jt = T(/* @__PURE__ */ new Map()), Yt = T(/* @__PURE__ */ new Map());
2161
- function Xt(e) {
2162
- return function(t) {
2163
- t ? Jt.value.set(e, t) : Jt.value.delete(e);
2164
- };
2165
- }
2166
- function Zt() {
2167
- Yt.value.forEach((e) => {
2168
- try {
2169
- e.cancel();
2170
- } catch {}
2171
- }), Yt.value.clear();
2172
- }
2173
- function Qt() {
2174
- Zt();
2175
- let e = Y.value?.edges ?? [];
2176
- if (!e.length) return;
2177
- let t = R.value.style.chart.edges.animations, n = Number(t.referenceDistance) > 0 ? Number(t.referenceDistance) : 24;
2178
- e.forEach((e) => {
2179
- let r = R.value.style.chart.midpoints.selectedEdge.animated === !0 && Q.value != null && e.id === Q.value, i = !!e?.original?.animated || !!e?.animated || r, a = Jt.value.get(e.id);
2180
- if (!a) return;
2181
- if (!i) {
2182
- a.style.strokeDasharray = "0", a.style.strokeDashoffset = "0";
2183
- return;
2184
- }
2185
- let o = e?.original?.dasharray ?? t.dasharray;
2186
- a.style.strokeDasharray = String(o), a.style.strokeDashoffset = "0";
2187
- let s = ![void 0, null].includes(e?.original?.animationDirection), c = ![void 0, null].includes(t.animationDirection), l = qt(a, {
2188
- direction: s ? Number(e.original.animationDirection) : c ? Number(t.animationDirection) : -1,
2189
- mode: "oneLapNearest",
2190
- dasharray: String(o)
2191
- }), u = e?.original?.animationDurationMs ?? t.animationDurationMs ?? 1e3, d = Number(u), f = Number.isFinite(d) && d > 0 ? n / d : n / 1e3, p = Math.max(1, Math.round(Math.abs(l) / Math.max(1e-9, f))), m = a.animate([{ strokeDashoffset: 0 }, { strokeDashoffset: l }], {
2192
- duration: p,
2193
- iterations: Infinity,
2194
- easing: "linear"
2195
- });
2196
- Yt.value.set(e.id, m);
2197
- });
2198
- }
2199
- Ee(() => Y.value && Y.value.edges, async () => {
2200
- await ve(), Qt();
2201
- }, {
2202
- deep: !0,
2203
- immediate: !0
2204
- }), xe(() => {
2205
- Zt();
2206
- });
2207
- async function $t({ scale: e = 2 } = {}) {
2208
- if (!M.value) return;
2209
- let { width: t, height: n } = M.value.getBoundingClientRect(), r = t / n, { imageUri: i, base64: a } = await g({
2210
- domElement: M.value,
2211
- base64: !0,
2212
- img: !0,
2213
- scale: e
2214
- });
2215
- return {
2216
- imageUri: i,
2217
- base64: a,
2218
- title: R.value.style.chart.title.text ?? "vue-ui-dag",
2219
- width: t,
2220
- height: n,
2221
- aspectRatio: r
2222
- };
2223
- }
2224
- let en = _(() => {
2225
- let e = Number(R.value.style.chart.layout.nodeHeight);
2226
- return Number.isFinite(e) && e > 0 ? e / R.value.style.chart.backgroundPattern.spacingRatio : 12;
2227
- }), tn = _(() => en.value * (R.value.style.chart.backgroundPattern.dotRadiusRatio / 100)), $ = T(null), nn = null, rn = 0;
2228
- function an(e) {
2229
- nn &&= (clearTimeout(nn), null), $.value !== e && ($.value = e, (R.value.style.chart.nodes.selected.downstreamEdges.animated === !0 || R.value.style.chart.nodes.selected.upstreamEdges.animated === !0) && Qt());
2230
- }
2231
- function on(e) {
2232
- Ue.value = "pointer", Q.value = null, an(e);
2233
- }
2234
- async function sn(e) {
2235
- Ue.value = "pointer", $.value = null, await Bt(e);
2236
- }
2237
- function cn(e) {
2238
- let t = ++rn;
2239
- nn && clearTimeout(nn), nn = setTimeout(() => {
2240
- t === rn && $.value === e && ($.value = null, (R.value.style.chart.nodes.selected.downstreamEdges.animated === !0 || R.value.style.chart.nodes.selected.upstreamEdges.animated === !0) && Qt());
2241
- }, 20);
2242
- }
2243
- function ln(e) {
2244
- let t = e.from === $.value, n = e.to === $.value, r = L.value === "midpoint" && I.value === e.id, i = Q.value === e.id || z.value?.id === e.id || r, a = e.original.color ?? R.value.style.chart.edges.stroke;
2245
- return i && R.value.style.chart.midpoints.selectedEdge.stroke != null ? a = R.value.style.chart.midpoints.selectedEdge.stroke : t && R.value.style.chart.nodes.selected.downstreamEdges.stroke != null ? a = R.value.style.chart.nodes.selected.downstreamEdges.stroke : n && R.value.style.chart.nodes.selected.upstreamEdges.stroke != null && (a = R.value.style.chart.nodes.selected.upstreamEdges.stroke), t && R.value.style.chart.nodes.selected.downstreamEdges.animated === !0 || n && R.value.style.chart.nodes.selected.upstreamEdges.animated === !0 || r && R.value.style.chart.midpoints.selectedEdge.animated === !0 ? e.animated = !0 : e.animated = (Y.value?.edges.find((t) => t.id === e.id))?.original?.animated ?? !1, {
2246
- d: e.pathData,
2247
- fill: "none",
2248
- stroke: a,
2249
- "stroke-width": R.value.style.chart.edges.strokeWidth * (i || e.from === $.value ? 2 : 1),
2250
- "stroke-linecap": "round",
2251
- "stroke-linejoin": "round"
2252
- };
2253
- }
2254
- function un(e) {
2255
- return L.value === "node" && I.value === e;
2256
- }
2257
- function dn(e) {
2258
- let t = $.value === e.id, n = L.value === "node" && I.value === e.id, r = t || n, i = r && R.value.style.chart.nodes.selected.backgroundColor != null ? R.value.style.chart.nodes.selected.backgroundColor : e.original.backgroundColor, a = r && R.value.style.chart.nodes.selected.stroke != null ? R.value.style.chart.nodes.selected.stroke : R.value.style.chart.nodes.stroke, o = r && R.value.style.chart.nodes.selected.strokeWidth != null ? R.value.style.chart.nodes.selected.strokeWidth : R.value.style.chart.nodes.strokeWidth;
2259
- return {
2260
- x: e.x - e.width / 2,
2261
- y: e.y - e.height / 2,
2262
- width: e.width,
2263
- height: e.height,
2264
- rx: R.value.style.chart.nodes.borderRadius,
2265
- fill: i,
2266
- stroke: a,
2267
- "stroke-width": o
2268
- };
2269
- }
2270
- function fn(e) {
2271
- let t = e.from === $.value, n = e.to === $.value, r = L.value === "midpoint" && I.value === e.id, i = Q.value === e.id || z.value?.id === e.id || r, a = e.original.color ?? R.value.style.chart.edges.stroke;
2272
- return i && R.value.style.chart.midpoints.selectedEdge.stroke != null ? a = R.value.style.chart.midpoints.selectedEdge.stroke : t && R.value.style.chart.nodes.selected.downstreamEdges.stroke != null ? a = R.value.style.chart.nodes.selected.downstreamEdges.stroke : n && R.value.style.chart.nodes.selected.upstreamEdges.stroke != null && (a = R.value.style.chart.nodes.selected.upstreamEdges.stroke), {
2273
- cx: e.midpoint.x,
2274
- cy: e.midpoint.y,
2275
- r: R.value.style.chart.midpoints.radius,
2276
- fill: r ? R.value.style.chart.midpoints.selectedEdge.stroke ?? R.value.style.chart.midpoints.fill : R.value.style.chart.midpoints.fill,
2277
- stroke: a,
2278
- "stroke-width": R.value.style.chart.edges.strokeWidth * (i || e.from === $.value ? 2 : 1)
2279
- };
2280
- }
2281
- function pn(e) {
2282
- let t = e.from === $.value, n = e.to === $.value, r = L.value === "midpoint" && I.value === e.id, i = Q.value === e.id || z.value?.id === e.id || r, a = e.color ?? e.original?.color ?? R.value.style.chart.edges.stroke;
2283
- return i && R.value.style.chart.midpoints.selectedEdge.stroke != null ? a = R.value.style.chart.midpoints.selectedEdge.stroke : t && R.value.style.chart.nodes.selected.downstreamEdges.stroke != null ? a = R.value.style.chart.nodes.selected.downstreamEdges.stroke : n && R.value.style.chart.nodes.selected.upstreamEdges.stroke != null && (a = R.value.style.chart.nodes.selected.upstreamEdges.stroke), a;
2284
- }
2285
- function mn(e) {
2286
- return `${xt}-${String(e).replace(/[^a-zA-Z0-9_-]/g, "_")}`;
2287
- }
2288
- function hn() {
2289
- return Y.value;
2290
- }
2291
- function gn(e) {
2292
- if (e?.stage === "start") {
2293
- Be.value = !0;
2294
- return;
2295
- }
2296
- if (e?.stage === "end") {
2297
- Be.value = !1;
2298
- return;
2299
- }
2300
- ft();
2301
- }
2302
- async function _n() {
2303
- if (j("copyAlt", {
2304
- config: R.value,
2305
- dataset: ot.value
2306
- }), !R.value.userOptions.callbacks.altCopy) {
2307
- console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");
2308
- return;
2309
- }
2310
- await Promise.resolve(R.value.userOptions.callbacks.altCopy({
2311
- config: R.value,
2312
- dataset: ot.value
2313
- }));
2314
- }
2315
- let vn = _(() => (Y.value?.nodes ?? []).map((e) => ({
2316
- id: e.id,
2317
- type: "node",
2318
- x: e.x,
2319
- y: e.y,
2320
- label: e.label ?? e.id,
2321
- raw: e
2322
- }))), yn = _(() => R.value.style.chart.midpoints.show ? (Y.value?.edges ?? []).filter((e) => e?.midpoint).map((e) => ({
2323
- id: e.id,
2324
- type: "midpoint",
2325
- x: e.midpoint.x,
2326
- y: e.midpoint.y,
2327
- label: `${X(e.from)?.label ?? e.from} → ${X(e.to)?.label ?? e.to}`,
2328
- raw: e
2329
- })) : []), bn = _(() => [...vn.value, ...yn.value].sort((e, t) => e.x === t.x ? e.y - t.y : e.x - t.x)), xn = _(() => {
2330
- let e = /* @__PURE__ */ new Map();
2331
- return bn.value.forEach((t, n) => {
2332
- e.set(`${t.type}:${t.id}`, n);
2333
- }), e;
2334
- }), Sn = _(() => {
2335
- let e = Y.value?.nodes ?? [], t = Y.value?.edges ?? [];
2336
- return {
2337
- headers: [
2338
- R.value.a11y?.translations?.node ?? "Node",
2339
- R.value.a11y?.translations?.parents ?? "Parents",
2340
- R.value.a11y?.translations?.children ?? "Children"
2341
- ],
2342
- rows: e.map((e) => {
2343
- let n = t.filter((t) => t.to === e.id).map((e) => X(e.from)?.label ?? e.from).join(", "), r = t.filter((t) => t.from === e.id).map((e) => X(e.to)?.label ?? e.to).join(", ");
2344
- return [
2345
- e.label ?? e.id,
2346
- n || "—",
2347
- r || "—"
2348
- ];
2349
- })
2350
- };
2351
- });
2352
- function Cn(e) {
2353
- return `${e.type}:${e.id}`;
2354
- }
2355
- function wn() {
2356
- return I.value == null || L.value == null ? null : bn.value.find((e) => e.id === I.value && e.type === L.value) ?? null;
2357
- }
2358
- async function Tn(e) {
2359
- if (e) {
2360
- if (e.type === "node") {
2361
- Vt();
2362
- return;
2363
- }
2364
- e.type === "midpoint" && (Ut(), await Bt(e.raw));
2365
- }
2366
- }
2367
- function En(e) {
2368
- if (e) {
2369
- if (I.value = e.id, L.value = e.type, He.value = xn.value.get(Cn(e)) ?? null, e.type === "node") {
2370
- an(e.id), Q.value = null;
2371
- return;
2372
- }
2373
- e.type === "midpoint" && ($.value = null, Q.value = e.id, R.value.style.chart.midpoints.selectedEdge.animated === !0 && Qt());
2374
- }
2375
- }
2376
- function Dn() {
2377
- I.value = null, L.value = null, He.value = null, V.value || ($.value = null), W.value || (Q.value = null, R.value.style.chart.midpoints.selectedEdge.animated === !0 && Qt());
2378
- }
2379
- function On() {
2380
- We.value = !0, Dn();
2381
- }
2382
- function kn() {
2383
- We.value = !1, Ut(), Vt(), Dn();
2384
- }
2385
- function An(e, t, n) {
2386
- let r = t.x - e.x, i = t.y - e.y;
2387
- return n === "right" && r <= 0 || n === "left" && r >= 0 || n === "down" && i <= 0 || n === "up" && i >= 0 ? Infinity : n === "right" || n === "left" ? Math.abs(r) * 1e3 + Math.abs(i) : Math.abs(i) * 1e3 + Math.abs(r);
2388
- }
2389
- function jn(e, t) {
2390
- let n = bn.value.filter((t) => Cn(t) !== Cn(e));
2391
- if (!n.length) return null;
2392
- let r = null, i = Infinity;
2393
- return n.forEach((n) => {
2394
- let a = An(e, n, t);
2395
- a < i && (i = a, r = n);
2396
- }), r || (t === "right" || t === "down" ? bn.value[0] ?? null : bn.value[bn.value.length - 1] ?? null);
2397
- }
2398
- async function Mn(e) {
2399
- e && (Ue.value = "keyboard", e.type === "node" && (Vt(), await Ht(e.raw)));
2400
- }
2401
- async function Nn(e) {
2402
- if (!K.value || G.value || document.activeElement !== K.value || !bn.value.length) return;
2403
- let t = e.key === "ArrowLeft", n = e.key === "ArrowRight", r = e.key === "ArrowUp", i = e.key === "ArrowDown", a = e.key === "Enter" || e.key === " ", o = e.key === "Escape";
2404
- if (!t && !n && !r && !i && !a && !o) return;
2405
- if (e.preventDefault(), e.stopPropagation(), o) {
2406
- Ut(), Vt(), Dn();
2407
- return;
2408
- }
2409
- let s = wn();
2410
- if (a) {
2411
- if (!s) return;
2412
- s.type === "node" && await Mn(s);
2413
- return;
2414
- }
2415
- if (!s) {
2416
- let e = bn.value[0];
2417
- if (!e) return;
2418
- En(e), await Tn(e);
2419
- return;
2420
- }
2421
- let c = null;
2422
- n ? c = jn(s, "right") : t ? c = jn(s, "left") : i ? c = jn(s, "down") : r && (c = jn(s, "up")), c && (Ut(), Vt(), En(c), await Tn(c));
2423
- }
2424
- return o({
2425
- getData: hn,
2426
- getImage: $t,
2427
- generatePdf: dt,
2428
- generateSvg: gt,
2429
- generateImage: ft,
2430
- toggleAnnotator: Nt,
2431
- toggleFullscreen: Mt,
2432
- zoomIn: Pt,
2433
- zoomOut: Ft,
2434
- resetZoom: Tt,
2435
- switchDirection: Lt,
2436
- copyAlt: _n
2437
- }), (e, t) => (w(), b("div", {
2438
- class: ye(`vue-data-ui-component vue-ui-dag ${Z.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${R.value.responsive ? "vue-ui-dag-responsive" : ""}`),
2439
- id: `dag_${N.value}`,
2440
- ref_key: "dagChart",
2441
- ref: M,
2442
- style: be({
2443
- fontFamily: R.value.style.fontFamily,
2444
- backgroundColor: R.value.style.chart.backgroundColor,
2445
- padding: "0.5rem"
2446
- }),
2447
- onMouseenter: _t,
2448
- onMouseleave: vt
2449
- }, [
2450
- x("div", {
2451
- id: `chart-instructions-${N.value}`,
2452
- class: "sr-only"
2453
- }, [x("p", null, we(R.value.a11y.translations.keyboardNavigation), 1)], 8, Zn),
2454
- Sn.value?.rows?.length ? (w(), v(ie, {
2455
- key: 0,
2456
- uid: N.value,
2457
- head: Sn.value.headers,
2458
- body: Sn.value.rows,
2459
- notice: R.value.a11y.translations.tableAvailable,
2460
- caption: R.value.a11y.translations.tableCaption
2461
- }, null, 8, [
2462
- "uid",
2463
- "head",
2464
- "body",
2465
- "notice",
2466
- "caption"
2467
- ])) : y("", !0),
2468
- D(bt) ? (w(), b("div", Qn, we(String(D(bt))), 1)) : y("", !0),
2469
- R.value.userOptions.buttons.annotator ? (w(), v(D(De), {
2470
- key: 2,
2471
- svgRef: D(K),
2472
- backgroundColor: R.value.style.chart.backgroundColor,
2473
- color: R.value.style.chart.color,
2474
- active: G.value,
2475
- isCursorPointer: Ge.value,
2476
- onClose: Nt
2477
- }, {
2478
- "annotator-action-close": O(() => [E(e.$slots, "annotator-action-close", {}, void 0, !0)]),
2479
- "annotator-action-color": O(({ color: t }) => [E(e.$slots, "annotator-action-color", C(S({ color: t })), void 0, !0)]),
2480
- "annotator-action-draw": O(({ mode: t }) => [E(e.$slots, "annotator-action-draw", C(S({ mode: t })), void 0, !0)]),
2481
- "annotator-action-undo": O(({ disabled: t }) => [E(e.$slots, "annotator-action-undo", C(S({ disabled: t })), void 0, !0)]),
2482
- "annotator-action-redo": O(({ disabled: t }) => [E(e.$slots, "annotator-action-redo", C(S({ disabled: t })), void 0, !0)]),
2483
- "annotator-action-delete": O(({ disabled: t }) => [E(e.$slots, "annotator-action-delete", C(S({ disabled: t })), void 0, !0)]),
2484
- _: 3
2485
- }, 8, [
2486
- "svgRef",
2487
- "backgroundColor",
2488
- "color",
2489
- "active",
2490
- "isCursorPointer"
2491
- ])) : y("", !0),
2492
- R.value.userOptions.show && ze.value && (D(rt) || D(tt)) ? (w(), v(D(ke), {
2493
- ref: "userOptionsRef",
2494
- key: `user_option_${Le.value}`,
2495
- backgroundColor: R.value.style.chart.backgroundColor,
2496
- color: R.value.style.chart.color,
2497
- isPrinting: D(ut),
2498
- isImaging: D(J),
2499
- uid: N.value,
2500
- hasTooltip: !1,
2501
- hasTable: !1,
2502
- hasXls: !1,
2503
- hasLabel: !1,
2504
- hasPdf: R.value.userOptions.buttons.pdf,
2505
- hasImg: R.value.userOptions.buttons.img,
2506
- hasSvg: R.value.userOptions.buttons.svg,
2507
- hasFullscreen: R.value.userOptions.buttons.fullscreen,
2508
- hasAltCopy: R.value.userOptions.buttons.altCopy,
2509
- isFullscreen: Z.value,
2510
- chartElement: M.value,
2511
- position: R.value.userOptions.position,
2512
- titles: { ...R.value.userOptions.buttonTitles },
2513
- hasAnnotator: R.value.userOptions.buttons.annotator,
2514
- isAnnotation: G.value,
2515
- callbacks: R.value.userOptions.callbacks,
2516
- printScale: R.value.userOptions.print.scale,
2517
- hasZoom: R.value.userOptions.buttons.zoom,
2518
- isZoom: Ct.value,
2519
- isCursorPointer: Ge.value,
2520
- onToggleFullscreen: Mt,
2521
- onGeneratePdf: D(dt),
2522
- onGenerateImage: gn,
2523
- onGenerateSvg: gt,
2524
- onToggleAnnotator: Nt,
2525
- onToggleZoom: kt,
2526
- onCopyAlt: _n,
2527
- style: be({ visibility: D(rt) ? D(tt) ? "visible" : "hidden" : "visible" })
2528
- }, pe({ _: 2 }, [
2529
- e.$slots.menuIcon ? {
2530
- name: "menuIcon",
2531
- fn: O(({ isOpen: t, color: n }) => [E(e.$slots, "menuIcon", C(S({
2532
- isOpen: t,
2533
- color: n
2534
- })), void 0, !0)]),
2535
- key: "0"
2536
- } : void 0,
2537
- e.$slots.optionPdf ? {
2538
- name: "optionPdf",
2539
- fn: O(() => [E(e.$slots, "optionPdf", {}, void 0, !0)]),
2540
- key: "1"
2541
- } : void 0,
2542
- e.$slots.optionImg ? {
2543
- name: "optionImg",
2544
- fn: O(() => [E(e.$slots, "optionImg", {}, void 0, !0)]),
2545
- key: "2"
2546
- } : void 0,
2547
- e.$slots.optionSvg ? {
2548
- name: "optionSvg",
2549
- fn: O(() => [E(e.$slots, "optionSvg", {}, void 0, !0)]),
2550
- key: "3"
2551
- } : void 0,
2552
- e.$slots.optionFullscreen ? {
2553
- name: "optionFullscreen",
2554
- fn: O(({ toggleFullscreen: t, isFullscreen: n }) => [E(e.$slots, "optionFullscreen", C(S({
2555
- toggleFullscreen: t,
2556
- isFullscreen: n
2557
- })), void 0, !0)]),
2558
- key: "4"
2559
- } : void 0,
2560
- e.$slots.optionAnnotator ? {
2561
- name: "optionAnnotator",
2562
- fn: O(({ toggleAnnotator: t, isAnnotator: n }) => [E(e.$slots, "optionAnnotator", C(S({
2563
- toggleAnnotator: t,
2564
- isAnnotator: n
2565
- })), void 0, !0)]),
2566
- key: "5"
2567
- } : void 0,
2568
- e.$slots.optionZoom ? {
2569
- name: "optionZoom",
2570
- fn: O(({ toggleZoom: t, isZoomLocked: n }) => [E(e.$slots, "optionZoom", C(S({
2571
- toggleZoom: t,
2572
- isZoomLocked: n
2573
- })), void 0, !0)]),
2574
- key: "6"
2575
- } : void 0,
2576
- e.$slots.optionAltCopy ? {
2577
- name: "optionAltCopy",
2578
- fn: O(({ altCopy: t }) => [E(e.$slots, "optionAltCopy", C(S({ altCopy: t })), void 0, !0)]),
2579
- key: "7"
2580
- } : void 0,
2581
- e.$slots["custom-menu-before"] ? {
2582
- name: "custom-menu-before",
2583
- fn: O(() => [E(e.$slots, "custom-menu-before", {}, void 0, !0)]),
2584
- key: "8"
2585
- } : void 0,
2586
- e.$slots["custom-menu-after"] ? {
2587
- name: "custom-menu-after",
2588
- fn: O(() => [E(e.$slots, "custom-menu-after", {}, void 0, !0)]),
2589
- key: "9"
2590
- } : void 0
2591
- ]), 1032, [
2592
- "backgroundColor",
2593
- "color",
2594
- "isPrinting",
2595
- "isImaging",
2596
- "uid",
2597
- "hasPdf",
2598
- "hasImg",
2599
- "hasSvg",
2600
- "hasFullscreen",
2601
- "hasAltCopy",
2602
- "isFullscreen",
2603
- "chartElement",
2604
- "position",
2605
- "titles",
2606
- "hasAnnotator",
2607
- "isAnnotation",
2608
- "callbacks",
2609
- "printScale",
2610
- "hasZoom",
2611
- "isZoom",
2612
- "isCursorPointer",
2613
- "onGeneratePdf",
2614
- "style"
2615
- ])) : y("", !0),
2616
- R.value.style.chart.title.text ? (w(), b("div", {
2617
- key: 4,
2618
- ref_key: "chartTitle",
2619
- ref: Ne,
2620
- style: "width:100%;background:transparent;"
2621
- }, [(w(), v(ee, {
2622
- key: `title_${Ie.value}`,
2623
- config: {
2624
- title: {
2625
- cy: "dag-title",
2626
- ...R.value.style.chart.title
2627
- },
2628
- subtitle: {
2629
- cy: "dag-subtitle",
2630
- ...R.value.style.chart.title.subtitle
2631
- }
2632
- }
2633
- }, null, 8, ["config"]))], 512)) : y("", !0),
2634
- R.value.style.chart.controls.position === "top" && !D(at) && R.value.style.chart.controls.show ? (w(), v(ce, {
2635
- key: 5,
2636
- ref_key: "zoomControls",
2637
- ref: Fe,
2638
- config: R.value,
2639
- scale: D(Dt),
2640
- isFullscreen: Z.value,
2641
- withDirection: "",
2642
- onZoomIn: Pt,
2643
- onZoomOut: Ft,
2644
- onResetZoom: t[0] ||= () => D(Tt)(!0),
2645
- onSwitchDirection: Lt
2646
- }, null, 8, [
2647
- "config",
2648
- "scale",
2649
- "isFullscreen"
2650
- ])) : y("", !0),
2651
- x("div", $n, [D(Y) ? (w(), b("svg", {
2652
- key: 0,
2653
- ref_key: "svgRef",
2654
- ref: K,
2655
- class: ye({
2656
- "vue-ui-dag-svg": !0,
2657
- "vue-data-ui-loading": D(at)
2658
- }),
2659
- viewBox: jt.value,
2660
- xmlns: D(s),
2661
- style: be({
2662
- backgroundColor: R.value.style.chart.backgroundColor,
2663
- height: "100%",
2664
- width: "100%"
2665
- }),
2666
- tabindex: "0",
2667
- "aria-describedby": `chart-instructions-${N.value}`,
2668
- onFocus: On,
2669
- onBlur: kn,
2670
- onKeydown: Nn
2671
- }, [
2672
- he(D(Ae)),
2673
- R.value.style.chart.backgroundPattern.show ? (w(), b("defs", tr, [x("pattern", {
2674
- id: `dag_bg_pattern_${N.value}`,
2675
- patternUnits: "userSpaceOnUse",
2676
- width: en.value,
2677
- height: en.value
2678
- }, [E(e.$slots, "background-pattern", C(S({
2679
- x: en.value / 2,
2680
- y: en.value / 2,
2681
- color: R.value.style.chart.backgroundPattern.dotColor
2682
- })), () => [x("circle", {
2683
- cx: en.value / 2,
2684
- cy: en.value / 2,
2685
- r: tn.value,
2686
- fill: R.value.style.chart.backgroundPattern.dotColor
2687
- }, null, 8, rr)], !0)], 8, nr)])) : y("", !0),
2688
- R.value.style.chart.backgroundPattern.show ? (w(), b("rect", {
2689
- key: 1,
2690
- x: D(wt)?.x ?? 0,
2691
- y: D(wt)?.y ?? 0,
2692
- width: D(wt)?.width ?? 0,
2693
- height: D(wt)?.height ?? 0,
2694
- fill: `url(#dag_bg_pattern_${N.value})`,
2695
- style: be({
2696
- pointerEvents: "none",
2697
- opacity: R.value.style.chart.backgroundPattern.opacity
2698
- })
2699
- }, null, 12, ir)) : y("", !0),
2700
- D(Y).arrowShape === "undirected" ? y("", !0) : (w(), b("defs", ar, [(w(!0), b(ue, null, Ce(D(Y).edges, (e) => (w(), b("marker", {
2701
- key: `marker_${e.id}`,
2702
- id: mn(e.id),
2703
- markerWidth: D(Y).arrowSize,
2704
- markerHeight: D(Y).arrowSize,
2705
- refX: D(Y).arrowSize - 3,
2706
- refY: D(Y).arrowSize / 2,
2707
- orient: "auto",
2708
- markerUnits: "strokeWidth"
2709
- }, [D(Y).arrowShape === "normal" ? (w(), b("path", {
2710
- key: 0,
2711
- d: `M 0 0 L ${D(Y).arrowSize} ${D(Y).arrowSize / 2} L 0 ${D(Y).arrowSize} Z`,
2712
- fill: pn(e),
2713
- stroke: pn(e),
2714
- "stroke-width": "0",
2715
- style: { transition: "stroke 0.2s ease-in-out,\n fill 0.2s ease-in-out,\n stroke-width 0.2s ease-in-out" }
2716
- }, null, 8, sr)) : (w(), b("path", {
2717
- key: 1,
2718
- d: `M 0 0 L ${D(Y).arrowSize} ${D(Y).arrowSize / 2} L 0 ${D(Y).arrowSize} L ${D(Y).arrowSize / 3} ${D(Y).arrowSize / 2} Z`,
2719
- fill: pn(e),
2720
- stroke: pn(e),
2721
- "stroke-width": "0",
2722
- style: { transition: "stroke 0.2s ease-in-out,\n fill 0.2s ease-in-out,\n stroke-width 0.2s ease-in-out" }
2723
- }, null, 8, cr))], 8, or))), 128))])),
2724
- x("g", lr, [(w(!0), b(ue, null, Ce(D(Y).edges, (e) => (w(), b(ue, { key: e.id }, [x("path", _e({
2725
- "data-cy-edge": "",
2726
- ref_for: !0,
2727
- ref: Xt(e.id)
2728
- }, { ref_for: !0 }, ln(e), { style: {
2729
- "pointer-events": "none",
2730
- transition: "stroke-width 0.2s ease-in-out,\n stroke 0.2s ease-in-out"
2731
- } }), null, 16), R.value.style.chart.midpoints.show ? (w(), b("circle", _e({
2732
- key: 0,
2733
- "data-cy-midpoint": "",
2734
- class: "vue-ui-dag-edge-midpoint",
2735
- "data-a11y-midpoint-id": e.id
2736
- }, { ref_for: !0 }, fn(e), {
2737
- "aria-label": `${X(e.from)?.label ?? e.from} to ${X(e.to)?.label ?? e.to}`,
2738
- style: { transition: "stroke-width 0.2s ease-in-out,\n stroke 0.2s ease-in-out,\n fill 0.2s ease-in-out" },
2739
- onMouseenter: (t) => sn(e),
2740
- onMouseleave: Vt
2741
- }), null, 16, ur)) : y("", !0)], 64))), 128))]),
2742
- x("g", dr, [(w(!0), b(ue, null, Ce(D(Y).nodes, (t) => (w(), b("g", {
2743
- key: t.id,
2744
- class: "vue-ui-dag-node",
2745
- onClick: Oe((e) => R.value.style.chart.nodes.tooltip.showOnClick && Ht(t), ["stop"]),
2746
- onMouseenter: (e) => on(t.id),
2747
- onMouseleave: (e) => cn(t.id)
2748
- }, [e.$slots.node ? y("", !0) : (w(), b("rect", _e({
2749
- key: 0,
2750
- "data-cy-node": ""
2751
- }, { ref_for: !0 }, dn(t), {
2752
- "data-a11y-node-id": t.id,
2753
- "aria-label": `${t.label ?? t.id}`,
2754
- style: {
2755
- cursor: R.value.style.chart.nodes.tooltip.showOnClick && Ge.value ? "pointer" : "default",
2756
- transition: "stroke 0.2s ease-in-out, stroke-width 0.2s ease-in-out, fill 0.2s ease-in-out"
2757
- }
2758
- }), null, 16, pr)), e.$slots.node ? (w(), b("foreignObject", {
2759
- key: 1,
2760
- x: t.x - t.width / 2,
2761
- y: t.y - t.height / 2,
2762
- width: t.width,
2763
- height: t.height,
2764
- style: { overflow: "visible" }
2765
- }, [E(e.$slots, "node", _e({ ref_for: !0 }, {
2766
- node: t,
2767
- orientation: q.value
2768
- }), void 0, !0)], 8, mr)) : y("", !0)], 40, fr))), 128))]),
2769
- x("g", hr, [(w(!0), b(ue, null, Ce(D(Y).edges, (e) => (w(), b("path", {
2770
- key: e.id,
2771
- d: e.pathData,
2772
- fill: "none",
2773
- stroke: "transparent",
2774
- "stroke-width": R.value.style.chart.edges.strokeWidth * (e.from === $.value || e.id === z.value?.id ? 1.3 : 1),
2775
- "stroke-linecap": "round",
2776
- "stroke-linejoin": "round",
2777
- "marker-end": D(Y).arrowShape === "undirected" ? null : `url(#${mn(e.id)})`,
2778
- style: {
2779
- "pointer-events": "none",
2780
- transition: "stroke-width 0.2s ease-in-out,\n stroke 0.2s ease-in-out"
2781
- }
2782
- }, null, 8, gr))), 128))]),
2783
- x("g", _r, [(w(!0), b(ue, null, Ce(D(Y).nodes, (t) => (w(), b("g", {
2784
- key: t.id,
2785
- onClick: Oe((e) => R.value.style.chart.nodes.tooltip.showOnClick && Ht(t), ["stop"]),
2786
- onMouseenter: (e) => an(t.id),
2787
- onMouseleave: (e) => cn(t.id)
2788
- }, [e.$slots["free-node-label"] ? y("", !0) : (w(), b(ue, { key: 0 }, [e.$slots["node-label"] ? (w(), b("text", {
2789
- key: 0,
2790
- x: t.x,
2791
- y: t.y + R.value.style.chart.nodes.labels.fontSize / 3,
2792
- "text-anchor": "middle",
2793
- "font-size": R.value.style.chart.nodes.labels.fontSize,
2794
- fill: $.value === t.id && R.value.style.chart.nodes.selected.labelColor != null ? R.value.style.chart.nodes.selected.labelColor : t.original.color,
2795
- "font-weight": R.value.style.chart.nodes.labels.bold ? "bold" : "normal",
2796
- style: { transition: "fill 0.2s ease-in-out" }
2797
- }, [E(e.$slots, "node-label", _e({ ref_for: !0 }, {
2798
- node: t,
2799
- orientation: q.value
2800
- }), () => [me(we(t.label), 1)], !0)], 8, yr)) : !e.$slots["free-node-label"] && !e.$slots.node ? (w(), b("text", {
2801
- key: 1,
2802
- "data-cy-node-label": "",
2803
- x: t.x,
2804
- y: t.y + R.value.style.chart.nodes.labels.fontSize / 3,
2805
- "text-anchor": "middle",
2806
- "font-size": R.value.style.chart.nodes.labels.fontSize,
2807
- fill: ($.value === t.id || un(t.id)) && R.value.style.chart.nodes.selected.labelColor != null ? R.value.style.chart.nodes.selected.labelColor : t.original.color,
2808
- "font-weight": R.value.style.chart.nodes.labels.bold ? "bold" : "normal",
2809
- style: { transition: "fill 0.2s ease-in-out" },
2810
- innerHTML: D(i)({
2811
- content: t.label,
2812
- fontSize: R.value.style.chart.nodes.labels.fontSize,
2813
- fontWeight: R.value.style.chart.nodes.labels.bold ? "bold" : "normal",
2814
- fill: ($.value === t.id || un(t.id)) && R.value.style.chart.nodes.selected.labelColor != null ? R.value.style.chart.nodes.selected.labelColor : t.original.color,
2815
- x: t.x,
2816
- y: t.y,
2817
- autoOffset: !0
2818
- })
2819
- }, null, 8, br)) : y("", !0)], 64)), e.$slots["free-node-label"] ? (w(), b("g", xr, [E(e.$slots, "free-node-label", _e({ ref_for: !0 }, {
2820
- node: t,
2821
- layoutData: D(Y),
2822
- orientation: q.value
2823
- }), void 0, !0)])) : y("", !0)], 40, vr))), 128))]),
2824
- E(e.$slots, "svg", { svg: {
2825
- drawingArea: D(wt),
2826
- data: D(Y),
2827
- orientation: q.value,
2828
- isPrintingImg: D(ut) || D(J) || Be.value,
2829
- isPrintingSvg: Ve.value
2830
- } }, void 0, !0)
2831
- ], 46, er)) : y("", !0), e.$slots.hint ? (w(), b("div", Sr, [E(e.$slots, "hint", C(S({
2832
- hint: R.value.a11y.translations.keyboardNavigation,
2833
- isVisible: We.value
2834
- })), void 0, !0)])) : y("", !0)]),
2835
- e.$slots.watermark ? (w(), b("div", Cr, [E(e.$slots, "watermark", C(S({ isPrinting: D(ut) || D(J) || Be.value || Ve.value })), void 0, !0)])) : y("", !0),
2836
- he(fe, { name: "fade" }, {
2837
- default: O(() => [W.value ? (w(), v(de, {
2838
- key: 0,
2839
- to: Z.value ? M.value : "body"
2840
- }, [x("div", {
2841
- "data-cy-tooltip-midpoint": "",
2842
- ref_key: "tooltipRef",
2843
- ref: B,
2844
- class: "vue-ui-dag-tooltip",
2845
- style: be({
2846
- ...Ye.value,
2847
- maxWidth: R.value.style.chart.midpoints.tooltip.maxWidth,
2848
- "--vue-data-ui-dag-tooltip-background": R.value.style.chart.midpoints.tooltip.backgroundColor,
2849
- "--vue-data-ui-dag-tooltip-color": R.value.style.chart.midpoints.tooltip.color
2850
- }),
2851
- "data-position": Xe.value
2852
- }, [E(e.$slots, "tooltip-midpoint", C(S({
2853
- edge: z.value,
2854
- layoutData: D(Y)
2855
- })), () => [z.value ? (w(), b("div", Tr, we(X(z.value.from)?.label ?? z.value.from) + " → " + we(X(z.value.to)?.label ?? z.value.to), 1)) : y("", !0)], !0)], 12, wr)], 8, ["to"])) : y("", !0)]),
2856
- _: 3
2857
- }),
2858
- he(fe, { name: "fade" }, {
2859
- default: O(() => [V.value ? (w(), v(de, {
2860
- key: 0,
2861
- to: Z.value ? M.value : "body"
2862
- }, [x("div", {
2863
- "data-cy-tooltip-node": "",
2864
- ref_key: "nodeTooltipRef",
2865
- ref: U,
2866
- class: "vue-ui-dag-node-tooltip",
2867
- style: be({
2868
- maxWidth: R.value.style.chart.nodes.tooltip.maxWidth,
2869
- left: $e.value.left,
2870
- top: $e.value.top,
2871
- "--vue-data-ui-dag-node-tooltip-background": R.value.style.chart.nodes.tooltip.backgroundColor,
2872
- "--vue-data-ui-dag-node-tooltip-color": R.value.style.chart.nodes.tooltip.color
2873
- }),
2874
- "data-position": et.value
2875
- }, [E(e.$slots, "tooltip-node", C(S({
2876
- node: H.value,
2877
- layoutData: D(Y)
2878
- })), () => [H.value ? (w(), b("div", Dr, we(H.value.label), 1)) : y("", !0)], !0)], 12, Er)], 8, ["to"])) : y("", !0)]),
2879
- _: 3
2880
- }),
2881
- R.value.style.chart.controls.position === "bottom" && !D(at) && R.value.style.chart.controls.show ? (w(), v(ce, {
2882
- key: 7,
2883
- ref_key: "zoomControls",
2884
- ref: Fe,
2885
- config: R.value,
2886
- scale: D(Dt),
2887
- isFullscreen: Z.value,
2888
- withDirection: "",
2889
- onZoomIn: Pt,
2890
- onZoomOut: Ft,
2891
- onResetZoom: t[1] ||= () => D(Tt)(!0),
2892
- onSwitchDirection: Lt
2893
- }, null, 8, [
2894
- "config",
2895
- "scale",
2896
- "isFullscreen"
2897
- ])) : y("", !0),
2898
- e.$slots.source ? (w(), b("div", {
2899
- key: 8,
2900
- ref_key: "source",
2901
- ref: Pe,
2902
- dir: "auto"
2903
- }, [E(e.$slots, "source", {}, void 0, !0)], 512)) : y("", !0),
2904
- E(e.$slots, "skeleton", {}, () => [D(at) ? (w(), v(f, { key: 0 })) : y("", !0)], !0)
2905
- ], 46, Xn));
2906
- }
2907
- }, [["__scopeId", "data-v-3de9c8da"]]);
2908
- //#endregion
2909
- export { Yn as n, kr as t };