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

custom.css example? #21

Closed ldecicco-USGS closed 4 years ago

ldecicco-USGS commented 5 years ago

I have a graph that is really tall. I'd like to move the spinner to the top instead of the center (it gets lost in the center). I've tried:

withSpinner(plotOutput("endpointGraph", height = height, width = "100%"),
                     custom.css = "vertical-align:top")

and

withSpinner(plotOutput("endpointGraph", height = height, width = "100%"),
                     custom.css = "vertical-align: top;")

But that gives me an error "invalid argument type". Do you have any examples of how to use the custom.css argument?

trafficonese commented 5 years ago

Try with this:

withSpinner(plotOutput(outputId = "distPlot"), custom.css = "vertical-align: top; top: 0%;")

Or just custom.css = "top: 0%;" should be fine too.

tonyk7440 commented 5 years ago

Getting this error also with:

withSpinner(imageOutput(outputId = "wordcloud"), custom.css = "top: 0%;")

Error: Warning: Error in !: invalid argument type 73: withSpinner

emmacooperpeterson commented 5 years ago

I'd also love to see an example of how to use custom.css – can't seem to get anything to work 😞 @andrewsali

daattali commented 4 years ago

The custom.css option takes a TRUE or FALSE, just to tell the package if to add its own CSS or not.

The actual CSS you want to add needs to go in your app's ui. The function now accepts an id parameter so that you can target specific spinners in your CSS