### Install shinybusy from GitHub Source: https://github.com/dreamrs/shinybusy/blob/master/README.md Install the development version of the shinybusy package from GitHub using the remotes package. ```r remotes::install_github("dreamRs/shinybusy") ``` -------------------------------- ### Install shinybusy from CRAN Source: https://github.com/dreamrs/shinybusy/blob/master/README.md Install the stable version of the shinybusy package from CRAN using this command. ```r install.packages("shinybusy") ``` -------------------------------- ### Start-up Screen with Automatic Removal Source: https://context7.com/dreamrs/shinybusy/llms.txt Display a loading screen when the application starts using busy_start_up() with mode = "auto". The screen will automatically be removed after a specified timeout, indicating the app is ready. ```r library(shiny) library(shinybusy) ui <- fluidPage( # Show loading screen until app is ready busy_start_up( loader = spin_epic("flower", color = "#112446"), text = "Loading application...", mode = "auto", timeout = 500, color = "#112446", background = "#f0f0f0" ), tags$h1("Application Ready!"), plotOutput("plot") ) server <- function(input, output, session) { output$plot <- renderPlot({ Sys.sleep(2) # Simulate initial loading plot(rnorm(100)) }) } shinyApp(ui, server) ``` -------------------------------- ### Install Node Modules with Packer Source: https://github.com/dreamrs/shinybusy/blob/master/README.md Install the necessary Node.js modules for managing JavaScript assets using the packer package. ```r packer::npm_install() ``` -------------------------------- ### Start-up Screen with Manual Removal Source: https://context7.com/dreamrs/shinybusy/llms.txt Control the removal of the start-up screen from the server side using busy_start_up() with mode = "manual". The screen remains visible until remove_start_up() is explicitly called, allowing for controlled initialization. ```r library(shiny) library(shinybusy) ui <- fluidPage( busy_start_up( loader = tags$img( src = "https://jeroen.github.io/images/banana.gif", width = 100 ), text = "Initializing...", mode = "manual" ), tags$h1("Application Content") ) server <- function(input, output, session) { # Perform initialization tasks Sys.sleep(3) # Manually remove start-up screen when ready remove_start_up(timeout = 100) } shinyApp(ui, server) ``` -------------------------------- ### Implement Progress Widgets Source: https://context7.com/dreamrs/shinybusy/llms.txt Adds line, circle, or semicircle progress indicators that can be updated dynamically from the server. ```r library(shiny) library(shinybusy) ui <- fluidPage( tags$h2("Progress Indicators"), fluidRow( column(4, tags$p("Line Progress:"), progress_line( value = 0, color = "#112446", stroke_width = 4, shiny_id = "line_progress" ) ), column(4, tags$p("Circle Progress:"), progress_circle( value = 0, color = "#112446", shiny_id = "circle_progress" ) ), column(4, tags$p("Semicircle Progress:"), progress_semicircle( value = 0, color = "#112446", shiny_id = "semi_progress" ) ) ), sliderInput("progress", "Update Progress:", 0, 1, 0, step = 0.1) ) server <- function(input, output, session) { observe({ update_progress("line_progress", input$progress) update_progress("circle_progress", input$progress) update_progress("semi_progress", input$progress) }) } shinyApp(ui, server) ``` -------------------------------- ### Automatic Output Blocking with block_output() Source: https://context7.com/dreamrs/shinybusy/llms.txt Automatically apply a loading overlay to an output element whenever it is being recalculated by using block_output(). This simplifies the process of indicating ongoing computations for outputs. ```r library(shiny) library(shinybusy) ui <- fluidPage( sliderInput("n", "Number of points:", 10, 100, 50), # Wrap output with block_output() for automatic blocking block_output( plotOutput("plot"), type = "dots", text = "Updating...", timeout = 300, minHeight = "400px" ) ) server <- function(input, output, session) { output$plot <- renderPlot({ Sys.sleep(1) # Simulate computation time plot(rnorm(input$n)) }) } shinyApp(ui, server) ``` -------------------------------- ### Bundle JavaScript Assets with Packer Source: https://github.com/dreamrs/shinybusy/blob/master/README.md After modifying JavaScript files, run this command to bundle them using the packer package. ```r packer::bundle() ``` -------------------------------- ### SpinKit Spinners Source: https://context7.com/dreamrs/shinybusy/llms.txt Generate various spinners from the SpinKit library using the spin_kit() function. Customize the spinner type and color to match your application's theme. ```r library(shiny) library(shinybusy) # Available SpinKit spinners: # "double-bounce", "circle", "bounce", "folding-cube", # "rotating-plane", "cube-grid", "fading-circle", "dots", "cube" ui <- fluidPage( tags$h2("SpinKit Spinners"), fluidRow( lapply( c("circle", "bounce", "folding-cube", "cube-grid", "fading-circle"), function(spin_name) { column( width = 2, tags$b(spin_name), tags$div( style = "width: 60px; height: 60px; position: relative;", spin_kit(spin = spin_name, color = "#112446") ) ) } ) ) ) server <- function(input, output, session) {} shinyApp(ui, server) ``` -------------------------------- ### Display Modal Spinner Source: https://context7.com/dreamrs/shinybusy/llms.txt Use show_modal_spinner and remove_modal_spinner to indicate background processing in a modal dialog. ```r library(shiny) library(shinybusy) ui <- fluidPage( actionButton("calculate", "Run Calculation"), verbatimTextOutput("result") ) server <- function(input, output, session) { observeEvent(input$calculate, { show_modal_spinner( spin = "cube-grid", color = "firebrick", text = "Processing data, please wait..." ) Sys.sleep(5) # Long calculation remove_modal_spinner() }) output$result <- renderPrint({ input$calculate "Calculation complete!" }) } shinyApp(ui, server) ``` -------------------------------- ### Configure Notifications Source: https://context7.com/dreamrs/shinybusy/llms.txt Customize the appearance and behavior of notifications using config_notify. ```r library(shiny) library(shinybusy) ui <- fluidPage( actionButton("custom", "Custom Notification") ) server <- function(input, output, session) { observeEvent(input$custom, { notify( text = "Custom styled notification!", type = "success", timeout = 5000, position = "center-top", config_notify( background = "#28a745", textColor = "#ffffff", width = "400px", fontSize = "16px", borderRadius = "10px", cssAnimation = TRUE, cssAnimationStyle = "zoom" ) ) }) } shinyApp(ui, server) ``` -------------------------------- ### Display Modal GIF Source: https://context7.com/dreamrs/shinybusy/llms.txt Show a custom GIF image in a modal dialog during processing tasks. ```r library(shiny) library(shinybusy) ui <- fluidPage( actionButton("load", "Load Data") ) server <- function(input, output, session) { observeEvent(input$load, { show_modal_gif( src = "https://jeroen.github.io/images/banana.gif", text = "Loading data...", width = "150px", height = "150px", modal_size = "m" ) Sys.sleep(3) remove_modal_gif() }) } shinyApp(ui, server) ``` -------------------------------- ### Create Epic Spinners in Shiny Source: https://context7.com/dreamrs/shinybusy/llms.txt Displays various animation styles from the Epic Spinners library within a Shiny UI. ```r library(shiny) library(shinybusy) # Available Epic spinners: # "flower", "pixel", "hollow-dots", "intersecting-circles", "orbit", # "radar", "scaling-squares", "half-circle", "trinity-rings", # "fulfilling-square", "circles-to-rhombuses", "semipolar", # "self-building-square", "swapping-squares", "fulfilling-bouncing-circle", # "fingerprint", "spring", "atom", "looping-rhombuses", "breeding-rhombus" ui <- fluidPage( tags$h2("Epic Spinners"), lapply( c("flower", "orbit", "radar", "atom", "fingerprint"), function(spin_name) { tags$div( style = "display: inline-block; width: 150px; height: 100px; margin: 10px;", tags$b(spin_name), spin_epic(spin = spin_name, color = "#08298A") ) } ) ) server <- function(input, output, session) {} shinyApp(ui, server) ``` -------------------------------- ### Add Loading State to Multiple Outputs with CSS Selector Source: https://context7.com/dreamrs/shinybusy/llms.txt Use add_loading_state() to apply loading indicators to multiple outputs that match a given CSS selector. This is efficient for applying consistent loading states across several elements, like multiple plots. ```r library(shiny) library(shinybusy) ui <- fluidPage( # Apply loading state to all plot outputs add_loading_state( ".shiny-plot-output", spinner = "standard", text = "Please wait...", svgColor = "steelblue", backgroundColor = "rgba(255,255,255,0.9)" ), actionButton("refresh", "Refresh All Charts"), fluidRow( column(6, plotOutput("plot1")), column(6, plotOutput("plot2")Ма) ) ) server <- function(input, output, session) { output$plot1 <- renderPlot({ input$refresh if (input$refresh > 0) Sys.sleep(2) barplot(table(floor(runif(100) * 6))) }) output$plot2 <- renderPlot({ input$refresh if (input$refresh > 0) Sys.sleep(2) plot(rnorm(50), rnorm(50)) }) } shinyApp(ui, server) ``` -------------------------------- ### Customize Report Dialogs with config_report() Source: https://context7.com/dreamrs/shinybusy/llms.txt Use config_report() to customize the appearance of report dialogs generated by the report() function. This allows for custom background, text, and button colors, as well as border radius. ```r library(shiny) library(shinybusy) ui <- fluidPage( actionButton("styled", "Styled Report") ) server <- function(input, output, session) { observeEvent(input$styled, { report( title = "Custom Report", text = "This report has custom styling.", type = "info", button = "Got it!", config_report( backgroundColor = "#f8f9fa", titleColor = "#212529", messageColor = "#6c757d", buttonBackground = "#007bff", buttonColor = "#ffffff", borderRadius = "15px" ) ) }) } shinyApp(ui, server) ``` -------------------------------- ### Display Modal Progress Bar Source: https://context7.com/dreamrs/shinybusy/llms.txt Show a linear progress bar in a modal for operations with a known number of steps. ```r library(shiny) library(shinybusy) ui <- fluidPage( actionButton("process", "Process Items") ) server <- function(input, output, session) { observeEvent(input$process, { show_modal_progress_line( value = 0, text = "auto", color = "#112446" ) for (i in 1:10) { update_modal_progress(value = i / 10) Sys.sleep(0.5) } remove_modal_progress() }) } shinyApp(ui, server) ``` -------------------------------- ### Display Modal Progress Circle Source: https://context7.com/dreamrs/shinybusy/llms.txt Use a circular progress indicator within a modal dialog for tracking task completion. ```r library(shiny) library(shinybusy) ui <- fluidPage( actionButton("upload", "Upload Files") ) server <- function(input, output, session) { observeEvent(input$upload, { show_modal_progress_circle( value = 0, color = "#3498db", height = "200px" ) for (i in 1:20) { update_modal_progress(value = i / 20) Sys.sleep(0.2) } remove_modal_progress() }) } shinyApp(ui, server) ``` -------------------------------- ### Add spinner busy indicator Source: https://github.com/dreamrs/shinybusy/blob/master/README.md Incorporate a spinner animation in the top-right corner of the page to indicate server activity. Choose from various spinner types. ```r add_busy_spinner(spin = "fading-circle") ``` -------------------------------- ### Send Notifications Source: https://context7.com/dreamrs/shinybusy/llms.txt Trigger toast-style notifications for success, failure, information, or warnings. ```r library(shiny) library(shinybusy) ui <- fluidPage( actionButton("success", "Success"), actionButton("error", "Error"), actionButton("info", "Info"), actionButton("warn", "Warning") ) server <- function(input, output, session) { observeEvent(input$success, { notify_success("Operation completed successfully!") }) observeEvent(input$error, { notify_failure("An error occurred!") }) observeEvent(input$info, { notify_info("Here is some information.") }) observeEvent(input$warn, { notify_warning("Please check your input!") }) } shinyApp(ui, server) ``` -------------------------------- ### Manual Spinner Control Source: https://context7.com/dreamrs/shinybusy/llms.txt Manually show and hide spinners using `use_busy_spinner()`, `show_spinner()`, and `hide_spinner()`. The spinner can be positioned full-page. ```r library(shiny) library(shinybusy) ui <- fluidPage( use_busy_spinner( spin = "orbit", color = "#112446", position = "full-page" ), actionButton("task", "Run Task") ) server <- function(input, output, session) { observeEvent(input$task, { show_spinner() Sys.sleep(3) hide_spinner() }) } shinyApp(ui, server) ``` -------------------------------- ### Manual Progress Bar Control Source: https://context7.com/dreamrs/shinybusy/llms.txt Provides manual control over a progress bar using `use_busy_bar()` in the UI and `update_busy_bar()` from the server. The bar updates from 0-100 and can be reset. ```r library(shiny) library(shinybusy) ui <- fluidPage( use_busy_bar(color = "#01DF01", height = "15px"), actionButton("start", "Start Processing") ) server <- function(input, output, session) { observeEvent(input$start, { for (i in 1:100) { update_busy_bar(value = i) # Update progress from 0-100 Sys.sleep(0.05) } update_busy_bar(value = NULL) # Reset/hide the bar }) } shinyApp(ui, server) ``` -------------------------------- ### Add Automatic Busy Progress Bar Source: https://context7.com/dreamrs/shinybusy/llms.txt Displays an animated progress bar at the top of the page when the server is busy. Customize color, centering, and height. ```r library(shiny) library(shinybusy) ui <- fluidPage( # Add progress bar - appears automatically when server is busy add_busy_bar( timeout = 1000, color = "#FF0000", centered = FALSE, height = "8px" ), actionButton("process", "Process Data"), tableOutput("data") ) server <- function(input, output, session) { output$data <- renderTable({ input$process Sys.sleep(2) # Progress bar appears during processing head(mtcars) }) } shinyApp(ui, server) ``` -------------------------------- ### Add Automatic Busy Spinner Source: https://context7.com/dreamrs/shinybusy/llms.txt Automatically displays a spinner when the Shiny server is busy. Configure spinner style, color, timeout, and position. ```r library(shiny) library(shinybusy) ui <- fluidPage( # Add spinner to UI - appears automatically when server is busy add_busy_spinner( spin = "fading-circle", color = "#112446", timeout = 100, position = "top-right", margins = c(10, 10), height = "50px", width = "50px" ), actionButton("calculate", "Run Long Calculation"), plotOutput("result") ) server <- function(input, output, session) { observeEvent(input$calculate, { Sys.sleep(3) # Spinner automatically appears during this delay }) output$result <- renderPlot({ input$calculate plot(rnorm(100)) }) } shinyApp(ui, server) ``` -------------------------------- ### Display Reports Source: https://context7.com/dreamrs/shinybusy/llms.txt Show extended notifications with titles and messages using report functions. ```r library(shiny) library(shinybusy) ui <- fluidPage( actionButton("success", "Show Success"), actionButton("error", "Show Error"), actionButton("info", "Show Info"), actionButton("warning", "Show Warning") ) server <- function(input, output, session) { observeEvent(input$success, { report_success( title = "Success!", text = "Your data has been saved successfully." ) }) observeEvent(input$error, { report_failure( title = "Error", text = "Failed to connect to the database." ) }) observeEvent(input$info, { report_info( title = "Information", text = tags$p( style = "font-style: italic;", "This feature requires administrator privileges." ) ) }) observeEvent(input$warning, { report_warning( title = "Warning", text = "Unsaved changes will be lost." ) }) } shinyApp(ui, server) ``` -------------------------------- ### Block and Unblock UI Elements Source: https://context7.com/dreamrs/shinybusy/llms.txt Manually block and unblock specific UI elements using the block() and unblock() functions. This is useful for indicating that a calculation is in progress for a particular element, such as a plot. ```r library(shiny) library(shinybusy) ui <- fluidPage( plotOutput(outputId = "plot"), actionButton("refresh", "Refresh Plot") ) server <- function(input, output, session) { data_r <- reactive({ input$refresh # Block the plot while calculating block( id = "plot", type = "circle", text = "Calculating...", messageColor = "#FFF", svgColor = "#FFF", backgroundColor = "#5ea4d8" ) Sys.sleep(2) data <- data.frame(x = rnorm(50), y = rnorm(50)) # Unblock after calculation unblock(id = "plot", timeout = 300) return(data) }) output$plot <- renderPlot({ plot(data_r()) }) } shinyApp(ui, server) ``` -------------------------------- ### Add progress bar busy indicator Source: https://github.com/dreamrs/shinybusy/blob/master/README.md Add an infinite progress bar to the top of the page that appears when the Shiny server is busy. Customize the bar color. ```r add_busy_bar(color = "#FF0000") ``` -------------------------------- ### Add Automatic Busy GIF Source: https://context7.com/dreamrs/shinybusy/llms.txt Animates a GIF when the server is busy and pauses it when idle. Supports custom GIF images via URL or local files. ```r library(shiny) library(shinybusy) ui <- fluidPage( # Add GIF indicator - animates when server is busy add_busy_gif( src = "https://jeroen.github.io/images/banana.gif", timeout = 100, position = "top-right", height = "70px", width = "70px" ), actionButton("run", "Run Task"), verbatimTextOutput("output") ) server <- function(input, output, session) { output$output <- renderPrint({ input$run Sys.sleep(3) # GIF animates during this delay print("Task completed!") }) } shinyApp(ui, server) ``` -------------------------------- ### Manual GIF Control Source: https://context7.com/dreamrs/shinybusy/llms.txt Control GIF animation manually with `use_busy_gif()`, `play_gif()`, and `stop_gif()`. The GIF can be positioned full-page. ```r library(shiny) library(shinybusy) ui <- fluidPage( use_busy_gif( src = "https://jeroen.github.io/images/banana.gif", position = "full-page", height = "200px", width = "200px" ), actionButton("start", "Start"), actionButton("stop", "Stop") ) server <- function(input, output, session) { observeEvent(input$start, { play_gif() }) observeEvent(input$stop, { stop_gif() }) } shinyApp(ui, server) ``` -------------------------------- ### Add GIF busy indicator Source: https://github.com/dreamrs/shinybusy/blob/master/README.md Use this function in your Shiny UI to display a GIF animation when the server is busy. Specify the GIF source, height, and width. ```r # Somewhere in UI add_busy_gif(src = "https://jeroen.github.io/images/banana.gif", height = 70, width = 70) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.