Is there a way to specify the Graphics Device backend on deploying to RStudio Connect? I have a working ggplot that displays locally after setting "AGG" as the backend Graphics Device (i.e. using the ragg package).
I have tried specifying options(shiny.useragg = TRUE) in my .Rprofile that goes with the deployment, but the rendering still isn't working correctly.
The ragg package is a suggested dependency of Shiny, not a strict dependency. Do you have a library(ragg) statement in your code or have some other explicit reference to ragg?
You'll also want to make sure that your Connect server has the ragg system dependencies installed; they're listed here: Posit Package Manager
We toyed with the idea of forcing a ragg dependency in the rsconnect 0.8.27 release, but rolled that back in rsconnect 0.8.28 because too many environments lacked the ragg system dependencies.
Hi aron, thanks for the reply. library(ragg) was included at the top of the boilerplate shiny app (with just a slight modification to display my plot instead of the usual Old Faithful histogram). I'm reaching out to our Connect admin to see if they can confirm the dependency installation. Is there any other information I can provide them that they can look into?
The font choices are likely to be different on the Connect (Linux) server compared to your development environment. Unfortunately, I don't have any specific advice about font installation.
You may want to try calling systemfonts::system_fonts() from your content to determine what fonts are available on the remote system.
@aron I haven't gotten a confirmation yet from my Connect admin, but I also tested this on shinyapps.io and it doesn't render correctly there either: ggswim
I would have expected it to, unless there's some way to specify graphics device settings on deployment? I already have options(shiny.useragg = TRUE) set in the .Rprofile that accompanies the deployment.
Unfortunately, I don't know enough about the internals of ragg to say what might be happening. Have you tried enumerating the available fonts by adding a call to systemfonts::system_fonts() from your content?
Since this problem is also happening on shinyapps.io, could you file a ragg issue with a minimal Shiny application showing the problem?