Learn R Programming

waiter (version 0.0.6)

butler: Butler

Description

Programmatically show and hide loading bar.

Usage

use_butler()

show_butler()

hide_butler()

config_butler( thickness = 5, colors = list(`0` = "red", `.3` = "blue", `1` = "green"), shadow_blur = 5, shadow_color = "rgba(0, 0, 0, .5)" )

Arguments

thickness

Thickness of the bar.

colors

List of gradient color stops used to draw the progress bar.

shadow_blur

Shadow blur size.

shadow_color

Shadow color.

Functions

  • use_butler: butler dependencies to include anywhere in your UI but ideally at the top.

  • show_butler: Show a butler.

  • hide_butler: Hide butler.

  • config_butler: Configure the butler.

Class

Arguments passed to config_butler are passed to the initialisation method new.

  • Butler: initiatlise a Butler.

Methods

Public methods

Method new()

Usage

Butler$new(
  thickness = 5,
  colors = list(`0` = "red", `.3` = "blue", `1` = "green"),
  shadow_blur = 5,
  shadow_color = "rgba(0, 0, 0, .5)"
)

Arguments

thickness

Thickness of the bar.

colors

List of gradient color stops used to draw the progress bar.

shadow_blur

Shadow blur size.

shadow_color

Shadow color.

Details

Create a butler.

Examples

\dontrun{Butler$new()}

Method show()

Usage

Butler$show()

Details

Show the butler.

Examples

\dontrun{Butler$new()$show()}

Method hide()

Usage

Butler$hide()

Details

Hide the butler.

Examples

\dontrun{Butler$new()$show()$hide()}

Examples

Run this code
# NOT RUN {
library(shiny)

ui <- fluidPage(
	use_butler(),
	br(),
	actionButton("show", "show butler"),
	actionButton("hide", "hide butler")
)

server <- function(input, output){

	observeEvent(input$show,{
		show_butler()
	})

	observeEvent(input$hide,{
		hide_butler()
	})

}

if(interactive()) shinyApp(ui, server)


## ------------------------------------------------
## Method `Butler$new`
## ------------------------------------------------

# }
# NOT RUN {
Butler$new()
# }
# NOT RUN {
## ------------------------------------------------
## Method `Butler$show`
## ------------------------------------------------

# }
# NOT RUN {
Butler$new()$show()
# }
# NOT RUN {
## ------------------------------------------------
## Method `Butler$hide`
## ------------------------------------------------

# }
# NOT RUN {
Butler$new()$show()$hide()
# }

Run the code above in your browser using DataLab