ggraph (version 0.1.1)

layout_igraph_auto: Use igraph layout algorithms for layout_igraph

Description

This layout function makes it easy to apply one of the layout algorithms supplied in igraph when plotting with ggraph. Layout names are auto completed so there is no need to write layout_with_graphopt or layout_as_tree, just graphopt and tree (though the former will also work if you want to be super explicit). Circular layout is only supported for tree-like layout (tree and sugiyama) and will throw an error when applied to other layouts.

Usage

layout_igraph_auto(graph, circular, ...)
layout_igraph_igraph(graph, algorithm, circular, offset = pi/2, use.dummy = FALSE, ...)

Arguments

graph
An igraph object.
circular
Logical. Should the layout be transformed to a circular representation. Defaults to FALSE. Only applicable to algorithm = 'tree' and algorithm = 'sugiyama'.
...
Arguments passed on to the respective layout functions
algorithm
The type of layout algorithm to apply. See layout_ for links to the layouts supplied by igraph.
offset
If circular = TRUE, where should it begin. Defaults to pi/2 which is equivalent to 12 o'clock.
use.dummy
Logical. In the case of algorithm = 'sugiyama' should the dummy-infused graph be used rather than the original. Defaults to FALSE.

Value

A data.frame with the columns x, y, circular as well as any information stored as vertex attributes on the igraph object.

Details

igraph provides a huge amount of possible layouts. They are all briefly described below:

Hierarchical layouts

Standard layouts

See Also

Other layout_igraph_*: layout_igraph_circlepack, layout_igraph_dendrogram, layout_igraph_hive, layout_igraph_linear, layout_igraph_manual, layout_igraph_partition, layout_igraph_treemap