Skip to content

Instantly share code, notes, and snippets.

View philibe's full-sized avatar

philibe

  • France
View GitHub Profile
@timelyportfolio
timelyportfolio / Readme.md
Last active February 20, 2021 12:48
svg as reactiveValue in Shiny used with uiOutput

Just playing around with svg from svglite, and I wondered if the svg output would work as reactiveValue in Shiny. Of course, it does. Then, I wanted to confirm that functions could be used for render*Output, and yes they can.

useful?

Is this useful? svg works really well in responsive contexts, so this might be helpful in that situation. Also, we could dynamically render svg spinners or animations on load or for other feedback. Let me know if you think of use cases.

functions for render*Output can help immensely.

library(htmltools)
@wch
wch / server.r
Last active September 8, 2023 20:25
Shiny example: dynamic input fields
data_sets <- c("mtcars", "morley", "rock")
shinyServer(function(input, output) {
# Drop-down selection box for which data set
output$choose_dataset <- renderUI({
selectInput("dataset", "Data set", as.list(data_sets))
})
# Check boxes