When visualizing data with plotly, i want to write widgets as html-documents without htmlwidgets::saveWidget
writing dependencies every time, assuming that these already are in place, to save processing time. The widgets need to be self-contained to save disk space.
library(plotly)
t <- Sys.time()
p <- plot_ly(ggplot2::diamonds, y = ~price, color = ~cut, type = "box")
htmlwidgets::saveWidget(as_widget(p), "test.html", selfcontained = F, libdir = NULL)
print(Sys.time() - t)
Time difference of 4.303076 secs
on my machine.
This produces ~6 mb of data only in depedencies (crosstalk-1.0.0, htmlwidgets-1.2, jquery-1.11.3, plotly-binding-4.7.1.9000, plotly-htmlwidgets-css-1.38.3, plotly-main-1.38.3, typedarray-0.1)
htmlwidgets::saveWidget
writes dependencies although these files already exist. Can this be prevented?