hostessLoader {waiter} | R Documentation |
Loader
Description
Customise the Hostess laoding bar.
Usage
hostess_loader(
id = "hostess",
preset = NULL,
text_color = "#FFFFFF",
center_page = FALSE,
class = "",
min = 0,
max = 100,
svg = NULL,
progress_type = c("stroke", "fill"),
fill_direction = c("btt", "ttb", "ltr", "rtl"),
stroke_direction = c("normal", "reverse"),
fill_color = NULL,
stroke_color = NULL,
...
)
hostess_gradient(angle = 0, duration = 1, colors = c("red", "white", "blue"))
hostess_bubble(
color_background = "#697682",
color_bubble = "#f7fff7",
count = 25,
duration = 1
)
hostess_stripe(color1 = "#697682", color2 = "#f7fff7", duration = 1)
Arguments
id |
Id of hostess (valid CSS). |
preset |
A loading bar preset, see section below. |
text_color |
The color of the loading text. |
center_page |
By default the hostess is not centered in the middle
of the screen, centering in the middle of the page is however ideal when using
it with waiter full screen, for the latter set to |
class |
CSS class. |
min , max |
Minimum and maximum representing the starting and ending points of the progress bar. |
svg |
Either an svg path e.g.: |
progress_type |
The progress type, either |
fill_direction , stroke_direction |
The direction which the progress bar should
take. Wether |
fill_color , stroke_color |
The color to use for the progress bar.
Wether |
... |
Any other other advanced options to pass to the loaded see the official documentation. |
angle |
Angle of gradient. |
duration |
Duration of the loop. |
colors |
Color vectors composing the gradient. |
color_background |
The background of the color. |
color_bubble |
The color of the bubbles contour. |
count |
The number of bubbles. |
color1 , color2 |
Colors of stripes. |
Presets
line
fan
circle
bubble
rainbow
energy
stripe
text
Examples
library(shiny)
library(waiter)
# diagonal line
path <- "M10 10L90 30"
ui <- fluidPage(
useWaiter(),
useHostess(),
actionButton("draw", "redraw"),
plotOutput("plot")
)
server <- function(input, output) {
dataset <- reactive({
input$draw
hostess <- Hostess$new(min = 0, max = 10)
hostess$set_loader <- hostess_loader(
progress_type = "stroke",
stroke_color = hostess_stripe()
)
waiter <- Waiter$new(
"plot",
hostess$loader()
)
waiter$show()
for(i in 1:10){
Sys.sleep(.2)
hostess$inc(1)
}
runif(100)
})
output$plot <- renderPlot(plot(dataset()))
}
if(interactive()) shinyApp(ui, server)