{"id":13424028,"url":"https://github.com/JohnCoene/waiter","last_synced_at":"2025-03-15T17:32:56.221Z","repository":{"id":34829603,"uuid":"174504815","full_name":"JohnCoene/waiter","owner":"JohnCoene","description":"🕰️ Loading screens for Shiny","archived":false,"fork":false,"pushed_at":"2024-04-12T07:01:17.000Z","size":42829,"stargazers_count":498,"open_issues_count":30,"forks_count":25,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-15T00:51:46.255Z","etag":null,"topics":["hacktoberfest","r","rstats","shiny"],"latest_commit_sha":null,"homepage":"https://waiter.john-coene.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohnCoene.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"JohnCoene"}},"created_at":"2019-03-08T09:09:17.000Z","updated_at":"2024-09-28T17:18:19.000Z","dependencies_parsed_at":"2024-04-12T08:35:26.030Z","dependency_job_id":null,"html_url":"https://github.com/JohnCoene/waiter","commit_stats":{"total_commits":511,"total_committers":9,"mean_commits":56.77777777777778,"dds":0.03913894324853229,"last_synced_commit":"6e087aa3b19e0bc3075acd85251318cb83197e2c"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnCoene%2Fwaiter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnCoene%2Fwaiter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnCoene%2Fwaiter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnCoene%2Fwaiter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnCoene","download_url":"https://codeload.github.com/JohnCoene/waiter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221435173,"owners_count":16820596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","r","rstats","shiny"],"created_at":"2024-07-31T00:00:47.039Z","updated_at":"2024-10-26T22:32:36.450Z","avatar_url":"https://github.com/JohnCoene.png","language":"JavaScript","funding_links":["https://github.com/sponsors/JohnCoene"],"categories":["CSS","Tools","JavaScript","UI Components"],"sub_categories":["Packages","Loader"],"readme":"---\noutput: \n  github_document:\n    html_preview: false\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"./man/figures/logo.png\" height = \"200px\" /\u003e\n\nLoading screens for Shiny\n\n\u003c!-- badges: start --\u003e\n![R-CMD-check](https://github.com/JohnCoene/waiter/workflows/R-CMD-check/badge.svg)\n[![CRAN status](https://www.r-pkg.org/badges/version/waiter)](https://CRAN.R-project.org/package=waiter)\n\u003c!-- badges: end --\u003e\n\n[Website](https://waiter.john-coene.com) | [Demo](https://shiny.john-coene.com/waiter/) | [Get Started](https://waiter.john-coene.com/#/waiter/intro) | [Cheat Sheet](https://waiter.john-coene.com/#/cheatsheet)\n\u003c/div\u003e\n\nThe 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.\n\n```{r, echo=FALSE, eval=TRUE}\nyes \u003c- \":heavy_check_mark:\"\nno \u003c- \":heavy_multiplication_x:\"\n\nfeat \u003c- tibble::tribble(\n  ~\"Feature\",         ~\"Waiter\", ~\"Waitress\", ~\"Hostess\", ~\"Attendant\",\n  \"Progress Bar\",       yes,      yes,         yes,       yes,\n  \"Full Screen\",        yes,      yes,         no,        no,\n  \"Works with waiter\",  yes,      no,          yes,       yes,\n  \"Spinner\",            yes,      no,          no,        no,\n  \"Updatable\",          yes,      no,          no,        yes,\n  \"Notifications\",      no,      yes,          no,        no \n)\n\nknitr::kable(feat, align = \"c\")\n```\n\n## Examples\n\nBelow are simple examples of applications that use the package, consult the [website](https://waiter.john-coene.com) for more.\n\n## Waiter\n\nTo use the waiter:\n\n1. Include `useWaiter` in your UI.\n2. Trigger `waiter_show` to show the waiting screen.\n3. Eventually trigger `waiter_hide` to hide the loading screen.\n\n```r\nlibrary(shiny)\nlibrary(waiter)\n\nui \u003c- fluidPage(\n  useWaiter(), # include dependencies\n  actionButton(\"show\", \"Show loading for 3 seconds\")\n)\n\nserver \u003c- function(input, output, session){\n\n  observeEvent(input$show, {\n\n    waiter_show( # show the waiter\n      html = spin_fading_circles() # use a spinner\n    )\n\n    Sys.sleep(3) # do something that takes time\n    \n    waiter_hide() # hide the waiter\n  })\n  \n}\n\nshinyApp(ui, server)\n```\n\n![](man/figures//waiter-basic.gif)\n\nThe waiter includes more options to customise the spinner, the background, show the waiter on load, etc.\n\n### Waitress\n\nTo use the waitress:\n\n1. Include `use_waitress` in your UI.\n2. Initialise a waitress from the `Waitress` object with the `new` method.\n3. You must then call the `start`.\n4. On the waitress object use the `increase` method to increase the progress bar.\n5. Use the `hide` method when done.\n\n```r\nlibrary(shiny)\nlibrary(waiter)\n\nui \u003c- fluidPage(\n  useWaitress(),\n  p(\"App content\")\n)\n\nserver \u003c- function(input, output){\n\n  # call the waitress\n  waitress \u003c- Waitress$\n    new(theme = \"overlay-percent\")$\n    start() # start\n\n  for(i in 1:10){\n    waitress$inc(10) # increase by 10%\n    Sys.sleep(.3)\n  }\n\n  # hide when it's done\n  waitress$close() \n\n}\n\nshinyApp(ui, server)\n```\n\n![](man/figures//waitress-basic.gif)\n\nThere are more options to the waitress, you can have it overlay any element (such as the navbar), automagically increment it, etc.\n\n## Get it\n\nYou can install waiter from [CRAN](https://CRAN.R-project.org/package=waiter).\n\n```r\ninstall.packages(\"waiter\")\n```\n\nOr the development version from Github with:\n\n``` r\ninstall.packages(\"remotes\")\nremotes::install_github(\"JohnCoene/waiter\")\n```\n\nPlease note that the 'waiter' project is released with a [Contributor Code of Conduct](https://waiter.john-coene.com/#/coc). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohnCoene%2Fwaiter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJohnCoene%2Fwaiter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohnCoene%2Fwaiter/lists"}