@knowvah/dot-engine 2.10.3 → 2.11.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/dist/gvc/context.d.ts.map +1 -1
- package/dist/gvc/emit-xdot.d.ts.map +1 -1
- package/dist/gvc/layout-reset.d.ts +38 -1
- package/dist/gvc/layout-reset.d.ts.map +1 -1
- package/dist/index.js +1191 -372
- package/dist/index.js.map +4 -4
- package/dist/layout/circo/circular.d.ts.map +1 -1
- package/dist/layout/dot/edge-route-helpers.d.ts +6 -1
- package/dist/layout/dot/edge-route-helpers.d.ts.map +1 -1
- package/dist/layout/dot/edge-route-rank.d.ts +4 -1
- package/dist/layout/dot/edge-route-rank.d.ts.map +1 -1
- package/dist/layout/dot/index.d.ts.map +1 -1
- package/dist/layout/dot/init.d.ts.map +1 -1
- package/dist/layout/fdp/cluster-edges.d.ts +11 -0
- package/dist/layout/fdp/cluster-edges.d.ts.map +1 -1
- package/dist/layout/neato/closest.d.ts +20 -0
- package/dist/layout/neato/closest.d.ts.map +1 -0
- package/dist/layout/neato/constrained-majorization.d.ts +13 -0
- package/dist/layout/neato/constrained-majorization.d.ts.map +1 -1
- package/dist/layout/neato/embed-graph.d.ts +20 -0
- package/dist/layout/neato/embed-graph.d.ts.map +1 -0
- package/dist/layout/neato/fdp-adjust.d.ts.map +1 -1
- package/dist/layout/neato/index.d.ts.map +1 -1
- package/dist/layout/neato/init-dim.d.ts +54 -0
- package/dist/layout/neato/init-dim.d.ts.map +1 -0
- package/dist/layout/neato/init.d.ts +1 -11
- package/dist/layout/neato/init.d.ts.map +1 -1
- package/dist/layout/neato/kk.d.ts +4 -2
- package/dist/layout/neato/kk.d.ts.map +1 -1
- package/dist/layout/neato/matrix-ops-dense.d.ts +34 -0
- package/dist/layout/neato/matrix-ops-dense.d.ts.map +1 -0
- package/dist/layout/neato/pca.d.ts +14 -0
- package/dist/layout/neato/pca.d.ts.map +1 -0
- package/dist/layout/neato/sgd.d.ts +2 -3
- package/dist/layout/neato/sgd.d.ts.map +1 -1
- package/dist/layout/neato/start.d.ts +5 -5
- package/dist/layout/neato/start.d.ts.map +1 -1
- package/dist/layout/neato/stress-kernel.d.ts +10 -2
- package/dist/layout/neato/stress-kernel.d.ts.map +1 -1
- package/dist/layout/neato/stress-subspace.d.ts +39 -0
- package/dist/layout/neato/stress-subspace.d.ts.map +1 -0
- package/dist/layout/neato/vpsc-adjust.d.ts.map +1 -1
- package/dist/layout/pack/ccomps.d.ts +4 -2
- package/dist/layout/pack/ccomps.d.ts.map +1 -1
- package/dist/layout/sfdp/index.d.ts.map +1 -1
- package/dist/layout/sfdp/init.d.ts +6 -7
- package/dist/layout/sfdp/init.d.ts.map +1 -1
- package/dist/layout/twopi/circle.d.ts.map +1 -1
- package/dist/layout/twopi/index.d.ts.map +1 -1
- package/dist/render/dot/attrs.d.ts +7 -0
- package/dist/render/dot/attrs.d.ts.map +1 -1
- package/dist/render.js +1574 -755
- package/dist/render.js.map +4 -4
- package/package.json +4 -4
- package/src/gvc/__fixtures__/rerender/abom-shift-pack.dot.plain.nofree.1 +20 -0
- package/src/gvc/__fixtures__/rerender/abom-shift-pack.dot.plain.nofree.2 +20 -0
- package/src/gvc/__fixtures__/rerender/abom-shift-pack.dot.plain.nofree.3 +20 -0
- package/src/gvc/__fixtures__/rerender/abom-shift-pack.gv +1 -0
- package/src/gvc/__fixtures__/rerender/abom-shift-parity.dot.plain.nofree.1 +22 -0
- package/src/gvc/__fixtures__/rerender/abom-shift-parity.dot.plain.nofree.2 +22 -0
- package/src/gvc/__fixtures__/rerender/abom-shift-parity.dot.plain.nofree.3 +22 -0
- package/src/gvc/__fixtures__/rerender/abom-shift-parity.gv +1 -0
- package/src/gvc/__fixtures__/rerender/abom-shift.dot.plain.nofree.1 +13 -0
- package/src/gvc/__fixtures__/rerender/abom-shift.dot.plain.nofree.2 +13 -0
- package/src/gvc/__fixtures__/rerender/abom-shift.dot.plain.nofree.3 +13 -0
- package/src/gvc/__fixtures__/rerender/abom-shift.gv +1 -0
- package/src/gvc/__fixtures__/rerender/cluster-edge-splines.fdp.plain.1 +10 -0
- package/src/gvc/__fixtures__/rerender/cluster-edge-splines.fdp.plain.2 +11 -0
- package/src/gvc/__fixtures__/rerender/cluster-edge-splines.gv +9 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.dot.1 +40 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.dot.2 +40 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.plain.noaddr.1 +15 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.plain.noaddr.2 +17 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.seq-dot-plain.1 +40 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.seq-dot-plain.2 +15 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.seq-dot-svg.1 +40 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.seq-dot-svg.2 +99 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.seq-json-json.1 +489 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.seq-json-json.2 +503 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.seq-nofree-dot-svg.1 +40 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.seq-nofree-dot-svg.2 +109 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.xdot.1 +69 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.fdp.xdot.2 +70 -0
- package/src/gvc/__fixtures__/rerender/cluster-edges.gv +15 -0
- package/src/gvc/__fixtures__/rerender/fdp-1581.fdp.dot.1 +104 -0
- package/src/gvc/__fixtures__/rerender/fdp-1581.fdp.dot.2 +104 -0
- package/src/gvc/__fixtures__/rerender/fdp-1581.gv +26 -0
- package/src/gvc/__fixtures__/rerender/flat-rev-stale.dot.plain.nofree.1 +34 -0
- package/src/gvc/__fixtures__/rerender/flat-rev-stale.dot.plain.nofree.2 +34 -0
- package/src/gvc/__fixtures__/rerender/flat-rev-stale.dot.plain.nofree.3 +34 -0
- package/src/gvc/__fixtures__/rerender/flat-rev-stale.gv +33 -0
- package/src/gvc/__fixtures__/rerender/multi-edge.dot.svg.nofree.1 +181 -0
- package/src/gvc/__fixtures__/rerender/multi-edge.dot.svg.nofree.2 +218 -0
- package/src/gvc/__fixtures__/rerender/multi-edge.dot.svg.nofree.3 +255 -0
- package/src/gvc/__fixtures__/rerender/regen.sh +25 -0
- package/src/gvc/context.ts +7 -2
- package/src/gvc/emit-xdot.ts +37 -7
- package/src/gvc/layout-reset.ts +59 -1
- package/src/layout/circo/circular.ts +3 -1
- package/src/layout/dot/edge-route-helpers.ts +8 -2
- package/src/layout/dot/edge-route-rank.ts +20 -2
- package/src/layout/dot/index.ts +17 -2
- package/src/layout/dot/init.ts +9 -17
- package/src/layout/dot/splines-flat.ts +12 -12
- package/src/layout/fdp/cluster-edges.ts +0 -0
- package/src/layout/neato/__fixtures__/dim/circuit-dim3.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/circuit-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/circuit-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/circuit-dim3.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/dim11-dimen11.dot +32 -0
- package/src/layout/neato/__fixtures__/dim/dim11-dimen11.gv +11 -0
- package/src/layout/neato/__fixtures__/dim/dim11-dimen11.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/dim11-dimen11.xdot +53 -0
- package/src/layout/neato/__fixtures__/dim/dim3-dimen3.dot +32 -0
- package/src/layout/neato/__fixtures__/dim/dim3-dimen3.gv +11 -0
- package/src/layout/neato/__fixtures__/dim/dim3-dimen3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/dim3-dimen3.xdot +53 -0
- package/src/layout/neato/__fixtures__/dim/dim3.dot +31 -0
- package/src/layout/neato/__fixtures__/dim/dim3.gv +10 -0
- package/src/layout/neato/__fixtures__/dim/dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/dim3.xdot +52 -0
- package/src/layout/neato/__fixtures__/dim/dim4-dimen4.dot +32 -0
- package/src/layout/neato/__fixtures__/dim/dim4-dimen4.gv +11 -0
- package/src/layout/neato/__fixtures__/dim/dim4-dimen4.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/dim4-dimen4.xdot +53 -0
- package/src/layout/neato/__fixtures__/dim/dimen3.dot +31 -0
- package/src/layout/neato/__fixtures__/dim/dimen3.gv +10 -0
- package/src/layout/neato/__fixtures__/dim/dimen3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/dimen3.xdot +52 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-dim3.dot +267 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-dim3.gv +84 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-dim3.xdot +468 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-dim4.dot +267 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-dim4.gv +84 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-dim4.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-dim4.xdot +468 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-subset-dim3.dot +268 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-subset-dim3.gv +85 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-subset-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-big-subset-dim3.xdot +469 -0
- package/src/layout/neato/__fixtures__/dim/hier-big110-dim3.dot +484 -0
- package/src/layout/neato/__fixtures__/dim/hier-big110-dim3.gv +151 -0
- package/src/layout/neato/__fixtures__/dim/hier-big110-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-big110-dim3.xdot +852 -0
- package/src/layout/neato/__fixtures__/dim/hier-circuit-dim3.dot +34 -0
- package/src/layout/neato/__fixtures__/dim/hier-circuit-dim3.gv +13 -0
- package/src/layout/neato/__fixtures__/dim/hier-circuit-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-circuit-dim3.xdot +55 -0
- package/src/layout/neato/__fixtures__/dim/hier-dim3.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/hier-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/hier-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-dim3.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/hier-dim4.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/hier-dim4.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/hier-dim4.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-dim4.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/hier-dirnone-dim2.dot +32 -0
- package/src/layout/neato/__fixtures__/dim/hier-dirnone-dim2.gv +11 -0
- package/src/layout/neato/__fixtures__/dim/hier-dirnone-dim2.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-dirnone-dim2.xdot +53 -0
- package/src/layout/neato/__fixtures__/dim/hier-dirnone-dim3.dot +34 -0
- package/src/layout/neato/__fixtures__/dim/hier-dirnone-dim3.gv +13 -0
- package/src/layout/neato/__fixtures__/dim/hier-dirnone-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-dirnone-dim3.xdot +55 -0
- package/src/layout/neato/__fixtures__/dim/hier-len-dim3.dot +37 -0
- package/src/layout/neato/__fixtures__/dim/hier-len-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/hier-len-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-len-dim3.xdot +58 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-big.dot +141 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-big.gv +48 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-big.stderr +1 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-big.xdot +233 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim2.dot +21 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim2.gv +8 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim2.stderr +1 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim2.xdot +33 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim3.dot +23 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim3.gv +10 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim3.stderr +1 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim3.xdot +35 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim4.dot +23 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim4.gv +10 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim4.stderr +1 -0
- package/src/layout/neato/__fixtures__/dim/hier-noedge-dim4.xdot +35 -0
- package/src/layout/neato/__fixtures__/dim/hier-nohier-dim2.dot +26 -0
- package/src/layout/neato/__fixtures__/dim/hier-nohier-dim2.gv +7 -0
- package/src/layout/neato/__fixtures__/dim/hier-nohier-dim2.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-nohier-dim2.xdot +44 -0
- package/src/layout/neato/__fixtures__/dim/hier-nohier-dim3.dot +28 -0
- package/src/layout/neato/__fixtures__/dim/hier-nohier-dim3.gv +9 -0
- package/src/layout/neato/__fixtures__/dim/hier-nohier-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-nohier-dim3.xdot +46 -0
- package/src/layout/neato/__fixtures__/dim/hier-pack-dim3.dot +48 -0
- package/src/layout/neato/__fixtures__/dim/hier-pack-dim3.gv +15 -0
- package/src/layout/neato/__fixtures__/dim/hier-pack-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-pack-dim3.xdot +79 -0
- package/src/layout/neato/__fixtures__/dim/hier-ring-dim3.dot +56 -0
- package/src/layout/neato/__fixtures__/dim/hier-ring-dim3.gv +17 -0
- package/src/layout/neato/__fixtures__/dim/hier-ring-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-ring-dim3.xdot +94 -0
- package/src/layout/neato/__fixtures__/dim/hier-star-dim3.dot +47 -0
- package/src/layout/neato/__fixtures__/dim/hier-star-dim3.gv +14 -0
- package/src/layout/neato/__fixtures__/dim/hier-star-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-star-dim3.xdot +78 -0
- package/src/layout/neato/__fixtures__/dim/hier-stresswt1-dim3.dot +34 -0
- package/src/layout/neato/__fixtures__/dim/hier-stresswt1-dim3.gv +13 -0
- package/src/layout/neato/__fixtures__/dim/hier-stresswt1-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-stresswt1-dim3.xdot +55 -0
- package/src/layout/neato/__fixtures__/dim/hier-stresswt1-dim4.dot +34 -0
- package/src/layout/neato/__fixtures__/dim/hier-stresswt1-dim4.gv +13 -0
- package/src/layout/neato/__fixtures__/dim/hier-stresswt1-dim4.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-stresswt1-dim4.xdot +55 -0
- package/src/layout/neato/__fixtures__/dim/hier-subset-dim3.dot +34 -0
- package/src/layout/neato/__fixtures__/dim/hier-subset-dim3.gv +13 -0
- package/src/layout/neato/__fixtures__/dim/hier-subset-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-subset-dim3.xdot +55 -0
- package/src/layout/neato/__fixtures__/dim/hier-two-dim3.dot +15 -0
- package/src/layout/neato/__fixtures__/dim/hier-two-dim3.gv +6 -0
- package/src/layout/neato/__fixtures__/dim/hier-two-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/hier-two-dim3.xdot +22 -0
- package/src/layout/neato/__fixtures__/dim/ipsep-dim3.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/ipsep-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/ipsep-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/ipsep-dim3.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/kk-dim3.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/kk-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/kk-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/kk-dim3.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/kk-dim4-dimen4.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/kk-dim4-dimen4.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/kk-dim4-dimen4.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/kk-dim4-dimen4.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/kk-pins-dim3.dot +39 -0
- package/src/layout/neato/__fixtures__/dim/kk-pins-dim3.gv +15 -0
- package/src/layout/neato/__fixtures__/dim/kk-pins-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/kk-pins-dim3.xdot +60 -0
- package/src/layout/neato/__fixtures__/dim/overlap-false-dim3.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/overlap-false-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/overlap-false-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/overlap-false-dim3.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/overlap-scale-dim3.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/overlap-scale-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/overlap-scale-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/overlap-scale-dim3.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/overlap-vpsc-dim3.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/overlap-vpsc-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/overlap-vpsc-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/overlap-vpsc-dim3.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/pack-dim3.dot +47 -0
- package/src/layout/neato/__fixtures__/dim/pack-dim3.gv +14 -0
- package/src/layout/neato/__fixtures__/dim/pack-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/pack-dim3.xdot +78 -0
- package/src/layout/neato/__fixtures__/dim/pins-dim3.dot +38 -0
- package/src/layout/neato/__fixtures__/dim/pins-dim3.gv +14 -0
- package/src/layout/neato/__fixtures__/dim/pins-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/pins-dim3.xdot +59 -0
- package/src/layout/neato/__fixtures__/dim/regen.sh +24 -0
- package/src/layout/neato/__fixtures__/dim/regular-dim3.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/regular-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/regular-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/regular-dim3.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/sgd-dim3.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/sgd-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/sgd-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/sgd-dim3.xdot +54 -0
- package/src/layout/neato/__fixtures__/dim/smart-units.json +16 -0
- package/src/layout/neato/__fixtures__/dim/subset-dim3.dot +33 -0
- package/src/layout/neato/__fixtures__/dim/subset-dim3.gv +12 -0
- package/src/layout/neato/__fixtures__/dim/subset-dim3.stderr +0 -0
- package/src/layout/neato/__fixtures__/dim/subset-dim3.xdot +54 -0
- package/src/layout/neato/closest.ts +206 -0
- package/src/layout/neato/constrained-majorization.ts +4 -23
- package/src/layout/neato/embed-graph.ts +81 -0
- package/src/layout/neato/fdp-adjust.ts +22 -8
- package/src/layout/neato/index.ts +26 -17
- package/src/layout/neato/init-dim.ts +165 -0
- package/src/layout/neato/init.ts +9 -35
- package/src/layout/neato/kk.ts +47 -41
- package/src/layout/neato/matrix-ops-dense.ts +232 -0
- package/src/layout/neato/pca.ts +60 -0
- package/src/layout/neato/sgd.ts +11 -4
- package/src/layout/neato/start.ts +8 -5
- package/src/layout/neato/stress-kernel.ts +65 -5
- package/src/layout/neato/stress-subspace.ts +371 -0
- package/src/layout/neato/vpsc-adjust.ts +3 -1
- package/src/layout/pack/__fixtures__/cc-reuse/circo.dot +23 -0
- package/src/layout/pack/__fixtures__/cc-reuse/circo.gv +1 -0
- package/src/layout/pack/__fixtures__/cc-reuse/circo.stderr +0 -0
- package/src/layout/pack/__fixtures__/cc-reuse/circo.xdot +38 -0
- package/src/layout/pack/__fixtures__/cc-reuse/neato.dot +23 -0
- package/src/layout/pack/__fixtures__/cc-reuse/neato.gv +1 -0
- package/src/layout/pack/__fixtures__/cc-reuse/neato.stderr +0 -0
- package/src/layout/pack/__fixtures__/cc-reuse/neato.xdot +38 -0
- package/src/layout/pack/__fixtures__/cc-reuse/osage.dot +23 -0
- package/src/layout/pack/__fixtures__/cc-reuse/osage.gv +1 -0
- package/src/layout/pack/__fixtures__/cc-reuse/osage.stderr +0 -0
- package/src/layout/pack/__fixtures__/cc-reuse/osage.xdot +38 -0
- package/src/layout/pack/__fixtures__/cc-reuse/regen.sh +24 -0
- package/src/layout/pack/__fixtures__/cc-reuse/sfdp.dot +21 -0
- package/src/layout/pack/__fixtures__/cc-reuse/sfdp.gv +1 -0
- package/src/layout/pack/__fixtures__/cc-reuse/sfdp.stderr +0 -0
- package/src/layout/pack/__fixtures__/cc-reuse/sfdp.xdot +36 -0
- package/src/layout/pack/__fixtures__/cc-reuse/twopi.dot +21 -0
- package/src/layout/pack/__fixtures__/cc-reuse/twopi.gv +1 -0
- package/src/layout/pack/__fixtures__/cc-reuse/twopi.stderr +1 -0
- package/src/layout/pack/__fixtures__/cc-reuse/twopi.xdot +36 -0
- package/src/layout/pack/ccomps.ts +34 -6
- package/src/layout/sfdp/__fixtures__/dim/dim3-dimen3.dot +32 -0
- package/src/layout/sfdp/__fixtures__/dim/dim3-dimen3.gv +11 -0
- package/src/layout/sfdp/__fixtures__/dim/dim3-dimen3.stderr +0 -0
- package/src/layout/sfdp/__fixtures__/dim/dim3-dimen3.xdot +53 -0
- package/src/layout/sfdp/__fixtures__/dim/dim3.dot +31 -0
- package/src/layout/sfdp/__fixtures__/dim/dim3.gv +10 -0
- package/src/layout/sfdp/__fixtures__/dim/dim3.stderr +0 -0
- package/src/layout/sfdp/__fixtures__/dim/dim3.xdot +52 -0
- package/src/layout/sfdp/__fixtures__/dim/dim4-dimen4.dot +32 -0
- package/src/layout/sfdp/__fixtures__/dim/dim4-dimen4.gv +11 -0
- package/src/layout/sfdp/__fixtures__/dim/dim4-dimen4.stderr +0 -0
- package/src/layout/sfdp/__fixtures__/dim/dim4-dimen4.xdot +53 -0
- package/src/layout/sfdp/__fixtures__/dim/overlap-prism-dim3.dot +33 -0
- package/src/layout/sfdp/__fixtures__/dim/overlap-prism-dim3.gv +12 -0
- package/src/layout/sfdp/__fixtures__/dim/overlap-prism-dim3.stderr +0 -0
- package/src/layout/sfdp/__fixtures__/dim/overlap-prism-dim3.xdot +54 -0
- package/src/layout/sfdp/__fixtures__/dim/regen.sh +24 -0
- package/src/layout/sfdp/index.ts +15 -10
- package/src/layout/sfdp/init.ts +26 -11
- package/src/layout/twopi/circle.ts +5 -1
- package/src/layout/twopi/index.ts +3 -0
- package/src/render/dot/agwrite.ts +2 -2
- package/src/render/dot/attrs.ts +16 -0
- package/src/render/dot/write-back.ts +2 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
graph G {
|
|
2
|
+
graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 290.05 248.74 290.05 248.74 0 ",
|
|
3
|
+
bb="0,0,248.74,290.05",
|
|
4
|
+
dim=3,
|
|
5
|
+
dimen=3,
|
|
6
|
+
overlap=prism,
|
|
7
|
+
xdotversion=1.7
|
|
8
|
+
];
|
|
9
|
+
node [label="\N"];
|
|
10
|
+
a [_draw_="c 7 -#000000 e 81.11 195.63 27 18 ",
|
|
11
|
+
_ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 81.11 191.43 0 6.21 1 -a ",
|
|
12
|
+
height=0.5,
|
|
13
|
+
pos="81.115,195.63,-712.58",
|
|
14
|
+
width=0.75];
|
|
15
|
+
b [_draw_="c 7 -#000000 e 27 272.05 27 18 ",
|
|
16
|
+
_ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 27 267.85 0 7 1 -b ",
|
|
17
|
+
height=0.5,
|
|
18
|
+
pos="27,272.05,-746.78",
|
|
19
|
+
width=0.75];
|
|
20
|
+
a -- b [_draw_="c 7 -#000000 B 4 69.37 212.21 60.3 225.03 47.79 242.69 38.72 255.5 ",
|
|
21
|
+
pos="69.373,212.21 60.296,225.03 47.79,242.69 38.719,255.5"];
|
|
22
|
+
c [_draw_="c 7 -#000000 e 85.4 226.11 27 18 ",
|
|
23
|
+
_ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 85.4 221.91 0 6.21 1 -c ",
|
|
24
|
+
height=0.5,
|
|
25
|
+
pos="85.401,226.11,-801.24",
|
|
26
|
+
width=0.75];
|
|
27
|
+
a -- c [_draw_="c 7 -#000000 B 4 83.66 213.71 83.67 213.82 83.69 213.92 83.7 214.02 ",
|
|
28
|
+
pos="83.658,213.71 83.672,213.82 83.686,213.92 83.701,214.02"];
|
|
29
|
+
b -- c [_draw_="c 7 -#000000 B 4 44.84 258.01 52.09 252.31 60.44 245.75 67.67 240.06 ",
|
|
30
|
+
pos="44.84,258.01 52.085,252.31 60.436,245.75 67.671,240.06"];
|
|
31
|
+
d [_draw_="c 7 -#000000 e 156.36 144.76 27 18 ",
|
|
32
|
+
_ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 156.36 140.56 0 7 1 -d ",
|
|
33
|
+
height=0.5,
|
|
34
|
+
pos="156.36,144.76,-803.5",
|
|
35
|
+
width=0.75];
|
|
36
|
+
c -- d [_draw_="c 7 -#000000 B 4 99.08 210.42 111.57 196.11 129.93 175.06 142.47 160.67 ",
|
|
37
|
+
pos="99.082,210.42 111.57,196.11 129.93,175.06 142.47,160.67"];
|
|
38
|
+
e [_draw_="c 7 -#000000 e 160.26 102.33 27 18 ",
|
|
39
|
+
_ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 160.26 98.13 0 6.21 1 -e ",
|
|
40
|
+
height=0.5,
|
|
41
|
+
pos="160.26,102.33,-708.71",
|
|
42
|
+
width=0.75];
|
|
43
|
+
d -- e [_draw_="c 7 -#000000 B 4 158.03 126.52 158.22 124.54 158.4 122.53 158.58 120.55 ",
|
|
44
|
+
pos="158.03,126.52 158.22,124.54 158.4,122.53 158.58,120.55"];
|
|
45
|
+
e -- a [_draw_="c 7 -#000000 B 4 146.83 118.16 132.28 135.32 109.19 162.54 94.61 179.73 ",
|
|
46
|
+
pos="146.83,118.16 132.28,135.32 109.19,162.54 94.606,179.73"];
|
|
47
|
+
f [_draw_="c 7 -#000000 e 221.74 18 27 18 ",
|
|
48
|
+
_ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 221.74 13.8 0 4.66 1 -f ",
|
|
49
|
+
height=0.5,
|
|
50
|
+
pos="221.74,18,-676.03",
|
|
51
|
+
width=0.75];
|
|
52
|
+
e -- f [_draw_="c 7 -#000000 B 4 172.11 86.07 182.93 71.23 198.84 49.41 209.72 34.5 ",
|
|
53
|
+
pos="172.11,86.072 182.93,71.234 198.84,49.409 209.72,34.498"];
|
|
54
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# SPDX-License-Identifier: EPL-2.0
|
|
3
|
+
# Regenerates these part-10 fixtures: graphviz 16.1.0 (oracle/16.1.0). One <case>.xdot,
|
|
4
|
+
# <case>.dot and <case>.stderr per <case>.gv. Engine sfdp. The .stderr is the -Txdot run's;
|
|
5
|
+
# regen reports a case whose -Tdot stderr differs. Inputs come from
|
|
6
|
+
# plans/post-16-1-followups-10/harness/T0/gen-fixtures.py.
|
|
7
|
+
#
|
|
8
|
+
# Usage: GVBINDIR=<full plugin dir> bash regen.sh
|
|
9
|
+
set -u
|
|
10
|
+
DOT=${DOT:-$HOME/git/graphviz/build/cmd/dot/dot}
|
|
11
|
+
cd "$(dirname "$0")"
|
|
12
|
+
for f in *.gv; do
|
|
13
|
+
c=${f%.gv}
|
|
14
|
+
e=sfdp
|
|
15
|
+
"$DOT" -K"$e" -Txdot "$f" > "$c.xdot" 2> "$c.stderr"
|
|
16
|
+
rc=$?
|
|
17
|
+
[ "$rc" -eq 0 ] || echo "$c: xdot exit $rc"
|
|
18
|
+
err=$(mktemp)
|
|
19
|
+
"$DOT" -K"$e" -Tdot "$f" > "$c.dot" 2> "$err"
|
|
20
|
+
rc=$?
|
|
21
|
+
[ "$rc" -eq 0 ] || echo "$c: dot exit $rc"
|
|
22
|
+
cmp -s "$c.stderr" "$err" || echo "$c: dot stderr differs"
|
|
23
|
+
rm -f "$err"
|
|
24
|
+
done
|
package/src/layout/sfdp/index.ts
CHANGED
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
import type { Graph } from '../../model/graph.js';
|
|
15
15
|
import type { LayoutEngine } from '../../gvc/context.js';
|
|
16
|
+
import { agdelsubg } from '../../model/cgraph-ops.js';
|
|
16
17
|
import { csrand } from '../../common/crand.js';
|
|
17
18
|
import { graphInit } from '../../common/graph-init.js';
|
|
18
19
|
import { setEdgeTypeFromAttr } from '../dot/index.js';
|
|
19
20
|
import { EDGETYPE_LINE, splineEdgesShifted } from '../neato/splines.js';
|
|
21
|
+
import { ndimOf } from '../neato/init-dim.js';
|
|
20
22
|
import { sepFactor, DFLT_MARGIN } from '../neato/sep-factor.js';
|
|
21
23
|
import {
|
|
22
24
|
ccomps,
|
|
@@ -50,9 +52,6 @@ import {
|
|
|
50
52
|
export { sfdpInitGraph, sfdpCleanup, tuneControl, makeMatrix, getSizes, getPos };
|
|
51
53
|
export { multilevelSpringElectricalEmbedding };
|
|
52
54
|
|
|
53
|
-
/** GD_ndim is fixed at 2 — see sfdpInitGraph. */
|
|
54
|
-
const DIM = 2;
|
|
55
|
-
|
|
56
55
|
/**
|
|
57
56
|
* Lay out one connected graph: adjacency matrix, label half-sizes,
|
|
58
57
|
* starting positions, the multilevel embedding, ND_pos write-back.
|
|
@@ -61,16 +60,17 @@ const DIM = 2;
|
|
|
61
60
|
export function sfdpLayoutComponent(
|
|
62
61
|
g: Graph, ctrl: SpringElectricalControl, pad: { x: number; y: number },
|
|
63
62
|
): void {
|
|
63
|
+
const ndim = ndimOf(g);
|
|
64
64
|
const A = makeMatrix(g);
|
|
65
65
|
// edge_labeling_scheme > 0 (|edgelabel| nodes) is not ported.
|
|
66
|
-
const sizes = ctrl.overlap >= 0 ? getSizes(g, pad) : null;
|
|
67
|
-
const pos = getPos(g,
|
|
66
|
+
const sizes = ctrl.overlap >= 0 ? getSizes(g, pad, ndim) : null;
|
|
67
|
+
const pos = getPos(g, ndim);
|
|
68
68
|
|
|
69
|
-
multilevelSpringElectricalEmbedding(
|
|
69
|
+
multilevelSpringElectricalEmbedding(ndim, A, ctrl, sizes, pos);
|
|
70
70
|
|
|
71
71
|
for (const n of g.nodes.values()) {
|
|
72
72
|
const i = n.info.id!;
|
|
73
|
-
n.info.pos =
|
|
73
|
+
n.info.pos = pos.slice(i * ndim, (i + 1) * ndim);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -100,7 +100,10 @@ function resolveControl(g: Graph): {
|
|
|
100
100
|
const flag = overlap === undefined ? 'prism0' : overlap;
|
|
101
101
|
warnUnrecognizedOverlap(flag); // graphAdjustMode → getAdjustMode, once per layout
|
|
102
102
|
const ntry = overlapPrismTries(flag);
|
|
103
|
-
|
|
103
|
+
// C: `int doAdjust = Ndim == 2;` — in 3 or more dimensions no overlap is
|
|
104
|
+
// removed at all (ctrl.overlap = -1 and no removeOverlapWith).
|
|
105
|
+
const doAdjust = ndimOf(g) === 2;
|
|
106
|
+
if (ntry !== null && doAdjust) {
|
|
104
107
|
// AM_PRISM && doAdjust: overlap removal happens inside sfdp.
|
|
105
108
|
ctrl.overlap = ntry;
|
|
106
109
|
ctrl.initialScaling = lateDouble(
|
|
@@ -112,9 +115,10 @@ function resolveControl(g: Graph): {
|
|
|
112
115
|
}
|
|
113
116
|
return { ctrl, pad, doAdjust: false };
|
|
114
117
|
}
|
|
115
|
-
// Non-PRISM: turn off in-sfdp removal; run removeOverlapWith
|
|
118
|
+
// Non-PRISM (or Ndim != 2): turn off in-sfdp removal; run removeOverlapWith
|
|
119
|
+
// after layout only when doAdjust.
|
|
116
120
|
ctrl.overlap = -1;
|
|
117
|
-
return { ctrl, pad, doAdjust
|
|
121
|
+
return { ctrl, pad, doAdjust };
|
|
118
122
|
}
|
|
119
123
|
|
|
120
124
|
/**
|
|
@@ -218,6 +222,7 @@ export function sfdpLayout(g: Graph): void {
|
|
|
218
222
|
} else {
|
|
219
223
|
layoutComponents(g, comps, ctrl, pad, doAdjust);
|
|
220
224
|
}
|
|
225
|
+
for (const c of comps) agdelsubg(g, c); // @see lib/sfdpgen/sfdpinit.c:289
|
|
221
226
|
}
|
|
222
227
|
|
|
223
228
|
postprocess(g, singleComponent);
|
package/src/layout/sfdp/init.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { Graph } from '../../model/graph.js';
|
|
|
15
15
|
import { setEdgeTypeFromAttr } from '../dot/index.js';
|
|
16
16
|
import { EDGETYPE_LINE } from '../neato/splines.js';
|
|
17
17
|
import { neatoInitNode } from '../neato/init.js';
|
|
18
|
+
import { DFLT_DIM, MAXDIM } from '../neato/init-dim.js';
|
|
18
19
|
import {
|
|
19
20
|
commonInitNodeEdge, lateDouble, lateInt, layoutMeasurer,
|
|
20
21
|
} from '../../common/nodeinit.js';
|
|
@@ -47,9 +48,22 @@ const ELSCHEME_PENALTY2 = 2;
|
|
|
47
48
|
const EDGE_LABEL_NODE_PREFIX = '|edgelabel|';
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
|
-
*
|
|
51
|
-
* GD_ndim
|
|
52
|
-
*
|
|
51
|
+
* Read `dimen`, then `dim`, clamp at MAXDIM, into the root's `ndim` and `odim`
|
|
52
|
+
* (C's GD_ndim, GD_odim and the global Ndim).
|
|
53
|
+
* @see lib/sfdpgen/sfdpinit.c:sfdp_init_graph
|
|
54
|
+
*/
|
|
55
|
+
function sfdpInitDim(g: Graph): number {
|
|
56
|
+
const root = g.root;
|
|
57
|
+
const outdim = lateInt(aggetGraph(g, 'dimen'), DFLT_DIM, 2);
|
|
58
|
+
const ndim = Math.min(lateInt(aggetGraph(g, 'dim'), outdim, 2), MAXDIM);
|
|
59
|
+
root.info.ndim = ndim;
|
|
60
|
+
root.info.odim = Math.min(outdim, ndim);
|
|
61
|
+
return ndim;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Graph-level init: line edges, the layout dimension from `dimen` and `dim`
|
|
66
|
+
* (root `ndim`, `odim`), per-node neato init sized to it.
|
|
53
67
|
* @see lib/sfdpgen/sfdpinit.c:sfdp_init_graph
|
|
54
68
|
* @see lib/sfdpgen/sfdpinit.c:sfdp_init_node_edge
|
|
55
69
|
*/
|
|
@@ -59,8 +73,9 @@ export function sfdpInitGraph(g: Graph): void {
|
|
|
59
73
|
// setEdgeType FUNCTION (utils.c:1423): reads `splines`, LINE is the default.
|
|
60
74
|
// @see lib/sfdpgen/sfdpinit.c:54
|
|
61
75
|
setEdgeTypeFromAttr(g, EDGETYPE_LINE);
|
|
76
|
+
const ndim = sfdpInitDim(g);
|
|
62
77
|
commonInitNodeEdge(g); // common_init_node inside neato_init_node
|
|
63
|
-
for (const n of g.nodes.values()) neatoInitNode(n);
|
|
78
|
+
for (const n of g.nodes.values()) neatoInitNode(n, ndim);
|
|
64
79
|
// C sfdp_init_node_edge runs a second loop over out-edges calling
|
|
65
80
|
// sfdp_init_edge -> common_init_edge: it creates ED_label(e) and ORs
|
|
66
81
|
// GD_has_labels with EDGE_LABEL, which is what lets addXLabels (in
|
|
@@ -228,17 +243,17 @@ export function makeMatrix(g: Graph): SpMatrix {
|
|
|
228
243
|
}
|
|
229
244
|
|
|
230
245
|
/**
|
|
231
|
-
* Half node sizes plus padding, in inches, indexed by ND_id
|
|
232
|
-
* The |edgelabel| branch (edge_labeling_scheme > 0) is
|
|
233
|
-
* no supported input sets label_scheme.
|
|
246
|
+
* Half node sizes plus padding, in inches, indexed by ND_id, `ndim` apart
|
|
247
|
+
* (x, y, then zeros). The |edgelabel| branch (edge_labeling_scheme > 0) is
|
|
248
|
+
* not ported — no supported input sets label_scheme.
|
|
234
249
|
* @see lib/neatogen/adjust.c:getSizes (15.0.0)
|
|
235
250
|
*/
|
|
236
|
-
export function getSizes(g: Graph, pad: { x: number; y: number }): number[] {
|
|
237
|
-
const sizes = new Array<number>(
|
|
251
|
+
export function getSizes(g: Graph, pad: { x: number; y: number }, ndim: number = DFLT_DIM): number[] {
|
|
252
|
+
const sizes = new Array<number>(ndim * g.nodes.size).fill(0);
|
|
238
253
|
for (const n of g.nodes.values()) {
|
|
239
254
|
const i = n.info.id!;
|
|
240
|
-
sizes[i *
|
|
241
|
-
sizes[i *
|
|
255
|
+
sizes[i * ndim] = (n.info.width ?? 0) * 0.5 + pad.x;
|
|
256
|
+
sizes[i * ndim + 1] = (n.info.height ?? 0) * 0.5 + pad.y;
|
|
242
257
|
}
|
|
243
258
|
return sizes;
|
|
244
259
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @see lib/twopigen/circle.h
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import { agerrorf } from '../../common/agerr.js';
|
|
11
12
|
import { InternalError } from '../../errors.js';
|
|
12
13
|
import type { Graph } from '../../model/graph.js';
|
|
13
14
|
import type { Node } from '../../model/node.js';
|
|
@@ -331,7 +332,10 @@ export function circleLayout(sg: Graph, center: Node | null): Node | null {
|
|
|
331
332
|
if (center === null) center = findCenterNode(sg);
|
|
332
333
|
if (center === null) return null;
|
|
333
334
|
const maxN = setParentNodes(sg, center);
|
|
334
|
-
if (maxN === Number.MAX_SAFE_INTEGER)
|
|
335
|
+
if (maxN === Number.MAX_SAFE_INTEGER) {
|
|
336
|
+
agerrorf('twopi: use of weight=0 creates disconnected component.');
|
|
337
|
+
return center;
|
|
338
|
+
}
|
|
335
339
|
setSubtreeSize(sg);
|
|
336
340
|
setSubtreeSpans(sg, center);
|
|
337
341
|
setPositions(sg, center);
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import type { Graph } from '../../model/graph.js';
|
|
10
10
|
import type { LayoutEngine } from '../../gvc/context.js';
|
|
11
11
|
import { twopiInitGraph, twopiCleanup } from './init.js';
|
|
12
|
+
import { agdelsubg } from '../../model/cgraph-ops.js';
|
|
12
13
|
import { ccomps, normalizeGraphBB } from '../pack/index.js';
|
|
13
14
|
import { layoutSingle, layoutMulti, buildPackInfo } from './pipeline.js';
|
|
14
15
|
import { commonInitNodeEdge, layoutMeasurer } from '../../common/nodeinit.js';
|
|
@@ -58,6 +59,8 @@ export function twopiLayout(g: Graph): void {
|
|
|
58
59
|
} else {
|
|
59
60
|
layoutMulti(g, comps, globalRoot, buildPackInfo(g));
|
|
60
61
|
}
|
|
62
|
+
// @see lib/twopigen/twopiinit.c:twopi_layout (agdelete of each component)
|
|
63
|
+
for (const c of comps) agdelsubg(g, c);
|
|
61
64
|
normalizeGraphBB(g);
|
|
62
65
|
// C: dotneato_postprocess(g) — cluster labels, edge labels (addXLabels), root
|
|
63
66
|
// graph label space + translate. @see lib/twopigen/twopiinit.c:152
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
COMPUTED_EDGE_ATTRS, COMPUTED_NODE_ATTRS, appendRecordRects, computedPart, dictParts,
|
|
26
26
|
echoAttr, echoGraphAttr, edgeAttrsAttached, edgeConnector, edgePosRaw,
|
|
27
27
|
effectiveEdgeDefaults, effectiveNodeDefaults, graphInputParts, graphLabelAttrs,
|
|
28
|
-
isDirected, nodeDictParts, nodeRecord, objInputParts,
|
|
28
|
+
isDirected, nodeDictParts, nodePosRaw, nodeRecord, objInputParts,
|
|
29
29
|
} from './attrs.js';
|
|
30
30
|
import { nodesInSeq } from '../../layout/dot/decomp.js';
|
|
31
31
|
import type { XdotDraws, SerCtx } from './types.js';
|
|
@@ -390,7 +390,7 @@ export abstract class DotWriterBase {
|
|
|
390
390
|
// engine leaves them divergent — patchwork's finishNode lets poly_init
|
|
391
391
|
// clobber ND_width/height while the tile survives in lw/rw/ht.
|
|
392
392
|
const defs = effectiveNodeDefaults(scope);
|
|
393
|
-
const posRaw =
|
|
393
|
+
const posRaw = nodePosRaw(n);
|
|
394
394
|
const widthRaw = gfmt5((info.lw + info.rw) / 72);
|
|
395
395
|
const heightRaw = gfmt5(info.ht / 72);
|
|
396
396
|
const parts: string[] = [
|
package/src/render/dot/attrs.ts
CHANGED
|
@@ -29,6 +29,22 @@ export function edgeAttrsAttached(e: Edge): boolean {
|
|
|
29
29
|
return e.info.edge_type !== IGNORED && e.info.spl != null;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* A node's `pos` value: x and y at `%.5g`, then, when the root's `odim` is 3 or
|
|
34
|
+
* more, `72 * ND_pos[k]` for k from 2 below `odim`. `plain` and the SVG family
|
|
35
|
+
* never reach this: they print two coordinates, as C.
|
|
36
|
+
* @see lib/common/output.c:attach_attrs_and_arrows
|
|
37
|
+
*/
|
|
38
|
+
export function nodePosRaw(n: Node): string {
|
|
39
|
+
const c = n.info.coord;
|
|
40
|
+
let raw = gfmt5(c.x) + ',' + gfmt5(c.y);
|
|
41
|
+
const odim = n.root.info.odim ?? 2;
|
|
42
|
+
for (let k = 2; odim >= 3 && k < odim; k++) {
|
|
43
|
+
raw += ',' + gfmt5(POINTS_PER_INCH * (n.info.pos?.[k] ?? 0));
|
|
44
|
+
}
|
|
45
|
+
return raw;
|
|
46
|
+
}
|
|
47
|
+
|
|
32
48
|
/**
|
|
33
49
|
* Append the leaf-field rectangles of a record node, mirroring the recursion in
|
|
34
50
|
* `set_record_rects`: a field with sub-fields contributes nothing itself, while
|
|
@@ -20,7 +20,7 @@ import type { Graph } from '../../model/graph.js';
|
|
|
20
20
|
import type { Node } from '../../model/node.js';
|
|
21
21
|
import { ownAttrs } from '../../model/lazy-attrs.js';
|
|
22
22
|
import type { FieldT, ShapeDesc, TextlabelT } from '../../common/types.js';
|
|
23
|
-
import { appendRecordRects, edgeAttrsAttached, edgePosRaw } from './attrs.js';
|
|
23
|
+
import { appendRecordRects, edgeAttrsAttached, edgePosRaw, nodePosRaw } from './attrs.js';
|
|
24
24
|
import { gfmt2, gfmt5, lpStr, XDOT_VERSION } from './xdot-ops.js';
|
|
25
25
|
import type { XdotDraws } from './types.js';
|
|
26
26
|
|
|
@@ -33,7 +33,7 @@ type DrawsOf = (obj: Node | Edge | Graph) => XdotDraws | undefined;
|
|
|
33
33
|
function attachNode(n: Node): void {
|
|
34
34
|
const attrs = ownAttrs(n);
|
|
35
35
|
const info = n.info;
|
|
36
|
-
attrs.set('pos',
|
|
36
|
+
attrs.set('pos', nodePosRaw(n));
|
|
37
37
|
attrs.set('height', gfmt5(info.ht / POINTS_PER_INCH));
|
|
38
38
|
attrs.set('width', gfmt5((info.lw + info.rw) / POINTS_PER_INCH));
|
|
39
39
|
const xlabel = info.xlabel as TextlabelT | undefined;
|