visExport | R Documentation |
Network export configuration. This function only work within shiny or a web browser.
visExport( graph, type = "png", name = "network", label = paste0("Export as ", type), background = "#fff", float = "right", style = NULL, loadDependencies = TRUE, ... )
graph |
: a visNetwork object |
type |
: Type of export. One of "png" (default), "jpeg" or "pdf" |
name |
: name of imgage, default to "network" |
label |
: Label on button, default to "Export as png/jpeg/pdf" |
background |
: background color, default to white (#fff). Work only if network background is transparent. |
float |
: button postion, default to "right" |
style |
: button css style. |
loadDependencies |
/ Boolean. TRUE by default. Load libraries for export (fileSaver, Blob, canvastoBlob, html2canvas, jsPDF) |
... |
: arguments for addExport |
See online documentation https://datastorm-open.github.io/visNetwork/
visSave
## Not run: nodes <- data.frame(id = 1:3, group = c("B", "A", "B")) edges <- data.frame(from = c(1,2), to = c(2,3)) visNetwork(nodes, edges) %>% visGroups(groupname = "A", color = "red") %>% visGroups(groupname = "B", color = "lightblue") %>% visLegend() %>% visExport() visNetwork(nodes, edges) %>% visGroups(groupname = "A", color = "red") %>% visGroups(groupname = "B", color = "lightblue") %>% visLegend() %>% visExport(type = "jpeg", name = "export-network", float = "left", label = "Save network", background = "purple", style= "") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.