@knowvah/dot-engine 0.1.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/LICENSE +277 -0
- package/README.md +292 -0
- package/dist/api/builder.d.ts +78 -0
- package/dist/api/builder.d.ts.map +1 -0
- package/dist/api/edge-ops.d.ts +45 -0
- package/dist/api/edge-ops.d.ts.map +1 -0
- package/dist/api/geometry.d.ts +159 -0
- package/dist/api/geometry.d.ts.map +1 -0
- package/dist/api/index.d.ts +24 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api.js +719 -0
- package/dist/api.js.map +7 -0
- package/dist/bundle.js +101 -0
- package/dist/cdt/bag.d.ts +58 -0
- package/dist/cdt/bag.d.ts.map +1 -0
- package/dist/cdt/hash-core.d.ts +40 -0
- package/dist/cdt/hash-core.d.ts.map +1 -0
- package/dist/cdt/hash.d.ts +74 -0
- package/dist/cdt/hash.d.ts.map +1 -0
- package/dist/cdt/index.d.ts +16 -0
- package/dist/cdt/index.d.ts.map +1 -0
- package/dist/cdt/splay-core.d.ts +78 -0
- package/dist/cdt/splay-core.d.ts.map +1 -0
- package/dist/cdt/splay.d.ts +63 -0
- package/dist/cdt/splay.d.ts.map +1 -0
- package/dist/cdt/strhash.d.ts +26 -0
- package/dist/cdt/strhash.d.ts.map +1 -0
- package/dist/cdt/types.d.ts +11 -0
- package/dist/cdt/types.d.ts.map +1 -0
- package/dist/common/arith.d.ts +35 -0
- package/dist/common/arith.d.ts.map +1 -0
- package/dist/common/arm-pow-data.d.ts +17 -0
- package/dist/common/arm-pow-data.d.ts.map +1 -0
- package/dist/common/arm-pow.d.ts +12 -0
- package/dist/common/arm-pow.d.ts.map +1 -0
- package/dist/common/arrows-constants.d.ts +97 -0
- package/dist/common/arrows-constants.d.ts.map +1 -0
- package/dist/common/arrows-geometry.d.ts +24 -0
- package/dist/common/arrows-geometry.d.ts.map +1 -0
- package/dist/common/arrows-miter.d.ts +24 -0
- package/dist/common/arrows-miter.d.ts.map +1 -0
- package/dist/common/arrows-shapes-poly.d.ts +24 -0
- package/dist/common/arrows-shapes-poly.d.ts.map +1 -0
- package/dist/common/arrows-shapes-util.d.ts +77 -0
- package/dist/common/arrows-shapes-util.d.ts.map +1 -0
- package/dist/common/arrows-shapes.d.ts +48 -0
- package/dist/common/arrows-shapes.d.ts.map +1 -0
- package/dist/common/arrows-types.d.ts +59 -0
- package/dist/common/arrows-types.d.ts.map +1 -0
- package/dist/common/arrows.d.ts +69 -0
- package/dist/common/arrows.d.ts.map +1 -0
- package/dist/common/color.d.ts +66 -0
- package/dist/common/color.d.ts.map +1 -0
- package/dist/common/colorData.d.ts +10 -0
- package/dist/common/colorData.d.ts.map +1 -0
- package/dist/common/compass-port.d.ts +39 -0
- package/dist/common/compass-port.d.ts.map +1 -0
- package/dist/common/crand.d.ts +42 -0
- package/dist/common/crand.d.ts.map +1 -0
- package/dist/common/edge-label-init.d.ts +51 -0
- package/dist/common/edge-label-init.d.ts.map +1 -0
- package/dist/common/edge-offset.d.ts +66 -0
- package/dist/common/edge-offset.d.ts.map +1 -0
- package/dist/common/ellipse-wedge.d.ts +10 -0
- package/dist/common/ellipse-wedge.d.ts.map +1 -0
- package/dist/common/emit-types.d.ts +255 -0
- package/dist/common/emit-types.d.ts.map +1 -0
- package/dist/common/fma.d.ts +10 -0
- package/dist/common/fma.d.ts.map +1 -0
- package/dist/common/graph-init.d.ts +61 -0
- package/dist/common/graph-init.d.ts.map +1 -0
- package/dist/common/html-entities.d.ts +17 -0
- package/dist/common/html-entities.d.ts.map +1 -0
- package/dist/common/html-string.d.ts +14 -0
- package/dist/common/html-string.d.ts.map +1 -0
- package/dist/common/htmltable-emit-fill.d.ts +84 -0
- package/dist/common/htmltable-emit-fill.d.ts.map +1 -0
- package/dist/common/htmltable-emit-rules.d.ts +79 -0
- package/dist/common/htmltable-emit-rules.d.ts.map +1 -0
- package/dist/common/htmltable-emit.d.ts +63 -0
- package/dist/common/htmltable-emit.d.ts.map +1 -0
- package/dist/common/htmltable-lex.d.ts +16 -0
- package/dist/common/htmltable-lex.d.ts.map +1 -0
- package/dist/common/htmltable-parse.d.ts +37 -0
- package/dist/common/htmltable-parse.d.ts.map +1 -0
- package/dist/common/htmltable-port.d.ts +15 -0
- package/dist/common/htmltable-port.d.ts.map +1 -0
- package/dist/common/htmltable-pos-runs.d.ts +88 -0
- package/dist/common/htmltable-pos-runs.d.ts.map +1 -0
- package/dist/common/htmltable-pos.d.ts +192 -0
- package/dist/common/htmltable-pos.d.ts.map +1 -0
- package/dist/common/htmltable-types.d.ts +237 -0
- package/dist/common/htmltable-types.d.ts.map +1 -0
- package/dist/common/htmltable.d.ts +74 -0
- package/dist/common/htmltable.d.ts.map +1 -0
- package/dist/common/layers.d.ts +20 -0
- package/dist/common/layers.d.ts.map +1 -0
- package/dist/common/make-label.d.ts +60 -0
- package/dist/common/make-label.d.ts.map +1 -0
- package/dist/common/multicolor.d.ts +46 -0
- package/dist/common/multicolor.d.ts.map +1 -0
- package/dist/common/nodeinit.d.ts +45 -0
- package/dist/common/nodeinit.d.ts.map +1 -0
- package/dist/common/poly-gencode.d.ts +40 -0
- package/dist/common/poly-gencode.d.ts.map +1 -0
- package/dist/common/poly-init.d.ts +51 -0
- package/dist/common/poly-init.d.ts.map +1 -0
- package/dist/common/poly-inside.d.ts +37 -0
- package/dist/common/poly-inside.d.ts.map +1 -0
- package/dist/common/poly-shapes-cases.d.ts +31 -0
- package/dist/common/poly-shapes-cases.d.ts.map +1 -0
- package/dist/common/poly-shapes-cases2.d.ts +25 -0
- package/dist/common/poly-shapes-cases2.d.ts.map +1 -0
- package/dist/common/poly-shapes-util.d.ts +42 -0
- package/dist/common/poly-shapes-util.d.ts.map +1 -0
- package/dist/common/poly-shapes.d.ts +39 -0
- package/dist/common/poly-shapes.d.ts.map +1 -0
- package/dist/common/poly-sizing.d.ts +189 -0
- package/dist/common/poly-sizing.d.ts.map +1 -0
- package/dist/common/poly-vertices.d.ts +42 -0
- package/dist/common/poly-vertices.d.ts.map +1 -0
- package/dist/common/postproc.d.ts +49 -0
- package/dist/common/postproc.d.ts.map +1 -0
- package/dist/common/ps-fontalias.d.ts +36 -0
- package/dist/common/ps-fontalias.d.ts.map +1 -0
- package/dist/common/random.d.ts +8 -0
- package/dist/common/random.d.ts.map +1 -0
- package/dist/common/record-port.d.ts +34 -0
- package/dist/common/record-port.d.ts.map +1 -0
- package/dist/common/record.d.ts +105 -0
- package/dist/common/record.d.ts.map +1 -0
- package/dist/common/shapeData.d.ts +186 -0
- package/dist/common/shapeData.d.ts.map +1 -0
- package/dist/common/shapes.d.ts +36 -0
- package/dist/common/shapes.d.ts.map +1 -0
- package/dist/common/spline-midpoint.d.ts +31 -0
- package/dist/common/spline-midpoint.d.ts.map +1 -0
- package/dist/common/splines-clip.d.ts +21 -0
- package/dist/common/splines-clip.d.ts.map +1 -0
- package/dist/common/splines-constants.d.ts +42 -0
- package/dist/common/splines-constants.d.ts.map +1 -0
- package/dist/common/splines-geom.d.ts +51 -0
- package/dist/common/splines-geom.d.ts.map +1 -0
- package/dist/common/splines-path-begin.d.ts +17 -0
- package/dist/common/splines-path-begin.d.ts.map +1 -0
- package/dist/common/splines-path-end.d.ts +17 -0
- package/dist/common/splines-path-end.d.ts.map +1 -0
- package/dist/common/splines-path-shared.d.ts +53 -0
- package/dist/common/splines-path-shared.d.ts.map +1 -0
- package/dist/common/splines-routespl.d.ts +40 -0
- package/dist/common/splines-routespl.d.ts.map +1 -0
- package/dist/common/splines-selfedge.d.ts +21 -0
- package/dist/common/splines-selfedge.d.ts.map +1 -0
- package/dist/common/splines.d.ts +18 -0
- package/dist/common/splines.d.ts.map +1 -0
- package/dist/common/style-resolve.d.ts +197 -0
- package/dist/common/style-resolve.d.ts.map +1 -0
- package/dist/common/subst.d.ts +31 -0
- package/dist/common/subst.d.ts.map +1 -0
- package/dist/common/taper.d.ts +23 -0
- package/dist/common/taper.d.ts.map +1 -0
- package/dist/common/textmeasure-factory.d.ts +33 -0
- package/dist/common/textmeasure-factory.d.ts.map +1 -0
- package/dist/common/textmeasure-lookup.d.ts +17 -0
- package/dist/common/textmeasure-lookup.d.ts.map +1 -0
- package/dist/common/textmeasure-lut-data-a.d.ts +13 -0
- package/dist/common/textmeasure-lut-data-a.d.ts.map +1 -0
- package/dist/common/textmeasure-lut-data-b.d.ts +12 -0
- package/dist/common/textmeasure-lut-data-b.d.ts.map +1 -0
- package/dist/common/textmeasure-lut-data-c.d.ts +13 -0
- package/dist/common/textmeasure-lut-data-c.d.ts.map +1 -0
- package/dist/common/textmeasure-lut-data.d.ts +27 -0
- package/dist/common/textmeasure-lut-data.d.ts.map +1 -0
- package/dist/common/textmeasure.d.ts +120 -0
- package/dist/common/textmeasure.d.ts.map +1 -0
- package/dist/common/types.d.ts +316 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/xlabels-place.d.ts +125 -0
- package/dist/common/xlabels-place.d.ts.map +1 -0
- package/dist/debug.d.ts +58 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/errors.d.ts +63 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/gvc/anchor.d.ts +86 -0
- package/dist/gvc/anchor.d.ts.map +1 -0
- package/dist/gvc/context.d.ts +177 -0
- package/dist/gvc/context.d.ts.map +1 -0
- package/dist/gvc/default-context.d.ts +20 -0
- package/dist/gvc/default-context.d.ts.map +1 -0
- package/dist/gvc/device-cluster.d.ts +25 -0
- package/dist/gvc/device-cluster.d.ts.map +1 -0
- package/dist/gvc/device.d.ts +99 -0
- package/dist/gvc/device.d.ts.map +1 -0
- package/dist/gvc/edge-labels.d.ts +10 -0
- package/dist/gvc/edge-labels.d.ts.map +1 -0
- package/dist/gvc/emit-walk.d.ts +22 -0
- package/dist/gvc/emit-walk.d.ts.map +1 -0
- package/dist/gvc/image-resolver.d.ts +44 -0
- package/dist/gvc/image-resolver.d.ts.map +1 -0
- package/dist/gvc/job.d.ts +234 -0
- package/dist/gvc/job.d.ts.map +1 -0
- package/dist/gvc/textlayout.d.ts +33 -0
- package/dist/gvc/textlayout.d.ts.map +1 -0
- package/dist/gvc/textspan-emit.d.ts +41 -0
- package/dist/gvc/textspan-emit.d.ts.map +1 -0
- package/dist/gvc/usershape.d.ts +25 -0
- package/dist/gvc/usershape.d.ts.map +1 -0
- package/dist/gvc/viewport.d.ts +71 -0
- package/dist/gvc/viewport.d.ts.map +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52862 -0
- package/dist/index.js.map +7 -0
- package/dist/label/index.d.ts +74 -0
- package/dist/label/index.d.ts.map +1 -0
- package/dist/label/node.d.ts +108 -0
- package/dist/label/node.d.ts.map +1 -0
- package/dist/label/rectangle.d.ts +60 -0
- package/dist/label/rectangle.d.ts.map +1 -0
- package/dist/label/split-q.d.ts +13 -0
- package/dist/label/split-q.d.ts.map +1 -0
- package/dist/label/xlabels-geom.d.ts +46 -0
- package/dist/label/xlabels-geom.d.ts.map +1 -0
- package/dist/label/xlabels-intersect.d.ts +79 -0
- package/dist/label/xlabels-intersect.d.ts.map +1 -0
- package/dist/label/xlabels.d.ts +67 -0
- package/dist/label/xlabels.d.ts.map +1 -0
- package/dist/layout/circo/blockpath.d.ts +120 -0
- package/dist/layout/circo/blockpath.d.ts.map +1 -0
- package/dist/layout/circo/blocks.d.ts +135 -0
- package/dist/layout/circo/blocks.d.ts.map +1 -0
- package/dist/layout/circo/blocktree.d.ts +51 -0
- package/dist/layout/circo/blocktree.d.ts.map +1 -0
- package/dist/layout/circo/circular.d.ts +59 -0
- package/dist/layout/circo/circular.d.ts.map +1 -0
- package/dist/layout/circo/index.d.ts +35 -0
- package/dist/layout/circo/index.d.ts.map +1 -0
- package/dist/layout/circo/init.d.ts +50 -0
- package/dist/layout/circo/init.d.ts.map +1 -0
- package/dist/layout/circo/position-helpers.d.ts +33 -0
- package/dist/layout/circo/position-helpers.d.ts.map +1 -0
- package/dist/layout/circo/position.d.ts +66 -0
- package/dist/layout/circo/position.d.ts.map +1 -0
- package/dist/layout/dot/acyclic.d.ts +8 -0
- package/dist/layout/dot/acyclic.d.ts.map +1 -0
- package/dist/layout/dot/aspect.d.ts +17 -0
- package/dist/layout/dot/aspect.d.ts.map +1 -0
- package/dist/layout/dot/classify.d.ts +52 -0
- package/dist/layout/dot/classify.d.ts.map +1 -0
- package/dist/layout/dot/cluster-path.d.ts +38 -0
- package/dist/layout/dot/cluster-path.d.ts.map +1 -0
- package/dist/layout/dot/cluster.d.ts +102 -0
- package/dist/layout/dot/cluster.d.ts.map +1 -0
- package/dist/layout/dot/compound-clip.d.ts +69 -0
- package/dist/layout/dot/compound-clip.d.ts.map +1 -0
- package/dist/layout/dot/compound-geom.d.ts +115 -0
- package/dist/layout/dot/compound-geom.d.ts.map +1 -0
- package/dist/layout/dot/compound.d.ts +56 -0
- package/dist/layout/dot/compound.d.ts.map +1 -0
- package/dist/layout/dot/conc.d.ts +88 -0
- package/dist/layout/dot/conc.d.ts.map +1 -0
- package/dist/layout/dot/decomp.d.ts +66 -0
- package/dist/layout/dot/decomp.d.ts.map +1 -0
- package/dist/layout/dot/edge-order.d.ts +27 -0
- package/dist/layout/dot/edge-order.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-arrow.d.ts +46 -0
- package/dist/layout/dot/edge-route-arrow.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-boxes.d.ts +75 -0
- package/dist/layout/dot/edge-route-boxes.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-chain.d.ts +67 -0
- package/dist/layout/dot/edge-route-chain.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-clip.d.ts +88 -0
- package/dist/layout/dot/edge-route-clip.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-faithful.d.ts +94 -0
- package/dist/layout/dot/edge-route-faithful.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-geom.d.ts +43 -0
- package/dist/layout/dot/edge-route-geom.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-helpers.d.ts +50 -0
- package/dist/layout/dot/edge-route-helpers.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-poly.d.ts +48 -0
- package/dist/layout/dot/edge-route-poly.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-rank.d.ts +57 -0
- package/dist/layout/dot/edge-route-rank.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-routing.d.ts +99 -0
- package/dist/layout/dot/edge-route-routing.d.ts.map +1 -0
- package/dist/layout/dot/edge-route.d.ts +57 -0
- package/dist/layout/dot/edge-route.d.ts.map +1 -0
- package/dist/layout/dot/fastgr.d.ts +147 -0
- package/dist/layout/dot/fastgr.d.ts.map +1 -0
- package/dist/layout/dot/flat-utils.d.ts +21 -0
- package/dist/layout/dot/flat-utils.d.ts.map +1 -0
- package/dist/layout/dot/flat.d.ts +152 -0
- package/dist/layout/dot/flat.d.ts.map +1 -0
- package/dist/layout/dot/graph-label.d.ts +18 -0
- package/dist/layout/dot/graph-label.d.ts.map +1 -0
- package/dist/layout/dot/index.d.ts +128 -0
- package/dist/layout/dot/index.d.ts.map +1 -0
- package/dist/layout/dot/init.d.ts +93 -0
- package/dist/layout/dot/init.d.ts.map +1 -0
- package/dist/layout/dot/label-order.d.ts +45 -0
- package/dist/layout/dot/label-order.d.ts.map +1 -0
- package/dist/layout/dot/mincross-build.d.ts +52 -0
- package/dist/layout/dot/mincross-build.d.ts.map +1 -0
- package/dist/layout/dot/mincross-cross.d.ts +80 -0
- package/dist/layout/dot/mincross-cross.d.ts.map +1 -0
- package/dist/layout/dot/mincross-flat.d.ts +27 -0
- package/dist/layout/dot/mincross-flat.d.ts.map +1 -0
- package/dist/layout/dot/mincross-order.d.ts +89 -0
- package/dist/layout/dot/mincross-order.d.ts.map +1 -0
- package/dist/layout/dot/mincross-utils.d.ts +60 -0
- package/dist/layout/dot/mincross-utils.d.ts.map +1 -0
- package/dist/layout/dot/mincross.d.ts +75 -0
- package/dist/layout/dot/mincross.d.ts.map +1 -0
- package/dist/layout/dot/ns-core.d.ts +37 -0
- package/dist/layout/dot/ns-core.d.ts.map +1 -0
- package/dist/layout/dot/ns-range.d.ts +17 -0
- package/dist/layout/dot/ns-range.d.ts.map +1 -0
- package/dist/layout/dot/ns-subtree.d.ts +78 -0
- package/dist/layout/dot/ns-subtree.d.ts.map +1 -0
- package/dist/layout/dot/ns.d.ts +86 -0
- package/dist/layout/dot/ns.d.ts.map +1 -0
- package/dist/layout/dot/ortho-adapter.d.ts +19 -0
- package/dist/layout/dot/ortho-adapter.d.ts.map +1 -0
- package/dist/layout/dot/pack-components.d.ts +100 -0
- package/dist/layout/dot/pack-components.d.ts.map +1 -0
- package/dist/layout/dot/position-aux.d.ts +110 -0
- package/dist/layout/dot/position-aux.d.ts.map +1 -0
- package/dist/layout/dot/position-bbox.d.ts +57 -0
- package/dist/layout/dot/position-bbox.d.ts.map +1 -0
- package/dist/layout/dot/position-cluster.d.ts +48 -0
- package/dist/layout/dot/position-cluster.d.ts.map +1 -0
- package/dist/layout/dot/position-ycoords.d.ts +42 -0
- package/dist/layout/dot/position-ycoords.d.ts.map +1 -0
- package/dist/layout/dot/position.d.ts +47 -0
- package/dist/layout/dot/position.d.ts.map +1 -0
- package/dist/layout/dot/rank-dot2.d.ts +114 -0
- package/dist/layout/dot/rank-dot2.d.ts.map +1 -0
- package/dist/layout/dot/rank.d.ts +119 -0
- package/dist/layout/dot/rank.d.ts.map +1 -0
- package/dist/layout/dot/sameport.d.ts +70 -0
- package/dist/layout/dot/sameport.d.ts.map +1 -0
- package/dist/layout/dot/self-loop.d.ts +54 -0
- package/dist/layout/dot/self-loop.d.ts.map +1 -0
- package/dist/layout/dot/splines-clone.d.ts +33 -0
- package/dist/layout/dot/splines-clone.d.ts.map +1 -0
- package/dist/layout/dot/splines-flat-labeled.d.ts +101 -0
- package/dist/layout/dot/splines-flat-labeled.d.ts.map +1 -0
- package/dist/layout/dot/splines-flat-multi.d.ts +35 -0
- package/dist/layout/dot/splines-flat-multi.d.ts.map +1 -0
- package/dist/layout/dot/splines-flat.d.ts +116 -0
- package/dist/layout/dot/splines-flat.d.ts.map +1 -0
- package/dist/layout/dot/splines-groups.d.ts +38 -0
- package/dist/layout/dot/splines-groups.d.ts.map +1 -0
- package/dist/layout/dot/splines-label.d.ts +105 -0
- package/dist/layout/dot/splines-label.d.ts.map +1 -0
- package/dist/layout/dot/splines-route-type.d.ts +28 -0
- package/dist/layout/dot/splines-route-type.d.ts.map +1 -0
- package/dist/layout/dot/splines-route.d.ts +99 -0
- package/dist/layout/dot/splines-route.d.ts.map +1 -0
- package/dist/layout/dot/splines.d.ts +157 -0
- package/dist/layout/dot/splines.d.ts.map +1 -0
- package/dist/layout/dot/straight-edges.d.ts +39 -0
- package/dist/layout/dot/straight-edges.d.ts.map +1 -0
- package/dist/layout/fdp/cluster-edges.d.ts +31 -0
- package/dist/layout/fdp/cluster-edges.d.ts.map +1 -0
- package/dist/layout/fdp/comp.d.ts +29 -0
- package/dist/layout/fdp/comp.d.ts.map +1 -0
- package/dist/layout/fdp/derive.d.ts +39 -0
- package/dist/layout/fdp/derive.d.ts.map +1 -0
- package/dist/layout/fdp/fdp-model.d.ts +101 -0
- package/dist/layout/fdp/fdp-model.d.ts.map +1 -0
- package/dist/layout/fdp/grid.d.ts +49 -0
- package/dist/layout/fdp/grid.d.ts.map +1 -0
- package/dist/layout/fdp/index.d.ts +36 -0
- package/dist/layout/fdp/index.d.ts.map +1 -0
- package/dist/layout/fdp/init.d.ts +26 -0
- package/dist/layout/fdp/init.d.ts.map +1 -0
- package/dist/layout/fdp/layout.d.ts +57 -0
- package/dist/layout/fdp/layout.d.ts.map +1 -0
- package/dist/layout/fdp/normalize.d.ts +18 -0
- package/dist/layout/fdp/normalize.d.ts.map +1 -0
- package/dist/layout/fdp/ports.d.ts +41 -0
- package/dist/layout/fdp/ports.d.ts.map +1 -0
- package/dist/layout/fdp/tlayout-init.d.ts +21 -0
- package/dist/layout/fdp/tlayout-init.d.ts.map +1 -0
- package/dist/layout/fdp/tlayout-parms.d.ts +98 -0
- package/dist/layout/fdp/tlayout-parms.d.ts.map +1 -0
- package/dist/layout/fdp/tlayout.d.ts +43 -0
- package/dist/layout/fdp/tlayout.d.ts.map +1 -0
- package/dist/layout/fdp/xlayout.d.ts +26 -0
- package/dist/layout/fdp/xlayout.d.ts.map +1 -0
- package/dist/layout/neato/bfs.d.ts +43 -0
- package/dist/layout/neato/bfs.d.ts.map +1 -0
- package/dist/layout/neato/cdt-surface.d.ts +16 -0
- package/dist/layout/neato/cdt-surface.d.ts.map +1 -0
- package/dist/layout/neato/conjgrad.d.ts +61 -0
- package/dist/layout/neato/conjgrad.d.ts.map +1 -0
- package/dist/layout/neato/delaunay.d.ts +28 -0
- package/dist/layout/neato/delaunay.d.ts.map +1 -0
- package/dist/layout/neato/dijkstra.d.ts +80 -0
- package/dist/layout/neato/dijkstra.d.ts.map +1 -0
- package/dist/layout/neato/fdp-adjust.d.ts +31 -0
- package/dist/layout/neato/fdp-adjust.d.ts.map +1 -0
- package/dist/layout/neato/index.d.ts +58 -0
- package/dist/layout/neato/index.d.ts.map +1 -0
- package/dist/layout/neato/init.d.ts +207 -0
- package/dist/layout/neato/init.d.ts.map +1 -0
- package/dist/layout/neato/legal.d.ts +7 -0
- package/dist/layout/neato/legal.d.ts.map +1 -0
- package/dist/layout/neato/matrix-ops.d.ts +28 -0
- package/dist/layout/neato/matrix-ops.d.ts.map +1 -0
- package/dist/layout/neato/multispline-router.d.ts +80 -0
- package/dist/layout/neato/multispline-router.d.ts.map +1 -0
- package/dist/layout/neato/multispline.d.ts +24 -0
- package/dist/layout/neato/multispline.d.ts.map +1 -0
- package/dist/layout/neato/overlap-prism.d.ts +26 -0
- package/dist/layout/neato/overlap-prism.d.ts.map +1 -0
- package/dist/layout/neato/overlap.d.ts +85 -0
- package/dist/layout/neato/overlap.d.ts.map +1 -0
- package/dist/layout/neato/sc-adjust.d.ts +33 -0
- package/dist/layout/neato/sc-adjust.d.ts.map +1 -0
- package/dist/layout/neato/sep-factor.d.ts +41 -0
- package/dist/layout/neato/sep-factor.d.ts.map +1 -0
- package/dist/layout/neato/set-aspect.d.ts +33 -0
- package/dist/layout/neato/set-aspect.d.ts.map +1 -0
- package/dist/layout/neato/sgd.d.ts +166 -0
- package/dist/layout/neato/sgd.d.ts.map +1 -0
- package/dist/layout/neato/splines.d.ts +153 -0
- package/dist/layout/neato/splines.d.ts.map +1 -0
- package/dist/layout/neato/stress-kernel.d.ts +53 -0
- package/dist/layout/neato/stress-kernel.d.ts.map +1 -0
- package/dist/layout/neato/stress.d.ts +158 -0
- package/dist/layout/neato/stress.d.ts.map +1 -0
- package/dist/layout/osage/index.d.ts +158 -0
- package/dist/layout/osage/index.d.ts.map +1 -0
- package/dist/layout/osage/layout.d.ts +49 -0
- package/dist/layout/osage/layout.d.ts.map +1 -0
- package/dist/layout/osage/types.d.ts +28 -0
- package/dist/layout/osage/types.d.ts.map +1 -0
- package/dist/layout/pack/array-pack.d.ts +114 -0
- package/dist/layout/pack/array-pack.d.ts.map +1 -0
- package/dist/layout/pack/index.d.ts +157 -0
- package/dist/layout/pack/index.d.ts.map +1 -0
- package/dist/layout/pack/poly-pack.d.ts +126 -0
- package/dist/layout/pack/poly-pack.d.ts.map +1 -0
- package/dist/layout/pack/poly-place.d.ts +27 -0
- package/dist/layout/pack/poly-place.d.ts.map +1 -0
- package/dist/layout/pack/spiral-search.d.ts +18 -0
- package/dist/layout/pack/spiral-search.d.ts.map +1 -0
- package/dist/layout/pack/test-helpers.d.ts +7 -0
- package/dist/layout/pack/test-helpers.d.ts.map +1 -0
- package/dist/layout/pack/types.d.ts +74 -0
- package/dist/layout/pack/types.d.ts.map +1 -0
- package/dist/layout/patchwork/index.d.ts +136 -0
- package/dist/layout/patchwork/index.d.ts.map +1 -0
- package/dist/layout/patchwork/tree-map.d.ts +32 -0
- package/dist/layout/patchwork/tree-map.d.ts.map +1 -0
- package/dist/layout/patchwork/tree-node.d.ts +46 -0
- package/dist/layout/patchwork/tree-node.d.ts.map +1 -0
- package/dist/layout/sfdp/index.d.ts +39 -0
- package/dist/layout/sfdp/index.d.ts.map +1 -0
- package/dist/layout/sfdp/init.d.ts +61 -0
- package/dist/layout/sfdp/init.d.ts.map +1 -0
- package/dist/layout/sfdp/multilevel.d.ts +23 -0
- package/dist/layout/sfdp/multilevel.d.ts.map +1 -0
- package/dist/layout/sfdp/quadtree.d.ts +45 -0
- package/dist/layout/sfdp/quadtree.d.ts.map +1 -0
- package/dist/layout/sfdp/sparse-matrix-multiply.d.ts +34 -0
- package/dist/layout/sfdp/sparse-matrix-multiply.d.ts.map +1 -0
- package/dist/layout/sfdp/sparse-matrix.d.ts +101 -0
- package/dist/layout/sfdp/sparse-matrix.d.ts.map +1 -0
- package/dist/layout/sfdp/sparse-solve.d.ts +14 -0
- package/dist/layout/sfdp/sparse-solve.d.ts.map +1 -0
- package/dist/layout/sfdp/spring-driver.d.ts +18 -0
- package/dist/layout/sfdp/spring-driver.d.ts.map +1 -0
- package/dist/layout/sfdp/spring-electrical.d.ts +61 -0
- package/dist/layout/sfdp/spring-electrical.d.ts.map +1 -0
- package/dist/layout/twopi/circle.d.ts +83 -0
- package/dist/layout/twopi/circle.d.ts.map +1 -0
- package/dist/layout/twopi/index.d.ts +24 -0
- package/dist/layout/twopi/index.d.ts.map +1 -0
- package/dist/layout/twopi/init.d.ts +85 -0
- package/dist/layout/twopi/init.d.ts.map +1 -0
- package/dist/layout/twopi/pipeline.d.ts +37 -0
- package/dist/layout/twopi/pipeline.d.ts.map +1 -0
- package/dist/layout/twopi/twopi-test-helpers.d.ts +12 -0
- package/dist/layout/twopi/twopi-test-helpers.d.ts.map +1 -0
- package/dist/model/algData.d.ts +175 -0
- package/dist/model/algData.d.ts.map +1 -0
- package/dist/model/cgraph-ops.d.ts +86 -0
- package/dist/model/cgraph-ops.d.ts.map +1 -0
- package/dist/model/edge.d.ts +80 -0
- package/dist/model/edge.d.ts.map +1 -0
- package/dist/model/edgeInfo.d.ts +299 -0
- package/dist/model/edgeInfo.d.ts.map +1 -0
- package/dist/model/geom.d.ts +149 -0
- package/dist/model/geom.d.ts.map +1 -0
- package/dist/model/graph.d.ts +135 -0
- package/dist/model/graph.d.ts.map +1 -0
- package/dist/model/graphInfo.d.ts +418 -0
- package/dist/model/graphInfo.d.ts.map +1 -0
- package/dist/model/index.d.ts +10 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/layoutParams.d.ts +85 -0
- package/dist/model/layoutParams.d.ts.map +1 -0
- package/dist/model/node.d.ts +101 -0
- package/dist/model/node.d.ts.map +1 -0
- package/dist/model/nodeInfo.d.ts +278 -0
- package/dist/model/nodeInfo.d.ts.map +1 -0
- package/dist/model/rankEntry.d.ts +80 -0
- package/dist/model/rankEntry.d.ts.map +1 -0
- package/dist/ortho/chan-dict.d.ts +82 -0
- package/dist/ortho/chan-dict.d.ts.map +1 -0
- package/dist/ortho/fpq.d.ts +54 -0
- package/dist/ortho/fpq.d.ts.map +1 -0
- package/dist/ortho/index.d.ts +35 -0
- package/dist/ortho/index.d.ts.map +1 -0
- package/dist/ortho/maze-channels.d.ts +47 -0
- package/dist/ortho/maze-channels.d.ts.map +1 -0
- package/dist/ortho/maze.d.ts +27 -0
- package/dist/ortho/maze.d.ts.map +1 -0
- package/dist/ortho/ortho-parallel.d.ts +26 -0
- package/dist/ortho/ortho-parallel.d.ts.map +1 -0
- package/dist/ortho/ortho-route.d.ts +31 -0
- package/dist/ortho/ortho-route.d.ts.map +1 -0
- package/dist/ortho/partition.d.ts +34 -0
- package/dist/ortho/partition.d.ts.map +1 -0
- package/dist/ortho/rawgraph.d.ts +41 -0
- package/dist/ortho/rawgraph.d.ts.map +1 -0
- package/dist/ortho/sgraph.d.ts +74 -0
- package/dist/ortho/sgraph.d.ts.map +1 -0
- package/dist/ortho/trap-query.d.ts +32 -0
- package/dist/ortho/trap-query.d.ts.map +1 -0
- package/dist/ortho/trap-segment.d.ts +23 -0
- package/dist/ortho/trap-segment.d.ts.map +1 -0
- package/dist/ortho/trap-types.d.ts +91 -0
- package/dist/ortho/trap-types.d.ts.map +1 -0
- package/dist/ortho/trap-update.d.ts +12 -0
- package/dist/ortho/trap-update.d.ts.map +1 -0
- package/dist/ortho/trapezoid.d.ts +18 -0
- package/dist/ortho/trapezoid.d.ts.map +1 -0
- package/dist/ortho/types.d.ts +241 -0
- package/dist/ortho/types.d.ts.map +1 -0
- package/dist/parser/ast.d.ts +49 -0
- package/dist/parser/ast.d.ts.map +1 -0
- package/dist/parser/builder.d.ts +75 -0
- package/dist/parser/builder.d.ts.map +1 -0
- package/dist/parser/index.d.ts +97 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/pathplan/index.d.ts +8 -0
- package/dist/pathplan/index.d.ts.map +1 -0
- package/dist/pathplan/route.d.ts +9 -0
- package/dist/pathplan/route.d.ts.map +1 -0
- package/dist/pathplan/shortest.d.ts +5 -0
- package/dist/pathplan/shortest.d.ts.map +1 -0
- package/dist/pathplan/solvers.d.ts +5 -0
- package/dist/pathplan/solvers.d.ts.map +1 -0
- package/dist/pathplan/triang.d.ts +25 -0
- package/dist/pathplan/triang.d.ts.map +1 -0
- package/dist/pathplan/types.d.ts +22 -0
- package/dist/pathplan/types.d.ts.map +1 -0
- package/dist/pathplan/visibility.d.ts +13 -0
- package/dist/pathplan/visibility.d.ts.map +1 -0
- package/dist/pathplan/vispath.d.ts +9 -0
- package/dist/pathplan/vispath.d.ts.map +1 -0
- package/dist/rbtree/index.d.ts +127 -0
- package/dist/rbtree/index.d.ts.map +1 -0
- package/dist/render/color-resolve.d.ts +38 -0
- package/dist/render/color-resolve.d.ts.map +1 -0
- package/dist/render/dot.d.ts +379 -0
- package/dist/render/dot.d.ts.map +1 -0
- package/dist/render/index.d.ts +24 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/json.d.ts +89 -0
- package/dist/render/json.d.ts.map +1 -0
- package/dist/render/map-test-helpers.d.ts +13 -0
- package/dist/render/map-test-helpers.d.ts.map +1 -0
- package/dist/render/map.d.ts +197 -0
- package/dist/render/map.d.ts.map +1 -0
- package/dist/render/public.d.ts +64 -0
- package/dist/render/public.d.ts.map +1 -0
- package/dist/render/svg-arrow-ops.d.ts +10 -0
- package/dist/render/svg-arrow-ops.d.ts.map +1 -0
- package/dist/render/svg-cluster.d.ts +9 -0
- package/dist/render/svg-cluster.d.ts.map +1 -0
- package/dist/render/svg-edge-ortho-radius.d.ts +31 -0
- package/dist/render/svg-edge-ortho-radius.d.ts.map +1 -0
- package/dist/render/svg-edge-split.d.ts +48 -0
- package/dist/render/svg-edge-split.d.ts.map +1 -0
- package/dist/render/svg-gradient.d.ts +46 -0
- package/dist/render/svg-gradient.d.ts.map +1 -0
- package/dist/render/svg-graph.d.ts +97 -0
- package/dist/render/svg-graph.d.ts.map +1 -0
- package/dist/render/svg-helpers.d.ts +122 -0
- package/dist/render/svg-helpers.d.ts.map +1 -0
- package/dist/render/svg-id.d.ts +28 -0
- package/dist/render/svg-id.d.ts.map +1 -0
- package/dist/render/svg-multicolor.d.ts +60 -0
- package/dist/render/svg-multicolor.d.ts.map +1 -0
- package/dist/render/svg-parallel-edge.d.ts +28 -0
- package/dist/render/svg-parallel-edge.d.ts.map +1 -0
- package/dist/render/svg-tapered-edge.d.ts +18 -0
- package/dist/render/svg-tapered-edge.d.ts.map +1 -0
- package/dist/render/svg.d.ts +104 -0
- package/dist/render/svg.d.ts.map +1 -0
- package/dist/render/xdot-public.d.ts +95 -0
- package/dist/render/xdot-public.d.ts.map +1 -0
- package/dist/render/xml-escape.d.ts +21 -0
- package/dist/render/xml-escape.d.ts.map +1 -0
- package/dist/render.js +52556 -0
- package/dist/render.js.map +7 -0
- package/dist/util/agxbuf.d.ts +72 -0
- package/dist/util/agxbuf.d.ts.map +1 -0
- package/dist/util/bsd-qsort.d.ts +22 -0
- package/dist/util/bsd-qsort.d.ts.map +1 -0
- package/dist/util/index.d.ts +11 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/list.d.ts +47 -0
- package/dist/util/list.d.ts.map +1 -0
- package/dist/util/math.d.ts +54 -0
- package/dist/util/math.d.ts.map +1 -0
- package/dist/util/mt19937.d.ts +40 -0
- package/dist/util/mt19937.d.ts.map +1 -0
- package/dist/util/printf-round.d.ts +45 -0
- package/dist/util/printf-round.d.ts.map +1 -0
- package/dist/util/xml.d.ts +24 -0
- package/dist/util/xml.d.ts.map +1 -0
- package/dist/vpsc/Block.d.ts +116 -0
- package/dist/vpsc/Block.d.ts.map +1 -0
- package/dist/vpsc/Blocks.d.ts +66 -0
- package/dist/vpsc/Blocks.d.ts.map +1 -0
- package/dist/vpsc/Constraint.d.ts +51 -0
- package/dist/vpsc/Constraint.d.ts.map +1 -0
- package/dist/vpsc/HeapUtils.d.ts +37 -0
- package/dist/vpsc/HeapUtils.d.ts.map +1 -0
- package/dist/vpsc/Solver.d.ts +107 -0
- package/dist/vpsc/Solver.d.ts.map +1 -0
- package/dist/vpsc/SweepLine.d.ts +38 -0
- package/dist/vpsc/SweepLine.d.ts.map +1 -0
- package/dist/vpsc/Variable.d.ts +38 -0
- package/dist/vpsc/Variable.d.ts.map +1 -0
- package/dist/vpsc/index.d.ts +54 -0
- package/dist/vpsc/index.d.ts.map +1 -0
- package/dist/vpsc/sweepTypes.d.ts +29 -0
- package/dist/vpsc/sweepTypes.d.ts.map +1 -0
- package/dist/xdot/index.d.ts +6 -0
- package/dist/xdot/index.d.ts.map +1 -0
- package/dist/xdot/lex.d.ts +22 -0
- package/dist/xdot/lex.d.ts.map +1 -0
- package/dist/xdot/misc.d.ts +13 -0
- package/dist/xdot/misc.d.ts.map +1 -0
- package/dist/xdot/parse.d.ts +21 -0
- package/dist/xdot/parse.d.ts.map +1 -0
- package/dist/xdot/types.d.ts +152 -0
- package/dist/xdot/types.d.ts.map +1 -0
- package/package.json +113 -0
- package/src/api/builder.ts +277 -0
- package/src/api/edge-ops.ts +113 -0
- package/src/api/geometry.ts +307 -0
- package/src/api/index.ts +46 -0
- package/src/cdt/bag.ts +196 -0
- package/src/cdt/hash-core.ts +84 -0
- package/src/cdt/hash.ts +207 -0
- package/src/cdt/index.ts +17 -0
- package/src/cdt/splay-core.ts +301 -0
- package/src/cdt/splay.ts +191 -0
- package/src/cdt/strhash.ts +52 -0
- package/src/cdt/types.ts +13 -0
- package/src/common/arith.ts +39 -0
- package/src/common/arm-pow-data.ts +201 -0
- package/src/common/arm-pow.ts +296 -0
- package/src/common/arrows-constants.ts +175 -0
- package/src/common/arrows-geometry.ts +62 -0
- package/src/common/arrows-miter.ts +84 -0
- package/src/common/arrows-shapes-poly.ts +241 -0
- package/src/common/arrows-shapes-util.ts +162 -0
- package/src/common/arrows-shapes.ts +360 -0
- package/src/common/arrows-types.ts +59 -0
- package/src/common/arrows.ts +209 -0
- package/src/common/color.ts +340 -0
- package/src/common/colorData.ts +264 -0
- package/src/common/compass-port.ts +384 -0
- package/src/common/crand.ts +79 -0
- package/src/common/edge-label-init.ts +310 -0
- package/src/common/edge-offset.ts +140 -0
- package/src/common/ellipse-wedge.ts +189 -0
- package/src/common/emit-types.ts +332 -0
- package/src/common/fma.ts +52 -0
- package/src/common/graph-init.ts +359 -0
- package/src/common/html-entities.ts +299 -0
- package/src/common/html-string.ts +22 -0
- package/src/common/htmltable-emit-fill.ts +367 -0
- package/src/common/htmltable-emit-rules.ts +293 -0
- package/src/common/htmltable-emit.ts +345 -0
- package/src/common/htmltable-lex.ts +138 -0
- package/src/common/htmltable-parse.ts +539 -0
- package/src/common/htmltable-port.ts +32 -0
- package/src/common/htmltable-pos-runs.ts +313 -0
- package/src/common/htmltable-pos.ts +601 -0
- package/src/common/htmltable-types.ts +262 -0
- package/src/common/htmltable.ts +477 -0
- package/src/common/layers.ts +113 -0
- package/src/common/make-label.ts +192 -0
- package/src/common/multicolor.ts +167 -0
- package/src/common/nodeinit.ts +339 -0
- package/src/common/poly-gencode.ts +475 -0
- package/src/common/poly-init.ts +133 -0
- package/src/common/poly-inside.ts +202 -0
- package/src/common/poly-shapes-cases.ts +253 -0
- package/src/common/poly-shapes-cases2.ts +170 -0
- package/src/common/poly-shapes-util.ts +124 -0
- package/src/common/poly-shapes.ts +181 -0
- package/src/common/poly-sizing.ts +639 -0
- package/src/common/poly-vertices.ts +237 -0
- package/src/common/postproc.ts +436 -0
- package/src/common/ps-fontalias.ts +112 -0
- package/src/common/random.ts +37 -0
- package/src/common/record-port.ts +89 -0
- package/src/common/record.ts +523 -0
- package/src/common/shapeData.ts +502 -0
- package/src/common/shapes.ts +187 -0
- package/src/common/spline-midpoint.ts +105 -0
- package/src/common/splines-clip.ts +449 -0
- package/src/common/splines-constants.ts +53 -0
- package/src/common/splines-geom.ts +194 -0
- package/src/common/splines-path-begin.ts +243 -0
- package/src/common/splines-path-end.ts +231 -0
- package/src/common/splines-path-shared.ts +258 -0
- package/src/common/splines-routespl.ts +444 -0
- package/src/common/splines-selfedge.ts +403 -0
- package/src/common/splines.ts +33 -0
- package/src/common/style-resolve.ts +481 -0
- package/src/common/subst.ts +126 -0
- package/src/common/taper.ts +219 -0
- package/src/common/textmeasure-factory.ts +86 -0
- package/src/common/textmeasure-lookup.ts +50 -0
- package/src/common/textmeasure-lut-data-a.ts +182 -0
- package/src/common/textmeasure-lut-data-b.ts +140 -0
- package/src/common/textmeasure-lut-data-c.ts +221 -0
- package/src/common/textmeasure-lut-data.ts +78 -0
- package/src/common/textmeasure.ts +321 -0
- package/src/common/types.ts +425 -0
- package/src/common/xlabels-place.ts +475 -0
- package/src/debug.ts +38 -0
- package/src/errors.ts +95 -0
- package/src/gvc/anchor.ts +530 -0
- package/src/gvc/context.ts +260 -0
- package/src/gvc/default-context.ts +70 -0
- package/src/gvc/device-cluster.ts +114 -0
- package/src/gvc/device.ts +598 -0
- package/src/gvc/edge-labels.ts +116 -0
- package/src/gvc/emit-walk.ts +98 -0
- package/src/gvc/image-resolver.ts +137 -0
- package/src/gvc/job.ts +401 -0
- package/src/gvc/textlayout.ts +44 -0
- package/src/gvc/textspan-emit.ts +100 -0
- package/src/gvc/usershape.ts +33 -0
- package/src/gvc/viewport.ts +203 -0
- package/src/index.ts +165 -0
- package/src/label/index.ts +302 -0
- package/src/label/node.ts +278 -0
- package/src/label/rectangle.ts +123 -0
- package/src/label/split-q.ts +237 -0
- package/src/label/xlabels-geom.ts +132 -0
- package/src/label/xlabels-intersect.ts +421 -0
- package/src/label/xlabels.ts +212 -0
- package/src/layout/circo/blockpath.ts +560 -0
- package/src/layout/circo/blocks.ts +234 -0
- package/src/layout/circo/blocktree.ts +246 -0
- package/src/layout/circo/circular.ts +227 -0
- package/src/layout/circo/index.ts +90 -0
- package/src/layout/circo/init.ts +84 -0
- package/src/layout/circo/position-helpers.ts +104 -0
- package/src/layout/circo/position.ts +196 -0
- package/src/layout/dot/__fixtures__/xcoord-pivot-divergence.gv +79 -0
- package/src/layout/dot/acyclic.ts +60 -0
- package/src/layout/dot/aspect.ts +22 -0
- package/src/layout/dot/classify.ts +462 -0
- package/src/layout/dot/cluster-path.ts +200 -0
- package/src/layout/dot/cluster.ts +480 -0
- package/src/layout/dot/compound-clip.ts +224 -0
- package/src/layout/dot/compound-geom.ts +282 -0
- package/src/layout/dot/compound.ts +294 -0
- package/src/layout/dot/conc.ts +433 -0
- package/src/layout/dot/decomp.ts +165 -0
- package/src/layout/dot/edge-order.ts +62 -0
- package/src/layout/dot/edge-route-arrow.ts +87 -0
- package/src/layout/dot/edge-route-boxes.ts +99 -0
- package/src/layout/dot/edge-route-chain.ts +420 -0
- package/src/layout/dot/edge-route-clip.ts +253 -0
- package/src/layout/dot/edge-route-faithful.ts +404 -0
- package/src/layout/dot/edge-route-geom.ts +90 -0
- package/src/layout/dot/edge-route-helpers.ts +170 -0
- package/src/layout/dot/edge-route-poly.ts +174 -0
- package/src/layout/dot/edge-route-rank.ts +136 -0
- package/src/layout/dot/edge-route-routing.ts +219 -0
- package/src/layout/dot/edge-route.ts +490 -0
- package/src/layout/dot/fastgr.ts +377 -0
- package/src/layout/dot/flat-utils.ts +52 -0
- package/src/layout/dot/flat.ts +518 -0
- package/src/layout/dot/graph-label.ts +114 -0
- package/src/layout/dot/index.ts +302 -0
- package/src/layout/dot/init.ts +300 -0
- package/src/layout/dot/label-order.ts +161 -0
- package/src/layout/dot/mincross-build.ts +373 -0
- package/src/layout/dot/mincross-cross.ts +409 -0
- package/src/layout/dot/mincross-flat.ts +213 -0
- package/src/layout/dot/mincross-order.ts +401 -0
- package/src/layout/dot/mincross-utils.ts +170 -0
- package/src/layout/dot/mincross.ts +386 -0
- package/src/layout/dot/ns-core.ts +122 -0
- package/src/layout/dot/ns-range.ts +228 -0
- package/src/layout/dot/ns-subtree.ts +347 -0
- package/src/layout/dot/ns.ts +506 -0
- package/src/layout/dot/ortho-adapter.ts +133 -0
- package/src/layout/dot/pack-components.ts +433 -0
- package/src/layout/dot/position-aux.ts +382 -0
- package/src/layout/dot/position-bbox.ts +221 -0
- package/src/layout/dot/position-cluster.ts +286 -0
- package/src/layout/dot/position-ycoords.ts +287 -0
- package/src/layout/dot/position.ts +194 -0
- package/src/layout/dot/rank-dot2.ts +528 -0
- package/src/layout/dot/rank.ts +547 -0
- package/src/layout/dot/sameport.ts +278 -0
- package/src/layout/dot/self-loop.ts +147 -0
- package/src/layout/dot/splines-clone.ts +121 -0
- package/src/layout/dot/splines-flat-labeled.ts +408 -0
- package/src/layout/dot/splines-flat-multi.ts +188 -0
- package/src/layout/dot/splines-flat.ts +598 -0
- package/src/layout/dot/splines-groups.ts +190 -0
- package/src/layout/dot/splines-label.ts +432 -0
- package/src/layout/dot/splines-route-type.ts +44 -0
- package/src/layout/dot/splines-route.ts +478 -0
- package/src/layout/dot/splines.ts +538 -0
- package/src/layout/dot/straight-edges.ts +332 -0
- package/src/layout/fdp/cluster-edges.ts +0 -0
- package/src/layout/fdp/comp.ts +160 -0
- package/src/layout/fdp/derive.ts +272 -0
- package/src/layout/fdp/fdp-model.ts +238 -0
- package/src/layout/fdp/grid.ts +77 -0
- package/src/layout/fdp/index.ts +113 -0
- package/src/layout/fdp/init.ts +116 -0
- package/src/layout/fdp/layout.ts +485 -0
- package/src/layout/fdp/normalize.ts +100 -0
- package/src/layout/fdp/ports.ts +161 -0
- package/src/layout/fdp/tlayout-init.ts +230 -0
- package/src/layout/fdp/tlayout-parms.ts +234 -0
- package/src/layout/fdp/tlayout.ts +317 -0
- package/src/layout/fdp/xlayout.ts +350 -0
- package/src/layout/neato/bfs.ts +131 -0
- package/src/layout/neato/cdt-surface.ts +693 -0
- package/src/layout/neato/conjgrad.ts +159 -0
- package/src/layout/neato/delaunay.ts +259 -0
- package/src/layout/neato/dijkstra.ts +296 -0
- package/src/layout/neato/fdp-adjust.ts +124 -0
- package/src/layout/neato/index.ts +310 -0
- package/src/layout/neato/init.ts +505 -0
- package/src/layout/neato/legal.ts +316 -0
- package/src/layout/neato/matrix-ops.ts +112 -0
- package/src/layout/neato/multispline-router.ts +417 -0
- package/src/layout/neato/multispline.ts +427 -0
- package/src/layout/neato/overlap-prism.ts +503 -0
- package/src/layout/neato/overlap.ts +158 -0
- package/src/layout/neato/sc-adjust.ts +206 -0
- package/src/layout/neato/sep-factor.ts +118 -0
- package/src/layout/neato/set-aspect.ts +178 -0
- package/src/layout/neato/sgd.ts +461 -0
- package/src/layout/neato/splines.ts +1014 -0
- package/src/layout/neato/stress-kernel.ts +362 -0
- package/src/layout/neato/stress.ts +420 -0
- package/src/layout/osage/index.ts +548 -0
- package/src/layout/osage/layout.ts +254 -0
- package/src/layout/osage/types.ts +31 -0
- package/src/layout/pack/array-pack.ts +254 -0
- package/src/layout/pack/index.ts +570 -0
- package/src/layout/pack/poly-pack.ts +266 -0
- package/src/layout/pack/poly-place.ts +426 -0
- package/src/layout/pack/spiral-search.ts +106 -0
- package/src/layout/pack/test-helpers.ts +46 -0
- package/src/layout/pack/types.ts +85 -0
- package/src/layout/patchwork/index.ts +441 -0
- package/src/layout/patchwork/tree-map.ts +183 -0
- package/src/layout/patchwork/tree-node.ts +120 -0
- package/src/layout/sfdp/index.ts +231 -0
- package/src/layout/sfdp/init.ts +224 -0
- package/src/layout/sfdp/multilevel.ts +262 -0
- package/src/layout/sfdp/quadtree.ts +267 -0
- package/src/layout/sfdp/sparse-matrix-multiply.ts +160 -0
- package/src/layout/sfdp/sparse-matrix.ts +367 -0
- package/src/layout/sfdp/sparse-solve.ts +122 -0
- package/src/layout/sfdp/spring-driver.ts +209 -0
- package/src/layout/sfdp/spring-electrical.ts +431 -0
- package/src/layout/twopi/circle.ts +339 -0
- package/src/layout/twopi/index.ts +78 -0
- package/src/layout/twopi/init.ts +174 -0
- package/src/layout/twopi/pipeline.ts +98 -0
- package/src/layout/twopi/twopi-test-helpers.ts +44 -0
- package/src/model/algData.ts +194 -0
- package/src/model/cgraph-ops.ts +175 -0
- package/src/model/edge.ts +104 -0
- package/src/model/edgeInfo.ts +431 -0
- package/src/model/geom.ts +204 -0
- package/src/model/graph.ts +172 -0
- package/src/model/graphInfo.ts +528 -0
- package/src/model/index.ts +10 -0
- package/src/model/layoutParams.ts +127 -0
- package/src/model/node.ts +138 -0
- package/src/model/nodeInfo.ts +424 -0
- package/src/model/rankEntry.ts +95 -0
- package/src/ortho/chan-dict.ts +236 -0
- package/src/ortho/fpq.ts +149 -0
- package/src/ortho/index.ts +206 -0
- package/src/ortho/maze-channels.ts +196 -0
- package/src/ortho/maze.ts +311 -0
- package/src/ortho/ortho-parallel.ts +254 -0
- package/src/ortho/ortho-route.ts +349 -0
- package/src/ortho/partition.ts +303 -0
- package/src/ortho/rawgraph.ts +119 -0
- package/src/ortho/sgraph.ts +283 -0
- package/src/ortho/trap-query.ts +174 -0
- package/src/ortho/trap-segment.ts +303 -0
- package/src/ortho/trap-types.ts +171 -0
- package/src/ortho/trap-update.ts +89 -0
- package/src/ortho/trapezoid.ts +120 -0
- package/src/ortho/types.ts +286 -0
- package/src/parser/__fixtures__/directed.dot +10 -0
- package/src/parser/__fixtures__/simple.dot +7 -0
- package/src/parser/__fixtures__/subgraph.dot +17 -0
- package/src/parser/ast.ts +64 -0
- package/src/parser/builder.ts +401 -0
- package/src/parser/dot.d.ts +208 -0
- package/src/parser/dot.js +3321 -0
- package/src/parser/dot.pegjs +263 -0
- package/src/parser/index.ts +353 -0
- package/src/pathplan/index.ts +9 -0
- package/src/pathplan/route.ts +284 -0
- package/src/pathplan/shortest.ts +268 -0
- package/src/pathplan/solvers.ts +65 -0
- package/src/pathplan/triang.ts +221 -0
- package/src/pathplan/types.ts +16 -0
- package/src/pathplan/visibility.ts +170 -0
- package/src/pathplan/vispath.ts +118 -0
- package/src/rbtree/index.ts +418 -0
- package/src/render/color-resolve.ts +171 -0
- package/src/render/dot.ts +1514 -0
- package/src/render/index.ts +29 -0
- package/src/render/json.ts +734 -0
- package/src/render/map-test-helpers.ts +61 -0
- package/src/render/map.ts +528 -0
- package/src/render/public.ts +131 -0
- package/src/render/svg-arrow-ops.ts +113 -0
- package/src/render/svg-cluster.ts +24 -0
- package/src/render/svg-edge-ortho-radius.ts +228 -0
- package/src/render/svg-edge-split.ts +180 -0
- package/src/render/svg-gradient.ts +185 -0
- package/src/render/svg-graph.ts +415 -0
- package/src/render/svg-helpers.ts +623 -0
- package/src/render/svg-id.ts +76 -0
- package/src/render/svg-multicolor.ts +313 -0
- package/src/render/svg-parallel-edge.ts +123 -0
- package/src/render/svg-tapered-edge.ts +56 -0
- package/src/render/svg.ts +307 -0
- package/src/render/xdot-public.ts +164 -0
- package/src/render/xml-escape.ts +56 -0
- package/src/util/agxbuf.ts +138 -0
- package/src/util/bsd-qsort.ts +251 -0
- package/src/util/index.ts +25 -0
- package/src/util/list.ts +122 -0
- package/src/util/math.ts +104 -0
- package/src/util/mt19937.ts +143 -0
- package/src/util/printf-round.ts +163 -0
- package/src/util/xml.ts +184 -0
- package/src/vpsc/Block.ts +375 -0
- package/src/vpsc/Blocks.ts +164 -0
- package/src/vpsc/Constraint.ts +94 -0
- package/src/vpsc/HeapUtils.ts +88 -0
- package/src/vpsc/Solver.ts +274 -0
- package/src/vpsc/SweepLine.ts +214 -0
- package/src/vpsc/Variable.ts +54 -0
- package/src/vpsc/index.ts +122 -0
- package/src/vpsc/sweepTypes.ts +31 -0
- package/src/xdot/index.ts +7 -0
- package/src/xdot/lex.ts +151 -0
- package/src/xdot/misc.ts +226 -0
- package/src/xdot/parse.ts +349 -0
- package/src/xdot/types.ts +158 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Arrowhead polygon geometry for dot-layout edge rendering.
|
|
5
|
+
*
|
|
6
|
+
* @see lib/common/arrows.c:arrow_type_normal0
|
|
7
|
+
* @see lib/common/arrows.c:miter_shape
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { Point } from '../../model/geom.js';
|
|
11
|
+
import { normalizeVec } from './edge-route-geom.js';
|
|
12
|
+
import { parseArrow, resolveArrowType } from '../../common/arrows.js';
|
|
13
|
+
import { arrowDrawOps } from '../../common/arrows-shapes.js';
|
|
14
|
+
import type { ArrowDrawOp } from '../../common/arrows-types.js';
|
|
15
|
+
|
|
16
|
+
/** Arrow length in points. @see lib/common/arrows.c:#define ARROW_LENGTH 10. */
|
|
17
|
+
export const ARROW_LENGTH = 10;
|
|
18
|
+
|
|
19
|
+
/** Arrow width factor. @see lib/common/arrows.c:arrowwidth = 0.35 */
|
|
20
|
+
export const ARROW_WIDTH_FACTOR = 0.35;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Three-point arrowhead polygon: [rightBase, adj_tip, leftBase].
|
|
24
|
+
*
|
|
25
|
+
* Matches C's arrow_type_normal0 for a standard "normal" arrowhead:
|
|
26
|
+
* 1. delta_tip correction shifts both the polygon tip and base TOWARD the
|
|
27
|
+
* shaft by the miter-join extension length, so the filled polygon covers
|
|
28
|
+
* the miter join produced by the SVG renderer at the sharp tip vertex.
|
|
29
|
+
* Formula: (penwidth / (2 * arrowwidth)) * sqrt(1 + arrowwidth^2)
|
|
30
|
+
* 2. Polygon order is [a[1]=right_base, a[2]=adj_tip, a[3]=left_base]
|
|
31
|
+
* (matching gvrender_polygon(job, &a[1], 3)).
|
|
32
|
+
*
|
|
33
|
+
* @see lib/common/arrows.c:arrow_type_normal0
|
|
34
|
+
* @see lib/common/arrows.c:miter_shape
|
|
35
|
+
*/
|
|
36
|
+
export function arrowheadPolygon(arrowTip: Point, arrowDir: Point, penwidth = 1.0): Point[] {
|
|
37
|
+
const dir = normalizeVec(arrowDir);
|
|
38
|
+
const delta = (penwidth / (2 * ARROW_WIDTH_FACTOR)) * Math.sqrt(1 + ARROW_WIDTH_FACTOR * ARROW_WIDTH_FACTOR);
|
|
39
|
+
const adj_tip: Point = { x: arrowTip.x + dir.x * delta, y: arrowTip.y + dir.y * delta };
|
|
40
|
+
const adj_base: Point = {
|
|
41
|
+
x: arrowTip.x + dir.x * (ARROW_LENGTH + delta),
|
|
42
|
+
y: arrowTip.y + dir.y * (ARROW_LENGTH + delta),
|
|
43
|
+
};
|
|
44
|
+
const hw = ARROW_LENGTH * ARROW_WIDTH_FACTOR;
|
|
45
|
+
const perp: Point = { x: -dir.y * hw, y: dir.x * hw };
|
|
46
|
+
return [
|
|
47
|
+
{ x: adj_base.x - perp.x, y: adj_base.y - perp.y }, // a[1] = right base
|
|
48
|
+
adj_tip, // a[2] = tip
|
|
49
|
+
{ x: adj_base.x + perp.x, y: adj_base.y + perp.y }, // a[3] = left base
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Per-type arrow draw-op dispatch (ADR-1/ADR-2) — replaces the normal-only
|
|
55
|
+
// arrowheadPolygon at the layout storage sites.
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
/** Minimal edge shape exposing the arrow-related attributes. */
|
|
59
|
+
interface ArrowAttrEdge { attrs: Map<string, string> }
|
|
60
|
+
|
|
61
|
+
/** The arrowhead/arrowtail name for an edge end (default "normal"). */
|
|
62
|
+
export function edgeArrowName(e: ArrowAttrEdge, end: 'head' | 'tail'): string {
|
|
63
|
+
return e.attrs.get(end === 'head' ? 'arrowhead' : 'arrowtail') ?? 'normal';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The `arrowsize` edge attribute (default 1.0; clamped to ≥0 like late_double). */
|
|
67
|
+
export function edgeArrowsize(e: ArrowAttrEdge): number {
|
|
68
|
+
const s = parseFloat(e.attrs.get('arrowsize') ?? '');
|
|
69
|
+
return Number.isFinite(s) ? Math.max(s, 0) : 1.0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Typed arrow draw-ops for one edge end: reads `arrowhead`/`arrowtail` +
|
|
74
|
+
* `arrowsize`, resolves the compound arrow type, and dispatches to the full
|
|
75
|
+
* geometry table (`arrowDrawOps`). `tip` is the node-boundary point, `dir`
|
|
76
|
+
* points from tip toward the shaft (away from the node).
|
|
77
|
+
*
|
|
78
|
+
* @see lib/common/arrows.c:arrow_gen
|
|
79
|
+
*/
|
|
80
|
+
export function arrowDrawOpsForEnd(
|
|
81
|
+
e: ArrowAttrEdge, end: 'head' | 'tail', tip: Point, dir: Point, penwidth: number,
|
|
82
|
+
): ArrowDrawOp[] {
|
|
83
|
+
const comps = parseArrow(edgeArrowName(e, end)).map(resolveArrowType);
|
|
84
|
+
// Pass the RAW direction (not normalized): componentU reproduces arrow_gen's
|
|
85
|
+
// EPSILON normalization, which is relative to the raw shaft magnitude.
|
|
86
|
+
return arrowDrawOps(comps, tip, dir, edgeArrowsize(e), penwidth);
|
|
87
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Box assembly helpers for edge spline routing.
|
|
5
|
+
*
|
|
6
|
+
* Constructs the path boxes (tail, rank, head) that define the corridor
|
|
7
|
+
* through which a spline is routed.
|
|
8
|
+
*
|
|
9
|
+
* @see lib/common/splines.c:beginpath
|
|
10
|
+
* @see lib/common/splines.c:endpath
|
|
11
|
+
* @see lib/dotgen/dotsplines.c:rank_box
|
|
12
|
+
* @see lib/dotgen/dotsplines.c:maximal_bbox
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { Box } from '../../model/geom.js';
|
|
16
|
+
import type { NodeBox } from './edge-route-geom.js';
|
|
17
|
+
|
|
18
|
+
/** FUDGE padding added around node x-extents in maximal_bbox. */
|
|
19
|
+
const FUDGE = 2;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Assemble the tail-side box (beginpath, REGULAREDGE, no port).
|
|
23
|
+
*
|
|
24
|
+
* C sets boxes[0].UR.y = start.p.y. In TS SVG coords C's UR.y maps to
|
|
25
|
+
* our ll.y. The tail box spans ll.y=startPy (center) to ur.y (bottom).
|
|
26
|
+
*
|
|
27
|
+
* @see lib/common/splines.c:beginpath
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Tail box: nb with ur.y overridden to startPy (= beginpath UR.y = center.y).
|
|
31
|
+
* C: endp->boxes[0] = nb; endp->boxes[0].UR.y = P->start.p.y
|
|
32
|
+
* @see lib/common/splines.c:beginpath REGULAREDGE case
|
|
33
|
+
*/
|
|
34
|
+
export function makeTailBox(nb: Box, startPy: number): Box {
|
|
35
|
+
return { ll: nb.ll, ur: { x: nb.ur.x, y: startPy } };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Assemble the head-side box (endpath, REGULAREDGE, no port).
|
|
40
|
+
*
|
|
41
|
+
* C sets boxes[0].LL.y = end.p.y. In TS SVG coords C's LL.y maps to
|
|
42
|
+
* our ur.y. The head box spans ll.y (top) to ur.y=endPy (center).
|
|
43
|
+
*
|
|
44
|
+
* @see lib/common/splines.c:endpath
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Head box: nb with ll.y overridden to endPy (= endpath LL.y = center.y).
|
|
48
|
+
* C: endp->boxes[0] = nb; endp->boxes[0].LL.y = P->end.p.y
|
|
49
|
+
* @see lib/common/splines.c:endpath REGULAREDGE case
|
|
50
|
+
*/
|
|
51
|
+
export function makeHeadBox(nb: Box, endPy: number): Box {
|
|
52
|
+
return { ll: { x: nb.ll.x, y: endPy }, ur: nb.ur };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Parameters for makeRankBox — avoids a 6-parameter signature. */
|
|
56
|
+
export interface RankBoxParams {
|
|
57
|
+
llx: number;
|
|
58
|
+
urx: number;
|
|
59
|
+
tailCy: number;
|
|
60
|
+
tailHt1: number;
|
|
61
|
+
headCy: number;
|
|
62
|
+
headHt2: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Inter-rank space box between two adjacent ranks.
|
|
67
|
+
*
|
|
68
|
+
* In TS SVG coords: ll.y = tailCy+tailHt1 (bottom of tail node),
|
|
69
|
+
* ur.y = headCy-headHt2 (top of head node).
|
|
70
|
+
*
|
|
71
|
+
* @see lib/dotgen/dotsplines.c:rank_box
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* Inter-rank space box: from head node top (ll.y) to tail node bottom (ur.y).
|
|
75
|
+
* C: ll.y = headCy + headHt2 (= B.top = 90+18=108)
|
|
76
|
+
* ur.y = tailCy - tailHt1 (= A.bottom = 162-18=144)
|
|
77
|
+
* @see lib/dotgen/dotsplines.c:rank_box
|
|
78
|
+
*/
|
|
79
|
+
export function makeRankBox(p: RankBoxParams): Box {
|
|
80
|
+
return {
|
|
81
|
+
ll: { x: p.llx, y: p.headCy + p.headHt2 },
|
|
82
|
+
ur: { x: p.urx, y: p.tailCy - p.tailHt1 },
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Node bounding box for maximal_bbox (simple node, no neighbors).
|
|
88
|
+
*
|
|
89
|
+
* ll = { x: cx-lw-FUDGE, y: cy-ht1 } (top-left in SVG)
|
|
90
|
+
* ur = { x: cx+rw+FUDGE, y: cy+ht2 } (bottom-right in SVG)
|
|
91
|
+
*
|
|
92
|
+
* @see lib/dotgen/dotsplines.c:maximal_bbox
|
|
93
|
+
*/
|
|
94
|
+
export function makeMaximalBbox(box: NodeBox, ht1: number, ht2: number): Box {
|
|
95
|
+
return {
|
|
96
|
+
ll: { x: box.center.x - box.lw - FUDGE, y: box.center.y - ht1 },
|
|
97
|
+
ur: { x: box.center.x + box.rw + FUDGE, y: box.center.y + ht2 },
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Multi-rank edge routing via virtual-node chains.
|
|
5
|
+
*
|
|
6
|
+
* Both back-edges (tail.rank > head.rank) and forward edges spanning
|
|
7
|
+
* more than one rank (head.rank > tail.rank + 1) are routed by
|
|
8
|
+
* walking the virtual-node chain that class2/makeChain created and
|
|
9
|
+
* building a corridor-box path through every intermediate rank.
|
|
10
|
+
*
|
|
11
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge (hackflag path)
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { Graph } from '../../model/graph.js';
|
|
15
|
+
import type { Edge as GraphEdge } from '../../model/edge.js';
|
|
16
|
+
import type { Point, Box } from '../../model/geom.js';
|
|
17
|
+
import type { Node } from '../../model/node.js';
|
|
18
|
+
import { VIRTUAL, NORMAL } from './fastgr.js';
|
|
19
|
+
import type { NodeBox } from './edge-route-geom.js';
|
|
20
|
+
import { getSplineBounds } from './edge-route-rank.js';
|
|
21
|
+
import type { Path, PathendT } from '../../common/types.js';
|
|
22
|
+
import { makePort } from '../../model/edgeInfo.js';
|
|
23
|
+
import { beginPath } from '../../common/splines-path-begin.js';
|
|
24
|
+
import { endPath } from '../../common/splines-path-end.js';
|
|
25
|
+
import { routeRegularByType } from './splines-route-type.js';
|
|
26
|
+
import { edgeType, EDGETYPE_LINE, resolveOrigEdge, swapEndsP, swapEdgeSpline } from './splines.js';
|
|
27
|
+
import { clipAndInstall } from '../../common/splines-clip.js';
|
|
28
|
+
import { buildDotSinfo } from './self-loop.js';
|
|
29
|
+
import { TOP, BOTTOM, REGULAREDGE } from '../../common/splines-constants.js';
|
|
30
|
+
import { splineMerge, makeLineEdge, resizeVn, straightLen, straightPath } from './splines-route.js';
|
|
31
|
+
import { EDGE_LABEL } from './rank.js';
|
|
32
|
+
import type { RankEntry } from '../../model/rankEntry.js';
|
|
33
|
+
import { rankHt } from './edge-route-rank.js';
|
|
34
|
+
import { graphRanksep } from './position-aux.js';
|
|
35
|
+
import {
|
|
36
|
+
maximalBbox, appendRegularEnd, freshEndp, rankBox, completeRegularPath,
|
|
37
|
+
type BboxCtx,
|
|
38
|
+
} from './edge-route-faithful.js';
|
|
39
|
+
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Faithful multi-rank side-port routing (make_regular_edge hackflag path)
|
|
42
|
+
// @see lib/dotgen/dotsplines.c:make_regular_edge (forward, abs(rankdiff) > 1)
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
|
|
45
|
+
/** Per-call spline bounds. Splinesep = nodesep/4 (C's sd.Splinesep,
|
|
46
|
+
* dotsplines.c:267) sets the gap to VIRTUAL neighbors in maximal_bbox, which
|
|
47
|
+
* the chain's virtual nodes exercise. C's GD_nodesep is an `int` (types.h:334)
|
|
48
|
+
* and the divide is INTEGER (18/4=4); a float divide here (4.5) makes
|
|
49
|
+
* maximal_bbox's round() straddle the boundary, shifting a virtual-node box
|
|
50
|
+
* wall 1px and forcing an extra bezier piece on near-straight long edges
|
|
51
|
+
* (rankdir_dot Unix/TS 3.0->TS 4.0). Truncate to mirror C. */
|
|
52
|
+
function chainBboxCtx(g: Graph): BboxCtx {
|
|
53
|
+
return {
|
|
54
|
+
g,
|
|
55
|
+
sp: {
|
|
56
|
+
...getSplineBounds(g),
|
|
57
|
+
splinesep: Math.trunc((g.info.nodesep ?? 18) / 4),
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Segment edges of a forward virtual chain: tail→v1, v1→v2, …, vk→head. */
|
|
63
|
+
function chainSegments(e: GraphEdge): GraphEdge[] {
|
|
64
|
+
const segs: GraphEdge[] = [];
|
|
65
|
+
let cur = e.info.to_virt;
|
|
66
|
+
while (cur !== undefined) {
|
|
67
|
+
// Resolve the concentrate merge redirect to the representative chain (C: for
|
|
68
|
+
// rep=e; ED_to_virt(rep); rep=ED_to_virt(rep)). @see lib/dotgen/conc.c:rebuild_vlists
|
|
69
|
+
while (cur.info.to_virt !== undefined) cur = cur.info.to_virt;
|
|
70
|
+
segs.push(cur);
|
|
71
|
+
if (cur.head === e.head) break;
|
|
72
|
+
const out = cur.head.info.out;
|
|
73
|
+
cur = out !== undefined && out.size > 0 ? out.list[0] : undefined;
|
|
74
|
+
}
|
|
75
|
+
return segs;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** beginPath/endPath args for a single non-merged REGULAREDGE chain segment. */
|
|
79
|
+
function chainPathArgs(P: Path, e: GraphEdge, endp: PathendT, merge: boolean, ranksep: number) {
|
|
80
|
+
return { P, e, et: REGULAREDGE, endp, merge, ranksep };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** True when n is a non-merged virtual chain node (the C while-loop guard). */
|
|
84
|
+
function isChainVirtual(n: Node): boolean {
|
|
85
|
+
return (n.info.node_type ?? NORMAL) === VIRTUAL && !splineMerge(n);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* straight_len smode threshold: a collinear run is segmented once it is ≥ 5
|
|
90
|
+
* (4+1) with edge labels on the root graph, else ≥ 3 (2+1).
|
|
91
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge (GD_has_labels & EDGE_LABEL)
|
|
92
|
+
*/
|
|
93
|
+
function smodeThreshold(g: Graph): number {
|
|
94
|
+
return ((g.root.info.has_labels ?? 0) & EDGE_LABEL) ? 5 : 3;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Mutable state threaded through the make_regular_edge chain walk. */
|
|
98
|
+
interface ChainWalk {
|
|
99
|
+
ctx: BboxCtx;
|
|
100
|
+
ranks: RankEntry[];
|
|
101
|
+
ranksep: number;
|
|
102
|
+
et: number;
|
|
103
|
+
P: Path;
|
|
104
|
+
pts: Point[];
|
|
105
|
+
boxes: Box[];
|
|
106
|
+
segfirst: GraphEdge;
|
|
107
|
+
tend: PathendT;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function newChainWalk(g: Graph, segs: GraphEdge[]): ChainWalk {
|
|
111
|
+
return {
|
|
112
|
+
ctx: chainBboxCtx(g), ranks: g.info.rank!, ranksep: graphRanksep(g), et: edgeType(g),
|
|
113
|
+
P: { start: makePort(), end: makePort(), nbox: 0, boxes: [], data: null },
|
|
114
|
+
pts: [], boxes: [], segfirst: segs[0],
|
|
115
|
+
tend: freshEndp({ ll: { x: 0, y: 0 }, ur: { x: 0, y: 0 } }),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Open a segment: build the tail box from `chainEdge` (real chain geometry),
|
|
121
|
+
* beginPath on `portEdge` (carries the real tail port for segment 0; the
|
|
122
|
+
* virtual segment edge thereafter), and append the BOTTOM regular end.
|
|
123
|
+
* `constrain` forces the straight-middle exit slope on post-straight segments.
|
|
124
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge (beginpath + makeregularend BOTTOM)
|
|
125
|
+
*/
|
|
126
|
+
function beginSeg(
|
|
127
|
+
w: ChainWalk, portEdge: GraphEdge, chainEdge: GraphEdge, ie: GraphEdge | undefined, constrain: boolean,
|
|
128
|
+
): void {
|
|
129
|
+
const tn = chainEdge.tail;
|
|
130
|
+
w.tend = freshEndp(maximalBbox(w.ctx, tn, ie, chainEdge));
|
|
131
|
+
// merge tested on the node beginPath/concSlope uses (portEdge.tail), not the
|
|
132
|
+
// chain segment's tail — they differ when a concentrate-merged chain starts at
|
|
133
|
+
// a merge node while portEdge carries the real (normal) tail. Symmetric to
|
|
134
|
+
// endSeg. @see lib/dotgen/dotsplines.c:make_regular_edge (spline_merge(agtail(e)))
|
|
135
|
+
beginPath(chainPathArgs(w.P, portEdge, w.tend, splineMerge(portEdge.tail), w.ranksep));
|
|
136
|
+
appendRegularEnd(w.tend.nb, w.tend, BOTTOM, tn.info.coord.y - rankHt(w.ranks[tn.info.rank!].ht1, tn.info.ht));
|
|
137
|
+
if (constrain) { w.P.start.theta = -Math.PI / 2; w.P.start.constrained = true; }
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Close a segment: build the head box from `chainEdge`, endPath on `portEdge`
|
|
142
|
+
* (the real head port for the final segment; the virtual segment edge for an
|
|
143
|
+
* smode top), append the TOP regular end, optionally constrain the entry slope
|
|
144
|
+
* (smode top), then complete + route the path and append the control points.
|
|
145
|
+
* Returns false when the path cannot be assembled.
|
|
146
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge (endpath + completeregularpath + routesplines)
|
|
147
|
+
*/
|
|
148
|
+
function endSeg(
|
|
149
|
+
w: ChainWalk, portEdge: GraphEdge, chainEdge: GraphEdge, oe: GraphEdge | undefined, constrain: boolean,
|
|
150
|
+
): boolean {
|
|
151
|
+
const hn = chainEdge.head;
|
|
152
|
+
const hend = freshEndp(maximalBbox(w.ctx, hn, chainEdge, oe));
|
|
153
|
+
// merge must be tested on the node endPath/concSlope actually uses (the path
|
|
154
|
+
// edge's head = portEdge.head), as C does (spline_merge(aghead(e))) — NOT the
|
|
155
|
+
// chain segment's head. They differ in the final segment when the chain ends
|
|
156
|
+
// at a concentrator merge node while portEdge carries the real (normal) head;
|
|
157
|
+
// testing the merge node there would call concSlope on the normal sink (0
|
|
158
|
+
// in/out edges) and crash. @see lib/dotgen/dotsplines.c:make_regular_edge
|
|
159
|
+
endPath(chainPathArgs(w.P, portEdge, hend, splineMerge(portEdge.head), w.ranksep));
|
|
160
|
+
appendRegularEnd(hend.nb, hend, TOP, hn.info.coord.y + rankHt(w.ranks[hn.info.rank!].ht2, hn.info.ht));
|
|
161
|
+
if (constrain) { w.P.end.theta = Math.PI / 2; w.P.end.constrained = true; }
|
|
162
|
+
if (!completeRegularPath({ P: w.P, first: w.segfirst, last: chainEdge, tend: w.tend, hend, boxes: w.boxes })) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
const seg = routeRegularByType(w.P, w.et);
|
|
166
|
+
if (seg === null) return false;
|
|
167
|
+
for (const p of seg) w.pts.push(p);
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Close an smode top segment at `segs[ci]` (constrained entry slope), emit the
|
|
173
|
+
* straight middle as duplicate points, recover slack, then open the next
|
|
174
|
+
* segment at the post-straight edge with a constrained exit slope. Returns the
|
|
175
|
+
* chain index of the next segment's first edge, or -1 when routing fails.
|
|
176
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge (smode close + straight_path)
|
|
177
|
+
*/
|
|
178
|
+
function closeSmodeSeg(w: ChainWalk, segs: GraphEdge[], ci: number, sl: number, segFirst: number): number {
|
|
179
|
+
if (!endSeg(w, segs[ci], segs[ci], segs[ci + 1], true)) return -1;
|
|
180
|
+
straightPath(segs[ci + 1], sl, w.pts);
|
|
181
|
+
recoverSlack(segs.slice(segFirst), w.P);
|
|
182
|
+
const next = ci + 1 + sl;
|
|
183
|
+
w.segfirst = segs[next];
|
|
184
|
+
w.boxes = [];
|
|
185
|
+
beginSeg(w, segs[next], segs[next], segs[next].tail.info.in!.list[0], true);
|
|
186
|
+
return next;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** Route the final (post-loop) chain segment, ending at the real head node. */
|
|
190
|
+
function finishChain(
|
|
191
|
+
w: ChainWalk, portEdge: GraphEdge, lastEdge: GraphEdge, segFirst: number, segs: GraphEdge[],
|
|
192
|
+
): boolean {
|
|
193
|
+
w.boxes.push(rankBox(w.ctx, lastEdge.tail.info.rank!));
|
|
194
|
+
if (!endSeg(w, portEdge, lastEdge, undefined, false)) return false;
|
|
195
|
+
recoverSlack(segs.slice(segFirst), w.P);
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Route a virtual-node chain through the faithful pipeline, accumulating the
|
|
201
|
+
* make_regular_edge spline points. Below the straight_len threshold this emits a
|
|
202
|
+
* single segment (identical to the prior single-pass routing); a long
|
|
203
|
+
* collinear vnode run is split into spline-top + straight-middle + spline-bottom
|
|
204
|
+
* via successive beginpath/endpath/routesplines calls, hugging the corridor.
|
|
205
|
+
* `e` carries the real end ports (first beginpath, final endpath); the chain
|
|
206
|
+
* edges drive the box geometry.
|
|
207
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge (1771-1873 smode loop)
|
|
208
|
+
*/
|
|
209
|
+
function routeChainSegmented(
|
|
210
|
+
g: Graph, beginEdge: GraphEdge, endEdge: GraphEdge, segs: GraphEdge[],
|
|
211
|
+
): Point[] | null {
|
|
212
|
+
const w = newChainWalk(g, segs);
|
|
213
|
+
const thr = smodeThreshold(g);
|
|
214
|
+
beginSeg(w, beginEdge, segs[0], undefined, false);
|
|
215
|
+
let ei = 0, segFirst = 0, smode = false, si = false, sl = 0;
|
|
216
|
+
while (isChainVirtual(segs[ei].head)) {
|
|
217
|
+
w.boxes.push(rankBox(w.ctx, segs[ei].tail.info.rank!));
|
|
218
|
+
if (!smode) { sl = straightLen(segs[ei].head); if (sl >= thr) { smode = true; si = true; sl -= 2; } }
|
|
219
|
+
if (smode && !si) {
|
|
220
|
+
ei = closeSmodeSeg(w, segs, ei, sl, segFirst);
|
|
221
|
+
if (ei < 0) return null;
|
|
222
|
+
segFirst = ei; smode = false;
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
si = false;
|
|
226
|
+
w.boxes.push(maximalBbox(w.ctx, segs[ei].head, segs[ei], segs[ei + 1]));
|
|
227
|
+
ei++;
|
|
228
|
+
}
|
|
229
|
+
return finishChain(w, endEdge, segs[ei], segFirst, segs) ? w.pts : null;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Route a forward edge spanning ≥2 ranks via its virtual-node chain through the
|
|
234
|
+
* faithful pipeline (REGULAREDGE side boxes steer the port, routeSplines over
|
|
235
|
+
* the chain; adjustregularpath inter-rank widening finally fires). Returns
|
|
236
|
+
* control points in graphviz-internal y-up, or null when the edge is not a
|
|
237
|
+
* multi-rank chain.
|
|
238
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge (hackflag forward path)
|
|
239
|
+
*/
|
|
240
|
+
export function routeMultiRankEdgeFaithful(g: Graph, e: GraphEdge): Point[] | null {
|
|
241
|
+
const r = e.tail.info.rank;
|
|
242
|
+
const rh = e.head.info.rank;
|
|
243
|
+
if (g.info.rank === undefined || r === undefined || rh === undefined || rh <= r + 1) return null;
|
|
244
|
+
const et = edgeType(g);
|
|
245
|
+
// EDGETYPE_LINE: C tries makeLineEdge first (direct tail→head segment),
|
|
246
|
+
// falling back to the box corridor only when it declines (delr==1, or delr==2
|
|
247
|
+
// with edge labels). @see lib/dotgen/dotsplines.c:make_regular_edge (1757)
|
|
248
|
+
if (et === EDGETYPE_LINE) {
|
|
249
|
+
const line = makeLineEdge(g, e);
|
|
250
|
+
if (line !== null) return line;
|
|
251
|
+
}
|
|
252
|
+
const segs = chainSegments(e);
|
|
253
|
+
// Route only a COMPLETE chain (last segment reaches e.head). segs.length===1 is
|
|
254
|
+
// valid (concentrate may merge the whole chain to a direct tail->head segment);
|
|
255
|
+
// a chain ending at a virtual node is broken — bail, don't crash the loop.
|
|
256
|
+
// @see dotsplines.c:make_regular_edge
|
|
257
|
+
if (segs.length === 0 || segs[segs.length - 1].head !== e.head) return null;
|
|
258
|
+
// C's make_regular_edge drives beginpath with the FIRST chain fast edge and
|
|
259
|
+
// endpath with the LAST (each carries the orig's copied port, so a dyna
|
|
260
|
+
// record port resolves toward the adjacent-rank vnode, not the far real
|
|
261
|
+
// endpoint). @see lib/dotgen/dotsplines.c:make_regular_edge (tn/hn walk),
|
|
262
|
+
// lib/dotgen/fastgr.c:new_virtual_edge (port copies)
|
|
263
|
+
return routeChainSegmented(g, segs[0], segs[segs.length - 1], segs);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The merge-bounded run owned by one collected entry: the entry followed by
|
|
268
|
+
* `out.list[0]` successors while the head is a plain (non-merge) virtual node —
|
|
269
|
+
* C make_regular_edge's chain walk. Returns null when the entry is NOT a
|
|
270
|
+
* partial run (neither end at a splineMerge node): plain single-chain entries
|
|
271
|
+
* belong to the caller's whole-chain routers.
|
|
272
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge (while !splineMerge(hn) walk)
|
|
273
|
+
*/
|
|
274
|
+
function entryRunSegments(e: GraphEdge): GraphEdge[] | null {
|
|
275
|
+
const segs: GraphEdge[] = [e];
|
|
276
|
+
let hn = e.head;
|
|
277
|
+
while ((hn.info.node_type ?? NORMAL) === VIRTUAL && !splineMerge(hn)) {
|
|
278
|
+
const nxt = hn.info.out?.list[0];
|
|
279
|
+
if (nxt === undefined) return null; // broken chain — leave to the caller
|
|
280
|
+
segs.push(nxt);
|
|
281
|
+
hn = nxt.head;
|
|
282
|
+
}
|
|
283
|
+
if (!splineMerge(e.tail) && !splineMerge(hn)) return null;
|
|
284
|
+
return segs;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Route ONE collected entry's merge-bounded run — C's model where every
|
|
289
|
+
* fast-graph entry of a concentrate-merged chain (lead-in from the real node,
|
|
290
|
+
* trunk continuation out of a merge node, or a secondary's branch) is its own
|
|
291
|
+
* cnt=1 group (the group loop's MAINGRAPH break) and make_regular_edge walks
|
|
292
|
+
* from the entry to the first NORMAL or splineMerge node; clip_and_install
|
|
293
|
+
* then APPENDS the clipped bezier on the entry's original edge. The entry's
|
|
294
|
+
* own ports drive begin/endpath (the last segment carries the run's head
|
|
295
|
+
* port), and the install passes the ENTRY (its to_orig chain resolves the
|
|
296
|
+
* orig) with the walk's final head node, exactly as C.
|
|
297
|
+
*
|
|
298
|
+
* Returns the resolved original edge when the entry was a partial run
|
|
299
|
+
* (consumed — even if routing declined, so the caller never re-routes the
|
|
300
|
+
* whole chain), or null when the entry is a plain full chain.
|
|
301
|
+
* @see lib/dotgen/dotsplines.c:dot_splines_ (group loop), make_regular_edge
|
|
302
|
+
*/
|
|
303
|
+
export function routeEntryRun(g: Graph, entry: GraphEdge): GraphEdge | null {
|
|
304
|
+
const segs = entryRunSegments(entry);
|
|
305
|
+
if (segs === null) return null;
|
|
306
|
+
const last = segs[segs.length - 1];
|
|
307
|
+
const pts = routeChainSegmented(g, segs[0], last, segs);
|
|
308
|
+
if (pts !== null) clipAndInstall(entry, last.head, pts, pts.length, buildDotSinfo());
|
|
309
|
+
return resolveOrigEdge(entry);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* After splining, reposition each chain virtual node into the routing box that
|
|
314
|
+
* contains it (boxes run high-y to low-y). Label vnodes are anchored to the
|
|
315
|
+
* box's right edge (center = box.ur.x + rw); plain vnodes are centred. This is
|
|
316
|
+
* what aligns a flat-adj aux label vnode onto its spline so the label lands at
|
|
317
|
+
* the dot position (DOT-12). @see lib/dotgen/dotsplines.c:recover_slack
|
|
318
|
+
*/
|
|
319
|
+
function resizeVnInBox(vn: Node, box: Box): void {
|
|
320
|
+
if (vn.info.label != null) resizeVn(vn, box.ll.x, box.ur.x, box.ur.x + vn.info.rw);
|
|
321
|
+
else resizeVn(vn, box.ll.x, (box.ll.x + box.ur.x) / 2, box.ur.x);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function recoverSlack(segs: GraphEdge[], P: Path): void {
|
|
325
|
+
let b = 0; // skip first rank box
|
|
326
|
+
for (let i = 0; i < segs.length; i++) {
|
|
327
|
+
const vn = segs[i].head;
|
|
328
|
+
if ((vn.info.node_type ?? NORMAL) !== VIRTUAL || splineMerge(vn)) break;
|
|
329
|
+
while (b < P.nbox && P.boxes[b].ll.y > vn.info.coord.y) b++;
|
|
330
|
+
if (b >= P.nbox) break;
|
|
331
|
+
if (P.boxes[b].ur.y >= vn.info.coord.y) resizeVnInBox(vn, P.boxes[b]);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// ---------------------------------------------------------------------------
|
|
336
|
+
// Back-edge routing
|
|
337
|
+
// @see lib/dotgen/dotsplines.c:make_regular_edge (hackflag back-edge path)
|
|
338
|
+
// ---------------------------------------------------------------------------
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Virtual-chain segments of a multi-rank back edge in low-rank → high-rank
|
|
342
|
+
* order (e.head → e.tail). `chainSegments` cannot be reused: it stops at
|
|
343
|
+
* e.head, which is the chain's START for a back edge.
|
|
344
|
+
*/
|
|
345
|
+
function backChainSegments(e: GraphEdge): GraphEdge[] {
|
|
346
|
+
const segs: GraphEdge[] = [];
|
|
347
|
+
let cur = e.info.to_virt;
|
|
348
|
+
while (cur !== undefined) {
|
|
349
|
+
segs.push(cur);
|
|
350
|
+
if (cur.head === e.tail) break;
|
|
351
|
+
cur = cur.head.info.out?.list[0];
|
|
352
|
+
}
|
|
353
|
+
return segs;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Forward view of any edge (C `makefwdedge`): tail/head swapped when the edge
|
|
358
|
+
* runs high→low rank (a back edge), fresh portless ends. `beginPath`/`endPath`
|
|
359
|
+
* read `e.tail`/`e.head`, so the chain must be driven by an edge that runs
|
|
360
|
+
* low→high rank. Sets `to_orig`/`edge_type=VIRTUAL` so `clipAndInstall`→
|
|
361
|
+
* `newSpline` installs the spline on the ORIGINAL edge (its `to_orig` loop) and
|
|
362
|
+
* the post-routing `swapSpline` pass reverses it back to tail→head. Shares
|
|
363
|
+
* `attrs`/`root`/`to_virt` with `e`. Consumed by T3 for parallel back-members.
|
|
364
|
+
* @see lib/dotgen/dotsplines.c:makefwdedge
|
|
365
|
+
* @see lib/common/splines.c:clip_and_install (to_orig install loop)
|
|
366
|
+
*/
|
|
367
|
+
export function makeFwdEdge(e: GraphEdge): GraphEdge {
|
|
368
|
+
const back = (e.head.info.rank ?? 0) < (e.tail.info.rank ?? 0);
|
|
369
|
+
const [tail, head] = back ? [e.head, e.tail] : [e.tail, e.head];
|
|
370
|
+
return {
|
|
371
|
+
...e,
|
|
372
|
+
tail,
|
|
373
|
+
head,
|
|
374
|
+
info: {
|
|
375
|
+
...e.info,
|
|
376
|
+
// C makefwdedge SWAPS the ports (does not strip them): a back edge keeps
|
|
377
|
+
// its corner ports across the forward view so make_regular_edge curls it
|
|
378
|
+
// (e.g. #241_0 aux back-edge clone sw/se → size 7). Stripping to an empty
|
|
379
|
+
// Center port straightened every port-bearing back edge (size 4).
|
|
380
|
+
// @see lib/dotgen/dotsplines.c:makefwdedge (ED_tail_port(new)=ED_head_port(old))
|
|
381
|
+
tail_port: e.info.head_port ?? makePort(),
|
|
382
|
+
head_port: e.info.tail_port ?? makePort(),
|
|
383
|
+
to_orig: e,
|
|
384
|
+
edge_type: VIRTUAL,
|
|
385
|
+
},
|
|
386
|
+
} as GraphEdge;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Route a multi-rank back-edge via its virtual node chain, mirroring C exactly:
|
|
392
|
+
* make_regular_edge routes the makefwdedge (forward) view, clip_and_install
|
|
393
|
+
* clips THAT forward spline, and the spline is reversed afterward (swapSpline).
|
|
394
|
+
*
|
|
395
|
+
* Clipping the forward (un-reversed) spline is load-bearing: bezier_clip bisects
|
|
396
|
+
* each node end from the same direction C does. The previous reverse-then-clip
|
|
397
|
+
* path clipped the head node as a tail (bisecting the degenerate spline from the
|
|
398
|
+
* opposite parameter end), landing the 0.5-tolerance crossing ~0.26-0.33 off
|
|
399
|
+
* (1644, dfa family). clipAndInstall resolves the spline onto `e` via the
|
|
400
|
+
* fwdEdge's to_orig and gates arrows by ED_dir, so this also drops the bespoke
|
|
401
|
+
* reverse/arrow code. @see lib/dotgen/dotsplines.c:make_regular_edge (hackflag)
|
|
402
|
+
*/
|
|
403
|
+
export function routeBackEdge(e: GraphEdge, _tailBox: NodeBox, _headBox: NodeBox, g: Graph): void {
|
|
404
|
+
const segs = backChainSegments(e);
|
|
405
|
+
if (segs.length < 2 || segs[segs.length - 1].head !== e.tail) return;
|
|
406
|
+
const fwdEdge = makeFwdEdge(e);
|
|
407
|
+
// C's make_regular_edge routes the collected FAST SEGMENT view: beginpath's
|
|
408
|
+
// edge head is the adjacent chain vnode, so a dyna record port resolves
|
|
409
|
+
// toward that vnode (closestSide), not the far real endpoint. Passing the
|
|
410
|
+
// whole-edge fwd view here resolved b15's reversed record-port edges toward
|
|
411
|
+
// the wrong compass side (In: 's' at field-bottom instead of C's 'w' at
|
|
412
|
+
// field-left). The segments carry the correctly-oriented copied ports
|
|
413
|
+
// (fastgr new_virtual_edge copy rules); fwdEdge remains the clip target so
|
|
414
|
+
// bezier_clip keeps the load-bearing forward direction (1644).
|
|
415
|
+
// @see lib/dotgen/dotsplines.c:make_regular_edge (segfirst/tn/hn walk)
|
|
416
|
+
const fwd = routeChainSegmented(g, segs[0], segs[segs.length - 1], segs);
|
|
417
|
+
if (fwd === null) return;
|
|
418
|
+
clipAndInstall(fwdEdge, fwdEdge.head, fwd, fwd.length, buildDotSinfo());
|
|
419
|
+
if (swapEndsP(e)) swapEdgeSpline(e);
|
|
420
|
+
}
|