hostess {waiter} | R Documentation |
Hostess
Description
Add hostess dependencies.
Usage
use_hostess()
useHostess()
Methods
Public methods
Method new()
Usage
Hostess$new(id = NULL, min = 0, max = 100, n = 1, infinite = FALSE)
Arguments
id
Id used in
hostess_loader
if you generate the loader with theloader
method you may leave thisNULL
.min, max
Minimum and maximum representing the starting and ending points of the progress bar.
n
Number of loaders to generate.
infinite
Set to
TRUE
to create a never ending loading bar, ideal when you cannot compute increments or assess the time it might take before the loading bar should be removed.
Details
Create a hostess.
Examples
\dontrun{Hostess$new()}
Method start()
Usage
Hostess$start()
Details
Start the hostess
Method print()
Usage
Hostess$print()
Details
Print the hostess
Method set()
Usage
Hostess$set(value)
Arguments
value
Value to set, between
0
and100
.
Details
Set the hostess loading bar.
Examples
\dontrun{Hostess$new()$set(20)}
Method inc()
Usage
Hostess$inc(value)
Arguments
value
Value to set, between
0
and100
.
Details
Increase the hostess loading bar.
Examples
\dontrun{Hostess$new()$inc(10)}
Method close()
Usage
Hostess$close()
Details
Close the hostess
Examples
\dontrun{Waitress$new("#plot")$close()}
Method get_loader()
Usage
Hostess$get_loader( preset = NULL, text_color = "#FFFFFF", center_page = FALSE, class = "", min = NULL, max = NULL, 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, ... )
Arguments
preset
A loading bar preset, see section below.
text_color
The color of the loading text.
center_page
By default the hostess is centered in the middle of the screen, ideal when using it with waiter full screen, set to
FALSE
to prevent that.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.:
M10 10L90 10
or the path to a.svg
file. Note that if passing the latter it must be made available to Shiny by placing it either in thewww
folder or usingshiny::addResourcePath()
.progress_type
The progress type, either
stroke
orfill
. Ther former traces the path of thesvg
while the latter fills it progressively.fill_direction, stroke_direction
The direction which the progress bar should take. Wether
fill_direction
orstroke_direction
is used depends onprogress_type
.fill_color, stroke_color
The color to use for the progress bar. Wether
fill_color
orstroke_color
is used depends onprogress_type
....
Any other other advanced options to pass to the loaded see the official documentation.
Details
Create a hostess loading bar.
Examples
\dontrun{Hostess$new()$get_loader()}
Method set_loader()
Usage
Hostess$set_loader(loader)
Arguments
loader
Loader as defined by
hostess_loader()
.
Details
Set a hostess loader as defined by hostess_loader()
.
Examples
\dontrun{ loader <- hostess_loader() Hostess$new()$set_loader(loader) }
Method notify()
Usage
Hostess$notify( html = NULL, background_color = "transparent", text_color = "black", position = c("br", "tr", "bl", "tl") )
Arguments
html
Additional HTML content of the tag or a character string.
background_color
Background color of the notification.
text_color
Color of text of
html
.position
Position of the notification on the screen. Where
br
is the bottom-right,tr
is the top-right,bl
is bottom-left, andtl
is the top-left.
Details
Use the hostess as a notification. It is hidden when set
tpo 100
.
Examples
\dontrun{Hostess$new()$notify()}
Method clone()
The objects of this class are cloneable with this method.
Usage
Hostess$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
## ------------------------------------------------
## Method `Hostess$new`
## ------------------------------------------------
## Not run: Hostess$new()
## ------------------------------------------------
## Method `Hostess$set`
## ------------------------------------------------
## Not run: Hostess$new()$set(20)
## ------------------------------------------------
## Method `Hostess$inc`
## ------------------------------------------------
## Not run: Hostess$new()$inc(10)
## ------------------------------------------------
## Method `Hostess$close`
## ------------------------------------------------
## Not run: Waitress$new("#plot")$close()
## ------------------------------------------------
## Method `Hostess$get_loader`
## ------------------------------------------------
## Not run: Hostess$new()$get_loader()
## ------------------------------------------------
## Method `Hostess$set_loader`
## ------------------------------------------------
## Not run:
loader <- hostess_loader()
Hostess$new()$set_loader(loader)
## End(Not run)
## ------------------------------------------------
## Method `Hostess$notify`
## ------------------------------------------------
## Not run: Hostess$new()$notify()