Description Usage Arguments Value Examples
Export graph to SVG.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | sg_export_svg(
sg,
download = TRUE,
file = "graph.svg",
size = 1000,
width = 1000,
height = 1000,
labels = FALSE,
data = FALSE
)
sg_export_img(
sg,
download = TRUE,
file = "graph.png",
background = "white",
format = "png",
labels = FALSE
)
sg_export_img_p(
proxy,
download = TRUE,
file = "graph.png",
background = "white",
format = "png",
labels = FALSE
)
sg_export_svg_p(
proxy,
download = TRUE,
file = "graph.svg",
size = 1000,
width = 1000,
height = 1000,
labels = FALSE,
data = FALSE
)
|
sg |
An object of class |
download |
set to |
file |
Name of file. |
size |
Size of the SVG in pixels. |
width, height |
Width and height of the SVG in pixels. |
labels |
Whether the labels should be included in the svg file. |
data |
Whether additional data (node ids for instance) should be included in the svg file. |
background |
Background color of image. |
format |
Format of image, takes |
proxy |
An object of class |
An object of class htmlwidget
which renders the visualisation on print.
Functions ending in _p
return the proxy
.
1 2 3 4 5 6 7 8 | nodes <- sg_make_nodes()
edges <- sg_make_edges(nodes, 17)
sigmajs() %>%
sg_nodes(nodes, id, size) %>%
sg_edges(edges, id, source, target) %>%
sg_export_svg() %>%
sg_button("export_svg", "download")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.