View source: R/createsnapshot.R
CreateSnapshot | R Documentation |
Converts a htmlwidget to png image file
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
)
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.doubleclick |
Logical indicating whether to simulate doubleclicking.
Overrides |
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. |
Works with plotly and rhtmlLabeledScatter. Errors with rhtmlPictograph.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.