orca icon indicating copy to clipboard operation
orca copied to clipboard

JavaScript error when trying to save plot

Open gmarwaha opened this issue 4 years ago • 5 comments

New here, please excuse if something is not formatted correctly. I'm running R 3.6.3 (via RStudio 1.2.5033) on a Windows 10 device (session info below).

I'm trying to save a plotly object as a pdf or svg file using orca with the below code:

dat <- as.data.frame(mtcars)
library(plotly)
plt <- plot_ly(dat) %>% 
  add_markers(x = ~wt, y = ~mpg, 
              marker = list(line = list(color = 'black', width = 0.5)))
orca(p = plt, file = 'orca test.pdf', format = 'pdf', height = 1080, width = 1920)

This throws an 'Uncaught Exception' error with JavaScript as shown below (redacted folder names do not have any forward slashes or spaces): image

Orca appears to be installed properly when I check in command prompt: image

Java Version: image

Not sure what is causing this or how to resolve it. Ibeen having this error on Windows 10 for a while - the code ran fine on Windows 7 and is okay on MacOS High Sierra/Mojave. I reinstalled R, Rstudio and Java hoping it would fix this (read this on other forums) but to no avail.

Session Info:

R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)

Matrix products: default

locale:
[1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252    LC_MONETARY=English_Canada.1252
[4] LC_NUMERIC=C                    LC_TIME=English_Canada.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] plotly_4.9.2.1 ggplot2_3.3.0 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3        pillar_1.4.3      compiler_3.6.3    later_1.0.0       tools_3.6.3       digest_0.6.25    
 [7] jsonlite_1.6.1    lifecycle_0.2.0   tibble_2.1.3      gtable_0.3.0      viridisLite_0.3.0 pkgconfig_2.0.3  
[13] rlang_0.4.5       shiny_1.4.0       rstudioapi_0.11   crosstalk_1.0.0   fastmap_1.0.1     withr_2.1.2      
[19] dplyr_0.8.5       httr_1.4.1        htmlwidgets_1.5.1 vctrs_0.2.3       grid_3.6.3        tidyselect_1.0.0 
[25] glue_1.3.1        data.table_1.12.8 R6_2.4.1          processx_3.4.2    purrr_0.3.3       tidyr_1.0.2      
[31] magrittr_1.5      ps_1.3.2          scales_1.1.0      promises_1.1.0    htmltools_0.4.0   assertthat_0.2.1 
[37] mime_0.9          colorspace_1.4-1  xtable_1.8-4      httpuv_1.5.2      lazyeval_0.2.2    munsell_0.5.0    
[43] crayon_1.3.4   

gmarwaha avatar Mar 09 '20 18:03 gmarwaha

hi, have u ever exporter images by using orca? I managed to install it, but it shows this message:

Error: The orca command-line utility is required for this functionality.

did u have similar issues? thnaks

dplazas avatar Apr 02 '20 18:04 dplazas

@dplazas I haven't had that issue. You need to follow the installation instructions on this page to make sure it is installed.

gmarwaha avatar Apr 11 '20 23:04 gmarwaha

I followed the instructions.. is installed but doesnot work.

dplazas avatar Apr 13 '20 11:04 dplazas

I solved this problem by providing the target directory and file name separately.

altavir avatar Aug 13 '20 10:08 altavir

@altavir thanks! It works for me

rodaguayo avatar May 10 '21 23:05 rodaguayo