save.d3 | R Documentation |
Saves d3 diagram as a png image using webshot.
save.d3( d3, file, width = 1000, height = 750, delay = 0.2, zoom = 1, background = "white", title = "D3 Visualization" )
d3 |
A d3 object. |
file |
Location to save image. Must have extension ".png" or ".html". |
width |
Width of image. |
height |
Height of image. |
delay |
Time to wait before taking screenshot, in seconds. Sometimes a longer delay is needed for all assets to display properly. |
zoom |
Zoom before screenshot. |
background |
Background color of diagram. |
title |
Title for HTML diagram. |
## Not run: data(energy) d3 = sankey(energy) f = paste0(tempfile(), ".html") save.d3(d3, f) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.