diff --git a/R/geneView.R b/R/geneView.R index 55f64c0..6061fdc 100644 --- a/R/geneView.R +++ b/R/geneView.R @@ -306,7 +306,7 @@ geneView <- function(input, output, session, data, metadata, level = NULL, plot. #enable plot button only if plot possible shiny::observe({ - if(is.null(input$genes) | length(selector$selectedColumns()) < 1){ + if(is.null(input$genes) || !shiny::isTruthy(selector$selectedColumns())){ shinyjs::disable("plot") }else if(input$plotType == "violin"){ factor1.levels <- metadata.r()[level == selector$type() & key %in% selector$selectedColumns() & factor1 != ""][, .N, keyby = factor1][["N"]] diff --git a/R/pca.R b/R/pca.R index 249af4f..8d4d166 100644 --- a/R/pca.R +++ b/R/pca.R @@ -111,7 +111,7 @@ pca <- function(input, output, session, data, types, levels = NULL, entryLabel = }) levels.r <- shiny::reactive({ if(is.null(levels)){ - metadata.r()[["level"]] + types.r()[["level"]] }else{ if(shiny::is.reactive(levels)){ levels() @@ -162,11 +162,11 @@ pca <- function(input, output, session, data, types, levels = NULL, entryLabel = shinyjs::reset("dimB") shinyjs::reset("pointsize") shinyjs::reset("labelsize") - columnSelect <<- shiny::callModule(columnSelector, "select", type.columns = shiny::reactive(types.r()[level %in% levels.r(), c("key", "level"), with = FALSE]), columnTypeLabel = "Column types to choose from") + columnSelect <<- shiny::callModule(columnSelector, "select", type.columns = shiny::reactive(types.r()[level %in% levels.r()]), columnTypeLabel = "Column types to choose from") clearPlot(TRUE) }) - columnSelect <- shiny::callModule(columnSelector, "select", type.columns = shiny::reactive(types.r()[level %in% levels.r(), c("key", "level"), with = FALSE]), columnTypeLabel = "Column types to choose from") + columnSelect <- shiny::callModule(columnSelector, "select", type.columns = shiny::reactive(types.r()[level %in% levels.r()]), columnTypeLabel = "Column types to choose from") output$datalevel <- shiny::renderUI({ shiny::selectInput(session$ns("select"), label = "select data level", choices = unique(levels.r()))