From 81c4f964e1bd259ff1d6f444928a5a4278f76379 Mon Sep 17 00:00:00 2001 From: jwildfire Date: Thu, 17 Jun 2021 09:24:14 -0400 Subject: [PATCH 1/2] add basic loading indicator via shinybusy. fix #575 --- NAMESPACE | 1 + R/mod_safetyGraphicsUI.R | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NAMESPACE b/NAMESPACE index 2fcfe295..a5b2badf 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -71,6 +71,7 @@ importFrom(shiny,dataTableOutput) importFrom(shiny,renderDataTable) importFrom(shinyWidgets,progressBar) importFrom(shinyWidgets,updateProgressBar) +importFrom(shinybusy,add_busy_spinner) importFrom(shinyjs,delay) importFrom(shinyjs,disable) importFrom(shinyjs,disabled) diff --git a/R/mod_safetyGraphicsUI.R b/R/mod_safetyGraphicsUI.R index edf281af..adee9f22 100644 --- a/R/mod_safetyGraphicsUI.R +++ b/R/mod_safetyGraphicsUI.R @@ -7,7 +7,8 @@ #' @param standards a list of information regarding data standards. Each list item should use the format returned by safetyGraphics::detectStandard. #' #' @importFrom shinyjs useShinyjs -#' +#' @importFrom shinybusy add_busy_spinner +#' #' @export safetyGraphicsUI <- function(id, meta, domainData, mapping, standards){ @@ -32,6 +33,7 @@ safetyGraphicsUI <- function(id, meta, domainData, mapping, standards){ #app UI using calls to modules ui<-tagList( shinyjs::useShinyjs(), + add_busy_spinner(spin = "atom", position="bottom-right"), tags$head( tags$style(app_css), tags$link( From e31a22741a56a571e9f5f46b72d03f465b29c404 Mon Sep 17 00:00:00 2001 From: jwildfire Date: Thu, 17 Jun 2021 09:34:46 -0400 Subject: [PATCH 2/2] add modal for chart export. fix #519 --- NAMESPACE | 2 ++ R/mod_reportsTab.R | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NAMESPACE b/NAMESPACE index a5b2badf..ce290746 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -72,6 +72,8 @@ importFrom(shiny,renderDataTable) importFrom(shinyWidgets,progressBar) importFrom(shinyWidgets,updateProgressBar) importFrom(shinybusy,add_busy_spinner) +importFrom(shinybusy,remove_modal_spinner) +importFrom(shinybusy,show_modal_spinner) importFrom(shinyjs,delay) importFrom(shinyjs,disable) importFrom(shinyjs,disabled) diff --git a/R/mod_reportsTab.R b/R/mod_reportsTab.R index 93cc1ae1..6518cd0b 100644 --- a/R/mod_reportsTab.R +++ b/R/mod_reportsTab.R @@ -37,6 +37,7 @@ reportsTabUI <- function(id){ #' @param mapping tibble capturing the current data mappings [reactive]. #' #' @importFrom magrittr extract +#' @importFrom shinybusy show_modal_spinner remove_modal_spinner #' #' @export @@ -84,12 +85,13 @@ reportsTab <- function(input, output, session, charts, data, mapping){ mapping = mapping(), charts=charts_keep() ) - + show_modal_spinner(text="Creating html report. This might take a while for multiple charts/large data sets.") # show the modal window rmarkdown::render(tempReport, output_file = file, params = params, ## pass in params envir = new.env(parent = globalenv()) ## eval in child of global env ) + remove_modal_spinner() # remove it when done } ) } \ No newline at end of file