html_to_png | R Documentation |
Convert an interactive HTML widget to a static PNG image.
html_to_png(
path,
res = 3,
vwidth = 500 * res,
vheight = 500 * res,
delay = 3,
zoom = 1
)
path |
Path to an HTML file. |
res |
Resolution multiplier. |
vwidth |
Viewport width. This is the width of the browser "window". |
vheight |
Viewport height This is the height of the browser "window". |
delay |
Time to wait before taking screenshot, in seconds. Sometimes a longer delay is needed for all assets to display properly. |
zoom |
A number specifying the zoom factor. A zoom factor of 2 will result in twice as many pixels vertically and horizontally. Note that using 2 is not exactly the same as taking a screenshot on a HiDPI (Retina) device: it is like increasing the zoom to 200 doubling the height and width of the browser window. This differs from using a HiDPI device because some web pages load different, higher-resolution images when they know they will be displayed on a HiDPI device (but using zoom will not report that there is a HiDPI device). |
Path to PNG.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.