Description Usage Arguments Examples
Move the window such that the given time is centered
1 | centerTime(id, time, options)
|
id |
Timeline id or a |
time |
The date/time to center around |
options |
Named list of options controlling the animation. Most common
option is |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | timevis() %>%
centerTime(Sys.Date() - 1)
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
timevisOutput("timeline"),
actionButton("btn", "Center around 24 hours ago")
),
server = function(input, output) {
output$timeline <- renderTimevis(
timevis()
)
observeEvent(input$btn, {
centerTime("timeline", Sys.Date() - 1)
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.