rstudio / thematic

Theme ggplot2, lattice, and base graphics based on a few simple settings.
https://rstudio.github.io/thematic/
Other
244 stars 10 forks source link

thematic_with_theme() "replays" htmlwidgets #50

Closed cpsievert closed 4 years ago

cpsievert commented 4 years ago

Notice how the plotly graph gets printed after exiting the following shiny app:

library(plotly)
library(thematic)
library(shiny)

ui <- fluidPage(
  tags$head(
    tags$style(HTML("body{background-color:black; color:white}")),
    tags$style(HTML("a{color:#008000}"))
  ),
  plotlyOutput("ggplot")
)
server <- function(input, output) {
  output$ggplot <- renderPlotly({
    thematic_with_theme(
      thematic_theme(),
      ggplotly(qplot(1:15, 1:15, color = 1:15))
    )
  })
}
shinyApp(ui, server)