| layoutGraph {Rgraphviz} | R Documentation |
This is a wrapper to layout graph objects using arbitrary layout engines.
layoutGraph(x, layoutFun = layoutGraphviz, ...)
x |
A graph object |
layoutFun |
A function that performs the graph layout and returns a graph object with all necessary rendering information |
... |
Further arguments that are passed t layoutFun |
Layout of a graph and rendering are two separate processes. This
function provides an API to use any algorithm for the layout. The only
requirements to the layoutFun is to return a valid graph object
with all the necessary rendering information stored in its
renderInfo slot. This comprises
for nodes:
lw+rw=total
widthfor edges:
BezierCurve objects.
To indicate that this information has been added to the graph, the
function should also set the laidout flag in the graphData slot
to TRUE and add the bounding box information in the format of a
two-by-two matrix as item bbox in the graphData slot.
AT&T's Graphviz is the default layout algoritm to use when
layoutGraph is called without a specific layoutFun
function. See agopen for details about how to tweak
Graphviz.
An object inheriting from class graph
Florian Hahne, Deepayan Sarkar
renderGraph,
graph.par,
nodeRenderInfo,
edgeRenderInfo
library(graph) set.seed(123) V <- letters[1:10] M <- 1:4 g1 <- randomGraph(V, M, 0.8) x <- layoutGraph(g1)