R/mod_settings.R

Defines functions mod_settings_server mod_settings_ui

#' settings UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd 
#'
#' @importFrom shiny NS tagList 
mod_settings_ui <- function(id){
  ns <- NS(id)
  tagList(
    fluidPage(
      fluidRow(
        column(
          width = 6,
          offset = 3,
          
          numericInput(
            inputId = "x_axis",
            label = "X-Axis (px):",
            value = 512,
            min = 1,
            max = 3000,
            width = "100%"
          ),
          numericInput(
            inputId = "y_axis",
            label = "Y-Axis (px):",
            value = 288,
            min = 1,
            max = 3000,
            width = "100%"
          ),
          numericInput(
            inputId = "res",
            label = "Resolution of plot, in pixels per inch:",
            value = 70,
            min = 1,
            max = 3000,
            width = "100%"
          ),
          textOutput(ns("test")),
          actionButton(
            inputId = ns("renderPlots"),
            label = "Render Plots!",
            class = "btn btn-success btn-lg btn-block"
          )
        )
      )
    )
  )
}
    
#' settings Server Functions
#'
#' @noRd 
mod_settings_server <- function(id){
  moduleServer( id, function(input, output, session){
    ns <- session$ns
    
    observeEvent("renderPlots",{
      print(features_names_ids())
    })
  })
}
    
## To be copied in the UI
# mod_settings_ui("settings_ui_1")
    
## To be copied in the server
# mod_settings_server("settings_ui_1")
mariusrueve/scrnaseqExploreR documentation built on Dec. 21, 2021, 2:46 p.m.