@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,598 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* make_flat_edge, make_flat_adj_edges and helpers — flat edge spline routing.
|
|
5
|
+
*
|
|
6
|
+
* Flat edges connect nodes on the same rank. The adjacent-node case
|
|
7
|
+
* (make_flat_adj_edges) recursively invokes the full dot pipeline on a
|
|
8
|
+
* cloned subgraph. Full pathplan routing is deferred until pathplan.ts
|
|
9
|
+
* is ported.
|
|
10
|
+
*
|
|
11
|
+
* @see lib/dotgen/dotsplines.c:make_flat_edge, make_flat_adj_edges
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { Graph } from '../../model/graph.js';
|
|
15
|
+
import type { Edge } from '../../model/edge.js';
|
|
16
|
+
import type { Node } from '../../model/node.js';
|
|
17
|
+
import type { Box, Point } from '../../model/geom.js';
|
|
18
|
+
import type { Path, PathendT } from '../../common/types.js';
|
|
19
|
+
import type { SplineInfo } from './splines-route.js';
|
|
20
|
+
import { dotRank } from './rank.js';
|
|
21
|
+
import { dotMincross } from './mincross.js';
|
|
22
|
+
import { dotPosition } from './position.js';
|
|
23
|
+
import { dotSameports } from './sameport.js';
|
|
24
|
+
import { dotSplines_, swapEndsP, swapEdgeSpline } from './splines.js';
|
|
25
|
+
import { makePort } from '../../model/edgeInfo.js';
|
|
26
|
+
import { beginPath } from '../../common/splines-path-begin.js';
|
|
27
|
+
import { endPath } from '../../common/splines-path-end.js';
|
|
28
|
+
import { routeSplines } from '../../common/splines-routespl.js';
|
|
29
|
+
import { addBox, resolvePort } from '../../common/splines-path-shared.js';
|
|
30
|
+
import { TOP, BOTTOM, FLATEDGE } from '../../common/splines-constants.js';
|
|
31
|
+
import {
|
|
32
|
+
maximalBbox, appendRegularEnd, freshEndp, type BboxCtx,
|
|
33
|
+
} from './edge-route-faithful.js';
|
|
34
|
+
import { getSplineBounds } from './edge-route-rank.js';
|
|
35
|
+
import { graphRanksep } from './position-aux.js';
|
|
36
|
+
import { Edge as EdgeClass } from '../../model/edge.js';
|
|
37
|
+
import { cloneNode, cloneEdge, cleanupCloneGraph, transformf } from './splines-clone.js';
|
|
38
|
+
import { dotInitNodeEdge } from './init.js';
|
|
39
|
+
import { gvPostprocess } from '../../common/postproc.js';
|
|
40
|
+
import { newSpline } from '../../common/splines-clip.js';
|
|
41
|
+
import { mapArrowOpPoints } from '../../common/arrows-shapes-util.js';
|
|
42
|
+
import type { ArrowDrawOp } from '../../common/arrows-types.js';
|
|
43
|
+
import { updateBbBz } from '../../common/splines-geom.js';
|
|
44
|
+
import { placeRegularEdgeLabels, updateBB } from './splines-label.js';
|
|
45
|
+
import { NORMAL, VIRTUAL } from './fastgr.js';
|
|
46
|
+
import { EDGE_LABEL } from './rank.js';
|
|
47
|
+
|
|
48
|
+
/** Bundled args for makeFlatEndBox (keeps params <= 5). Declared here (not
|
|
49
|
+
* between functions) so lizard's TS parser doesn't fold it into a neighbor. */
|
|
50
|
+
export interface FlatEndParts {
|
|
51
|
+
ctx: BboxCtx;
|
|
52
|
+
P: Path;
|
|
53
|
+
e: Edge;
|
|
54
|
+
n: Node;
|
|
55
|
+
side: number;
|
|
56
|
+
ranksep: number;
|
|
57
|
+
isBegin: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
// cloneGraph — build auxiliary graph for flat adj routing
|
|
62
|
+
// @see lib/dotgen/dotsplines.c:cloneGraph
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Create a minimal clone of g for flat-adj routing.
|
|
67
|
+
* @see lib/dotgen/dotsplines.c:cloneGraph
|
|
68
|
+
*/
|
|
69
|
+
export function cloneGraph(g: Graph): Graph {
|
|
70
|
+
const auxg = new Graph('auxg', g.kind);
|
|
71
|
+
auxg.info.nodesep = g.info.nodesep;
|
|
72
|
+
auxg.info.ranksep = g.info.ranksep;
|
|
73
|
+
auxg.info.flags = g.info.flags;
|
|
74
|
+
// Mirror C cloneGraph: if parent is flipped (LR/RL) set rankdir=TB on auxg,
|
|
75
|
+
// else set rankdir=LR. The flat-adj pipeline needs the inverse axis.
|
|
76
|
+
// @see lib/dotgen/dotsplines.c:787-790
|
|
77
|
+
if (g.info.flip) {
|
|
78
|
+
// SET_RANKDIR(auxg, RANKDIR_TB): rankdir=0, flip=false
|
|
79
|
+
auxg.info.rankdir = 0;
|
|
80
|
+
auxg.info.flip = false;
|
|
81
|
+
} else {
|
|
82
|
+
// SET_RANKDIR(auxg, RANKDIR_LR): rankdir=(1<<2)|1=5, flip=true
|
|
83
|
+
auxg.info.rankdir = (1 << 2) | 1;
|
|
84
|
+
auxg.info.flip = true;
|
|
85
|
+
}
|
|
86
|
+
auxg.info.dotroot = auxg;
|
|
87
|
+
auxg.info.gvc = g.info.gvc;
|
|
88
|
+
return auxg;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// runAuxPipeline — rank + mincross + position on the cloned graph
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
|
|
95
|
+
/** Run rank, mincross, position on auxg; return non-zero on failure. */
|
|
96
|
+
export function runAuxPipeline(auxg: Graph): number {
|
|
97
|
+
dotRank(auxg);
|
|
98
|
+
const r = dotMincross(auxg);
|
|
99
|
+
if (r !== 0) return r;
|
|
100
|
+
return dotPosition(auxg);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Run sameports + splines (no normalize) on auxg; return non-zero on failure. */
|
|
104
|
+
export function runAuxSplines(auxg: Graph): number {
|
|
105
|
+
dotSameports(auxg);
|
|
106
|
+
return dotSplines_(auxg, false);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
// make_flat_adj_edges — recursive pipeline for adjacent flat edges
|
|
111
|
+
// @see lib/dotgen/dotsplines.c:make_flat_adj_edges
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Route flat edges between adjacent nodes by running the full dot pipeline
|
|
116
|
+
* on a cloned subgraph (rotated 90°).
|
|
117
|
+
*
|
|
118
|
+
* Acceptance criterion 1: after this call, the cloned graph's nodes have
|
|
119
|
+
* coord set (verified by dotPosition setting ND_coord).
|
|
120
|
+
*
|
|
121
|
+
* @see lib/dotgen/dotsplines.c:make_flat_adj_edges
|
|
122
|
+
*/
|
|
123
|
+
/** Aux graph + the two cloned endpoints + original→aux edge map. */
|
|
124
|
+
interface FlatAux { auxg: Graph; auxt: Node; auxh: Node; alg: Map<Edge, Edge>; }
|
|
125
|
+
|
|
126
|
+
/** Walk an edge to its NORMAL original. @see make_flat_adj_edges (ED_to_orig loop) */
|
|
127
|
+
function toNormalEdge(e: Edge): Edge {
|
|
128
|
+
let cur = e;
|
|
129
|
+
while ((cur.info.edge_type ?? NORMAL) !== NORMAL && cur.info.to_orig != null) {
|
|
130
|
+
cur = cur.info.to_orig;
|
|
131
|
+
}
|
|
132
|
+
return cur;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** True when an edge has no declared port on either end. */
|
|
136
|
+
function isPortless(e: Edge): boolean {
|
|
137
|
+
return !e.info.tail_port.defined && !e.info.head_port.defined;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Clone one edge into the aux graph, oriented tail→head from the original.
|
|
142
|
+
* `tn` is the node auxt was cloned from — C's flip-swapped `tn`
|
|
143
|
+
* (`aghead(e0)` under flip, else `agtail(e0)`). The orientation test must use
|
|
144
|
+
* that same node: C does `if (agtail(e) == tn) cloneEdge(auxt,auxh) else
|
|
145
|
+
* cloneEdge(auxh,auxt)`. Using the un-swapped tail here reverses every clone in
|
|
146
|
+
* flip (rankdir=LR) graphs, so an asymmetric compass-port pair (e.g. #1949
|
|
147
|
+
* structParty:N / :S) puts the detour loop on the wrong edge.
|
|
148
|
+
* @see lib/dotgen/dotsplines.c:make_flat_adj_edges (SWAP + cloneEdge branch)
|
|
149
|
+
*/
|
|
150
|
+
function cloneFlatEdge(auxg: Graph, tn: Node, auxt: Node, auxh: Node, orig: Edge): Edge {
|
|
151
|
+
return orig.tail === tn
|
|
152
|
+
? cloneEdge(auxg, auxt, auxh, orig) : cloneEdge(auxg, auxh, auxt, orig);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Forward-normalized lead-edge endpoints (C make_flat_edge's makefwdedge of
|
|
157
|
+
* `*edges`). setflags marks a FLATEDGE as BWDEDGE exactly when
|
|
158
|
+
* ND_order(tail) > ND_order(head), and make_flat_edge forward-normalizes a
|
|
159
|
+
* BWDEDGE lead via makefwdedge (swapping ends) BEFORE passing it to
|
|
160
|
+
* make_flat_adj_edges as e0. Net C invariant: the e0 whose tail/head feed
|
|
161
|
+
* tn/hn always runs left→right — tail = the lower-ND_order endpoint. A group
|
|
162
|
+
* whose lead runs high→low order (e.g. #1949's
|
|
163
|
+
* `structDefaultAuto->structParty:N` under rankdir=LR, a lone BWDEDGE group
|
|
164
|
+
* after the getmainedge split) must swap here; otherwise auxt/auxh, the
|
|
165
|
+
* reposition frame, and del all mirror, and the aux clone flips fwd↔back.
|
|
166
|
+
* @see lib/dotgen/dotsplines.c:setflags (FLATEDGE order predicate)
|
|
167
|
+
* @see lib/dotgen/dotsplines.c:make_flat_edge (makefwdedge of *edges)
|
|
168
|
+
*/
|
|
169
|
+
function flatLeadPair(edges: Edge[]): { tn: Node; hn: Node } {
|
|
170
|
+
const t = edges[0].tail, h = edges[0].head;
|
|
171
|
+
return (t.info.order ?? 0) < (h.info.order ?? 0) ? { tn: t, hn: h } : { tn: h, hn: t };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Build the rotated auxiliary graph: clone tail/head + each edge, then add a
|
|
176
|
+
* heavy ordering edge so the pair lands on adjacent ranks.
|
|
177
|
+
* @see lib/dotgen/dotsplines.c:make_flat_adj_edges (clone + hvye)
|
|
178
|
+
*/
|
|
179
|
+
function buildFlatAux(g: Graph, edges: Edge[], cnt: number): FlatAux {
|
|
180
|
+
const { tn: ltn, hn: lhn } = flatLeadPair(edges);
|
|
181
|
+
const flip = g.info.flip ?? false;
|
|
182
|
+
// C swaps tn/hn under flip, then clones auxt from tn and orients every edge
|
|
183
|
+
// against that same (swapped) tn. `refTn` is that node — the one auxt is
|
|
184
|
+
// cloned from — so the orientation test in cloneFlatEdge matches C.
|
|
185
|
+
const refTn = flip ? lhn : ltn;
|
|
186
|
+
const auxg = cloneGraph(g);
|
|
187
|
+
const auxt = cloneNode(auxg, refTn);
|
|
188
|
+
const auxh = cloneNode(auxg, flip ? ltn : lhn);
|
|
189
|
+
const alg = new Map<Edge, Edge>();
|
|
190
|
+
let hvye: Edge | null = null;
|
|
191
|
+
for (let i = 0; i < cnt; i++) {
|
|
192
|
+
const orig = toNormalEdge(edges[i]);
|
|
193
|
+
const auxe = cloneFlatEdge(auxg, refTn, auxt, auxh, orig);
|
|
194
|
+
alg.set(orig, auxe);
|
|
195
|
+
if (hvye === null && isPortless(orig)) hvye = auxe;
|
|
196
|
+
}
|
|
197
|
+
if (hvye === null) { hvye = new EdgeClass(auxt, auxh, ''); auxg.edges.push(hvye); }
|
|
198
|
+
hvye.info.weight = 10000;
|
|
199
|
+
return { auxg, auxt, auxh, alg };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** True if vn is a real (NORMAL) or labeled-virtual node — blocks adjacency. */
|
|
203
|
+
function blocksAdjacency(vn: Node | null): boolean {
|
|
204
|
+
if (vn === null) return false;
|
|
205
|
+
const t = vn.info.node_type ?? NORMAL;
|
|
206
|
+
return t === NORMAL || (t === VIRTUAL && vn.info.label != null);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** True if no adjacency-blocking node sits strictly between rank orders lo..hi. */
|
|
210
|
+
function noBlockerBetween(v: ReadonlyArray<Node | null>, lo: number, hi: number): boolean {
|
|
211
|
+
for (let i = lo + 1; i < hi; i++) {
|
|
212
|
+
if (blocksAdjacency(v[i] ?? null)) return false;
|
|
213
|
+
}
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** Reposition aux nodes into a frame aligned with the original graph.
|
|
218
|
+
* tn/hn are the forward-normalized lead endpoints (flatLeadPair): C computes
|
|
219
|
+
* rightx/leftx from the makefwdedge-normalized e0 BEFORE the flip swap, and
|
|
220
|
+
* midx from tn/hn AFTER it. @see lib/dotgen/dotsplines.c:make_flat_adj_edges */
|
|
221
|
+
function repositionFlatAux(g: Graph, edges: Edge[], aux: FlatAux): void {
|
|
222
|
+
const { tn: ltn, hn: lhn } = flatLeadPair(edges);
|
|
223
|
+
const flip = g.info.flip ?? false;
|
|
224
|
+
const rightx = lhn.info.coord.x, leftx = ltn.info.coord.x;
|
|
225
|
+
const stn = flip ? lhn : ltn;
|
|
226
|
+
const shn = flip ? ltn : lhn;
|
|
227
|
+
const midx = (stn.info.coord.x - stn.info.rw + shn.info.coord.x + shn.info.lw) / 2;
|
|
228
|
+
const midy = (aux.auxt.info.coord.x + aux.auxh.info.coord.x) / 2;
|
|
229
|
+
// Iterate the full node list (C's GD_nlist), not just the named-node Map:
|
|
230
|
+
// virtual label + routing nodes must be repositioned to midx too. Skipping
|
|
231
|
+
// them (Map only) bends labeled-flat splines and mislays the label.
|
|
232
|
+
// @see lib/dotgen/dotsplines.c:1215-1232
|
|
233
|
+
for (let n: Node | undefined = aux.auxg.info.nlist; n; n = n.info.next) {
|
|
234
|
+
if (n === aux.auxt) n.info.coord = { x: midy, y: rightx };
|
|
235
|
+
else if (n === aux.auxh) n.info.coord = { x: midy, y: leftx };
|
|
236
|
+
else n.info.coord = { x: n.info.coord.x, y: midx };
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** Transform the aux edge's head-arrow draw-ops onto the original edge.
|
|
241
|
+
* C regenerates the arrowhead at emit time from the spline's eflag/ep; the port
|
|
242
|
+
* pre-stashes the ops during routing. A reversed back-edge clone
|
|
243
|
+
* (routeFaithfulAdjacentBack) stashes its arrow as `tailArrowOps` (sflag side)
|
|
244
|
+
* BEFORE swapSpline flips the spline to a head arrow (eflag), so its head ops
|
|
245
|
+
* live under the tail field — recover it when the swapped spline carries eflag
|
|
246
|
+
* but `headArrowOps` is absent (e.g. #241_0 `3:sw->2:se`).
|
|
247
|
+
* @see lib/dotgen/dotsplines.c:make_flat_adj_edges */
|
|
248
|
+
function copyFlatArrow(orig: Edge, auxe: Edge, del: Point, flip: boolean): void {
|
|
249
|
+
const xf = (ops: ArrowDrawOp[]): ArrowDrawOp[] =>
|
|
250
|
+
ops.map(op => mapArrowOpPoints(op, p => transformf(p, del, flip)));
|
|
251
|
+
const eflag = auxe.info.spl?.list[0]?.eflag;
|
|
252
|
+
// Natural head: the aux head ops; reversed-clone fallback: the tail ops stand
|
|
253
|
+
// in for the head when the swapped spline carries eflag but no head ops were
|
|
254
|
+
// stashed (#241_0 `3:sw->2:se`).
|
|
255
|
+
const head = auxe.info.headArrowOps ?? (eflag ? auxe.info.tailArrowOps : undefined);
|
|
256
|
+
if (head !== undefined) orig.info.headArrowOps = xf(head);
|
|
257
|
+
// Natural tail arrow (dir=both / dir=back), unless the tail ops were already
|
|
258
|
+
// consumed as the head above (reversed clone: no head ops + eflag).
|
|
259
|
+
const tailConsumed = auxe.info.headArrowOps === undefined && eflag;
|
|
260
|
+
if (auxe.info.tailArrowOps !== undefined && !tailConsumed) {
|
|
261
|
+
orig.info.tailArrowOps = xf(auxe.info.tailArrowOps);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** Copy the aux edge's label position back onto the original, growing the
|
|
266
|
+
* graph bb. @see lib/dotgen/dotsplines.c:make_flat_adj_edges 1273-1277 */
|
|
267
|
+
function copyFlatLabel(orig: Edge, auxe: Edge, del: Point, flip: boolean, g: Graph): void {
|
|
268
|
+
const lbl = orig.info.label, auxLbl = auxe.info.label;
|
|
269
|
+
if (lbl === undefined || auxLbl === undefined || !auxLbl.set) return;
|
|
270
|
+
lbl.pos = transformf(auxLbl.pos, del, flip);
|
|
271
|
+
lbl.set = true;
|
|
272
|
+
if (g.info.bb !== undefined) updateBB(g, lbl);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** transformf the aux edge's spline + arrowhead + label onto the original edge. */
|
|
276
|
+
function copyOneFlatSpline(orig: Edge, auxe: Edge, del: Point, flip: boolean, g: Graph): void {
|
|
277
|
+
const auxbz = auxe.info.spl?.list[0];
|
|
278
|
+
if (auxbz === undefined) return;
|
|
279
|
+
// Copy bz.size points, not list.length: clip lowers `size` below the
|
|
280
|
+
// over-allocated `list` (e.g. an arrow-clipped head drops 7→4); emitting
|
|
281
|
+
// list.length would append the unclipped tail of the spline. @see the
|
|
282
|
+
// "emit uses bz.size not list.length" hazard (dotsplines.c install).
|
|
283
|
+
const sz = auxbz.size;
|
|
284
|
+
const bz = newSpline(orig, sz);
|
|
285
|
+
bz.sflag = auxbz.sflag;
|
|
286
|
+
bz.eflag = auxbz.eflag;
|
|
287
|
+
bz.sp = transformf(auxbz.sp, del, flip);
|
|
288
|
+
bz.ep = transformf(auxbz.ep, del, flip);
|
|
289
|
+
for (let j = 0; j < sz; j++) bz.list[j] = transformf(auxbz.list[j], del, flip);
|
|
290
|
+
// Grow the graph bb by each transformed bezier segment. @see dotsplines.c:1270
|
|
291
|
+
const bb = g.info.bb;
|
|
292
|
+
if (bb !== undefined) {
|
|
293
|
+
for (let j = 0; j + 3 < sz; j += 3) {
|
|
294
|
+
updateBbBz(bb, [bz.list[j], bz.list[j + 1], bz.list[j + 2], bz.list[j + 3]]);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
copyFlatArrow(orig, auxe, del, flip);
|
|
298
|
+
copyFlatLabel(orig, auxe, del, flip, g);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** Copy every routed aux spline back to its original edge. `del` anchors on
|
|
302
|
+
* the flip-swapped, forward-normalized lead tail — the node auxt was cloned
|
|
303
|
+
* from (C's tn at the del computation).
|
|
304
|
+
* @see lib/dotgen/dotsplines.c:make_flat_adj_edges (copy splines, del) */
|
|
305
|
+
function copyFlatSplines(g: Graph, edges: Edge[], aux: FlatAux): void {
|
|
306
|
+
const { tn: ltn, hn: lhn } = flatLeadPair(edges);
|
|
307
|
+
const flip = g.info.flip ?? false;
|
|
308
|
+
const stn = flip ? lhn : ltn;
|
|
309
|
+
const at = aux.auxt.info.coord;
|
|
310
|
+
const del = flip
|
|
311
|
+
? { x: stn.info.coord.x - at.y, y: stn.info.coord.y + at.x }
|
|
312
|
+
: { x: stn.info.coord.x - at.x, y: stn.info.coord.y - at.y };
|
|
313
|
+
for (let i = 0; i < edges.length; i++) {
|
|
314
|
+
const orig = toNormalEdge(edges[i]);
|
|
315
|
+
const auxe = aux.alg.get(orig);
|
|
316
|
+
if (auxe === undefined) continue;
|
|
317
|
+
copyOneFlatSpline(orig, auxe, del, flip, g);
|
|
318
|
+
normalizeCopiedFlatSpline(orig, auxe);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Apply C's top-level `edge_normalize` to a copied flat-adj spline.
|
|
324
|
+
*
|
|
325
|
+
* C copies the aux spline UN-normalized — `dot_splines_(auxg, 0)` never runs
|
|
326
|
+
* `edge_normalize` inside the aux, so a back-edge clone's geometry stays in
|
|
327
|
+
* its makefwdedge routing direction (rank0→rank1, i.e. auxt→auxh) with the
|
|
328
|
+
* arrow flags already swapped onto the geometric ends by arrow_clip
|
|
329
|
+
* (`swapEnds(auxe)` — rank-based, true for every back-edge clone). The
|
|
330
|
+
* TOP-LEVEL `edge_normalize` then reverses the copied spline iff
|
|
331
|
+
* `swap_ends_p(orig)` — for a flat MAIN edge that is the ORDER predicate:
|
|
332
|
+
* ND_order(head) < ND_order(tail) (dotsplines.c:113-124, 443-445).
|
|
333
|
+
*
|
|
334
|
+
* The port's aux routers instead normalize IN the aux, keyed on the aux
|
|
335
|
+
* edge's ranks (`routeFaithfulAdjacentBack` swaps exactly when
|
|
336
|
+
* `swapEndsP(auxe)` is true), and the top-level `edgeNormalize` never sees
|
|
337
|
+
* flat edges (it walks the fast graph's ND_out lists, which exclude flats).
|
|
338
|
+
* Net correction: the copied spline needs one more reversal exactly when the
|
|
339
|
+
* two predicates disagree.
|
|
340
|
+
*
|
|
341
|
+
* This is the T10b discriminator between the two oracle-pinned cases:
|
|
342
|
+
* 241_0 `3:sw->2:se` points right-to-left (ND_order(2)=2 < ND_order(3)=3),
|
|
343
|
+
* so BOTH predicates are true — the aux swap already matches C's normalize
|
|
344
|
+
* and the spline stays tail→head. 1949 `structParty:S->structDefaultAuto`
|
|
345
|
+
* under rankdir=LR points low-order→high-order (ND_order(structParty)=0 <
|
|
346
|
+
* ND_order(structDefaultAuto)=1): the aux clone is still a back edge
|
|
347
|
+
* (aux swap true) but C's normalize predicate is FALSE, so C leaves the
|
|
348
|
+
* spline head→tail (sflag marks the head arrow at list[0]) and
|
|
349
|
+
* place_portlabel reads the taillabel off the head end — a load-bearing C
|
|
350
|
+
* quirk this reproduces byte-for-byte.
|
|
351
|
+
*
|
|
352
|
+
* @see lib/dotgen/dotsplines.c:edge_normalize, swap_ends_p
|
|
353
|
+
*/
|
|
354
|
+
function normalizeCopiedFlatSpline(orig: Edge, auxe: Edge): void {
|
|
355
|
+
if (orig.info.spl === undefined) return;
|
|
356
|
+
if (swapEndsP(auxe) !== swapEndsP(orig)) swapEdgeSpline(orig);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Route adjacent flat edges (with ports) via a rotated auxiliary layout, then
|
|
361
|
+
* transform the resulting splines back onto the original edges. Installs splines
|
|
362
|
+
* directly on the originals (returns 0 on success). Records and the no-port
|
|
363
|
+
* makeSimpleFlat branch are out of scope (callers gate on a side port).
|
|
364
|
+
* @see lib/dotgen/dotsplines.c:make_flat_adj_edges
|
|
365
|
+
*/
|
|
366
|
+
export function makeFlatAdjEdges(g: Graph, edges: Edge[], cnt: number, _et: number): number {
|
|
367
|
+
const aux = buildFlatAux(g, edges, cnt);
|
|
368
|
+
dotInitNodeEdge(aux.auxg);
|
|
369
|
+
dotRank(aux.auxg);
|
|
370
|
+
if (dotMincross(aux.auxg) !== 0) return 1;
|
|
371
|
+
if (dotPosition(aux.auxg) !== 0) return 1;
|
|
372
|
+
repositionFlatAux(g, edges, aux);
|
|
373
|
+
dotSameports(aux.auxg);
|
|
374
|
+
dotSplines_(aux.auxg, false);
|
|
375
|
+
// The labeled chain edge routes in routeDotEdges (after dotSplines_'s own
|
|
376
|
+
// label pass), so recover_slack repositions the label vnode only afterward.
|
|
377
|
+
// Re-place the aux labels here to read the final vnode coords (DOT-12).
|
|
378
|
+
// @see lib/dotgen/dotsplines.c:make_regular_edge (recover_slack before place_vnlabel)
|
|
379
|
+
placeRegularEdgeLabels(aux.auxg);
|
|
380
|
+
gvPostprocess(aux.auxg);
|
|
381
|
+
copyFlatSplines(g, edges, aux);
|
|
382
|
+
cleanupCloneGraph(aux.auxg);
|
|
383
|
+
return 0;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* True when a same-rank edge's endpoints are adjacent in rank order (no NORMAL
|
|
388
|
+
* or labeled-virtual node between them) — the make_flat_adj_edges case.
|
|
389
|
+
* @see lib/dotgen/flat.c:checkFlatAdjacent
|
|
390
|
+
*/
|
|
391
|
+
export function isFlatAdjacent(g: Graph, e: Edge): boolean {
|
|
392
|
+
const r = e.tail.info.rank;
|
|
393
|
+
if (r === undefined || e.head.info.rank !== r) return false;
|
|
394
|
+
const rank = g.info.rank?.[r];
|
|
395
|
+
if (rank === undefined) return false;
|
|
396
|
+
const to = e.tail.info.order ?? 0;
|
|
397
|
+
const ho = e.head.info.order ?? 0;
|
|
398
|
+
return noBlockerBetween(rank.v, Math.min(to, ho), Math.max(to, ho));
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// ---------------------------------------------------------------------------
|
|
402
|
+
// make_flat_edge — dispatch flat edge routing
|
|
403
|
+
// @see lib/dotgen/dotsplines.c:make_flat_edge
|
|
404
|
+
// ---------------------------------------------------------------------------
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Route a group of flat (same-rank) edges.
|
|
408
|
+
* @see lib/dotgen/dotsplines.c:make_flat_edge
|
|
409
|
+
*/
|
|
410
|
+
export function makeFlatEdge(
|
|
411
|
+
g: Graph,
|
|
412
|
+
_sp: SplineInfo,
|
|
413
|
+
edges: Edge[],
|
|
414
|
+
cnt: number,
|
|
415
|
+
et: number,
|
|
416
|
+
): number {
|
|
417
|
+
if (cnt === 0 || edges.length === 0) return 0;
|
|
418
|
+
const isAdj = edges.some(e => (e.info.adjacent ?? 0) !== 0);
|
|
419
|
+
if (isAdj) return makeFlatAdjEdges(g, edges, cnt, et);
|
|
420
|
+
// C's labeled-flat dispatch lives in the live router here (AD-3): see
|
|
421
|
+
// edge-route.ts:routeForwardEdge → makeFlatLabeledEdge. Unlabeled: routeFlatEdgeFaithful.
|
|
422
|
+
return 0;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// ---------------------------------------------------------------------------
|
|
426
|
+
// routeFlatEdgeFaithful — faithful side-port routing for a single flat edge
|
|
427
|
+
// @see lib/dotgen/dotsplines.c:make_flat_edge (non-adjacent, non-labeled,
|
|
428
|
+
// EDGETYPE_SPLINE: the top-routing branch + make_flat_bottom_edges),
|
|
429
|
+
// makeFlatEnd / makeBottomFlatEnd
|
|
430
|
+
// ---------------------------------------------------------------------------
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* makeFlatEnd (side=TOP) / makeBottomFlatEnd (side=BOTTOM): seed the endpoint
|
|
434
|
+
* box from maximal_bbox, set the side mask, run begin/endpath (FLATEDGE feeds
|
|
435
|
+
* BeginFlatSide/EndFlatSide), then append the makeregularend box up to (TOP) or
|
|
436
|
+
* down from (BOTTOM) the node's rank extent.
|
|
437
|
+
* @see lib/dotgen/dotsplines.c:makeFlatEnd, makeBottomFlatEnd
|
|
438
|
+
*/
|
|
439
|
+
export function makeFlatEndBox(parts: FlatEndParts): PathendT {
|
|
440
|
+
const { ctx, P, e, n, side, ranksep, isBegin } = parts;
|
|
441
|
+
const endp = freshEndp(maximalBbox(ctx, n, undefined, e));
|
|
442
|
+
endp.sidemask = side;
|
|
443
|
+
const args = {
|
|
444
|
+
P, e, et: FLATEDGE, endp, merge: false,
|
|
445
|
+
ranksep,
|
|
446
|
+
};
|
|
447
|
+
if (isBegin) beginPath(args); else endPath(args);
|
|
448
|
+
const ranks = ctx.g.info.rank!;
|
|
449
|
+
const ht2 = ranks[n.info.rank!].ht2;
|
|
450
|
+
const y = side === TOP ? n.info.coord.y + ht2 : n.info.coord.y - ht2;
|
|
451
|
+
appendRegularEnd(endp.nb, endp, side, y);
|
|
452
|
+
return endp;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* The three connecting boxes for the top-routing branch (loop over the top).
|
|
457
|
+
* END boxes offset by `endStepX`/`endStepY` (C `(i+1)·step`); MIDDLE box keeps
|
|
458
|
+
* height `midStepY` (C plain `stepy`). cnt=1 ⇒ all three = step (original).
|
|
459
|
+
* @see lib/dotgen/dotsplines.c:make_flat_edge (boxes[], loop body)
|
|
460
|
+
*/
|
|
461
|
+
export function topBoxes(
|
|
462
|
+
tlast: Box, hlast: Box, endStepX: number, endStepY: number, midStepY: number,
|
|
463
|
+
): Box[] {
|
|
464
|
+
const b0: Box = {
|
|
465
|
+
ll: { x: tlast.ll.x, y: tlast.ur.y },
|
|
466
|
+
ur: { x: tlast.ur.x + endStepX, y: tlast.ur.y + endStepY },
|
|
467
|
+
};
|
|
468
|
+
const b1: Box = {
|
|
469
|
+
ll: { x: tlast.ll.x, y: b0.ur.y },
|
|
470
|
+
ur: { x: hlast.ur.x, y: b0.ur.y + midStepY },
|
|
471
|
+
};
|
|
472
|
+
const b2: Box = {
|
|
473
|
+
ll: { x: hlast.ll.x - endStepX, y: hlast.ur.y },
|
|
474
|
+
ur: { x: hlast.ur.x, y: b0.ur.y },
|
|
475
|
+
};
|
|
476
|
+
return [b0, b1, b2];
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* The three connecting boxes for the bottom-routing branch (loop under).
|
|
481
|
+
* END/MIDDLE step semantics mirror `topBoxes`; cnt=1 ⇒ all = step (original).
|
|
482
|
+
* @see lib/dotgen/dotsplines.c:make_flat_bottom_edges (boxes[], loop body)
|
|
483
|
+
*/
|
|
484
|
+
export function bottomBoxes(
|
|
485
|
+
tlast: Box, hlast: Box, endStepX: number, endStepY: number, midStepY: number,
|
|
486
|
+
): Box[] {
|
|
487
|
+
const b0: Box = {
|
|
488
|
+
ll: { x: tlast.ll.x, y: tlast.ll.y - endStepY },
|
|
489
|
+
ur: { x: tlast.ur.x + endStepX, y: tlast.ll.y },
|
|
490
|
+
};
|
|
491
|
+
const b1: Box = {
|
|
492
|
+
ll: { x: tlast.ll.x, y: b0.ll.y - midStepY },
|
|
493
|
+
ur: { x: hlast.ur.x, y: b0.ll.y },
|
|
494
|
+
};
|
|
495
|
+
const b2: Box = {
|
|
496
|
+
ll: { x: hlast.ll.x - endStepX, y: b0.ll.y },
|
|
497
|
+
ur: { x: hlast.ur.x, y: hlast.ll.y },
|
|
498
|
+
};
|
|
499
|
+
return [b0, b1, b2];
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Vertical space available for the loop. Top routing reads the rank above;
|
|
504
|
+
* bottom routing reads the rank below; either way a node at the graph
|
|
505
|
+
* boundary falls back to ranksep.
|
|
506
|
+
* @see lib/dotgen/dotsplines.c:make_flat_edge / make_flat_bottom_edges (vspace)
|
|
507
|
+
*/
|
|
508
|
+
export function flatVspace(g: Graph, tn: Node, top: boolean): number {
|
|
509
|
+
const ranks = g.info.rank!;
|
|
510
|
+
const r = tn.info.rank!;
|
|
511
|
+
if (top) {
|
|
512
|
+
if (r <= 0) return graphRanksep(g);
|
|
513
|
+
// C reads GD_has_labels(g->root), not the layout graph: under `pack` the
|
|
514
|
+
// component's own flag is 0 while the true root carries EDGE_LABEL.
|
|
515
|
+
// @see lib/dotgen/dotsplines.c:1552 (make_flat_edge)
|
|
516
|
+
const prevIdx = (g.root.info.has_labels & EDGE_LABEL) !== 0 ? r - 2 : r - 1;
|
|
517
|
+
// With EDGE_LABEL the previous *node* rank is r-2; after `abomination` shifts
|
|
518
|
+
// a flat-label rank in, r-2 can fall below minrank (no node rank above) —
|
|
519
|
+
// fall back to ranksep rather than dereferencing an absent rank.
|
|
520
|
+
const prev = prevIdx >= (g.info.minrank ?? 0) ? ranks[prevIdx] : undefined;
|
|
521
|
+
if (prev === undefined || prev.n === 0) return graphRanksep(g);
|
|
522
|
+
return prev.v[0].info.coord.y - prev.ht1 - tn.info.coord.y - ranks[r].ht2;
|
|
523
|
+
}
|
|
524
|
+
if (r >= (g.info.maxrank ?? 0)) return graphRanksep(g);
|
|
525
|
+
const next = ranks[r + 1];
|
|
526
|
+
return tn.info.coord.y - ranks[r].pht1 - (next.v[0].info.coord.y + next.pht2);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/** A fresh empty path for begin/route/end assembly. */
|
|
530
|
+
export function freshFlatPath(): Path {
|
|
531
|
+
return { start: makePort(), end: makePort(), nbox: 0, boxes: [], data: null };
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/** Per-caller spline_info bounds (C builds its own `sd` per orchestrator).
|
|
535
|
+
* Splinesep = GD_nodesep(g) / 4 with INTEGER division (C's GD_nodesep is an
|
|
536
|
+
* `int`, types.h:334; dotsplines.c:267 builds one sd shared by regular + flat
|
|
537
|
+
* routing). A float divide here (nodesep/2 = 9) over-widens the VIRTUAL-
|
|
538
|
+
* neighbor gap in maximal_bbox; truncate to nodesep/4 to mirror C. */
|
|
539
|
+
export function flatBboxCtx(g: Graph): BboxCtx {
|
|
540
|
+
return {
|
|
541
|
+
g,
|
|
542
|
+
sp: {
|
|
543
|
+
...getSplineBounds(g),
|
|
544
|
+
splinesep: Math.trunc((g.info.nodesep ?? 18) / 4),
|
|
545
|
+
},
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Routing-side decision: bottom routing fires when a BOTTOM port faces away
|
|
551
|
+
* from a non-TOP opposite end, exactly as C's
|
|
552
|
+
* `(tside==BOTTOM && hside!=TOP) || (hside==BOTTOM && tside!=TOP)`.
|
|
553
|
+
* @see lib/dotgen/dotsplines.c:make_flat_edge (tside/hside test)
|
|
554
|
+
*/
|
|
555
|
+
export function flatSide(e: Edge): { bottom: boolean; side: number } {
|
|
556
|
+
const tside = resolvePort(e.tail, e.head, e.info.tail_port).side ?? 0;
|
|
557
|
+
const hside = resolvePort(e.head, e.tail, e.info.head_port).side ?? 0;
|
|
558
|
+
const bottom = (tside === BOTTOM && hside !== TOP) || (hside === BOTTOM && tside !== TOP);
|
|
559
|
+
return { bottom, side: bottom ? BOTTOM : TOP };
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/** Concatenate tail boxes (fwd), the 3 connecting boxes, head boxes (rev). */
|
|
563
|
+
export function assembleFlatPath(P: Path, tend: PathendT, hend: PathendT, mid: Box[]): void {
|
|
564
|
+
for (let i = 0; i < tend.boxn; i++) addBox(P, tend.boxes[i]);
|
|
565
|
+
for (const b of mid) addBox(P, b);
|
|
566
|
+
for (let i = hend.boxn - 1; i >= 0; i--) addBox(P, hend.boxes[i]);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Route a single same-rank (flat) edge carrying a side-mask port through the
|
|
571
|
+
* faithful `beginPath → routeSplines → endPath → clipAndInstall` pipeline.
|
|
572
|
+
* Returns spline control points in graphviz-internal (y-up) coordinates, or
|
|
573
|
+
* null when the edge is not a same-rank edge. Does NOT clip or install — the
|
|
574
|
+
* caller (routeOneEdge) does that via clipAndInstall, mirroring how SR3 wires
|
|
575
|
+
* the regular faithful path.
|
|
576
|
+
*
|
|
577
|
+
* @see lib/dotgen/dotsplines.c:make_flat_edge (cnt=1, non-adjacent spline)
|
|
578
|
+
*/
|
|
579
|
+
export function routeFlatEdgeFaithful(g: Graph, e: Edge): Point[] | null {
|
|
580
|
+
const tn = e.tail;
|
|
581
|
+
const r = tn.info.rank;
|
|
582
|
+
if (g.info.rank === undefined || r === undefined || e.head.info.rank !== r) return null;
|
|
583
|
+
const { bottom, side } = flatSide(e);
|
|
584
|
+
const ctx = flatBboxCtx(g);
|
|
585
|
+
const ranksep = graphRanksep(g);
|
|
586
|
+
const P = freshFlatPath();
|
|
587
|
+
const tend = makeFlatEndBox({ ctx, P, e, n: tn, side, ranksep, isBegin: true });
|
|
588
|
+
const hend = makeFlatEndBox({ ctx, P, e, n: e.head, side, ranksep, isBegin: false });
|
|
589
|
+
const stepx = (g.info.nodesep ?? 18) / 2;
|
|
590
|
+
const stepy = flatVspace(g, tn, !bottom) / 2;
|
|
591
|
+
const tlast = tend.boxes[tend.boxn - 1];
|
|
592
|
+
const hlast = hend.boxes[hend.boxn - 1];
|
|
593
|
+
const mid = bottom
|
|
594
|
+
? bottomBoxes(tlast, hlast, stepx, stepy, stepy)
|
|
595
|
+
: topBoxes(tlast, hlast, stepx, stepy, stepy);
|
|
596
|
+
assembleFlatPath(P, tend, hend, mid);
|
|
597
|
+
return routeSplines(P);
|
|
598
|
+
}
|