Skip to content

Development hints

baj12 edited this page Nov 6, 2019 · 8 revisions

Development instructions

buttons that change color

ui.R

Define the button in ui.R

fluidRow(
        column(width = 12, offset = 1,
               uiOutput("**updatetsneParametersButton**")
        )
      )

reactives.R

in reactives.R, i.e. the reactive store the parameters used in the .schnappsEnv it has to be placed after checking that the results are good. the already used parameters are stored in the .schnappsEnv in a variable that starts with "calculated_" and ends with the variable name as used in input. Those variables are loaded using "isolate" in start of the reactive.

  .schnappsEnv$calculated_**gQC_tsneDim** = **gQC_tsneDim**
  .schnappsEnv$calculated_**gQC_tsneSeed** <- **gQC_tsneSeed**

outputs.R

in outputs.R create an observer that reacts to the input button and parameters and stores the current values Things to change: gQC_tsneSeed, ...

observe({
  if (DEBUG) cat(file = stderr(), "observe **tsneVars**\n")
  out <- **tsne**()
  if (is.null(out)) {
    # set one parameter to something not possible to deactivate button/or choose different
    .schnappsEnv$calculated_**gQC_tsneDim** = "NA"
  }

  assign("**gQC_tsneDim**", input$**gQC_tsneDim**, envir = .schnappsEnv)
   assign("**gQC_tsneSeed**", input$**gQC_tsneSeed**, envir = .schnappsEnv)
  # Here, we create the actual button
  output$**updatetsneParametersButton** <- updateButtonUI(name = "**updatetsneParameters**",
                                                      variables = c("**gQC_tsneDim**", "**gQC_tsneSeed**"  ) )
})

Special: adding to normalization functions

The normalization is update based on the radio button, but if additional parameters are available for a given normalization this has to be handled in the different contributions.

parameters.R

This file contains as well the GUI elements so we need to work here instead of the ui.R file. There is no button to change. In the reactive the inputs have to be isolated.

outputs.R

observers go into output.R