terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.
https://d2lang.com
Mozilla Public License 2.0
16.53k stars 414 forks source link

write a force-directed layout engine #641

Open alixander opened 1 year ago

alixander commented 1 year ago

i think gonum's layout package could work: https://pkg.go.dev/gonum.org/v1/gonum/graph/layout . For some reason their node representation doesn't include dimensions. If they're assuming unit sizes, it's a no go

alixander commented 1 year ago

i don't think their package would work.

alixander commented 1 year ago

elk actually has one, we might just be able to reuse: https://www.eclipse.org/elk/reference/algorithms/org-eclipse-elk-force.html

alixander commented 1 year ago

nah i want it to be in pure Go. plus we want to have maximum control of this. e.g. allow locking positions, dimensions, etc