Description Usage Arguments Examples
Turn igraph object into SVG.
1 2 | igraph_as_svg(x, radius_min = 5, radius_tf = TRUE, edgeColor = "black",
fontSize = 8, textOffset = 3, width = 800, height = 800)
|
x |
An |
radius_min |
... |
radius_tf |
... |
edgeColor |
... |
fontSize |
font size of the vertex labels |
textOffset |
where to put text |
width |
the width of the svg |
height |
the height of the svg |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(gradget)
library(magrittr)
library(igraph)
library(shiny)
G <- merkel2008 %>%
igraph_add_coordinates(layout = "kamada.kawai", dim = 2) %>%
igraph_normalize_coordinates(width = 800, height = 800, margin = 50)
S <- igraph_as_svg(G)
w <- svgPanZoom::svgPanZoom(S)
w <- htmlwidgets::appendContent(
w,
shiny::includeScript(path = system.file(package = "gradget", "js", "svg_js_extensions.js"))
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.