setWindow {timevis} | R Documentation |
Set the current visible window
Description
Set the current visible window
Usage
setWindow(id, start, end, options)
Arguments
id |
Timeline id or a |
start |
The start date/time to show in the timeline |
end |
The end date/time to show in the timeline |
options |
Named list of options controlling mainly the animation.
Most common option is |
Examples
## Not run:
timevis() %>%
setWindow(Sys.Date() - 1, Sys.Date() + 1)
## End(Not run)
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
timevisOutput("timeline"),
actionButton("btn", "Set window to show between yesterday to tomorrow")
),
server = function(input, output) {
output$timeline <- renderTimevis(
timevis()
)
observeEvent(input$btn, {
setWindow("timeline", Sys.Date() - 1, Sys.Date() + 1)
})
}
)
}
[Package timevis version 2.1.0 Index]