MCPcopy Index your code
hub / github.com/JohnCoene/waiter

github.com/JohnCoene/waiter @v0.2.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.5 ↗ · + Follow
83 symbols 206 edges 23 files 14 documented · 17%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Loading screens for Shiny

R-CMD-check CRAN
status

Website | Demo | Get Started | Cheat Sheet

The waiter lets you programmatically show and hide partial or full page loading screens with spinners or loading bars to keep your users patiently waiting as you load or compute fancy things.

Feature Waiter Waitress Hostess Attendant
Progress Bar :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Full Screen :heavy_check_mark: :heavy_check_mark: :heavy_multiplication_x: :heavy_multiplication_x:
Works with waiter :heavy_check_mark: :heavy_multiplication_x: :heavy_check_mark: :heavy_check_mark:
Spinner :heavy_check_mark: :heavy_multiplication_x: :heavy_multiplication_x: :heavy_multiplication_x:
Updatable :heavy_check_mark: :heavy_multiplication_x: :heavy_multiplication_x: :heavy_check_mark:
Notifications :heavy_multiplication_x: :heavy_check_mark: :heavy_multiplication_x: :heavy_multiplication_x:

Examples

Below are simple examples of applications that use the package, consult the website for more.

Waiter

To use the waiter:

  1. Include useWaiter in your UI.
  2. Trigger waiter_show to show the waiting screen.
  3. Eventually trigger waiter_hide to hide the loading screen.
library(shiny)
library(waiter)

ui <- fluidPage(
  useWaiter(), # include dependencies
  actionButton("show", "Show loading for 3 seconds")
)

server <- function(input, output, session){

  observeEvent(input$show, {

    waiter_show( # show the waiter
      html = spin_fading_circles() # use a spinner
    )

    Sys.sleep(3) # do something that takes time

    waiter_hide() # hide the waiter
  })

}

shinyApp(ui, server)

The waiter includes more options to customise the spinner, the background, show the waiter on load, etc.

Waitress

To use the waitress:

  1. Include use_waitress in your UI.
  2. Initialise a waitress from the Waitress object with the new method.
  3. You must then call the start.
  4. On the waitress object use the increase method to increase the progress bar.
  5. Use the hide method when done.
library(shiny)
library(waiter)

ui <- fluidPage(
  useWaitress(),
  p("App content")
)

server <- function(input, output){

  # call the waitress
  waitress <- Waitress$
    new(theme = "overlay-percent")$
    start() # start

  for(i in 1:10){
    waitress$inc(10) # increase by 10%
    Sys.sleep(.3)
  }

  # hide when it's done
  waitress$close() 

}

shinyApp(ui, server)

There are more options to the waitress, you can have it overlay any element (such as the navbar), automagically increment it, etc.

Get it

You can install waiter from CRAN.

install.packages("waiter")

Or the development version from Github with:

install.packages("remotes")
remotes::install_github("JohnCoene/waiter")

Please note that the ‘waiter’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Core symbols most depended-on inside this repo

o
called by 17
inst/packer/waiter.js
k
called by 15
docs/jsdoc/scripts/prettify/prettify.js
c
called by 14
inst/packer/waitress.js
r
called by 13
inst/packer/hostess.js
x
called by 13
docs/jsdoc/scripts/prettify/prettify.js
t
called by 12
inst/packer/waiter.js
s
called by 12
inst/packer/waitress.js
f
called by 12
inst/packer/waitress.js

Shape

Function 83

Languages

TypeScript100%

Modules by API surface

srcjs/exts/waitress/progress.js16 symbols
docs/jsdoc/scripts/prettify/prettify.js14 symbols
inst/packer/waitress.js13 symbols
inst/packer/waiter.js8 symbols
inst/assets/garcon/garcon.min.js8 symbols
inst/packer/hostess.js5 symbols
srcjs/exts/waiter/waiter.js4 symbols
inst/packer/attendant.js4 symbols
srcjs/exts/attendant/attendant.js3 symbols
srcjs/exts/waiter/callbacks.js2 symbols
srcjs/exts/waitress/waitress.js1 symbols
srcjs/exts/waiter/overlay.js1 symbols

For agents

$ claude mcp add waiter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page