if(interactive()){
ui <- fluidPage(
column(6,
spsTimeline(
"b",
up_labels = c("2000", "2001"),
down_labels = c("step 1", "step 2"),
icons = list(icon("table"), icon("gear")),
completes = c(FALSE, TRUE)
)
),
column(6,
actionButton("a", "complete step 1"),
actionButton("c", "uncomplete step 1"))
)
server <- function(input, output, session) {
observeEvent(input$a, {
updateSpsTimeline(session, "b", 1, up_label = "0000", down_label = "Finish")
})
observeEvent(input$c, {
updateSpsTimeline(session, "b", 1, complete = FALSE,
up_label = "9999", down_label = "Step 1")
})
}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab