dreamRs / shinybusy

Minimal busy indicator for Shiny apps
https://dreamrs.github.io/shinybusy/
Other
138 stars 16 forks source link

additional libraries? #4

Closed vgeo999 closed 3 years ago

vgeo999 commented 4 years ago

Hi there,

I really enjoy your package! Can you tell me if I need additional libraries on a shiny server to run it? So far, I included it in my app code and locally (in RStudio on my personal computer) it works as expected. But, as soon as I transfer the code to my shiny server, the webpage only shows a blank square instead of a spinner. When approaching the line remove_modal_spinner() the blank square disappears as it should and everything else is also working fine. Since I don't get any error message I was wondering if my Linux system, where the shiny server is running, maybe needs additional libraries?

Thank you very much! Liz

pvictor commented 4 years ago

Hi, There's no additional libraries needed that I can think. Can you provide sessionInfo() from your Linux system ? What functions are you using ? I can run some tests on my side.

Victor

vgeo999 commented 4 years ago

Hi, thanks for the quick response. I don't have any special functions. This is the code I used now to get the attached sessionInfo while seeing the blank square again.

# somebody clicked the action button
show_modal_spinner()
writeLines(capture.output(sessionInfo()), "sessionInfo.txt")
# wait some time while calculating desired output
suppressWarnings(calc(rv$name,rv$tab,rv$lab,rv$sam,rv$des,rv$pan, rv$rep))
# tell me if successful
print("calculation finished")
remove_modal_spinner()

Meanwhile I tested my app in firefox and chrome. While the latter shows me at least a greyish modal environment with a white square, surprisingly nothing happens in firefox - it just stays in a white and interactive state until the app moves on to the next step after the calculation. hm.

I also tested to use: showModal(modalDialog(add_busy_spinner(spin="folding-cube", position = "full-page"), title="Calculate data...", "Please wait, this task might take a while.", footer = NULL)) but with the same effect.

Thanks for looking into it! Would be a shame to not visually please my users with your spinners :) Liz sessionInfo.txt

pvictor commented 4 years ago

Hello Liz,

Thank you for the additional information. The problem occur with shiny v1.0.5, two quick ways to fix it :

or

fluidPage(

  # the two lines below
  shinybusy:::spinkit_dependencies(),
  shinybusy:::epic_spinners_dependencies(),

  ...

)

(the ::: are important, these functions are currently not exported)

I'm gonna see if there's another way.

I hope your users will like the spinners!

Victor

vgeo999 commented 4 years ago

Hey Victor, awesome! I was a bit afraid of updating shiny because of this 'never touch a running system' advice, but I also didn't want to leave my running system untouched (in terms of visual improvements), so adding these two lines did the trick indeed! Thank you. Is this add_busy_spinner() function different from the show_modal_spinner() function? Because the second example, where I tried to add a spinner into a modal dialog, still doesn't work. But I don't really need it, so just curious. Thank you very much for your quick help! Liz

pvictor commented 4 years ago

Hi Liz,

Purpose of add_busy_spinner is to be used once in your UI to add an automatic spinner in the top right corner of the page, see an example by typing ?add_busy_spinner.

Victor