The Graphviz site will soon be moved to a new host, and have a different format. You can try out the new site here. If you have suggestions or encounter any problems, please send mail to erg@graphviz.org. |

# Curved arrows

Submitted by truss on Fri, 05/15/2015 - 11:15

Is it possible to use 'curved-arrow' to connect nodes? digraph G { rankdir=LR; fontname="sans-serif"; penwidth="0.1"; edge [comment="Wildcard edge", fontname="sans-serif", fontsize=10, colorscheme="blues3", color=2, fontcolor=3]; node [fontname="serif", fontsize=13, fillcolor="1", colorscheme="blues4", color="2", fontcolor="4", style="filled"]; "a"; "b"; "a" -> "b" [dir="both"]; }

The same question was posted on graphviz a while ago:

https://stackoverflow.com/questions/24648791/arc-graph-layout-in-graphvi...

Far more complex, but perfectly describes what I am thinking.

## Recent comments

- This is a bug that has been

12 weeks 2 days ago - Double edges: even with latest version

12 weeks 2 days ago - If you run dot.exe -V, this

21 weeks 6 days ago - Not sure

22 weeks 2 hours ago - What version of Graphviz are

22 weeks 9 hours ago - update

47 weeks 5 days ago - re: yum install - Error downloading packages

1 year 3 weeks ago - yum install - Error downloading packages

1 year 4 weeks ago - Hi,
Sorry, I was a little

1 year 5 weeks ago - The difficulties you are

1 year 9 weeks ago

## What do you mean by

What do you mean by connecting nodes with a curved arrow? Can you point to an example, or explain this more fully? Thanks.

## examples of curved connectors

Here are some examples:

http://www.d3noob.org/2013/03/d3js-force-directed-graph-examples.html

In dot and 'splines=curved':

1. Does not render properly. produces two edges between nodes.

2. Nodes are always fixed and lines are excessively curvy. It would be nicer to have nodes shift as in neato and the above diagrams to allow curves. I also need cluster subgraphs, so neato is not an option. FDP seems to work, but again the spline-polynomial is of a high-degree. It woul dbe nicer to force an "arc" instead of a spline.

3. On a related note, the bounding box for a subgraph is always 'tight' around the nodes. Is it possible to keep the size (w, h) of boxes for all subgraphs to be the same? or prespecify some minimal ratio?

## In dot and

In dot and 'splines=curved':1. Does not render properly. produces two edges between nodes.This was a bug that has been fixed. Please install a newer version.

2. Nodes are always fixed and lines are excessively curvy. It would be nicer to have nodes shift as in neato and the above diagrams to allow curves. I also need cluster subgraphs, so neato is not an option. FDP seems to work, but again the spline-polynomial is of a high-degree. It woul dbe nicer to force an "arc" instead of a spline.If you have a dense positioning of nodes and use splines=true, you will get fairly curvy edges. You should find that splines=curved gives you what you want, or try introducing more space with nodesep and ranksep.

3. On a related note, the bounding box for a subgraph is always 'tight' around the nodes. Is it possible to keep the size (w, h) of boxes for all subgraphs to be the same? or prespecify some minimal ratio?No, especially as the box size is determined by the nodes it contains. Interesting idea though.

## splines=curved - adjacent nodes

It seems edges between adjacent nodes by definition will be a straightline!

Is it possible to force adjacent edges to be curved?

## Yes, at present, flat edges

Yes, at present, flat edges in general don't support edges as arcs. I need to fix that. A hack is to add an additional invisible edge between the nodes.

By the way, I fixed another bug in the code related to curved edges today, so you might do another update.

## 'invis' edge issues

There are several related issues:

g <- "digraph M {

graph [splines=curved];

'a';

'b';

'a' -> 'b' [style=invis];

'a' -> 'b' [dir=both];

'b' -> 'b' [dir=both];

}"

Any thoughts will be greatly appreciated. Thanks, TR

## Thank you for the "invis' tip

Thank you for the "invis' tip and the update. I will download the new version.

## splines=curved

Thanks.

1. good to know.

2. Yes, I am experimenting with sep and rank

Option to draw and "arc" instead of "spline" would bre 'really' nice. may provides a natural mechanism for optimal spacing of nodes in certain diagrams.