@@ -117,6 +117,7 @@ orca <- function(p, file = "plot.png", format = tools::file_ext(file),
117117# ' }
118118# ' \item{\code{quiet}}{Suppress all logging info.}
119119# ' \item{\code{debug}}{Starts app in debug mode.}
120+ # ' \item{\code{xvfb}}{Whether to run orca via X virtual framebuffer. May be necessary in a headless environment}
120121# ' }
121122# '
122123# ' @section Methods:
@@ -167,7 +168,7 @@ orca_serve <- R6::R6Class(
167168 port = NULL ,
168169 initialize = function (port = 5151 , mathjax = FALSE , safe = FALSE , request_limit = NULL ,
169170 keep_alive = TRUE , window_max_number = NULL , quiet = FALSE ,
170- debug = FALSE , ... ) {
171+ debug = FALSE , xvfb = FALSE , ... ) {
171172
172173 # make sure we have the required infrastructure
173174 orca_available()
@@ -200,7 +201,12 @@ orca_serve <- R6::R6Class(
200201 if (isTRUE(mathjax ))
201202 args <- c(args , " --mathjax" , file.path(mathjax_path(), " MathJax.js" ))
202203
203- self $ process <- processx :: process $ new(" orca" , args , ... )
204+ if (xvfb ) {
205+ self $ process <- processx :: process $ new(" xvfb-run" , c(" orca" , args ), ... )
206+ } else {
207+ self $ process <- processx :: process $ new(" orca" , args , ... )
208+ }
209+
204210 self $ port <- port
205211 },
206212 export = function (p , file = " plot.png" , format = tools :: file_ext(file ), scale = NULL , width = NULL , height = NULL ) {
0 commit comments