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

Bug fixes in UI

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