if (FALSE) {
linevis() %>%
centerTime(Sys.Date() - 1)
}
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
linevisOutput("graph2d"),
actionButton("btn", "Center around 24 hours ago")
),
server = function(input, output) {
output$graph2d <- renderLinevis(
linevis()
)
observeEvent(input$btn, {
centerTime("graph2d", Sys.Date() - 1)
})
}
)
}
Run the code above in your browser using DataLab