setCurrentTime | R Documentation |
Adjust the time of the current time bar
setCurrentTime(id, time)
id |
Timeline id or a |
time |
The new date/time |
## Not run:
timevis() %>%
setCurrentTime(Sys.Date())
## End(Not run)
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
timevisOutput("timeline"),
actionButton("btn", "Set current time to beginning of today")
),
server = function(input, output) {
output$timeline <- renderTimevis(
timevis()
)
observeEvent(input$btn, {
setCurrentTime("timeline", Sys.Date())
})
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.