pgPaneUI | R Documentation |
Creates a panel that displays multiple progress items.
Use pgPaneUI on UI side and use pgPaneUpdate
to update it.
A overall progress is automatically calculated on the bottom.
pgPaneUI(
pane_id,
titles,
pg_ids,
title_main = NULL,
opened = FALSE,
top = "3%",
right = "2%"
)
pgPaneUpdate(pane_id, pg_id, value, session = getDefaultReactiveDomain())
pane_id |
Progress panel main ID, use |
titles |
labels to display for each progress, must have the same length
as |
pg_ids |
a character vector of IDs for each progress. Don't forget
to use |
title_main |
If not specified and pane_id contains 'plot', title will be 'Plot Prepare'; has 'df' will be 'Data Prepare', if neither will be "Progress" |
opened |
bool, if this panel is opened at start |
top |
css style off set to the current windown top |
right |
css style off set to the current windown right |
pg_id |
a character string of ID indicating which progress within this
panel you want to update.
Do not use |
value |
0-100 number to update the progress you use |
session |
current shiny session |
returns HTML elements
if(interactive()){
# try to slide c under 0
ui <- fluidPage(
h4("Use your mouse to drag it"),
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.