MOTHBALLED-graphviz icon indicating copy to clipboard operation
MOTHBALLED-graphviz copied to clipboard

Digraph: separate loops in graph

Open JohnCC330 opened this issue 7 years ago • 10 comments

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)

screenshot_2017-07-17_16-53-56

JohnCC330 avatar Jul 17 '17 20:07 JohnCC330

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.

magneticnorth avatar Jul 17 '17 20:07 magneticnorth

Thanks for the hint, but the result is even more confusing: screenshot_2017-07-17_17-37-39

JohnCC330 avatar Jul 17 '17 20:07 JohnCC330

hmmm

can you send a sketch of what you would like to see?

magneticnorth avatar Jul 17 '17 20:07 magneticnorth

Something like this: screenshot_2017-07-17_17-43-22

JohnCC330 avatar Jul 17 '17 20:07 JohnCC330

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.

graphviz avatar Jul 17 '17 20:07 graphviz

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?

JohnCC330 avatar Jul 17 '17 20:07 JohnCC330

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

JohnCC330 avatar Jul 17 '17 21:07 JohnCC330

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: screenshot_2017-07-17_18-18-43 Just changing one port, from East (:e) to South-East (:se) produces this (rather unexpectedly): screenshot_2017-07-17_18-31-10

JohnCC330 avatar Jul 17 '17 21:07 JohnCC330

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.

emden avatar Jul 18 '17 00:07 emden

I'm on the forum.

emden avatar Jul 20 '17 12:07 emden