Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify the length of an edge in graphviz?

Tags:

In a directed graph, if there is a cycle, the graphviz makes that edge really short.

Is there a parameter that would let me change the length of the cyclic edge, so that the graph looks a bit uniform.

digraph ER {   rankdir="LR";   //orientation=landscape;     node [shape=ellipse, fontsize=30];   {node [label="Original"] old;}   {node [label="Final"] new;}   {node [label="Intermediate"] ir;}  old -> ir [label="suggest", fontsize=30]; ir -> ir [label="validate", fontsize=30, len=f]; ir -> new [label = "finalize", fontsize=30]; } 

enter image description here

like image 686
A. K. Avatar asked Jul 01 '12 16:07

A. K.


People also ask

How do I use DOT in Graphviz?

How do I use graphviz to convert this into an image? For windows: dl the msi and install; Find gvedit.exe in your programs list; Open . dot file in question; Click running person on toolbar; Go to graph -> settings ; change Output file type to file type of your liking and press ok..

What is rank in Graphviz?

Ranks and Subgraphs To work out the layout, Graphviz uses a system it calls "ranks". Each node is assigned a higher rank than the highest ranked node that point to it. If your rank direction is set to left to right ( rankdir=LR ), then nodes with a higher rank are placed further to the right.

What language does Graphviz use?

Graphviz consists of a graph description language named the DOT language and a set of tools that can generate and/or process DOT files: dot. a command-line tool to produce layered drawings of directed graphs in a variety of output formats, such as (PostScript, PDF, SVG, annotated text and so on). neato.


1 Answers

Edit: Sorry, my answer will make edges longer, but not the self referencing edges you need.

len doesn't work in dot, but minlen does.

https://www.graphviz.org/doc/info/attrs.html#d:minlen

x->y [minlen=5] 
like image 56
compound eye Avatar answered Sep 18 '22 12:09

compound eye