R/mod_categories_ui.R

Defines functions mod_categories_server mod_categories_ui

# WARNING - Generated by {fusen} from /dev/dev_golem_module.Rmd: do not edit by hand

#' categories UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd 
#'
#' @importFrom shiny NS tagList 
#' @importFrom shinydashboard box 
#' @keywords internal
mod_categories_ui <- function(id){
  ns <- NS(id)
  tagList( 
   tabsetPanel(type = "tabs",
         tabPanel(title= "Population Type Over Year",
                  mod_plotviz_ui(ns("categories1"),
                  thisPlot = "plot_ctr_population_type_per_year" ) ),
         
         tabPanel(title= "Tree Map",
                  mod_plotviz_ui(ns("categories2"),
                  thisPlot = "plot_ctr_treemap" ) ),
         
         tabPanel(title= "Key Figures",
                  mod_plotviz_ui(ns("categories3"),
                  thisPlot = "plot_ctr_keyfig" ) ) 
      ) ## End Tabset 
    )
}
    
#' categories Server Functions
#'
#' @param reactiveParameters  Main app filters defined through mod_input
#' @noRd 
#' @importFrom styler style_text
#' @import ggplot2
#' @import shiny
#' @importFrom stringr str_wrap
#' @keywords internal
mod_categories_server <- function(id, reactiveParameters){
  moduleServer( id, function(input, output, session){
    ns <- session$ns
    mod_plotviz_server("categories1", 
                       thisPlot = "plot_ctr_population_type_per_year", 
                       reactiveParameters )
    mod_plotviz_server("categories2", 
                       thisPlot = "plot_ctr_treemap", 
                       reactiveParameters )
    mod_plotviz_server("categories3", 
                       thisPlot = "plot_ctr_keyfig", 
                       reactiveParameters )
  })
}
    
## To be copied in the UI
# mod_categories_ui("categories_1")
    
## To be copied in the server
# mod_categories_server("categories_1")
Edouard-Legoupil/unhcrdatapackage documentation built on Nov. 6, 2023, 6:10 p.m.