if (FALSE) {
linevis(data.frame(start = Sys.Date(), content = "Today")) %>%
setItems(data.frame(start = Sys.Date() - 1, content = "yesterday"))
}
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
linevisOutput("graph2d"),
actionButton("btn", "Change the data to yesterday")
),
server = function(input, output) {
output$graph2d <- renderLinevis(
linevis(data.frame(start = Sys.Date(), content = "Today"))
)
observeEvent(input$btn, {
setItems("graph2d",
data.frame(start = Sys.Date() - 1, content = "yesterday"))
})
}
)
}
Run the code above in your browser using DataLab