d2 icon indicating copy to clipboard operation
d2 copied to clipboard

write a force-directed layout engine

Open alixander opened this issue 3 years ago • 4 comments

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 avatar Jan 11 '23 03:01 alixander

i don't think their package would work.

alixander avatar Feb 04 '23 08:02 alixander

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

alixander avatar Feb 19 '23 01:02 alixander

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

alixander avatar Feb 20 '23 04:02 alixander

Would be so nice to have

lkarlslund avatar Feb 19 '25 10:02 lkarlslund