| plot.gexf | R Documentation |
plot.gexf renders a gexf object as an interactive sigma.js htmlwidget.
For the legacy gexf-js file-server approach, use plot_gexfjs.
## S3 method for class 'gexf'
plot(x, y = NULL, width = NULL, height = NULL, ...)
x |
An object of class |
y |
Ignored. |
width, height |
Widget dimensions in pixels. Defaults to |
... |
Additional arguments forwarded to |
plot.gexf delegates to sigmajs, which produces an htmlwidget powered by
sigma.js. Node positions, colours, and sizes
are read directly from the GEXF viz:* attributes, so the graph must
contain them. If they are absent you can round-trip through igraph:
x <- igraph.to.gexf(gexf.to.igraph(x)) plot(x)
sigmajs(), plot_gexfjs()
if (interactive()) {
path <- system.file("gexf-graphs/lesmiserables.gexf", package = "rgexf")
graph <- read.gexf(path)
plot(graph)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.