Open rishabhshah-92 opened 1 year ago
Hmm, I'm not able to replicate this with R 4.2.2...would you mind double-checking that you can replicate from a fresh R session (without any other packages loaded)?
Same issue, in Rshiny.
library(shiny)
library(ggplot2)
library(thematic)
library(ragg)
thematic_shiny()
ui <- fluidPage(
# bslib makes it easy to customize CSS styles for things
# rendered by the browser, like tabsetPanel()
# https://rstudio.github.io/bslib
theme = bslib::bs_theme(
bg = "#002B36", fg = "#EEE8D5", primary = "#2AA198",
# bslib also makes it easy to import CSS fonts
base_font = bslib::font_google("Pacifico")
),
tabsetPanel(
type = "pills",
tabPanel("ggplot", plotOutput("ggplot")),
tabPanel("lattice", plotOutput("lattice")),
tabPanel("base", plotOutput("base"))
),
nav_item(
input_dark_mode(id = "mode", mode = 'light')
)
)
server <- function(input, output) {
output$ggplot <- renderPlot({
ggplot(mtcars, aes(wt, mpg, label = rownames(mtcars), color = factor(cyl))) +
theme_clean() +
geom_point() +
ggrepel::geom_text_repel()
})
output$lattice <- renderPlot({
lattice::show.settings()
})
output$base <- renderPlot({
image(volcano, col = thematic_get_option("sequential"))
})
}
shinyApp(ui, server)
Added a theme to the ggplot, and it doesn't auto-theme anymore.
Describe the problem
The following code works fine:
... but adding a theming command causes an error:
This is the preamble I am using:
Session Info
My ggplot2 version is 3.4.0 and thematic version is 0.1.2.9000. I am running R version 4.1.2 (2021-11-01), RStudio 2022.02.3 on macOS 12.2.1