visExport: Network export configuration

View source: R/visExport.R

visExportR Documentation

Network export configuration

Description

Network export configuration. This function only work within shiny or a web browser.

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), "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

References

See online documentation https://datastorm-open.github.io/visNetwork/

See Also

visSave

Examples


## 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)

visNetwork documentation built on Sept. 29, 2022, 5:07 p.m.