caugi_layout_fruchterman_reingold: Fruchterman-Reingold Force-Directed Layout

View source: R/layout.R

caugi_layout_fruchterman_reingoldR Documentation

Fruchterman-Reingold Force-Directed Layout

Description

Computes node coordinates using the Fruchterman-Reingold force-directed layout algorithm. Fast spring-electrical model that treats edges as springs and nodes as electrically charged particles. Produces organic, symmetric layouts with uniform edge lengths. Works with all edge types and produces deterministic results.

Usage

caugi_layout_fruchterman_reingold(x, packing_ratio = 1.618034, ...)

Arguments

x

A caugi object.

packing_ratio

Aspect ratio for packing disconnected components (width/height). Default is the golden ratio (1.618) which works well with widescreen displays. Use 1.0 for square grid, 2.0 for wider layouts, 0.5 for taller layouts, Inf for single row, or 0.0 for single column.

...

Ignored. For future extensibility.

Value

A data.frame with columns name, x, and y containing node names and their coordinates.

Source

Fruchterman, T. M. J., & Reingold, E. M. (1991). Graph drawing by force-directed placement. Software: Practice and Experience, 21(11), 1129-1164. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/spe.4380211102")}

See Also

Other plotting: add-caugi_plot-caugi_plot, caugi_layout(), caugi_layout_bipartite(), caugi_layout_circle(), caugi_layout_kamada_kawai(), caugi_layout_sugiyama(), caugi_layout_tiered(), caugi_plot(), divide-caugi_plot-caugi_plot, plot.caugi()

Examples

cg <- caugi(
  A %-->% B,
  B %<->% C,
  C %-->% D
)
layout <- caugi_layout_fruchterman_reingold(cg)


caugi documentation built on Oct. 28, 2026, 1:07 a.m.