fitWindow: Adjust the visible window such that it fits all items

Description Usage Arguments Examples

Description

Adjust the visible window such that it fits all items

Usage

1

Arguments

id

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

options

Named list of options controlling the animation. Most common option is "animation" = TRUE/FALSE. For a full list of options, see the "fit" 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
if (interactive()) {
library(shiny)
shinyApp(
  ui = fluidPage(
    timevisOutput("timeline"),
    actionButton("btn", "Fit all items")
  ),
  server = function(input, output) {
    output$timeline <- renderTimevis(
      timevis(data.frame(
        id = 1:2, start = c(Sys.Date(), Sys.Date() - 1), content = c("1", "2")
      ))
    )
    observeEvent(input$btn, {
      fitWindow("timeline", list(animation = FALSE))
    })
  }
)
}

westdana/Timeline documentation built on May 3, 2019, 3:02 p.m.