User interface and style improvements

This commit is contained in:
Elias Projahn 2022-08-18 12:21:00 +02:00
parent 447fdfab4f
commit 6938cb0d84
7 changed files with 62 additions and 44 deletions

View file

@ -4,7 +4,7 @@
#' @noRd #' @noRd
comparison_editor_ui <- function(id, options) { comparison_editor_ui <- function(id, options) {
verticalLayout( verticalLayout(
h3("Comparison"), h5("Comparison"),
selectInput( selectInput(
NS(id, "comparison_genes"), NS(id, "comparison_genes"),
"Comparison genes", "Comparison genes",

View file

@ -8,11 +8,15 @@ details_ui <- function(id) {
splitLayout( splitLayout(
cellWidths = "auto", cellWidths = "auto",
uiOutput(NS(id, "copy")), uiOutput(NS(id, "copy")),
downloadButton(NS(id, "download"), "Download CSV") downloadButton(
NS(id, "download"),
"Download CSV",
class = "btn-outline-primary"
)
) )
), ),
div( div(
style = "margin-top: 16px", style = "margin-top: 16px; margin-bottom: 8px;",
DT::DTOutput(NS(id, "genes")) DT::DTOutput(NS(id, "genes"))
) )
) )
@ -43,13 +47,15 @@ details_server <- function(id, options, results) {
"copy_ids_button", "copy_ids_button",
"Copy gene IDs", "Copy gene IDs",
genes_text, genes_text,
icon = icon("clipboard") icon = icon("clipboard"),
class = "btn-outline-primary"
), ),
rclipboard::rclipButton( rclipboard::rclipButton(
"copy_names_button", "copy_names_button",
"Copy gene names", "Copy gene names",
names_text, names_text,
icon = icon("clipboard") icon = icon("clipboard"),
class = "btn-outline-primary"
) )
) )
}) })

View file

@ -2,18 +2,22 @@
filters_ui <- function(id) { filters_ui <- function(id) {
div( div(
class = "well", class = "well",
style = "margin-top: 24px; margin-bottom: 16px; padding-top: 24px;", style = "margin-top: 24px; margin-bottom: 16px;",
verticalLayout( verticalLayout(
radioButtons( h5("Filter criteria"),
NS(id, "method"), div(
label = NULL, style = "margin-top: 8px;",
choices = list( radioButtons(
"Filter percentiles" = "percentile", NS(id, "method"),
"Filter scores" = "score", label = NULL,
"Filter ranks" = "rank", choices = list(
"No filtering" = "none" "Filter percentiles" = "percentile",
), "Filter scores" = "score",
inline = TRUE "Filter ranks" = "rank",
"No filtering" = "none"
),
inline = TRUE
)
), ),
tabsetPanel( tabsetPanel(
id = NS(id, "sliders"), id = NS(id, "sliders"),

View file

@ -1,7 +1,7 @@
# Construct UI for the methods editor. # Construct UI for the methods editor.
methods_ui <- function(id, options) { methods_ui <- function(id, options) {
verticalLayout( verticalLayout(
h3("Methods"), h5("Methods"),
selectInput( selectInput(
NS(id, "optimization_genes"), NS(id, "optimization_genes"),
"Genes to optimize for", "Genes to optimize for",

View file

@ -16,7 +16,7 @@ preset_editor_ui <- function(id, options) {
} }
verticalLayout( verticalLayout(
h3("Inputs"), h5("Inputs"),
selectInput( selectInput(
NS(id, "species"), NS(id, "species"),
"Species to include", "Species to include",

View file

@ -37,7 +37,22 @@ results_ui <- function(id, options) {
) )
), ),
tabPanel( tabPanel(
title = "Method comparison", title = "Gene sets",
div(
style = "margin-top: 16px",
htmlOutput(NS(id, "comparison_text")),
div(
style = "margin-top: 16px;",
plotly::plotlyOutput(
NS(id, "boxplot"),
width = "100%",
height = "600px"
)
)
)
),
tabPanel(
title = "Methods",
div( div(
style = "margin-top: 16px", style = "margin-top: 16px",
plotly::plotlyOutput( plotly::plotlyOutput(
@ -100,29 +115,6 @@ results_ui <- function(id, options) {
height = "600px" height = "600px"
) )
), ),
tabPanel(
title = "Comparison",
div(
style = "margin-top: 16px",
htmlOutput(NS(id, "comparison_text")),
plotly::plotlyOutput(
NS(id, "boxplot"),
width = "100%",
height = "600px"
)
)
),
tabPanel(
title = "Ortholog locations",
div(
style = "margin-top: 16px",
plotly::plotlyOutput(
NS(id, "gene_locations_plot"),
width = "100%",
height = "1200px"
)
)
),
tabPanel( tabPanel(
title = "Scores by position", title = "Scores by position",
div( div(
@ -143,6 +135,17 @@ results_ui <- function(id, options) {
) )
) )
), ),
tabPanel(
title = "Ortholog locations",
div(
style = "margin-top: 16px",
plotly::plotlyOutput(
NS(id, "gene_locations_plot"),
width = "100%",
height = "1200px"
)
)
),
tabPanel( tabPanel(
title = "Detailed results", title = "Detailed results",
details_ui(NS(id, "results")) details_ui(NS(id, "results"))
@ -330,7 +333,10 @@ results_server <- function(id, options, analysis) {
if (!is.null(comparison)) { if (!is.null(comparison)) {
div( div(
reference_div, reference_div,
div(HTML(comparison_text("comparison genes", comparison))) div(
style = "margin-top: 16px;",
HTML(comparison_text("comparison genes", comparison))
)
) )
} else { } else {
reference_div reference_div

View file

@ -9,7 +9,9 @@ custom_css <- function() {
"vertical-align: top;", "vertical-align: top;",
"margin-right: 12px;", "margin-right: 12px;",
"}", "}",
".shiny-input-container { width: auto !important; min-width: 200px; }" ".shiny-input-container { width: auto !important; min-width: 200px; }",
"h5 { margin-top: 0.5rem; margin-bottom: 1rem; font-weight: bold; }",
".navbar-brand { font-weight: bold; }"
)) ))
) )
} }