preview_spinner
.print
method added for this.waiter_on_busy
include_js
argument to simplify APIwaiter_set_theme
, waiter_get_theme
, and waiter_unset_theme
) to enable setting a global theme; making such that every waiter loading screen uses the same options (color
, html
, and logo
). This can e overridden in individual waiter loading screens.spin_google
spinnertransparent
to easily create transparent waiter backgrounds.use_waiter
takes a spinner
argument to which one can specify any of 7 spinner CSS kits, by default all kits are loaded. One can know which kits should be specified by simply typing the spinner in the console, e.g.: spin_rotating_plane()
.Version 0.1.0
sees great many changes. Nothing has been broken but has been deprecated. The steward
and garcon
family of functions have been added.
All functions now start with waiter_
.
waiter_show
function deprecates show_waiter
waiter_hide
function deprecates hide_waiter
waiter_update
function deprecates update_waiter
waiter_show_on_load
function deprecates show_waiter_on_load
waiter_hide_on_load
function deprecates hide_waiter_on_load
The Reference class Waiter
takes a new optional id
first argument which takes one or more ids of elements to overlay the waiter over, the content of the waiter (html
) becomes the second argument. If passing a list of ids one can pass a list of content html
.
library(shiny)
library(waiter)
ui <- fluidPage(
use_waiter(),
actionButton("btn", "Render"),
fluidRow(
column(6, plotOutput("plot1")),
column(6, plotOutput("plot2"))
)
)
server <- function(input, output) {
w <- Waiter$new(
list("plot1", "plot2"),
html = list(spin_1(), spin_2())
)
dataset <- reactive({
input$btn
w$show()
Sys.sleep(2)
runif(100)
})
output$plot1 <- renderPlot(plot(dataset()))
output$plot2 <- renderPlot(plot(dataset()))
}
shinyApp(ui, server)
The waitress also sees a lot of changes, again nothing has been broken.
call_waitress
has been deprecated in favour of the Reference class, please use Waitress$new()
instead.shiny::Progress
min
and max
arguments, one is no longer limited to percentageshtml
argument on start
method to add content on waitresslibrary(shiny)
library(waiter)
ui <- fluidPage(
use_waitress(),
actionButton("btn", "render"),
plotOutput("plot")
)
server <- function(input, output) {
w <- Waitress$new("#plot", min = 0, max = 10)
output$plot <- renderPlot({
input$btn
w$start("LOADING")
for(i in 1:10){
Sys.sleep(.3)
w$inc(1)
}
w$close()
plot(runif(100))
})
}
shinyApp(ui, server)
The hostess is a new addition to the staff, it works hand in hand with waiter to allow you to layer a progress bar on top of the waiter (though it can be used on its own). Moreover the latter progress bars can be greatly customised.
library(shiny)
library(waiter)
ui <- fluidPage(
use_waiter(),
use_hostess(),
waiter_show_on_load(
color = "#f7fff7",
hostess_loader(
"loader",
preset = "circle",
text_color = "black",
class = "label-center",
center_page = TRUE
)
)
)
server <- function(input, output){
hostess <- Hostess$new("loader")
for(i in 1:10){
Sys.sleep(runif(1) / 2)
hostess$set(i * 10)
}
waiter_hide()
}
shinyApp(ui, server)