Description Usage Arguments Examples
Add multiple items to a timeline
1 |
id |
Timeline id or a |
data |
A dataframe containing the items data to add. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | timevis() %>%
addItems(data.frame(start = c(Sys.Date(), Sys.Date() - 1),
content = c("Today", "Yesterday")))
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")))
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.