Save a Sankey diagram created via sankeyNetwork() to an HTML or PNG
file. HTML files are created via htmlwidgets::saveWidget().
PNG files are converted from HTML files via webshot::webshot().
saveNetwork(
network,
folder_path = NULL,
file_name = "temp",
png = "create",
html = "none",
vwidth = network$width,
vheight = network$height,
zoom = 5,
delay = 0.5,
selfcontained = TRUE
)Network to save, i.e. result of sankeyNetwork().
Path to the destination folder.
File name without file extension.
Should a png file be created and/or immediately opened? Can be either "none", "create" or "open".
Should an html file be created and/or immediately opened? Can be either "none", "create" or "open".
Passed to webshot::webshot(). Viewport width in pixels. Defaults to network$width, i.e. the width that was set in sankeyNetwork().
Passed to webshot::webshot(). Viewport height in pixels. Defaults to network$height, i.e. the height that was set in sankeyNetwork().
Passed to webshot::webshot(). Zoom factor. 1 means actual size, 2 means 50% zoom, etc.
Passed to webshot::webshot(). Time to delay before taking webshot, in seconds.
Passed to htmlwidgets::saveWidget(). Whether to save the HTML as a single self-contained file (with external resources base64 encoded) or a file with external resources placed in an adjacent directory. TRUE by default, but note that this does not always seem to work.