Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revealjs fails with generating mapview objects when chrome.exe is blocked. Any work arounds? #158

Open
ejjunju opened this issue Oct 13, 2023 · 1 comment
Labels
reprex needs a minimal reproducible example

Comments

@ejjunju
Copy link

ejjunju commented Oct 13, 2023

i am making a revealjs presentation with a slide that has mapview /leaflet maps. Unfortunately i cant render it because it seems a process that depends on chrome.exe must be called and chrome is blocked at work as a policy. Is there a wrok around that avoids calling chrome.exe?

This error only happens with format: revealjs but not with format: html. I am using Rstudio and R

my code chunk that produces the error

library(sf)
library(mapview)
library(leaflet)
library(mapedit)
library(leaflet.extras )

s20<-st_read("../Beregning v01/20/Flomsone_20arsflom.shp",quiet=TRUE)
s50<-st_read("../Beregning v01/50/Flomsone_50arsflom.shp",quiet=TRUE)
s200<-st_read("../Beregning v01/200/Flomsone_200arsflom.shp",quiet=TRUE)

s20$value<-40 #% T=20 L=10
s200$value<- 5 #%  T=200 L=10
s50$value<-18 # % T= 50 L=10

m<-mapview(s20,col.regions="cyan",zcol="value",alpha.regions=0.1,col="cyan") +
  mapview(s50,col.regions="blue",zcol="value",alpha.regions=0.1,col="blue") +
  mapview(s200,col.regions="red",zcol="value",alpha.regions=0.1,col="red")

m@map<-m@map
m

Error message. see also attached scenne shot of popup!

Error in `process_initialize(self, private, command, args, stdin, stdout, …`:
! Native call to `processx_exec` failed
Caused by error in `chain_call(c_processx_exec, command, c(command, args), pty, pty_options, …`:
! create process 'C:\Program Files\Google\Chrome\Application\chrome.exe' (system error 5, Access is denied.
) @win/processx.c:1040 (processx_exec)
---
Backtrace:
 1. global .main()
 2. global execute(params$input, params$format, params$tempDir, params$libDir, …
 3. rmarkdown::render(input = input, output_format = output_format, …
 4. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
 5. knitr:::process_file(text, output)
 6. base::withCallingHandlers(if (tangle) process_tangle(group) else process_group(g…
 7. knitr:::process_group(group)
 8. knitr:::process_group.block(group)
 9. knitr:::call_block(x)
10. knitr:::block_exec(params)
11. knitr:::eng_r(options)
12. knitr:::in_input_dir(evaluate(code, envir = env, new_device = FALSE, …
13. knitr:::in_dir(input_dir(), expr)
14. local evaluate(code, envir = env, new_device = FALSE, keep_warning = if (is.nume…
15. evaluate::evaluate(...)
16. evaluate:::evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, …
17. base::handle(pv <- withCallingHandlers(withVisible(value_fun(ev$value, …
18. base::withCallingHandlers(withVisible(value_fun(ev$value, ev$visible)), …
19. base::withVisible(value_fun(ev$value, ev$visible))
20. local value_fun(ev$value, ev$visible)
21. local fun(x, options = options)
22. base::withVisible(knit_print(x, ...))
23. knitr::knit_print(x, ...)
24. mapview:::knit_print.mapview(x, ...)
25. knitr::knit_print(mapview2leaflet(x), ...)
26. knitr:::html_screenshot(x)
27. knitr:::in_dir(d, { …
28. base::do.call(getFromNamespace("webshot", webshot), c(list(f1, f2), …
29. (function (url = NULL, file = "webshot.png", vwidth = 992, vheight = 744, …
30. chromote::default_chromote_object()
31. chromote::set_default_chromote_object(Chromote$new())
32. Chromote$new()
33. local initialize(...)
34. Chrome$new()
35. local initialize(...)
36. chromote:::launch_chrome(path, args)
37. process$new(command = path, args = c("--headless", "--remote-debugging-por…
38. local initialize(...)
39. processx:::process_initialize(self, private, command, args, stdin, stdout, …
40. processx:::chain_call(c_processx_exec, command, c(command, args), pty, pty_options, …
41. | base::withCallingHandlers(do.call(".Call", list(.NAME, ...)), error = function(e…
42. | base::do.call(".Call", list(.NAME, ...))
43. | base::.handleSimpleError(function (e) …
44. | local h(simpleError(msg, call))
45. | processx:::throw_error(err, parent = e)
                                                                                                              
Execution halted

chrome violation

@cderv
Copy link
Collaborator

cderv commented Oct 13, 2023

This error only happens with format: revealjs but not with format: html.

Are you using Quarto ? .qmd extension ? Does your YAML looks like

format: revealjs

You did not share full source code example so hard to know.

This is the repo for the R Package which is not used by Quarto. This R package is used with

output: revealjs::revealjs_presentation

thanks for additional information

@cderv cderv added the reprex needs a minimal reproducible example label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants