ggraph (version 1.0.2)

layout_igraph_partition: Calculate nodes as areas dividing their parent

Description

The partition layout is a way to show hierarchical data in the same way as layout_igraph_treemap. Instead of subdividing the parent area the partition layout shows the division of a nodes children next to the area of the node itself. As such the node positions will be very reminicent of a reingold-tilford tree layout but by plotting nodes as areas it better communicate the total weight of a node by summing up all its children. Often partition layouts are called icicle plots or sunburst diagrams (in case a radial transform is applied).

Usage

layout_igraph_partition(graph, weight = NULL, circular = FALSE,
  height = NULL, sort.by = NULL, direction = "out", offset = pi/2,
  const.area = TRUE)

Arguments

graph

An igraph object

weight

An optional vertex attribute to use as weight. Will only affect the weight of leaf nodes as the weight of non-leaf nodes are derived from their children.

circular

Logical. Should the layout be transformed to a circular representation. If TRUE the resulting layout will be a sunburst diagram.

height

An optional vertex attribute to use as height. If NULL all nodes will be given a height of 1.

sort.by

The name of a vertex attribute to sort the nodes by.

direction

The direction of the tree in the graph. 'out' (default) means that parents point towards their children, while 'in' means that children point towards their parent.

offset

If circular = TRUE, where should it begin. Defaults to pi/2 which is equivalent to 12 o'clock.

const.area

Logical. Should 'height' be scaled for area proportionality when using circular = TRUE. Defaults to TRUE.

Value

If circular = FALSE A data.frame with the columns x, y, width, height, leaf, depth, circular as well as any information stored as vertex attributes on the igraph object. If circular = TRUE A data.frame with the columns x, y, r0, r, start, end, leaf, depth, circular as well as any information stored as vertex attributes on the igraph object.

References

Kruskal, J. B., Landwehr, J. M. (1983). Icicle Plots: Better Displays for Hierarchical Clustering. American Statistician Vol 37(2), 162-168. http://doi.org/10.2307/2685881

See Also

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