Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kunst, Jonathan
Polyploid datavisualisation
Commits
374ac009
Commit
374ac009
authored
Dec 31, 2021
by
Kunst, Jonathan
Browse files
Create UI for editing plot layout (models to include and chromosome choice)
parent
7cbe3b06
Changes
1
Hide whitespace changes
Inline
Side-by-side
polyqtlvis/R/mod_qtl_plotly_panel.R
View file @
374ac009
...
...
@@ -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_model
s
'
,
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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment