This package exposes two distinct programming APIs for working with progress.
Using withProgress
with incProgress
or setProgress
provide a simple function-based interface, while the Progress()
reference class provides an object-oriented API.
Use withProgress
to wrap the scope of your work; doing so will cause a
new progress panel to be created, and it will be displayed the first time
incProgress
or setProgress
are called. When withProgress
exits, the corresponding progress panel will be removed.
The incProgress
function increments the status bar by a specified
amount, whereas the setProgress
function sets it to a specific value,
and can also set the text displayed.
Generally, withProgress
/incProgress
/setProgress
should
be sufficient; the exception is if the work to be done is asynchronous (this
is not common) or otherwise cannot be encapsulated by a single scope. In that
case, you can use the Progress
reference class.
As of version 0.14, the progress indicators use Shiny's new notification API.
If you want to use the old styling (for example, you may have used customized
CSS), you can use style="old"
each time you call
withProgress()
. If you don't want to set the style each time
withProgress
is called, you can instead call
shinyOptions(progress.style="old")
just once, inside the server
function.