From 3c4456cc5f7ec2411c14329c4cd0f4a4461cfd99 Mon Sep 17 00:00:00 2001
From: oumaima Mtaallah <oumaima.mtallah@gmail.com>
Date: Mon, 18 Mar 2024 13:04:47 +0100
Subject: [PATCH] Add spinners to the Epidemiological_Unit and Risk Factors
 (original scale and risk scale).

---
 DESCRIPTION             | 2 +-
 NAMESPACE               | 1 +
 R/mapMCDA_app.R         | 2 +-
 inst/interface/global.R | 1 +
 inst/interface/ui.R     | 6 +++---
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index ddda406..9a083d5 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -25,7 +25,7 @@ License: GPL-3 + file LICENSE
 Encoding: UTF-8
 LazyData: true
 Imports: deldir, geodata, geonetwork, igraph, methods, rhandsontable,
-        shiny, shinydashboard, shinyFiles, sf, terra (>= 1.7.23), utils
+        shiny, shinycssloaders, shinydashboard, shinyFiles, sf, terra (>= 1.7.23), utils
 Suggests: covr, devtools, knitr, lintr, lwgeom, mapview, rmarkdown,
         roxygen2, testthat
 RoxygenNote: 7.3.1
diff --git a/NAMESPACE b/NAMESPACE
index 4ad1ef7..bf9843b 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -34,6 +34,7 @@ import(rhandsontable)
 import(sf)
 import(shiny)
 import(shinyFiles)
+import(shinycssloaders)
 import(shinydashboard)
 import(terra)
 importFrom(geodata,gadm)
diff --git a/R/mapMCDA_app.R b/R/mapMCDA_app.R
index 4b72fa1..856dd28 100644
--- a/R/mapMCDA_app.R
+++ b/R/mapMCDA_app.R
@@ -4,7 +4,7 @@
 #' 
 #' @param bg Logical. If TRUE, the GUI is launched in the background, leaving
 #'   available the current session.
-#' @import shiny rhandsontable shinyFiles shinydashboard
+#' @import shiny rhandsontable shinyFiles shinycssloaders shinydashboard 
 #' @export
 mapMCDA_app <- function (bg = FALSE) {
   
diff --git a/inst/interface/global.R b/inst/interface/global.R
index 9713622..e1701cd 100644
--- a/inst/interface/global.R
+++ b/inst/interface/global.R
@@ -8,6 +8,7 @@ library(shiny)
 library(shinydashboard)
 library(rhandsontable)
 library(shinyFiles)
+library(shinycssloaders)
 
 #### MAIN VARIABLES ####
 
diff --git a/inst/interface/ui.R b/inst/interface/ui.R
index fa39ffd..5cc47dd 100644
--- a/inst/interface/ui.R
+++ b/inst/interface/ui.R
@@ -94,7 +94,7 @@ body <- dashboardBody(
             box(title = uiOutput("unitMapTextUI"), status = "primary", width = 6, solidHeader = TRUE,
                 
                 # Display map
-                plotOutput("unitMapDisplay")
+                shinycssloaders::withSpinner(plotOutput("unitMapDisplay"))
                 
             ),
             
@@ -118,7 +118,7 @@ body <- dashboardBody(
             box(title = uiOutput("riskRawMapTextUI"), status = "primary", width = 6, solidHeader = TRUE,
                 
                 # Original raw layer
-                plotOutput("rawLayerDisplay")
+                shinycssloaders::withSpinner(plotOutput("rawLayerDisplay"))
                 
             ),
             
@@ -126,7 +126,7 @@ body <- dashboardBody(
             box(title = uiOutput("riskStandRasterTextUI"), status = "success", width = 6, solidHeader = TRUE,
                 
                 # Standardized raster
-                plotOutput("standRasterDisplay")
+                shinycssloaders::withSpinner(plotOutput("standRasterDisplay"))
                 
             ),
             
-- 
GitLab