How indicate user the lag due to the time needed to display the webpage

28 views
Skip to first unread message

charlott...@gmail.com

unread,
Mar 9, 2016, 10:25:37 AM3/9/16
to Shiny - Web Framework for R
Dear all,

Yes, I know my question seems quite obscure and I will trying to explain it clearer (if it is still unclear at the end of the post, don't hesitate to ask precisions :D thanks a lot !!).
My question is about how indicate to users that the webpage is currently being displayed.

The context of this question is the following: In my data set, I have more than 20 analyzed chemical elements (reactive input), and in my app I would like to display the results (and graphics) of linear regressions of each element. When I try to display the page with results, it is very long to appear (that is not the worth) but when I change the number of elements, the page is very long to update the page whereas the regression calculation is finished long time ago.

I think an example will be more efficient (of course, this code is completely senseless as the real script is not reproducible without a big dataset):

sidebar <- dashboardSidebar(
  sidebarMenu
(
    menuItem
("Start Project", tabName = "start"),
    menuItem
("Calibration", tabName = "Standards")
))

body
<- dashboardBody(
  tabItems
(
   
##START
    tabItem
("start",
            numericInput
("num", label = h3("Numeric input"), value = 1)
           
           
   
),
    tabItem
("Standards",
            uiOutput
('essai')
           
)
 
)#tabItem
)#dashboardBody

header
<- dashboardHeader(
)

ui
<- dashboardPage(header, sidebar, body)

server
<- function(input, output, session) {  
 

  output$essai
<- renderUI({  
   
    withProgress
(message = 'Making plot', value = 0, {
     
      lapply
(1:input$num, function(i){    
       
        incProgress
(1/input$num, detail = paste("Doing part", i))
       
Sys.sleep(0.02)
       
        plotname2
<- paste("plotSession", i, sep="")
       
        output
[[plotname2]] <- renderPlot({
          plot
(1,1)})

        box
(plotOutput(plotname2))
     
})
     
   
})
   
 
})
}

shinyApp
(ui, server)

For instance, if we ask for 100 plots, all the graphics will not be displayed at the end of the progression of the progress bar.
Other thing, if after enter 100 in numeric input, we put 1, the page will also have a lag for displaying only one graph whereas the progress bar is over.

If I put myself in the place of the person who uses this app, it looks like a big strange, it is like there is no reaction of the computer ??

To remedy this situation, I looked on the topics and I found this progress bar, but I think it is not fixing my problem as it is not a calculation problem but a displaying problem.

Do you have another tip for this situation ??

Thanks a lot in advance and sorry for the complexity of the question...

Cha 

Manali Rupji

unread,
Dec 12, 2017, 3:41:16 PM12/12/17
to Shiny - Web Framework for R
Hello Cha,

I am facing a similar problem when using consensus clustering package from bioconductor. 

Were you able to resolve the issue?

Regards,
Manali

Andras Sali

unread,
Dec 12, 2017, 3:59:55 PM12/12/17
to Manali Rupji, Shiny - Web Framework for R
Hi Manali, 

Maybe you can try the shinycssloaders package. It might provide some useful feedback for the user that there is still something being done. 

Best, 

András 

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/fd78262c-50c6-45cc-af80-1bba91c7209a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages