visExport {visNetwork} | R Documentation |
Network export configuration. This function only work within shiny or a web browser (not in RStudio)
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) or "jpeg" |
name |
: name of imgage, default to "network" |
label |
: Label on button, default to "Export as png/jpeg" |
background |
: background color, default to white (#fff) |
float |
: button postion, default to "right" |
style |
: button css style. |
loadDependencies |
/ Boolean. TRUE by default. Load libraries for export (fileSaver, Blob, canvastoBlob,html2canvas) |
visNodes for nodes options, visEdges for edges options, visGroups for groups options, visLegend for adding legend, visOptions for custom option, visLayout & visHierarchicalLayout for layout, visPhysics for control physics, visInteraction for interaction, visNetworkProxy & visFocus & visFit for animation within shiny, visDocumentation, visEvents, visConfigure ...
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= "")