Closed niv29 closed 3 years ago
This works on the Github development version.
library(shiny)
library(waiter)
ui <- fluidPage(
use_waiter(), # include dependencies
tags$style(
".waiter-overlay-content{
position: absolute;
top: 30px; /*30 pixels from the top*/
left: 48%; /*48% from the left*/
}"
),
actionButton("showFull", "Show full screen"),
actionButton("showPartial", "Show partial"),
div(
id = "hello",
style = "width:400px;height:500px;",
h4("This could be a chart of whatever")
)
)
server <- function(input, output, session){
# partial
w1 <- Waiter$new("hello")
observeEvent(input$showPartial, {
w1$show()
Sys.sleep(4)
w1$hide()
})
# full screen
w2 <- Waiter$new()
observeEvent(input$showFull, {
w2$show()
Sys.sleep(4)
w2$hide()
})
}
shinyApp(ui, server)
I'm not sure I should add it to the package: it would add more arguments, etc. where there are already many but it's worth mentioning in the documentation.
Let me know if this works.
I'm going to go ahead and close before I forget. Feel free to reopen if you think this should be addressed differently.
This works perfectly fine for partial screen. Thank you!!
Feature to place the spinner wheel on top of the waiter screen would really help!