Commit 374ac009 authored by Kunst, Jonathan's avatar Kunst, Jonathan
Browse files

Create UI for editing plot layout (models to include and chromosome choice)

parent 7cbe3b06
......@@ -16,17 +16,49 @@ mod_qtl_plotly_panel_ui <- function(id){
ns <- NS(id)
tagList(
fluidRow(
# models to include
selectizeInput(inputId = ns('choice_models'),
label = 'Models to include',
choices = 'Create a model first',
multiple = TRUE),
# models to include
column(2,
# plot all models or a selection?
checkboxInput(inputId = ns('check_model'),
label = 'All models',
value = TRUE),
# selector for models appears when checkbox is unchecked
conditionalPanel(condition = 'input.check_model == 0',
ns = ns,
selectizeInput(inputId = ns('choice_model'),
label = 'Models',
choices = 'Create a model first',
multiple = TRUE)
)
),
# linkage groups to include
actionButton(inputId = ns('update_plot'),
label = 'Update plot')
# linkage groups to include
column(2,
# plot all chromosomes or a selection?
checkboxInput(inputId = ns('check_chrom'),
label = 'All chromosomes',
value = TRUE),
# selector for chromosome appears when checkbox is unchecked
conditionalPanel(condition = 'input.check_chrom == 0',
ns = ns,
selectizeInput(inputId = ns('choice_chrom'),
label = 'Chromosomes',
choices = 'Create a model first',
multiple = TRUE)
)
),
# Rescale or not
column(1, checkboxInput(inputId = ns('check_rescale'),
label = 'Rescale',
value = TRUE)),
# update plot action button
column(1, actionButton(inputId = ns('update_plot'),
label = 'Update plot')
),
),
withSpinner(plotlyOutput(outputId = ns('plotly'))),
......@@ -41,12 +73,20 @@ mod_qtl_plotly_panel_ui <- function(id){
mod_qtl_plotly_panel_server <- function(id, rv){
moduleServer( id, function(input, output, session){
ns <- session$ns
# model selection for plotly object
observeEvent(rv$polyqtl_scan, {
updateSelectInput(session, 'choice_models',
updateSelectInput(session, 'choice_model',
choices = names(rv$model_list))
})
# linkage groups selection for plotly object
observeEvent(rv$polyqtl_scan, {
updateSelectInput(session, 'choice_chrom',
choices = unique(bind_rows(rv$model_list, .id = 'model')$chromosome))
})
# generate plotly object ----
observeEvent(input$update_plot, {
req(rv$polyqtl_scan)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment