Skip to content

Commit 1afc1c0

Browse files
committed
deprecate export(); drop RSelenium from suggests
1 parent 80008f5 commit 1afc1c0

File tree

3 files changed

+6
-48
lines changed

3 files changed

+6
-48
lines changed

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ Suggests:
6565
sf,
6666
maptools,
6767
rgeos,
68-
RSelenium,
6968
png,
7069
IRdisplay,
7170
processx

R/export.R

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' Export a plotly graph to a static file
22
#'
3-
#' This function is in the process of being deprecated. Use the `[orca]()` function instead.
3+
#' This function is in the process of being deprecated (use [orca] instead).
44
#'
55
#' @details For SVG plots, a screenshot is taken via `webshot::webshot()`.
66
#' Since `phantomjs` (and hence `webshot`) does not support WebGL,
@@ -11,36 +11,15 @@
1111
#' Valid extensions include 'jpeg' | 'png' | 'webp' | 'svg' | 'pdf'
1212
#' @param selenium used only when `p` is a WebGL plot or the output
1313
#' format is 'webp' or 'svg'. Should be an object of class "rsClientServer"
14-
#' returned by `RSelenium::rsDriver` (see examples).
14+
#' returned by `RSelenium::rsDriver`.
1515
#' @param ... if `p` is non-WebGL and the output file format is
1616
#' jpeg/png/pdf arguments are passed along to `webshot::webshot()`.
1717
#' Otherwise, they are ignored.
1818
#' @export
1919
#' @author Carson Sievert
20-
#' @examples
21-
#' # The webshot package handles non-WebGL conversion to jpeg/png/pdf
22-
#' \dontrun{
23-
#' export(plot_ly(economics, x = ~date, y = ~pce))
24-
#' export(plot_ly(economics, x = ~date, y = ~pce), "plot.pdf")
25-
#'
26-
#' # If you can't get a selenium server running, another option is to
27-
#' # use Plotly.downloadImage() via htmlwidgets::onRender()...
28-
#' # Downloading images won't work inside RStudio, but you can set the viewer
29-
#' # option to NULL to prompt your default web browser
30-
#' options(viewer = NULL)
31-
#' plot_ly(economics, x = ~date, y = ~pce, z = ~pop) %>%
32-
#' htmlwidgets::onRender(
33-
#' "function(el, x) {
34-
#' var gd = document.getElementById(el.id);
35-
#' Plotly.downloadImage(gd, {format: 'png', width: 600, height: 400, filename: 'plot'});
36-
#' }"
37-
#' )
38-
#'}
20+
#'
3921
export <- function(p = last_plot(), file = "plotly.png", selenium = NULL, ...) {
40-
message(
41-
"The `export()` function is in the process of being deprecated. ",
42-
"Please use the `orca()` function instead."
43-
)
22+
.Deprecated("orca")
4423

4524
# infer the file type
4625
fileType <- tolower(tools::file_ext(file))

man/export.Rd

Lines changed: 2 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)