@knowvah/dot-engine 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +277 -0
- package/README.md +292 -0
- package/dist/api/builder.d.ts +78 -0
- package/dist/api/builder.d.ts.map +1 -0
- package/dist/api/edge-ops.d.ts +45 -0
- package/dist/api/edge-ops.d.ts.map +1 -0
- package/dist/api/geometry.d.ts +159 -0
- package/dist/api/geometry.d.ts.map +1 -0
- package/dist/api/index.d.ts +24 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api.js +719 -0
- package/dist/api.js.map +7 -0
- package/dist/bundle.js +101 -0
- package/dist/cdt/bag.d.ts +58 -0
- package/dist/cdt/bag.d.ts.map +1 -0
- package/dist/cdt/hash-core.d.ts +40 -0
- package/dist/cdt/hash-core.d.ts.map +1 -0
- package/dist/cdt/hash.d.ts +74 -0
- package/dist/cdt/hash.d.ts.map +1 -0
- package/dist/cdt/index.d.ts +16 -0
- package/dist/cdt/index.d.ts.map +1 -0
- package/dist/cdt/splay-core.d.ts +78 -0
- package/dist/cdt/splay-core.d.ts.map +1 -0
- package/dist/cdt/splay.d.ts +63 -0
- package/dist/cdt/splay.d.ts.map +1 -0
- package/dist/cdt/strhash.d.ts +26 -0
- package/dist/cdt/strhash.d.ts.map +1 -0
- package/dist/cdt/types.d.ts +11 -0
- package/dist/cdt/types.d.ts.map +1 -0
- package/dist/common/arith.d.ts +35 -0
- package/dist/common/arith.d.ts.map +1 -0
- package/dist/common/arm-pow-data.d.ts +17 -0
- package/dist/common/arm-pow-data.d.ts.map +1 -0
- package/dist/common/arm-pow.d.ts +12 -0
- package/dist/common/arm-pow.d.ts.map +1 -0
- package/dist/common/arrows-constants.d.ts +97 -0
- package/dist/common/arrows-constants.d.ts.map +1 -0
- package/dist/common/arrows-geometry.d.ts +24 -0
- package/dist/common/arrows-geometry.d.ts.map +1 -0
- package/dist/common/arrows-miter.d.ts +24 -0
- package/dist/common/arrows-miter.d.ts.map +1 -0
- package/dist/common/arrows-shapes-poly.d.ts +24 -0
- package/dist/common/arrows-shapes-poly.d.ts.map +1 -0
- package/dist/common/arrows-shapes-util.d.ts +77 -0
- package/dist/common/arrows-shapes-util.d.ts.map +1 -0
- package/dist/common/arrows-shapes.d.ts +48 -0
- package/dist/common/arrows-shapes.d.ts.map +1 -0
- package/dist/common/arrows-types.d.ts +59 -0
- package/dist/common/arrows-types.d.ts.map +1 -0
- package/dist/common/arrows.d.ts +69 -0
- package/dist/common/arrows.d.ts.map +1 -0
- package/dist/common/color.d.ts +66 -0
- package/dist/common/color.d.ts.map +1 -0
- package/dist/common/colorData.d.ts +10 -0
- package/dist/common/colorData.d.ts.map +1 -0
- package/dist/common/compass-port.d.ts +39 -0
- package/dist/common/compass-port.d.ts.map +1 -0
- package/dist/common/crand.d.ts +42 -0
- package/dist/common/crand.d.ts.map +1 -0
- package/dist/common/edge-label-init.d.ts +51 -0
- package/dist/common/edge-label-init.d.ts.map +1 -0
- package/dist/common/edge-offset.d.ts +66 -0
- package/dist/common/edge-offset.d.ts.map +1 -0
- package/dist/common/ellipse-wedge.d.ts +10 -0
- package/dist/common/ellipse-wedge.d.ts.map +1 -0
- package/dist/common/emit-types.d.ts +255 -0
- package/dist/common/emit-types.d.ts.map +1 -0
- package/dist/common/fma.d.ts +10 -0
- package/dist/common/fma.d.ts.map +1 -0
- package/dist/common/graph-init.d.ts +61 -0
- package/dist/common/graph-init.d.ts.map +1 -0
- package/dist/common/html-entities.d.ts +17 -0
- package/dist/common/html-entities.d.ts.map +1 -0
- package/dist/common/html-string.d.ts +14 -0
- package/dist/common/html-string.d.ts.map +1 -0
- package/dist/common/htmltable-emit-fill.d.ts +84 -0
- package/dist/common/htmltable-emit-fill.d.ts.map +1 -0
- package/dist/common/htmltable-emit-rules.d.ts +79 -0
- package/dist/common/htmltable-emit-rules.d.ts.map +1 -0
- package/dist/common/htmltable-emit.d.ts +63 -0
- package/dist/common/htmltable-emit.d.ts.map +1 -0
- package/dist/common/htmltable-lex.d.ts +16 -0
- package/dist/common/htmltable-lex.d.ts.map +1 -0
- package/dist/common/htmltable-parse.d.ts +37 -0
- package/dist/common/htmltable-parse.d.ts.map +1 -0
- package/dist/common/htmltable-port.d.ts +15 -0
- package/dist/common/htmltable-port.d.ts.map +1 -0
- package/dist/common/htmltable-pos-runs.d.ts +88 -0
- package/dist/common/htmltable-pos-runs.d.ts.map +1 -0
- package/dist/common/htmltable-pos.d.ts +192 -0
- package/dist/common/htmltable-pos.d.ts.map +1 -0
- package/dist/common/htmltable-types.d.ts +237 -0
- package/dist/common/htmltable-types.d.ts.map +1 -0
- package/dist/common/htmltable.d.ts +74 -0
- package/dist/common/htmltable.d.ts.map +1 -0
- package/dist/common/layers.d.ts +20 -0
- package/dist/common/layers.d.ts.map +1 -0
- package/dist/common/make-label.d.ts +60 -0
- package/dist/common/make-label.d.ts.map +1 -0
- package/dist/common/multicolor.d.ts +46 -0
- package/dist/common/multicolor.d.ts.map +1 -0
- package/dist/common/nodeinit.d.ts +45 -0
- package/dist/common/nodeinit.d.ts.map +1 -0
- package/dist/common/poly-gencode.d.ts +40 -0
- package/dist/common/poly-gencode.d.ts.map +1 -0
- package/dist/common/poly-init.d.ts +51 -0
- package/dist/common/poly-init.d.ts.map +1 -0
- package/dist/common/poly-inside.d.ts +37 -0
- package/dist/common/poly-inside.d.ts.map +1 -0
- package/dist/common/poly-shapes-cases.d.ts +31 -0
- package/dist/common/poly-shapes-cases.d.ts.map +1 -0
- package/dist/common/poly-shapes-cases2.d.ts +25 -0
- package/dist/common/poly-shapes-cases2.d.ts.map +1 -0
- package/dist/common/poly-shapes-util.d.ts +42 -0
- package/dist/common/poly-shapes-util.d.ts.map +1 -0
- package/dist/common/poly-shapes.d.ts +39 -0
- package/dist/common/poly-shapes.d.ts.map +1 -0
- package/dist/common/poly-sizing.d.ts +189 -0
- package/dist/common/poly-sizing.d.ts.map +1 -0
- package/dist/common/poly-vertices.d.ts +42 -0
- package/dist/common/poly-vertices.d.ts.map +1 -0
- package/dist/common/postproc.d.ts +49 -0
- package/dist/common/postproc.d.ts.map +1 -0
- package/dist/common/ps-fontalias.d.ts +36 -0
- package/dist/common/ps-fontalias.d.ts.map +1 -0
- package/dist/common/random.d.ts +8 -0
- package/dist/common/random.d.ts.map +1 -0
- package/dist/common/record-port.d.ts +34 -0
- package/dist/common/record-port.d.ts.map +1 -0
- package/dist/common/record.d.ts +105 -0
- package/dist/common/record.d.ts.map +1 -0
- package/dist/common/shapeData.d.ts +186 -0
- package/dist/common/shapeData.d.ts.map +1 -0
- package/dist/common/shapes.d.ts +36 -0
- package/dist/common/shapes.d.ts.map +1 -0
- package/dist/common/spline-midpoint.d.ts +31 -0
- package/dist/common/spline-midpoint.d.ts.map +1 -0
- package/dist/common/splines-clip.d.ts +21 -0
- package/dist/common/splines-clip.d.ts.map +1 -0
- package/dist/common/splines-constants.d.ts +42 -0
- package/dist/common/splines-constants.d.ts.map +1 -0
- package/dist/common/splines-geom.d.ts +51 -0
- package/dist/common/splines-geom.d.ts.map +1 -0
- package/dist/common/splines-path-begin.d.ts +17 -0
- package/dist/common/splines-path-begin.d.ts.map +1 -0
- package/dist/common/splines-path-end.d.ts +17 -0
- package/dist/common/splines-path-end.d.ts.map +1 -0
- package/dist/common/splines-path-shared.d.ts +53 -0
- package/dist/common/splines-path-shared.d.ts.map +1 -0
- package/dist/common/splines-routespl.d.ts +40 -0
- package/dist/common/splines-routespl.d.ts.map +1 -0
- package/dist/common/splines-selfedge.d.ts +21 -0
- package/dist/common/splines-selfedge.d.ts.map +1 -0
- package/dist/common/splines.d.ts +18 -0
- package/dist/common/splines.d.ts.map +1 -0
- package/dist/common/style-resolve.d.ts +197 -0
- package/dist/common/style-resolve.d.ts.map +1 -0
- package/dist/common/subst.d.ts +31 -0
- package/dist/common/subst.d.ts.map +1 -0
- package/dist/common/taper.d.ts +23 -0
- package/dist/common/taper.d.ts.map +1 -0
- package/dist/common/textmeasure-factory.d.ts +33 -0
- package/dist/common/textmeasure-factory.d.ts.map +1 -0
- package/dist/common/textmeasure-lookup.d.ts +17 -0
- package/dist/common/textmeasure-lookup.d.ts.map +1 -0
- package/dist/common/textmeasure-lut-data-a.d.ts +13 -0
- package/dist/common/textmeasure-lut-data-a.d.ts.map +1 -0
- package/dist/common/textmeasure-lut-data-b.d.ts +12 -0
- package/dist/common/textmeasure-lut-data-b.d.ts.map +1 -0
- package/dist/common/textmeasure-lut-data-c.d.ts +13 -0
- package/dist/common/textmeasure-lut-data-c.d.ts.map +1 -0
- package/dist/common/textmeasure-lut-data.d.ts +27 -0
- package/dist/common/textmeasure-lut-data.d.ts.map +1 -0
- package/dist/common/textmeasure.d.ts +120 -0
- package/dist/common/textmeasure.d.ts.map +1 -0
- package/dist/common/types.d.ts +316 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/xlabels-place.d.ts +125 -0
- package/dist/common/xlabels-place.d.ts.map +1 -0
- package/dist/debug.d.ts +58 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/errors.d.ts +63 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/gvc/anchor.d.ts +86 -0
- package/dist/gvc/anchor.d.ts.map +1 -0
- package/dist/gvc/context.d.ts +177 -0
- package/dist/gvc/context.d.ts.map +1 -0
- package/dist/gvc/default-context.d.ts +20 -0
- package/dist/gvc/default-context.d.ts.map +1 -0
- package/dist/gvc/device-cluster.d.ts +25 -0
- package/dist/gvc/device-cluster.d.ts.map +1 -0
- package/dist/gvc/device.d.ts +99 -0
- package/dist/gvc/device.d.ts.map +1 -0
- package/dist/gvc/edge-labels.d.ts +10 -0
- package/dist/gvc/edge-labels.d.ts.map +1 -0
- package/dist/gvc/emit-walk.d.ts +22 -0
- package/dist/gvc/emit-walk.d.ts.map +1 -0
- package/dist/gvc/image-resolver.d.ts +44 -0
- package/dist/gvc/image-resolver.d.ts.map +1 -0
- package/dist/gvc/job.d.ts +234 -0
- package/dist/gvc/job.d.ts.map +1 -0
- package/dist/gvc/textlayout.d.ts +33 -0
- package/dist/gvc/textlayout.d.ts.map +1 -0
- package/dist/gvc/textspan-emit.d.ts +41 -0
- package/dist/gvc/textspan-emit.d.ts.map +1 -0
- package/dist/gvc/usershape.d.ts +25 -0
- package/dist/gvc/usershape.d.ts.map +1 -0
- package/dist/gvc/viewport.d.ts +71 -0
- package/dist/gvc/viewport.d.ts.map +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52862 -0
- package/dist/index.js.map +7 -0
- package/dist/label/index.d.ts +74 -0
- package/dist/label/index.d.ts.map +1 -0
- package/dist/label/node.d.ts +108 -0
- package/dist/label/node.d.ts.map +1 -0
- package/dist/label/rectangle.d.ts +60 -0
- package/dist/label/rectangle.d.ts.map +1 -0
- package/dist/label/split-q.d.ts +13 -0
- package/dist/label/split-q.d.ts.map +1 -0
- package/dist/label/xlabels-geom.d.ts +46 -0
- package/dist/label/xlabels-geom.d.ts.map +1 -0
- package/dist/label/xlabels-intersect.d.ts +79 -0
- package/dist/label/xlabels-intersect.d.ts.map +1 -0
- package/dist/label/xlabels.d.ts +67 -0
- package/dist/label/xlabels.d.ts.map +1 -0
- package/dist/layout/circo/blockpath.d.ts +120 -0
- package/dist/layout/circo/blockpath.d.ts.map +1 -0
- package/dist/layout/circo/blocks.d.ts +135 -0
- package/dist/layout/circo/blocks.d.ts.map +1 -0
- package/dist/layout/circo/blocktree.d.ts +51 -0
- package/dist/layout/circo/blocktree.d.ts.map +1 -0
- package/dist/layout/circo/circular.d.ts +59 -0
- package/dist/layout/circo/circular.d.ts.map +1 -0
- package/dist/layout/circo/index.d.ts +35 -0
- package/dist/layout/circo/index.d.ts.map +1 -0
- package/dist/layout/circo/init.d.ts +50 -0
- package/dist/layout/circo/init.d.ts.map +1 -0
- package/dist/layout/circo/position-helpers.d.ts +33 -0
- package/dist/layout/circo/position-helpers.d.ts.map +1 -0
- package/dist/layout/circo/position.d.ts +66 -0
- package/dist/layout/circo/position.d.ts.map +1 -0
- package/dist/layout/dot/acyclic.d.ts +8 -0
- package/dist/layout/dot/acyclic.d.ts.map +1 -0
- package/dist/layout/dot/aspect.d.ts +17 -0
- package/dist/layout/dot/aspect.d.ts.map +1 -0
- package/dist/layout/dot/classify.d.ts +52 -0
- package/dist/layout/dot/classify.d.ts.map +1 -0
- package/dist/layout/dot/cluster-path.d.ts +38 -0
- package/dist/layout/dot/cluster-path.d.ts.map +1 -0
- package/dist/layout/dot/cluster.d.ts +102 -0
- package/dist/layout/dot/cluster.d.ts.map +1 -0
- package/dist/layout/dot/compound-clip.d.ts +69 -0
- package/dist/layout/dot/compound-clip.d.ts.map +1 -0
- package/dist/layout/dot/compound-geom.d.ts +115 -0
- package/dist/layout/dot/compound-geom.d.ts.map +1 -0
- package/dist/layout/dot/compound.d.ts +56 -0
- package/dist/layout/dot/compound.d.ts.map +1 -0
- package/dist/layout/dot/conc.d.ts +88 -0
- package/dist/layout/dot/conc.d.ts.map +1 -0
- package/dist/layout/dot/decomp.d.ts +66 -0
- package/dist/layout/dot/decomp.d.ts.map +1 -0
- package/dist/layout/dot/edge-order.d.ts +27 -0
- package/dist/layout/dot/edge-order.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-arrow.d.ts +46 -0
- package/dist/layout/dot/edge-route-arrow.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-boxes.d.ts +75 -0
- package/dist/layout/dot/edge-route-boxes.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-chain.d.ts +67 -0
- package/dist/layout/dot/edge-route-chain.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-clip.d.ts +88 -0
- package/dist/layout/dot/edge-route-clip.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-faithful.d.ts +94 -0
- package/dist/layout/dot/edge-route-faithful.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-geom.d.ts +43 -0
- package/dist/layout/dot/edge-route-geom.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-helpers.d.ts +50 -0
- package/dist/layout/dot/edge-route-helpers.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-poly.d.ts +48 -0
- package/dist/layout/dot/edge-route-poly.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-rank.d.ts +57 -0
- package/dist/layout/dot/edge-route-rank.d.ts.map +1 -0
- package/dist/layout/dot/edge-route-routing.d.ts +99 -0
- package/dist/layout/dot/edge-route-routing.d.ts.map +1 -0
- package/dist/layout/dot/edge-route.d.ts +57 -0
- package/dist/layout/dot/edge-route.d.ts.map +1 -0
- package/dist/layout/dot/fastgr.d.ts +147 -0
- package/dist/layout/dot/fastgr.d.ts.map +1 -0
- package/dist/layout/dot/flat-utils.d.ts +21 -0
- package/dist/layout/dot/flat-utils.d.ts.map +1 -0
- package/dist/layout/dot/flat.d.ts +152 -0
- package/dist/layout/dot/flat.d.ts.map +1 -0
- package/dist/layout/dot/graph-label.d.ts +18 -0
- package/dist/layout/dot/graph-label.d.ts.map +1 -0
- package/dist/layout/dot/index.d.ts +128 -0
- package/dist/layout/dot/index.d.ts.map +1 -0
- package/dist/layout/dot/init.d.ts +93 -0
- package/dist/layout/dot/init.d.ts.map +1 -0
- package/dist/layout/dot/label-order.d.ts +45 -0
- package/dist/layout/dot/label-order.d.ts.map +1 -0
- package/dist/layout/dot/mincross-build.d.ts +52 -0
- package/dist/layout/dot/mincross-build.d.ts.map +1 -0
- package/dist/layout/dot/mincross-cross.d.ts +80 -0
- package/dist/layout/dot/mincross-cross.d.ts.map +1 -0
- package/dist/layout/dot/mincross-flat.d.ts +27 -0
- package/dist/layout/dot/mincross-flat.d.ts.map +1 -0
- package/dist/layout/dot/mincross-order.d.ts +89 -0
- package/dist/layout/dot/mincross-order.d.ts.map +1 -0
- package/dist/layout/dot/mincross-utils.d.ts +60 -0
- package/dist/layout/dot/mincross-utils.d.ts.map +1 -0
- package/dist/layout/dot/mincross.d.ts +75 -0
- package/dist/layout/dot/mincross.d.ts.map +1 -0
- package/dist/layout/dot/ns-core.d.ts +37 -0
- package/dist/layout/dot/ns-core.d.ts.map +1 -0
- package/dist/layout/dot/ns-range.d.ts +17 -0
- package/dist/layout/dot/ns-range.d.ts.map +1 -0
- package/dist/layout/dot/ns-subtree.d.ts +78 -0
- package/dist/layout/dot/ns-subtree.d.ts.map +1 -0
- package/dist/layout/dot/ns.d.ts +86 -0
- package/dist/layout/dot/ns.d.ts.map +1 -0
- package/dist/layout/dot/ortho-adapter.d.ts +19 -0
- package/dist/layout/dot/ortho-adapter.d.ts.map +1 -0
- package/dist/layout/dot/pack-components.d.ts +100 -0
- package/dist/layout/dot/pack-components.d.ts.map +1 -0
- package/dist/layout/dot/position-aux.d.ts +110 -0
- package/dist/layout/dot/position-aux.d.ts.map +1 -0
- package/dist/layout/dot/position-bbox.d.ts +57 -0
- package/dist/layout/dot/position-bbox.d.ts.map +1 -0
- package/dist/layout/dot/position-cluster.d.ts +48 -0
- package/dist/layout/dot/position-cluster.d.ts.map +1 -0
- package/dist/layout/dot/position-ycoords.d.ts +42 -0
- package/dist/layout/dot/position-ycoords.d.ts.map +1 -0
- package/dist/layout/dot/position.d.ts +47 -0
- package/dist/layout/dot/position.d.ts.map +1 -0
- package/dist/layout/dot/rank-dot2.d.ts +114 -0
- package/dist/layout/dot/rank-dot2.d.ts.map +1 -0
- package/dist/layout/dot/rank.d.ts +119 -0
- package/dist/layout/dot/rank.d.ts.map +1 -0
- package/dist/layout/dot/sameport.d.ts +70 -0
- package/dist/layout/dot/sameport.d.ts.map +1 -0
- package/dist/layout/dot/self-loop.d.ts +54 -0
- package/dist/layout/dot/self-loop.d.ts.map +1 -0
- package/dist/layout/dot/splines-clone.d.ts +33 -0
- package/dist/layout/dot/splines-clone.d.ts.map +1 -0
- package/dist/layout/dot/splines-flat-labeled.d.ts +101 -0
- package/dist/layout/dot/splines-flat-labeled.d.ts.map +1 -0
- package/dist/layout/dot/splines-flat-multi.d.ts +35 -0
- package/dist/layout/dot/splines-flat-multi.d.ts.map +1 -0
- package/dist/layout/dot/splines-flat.d.ts +116 -0
- package/dist/layout/dot/splines-flat.d.ts.map +1 -0
- package/dist/layout/dot/splines-groups.d.ts +38 -0
- package/dist/layout/dot/splines-groups.d.ts.map +1 -0
- package/dist/layout/dot/splines-label.d.ts +105 -0
- package/dist/layout/dot/splines-label.d.ts.map +1 -0
- package/dist/layout/dot/splines-route-type.d.ts +28 -0
- package/dist/layout/dot/splines-route-type.d.ts.map +1 -0
- package/dist/layout/dot/splines-route.d.ts +99 -0
- package/dist/layout/dot/splines-route.d.ts.map +1 -0
- package/dist/layout/dot/splines.d.ts +157 -0
- package/dist/layout/dot/splines.d.ts.map +1 -0
- package/dist/layout/dot/straight-edges.d.ts +39 -0
- package/dist/layout/dot/straight-edges.d.ts.map +1 -0
- package/dist/layout/fdp/cluster-edges.d.ts +31 -0
- package/dist/layout/fdp/cluster-edges.d.ts.map +1 -0
- package/dist/layout/fdp/comp.d.ts +29 -0
- package/dist/layout/fdp/comp.d.ts.map +1 -0
- package/dist/layout/fdp/derive.d.ts +39 -0
- package/dist/layout/fdp/derive.d.ts.map +1 -0
- package/dist/layout/fdp/fdp-model.d.ts +101 -0
- package/dist/layout/fdp/fdp-model.d.ts.map +1 -0
- package/dist/layout/fdp/grid.d.ts +49 -0
- package/dist/layout/fdp/grid.d.ts.map +1 -0
- package/dist/layout/fdp/index.d.ts +36 -0
- package/dist/layout/fdp/index.d.ts.map +1 -0
- package/dist/layout/fdp/init.d.ts +26 -0
- package/dist/layout/fdp/init.d.ts.map +1 -0
- package/dist/layout/fdp/layout.d.ts +57 -0
- package/dist/layout/fdp/layout.d.ts.map +1 -0
- package/dist/layout/fdp/normalize.d.ts +18 -0
- package/dist/layout/fdp/normalize.d.ts.map +1 -0
- package/dist/layout/fdp/ports.d.ts +41 -0
- package/dist/layout/fdp/ports.d.ts.map +1 -0
- package/dist/layout/fdp/tlayout-init.d.ts +21 -0
- package/dist/layout/fdp/tlayout-init.d.ts.map +1 -0
- package/dist/layout/fdp/tlayout-parms.d.ts +98 -0
- package/dist/layout/fdp/tlayout-parms.d.ts.map +1 -0
- package/dist/layout/fdp/tlayout.d.ts +43 -0
- package/dist/layout/fdp/tlayout.d.ts.map +1 -0
- package/dist/layout/fdp/xlayout.d.ts +26 -0
- package/dist/layout/fdp/xlayout.d.ts.map +1 -0
- package/dist/layout/neato/bfs.d.ts +43 -0
- package/dist/layout/neato/bfs.d.ts.map +1 -0
- package/dist/layout/neato/cdt-surface.d.ts +16 -0
- package/dist/layout/neato/cdt-surface.d.ts.map +1 -0
- package/dist/layout/neato/conjgrad.d.ts +61 -0
- package/dist/layout/neato/conjgrad.d.ts.map +1 -0
- package/dist/layout/neato/delaunay.d.ts +28 -0
- package/dist/layout/neato/delaunay.d.ts.map +1 -0
- package/dist/layout/neato/dijkstra.d.ts +80 -0
- package/dist/layout/neato/dijkstra.d.ts.map +1 -0
- package/dist/layout/neato/fdp-adjust.d.ts +31 -0
- package/dist/layout/neato/fdp-adjust.d.ts.map +1 -0
- package/dist/layout/neato/index.d.ts +58 -0
- package/dist/layout/neato/index.d.ts.map +1 -0
- package/dist/layout/neato/init.d.ts +207 -0
- package/dist/layout/neato/init.d.ts.map +1 -0
- package/dist/layout/neato/legal.d.ts +7 -0
- package/dist/layout/neato/legal.d.ts.map +1 -0
- package/dist/layout/neato/matrix-ops.d.ts +28 -0
- package/dist/layout/neato/matrix-ops.d.ts.map +1 -0
- package/dist/layout/neato/multispline-router.d.ts +80 -0
- package/dist/layout/neato/multispline-router.d.ts.map +1 -0
- package/dist/layout/neato/multispline.d.ts +24 -0
- package/dist/layout/neato/multispline.d.ts.map +1 -0
- package/dist/layout/neato/overlap-prism.d.ts +26 -0
- package/dist/layout/neato/overlap-prism.d.ts.map +1 -0
- package/dist/layout/neato/overlap.d.ts +85 -0
- package/dist/layout/neato/overlap.d.ts.map +1 -0
- package/dist/layout/neato/sc-adjust.d.ts +33 -0
- package/dist/layout/neato/sc-adjust.d.ts.map +1 -0
- package/dist/layout/neato/sep-factor.d.ts +41 -0
- package/dist/layout/neato/sep-factor.d.ts.map +1 -0
- package/dist/layout/neato/set-aspect.d.ts +33 -0
- package/dist/layout/neato/set-aspect.d.ts.map +1 -0
- package/dist/layout/neato/sgd.d.ts +166 -0
- package/dist/layout/neato/sgd.d.ts.map +1 -0
- package/dist/layout/neato/splines.d.ts +153 -0
- package/dist/layout/neato/splines.d.ts.map +1 -0
- package/dist/layout/neato/stress-kernel.d.ts +53 -0
- package/dist/layout/neato/stress-kernel.d.ts.map +1 -0
- package/dist/layout/neato/stress.d.ts +158 -0
- package/dist/layout/neato/stress.d.ts.map +1 -0
- package/dist/layout/osage/index.d.ts +158 -0
- package/dist/layout/osage/index.d.ts.map +1 -0
- package/dist/layout/osage/layout.d.ts +49 -0
- package/dist/layout/osage/layout.d.ts.map +1 -0
- package/dist/layout/osage/types.d.ts +28 -0
- package/dist/layout/osage/types.d.ts.map +1 -0
- package/dist/layout/pack/array-pack.d.ts +114 -0
- package/dist/layout/pack/array-pack.d.ts.map +1 -0
- package/dist/layout/pack/index.d.ts +157 -0
- package/dist/layout/pack/index.d.ts.map +1 -0
- package/dist/layout/pack/poly-pack.d.ts +126 -0
- package/dist/layout/pack/poly-pack.d.ts.map +1 -0
- package/dist/layout/pack/poly-place.d.ts +27 -0
- package/dist/layout/pack/poly-place.d.ts.map +1 -0
- package/dist/layout/pack/spiral-search.d.ts +18 -0
- package/dist/layout/pack/spiral-search.d.ts.map +1 -0
- package/dist/layout/pack/test-helpers.d.ts +7 -0
- package/dist/layout/pack/test-helpers.d.ts.map +1 -0
- package/dist/layout/pack/types.d.ts +74 -0
- package/dist/layout/pack/types.d.ts.map +1 -0
- package/dist/layout/patchwork/index.d.ts +136 -0
- package/dist/layout/patchwork/index.d.ts.map +1 -0
- package/dist/layout/patchwork/tree-map.d.ts +32 -0
- package/dist/layout/patchwork/tree-map.d.ts.map +1 -0
- package/dist/layout/patchwork/tree-node.d.ts +46 -0
- package/dist/layout/patchwork/tree-node.d.ts.map +1 -0
- package/dist/layout/sfdp/index.d.ts +39 -0
- package/dist/layout/sfdp/index.d.ts.map +1 -0
- package/dist/layout/sfdp/init.d.ts +61 -0
- package/dist/layout/sfdp/init.d.ts.map +1 -0
- package/dist/layout/sfdp/multilevel.d.ts +23 -0
- package/dist/layout/sfdp/multilevel.d.ts.map +1 -0
- package/dist/layout/sfdp/quadtree.d.ts +45 -0
- package/dist/layout/sfdp/quadtree.d.ts.map +1 -0
- package/dist/layout/sfdp/sparse-matrix-multiply.d.ts +34 -0
- package/dist/layout/sfdp/sparse-matrix-multiply.d.ts.map +1 -0
- package/dist/layout/sfdp/sparse-matrix.d.ts +101 -0
- package/dist/layout/sfdp/sparse-matrix.d.ts.map +1 -0
- package/dist/layout/sfdp/sparse-solve.d.ts +14 -0
- package/dist/layout/sfdp/sparse-solve.d.ts.map +1 -0
- package/dist/layout/sfdp/spring-driver.d.ts +18 -0
- package/dist/layout/sfdp/spring-driver.d.ts.map +1 -0
- package/dist/layout/sfdp/spring-electrical.d.ts +61 -0
- package/dist/layout/sfdp/spring-electrical.d.ts.map +1 -0
- package/dist/layout/twopi/circle.d.ts +83 -0
- package/dist/layout/twopi/circle.d.ts.map +1 -0
- package/dist/layout/twopi/index.d.ts +24 -0
- package/dist/layout/twopi/index.d.ts.map +1 -0
- package/dist/layout/twopi/init.d.ts +85 -0
- package/dist/layout/twopi/init.d.ts.map +1 -0
- package/dist/layout/twopi/pipeline.d.ts +37 -0
- package/dist/layout/twopi/pipeline.d.ts.map +1 -0
- package/dist/layout/twopi/twopi-test-helpers.d.ts +12 -0
- package/dist/layout/twopi/twopi-test-helpers.d.ts.map +1 -0
- package/dist/model/algData.d.ts +175 -0
- package/dist/model/algData.d.ts.map +1 -0
- package/dist/model/cgraph-ops.d.ts +86 -0
- package/dist/model/cgraph-ops.d.ts.map +1 -0
- package/dist/model/edge.d.ts +80 -0
- package/dist/model/edge.d.ts.map +1 -0
- package/dist/model/edgeInfo.d.ts +299 -0
- package/dist/model/edgeInfo.d.ts.map +1 -0
- package/dist/model/geom.d.ts +149 -0
- package/dist/model/geom.d.ts.map +1 -0
- package/dist/model/graph.d.ts +135 -0
- package/dist/model/graph.d.ts.map +1 -0
- package/dist/model/graphInfo.d.ts +418 -0
- package/dist/model/graphInfo.d.ts.map +1 -0
- package/dist/model/index.d.ts +10 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/layoutParams.d.ts +85 -0
- package/dist/model/layoutParams.d.ts.map +1 -0
- package/dist/model/node.d.ts +101 -0
- package/dist/model/node.d.ts.map +1 -0
- package/dist/model/nodeInfo.d.ts +278 -0
- package/dist/model/nodeInfo.d.ts.map +1 -0
- package/dist/model/rankEntry.d.ts +80 -0
- package/dist/model/rankEntry.d.ts.map +1 -0
- package/dist/ortho/chan-dict.d.ts +82 -0
- package/dist/ortho/chan-dict.d.ts.map +1 -0
- package/dist/ortho/fpq.d.ts +54 -0
- package/dist/ortho/fpq.d.ts.map +1 -0
- package/dist/ortho/index.d.ts +35 -0
- package/dist/ortho/index.d.ts.map +1 -0
- package/dist/ortho/maze-channels.d.ts +47 -0
- package/dist/ortho/maze-channels.d.ts.map +1 -0
- package/dist/ortho/maze.d.ts +27 -0
- package/dist/ortho/maze.d.ts.map +1 -0
- package/dist/ortho/ortho-parallel.d.ts +26 -0
- package/dist/ortho/ortho-parallel.d.ts.map +1 -0
- package/dist/ortho/ortho-route.d.ts +31 -0
- package/dist/ortho/ortho-route.d.ts.map +1 -0
- package/dist/ortho/partition.d.ts +34 -0
- package/dist/ortho/partition.d.ts.map +1 -0
- package/dist/ortho/rawgraph.d.ts +41 -0
- package/dist/ortho/rawgraph.d.ts.map +1 -0
- package/dist/ortho/sgraph.d.ts +74 -0
- package/dist/ortho/sgraph.d.ts.map +1 -0
- package/dist/ortho/trap-query.d.ts +32 -0
- package/dist/ortho/trap-query.d.ts.map +1 -0
- package/dist/ortho/trap-segment.d.ts +23 -0
- package/dist/ortho/trap-segment.d.ts.map +1 -0
- package/dist/ortho/trap-types.d.ts +91 -0
- package/dist/ortho/trap-types.d.ts.map +1 -0
- package/dist/ortho/trap-update.d.ts +12 -0
- package/dist/ortho/trap-update.d.ts.map +1 -0
- package/dist/ortho/trapezoid.d.ts +18 -0
- package/dist/ortho/trapezoid.d.ts.map +1 -0
- package/dist/ortho/types.d.ts +241 -0
- package/dist/ortho/types.d.ts.map +1 -0
- package/dist/parser/ast.d.ts +49 -0
- package/dist/parser/ast.d.ts.map +1 -0
- package/dist/parser/builder.d.ts +75 -0
- package/dist/parser/builder.d.ts.map +1 -0
- package/dist/parser/index.d.ts +97 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/pathplan/index.d.ts +8 -0
- package/dist/pathplan/index.d.ts.map +1 -0
- package/dist/pathplan/route.d.ts +9 -0
- package/dist/pathplan/route.d.ts.map +1 -0
- package/dist/pathplan/shortest.d.ts +5 -0
- package/dist/pathplan/shortest.d.ts.map +1 -0
- package/dist/pathplan/solvers.d.ts +5 -0
- package/dist/pathplan/solvers.d.ts.map +1 -0
- package/dist/pathplan/triang.d.ts +25 -0
- package/dist/pathplan/triang.d.ts.map +1 -0
- package/dist/pathplan/types.d.ts +22 -0
- package/dist/pathplan/types.d.ts.map +1 -0
- package/dist/pathplan/visibility.d.ts +13 -0
- package/dist/pathplan/visibility.d.ts.map +1 -0
- package/dist/pathplan/vispath.d.ts +9 -0
- package/dist/pathplan/vispath.d.ts.map +1 -0
- package/dist/rbtree/index.d.ts +127 -0
- package/dist/rbtree/index.d.ts.map +1 -0
- package/dist/render/color-resolve.d.ts +38 -0
- package/dist/render/color-resolve.d.ts.map +1 -0
- package/dist/render/dot.d.ts +379 -0
- package/dist/render/dot.d.ts.map +1 -0
- package/dist/render/index.d.ts +24 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/json.d.ts +89 -0
- package/dist/render/json.d.ts.map +1 -0
- package/dist/render/map-test-helpers.d.ts +13 -0
- package/dist/render/map-test-helpers.d.ts.map +1 -0
- package/dist/render/map.d.ts +197 -0
- package/dist/render/map.d.ts.map +1 -0
- package/dist/render/public.d.ts +64 -0
- package/dist/render/public.d.ts.map +1 -0
- package/dist/render/svg-arrow-ops.d.ts +10 -0
- package/dist/render/svg-arrow-ops.d.ts.map +1 -0
- package/dist/render/svg-cluster.d.ts +9 -0
- package/dist/render/svg-cluster.d.ts.map +1 -0
- package/dist/render/svg-edge-ortho-radius.d.ts +31 -0
- package/dist/render/svg-edge-ortho-radius.d.ts.map +1 -0
- package/dist/render/svg-edge-split.d.ts +48 -0
- package/dist/render/svg-edge-split.d.ts.map +1 -0
- package/dist/render/svg-gradient.d.ts +46 -0
- package/dist/render/svg-gradient.d.ts.map +1 -0
- package/dist/render/svg-graph.d.ts +97 -0
- package/dist/render/svg-graph.d.ts.map +1 -0
- package/dist/render/svg-helpers.d.ts +122 -0
- package/dist/render/svg-helpers.d.ts.map +1 -0
- package/dist/render/svg-id.d.ts +28 -0
- package/dist/render/svg-id.d.ts.map +1 -0
- package/dist/render/svg-multicolor.d.ts +60 -0
- package/dist/render/svg-multicolor.d.ts.map +1 -0
- package/dist/render/svg-parallel-edge.d.ts +28 -0
- package/dist/render/svg-parallel-edge.d.ts.map +1 -0
- package/dist/render/svg-tapered-edge.d.ts +18 -0
- package/dist/render/svg-tapered-edge.d.ts.map +1 -0
- package/dist/render/svg.d.ts +104 -0
- package/dist/render/svg.d.ts.map +1 -0
- package/dist/render/xdot-public.d.ts +95 -0
- package/dist/render/xdot-public.d.ts.map +1 -0
- package/dist/render/xml-escape.d.ts +21 -0
- package/dist/render/xml-escape.d.ts.map +1 -0
- package/dist/render.js +52556 -0
- package/dist/render.js.map +7 -0
- package/dist/util/agxbuf.d.ts +72 -0
- package/dist/util/agxbuf.d.ts.map +1 -0
- package/dist/util/bsd-qsort.d.ts +22 -0
- package/dist/util/bsd-qsort.d.ts.map +1 -0
- package/dist/util/index.d.ts +11 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/list.d.ts +47 -0
- package/dist/util/list.d.ts.map +1 -0
- package/dist/util/math.d.ts +54 -0
- package/dist/util/math.d.ts.map +1 -0
- package/dist/util/mt19937.d.ts +40 -0
- package/dist/util/mt19937.d.ts.map +1 -0
- package/dist/util/printf-round.d.ts +45 -0
- package/dist/util/printf-round.d.ts.map +1 -0
- package/dist/util/xml.d.ts +24 -0
- package/dist/util/xml.d.ts.map +1 -0
- package/dist/vpsc/Block.d.ts +116 -0
- package/dist/vpsc/Block.d.ts.map +1 -0
- package/dist/vpsc/Blocks.d.ts +66 -0
- package/dist/vpsc/Blocks.d.ts.map +1 -0
- package/dist/vpsc/Constraint.d.ts +51 -0
- package/dist/vpsc/Constraint.d.ts.map +1 -0
- package/dist/vpsc/HeapUtils.d.ts +37 -0
- package/dist/vpsc/HeapUtils.d.ts.map +1 -0
- package/dist/vpsc/Solver.d.ts +107 -0
- package/dist/vpsc/Solver.d.ts.map +1 -0
- package/dist/vpsc/SweepLine.d.ts +38 -0
- package/dist/vpsc/SweepLine.d.ts.map +1 -0
- package/dist/vpsc/Variable.d.ts +38 -0
- package/dist/vpsc/Variable.d.ts.map +1 -0
- package/dist/vpsc/index.d.ts +54 -0
- package/dist/vpsc/index.d.ts.map +1 -0
- package/dist/vpsc/sweepTypes.d.ts +29 -0
- package/dist/vpsc/sweepTypes.d.ts.map +1 -0
- package/dist/xdot/index.d.ts +6 -0
- package/dist/xdot/index.d.ts.map +1 -0
- package/dist/xdot/lex.d.ts +22 -0
- package/dist/xdot/lex.d.ts.map +1 -0
- package/dist/xdot/misc.d.ts +13 -0
- package/dist/xdot/misc.d.ts.map +1 -0
- package/dist/xdot/parse.d.ts +21 -0
- package/dist/xdot/parse.d.ts.map +1 -0
- package/dist/xdot/types.d.ts +152 -0
- package/dist/xdot/types.d.ts.map +1 -0
- package/package.json +113 -0
- package/src/api/builder.ts +277 -0
- package/src/api/edge-ops.ts +113 -0
- package/src/api/geometry.ts +307 -0
- package/src/api/index.ts +46 -0
- package/src/cdt/bag.ts +196 -0
- package/src/cdt/hash-core.ts +84 -0
- package/src/cdt/hash.ts +207 -0
- package/src/cdt/index.ts +17 -0
- package/src/cdt/splay-core.ts +301 -0
- package/src/cdt/splay.ts +191 -0
- package/src/cdt/strhash.ts +52 -0
- package/src/cdt/types.ts +13 -0
- package/src/common/arith.ts +39 -0
- package/src/common/arm-pow-data.ts +201 -0
- package/src/common/arm-pow.ts +296 -0
- package/src/common/arrows-constants.ts +175 -0
- package/src/common/arrows-geometry.ts +62 -0
- package/src/common/arrows-miter.ts +84 -0
- package/src/common/arrows-shapes-poly.ts +241 -0
- package/src/common/arrows-shapes-util.ts +162 -0
- package/src/common/arrows-shapes.ts +360 -0
- package/src/common/arrows-types.ts +59 -0
- package/src/common/arrows.ts +209 -0
- package/src/common/color.ts +340 -0
- package/src/common/colorData.ts +264 -0
- package/src/common/compass-port.ts +384 -0
- package/src/common/crand.ts +79 -0
- package/src/common/edge-label-init.ts +310 -0
- package/src/common/edge-offset.ts +140 -0
- package/src/common/ellipse-wedge.ts +189 -0
- package/src/common/emit-types.ts +332 -0
- package/src/common/fma.ts +52 -0
- package/src/common/graph-init.ts +359 -0
- package/src/common/html-entities.ts +299 -0
- package/src/common/html-string.ts +22 -0
- package/src/common/htmltable-emit-fill.ts +367 -0
- package/src/common/htmltable-emit-rules.ts +293 -0
- package/src/common/htmltable-emit.ts +345 -0
- package/src/common/htmltable-lex.ts +138 -0
- package/src/common/htmltable-parse.ts +539 -0
- package/src/common/htmltable-port.ts +32 -0
- package/src/common/htmltable-pos-runs.ts +313 -0
- package/src/common/htmltable-pos.ts +601 -0
- package/src/common/htmltable-types.ts +262 -0
- package/src/common/htmltable.ts +477 -0
- package/src/common/layers.ts +113 -0
- package/src/common/make-label.ts +192 -0
- package/src/common/multicolor.ts +167 -0
- package/src/common/nodeinit.ts +339 -0
- package/src/common/poly-gencode.ts +475 -0
- package/src/common/poly-init.ts +133 -0
- package/src/common/poly-inside.ts +202 -0
- package/src/common/poly-shapes-cases.ts +253 -0
- package/src/common/poly-shapes-cases2.ts +170 -0
- package/src/common/poly-shapes-util.ts +124 -0
- package/src/common/poly-shapes.ts +181 -0
- package/src/common/poly-sizing.ts +639 -0
- package/src/common/poly-vertices.ts +237 -0
- package/src/common/postproc.ts +436 -0
- package/src/common/ps-fontalias.ts +112 -0
- package/src/common/random.ts +37 -0
- package/src/common/record-port.ts +89 -0
- package/src/common/record.ts +523 -0
- package/src/common/shapeData.ts +502 -0
- package/src/common/shapes.ts +187 -0
- package/src/common/spline-midpoint.ts +105 -0
- package/src/common/splines-clip.ts +449 -0
- package/src/common/splines-constants.ts +53 -0
- package/src/common/splines-geom.ts +194 -0
- package/src/common/splines-path-begin.ts +243 -0
- package/src/common/splines-path-end.ts +231 -0
- package/src/common/splines-path-shared.ts +258 -0
- package/src/common/splines-routespl.ts +444 -0
- package/src/common/splines-selfedge.ts +403 -0
- package/src/common/splines.ts +33 -0
- package/src/common/style-resolve.ts +481 -0
- package/src/common/subst.ts +126 -0
- package/src/common/taper.ts +219 -0
- package/src/common/textmeasure-factory.ts +86 -0
- package/src/common/textmeasure-lookup.ts +50 -0
- package/src/common/textmeasure-lut-data-a.ts +182 -0
- package/src/common/textmeasure-lut-data-b.ts +140 -0
- package/src/common/textmeasure-lut-data-c.ts +221 -0
- package/src/common/textmeasure-lut-data.ts +78 -0
- package/src/common/textmeasure.ts +321 -0
- package/src/common/types.ts +425 -0
- package/src/common/xlabels-place.ts +475 -0
- package/src/debug.ts +38 -0
- package/src/errors.ts +95 -0
- package/src/gvc/anchor.ts +530 -0
- package/src/gvc/context.ts +260 -0
- package/src/gvc/default-context.ts +70 -0
- package/src/gvc/device-cluster.ts +114 -0
- package/src/gvc/device.ts +598 -0
- package/src/gvc/edge-labels.ts +116 -0
- package/src/gvc/emit-walk.ts +98 -0
- package/src/gvc/image-resolver.ts +137 -0
- package/src/gvc/job.ts +401 -0
- package/src/gvc/textlayout.ts +44 -0
- package/src/gvc/textspan-emit.ts +100 -0
- package/src/gvc/usershape.ts +33 -0
- package/src/gvc/viewport.ts +203 -0
- package/src/index.ts +165 -0
- package/src/label/index.ts +302 -0
- package/src/label/node.ts +278 -0
- package/src/label/rectangle.ts +123 -0
- package/src/label/split-q.ts +237 -0
- package/src/label/xlabels-geom.ts +132 -0
- package/src/label/xlabels-intersect.ts +421 -0
- package/src/label/xlabels.ts +212 -0
- package/src/layout/circo/blockpath.ts +560 -0
- package/src/layout/circo/blocks.ts +234 -0
- package/src/layout/circo/blocktree.ts +246 -0
- package/src/layout/circo/circular.ts +227 -0
- package/src/layout/circo/index.ts +90 -0
- package/src/layout/circo/init.ts +84 -0
- package/src/layout/circo/position-helpers.ts +104 -0
- package/src/layout/circo/position.ts +196 -0
- package/src/layout/dot/__fixtures__/xcoord-pivot-divergence.gv +79 -0
- package/src/layout/dot/acyclic.ts +60 -0
- package/src/layout/dot/aspect.ts +22 -0
- package/src/layout/dot/classify.ts +462 -0
- package/src/layout/dot/cluster-path.ts +200 -0
- package/src/layout/dot/cluster.ts +480 -0
- package/src/layout/dot/compound-clip.ts +224 -0
- package/src/layout/dot/compound-geom.ts +282 -0
- package/src/layout/dot/compound.ts +294 -0
- package/src/layout/dot/conc.ts +433 -0
- package/src/layout/dot/decomp.ts +165 -0
- package/src/layout/dot/edge-order.ts +62 -0
- package/src/layout/dot/edge-route-arrow.ts +87 -0
- package/src/layout/dot/edge-route-boxes.ts +99 -0
- package/src/layout/dot/edge-route-chain.ts +420 -0
- package/src/layout/dot/edge-route-clip.ts +253 -0
- package/src/layout/dot/edge-route-faithful.ts +404 -0
- package/src/layout/dot/edge-route-geom.ts +90 -0
- package/src/layout/dot/edge-route-helpers.ts +170 -0
- package/src/layout/dot/edge-route-poly.ts +174 -0
- package/src/layout/dot/edge-route-rank.ts +136 -0
- package/src/layout/dot/edge-route-routing.ts +219 -0
- package/src/layout/dot/edge-route.ts +490 -0
- package/src/layout/dot/fastgr.ts +377 -0
- package/src/layout/dot/flat-utils.ts +52 -0
- package/src/layout/dot/flat.ts +518 -0
- package/src/layout/dot/graph-label.ts +114 -0
- package/src/layout/dot/index.ts +302 -0
- package/src/layout/dot/init.ts +300 -0
- package/src/layout/dot/label-order.ts +161 -0
- package/src/layout/dot/mincross-build.ts +373 -0
- package/src/layout/dot/mincross-cross.ts +409 -0
- package/src/layout/dot/mincross-flat.ts +213 -0
- package/src/layout/dot/mincross-order.ts +401 -0
- package/src/layout/dot/mincross-utils.ts +170 -0
- package/src/layout/dot/mincross.ts +386 -0
- package/src/layout/dot/ns-core.ts +122 -0
- package/src/layout/dot/ns-range.ts +228 -0
- package/src/layout/dot/ns-subtree.ts +347 -0
- package/src/layout/dot/ns.ts +506 -0
- package/src/layout/dot/ortho-adapter.ts +133 -0
- package/src/layout/dot/pack-components.ts +433 -0
- package/src/layout/dot/position-aux.ts +382 -0
- package/src/layout/dot/position-bbox.ts +221 -0
- package/src/layout/dot/position-cluster.ts +286 -0
- package/src/layout/dot/position-ycoords.ts +287 -0
- package/src/layout/dot/position.ts +194 -0
- package/src/layout/dot/rank-dot2.ts +528 -0
- package/src/layout/dot/rank.ts +547 -0
- package/src/layout/dot/sameport.ts +278 -0
- package/src/layout/dot/self-loop.ts +147 -0
- package/src/layout/dot/splines-clone.ts +121 -0
- package/src/layout/dot/splines-flat-labeled.ts +408 -0
- package/src/layout/dot/splines-flat-multi.ts +188 -0
- package/src/layout/dot/splines-flat.ts +598 -0
- package/src/layout/dot/splines-groups.ts +190 -0
- package/src/layout/dot/splines-label.ts +432 -0
- package/src/layout/dot/splines-route-type.ts +44 -0
- package/src/layout/dot/splines-route.ts +478 -0
- package/src/layout/dot/splines.ts +538 -0
- package/src/layout/dot/straight-edges.ts +332 -0
- package/src/layout/fdp/cluster-edges.ts +0 -0
- package/src/layout/fdp/comp.ts +160 -0
- package/src/layout/fdp/derive.ts +272 -0
- package/src/layout/fdp/fdp-model.ts +238 -0
- package/src/layout/fdp/grid.ts +77 -0
- package/src/layout/fdp/index.ts +113 -0
- package/src/layout/fdp/init.ts +116 -0
- package/src/layout/fdp/layout.ts +485 -0
- package/src/layout/fdp/normalize.ts +100 -0
- package/src/layout/fdp/ports.ts +161 -0
- package/src/layout/fdp/tlayout-init.ts +230 -0
- package/src/layout/fdp/tlayout-parms.ts +234 -0
- package/src/layout/fdp/tlayout.ts +317 -0
- package/src/layout/fdp/xlayout.ts +350 -0
- package/src/layout/neato/bfs.ts +131 -0
- package/src/layout/neato/cdt-surface.ts +693 -0
- package/src/layout/neato/conjgrad.ts +159 -0
- package/src/layout/neato/delaunay.ts +259 -0
- package/src/layout/neato/dijkstra.ts +296 -0
- package/src/layout/neato/fdp-adjust.ts +124 -0
- package/src/layout/neato/index.ts +310 -0
- package/src/layout/neato/init.ts +505 -0
- package/src/layout/neato/legal.ts +316 -0
- package/src/layout/neato/matrix-ops.ts +112 -0
- package/src/layout/neato/multispline-router.ts +417 -0
- package/src/layout/neato/multispline.ts +427 -0
- package/src/layout/neato/overlap-prism.ts +503 -0
- package/src/layout/neato/overlap.ts +158 -0
- package/src/layout/neato/sc-adjust.ts +206 -0
- package/src/layout/neato/sep-factor.ts +118 -0
- package/src/layout/neato/set-aspect.ts +178 -0
- package/src/layout/neato/sgd.ts +461 -0
- package/src/layout/neato/splines.ts +1014 -0
- package/src/layout/neato/stress-kernel.ts +362 -0
- package/src/layout/neato/stress.ts +420 -0
- package/src/layout/osage/index.ts +548 -0
- package/src/layout/osage/layout.ts +254 -0
- package/src/layout/osage/types.ts +31 -0
- package/src/layout/pack/array-pack.ts +254 -0
- package/src/layout/pack/index.ts +570 -0
- package/src/layout/pack/poly-pack.ts +266 -0
- package/src/layout/pack/poly-place.ts +426 -0
- package/src/layout/pack/spiral-search.ts +106 -0
- package/src/layout/pack/test-helpers.ts +46 -0
- package/src/layout/pack/types.ts +85 -0
- package/src/layout/patchwork/index.ts +441 -0
- package/src/layout/patchwork/tree-map.ts +183 -0
- package/src/layout/patchwork/tree-node.ts +120 -0
- package/src/layout/sfdp/index.ts +231 -0
- package/src/layout/sfdp/init.ts +224 -0
- package/src/layout/sfdp/multilevel.ts +262 -0
- package/src/layout/sfdp/quadtree.ts +267 -0
- package/src/layout/sfdp/sparse-matrix-multiply.ts +160 -0
- package/src/layout/sfdp/sparse-matrix.ts +367 -0
- package/src/layout/sfdp/sparse-solve.ts +122 -0
- package/src/layout/sfdp/spring-driver.ts +209 -0
- package/src/layout/sfdp/spring-electrical.ts +431 -0
- package/src/layout/twopi/circle.ts +339 -0
- package/src/layout/twopi/index.ts +78 -0
- package/src/layout/twopi/init.ts +174 -0
- package/src/layout/twopi/pipeline.ts +98 -0
- package/src/layout/twopi/twopi-test-helpers.ts +44 -0
- package/src/model/algData.ts +194 -0
- package/src/model/cgraph-ops.ts +175 -0
- package/src/model/edge.ts +104 -0
- package/src/model/edgeInfo.ts +431 -0
- package/src/model/geom.ts +204 -0
- package/src/model/graph.ts +172 -0
- package/src/model/graphInfo.ts +528 -0
- package/src/model/index.ts +10 -0
- package/src/model/layoutParams.ts +127 -0
- package/src/model/node.ts +138 -0
- package/src/model/nodeInfo.ts +424 -0
- package/src/model/rankEntry.ts +95 -0
- package/src/ortho/chan-dict.ts +236 -0
- package/src/ortho/fpq.ts +149 -0
- package/src/ortho/index.ts +206 -0
- package/src/ortho/maze-channels.ts +196 -0
- package/src/ortho/maze.ts +311 -0
- package/src/ortho/ortho-parallel.ts +254 -0
- package/src/ortho/ortho-route.ts +349 -0
- package/src/ortho/partition.ts +303 -0
- package/src/ortho/rawgraph.ts +119 -0
- package/src/ortho/sgraph.ts +283 -0
- package/src/ortho/trap-query.ts +174 -0
- package/src/ortho/trap-segment.ts +303 -0
- package/src/ortho/trap-types.ts +171 -0
- package/src/ortho/trap-update.ts +89 -0
- package/src/ortho/trapezoid.ts +120 -0
- package/src/ortho/types.ts +286 -0
- package/src/parser/__fixtures__/directed.dot +10 -0
- package/src/parser/__fixtures__/simple.dot +7 -0
- package/src/parser/__fixtures__/subgraph.dot +17 -0
- package/src/parser/ast.ts +64 -0
- package/src/parser/builder.ts +401 -0
- package/src/parser/dot.d.ts +208 -0
- package/src/parser/dot.js +3321 -0
- package/src/parser/dot.pegjs +263 -0
- package/src/parser/index.ts +353 -0
- package/src/pathplan/index.ts +9 -0
- package/src/pathplan/route.ts +284 -0
- package/src/pathplan/shortest.ts +268 -0
- package/src/pathplan/solvers.ts +65 -0
- package/src/pathplan/triang.ts +221 -0
- package/src/pathplan/types.ts +16 -0
- package/src/pathplan/visibility.ts +170 -0
- package/src/pathplan/vispath.ts +118 -0
- package/src/rbtree/index.ts +418 -0
- package/src/render/color-resolve.ts +171 -0
- package/src/render/dot.ts +1514 -0
- package/src/render/index.ts +29 -0
- package/src/render/json.ts +734 -0
- package/src/render/map-test-helpers.ts +61 -0
- package/src/render/map.ts +528 -0
- package/src/render/public.ts +131 -0
- package/src/render/svg-arrow-ops.ts +113 -0
- package/src/render/svg-cluster.ts +24 -0
- package/src/render/svg-edge-ortho-radius.ts +228 -0
- package/src/render/svg-edge-split.ts +180 -0
- package/src/render/svg-gradient.ts +185 -0
- package/src/render/svg-graph.ts +415 -0
- package/src/render/svg-helpers.ts +623 -0
- package/src/render/svg-id.ts +76 -0
- package/src/render/svg-multicolor.ts +313 -0
- package/src/render/svg-parallel-edge.ts +123 -0
- package/src/render/svg-tapered-edge.ts +56 -0
- package/src/render/svg.ts +307 -0
- package/src/render/xdot-public.ts +164 -0
- package/src/render/xml-escape.ts +56 -0
- package/src/util/agxbuf.ts +138 -0
- package/src/util/bsd-qsort.ts +251 -0
- package/src/util/index.ts +25 -0
- package/src/util/list.ts +122 -0
- package/src/util/math.ts +104 -0
- package/src/util/mt19937.ts +143 -0
- package/src/util/printf-round.ts +163 -0
- package/src/util/xml.ts +184 -0
- package/src/vpsc/Block.ts +375 -0
- package/src/vpsc/Blocks.ts +164 -0
- package/src/vpsc/Constraint.ts +94 -0
- package/src/vpsc/HeapUtils.ts +88 -0
- package/src/vpsc/Solver.ts +274 -0
- package/src/vpsc/SweepLine.ts +214 -0
- package/src/vpsc/Variable.ts +54 -0
- package/src/vpsc/index.ts +122 -0
- package/src/vpsc/sweepTypes.ts +31 -0
- package/src/xdot/index.ts +7 -0
- package/src/xdot/lex.ts +151 -0
- package/src/xdot/misc.ts +226 -0
- package/src/xdot/parse.ts +349 -0
- package/src/xdot/types.ts +158 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Converts a parsed DOT AST into the Graph model.
|
|
5
|
+
*
|
|
6
|
+
* @see lib/cgraph/grammar.y
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { Graph, type GraphKind } from '../model/graph.js';
|
|
10
|
+
import { Node } from '../model/node.js';
|
|
11
|
+
import { Edge } from '../model/edge.js';
|
|
12
|
+
import { assignSubgSeq } from '../model/cgraph-ops.js';
|
|
13
|
+
import type {
|
|
14
|
+
AttrPair,
|
|
15
|
+
NodeId,
|
|
16
|
+
NodeStmt,
|
|
17
|
+
EdgeStmt,
|
|
18
|
+
AttrStmt,
|
|
19
|
+
AssignStmt,
|
|
20
|
+
SubgraphStmt,
|
|
21
|
+
ParsedStmt,
|
|
22
|
+
ParsedGraph,
|
|
23
|
+
} from './ast.js';
|
|
24
|
+
|
|
25
|
+
// ── Attribute helpers ─────────────────────────────────────────────────────────
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Normalise an attribute value. HTML strings arrive from the grammar
|
|
29
|
+
* already prefixed with the HTML marker (cgraph's aghtmlstr flag).
|
|
30
|
+
*/
|
|
31
|
+
export function normaliseAttrValue(value: string): string {
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function applyAttrs(
|
|
36
|
+
pairs: AttrPair[],
|
|
37
|
+
target: Map<string, string>,
|
|
38
|
+
): void {
|
|
39
|
+
for (const { key, value } of pairs) {
|
|
40
|
+
target.set(key, normaliseAttrValue(value));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The port string a NodeId endpoint contributes to the edge's
|
|
46
|
+
* tailport/headport attr: "port" or "port:compass". Subgraph endpoints and
|
|
47
|
+
* port-less nodes contribute nothing. Mirrors C's mkport writing the
|
|
48
|
+
* tailport/headport attr from `A:port:compass` DOT syntax.
|
|
49
|
+
* @see lib/cgraph/grammar.y:396 (mkport)
|
|
50
|
+
*/
|
|
51
|
+
function portStringOf(item: NodeId | SubgraphStmt): string {
|
|
52
|
+
if ('type' in item && item.type === 'subgraph') return '';
|
|
53
|
+
const ni = item as NodeId;
|
|
54
|
+
if (ni.port === null || ni.port === '') return '';
|
|
55
|
+
return ni.compass ? ni.port + ':' + ni.compass : ni.port;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ── Node registry ─────────────────────────────────────────────────────────────
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Collect the node-attribute defaults in effect at `scope`: walk scope -> root,
|
|
62
|
+
* inner overriding outer (first-found wins). Returns a fresh map so later
|
|
63
|
+
* node[...] statements that mutate a graph's nodeDefaults do not change an
|
|
64
|
+
* already-created node's snapshot.
|
|
65
|
+
*/
|
|
66
|
+
function effectiveNodeDefaults(scope: Graph): Map<string, string> {
|
|
67
|
+
const eff = new Map<string, string>();
|
|
68
|
+
for (let g: Graph | null = scope; g !== null; g = g.parent) {
|
|
69
|
+
for (const [k, v] of g.nodeDefaults) {
|
|
70
|
+
if (!eff.has(k)) eff.set(k, v);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return eff;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Graph-attr keys do_graph_label inherits; seeded into subgraph attrs so the
|
|
77
|
+
* inherited value survives the layout's cluster rebuilds (which copy attrs but
|
|
78
|
+
* not the snapshot). `labelloc`/`labeljust` drive cluster label position and
|
|
79
|
+
* inherit via C `agget` just like label/font — @see input.c:858-877. */
|
|
80
|
+
const GRAPH_LABEL_INHERIT_KEYS = ['label', 'fontname', 'fontsize', 'fontcolor', 'labelloc', 'labeljust'] as const;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Collect the graph-attribute defaults in effect at `scope`: walk scope -> root,
|
|
84
|
+
* inner overriding outer (first-found wins), reading each graph's own `attrs`.
|
|
85
|
+
* Snapshotted when a subgraph opens so an ancestor attribute set LATER in
|
|
86
|
+
* statement order does not retroactively apply (DOT's order-sensitive defaults).
|
|
87
|
+
*/
|
|
88
|
+
function effectiveGraphDefaults(scope: Graph): Map<string, string> {
|
|
89
|
+
const eff = new Map<string, string>();
|
|
90
|
+
for (let g: Graph | null = scope; g !== null; g = g.parent) {
|
|
91
|
+
for (const [k, v] of g.attrs) {
|
|
92
|
+
if (!eff.has(k)) eff.set(k, v);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return eff;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Manages the per-parse node ID counter and node creation. */
|
|
99
|
+
export class NodeRegistry {
|
|
100
|
+
private nextId = 0;
|
|
101
|
+
|
|
102
|
+
reset(): void {
|
|
103
|
+
this.nextId = 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
ensure(name: string, root: Graph, scope: Graph = root): Node {
|
|
107
|
+
const existing = root.nodes.get(name);
|
|
108
|
+
if (existing !== undefined) return existing;
|
|
109
|
+
const node = new Node(this.nextId++, name, root);
|
|
110
|
+
// Snapshot the node-attribute defaults active in this scope at creation, in
|
|
111
|
+
// statement order — a node[...] declared later does not apply to this node.
|
|
112
|
+
// @see nodeAttr (poly-init), snapshotEdgeDefaults (edges do the same).
|
|
113
|
+
node.nodeDefaultsSnapshot = effectiveNodeDefaults(scope);
|
|
114
|
+
root.nodes.set(name, node);
|
|
115
|
+
return node;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ── Endpoint / name collection ────────────────────────────────────────────────
|
|
120
|
+
|
|
121
|
+
/** Collects node names from AST statement lists (for edge endpoint expansion). */
|
|
122
|
+
export class NameCollector {
|
|
123
|
+
static fromStmts(stmts: ParsedStmt[]): string[] {
|
|
124
|
+
const out: string[] = [];
|
|
125
|
+
for (const s of stmts) NameCollector.fromStmt(s, out);
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static fromStmt(stmt: ParsedStmt, out: string[]): void {
|
|
130
|
+
if (stmt.type === 'node') {
|
|
131
|
+
out.push(stmt.id.id);
|
|
132
|
+
} else if (stmt.type === 'edge') {
|
|
133
|
+
for (const item of stmt.nodes) NameCollector.fromEndpoint(item, out);
|
|
134
|
+
} else if (stmt.type === 'subgraph') {
|
|
135
|
+
out.push(...NameCollector.fromStmts(stmt.stmts));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
static fromEndpoint(item: NodeId | SubgraphStmt, out: string[]): void {
|
|
140
|
+
if ('type' in item && item.type === 'subgraph') {
|
|
141
|
+
out.push(...NameCollector.fromStmts(item.stmts));
|
|
142
|
+
} else {
|
|
143
|
+
out.push((item as NodeId).id);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// ── Statement processors ──────────────────────────────────────────────────────
|
|
149
|
+
|
|
150
|
+
/** Processes individual parsed statements into graph model objects. */
|
|
151
|
+
export class StmtProcessor {
|
|
152
|
+
/**
|
|
153
|
+
* cgraph's anonymous-object id counter, shared across the whole parse. Every
|
|
154
|
+
* anonymous object — the unnamed root graph, each anonymous subgraph, and each
|
|
155
|
+
* keyless edge — consumes `id = 2*counter+1` in creation order and advances
|
|
156
|
+
* the counter; named objects (named graphs/subgraphs/nodes, keyed edges) get
|
|
157
|
+
* pointer-based even ids and do NOT advance it. The id is only materialized as
|
|
158
|
+
* a `%N` name for subgraphs (the sole anon objects that surface a `<title>` in
|
|
159
|
+
* SVG); edges and the root advance the counter silently so siblings get
|
|
160
|
+
* cgraph's exact numbering (e.g. 2475_2: %3, %9, %17 … as keyless edges fall
|
|
161
|
+
* between the cluster subgraphs).
|
|
162
|
+
* @see lib/cgraph/id.c:idmap (anon branch `*id = st->counter*2+1; ++counter`)
|
|
163
|
+
* @see lib/cgraph/id.c:agnameof (`'%' + id`)
|
|
164
|
+
*/
|
|
165
|
+
private anonCounter = 0;
|
|
166
|
+
|
|
167
|
+
constructor(private readonly registry: NodeRegistry) {}
|
|
168
|
+
|
|
169
|
+
/** Consume one anonymous id, returning cgraph's `2*counter+1`. */
|
|
170
|
+
private nextAnonId(): number {
|
|
171
|
+
return this.anonCounter++ * 2 + 1;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Advance the shared anon-id counter without materializing a name — the
|
|
176
|
+
* unnamed root graph and each keyless edge consume an id slot so later
|
|
177
|
+
* anonymous subgraphs land on cgraph's exact `%N`.
|
|
178
|
+
* @see lib/cgraph/id.c:idmap
|
|
179
|
+
*/
|
|
180
|
+
advanceAnonId(): void {
|
|
181
|
+
this.anonCounter++;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
processAssign(stmt: AssignStmt, graph: Graph): void {
|
|
185
|
+
graph.attrs.set(stmt.key, normaliseAttrValue(stmt.value));
|
|
186
|
+
// cgraph: assigning a graph attr on any (sub)graph declares it graph-wide
|
|
187
|
+
// with an empty default → the root sees "" for it. @see agattr declaration.
|
|
188
|
+
graph.root.declaredGraphAttrs.add(stmt.key);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
processAttr(stmt: AttrStmt, graph: Graph): void {
|
|
192
|
+
if (stmt.target === 'graph') {
|
|
193
|
+
applyAttrs(stmt.attrs, graph.attrs);
|
|
194
|
+
for (const a of stmt.attrs) graph.root.declaredGraphAttrs.add(a.key);
|
|
195
|
+
} else if (stmt.target === 'node') {
|
|
196
|
+
applyAttrs(stmt.attrs, graph.nodeDefaults);
|
|
197
|
+
} else {
|
|
198
|
+
applyAttrs(stmt.attrs, graph.edgeDefaults);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
processNodeStmt(stmt: NodeStmt, graph: Graph, root: Graph): void {
|
|
203
|
+
const node = this.registry.ensure(stmt.id.id, root, graph);
|
|
204
|
+
applyAttrs(stmt.attrs, node.attrs);
|
|
205
|
+
// cgraph: a node in a subgraph is a member of every enclosing graph.
|
|
206
|
+
// @see lib/cgraph/node.c:agnode
|
|
207
|
+
for (let g: Graph | null = graph; g !== null && g !== root; g = g.parent) {
|
|
208
|
+
g.nodes.set(node.name, node);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
processEdgeStmt(stmt: EdgeStmt, graph: Graph, root: Graph, directed: boolean): void {
|
|
213
|
+
// Resolve every endpoint ONCE before pairing. A subgraph endpoint is created
|
|
214
|
+
// as a real subgraph here (consuming its anon-id/AGSEQ); an interior one
|
|
215
|
+
// (A -> {S} -> B) appears in two adjacent pairs, so resolving once avoids
|
|
216
|
+
// double-creating it. Endpoints (incl. subgraphs) open before any edge of the
|
|
217
|
+
// statement is built — matching cgraph's grammar. @see lib/cgraph/grammar.y
|
|
218
|
+
const ends = stmt.nodes.map((item) => ({
|
|
219
|
+
nodes: this.resolveEndpoint(item, root, graph, directed),
|
|
220
|
+
port: portStringOf(item),
|
|
221
|
+
}));
|
|
222
|
+
for (let i = 0; i < ends.length - 1; i++) {
|
|
223
|
+
this.connectEndpoints(ends[i], ends[i + 1], stmt.attrs, graph, root);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
processSubgraph(
|
|
228
|
+
stmt: SubgraphStmt,
|
|
229
|
+
graph: Graph,
|
|
230
|
+
root: Graph,
|
|
231
|
+
directed: boolean,
|
|
232
|
+
): Graph {
|
|
233
|
+
// cgraph names anonymous subgraphs `%N` so siblings stay distinct; an empty
|
|
234
|
+
// name would collide in graph.subgraphs (a Map), silently dropping all but
|
|
235
|
+
// the last — e.g. `subgraph {…} subgraph {…}` losing the first and any
|
|
236
|
+
// cluster nested in it (nestedclust: cluster_ss81). The `%` prefix is not a
|
|
237
|
+
// valid DOT identifier start, so it cannot clash with a user name. The id is
|
|
238
|
+
// cgraph's shared anonymous counter (2*counter+1), allocated when the
|
|
239
|
+
// subgraph opens (before its body), so keyless edges parsed earlier in the
|
|
240
|
+
// enclosing scope have already advanced it — matching native's %N exactly.
|
|
241
|
+
// @see lib/cgraph/graph.c:agsubg, lib/cgraph/id.c:idmap
|
|
242
|
+
const sgName = stmt.id ?? `%${this.nextAnonId()}`;
|
|
243
|
+
// AGSEQ is assigned when the subgraph opens, before its body — matching C's
|
|
244
|
+
// agopen, which calls agnextseq before processing the subgraph contents.
|
|
245
|
+
// A reopened named subgraph (`subgraph X {…} … subgraph X {…}`) consumes no
|
|
246
|
+
// new AGSEQ in cgraph, so reuse the prior seq rather than re-incrementing.
|
|
247
|
+
// (Content still overwrites; merge semantics are unchanged and out of scope.)
|
|
248
|
+
const prior = graph.subgraphs.get(sgName);
|
|
249
|
+
const sg = new Graph(sgName, graph.kind);
|
|
250
|
+
sg.parent = graph;
|
|
251
|
+
sg.root = root;
|
|
252
|
+
if (prior !== undefined) sg.seq = prior.seq;
|
|
253
|
+
else assignSubgSeq(graph, sg);
|
|
254
|
+
// Snapshot the enclosing graph-attribute defaults at OPEN time (before the
|
|
255
|
+
// body) so a later ancestor `graph [label=…]` does not apply to this
|
|
256
|
+
// subgraph — matching cgraph's parse-time defval copy (order-sensitive).
|
|
257
|
+
sg.graphDefaultsSnapshot = effectiveGraphDefaults(graph);
|
|
258
|
+
buildGraph(stmt.stmts, sg, root, directed, this);
|
|
259
|
+
// Seed the order-correct inherited label-family defaults into the subgraph's
|
|
260
|
+
// OWN attrs (body wins) so they survive the layout's cluster rebuilds, which
|
|
261
|
+
// copy attrs but not the snapshot. Mirrors cgraph's agsubg defval copy; kept
|
|
262
|
+
// to the keys do_graph_label reads so the blast radius stays in label render.
|
|
263
|
+
// @see lib/common/input.c:do_graph_label (agget label/font*)
|
|
264
|
+
for (const key of GRAPH_LABEL_INHERIT_KEYS) {
|
|
265
|
+
const v = sg.graphDefaultsSnapshot.get(key);
|
|
266
|
+
if (v !== undefined && !sg.attrs.has(key)) sg.attrs.set(key, v);
|
|
267
|
+
}
|
|
268
|
+
graph.subgraphs.set(sgName, sg);
|
|
269
|
+
return sg;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
dispatch(
|
|
273
|
+
stmt: ParsedStmt,
|
|
274
|
+
graph: Graph,
|
|
275
|
+
root: Graph,
|
|
276
|
+
directed: boolean,
|
|
277
|
+
): void {
|
|
278
|
+
switch (stmt.type) {
|
|
279
|
+
case 'assign': this.processAssign(stmt, graph); break;
|
|
280
|
+
case 'attr': this.processAttr(stmt, graph); break;
|
|
281
|
+
case 'node': this.processNodeStmt(stmt, graph, root); break;
|
|
282
|
+
case 'edge': this.processEdgeStmt(stmt, graph, root, directed); break;
|
|
283
|
+
case 'subgraph': this.processSubgraph(stmt, graph, root, directed); break;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Snapshot the edge-attribute defaults active in `scope` at edge creation:
|
|
289
|
+
* walk scope -> root (inner overriding outer), filling only keys the edge
|
|
290
|
+
* does not set explicitly. Edges read attrs from their own map only, and
|
|
291
|
+
* DOT's edge[...] defaults apply to edges created after the statement in that
|
|
292
|
+
* scope, so the snapshot must happen at creation, in statement order.
|
|
293
|
+
*/
|
|
294
|
+
private snapshotEdgeDefaults(edge: Edge, scope: Graph): void {
|
|
295
|
+
for (let g: Graph | null = scope; g !== null; g = g.parent) {
|
|
296
|
+
for (const [k, v] of g.edgeDefaults) {
|
|
297
|
+
if (!edge.attrs.has(k)) edge.attrs.set(k, v);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
private resolveEndpoint(
|
|
303
|
+
item: NodeId | SubgraphStmt,
|
|
304
|
+
root: Graph,
|
|
305
|
+
scope: Graph,
|
|
306
|
+
directed: boolean,
|
|
307
|
+
): Node[] {
|
|
308
|
+
if ('type' in item && item.type === 'subgraph') {
|
|
309
|
+
// Create the subgraph as a first-class object so its rank-set attr
|
|
310
|
+
// (rank=same/min/max/source/sink), node membership, and anon-id/AGSEQ are
|
|
311
|
+
// registered for collapse_sets; then expand the edge over its node names.
|
|
312
|
+
this.processSubgraph(item, scope, root, directed);
|
|
313
|
+
// Ensure (create/look-up) the member nodes in written order, so NEW nodes
|
|
314
|
+
// take their AGSEQ in source order — then iterate them in AGSEQ (node id)
|
|
315
|
+
// order for edge creation. C builds `tail -> {set}` edges by walking the
|
|
316
|
+
// endpoint subgraph's node dictionary (sequence-ordered), not the written
|
|
317
|
+
// order; iterating out of order assigns the wrong graphSeq (SVG edge id)
|
|
318
|
+
// when the set lists pre-existing nodes out of creation order (graphs-world
|
|
319
|
+
// `37 -> {39;41;38;40}`: heads 38,40,39,41 by AGSEQ, not 39,41,38,40).
|
|
320
|
+
// @see lib/cgraph/edge.c:agedge — edges follow agfstnode/agnxtnode order
|
|
321
|
+
// Dedup by node identity: a name appearing in several statements of the
|
|
322
|
+
// endpoint subgraph (e.g. a1 in both `a1->a2` and `b2->a1`) is ONE member
|
|
323
|
+
// in cgraph's node dictionary, so `subg -> x` expands to a single a1->x —
|
|
324
|
+
// not one per textual occurrence (1902 drew a1->a3 twice).
|
|
325
|
+
// @see lib/cgraph/edge.c:agedge (walks agfstnode/agnxtnode — unique nodes)
|
|
326
|
+
const seen = new Set<number>();
|
|
327
|
+
const nodes = NameCollector.fromStmts(item.stmts)
|
|
328
|
+
.map((n) => this.registry.ensure(n, root, scope))
|
|
329
|
+
.filter((nd) => (seen.has(nd.id) ? false : (seen.add(nd.id), true)));
|
|
330
|
+
return nodes.sort((a, b) => a.id - b.id);
|
|
331
|
+
}
|
|
332
|
+
return [this.registry.ensure((item as NodeId).id, root, scope)];
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
private connectEndpoints(
|
|
336
|
+
tailEnd: { nodes: Node[]; port: string },
|
|
337
|
+
headEnd: { nodes: Node[]; port: string },
|
|
338
|
+
attrs: AttrPair[],
|
|
339
|
+
graph: Graph,
|
|
340
|
+
root: Graph,
|
|
341
|
+
): void {
|
|
342
|
+
// DOT-syntax ports land in tailport/headport attrs; explicit attrs win.
|
|
343
|
+
const tailPort = tailEnd.port;
|
|
344
|
+
const headPort = headEnd.port;
|
|
345
|
+
for (const tail of tailEnd.nodes) {
|
|
346
|
+
for (const head of headEnd.nodes) {
|
|
347
|
+
const edge = new Edge(tail, head, '');
|
|
348
|
+
this.advanceAnonId(); // keyless edge = anonymous cgraph id (see method)
|
|
349
|
+
applyAttrs(attrs, edge.attrs);
|
|
350
|
+
this.snapshotEdgeDefaults(edge, graph);
|
|
351
|
+
if (tailPort && !edge.attrs.has('tailport')) edge.attrs.set('tailport', tailPort);
|
|
352
|
+
if (headPort && !edge.attrs.has('headport')) edge.attrs.set('headport', headPort);
|
|
353
|
+
root.edges.push(edge);
|
|
354
|
+
edge.graphSeq = root.edges.length;
|
|
355
|
+
// cgraph: nodes and edges belong to every enclosing graph.
|
|
356
|
+
// @see lib/cgraph/edge.c:agedge
|
|
357
|
+
for (let g: Graph | null = graph; g !== null && g !== root; g = g.parent) {
|
|
358
|
+
g.nodes.set(tail.name, tail);
|
|
359
|
+
g.nodes.set(head.name, head);
|
|
360
|
+
g.edges.push(edge);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// ── Graph builder ─────────────────────────────────────────────────────────────
|
|
368
|
+
|
|
369
|
+
/** Walk a statement list and populate graph / root using the given processor. */
|
|
370
|
+
export function buildGraph(
|
|
371
|
+
stmts: ParsedStmt[],
|
|
372
|
+
graph: Graph,
|
|
373
|
+
root: Graph,
|
|
374
|
+
directed: boolean,
|
|
375
|
+
processor: StmtProcessor,
|
|
376
|
+
): void {
|
|
377
|
+
for (const stmt of stmts) {
|
|
378
|
+
processor.dispatch(stmt, graph, root, directed);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/** Build a Graph model from a fully-parsed AST. */
|
|
383
|
+
export function buildFromAst(ast: ParsedGraph): Graph {
|
|
384
|
+
const registry = new NodeRegistry();
|
|
385
|
+
const processor = new StmtProcessor(registry);
|
|
386
|
+
let kind: GraphKind;
|
|
387
|
+
if (ast.directed && ast.strict) kind = 'strict-directed';
|
|
388
|
+
else if (ast.directed) kind = 'directed';
|
|
389
|
+
else if (ast.strict) kind = 'strict-undirected';
|
|
390
|
+
else kind = 'undirected';
|
|
391
|
+
// ast.id is null for a nameless root (`digraph {`) and '' for an explicit
|
|
392
|
+
// empty name (`digraph "" {`); only the former is anonymous in cgraph (→ `%1`).
|
|
393
|
+
const graph = new Graph(ast.id ?? '', kind, ast.id == null);
|
|
394
|
+
// An unnamed root graph is itself anonymous in cgraph (agopen with no name),
|
|
395
|
+
// consuming anon id 1 before any statement — so the first anonymous subgraph is
|
|
396
|
+
// %3, not %1 (a named root leaves the counter at 0 → first subgraph %1).
|
|
397
|
+
// @see lib/cgraph/graph.c:agopen, lib/cgraph/id.c:idmap
|
|
398
|
+
if (!ast.id) processor.advanceAnonId();
|
|
399
|
+
buildGraph(ast.stmts, graph, graph, ast.directed, processor);
|
|
400
|
+
return graph;
|
|
401
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/** Provides information pointing to a location within a source. */
|
|
2
|
+
export interface Location {
|
|
3
|
+
/** Line in the parsed source (1-based). */
|
|
4
|
+
readonly line: number;
|
|
5
|
+
/** Column in the parsed source (1-based). */
|
|
6
|
+
readonly column: number;
|
|
7
|
+
/** Offset in the parsed source (0-based). */
|
|
8
|
+
readonly offset: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Anything that can successfully be converted to a string with `String()`
|
|
13
|
+
* so that it can be used in error messages.
|
|
14
|
+
*
|
|
15
|
+
* The GrammarLocation class in Peggy is a good example.
|
|
16
|
+
*/
|
|
17
|
+
export interface GrammarSourceObject {
|
|
18
|
+
readonly toString: () => string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* If specified, allows the grammar source to be embedded in a larger file
|
|
22
|
+
* at some offset.
|
|
23
|
+
*/
|
|
24
|
+
readonly offset?: undefined | ((loc: Location) => Location);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Most often, you just use a string with the file name.
|
|
29
|
+
*/
|
|
30
|
+
export type GrammarSource = string | GrammarSourceObject;
|
|
31
|
+
|
|
32
|
+
/** The `start` and `end` position's of an object within the source. */
|
|
33
|
+
export interface LocationRange {
|
|
34
|
+
/**
|
|
35
|
+
* A string or object that was supplied to the `parse()` call as the
|
|
36
|
+
* `grammarSource` option.
|
|
37
|
+
*/
|
|
38
|
+
readonly source: GrammarSource;
|
|
39
|
+
/** Position at the beginning of the expression. */
|
|
40
|
+
readonly start: Location;
|
|
41
|
+
/** Position after the end of the expression. */
|
|
42
|
+
readonly end: Location;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Expected a literal string, like `"foo"i`.
|
|
47
|
+
*/
|
|
48
|
+
export interface LiteralExpectation {
|
|
49
|
+
readonly type: "literal";
|
|
50
|
+
readonly text: string;
|
|
51
|
+
readonly ignoreCase: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Range of characters, like `a-z`
|
|
56
|
+
*/
|
|
57
|
+
export type ClassRange = [
|
|
58
|
+
start: string,
|
|
59
|
+
end: string,
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
export interface ClassParts extends Array<string | ClassRange> {
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Expected a class, such as `[^acd-gz]i`
|
|
67
|
+
*/
|
|
68
|
+
export interface ClassExpectation {
|
|
69
|
+
readonly type: "class";
|
|
70
|
+
readonly parts: ClassParts;
|
|
71
|
+
readonly inverted: boolean;
|
|
72
|
+
readonly ignoreCase: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Expected any character, with `.`
|
|
77
|
+
*/
|
|
78
|
+
export interface AnyExpectation {
|
|
79
|
+
readonly type: "any";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Expected the end of input.
|
|
84
|
+
*/
|
|
85
|
+
export interface EndExpectation {
|
|
86
|
+
readonly type: "end";
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Expected some other input. These are specified with a rule's
|
|
91
|
+
* "human-readable name", or with the `expected(message, location)`
|
|
92
|
+
* function.
|
|
93
|
+
*/
|
|
94
|
+
export interface OtherExpectation {
|
|
95
|
+
readonly type: "other";
|
|
96
|
+
readonly description: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export type Expectation =
|
|
100
|
+
| AnyExpectation
|
|
101
|
+
| ClassExpectation
|
|
102
|
+
| EndExpectation
|
|
103
|
+
| LiteralExpectation
|
|
104
|
+
| OtherExpectation;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Pass an array of these into `SyntaxError.prototype.format()`
|
|
108
|
+
*/
|
|
109
|
+
export interface SourceText {
|
|
110
|
+
/**
|
|
111
|
+
* Identifier of an input that was used as a grammarSource in parse().
|
|
112
|
+
*/
|
|
113
|
+
readonly source: GrammarSource;
|
|
114
|
+
/** Source text of the input. */
|
|
115
|
+
readonly text: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export declare class SyntaxError extends globalThis.SyntaxError {
|
|
119
|
+
/**
|
|
120
|
+
* Constructs the human-readable message from the machine representation.
|
|
121
|
+
*
|
|
122
|
+
* @param expected Array of expected items, generated by the parser
|
|
123
|
+
* @param found Any text that will appear as found in the input instead of
|
|
124
|
+
* expected
|
|
125
|
+
*/
|
|
126
|
+
static buildMessage(expected: Expectation[], found?: string | null | undefined): string;
|
|
127
|
+
readonly expected: Expectation[];
|
|
128
|
+
readonly found: string | null | undefined;
|
|
129
|
+
readonly location: LocationRange;
|
|
130
|
+
readonly name: string;
|
|
131
|
+
constructor(
|
|
132
|
+
message: string,
|
|
133
|
+
expected: Expectation[],
|
|
134
|
+
found: string | null,
|
|
135
|
+
location: LocationRange,
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* With good sources, generates a feature-rich error message pointing to the
|
|
140
|
+
* error in the input.
|
|
141
|
+
* @param sources List of {source, text} objects that map to the input.
|
|
142
|
+
*/
|
|
143
|
+
format(sources: SourceText[]): string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Trace execution of the parser.
|
|
148
|
+
*/
|
|
149
|
+
export interface ParserTracer {
|
|
150
|
+
trace: (event: ParserTracerEvent) => void;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export type ParserTracerEvent
|
|
154
|
+
= {
|
|
155
|
+
readonly type: "rule.enter";
|
|
156
|
+
readonly rule: string;
|
|
157
|
+
readonly location: LocationRange
|
|
158
|
+
}
|
|
159
|
+
| {
|
|
160
|
+
readonly type: "rule.fail";
|
|
161
|
+
readonly rule: string;
|
|
162
|
+
readonly location: LocationRange
|
|
163
|
+
}
|
|
164
|
+
| {
|
|
165
|
+
readonly type: "rule.match";
|
|
166
|
+
readonly rule: string;
|
|
167
|
+
readonly location: LocationRange
|
|
168
|
+
/** Return value from the rule. */
|
|
169
|
+
readonly result: unknown;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export type StartRuleNames = "Graph";
|
|
173
|
+
export interface ParseOptions<T extends StartRuleNames = "Graph"> {
|
|
174
|
+
/**
|
|
175
|
+
* String or object that will be attached to the each `LocationRange` object
|
|
176
|
+
* created by the parser. For example, this can be path to the parsed file
|
|
177
|
+
* or even the File object.
|
|
178
|
+
*/
|
|
179
|
+
readonly grammarSource?: GrammarSource;
|
|
180
|
+
readonly startRule?: T;
|
|
181
|
+
readonly tracer?: ParserTracer;
|
|
182
|
+
|
|
183
|
+
// Internal use only:
|
|
184
|
+
readonly peg$library?: boolean;
|
|
185
|
+
// Internal use only:
|
|
186
|
+
peg$currPos?: number;
|
|
187
|
+
// Internal use only:
|
|
188
|
+
peg$silentFails?: number;
|
|
189
|
+
// Internal use only:
|
|
190
|
+
peg$maxFailExpected?: Expectation[];
|
|
191
|
+
// Extra application-specific properties
|
|
192
|
+
[key: string]: unknown;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export declare const StartRules: StartRuleNames[];
|
|
196
|
+
export declare const parse: typeof ParseFunction;
|
|
197
|
+
|
|
198
|
+
// Overload of ParseFunction for each allowedStartRule
|
|
199
|
+
|
|
200
|
+
declare function ParseFunction<Options extends ParseOptions<"Graph">>(
|
|
201
|
+
input: string,
|
|
202
|
+
options?: Options,
|
|
203
|
+
): any;
|
|
204
|
+
|
|
205
|
+
declare function ParseFunction<Options extends ParseOptions<StartRuleNames>>(
|
|
206
|
+
input: string,
|
|
207
|
+
options?: Options,
|
|
208
|
+
): any;
|