html_to_png: HTML to PNG

View source: R/html_to_png.R

html_to_pngR Documentation

HTML to PNG

Description

Convert an interactive HTML widget to a static PNG image.

Usage

html_to_png(
  path,
  res = 3,
  vwidth = 500 * res,
  vheight = 500 * res,
  delay = 3,
  zoom = 1
)

Arguments

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).

Value

Path to PNG.


RajLabMSSM/echodeps documentation built on Oct. 31, 2023, 7:20 a.m.