@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,202 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Point-in-shape test for polygon nodes, used by edge clipping
|
|
5
|
+
* (bezier_clip via shape_clip0). Calculations use the unrotated node
|
|
6
|
+
* shape centered on the origin.
|
|
7
|
+
*
|
|
8
|
+
* The rankdir rotation (ccwrotatepf by 90*GD_rankdir) and the GD_flip extent
|
|
9
|
+
* swap ARE applied (mission-dot-splines T2 routes rankdir edges through this
|
|
10
|
+
* clip). The polygon segment walk uses the outline ring at the node's resolved
|
|
11
|
+
* penwidth (base + penwidth/2), matching C's outline periphery.
|
|
12
|
+
*
|
|
13
|
+
* @see lib/common/shapes.c:poly_inside
|
|
14
|
+
* @see lib/common/shapes.c:same_side
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { Point } from '../model/geom.js';
|
|
18
|
+
import type { Node } from '../model/node.js';
|
|
19
|
+
import type { PolygonT } from './types.js';
|
|
20
|
+
import type { InsideContext } from './splines-geom.js';
|
|
21
|
+
import { polygonOutlineRing } from './poly-sizing.js';
|
|
22
|
+
import { ccwrotatepf } from '../model/geom.js';
|
|
23
|
+
|
|
24
|
+
/** Test if p0 and p1 are on the same side of the line L0-L1. @see shapes.c:same_side */
|
|
25
|
+
export function sameSide(p0: Point, p1: Point, L0: Point, L1: Point): boolean {
|
|
26
|
+
const a = -(L1.y - L0.y);
|
|
27
|
+
const b = L1.x - L0.x;
|
|
28
|
+
const c = a * L0.x + b * L0.y;
|
|
29
|
+
const s0 = a * p0.x + b * p0.y - c >= 0;
|
|
30
|
+
const s1 = a * p1.x + b * p1.y - c >= 0;
|
|
31
|
+
return s0 === s1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Vertex-extent box of a fixedshape polygon. @see lib/common/shapes.c:polyBB */
|
|
35
|
+
function fixedShapeSize(poly: PolygonT): { w: number; h: number } {
|
|
36
|
+
let xmax = 0;
|
|
37
|
+
let ymax = 0;
|
|
38
|
+
for (const v of poly.vertices ?? []) {
|
|
39
|
+
xmax = Math.max(xmax, Math.abs(v.x));
|
|
40
|
+
ymax = Math.max(ymax, Math.abs(v.y));
|
|
41
|
+
}
|
|
42
|
+
return { w: 2 * xmax, h: 2 * ymax };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Scale factors and outline half-extents for the inside test. */
|
|
46
|
+
interface InsideScale {
|
|
47
|
+
scalex: number;
|
|
48
|
+
scaley: number;
|
|
49
|
+
boxURx: number;
|
|
50
|
+
boxURy: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Node size + outline extents (points) for the inside scale. */
|
|
54
|
+
function insideDims(n: Node, poly: PolygonT, xsize: number, ysize: number):
|
|
55
|
+
{ w: number; h: number; ow: number; oh: number } {
|
|
56
|
+
if (poly.option.fixedshape) {
|
|
57
|
+
const { w, h } = fixedShapeSize(poly);
|
|
58
|
+
return { w, h, ow: w, oh: h };
|
|
59
|
+
}
|
|
60
|
+
const w = 72 * (n.info.width || xsize / 72);
|
|
61
|
+
const h = 72 * (n.info.height || ysize / 72);
|
|
62
|
+
// Nodes that skipped poly_init (no measurer) have no outline dims.
|
|
63
|
+
return { w, h, ow: 72 * n.info.outline_width || w, oh: 72 * n.info.outline_height || h };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** @see lib/common/shapes.c:poly_inside (scale setup) */
|
|
67
|
+
function insideScale(n: Node, poly: PolygonT): InsideScale {
|
|
68
|
+
// C swaps the node extents for flipped (LR/RL) layouts. @see poly_inside (GD_flip)
|
|
69
|
+
const flip = n.root.info.flip === true;
|
|
70
|
+
const lwrw = n.info.lw + n.info.rw;
|
|
71
|
+
const xsize = flip ? n.info.ht : lwrw;
|
|
72
|
+
const ysize = flip ? lwrw : n.info.ht;
|
|
73
|
+
const { w, h, ow, oh } = insideDims(n, poly, xsize, ysize);
|
|
74
|
+
return {
|
|
75
|
+
scalex: xsize !== 0 ? w / xsize : w,
|
|
76
|
+
scaley: ysize !== 0 ? h / ysize : h,
|
|
77
|
+
boxURx: ow / 2,
|
|
78
|
+
boxURy: oh / 2,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Polygon segment walk over the vertex ring. @see shapes.c:poly_inside */
|
|
83
|
+
function polygonWalk(P: Point, vertex: Point[], sides: number): boolean {
|
|
84
|
+
const O = { x: 0, y: 0 };
|
|
85
|
+
let i = 0;
|
|
86
|
+
let i1 = 1 % sides;
|
|
87
|
+
const Q = vertex[i]!;
|
|
88
|
+
const R = vertex[i1]!;
|
|
89
|
+
if (!sameSide(P, O, Q, R)) return false; // outside this segment's face
|
|
90
|
+
const s = sameSide(P, Q, R, O);
|
|
91
|
+
if (s && sameSide(P, R, O, Q)) return true; // between the segment's sides
|
|
92
|
+
for (let j = 1; j < sides; j++) {
|
|
93
|
+
if (s) {
|
|
94
|
+
i = i1;
|
|
95
|
+
i1 = (i + 1) % sides;
|
|
96
|
+
} else {
|
|
97
|
+
i1 = i;
|
|
98
|
+
i = (i + sides - 1) % sides;
|
|
99
|
+
}
|
|
100
|
+
if (!sameSide(P, O, vertex[i]!, vertex[i1]!)) return false;
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* True when point p (relative to the node center) lies inside the
|
|
107
|
+
* node's polygon shape.
|
|
108
|
+
* @see lib/common/shapes.c:poly_inside
|
|
109
|
+
*/
|
|
110
|
+
/** Scaled-point shape test once the polygon descriptor is resolved. */
|
|
111
|
+
function insideShape(n: Node, poly: PolygonT, p: Point): boolean {
|
|
112
|
+
const sc = insideScale(n, poly);
|
|
113
|
+
const P = { x: p.x * sc.scalex, y: p.y * sc.scaley };
|
|
114
|
+
if (Math.abs(P.x) > sc.boxURx || Math.abs(P.y) > sc.boxURy) return false;
|
|
115
|
+
if (poly.sides <= 2) {
|
|
116
|
+
return Math.hypot(P.x / sc.boxURx, P.y / sc.boxURy) < 1;
|
|
117
|
+
}
|
|
118
|
+
// C walks the outline ring (outermost periphery + penwidth/2
|
|
119
|
+
// bisector offsets). @see shapes.c:poly_inside (outp selection)
|
|
120
|
+
const outerStart = (Math.max(poly.peripheries, 1) - 1) * poly.sides;
|
|
121
|
+
const outer = poly.vertices!.slice(outerStart, outerStart + poly.sides);
|
|
122
|
+
const ring = polygonOutlineRing(outer, poly.sides, poly.penwidth ?? 1);
|
|
123
|
+
return polygonWalk(P, ring, poly.sides);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function polyInside(ctx: InsideContext, p: Point): boolean {
|
|
127
|
+
const n = ctx.node as Node | undefined;
|
|
128
|
+
if (n === undefined) return false;
|
|
129
|
+
// C rotates the test point by the rank direction before testing against the
|
|
130
|
+
// node's natural-frame polygon. @see shapes.c:poly_inside (ccwrotatepf)
|
|
131
|
+
const rankdir = (n.root.info.rankdir ?? 0) & 0x3;
|
|
132
|
+
const P = rankdir === 0 ? p : ccwrotatepf(p, rankdir * 90);
|
|
133
|
+
if (ctx.bp) {
|
|
134
|
+
const b = ctx.bp;
|
|
135
|
+
return P.x >= b.ll.x && P.x <= b.ur.x && P.y >= b.ll.y && P.y <= b.ur.y;
|
|
136
|
+
}
|
|
137
|
+
const poly = n.info.shape_info as PolygonT | undefined;
|
|
138
|
+
if (poly === undefined || poly.vertices === null) return false;
|
|
139
|
+
return insideShape(n, poly, P);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Point-in-star test. A star is concave, so the generic poly_inside decagon
|
|
144
|
+
* walk clips edges to the wrong (inner) boundary; C gives the star its own
|
|
145
|
+
* insidefn that tests the point against the OUTER-tip pentagram: step the
|
|
146
|
+
* outline vertices by 2 (the five tips) connecting tip i to tip (i+4)%sides,
|
|
147
|
+
* and count the pentagram edges the point is on the far side of from the
|
|
148
|
+
* centre — two or more means outside. The port's star vertices are already at
|
|
149
|
+
* final node scale (poly_inside's scalex/scaley collapse to 1), so P is tested
|
|
150
|
+
* directly, matching C. @see lib/common/shapes.c:star_inside (4089)
|
|
151
|
+
*/
|
|
152
|
+
export function starInside(ctx: InsideContext, p: Point): boolean {
|
|
153
|
+
const n = ctx.node as Node | undefined;
|
|
154
|
+
if (n === undefined) return false;
|
|
155
|
+
const rankdir = (n.root.info.rankdir ?? 0) & 0x3;
|
|
156
|
+
const P = rankdir === 0 ? p : ccwrotatepf(p, rankdir * 90);
|
|
157
|
+
if (ctx.bp) {
|
|
158
|
+
const b = ctx.bp;
|
|
159
|
+
return P.x >= b.ll.x && P.x <= b.ur.x && P.y >= b.ll.y && P.y <= b.ur.y;
|
|
160
|
+
}
|
|
161
|
+
const poly = n.info.shape_info as PolygonT | undefined;
|
|
162
|
+
if (poly === undefined || poly.vertices === null) return false;
|
|
163
|
+
const sides = poly.sides;
|
|
164
|
+
const outerStart = (Math.max(poly.peripheries, 1) - 1) * sides;
|
|
165
|
+
const outer = poly.vertices.slice(outerStart, outerStart + sides);
|
|
166
|
+
const ring = polygonOutlineRing(outer, sides, poly.penwidth ?? 1);
|
|
167
|
+
const O = { x: 0, y: 0 };
|
|
168
|
+
let outcnt = 0;
|
|
169
|
+
for (let i = 0; i < sides; i += 2) {
|
|
170
|
+
const Q = ring[i]!;
|
|
171
|
+
const R = ring[(i + 4) % sides]!;
|
|
172
|
+
if (!sameSide(P, O, Q, R)) outcnt++;
|
|
173
|
+
if (outcnt === 2) return false;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Point-in-record test: inside the field tree's bounding box, expanded
|
|
180
|
+
* by half the penwidth (the outline). penwidth attr is read as default
|
|
181
|
+
* 1 (no attr plumbing here; no test sets node penwidth).
|
|
182
|
+
* @see lib/common/shapes.c:record_inside
|
|
183
|
+
*/
|
|
184
|
+
export function recordInside(ctx: InsideContext, p: Point): boolean {
|
|
185
|
+
const n = ctx.node as Node | undefined;
|
|
186
|
+
if (n === undefined) return false;
|
|
187
|
+
// C converts the query point to the record's own (label) frame first:
|
|
188
|
+
// ccwrotatepf(p, 90 * GD_rankdir). @see lib/common/shapes.c:record_inside
|
|
189
|
+
const rankdir = (n.root.info.rankdir ?? 0) & 0x3;
|
|
190
|
+
const P = rankdir === 0 ? p : ccwrotatepf(p, rankdir * 90);
|
|
191
|
+
let bb: { ll: Point; ur: Point };
|
|
192
|
+
if (ctx.bp) {
|
|
193
|
+
bb = ctx.bp;
|
|
194
|
+
} else {
|
|
195
|
+
const fld = n.info.shape_info as { b?: { ll: Point; ur: Point } } | undefined;
|
|
196
|
+
if (!fld?.b) return false;
|
|
197
|
+
bb = fld.b;
|
|
198
|
+
}
|
|
199
|
+
const pw = 0.5; // DEFAULT_NODEPENWIDTH / 2
|
|
200
|
+
return P.x >= bb.ll.x - pw && P.x <= bb.ur.x + pw
|
|
201
|
+
&& P.y >= bb.ll.y - pw && P.y <= bb.ur.y + pw;
|
|
202
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
//
|
|
3
|
+
// Per-shape vertex generators, verbatim ports of the round_corners switch
|
|
4
|
+
// cases (lib/common/shapes.c:740-1739). Each builds a D[] polygon (and any
|
|
5
|
+
// inner polylines) from the box vertices AF[] (`af`) and bevel polygon B[]
|
|
6
|
+
// (`b`), then renders via the adapters in poly-shapes-util.ts.
|
|
7
|
+
|
|
8
|
+
import type { Point } from '../model/geom.js';
|
|
9
|
+
import {
|
|
10
|
+
type ShapeCtx, renderShapePolygon, renderShapePolyline,
|
|
11
|
+
vadd, vsub, midX, midY1, dsDnaLine,
|
|
12
|
+
} from './poly-shapes-util.js';
|
|
13
|
+
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Box family
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
/** CDS — arrow without protrusions (5-point polygon). @see shapes.c:959-989 */
|
|
19
|
+
export function drawCds(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
20
|
+
const w = b[3]!.y - b[4]!.y;
|
|
21
|
+
const D: Point[] = [
|
|
22
|
+
{ x: b[1]!.x, y: b[1]!.y - w / 2 },
|
|
23
|
+
{ x: b[3]!.x, y: b[3]!.y - w / 2 },
|
|
24
|
+
{ x: af[2]!.x, y: af[2]!.y + w / 2 },
|
|
25
|
+
{ x: b[1]!.x, y: af[2]!.y + w / 2 },
|
|
26
|
+
{ x: af[0]!.x, y: af[0]!.y - (af[0]!.y - af[3]!.y) / 2 },
|
|
27
|
+
];
|
|
28
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** DOGEAR (note): cutoff corner + inner fold lines. @see shapes.c:740-758 */
|
|
32
|
+
export function drawDogear(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
33
|
+
const sides = af.length;
|
|
34
|
+
const D: Point[] = new Array<Point>(sides + 1);
|
|
35
|
+
for (let seg = 1; seg < sides; seg++) D[seg] = af[seg]!;
|
|
36
|
+
D[0] = b[3 * (sides - 1) + 4]!;
|
|
37
|
+
D[sides] = b[3 * (sides - 1) + 2]!;
|
|
38
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
39
|
+
const s = sides - 1;
|
|
40
|
+
const c0 = b[3 * s + 2]!;
|
|
41
|
+
const c2 = vadd(b[3 * s + 4]!, vsub(c0, b[3 * s + 3]!));
|
|
42
|
+
renderShapePolyline([b[3 * s + 4]!, c2], coord, ctx);
|
|
43
|
+
renderShapePolyline([c0, c2], coord, ctx);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** TAB: top-left tab protrusion. @see shapes.c:760-791 */
|
|
47
|
+
export function drawTab(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
48
|
+
const sides = af.length;
|
|
49
|
+
const w = { x: (b[3]!.x - b[4]!.x) / 3, y: (b[3]!.y - b[4]!.y) / 3 };
|
|
50
|
+
const D: Point[] = [af[0]!, b[2]!, vadd(b[2]!, w), vadd(b[3]!, w)];
|
|
51
|
+
for (let seg = 4; seg < sides + 2; seg++) D.push(af[seg - 2]!);
|
|
52
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
53
|
+
renderShapePolyline([b[3]!, b[2]!], coord, ctx);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** FOLDER: top folder-tab outline. @see shapes.c:793-821 */
|
|
57
|
+
export function drawFolder(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
58
|
+
const sides = af.length;
|
|
59
|
+
const dx = af[0]!.x - b[1]!.x;
|
|
60
|
+
const wy = (b[3]!.y - b[4]!.y) / 3;
|
|
61
|
+
// C sets D[4]=B[3] then the seg=4 loop overwrites it with AF[1] (==B[3]).
|
|
62
|
+
const D: Point[] = [
|
|
63
|
+
af[0]!,
|
|
64
|
+
{ x: af[0]!.x - dx / 4, y: af[0]!.y + wy },
|
|
65
|
+
{ x: af[0]!.x - 2 * dx, y: af[0]!.y + wy },
|
|
66
|
+
{ x: af[0]!.x - 2.25 * dx, y: b[3]!.y },
|
|
67
|
+
];
|
|
68
|
+
for (let seg = 4; seg < sides + 3; seg++) D.push(af[seg - 3]!);
|
|
69
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** BOX3D: cutoff corners + three depth lines. @see shapes.c:823-844 (sides==4) */
|
|
73
|
+
export function drawBox3d(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
74
|
+
const D: Point[] = [af[0]!, b[2]!, b[4]!, af[2]!, b[8]!, b[10]!];
|
|
75
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
76
|
+
const c0 = vadd(b[1]!, vsub(b[11]!, b[0]!));
|
|
77
|
+
renderShapePolyline([c0, b[4]!], coord, ctx);
|
|
78
|
+
renderShapePolyline([c0, b[8]!], coord, ctx);
|
|
79
|
+
renderShapePolyline([c0, b[0]!], coord, ctx);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** COMPONENT: two side bays + their inner lines. @see shapes.c:846-905 (sides==4) */
|
|
83
|
+
export function drawComponent(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
84
|
+
const u = vsub(b[4]!, b[3]!);
|
|
85
|
+
const v = vsub(b[3]!, b[2]!);
|
|
86
|
+
const D: Point[] = new Array<Point>(12);
|
|
87
|
+
D[0] = af[0]!; D[1] = af[1]!;
|
|
88
|
+
D[2] = vadd(b[3]!, u); D[3] = vadd(D[2], v); D[4] = vadd(D[3], u); D[5] = vadd(D[4], vsub(D[2], D[3]));
|
|
89
|
+
const u2 = vsub(b[5]!, b[6]!);
|
|
90
|
+
const v2 = vsub(b[6]!, b[7]!);
|
|
91
|
+
D[9] = vadd(b[6]!, u2); D[8] = vadd(D[9], v2); D[7] = vadd(D[8], u2); D[6] = vadd(D[7], vsub(D[9], D[8]));
|
|
92
|
+
D[10] = af[2]!; D[11] = af[3]!;
|
|
93
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
94
|
+
componentInnerLines(D, coord, ctx);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** COMPONENT's two 4-point inner bay outlines. @see shapes.c:889-903 */
|
|
98
|
+
function componentInnerLines(D: Point[], coord: Point, ctx: ShapeCtx): void {
|
|
99
|
+
const a1 = vsub(D[2]!, vsub(D[3]!, D[2]!));
|
|
100
|
+
const a2 = vadd(a1, vsub(D[4]!, D[3]!));
|
|
101
|
+
renderShapePolyline([D[2]!, a1, a2, D[5]!], coord, ctx);
|
|
102
|
+
const b1 = vsub(D[6]!, vsub(D[7]!, D[6]!));
|
|
103
|
+
const b2 = vadd(b1, vsub(D[8]!, D[7]!));
|
|
104
|
+
renderShapePolyline([D[6]!, b1, b2, D[9]!], coord, ctx);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
// Gene-expression SBOLv (filled polygon + dsDNA centre line)
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
|
|
111
|
+
/** PROMOTER: L-shaped arrow on the centre line. @see shapes.c:908-957 */
|
|
112
|
+
export function drawPromoter(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
113
|
+
const mx = midX(af), my = midY1(af);
|
|
114
|
+
const w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
115
|
+
const D0 = { x: mx + (af[0]!.x - af[1]!.x) / 8, y: my + (w * 3) / 2 };
|
|
116
|
+
const D1 = { x: mx - (af[0]!.x - af[1]!.x) / 4, y: D0.y };
|
|
117
|
+
const D2 = { x: D1.x, y: my };
|
|
118
|
+
const D3 = { x: D2.x + wx / 2, y: my };
|
|
119
|
+
const D4 = { x: D3.x, y: my + w };
|
|
120
|
+
const D5 = { x: D0.x, y: D4.y };
|
|
121
|
+
const D6 = { x: D0.x, y: D4.y - w / 4 };
|
|
122
|
+
const D7 = { x: D6.x + wx, y: D6.y + w / 2 };
|
|
123
|
+
const D8 = { x: D0.x, y: D0.y + w / 4 };
|
|
124
|
+
renderShapePolygon([D0, D1, D2, D3, D4, D5, D6, D7, D8], coord, ctx, filled);
|
|
125
|
+
renderShapePolyline(dsDnaLine(af), coord, ctx);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** TERMINATOR: centred T-shape. @see shapes.c:991-1033 */
|
|
129
|
+
export function drawTerminator(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
130
|
+
const mx = midX(af), my = midY1(af);
|
|
131
|
+
const w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
132
|
+
const D0 = { x: mx + wx / 4, y: my };
|
|
133
|
+
const D1 = { x: D0.x, y: D0.y + w / 2 };
|
|
134
|
+
const D2 = { x: D1.x + wx / 2, y: D1.y };
|
|
135
|
+
const D3 = { x: D2.x, y: D2.y + w / 2 };
|
|
136
|
+
const D4 = { x: mx - (wx * 3) / 4, y: D3.y };
|
|
137
|
+
const D5 = { x: D4.x, y: D2.y };
|
|
138
|
+
const D6 = { x: mx - wx / 4, y: D1.y };
|
|
139
|
+
const D7 = { x: D6.x, y: D0.y };
|
|
140
|
+
renderShapePolygon([D0, D1, D2, D3, D4, D5, D6, D7], coord, ctx, filled);
|
|
141
|
+
renderShapePolyline(dsDnaLine(af), coord, ctx);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** UTR: centred half-octagon. @see shapes.c:1036-1073 */
|
|
145
|
+
export function drawUtr(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
146
|
+
const mx = midX(af), my = midY1(af);
|
|
147
|
+
const w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
148
|
+
const D0 = { x: mx + (wx * 3) / 4, y: my };
|
|
149
|
+
const D1 = { x: D0.x, y: D0.y + w / 4 };
|
|
150
|
+
const D2 = { x: mx + wx / 4, y: D1.y + w / 2 };
|
|
151
|
+
const D3 = { x: mx - wx / 4, y: D2.y };
|
|
152
|
+
const D4 = { x: mx - (wx * 3) / 4, y: D1.y };
|
|
153
|
+
const D5 = { x: D4.x, y: D0.y };
|
|
154
|
+
renderShapePolygon([D0, D1, D2, D3, D4, D5], coord, ctx, filled);
|
|
155
|
+
renderShapePolyline(dsDnaLine(af), coord, ctx);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** INSULATOR: nested squares with split dsDNA. @see shapes.c:1455-1503 */
|
|
159
|
+
export function drawInsulator(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
160
|
+
const mx = midX(af), my = midY1(af);
|
|
161
|
+
const h = (b[2]!.x - b[3]!.x) / 2, q = ((b[2]!.x - b[3]!.x) * 3) / 4;
|
|
162
|
+
const dy = af[2]!.y + (af[0]!.y - af[3]!.y) / 2;
|
|
163
|
+
renderShapePolygon([
|
|
164
|
+
{ x: mx + h, y: my + h }, { x: mx + h, y: my - h },
|
|
165
|
+
{ x: mx - h, y: my - h }, { x: mx - h, y: my + h },
|
|
166
|
+
], coord, ctx, filled);
|
|
167
|
+
renderShapePolyline([
|
|
168
|
+
{ x: mx + q, y: my + q }, { x: mx + q, y: my - q },
|
|
169
|
+
{ x: mx - q, y: my - q }, { x: mx - q, y: my + q }, { x: mx + q, y: my + q },
|
|
170
|
+
], coord, ctx);
|
|
171
|
+
renderShapePolyline([{ x: mx + q, y: my }, { x: af[0]!.x, y: dy }], coord, ctx);
|
|
172
|
+
renderShapePolyline([{ x: af[1]!.x, y: my }, { x: mx - q, y: dy }], coord, ctx);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// ---------------------------------------------------------------------------
|
|
176
|
+
// Shared geometry: 16-point X (ribosite/proteasesite), 8-point octagon
|
|
177
|
+
// (rnastab/proteinstab). Both add a stem line + dsDNA.
|
|
178
|
+
// ---------------------------------------------------------------------------
|
|
179
|
+
|
|
180
|
+
/** The 16-point "X" body. @see shapes.c:1517-1548 (ribosite ≡ proteasesite) */
|
|
181
|
+
function xShape(af: Point[], b: Point[]): Point[] {
|
|
182
|
+
const mx = midX(af), my = midY1(af);
|
|
183
|
+
const w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
184
|
+
const D0 = { x: mx + wx / 4, y: my + w / 2 };
|
|
185
|
+
const D1 = { x: D0.x, y: D0.y + w / 8 };
|
|
186
|
+
const D2 = { x: D0.x - wx / 8, y: D1.y + w / 8 };
|
|
187
|
+
const D3 = { x: D0.x, y: D2.y + w / 8 };
|
|
188
|
+
const D4 = { x: D0.x, y: D3.y + w / 8 };
|
|
189
|
+
const D5 = { x: D2.x, y: D4.y };
|
|
190
|
+
const D6 = { x: mx, y: D3.y };
|
|
191
|
+
const D7 = { x: D6.x - wx / 8, y: D5.y };
|
|
192
|
+
const D8 = { x: D7.x - wx / 8, y: D7.y };
|
|
193
|
+
const D9 = { x: D8.x, y: D3.y };
|
|
194
|
+
const D10 = { x: D8.x + wx / 8, y: D2.y };
|
|
195
|
+
const D11 = { x: D8.x, y: D1.y };
|
|
196
|
+
const D12 = { x: D8.x, y: D0.y };
|
|
197
|
+
const D13 = { x: D10.x, y: D12.y };
|
|
198
|
+
const D14 = { x: D6.x, y: D1.y };
|
|
199
|
+
const D15 = { x: D2.x, y: D0.y };
|
|
200
|
+
return [D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15];
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** The 8-point octagon body. @see shapes.c:1588-1603 (rnastab ≡ proteinstab) */
|
|
204
|
+
function octShape(af: Point[], b: Point[]): Point[] {
|
|
205
|
+
const mx = midX(af), my = midY1(af);
|
|
206
|
+
const w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
207
|
+
const D0 = { x: mx + wx / 8, y: my + w / 2 };
|
|
208
|
+
const D1 = { x: D0.x + wx / 8, y: D0.y + w / 8 };
|
|
209
|
+
const D2 = { x: D1.x, y: D1.y + w / 4 };
|
|
210
|
+
const D3 = { x: D0.x, y: D2.y + w / 8 };
|
|
211
|
+
const D4 = { x: D3.x - wx / 4, y: D3.y };
|
|
212
|
+
const D5 = { x: D4.x - wx / 8, y: D2.y };
|
|
213
|
+
const D6 = { x: D5.x, y: D1.y };
|
|
214
|
+
const D7 = { x: D4.x, y: D0.y };
|
|
215
|
+
return [D0, D1, D2, D3, D4, D5, D6, D7];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/** RIBOSITE: X + 2-part dashed stem. @see shapes.c:1505-1573 */
|
|
219
|
+
export function drawRibosite(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
220
|
+
const D = xShape(af, b);
|
|
221
|
+
const my = midY1(af), w = b[3]!.y - b[4]!.y, cx = D[14]!.x;
|
|
222
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
223
|
+
renderShapePolyline([{ x: cx, y: my }, { x: cx, y: my + w / 8 }], coord, ctx);
|
|
224
|
+
renderShapePolyline([{ x: cx, y: my + w / 4 }, { x: cx, y: my + w / 4 + w / 8 }], coord, ctx);
|
|
225
|
+
renderShapePolyline(dsDnaLine(af), coord, ctx);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** PROTEASESITE: X + solid stem. @see shapes.c:1633-1690 */
|
|
229
|
+
export function drawProteasesite(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
230
|
+
const D = xShape(af, b);
|
|
231
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
232
|
+
renderShapePolyline([D[14]!, { x: D[14]!.x, y: midY1(af) }], coord, ctx);
|
|
233
|
+
renderShapePolyline(dsDnaLine(af), coord, ctx);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** RNASTAB: octagon + 2-part dashed stem. @see shapes.c:1576-1629 */
|
|
237
|
+
export function drawRnastab(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
238
|
+
const D = octShape(af, b);
|
|
239
|
+
const mx = midX(af), my = midY1(af), w = b[3]!.y - b[4]!.y;
|
|
240
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
241
|
+
renderShapePolyline([{ x: mx, y: my }, { x: mx, y: my + w / 8 }], coord, ctx);
|
|
242
|
+
renderShapePolyline([{ x: mx, y: my + w / 4 }, { x: mx, y: my + w / 4 + w / 8 }], coord, ctx);
|
|
243
|
+
renderShapePolyline(dsDnaLine(af), coord, ctx);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** PROTEINSTAB: octagon + solid stem. @see shapes.c:1694-1736 */
|
|
247
|
+
export function drawProteinstab(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
248
|
+
const D = octShape(af, b);
|
|
249
|
+
const mx = midX(af);
|
|
250
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
251
|
+
renderShapePolyline([{ x: mx, y: D[0]!.y }, { x: mx, y: midY1(af) }], coord, ctx);
|
|
252
|
+
renderShapePolyline(dsDnaLine(af), coord, ctx);
|
|
253
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
+
//
|
|
3
|
+
// Per-shape vertex generators (part 2): DNA construction symbols and the
|
|
4
|
+
// arrow/promoter family. Verbatim ports of the round_corners switch cases
|
|
5
|
+
// (lib/common/shapes.c:1076-1454, 1741-1889). See poly-shapes-cases.ts for the
|
|
6
|
+
// box and gene-expression families.
|
|
7
|
+
|
|
8
|
+
import type { Point } from '../model/geom.js';
|
|
9
|
+
import {
|
|
10
|
+
type ShapeCtx, renderShapePolygon, renderShapePolyline,
|
|
11
|
+
midX, midY1, dsDnaLine, rect, dnaY,
|
|
12
|
+
} from './poly-shapes-util.js';
|
|
13
|
+
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// DNA construction symbols
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
/** PRIMERSITE: half-arrow, scales in x. @see shapes.c:1076-1112 */
|
|
19
|
+
export function drawPrimersite(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
20
|
+
const mx = midX(af), my = midY1(af);
|
|
21
|
+
const w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
22
|
+
const D0 = { x: mx + wx, y: my + w / 4 };
|
|
23
|
+
const D1 = { x: D0.x - wx, y: D0.y + w };
|
|
24
|
+
const D2 = { x: D1.x, y: D0.y + w / 2 };
|
|
25
|
+
const D3 = { x: mx - (af[0]!.x - af[1]!.x) / 4, y: D2.y };
|
|
26
|
+
const D4 = { x: D3.x, y: D0.y };
|
|
27
|
+
renderShapePolygon([D0, D1, D2, D3, D4], coord, ctx, filled);
|
|
28
|
+
renderShapePolyline(dsDnaLine(af), coord, ctx);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** RESTRICTIONSITE: zigzag with split dsDNA. @see shapes.c:1115-1163 */
|
|
32
|
+
export function drawRestrictionsite(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
33
|
+
const mx = midX(af), my = midY1(af), sw = (af[0]!.x - af[1]!.x) / 8;
|
|
34
|
+
const w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
35
|
+
const D0 = { x: mx + sw + wx / 2, y: my + w / 4 };
|
|
36
|
+
const D1 = { x: mx - sw, y: D0.y };
|
|
37
|
+
const D2 = { x: D1.x, y: D1.y + w / 2 };
|
|
38
|
+
const D3 = { x: D2.x - wx / 2, y: D2.y };
|
|
39
|
+
const D4 = { x: D3.x, y: my - w / 4 };
|
|
40
|
+
const D5 = { x: D0.x - wx / 2, y: D4.y };
|
|
41
|
+
const D6 = { x: D5.x, y: D5.y - w / 2 };
|
|
42
|
+
const D7 = { x: D0.x, y: D6.y };
|
|
43
|
+
renderShapePolygon([D0, D1, D2, D3, D4, D5, D6, D7], coord, ctx, filled);
|
|
44
|
+
renderShapePolyline([{ x: af[1]!.x, y: my }, { x: D4.x, y: dnaY(af) }], coord, ctx);
|
|
45
|
+
renderShapePolyline([{ x: D7.x, y: my }, { x: af[0]!.x, y: dnaY(af) }], coord, ctx);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** FIVEPOVERHANG: two left rects + right dsDNA. @see shapes.c:1167-1213 */
|
|
49
|
+
export function drawFivepoverhang(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
50
|
+
const my = midY1(af), w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
51
|
+
renderShapePolygon(rect(af[1]!.x, my + w / 8, 2 * wx, w / 2), coord, ctx, filled);
|
|
52
|
+
const r2 = rect(af[1]!.x + wx, my - (w * 5) / 8, wx, w / 2);
|
|
53
|
+
renderShapePolygon(r2, coord, ctx, filled);
|
|
54
|
+
renderShapePolyline([{ x: r2[1]!.x, y: my }, { x: af[0]!.x, y: dnaY(af) }], coord, ctx);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** THREEPOVERHANG: two right rects + left dsDNA. @see shapes.c:1217-1263 */
|
|
58
|
+
export function drawThreepoverhang(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
59
|
+
const my = midY1(af), w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
60
|
+
const a0 = { x: af[0]!.x, y: my + w / 8 };
|
|
61
|
+
const a1 = { x: a0.x, y: a0.y + w / 2 };
|
|
62
|
+
renderShapePolygon([a0, a1, { x: a1.x - 2 * w, y: a1.y }, { x: a1.x - 2 * w, y: a0.y }], coord, ctx, filled);
|
|
63
|
+
const c0 = { x: af[0]!.x - wx, y: my - (w * 5) / 8 };
|
|
64
|
+
const c1 = { x: c0.x, y: c0.y + w / 2 };
|
|
65
|
+
const c2x = c1.x - w;
|
|
66
|
+
renderShapePolygon([c0, c1, { x: c2x, y: c1.y }, { x: c2x, y: c0.y }], coord, ctx, filled);
|
|
67
|
+
renderShapePolyline([{ x: af[1]!.x, y: my }, { x: c2x, y: dnaY(af) }], coord, ctx);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** NOVERHANG: four rects + split dsDNA. @see shapes.c:1267-1348 */
|
|
71
|
+
export function drawNoverhang(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
72
|
+
const mx = midX(af), my = midY1(af), w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
73
|
+
const lx = mx - (wx * 9) / 8, rx = mx + wx / 8;
|
|
74
|
+
const top = my + w / 8, bot = my - (w * 5) / 8;
|
|
75
|
+
for (const [x, y] of [[lx, top], [lx, bot], [rx, bot], [rx, top]] as const) {
|
|
76
|
+
renderShapePolygon(rect(x, y, wx, w / 2), coord, ctx, filled);
|
|
77
|
+
}
|
|
78
|
+
renderShapePolyline([{ x: rx + wx, y: my }, { x: af[0]!.x, y: dnaY(af) }], coord, ctx);
|
|
79
|
+
renderShapePolyline([{ x: lx, y: my }, { x: af[1]!.x, y: dnaY(af) }], coord, ctx);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** ASSEMBLY: two centred rects + split dsDNA. @see shapes.c:1352-1404 */
|
|
83
|
+
export function drawAssembly(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
84
|
+
const mx = midX(af), my = midY1(af), w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
85
|
+
const x0 = mx - wx;
|
|
86
|
+
renderShapePolygon(rect(x0, my + w / 8, 2 * wx, w / 2), coord, ctx, filled);
|
|
87
|
+
renderShapePolygon(rect(x0, my - (w * 5) / 8, 2 * wx, w / 2), coord, ctx, filled);
|
|
88
|
+
renderShapePolyline([{ x: x0 + 2 * wx, y: my }, { x: af[0]!.x, y: dnaY(af) }], coord, ctx);
|
|
89
|
+
renderShapePolyline([{ x: af[1]!.x, y: my }, { x: x0, y: dnaY(af) }], coord, ctx);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** SIGNATURE: box + "X" + bottom line. @see shapes.c:1408-1451 */
|
|
93
|
+
export function drawSignature(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
94
|
+
const my = midY1(af), w = b[3]!.y - b[4]!.y, wx = b[2]!.x - b[3]!.x;
|
|
95
|
+
renderShapePolygon([
|
|
96
|
+
{ x: af[0]!.x, y: b[1]!.y - w / 2 },
|
|
97
|
+
{ x: b[3]!.x, y: b[3]!.y - w / 2 },
|
|
98
|
+
{ x: af[2]!.x, y: af[2]!.y + w / 2 },
|
|
99
|
+
{ x: af[0]!.x, y: af[2]!.y + w / 2 },
|
|
100
|
+
], coord, ctx, filled);
|
|
101
|
+
const xl = af[1]!.x + wx / 4;
|
|
102
|
+
renderShapePolyline([{ x: xl, y: my + w / 8 }, { x: xl + wx / 4, y: my + w / 8 - w / 4 }], coord, ctx);
|
|
103
|
+
renderShapePolyline([{ x: xl, y: my - w / 8 }, { x: xl + wx / 4, y: my - w / 8 + w / 4 }], coord, ctx);
|
|
104
|
+
const by = af[2]!.y + (w * 3) / 4;
|
|
105
|
+
renderShapePolyline([{ x: xl, y: by }, { x: af[0]!.x - wx / 4, y: by }], coord, ctx);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
// Arrow / promoter family (single filled polygon, triangle point on one end)
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
|
|
112
|
+
/** RPROMOTER: right-pointing arrow with a tab. @see shapes.c:1741-1777 */
|
|
113
|
+
export function drawRpromoter(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
114
|
+
const w = b[3]!.y - b[4]!.y, hw = (b[2]!.x - b[3]!.x) / 2;
|
|
115
|
+
const lx = b[1]!.x - hw, rx = b[2]!.x + hw;
|
|
116
|
+
renderShapePolygon([
|
|
117
|
+
{ x: lx, y: b[1]!.y - w / 2 },
|
|
118
|
+
{ x: b[3]!.x, y: b[3]!.y - w / 2 },
|
|
119
|
+
{ x: af[2]!.x, y: af[2]!.y },
|
|
120
|
+
{ x: rx, y: af[2]!.y },
|
|
121
|
+
{ x: rx, y: af[2]!.y + w / 2 },
|
|
122
|
+
{ x: lx, y: af[2]!.y + w / 2 },
|
|
123
|
+
{ x: lx, y: af[3]!.y },
|
|
124
|
+
{ x: af[0]!.x, y: af[0]!.y - (af[0]!.y - af[3]!.y) / 2 },
|
|
125
|
+
{ x: lx, y: af[0]!.y },
|
|
126
|
+
], coord, ctx, filled);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** RARROW: right-pointing arrow. @see shapes.c:1781-1813 */
|
|
130
|
+
export function drawRarrow(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
131
|
+
const w = b[3]!.y - b[4]!.y, lx = b[1]!.x - (b[2]!.x - b[3]!.x) / 2;
|
|
132
|
+
renderShapePolygon([
|
|
133
|
+
{ x: lx, y: b[1]!.y - w / 2 },
|
|
134
|
+
{ x: b[3]!.x, y: b[3]!.y - w / 2 },
|
|
135
|
+
{ x: af[2]!.x, y: af[2]!.y + w / 2 },
|
|
136
|
+
{ x: lx, y: af[2]!.y + w / 2 },
|
|
137
|
+
{ x: lx, y: af[3]!.y },
|
|
138
|
+
{ x: af[0]!.x, y: af[0]!.y - (af[0]!.y - af[3]!.y) / 2 },
|
|
139
|
+
{ x: lx, y: af[0]!.y },
|
|
140
|
+
], coord, ctx, filled);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Shared head of LARROW / LPROMOTER (D[0..5], left-pointing arrow body). */
|
|
144
|
+
function leftArrowHead(af: Point[], b: Point[]): Point[] {
|
|
145
|
+
const w = b[3]!.y - b[4]!.y, rx = b[2]!.x + (b[2]!.x - b[3]!.x) / 2;
|
|
146
|
+
return [
|
|
147
|
+
{ x: af[0]!.x, y: af[0]!.y - w / 2 },
|
|
148
|
+
{ x: rx, y: af[0]!.y - w / 2 },
|
|
149
|
+
{ x: rx, y: b[2]!.y },
|
|
150
|
+
{ x: af[1]!.x, y: af[1]!.y - (af[1]!.y - af[2]!.y) / 2 },
|
|
151
|
+
{ x: rx, y: af[2]!.y },
|
|
152
|
+
{ x: rx, y: af[2]!.y + w / 2 },
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** LARROW: left-pointing arrow. @see shapes.c:1817-1847 */
|
|
157
|
+
export function drawLarrow(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
158
|
+
const w = b[3]!.y - b[4]!.y;
|
|
159
|
+
const D = leftArrowHead(af, b);
|
|
160
|
+
D.push({ x: af[0]!.x, y: af[3]!.y + w / 2 });
|
|
161
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** LPROMOTER: left-pointing arrow with a tab. @see shapes.c:1851-1887 */
|
|
165
|
+
export function drawLpromoter(af: Point[], b: Point[], coord: Point, filled: boolean, ctx: ShapeCtx): void {
|
|
166
|
+
const w = b[3]!.y - b[4]!.y, lx = b[1]!.x - (b[2]!.x - b[3]!.x) / 2;
|
|
167
|
+
const D = leftArrowHead(af, b);
|
|
168
|
+
D.push({ x: lx, y: af[3]!.y + w / 2 }, { x: lx, y: af[3]!.y }, { x: af[3]!.x, y: af[3]!.y });
|
|
169
|
+
renderShapePolygon(D, coord, ctx, filled);
|
|
170
|
+
}
|