widget2png: Make a static png file for an htmlwidget

View source: R/output_save.R

widget2pngR Documentation

Make a static png file for an htmlwidget

Description

Make a static png file for an htmlwidget

Usage

widget2png(p, file, timeout = 500)

Arguments

p

htmlwidget object

file

where to save png file

timeout

plot render timeout in milliseconds (see details)

Details

This uses phantomjs (https://phantomjs.org) to render your htmlwidget in a headless browser and take a screenshot of it, creating a static output. This assumes that phantomjs has been installed on your machine and is available as a system call. For plots that take longer to load and render, you may need to increase the value of timeout. Note that this function is experimental.

Examples


figure(tools = NULL) %>%
  ly_points(1:10) %>%
  widget2png("/tmp/test.png")


bokeh/rbokeh documentation built on Nov. 3, 2023, 2:36 a.m.