| 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_local_theme(theme_base) |
| 18 |
plot(1:10, 1:10, col = thematic_get_option("accent")) |
| 19 |
}) |
| 20 |
|
| 21 |
output$ggplot <- renderPlot({ |
| 22 |
thematic_local_theme(theme_ggplot) |
| 23 |
print(ggplot2::qplot(1:10, 1:10, color = 1:10)) |
| 24 |
}) |
| 25 |
|
| 26 |
output$lattice <- renderPlot({ |
| 27 |
thematic_local_theme(theme_lattice) |
| 28 |
print(lattice::show.settings()) |
| 29 |
}) |
| 30 |
|
| 31 |
} |
| 32 |
|
| 33 |
shinyApp(ui, server) |
| 34 |
|
| 35 |
|