I think it would be handy to have an autoAttendantBar() which behaves similarly to autoWaiter(), i.e. it is shown on shiny:recalculating and closed on shiny:error or shiny:value.
Also, inspired by the behaviour of NProgress I think it would be more satisfying visually if:
The automatic increase interval was not fixed but rather depended on the value of the progress bar so that the bar initially increases quickly and then slows down as we approach the end.
The progress bar was finished off before being hidden when it is closed.
i.,e. this kind of behaviour:
# Increase by decaying interval
pbNext <- function(pb, x0 = 0.1, rate = 5) {
next_val <- pb$getVal() + x0*exp(-rate*pb$getVal())
pb$up(next_val)
}
# When finished, increase by random amount, wait, then increase to end
pbDone <- function(pb, ms = 100) {
nextval <- pb$getVal() + runif(1, 0, 1-pb$getVal())
pb$up(nextval)
Sys.sleep(ms/1000)
pb$up(1)
close(pb)
}
pb <- utils::txtProgressBar()
while (pb$getVal() < 1) {
Sys.sleep(0.1)
# Imagine we hit `shiny:value` just after progbar crosses midway
if (pb$getVal()<0.6) {
pbNext(pb)
} else {
pbDone(pb)
}
}
Stellar package!
I think it would be handy to have an
autoAttendantBar()
which behaves similarly toautoWaiter()
, i.e. it is shown onshiny:recalculating
and closed onshiny:error
orshiny:value
.Also, inspired by the behaviour of NProgress I think it would be more satisfying visually if:
The automatic increase interval was not fixed but rather depended on the value of the progress bar so that the bar initially increases quickly and then slows down as we approach the end.
The progress bar was finished off before being hidden when it is closed.
i.,e. this kind of behaviour:
Relevant parts of NProgress here: https://github.com/rstacruz/nprogress/blob/e1a8b7fb6e059085df5f83c45d3c2308a147ca18/nprogress.js#L148-L177