News for hackers. Stuff that matters.
Re:How to draw S-curved arrows between boxes by alejohausner on Wednesday December 22, 2021 @06:39PM (#29656885)
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/

2: http://www.webgraphviz.com/?tab=map

Re:How to draw S-curved arrows between boxes by alhirzel on Wednesday December 22, 2021 @07:57PM (#29657490)
Sometimes 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.
Re:How to draw S-curved arrows between boxes by monkeycantype on Wednesday December 22, 2021 @08:55PM (#29657815)
I 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}"`;

Re:How to draw S-curved arrows between boxes by alhirzel on Thursday December 23, 2021 @12:09AM (#29658868)
Cool, I appreciate you sharing the info on your process!
Re:How to draw S-curved arrows between boxes by monkeycantype on Thursday December 23, 2021 @02:00AM (#29659404)
You’re welcome
Re:How to draw S-curved arrows between boxes by jeffreygoesto on Thursday December 23, 2021 @03:42AM (#29659914)
Not 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

[1] https://github.com/eclipse/elk

[2] https://plantuml.com/elk

Re:How to draw S-curved arrows between boxes by graphviz on Friday December 24, 2021 @07:52AM (#29673195)
Agree.
Re:How to draw S-curved arrows between boxes by graphviz on Friday December 24, 2021 @08:05AM (#29673250)
Also, this is a great problem, and we tried to solve it in a more general context. 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/ind...

Re:How to draw S-curved arrows between boxes by SPDurkee on Thursday December 23, 2021 @03:11AM (#29659741)
This is a great github to play around with dot online: https://dreampuf.github.io/GraphvizOnline/