@knowvah/dot-engine 2.8.1 → 2.9.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/common/graph-init.d.ts.map +1 -1
- package/dist/common/poly-gencode.d.ts.map +1 -1
- package/dist/common/poly-init.d.ts +3 -2
- package/dist/common/poly-init.d.ts.map +1 -1
- package/dist/common/safefile.d.ts +23 -0
- package/dist/common/safefile.d.ts.map +1 -0
- package/dist/common/shapes.d.ts +6 -6
- package/dist/common/shapes.d.ts.map +1 -1
- package/dist/gvc/device.d.ts.map +1 -1
- package/dist/gvc/image-type.d.ts +41 -0
- package/dist/gvc/image-type.d.ts.map +1 -0
- package/dist/gvc/render-usershape.d.ts +8 -0
- package/dist/gvc/render-usershape.d.ts.map +1 -1
- package/dist/gvc/usershape.d.ts +23 -1
- package/dist/gvc/usershape.d.ts.map +1 -1
- package/dist/index.js +8328 -6979
- package/dist/index.js.map +4 -4
- package/dist/layout/neato/__fixtures__/quad-prog-vpsc.d.ts +118 -0
- package/dist/layout/neato/__fixtures__/quad-prog-vpsc.d.ts.map +1 -0
- package/dist/layout/neato/__fixtures__/stress-models.d.ts +39 -0
- package/dist/layout/neato/__fixtures__/stress-models.d.ts.map +1 -0
- package/dist/layout/neato/circuit.d.ts +10 -0
- package/dist/layout/neato/circuit.d.ts.map +1 -0
- package/dist/layout/neato/init.d.ts +3 -2
- package/dist/layout/neato/init.d.ts.map +1 -1
- package/dist/layout/neato/ipsep-opts.d.ts +19 -0
- package/dist/layout/neato/ipsep-opts.d.ts.map +1 -0
- package/dist/layout/neato/lu.d.ts +35 -0
- package/dist/layout/neato/lu.d.ts.map +1 -0
- package/dist/layout/neato/matinv.d.ts +8 -0
- package/dist/layout/neato/matinv.d.ts.map +1 -0
- package/dist/layout/neato/quad-prog-vpsc-overlap.d.ts +35 -0
- package/dist/layout/neato/quad-prog-vpsc-overlap.d.ts.map +1 -0
- package/dist/layout/neato/quad-prog-vpsc.d.ts +110 -0
- package/dist/layout/neato/quad-prog-vpsc.d.ts.map +1 -0
- package/dist/layout/neato/start.d.ts +5 -4
- package/dist/layout/neato/start.d.ts.map +1 -1
- package/dist/layout/neato/stress-cola.d.ts +65 -0
- package/dist/layout/neato/stress-cola.d.ts.map +1 -0
- package/dist/layout/neato/stress-kernel.d.ts +0 -2
- package/dist/layout/neato/stress-kernel.d.ts.map +1 -1
- package/dist/layout/neato/stress-models.d.ts +48 -0
- package/dist/layout/neato/stress-models.d.ts.map +1 -0
- package/dist/layout/neato/vpsc-adjust.d.ts +7 -8
- package/dist/layout/neato/vpsc-adjust.d.ts.map +1 -1
- package/dist/render/color-resolve.d.ts +14 -0
- package/dist/render/color-resolve.d.ts.map +1 -1
- package/dist/render/dot/edge-draw.d.ts.map +1 -1
- package/dist/render/svg-arrow-ops.d.ts +21 -4
- package/dist/render/svg-arrow-ops.d.ts.map +1 -1
- package/dist/render/svg-edge-arrows.d.ts +3 -3
- package/dist/render/svg-edge-arrows.d.ts.map +1 -1
- package/dist/render/svg-helpers.d.ts +1 -1
- package/dist/render/svg-helpers.d.ts.map +1 -1
- package/dist/render/svg.d.ts.map +1 -1
- package/dist/render.js +8318 -6969
- package/dist/render.js.map +4 -4
- package/package.json +1 -1
- package/src/common/graph-init.ts +4 -2
- package/src/common/poly-gencode.ts +2 -1
- package/src/common/poly-init.ts +21 -12
- package/src/common/safefile.ts +74 -0
- package/src/common/shapes.ts +43 -22
- package/src/gvc/__fixtures__/p7/colors/98-point.gv +1 -0
- package/src/gvc/__fixtures__/p7/colors/98-point.json +54 -0
- package/src/gvc/__fixtures__/p7/colors/98-point.json.stderr +1 -0
- package/src/gvc/__fixtures__/p7/colors/98-point.svg +17 -0
- package/src/gvc/__fixtures__/p7/colors/98-point.svg.stderr +1 -0
- package/src/gvc/__fixtures__/p7/colors/98-point.xdot +13 -0
- package/src/gvc/__fixtures__/p7/colors/98-point.xdot.stderr +1 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-color.gv +1 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-color.json +150 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-color.json.stderr +1 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-color.svg +30 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-color.svg.stderr +1 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-color.xdot +22 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-color.xdot.stderr +1 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-red-colon.gv +1 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-red-colon.json +149 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-red-colon.json.stderr +0 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-red-colon.svg +30 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-red-colon.svg.stderr +0 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-red-colon.xdot +21 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge-red-colon.xdot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge.gv +1 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge.json +149 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge.json.stderr +1 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge.svg +30 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge.svg.stderr +1 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge.xdot +21 -0
- package/src/gvc/__fixtures__/p7/colors/99-edge.xdot.stderr +1 -0
- package/src/gvc/__fixtures__/p7/images/100-rotate.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/100-rotate.svg +19 -0
- package/src/gvc/__fixtures__/p7/images/100-rotate.svg.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.cmapx +2 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.cmapx.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.dot +8 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.dot.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.json +68 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.json.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.plain +3 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.plain.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.svg +18 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.svg.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.xdot +13 -0
- package/src/gvc/__fixtures__/p7/images/101-bad.xdot.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.cmapx +2 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.cmapx.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.dot +8 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.dot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.json +70 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.json.stderr +1 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.plain +3 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.plain.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.svg +19 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.svg.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.xdot +13 -0
- package/src/gvc/__fixtures__/p7/images/101-gif.xdot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.cmapx +2 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.cmapx.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.dot +8 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.dot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.json +70 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.json.stderr +1 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.plain +3 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.plain.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.svg +19 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.svg.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.xdot +13 -0
- package/src/gvc/__fixtures__/p7/images/101-jpg.xdot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-png.cmapx +2 -0
- package/src/gvc/__fixtures__/p7/images/101-png.cmapx.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-png.dot +8 -0
- package/src/gvc/__fixtures__/p7/images/101-png.dot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-png.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/101-png.json +70 -0
- package/src/gvc/__fixtures__/p7/images/101-png.json.stderr +1 -0
- package/src/gvc/__fixtures__/p7/images/101-png.plain +3 -0
- package/src/gvc/__fixtures__/p7/images/101-png.plain.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-png.svg +19 -0
- package/src/gvc/__fixtures__/p7/images/101-png.svg.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-png.xdot +13 -0
- package/src/gvc/__fixtures__/p7/images/101-png.xdot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.cmapx +2 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.cmapx.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.dot +8 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.dot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.json +70 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.json.stderr +1 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.plain +3 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.plain.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.svg +19 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.svg.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.xdot +13 -0
- package/src/gvc/__fixtures__/p7/images/101-svg.xdot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.cmapx +2 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.cmapx.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.dot +8 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.dot.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.json +68 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.json.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.plain +3 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.plain.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.svg +18 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.svg.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.xdot +13 -0
- package/src/gvc/__fixtures__/p7/images/101-svgbare.xdot.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-abs.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-abs.svg +18 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-abs.svg.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-abs.xdot +14 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-abs.xdot.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-found.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-found.svg +19 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-found.svg.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-found.xdot +14 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-found.xdot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-missing.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-missing.svg +18 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-missing.svg.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-missing.xdot +14 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-missing.xdot.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-shapefile.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-shapefile.svg +18 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-shapefile.svg.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-shapefile.xdot +15 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-shapefile.xdot.stderr +2 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-two.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-two.svg +19 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-two.svg.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-two.xdot +14 -0
- package/src/gvc/__fixtures__/p7/images/102-ip-two.xdot.stderr +0 -0
- package/src/gvc/__fixtures__/p7/images/97-custom.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/97-custom.svg +18 -0
- package/src/gvc/__fixtures__/p7/images/97-custom.svg.stderr +1 -0
- package/src/gvc/__fixtures__/p7/images/97-custom.xdot +13 -0
- package/src/gvc/__fixtures__/p7/images/97-custom.xdot.stderr +1 -0
- package/src/gvc/__fixtures__/p7/images/97-nosuch-image.gv +1 -0
- package/src/gvc/__fixtures__/p7/images/97-nosuch-image.svg +19 -0
- package/src/gvc/__fixtures__/p7/images/97-nosuch-image.svg.stderr +1 -0
- package/src/gvc/__fixtures__/p7/images/97-nosuch-image.xdot +14 -0
- package/src/gvc/__fixtures__/p7/images/97-nosuch-image.xdot.stderr +1 -0
- package/src/gvc/__fixtures__/p7/images/bad.png +1 -0
- package/src/gvc/__fixtures__/p7/images/d/r.png +0 -0
- package/src/gvc/__fixtures__/p7/images/d2/r.png +0 -0
- package/src/gvc/__fixtures__/p7/images/g.gif +0 -0
- package/src/gvc/__fixtures__/p7/images/graphs-val_val.gv +10 -0
- package/src/gvc/__fixtures__/p7/images/graphs-val_val.svg +25 -0
- package/src/gvc/__fixtures__/p7/images/graphs-val_val.svg.stderr +3 -0
- package/src/gvc/__fixtures__/p7/images/graphs-val_val.xdot +30 -0
- package/src/gvc/__fixtures__/p7/images/graphs-val_val.xdot.stderr +3 -0
- package/src/gvc/__fixtures__/p7/images/j.jpg +0 -0
- package/src/gvc/__fixtures__/p7/images/r.png +0 -0
- package/src/gvc/__fixtures__/p7/images/s.svg +2 -0
- package/src/gvc/__fixtures__/p7/images/sb.svg +1 -0
- package/src/gvc/__fixtures__/p7/images/t.png +0 -0
- package/src/gvc/__fixtures__/p7/regen.sh +23 -0
- package/src/gvc/device.ts +11 -4
- package/src/gvc/image-type.ts +122 -0
- package/src/gvc/render-usershape.ts +52 -1
- package/src/gvc/usershape.ts +40 -1
- package/src/layout/neato/__fixtures__/ipsep/big-dired.gv +243 -0
- package/src/layout/neato/__fixtures__/ipsep/big-dired.trace +55 -0
- package/src/layout/neato/__fixtures__/ipsep/big-dired.xdot +1832 -0
- package/src/layout/neato/__fixtures__/ipsep/big-dired.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/cluster.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/cluster.trace +95 -0
- package/src/layout/neato/__fixtures__/ipsep/cluster.xdot +58 -0
- package/src/layout/neato/__fixtures__/ipsep/cluster.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier-levelsgap.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier-levelsgap.trace +40 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier-levelsgap.xdot +72 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier-levelsgap.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier-sep.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier-sep.trace +43 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier-sep.xdot +72 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier-sep.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier.trace +43 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier.xdot +71 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-hier.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-true.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-true.trace +51 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-true.xdot +71 -0
- package/src/layout/neato/__fixtures__/ipsep/dired-true.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-grid.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-grid.trace +41 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-grid.xdot +77 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-grid.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-k6.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-k6.trace +41 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-k6.xdot +68 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-k6.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-rand-len.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-rand-len.trace +42 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-rand-len.xdot +110 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-rand-len.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-rand.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-rand.trace +49 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-rand.xdot +108 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-rand.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-tree.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-tree.trace +43 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-tree.xdot +83 -0
- package/src/layout/neato/__fixtures__/ipsep/ipsep-tree.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/kd-ipsep-len.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/kd-ipsep-len.trace +49 -0
- package/src/layout/neato/__fixtures__/ipsep/kd-ipsep-len.xdot +48 -0
- package/src/layout/neato/__fixtures__/ipsep/kd-ipsep-len.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/kd-ipsep.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/kd-ipsep.trace +45 -0
- package/src/layout/neato/__fixtures__/ipsep/kd-ipsep.xdot +47 -0
- package/src/layout/neato/__fixtures__/ipsep/kd-ipsep.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/len-dired.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/len-dired.trace +44 -0
- package/src/layout/neato/__fixtures__/ipsep/len-dired.xdot +66 -0
- package/src/layout/neato/__fixtures__/ipsep/len-dired.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/model-circuit.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/model-circuit.trace +46 -0
- package/src/layout/neato/__fixtures__/ipsep/model-circuit.xdot +83 -0
- package/src/layout/neato/__fixtures__/ipsep/model-circuit.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/model-mds-len.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/model-mds-len.trace +52 -0
- package/src/layout/neato/__fixtures__/ipsep/model-mds-len.xdot +72 -0
- package/src/layout/neato/__fixtures__/ipsep/model-mds-len.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/model-mds.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/model-mds.trace +52 -0
- package/src/layout/neato/__fixtures__/ipsep/model-mds.xdot +83 -0
- package/src/layout/neato/__fixtures__/ipsep/model-mds.xdot.stderr +2 -0
- package/src/layout/neato/__fixtures__/ipsep/model-subset.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/model-subset.trace +49 -0
- package/src/layout/neato/__fixtures__/ipsep/model-subset.xdot +83 -0
- package/src/layout/neato/__fixtures__/ipsep/model-subset.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/overlap-ipsep.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/overlap-ipsep.trace +211 -0
- package/src/layout/neato/__fixtures__/ipsep/overlap-ipsep.xdot +60 -0
- package/src/layout/neato/__fixtures__/ipsep/overlap-ipsep.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/overlap-vpsc.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/overlap-vpsc.trace +50 -0
- package/src/layout/neato/__fixtures__/ipsep/overlap-vpsc.xdot +60 -0
- package/src/layout/neato/__fixtures__/ipsep/overlap-vpsc.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/start-self-dired.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/start-self-dired.trace +51 -0
- package/src/layout/neato/__fixtures__/ipsep/start-self-dired.xdot +72 -0
- package/src/layout/neato/__fixtures__/ipsep/start-self-dired.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/ipsep/start-self.gv +1 -0
- package/src/layout/neato/__fixtures__/ipsep/start-self.trace +43 -0
- package/src/layout/neato/__fixtures__/ipsep/start-self.xdot +84 -0
- package/src/layout/neato/__fixtures__/ipsep/start-self.xdot.stderr +0 -0
- package/src/layout/neato/__fixtures__/quad-prog-vpsc.ts +109 -0
- package/src/layout/neato/__fixtures__/stress-models.ts +64 -0
- package/src/layout/neato/circuit.ts +31 -0
- package/src/layout/neato/index.ts +2 -2
- package/src/layout/neato/init.ts +25 -34
- package/src/layout/neato/ipsep-opts.ts +158 -0
- package/src/layout/neato/lu.ts +189 -0
- package/src/layout/neato/matinv.ts +37 -0
- package/src/layout/neato/quad-prog-vpsc-overlap.ts +365 -0
- package/src/layout/neato/quad-prog-vpsc.ts +416 -0
- package/src/layout/neato/start.ts +9 -24
- package/src/layout/neato/stress-cola.ts +497 -0
- package/src/layout/neato/stress-kernel.ts +1 -17
- package/src/layout/neato/stress-models.ts +212 -0
- package/src/layout/neato/vpsc-adjust.ts +35 -66
- package/src/render/color-resolve.ts +25 -2
- package/src/render/dot/edge-draw.ts +7 -4
- package/src/render/svg-arrow-ops.ts +35 -19
- package/src/render/svg-edge-arrows.ts +7 -6
- package/src/render/svg-helpers.ts +19 -11
- package/src/render/svg.ts +15 -3
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expected results for the T5 quad_prog_vpsc tests, captured from a native
|
|
3
|
+
* harness that links the oracle's own lib/neatogen and lib/vpsc (graphviz
|
|
4
|
+
* 16.1.0) and calls initCMajVPSC, constrained_majorization_vpsc,
|
|
5
|
+
* generateNonoverlapConstraints, removeoverlaps and deleteCMajEnvVPSC in the
|
|
6
|
+
* listed order on one environment.
|
|
7
|
+
*
|
|
8
|
+
* Build: clang -O3 -DNDEBUG -flto=thin -arch arm64 -DDIGCOLA -DIPSEPCOLA (C
|
|
9
|
+
* harness, gnu17) plus a gnu++17 helper that reads Constraint fields, linked
|
|
10
|
+
* against build/lib/neatogen/libneatogen.a, build/lib/vpsc/libvpsc.a,
|
|
11
|
+
* libcommon.a, libpack.a, liblabel.a, librbtree.a, libortho.a, libsfdpgen.a
|
|
12
|
+
* and -lgvc -lcgraph -lcdt -lpathplan -lgts -lglib-2.0. The harness copies of
|
|
13
|
+
* the four functions disassemble to the same instruction and float-op
|
|
14
|
+
* sequence as libgvplugin_neato_layout.8.0.15.dylib's.
|
|
15
|
+
*
|
|
16
|
+
* Input rules the harness follows (the C depends on them):
|
|
17
|
+
* - `srand(seed)` (SRAND op; `csrand` here) before every initCMajVPSC with
|
|
18
|
+
* diredges 2: compute_y_coords starts from init_vec_orth1's rand() vector,
|
|
19
|
+
* so the DiG-CoLa level count depends on the rand state.
|
|
20
|
+
* - all nodes' ewgts are ONE contiguous allocation, as makeGraphData builds
|
|
21
|
+
* them: compute_y_coords restores per-node pointers by walking
|
|
22
|
+
* graph[0].ewgts.
|
|
23
|
+
* Floats are printed as %.17g of the float value; constraint gaps are doubles.
|
|
24
|
+
* Inputs are seeded pseudo-random (mulberry32). Generated data: do not
|
|
25
|
+
* hand-edit (generator and harness are archived under plans/).
|
|
26
|
+
*/
|
|
27
|
+
import type { IpsepOptions } from '../quad-prog-vpsc.js';
|
|
28
|
+
import type { DirectedVtxData } from '../opt-arrangement.js';
|
|
29
|
+
/** One harness step and its native result. */
|
|
30
|
+
export type VpscOp = {
|
|
31
|
+
readonly op: 'INIT';
|
|
32
|
+
readonly diredges: 0 | 1 | 2;
|
|
33
|
+
readonly expect: {
|
|
34
|
+
nv: number;
|
|
35
|
+
nldv: number;
|
|
36
|
+
ndv: number;
|
|
37
|
+
gm: number;
|
|
38
|
+
m: number;
|
|
39
|
+
} | null;
|
|
40
|
+
} | {
|
|
41
|
+
readonly op: 'CMV';
|
|
42
|
+
readonly iters: number;
|
|
43
|
+
readonly b: readonly number[];
|
|
44
|
+
readonly place: readonly number[];
|
|
45
|
+
readonly expect: {
|
|
46
|
+
ret: number;
|
|
47
|
+
place: readonly number[];
|
|
48
|
+
};
|
|
49
|
+
} | {
|
|
50
|
+
readonly op: 'GNC';
|
|
51
|
+
readonly scale: number;
|
|
52
|
+
readonly k: 0 | 1;
|
|
53
|
+
readonly tc: boolean;
|
|
54
|
+
readonly coords: readonly (readonly number[])[];
|
|
55
|
+
readonly expect: {
|
|
56
|
+
m: number;
|
|
57
|
+
gm: number;
|
|
58
|
+
cs: readonly (readonly number[])[];
|
|
59
|
+
bb: readonly (readonly number[])[];
|
|
60
|
+
};
|
|
61
|
+
} | {
|
|
62
|
+
readonly op: 'CMVK';
|
|
63
|
+
readonly iters: number;
|
|
64
|
+
readonly b: readonly number[];
|
|
65
|
+
readonly expect: {
|
|
66
|
+
ret: number;
|
|
67
|
+
place: readonly number[];
|
|
68
|
+
};
|
|
69
|
+
} | {
|
|
70
|
+
readonly op: 'GNCK';
|
|
71
|
+
readonly scale: number;
|
|
72
|
+
readonly k: 0 | 1;
|
|
73
|
+
readonly tc: boolean;
|
|
74
|
+
readonly x: readonly number[];
|
|
75
|
+
readonly expect: {
|
|
76
|
+
m: number;
|
|
77
|
+
gm: number;
|
|
78
|
+
cs: readonly (readonly number[])[];
|
|
79
|
+
bb: readonly (readonly number[])[];
|
|
80
|
+
};
|
|
81
|
+
} | {
|
|
82
|
+
readonly op: 'SRAND';
|
|
83
|
+
readonly seed: number;
|
|
84
|
+
} | {
|
|
85
|
+
readonly op: 'DEL';
|
|
86
|
+
} | {
|
|
87
|
+
readonly op: 'RM';
|
|
88
|
+
readonly coords: readonly (readonly number[])[];
|
|
89
|
+
readonly expect: {
|
|
90
|
+
x: readonly number[];
|
|
91
|
+
y: readonly number[];
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
/** One harness case: header (graph, options, matrix) plus its steps. */
|
|
95
|
+
export interface VpscCase {
|
|
96
|
+
readonly name: string;
|
|
97
|
+
/** Variables, including the two cluster boundary variables per cluster. */
|
|
98
|
+
readonly n: number;
|
|
99
|
+
readonly clusters: readonly (readonly number[])[];
|
|
100
|
+
readonly toplevel: readonly number[];
|
|
101
|
+
readonly edgeGap: number;
|
|
102
|
+
readonly gap: readonly [number, number];
|
|
103
|
+
readonly nsize: readonly (readonly [number, number])[];
|
|
104
|
+
readonly graph: readonly {
|
|
105
|
+
edges: number[];
|
|
106
|
+
ewgts: number[];
|
|
107
|
+
edists: number[];
|
|
108
|
+
}[] | null;
|
|
109
|
+
/** Packed upper-triangular float matrix (row-wise), or null. */
|
|
110
|
+
readonly packed: readonly number[] | null;
|
|
111
|
+
readonly ops: readonly VpscOp[];
|
|
112
|
+
}
|
|
113
|
+
export declare const VPSC_CASES: readonly VpscCase[];
|
|
114
|
+
/** `ipsep_options` of a harness case (clusters, gaps, node sizes); `bb` is output. */
|
|
115
|
+
export declare function optionsOf(c: VpscCase): IpsepOptions;
|
|
116
|
+
/** `vtx_data` rows of a harness case (fresh arrays: compute_y_coords swaps ewgts). */
|
|
117
|
+
export declare function graphOf(c: VpscCase): DirectedVtxData[] | null;
|
|
118
|
+
//# sourceMappingURL=quad-prog-vpsc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quad-prog-vpsc.d.ts","sourceRoot":"","sources":["../../../../src/layout/neato/__fixtures__/quad-prog-vpsc.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,8CAA8C;AAC9C,MAAM,MAAM,MAAM,GACd;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClD,QAAQ,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,GAC5F;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CA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MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,GAAG,IAAI,CAAC;IACzF,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EAgBzC,CAAC;AAEF,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,GAAG,YAAY,CAiBnD;AAED,sFAAsF;AACtF,wBAAgB,OAAO,CAAC,CAAC,EAAE,QAAQ,GAAG,eAAe,EAAE,GAAG,IAAI,CAI7D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expected results for the T7 subset/circuit distance-model tests, captured from a
|
|
3
|
+
* native clang -O3 -flto=thin -arch arm64 harness that links the oracle's own
|
|
4
|
+
* lib/neatogen/libneatogen.a (graphviz 16.1.0) and calls
|
|
5
|
+
* `compute_apsp_artificial_weights_packed`, `circuitModel` and `matinv`.
|
|
6
|
+
* `rows` are the `vtx_data` built as `neatoinit.c:makeGraphData` does for mode=ipsep
|
|
7
|
+
* (`ewgts` = len or 1.0; subset ignores len) or with `ewgts == NULL` (`null`);
|
|
8
|
+
* graphs are `ipsep/model-subset.gv`, `ipsep/model-circuit.gv`, `ipsep/ipsep-rand-len.gv`
|
|
9
|
+
* and `graph{a--b; b--c; d--e}`. "with len" keeps len under subset to drive fmaxf;
|
|
10
|
+
* "size_t wrap" is hand-built rows with duplicate neighbours (not makeGraphData output).
|
|
11
|
+
* Generated data: do not hand-edit.
|
|
12
|
+
*/
|
|
13
|
+
/** One `vtx_data` row; `ewgts: null` is C `NULL`. */
|
|
14
|
+
export interface ModelRow {
|
|
15
|
+
readonly edges: readonly number[];
|
|
16
|
+
readonly ewgts: readonly number[] | null;
|
|
17
|
+
}
|
|
18
|
+
/** One model call and its native result. */
|
|
19
|
+
export interface ModelCase {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly fn: 'subset' | 'circuit';
|
|
22
|
+
readonly rows: readonly ModelRow[];
|
|
23
|
+
/** Native packed `Dij` (float32 values), or `null` (C `NULL`). */
|
|
24
|
+
readonly dij: readonly number[] | null;
|
|
25
|
+
/** `graph[0].ewgts == NULL` after the call. */
|
|
26
|
+
readonly ewgts0Null: 0 | 1;
|
|
27
|
+
/** Rows after the call (weighted inputs only). */
|
|
28
|
+
readonly after?: readonly ModelRow[];
|
|
29
|
+
}
|
|
30
|
+
/** One `matinv` call and its native result. */
|
|
31
|
+
export interface MatinvCase {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly a: readonly (readonly number[])[];
|
|
34
|
+
readonly rv: 0 | 1;
|
|
35
|
+
readonly inv: readonly (readonly number[])[];
|
|
36
|
+
}
|
|
37
|
+
export declare const MODEL_CASES: readonly ModelCase[];
|
|
38
|
+
export declare const MATINV_CASES: readonly MatinvCase[];
|
|
39
|
+
//# sourceMappingURL=stress-models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stress-models.d.ts","sourceRoot":"","sources":["../../../../src/layout/neato/__fixtures__/stress-models.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAEH,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CAC1C;AAED,4CAA4C;AAC5C,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,QAAQ,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,SAAS,QAAQ,EAAE,CAAC;IACnC,kEAAkE;IAClE,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACvC,+CAA+C;IAC/C,QAAQ,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CACtC;AAED,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;IAC3C,QAAQ,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IACnB,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;CAC9C;AAED,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAY3C,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAQ7C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set each diagonal entry of the conductance matrix `Gm` to minus the sum of
|
|
3
|
+
* its row, then invert the leading (nG-1) minor into `GmInv` ("ignore nth
|
|
4
|
+
* node"). 1 on success, 0 when singular (e.g. the graph is disconnected).
|
|
5
|
+
* C's `Verbose` line "Calculating circuit model" is not ported (the port has
|
|
6
|
+
* no Verbose).
|
|
7
|
+
* @see lib/neatogen/circuit.c:solveCircuit
|
|
8
|
+
*/
|
|
9
|
+
export declare function solveCircuit(nG: number, Gm: Float64Array[], GmInv: Float64Array[]): 0 | 1;
|
|
10
|
+
//# sourceMappingURL=circuit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circuit.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/circuit.ts"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,CAWzF"}
|
|
@@ -13,6 +13,7 @@ import type { Edge } from '../../model/edge.js';
|
|
|
13
13
|
import type { VtxData } from './dijkstra.js';
|
|
14
14
|
import { checkStart } from './start.js';
|
|
15
15
|
import { makeGraphDataC, graphHasLen } from './make-graph-data.js';
|
|
16
|
+
import { type AdjustData } from './fdp-adjust.js';
|
|
16
17
|
export { makeGraphDataC, graphHasLen, checkStart };
|
|
17
18
|
/** Kamada-Kawai energy minimization. @see lib/neatogen/neatoprocs.h */
|
|
18
19
|
export declare const MODE_KK = 0;
|
|
@@ -143,9 +144,9 @@ export declare function mapModelToStress(model: number): number;
|
|
|
143
144
|
/** `MaxIter` per mode; `maxiter` goes through C `atoi` (no digits -> 0). @see neatoinit.c:1280-1287 */
|
|
144
145
|
export declare function neatoMaxIter(maxiter: string | undefined, mode: number, n: number): number;
|
|
145
146
|
/** Run stress majorization and write positions back. @see lib/neatogen/neatoinit.c:majorization */
|
|
146
|
-
export declare function runMajorization(g: Graph, mode: number, model: number): void;
|
|
147
|
+
export declare function runMajorization(g: Graph, mode: number, model: number, am: AdjustData): void;
|
|
147
148
|
/** Dispatch to the layout solver for the mode. @see lib/neatogen/neatoinit.c:neatoLayout */
|
|
148
|
-
export declare function solveModel(g: Graph, mode: number, model: number): void;
|
|
149
|
+
export declare function solveModel(g: Graph, mode: number, model: number, am?: AdjustData): void;
|
|
149
150
|
/** Minimum X and Y across all node positions. @see lib/neatogen/neatoinit.c (translate logic) */
|
|
150
151
|
export declare function findMinPos(g: Graph): {
|
|
151
152
|
minX: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/init.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CA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AAe,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,GAAG,IAAI,CAkB3F;AAKD,4FAA4F;AAC5F,wBAAgB,UAAU,CACxB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,GAAE,UAAsB,GAChE,IAAI,CAWN;AAMD,iGAAiG;AACjG,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAUnE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAOrE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAI7C;AAMD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAc7C;AAMD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAW3C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Graph } from '../../model/graph.js';
|
|
2
|
+
import type { Node } from '../../model/node.js';
|
|
3
|
+
import { type AdjustData } from './fdp-adjust.js';
|
|
4
|
+
import type { ClusterData, IpsepOptions } from './quad-prog-vpsc.js';
|
|
5
|
+
/**
|
|
6
|
+
* Cluster membership of `g`'s nodes: one index array per top-level cluster of
|
|
7
|
+
* the master graph, the nodes in no cluster (`toplevel`), and a zeroed
|
|
8
|
+
* bounding box per cluster.
|
|
9
|
+
* @see lib/neatogen/neatoinit.c:cluster_map
|
|
10
|
+
*/
|
|
11
|
+
export declare function clusterMap(mg: Graph, g: Graph, nodes: readonly Node[]): ClusterData;
|
|
12
|
+
/**
|
|
13
|
+
* The options `majorization` hands `stress_majorization_cola` for one
|
|
14
|
+
* component `g` of the master graph `mg`; `am` is the layout's resolved
|
|
15
|
+
* overlap mode.
|
|
16
|
+
* @see lib/neatogen/neatoinit.c:majorization (1121-1170)
|
|
17
|
+
*/
|
|
18
|
+
export declare function ipsepOptions(mg: Graph, g: Graph, nodes: readonly Node[], am: AdjustData): IpsepOptions;
|
|
19
|
+
//# sourceMappingURL=ipsep-opts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ipsep-opts.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/ipsep-opts.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAKhD,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAqCrE;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,WAAW,CA6BnF;AAuCD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,EAAE,EAAE,UAAU,GAAG,YAAY,CAQtG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State for an LU decomposition. `null` is a freed (or never allocated) field.
|
|
3
|
+
* @see lib/neatogen/neato.h:lu_t
|
|
4
|
+
*/
|
|
5
|
+
export interface LuT {
|
|
6
|
+
/** Composite of the upper and lower triangular matrices. */
|
|
7
|
+
lu: Float64Array[] | null;
|
|
8
|
+
/** Pivot sequence. */
|
|
9
|
+
ps: Int32Array | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An m x n array of rows over one buffer, every entry `ival`.
|
|
13
|
+
* Lives here (not in a stuff.c port) because lu.c is its first ported caller.
|
|
14
|
+
* @see lib/neatogen/stuff.c:new_array
|
|
15
|
+
*/
|
|
16
|
+
export declare function newArray(m: number, n: number, ival: number): Float64Array[];
|
|
17
|
+
/**
|
|
18
|
+
* Decompose the n x n matrix `a` into `lu`. 1 on success; 0 (with `lu` freed)
|
|
19
|
+
* when `a` is singular. n = 0 reads `ps[-1]` in C (undefined behaviour); no
|
|
20
|
+
* caller reaches it (stress_majorization_cola returns early for one node).
|
|
21
|
+
* @see lib/neatogen/lu.c:lu_decompose
|
|
22
|
+
*/
|
|
23
|
+
export declare function luDecompose(lu: LuT, a: readonly ArrayLike<number>[], n: number): 0 | 1;
|
|
24
|
+
/**
|
|
25
|
+
* Solve A x = e_bi with the decomposition from `luDecompose`.
|
|
26
|
+
* @see lib/neatogen/lu.c:lu_solve
|
|
27
|
+
*/
|
|
28
|
+
export declare function luSolve(lu: LuT, x: Float64Array, bi: number, n: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* Release the decomposition. C frees without clearing the pointers; the port
|
|
31
|
+
* drops them to `null`.
|
|
32
|
+
* @see lib/neatogen/lu.c:lu_free
|
|
33
|
+
*/
|
|
34
|
+
export declare function luFree(lu: LuT | null): void;
|
|
35
|
+
//# sourceMappingURL=lu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lu.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/lu.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,WAAW,GAAG;IAClB,4DAA4D;IAC5D,EAAE,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC1B,sBAAsB;IACtB,EAAE,EAAE,UAAU,GAAG,IAAI,CAAC;CACvB;AAKD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE,CAQ3E;AA0DD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,CA+BtF;AAgBD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAe7E;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,CAM3C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invert the leading n x n block of `A` into `Ainv`: solve for one row of
|
|
3
|
+
* `Ainv` per unit vector, then transpose. 1 on success, 0 when singular
|
|
4
|
+
* (`Ainv` untouched).
|
|
5
|
+
* @see lib/neatogen/matinv.c:matinv
|
|
6
|
+
*/
|
|
7
|
+
export declare function matinv(A: readonly ArrayLike<number>[], Ainv: Float64Array[], n: number): 0 | 1;
|
|
8
|
+
//# sourceMappingURL=matinv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matinv.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/matinv.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,SAAS,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,CAqB9F"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type CMajEnvVPSC, type DigColaLevel, type IpsepOptions } from './quad-prog-vpsc.js';
|
|
2
|
+
/** `generateNonoverlapConstraints`' parameters after `e`, in C order. */
|
|
3
|
+
export interface NonoverlapArgs {
|
|
4
|
+
nsizeScale: number;
|
|
5
|
+
coords: Float32Array[];
|
|
6
|
+
/** 0 = x, 1 = y. */
|
|
7
|
+
k: 0 | 1;
|
|
8
|
+
transitiveClosure: boolean;
|
|
9
|
+
opt: IpsepOptions;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generate non-overlap constraints for the nodes (and, with clusters, inside
|
|
13
|
+
* each cluster including its boundary variables, then between top-level
|
|
14
|
+
* nodes and clusters treated as rectangles), replacing the previous pass's
|
|
15
|
+
* and keeping the global constraints first.
|
|
16
|
+
* @see lib/neatogen/quad_prog_vpsc.c:generateNonoverlapConstraints
|
|
17
|
+
*/
|
|
18
|
+
export declare function generateNonoverlapConstraints(e: CMajEnvVPSC, a: NonoverlapArgs): void;
|
|
19
|
+
/**
|
|
20
|
+
* Statically remove overlaps: move each node as little as possible.
|
|
21
|
+
* @see lib/neatogen/quad_prog_vpsc.c:removeoverlaps
|
|
22
|
+
*/
|
|
23
|
+
export declare function removeoverlaps(n: number, coords: Float32Array[], opt: IpsepOptions): void;
|
|
24
|
+
/**
|
|
25
|
+
* Unpack `ordering` into one level per division (plus the last).
|
|
26
|
+
* @see lib/neatogen/quad_prog_vpsc.c:assign_digcola_levels
|
|
27
|
+
*/
|
|
28
|
+
export declare function assignDigcolaLevels(ordering: Int32Array, n: number, levelInds: Int32Array, numDivisions: number): DigColaLevel[];
|
|
29
|
+
/**
|
|
30
|
+
* Number of separation constraints from the level sizes:
|
|
31
|
+
* `Σ_{i=1}^{num_levels-1} (|L[i]| + |L[i-1]|) + |L[0]| + |L[num_levels-1]|`.
|
|
32
|
+
* @see lib/neatogen/quad_prog_vpsc.c:get_num_digcola_constraints
|
|
33
|
+
*/
|
|
34
|
+
export declare function getNumDigcolaConstraints(levels: DigColaLevel[], numLevels: number): number;
|
|
35
|
+
//# sourceMappingURL=quad-prog-vpsc-overlap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quad-prog-vpsc-overlap.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/quad-prog-vpsc-overlap.ts"],"names":[],"mappings":"AAoCA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAW7B,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,oBAAoB;IACpB,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACT,iBAAiB,EAAE,OAAO,CAAC;IAC3B,GAAG,EAAE,YAAY,CAAC;CACnB;AAqMD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,cAAc,GAAG,IAAI,CAwCrF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,GAAG,EAAE,YAAY,GAAG,IAAI,CAczF;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,GAC3E,YAAY,EAAE,CAiBhB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAO1F"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quadratic programming with separation constraints (IPSep-CoLa): minimise
|
|
3
|
+
* `X' A X + b X` subject to VPSC separation constraints by gradient
|
|
4
|
+
* projection — a float32-faithful port of `lib/neatogen/quad_prog_vpsc.c`.
|
|
5
|
+
* The C works on `float`; arrays are `Float32Array` and every float result is
|
|
6
|
+
* rounded with `Math.fround`.
|
|
7
|
+
*
|
|
8
|
+
* Fused multiply-adds follow the 16.1 arm64 `-O3 -flto=thin` build
|
|
9
|
+
* (`libgvplugin_neato_layout.8.0.15.dylib`, `_constrained_majorization_vpsc`):
|
|
10
|
+
* each `A`-row reduction is vectorised in 16- and 4-wide blocks whose
|
|
11
|
+
* products are rounded before strictly in-order adds, and its scalar tail is
|
|
12
|
+
* `fmadd`; the per-`i` accumulations, the descent step and the beta step are
|
|
13
|
+
* `fmadd`/`fmsub`/`fmla` in every shape. See {@link rowReduce}.
|
|
14
|
+
*
|
|
15
|
+
* `Verbose` stderr lines and the `CONMAJ_LOGGING` trace are not ported (the
|
|
16
|
+
* port has no Verbose). `generateNonoverlapConstraints`, `removeoverlaps`,
|
|
17
|
+
* `assign_digcola_levels` and `get_num_digcola_constraints` live in
|
|
18
|
+
* `quad-prog-vpsc-overlap.ts` only because of the file-length limit.
|
|
19
|
+
*
|
|
20
|
+
* @see lib/neatogen/quad_prog_vpsc.c
|
|
21
|
+
* @see lib/neatogen/quad_prog_vpsc.h
|
|
22
|
+
*/
|
|
23
|
+
import type { Box, Point } from '../../model/geom.js';
|
|
24
|
+
import { type Constraint, type IncVPSC, type Variable } from '../../vpsc/index.js';
|
|
25
|
+
import type { DirectedVtxData } from './opt-arrangement.js';
|
|
26
|
+
/**
|
|
27
|
+
* Cluster membership for the containment and cluster non-overlap constraints.
|
|
28
|
+
* C counts are `size_t`; `bb` is written by `generateNonoverlapConstraints`.
|
|
29
|
+
* @see lib/neatogen/defs.h:cluster_data
|
|
30
|
+
*/
|
|
31
|
+
export interface ClusterData {
|
|
32
|
+
/** Total count of vars in clusters. */
|
|
33
|
+
nvars: number;
|
|
34
|
+
/** Number of clusters. */
|
|
35
|
+
nclusters: number;
|
|
36
|
+
/** Number of vars in each cluster. */
|
|
37
|
+
clustersizes: Int32Array;
|
|
38
|
+
/** Var indices of the constituents of each cluster. */
|
|
39
|
+
clusters: Int32Array[];
|
|
40
|
+
/** Number of nodes not in any cluster. */
|
|
41
|
+
ntoplevel: number;
|
|
42
|
+
/** Nodes not in any cluster. */
|
|
43
|
+
toplevel: Int32Array;
|
|
44
|
+
/** Bounding box of each cluster. */
|
|
45
|
+
bb: Box[];
|
|
46
|
+
}
|
|
47
|
+
/** @see lib/neatogen/digcola.h:ipsep_options */
|
|
48
|
+
export interface IpsepOptions {
|
|
49
|
+
/** 1 = directed edge constraints, 2 = DiG-CoLa hierarchy level constraints. */
|
|
50
|
+
diredges: 0 | 1 | 2;
|
|
51
|
+
/** Vertical separation forced between the ends of a directed edge. */
|
|
52
|
+
edgeGap: number;
|
|
53
|
+
/** 1 = non-overlap constraints, 2 = remove overlaps after layout. */
|
|
54
|
+
noverlap: 0 | 1 | 2;
|
|
55
|
+
/** Horizontal and vertical gap enforced when removing overlap. */
|
|
56
|
+
gap: Point;
|
|
57
|
+
/** Node widths and heights. */
|
|
58
|
+
nsize: Point[];
|
|
59
|
+
clusters: ClusterData;
|
|
60
|
+
}
|
|
61
|
+
/** @see lib/neatogen/quad_prog_vpsc.h:DigColaLevel */
|
|
62
|
+
export interface DigColaLevel {
|
|
63
|
+
nodes: Int32Array;
|
|
64
|
+
numNodes: number;
|
|
65
|
+
}
|
|
66
|
+
/** @see lib/neatogen/quad_prog_vpsc.h:CMajEnvVPSC */
|
|
67
|
+
export interface CMajEnvVPSC {
|
|
68
|
+
/** Unpacked matrix, or null when none was given. */
|
|
69
|
+
A: Float32Array[] | null;
|
|
70
|
+
/** Number of actual vars. */
|
|
71
|
+
nv: number;
|
|
72
|
+
/** Number of dummy nodes included in the Laplacian matrix. */
|
|
73
|
+
nldv: number;
|
|
74
|
+
/** Number of dummy nodes not included in the Laplacian matrix. */
|
|
75
|
+
ndv: number;
|
|
76
|
+
vs: Variable[];
|
|
77
|
+
/** Total number of constraints for the next iteration. */
|
|
78
|
+
m: number;
|
|
79
|
+
/** Number of global constraints. */
|
|
80
|
+
gm: number;
|
|
81
|
+
cs: Constraint[] | null;
|
|
82
|
+
/** Global constraints, persistent throughout the optimisation. */
|
|
83
|
+
gcs: Constraint[] | null;
|
|
84
|
+
vpsc: IncVPSC | null;
|
|
85
|
+
/** Utility arrays (reusable memory). */
|
|
86
|
+
fArray1: Float32Array;
|
|
87
|
+
fArray2: Float32Array;
|
|
88
|
+
fArray3: Float32Array;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Use gradient projection to solve Variable Placement with Separation
|
|
92
|
+
* Constraints. Returns the iteration count.
|
|
93
|
+
* @see lib/neatogen/quad_prog_vpsc.c:constrained_majorization_vpsc
|
|
94
|
+
*/
|
|
95
|
+
export declare function constrainedMajorizationVpsc(e: CMajEnvVPSC, b: Float32Array, place: Float32Array, maxIterations: number): number;
|
|
96
|
+
/**
|
|
97
|
+
* Set up the environment and the global constraints (directed-edge and
|
|
98
|
+
* cluster containment constraints). `diredges`: 0 = none, 1 = one separation
|
|
99
|
+
* constraint per edge (in the acyclic subgraph), 2 = DiG-CoLa level
|
|
100
|
+
* constraints. Returns null where C returns NULL.
|
|
101
|
+
* @see lib/neatogen/quad_prog_vpsc.c:initCMajVPSC
|
|
102
|
+
*/
|
|
103
|
+
export declare function initCMajVPSC(n: number, packedMat: Float32Array | null, graph: DirectedVtxData[] | null, opt: IpsepOptions, diredges: 0 | 1 | 2): CMajEnvVPSC | null;
|
|
104
|
+
/**
|
|
105
|
+
* Release the environment: the solver, its constraints (global ones only
|
|
106
|
+
* when the array is separate) and variables.
|
|
107
|
+
* @see lib/neatogen/quad_prog_vpsc.c:deleteCMajEnvVPSC
|
|
108
|
+
*/
|
|
109
|
+
export declare function deleteCMajEnvVPSC(e: CMajEnvVPSC): void;
|
|
110
|
+
//# sourceMappingURL=quad-prog-vpsc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quad-prog-vpsc.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/quad-prog-vpsc.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqB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E,MAAM,CAAC;IACb,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,QAAQ,EAAE,CAAC;IACf,0DAA0D;IAC1D,CAAC,EAAE,MAAM,CAAC;IACV,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IACxB,kEAAkE;IAClE,GAAG,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACrB,wCAAwC;IACxC,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,YAAY,CAAC;CACvB;AAiGD;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,GAC1E,MAAM,CAyBR;AAmGD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,IAAI,EAC1E,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GACrC,WAAW,GAAG,IAAI,CAkCpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI,CAWtD"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Neato `start` handling (setSeed / initRegular / checkStart) and the
|
|
3
3
|
* fail-loud checks for the neato init features this port does not have
|
|
4
|
-
* (smart init for the stress path, the subset/circuit distance models
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* (smart init for the stress path, the subset/circuit distance models).
|
|
5
|
+
* mode=hier runs `stress_majorization_with_hierarchy`; its own unported
|
|
6
|
+
* branches (subset/circuit models, the smart-init fallback without a
|
|
7
|
+
* hierarchy) are loud in constrained-majorization.ts. mode=ipsep runs
|
|
8
|
+
* `stress_majorization_cola`, which ports both models and takes no smart init.
|
|
8
9
|
*
|
|
9
10
|
* Each loud check sits where neato's C branches into the unported code and
|
|
10
11
|
* fires only for the modes whose C path reaches it (ADR-3).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/start.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/start.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAUlD,0CAA0C;AAC1C,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,6CAA6C;AAC7C,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,4CAA4C;AAC5C,eAAO,MAAM,WAAW,IAAI,CAAC;AAyB7B;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAClC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAYhC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAStD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,CAAC,EAAE,KAAK,EAAE,EAAE,GAAE,MAAqB,EAAE,IAAI,GAAE,MAAoB,GAC9D,MAAM,CAQR;AAsBD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,CAO1C;AA2DD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAI3E"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IPSep-CoLa stress majorization subject to separation constraints
|
|
3
|
+
* (mode=ipsep) — a float32-faithful port of
|
|
4
|
+
* `constrained_majorization_ipsep.c:stress_majorization_cola`.
|
|
5
|
+
*
|
|
6
|
+
* Kernels, as the 16.1 arm64 `-O3 -flto=thin` build runs them: both inlined
|
|
7
|
+
* `right_mult_with_vector_ff` copies are the kD copy's instructions
|
|
8
|
+
* (`rightMultWithVectorFFFused`); `conjugate_gradient_mkernel` is the one
|
|
9
|
+
* out-of-line fused body the kD kernel also calls
|
|
10
|
+
* (`conjugateGradientMkernelFused`); the squared distances are `square_vec`
|
|
11
|
+
* then `vectors_additionf`, two loops, so each product is rounded before its
|
|
12
|
+
* add (313-316, unlike stress.c's fused `+= tmp * tmp`).
|
|
13
|
+
*
|
|
14
|
+
* The complexity limits force the C body into helpers, each kept in C order
|
|
15
|
+
* and named with its C line range: {@link maxEdgeLength} (112-116),
|
|
16
|
+
* {@link modelDistances} (128-151), {@link diameterOf} (158-164),
|
|
17
|
+
* {@link colaScaleLayout} (166-191), {@link clusterLaplacian} (205-236),
|
|
18
|
+
* {@link laplacianDiagonal} (237-253), {@link floatCoords} (255-262),
|
|
19
|
+
* {@link optimize} (282-293, 434-444), {@link iterate} (295-433) with
|
|
20
|
+
* {@link pairDistances} / {@link buildLap1} (298-336), {@link computeStress}
|
|
21
|
+
* (338-357), {@link scaleUpNodes} (377-385), {@link solveHorizontal} /
|
|
22
|
+
* {@link solveVertical} (400-432), and {@link writeBack} (446-455).
|
|
23
|
+
*
|
|
24
|
+
* `Verbose` output and the timers are not ported (the port has no Verbose);
|
|
25
|
+
* {@link stressMajorizationColaTraced} reports each iteration's stress, the
|
|
26
|
+
* value C prints under `-v`, for tests. C's `Epsilon` global is the
|
|
27
|
+
* `epsilon` option.
|
|
28
|
+
*
|
|
29
|
+
* @see lib/neatogen/constrained_majorization_ipsep.c:stress_majorization_cola
|
|
30
|
+
*/
|
|
31
|
+
import type { Node } from '../../model/node.js';
|
|
32
|
+
import type { DirectedVtxData } from './opt-arrangement.js';
|
|
33
|
+
import { type IpsepOptions } from './quad-prog-vpsc.js';
|
|
34
|
+
/** `stress_majorization_cola`'s scalar arguments after `nodes` (C `Epsilon` included). */
|
|
35
|
+
export interface ColaOptions {
|
|
36
|
+
/** Dimensionality of the layout. */
|
|
37
|
+
dim: number;
|
|
38
|
+
/** Distance model: C `defs.h` `MODEL_*` (the `init.ts` constants). */
|
|
39
|
+
model: number;
|
|
40
|
+
/** Maximum iterations. */
|
|
41
|
+
maxi: number;
|
|
42
|
+
/** C's global `Epsilon` (graph `epsilon`, default `DFLT_TOLERANCE`). */
|
|
43
|
+
epsilon: number;
|
|
44
|
+
opt: IpsepOptions;
|
|
45
|
+
}
|
|
46
|
+
/** Receives each iteration's stress, the value C prints under `-v` (360-364). */
|
|
47
|
+
export type ColaStressObserver = (stress: number) => void;
|
|
48
|
+
/**
|
|
49
|
+
* {@link stressMajorizationCola} reporting each iteration's stress to
|
|
50
|
+
* `observe`. Internal: for tests, not exported from the package.
|
|
51
|
+
* @see lib/neatogen/constrained_majorization_ipsep.c:stress_majorization_cola
|
|
52
|
+
*/
|
|
53
|
+
export declare function stressMajorizationColaTraced(graph: DirectedVtxData[], n: number, dCoords: Float64Array[], nodes: Node[], o: ColaOptions & {
|
|
54
|
+
observe: ColaStressObserver | null;
|
|
55
|
+
}): number;
|
|
56
|
+
/**
|
|
57
|
+
* Stress majorization subject to separation constraints: directed-edge
|
|
58
|
+
* (`diredges` 1) or DiG-CoLa level (2) constraints, cluster containment, and
|
|
59
|
+
* node non-overlap during (`noverlap` 1) or after (2) layout. Mutates
|
|
60
|
+
* `dCoords`; returns C's value (iterations, -1 on error, 0 for n == 1 or
|
|
61
|
+
* maxi == 0). C has no `maxi < 0` return here: `neatoLayout` returns before.
|
|
62
|
+
* @see lib/neatogen/constrained_majorization_ipsep.c:stress_majorization_cola
|
|
63
|
+
*/
|
|
64
|
+
export declare function stressMajorizationCola(graph: DirectedVtxData[], n: number, dCoords: Float64Array[], nodes: Node[], o: ColaOptions): number;
|
|
65
|
+
//# sourceMappingURL=stress-cola.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stress-cola.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/stress-cola.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAMhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAC2E,KAAK,YAAY,EAClG,MAAM,qBAAqB,CAAC;AA+B7B,0FAA0F;AAC1F,MAAM,WAAW,WAAW;IAC1B,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,YAAY,CAAC;CACnB;AAED,iFAAiF;AACjF,MAAM,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAqX1D;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAC3E,CAAC,EAAE,WAAW,GAAG;IAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAA;CAAE,GACtD,MAAM,CAcR;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,WAAW,GAC1F,MAAM,CAER"}
|
|
@@ -38,8 +38,6 @@ export interface StressOpts {
|
|
|
38
38
|
/** MODEL_* — only the resulting Dij matters here; pass it in. */
|
|
39
39
|
maxi: number;
|
|
40
40
|
epsilon: number;
|
|
41
|
-
/** Run the kernels as `stress_majorization_cola` does (mode=ipsep). */
|
|
42
|
-
cola?: boolean;
|
|
43
41
|
}
|
|
44
42
|
/**
|
|
45
43
|
* Dense stress majorization. Mutates dCoords in place; returns the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stress-kernel.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/stress-kernel.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"stress-kernel.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/stress-kernel.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAkBvD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,YAAY,CAS3E;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,YAAY,CASnF;AAkBD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAC5D,OAAO,CAgBT;AAqID,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,UAAU,GAClF,MAAM,CA+CR"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The subset and circuit distance models of stress majorization, plus the
|
|
3
|
+
* three kkutils.c neighbour-vector helpers they use (kept here because
|
|
4
|
+
* kkutils.ts is outside the porting task that added them).
|
|
5
|
+
*
|
|
6
|
+
* `Dij` is C `float` (Float32Array); the circuit matrices are C `double`.
|
|
7
|
+
* C `NULL` ewgts is the port's empty array.
|
|
8
|
+
*
|
|
9
|
+
* @see lib/neatogen/stress.c
|
|
10
|
+
* @see lib/neatogen/kkutils.c
|
|
11
|
+
*/
|
|
12
|
+
import type { VtxData } from './dijkstra.js';
|
|
13
|
+
/**
|
|
14
|
+
* Count the neighbours of `u` marked in `vVector`.
|
|
15
|
+
* @see lib/neatogen/kkutils.c:common_neighbors
|
|
16
|
+
*/
|
|
17
|
+
export declare function commonNeighbors(graph: readonly VtxData[], u: number, vVector: Int32Array): number;
|
|
18
|
+
/**
|
|
19
|
+
* Mark the neighbours of `vtx` (a node is NOT a neighbour of itself).
|
|
20
|
+
* @see lib/neatogen/kkutils.c:fill_neighbors_vec_unweighted
|
|
21
|
+
*/
|
|
22
|
+
export declare function fillNeighborsVecUnweighted(graph: readonly VtxData[], vtx: number, vtxVec: Int32Array): void;
|
|
23
|
+
/**
|
|
24
|
+
* Clear the marks set by `fillNeighborsVecUnweighted`.
|
|
25
|
+
* @see lib/neatogen/kkutils.c:empty_neighbors_vec
|
|
26
|
+
*/
|
|
27
|
+
export declare function emptyNeighborsVec(graph: readonly VtxData[], vtx: number, vtxVec: Int32Array): void;
|
|
28
|
+
/**
|
|
29
|
+
* Distances from the resistor circuit: Dij = Ginv[i][i] + Ginv[j][j] -
|
|
30
|
+
* 2 Ginv[i][j] over the inverted conductance matrix; `null` (C `NULL`) when
|
|
31
|
+
* `solveCircuit` fails, e.g. on a disconnected graph.
|
|
32
|
+
* @see lib/neatogen/stress.c:circuitModel
|
|
33
|
+
*/
|
|
34
|
+
export declare function circuitModel(graph: readonly VtxData[], nG: number): Float32Array | null;
|
|
35
|
+
/**
|
|
36
|
+
* All-pairs shortest paths after weighting every edge so that high-degree
|
|
37
|
+
* nodes sit far apart: Dijkstra when the graph carries ewgts, else bfs over
|
|
38
|
+
* the (int-truncated) artificial weights.
|
|
39
|
+
*
|
|
40
|
+
* The C allocates one buffer of sum(nedges) floats and walks a pointer
|
|
41
|
+
* through it; the port allocates each vertex's slice. On return
|
|
42
|
+
* graph[0].ewgts is NULL; when the caller had ewgts every vertex gets its
|
|
43
|
+
* original array back, otherwise graph[1..n-1].ewgts keep the artificial
|
|
44
|
+
* weights (C: dangling pointers into the freed buffer).
|
|
45
|
+
* @see lib/neatogen/stress.c:compute_apsp_artificial_weights_packed
|
|
46
|
+
*/
|
|
47
|
+
export declare function computeApspArtificialWeightsPacked(graph: VtxData[], n: number): Float32Array;
|
|
48
|
+
//# sourceMappingURL=stress-models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stress-models.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/stress-models.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAa7C;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,MAAM,CAWjG;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAI3G;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAIlG;AAMD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAgCvF;AAqED;;;;;;;;;;;GAWG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,YAAY,CAwB5F"}
|