waitressClass {waiter} | R Documentation |
Waitress R6 Class
Description
Create a waitress (progress bar) and programmatically set or increase its percentage, then hide it when done.
Active bindings
max
Maximum value of the bar.
min
Minimum value of the bar.
Methods
Public methods
Method new()
Usage
Waitress$new( selector = NULL, theme = c("line", "overlay", "overlay-radius", "overlay-opacity", "overlay-percent"), min = 0, max = 100, infinite = FALSE, hide_on_render = FALSE )
Arguments
selector
Element selector to apply the waitress to, if
NULL
then the waitress is applied to the whole screen.theme
A valid theme, see function usage.
min, max
Minimum and maximum representing the starting and ending points of the progress bar.
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.hide_on_render
Set to
TRUE
to automatically hide the waitress when the element inid
is rendered. Note the latter will work with shiny plots, tables, htmlwidgets, etc. but will not work with arbitrary elements.color, percent_color
Color of waitress and color of percent text shown when
theme
is set tooverlay-percent
.
Details
Create a waitress.
Examples
\dontrun{Waitress$new("#plot")}
Method start()
Usage
Waitress$start( html = NULL, background_color = "transparent", text_color = "black" )
Arguments
html
HTML content to show over the waitress, accepts htmltools and shiny tags.
background_color
The background color of the html.
text_color
The color of the
html
content.
Details
Start the waitress.
Examples
\dontrun{Waitress$new("#plot")$start()}
Method notify()
Usage
Waitress$notify( html = NULL, background_color = "white", text_color = "black", position = c("br", "tr", "bl", "tl") )
Arguments
html
HTML content to show over the waitress, accepts htmltools and shiny tags.
background_color
The background color of the html.
text_color
The color of the
html
content.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
Show the waitress as a notification.
Examples
\dontrun{Waitress$new()$notify()}
Method set()
Usage
Waitress$set(value)
Arguments
value
Value to set waitress to.
Details
Set the waitress to a specific percentage.
Examples
\dontrun{Waitress$new("#plot")$set(20)}
Method auto()
Usage
Waitress$auto(value, ms)
Arguments
value
Value to set waitress to.
ms
Number of Milliseconds
Details
Automatically start and end the waitress.
Examples
\dontrun{Waitress$new("#plot")$auto(20, 2000)}
Method inc()
Usage
Waitress$inc(value)
Arguments
value
Value to increase waitress to.
Details
Increase the waitress by a percentage.
Examples
\dontrun{Waitress$new("#plot")$inc(30)}
Method close()
Usage
Waitress$close()
Details
Close the waitress.
Examples
\dontrun{Waitress$new("#plot")$close()}
Method getMin()
Usage
Waitress$getMin()
Details
Get minimum value
Method getMax()
Usage
Waitress$getMax()
Details
Get maximum value
Method getValue()
Usage
Waitress$getValue()
Details
Get current value
Method print()
Usage
Waitress$print()
Details
Print the waitress.
Examples
\dontrun{Waitress$new("#plot")$hide()}
Method clone()
The objects of this class are cloneable with this method.
Usage
Waitress$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
## ------------------------------------------------
## Method `Waitress$new`
## ------------------------------------------------
## Not run: Waitress$new("#plot")
## ------------------------------------------------
## Method `Waitress$start`
## ------------------------------------------------
## Not run: Waitress$new("#plot")$start()
## ------------------------------------------------
## Method `Waitress$notify`
## ------------------------------------------------
## Not run: Waitress$new()$notify()
## ------------------------------------------------
## Method `Waitress$set`
## ------------------------------------------------
## Not run: Waitress$new("#plot")$set(20)
## ------------------------------------------------
## Method `Waitress$auto`
## ------------------------------------------------
## Not run: Waitress$new("#plot")$auto(20, 2000)
## ------------------------------------------------
## Method `Waitress$inc`
## ------------------------------------------------
## Not run: Waitress$new("#plot")$inc(30)
## ------------------------------------------------
## Method `Waitress$close`
## ------------------------------------------------
## Not run: Waitress$new("#plot")$close()
## ------------------------------------------------
## Method `Waitress$print`
## ------------------------------------------------
## Not run: Waitress$new("#plot")$hide()