Learn R Programming

visNetwork (version 1.0.0)

visExport: Network export configuration

Description

Network export configuration. This function only work within shiny or a web browser (not in RStudio)

Usage

visExport(graph, type = "png", name = "network",
  label = paste0("Export as ", type), background = "#fff",
  float = "right", style = NULL, loadDependencies = TRUE)

Arguments

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)

See Also

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 ...

Examples

Run this code
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= "")

Run the code above in your browser using DataLab