Export htmlwidget plot to a gist

Share:

Description

Export htmlwidget plot to a gist

Usage

1
2
3
4
5
6
widget2gist(widget_string, name, created = NULL, description = "",
  license = c("none", "apache-2.0", "bsd-2-clause", "bsd-3-clause",
  "cc-by-4.0", "cc-by-nc-4.0", "cc-by-nc-nd-4.0", "cc-by-nc-sa-4.0",
  "cc-by-nd-4.0", "cc-by-sa-4.0", "cddl-1.0", "epl-1.0", "gpl-2.0", "gpl-3.0",
  "lgpl-2.1", "lgpl-3.0", "mit", "mpl-2.0"), border = TRUE,
  scrolling = FALSE, secure = TRUE, view = TRUE)

Arguments

widget_string

a string containing R code to create an htmlwidget

name

name of the gist

created

optional string for a "Created by" to preceed the README

description

optional text to go in README.md to describe the gist

license

license under which gist is released - one of those accepted here: http://bl.ocks.org/licenses.txt

border

should the bl.ocks.org iframe have a border?

scrolling

should the bl.ocks.org iframe scroll?

secure

should https be used for cdn links?

view

should the resulting gist be opened in the browser on bl.ocks.org?

Note

This requires that you have a github personal access token stored as an environment variable GITHUB_PAT. See gist_create for more information.

Also note that this currently can't handle thumbnails but we are looking into ways to do that.

Examples

1
2
3
4
## Not run: 
widget2gist("figure() %>% ly_points(1:10)", name = "test")

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.