Commit 5f86a0fd authored by Maciej Dobrzynski's avatar Maciej Dobrzynski

Bug fixes in UI

parent ffab21c1
......@@ -25,15 +25,22 @@ DEB = T
# PLOTFONTFACETSTRIP = 10
# PLOTFONTLEGEND = 8
PLOTFONTBASE = 12
PLOTFONTAXISTEXT = 12
PLOTFONTAXISTITLE = 12
PLOTFONTFACETSTRIP = 16
PLOTFONTLEGEND = 12
PLOTFONTBASE = 16
PLOTFONTAXISTEXT = 16
PLOTFONTAXISTITLE = 16
PLOTFONTFACETSTRIP = 20
PLOTFONTLEGEND = 16
# height (in pixels) of ribbon and single traj. plots
PLOTRIBBONHEIGHT = 500 # in pixels
PLOTTRAJHEIGHT = 500 # in pixels
PLOTPSDHEIGHT = 500 # in pixels
PLOTBOXHEIGHT = 500 # in pixels
PLOTSCATTERHEIGHT = 500 # in pixels
PLOTWIDTH = 85 # in percent
# default number of facets in plots
PLOTNFACETDEFAULT = 2
PLOTNFACETDEFAULT = 3
# internal column names
COLRT = 'realtime'
......@@ -499,7 +506,7 @@ LOCrotatedAxisElementText = function(angle, position='x', size = 12){
rads = (-angle - positions[[ position ]])*pi/180
hjust = round((1 - sin(rads)))/2
vjust = round((1 + cos(rads)))/2
element_text(size = 12, angle = angle, vjust = vjust, hjust = hjust)
element_text(size = size, angle = angle, vjust = vjust, hjust = hjust)
}
# Plot individual time series
......
......@@ -43,7 +43,7 @@ modBoxPlotUI = function(id, label = "Plot Box-plots") {
numericInput(
ns('inPlotBoxWidth'),
'Width [%]:',
value = 100,
value = PLOTWIDTH,
min = 10,
width = '100px',
step = 10
......@@ -51,7 +51,7 @@ modBoxPlotUI = function(id, label = "Plot Box-plots") {
numericInput(
ns('inPlotBoxHeight'),
'Height [px]:',
value = 800,
value = PLOTBOXHEIGHT,
min = 100,
width = '100px',
step = 50
......
......@@ -7,7 +7,7 @@ modClDistPlotUI = function(id, label = "Plot Fractions WIthin Clusters") {
"45 deg" = 45,
"90 deg" = 90)),
actionButton(ns('butPlotClDist'), 'Plot!'),
plotOutput(ns('outPlotClDist'), height = '800px', width = 'auto'),
plotOutput(ns('outPlotClDist'), height = PLOTBOXHEIGHT, width = 'auto'),
downPlotUI(ns('downPlotClDist'), "Download PDF")
)
}
......@@ -63,7 +63,7 @@ modClDistPlot = function(input, output, session, in.data, in.cols = NULL, in.fna
in.font.strip = PLOTFONTFACETSTRIP,
in.font.legend = PLOTFONTLEGEND) +
theme(
axis.text.x = LOCrotatedAxisElementText(as.numeric(input$rBAxisLabelsRotate))
axis.text.x = LOCrotatedAxisElementText(as.numeric(input$rBAxisLabelsRotate), size = PLOTFONTAXISTEXT)
)
return(p.out)
......
modHeatmapPlotUI = function(id, label = "Plot Heatmap") {
ns <- NS(id)
}
modHeatmapPlot = function(input, output, session, in.data) {
ns <- session$ns
}
\ No newline at end of file
......@@ -67,7 +67,7 @@ modSelOutliers = function(input, output, session, in.data) {
output$txtOutliersPerc <- renderText({
cat(file = stdout(), 'modSelOutliers: txtOutliersPerc\n')
sprintf('<b>%d total track(s)<br>%d outlier track(s)<br>%d outlier point(s)</b><br>',
sprintf('<b>%d total track(s)<br>%d removed track(s)<br>%d removed point(s)</b><br>',
nCellsCounter[['nCellsOrig']],
nCellsCounter[['nCellsOrig']] - nCellsCounter[['nCellsAfter']],
nCellsCounter[['nOutlierTpts']])
......
......@@ -41,7 +41,7 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") {
numericInput(
ns('inPlotHeight'),
'Display plot height [px]',
value = 1000,
value = PLOTSCATTERHEIGHT,
min = 100,
step = 100
),
......
......@@ -16,7 +16,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") {
tagList(
fluidRow(
column(
3,
2,
numericInput(
ns('inPlotTrajFacetNcol'),
'#Columns:',
......@@ -29,7 +29,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") {
actionButton(ns('butPlotTraj'), 'Plot!')
),
column(
3,
2,
checkboxGroupInput(ns('chBPlotTrajStat'), 'Stats:', list('Mean' = 'mean', '95% conf. interv.' = 'CI', 'Std. error' = 'SE'))
),
column(
......@@ -48,20 +48,19 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") {
),
column(
3,
2,
numericInput(
ns('inPlotTrajWidth'),
'Width [%]:',
value = 100,
value = PLOTWIDTH,
min = 10,
max = 100,
width = '100px',
step = 10
),
numericInput(
ns('inPlotTrajHeight'),
'Height [px]:',
value = 800,
value = PLOTTRAJHEIGHT,
min = 100,
width = '100px',
step = 50
......
......@@ -8,36 +8,43 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") {
tagList(
fluidRow(
column(
3,
2,
radioButtons(ns('rBPSDmethod'), 'Method for PSD estimation:', list('Smoothed Fourier' = 'pgram', 'AR Fit' = 'ar')),
checkboxInput(ns('chBplotTrajInt'), 'Interactive Plot'),
actionButton(ns('butPlotTraj'), 'Plot!')
),
column(
3,
2,
selectInput(ns('inPSDxchoice'), 'X-axis:', list('Period'= TRUE, 'Frequency'= FALSE)),
numericInput(ns('ninPSDsamplFreq'), '# time units between 2 points:', value = 1, min = 0, step = 1)
),
column(
3,
selectInput(ns('inPSDlogtype'), 'Transformation:', list('1/x'='inverse_trans', 'log2'= 'log2', 'log10'= 'log10', 'ln'= 'log')),
checkboxGroupInput(ns('chBGPSDlogaxis'), 'Transform the axis:', list('x' = 'x', 'y' = 'y'), inline = TRUE)
2,
selectInput(ns('inPSDtransXtype'), 'Transform X-axis:', list('none' = 'none',
'1/x'='inverse_trans',
'log2'= 'log2',
'log10'= 'log10',
'ln'= 'log')),
selectInput(ns('inPSDtransYtype'), 'Transform Y-axis:', list('none' = 'none',
'1/y'='inverse_trans',
'log2'= 'log2',
'log10'= 'log10',
'ln'= 'log'))
),
column(
3,
2,
numericInput(
ns('inPlotTrajWidth'),
'Width [%]:',
value = 100,
min = 10,
max = 100,
width = '100px',
step = 10
),
numericInput(
ns('inPlotTrajHeight'),
'Height [px]:',
value = 800,
value = PLOTPSDHEIGHT,
min = 100,
width = '100px',
step = 50
......@@ -205,24 +212,24 @@ modPSDPlot = function(input, output, session,
in.font.axis.title = PLOTFONTAXISTITLE,
in.font.strip = PLOTFONTFACETSTRIP,
in.font.legend = PLOTFONTLEGEND)
# TODO: Restore tick labels when using inverse transformation
# See: https://stackoverflow.com/questions/56130614/ggplot2-missing-labels-after-custom-scaling-of-axis
inverse_trans <- scales::trans_new("myinverse", transform = function(x) 1/x,
inverse = function(x) 1/(1/x))
if("x" %in% input$chBGPSDlogaxis){
if(input$inPSDlogtype == "inverse_trans"){
p.out <- p.out + scale_x_continuous(trans = inverse_trans)
} else {
p.out <- p.out + scale_x_continuous(trans = input$inPSDlogtype)
}
if(input$inPSDtransXtype == "inverse_trans"){
p.out <- p.out + scale_x_continuous(trans = inverse_trans)
} else if (!(input$inPSDtransXtype == "none")) {
p.out <- p.out + scale_x_continuous(trans = input$inPSDtransXtype)
}
if("y" %in% input$chBGPSDlogaxis){
if(input$inPSDlogtype == "inverse_trans"){
p.out <- p.out + scale_y_continuous(trans = inverse_trans)
} else {
p.out <- p.out + scale_y_continuous(trans = input$inPSDlogtype)
}
if(input$inPSDtransYtype == "inverse_trans"){
p.out <- p.out + scale_y_continuous(trans = inverse_trans)
} else if (!(input$inPSDtransYtype == "none")) {
p.out <- p.out + scale_y_continuous(trans = input$inPSDtransYtype)
}
return(p.out)
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") {
tagList(
fluidRow(
column(
3,
2,
checkboxInput(ns('chBplotTrajInt'), 'Interactive Plot'),
radioButtons(ns('rBlegendPos'), 'Legend placement:', list('top' = 'top', 'right' = 'right')),
actionButton(ns('butPlotTraj'), 'Plot!')
......@@ -16,20 +16,19 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") {
sliderInput(ns('sliPlotTrajSkip'), 'Plot every n-th point:', min = 1, max = 10, value = 1, step = 1)
),
column(
3,
2,
numericInput(
ns('inPlotTrajWidth'),
'Width [%]:',
value = 100,
value = PLOTWIDTH,
min = 10,
max = 100,
width = '100px',
step = 10
),
numericInput(
ns('inPlotTrajHeight'),
'Height [px]:',
value = 800,
value = PLOTRIBBONHEIGHT,
min = 100,
width = '100px',
step = 50
......
......@@ -18,7 +18,7 @@ shinyUI(fluidPage(
title = "Timecourse Inspector",
sidebarLayout(
sidebarPanel(
sidebarPanel(width = 3,
#Selector for file upload
fileInput(
'inFileLoadNuc',
......
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