| caugi_layout_kamada_kawai | R Documentation |
Computes node coordinates using the Kamada-Kawai stress minimization algorithm. High-quality force-directed layout that minimizes "stress" by making Euclidean distances proportional to graph-theoretic distances. Better preserves global structure and path lengths compared to Fruchterman-Reingold. Ideal for publication-quality visualizations. Works with all edge types and produces deterministic results.
caugi_layout_kamada_kawai(x, packing_ratio = 1.618034, ...)
x |
A |
packing_ratio |
Aspect ratio for packing disconnected components
(width/height). Default is the golden ratio (1.618) which works well with
widescreen displays. Use |
... |
Ignored. For future extensibility. |
A data.frame with columns name, x, and y containing node
names and their coordinates.
Kamada, T., & Kawai, S. (1989). An algorithm for drawing general undirected graphs. Information Processing Letters, 31(1), 7-15. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/0020-0190(89)90102-6")}
Other plotting:
add-caugi_plot-caugi_plot,
caugi_layout(),
caugi_layout_bipartite(),
caugi_layout_circle(),
caugi_layout_fruchterman_reingold(),
caugi_layout_sugiyama(),
caugi_layout_tiered(),
caugi_plot(),
divide-caugi_plot-caugi_plot,
plot.caugi()
cg <- caugi(
A %-->% B,
B %<->% C,
C %-->% D
)
layout <- caugi_layout_kamada_kawai(cg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.