R/mod_module_structure.R

Defines functions mod_module_structure_server mod_module_structure_ui

#' module_structure UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd 
#'
#' @importFrom shiny NS tagList

 
mod_module_structure_ui <- function(id){
  ns <- NS(id)
  tagList(
    shinydashboard::dashboardPage(
      skin = 'purple',
      shinydashboard::dashboardHeader(
        title = 'Microsoft AI',
        titleWidth = 300,
        dropdownMenu(type = 'messages',
                     icon = icon('github'),
                     messageItem(
                       from = 'Github',
                       message = '',
                       icon = icon('github'),
                       href = 'https://github.com/Viinky-Kevs/microsoftAI'
                     ))
      ),
      shinydashboard::dashboardSidebar(
        width = 300,
        sidebarMenu(
          id = 'sidebar',
          style = "position: relative; overflow: visible;",
          shinydashboard::menuItem("Home", 
                                   tabName = 'home', 
                                   icon = icon('home')),
          shinydashboard::menuItem('Module 1', 
                                   tabName = 'module1', 
                                   icon = icon('bezier-curve'),
                                   menuSubItem('Upload files', 
                                               tabName = 'upload',
                                               icon = icon('upload')),
                                   menuItem('Genotypic module',
                                            tabName = 'genotipic',
                                            icon = icon('dna'),
                                            menuSubItem('Traditional methods',
                                                        tabName = 'genotipic'),
                                            menuSubItem('Distance matrix',
                                                        tabName = 'genotypic1'),
                                            menuSubItem('PCA',
                                                        tabName = 'genotypic2'),
                                            menuSubItem('DPCA',
                                                        tabName = 'genotypic3'),
                                            menuSubItem('Statistics',
                                                        tabName = 'genotypic4'),
                                            menuSubItem('Statistics per cluster',
                                                        tabName = 'genotypic5'),
                                            menuSubItem('Genetic divergence',
                                                        tabName = 'genotypic6')
                                            ),
                                   menuSubItem('Phenotypic data', 
                                               tabName = 'phenotipic',
                                               icon = icon('leaf')),
                                   menuSubItem('Descriptor optimization', 
                                               tabName = 'optimization',
                                               icon = icon('chart-bar'))
          ),
          shinydashboard::menuItem('Module 2', 
                                   tabName = 'module2', 
                                   icon = icon('bezier-curve'),
                                   badgeLabel = 'Soon', 
                                   badgeColor = "green"),
          shinydashboard::menuItem('Module 3', 
                                   tabName = 'module3', 
                                   icon = icon('bezier-curve'),
                                   badgeLabel = 'Soon', 
                                   badgeColor = "green"),
          shinydashboard::menuItem('Team', tabName = 'team', icon = icon('users')),
          HTML(paste0(
            "<br><br><br><br><br><br><br><br><br>",
            "<br><br><br><br><br><br><br><br><br>",
            "<br><br><br><br><br><br><br><br><br>",
            "<script>",
            "var today = new Date();",
            "var yyyy = today.getFullYear();",
            "</script>",
            "<p style = 'text-align: center;'><small>&copy; - <a href='#' target='_blank'>microsoft AI </a> - <script>document.write(yyyy);</script></small></p>")
          )
        )
        
      ),
      shinydashboard::dashboardBody(
        shinydashboard::tabItems(
          shinydashboard::tabItem(
            tabName = 'home',
            fluidPage(
              mod_home_page_ui("home_page_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'upload',
            fluidPage(
              mod_import_data_ui("import_data_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'genotipic',
            fluidPage(
              mod_genotipic_ui("genotipic_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'genotypic1',
            fluidPage(
              mod_genotypic1_ui("genotypic1_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'genotypic2',
            fluidPage(
              mod_genotypic2_ui("genotypic2_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'genotypic3',
            fluidPage(
              mod_genotypic3_ui("genotypic3_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'genotypic4',
            fluidPage(
              mod_genotypic4_ui("genotypic4_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'genotypic5',
            fluidPage(
              mod_genotypic5_ui("genotypic5_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'genotypic6',
            fluidPage(
              mod_genotypic6_ui("genotypic6_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'phenotipic',
            fluidPage(
              mod_phenotypic_ui("phenotypic_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'optimization',
            fluidPage(
              mod_descriptor_ui("descriptor_ui_1")
            )
          ),
          shinydashboard::tabItem(
            tabName = 'team',
            fluidPage(
              mod_team_ui("team_ui_1")
            )
          )
        )
        
      )
    )
  )
}
    
#' module_structure Server Functions
#'
#' @noRd 

mod_module_structure_server <- function(id){
  moduleServer( id, function(input, output, session){
    ns <- session$ns
  })
}
    
## To be copied in the UI
# mod_module_structure_ui("module_structure_ui_1")
    
## To be copied in the server
# mod_module_structure_server("module_structure_ui_1")
Viinky-Kevs/microsoftAI documentation built on April 10, 2022, 12:01 p.m.