Creates a timeline control for replaying the history of synchronized inputs
recorded by sync_inputs().
See also
Other sync:
replay_server(),
sync_inputs()
Examples
if (interactive()) {
ui <- shiny::fluidPage(
shiny::selectInput("dist", "Distribution",
c("Normal", "Uniform", "Exponential")),
shiny::sliderInput("n", "Observations", 10, 500, 100),
shiny::plotOutput("plot"),
replay_ui("timeline")
)
server <- function(input, output, session) {
replaying <- sync_inputs()
replay_server("timeline", replaying = replaying)
output$plot <- shiny::renderPlot(
hist(switch(input$dist,
Normal = rnorm(input$n),
Uniform = runif(input$n),
Exponential = rexp(input$n)
))
)
}
shiny::shinyApp(ui, server)
}