diff --git a/R/mod_click_tables.R b/R/mod_click_tables.R index 1eee7b6..164fe40 100644 --- a/R/mod_click_tables.R +++ b/R/mod_click_tables.R @@ -10,7 +10,8 @@ mod_click_tables_ui <- function(id) { ns <- NS(id) tagList( - uiOutput(ns("dynamic_click_tableUI")) + uiOutput(ns("dynamic_click_tableUI")) |> + shinycssloaders::withSpinner() ) } @@ -39,7 +40,8 @@ mod_click_tables_server <- function(id, filter_data, data_exists, comment_type = shinycssloaders::withSpinner(), hr(), h5("Please select a Sub-category from the table above in other to drill down the table below"), - uiOutput(ns("comment_table")) + uiOutput(ns("comment_table")) |> + shinycssloaders::withSpinner() ) }) diff --git a/R/mod_demographics.R b/R/mod_demographics.R index 7127ea9..01bd5b0 100644 --- a/R/mod_demographics.R +++ b/R/mod_demographics.R @@ -10,7 +10,8 @@ mod_demographics_ui <- function(id) { ns <- NS(id) - uiOutput(ns("dynamic_demo_UI")) + uiOutput(ns("dynamic_demo_UI")) |> + shinycssloaders::withSpinner() } #' demographics Server Functions @@ -48,28 +49,53 @@ mod_demographics_server <- function(id, filter_data, data_exists) { br(), fluidRow( if (has_demography_1) { - column(width, plotly::plotlyOutput(ns("demography_1_graph"))) + column( + width, + plotly::plotlyOutput(ns("demography_1_graph")) |> + shinycssloaders::withSpinner() + ) }, if (has_demography_2) { - column(width, plotly::plotlyOutput(ns("demography_2_graph"))) + column( + width, + plotly::plotlyOutput(ns("demography_2_graph")) |> + shinycssloaders::withSpinner() + ) }, if (has_demography_3) { - column(width, plotly::plotlyOutput(ns("demography_3_graph"))) + column( + width, + plotly::plotlyOutput(ns("demography_3_graph")) |> + shinycssloaders::withSpinner() + ) } ), hr(), pre("The below chart shows the average percentage of FFT score for each group in the demographic feature.", - "Note: Categories with fewer than 10 individuals are excluded", - style = "background-color:#005EB8; color:#fff"), + "Note: Categories with fewer than 10 individuals are excluded", + style = "background-color:#005EB8; color:#fff" + ), fluidRow( if (has_demography_1) { - column(width, plotly::plotlyOutput(ns("compare_demography_1"))) + column( + width, + plotly::plotlyOutput(ns("compare_demography_1")) |> + shinycssloaders::withSpinner() + ) }, if (has_demography_2) { - column(width, plotly::plotlyOutput(ns("compare_demography_2"))) + column( + width, + plotly::plotlyOutput(ns("compare_demography_2")) |> + shinycssloaders::withSpinner() + ) }, if (has_demography_3) { - column(width, plotly::plotlyOutput(ns("compare_demography_3"))) + column( + width, + plotly::plotlyOutput(ns("compare_demography_3")) |> + shinycssloaders::withSpinner() + ) } ) ) @@ -78,23 +104,23 @@ mod_demographics_server <- function(id, filter_data, data_exists) { # distribution---- output$demography_1_graph <- plotly::renderPlotly({ - demo_data <- filter_data()$unique_data %>% + demo_data <- filter_data()$unique_data |> dplyr::arrange(get_golem_config("demography_1")) - demo_data[, get_golem_config("demography_1")] <- demo_data[, get_golem_config("demography_1")] %>% - unlist(use.names = F) %>% + demo_data[, get_golem_config("demography_1")] <- demo_data[, get_golem_config("demography_1")] |> + unlist(use.names = F) |> factor() - - demo_data %>% + + demo_data |> demographic_distribution(variable = get_golem_config("demography_1")) }) output$demography_2_graph <- plotly::renderPlotly({ - filter_data()$unique_data %>% + filter_data()$unique_data |> demographic_distribution(variable = get_golem_config("demography_2")) }) output$demography_3_graph <- plotly::renderPlotly({ - filter_data()$unique_data %>% + filter_data()$unique_data |> demographic_distribution(variable = get_golem_config("demography_3")) }) diff --git a/R/mod_trend.R b/R/mod_trend.R index 80ce1d1..c8a3c12 100644 --- a/R/mod_trend.R +++ b/R/mod_trend.R @@ -12,7 +12,8 @@ mod_trend_ui <- function(id) { tagList( br(), - uiOutput(ns("dynamic_trendUI")) + uiOutput(ns("dynamic_trendUI")) |> + shinycssloaders::withSpinner() ) } @@ -55,9 +56,6 @@ mod_trend_server <- function(id, filter_data, data_exists) { plotly::plotlyOutput(ns("super_category_trend_plot")) %>% shinycssloaders::withSpinner(), hr(), - # downloadButton(ns("super_category_download_data"), "Download data", - # icon = icon("download") - # ), uiOutput(ns("dynamic_super_category_table")) ), @@ -70,16 +68,11 @@ mod_trend_server <- function(id, filter_data, data_exists) { plotly::plotlyOutput(ns("sub_category_trend_plot")) %>% shinycssloaders::withSpinner(), hr(), - # downloadButton(ns("sub_category_download_data"), "Download data", - # icon = icon("download") - # ), uiOutput(ns("dynamic_sub_category_table")) ) ) ) ) - # hr(), - # DT::DTOutput(ns("dynamic_super_category_table")) ) })