addItems {timevis} | R Documentation |
Add multiple items to a timeline
Description
Add multiple items to a timeline
Usage
addItems(id, data)
Arguments
id |
Timeline id or a |
data |
A dataframe containing the items data to add. |
Examples
## Not run:
timevis() %>%
addItems(data.frame(start = c(Sys.Date(), Sys.Date() - 1),
content = c("Today", "Yesterday")))
## End(Not run)
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
timevisOutput("timeline"),
actionButton("btn", "Add items today and yesterday")
),
server = function(input, output) {
output$timeline <- renderTimevis(
timevis()
)
observeEvent(input$btn, {
addItems("timeline",
data.frame(start = c(Sys.Date(), Sys.Date() - 1),
content = c("Today", "Yesterday")))
})
}
)
}
[Package timevis version 2.1.0 Index]