I'm working with a Shiny app where I need to calculate processes and while the calc progress is executing, I'm using a progressBar
to show the process.
The problem is that the progress bar is too small, and I don't like the way is shown.
So, I was thinking that maybe there's a way to implement a progress bar using a Shiny modal (there's a function called modalDialog
).
My idea is that when the user runs the calc, a modal will be opened showing a progressBar
.
This is the progress code:
withProgress(message = 'Runing GSVA', value = 0, {
incProgress(1, detail = "This may take a while...")
functionToGenerate()
})
Any idea?
Hi i wrote a progress bar function in the package
shinyWidgets
, you can put it in a modal, but it's tricky to use withshiny::showModal
, so you can create your own modal manually like below. It's more code to write but it works fine.I would suggest customizing the CSS class of the notification: If you inspect the element of the notifier you see that it has the class "shiny-notification". So you can overwrite some properties of that class with
tags$style()
. In the example below (for the template: see?withProgress
) i decided to adjust height+width to make it bigger and top+left to center it.