Description Usage Arguments Examples
Select one or multiple items on a timeline
1 | setSelection(id, itemId, options)
|
id |
Timeline id or a |
itemId |
A vector (or single value) of the item ids to select |
options |
Named list of options controlling mainly the animation.
Most common options are |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | timevis(data.frame(id = 1:3, start = Sys.Date(), content = 1:3)) %>%
setSelection(2)
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
timevisOutput("timeline"),
actionButton("btn", "Select item 2")
),
server = function(input, output) {
output$timeline <- renderTimevis(
timevis(
data.frame(id = 1:3, start = Sys.Date(), content = 1:3)
)
)
observeEvent(input$btn, {
setSelection("timeline", 2)
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.