Description Usage Arguments Examples
Update the configuration options of a timeline
1 | setOptions(id, options)
|
id |
Timeline id or a |
options |
A named list containing updated configuration options to use.
See the |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | timevis(
data.frame(start = Sys.Date(), content = "Today"),
options = list(showCurrentTime = FALSE, orientation = "top")
) %>%
setOptions(list(editable = TRUE, showCurrentTime = TRUE))
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
timevisOutput("timeline"),
actionButton("btn", "Show current time and allow items to be editable")
),
server = function(input, output) {
output$timeline <- renderTimevis(
timevis(
data.frame(start = Sys.Date(), content = "Today"),
options = list(showCurrentTime = FALSE, orientation = "top")
)
)
observeEvent(input$btn, {
setOptions("timeline", list(editable = TRUE, showCurrentTime = TRUE))
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.