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