Hacker News new | ask | show | jobs
by tptacek 49 days ago
Graph layout is a famously hard problem!
2 comments

I wonder if it is almost like writing. In that to make the diagram that communicates well you need to have solved the problem properly.
A common layout implementation is to provide constraints to a SAT Solver… so you were close :)
To my taste, most automatic layout implementations produce horrible layouts. Yes, you can use SAT-solve and optimize your way towards a node ordering that produces no crossing lines, but those rarely create something that makes intuitive sense of the content

Good layout is a lot more like writing, in that you have to think about how the intended recipient will perceive and what you want them to notice in which order, and how to make it easy to follow the various relationships

I have had good luck with D2 and elk or dagre. If you get into the nitty gritty of elk you can do a _lot_ with it.
The tala layout engine for d2 is now included it provides a very good layout.
If only it had a good documentation. I really like the elkjs JavaScript version (thanks, Ulf!) bitte unfortunately transcoding makes transferring the Java docs even harder...