# NOT RUN {
if(interactive()){
# try to slide c under 0
ui <- fluidPage(
h4("you need to open up the progress
tracker, it is collapsed ->"),
actionButton("a", "a"),
actionButton("b", "b"),
sliderInput("c", min = -100,
max = 100, value = 0,
label = "c"),
pgPaneUI(
pane_id = "thispg",
titles = c("this a", "this b", " this c"),
pg_ids = c("a", "b", "c"),
title_main = "Example Progress",
opened = TRUE,
top = "30%",
right = "50%"
)
)
server <- function(input, output, session) {
observeEvent(input$a, {
for(i in 1:10){
pgPaneUpdate("thispg", "a", i*10)
Sys.sleep(0.3)
}
})
observeEvent(input$b, {
for(i in 1:10){
pgPaneUpdate("thispg", "b", i*10)
Sys.sleep(0.3)
}
})
observeEvent(input$c, pgPaneUpdate("thispg", "c", input$c))
}
shinyApp(ui, server)
}
# }
Run the code above in your browser using DataLab