0

I'm currently working on an application in Shiny (RStudio).
At the end of my application, I allow the user to download a markdown file with the most important results of the application (using downloadButton). However, the process of this file tends to take some time, so I was wondering whether there exists some code that allows me to inform the user that the markdown file is being knitted/downloaded.

On StackOverflow, I already found (and implemented on another position in my ui-file), the following code which displays a 'Loading...' message when Shiny is running a function (with many thanks to user1603038):

conditionalPanel(condition="$('html').hasClass('shiny-busy')",
                 tags$div(h3("Loading..."),
                          tags$p("This can take a few minutes."),
                          id="loadmessage"))

I thought that adapting the id-name would suffice for the code to work, but it doesn't. Did I do anything wrong? Am I not allowed to use this chunk of code multiple times? I suspect that the knitting process does not concern Shiny itself. So, does there exists a similar class in html to indicate that the application is knitting a markdown file (e.g., hasClass('knitr-busy'), which unfortunately does not work)?

Alternatively, is there a way to inform the user that the downloadButton has been pressed and that RStudio is currently knitting the file (which value I -miraculously- should be able to reset after the markdown file has been generated)? I know that the actionButton in Shiny registers the amount of clicks on the button, but I'm not sure whether the downloadButton can provide a similar value...

Thanks in advance!

  • Maybe using `busyIndicator` from `shinysky` package? – SBista Oct 26 '17 at 08:59
  • Thank you for responding, but shinysky uses this "$('html').hasClass('shiny-busy')" condition as well, so my question remains the same... – Fien Gistelinck Nov 22 '17 at 16:11
  • Will have to look into this deeper then. It's weird because I've used busy indicator more than once in my app. – SBista Nov 22 '17 at 16:20
  • I found an answer to my question at the following page: https://stackoverflow.com/a/43663722/7084325 I agree with [SBista](https://stackoverflow.com/users/5894457/sbista) that multiple busy indicators are possible. Yet, I believe that the knitr-process does not involve shiny itself. As a result, I did not end up with any "loading..." comment. Consequently, I looked for the alternative approach in which I used the amount of clicks on the downloadButton as an indicator to display a comment about the file being knitted. Thanks to [BigDataScientist](https://stackoverflow.com/users/3502164/bigdatas – Fien Gistelinck Dec 12 '17 at 14:03

0 Answers0