question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JavaScript error when trying to save plot

See original GitHub issue

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   

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
altavircommented, Aug 13, 2020

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

0reactions
rodaguayocommented, May 10, 2021

@altavir thanks! It works for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

getting error in while saving the data into database by sending ...
what I am Trying to do : I am trying to save the data into database by sending data via a post request...
Read more >
saving plots results in R code execution error - RStudio IDE
I've been struggling with RStudio lateley. Whenever I want to save a plot (even the simplest ones) as a jpg, I get an...
Read more >
Save a ggplot (or other grid object) with sensible defaults
ggsave() is a convenient function for saving a plot. It defaults to saving the last plot that you displayed, using the size of...
Read more >
Display Troubleshooting — Altair 4.2.0 documentation
If you are expecting a chart output and see nothing at all, it means that the Javascript rendering libraries are not being invoked....
Read more >
Error saving plots in Makie - Julia Discourse
Hello Everyone,. I was trying to save my plot as png images using Makie.jl in a for loop which constantly updates the plot....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found