vue-data-ui 3.17.13 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/A11yDataTable-q2-8fSlJ.js +45 -0
- package/dist/Arrow-BU2Z7mfz.js +116 -0
- package/dist/BaseDraggableDialog-LE75fWYz.js +272 -0
- package/dist/BaseIcon-CL6Y7alf.js +499 -0
- package/dist/BaseLegendToggle-BvPOFMVZ.js +56 -0
- package/dist/BaseScanner-C7dmAref.js +27 -0
- package/dist/BaseZoomControls-DSwf4HhS.js +111 -0
- package/dist/ColorPicker-BGbMrtup.js +255 -0
- package/dist/DataTable-ZG4GX2Zg.js +150 -0
- package/dist/Legend-BPb8i4aC.js +114 -0
- package/dist/NonSvgPenAndPaper-BT3YMjgo.js +577 -0
- package/dist/PackageVersion-B1cPtZ3Q.js +11 -0
- package/dist/PenAndPaper-DxBCVZAx.js +461 -0
- package/dist/RecursiveCircles-DPpLel6f.js +117 -0
- package/dist/RecursiveLabels-DBMJf_to.js +56 -0
- package/dist/RecursiveLinks-D06dBL4a.js +78 -0
- package/dist/Shape-Dbug7CtK.js +141 -0
- package/dist/Slicer-SEdaKYPX.js +1144 -0
- package/dist/SlicerPreview-BLlQTUI_.js +1523 -0
- package/dist/SparkTooltip-BaONR2nq.js +93 -0
- package/dist/Title-ByyzJzpc.js +87 -0
- package/dist/Tooltip-V6Z0Ko-1.js +307 -0
- package/dist/UserOptions-Gaw1761w.js +1407 -0
- package/dist/_plugin-vue_export-helper-Dq1MygBL.js +8 -0
- package/dist/canvas-lib-DTaADQOK.js +79 -0
- package/dist/components/arrow.js +2 -5
- package/dist/components/vue-ui-3d-bar.js +2 -5
- package/dist/components/vue-ui-accordion.js +2 -5
- package/dist/components/vue-ui-age-pyramid.js +2 -5
- package/dist/components/vue-ui-annotator.js +2 -5
- package/dist/components/vue-ui-bullet.js +2 -5
- package/dist/components/vue-ui-bump.js +2 -5
- package/dist/components/vue-ui-candlestick.js +2 -5
- package/dist/components/vue-ui-carousel-table.js +2 -5
- package/dist/components/vue-ui-chestnut.js +2 -5
- package/dist/components/vue-ui-chord.js +2 -5
- package/dist/components/vue-ui-circle-pack.js +2 -5
- package/dist/components/vue-ui-cursor.js +2 -5
- package/dist/components/vue-ui-dag.js +2 -5
- package/dist/components/vue-ui-dashboard.js +2 -5
- package/dist/components/vue-ui-digits.js +2 -5
- package/dist/components/vue-ui-donut-evolution.js +2 -5
- package/dist/components/vue-ui-donut.js +2 -5
- package/dist/components/vue-ui-dumbbell.js +2 -5
- package/dist/components/vue-ui-flow.js +2 -5
- package/dist/components/vue-ui-funnel.js +2 -5
- package/dist/components/vue-ui-galaxy.js +2 -5
- package/dist/components/vue-ui-gauge.js +2 -5
- package/dist/components/vue-ui-geo.js +2 -5
- package/dist/components/vue-ui-gizmo.js +2 -5
- package/dist/components/vue-ui-heatmap.js +2 -5
- package/dist/components/vue-ui-history-plot.js +2 -5
- package/dist/components/vue-ui-horizontal-bar.js +2 -5
- package/dist/components/vue-ui-icon.js +2 -5
- package/dist/components/vue-ui-kpi.js +2 -5
- package/dist/components/vue-ui-mini-loader.js +2 -5
- package/dist/components/vue-ui-molecule.js +2 -5
- package/dist/components/vue-ui-mood-radar.js +2 -5
- package/dist/components/vue-ui-nested-donuts.js +2 -5
- package/dist/components/vue-ui-onion.js +2 -5
- package/dist/components/vue-ui-parallel-coordinate-plot.js +2 -5
- package/dist/components/vue-ui-pattern-seed.js +2 -5
- package/dist/components/vue-ui-pattern.js +2 -5
- package/dist/components/vue-ui-quadrant.js +2 -5
- package/dist/components/vue-ui-quick-chart.js +2 -5
- package/dist/components/vue-ui-radar.js +2 -5
- package/dist/components/vue-ui-rating.js +2 -5
- package/dist/components/vue-ui-relation-circle.js +2 -5
- package/dist/components/vue-ui-ridgeline.js +2 -5
- package/dist/components/vue-ui-rings.js +2 -5
- package/dist/components/vue-ui-scatter.js +2 -5
- package/dist/components/vue-ui-skeleton.js +2 -5
- package/dist/components/vue-ui-smiley.js +2 -5
- package/dist/components/vue-ui-spark-trend.js +2 -5
- package/dist/components/vue-ui-sparkbar.js +2 -5
- package/dist/components/vue-ui-sparkgauge.js +2 -5
- package/dist/components/vue-ui-sparkhistogram.js +2 -5
- package/dist/components/vue-ui-sparkline.js +2 -5
- package/dist/components/vue-ui-sparkstackbar.js +2 -5
- package/dist/components/vue-ui-stackbar.js +2 -5
- package/dist/components/vue-ui-stackline.js +2 -5
- package/dist/components/vue-ui-strip-plot.js +2 -5
- package/dist/components/vue-ui-table-heatmap.js +2 -5
- package/dist/components/vue-ui-table-sparkline.js +2 -5
- package/dist/components/vue-ui-table.js +2 -5
- package/dist/components/vue-ui-thermometer.js +2 -5
- package/dist/components/vue-ui-timer.js +2 -5
- package/dist/components/vue-ui-tiremarks.js +2 -5
- package/dist/components/vue-ui-treemap.js +2 -5
- package/dist/components/vue-ui-vertical-bar.js +2 -5
- package/dist/components/vue-ui-waffle.js +2 -5
- package/dist/components/vue-ui-wheel.js +2 -5
- package/dist/components/vue-ui-word-cloud.js +2 -5
- package/dist/components/vue-ui-world.js +2 -5
- package/dist/components/vue-ui-xy-canvas.js +2 -5
- package/dist/components/vue-ui-xy.js +2 -5
- package/dist/dom-to-png-C9UOX1d2.js +237 -0
- package/dist/exposedLib-BQjH823l.js +19 -0
- package/dist/geoProjections-CQIkC70z.js +146 -0
- package/dist/img-NMY-_LiJ.js +74 -0
- package/dist/labelUtils-BiSegLOT.js +19 -0
- package/dist/lib-B83ZCydz.js +1879 -0
- package/dist/patternUtils-B7BWu5bV.js +258 -0
- package/dist/pdf-Ey2KFETK.js +90 -0
- package/dist/rolldown-runtime-CAFD8bLK.js +11 -0
- package/dist/style.css +2 -1
- package/dist/types/arrow.d.ts +1 -1
- package/dist/types/utils.d.ts +23 -0
- package/dist/types/vue-data-ui.d.ts +4766 -630
- package/dist/types/vue-ui-3d-bar.d.ts +64 -9
- package/dist/types/vue-ui-accordion.d.ts +4 -3
- package/dist/types/vue-ui-age-pyramid.d.ts +79 -9
- package/dist/types/vue-ui-annotator.d.ts +3 -5
- package/dist/types/vue-ui-bullet.d.ts +60 -9
- package/dist/types/vue-ui-bump.d.ts +65 -9
- package/dist/types/vue-ui-candlestick.d.ts +83 -9
- package/dist/types/vue-ui-carousel-table.d.ts +36 -6
- package/dist/types/vue-ui-chestnut.d.ts +66 -9
- package/dist/types/vue-ui-chord.d.ts +78 -9
- package/dist/types/vue-ui-circle-pack.d.ts +86 -9
- package/dist/types/vue-ui-cursor.d.ts +4 -2
- package/dist/types/vue-ui-dag.d.ts +92 -9
- package/dist/types/vue-ui-dashboard.d.ts +43 -6
- package/dist/types/vue-ui-digits.d.ts +4 -2
- package/dist/types/vue-ui-donut-evolution.d.ts +70 -9
- package/dist/types/vue-ui-donut.d.ts +92 -9
- package/dist/types/vue-ui-dumbbell.d.ts +65 -9
- package/dist/types/vue-ui-flow.d.ts +79 -9
- package/dist/types/vue-ui-funnel.d.ts +55 -9
- package/dist/types/vue-ui-galaxy.d.ts +83 -9
- package/dist/types/vue-ui-gauge.d.ts +64 -9
- package/dist/types/vue-ui-geo.d.ts +71 -9
- package/dist/types/vue-ui-gizmo.d.ts +17 -6
- package/dist/types/vue-ui-heatmap.d.ts +73 -9
- package/dist/types/vue-ui-history-plot.d.ts +82 -9
- package/dist/types/vue-ui-horizontal-bar.d.ts +84 -9
- package/dist/types/vue-ui-icon.d.ts +2 -2
- package/dist/types/vue-ui-kpi.d.ts +21 -7
- package/dist/types/vue-ui-mini-loader.d.ts +5 -3
- package/dist/types/vue-ui-molecule.d.ts +86 -9
- package/dist/types/vue-ui-mood-radar.d.ts +66 -9
- package/dist/types/vue-ui-nested-donuts.d.ts +80 -9
- package/dist/types/vue-ui-onion.d.ts +77 -9
- package/dist/types/vue-ui-parallel-coordinate-plot.d.ts +92 -9
- package/dist/types/vue-ui-pattern-seed.d.ts +1 -1
- package/dist/types/vue-ui-pattern.d.ts +2 -2
- package/dist/types/vue-ui-quadrant.d.ts +86 -9
- package/dist/types/vue-ui-quick-chart.d.ts +79 -9
- package/dist/types/vue-ui-radar.d.ts +83 -9
- package/dist/types/vue-ui-rating.d.ts +22 -6
- package/dist/types/vue-ui-relation-circle.d.ts +66 -9
- package/dist/types/vue-ui-ridgeline.d.ts +69 -9
- package/dist/types/vue-ui-rings.d.ts +70 -9
- package/dist/types/vue-ui-scatter.d.ts +67 -9
- package/dist/types/vue-ui-skeleton.d.ts +3 -2
- package/dist/types/vue-ui-smiley.d.ts +3 -2
- package/dist/types/vue-ui-spark-trend.d.ts +14 -6
- package/dist/types/vue-ui-sparkbar.d.ts +27 -6
- package/dist/types/vue-ui-sparkgauge.d.ts +20 -6
- package/dist/types/vue-ui-sparkhistogram.d.ts +24 -6
- package/dist/types/vue-ui-sparkline.d.ts +35 -6
- package/dist/types/vue-ui-sparkstackbar.d.ts +35 -6
- package/dist/types/vue-ui-stackbar.d.ts +85 -9
- package/dist/types/vue-ui-stackline.d.ts +81 -9
- package/dist/types/vue-ui-strip-plot.d.ts +66 -9
- package/dist/types/vue-ui-table-heatmap.d.ts +52 -6
- package/dist/types/vue-ui-table-sparkline.d.ts +30 -6
- package/dist/types/vue-ui-table.d.ts +10 -2
- package/dist/types/vue-ui-thermometer.d.ts +46 -9
- package/dist/types/vue-ui-timer.d.ts +31 -5
- package/dist/types/vue-ui-tiremarks.d.ts +46 -9
- package/dist/types/vue-ui-treemap.d.ts +73 -9
- package/dist/types/vue-ui-vertical-bar.d.ts +2 -2
- package/dist/types/vue-ui-waffle.d.ts +72 -9
- package/dist/types/vue-ui-wheel.d.ts +46 -9
- package/dist/types/vue-ui-word-cloud.d.ts +73 -9
- package/dist/types/vue-ui-world.d.ts +68 -9
- package/dist/types/vue-ui-xy-canvas.d.ts +75 -9
- package/dist/types/vue-ui-xy.d.ts +108 -10
- package/dist/useAutoSizeLabelsInsideViewbox-De0rTecW.js +50 -0
- package/dist/useChartAccessibility-Do37qcw2.js +12 -0
- package/dist/useConfig-KnOLHtlJ.js +7419 -0
- package/dist/useFitSvgText-C-MEdAfe.js +63 -0
- package/dist/useNestedProp-CcxL1gUU.js +10 -0
- package/dist/useObjectBindings-Dc8Rf6Qy.js +189 -0
- package/dist/usePanZoom-B-4M_gmY.js +157 -0
- package/dist/usePrefersMotion-BywLbIko.js +15 -0
- package/dist/usePrinter-CMLF900n.js +49 -0
- package/dist/useResponsive-CrAInupd.js +19 -0
- package/dist/useStableElementSize-0I1IpHPl.js +77 -0
- package/dist/useSvgExport-Dtu973wa.js +755 -0
- package/dist/useTableResponsive-DrM1xqII.js +24 -0
- package/dist/useThemeCheck-rFK9Zlb_.js +24 -0
- package/dist/useTimeLabelCollider-Dm55Emzg.js +57 -0
- package/dist/useTimeLabels-C0x7zUXP.js +272 -0
- package/dist/useUserOptionState-CjPJPTg2.js +15 -0
- package/dist/utils.js +27 -44
- package/dist/vClickOutside-CbX_bC9A.js +13 -0
- package/dist/vue-data-ui-D1REqS_k.js +274 -0
- package/dist/vue-data-ui.js +76 -167
- package/dist/vue-ui-3d-bar-vO_kSCd6.js +1747 -0
- package/dist/vue-ui-accordion-Cf-jZELj.js +81 -0
- package/dist/vue-ui-age-pyramid-DHXhrP_3.js +1226 -0
- package/dist/vue-ui-annotator-B0o6czmF.js +2899 -0
- package/dist/vue-ui-bullet-C93-cf0H.js +700 -0
- package/dist/vue-ui-bump-C_Szk9AZ.js +1239 -0
- package/dist/vue-ui-candlestick-6JdMEJKO.js +1802 -0
- package/dist/vue-ui-carousel-table-CZ_HK0Iw.js +445 -0
- package/dist/vue-ui-chestnut-B8ixU585.js +2000 -0
- package/dist/vue-ui-chord-DC5sLapz.js +1381 -0
- package/dist/vue-ui-circle-pack-CsmSEwt3.js +1183 -0
- package/dist/vue-ui-cursor-B-QODIL3.js +283 -0
- package/dist/vue-ui-dag-C9LYfjS_.js +2899 -0
- package/dist/vue-ui-dashboard-D-f4ZaLi.js +503 -0
- package/dist/vue-ui-digits-CcB3odN7.js +209 -0
- package/dist/vue-ui-donut-DR0ngnZC.js +2396 -0
- package/dist/vue-ui-donut-evolution-BXpOscCe.js +1490 -0
- package/dist/vue-ui-dumbbell-CB_clJWA.js +1517 -0
- package/dist/vue-ui-flow-CUiOAEy1.js +1223 -0
- package/dist/vue-ui-funnel-BAlGDK0o.js +767 -0
- package/dist/vue-ui-galaxy-DbYNfSHb.js +1062 -0
- package/dist/vue-ui-gauge-Cie7jykM.js +910 -0
- package/dist/vue-ui-geo-Ce_gBRye.js +1504 -0
- package/dist/vue-ui-gizmo-B9POi_SN.js +225 -0
- package/dist/vue-ui-heatmap-DFfRSbnk.js +1556 -0
- package/dist/vue-ui-history-plot-DHp5WFgx.js +1551 -0
- package/dist/vue-ui-horizontal-bar-DI4yoARv.js +1669 -0
- package/dist/vue-ui-kpi-oUfso4UP.js +96 -0
- package/dist/vue-ui-mini-loader-aZMi1_uX.js +125 -0
- package/dist/vue-ui-molecule-D72kzel_.js +912 -0
- package/dist/vue-ui-mood-radar-Tw2ZFP7Y.js +1138 -0
- package/dist/vue-ui-nested-donuts-Bza1LczX.js +1472 -0
- package/dist/vue-ui-onion-BOuuib5d.js +1188 -0
- package/dist/vue-ui-parallel-coordinate-plot-BuQUq6-o.js +1413 -0
- package/dist/vue-ui-pattern-Bj-IPFr2.js +154 -0
- package/dist/vue-ui-pattern-seed-abRweCDE.js +61 -0
- package/dist/vue-ui-quadrant-zNFIXNt9.js +1966 -0
- package/dist/vue-ui-quick-chart-B1a8QVUn.js +2459 -0
- package/dist/vue-ui-radar-VFn-YP_2.js +1214 -0
- package/dist/vue-ui-rating-Dxgn21FA.js +343 -0
- package/dist/vue-ui-relation-circle-B0sZaCgX.js +914 -0
- package/dist/vue-ui-ridgeline-BsBAbg5V.js +1612 -0
- package/dist/vue-ui-rings-CDwUzMF-.js +1231 -0
- package/dist/vue-ui-scatter-Du_b-zM8.js +2380 -0
- package/dist/vue-ui-skeleton-BAq6J_6G.js +2556 -0
- package/dist/vue-ui-smiley-CoHvkS0c.js +356 -0
- package/dist/vue-ui-spark-trend-BmCcJ17C.js +438 -0
- package/dist/vue-ui-sparkbar-9z05IMx8.js +393 -0
- package/dist/vue-ui-sparkgauge-BlWri9DP.js +255 -0
- package/dist/vue-ui-sparkhistogram-CHZTt8d8.js +560 -0
- package/dist/vue-ui-sparkline-DirLW9Nd.js +1503 -0
- package/dist/vue-ui-sparkstackbar-Dk6cEI2o.js +660 -0
- package/dist/vue-ui-stackbar-DNIrGHkt.js +2235 -0
- package/dist/vue-ui-stackline-HoWn_ur2.js +2362 -0
- package/dist/vue-ui-strip-plot-Bi8u_fLr.js +1328 -0
- package/dist/vue-ui-table-XLjOOfdI.js +1338 -0
- package/dist/vue-ui-table-heatmap-DvnFiveI.js +334 -0
- package/dist/vue-ui-table-sparkline-CSZf8XxP.js +697 -0
- package/dist/vue-ui-thermometer-7eUO_7CP.js +753 -0
- package/dist/vue-ui-timer-DCbxsREb.js +439 -0
- package/dist/vue-ui-tiremarks-p_sfTufv.js +542 -0
- package/dist/vue-ui-treemap-BdZOW7TM.js +1575 -0
- package/dist/vue-ui-waffle-Bf9dWWCM.js +1350 -0
- package/dist/vue-ui-wheel-CZrIiB0K.js +875 -0
- package/dist/vue-ui-word-cloud-BeLjxoRe.js +1644 -0
- package/dist/vue-ui-world-D9ahzEQ2.js +14252 -0
- package/dist/vue-ui-xy-DrvbVuHO.js +4063 -0
- package/dist/vue-ui-xy-canvas-DU7vFrQr.js +1774 -0
- package/dist/vue_ui_3d_bar-CXKqO5Ej.js +185 -0
- package/dist/vue_ui_age_pyramid-BON8QI6X.js +301 -0
- package/dist/vue_ui_bullet-CE5sFT7u.js +186 -0
- package/dist/vue_ui_bump-frnXaXul.js +201 -0
- package/dist/vue_ui_candlestick-sY6UtOop.js +374 -0
- package/dist/vue_ui_chestnut-BiUZFv40.js +305 -0
- package/dist/vue_ui_chord-DpyR_b9A.js +275 -0
- package/dist/vue_ui_circle_pack-DBKz_Fi_.js +130 -0
- package/dist/vue_ui_dag-Ci_MOnvd.js +258 -0
- package/dist/vue_ui_donut-Cx2_BGcQ.js +358 -0
- package/dist/vue_ui_donut_evolution-CAJefrHs.js +717 -0
- package/dist/vue_ui_dumbbell-CClzAZTN.js +304 -0
- package/dist/vue_ui_flow-CCHO1Lo9.js +238 -0
- package/dist/vue_ui_funnel-h8q2mRpC.js +234 -0
- package/dist/vue_ui_galaxy-70vtkEBw.js +265 -0
- package/dist/vue_ui_gauge-C17CgfzN.js +178 -0
- package/dist/vue_ui_geo-C0UbQ0Lc.js +248 -0
- package/dist/vue_ui_heatmap-BqPP3J4M.js +319 -0
- package/dist/vue_ui_history_plot-C5nytDHh.js +413 -0
- package/dist/vue_ui_horizontal_bar-Bqxorkc_.js +341 -0
- package/dist/vue_ui_molecule-Dka4JBOp.js +231 -0
- package/dist/vue_ui_mood_radar-Dg4ijm53.js +281 -0
- package/dist/vue_ui_nested_donuts-BY9cOoHF.js +273 -0
- package/dist/vue_ui_onion-DTV9cup-.js +293 -0
- package/dist/vue_ui_parallel_coordinate_plot-CNWrDh96.js +278 -0
- package/dist/vue_ui_quadrant-3kjYvxpj.js +428 -0
- package/dist/vue_ui_quick_chart--VaYQuM4.js +139 -0
- package/dist/vue_ui_radar-Dxx9GJmj.js +306 -0
- package/dist/vue_ui_relation_circle-Cr0I2SoU.js +98 -0
- package/dist/vue_ui_ridgeline-CAtYca4b.js +767 -0
- package/dist/vue_ui_rings-DXC1VeX5.js +320 -0
- package/dist/vue_ui_scatter-D2S2j0ap.js +479 -0
- package/dist/vue_ui_spark_trend-BHMQ6_1p.js +82 -0
- package/dist/vue_ui_sparkbar-BR6hbuDE.js +64 -0
- package/dist/vue_ui_sparkgauge-xfPRHnMv.js +90 -0
- package/dist/vue_ui_sparkhistogram-CJRENZ1C.js +123 -0
- package/dist/vue_ui_sparkline-wgk7yO7E.js +151 -0
- package/dist/vue_ui_sparkstackbar-C5qZMmAl.js +175 -0
- package/dist/vue_ui_stackbar-BW_C3MXw.js +412 -0
- package/dist/vue_ui_stackline-DpI2LnjO.js +426 -0
- package/dist/vue_ui_strip_plot-8ZelqC5b.js +301 -0
- package/dist/vue_ui_table_heatmap-BGUjA0WA.js +80 -0
- package/dist/vue_ui_table_sparkline-i0Q-N_we.js +124 -0
- package/dist/vue_ui_thermometer-CuN7Gpez.js +123 -0
- package/dist/vue_ui_tiremarks-A6UHC0c3.js +122 -0
- package/dist/vue_ui_treemap-BQp06q-g.js +328 -0
- package/dist/vue_ui_vertical_bar-CJSD1FZS.js +247 -0
- package/dist/vue_ui_waffle-C_Ev4l7B.js +292 -0
- package/dist/vue_ui_wheel-DdkTPXJU.js +133 -0
- package/dist/vue_ui_word_cloud-B1PbsYPc.js +254 -0
- package/dist/vue_ui_xy-BYPqfYyx.js +482 -0
- package/dist/vue_ui_xy_canvas-CMHGNrLf.js +408 -0
- package/package.json +7 -7
- package/dist/A11yDataTable-BpmuNomI.js +0 -54
- package/dist/Arrow-dSvLFssU.js +0 -101
- package/dist/BaseDraggableDialog-Di8Hlru3.js +0 -249
- package/dist/BaseIcon-DX0hTWa-.js +0 -476
- package/dist/BaseLegendToggle-cMP8M2u0.js +0 -47
- package/dist/BaseScanner-C2j3TsSY.js +0 -36
- package/dist/BaseZoomControls-CVSC1-SU.js +0 -123
- package/dist/ColorPicker-bAxGcXK0.js +0 -271
- package/dist/DataTable-cMnb68Ik.js +0 -145
- package/dist/Legend-DGN5lY60.js +0 -104
- package/dist/NonSvgPenAndPaper-B6E0zEYe.js +0 -573
- package/dist/PackageVersion-BfrCAH6_.js +0 -10
- package/dist/PenAndPaper-CJDoB5H9.js +0 -527
- package/dist/RecursiveCircles-BE6GoMmo.js +0 -101
- package/dist/RecursiveLabels-BhQMS9Sm.js +0 -55
- package/dist/RecursiveLinks-BDwyYfP-.js +0 -83
- package/dist/Shape-CxJ5_Rre.js +0 -116
- package/dist/Slicer-D7UcO8sN.js +0 -1145
- package/dist/SlicerPreview-D_CgrN_7.js +0 -1580
- package/dist/SparkTooltip-D4bM-kfz.js +0 -68
- package/dist/Title-BbKoiBk2.js +0 -88
- package/dist/Tooltip-Cvt7Fi0Q.js +0 -299
- package/dist/UserOptions-DVduN6X7.js +0 -1474
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/dom-to-png-DGvx6i5V.js +0 -262
- package/dist/exposedLib-sJvY1pST.js +0 -22
- package/dist/geoProjections-BFq2sOBY.js +0 -162
- package/dist/img-CjTQXS0U.js +0 -57
- package/dist/labelUtils-DX9oyq3C.js +0 -26
- package/dist/lib-DMzrGQHK.js +0 -2477
- package/dist/patternUtils-BINhU4Ky.js +0 -615
- package/dist/pdf-C4H4o1Cj.js +0 -88
- package/dist/useAutoSizeLabelsInsideViewbox-izlGDfwu.js +0 -55
- package/dist/useChartAccessibility-cp6XQtqi.js +0 -15
- package/dist/useConfig-CG4HT3wS.js +0 -7901
- package/dist/useFitSvgText-2crs6Fv5.js +0 -69
- package/dist/useNestedProp-DH0BEVVS.js +0 -13
- package/dist/useObjectBindings-Dixg-RIe.js +0 -228
- package/dist/usePanZoom-BbDhcKWf.js +0 -141
- package/dist/usePrefersMotion-Co0nj1eS.js +0 -17
- package/dist/usePrinter-C4t8DdQ-.js +0 -51
- package/dist/useResponsive-DfdjqQps.js +0 -195
- package/dist/useStableElementSize-C48ZVcZQ.js +0 -77
- package/dist/useSvgExport-BTG4hVPO.js +0 -870
- package/dist/useTableResponsive-BpfiEtzR.js +0 -26
- package/dist/useThemeCheck-C9Ccl7U9.js +0 -36
- package/dist/useTimeLabelCollider-D3JeJ6Ye.js +0 -86
- package/dist/useTimeLabels-Cv0tD9In.js +0 -307
- package/dist/useUserOptionState-B7Ej974k.js +0 -19
- package/dist/vClickOutside-C6WiFswA.js +0 -13
- package/dist/vue-data-ui-D1ZI7Y4l.js +0 -433
- package/dist/vue-ui-3d-bar-DEjKYzI5.js +0 -1824
- package/dist/vue-ui-accordion-DFtpH_16.js +0 -92
- package/dist/vue-ui-age-pyramid-LiC9hTjP.js +0 -1179
- package/dist/vue-ui-annotator-DrKnQoHf.js +0 -2991
- package/dist/vue-ui-bullet-DdxEINdq.js +0 -769
- package/dist/vue-ui-bump-CdgO1V7z.js +0 -1250
- package/dist/vue-ui-candlestick-DxJnPwto.js +0 -1775
- package/dist/vue-ui-carousel-table-CMefu5TI.js +0 -487
- package/dist/vue-ui-chestnut-BnGN72PO.js +0 -2001
- package/dist/vue-ui-chord-DWyar45U.js +0 -1457
- package/dist/vue-ui-circle-pack-CQ8vF2XH.js +0 -1076
- package/dist/vue-ui-cursor-HHOdkmyB.js +0 -260
- package/dist/vue-ui-dag-BDWPBElq.js +0 -3209
- package/dist/vue-ui-dashboard-Dg_I3X2a.js +0 -627
- package/dist/vue-ui-digits-CZmdir8V.js +0 -211
- package/dist/vue-ui-donut-BKegKHxj.js +0 -2608
- package/dist/vue-ui-donut-evolution-047dE4Lu.js +0 -1578
- package/dist/vue-ui-dumbbell-BL4ZMChj.js +0 -1552
- package/dist/vue-ui-flow-BAqtyunQ.js +0 -1279
- package/dist/vue-ui-funnel-Pl2sEOZs.js +0 -823
- package/dist/vue-ui-galaxy-CBF5Wsax.js +0 -1108
- package/dist/vue-ui-gauge-COV_S0Vp.js +0 -955
- package/dist/vue-ui-geo-CaPXElPf.js +0 -1510
- package/dist/vue-ui-gizmo-Csn7up96.js +0 -238
- package/dist/vue-ui-heatmap-Cpb0BYLa.js +0 -1694
- package/dist/vue-ui-history-plot-ZZEdzFCE.js +0 -1564
- package/dist/vue-ui-horizontal-bar-BonPYUZf.js +0 -1735
- package/dist/vue-ui-kpi-DoHhSsDK.js +0 -130
- package/dist/vue-ui-mini-loader-DOTBVCLE.js +0 -138
- package/dist/vue-ui-molecule-mVYnXouV.js +0 -945
- package/dist/vue-ui-mood-radar-DPvwnc3z.js +0 -1197
- package/dist/vue-ui-nested-donuts-C7E6TXrZ.js +0 -1702
- package/dist/vue-ui-onion-BGIlFhGB.js +0 -1207
- package/dist/vue-ui-parallel-coordinate-plot-C6G_A9ua.js +0 -1432
- package/dist/vue-ui-pattern-mXZW_pvA.js +0 -146
- package/dist/vue-ui-pattern-seed-BcNlxb2i.js +0 -36
- package/dist/vue-ui-quadrant-CVpIeYOB.js +0 -1918
- package/dist/vue-ui-quick-chart-CcV8qn9-.js +0 -2514
- package/dist/vue-ui-radar-G4AV1rBo.js +0 -1259
- package/dist/vue-ui-rating-CqPlP88P.js +0 -370
- package/dist/vue-ui-relation-circle-CkZ8oFVV.js +0 -856
- package/dist/vue-ui-ridgeline-CBTyYn6Q.js +0 -1737
- package/dist/vue-ui-rings-CSIOqFiP.js +0 -1256
- package/dist/vue-ui-scatter-AuC46ufT.js +0 -2345
- package/dist/vue-ui-skeleton-YD6rZjY_.js +0 -2475
- package/dist/vue-ui-smiley-CY0WFv2j.js +0 -391
- package/dist/vue-ui-spark-trend-D8KGIt-R.js +0 -423
- package/dist/vue-ui-sparkbar-BjWGJjzN.js +0 -424
- package/dist/vue-ui-sparkgauge-Dab5mss7.js +0 -285
- package/dist/vue-ui-sparkhistogram-D0rsmiPh.js +0 -559
- package/dist/vue-ui-sparkline-BCaauQuX.js +0 -1550
- package/dist/vue-ui-sparkstackbar-NT5yD6xA.js +0 -672
- package/dist/vue-ui-stackbar-ChBk_A1c.js +0 -2393
- package/dist/vue-ui-stackline-Cujamlze.js +0 -2490
- package/dist/vue-ui-strip-plot-CGBumG6I.js +0 -1293
- package/dist/vue-ui-table-BX2iMku4.js +0 -1726
- package/dist/vue-ui-table-heatmap-KXgXYVXm.js +0 -353
- package/dist/vue-ui-table-sparkline-C3NWnry0.js +0 -803
- package/dist/vue-ui-thermometer-DvdceZB1.js +0 -743
- package/dist/vue-ui-timer-XWAbvuAY.js +0 -504
- package/dist/vue-ui-tiremarks-B-YI1RlT.js +0 -578
- package/dist/vue-ui-treemap-AzorGfmd.js +0 -1757
- package/dist/vue-ui-waffle-CKtUvdTE.js +0 -1442
- package/dist/vue-ui-wheel-CnsLEArZ.js +0 -908
- package/dist/vue-ui-word-cloud-iAme2ihe.js +0 -1644
- package/dist/vue-ui-world-D5rrC9rw.js +0 -14452
- package/dist/vue-ui-xy-C_Q9chQe.js +0 -4468
- package/dist/vue-ui-xy-canvas-DG0299qE.js +0 -2107
- package/dist/vue_ui_3d_bar-CL0iX8Qi.js +0 -22
- package/dist/vue_ui_age_pyramid-8H8WSL7J.js +0 -22
- package/dist/vue_ui_bullet-Ckqieba5.js +0 -22
- package/dist/vue_ui_bump-CIht647H.js +0 -22
- package/dist/vue_ui_candlestick-BAMn-VGw.js +0 -22
- package/dist/vue_ui_chestnut-BloFvDuV.js +0 -22
- package/dist/vue_ui_chord-Bc1_ocwK.js +0 -22
- package/dist/vue_ui_circle_pack-CLmw8nHe.js +0 -22
- package/dist/vue_ui_dag-ZOwuDBZ8.js +0 -22
- package/dist/vue_ui_donut-CA4dgV8J.js +0 -22
- package/dist/vue_ui_donut_evolution-DFQU-rqE.js +0 -22
- package/dist/vue_ui_dumbbell-BCOHDiPk.js +0 -22
- package/dist/vue_ui_flow-BErINgox.js +0 -22
- package/dist/vue_ui_funnel-yuaMZ-yb.js +0 -22
- package/dist/vue_ui_galaxy-D95AN4FT.js +0 -22
- package/dist/vue_ui_gauge-BMEuRC4J.js +0 -22
- package/dist/vue_ui_geo--kg4VoVX.js +0 -22
- package/dist/vue_ui_heatmap-C9u993qE.js +0 -22
- package/dist/vue_ui_history_plot-BCKk1CrQ.js +0 -22
- package/dist/vue_ui_horizontal_bar-BEagrV0T.js +0 -22
- package/dist/vue_ui_molecule-BtvlINUh.js +0 -22
- package/dist/vue_ui_mood_radar-BUs6Fdn8.js +0 -22
- package/dist/vue_ui_nested_donuts-DvTrWT_C.js +0 -22
- package/dist/vue_ui_onion-CxWH9_OZ.js +0 -22
- package/dist/vue_ui_parallel_coordinate_plot-DH3cFJ3n.js +0 -22
- package/dist/vue_ui_quadrant-DjRs--Uz.js +0 -22
- package/dist/vue_ui_quick_chart-DMCjEjPe.js +0 -22
- package/dist/vue_ui_radar-DryGBOrz.js +0 -22
- package/dist/vue_ui_relation_circle-CCroen7h.js +0 -22
- package/dist/vue_ui_ridgeline-j4rVmpEp.js +0 -22
- package/dist/vue_ui_rings-CxOrekqA.js +0 -22
- package/dist/vue_ui_scatter-Bu1EAy9H.js +0 -22
- package/dist/vue_ui_spark_trend-3BjrSprO.js +0 -22
- package/dist/vue_ui_sparkbar-BsMzz5Um.js +0 -22
- package/dist/vue_ui_sparkgauge-KnjASOZs.js +0 -22
- package/dist/vue_ui_sparkhistogram-GBdzIVvS.js +0 -22
- package/dist/vue_ui_sparkline-CQ8DJVJx.js +0 -22
- package/dist/vue_ui_sparkstackbar-BSexvOuM.js +0 -22
- package/dist/vue_ui_stackbar-CuDC4O4b.js +0 -22
- package/dist/vue_ui_stackline-QTh-nuxE.js +0 -22
- package/dist/vue_ui_strip_plot-B9ypi_F3.js +0 -22
- package/dist/vue_ui_table_heatmap-CkvipPVy.js +0 -16
- package/dist/vue_ui_table_sparkline-yQdijcyJ.js +0 -22
- package/dist/vue_ui_thermometer-BTmjRBH8.js +0 -22
- package/dist/vue_ui_tiremarks-DBotWfi8.js +0 -22
- package/dist/vue_ui_treemap-D9-AIkT-.js +0 -22
- package/dist/vue_ui_vertical_bar-CELc39b8.js +0 -18
- package/dist/vue_ui_waffle-M2h-uJQ_.js +0 -22
- package/dist/vue_ui_wheel-LqBz3lv4.js +0 -22
- package/dist/vue_ui_word_cloud-mKAtBxHR.js +0 -22
- package/dist/vue_ui_xy-esktmpg-.js +0 -22
- package/dist/vue_ui_xy_canvas-6BBDSowT.js +0 -22
|
@@ -0,0 +1,2899 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
|
|
2
|
+
import { H as t, St as n, V as r, X as i, lt as a, t as o, y as s, zt as c } from "./lib-B83ZCydz.js";
|
|
3
|
+
import { t as l } from "./useConfig-KnOLHtlJ.js";
|
|
4
|
+
import { t as u } from "./usePrinter-CMLF900n.js";
|
|
5
|
+
import { n as d, t as f } from "./BaseScanner-C7dmAref.js";
|
|
6
|
+
import { t as p } from "./useSvgExport-Dtu973wa.js";
|
|
7
|
+
import { t as m } from "./useNestedProp-CcxL1gUU.js";
|
|
8
|
+
import { t as h } from "./useThemeCheck-rFK9Zlb_.js";
|
|
9
|
+
import { t as g } from "./img-NMY-_LiJ.js";
|
|
10
|
+
import { n as ee } from "./Title-ByyzJzpc.js";
|
|
11
|
+
import { t as te } from "./_plugin-vue_export-helper-Dq1MygBL.js";
|
|
12
|
+
import { c as ne } from "./canvas-lib-DTaADQOK.js";
|
|
13
|
+
import { t as re } from "./useResponsive-CrAInupd.js";
|
|
14
|
+
import { t as ie } from "./A11yDataTable-q2-8fSlJ.js";
|
|
15
|
+
import { t as ae } from "./useUserOptionState-CjPJPTg2.js";
|
|
16
|
+
import { t as oe } from "./useChartAccessibility-Do37qcw2.js";
|
|
17
|
+
import { t as se } from "./usePanZoom-B-4M_gmY.js";
|
|
18
|
+
import { t as ce } from "./BaseZoomControls-DSwf4HhS.js";
|
|
19
|
+
import { t as le } from "./vue_ui_dag-Ci_MOnvd.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: n, edges: r, configuration: i } = e, o = T(null), s = T(null), c = `dag-arrow-${t()}`;
|
|
1604
|
+
function l(e, n, r) {
|
|
1605
|
+
s.value = null, o.value = null;
|
|
1606
|
+
let i = {
|
|
1607
|
+
...Gn,
|
|
1608
|
+
...r
|
|
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
|
+
}), n.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 r = l.edge(e), a = r.points || [];
|
|
1645
|
+
if (!a.length) return null;
|
|
1646
|
+
let o = i.curvedEdges ? qn(a) : Kn(a), s = i.arrowShape === "undirected" ? null : `url(#${c})`, u = n.find((t) => t?.from === e.v && t?.to === e.w);
|
|
1647
|
+
return {
|
|
1648
|
+
id: `${e.v}->${e.w}->${t()}`,
|
|
1649
|
+
from: e.v,
|
|
1650
|
+
to: e.w,
|
|
1651
|
+
points: a,
|
|
1652
|
+
pathData: o,
|
|
1653
|
+
markerEnd: s,
|
|
1654
|
+
original: {
|
|
1655
|
+
...u,
|
|
1656
|
+
...r
|
|
1657
|
+
}
|
|
1658
|
+
};
|
|
1659
|
+
}).filter(Boolean), f = i.padding;
|
|
1660
|
+
if (!u.length) {
|
|
1661
|
+
o.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
|
+
o.value = {
|
|
1672
|
+
nodes: u,
|
|
1673
|
+
edges: d.map((e) => ({
|
|
1674
|
+
...e,
|
|
1675
|
+
midpoint: e.pathData ? a(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(n) || [], D(r) || [], D(i) || {});
|
|
1688
|
+
} catch (e) {
|
|
1689
|
+
console.error("[useDag] layout error:", e), s.value = e, o.value = null;
|
|
1690
|
+
}
|
|
1691
|
+
}), {
|
|
1692
|
+
layoutData: o,
|
|
1693
|
+
lastError: s,
|
|
1694
|
+
arrowMarkerIdentifier: c,
|
|
1695
|
+
recomputeLayout: () => {
|
|
1696
|
+
l(D(n) || [], D(r) || [], 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: a, emit: te }) {
|
|
1812
|
+
let De = ge(() => import("./PenAndPaper-DxBCVZAx.js").then((e) => e.t)), ke = ge(() => import("./UserOptions-Gaw1761w.js").then((e) => e.n)), Ae = ge(() => import("./PackageVersion-B1cPtZ3Q.js").then((e) => e.t)), { vue_ui_dag: je } = l(), { isThemeValid: k, warnInvalidTheme: Me } = h(), A = e, j = te, M = T(null), N = T(t()), 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 = _(() => c({
|
|
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: c({
|
|
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) && (i({
|
|
1895
|
+
componentName: "VueUiDag",
|
|
1896
|
+
type: "dataset",
|
|
1897
|
+
debug: lt.value
|
|
1898
|
+
}), ze.value = !1, st.value = !0), A.dataset.nodes || (i({
|
|
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 ? s(e.backgroundColor) : R.value.style.chart.nodes.backgroundColor,
|
|
1966
|
+
color: e.color ? s(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 a({
|
|
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
|
+
]), 1032, [
|
|
2582
|
+
"backgroundColor",
|
|
2583
|
+
"color",
|
|
2584
|
+
"isPrinting",
|
|
2585
|
+
"isImaging",
|
|
2586
|
+
"uid",
|
|
2587
|
+
"hasPdf",
|
|
2588
|
+
"hasImg",
|
|
2589
|
+
"hasSvg",
|
|
2590
|
+
"hasFullscreen",
|
|
2591
|
+
"hasAltCopy",
|
|
2592
|
+
"isFullscreen",
|
|
2593
|
+
"chartElement",
|
|
2594
|
+
"position",
|
|
2595
|
+
"titles",
|
|
2596
|
+
"hasAnnotator",
|
|
2597
|
+
"isAnnotation",
|
|
2598
|
+
"callbacks",
|
|
2599
|
+
"printScale",
|
|
2600
|
+
"hasZoom",
|
|
2601
|
+
"isZoom",
|
|
2602
|
+
"isCursorPointer",
|
|
2603
|
+
"onGeneratePdf",
|
|
2604
|
+
"style"
|
|
2605
|
+
])) : y("", !0),
|
|
2606
|
+
R.value.style.chart.title.text ? (w(), b("div", {
|
|
2607
|
+
key: 4,
|
|
2608
|
+
ref_key: "chartTitle",
|
|
2609
|
+
ref: Ne,
|
|
2610
|
+
style: "width:100%;background:transparent;"
|
|
2611
|
+
}, [(w(), v(ee, {
|
|
2612
|
+
key: `title_${Ie.value}`,
|
|
2613
|
+
config: {
|
|
2614
|
+
title: {
|
|
2615
|
+
cy: "dag-title",
|
|
2616
|
+
...R.value.style.chart.title
|
|
2617
|
+
},
|
|
2618
|
+
subtitle: {
|
|
2619
|
+
cy: "dag-subtitle",
|
|
2620
|
+
...R.value.style.chart.title.subtitle
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
}, null, 8, ["config"]))], 512)) : y("", !0),
|
|
2624
|
+
R.value.style.chart.controls.position === "top" && !D(at) && R.value.style.chart.controls.show ? (w(), v(ce, {
|
|
2625
|
+
key: 5,
|
|
2626
|
+
ref_key: "zoomControls",
|
|
2627
|
+
ref: Fe,
|
|
2628
|
+
config: R.value,
|
|
2629
|
+
scale: D(Dt),
|
|
2630
|
+
isFullscreen: Z.value,
|
|
2631
|
+
withDirection: "",
|
|
2632
|
+
onZoomIn: Pt,
|
|
2633
|
+
onZoomOut: Ft,
|
|
2634
|
+
onResetZoom: t[0] ||= () => D(Tt)(!0),
|
|
2635
|
+
onSwitchDirection: Lt
|
|
2636
|
+
}, null, 8, [
|
|
2637
|
+
"config",
|
|
2638
|
+
"scale",
|
|
2639
|
+
"isFullscreen"
|
|
2640
|
+
])) : y("", !0),
|
|
2641
|
+
x("div", $n, [D(Y) ? (w(), b("svg", {
|
|
2642
|
+
key: 0,
|
|
2643
|
+
ref_key: "svgRef",
|
|
2644
|
+
ref: K,
|
|
2645
|
+
class: ye({
|
|
2646
|
+
"vue-ui-dag-svg": !0,
|
|
2647
|
+
"vue-data-ui-loading": D(at)
|
|
2648
|
+
}),
|
|
2649
|
+
viewBox: jt.value,
|
|
2650
|
+
xmlns: D(o),
|
|
2651
|
+
style: be({
|
|
2652
|
+
backgroundColor: R.value.style.chart.backgroundColor,
|
|
2653
|
+
height: "100%",
|
|
2654
|
+
width: "100%"
|
|
2655
|
+
}),
|
|
2656
|
+
tabindex: "0",
|
|
2657
|
+
"aria-describedby": `chart-instructions-${N.value}`,
|
|
2658
|
+
onFocus: On,
|
|
2659
|
+
onBlur: kn,
|
|
2660
|
+
onKeydown: Nn
|
|
2661
|
+
}, [
|
|
2662
|
+
he(D(Ae)),
|
|
2663
|
+
R.value.style.chart.backgroundPattern.show ? (w(), b("defs", tr, [x("pattern", {
|
|
2664
|
+
id: `dag_bg_pattern_${N.value}`,
|
|
2665
|
+
patternUnits: "userSpaceOnUse",
|
|
2666
|
+
width: en.value,
|
|
2667
|
+
height: en.value
|
|
2668
|
+
}, [E(e.$slots, "background-pattern", C(S({
|
|
2669
|
+
x: en.value / 2,
|
|
2670
|
+
y: en.value / 2,
|
|
2671
|
+
color: R.value.style.chart.backgroundPattern.dotColor
|
|
2672
|
+
})), () => [x("circle", {
|
|
2673
|
+
cx: en.value / 2,
|
|
2674
|
+
cy: en.value / 2,
|
|
2675
|
+
r: tn.value,
|
|
2676
|
+
fill: R.value.style.chart.backgroundPattern.dotColor
|
|
2677
|
+
}, null, 8, rr)], !0)], 8, nr)])) : y("", !0),
|
|
2678
|
+
R.value.style.chart.backgroundPattern.show ? (w(), b("rect", {
|
|
2679
|
+
key: 1,
|
|
2680
|
+
x: D(wt)?.x ?? 0,
|
|
2681
|
+
y: D(wt)?.y ?? 0,
|
|
2682
|
+
width: D(wt)?.width ?? 0,
|
|
2683
|
+
height: D(wt)?.height ?? 0,
|
|
2684
|
+
fill: `url(#dag_bg_pattern_${N.value})`,
|
|
2685
|
+
style: be({
|
|
2686
|
+
pointerEvents: "none",
|
|
2687
|
+
opacity: R.value.style.chart.backgroundPattern.opacity
|
|
2688
|
+
})
|
|
2689
|
+
}, null, 12, ir)) : y("", !0),
|
|
2690
|
+
D(Y).arrowShape === "undirected" ? y("", !0) : (w(), b("defs", ar, [(w(!0), b(ue, null, Ce(D(Y).edges, (e) => (w(), b("marker", {
|
|
2691
|
+
key: `marker_${e.id}`,
|
|
2692
|
+
id: mn(e.id),
|
|
2693
|
+
markerWidth: D(Y).arrowSize,
|
|
2694
|
+
markerHeight: D(Y).arrowSize,
|
|
2695
|
+
refX: D(Y).arrowSize - 3,
|
|
2696
|
+
refY: D(Y).arrowSize / 2,
|
|
2697
|
+
orient: "auto",
|
|
2698
|
+
markerUnits: "strokeWidth"
|
|
2699
|
+
}, [D(Y).arrowShape === "normal" ? (w(), b("path", {
|
|
2700
|
+
key: 0,
|
|
2701
|
+
d: `M 0 0 L ${D(Y).arrowSize} ${D(Y).arrowSize / 2} L 0 ${D(Y).arrowSize} Z`,
|
|
2702
|
+
fill: pn(e),
|
|
2703
|
+
stroke: pn(e),
|
|
2704
|
+
"stroke-width": "0",
|
|
2705
|
+
style: { transition: "stroke 0.2s ease-in-out,\n fill 0.2s ease-in-out,\n stroke-width 0.2s ease-in-out" }
|
|
2706
|
+
}, null, 8, sr)) : (w(), b("path", {
|
|
2707
|
+
key: 1,
|
|
2708
|
+
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`,
|
|
2709
|
+
fill: pn(e),
|
|
2710
|
+
stroke: pn(e),
|
|
2711
|
+
"stroke-width": "0",
|
|
2712
|
+
style: { transition: "stroke 0.2s ease-in-out,\n fill 0.2s ease-in-out,\n stroke-width 0.2s ease-in-out" }
|
|
2713
|
+
}, null, 8, cr))], 8, or))), 128))])),
|
|
2714
|
+
x("g", lr, [(w(!0), b(ue, null, Ce(D(Y).edges, (e) => (w(), b(ue, { key: e.id }, [x("path", _e({
|
|
2715
|
+
"data-cy-edge": "",
|
|
2716
|
+
ref_for: !0,
|
|
2717
|
+
ref: Xt(e.id)
|
|
2718
|
+
}, { ref_for: !0 }, ln(e), { style: {
|
|
2719
|
+
"pointer-events": "none",
|
|
2720
|
+
transition: "stroke-width 0.2s ease-in-out,\n stroke 0.2s ease-in-out"
|
|
2721
|
+
} }), null, 16), R.value.style.chart.midpoints.show ? (w(), b("circle", _e({
|
|
2722
|
+
key: 0,
|
|
2723
|
+
"data-cy-midpoint": "",
|
|
2724
|
+
class: "vue-ui-dag-edge-midpoint",
|
|
2725
|
+
"data-a11y-midpoint-id": e.id
|
|
2726
|
+
}, { ref_for: !0 }, fn(e), {
|
|
2727
|
+
"aria-label": `${X(e.from)?.label ?? e.from} to ${X(e.to)?.label ?? e.to}`,
|
|
2728
|
+
style: { transition: "stroke-width 0.2s ease-in-out,\n stroke 0.2s ease-in-out,\n fill 0.2s ease-in-out" },
|
|
2729
|
+
onMouseenter: (t) => sn(e),
|
|
2730
|
+
onMouseleave: Vt
|
|
2731
|
+
}), null, 16, ur)) : y("", !0)], 64))), 128))]),
|
|
2732
|
+
x("g", dr, [(w(!0), b(ue, null, Ce(D(Y).nodes, (t) => (w(), b("g", {
|
|
2733
|
+
key: t.id,
|
|
2734
|
+
class: "vue-ui-dag-node",
|
|
2735
|
+
onClick: Oe((e) => R.value.style.chart.nodes.tooltip.showOnClick && Ht(t), ["stop"]),
|
|
2736
|
+
onMouseenter: (e) => on(t.id),
|
|
2737
|
+
onMouseleave: (e) => cn(t.id)
|
|
2738
|
+
}, [e.$slots.node ? y("", !0) : (w(), b("rect", _e({
|
|
2739
|
+
key: 0,
|
|
2740
|
+
"data-cy-node": ""
|
|
2741
|
+
}, { ref_for: !0 }, dn(t), {
|
|
2742
|
+
"data-a11y-node-id": t.id,
|
|
2743
|
+
"aria-label": `${t.label ?? t.id}`,
|
|
2744
|
+
style: {
|
|
2745
|
+
cursor: R.value.style.chart.nodes.tooltip.showOnClick && Ge.value ? "pointer" : "default",
|
|
2746
|
+
transition: "stroke 0.2s ease-in-out, stroke-width 0.2s ease-in-out, fill 0.2s ease-in-out"
|
|
2747
|
+
}
|
|
2748
|
+
}), null, 16, pr)), e.$slots.node ? (w(), b("foreignObject", {
|
|
2749
|
+
key: 1,
|
|
2750
|
+
x: t.x - t.width / 2,
|
|
2751
|
+
y: t.y - t.height / 2,
|
|
2752
|
+
width: t.width,
|
|
2753
|
+
height: t.height,
|
|
2754
|
+
style: { overflow: "visible" }
|
|
2755
|
+
}, [E(e.$slots, "node", _e({ ref_for: !0 }, {
|
|
2756
|
+
node: t,
|
|
2757
|
+
orientation: q.value
|
|
2758
|
+
}), void 0, !0)], 8, mr)) : y("", !0)], 40, fr))), 128))]),
|
|
2759
|
+
x("g", hr, [(w(!0), b(ue, null, Ce(D(Y).edges, (e) => (w(), b("path", {
|
|
2760
|
+
key: e.id,
|
|
2761
|
+
d: e.pathData,
|
|
2762
|
+
fill: "none",
|
|
2763
|
+
stroke: "transparent",
|
|
2764
|
+
"stroke-width": R.value.style.chart.edges.strokeWidth * (e.from === $.value || e.id === z.value?.id ? 1.3 : 1),
|
|
2765
|
+
"stroke-linecap": "round",
|
|
2766
|
+
"stroke-linejoin": "round",
|
|
2767
|
+
"marker-end": D(Y).arrowShape === "undirected" ? null : `url(#${mn(e.id)})`,
|
|
2768
|
+
style: {
|
|
2769
|
+
"pointer-events": "none",
|
|
2770
|
+
transition: "stroke-width 0.2s ease-in-out,\n stroke 0.2s ease-in-out"
|
|
2771
|
+
}
|
|
2772
|
+
}, null, 8, gr))), 128))]),
|
|
2773
|
+
x("g", _r, [(w(!0), b(ue, null, Ce(D(Y).nodes, (t) => (w(), b("g", {
|
|
2774
|
+
key: t.id,
|
|
2775
|
+
onClick: Oe((e) => R.value.style.chart.nodes.tooltip.showOnClick && Ht(t), ["stop"]),
|
|
2776
|
+
onMouseenter: (e) => an(t.id),
|
|
2777
|
+
onMouseleave: (e) => cn(t.id)
|
|
2778
|
+
}, [e.$slots["free-node-label"] ? y("", !0) : (w(), b(ue, { key: 0 }, [e.$slots["node-label"] ? (w(), b("text", {
|
|
2779
|
+
key: 0,
|
|
2780
|
+
x: t.x,
|
|
2781
|
+
y: t.y + R.value.style.chart.nodes.labels.fontSize / 3,
|
|
2782
|
+
"text-anchor": "middle",
|
|
2783
|
+
"font-size": R.value.style.chart.nodes.labels.fontSize,
|
|
2784
|
+
fill: $.value === t.id && R.value.style.chart.nodes.selected.labelColor != null ? R.value.style.chart.nodes.selected.labelColor : t.original.color,
|
|
2785
|
+
"font-weight": R.value.style.chart.nodes.labels.bold ? "bold" : "normal",
|
|
2786
|
+
style: { transition: "fill 0.2s ease-in-out" }
|
|
2787
|
+
}, [E(e.$slots, "node-label", _e({ ref_for: !0 }, {
|
|
2788
|
+
node: t,
|
|
2789
|
+
orientation: q.value
|
|
2790
|
+
}), () => [me(we(t.label), 1)], !0)], 8, yr)) : !e.$slots["free-node-label"] && !e.$slots.node ? (w(), b("text", {
|
|
2791
|
+
key: 1,
|
|
2792
|
+
"data-cy-node-label": "",
|
|
2793
|
+
x: t.x,
|
|
2794
|
+
y: t.y + R.value.style.chart.nodes.labels.fontSize / 3,
|
|
2795
|
+
"text-anchor": "middle",
|
|
2796
|
+
"font-size": R.value.style.chart.nodes.labels.fontSize,
|
|
2797
|
+
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,
|
|
2798
|
+
"font-weight": R.value.style.chart.nodes.labels.bold ? "bold" : "normal",
|
|
2799
|
+
style: { transition: "fill 0.2s ease-in-out" },
|
|
2800
|
+
innerHTML: D(r)({
|
|
2801
|
+
content: t.label,
|
|
2802
|
+
fontSize: R.value.style.chart.nodes.labels.fontSize,
|
|
2803
|
+
fontWeight: R.value.style.chart.nodes.labels.bold ? "bold" : "normal",
|
|
2804
|
+
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,
|
|
2805
|
+
x: t.x,
|
|
2806
|
+
y: t.y,
|
|
2807
|
+
autoOffset: !0
|
|
2808
|
+
})
|
|
2809
|
+
}, 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 }, {
|
|
2810
|
+
node: t,
|
|
2811
|
+
layoutData: D(Y),
|
|
2812
|
+
orientation: q.value
|
|
2813
|
+
}), void 0, !0)])) : y("", !0)], 40, vr))), 128))]),
|
|
2814
|
+
E(e.$slots, "svg", { svg: {
|
|
2815
|
+
drawingArea: D(wt),
|
|
2816
|
+
data: D(Y),
|
|
2817
|
+
orientation: q.value,
|
|
2818
|
+
isPrintingImg: D(ut) || D(J) || Be.value,
|
|
2819
|
+
isPrintingSvg: Ve.value
|
|
2820
|
+
} }, void 0, !0)
|
|
2821
|
+
], 46, er)) : y("", !0), e.$slots.hint ? (w(), b("div", Sr, [E(e.$slots, "hint", C(S({
|
|
2822
|
+
hint: R.value.a11y.translations.keyboardNavigation,
|
|
2823
|
+
isVisible: We.value
|
|
2824
|
+
})), void 0, !0)])) : y("", !0)]),
|
|
2825
|
+
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),
|
|
2826
|
+
he(fe, { name: "fade" }, {
|
|
2827
|
+
default: O(() => [W.value ? (w(), v(de, {
|
|
2828
|
+
key: 0,
|
|
2829
|
+
to: Z.value ? M.value : "body"
|
|
2830
|
+
}, [x("div", {
|
|
2831
|
+
"data-cy-tooltip-midpoint": "",
|
|
2832
|
+
ref_key: "tooltipRef",
|
|
2833
|
+
ref: B,
|
|
2834
|
+
class: "vue-ui-dag-tooltip",
|
|
2835
|
+
style: be({
|
|
2836
|
+
...Ye.value,
|
|
2837
|
+
maxWidth: R.value.style.chart.midpoints.tooltip.maxWidth,
|
|
2838
|
+
"--vue-data-ui-dag-tooltip-background": R.value.style.chart.midpoints.tooltip.backgroundColor,
|
|
2839
|
+
"--vue-data-ui-dag-tooltip-color": R.value.style.chart.midpoints.tooltip.color
|
|
2840
|
+
}),
|
|
2841
|
+
"data-position": Xe.value
|
|
2842
|
+
}, [E(e.$slots, "tooltip-midpoint", C(S({
|
|
2843
|
+
edge: z.value,
|
|
2844
|
+
layoutData: D(Y)
|
|
2845
|
+
})), () => [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)]),
|
|
2846
|
+
_: 3
|
|
2847
|
+
}),
|
|
2848
|
+
he(fe, { name: "fade" }, {
|
|
2849
|
+
default: O(() => [V.value ? (w(), v(de, {
|
|
2850
|
+
key: 0,
|
|
2851
|
+
to: Z.value ? M.value : "body"
|
|
2852
|
+
}, [x("div", {
|
|
2853
|
+
"data-cy-tooltip-node": "",
|
|
2854
|
+
ref_key: "nodeTooltipRef",
|
|
2855
|
+
ref: U,
|
|
2856
|
+
class: "vue-ui-dag-node-tooltip",
|
|
2857
|
+
style: be({
|
|
2858
|
+
maxWidth: R.value.style.chart.nodes.tooltip.maxWidth,
|
|
2859
|
+
left: $e.value.left,
|
|
2860
|
+
top: $e.value.top,
|
|
2861
|
+
"--vue-data-ui-dag-node-tooltip-background": R.value.style.chart.nodes.tooltip.backgroundColor,
|
|
2862
|
+
"--vue-data-ui-dag-node-tooltip-color": R.value.style.chart.nodes.tooltip.color
|
|
2863
|
+
}),
|
|
2864
|
+
"data-position": et.value
|
|
2865
|
+
}, [E(e.$slots, "tooltip-node", C(S({
|
|
2866
|
+
node: H.value,
|
|
2867
|
+
layoutData: D(Y)
|
|
2868
|
+
})), () => [H.value ? (w(), b("div", Dr, we(H.value.label), 1)) : y("", !0)], !0)], 12, Er)], 8, ["to"])) : y("", !0)]),
|
|
2869
|
+
_: 3
|
|
2870
|
+
}),
|
|
2871
|
+
R.value.style.chart.controls.position === "bottom" && !D(at) && R.value.style.chart.controls.show ? (w(), v(ce, {
|
|
2872
|
+
key: 7,
|
|
2873
|
+
ref_key: "zoomControls",
|
|
2874
|
+
ref: Fe,
|
|
2875
|
+
config: R.value,
|
|
2876
|
+
scale: D(Dt),
|
|
2877
|
+
isFullscreen: Z.value,
|
|
2878
|
+
withDirection: "",
|
|
2879
|
+
onZoomIn: Pt,
|
|
2880
|
+
onZoomOut: Ft,
|
|
2881
|
+
onResetZoom: t[1] ||= () => D(Tt)(!0),
|
|
2882
|
+
onSwitchDirection: Lt
|
|
2883
|
+
}, null, 8, [
|
|
2884
|
+
"config",
|
|
2885
|
+
"scale",
|
|
2886
|
+
"isFullscreen"
|
|
2887
|
+
])) : y("", !0),
|
|
2888
|
+
e.$slots.source ? (w(), b("div", {
|
|
2889
|
+
key: 8,
|
|
2890
|
+
ref_key: "source",
|
|
2891
|
+
ref: Pe,
|
|
2892
|
+
dir: "auto"
|
|
2893
|
+
}, [E(e.$slots, "source", {}, void 0, !0)], 512)) : y("", !0),
|
|
2894
|
+
E(e.$slots, "skeleton", {}, () => [D(at) ? (w(), v(f, { key: 0 })) : y("", !0)], !0)
|
|
2895
|
+
], 46, Xn));
|
|
2896
|
+
}
|
|
2897
|
+
}, [["__scopeId", "data-v-04c5b754"]]);
|
|
2898
|
+
//#endregion
|
|
2899
|
+
export { Yn as n, kr as t };
|