Zoom in/out the current visible window

zoomIn(id, percent = 0.5, animation = TRUE)

zoomOut(id, percent = 0.5, animation = TRUE)

Arguments

id

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

percent

The amount to zoom in or out. Must be a number between 0 and 1. A value of 0.5 means that after zooming out the timeline will show 50% more content.

animation

Whether or not to animate the zoom.

Examples


timevis() %>%
  zoomIn()
timevis() %>% zoomOut(0.3)
if (interactive()) { library(shiny) shinyApp( ui = fluidPage( timevisOutput("timeline"), sliderInput("zoom", "Zoom by", min = 0, max = 1, value = 0.5, step = 0.1), checkboxInput("animate", "Animate?", TRUE), actionButton("zoomIn", "Zoom IN"), actionButton("zoomOut", "Zoom OUT") ), server = function(input, output) { output$timeline <- renderTimevis( timevis() ) observeEvent(input$zoomIn, { zoomIn("timeline", percent = input$zoom, animation = input$animate) }) observeEvent(input$zoomOut, { zoomOut("timeline", percent = input$zoom, animation = input$animate) }) } ) }