Debian Codegraph @

tests/testthat/agg_png/app.R

raw
1 library(shiny)
2 library(ggplot2)
3 library(thematic)
4
5 thematic_shiny("black", "white", font = font_spec("Pacifico", 1.25, update = TRUE))
6
7 ui <- fluidPage(
8 imageOutput("ragg_png")
9 )
10
11 render_image <- function(expr) {
12 snapshotPreprocessOutput(renderImage(expr), function(value) {})
13 }
14
15 server <- function(input, output, session) {
16 output$ragg_png <- render_image({
17 file <- thematic_save_plot(
18 qplot(1:10) + ggtitle("ragg::agg_png"),
19 device = ragg::agg_png,
20 width = 800, height = 400
21 )
22 list(src = file, width = 800, height = 400)
23 })
24 }
25
26 shinyApp(ui, server)