Debian Codegraph @

tests/testthat/cairo_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("png")
9 )
10
11 render_image <- function(expr) {
12 snapshotPreprocessOutput(renderImage(expr), function(value) {})
13 }
14
15 server <- function(input, output, session) {
16 output$png <- render_image({
17 file <- thematic_save_plot(
18 qplot(1:10) + ggtitle("grDevices::png"),
19 device = grDevices::png, type = "cairo",
20 antialias = "none",
21 width = 800, height = 400
22 )
23 list(src = file, width = 800, height = 400)
24 })
25 }
26
27 shinyApp(ui, server)