daattali / shinycssloaders

⌛ Add loading animations to a Shiny output while it's recalculating
https://daattali.com/shiny/shinycssloaders-demo/
Other
395 stars 45 forks source link

Global loader #42

Closed iferres closed 1 year ago

iferres commented 4 years ago

Hi, is it possible to add a global loader when certain events occur? With global loader I mean one single loader for a whole page (or many plots/tables). May be these are 2 separate questions: 1) Is it possible to add a global loader for a whole page/tab? And 2) is it possible to deploy them when certain event happens? Thanks

daattali commented 4 years ago

This isn't supported but would be a welcomed PR

ismirsehregal commented 4 years ago

You can manually trigger a "global" spinner as described here.

daattali commented 1 year ago

The solution provided by @ismirsehregal can be used. But this package is mostly concerned with adding loader spinners to outputs. In an effort to avoid feature creep, I've decided that we won't support this feature, but there are other packages such as {waiter} that can be used for full-screen spinners.

daattali commented 1 year ago

Re-opening because I'm currently in the midst of making a lot of feature additions, and I have an idea of how to implement this as well.

daattali commented 1 year ago

@iferres @ismirsehregal this is now supported. You need to call pageSpinner() in the UI (it supports most of the same parameters), and then you can use showPageSpinner()/hidePageSpinner(). See the function documentation.

Please let me know if this works as expected.

iferres commented 1 year ago

Thank you very much @daattali, really appreciate your effort. But unfortunately I'm no longer working on any shiny project right now where I could test it.

ismirsehregal commented 1 year ago

@daattali - it is working fine - thanks!

daattali commented 1 year ago

@iferres @ismirsehregal I changed how the full page spinner works. There is no longer a UI function pageSpinner(). Now you only need to call showPageSpinner() with all the parameters.

I had to do this because otherwise you could only have a single look for the page spinner. Now you can use the page spinner multiple times, with different parameters every time.