i have not found the solution for my question about ProgressBar in Shiny for loading the data from database. My Shiny App is connected to database and the user directly gets the data from there (as my SQL Query is reactive, the amount of the data varies). Sometimes the data is quite big and loading it takes some time. The user does not know if something is going on or the app got "stuck". I implemented in my app (in output$tabelle <- DT::renderDataTable({
...) the easiest possible process indicator but it seems to not be enough:
progress <- shiny::Progress$new()
on.exit(progress$close())
progress$set(message = "Processing", value = 0)
The user still gets bit confused.
I would like to have smthg like this (showing a status message in R) using ?tcltk::tkProgressBar
:
pb <- tkProgressBar("test progress bar", "Some information in %",
0, 100, 50)
Sys.sleep(0.5)
u <- c(0, sort(runif(20, 0 ,100)), 100)
for(i in u) {
Sys.sleep(0.1)
info <- sprintf("%d%% done", round(i))
setTkProgressBar(pb, i, sprintf("test (%s)", info), info)
}
Sys.sleep(5)
close(pb)
with some percentage valuating the progress of data loading from database.
I do not know how i can use it inside my shiny app. Any ideas will be helpful.
Thanks in advance!
*some simple app:
library("shiny")
library("DT")
shinyApp(
ui = fluidPage(DT::dataTableOutput('tbl')),
server = function(input, output) {
output$tbl = DT::renderDataTable(
iris)
}
)