MOTHBALLED-graphviz
MOTHBALLED-graphviz copied to clipboard
Digraph: separate loops in graph
I have a state where two stimuli cause a 'local' loop. It seems that these are all generated in the same direction, but this creates a rather unclear graph. Is there any way to change the direction of one of the loops? (looked at orientation, rotate, rotation, but they don't seem to have any effect)
You could manually set one of the edges to be drawn pointing the other way, e.g. digraph G {a -> a; a -> a [dir=back]}
It would be nice to support this programmatically but first we have to move all the code to Javascript or Rust.
Thanks for the hint, but the result is even more confusing:
hmmm
can you send a sketch of what you would like to see?
Something like this:
That makes sense. Emden Gansner would know more about that; he wrote a lot of the current edge routing code. There is a notion of edge ports that might be coerced into doing that.
I'm a newbie with GraphViz, but I'm interested, and it seems like something that might come in handy in several ways (I'm an electronics eng, and also teach computer graphics). How would I contact Mr Gansner? I found references about him being with Google Inc? Or is he on this forum?
I found this:
This feature has been requested occasionally. I'm not sure how to implement it, but it probably would require a fair amount of bookkeeping.
For fine tuning, you can employ compass point ports to some separation.
Emden
I found an extreme example of the above problem on this page. Adding the ports (:se, :s, :sw, etc) to the edges helps to at least separate the connection points to the ellipses, but the resulting curves have a strong tendency to 'lean' towards the left in the graph, even crossing over the node itself. (I would expect the opposite, as there is more space at the right. Here are a couple of results:
Just changing one port, from East (:e) to South-East (:se) produces this (rather unexpectedly):
The code for loops is still fairly rudimentary and, as you've seen, has some problems. In particular, it doesn't automatically take into account extra space or trying to alternate loops from side to side.
I'm on the forum.