save_d3_svg: Save a D3 visualization as a SVG file

Description Usage Arguments Examples

View source: R/save_d3_svg.R

Description

Save a D3 visualization as a SVG file

Usage

1
save_d3_svg(d3, file, background = "white", delay = 0.5)

Arguments

d3

D3 visualization to save.

file

File to save SCG into.

background

Text string giving the html background color of the widget. Defaults to white.

delay

Delay (in seconds) to wait before saving the SVG.

Examples

1
2
3
4
5
6
7
8
library(r2d3)

viz <- r2d3(
  data = c(0.3, 0.6, 0.8, 0.95, 0.40, 0.20),
  script = system.file("examples/barchart.js", package = "r2d3")
)

save_d3_svg(viz, file = tempfile(fileext = ".svg"))

hafen/r2d3svg documentation built on Feb. 7, 2020, 12:23 a.m.