setWindow: Set the current visible window

Description Usage Arguments Examples

View source: R/api.R

Description

Set the current visible window

Usage

1

Arguments

id

Timeline id or a timevis object (the output from timevis())

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 animation = TRUE/FALSE. For a full list of options, see the "setWindow" method in the official Timeline documentation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
timevis() %>%
  setWindow(Sys.Date() - 1, Sys.Date() + 1)

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)
    })
  }
)
}

westdana/Timeline documentation built on July 28, 2017, 12:13 a.m.