@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,570 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public API for rectangle packing and connected-component decomposition.
|
|
5
|
+
* Ports lib/pack/pack.c and lib/pack/ccomps.c.
|
|
6
|
+
*
|
|
7
|
+
* @see lib/pack/pack.c
|
|
8
|
+
* @see lib/pack/ccomps.c
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { Graph } from '../../model/graph.js';
|
|
12
|
+
import type { Node } from '../../model/node.js';
|
|
13
|
+
import type { Edge } from '../../model/edge.js';
|
|
14
|
+
import type { Box, Point } from '../../model/geom.js';
|
|
15
|
+
import type { ArrowDrawOp } from '../../common/arrows-types.js';
|
|
16
|
+
import { mapArrowOpPoints } from '../../common/arrows-shapes-util.js';
|
|
17
|
+
import { arrayRects } from './array-pack.js';
|
|
18
|
+
import { polyRects } from './poly-pack.js';
|
|
19
|
+
import { updateBbBz } from '../../common/splines-geom.js';
|
|
20
|
+
import { polyGraphs } from './poly-place.js';
|
|
21
|
+
import {
|
|
22
|
+
PackMode, PackInfo,
|
|
23
|
+
PS2INCH, PK_COL_MAJOR, PK_USER_VALS, PK_LEFT_ALIGN,
|
|
24
|
+
PK_RIGHT_ALIGN, PK_TOP_ALIGN, PK_BOT_ALIGN, PK_INPUT_ORDER,
|
|
25
|
+
} from './types.js';
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
PackMode, PS2INCH,
|
|
29
|
+
PK_COL_MAJOR, PK_USER_VALS, PK_LEFT_ALIGN, PK_RIGHT_ALIGN,
|
|
30
|
+
PK_TOP_ALIGN, PK_BOT_ALIGN, PK_INPUT_ORDER,
|
|
31
|
+
};
|
|
32
|
+
export type { PackInfo };
|
|
33
|
+
export { ps2inch, inch2ps } from './types.js';
|
|
34
|
+
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// putRects / packRects
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Compute bounding-box packing offsets for ng bare rectangles.
|
|
41
|
+
* Returns null for Aspect mode (not implemented in C) or Node/Cluster mode
|
|
42
|
+
* (no node geometry available).
|
|
43
|
+
* @see lib/pack/pack.c:putRects
|
|
44
|
+
*/
|
|
45
|
+
export function putRects(ng: number, bbs: Box[], pinfo: PackInfo): Point[] | null {
|
|
46
|
+
if (ng <= 0) return [];
|
|
47
|
+
if (pinfo.mode === PackMode.Aspect) return null;
|
|
48
|
+
if (pinfo.mode === PackMode.Node || pinfo.mode === PackMode.Cluster) return null;
|
|
49
|
+
if (pinfo.mode === PackMode.Array) return arrayRects(ng, bbs, pinfo);
|
|
50
|
+
return polyRects(ng, bbs, pinfo);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Pack bare rectangles; updates bbs in place. Returns 0 on success.
|
|
55
|
+
* @see lib/pack/pack.c:packRects
|
|
56
|
+
*/
|
|
57
|
+
export function packRects(ng: number, bbs: Box[], pinfo: PackInfo): number {
|
|
58
|
+
const pts = putRects(ng, bbs, pinfo);
|
|
59
|
+
if (!pts) return -1;
|
|
60
|
+
for (let i = 0; i < ng; i++) {
|
|
61
|
+
const w = bbs[i].ur.x - bbs[i].ll.x;
|
|
62
|
+
const h = bbs[i].ur.y - bbs[i].ll.y;
|
|
63
|
+
bbs[i].ll.x = pts[i].x;
|
|
64
|
+
bbs[i].ll.y = pts[i].y;
|
|
65
|
+
bbs[i].ur.x = pts[i].x + w;
|
|
66
|
+
bbs[i].ur.y = pts[i].y + h;
|
|
67
|
+
}
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
// Graph bounding-box extraction
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
|
|
75
|
+
/** Node x-coordinate (0 if unset). */
|
|
76
|
+
export function nodeCoordX(n: Node): number {
|
|
77
|
+
return n.info.coord !== undefined ? n.info.coord.x : 0;
|
|
78
|
+
}
|
|
79
|
+
/** Node y-coordinate (0 if unset). */
|
|
80
|
+
export function nodeCoordY(n: Node): number {
|
|
81
|
+
return n.info.coord !== undefined ? n.info.coord.y : 0;
|
|
82
|
+
}
|
|
83
|
+
/** Expand accumulated bounds by one node. */
|
|
84
|
+
export function expandBounds(
|
|
85
|
+
b: { llx: number; lly: number; urx: number; ury: number },
|
|
86
|
+
n: Node, margin: number,
|
|
87
|
+
): void {
|
|
88
|
+
const x = nodeCoordX(n);
|
|
89
|
+
const y = nodeCoordY(n);
|
|
90
|
+
const lw = n.info.lw !== undefined ? n.info.lw : 18;
|
|
91
|
+
const rw = n.info.rw !== undefined ? n.info.rw : 18;
|
|
92
|
+
const ht = n.info.ht !== undefined ? n.info.ht : 18;
|
|
93
|
+
b.llx = Math.min(b.llx, x - lw - margin);
|
|
94
|
+
b.lly = Math.min(b.lly, y - ht / 2 - margin);
|
|
95
|
+
b.urx = Math.max(b.urx, x + rw + margin);
|
|
96
|
+
b.ury = Math.max(b.ury, y + ht / 2 + margin);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Expand accumulated bounds by one edge's routed spline and its labels.
|
|
100
|
+
*
|
|
101
|
+
* C's `compute_bb` walks every out-edge of every node and expands the box over
|
|
102
|
+
* each bezier's control points, then over the edge's centre/head/tail/x labels
|
|
103
|
+
* when they are `set`. Splines that bulge outside the node hull — a self-loop,
|
|
104
|
+
* a curved or ported edge, a flat edge routed around a node — therefore belong
|
|
105
|
+
* to the graph box. Omitting them truncates the graph bb (and, since the
|
|
106
|
+
* background `filled_polygon` is drawn from the bb, the drawn background too):
|
|
107
|
+
* a lone node with a self-loop reports a 54pt-wide graph instead of 72pt,
|
|
108
|
+
* because the loop bulges 18pt to the node's right.
|
|
109
|
+
*
|
|
110
|
+
* `bz.size` — never `bz.list.length` — bounds the point loop: the point lists
|
|
111
|
+
* are over-allocated, exactly as C's `ED_spl(e)->list[i].size` bounds its own.
|
|
112
|
+
*
|
|
113
|
+
* @see lib/common/utils.c:633 compute_bb (the `for (e = agfstout(g, n); ...)` arm)
|
|
114
|
+
*/
|
|
115
|
+
function expandBoundsByEdge(
|
|
116
|
+
b: { llx: number; lly: number; urx: number; ury: number },
|
|
117
|
+
e: Edge, flip: boolean, refineSplines: boolean,
|
|
118
|
+
): void {
|
|
119
|
+
const spl = e.info.spl;
|
|
120
|
+
if (spl !== undefined && refineSplines) {
|
|
121
|
+
// Single-component neato-family final bb: native never re-runs compute_bb
|
|
122
|
+
// after routing, so the edge contribution is the curve grown by
|
|
123
|
+
// update_bb_bz in clip_and_install (emit.c:746), strictly inside the
|
|
124
|
+
// control hull. Refine each cubic to the curve so a middle control point
|
|
125
|
+
// outside the curve does not inflate the box.
|
|
126
|
+
const box: Box = { ll: { x: b.llx, y: b.lly }, ur: { x: b.urx, y: b.ury } };
|
|
127
|
+
for (let i = 0; i < spl.size; i++) {
|
|
128
|
+
const bz = spl.list[i];
|
|
129
|
+
if (bz === undefined) continue;
|
|
130
|
+
for (let j = 0; j + 3 < bz.size; j += 3) {
|
|
131
|
+
const p0 = bz.list[j];
|
|
132
|
+
const p1 = bz.list[j + 1];
|
|
133
|
+
const p2 = bz.list[j + 2];
|
|
134
|
+
const p3 = bz.list[j + 3];
|
|
135
|
+
if (p0 && p1 && p2 && p3) updateBbBz(box, [p0, p1, p2, p3]);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
b.llx = box.ll.x;
|
|
139
|
+
b.lly = box.ll.y;
|
|
140
|
+
b.urx = box.ur.x;
|
|
141
|
+
b.ury = box.ur.y;
|
|
142
|
+
} else if (spl !== undefined) {
|
|
143
|
+
// Pack / multi-component path: native's pack re-runs compute_bb AFTER
|
|
144
|
+
// routing (pack.c:801), which unions raw control points (ED_spl). Match it.
|
|
145
|
+
for (let i = 0; i < spl.size; i++) {
|
|
146
|
+
const bz = spl.list[i];
|
|
147
|
+
if (bz === undefined) continue;
|
|
148
|
+
for (let j = 0; j < bz.size; j++) {
|
|
149
|
+
const p = bz.list[j];
|
|
150
|
+
if (p === undefined) continue;
|
|
151
|
+
b.llx = Math.min(b.llx, p.x);
|
|
152
|
+
b.lly = Math.min(b.lly, p.y);
|
|
153
|
+
b.urx = Math.max(b.urx, p.x);
|
|
154
|
+
b.ury = Math.max(b.ury, p.y);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
for (const l of [e.info.label, e.info.head_label, e.info.tail_label, e.info.xlabel]) {
|
|
159
|
+
if (l === undefined || l.set !== true) continue;
|
|
160
|
+
// C addLabelBB: under flip (rankdir=LR/RL) the stored dimen axes swap.
|
|
161
|
+
// @see lib/common/utils.c:569 addLabelBB
|
|
162
|
+
const hw = (flip ? l.dimen.y : l.dimen.x) / 2;
|
|
163
|
+
const hh = (flip ? l.dimen.x : l.dimen.y) / 2;
|
|
164
|
+
b.llx = Math.min(b.llx, l.pos.x - hw);
|
|
165
|
+
b.lly = Math.min(b.lly, l.pos.y - hh);
|
|
166
|
+
b.urx = Math.max(b.urx, l.pos.x + hw);
|
|
167
|
+
b.ury = Math.max(b.ury, l.pos.y + hh);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Compute a graph's bounding box: node extents, plus every routed edge spline
|
|
173
|
+
* and edge label.
|
|
174
|
+
*
|
|
175
|
+
* This is the port of C's `compute_bb` — the final bb of every non-dot engine
|
|
176
|
+
* (neato/fdp/sfdp/circo/twopi/osage all reach it, and `pack` uses it for
|
|
177
|
+
* component boxes; dot sets its own bb in `set_aspect`). It was node-only until
|
|
178
|
+
* 2026-07-12, which truncated the box of any graph whose edges leave the node
|
|
179
|
+
* hull; see `expandBoundsByEdge`.
|
|
180
|
+
*
|
|
181
|
+
* DELIBERATE DEVIATION from C's `compute_bb`, which also expands over node
|
|
182
|
+
* xlabels, cluster bbs, and the graph label: the port already grows the bb for
|
|
183
|
+
* those in dedicated passes (the xlabel placement pass, `addClusters`, and
|
|
184
|
+
* `placeGraphLabel`, each of which runs after this call and expands
|
|
185
|
+
* `g.info.bb`). Folding them in here as well would double-expand rather than
|
|
186
|
+
* match C. The edge arm has no such counterpart pass — it was simply missing.
|
|
187
|
+
*
|
|
188
|
+
* @see lib/common/utils.c:633 compute_bb
|
|
189
|
+
* @see lib/neatogen/neatoinit.c:1419 (compute_bb called right after spline_edges)
|
|
190
|
+
* @see lib/pack/pack.c:801 computeBB
|
|
191
|
+
*/
|
|
192
|
+
export function computeSubgraphBB(g: Graph, margin: number, refineSplines = false): Box {
|
|
193
|
+
const b = { llx: Infinity, lly: Infinity, urx: -Infinity, ury: -Infinity };
|
|
194
|
+
for (const n of g.nodes.values()) expandBounds(b, n, margin);
|
|
195
|
+
const flip = g.info.flip === true;
|
|
196
|
+
for (const e of g.edges) expandBoundsByEdge(b, e, flip, refineSplines);
|
|
197
|
+
if (!isFinite(b.llx)) return { ll: { x: 0, y: 0 }, ur: { x: 0, y: 0 } };
|
|
198
|
+
return { ll: { x: b.llx, y: b.lly }, ur: { x: b.urx, y: b.ury } };
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** Extract bounding boxes for an array of subgraphs. */
|
|
202
|
+
export function subgraphBBs(gs: Graph[], margin: number): Box[] {
|
|
203
|
+
return gs.map(g => computeSubgraphBB(g, margin));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// ---------------------------------------------------------------------------
|
|
207
|
+
// putGraphs / packGraphs / packSubgraphs
|
|
208
|
+
// ---------------------------------------------------------------------------
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Compute packing translation deltas for ng pre-laid-out subgraphs.
|
|
212
|
+
* Bounding boxes are raw (C compute_bb has no margin; the packers add
|
|
213
|
+
* the margin themselves).
|
|
214
|
+
* @see lib/pack/pack.c:putGraphs
|
|
215
|
+
*/
|
|
216
|
+
export function putGraphs(ng: number, gs: Graph[], root: Graph, pinfo: PackInfo): Point[] | null {
|
|
217
|
+
if (ng <= 0) return null;
|
|
218
|
+
const bbs = gs.map((g) => {
|
|
219
|
+
const bb = computeSubgraphBB(g, 0);
|
|
220
|
+
g.info.bb = bb;
|
|
221
|
+
return bb;
|
|
222
|
+
});
|
|
223
|
+
if (pinfo.mode <= PackMode.Graph) return polyGraphs(gs, root, pinfo, bbs);
|
|
224
|
+
if (pinfo.mode === PackMode.Array) {
|
|
225
|
+
if (pinfo.flags & PK_USER_VALS) {
|
|
226
|
+
pinfo.vals = gs.map((g) => {
|
|
227
|
+
const v = parseInt(g.attrs.get('sortv') ?? '', 10);
|
|
228
|
+
return !Number.isNaN(v) && v >= 0 ? v : 0;
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
return arrayRects(ng, bbs, pinfo);
|
|
232
|
+
}
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Pack subgraphs; returns 0 on success.
|
|
238
|
+
* @see lib/pack/pack.c:packGraphs
|
|
239
|
+
*/
|
|
240
|
+
export function packGraphs(ng: number, gs: Graph[], root: Graph, pinfo: PackInfo): number {
|
|
241
|
+
const pts = putGraphs(ng, gs, root, pinfo);
|
|
242
|
+
if (!pts) return -1;
|
|
243
|
+
return shiftGraphs(ng, gs, pts, root, pinfo.doSplines);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Pack subgraphs and update root bounding box.
|
|
248
|
+
* @see lib/pack/pack.c:packSubgraphs
|
|
249
|
+
*/
|
|
250
|
+
export function packSubgraphs(ng: number, gs: Graph[], root: Graph, pinfo: PackInfo): number {
|
|
251
|
+
const rc = packGraphs(ng, gs, root, pinfo);
|
|
252
|
+
if (rc === 0) root.info.bb = computeSubgraphBB(root, 0);
|
|
253
|
+
return rc;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// ---------------------------------------------------------------------------
|
|
257
|
+
// shiftGraphs
|
|
258
|
+
// ---------------------------------------------------------------------------
|
|
259
|
+
|
|
260
|
+
/** Shift all nodes in g by (dx, dy) points. @see lib/pack/pack.c:shiftGraph */
|
|
261
|
+
/**
|
|
262
|
+
* Shift a graph's bb, label position, and all nested cluster bbs.
|
|
263
|
+
* @see lib/pack/pack.c:shiftGraph
|
|
264
|
+
*/
|
|
265
|
+
export function shiftGraphBBs(g: Graph, dx: number, dy: number): void {
|
|
266
|
+
const bb = g.info.bb as Box | undefined;
|
|
267
|
+
if (bb !== undefined) {
|
|
268
|
+
g.info.bb = {
|
|
269
|
+
ll: { x: bb.ll.x + dx, y: bb.ll.y + dy },
|
|
270
|
+
ur: { x: bb.ur.x + dx, y: bb.ur.y + dy },
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
const lab = g.info.label as { set?: boolean; pos?: Point } | undefined;
|
|
274
|
+
if (lab?.set && lab.pos) {
|
|
275
|
+
lab.pos = { x: lab.pos.x + dx, y: lab.pos.y + dy };
|
|
276
|
+
}
|
|
277
|
+
const nClust = g.info.n_cluster ?? 0;
|
|
278
|
+
for (let c = 1; c <= nClust; c++) {
|
|
279
|
+
const sub = g.info.clust?.[c - 1];
|
|
280
|
+
if (sub) shiftGraphBBs(sub, dx, dy);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** Translate an edge's spline points and all four label kinds.
|
|
285
|
+
* C shiftEdge moves ED_label, ED_xlabel, ED_head_label, ED_tail_label — every
|
|
286
|
+
* one, in that order — before the spline. Omitting the port (head/tail) or
|
|
287
|
+
* external labels leaves them behind the shift delta when normalizeGraphBB
|
|
288
|
+
* translates a label-expanded drawing to origin (twopi 144 head/tail-label
|
|
289
|
+
* x-offset). @see lib/pack/pack.c:shiftEdge */
|
|
290
|
+
export function shiftEdgePoints(e: Edge, dx: number, dy: number): void {
|
|
291
|
+
const moveLabel = (raw: unknown): void => {
|
|
292
|
+
const lab = raw as { pos?: Point } | undefined;
|
|
293
|
+
if (lab?.pos) lab.pos = { x: lab.pos.x + dx, y: lab.pos.y + dy };
|
|
294
|
+
};
|
|
295
|
+
moveLabel(e.info.label);
|
|
296
|
+
moveLabel(e.info.xlabel);
|
|
297
|
+
moveLabel(e.info.head_label);
|
|
298
|
+
moveLabel(e.info.tail_label);
|
|
299
|
+
const spl = e.info.spl;
|
|
300
|
+
if (!spl) return;
|
|
301
|
+
for (const bz of spl.list) {
|
|
302
|
+
for (let k = 0; k < bz.size; k++) {
|
|
303
|
+
const p = bz.list[k]!;
|
|
304
|
+
bz.list[k] = { x: p.x + dx, y: p.y + dy };
|
|
305
|
+
}
|
|
306
|
+
if (bz.sflag) bz.sp = { x: bz.sp.x + dx, y: bz.sp.y + dy };
|
|
307
|
+
if (bz.eflag) bz.ep = { x: bz.ep.x + dx, y: bz.ep.y + dy };
|
|
308
|
+
}
|
|
309
|
+
// The port pre-computes arrowhead draw-ops during routing (C regenerates
|
|
310
|
+
// them at render time from the shifted ep/sp) — every rigid shift of the
|
|
311
|
+
// spline must carry them along or arrows lag by the shift delta.
|
|
312
|
+
const shiftOps = (ops: ArrowDrawOp[] | undefined): ArrowDrawOp[] | undefined =>
|
|
313
|
+
ops?.map((op) => mapArrowOpPoints(op, (p) => ({ x: p.x + dx, y: p.y + dy })));
|
|
314
|
+
e.info.headArrowOps = shiftOps(e.info.headArrowOps);
|
|
315
|
+
e.info.tailArrowOps = shiftOps(e.info.tailArrowOps);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function shiftOneGraph(g: Graph, dx: number, dy: number): void {
|
|
319
|
+
for (const n of g.nodes.values()) {
|
|
320
|
+
const c = n.info.coord ?? { x: 0, y: 0 };
|
|
321
|
+
n.info.coord = { x: c.x + dx, y: c.y + dy };
|
|
322
|
+
if (n.info.pos) {
|
|
323
|
+
// pos is in inches — convert point delta to inches
|
|
324
|
+
n.info.pos[0] = (n.info.pos[0] ?? 0) + dx * PS2INCH;
|
|
325
|
+
n.info.pos[1] = (n.info.pos[1] ?? 0) + dy * PS2INCH;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
// C shiftGraphs also translates routed splines (doSplines).
|
|
329
|
+
for (const e of g.edges) shiftEdgePoints(e, dx, dy);
|
|
330
|
+
// C shiftGraph also translates the graph/cluster bb tree and labels.
|
|
331
|
+
shiftGraphBBs(g, dx, dy);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Normalize bb.ll to (0,0) by shifting all nodes, edges, and the bb itself.
|
|
336
|
+
* Uses g.info.bb.ll (which includes spline extent from clipAndInstall) as the
|
|
337
|
+
* translation offset — matching C's translate_drawing which reads GD_bb(g).LL
|
|
338
|
+
* after clip_and_install has expanded it via update_bb_bz. A node-only
|
|
339
|
+
* recompute here would discard spline extent (twopi-self-loop divergence).
|
|
340
|
+
* @see lib/common/postproc.c:translate_drawing
|
|
341
|
+
* @see lib/common/splines.c:clip_and_install
|
|
342
|
+
*/
|
|
343
|
+
export function normalizeGraphBB(g: Graph): void {
|
|
344
|
+
const ll = g.info.bb.ll;
|
|
345
|
+
if (ll.x !== 0 || ll.y !== 0) {
|
|
346
|
+
shiftOneGraph(g, -ll.x, -ll.y);
|
|
347
|
+
// g.info.bb updated by shiftOneGraph → shiftGraphBBs; no recompute needed.
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Apply packing translation DELTAS to subgraphs; shifts coords, pos,
|
|
353
|
+
* bbs, labels, and cluster bbs. Spline shifting (doSplines) is not
|
|
354
|
+
* ported — no packing caller has routed edges before packing yet.
|
|
355
|
+
* @see lib/pack/pack.c:shiftGraphs
|
|
356
|
+
*/
|
|
357
|
+
export function shiftGraphs(
|
|
358
|
+
ng: number, gs: Graph[], pp: Point[], _root: Graph, _doSplines: boolean,
|
|
359
|
+
): number {
|
|
360
|
+
for (let i = 0; i < ng; i++) {
|
|
361
|
+
const dx = pp[i].x;
|
|
362
|
+
const dy = pp[i].y;
|
|
363
|
+
if (dx !== 0 || dy !== 0) shiftOneGraph(gs[i], dx, dy);
|
|
364
|
+
}
|
|
365
|
+
return 0;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// ---------------------------------------------------------------------------
|
|
369
|
+
// Component decomposition (ccomps.c)
|
|
370
|
+
// ---------------------------------------------------------------------------
|
|
371
|
+
|
|
372
|
+
/** DFS to collect connected component nodes. @see lib/pack/ccomps.c */
|
|
373
|
+
export function dfsCollect(g: Graph, start: Node, visited: Set<string>): Node[] {
|
|
374
|
+
const stack: Node[] = [start];
|
|
375
|
+
const comp: Node[] = [];
|
|
376
|
+
while (stack.length > 0) {
|
|
377
|
+
const n = stack.pop()!;
|
|
378
|
+
if (visited.has(n.name)) continue;
|
|
379
|
+
visited.add(n.name);
|
|
380
|
+
comp.push(n);
|
|
381
|
+
for (const e of g.edges) {
|
|
382
|
+
if (e.tail === n && !visited.has(e.head.name)) stack.push(e.head);
|
|
383
|
+
if (e.head === n && !visited.has(e.tail.name)) stack.push(e.tail);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
return comp;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/** Build a subgraph containing only nodes. @see lib/pack/ccomps.c */
|
|
390
|
+
export function buildSubgraph(root: Graph, nodes: Node[], name: string): Graph {
|
|
391
|
+
const sg = new (root.constructor as { new(name: string, kind: string): Graph })(name, 'directed');
|
|
392
|
+
sg.info.dotroot = root;
|
|
393
|
+
// C ccomps creates components via agsubg: sg->root is the original
|
|
394
|
+
// root graph, so root attrs (ranksep etc.) stay visible, and
|
|
395
|
+
// iteration order is the root-creation (ID) order.
|
|
396
|
+
sg.parent = root;
|
|
397
|
+
sg.root = root.root;
|
|
398
|
+
for (const n of [...nodes].sort((a, b) => a.id - b.id)) sg.nodes.set(n.name, n);
|
|
399
|
+
// Induce the component's edges (graphviz_node_induce equivalent).
|
|
400
|
+
const ns = new Set(nodes);
|
|
401
|
+
sg.edges = root.edges.filter((e) => ns.has(e.tail) && ns.has(e.head));
|
|
402
|
+
return sg;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Decompose g into connected components (nodes only, no edges).
|
|
407
|
+
* @see lib/pack/ccomps.c:ccomps
|
|
408
|
+
*/
|
|
409
|
+
export function ccomps(g: Graph, pfx: string): Graph[] {
|
|
410
|
+
const visited = new Set<string>();
|
|
411
|
+
const result: Graph[] = [];
|
|
412
|
+
let idx = 0;
|
|
413
|
+
for (const n of g.nodes.values()) {
|
|
414
|
+
if (visited.has(n.name)) continue;
|
|
415
|
+
const comp = dfsCollect(g, n, visited);
|
|
416
|
+
result.push(buildSubgraph(g, comp, `${pfx}_${idx++}`));
|
|
417
|
+
}
|
|
418
|
+
return result;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* ccomps variant — same as ccomps for this port.
|
|
423
|
+
* @see lib/pack/ccomps.c:cccomps
|
|
424
|
+
*/
|
|
425
|
+
export function cccomps(g: Graph, pfx: string): Graph[] {
|
|
426
|
+
return ccomps(g, pfx);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* ccomps with pinned-node detection.
|
|
431
|
+
* @see lib/pack/ccomps.c:pccomps
|
|
432
|
+
*/
|
|
433
|
+
export function pccomps(g: Graph, pfx: string): { graphs: Graph[]; pinned: boolean } {
|
|
434
|
+
// C first collects every component containing a pinned node into a single
|
|
435
|
+
// subgraph at index 0 (pin=true), then the remaining components in
|
|
436
|
+
// agfstnode order. Mirror that ordering so the fixed[0] flag and packing
|
|
437
|
+
// arrangement match. @see lib/pack/ccomps.c:pccomps
|
|
438
|
+
const visited = new Set<string>();
|
|
439
|
+
const result: Graph[] = [];
|
|
440
|
+
let idx = 0;
|
|
441
|
+
let pinned = false;
|
|
442
|
+
|
|
443
|
+
// Pass 1 — all pinned-node components merged into one subgraph (index 0).
|
|
444
|
+
const pinnedNodes: Node[] = [];
|
|
445
|
+
for (const n of g.nodes.values()) {
|
|
446
|
+
if (visited.has(n.name) || !n.info.pinned) continue;
|
|
447
|
+
for (const m of dfsCollect(g, n, visited)) pinnedNodes.push(m);
|
|
448
|
+
pinned = true;
|
|
449
|
+
}
|
|
450
|
+
if (pinnedNodes.length > 0) {
|
|
451
|
+
result.push(buildSubgraph(g, pinnedNodes, `${pfx}_${idx++}`));
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Pass 2 — remaining components in node order.
|
|
455
|
+
for (const n of g.nodes.values()) {
|
|
456
|
+
if (visited.has(n.name)) continue;
|
|
457
|
+
const comp = dfsCollect(g, n, visited);
|
|
458
|
+
result.push(buildSubgraph(g, comp, `${pfx}_${idx++}`));
|
|
459
|
+
}
|
|
460
|
+
return { graphs: result, pinned };
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/** True if g has exactly one connected component. @see lib/pack/ccomps.c:isConnected */
|
|
464
|
+
export function isConnected(g: Graph): boolean {
|
|
465
|
+
return ccomps(g, '__chk').length <= 1;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// ---------------------------------------------------------------------------
|
|
469
|
+
// Attribute readers
|
|
470
|
+
// ---------------------------------------------------------------------------
|
|
471
|
+
|
|
472
|
+
/** Per-flag-character pinfo flag bits. @see lib/pack/pack.c:chkFlags */
|
|
473
|
+
const PACK_FLAG_CHARS: Record<string, number> = {
|
|
474
|
+
c: PK_COL_MAJOR,
|
|
475
|
+
i: PK_INPUT_ORDER,
|
|
476
|
+
u: PK_USER_VALS,
|
|
477
|
+
t: PK_TOP_ALIGN,
|
|
478
|
+
b: PK_BOT_ALIGN,
|
|
479
|
+
l: PK_LEFT_ALIGN,
|
|
480
|
+
r: PK_RIGHT_ALIGN,
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Consume an optional `_<flags>` suffix after "array", OR-ing flag
|
|
485
|
+
* bits into pinfo. Returns the rest of the string (possible column
|
|
486
|
+
* count). @see lib/pack/pack.c:chkFlags
|
|
487
|
+
*/
|
|
488
|
+
export function chkFlags(p: string, pinfo: PackInfo): string {
|
|
489
|
+
if (!p.startsWith('_')) return p;
|
|
490
|
+
let i = 1;
|
|
491
|
+
while (i < p.length) {
|
|
492
|
+
const bit = PACK_FLAG_CHARS[p[i]!];
|
|
493
|
+
if (bit === undefined) break;
|
|
494
|
+
pinfo.flags |= bit;
|
|
495
|
+
i++;
|
|
496
|
+
}
|
|
497
|
+
return p.slice(i);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/** Parse pack mode from string attribute. @see lib/pack/pack.c:parsePackModeInfo */
|
|
501
|
+
export function parsePackModeInfo(p: string, dflt: PackMode, pinfo: PackInfo): PackMode {
|
|
502
|
+
pinfo.flags = 0;
|
|
503
|
+
pinfo.mode = dflt;
|
|
504
|
+
pinfo.sz = 0;
|
|
505
|
+
pinfo.vals = null;
|
|
506
|
+
if (p.startsWith('array')) {
|
|
507
|
+
pinfo.mode = PackMode.Array;
|
|
508
|
+
const rest = chkFlags(p.slice('array'.length), pinfo);
|
|
509
|
+
const i = parseInt(rest, 10);
|
|
510
|
+
if (!Number.isNaN(i) && i > 0) pinfo.sz = i;
|
|
511
|
+
} else if (p.startsWith('aspect')) {
|
|
512
|
+
pinfo.mode = PackMode.Aspect;
|
|
513
|
+
const v = parseFloat(p.slice('aspect'.length));
|
|
514
|
+
pinfo.aspect = !Number.isNaN(v) && v > 0 ? v : 1;
|
|
515
|
+
} else if (p === 'cluster') {
|
|
516
|
+
pinfo.mode = PackMode.Cluster;
|
|
517
|
+
} else if (p === 'graph') {
|
|
518
|
+
pinfo.mode = PackMode.Graph;
|
|
519
|
+
} else if (p === 'node') {
|
|
520
|
+
pinfo.mode = PackMode.Node;
|
|
521
|
+
}
|
|
522
|
+
return pinfo.mode;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/** Graph attr with root-default fallback (agget semantics for graphs). */
|
|
526
|
+
function graphAttr(g: Graph, key: string): string | undefined {
|
|
527
|
+
return g.attrs.get(key) ?? (g !== g.root ? g.root.attrs.get(key) : undefined);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/** Read pack mode from the "packmode" graph attr. @see lib/pack/pack.c:getPackModeInfo */
|
|
531
|
+
export function getPackModeInfo(g: Graph, dflt: PackMode, pinfo: PackInfo): PackMode {
|
|
532
|
+
return parsePackModeInfo(graphAttr(g, 'packmode') ?? '', dflt, pinfo);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/** Get pack mode from graph. @see lib/pack/pack.c:getPackMode */
|
|
536
|
+
export function getPackMode(g: Graph, dflt: PackMode): PackMode {
|
|
537
|
+
const pinfo: PackInfo = { aspect: 0, sz: 0, margin: 0, doSplines: false, mode: dflt, fixed: null, vals: null, flags: 0 };
|
|
538
|
+
return getPackModeInfo(g, dflt, pinfo);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Read the "pack" graph attr: unset → notDef; non-negative int →
|
|
543
|
+
* value; true-ish ('t'/'T') → dflt; otherwise notDef.
|
|
544
|
+
* @see lib/pack/pack.c:getPack
|
|
545
|
+
*/
|
|
546
|
+
export function getPack(g: Graph, notDef: number, dflt: number): number {
|
|
547
|
+
const p = graphAttr(g, 'pack');
|
|
548
|
+
if (p === undefined) return notDef;
|
|
549
|
+
const i = parseInt(p, 10);
|
|
550
|
+
if (!Number.isNaN(i) && i >= 0) return i;
|
|
551
|
+
if (p[0] === 't' || p[0] === 'T') return dflt;
|
|
552
|
+
return notDef;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/** Populate PackInfo from graph attributes. @see lib/pack/pack.c:getPackInfo */
|
|
556
|
+
export function getPackInfo(g: Graph, dflt: PackMode, dfltMargin: number, pinfo: PackInfo): PackMode {
|
|
557
|
+
pinfo.margin = getPack(g, dfltMargin, dfltMargin);
|
|
558
|
+
pinfo.doSplines = false;
|
|
559
|
+
pinfo.flags = 0;
|
|
560
|
+
pinfo.fixed = null;
|
|
561
|
+
pinfo.vals = null;
|
|
562
|
+
pinfo.sz = 0;
|
|
563
|
+
pinfo.aspect = 1;
|
|
564
|
+
return getPackModeInfo(g, dflt, pinfo);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/** @see lib/pack/ccomps.c:mapClust */
|
|
568
|
+
export function mapClust(cl: Graph): Graph {
|
|
569
|
+
return cl;
|
|
570
|
+
}
|