Progress bars
It is quite common within Shiny applications and in analytics generally, to have computations or data fetches that take a long time. Later in the chapter, you will learn some of the ways in which you can control the reactive relationships within an application in order to reduce unnecessary processing.
However, even using all these tools, it will sometimes be necessary for the user to wait some time before their output is returned. In cases like this, it is a good practice to do two things: first, to inform that the server is processing the request and has not simply crashed or otherwise failed, and second, to give the user some idea of how much time has elapsed because they requested the output and how much time they have remaining to wait.
This is achieved very simply in Shiny using the withProgress()
function. This function defaults to measuring progress on a scale from 0 to 1 and produces a loading bar at the top of the application with the information from the message
and...