The 'shinycssloaders' package was developed as a simple wrapper to provide loading icons to UI output, which works great. Unfortunately, it does not work for maps that are updated via leafletProxy (only the initial map produced will use a loading icon).
Is there a known solution for this?
Here's how I use the function provided by github.com/AnalytixWare/ShinySky/blob/master/R/busy-indicator.r
In your UI:
tagList(
tags$head(
tags$script(type="text/javascript", src = "busy.js")
)
),
div(class = "busy", p('your text'),img(src="loader.gif")
)
where a folder www inlcudes the loader.gif and busy.js with
setInterval(function(){
if ($('html').attr('class')=='shiny-busy') {
setTimeout(function() {
if ($('html').attr('class')=='shiny-busy') {
$('div.busy').show()
}
}, 1500)
} else {
$('div.busy').hide()
}
}, 0)
The loader.gif (and the text if provided) then always appears when shiny is busy (with the delay provided in the function).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With