waitressClass: Waitress R6 Class

Description Methods Examples

Description

Create a waitress (progress bar) and programmatically set or increase its percentage, then hide it when done.

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 in id 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 to overlay-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, and tl 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 increase()

Usage
Waitress$increase(percent)
Arguments
percent

Percentage to increase waitress to.

Details

Deprecated in favour of inc method. Increase the waitress by a percentage.


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 hide()

Usage
Waitress$hide()
Details

Deprecated in favour of close method. Hide the waitress.


Method close()

Usage
Waitress$close()
Details

Close the waitress.

Examples
\dontrun{Waitress$new("#plot")$close()}

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## ------------------------------------------------
## 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()

waiter documentation built on July 12, 2020, 5:05 p.m.