From bf06662a788cff5d738a51a63fdeaac0d050112e Mon Sep 17 00:00:00 2001 From: Schultheis Date: Fri, 9 Mar 2018 09:25:42 +0100 Subject: [PATCH] pca: disable plot button on start --- R/pca.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/pca.R b/R/pca.R index e3cd1da..249af4f 100644 --- a/R/pca.R +++ b/R/pca.R @@ -120,6 +120,7 @@ pca <- function(input, output, session, data, types, levels = NULL, entryLabel = } } }) + # handle reactive sizes size <- shiny::reactive({ width <- ifelse(shiny::is.reactive(width), width(), width) @@ -171,9 +172,12 @@ pca <- function(input, output, session, data, types, levels = NULL, entryLabel = shiny::selectInput(session$ns("select"), label = "select data level", choices = unique(levels.r())) }) - #update dimension inputs + # disable plot button on init + shinyjs::disable("plot") + # update dimension inputs shiny::observe({ col.num <- length(shiny::req(columnSelect$selectedColumns())) + if(col.num < 3 || nrow(shiny::isolate(data.r())) < 3 || is.na(input$dimA) || is.na(input$dimB)){ shinyjs::disable("plot")