CreateSnapshot: CreateSnapshot

View source: R/createsnapshot.R

CreateSnapshotR Documentation

CreateSnapshot

Description

Converts a htmlwidget to png image file

Usage

CreateSnapshot(
  widget,
  filename,
  delay = 0.2,
  width = 992,
  height = 744,
  mouse.hover = TRUE,
  mouse.click = FALSE,
  mouse.doubleclick = FALSE,
  mouse.xpos = 0.5,
  mouse.ypos = 0.5,
  debug = FALSE
)

Arguments

widget

The htmlwidget to display.

filename

Name of output file (png format).

delay

Time to wait before taking screenshot, in seconds. Sometimes a longer delay is needed for all assets to display properly.

width

Width of the snapshot viewport in pixels.

height

Height of the snapshot viewport in pixels.

mouse.hover

Logical indicating whether or not to simulate mouse moving. Note that the cursor itself is not visible, only the effects of clicking.

mouse.click

Logical indicating whether to simulate mouse click. Overrides mouse.click.

mouse.doubleclick

Logical indicating whether to simulate doubleclicking. Overrides mouse.hover and mouse.click.

mouse.xpos

Horizontal position of the mouse ranging from 0 (left) to 1 (right).

mouse.ypos

Vertical position of the mouse ranging from 0 (top) to 1 (bottom).

debug

Print debug message from snapshotting.

Details

Works with plotly and rhtmlLabeledScatter. Errors with rhtmlPictograph.


Displayr/flipChartTests documentation built on Feb. 23, 2024, 9:36 p.m.