Debian Codegraph @

tests/testthat/auto_theme_shiny/with_theme/app.R

raw
1 library(shiny)
2 library(thematic)
3
4 theme_base <- thematic_theme("black", "white", accent = "purple")
5 theme_ggplot <- thematic_theme("black", "white", accent = "red")
6 theme_lattice <- thematic_theme("black", "white", accent = "orange")
7
8 ui <- fluidPage(
9 plotOutput("base"),
10 plotOutput("ggplot"),
11 plotOutput("lattice")
12 )
13
14 server <- function(input, output, session) {
15
16 output$base <- renderPlot({
17 thematic_with_theme(theme_base, {
18 plot(1:10, 1:10, col = thematic_get_option("accent"))
19 })
20 })
21
22 output$ggplot <- renderPlot({
23 thematic_with_theme(theme_ggplot, {
24 ggplot2::qplot(1:10, 1:10, color = 1:10)
25 })
26 })
27
28 output$lattice <- renderPlot({
29 thematic_with_theme(theme_lattice, {
30 lattice::show.settings()
31 })
32 })
33
34 }
35
36 shinyApp(ui, server)
37
38