4 ms·
The graphviz system [1], originally from at&t labs, has a program called "dot" that does this kind of thing very well, including routing the arrows around other
by alejohausner 5y ago
The graphviz system [1], originally from at&t labs, has a program called "dot" that does this kind of thing very well, including routing the arrows around other boxes that may be in the way. It's been open sourced. It's also been ported to the web [2]
1: https://graphviz.org/ https://graphviz.org/
2: http://www.webgraphviz.com/?tab=map http://www.webgraphviz.com/?tab=map
- alhirzel 5y agoSometimes I wish there were a more modern replacement for Graphviz. There are things that it doesn't handle very well (e.g., nested subgraphs) and I feel like there are good (albeit proprietary) algorithms which could make their way into a general package.
- monkeycantype 5y agoI use dot, and manually position everything, then use the neato -n2 option to render: `dot -T ${format} -n${n} ${verbose>1?"-v ":""}-Goverlap-true -Gsplines=false -Kneato -o "${ output }" "${ input }"` this still doesn't do subgraphs well, so I sometime do the 'groups' in a separate document, then composite the layers with image magick `magick composite ${verbose>1?"-verbose ":""}-gravity NorthWest "${a}" "${b}" "${png_output}"`;
- alhirzel 5y agoCool, I appreciate you sharing the info on your process!
- monkeycantype 5y agoYou’re welcome
- jeffreygoesto 5y agoNot as easy to use, because it does not have a simple cli, but nested layouts are better than dot's with the Eclipse Layout Kernel. There is a JavaScript version, as well and you can try it in recent plantuml versions. [0] https://www.eclipse.org/elk https://www.eclipse.org/elk [1] https://github.com/eclipse/elk https://github.com/eclipse/elk [2] https://plantuml.com/elk https://plantuml.com/elk
- graphviz 5y agoAgree.
- graphviz 5y agoAlso, this is a great problem, and we tried to solve it in a more general context. http://dpd.cs.princeton.edu/Papers/DGKN97.pdf http://dpd.cs.princeton.edu/Papers/DGKN97.pdf I believe it's an open problem what makes a curve look "natural" or how to do a good job of routing multiple splines around obstacles so they do not intersect each other, though the work of Keean Crane at CMU seems promising: https://www.cs.cmu.edu/~kmcrane/Projects/RepulsiveCurves/index.html https://www.cs.cmu.edu/~kmcrane/Projects/RepulsiveCurves/ind...
- CyberSimon 5y agoThis is a great github to play around with dot online: https://dreampuf.github.io/GraphvizOnline/ https://dreampuf.github.io/GraphvizOnline/