deepviz
deepviz copied to clipboard
Feature request: convenience function for saving graphs
I plan on adding this later. A simple function to take care of saving the plot as an image file. Something like:
save.graph <- function(graph, filename, filetype = 'jpg') {
html.file <- paste0(filename, '.html')
jpg.file <- paste0(filename, '.', filetype)
saveWidget(graph, html.file)
webshot::webshot(html.file, file = jpg.file)
}
Considerations:
- should it auto-load webshot and htmlwidgets?
- should it auto-insall phantomjs if not installed?