@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,401 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Ordering/median pass and mincross main loop for the mincross algorithm.
|
|
5
|
+
* Build-phase helpers live in mincross-build.ts.
|
|
6
|
+
*
|
|
7
|
+
* @see lib/dotgen/mincross.c
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { Graph } from '../../model/graph.js';
|
|
11
|
+
import type { Node } from '../../model/node.js';
|
|
12
|
+
import type { RankEntry } from '../../model/rankEntry.js';
|
|
13
|
+
import type { EdgeList } from '../../model/nodeInfo.js';
|
|
14
|
+
import { MincrossContext, CONVERGENCE, dotRoot, rankGet } from './mincross-utils.js';
|
|
15
|
+
import { exchange, left2right, transpose, ncross, val, xpen } from './mincross-cross.js';
|
|
16
|
+
import { buildRanks, flatBreakcycles, flatReorder } from './mincross-build.js';
|
|
17
|
+
|
|
18
|
+
type StepBounds = { first: number; last: number; dir: number };
|
|
19
|
+
type CrossState = { cur: number; best: number };
|
|
20
|
+
type ReorderResult = { rp: number; muststay: boolean };
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Diagnostic trace hook mirroring C's `if (Verbose) fprintf(...)` in
|
|
24
|
+
* `mincross()`. Default null = no output, no behavior change (the only cost is
|
|
25
|
+
* one null check per iter, matching C's Verbose guard). Set by trajectory-diff
|
|
26
|
+
* harnesses to dump the per-iter crossing trajectory. @see mincross.c:723-727
|
|
27
|
+
*/
|
|
28
|
+
let mincrossTrace: ((line: string) => void) | null = null;
|
|
29
|
+
export function setMincrossTrace(fn: ((line: string) => void) | null): void {
|
|
30
|
+
mincrossTrace = fn;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// flat_mval — @see lib/dotgen/mincross.c:flat_mval
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
|
|
37
|
+
export function flatMvalIn(n: Node, fi: EdgeList): boolean {
|
|
38
|
+
let nn = fi.list[0]!.tail;
|
|
39
|
+
for (let i = 1; i < fi.size; i++) {
|
|
40
|
+
const edge = fi.list[i]!;
|
|
41
|
+
const ord = edge.tail.info.order !== undefined ? edge.tail.info.order : 0;
|
|
42
|
+
const nnOrd = nn.info.order !== undefined ? nn.info.order : 0;
|
|
43
|
+
if (ord > nnOrd) nn = edge.tail;
|
|
44
|
+
}
|
|
45
|
+
const nnMval = nn.info.mval !== undefined ? nn.info.mval : -1;
|
|
46
|
+
if (nnMval >= 0) { n.info.mval = nnMval + 1; return false; }
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function flatMvalOut(n: Node, fo: EdgeList): boolean {
|
|
51
|
+
let nn = fo.list[0]!.head;
|
|
52
|
+
for (let i = 1; i < fo.size; i++) {
|
|
53
|
+
const edge = fo.list[i]!;
|
|
54
|
+
const ord = edge.head.info.order !== undefined ? edge.head.info.order : 0;
|
|
55
|
+
const nnOrd = nn.info.order !== undefined ? nn.info.order : 0;
|
|
56
|
+
if (ord < nnOrd) nn = edge.head;
|
|
57
|
+
}
|
|
58
|
+
const nnMval = nn.info.mval !== undefined ? nn.info.mval : -1;
|
|
59
|
+
if (nnMval > 0) { n.info.mval = nnMval - 1; return false; }
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** @see lib/dotgen/mincross.c:flat_mval */
|
|
64
|
+
export function flatMval(n: Node): boolean {
|
|
65
|
+
const fi = n.info.flat_in;
|
|
66
|
+
if (fi !== undefined && fi.size > 0) return flatMvalIn(n, fi);
|
|
67
|
+
const fo = n.info.flat_out;
|
|
68
|
+
if (fo !== undefined && fo.size > 0) return flatMvalOut(n, fo);
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
// medians — @see lib/dotgen/mincross.c:mval / median / medians
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
|
|
76
|
+
/** Collect val() samples for one node's adjacent edges. @see lib/dotgen/mincross.c:mval */
|
|
77
|
+
export function mediansCollectDir(v: Node, d: number, list: number[]): void {
|
|
78
|
+
const vRank = v.info.rank !== undefined ? v.info.rank : 0;
|
|
79
|
+
const edges = d < vRank ? v.info.in : v.info.out;
|
|
80
|
+
if (!edges) return;
|
|
81
|
+
for (let i = edges.size - 1; i >= 0; i--) {
|
|
82
|
+
const e = edges.list[i]!;
|
|
83
|
+
if (xpen(e) <= 0) continue;
|
|
84
|
+
if (d < vRank) {
|
|
85
|
+
list.push(val(e.tail, e.info.tail_port.order));
|
|
86
|
+
} else {
|
|
87
|
+
list.push(val(e.head, e.info.head_port.order));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* C operates on an int[] (VAL = MC_SCALE*ND_order + port.order), so the n==2
|
|
94
|
+
* average and the equal-span case use INTEGER division (truncation toward
|
|
95
|
+
* zero), not float. Using float here yields x.5 mvals that perturb the reorder
|
|
96
|
+
* sort and diverge from C on tie-heavy ranks (e.g. 2371's flat mid network).
|
|
97
|
+
* The unequal-span weighted median stays a true double, matching C.
|
|
98
|
+
* @see lib/dotgen/mincross.c:median
|
|
99
|
+
*/
|
|
100
|
+
export function computeMedian(list: number[]): number {
|
|
101
|
+
const n = list.length;
|
|
102
|
+
if (n === 0) return -1;
|
|
103
|
+
list.sort((a, b) => a - b);
|
|
104
|
+
if (n === 1) return list[0]!;
|
|
105
|
+
if (n === 2) return Math.trunc((list[0]! + list[1]!) / 2);
|
|
106
|
+
const m = Math.floor(n / 2);
|
|
107
|
+
if (n % 2 !== 0) return list[m]!;
|
|
108
|
+
const lspan = list[m - 1]! - list[0]!;
|
|
109
|
+
const rspan = list[n - 1]! - list[m]!;
|
|
110
|
+
if (lspan === rspan) return Math.trunc((list[m - 1]! + list[m]!) / 2);
|
|
111
|
+
return (list[m - 1]! * rspan + list[m]! * lspan) / (lspan + rspan);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Loop 1 body of C `medians` (mincross.c:1627-1667) — computes a fresh mval
|
|
116
|
+
* for a SINGLE node from its directional fast-edge list. An empty list
|
|
117
|
+
* (including nodes with no fast edges in this direction at all — case 0 at
|
|
118
|
+
* mincross.c:1643) resets mval to -1 via computeMedian. This must run for
|
|
119
|
+
* EVERY node in the rank, unconditionally, before flat_mval (loop 2 in
|
|
120
|
+
* `medians` below) reads any node's mval.
|
|
121
|
+
* @see lib/dotgen/mincross.c:1621-1667
|
|
122
|
+
*/
|
|
123
|
+
export function mediansProcessNode(v: Node, d: number): void {
|
|
124
|
+
const list: number[] = [];
|
|
125
|
+
mediansCollectDir(v, d, list);
|
|
126
|
+
v.info.mval = computeMedian(list);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @see lib/dotgen/mincross.c:1621
|
|
131
|
+
*
|
|
132
|
+
* Mirrors C's exact two-loop shape. Loop 1 resets/sets mval for EVERY node
|
|
133
|
+
* in the rank (mincross.c:1627-1667). Loop 2 runs flat_mval only for nodes
|
|
134
|
+
* with NO fast edges in either direction (mincross.c:1669-1673), strictly
|
|
135
|
+
* after loop 1 has completed for the whole rank — so flat_mval always
|
|
136
|
+
* observes a freshly-reset mval, never a stale value left over from the
|
|
137
|
+
* opposite pass direction. A fused single-loop version that early-returns
|
|
138
|
+
* into flat_mval for edge-less nodes skips the loop-1 reset for exactly
|
|
139
|
+
* those nodes, leaking stale cross-pass mval into the reorder comparator.
|
|
140
|
+
* @see plans/residual-cleanup/analysis/1453-medians-reset.md
|
|
141
|
+
*/
|
|
142
|
+
export function medians(_ctx: MincrossContext, g: Graph, r: number, d: number): boolean {
|
|
143
|
+
const gRank = g.info.rank;
|
|
144
|
+
if (!gRank) return false;
|
|
145
|
+
const rk = gRank[r];
|
|
146
|
+
for (let i = 0; i < rk.n; i++) {
|
|
147
|
+
// Faithful to C GD_rank(g)[r].v — the already-offset window pointer.
|
|
148
|
+
// TS keeps rk.v as the full root array + a separate vStart, so we must
|
|
149
|
+
// read rk.v[vStart+i] = rankGet(rk,i). transpose already does this;
|
|
150
|
+
// medians/reorder were ported without it. @see mincross.c:medians
|
|
151
|
+
const v = rankGet(rk, i);
|
|
152
|
+
if (!v) continue;
|
|
153
|
+
mediansProcessNode(v, d);
|
|
154
|
+
}
|
|
155
|
+
let hasfixed = false;
|
|
156
|
+
for (let i = 0; i < rk.n; i++) {
|
|
157
|
+
const v = rankGet(rk, i);
|
|
158
|
+
if (!v) continue;
|
|
159
|
+
const inSize = v.info.in !== undefined ? v.info.in.size : 0;
|
|
160
|
+
const outSize = v.info.out !== undefined ? v.info.out.size : 0;
|
|
161
|
+
if (inSize === 0 && outSize === 0) {
|
|
162
|
+
if (flatMval(v)) hasfixed = true;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return hasfixed;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// ---------------------------------------------------------------------------
|
|
169
|
+
// save_best / restore_best — @see lib/dotgen/mincross.c:save_best/restore_best
|
|
170
|
+
// ---------------------------------------------------------------------------
|
|
171
|
+
|
|
172
|
+
/** @see lib/dotgen/mincross.c:save_best */
|
|
173
|
+
export function saveBest(g: Graph): void {
|
|
174
|
+
const rank = g.info.rank;
|
|
175
|
+
if (!rank) return;
|
|
176
|
+
const mn = g.info.minrank !== undefined ? g.info.minrank : 0;
|
|
177
|
+
const mx = g.info.maxrank !== undefined ? g.info.maxrank : 0;
|
|
178
|
+
for (let r = mn; r <= mx; r++) {
|
|
179
|
+
const vs = rank[r].vStart ?? 0;
|
|
180
|
+
for (let i = 0; i < rank[r].n; i++) {
|
|
181
|
+
// Read the offset window: C save_best reads GD_rank(g)[r].v[i] where the
|
|
182
|
+
// pointer is already advanced by vStart. @see mincross.c:save_best
|
|
183
|
+
// C's saveorder scratch holds the WINDOW-RELATIVE ND_order (install_in_rank
|
|
184
|
+
// sets ND_order = i within the window); the port's order is absolute
|
|
185
|
+
// (vStart + i), so subtract vStart to store C's exact scratch value. The
|
|
186
|
+
// leftover scratch is load-bearing: a node dropped by merge2's n=an
|
|
187
|
+
// truncation (allocate_ranks undercount, e.g. 2521's b3) keeps this value
|
|
188
|
+
// as its final x-coordinate. @see mincross.c:114 saveorder
|
|
189
|
+
const n = rankGet(rank[r], i);
|
|
190
|
+
n.info.coord.x = (n.info.order !== undefined ? n.info.order : 0) - vs;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function restoreRank(rk: RankEntry, rootRk: RankEntry): void {
|
|
196
|
+
// Restore + re-sort the absolute window [vStart, vStart+n) — C restore_best
|
|
197
|
+
// qsorts GD_rank(g)[r].v (the offset pointer) over n. @see mincross.c:restore_best
|
|
198
|
+
const vs = rk.vStart ?? 0;
|
|
199
|
+
// coord.x scratch holds the window-relative order (see saveBest); convert back.
|
|
200
|
+
for (let i = 0; i < rk.n; i++) rk.v[vs + i].info.order = rk.v[vs + i].info.coord.x + vs;
|
|
201
|
+
const sorted = rk.v.slice(vs, vs + rk.n).sort(
|
|
202
|
+
(a, b) => (a.info.order !== undefined ? a.info.order : 0) - (b.info.order !== undefined ? b.info.order : 0),
|
|
203
|
+
);
|
|
204
|
+
for (let i = 0; i < rk.n; i++) rk.v[vs + i] = sorted[i]!;
|
|
205
|
+
rootRk.valid = false;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** @see lib/dotgen/mincross.c:restore_best */
|
|
209
|
+
export function restoreBest(ctx: MincrossContext, g: Graph): void {
|
|
210
|
+
const rank = g.info.rank;
|
|
211
|
+
const rootRank = ctx.root.info.rank;
|
|
212
|
+
if (!rank || !rootRank) return;
|
|
213
|
+
const mn = g.info.minrank !== undefined ? g.info.minrank : 0;
|
|
214
|
+
const mx = g.info.maxrank !== undefined ? g.info.maxrank : 0;
|
|
215
|
+
for (let r = mn; r <= mx; r++) restoreRank(rank[r], rootRank[r]);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// ---------------------------------------------------------------------------
|
|
219
|
+
// reorder — @see lib/dotgen/mincross.c:reorder
|
|
220
|
+
// ---------------------------------------------------------------------------
|
|
221
|
+
|
|
222
|
+
export function reorderFindLp(vlist: Node[], lp: number, ep: number): number {
|
|
223
|
+
// Advance past nodes that cannot be compared, i.e. while (mval ?? -1) < 0.
|
|
224
|
+
// Perf: read node.info.mval once per step (the original ternary read the
|
|
225
|
+
// property chain twice). Behaviour-identical — this is the hottest loop in
|
|
226
|
+
// the port (~1.6e9 iters on 2108); the read count, not the logic, changed.
|
|
227
|
+
while (lp < ep) {
|
|
228
|
+
const mv = vlist[lp]!.info.mval;
|
|
229
|
+
if (mv !== undefined && mv >= 0) break;
|
|
230
|
+
lp++;
|
|
231
|
+
}
|
|
232
|
+
return lp;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Reused output for reorderFindRp. The result is consumed synchronously by the
|
|
237
|
+
* single caller (and by tests) before the next call, so a shared scratch object
|
|
238
|
+
* is safe and removes ~1.6e9 short-lived allocations on large ranks (2108).
|
|
239
|
+
* @see lib/dotgen/mincross.c:reorder (C returns `rp`/`muststay` via locals)
|
|
240
|
+
*/
|
|
241
|
+
const REORDER_RP: ReorderResult = { rp: 0, muststay: false };
|
|
242
|
+
|
|
243
|
+
export function reorderFindRp(g: Graph, vlist: Node[], lp: number, ep: number): ReorderResult {
|
|
244
|
+
const lpNode = vlist[lp]!; // loop-invariant across the rp scan — hoisted
|
|
245
|
+
let sawclust = false;
|
|
246
|
+
for (let rp = lp + 1; rp < ep; rp++) {
|
|
247
|
+
const w = vlist[rp]!;
|
|
248
|
+
const wInfo = w.info;
|
|
249
|
+
if (sawclust && wInfo.clust) continue;
|
|
250
|
+
if (left2right(g, lpNode, w) !== 0) { REORDER_RP.rp = rp; REORDER_RP.muststay = true; return REORDER_RP; }
|
|
251
|
+
const wm = wInfo.mval;
|
|
252
|
+
if (wm !== undefined && wm >= 0) { REORDER_RP.rp = rp; REORDER_RP.muststay = false; return REORDER_RP; }
|
|
253
|
+
if (wInfo.clust) sawclust = true;
|
|
254
|
+
}
|
|
255
|
+
REORDER_RP.rp = ep; REORDER_RP.muststay = false;
|
|
256
|
+
return REORDER_RP;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export function reorderInner(
|
|
260
|
+
ctx: MincrossContext,
|
|
261
|
+
g: Graph,
|
|
262
|
+
vlist: Node[],
|
|
263
|
+
win: { start: number; ep: number },
|
|
264
|
+
reverse: boolean,
|
|
265
|
+
): boolean {
|
|
266
|
+
let changed = false;
|
|
267
|
+
const ep = win.ep;
|
|
268
|
+
let lp = win.start;
|
|
269
|
+
while (lp < ep) {
|
|
270
|
+
lp = reorderFindLp(vlist, lp, ep);
|
|
271
|
+
if (lp >= ep) break;
|
|
272
|
+
const res = reorderFindRp(g, vlist, lp, ep);
|
|
273
|
+
const rp = res.rp; // capture before any later call mutates the shared scratch
|
|
274
|
+
if (rp >= ep) break;
|
|
275
|
+
if (!res.muststay) {
|
|
276
|
+
// Perf: read each node and its mval once (was four property-chain reads).
|
|
277
|
+
const lpNode = vlist[lp]!;
|
|
278
|
+
const rpNode = vlist[rp]!;
|
|
279
|
+
const m1 = lpNode.info.mval;
|
|
280
|
+
const m2 = rpNode.info.mval;
|
|
281
|
+
const p1 = m1 !== undefined ? m1 : -1;
|
|
282
|
+
const p2 = m2 !== undefined ? m2 : -1;
|
|
283
|
+
if (p1 > p2 || (p1 >= p2 && reverse)) { exchange(ctx, lpNode, rpNode); changed = true; }
|
|
284
|
+
}
|
|
285
|
+
lp = rp;
|
|
286
|
+
}
|
|
287
|
+
return changed;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Absolute window [start, start+n) for a rank — faithful to C reading the
|
|
292
|
+
* already-offset GD_rank(g)[r].v window pointer. @see mincross.c:reorder
|
|
293
|
+
*/
|
|
294
|
+
function reorderWindow(re: RankEntry): { start: number; n: number } {
|
|
295
|
+
return { start: re.vStart ?? 0, n: re.n };
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/** @see lib/dotgen/mincross.c:reorder */
|
|
299
|
+
export function reorder(ctx: MincrossContext, g: Graph, r: number, reverse: boolean, hasfixed: boolean): void {
|
|
300
|
+
const rootRank = ctx.root.info.rank;
|
|
301
|
+
if (!rootRank) return;
|
|
302
|
+
const rk = g.info.rank;
|
|
303
|
+
if (!rk) return;
|
|
304
|
+
const vlist = rk[r].v;
|
|
305
|
+
const { start, n } = reorderWindow(rk[r]);
|
|
306
|
+
let ep = start + n;
|
|
307
|
+
let changed = false;
|
|
308
|
+
for (let nelt = n - 1; nelt >= 0; nelt--) {
|
|
309
|
+
if (reorderInner(ctx, g, vlist, { start, ep }, reverse)) changed = true;
|
|
310
|
+
if (!hasfixed && !reverse) ep--;
|
|
311
|
+
}
|
|
312
|
+
if (changed) {
|
|
313
|
+
rootRank[r].valid = false;
|
|
314
|
+
if (r > 0) rootRank[r - 1].valid = false;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// ---------------------------------------------------------------------------
|
|
319
|
+
// mincross_step — @see lib/dotgen/mincross.c:mincross_step
|
|
320
|
+
// ---------------------------------------------------------------------------
|
|
321
|
+
|
|
322
|
+
/** @see lib/dotgen/mincross.c:mincross_step (bounds computation) */
|
|
323
|
+
export function mincrossStepBounds(ctx: MincrossContext, g: Graph, pass: number): StepBounds {
|
|
324
|
+
const mn = g.info.minrank !== undefined ? g.info.minrank : 0;
|
|
325
|
+
const mx = g.info.maxrank !== undefined ? g.info.maxrank : 0;
|
|
326
|
+
const rootMn = ctx.root.info.minrank !== undefined ? ctx.root.info.minrank : 0;
|
|
327
|
+
const rootMx = ctx.root.info.maxrank !== undefined ? ctx.root.info.maxrank : 0;
|
|
328
|
+
if (pass % 2 === 0) {
|
|
329
|
+
const first = mn > rootMn ? mn : mn + 1;
|
|
330
|
+
return { first, last: mx, dir: 1 };
|
|
331
|
+
}
|
|
332
|
+
const first = mx < rootMx ? mx : mx - 1;
|
|
333
|
+
return { first, last: mn, dir: -1 };
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/** @see lib/dotgen/mincross.c:mincross_step */
|
|
337
|
+
export function mincrossStep(ctx: MincrossContext, g: Graph, pass: number): void {
|
|
338
|
+
const reverse = pass % 4 < 2;
|
|
339
|
+
const bounds = mincrossStepBounds(ctx, g, pass);
|
|
340
|
+
for (let r = bounds.first; r !== bounds.last + bounds.dir; r += bounds.dir) {
|
|
341
|
+
const hasfixed = medians(ctx, g, r, r - bounds.dir);
|
|
342
|
+
reorder(ctx, g, r, reverse, hasfixed);
|
|
343
|
+
}
|
|
344
|
+
transpose(ctx, g, !reverse);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// ---------------------------------------------------------------------------
|
|
348
|
+
// mincross main loop — @see lib/dotgen/mincross.c:mincross
|
|
349
|
+
// ---------------------------------------------------------------------------
|
|
350
|
+
|
|
351
|
+
/** @see lib/dotgen/mincross.c:mincross (iteration loop) */
|
|
352
|
+
export function mincrossIter(ctx: MincrossContext, g: Graph, maxthispass: number, state: CrossState, pass: number): void {
|
|
353
|
+
let trying = 0;
|
|
354
|
+
for (let iter = 0; iter < maxthispass; iter++) {
|
|
355
|
+
if (mincrossTrace) {
|
|
356
|
+
mincrossTrace(`mincross: pass ${pass} iter ${iter} trying ${trying} cur_cross ${state.cur} best_cross ${state.best}`);
|
|
357
|
+
}
|
|
358
|
+
if (trying++ >= ctx.minQuit) break;
|
|
359
|
+
if (state.cur === 0) break;
|
|
360
|
+
mincrossStep(ctx, g, iter);
|
|
361
|
+
state.cur = ncross(ctx);
|
|
362
|
+
if (state.cur <= state.best) {
|
|
363
|
+
saveBest(g);
|
|
364
|
+
if (state.cur < CONVERGENCE * state.best) trying = 0;
|
|
365
|
+
state.best = state.cur;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** @see lib/dotgen/mincross.c:mincross (pass setup) */
|
|
371
|
+
export function mincrossPassSetup(ctx: MincrossContext, g: Graph, pass: number, state: CrossState): number {
|
|
372
|
+
if (pass <= 1) {
|
|
373
|
+
const maxthispass = Math.min(4, ctx.maxIter);
|
|
374
|
+
if (g === dotRoot(g) && buildRanks(ctx, g, pass) !== 0) return -1;
|
|
375
|
+
if (pass === 0) flatBreakcycles(ctx, g);
|
|
376
|
+
flatReorder(ctx, g);
|
|
377
|
+
state.cur = ncross(ctx);
|
|
378
|
+
if (state.cur <= state.best) { saveBest(g); state.best = state.cur; }
|
|
379
|
+
return maxthispass;
|
|
380
|
+
}
|
|
381
|
+
const maxthispass = ctx.maxIter;
|
|
382
|
+
if (state.cur > state.best) restoreBest(ctx, g);
|
|
383
|
+
state.cur = state.best;
|
|
384
|
+
return maxthispass;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** @see lib/dotgen/mincross.c:mincross */
|
|
388
|
+
export function mincrossMain(ctx: MincrossContext, g: Graph, startpass: number): number {
|
|
389
|
+
const initCross = startpass > 1 ? ncross(ctx) : Number.MAX_SAFE_INTEGER;
|
|
390
|
+
const state: CrossState = { cur: initCross, best: initCross };
|
|
391
|
+
if (startpass > 1) saveBest(g);
|
|
392
|
+
for (let pass = startpass; pass <= 2; pass++) {
|
|
393
|
+
const maxthispass = mincrossPassSetup(ctx, g, pass, state);
|
|
394
|
+
if (maxthispass < 0) return -1;
|
|
395
|
+
mincrossIter(ctx, g, maxthispass, state, pass);
|
|
396
|
+
if (state.cur === 0) break;
|
|
397
|
+
}
|
|
398
|
+
if (state.cur > state.best) restoreBest(ctx, g);
|
|
399
|
+
if (state.best > 0) { transpose(ctx, g, false); state.best = ncross(ctx); }
|
|
400
|
+
return state.best;
|
|
401
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared utilities for the mincross family: context type, AdjMatrix helpers,
|
|
5
|
+
* graph helpers, and node cluster helpers.
|
|
6
|
+
* Imported by mincross.ts, mincross-build.ts, mincross-cross.ts, and
|
|
7
|
+
* mincross-order.ts to avoid circular dependencies.
|
|
8
|
+
*
|
|
9
|
+
* @see lib/dotgen/mincross.c
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { Graph } from '../../model/graph.js';
|
|
13
|
+
import type { Node } from '../../model/node.js';
|
|
14
|
+
import type { Edge } from '../../model/edge.js';
|
|
15
|
+
import type { AdjMatrix, RankEntry } from '../../model/rankEntry.js';
|
|
16
|
+
import { VIRTUAL, NORMAL } from './fastgr.js';
|
|
17
|
+
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Constants
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
/** @see lib/dotgen/mincross.c:Convergence */
|
|
23
|
+
export const CONVERGENCE = 0.995;
|
|
24
|
+
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// MincrossContext
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Replaces C module-level statics (Root, GlobalMinRank/MaxRank, TE_list,
|
|
31
|
+
* TI_list, ReMincross, MinQuit, MaxIter) for reentrancy.
|
|
32
|
+
* @see lib/dotgen/mincross.c (module statics)
|
|
33
|
+
*/
|
|
34
|
+
export interface MincrossContext {
|
|
35
|
+
root: Graph;
|
|
36
|
+
globalMinRank: number;
|
|
37
|
+
globalMaxRank: number;
|
|
38
|
+
teList: Edge[];
|
|
39
|
+
tiList: number[];
|
|
40
|
+
reMincross: boolean;
|
|
41
|
+
minQuit: number;
|
|
42
|
+
maxIter: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
// AdjMatrix helpers @see lib/dotgen/mincross.c:matrix_get/set/new_matrix
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
|
|
49
|
+
/** @see lib/dotgen/mincross.c:matrix_get */
|
|
50
|
+
export function matrixGet(m: AdjMatrix, row: number, col: number): boolean {
|
|
51
|
+
if (row >= m.nrows || col >= m.ncols) return false;
|
|
52
|
+
const idx = row * m.ncols + col;
|
|
53
|
+
return ((m.data[idx >> 3] >> (idx & 7)) & 1) === 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** @see lib/dotgen/mincross.c:matrix_set */
|
|
57
|
+
export function matrixSet(m: AdjMatrix, row: number, col: number): void {
|
|
58
|
+
if (row >= m.nrows || col >= m.ncols) matrixExpand(m, row, col);
|
|
59
|
+
const idx = row * m.ncols + col;
|
|
60
|
+
m.data[idx >> 3] |= (1 << (idx & 7));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Copy all set bits into new buffer with updated column count. */
|
|
64
|
+
export function matrixCopyBits(m: AdjMatrix, data: Uint8Array, ncols: number): void {
|
|
65
|
+
for (let r = 0; r < m.nrows; r++) {
|
|
66
|
+
for (let c = 0; c < m.ncols; c++) {
|
|
67
|
+
if (!matrixGet(m, r, c)) continue;
|
|
68
|
+
const idx = r * ncols + c;
|
|
69
|
+
data[idx >> 3] |= (1 << (idx & 7));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function matrixExpand(m: AdjMatrix, row: number, col: number): void {
|
|
75
|
+
const nrows = Math.max(m.nrows, row + 1);
|
|
76
|
+
const ncols = Math.max(m.ncols, col + 1);
|
|
77
|
+
const bits = nrows * ncols;
|
|
78
|
+
const bytes = (bits >> 3) + (bits & 7 ? 1 : 0);
|
|
79
|
+
const data = new Uint8Array(bytes);
|
|
80
|
+
matrixCopyBits(m, data, ncols);
|
|
81
|
+
m.nrows = nrows;
|
|
82
|
+
m.ncols = ncols;
|
|
83
|
+
m.data = data;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** @see lib/dotgen/mincross.c:new_matrix */
|
|
87
|
+
export function newMatrix(rows: number, cols: number): AdjMatrix {
|
|
88
|
+
const bits = rows * cols;
|
|
89
|
+
const bytes = (bits >> 3) + (bits & 7 ? 1 : 0);
|
|
90
|
+
return { nrows: rows, ncols: cols, data: new Uint8Array(bytes) };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
// Graph helpers
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
|
|
97
|
+
/** @see lib/dotgen/dot.h:dot_root */
|
|
98
|
+
export function dotRoot(g: Graph): Graph {
|
|
99
|
+
return g.info.dotroot ?? g.root;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** @see lib/cgraph/cgraph.h:agcontains (node) */
|
|
103
|
+
export function agContainsNode(g: Graph, n: Node): boolean {
|
|
104
|
+
return g.nodes.get(n.name) === n;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** @see lib/cgraph/cgraph.h:agcontains (edge) */
|
|
108
|
+
export function agContainsEdge(g: Graph, e: Edge): boolean {
|
|
109
|
+
return g.edges.includes(e);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
// Rank accessors with vStart offset
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
|
|
116
|
+
/** Get rank.v[i] respecting vStart pointer-arithmetic offset. */
|
|
117
|
+
export function rankGet(rank: RankEntry, i: number): Node {
|
|
118
|
+
return rank.v[(rank.vStart ?? 0) + i];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Set rank.v[i] respecting vStart pointer-arithmetic offset. */
|
|
122
|
+
export function rankSet(rank: RankEntry, i: number, n: Node): void {
|
|
123
|
+
rank.v[(rank.vStart ?? 0) + i] = n;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// Node cluster / containment helpers
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
|
|
130
|
+
/** @see lib/dotgen/mincross.c:is_a_normal_node_of */
|
|
131
|
+
export function isNormalNodeOf(g: Graph, v: Node): boolean {
|
|
132
|
+
return v.info.node_type === NORMAL && agContainsNode(g, v);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** @see lib/dotgen/mincross.c:is_a_vnode_of_an_edge_of */
|
|
136
|
+
export function isVnodeOfEdgeOf(g: Graph, v: Node): boolean {
|
|
137
|
+
if (v.info.node_type !== VIRTUAL) return false;
|
|
138
|
+
const inSz = v.info.in ? v.info.in.size : 0;
|
|
139
|
+
const outSz = v.info.out ? v.info.out.size : 0;
|
|
140
|
+
if (inSz !== 1 || outSz !== 1) return false;
|
|
141
|
+
let e = v.info.out!.list[0];
|
|
142
|
+
while (e.info.edge_type !== NORMAL && e.info.to_orig) e = e.info.to_orig;
|
|
143
|
+
return agContainsEdge(g, e);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** @see lib/dotgen/mincross.c:inside_cluster */
|
|
147
|
+
export function insideCluster(g: Graph, v: Node): boolean {
|
|
148
|
+
return isNormalNodeOf(g, v) || isVnodeOfEdgeOf(g, v);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** @see lib/dotgen/mincross.c:neighbor
|
|
152
|
+
* Only the Root global is consulted, so callers outside the mincross pass
|
|
153
|
+
* (flat_edges' vlist reset runs in dot_position) may pass a bare `{root}`. */
|
|
154
|
+
export function neighborNode(ctx: Pick<MincrossContext, 'root'>, v: Node, dir: number): Node | undefined {
|
|
155
|
+
const rk = ctx.root.info.rank?.[v.info.rank ?? 0];
|
|
156
|
+
if (!rk) return undefined;
|
|
157
|
+
const order = v.info.order ?? 0;
|
|
158
|
+
// rank.v may contain explicit null entries (make_slots); coerce null→undefined.
|
|
159
|
+
return (dir < 0 ? (order > 0 ? rk.v[order - 1] : undefined) : rk.v[order + 1]) ?? undefined;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** @see lib/dotgen/mincross.c:furthestnode */
|
|
163
|
+
export function furthestNode(ctx: Pick<MincrossContext, 'root'>, g: Graph, v: Node, dir: number): Node {
|
|
164
|
+
let rv = v;
|
|
165
|
+
let u: Node | undefined = v;
|
|
166
|
+
while ((u = neighborNode(ctx, u, dir)) !== undefined) {
|
|
167
|
+
if (isNormalNodeOf(g, u) || isVnodeOfEdgeOf(g, u)) rv = u;
|
|
168
|
+
}
|
|
169
|
+
return rv;
|
|
170
|
+
}
|