2626# ' @param debug Starts app in debug mode and turn on verbose logs on stdout.
2727# ' @param safe Turns on safe mode: where figures likely to make browser window
2828# ' hang during image generating are skipped.
29+ # ' @param more_args additional arguments to pass along to system command. This is useful
30+ # ' for specifying display and/or electron options, such as `--enable-webgl` or `--disable-gpu`.
31+ # ' @param ... additional arguments passed along to `processx::run()`
2932# ' @export
3033# ' @author Carson Sievert
3134# ' @md
3235# ' @rdname orca
3336# ' @examples
3437# '
3538# ' \dontrun{
39+ # ' # NOTE: in a headless environment, you may need to set `more_args="--enable-webgl"`
40+ # ' # to export webgl correctly
3641# ' p <- plot_ly(z = ~volcano) %>% add_surface()
3742# ' orca(p, "surface-plot.svg")
3843# '
5964orca <- function (p , file = " plot.png" , format = tools :: file_ext(file ),
6065 scale = NULL , width = NULL , height = NULL , mathjax = FALSE ,
6166 parallel_limit = NULL , verbose = FALSE , debug = FALSE ,
62- safe = FALSE ) {
67+ safe = FALSE , more_args = NULL , ... ) {
6368
6469 orca_available()
6570
@@ -79,7 +84,8 @@ orca <- function(p, file = "plot.png", format = tools::file_ext(file),
7984 " --plotlyjs" , plotlyjs_file ,
8085 if (debug ) " --debug" ,
8186 if (verbose ) " --verbose" ,
82- if (safe ) " --safe-mode"
87+ if (safe ) " --safe-mode" ,
88+ more_args
8389 )
8490
8591 if (! is.null(scale )) args <- c(args , " --scale" , scale )
@@ -91,7 +97,7 @@ orca <- function(p, file = "plot.png", format = tools::file_ext(file),
9197
9298 # TODO: point to local topojson? Should this only work if plot_geo(standalone = TRUE)?
9399 try_library(" processx" , " orca" )
94- invisible (processx :: run(" orca" , args , echo = TRUE , spinner = TRUE ))
100+ invisible (processx :: run(" orca" , args , echo = TRUE , spinner = TRUE , ... ))
95101}
96102
97103# ' Orca image export server
@@ -102,8 +108,6 @@ orca <- function(p, file = "plot.png", format = tools::file_ext(file),
102108# ' @param window_max_number Sets maximum number of browser windows the server can keep open at a given time.
103109# ' @param request_limit Sets a request limit that makes orca exit when reached.
104110# ' @param quiet Suppress all logging info.
105- # ' @param more_args additional arguments to pass along to system command. This is mainly useful
106- # ' for specifying electron options, such as `--disable-gpu`.
107111# ' @param ... arguments passed along to `processx::process$new()`.
108112# '
109113# ' @section Methods:
0 commit comments