| 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
maxMaximum value of the bar.
minMinimum 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
selectorElement selector to apply the waitress to, if
NULLthen the waitress is applied to the whole screen.themeA valid theme, see function usage.
min, maxMinimum and maximum representing the starting and ending points of the progress bar.
infiniteSet to
TRUEto 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_renderSet to
TRUEto automatically hide the waitress when the element inidis rendered. Note the latter will work with shiny plots, tables, htmlwidgets, etc. but will not work with arbitrary elements.color, percent_colorColor of waitress and color of percent text shown when
themeis 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
htmlHTML content to show over the waitress, accepts htmltools and shiny tags.
background_colorThe background color of the html.
text_colorThe color of the
htmlcontent.
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
htmlHTML content to show over the waitress, accepts htmltools and shiny tags.
background_colorThe background color of the html.
text_colorThe color of the
htmlcontent.positionPosition of the notification on the screen. Where
bris the bottom-right,tris the top-right,blis bottom-left, andtlis the top-left.
Details
Show the waitress as a notification.
Examples
\dontrun{Waitress$new()$notify()}
Method set()
Usage
Waitress$set(value)
Arguments
valueValue 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
valueValue to set waitress to.
msNumber of Milliseconds
Details
Automatically start and end the waitress.
Examples
\dontrun{Waitress$new("#plot")$auto(20, 2000)}
Method inc()
Usage
Waitress$inc(value)
Arguments
valueValue 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
deepWhether 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()