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

Transparent background? #22

Closed yueqiw closed 3 years ago

yueqiw commented 5 years ago

Hi,

The package is great for shiny apps. I'm wondering if it's possible to use transparent background so that the previous plots won't disappear entirely? Thanks!

trafficonese commented 5 years ago

The problem is not the background-color. The problem is, that when the spinner shows, the underlying ouput visibility is set to hidden.

To undo this you have to change the spinner.js code. Uncomment line 4 (below) and you get what you want: $(".recalculating").siblings(".load-container").siblings('.shiny-bound-output, .shiny-output-error').css('visibility', 'hidden');

DavidPatShuiFong commented 5 years ago

A working example can be found by Gao Zheng at https://github.com/Pill-GZ/shinycssloaders/commit/358c007ea1a891f21bbec2c189a6fb5db952017b

It doesn't work perfectly well with datatables, for which the height of the table is not known at the time withspinner is called, and so is estimated. The problem is that, when/if the table is changed, the 'estimated' height is placed, as blank space, above the table.

In that case, I found I need to set proxy.height to zero. The 'spinner' ends up appearing at the top of where the table will appear.

daattali commented 3 years ago

I've added a hide.ui parameter to support this.