Note : I have read almost all the discussions on this object in shiny googlegroups and here in SO.
I need an indicator that shows the shiny server is busy. I have tried shiny incubator, however, the problem is that I can't set a max for progress bar. I don't want something like this : http://shiny.rstudio.com/gallery/progress-example.html What I need is something that: 1- shows a busy indicator message and bar (i.e just a simple animated bar, do not need to show a filling bar) as long as the server is calculating 2- it is shown in no matter which tab you are viewing. (not only in the related tab, but on top of the tabset)
Thanks
Alternatively, you can use
shinycssloaders
package https://github.com/andrewsali/shinycssloadersI found using fadeIn() as opposed to show() helps mitigate this blinking occurence:
Update 2018: Currently there is a great package to help you display loaders:
shinycssloaders
(source: https://github.com/andrewsali/shinycssloaders)I've been looking for this as well. Most people suggest a conditional panel like so:
You could always give yourself more control and create the conditional handling (maybe depending on more stuff) like this in your ui.R:
where some JavaScript handles the showing and hiding of that div:
with some extra css you could make sure your animated busy image gets a fixed postion where it will always be visible.
In any of the above cases i found that the "shiny-busy" condition is somewhat imprecise and unreliable: the div shows for a split second and disappears while computations are still going on... I found a dirty solution to fix that problem, at least in my apps. Feel free to try it out and maybe someone could give an insight to how and why this solves the issue.
In your server.R you'll need to add two reactiveValues:
then, in your renderPlot function (or other output function where computations go on), you use these reactive values to reset the function:
The busy div also appears for split seconds for the latest versions of shiny, even though no apparent calculations are going on (it was not an issue in older versions). Shiny seems to be regularly in its busy-mode for a short time. As a solution (complementing the above discussion), one can include another 2nd delayed validation of the shiny-busy html class for the conditional handling. The JavaScript-part would look something like that (example also includes check for two different div.busy-states depending on the reactive textit):