addItems | R Documentation |
Add multiple items to a timeline
addItems(id, data)
id |
Timeline id or a |
data |
A dataframe containing the items data to add. |
## 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"))) }) } ) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.