R/mod_select_ch.R

Defines functions mod_select_ch_server mod_select_ch_ui

Documented in mod_select_ch_server mod_select_ch_ui

# Module UI
  
#' @title   mod_select_ch_ui and mod_select_ch_server
#' @description  A shiny Module.
#'
#' @param id shiny id
#' @param input internal
#' @param output internal
#' @param session internal
#'
#' @rdname mod_select_ch
#'
#' @keywords internal
#' @export 
#' @importFrom shiny NS tagList 
mod_select_ch_ui <- function(id){
  ns <- NS(id)
  tagList(
    selectInput(ns("DAPI"), "Nuclei:",  c("ch1", "ch2", "ch3", "ch4")), 
    selectInput(ns("GFP"), "Phenotype:", c("ch1", "ch2", "ch3", "ch4"))
  )
}
    
# Module Server
    
#' @rdname mod_select_ch
#' @export
#' @keywords internal
    
mod_select_ch_server <- function(input, output, session, r){
  ns <- session$ns
  r$mod3 <- reactiveValues()
  observe({
    r$mod3$DAPI <- input$DAPI
    r$mod3$GFP <- input$GFP})
}
    
## To be copied in the UI
# mod_select_ch_ui("select_ch_ui_1")
    
## To be copied in the server
# callModule(mod_select_ch_server, "select_ch_ui_1")
 
hbaldwin07/GK_shiny_app documentation built on Oct. 12, 2020, 5:58 p.m.