The withProgress() function can generate a message box indicating the shiny app is running. But the message is at the top-right conner of the browser with a small text size, which makes the message not that eye-catching.
So I wonder is there any way that I could change the style and the position of this box, so that the message can be more expressive.
Here is a part of my code:
output$plot <- renderPlot({
if (input$button){
withProgress(
distributionPolygon(data(),unit="years",colors=c("black","gray30","gray50","gray70","blue3","dodgerblue3","steelblue1","lightskyblue1","red4","indianred3","orange","seagreen4"),main=title(),tpsMax=input$months),
message = 'Loading...',
detail = ''
)
}
})
Easy way: You can just include the HTML function tags$head() in the ui to overlay the progress bar. Since it's a notification it can be called with .shiny-notification. Simplest way is to put this line somewhere in the ui and adjust the positions (and other CSS related parameters, see here.
ui <- fluidPage(
titlePanel(),
tags$head(tags$style(".shiny-notification {position: fixed; top: 60% ;left: 50%)),
sidebarPanel()
mainPanel()
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With