@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,277 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Programmatic graph builder — constructs a Graph model without emitting DOT.
|
|
5
|
+
*
|
|
6
|
+
* Exposes lightweight typed handles (GvNode, GvEdge) that wrap internal
|
|
7
|
+
* model references without leaking the mutable model classes (ADR-1, ADR-6,
|
|
8
|
+
* ADR-8).
|
|
9
|
+
*
|
|
10
|
+
* @see lib/cgraph/graph.c:agopen
|
|
11
|
+
* @see lib/cgraph/node.c:agnode
|
|
12
|
+
* @see lib/cgraph/subg.c:agsubg
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { Graph, type GraphKind } from '../model/graph.js';
|
|
16
|
+
import type { Node } from '../model/node.js';
|
|
17
|
+
import type { Edge } from '../model/edge.js';
|
|
18
|
+
import { agnode, agsubg, agsubnode } from '../model/cgraph-ops.js';
|
|
19
|
+
import { addEdge as cgraphAddEdge } from './edge-ops.js';
|
|
20
|
+
import { RenderError } from '../errors.js';
|
|
21
|
+
import { HTML_STRING_MARK } from '../common/html-string.js';
|
|
22
|
+
|
|
23
|
+
// ── Public interfaces ──────────────────────────────────────────────────────────
|
|
24
|
+
|
|
25
|
+
/** Options for createGraph. */
|
|
26
|
+
export interface CreateGraphOptions {
|
|
27
|
+
directed?: boolean;
|
|
28
|
+
strict?: boolean;
|
|
29
|
+
name?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Opaque handle for a graph node.
|
|
34
|
+
* @see lib/cgraph/cgraph.h:Agnode_s
|
|
35
|
+
*/
|
|
36
|
+
export interface GvNode {
|
|
37
|
+
readonly name: string;
|
|
38
|
+
setAttr(k: string, v: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Set an attribute to an HTML-string value (e.g. `label` to an HTML-table
|
|
41
|
+
* label). Equivalent to `label=<...>` in DOT text: the value is tagged as
|
|
42
|
+
* HTML so the layout engine measures it as markup, not as literal text.
|
|
43
|
+
* @see lib/cgraph/refstr.c:aghtmlstr
|
|
44
|
+
*/
|
|
45
|
+
setHtmlAttr(k: string, v: string): void;
|
|
46
|
+
getAttr(k: string): string | undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Opaque handle for a graph edge.
|
|
51
|
+
* @see lib/cgraph/cgraph.h:Agedge_s
|
|
52
|
+
*/
|
|
53
|
+
export interface GvEdge {
|
|
54
|
+
readonly tail: string;
|
|
55
|
+
readonly head: string;
|
|
56
|
+
setAttr(k: string, v: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Set an attribute to an HTML-string value (e.g. an HTML-table edge label).
|
|
59
|
+
* @see GvNode.setHtmlAttr
|
|
60
|
+
*/
|
|
61
|
+
setHtmlAttr(k: string, v: string): void;
|
|
62
|
+
getAttr(k: string): string | undefined;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Builder returned by createGraph. Provides idiomatic programmatic
|
|
67
|
+
* construction of a graph model.
|
|
68
|
+
*/
|
|
69
|
+
export interface GvGraphBuilder {
|
|
70
|
+
addNode(name: string, attrs?: Record<string, string>): GvNode;
|
|
71
|
+
addEdge(
|
|
72
|
+
tail: GvNode | string,
|
|
73
|
+
head: GvNode | string,
|
|
74
|
+
attrs?: Record<string, string>,
|
|
75
|
+
): GvEdge;
|
|
76
|
+
addSubgraph(name: string, attrs?: Record<string, string>): GvGraphBuilder;
|
|
77
|
+
setAttr(k: string, v: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Set an attribute on this (sub)graph to an HTML-string value — the
|
|
80
|
+
* supported way to give a cluster an HTML-table `label` (the header-size
|
|
81
|
+
* reservation the jar drives) without hand-writing the internal marker.
|
|
82
|
+
* @see GvNode.setHtmlAttr
|
|
83
|
+
*/
|
|
84
|
+
setHtmlAttr(k: string, v: string): void;
|
|
85
|
+
getAttr(k: string): string | undefined;
|
|
86
|
+
readonly graph: Graph;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ── Internal handle implementations ──────────────────────────────────────────
|
|
90
|
+
|
|
91
|
+
/** Internal node handle — wraps Node ref without leaking the class. */
|
|
92
|
+
class NodeHandle implements GvNode {
|
|
93
|
+
/** @internal */ readonly _node: Node;
|
|
94
|
+
|
|
95
|
+
constructor(node: Node) {
|
|
96
|
+
this._node = node;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
get name(): string {
|
|
100
|
+
return this._node.name;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
setAttr(k: string, v: string): void {
|
|
104
|
+
this._node.attrs.set(k, v);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
setHtmlAttr(k: string, v: string): void {
|
|
108
|
+
this._node.attrs.set(k, HTML_STRING_MARK + v);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
getAttr(k: string): string | undefined {
|
|
112
|
+
return this._node.attrs.get(k);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Internal edge handle — wraps Edge ref without leaking the class. */
|
|
117
|
+
class EdgeHandle implements GvEdge {
|
|
118
|
+
/** @internal */ readonly _edge: Edge;
|
|
119
|
+
|
|
120
|
+
constructor(edge: Edge) {
|
|
121
|
+
this._edge = edge;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
get tail(): string {
|
|
125
|
+
return this._edge.tail.name;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
get head(): string {
|
|
129
|
+
return this._edge.head.name;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
setAttr(k: string, v: string): void {
|
|
133
|
+
this._edge.attrs.set(k, v);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
setHtmlAttr(k: string, v: string): void {
|
|
137
|
+
this._edge.attrs.set(k, HTML_STRING_MARK + v);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
getAttr(k: string): string | undefined {
|
|
141
|
+
return this._edge.attrs.get(k);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// ── Builder implementation ─────────────────────────────────────────────────────
|
|
146
|
+
|
|
147
|
+
/** Resolve a GvNode handle or a name string to an internal Node. */
|
|
148
|
+
function resolveNode(g: Graph, ref: GvNode | string): Node {
|
|
149
|
+
if (typeof ref === 'string') {
|
|
150
|
+
const node = agnode(g, ref, true);
|
|
151
|
+
if (node === null) {
|
|
152
|
+
throw new RenderError(`Failed to resolve node '${ref}' in graph '${g.name}'`, 'GENERIC_ERROR');
|
|
153
|
+
}
|
|
154
|
+
return node;
|
|
155
|
+
}
|
|
156
|
+
return (ref as NodeHandle)._node;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Apply an attrs Record to a Map. */
|
|
160
|
+
function applyAttrs(
|
|
161
|
+
map: Map<string, string>,
|
|
162
|
+
attrs: Record<string, string> | undefined,
|
|
163
|
+
): void {
|
|
164
|
+
if (attrs === undefined) return;
|
|
165
|
+
for (const [k, v] of Object.entries(attrs)) {
|
|
166
|
+
map.set(k, v);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Builder backed by a Graph + optional subgraph context.
|
|
172
|
+
* Root builder: _context === _graph (the root Graph).
|
|
173
|
+
* Subgraph builder: _context is the subgraph; _graph is always the root.
|
|
174
|
+
*/
|
|
175
|
+
class GraphBuilder implements GvGraphBuilder {
|
|
176
|
+
private readonly _graph: Graph;
|
|
177
|
+
private readonly _context: Graph;
|
|
178
|
+
|
|
179
|
+
constructor(graph: Graph, context: Graph) {
|
|
180
|
+
this._graph = graph;
|
|
181
|
+
this._context = context;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
get graph(): Graph {
|
|
185
|
+
return this._graph;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
addNode(name: string, attrs?: Record<string, string>): GvNode {
|
|
189
|
+
return addNodeToContext(this._graph, this._context, name, attrs);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
addEdge(
|
|
193
|
+
tail: GvNode | string,
|
|
194
|
+
head: GvNode | string,
|
|
195
|
+
attrs?: Record<string, string>,
|
|
196
|
+
): GvEdge {
|
|
197
|
+
const tailNode = resolveNode(this._graph, tail);
|
|
198
|
+
const headNode = resolveNode(this._graph, head);
|
|
199
|
+
const edge = cgraphAddEdge(this._graph, tailNode, headNode);
|
|
200
|
+
applyAttrs(edge.attrs, attrs);
|
|
201
|
+
return new EdgeHandle(edge);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
addSubgraph(name: string, attrs?: Record<string, string>): GvGraphBuilder {
|
|
205
|
+
const sg = agsubg(this._context, name, true);
|
|
206
|
+
if (sg === null) {
|
|
207
|
+
throw new RenderError(`Failed to create subgraph '${name}'`, 'GENERIC_ERROR');
|
|
208
|
+
}
|
|
209
|
+
applyAttrs(sg.attrs, attrs);
|
|
210
|
+
return new GraphBuilder(this._graph, sg);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
setAttr(k: string, v: string): void {
|
|
214
|
+
this._context.attrs.set(k, v);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
setHtmlAttr(k: string, v: string): void {
|
|
218
|
+
this._context.attrs.set(k, HTML_STRING_MARK + v);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
getAttr(k: string): string | undefined {
|
|
222
|
+
return this._context.attrs.get(k);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Create a node in root and, when context is a subgraph, install it there too.
|
|
228
|
+
* Extracted to keep GraphBuilder.addNode below the CCN/length threshold.
|
|
229
|
+
*/
|
|
230
|
+
function addNodeToContext(
|
|
231
|
+
root: Graph,
|
|
232
|
+
context: Graph,
|
|
233
|
+
name: string,
|
|
234
|
+
attrs: Record<string, string> | undefined,
|
|
235
|
+
): GvNode {
|
|
236
|
+
const node = agnode(root, name, true);
|
|
237
|
+
if (node === null) throw new RenderError(`Failed to create node '${name}'`, 'GENERIC_ERROR');
|
|
238
|
+
applyAttrs(node.attrs, attrs);
|
|
239
|
+
if (context !== root) agsubnode(context, node, true);
|
|
240
|
+
return new NodeHandle(node);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// ── GraphKind mapping ──────────────────────────────────────────────────────────
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Lookup table: [directed][strict] → GraphKind.
|
|
247
|
+
* Per parser/builder.ts:272-274 (the canonical mapping in this codebase).
|
|
248
|
+
* @see lib/cgraph/graph.c:Agdirected / Agstrictdirected / Agundirected / Agstrictundirected
|
|
249
|
+
*/
|
|
250
|
+
const KIND_TABLE: Record<string, GraphKind> = {
|
|
251
|
+
'true:true': 'strict-directed',
|
|
252
|
+
'true:false': 'directed',
|
|
253
|
+
'false:true': 'strict-undirected',
|
|
254
|
+
'false:false': 'undirected',
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
/** Derive GraphKind from CreateGraphOptions. */
|
|
258
|
+
function resolveKind(opts: CreateGraphOptions | undefined): GraphKind {
|
|
259
|
+
const d = String(opts?.directed ?? true);
|
|
260
|
+
const s = String(opts?.strict ?? false);
|
|
261
|
+
return KIND_TABLE[`${d}:${s}`] ?? 'directed';
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// ── Factory ────────────────────────────────────────────────────────────────────
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Create a new programmatic graph builder.
|
|
268
|
+
*
|
|
269
|
+
* The builder's `.graph` is a fresh Graph ready for handoff to layout/render.
|
|
270
|
+
* Defaults: directed=true, strict=false, name=''.
|
|
271
|
+
*
|
|
272
|
+
* @see lib/cgraph/graph.c:agopen
|
|
273
|
+
*/
|
|
274
|
+
export function createGraph(opts?: CreateGraphOptions): GvGraphBuilder {
|
|
275
|
+
const g = new Graph(opts?.name ?? '', resolveKind(opts));
|
|
276
|
+
return new GraphBuilder(g, g);
|
|
277
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Safe edge-creation helper — the `agedge` equivalent for programmatic graph
|
|
5
|
+
* construction. Mirrors the parser's dual-list insertion and adds the
|
|
6
|
+
* strict-graph deduplication mandated by cgraph.
|
|
7
|
+
*
|
|
8
|
+
* @see lib/cgraph/edge.c:agedge
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { Graph } from '../model/graph.js';
|
|
12
|
+
import type { Node } from '../model/node.js';
|
|
13
|
+
import { Edge } from '../model/edge.js';
|
|
14
|
+
|
|
15
|
+
/** @see lib/cgraph/cgraph.h:agisundirected */
|
|
16
|
+
function isUndirected(g: Graph): boolean {
|
|
17
|
+
const k = g.root.kind;
|
|
18
|
+
return k === 'undirected' || k === 'strict-undirected';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** @see lib/cgraph/cgraph.h:agisstrict */
|
|
22
|
+
function isStrict(g: Graph): boolean {
|
|
23
|
+
const k = g.root.kind;
|
|
24
|
+
return k === 'strict-directed' || k === 'strict-undirected';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Probe root.edges for an existing (tail,head) pair.
|
|
29
|
+
* For undirected graphs, (h,t) matches (t,h) — mirrors the C wildcard
|
|
30
|
+
* key probe in ok_to_make_edge / agedge pre-creation check.
|
|
31
|
+
* @see lib/cgraph/edge.c:ok_to_make_edge
|
|
32
|
+
*/
|
|
33
|
+
function findExistingEdge(
|
|
34
|
+
root: Graph,
|
|
35
|
+
tail: Node,
|
|
36
|
+
head: Node,
|
|
37
|
+
undirected: boolean,
|
|
38
|
+
): Edge | null {
|
|
39
|
+
for (const e of root.edges) {
|
|
40
|
+
if (e.tail === tail && e.head === head) return e;
|
|
41
|
+
if (undirected && e.tail === head && e.head === tail) return e;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Insert edge into root.edges and walk the subgraph chain toward root,
|
|
48
|
+
* adding the edge (and its endpoint nodes) to every enclosing graph.
|
|
49
|
+
* Mirrors processEdgePair's enclosing-graph loop and installedge.
|
|
50
|
+
* @see lib/cgraph/edge.c:installedge
|
|
51
|
+
* @see src/parser/builder.ts:238-246
|
|
52
|
+
*/
|
|
53
|
+
function insertEdge(g: Graph, root: Graph, edge: Edge): void {
|
|
54
|
+
root.edges.push(edge);
|
|
55
|
+
edge.graphSeq = root.edges.length;
|
|
56
|
+
for (let cur: Graph | null = g; cur !== null && cur !== root; cur = cur.parent) {
|
|
57
|
+
cur.nodes.set(edge.tail.name, edge.tail);
|
|
58
|
+
cur.nodes.set(edge.head.name, edge.head);
|
|
59
|
+
cur.edges.push(edge);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Create and insert an edge from `tail` to `head` in graph `g`.
|
|
65
|
+
*
|
|
66
|
+
* In a strict graph, at most one edge between any (tail, head) pair exists
|
|
67
|
+
* (symmetric for undirected). When a match is found the existing edge is
|
|
68
|
+
* returned without modification. This matches C `agedge` with `cflag=1`.
|
|
69
|
+
*
|
|
70
|
+
* Most callers building a graph programmatically should prefer
|
|
71
|
+
* `createGraph().addEdge(...)` (the `GvGraphBuilder` method), which accepts
|
|
72
|
+
* node names or handles. Use this lower-level `addEdge` when you already
|
|
73
|
+
* hold `Graph`/`Node` references — e.g. edges added onto a graph returned by
|
|
74
|
+
* `parse()`.
|
|
75
|
+
*
|
|
76
|
+
* @param g - Owning graph or subgraph; root derived via `g.root`.
|
|
77
|
+
* @param tail - Source node (AGTAIL). @see lib/cgraph/cgraph.h:AGTAIL
|
|
78
|
+
* @param head - Destination node (AGHEAD). @see lib/cgraph/cgraph.h:AGHEAD
|
|
79
|
+
* @param name - Edge key; defaults to empty string for anonymous edges.
|
|
80
|
+
* Ignored for strict-graph dedup (wildcard match).
|
|
81
|
+
* @returns The new (or existing, for strict graphs) edge.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* import { parse, addEdge } from '@knowvah/dot-engine';
|
|
86
|
+
*
|
|
87
|
+
* const g = parse('digraph { a; b; }');
|
|
88
|
+
* const a = g.nodes.get('a')!;
|
|
89
|
+
* const b = g.nodes.get('b')!;
|
|
90
|
+
* const edge = addEdge(g, a, b, 'ab1');
|
|
91
|
+
* // edge.tail === a, edge.head === b
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @see lib/cgraph/edge.c:agedge
|
|
95
|
+
*/
|
|
96
|
+
export function addEdge(
|
|
97
|
+
g: Graph,
|
|
98
|
+
tail: Node,
|
|
99
|
+
head: Node,
|
|
100
|
+
name?: string,
|
|
101
|
+
): Edge {
|
|
102
|
+
const root = g.root;
|
|
103
|
+
const undirected = isUndirected(g);
|
|
104
|
+
|
|
105
|
+
if (isStrict(g)) {
|
|
106
|
+
const existing = findExistingEdge(root, tail, head, undirected);
|
|
107
|
+
if (existing !== null) return existing;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const edge = new Edge(tail, head, name ?? '');
|
|
111
|
+
insertEdge(g, root, edge);
|
|
112
|
+
return edge;
|
|
113
|
+
}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Geometry snapshot API — reads computed layout geometry from an
|
|
5
|
+
* internal Graph after ctx.layout() has run, and returns a plain,
|
|
6
|
+
* JSON-serializable snapshot.
|
|
7
|
+
*
|
|
8
|
+
* Coordinate systems
|
|
9
|
+
* ------------------
|
|
10
|
+
* Native graphviz coordinates are y-up (origin at lower-left).
|
|
11
|
+
* Most screen consumers want y-down (origin at upper-left).
|
|
12
|
+
*
|
|
13
|
+
* With the default `yAxis: 'down'`, every y coordinate is flipped:
|
|
14
|
+
* y' = bbHeight - y
|
|
15
|
+
* where bbHeight = graph bb.ur.y - graph bb.ll.y.
|
|
16
|
+
* The `bounds` origin is normalised to (0, 0) at the top-left corner.
|
|
17
|
+
*
|
|
18
|
+
* With `yAxis: 'up'`, values are returned unchanged (native y-up frame).
|
|
19
|
+
*
|
|
20
|
+
* Units
|
|
21
|
+
* -----
|
|
22
|
+
* The internal model stores node `width` and `height` in inches
|
|
23
|
+
* (matching C ND_width / ND_height in lib/common/types.h).
|
|
24
|
+
* `NodeGeometry.width` and `NodeGeometry.height` are converted to
|
|
25
|
+
* **points** (1 inch = 72 points) before being returned.
|
|
26
|
+
*
|
|
27
|
+
* All other coordinates (x, y, bbox dimensions, spline points,
|
|
28
|
+
* label positions) are in the native graphviz point unit.
|
|
29
|
+
*
|
|
30
|
+
* @see lib/common/types.h
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import type { Graph } from '../model/graph.js';
|
|
34
|
+
import type { Node } from '../model/node.js';
|
|
35
|
+
import type { Edge } from '../model/edge.js';
|
|
36
|
+
import { RenderError } from '../errors.js';
|
|
37
|
+
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// Public coordinate types (canonical home — T5 imports GeometryOptions here)
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
|
|
42
|
+
/** Coordinate system for returned geometry. */
|
|
43
|
+
export type YAxis = 'up' | 'down';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Options for {@link getLayout}.
|
|
47
|
+
*
|
|
48
|
+
* @property yAxis - Coordinate direction. Default `'down'` (origin top-left,
|
|
49
|
+
* y increases downward — screen convention). Use `'up'` to get native
|
|
50
|
+
* graphviz coordinates (origin bottom-left, y increases upward).
|
|
51
|
+
*/
|
|
52
|
+
export type GeometryOptions = { yAxis?: YAxis };
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Overall bounding box of the graph, in points.
|
|
56
|
+
*
|
|
57
|
+
* With `yAxis:'down'`, x and y are 0 (normalised to top-left origin)
|
|
58
|
+
* and width/height are the natural dimensions.
|
|
59
|
+
* With `yAxis:'up'`, x and y match the raw lower-left corner of the
|
|
60
|
+
* graph bounding box.
|
|
61
|
+
*/
|
|
62
|
+
export interface BoundsGeometry {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Per-node geometry extracted after layout, in points.
|
|
71
|
+
*
|
|
72
|
+
* `x` and `y` are the node centre coordinates.
|
|
73
|
+
* `width` and `height` are in **points** (converted from the inches
|
|
74
|
+
* stored on the model: `NodeInfo.width * 72`, `NodeInfo.height * 72`).
|
|
75
|
+
*
|
|
76
|
+
* @see lib/common/types.h:ND_coord, ND_width, ND_height
|
|
77
|
+
*/
|
|
78
|
+
export interface NodeGeometry {
|
|
79
|
+
name: string;
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
/**
|
|
83
|
+
* Node width in **points** (model stores inches; multiplied by 72 here).
|
|
84
|
+
* @see lib/common/types.h:ND_width
|
|
85
|
+
*/
|
|
86
|
+
width: number;
|
|
87
|
+
/**
|
|
88
|
+
* Node height in **points** (model stores inches; multiplied by 72 here).
|
|
89
|
+
* @see lib/common/types.h:ND_height
|
|
90
|
+
*/
|
|
91
|
+
height: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Per-edge geometry extracted after spline routing, in points.
|
|
96
|
+
*
|
|
97
|
+
* `points` concatenates all bezier control points from the edge spline,
|
|
98
|
+
* in order. An edge with no routed spline produces an empty `points` array.
|
|
99
|
+
* `label` is present only when the edge carries a centre label.
|
|
100
|
+
*
|
|
101
|
+
* @see lib/common/types.h:ED_spl, ED_label
|
|
102
|
+
*/
|
|
103
|
+
export interface EdgeGeometry {
|
|
104
|
+
tail: string;
|
|
105
|
+
head: string;
|
|
106
|
+
/** Bezier control points for the edge spline, in points. */
|
|
107
|
+
points: { x: number; y: number }[];
|
|
108
|
+
/** Centre edge label position, if present. @see lib/common/types.h:ED_label */
|
|
109
|
+
label?: { x: number; y: number };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Per-cluster geometry extracted after layout, in points.
|
|
114
|
+
*
|
|
115
|
+
* `name` is the cluster subgraph's name (e.g. `cluster6`); for nested
|
|
116
|
+
* clusters the name encodes the hierarchy, so no explicit parent link is
|
|
117
|
+
* exposed. `x`/`y`/`width`/`height` describe the cluster's bounding box,
|
|
118
|
+
* following the same frame convention as {@link BoundsGeometry}: with
|
|
119
|
+
* `yAxis:'down'` (x, y) is the top-left corner; with `yAxis:'up'` (x, y) is
|
|
120
|
+
* the lower-left corner (native graphviz frame). These are the raw box
|
|
121
|
+
* corners graphviz computed — the same values `render()` rounds to emit the
|
|
122
|
+
* `class="cluster"` polygon, so a consumer quantizing to SVG precision gets
|
|
123
|
+
* byte-conformant geometry.
|
|
124
|
+
*
|
|
125
|
+
* @see lib/common/types.h:GD_bb (of a cluster subgraph)
|
|
126
|
+
*/
|
|
127
|
+
export interface ClusterGeometry {
|
|
128
|
+
/** Cluster subgraph name (e.g. `cluster6`); encodes nesting. */
|
|
129
|
+
name: string;
|
|
130
|
+
x: number;
|
|
131
|
+
y: number;
|
|
132
|
+
width: number;
|
|
133
|
+
height: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Plain, JSON-serializable snapshot of the graph's computed geometry.
|
|
138
|
+
*
|
|
139
|
+
* `clusters` lists every cluster subgraph (recursively, nested clusters each
|
|
140
|
+
* get their own entry) with a computed bounding box; it is empty for graphs
|
|
141
|
+
* without clusters.
|
|
142
|
+
*
|
|
143
|
+
* @see lib/common/types.h:GD_bb, ND_coord, ED_spl, GD_clust
|
|
144
|
+
*/
|
|
145
|
+
export interface LayoutSnapshot {
|
|
146
|
+
bounds: BoundsGeometry;
|
|
147
|
+
nodes: NodeGeometry[];
|
|
148
|
+
edges: EdgeGeometry[];
|
|
149
|
+
clusters: ClusterGeometry[];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// ---------------------------------------------------------------------------
|
|
153
|
+
// Internal constants
|
|
154
|
+
// ---------------------------------------------------------------------------
|
|
155
|
+
|
|
156
|
+
/** Points per inch — matches graphviz's DPI constant. @see lib/common/geom.h */
|
|
157
|
+
const INCHES_TO_POINTS = 72;
|
|
158
|
+
|
|
159
|
+
// ---------------------------------------------------------------------------
|
|
160
|
+
// Internal helpers
|
|
161
|
+
// ---------------------------------------------------------------------------
|
|
162
|
+
|
|
163
|
+
/** Build a y-flip function bound to a specific graph bounding-box height. */
|
|
164
|
+
function makeFlipY(bbHeight: number, yAxis: YAxis): (y: number) => number {
|
|
165
|
+
if (yAxis === 'up') return (y) => y;
|
|
166
|
+
return (y) => bbHeight - y;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Snapshot one node's geometry.
|
|
171
|
+
* @see lib/common/types.h:ND_coord, ND_width, ND_height
|
|
172
|
+
*/
|
|
173
|
+
function snapshotNode(node: Node, flipY: (y: number) => number): NodeGeometry {
|
|
174
|
+
const coord = node.info.coord;
|
|
175
|
+
return {
|
|
176
|
+
name: node.name,
|
|
177
|
+
x: coord.x,
|
|
178
|
+
y: flipY(coord.y),
|
|
179
|
+
width: node.info.width * INCHES_TO_POINTS,
|
|
180
|
+
height: node.info.height * INCHES_TO_POINTS,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Collect bezier control points from an edge's spline.
|
|
186
|
+
* Uses `.size` (not `.list.length`) because C over-allocates `list`
|
|
187
|
+
* and `size` holds the actual count after clip_and_install.
|
|
188
|
+
* @see lib/common/splines.c:clip_and_install
|
|
189
|
+
*/
|
|
190
|
+
function collectEdgePoints(
|
|
191
|
+
edge: Edge,
|
|
192
|
+
flipY: (y: number) => number,
|
|
193
|
+
): { x: number; y: number }[] {
|
|
194
|
+
const spl = edge.info.spl;
|
|
195
|
+
if (spl === undefined) return [];
|
|
196
|
+
const pts: { x: number; y: number }[] = [];
|
|
197
|
+
for (const bz of spl.list) {
|
|
198
|
+
for (let k = 0; k < bz.size; k++) {
|
|
199
|
+
const pt = bz.list[k];
|
|
200
|
+
pts.push({ x: pt.x, y: flipY(pt.y) });
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return pts;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Snapshot one edge's geometry.
|
|
208
|
+
* @see lib/common/types.h:ED_spl, ED_label (textlabel_t.pos)
|
|
209
|
+
*/
|
|
210
|
+
function snapshotEdge(edge: Edge, flipY: (y: number) => number): EdgeGeometry {
|
|
211
|
+
const geom: EdgeGeometry = {
|
|
212
|
+
tail: edge.tail.name,
|
|
213
|
+
head: edge.head.name,
|
|
214
|
+
points: collectEdgePoints(edge, flipY),
|
|
215
|
+
};
|
|
216
|
+
const lbl = edge.info.label;
|
|
217
|
+
if (lbl !== undefined) {
|
|
218
|
+
geom.label = { x: lbl.pos.x, y: flipY(lbl.pos.y) };
|
|
219
|
+
}
|
|
220
|
+
return geom;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Snapshot one cluster's bounding box, in the requested frame.
|
|
225
|
+
*
|
|
226
|
+
* Mirrors the {@link BoundsGeometry} convention: `yAxis:'up'` returns the
|
|
227
|
+
* native lower-left corner (ll); `yAxis:'down'` returns the top-left corner
|
|
228
|
+
* (ll.x, flipped ur.y). `width`/`height` are frame-independent (ur - ll).
|
|
229
|
+
*
|
|
230
|
+
* @see lib/common/types.h:GD_bb (cluster subgraph)
|
|
231
|
+
*/
|
|
232
|
+
function snapshotCluster(
|
|
233
|
+
sg: Graph, yAxis: YAxis, flipY: (y: number) => number,
|
|
234
|
+
): ClusterGeometry {
|
|
235
|
+
const bb = sg.info.bb;
|
|
236
|
+
return {
|
|
237
|
+
name: sg.name,
|
|
238
|
+
x: bb.ll.x,
|
|
239
|
+
// 'up' keeps the lower-left y; 'down' flips the upper-right y to the
|
|
240
|
+
// top-left of the box (flipY is monotonic-decreasing there).
|
|
241
|
+
y: yAxis === 'up' ? bb.ll.y : flipY(bb.ur.y),
|
|
242
|
+
width: bb.ur.x - bb.ll.x,
|
|
243
|
+
height: bb.ur.y - bb.ll.y,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Collect every cluster subgraph (depth-first, nested clusters included).
|
|
249
|
+
* C stores clusters 1-indexed in GD_clust; the TS model exposes a 0-indexed
|
|
250
|
+
* `info.clust` array on each (sub)graph. A cluster without a computed bb
|
|
251
|
+
* (never laid out) is skipped.
|
|
252
|
+
* @see lib/common/types.h:GD_clust, GD_n_cluster
|
|
253
|
+
*/
|
|
254
|
+
function collectClusters(
|
|
255
|
+
sg: Graph, yAxis: YAxis, flipY: (y: number) => number,
|
|
256
|
+
out: ClusterGeometry[],
|
|
257
|
+
): void {
|
|
258
|
+
for (const c of sg.info.clust ?? []) {
|
|
259
|
+
if (c.info.bb !== undefined) out.push(snapshotCluster(c, yAxis, flipY));
|
|
260
|
+
collectClusters(c, yAxis, flipY, out);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// ---------------------------------------------------------------------------
|
|
265
|
+
// Public API
|
|
266
|
+
// ---------------------------------------------------------------------------
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Returns a plain, JSON-serializable snapshot of the computed geometry for
|
|
270
|
+
* all nodes and edges in graph `g`.
|
|
271
|
+
*
|
|
272
|
+
* Must be called **after** `ctx.layout(g, engine)` (or `render`) has run.
|
|
273
|
+
* Before layout the geometry fields hold calloc-zero defaults (every node at
|
|
274
|
+
* the origin, an empty bounding box), so a not-yet-laid-out graph is rejected
|
|
275
|
+
* with a `RenderError` rather than returning that all-zero snapshot as if it
|
|
276
|
+
* were real geometry.
|
|
277
|
+
*
|
|
278
|
+
* @param g - Laid-out graph (internal model; not mutated by this function).
|
|
279
|
+
* @param opts - Coordinate options; defaults to `{ yAxis: 'down' }`.
|
|
280
|
+
* @throws RenderError if `g` has not been laid out.
|
|
281
|
+
*
|
|
282
|
+
* @see lib/common/types.h:GD_bb, ND_coord, ED_spl
|
|
283
|
+
*/
|
|
284
|
+
export function getLayout(g: Graph, opts?: GeometryOptions): LayoutSnapshot {
|
|
285
|
+
if (g.info?.laidOut !== true) {
|
|
286
|
+
throw new RenderError(
|
|
287
|
+
'getLayout requires a laid-out graph; run ctx.layout(g, engine) or render() first',
|
|
288
|
+
'GENERIC_ERROR',
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
const yAxis: YAxis = opts?.yAxis ?? 'down';
|
|
292
|
+
const bb = g.info.bb;
|
|
293
|
+
const bbWidth = bb.ur.x - bb.ll.x;
|
|
294
|
+
const bbHeight = bb.ur.y - bb.ll.y;
|
|
295
|
+
const flipY = makeFlipY(bbHeight, yAxis);
|
|
296
|
+
|
|
297
|
+
const bounds: BoundsGeometry = yAxis === 'down'
|
|
298
|
+
? { x: 0, y: 0, width: bbWidth, height: bbHeight }
|
|
299
|
+
: { x: bb.ll.x, y: bb.ll.y, width: bbWidth, height: bbHeight };
|
|
300
|
+
|
|
301
|
+
const nodes = Array.from(g.nodes.values()).map((n) => snapshotNode(n, flipY));
|
|
302
|
+
const edges = g.edges.map((e) => snapshotEdge(e, flipY));
|
|
303
|
+
const clusters: ClusterGeometry[] = [];
|
|
304
|
+
collectClusters(g, yAxis, flipY, clusters);
|
|
305
|
+
|
|
306
|
+
return { bounds, nodes, edges, clusters };
|
|
307
|
+
}
|