Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I direct edge to get out of the diamond on the right?

Tags:

graphviz

dot

I have a simple dot diagram to show how to perform tests.

PerformTests;                                     PerformTests<---+
PerformTests -> TestsPassed;                            |         |
TestsPassed [shape="diamond"];                          v         |
TestsPassed -> Release [label="Yes"];             TestsPassed     |
TestsPassed -> FixErrors [label="No"];                 Y|  N\     |
FixErrors -> PerformTests;                              v    FixErrors
                                                     Release 

The diagram shows square boxes for all nodes, except TestPassed that has a diamond shape. My issue is here. I'd like the edge that goes outside of the diamond for No to be getting out of the diamond at the right (east) instead of oblique down-right (south-east).

           What I have        What I want
                ^                  ^    
               / \                / \   
              <   >              <   >--->  
               \ /\               \ /   
                v  \               v    

I've seen such compass_pt in the dot grammar, but cannot figure out how to use it. I what I want possible, and how to do it?

like image 864
Didier Trosset Avatar asked May 06 '10 13:05

Didier Trosset


1 Answers

Simply add the compass_pt :e right after the node name in the edge declaration (line 5).

PerformTests;                                     PerformTests<-----+
PerformTests -> TestsPassed;                            |           |
TestsPassed [shape="diamond"];                          v     N     |
TestsPassed -> Release [label="Yes"];             TestsPassed --> FixErrors
TestsPassed:e -> FixErrors [label="No"];               Y|  
FixErrors -> PerformTests;                              v
                                                     Release 

Compass point e stands for East (on the right side). Use w for the left side (West). There is also ne for North-East and so on.

like image 121
Didier Trosset Avatar answered Oct 06 '22 22:10

Didier Trosset