Commit cfc6be30 authored by dmattek's avatar dmattek
Browse files

Defined global variables for font sizes in plots

parent eebd8a44
...@@ -12,6 +12,18 @@ require(gplots) # for heatmap.2 ...@@ -12,6 +12,18 @@ require(gplots) # for heatmap.2
require(grid) # for modifying grob require(grid) # for modifying grob
require(Hmisc) # for CI calculation require(Hmisc) # for CI calculation
# Global parameters ----
# font sizes in pts for plots
PLOTFONTBASE = 12
PLOTFONTAXISTEXT = 12
PLOTFONTAXISTITLE = 12
PLOTFONTFACETSTRIP = 14
PLOTFONTLEGEND = 12
# default number of facets in plots
PLOTNFACETDEFAULT = 3
# Colour definitions ---- # Colour definitions ----
rhg_cols <- c( rhg_cols <- c(
"#771C19", "#771C19",
...@@ -513,7 +525,11 @@ LOCplotTraj = function(dt.arg, # input data table ...@@ -513,7 +525,11 @@ LOCplotTraj = function(dt.arg, # input data table
xlab(paste0(xlab.arg, "\n")) + xlab(paste0(xlab.arg, "\n")) +
ylab(paste0("\n", ylab.arg)) + ylab(paste0("\n", ylab.arg)) +
ggtitle(plotlab.arg) + ggtitle(plotlab.arg) +
LOCggplotTheme() + LOCggplotTheme(in.font.base = PLOTFONTBASE,
in.font.axis.text = PLOTFONTAXISTEXT,
in.font.axis.title = PLOTFONTAXISTITLE,
in.font.strip = PLOTFONTFACETSTRIP,
in.font.legend = PLOTFONTLEGEND) +
theme(legend.position = "top") theme(legend.position = "top")
return(p.tmp) return(p.tmp)
...@@ -655,7 +671,11 @@ LOCggplotScat = function(dt.arg, ...@@ -655,7 +671,11 @@ LOCggplotScat = function(dt.arg,
p.tmp = p.tmp + p.tmp = p.tmp +
LOCggplotTheme() + LOCggplotTheme(in.font.base = PLOTFONTBASE,
in.font.axis.text = PLOTFONTAXISTEXT,
in.font.axis.title = PLOTFONTAXISTITLE,
in.font.strip = PLOTFONTFACETSTRIP,
in.font.legend = PLOTFONTLEGEND) +
theme(legend.position = "none") theme(legend.position = "none")
# Marginal distributions don;t work with plotly... # Marginal distributions don;t work with plotly...
......
...@@ -239,7 +239,11 @@ modBoxPlot = function(input, output, session, ...@@ -239,7 +239,11 @@ modBoxPlot = function(input, output, session,
scale_fill_discrete(name = '') + scale_fill_discrete(name = '') +
xlab('') + xlab('') +
ylab('') + ylab('') +
LOCggplotTheme() + LOCggplotTheme(in.font.base = PLOTFONTBASE,
in.font.axis.text = PLOTFONTAXISTEXT,
in.font.axis.title = PLOTFONTAXISTITLE,
in.font.strip = PLOTFONTFACETSTRIP,
in.font.legend = PLOTFONTLEGEND) +
theme(legend.position = input$selPlotBoxLegendPos, theme(legend.position = input$selPlotBoxLegendPos,
axis.text.x = LOCrotatedAxisElementText(as.numeric(input$rBAxisLabelsRotate))) axis.text.x = LOCrotatedAxisElementText(as.numeric(input$rBAxisLabelsRotate)))
......
...@@ -57,7 +57,11 @@ modClDistPlot = function(input, output, session, in.data, in.cols = NULL, in.fna ...@@ -57,7 +57,11 @@ modClDistPlot = function(input, output, session, in.data, in.cols = NULL, in.fna
scale_y_continuous(labels = percent) + scale_y_continuous(labels = percent) +
ylab("percentage of cells\n") + ylab("percentage of cells\n") +
xlab("") + xlab("") +
LOCggplotTheme() + LOCggplotTheme(in.font.base = PLOTFONTBASE,
in.font.axis.text = PLOTFONTAXISTEXT,
in.font.axis.title = PLOTFONTAXISTITLE,
in.font.strip = PLOTFONTFACETSTRIP,
in.font.legend = PLOTFONTLEGEND) +
theme( theme(
axis.text.x = LOCrotatedAxisElementText(as.numeric(input$rBAxisLabelsRotate)) axis.text.x = LOCrotatedAxisElementText(as.numeric(input$rBAxisLabelsRotate))
) )
......
...@@ -48,7 +48,7 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") { ...@@ -48,7 +48,7 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") {
numericInput( numericInput(
ns('inPlotNcolFacet'), ns('inPlotNcolFacet'),
'#columns', '#columns',
value = 2, value = PLOTNFACETDEFAULT,
min = 1, min = 1,
step = 1 step = 1
) )
......
...@@ -20,7 +20,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") { ...@@ -20,7 +20,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") {
numericInput( numericInput(
ns('inPlotTrajFacetNcol'), ns('inPlotTrajFacetNcol'),
'#Columns:', '#Columns:',
value = 4, value = PLOTNFACETDEFAULT,
min = 1, min = 1,
width = '100px', width = '100px',
step = 1 step = 1
......
...@@ -210,7 +210,11 @@ modTrajRibbonPlot = function(input, output, session, ...@@ -210,7 +210,11 @@ modTrajRibbonPlot = function(input, output, session,
y.stim.arg = c('ystart', 'yend'), y.stim.arg = c('ystart', 'yend'),
xlab.arg = 'Time (min)', xlab.arg = 'Time (min)',
ylab.arg = '') + ylab.arg = '') +
LOCggplotTheme() + LOCggplotTheme(in.font.base = PLOTFONTBASE,
in.font.axis.text = PLOTFONTAXISTEXT,
in.font.axis.title = PLOTFONTAXISTITLE,
in.font.strip = PLOTFONTFACETSTRIP,
in.font.legend = PLOTFONTLEGEND) +
theme(legend.position = input$rBlegendPos) theme(legend.position = input$rBlegendPos)
return(p.out) return(p.out)
......
...@@ -20,6 +20,7 @@ library(scales) # for percentages on y scale ...@@ -20,6 +20,7 @@ library(scales) # for percentages on y scale
library(dtw) # for dynamic time warping library(dtw) # for dynamic time warping
library(imputeTS) # for interpolating NAs library(imputeTS) # for interpolating NAs
# Global parameters ----
# change to increase the limit of the upload file size # change to increase the limit of the upload file size
options(shiny.maxRequestSize = 200 * 1024 ^ 2) options(shiny.maxRequestSize = 200 * 1024 ^ 2)
......
Markdown is supported
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