The basics
demo is a full Shiny app with theme persistence, intensity, accent
wells, and theme_glass() plots. Apps may take a moment to
wake up.
Paste this into the Shinylive editor (install shinyglass from GitHub in the editor if the CRAN build is older than 0.3.0):
library(shiny)
library(shinyglass)
ui <- glass_page(
title = "shinyglass playground",
persist = TRUE,
scene = "tahoe",
sliderInput("n", "Points", 10, 80, 30),
plotOutput("p", height = "280px")
)
server <- function(input, output, session) {
observe_glass(input, session)
output$p <- renderPlot({
pal <- glass_plot_colors(input = input)
plot(
seq_len(input$n),
sin(seq_len(input$n) / 4),
col = pal$fill,
pch = 16,
fg = pal$ink,
col.axis = pal$ink
)
}, bg = "transparent")
}
shinyApp(ui, server)The same app lives at inst/examples/playground.R in the
source repository.