setCurrentTime {timevis}R Documentation

Adjust the time of the current time bar

Description

Adjust the time of the current time bar

Usage

setCurrentTime(id, time)

Arguments

id

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

time

The new date/time

Examples

## Not run: 
timevis() %>%
  setCurrentTime(Sys.Date())

## End(Not run)

if (interactive()) {
library(shiny)
shinyApp(
  ui = fluidPage(
    timevisOutput("timeline"),
    actionButton("btn", "Set current time to beginning of today")
  ),
  server = function(input, output) {
    output$timeline <- renderTimevis(
      timevis()
    )
    observeEvent(input$btn, {
      setCurrentTime("timeline", Sys.Date())
    })
  }
)
}

[Package timevis version 2.1.0 Index]