Shiny is our internal BI tool. For our Shiny apps, we load data before shinyServer running:
load("afterProcessedData.RData") # or dt = fread("afterProcessedData.csv") shinyServer(function(input, output, session){ ... However, some of apps are loading big files and they take up to 30s to load up. Many users, when they open a page, don't know whether the page is broken since it is stuck when it is loading. They may close it or click filters, which may cause an error. In this case, a progress bar will be very helpful. I notice withProgress() may help but it has to be inside reactive() or renderXx().
One way I can do is to have laod() warpped with reactive() inside the shinyServer(function(input, output, session){ but my concern is it will slower the performance. And my users very care about the responsive performance.
Any suggestions for this situation?
Edit: I guess there is not an easy way to do this. I have another thought. Maybe I can show a text on the screen saying 'the data is loading', but I have to make it disappear after the first table gets show up. However, I don't know how to set up the condition. Below is my code showing first table:
dashboardBody( fluidRow( tabBox(width = 12, tabPanel("Summary", dataTableOutput("data1")), Thank you in advance!
withProgress()inside areactive ()orrender()a problem ? . Even though, I am not happy with the kind status bar it displays, but it works OK for me when I wrapwithProgressin all myrender()functions .renderthat out on ShinywithProgress()?output$Ref_output <- DT::renderDataTable(withProgress( message = 'Processing the query', value = 5, expr = { DT::datatable(reference.table(), selection = 'multiple')With some changes to CSS file the progress bar is thicker and in red color than default one.load()in thereactive()is that it will slow down the performance since each change will call aload(). The second solution withSO solutionssomehow makesload()3 times longer, which will be blamed by clients.loadat every session? for everything else you can and should usewithProgress()also desable buttons while people wait withshinyjspackage so they dont click on anything until its fully loaded