deepviz icon indicating copy to clipboard operation
deepviz copied to clipboard

Feature request: convenience function for saving graphs

Open nateGeorge opened this issue 5 years ago • 0 comments

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?

nateGeorge avatar Apr 17 '19 00:04 nateGeorge