Commit cfc6be30 authored by dmattek's avatar dmattek

Defined global variables for font sizes in plots

parent eebd8a44
......@@ -12,6 +12,18 @@ require(gplots) # for heatmap.2
require(grid) # for modifying grob
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 ----
rhg_cols <- c(
"#771C19",
......@@ -513,7 +525,11 @@ LOCplotTraj = function(dt.arg, # input data table
xlab(paste0(xlab.arg, "\n")) +
ylab(paste0("\n", ylab.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")
return(p.tmp)
......@@ -655,7 +671,11 @@ LOCggplotScat = function(dt.arg,
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")
# Marginal distributions don;t work with plotly...
......
......@@ -239,7 +239,11 @@ modBoxPlot = function(input, output, session,
scale_fill_discrete(name = '') +
xlab('') +
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,
axis.text.x = LOCrotatedAxisElementText(as.numeric(input$rBAxisLabelsRotate)))
......
......@@ -57,7 +57,11 @@ modClDistPlot = function(input, output, session, in.data, in.cols = NULL, in.fna
scale_y_continuous(labels = percent) +
ylab("percentage of cells\n") +
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(
axis.text.x = LOCrotatedAxisElementText(as.numeric(input$rBAxisLabelsRotate))
)
......
......@@ -48,7 +48,7 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") {
numericInput(
ns('inPlotNcolFacet'),
'#columns',
value = 2,
value = PLOTNFACETDEFAULT,
min = 1,
step = 1
)
......
......@@ -20,7 +20,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") {
numericInput(
ns('inPlotTrajFacetNcol'),
'#Columns:',
value = 4,
value = PLOTNFACETDEFAULT,
min = 1,
width = '100px',
step = 1
......
......@@ -210,7 +210,11 @@ modTrajRibbonPlot = function(input, output, session,
y.stim.arg = c('ystart', 'yend'),
xlab.arg = 'Time (min)',
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)
return(p.out)
......
......@@ -20,6 +20,7 @@ library(scales) # for percentages on y scale
library(dtw) # for dynamic time warping
library(imputeTS) # for interpolating NAs
# Global parameters ----
# change to increase the limit of the upload file size
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