@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,253 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Bezier subdivision and node-boundary clipping for edge spline routing.
|
|
5
|
+
*
|
|
6
|
+
* @see lib/common/utils.c:Bezier
|
|
7
|
+
* @see lib/common/splines.c:bezier_clip
|
|
8
|
+
* @see lib/common/splines.c:shape_clip0
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { Point } from '../../model/geom.js';
|
|
12
|
+
import { parseArrow, resolveArrowType } from '../../common/arrows.js';
|
|
13
|
+
import { arrowLength } from '../../common/arrows-shapes.js';
|
|
14
|
+
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// De Casteljau subdivision
|
|
17
|
+
// @see lib/common/utils.c:Bezier
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Build the De Casteljau triangle for a cubic Bezier at parameter t.
|
|
22
|
+
* v[i][j] = (1-t)*v[i-1][j] + t*v[i-1][j+1].
|
|
23
|
+
* @see lib/common/utils.c:Bezier (triangle computation section)
|
|
24
|
+
*/
|
|
25
|
+
function deCasteljauTriangle(sp: Point[], t: number): Point[][] {
|
|
26
|
+
const u = 1 - t;
|
|
27
|
+
const v: Point[][] = [
|
|
28
|
+
[sp[0], sp[1], sp[2], sp[3]],
|
|
29
|
+
[{ x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }],
|
|
30
|
+
[{ x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }],
|
|
31
|
+
[{ x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }],
|
|
32
|
+
];
|
|
33
|
+
for (let i = 1; i <= 3; i++) {
|
|
34
|
+
for (let j = 0; j <= 3 - i; j++) {
|
|
35
|
+
v[i][j] = {
|
|
36
|
+
x: u * v[i - 1][j].x + t * v[i - 1][j + 1].x,
|
|
37
|
+
y: u * v[i - 1][j].y + t * v[i - 1][j + 1].y,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return v;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* De Casteljau subdivision of a cubic Bezier at parameter t.
|
|
46
|
+
* Returns [left4, right4, midpoint].
|
|
47
|
+
* @see lib/common/utils.c:Bezier
|
|
48
|
+
*/
|
|
49
|
+
export function bezierSubdivide(
|
|
50
|
+
sp: Point[],
|
|
51
|
+
t: number,
|
|
52
|
+
): [Point[], Point[], Point] {
|
|
53
|
+
const v = deCasteljauTriangle(sp, t);
|
|
54
|
+
const left: Point[] = [v[0][0], v[1][0], v[2][0], v[3][0]];
|
|
55
|
+
const right: Point[] = [v[3][0], v[2][1], v[1][2], v[0][3]];
|
|
56
|
+
return [left, right, v[3][0]];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
// bezierClipNode
|
|
61
|
+
// @see lib/common/splines.c:bezier_clip
|
|
62
|
+
// @see lib/common/splines.c:shape_clip0
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
/** State carried through one bisection iteration. */
|
|
66
|
+
interface BisectState {
|
|
67
|
+
low: number;
|
|
68
|
+
high: number;
|
|
69
|
+
best: Point[];
|
|
70
|
+
found: boolean;
|
|
71
|
+
pt: Point;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Perform one bisection step; returns updated state. */
|
|
75
|
+
function bisectStep(
|
|
76
|
+
c: Point[],
|
|
77
|
+
insideFn: (lx: number, ly: number) => boolean,
|
|
78
|
+
leftInside: boolean,
|
|
79
|
+
s: BisectState,
|
|
80
|
+
): BisectState {
|
|
81
|
+
const t = (s.high + s.low) / 2;
|
|
82
|
+
const [left, right, mid] = bezierSubdivide(c, t);
|
|
83
|
+
if (insideFn(mid.x, mid.y)) {
|
|
84
|
+
return leftInside
|
|
85
|
+
? { low: t, high: s.high, best: right, found: true, pt: mid }
|
|
86
|
+
: { low: s.low, high: t, best: left, found: true, pt: mid };
|
|
87
|
+
}
|
|
88
|
+
return leftInside
|
|
89
|
+
? { ...s, high: t, pt: mid }
|
|
90
|
+
: { ...s, low: t, pt: mid };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Binary-search clip of a Bezier in node-local coords.
|
|
95
|
+
* @see lib/common/splines.c:bezier_clip
|
|
96
|
+
*/
|
|
97
|
+
function bezierClipLocal(
|
|
98
|
+
c: Point[],
|
|
99
|
+
insideFn: (lx: number, ly: number) => boolean,
|
|
100
|
+
leftInside: boolean,
|
|
101
|
+
): Point[] {
|
|
102
|
+
let s: BisectState = {
|
|
103
|
+
low: 0, high: 1, best: c.slice(), found: false,
|
|
104
|
+
pt: leftInside ? c[0] : c[3],
|
|
105
|
+
};
|
|
106
|
+
let opt: Point;
|
|
107
|
+
do {
|
|
108
|
+
opt = s.pt;
|
|
109
|
+
s = bisectStep(c, insideFn, leftInside, s);
|
|
110
|
+
} while (Math.abs(opt.x - s.pt.x) > 0.5 || Math.abs(opt.y - s.pt.y) > 0.5);
|
|
111
|
+
if (s.found) return s.best;
|
|
112
|
+
const [left, right] = bezierSubdivide(c, (s.high + s.low) / 2);
|
|
113
|
+
return leftInside ? right : left;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Clip Bezier to node boundary using binary search.
|
|
118
|
+
*
|
|
119
|
+
* sp is in global coords. insideFn receives node-local coords (center
|
|
120
|
+
* subtracted). leftInside=true: sp[0] is inside node (tail clip).
|
|
121
|
+
* leftInside=false: sp[3] is inside node (head clip).
|
|
122
|
+
*
|
|
123
|
+
* @see lib/common/splines.c:bezier_clip
|
|
124
|
+
* @see lib/common/splines.c:shape_clip0
|
|
125
|
+
*/
|
|
126
|
+
export function bezierClipNode(
|
|
127
|
+
sp: Point[],
|
|
128
|
+
cx: number,
|
|
129
|
+
cy: number,
|
|
130
|
+
insideFn: (lx: number, ly: number) => boolean,
|
|
131
|
+
leftInside: boolean,
|
|
132
|
+
): Point[] {
|
|
133
|
+
const c: Point[] = sp.map(p => ({ x: p.x - cx, y: p.y - cy }));
|
|
134
|
+
return bezierClipLocal(c, insideFn, leftInside).map(p => ({
|
|
135
|
+
x: p.x + cx,
|
|
136
|
+
y: p.y + cy,
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Clip the path endpoint to the arrowhead BASE (not node boundary).
|
|
142
|
+
*
|
|
143
|
+
* Ports lib/common/arrows.c:arrowEndClip.
|
|
144
|
+
* The path ends at arrowhead-BASE (arrowTip + elen toward tail), not at the
|
|
145
|
+
* node boundary. The arrowTip (spl.ep) is the node-boundary clip result.
|
|
146
|
+
*
|
|
147
|
+
* Steps (matching C arrowEndClip):
|
|
148
|
+
* 1. Reverse the last Bezier segment: sp[0]=arrowTip, sp[1..3]=reversed path
|
|
149
|
+
* 2. inside = DIST(p, arrowTip) <= elen (arrowhead sphere)
|
|
150
|
+
* 3. bezierClip with left_inside=true (sp[0]=arrowTip is "inside" the sphere)
|
|
151
|
+
* 4. Un-reverse the clipped right subdivision → path ends at arrowhead BASE
|
|
152
|
+
*
|
|
153
|
+
* @see lib/common/arrows.c:arrowEndClip
|
|
154
|
+
*/
|
|
155
|
+
export function arrowEndClip(
|
|
156
|
+
path4: Point[],
|
|
157
|
+
arrowTip: Point,
|
|
158
|
+
elen: number,
|
|
159
|
+
): Point[] {
|
|
160
|
+
if (elen <= 0) return path4;
|
|
161
|
+
// Reverse: sp[0]=tip (inside sphere), sp[1..3]=reversed last 3 path points
|
|
162
|
+
const sp: Point[] = [arrowTip, path4[2]!, path4[1]!, path4[0]!];
|
|
163
|
+
const insideSphere = (lx: number, ly: number): boolean =>
|
|
164
|
+
Math.hypot(lx, ly) <= elen;
|
|
165
|
+
// bezierClipLocal with sp in RELATIVE coords (tip=origin)
|
|
166
|
+
const spRel: Point[] = sp.map(p => ({ x: p.x - arrowTip.x, y: p.y - arrowTip.y }));
|
|
167
|
+
const clippedRel = bezierClipLocal(spRel, insideSphere, true);
|
|
168
|
+
const clipped = clippedRel.map(p => ({ x: p.x + arrowTip.x, y: p.y + arrowTip.y }));
|
|
169
|
+
// Un-reverse: the clipped right subdivision = [arrowBase, ..., arrowTip]
|
|
170
|
+
// The path endpoint becomes arrowBase = clipped[0]
|
|
171
|
+
// Un-reverse the full clipped result; all 4 points update via de Casteljau
|
|
172
|
+
return [clipped[3]!, clipped[2]!, clipped[1]!, clipped[0]!];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Per-type spline clip length for an arrow string: the sum of the parsed
|
|
177
|
+
* compound arrow's component lengths (`arrow_length`). Replaces the normal-only
|
|
178
|
+
* `normalArrowLen` so non-normal arrows clip by their true length (ADR-4); the
|
|
179
|
+
* caller still gates on the edge flag (no clip when the end has no arrow).
|
|
180
|
+
* @see lib/common/arrows.c:arrow_length (:253)
|
|
181
|
+
*/
|
|
182
|
+
export function arrowClipLength(arrowName: string, arrowsize: number, penwidth: number): number {
|
|
183
|
+
const comps = parseArrow(arrowName).map(resolveArrowType);
|
|
184
|
+
return arrowLength(comps, arrowsize, penwidth);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Default node pen width. @see lib/common/const.h:DEFAULT_NODEPENWIDTH
|
|
189
|
+
*/
|
|
190
|
+
export const DEFAULT_NODEPENWIDTH = 1.0;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Returns a box-shape inside function for use with bezierClipNode.
|
|
194
|
+
*
|
|
195
|
+
* Matches C's poly_inside bounding-box test which uses the OUTLINE boundary
|
|
196
|
+
* (node + penwidth/2) rather than the geometric boundary:
|
|
197
|
+
* box_URx = (lw + rw + penwidth) / 2
|
|
198
|
+
* box_URy = (ht + penwidth) / 2
|
|
199
|
+
*
|
|
200
|
+
* @see lib/common/shapes.c:poly_inside (box_URx/box_URy computation)
|
|
201
|
+
*/
|
|
202
|
+
export function makeBoxInsideFn(
|
|
203
|
+
halfW: number,
|
|
204
|
+
halfH: number,
|
|
205
|
+
penwidth = DEFAULT_NODEPENWIDTH,
|
|
206
|
+
): (lx: number, ly: number) => boolean {
|
|
207
|
+
const uw = halfW + penwidth / 2;
|
|
208
|
+
const uh = halfH + penwidth / 2;
|
|
209
|
+
return (lx: number, ly: number): boolean =>
|
|
210
|
+
Math.abs(lx) <= uw && Math.abs(ly) <= uh;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Returns an ellipse-shape inside function for use with bezierClipNode.
|
|
215
|
+
*
|
|
216
|
+
* Matches C's poly_inside ellipse branch (sides <= 2):
|
|
217
|
+
* hypot(P.x/box_URx, P.y/box_URy) < 1 (strict less-than, matching C)
|
|
218
|
+
* where box_URx = lw + penwidth/2 and box_URy = ht/2 + penwidth/2.
|
|
219
|
+
*
|
|
220
|
+
* C uses strict < 1 (not <=) — the one-bit difference matters during
|
|
221
|
+
* binary search: a point exactly on the boundary is classified as outside
|
|
222
|
+
* in C, which determines when the search terminates.
|
|
223
|
+
*
|
|
224
|
+
* @see lib/common/shapes.c:poly_inside (sides <= 2 branch)
|
|
225
|
+
*/
|
|
226
|
+
export function makeEllipseInsideFn(
|
|
227
|
+
rx: number,
|
|
228
|
+
ry: number,
|
|
229
|
+
penwidth = DEFAULT_NODEPENWIDTH,
|
|
230
|
+
): (lx: number, ly: number) => boolean {
|
|
231
|
+
const erx = rx + penwidth / 2;
|
|
232
|
+
const ery = ry + penwidth / 2;
|
|
233
|
+
return (lx: number, ly: number): boolean =>
|
|
234
|
+
(lx * lx) / (erx * erx) + (ly * ly) / (ery * ery) < 1.0;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Clip path START to the tail arrowhead base (symmetric to arrowEndClip).
|
|
239
|
+
*
|
|
240
|
+
* path4[0] = tail node boundary (inside arrowhead sphere); after clip,
|
|
241
|
+
* path4[0] = arrowhead base (elen from tailTip).
|
|
242
|
+
*
|
|
243
|
+
* @see lib/common/arrows.c:arrowEndClip
|
|
244
|
+
*/
|
|
245
|
+
export function tailArrowEndClip(
|
|
246
|
+
path4: Point[],
|
|
247
|
+
tailTip: Point,
|
|
248
|
+
elen: number,
|
|
249
|
+
): Point[] {
|
|
250
|
+
if (elen <= 0) return path4;
|
|
251
|
+
const inside = (lx: number, ly: number): boolean => Math.hypot(lx, ly) <= elen;
|
|
252
|
+
return bezierClipNode(path4, tailTip.x, tailTip.y, inside, true);
|
|
253
|
+
}
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Faithful adjacent-rank regular-edge routing for dot.
|
|
5
|
+
*
|
|
6
|
+
* Assembles the `beginPath → completeRegularPath → routeSplines` box-channel
|
|
7
|
+
* pipeline that C's `make_regular_edge` uses. This is the sequence the
|
|
8
|
+
* simplified active fitter (`buildRankCorridor`/`computeSpline`) bypasses;
|
|
9
|
+
* the simplified fitter truncates the non-monotonic loop corridor a steering
|
|
10
|
+
* port needs (tail exits the TOP face while the head is below). routeSplines
|
|
11
|
+
* routes that corridor completely.
|
|
12
|
+
*
|
|
13
|
+
* SR2 scope: regular **adjacent-rank** edges only. Returns the spline control
|
|
14
|
+
* points in graphviz-internal y-up coordinates (the frame dot's router runs
|
|
15
|
+
* in; SVG y-negation is a later render pass). `clipAndInstall` + arrows +
|
|
16
|
+
* `routeOneEdge` wiring is SR3 — this module does not install anything.
|
|
17
|
+
*
|
|
18
|
+
* Deviations from C, journaled in decision-journal.md (SR2):
|
|
19
|
+
* - Cluster bounds (`cl_bound`) in maximal_bbox are not ported; no batch-2/3
|
|
20
|
+
* test graph has clusters. The neighbor branch uses node extents only.
|
|
21
|
+
*
|
|
22
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge
|
|
23
|
+
* @see lib/dotgen/dotsplines.c:completeregularpath
|
|
24
|
+
* @see lib/dotgen/dotsplines.c:adjustregularpath
|
|
25
|
+
* @see lib/dotgen/dotsplines.c:makeregularend
|
|
26
|
+
* @see lib/dotgen/dotsplines.c:maximal_bbox
|
|
27
|
+
* @see lib/dotgen/dotsplines.c:rank_box
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import type { Graph } from '../../model/graph.js';
|
|
31
|
+
import type { Node } from '../../model/node.js';
|
|
32
|
+
import type { Edge } from '../../model/edge.js';
|
|
33
|
+
import type { Box, Point } from '../../model/geom.js';
|
|
34
|
+
import type { Path, PathendT } from '../../common/types.js';
|
|
35
|
+
// C's maximal_bbox rounds both cluster walls with libm round() — half away from
|
|
36
|
+
// zero. @see lib/dotgen/dotsplines.c:maximal_bbox (round(b))
|
|
37
|
+
import { cround } from '../../common/arith.js';
|
|
38
|
+
import { makePort } from '../../model/edgeInfo.js';
|
|
39
|
+
import { beginPath } from '../../common/splines-path-begin.js';
|
|
40
|
+
import { endPath } from '../../common/splines-path-end.js';
|
|
41
|
+
import { routeRegularByType } from './splines-route-type.js';
|
|
42
|
+
import { edgeType } from './splines.js';
|
|
43
|
+
import { addBox } from '../../common/splines-path-shared.js';
|
|
44
|
+
import { TOP, BOTTOM, REGULAREDGE } from '../../common/splines-constants.js';
|
|
45
|
+
import { VIRTUAL, NORMAL } from './fastgr.js';
|
|
46
|
+
import { neighbor, topBound, botBound, nodeType, splineMerge } from './splines-route.js';
|
|
47
|
+
import { getSplineBounds, rankHt } from './edge-route-rank.js';
|
|
48
|
+
import { graphRanksep } from './position-aux.js';
|
|
49
|
+
|
|
50
|
+
/** maximal_bbox uses a local `#define FUDGE 4` (wider than splines.c FUDGE=2). */
|
|
51
|
+
const MBB_FUDGE = 4;
|
|
52
|
+
/** Minimum width of a box in the edge path. @see lib/dotgen/dotsplines.c:MINW */
|
|
53
|
+
const MINW = 16;
|
|
54
|
+
/** Half of MINW. @see lib/dotgen/dotsplines.c:HALFMINW */
|
|
55
|
+
const HALFMINW = 8;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Per-call routing bounds, mirroring the fields of spline_info_t that
|
|
59
|
+
* maximal_bbox / rank_box read.
|
|
60
|
+
* @see lib/dotgen/dotsplines.c:spline_info_t
|
|
61
|
+
*/
|
|
62
|
+
export interface SplineBounds {
|
|
63
|
+
leftBound: number;
|
|
64
|
+
rightBound: number;
|
|
65
|
+
splinesep: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Bundled context for the maximal_bbox helpers (keeps params <= 5). */
|
|
69
|
+
export interface BboxCtx {
|
|
70
|
+
g: Graph;
|
|
71
|
+
sp: SplineBounds;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Bundled arguments for completeRegularPath (keeps params <= 5). */
|
|
75
|
+
export interface RegularPathParts {
|
|
76
|
+
P: Path;
|
|
77
|
+
first: Edge;
|
|
78
|
+
last: Edge;
|
|
79
|
+
tend: PathendT;
|
|
80
|
+
hend: PathendT;
|
|
81
|
+
boxes: Box[];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// maximal_bbox
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
|
|
88
|
+
/** True for a virtual node carrying an edge label (gets reserved x-space). */
|
|
89
|
+
function isLabeledVirtual(n: Node): boolean {
|
|
90
|
+
return nodeType(n) === VIRTUAL && n.info.label != null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Tail/head clusters behind node n: its own cluster when NORMAL, else the
|
|
94
|
+
* original edge's endpoint clusters. @see cl_bound (dotsplines.c:2135-2140) */
|
|
95
|
+
function endpointClusters(n: Node): [Graph | undefined, Graph | undefined] {
|
|
96
|
+
if (nodeType(n) === NORMAL) return [n.info.clust, n.info.clust];
|
|
97
|
+
const orig = n.info.out?.list[0]?.info.to_orig;
|
|
98
|
+
return [orig?.tail.info.clust, orig?.head.info.clust];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** A real (non-root) cluster that is neither endpoint's cluster. C's
|
|
102
|
+
* `cl && cl != tcl && cl != hcl`. */
|
|
103
|
+
function interferes(cl: Graph | undefined, tcl: Graph | undefined, hcl: Graph | undefined): cl is Graph {
|
|
104
|
+
return cl !== undefined && cl !== tcl && cl !== hcl;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** True if virtual node n's coord lies inside cluster cl's bbox.
|
|
108
|
+
* @see lib/dotgen/dotsplines.c:cl_vninside */
|
|
109
|
+
function clVninside(cl: Graph, n: Node): boolean {
|
|
110
|
+
const bb = cl.info.bb;
|
|
111
|
+
if (bb === undefined) return false;
|
|
112
|
+
const c = n.info.coord;
|
|
113
|
+
return bb.ll.x <= c.x && c.x <= bb.ur.x && bb.ll.y <= c.y && c.y <= bb.ur.y;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** C's `REAL_CLUSTER(n)`: a node's cluster, but NULL when that cluster is the
|
|
117
|
+
* routing graph `g` itself (top-level nodes are assigned ND_clust == g by
|
|
118
|
+
* mark_lowclusters, yet must not count as a real, interfering cluster).
|
|
119
|
+
* @see lib/dotgen/dotsplines.c:2137 #define REAL_CLUSTER */
|
|
120
|
+
function realCluster(n: Node, g: Graph): Graph | undefined {
|
|
121
|
+
const cl = n.info.clust;
|
|
122
|
+
return cl === g ? undefined : cl;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** The cluster of a virtual adj node that interferes with n, if its coord lies
|
|
126
|
+
* inside it. @see cl_bound (dotsplines.c:2141-2153) */
|
|
127
|
+
function virtualAdjCluster(
|
|
128
|
+
adj: Node, tcl: Graph | undefined, hcl: Graph | undefined, g: Graph,
|
|
129
|
+
): Graph | undefined {
|
|
130
|
+
const orig = adj.info.out?.list[0]?.info.to_orig;
|
|
131
|
+
if (orig === undefined) return undefined;
|
|
132
|
+
const tc = realCluster(orig.tail, g);
|
|
133
|
+
if (interferes(tc, tcl, hcl) && clVninside(tc, adj)) return tc;
|
|
134
|
+
const hc = realCluster(orig.head, g);
|
|
135
|
+
if (interferes(hc, tcl, hcl) && clVninside(hc, adj)) return hc;
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Return the cluster of `adj` that interferes with the routing of `n`, or
|
|
141
|
+
* undefined. A box adjacent to a node in a different cluster is clamped to that
|
|
142
|
+
* cluster's boundary so the spline routes around it.
|
|
143
|
+
* @see lib/dotgen/dotsplines.c:cl_bound (2129)
|
|
144
|
+
*/
|
|
145
|
+
function clBound(n: Node, adj: Node, g: Graph): Graph | undefined {
|
|
146
|
+
const [tcl, hcl] = endpointClusters(n);
|
|
147
|
+
if (nodeType(adj) === NORMAL) {
|
|
148
|
+
const cl = realCluster(adj, g);
|
|
149
|
+
return interferes(cl, tcl, hcl) ? cl : undefined;
|
|
150
|
+
}
|
|
151
|
+
return virtualAdjCluster(adj, tcl, hcl, g);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Left x-extent of the maximal bbox. @see lib/dotgen/dotsplines.c:maximal_bbox */
|
|
155
|
+
function bboxLeftX(ctx: BboxCtx, vn: Node, ie: Edge | undefined, oe: Edge | undefined): number {
|
|
156
|
+
const b = vn.info.coord.x - vn.info.lw - MBB_FUDGE;
|
|
157
|
+
const left = neighbor(ctx.g, vn, ie, oe, -1);
|
|
158
|
+
if (!left) return Math.min(cround(b), ctx.sp.leftBound);
|
|
159
|
+
// A left neighbor in another cluster clamps us to that cluster's right edge.
|
|
160
|
+
const clBb = clBound(vn, left, ctx.g)?.info.bb;
|
|
161
|
+
const nb = clBb !== undefined
|
|
162
|
+
? clBb.ur.x + ctx.sp.splinesep
|
|
163
|
+
: left.info.coord.x + (left.info.mval ?? 0)
|
|
164
|
+
+ (nodeType(left) === NORMAL ? (ctx.g.info.nodesep ?? 18) / 2 : ctx.sp.splinesep);
|
|
165
|
+
return cround(Math.min(nb, b));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** Right x-extent of the maximal bbox. @see lib/dotgen/dotsplines.c:maximal_bbox */
|
|
169
|
+
function bboxRightX(ctx: BboxCtx, vn: Node, ie: Edge | undefined, oe: Edge | undefined): number {
|
|
170
|
+
const b = isLabeledVirtual(vn)
|
|
171
|
+
? vn.info.coord.x + 10
|
|
172
|
+
: vn.info.coord.x + vn.info.rw + MBB_FUDGE;
|
|
173
|
+
const right = neighbor(ctx.g, vn, ie, oe, 1);
|
|
174
|
+
if (!right) return Math.max(cround(b), ctx.sp.rightBound);
|
|
175
|
+
// A right neighbor in another cluster clamps us to that cluster's left edge.
|
|
176
|
+
const clBb = clBound(vn, right, ctx.g)?.info.bb;
|
|
177
|
+
const nb = clBb !== undefined
|
|
178
|
+
? clBb.ll.x - ctx.sp.splinesep
|
|
179
|
+
: right.info.coord.x - right.info.lw
|
|
180
|
+
- (nodeType(right) === NORMAL ? (ctx.g.info.nodesep ?? 18) / 2 : ctx.sp.splinesep);
|
|
181
|
+
return cround(Math.max(nb, b));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Build the initial bounding box for begin/endpath at node vn.
|
|
186
|
+
* @see lib/dotgen/dotsplines.c:maximal_bbox
|
|
187
|
+
*/
|
|
188
|
+
export function maximalBbox(ctx: BboxCtx, vn: Node, ie: Edge | undefined, oe: Edge | undefined): Box {
|
|
189
|
+
const llx = bboxLeftX(ctx, vn, ie, oe);
|
|
190
|
+
let urx = bboxRightX(ctx, vn, ie, oe);
|
|
191
|
+
if (isLabeledVirtual(vn)) {
|
|
192
|
+
urx -= vn.info.rw;
|
|
193
|
+
if (urx < llx) urx = vn.info.coord.x;
|
|
194
|
+
}
|
|
195
|
+
const ranks = ctx.g.info.rank!;
|
|
196
|
+
const r = vn.info.rank!;
|
|
197
|
+
return {
|
|
198
|
+
ll: { x: llx, y: vn.info.coord.y - rankHt(ranks[r].ht1, vn.info.ht) },
|
|
199
|
+
ur: { x: urx, y: vn.info.coord.y + rankHt(ranks[r].ht2, vn.info.ht) },
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// ---------------------------------------------------------------------------
|
|
204
|
+
// makeregularend / rank_box
|
|
205
|
+
// ---------------------------------------------------------------------------
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Fill box between a node and the inter-rank space (nodes on a rank can differ
|
|
209
|
+
* in height). Regular edges always go top to bottom.
|
|
210
|
+
* @see lib/dotgen/dotsplines.c:makeregularend
|
|
211
|
+
*/
|
|
212
|
+
function makeRegularEnd(b: Box, side: number, y: number): Box {
|
|
213
|
+
if (side === BOTTOM) return { ll: { x: b.ll.x, y }, ur: { x: b.ur.x, y: b.ll.y } };
|
|
214
|
+
return { ll: { x: b.ll.x, y: b.ur.y }, ur: { x: b.ur.x, y } };
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Override the endpoint box's y-extent from the last begin/endpath box, then
|
|
219
|
+
* append a makeregularend box if it is non-degenerate.
|
|
220
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge (b.UR.y/LL.y + makeregularend)
|
|
221
|
+
*/
|
|
222
|
+
export function appendRegularEnd(nb: Box, endp: PathendT, side: number, y: number): void {
|
|
223
|
+
const last = endp.boxes[endp.boxn - 1];
|
|
224
|
+
const b: Box = { ll: { x: nb.ll.x, y: last.ll.y }, ur: { x: nb.ur.x, y: last.ur.y } };
|
|
225
|
+
const end = makeRegularEnd(b, side, y);
|
|
226
|
+
if (end.ll.x < end.ur.x && end.ll.y < end.ur.y) endp.boxes[endp.boxn++] = end;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Inter-rank space box spanning the full routing width between rank r (tail)
|
|
231
|
+
* and rank r+1 (head).
|
|
232
|
+
* @see lib/dotgen/dotsplines.c:rank_box
|
|
233
|
+
*/
|
|
234
|
+
export function rankBox(ctx: BboxCtx, r: number): Box {
|
|
235
|
+
const ranks = ctx.g.info.rank!;
|
|
236
|
+
const top = ranks[r].v[0];
|
|
237
|
+
const bot = ranks[r + 1].v[0];
|
|
238
|
+
return {
|
|
239
|
+
ll: { x: ctx.sp.leftBound, y: bot.info.coord.y + rankHt(ranks[r + 1].ht2, bot.info.ht) },
|
|
240
|
+
ur: { x: ctx.sp.rightBound, y: top.info.coord.y - rankHt(ranks[r].ht1, top.info.ht) },
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// ---------------------------------------------------------------------------
|
|
245
|
+
// completeregularpath / adjustregularpath
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Mirror of C `getsplinepoints`: walk the `to_orig` chain looking for a routed
|
|
250
|
+
* spline, stopping at the first edge that has one or at a NORMAL (real) edge.
|
|
251
|
+
* Returns true when the chain yields no spline. A bound edge's spline often
|
|
252
|
+
* lives on its `to_orig` original rather than on the virtual edge itself, so a
|
|
253
|
+
* one-level `ED_spl(e)==NULL` check (the original port) wrongly reported it
|
|
254
|
+
* missing and made `completeRegularPath` decline plain regular edges whose
|
|
255
|
+
* bound siblings carry their spline on `to_orig` (wide fan-out/fan-in/merge).
|
|
256
|
+
* @see lib/common/splines.c:getsplinepoints
|
|
257
|
+
*/
|
|
258
|
+
function boundSplineMissing(e: Edge): boolean {
|
|
259
|
+
let le: Edge | undefined = e;
|
|
260
|
+
while (le !== undefined) {
|
|
261
|
+
if (le.info.spl !== undefined) return false;
|
|
262
|
+
if ((le.info.edge_type ?? NORMAL) === NORMAL) return true;
|
|
263
|
+
le = le.info.to_orig;
|
|
264
|
+
}
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** True if a bound edge exists but has no spline yet (C getsplinepoints==NULL). */
|
|
269
|
+
function boundMissing(e: Edge | undefined): boolean {
|
|
270
|
+
return e !== undefined && boundSplineMissing(e);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Order guard: every bounding edge must already be routed. C's top_bound /
|
|
275
|
+
* bot_bound only return spline-bearing edges, so in practice this always
|
|
276
|
+
* passes; ported for fidelity to completeregularpath's structure.
|
|
277
|
+
* @see lib/dotgen/dotsplines.c:completeregularpath (getsplinepoints guards)
|
|
278
|
+
*/
|
|
279
|
+
function pathBoundsReady(first: Edge, last: Edge): boolean {
|
|
280
|
+
return !boundMissing(topBound(first, -1)) && !boundMissing(topBound(first, 1))
|
|
281
|
+
&& !boundMissing(botBound(last, -1)) && !boundMissing(botBound(last, 1));
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** Grow rank boxes (even slots) / inter-rank boxes (odd) to a minimum width. */
|
|
285
|
+
function widenPathBoxes(P: Path, fb: number, lb: number): void {
|
|
286
|
+
for (let i = fb - 1; i < lb + 1; i++) {
|
|
287
|
+
const bp = P.boxes[i];
|
|
288
|
+
const even = (i - fb) % 2 === 0;
|
|
289
|
+
const tooNarrow = even ? bp.ll.x >= bp.ur.x : bp.ll.x + MINW > bp.ur.x;
|
|
290
|
+
if (tooNarrow) {
|
|
291
|
+
const x = (bp.ll.x + bp.ur.x) / 2;
|
|
292
|
+
bp.ll.x = x - HALFMINW;
|
|
293
|
+
bp.ur.x = x + HALFMINW;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/** Stretch the later box (bp2) to overlap bp1 by at least MINW. */
|
|
299
|
+
function growForward(bp1: Box, bp2: Box): void {
|
|
300
|
+
if (bp1.ll.x + MINW > bp2.ur.x) bp2.ur.x = bp1.ll.x + MINW;
|
|
301
|
+
if (bp1.ur.x - MINW < bp2.ll.x) bp2.ll.x = bp1.ur.x - MINW;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/** Stretch the earlier box (bp1) to overlap bp2 by at least MINW. */
|
|
305
|
+
function growBackward(bp1: Box, bp2: Box): void {
|
|
306
|
+
if (bp1.ll.x + MINW > bp2.ur.x) bp1.ll.x = bp2.ur.x - MINW;
|
|
307
|
+
if (bp1.ur.x - MINW < bp2.ll.x) bp1.ur.x = bp2.ll.x + MINW;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** Guarantee an overlap of at least MINW between adjacent boxes. */
|
|
311
|
+
function overlapPathBoxes(P: Path, fb: number, lb: number): void {
|
|
312
|
+
for (let i = 0; i + 1 < P.nbox; i++) {
|
|
313
|
+
const bp1 = P.boxes[i];
|
|
314
|
+
const bp2 = P.boxes[i + 1];
|
|
315
|
+
if (i >= fb && i <= lb && (i - fb) % 2 === 0) growForward(bp1, bp2);
|
|
316
|
+
else if (i + 1 >= fb && i < lb && (i + 1 - fb) % 2 === 0) growBackward(bp1, bp2);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Widen the assembled path so it is wide enough. fb/lb bracket the inter-rank
|
|
322
|
+
* boxes; if fb > lb there are none (the adjacent-rank case — both loops are
|
|
323
|
+
* no-ops).
|
|
324
|
+
* @see lib/dotgen/dotsplines.c:adjustregularpath
|
|
325
|
+
*/
|
|
326
|
+
function adjustRegularPath(P: Path, fb: number, lb: number): void {
|
|
327
|
+
widenPathBoxes(P, fb, lb);
|
|
328
|
+
overlapPathBoxes(P, fb, lb);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Concatenate tail boxes, inter-rank boxes (forward), and head boxes
|
|
333
|
+
* (reversed) into P, then widen. Returns false if a bounding edge is unrouted.
|
|
334
|
+
* @see lib/dotgen/dotsplines.c:completeregularpath
|
|
335
|
+
*/
|
|
336
|
+
export function completeRegularPath(parts: RegularPathParts): boolean {
|
|
337
|
+
const { P, first, last, tend, hend, boxes } = parts;
|
|
338
|
+
if (!pathBoundsReady(first, last)) return false;
|
|
339
|
+
for (let i = 0; i < tend.boxn; i++) addBox(P, tend.boxes[i]);
|
|
340
|
+
const fb = P.nbox + 1;
|
|
341
|
+
const lb = fb + boxes.length - 3;
|
|
342
|
+
for (let i = 0; i < boxes.length; i++) addBox(P, boxes[i]);
|
|
343
|
+
for (let i = hend.boxn - 1; i >= 0; i--) addBox(P, hend.boxes[i]);
|
|
344
|
+
adjustRegularPath(P, fb, lb);
|
|
345
|
+
return true;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// ---------------------------------------------------------------------------
|
|
349
|
+
// adapter
|
|
350
|
+
// ---------------------------------------------------------------------------
|
|
351
|
+
|
|
352
|
+
/** A fresh path endpoint seeded with its node bounding box. */
|
|
353
|
+
export function freshEndp(nb: Box): PathendT {
|
|
354
|
+
return { nb, np: { x: 0, y: 0 }, sidemask: 0, boxn: 0, boxes: [] };
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** beginPath/endPath args for a single non-merged regular edge. */
|
|
358
|
+
function pathArgs(P: Path, e: Edge, endp: PathendT, merge: boolean, ranksep: number) {
|
|
359
|
+
return { P, e, et: REGULAREDGE, endp, merge, ranksep };
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Route a regular adjacent-rank edge through the faithful box-channel
|
|
364
|
+
* pipeline. Returns spline control points in graphviz-internal (y-up)
|
|
365
|
+
* coordinates; null when the edge is not an adjacent-rank regular edge or
|
|
366
|
+
* the path cannot be assembled (decline — the caller may fall back); or
|
|
367
|
+
* 'lost' when the full corridor was attempted and routesplines itself
|
|
368
|
+
* failed — C installs no spline and the edge is LOST (map_edge warns, emit
|
|
369
|
+
* skips), never straight-line synthesized. Does NOT clip or install.
|
|
370
|
+
*
|
|
371
|
+
* @see lib/dotgen/dotsplines.c:make_regular_edge (adjacent-rank, no virtual chain)
|
|
372
|
+
* @see lib/common/routespl.c:routesplines (failure -> NULL, edge lost)
|
|
373
|
+
*/
|
|
374
|
+
export function routeRegularEdgeFaithful(g: Graph, e: Edge): Point[] | null | 'lost' {
|
|
375
|
+
const ranks = g.info.rank;
|
|
376
|
+
const r = e.tail.info.rank;
|
|
377
|
+
if (ranks === undefined || r === undefined || e.head.info.rank !== r + 1) return null;
|
|
378
|
+
const tn = e.tail;
|
|
379
|
+
const hn = e.head;
|
|
380
|
+
const ctx: BboxCtx = {
|
|
381
|
+
g,
|
|
382
|
+
sp: {
|
|
383
|
+
...getSplineBounds(g),
|
|
384
|
+
splinesep: Math.trunc((g.info.nodesep ?? 18) / 4),
|
|
385
|
+
},
|
|
386
|
+
};
|
|
387
|
+
const ranksep = graphRanksep(g);
|
|
388
|
+
const P: Path = { start: makePort(), end: makePort(), nbox: 0, boxes: [], data: null };
|
|
389
|
+
|
|
390
|
+
const tend = freshEndp(maximalBbox(ctx, tn, undefined, e));
|
|
391
|
+
beginPath(pathArgs(P, e, tend, splineMerge(tn), ranksep));
|
|
392
|
+
appendRegularEnd(tend.nb, tend, BOTTOM, tn.info.coord.y - rankHt(ranks[r].ht1, tn.info.ht));
|
|
393
|
+
|
|
394
|
+
const boxes: Box[] = [rankBox(ctx, r)];
|
|
395
|
+
|
|
396
|
+
const hend = freshEndp(maximalBbox(ctx, hn, e, undefined));
|
|
397
|
+
endPath(pathArgs(P, e, hend, splineMerge(hn), ranksep));
|
|
398
|
+
appendRegularEnd(hend.nb, hend, TOP, hn.info.coord.y + rankHt(ranks[r + 1].ht2, hn.info.ht));
|
|
399
|
+
|
|
400
|
+
if (!completeRegularPath({ P, first: e, last: e, tend, hend, boxes })) return null;
|
|
401
|
+
const pts = routeRegularByType(P, edgeType(g));
|
|
402
|
+
if (pts === null) return 'lost';
|
|
403
|
+
return pts;
|
|
404
|
+
}
|