Commit 7daed4c5 authored by dmattek's avatar dmattek

UI polishing

parent a362d936
...@@ -67,7 +67,7 @@ modAUCplotUI = function(id, label = "Plot AUC distributions") { ...@@ -67,7 +67,7 @@ modAUCplotUI = function(id, label = "Plot AUC distributions") {
), ),
uiOutput(ns('uiPlotBox')), uiOutput(ns('uiPlotBox')),
downPlotUI(ns('downPlotBox'), "Download PDF") downPlotUI(ns('downPlotBox'), "Download Plot")
) )
} }
......
...@@ -128,29 +128,6 @@ l.col.pal.dend.2 = list( ...@@ -128,29 +128,6 @@ l.col.pal.dend.2 = list(
) )
# Help text ---- # Help text ----
# Creates a popup with help text
# From: https://gist.github.com/jcheng5/5913297
helpPopup <- function(title, content,
placement=c('right', 'top', 'left', 'bottom'),
trigger=c('click', 'hover', 'focus', 'manual')) {
tagList(
singleton(
tags$head(
tags$script("$(function() { $(\"[data-toggle='popover']\").popover(); })")
)
),
tags$a(
href = "#", class = "btn btn-mini", `data-toggle` = "popover",
title = title, `data-content` = content, `data-animation` = TRUE,
`data-placement` = match.arg(placement, several.ok=TRUE)[1],
`data-trigger` = match.arg(trigger, several.ok=TRUE)[1],
#tags$i(class="icon-question-sign")
# changed based on http://stackoverflow.com/questions/30436013/info-bubble-text-in-a-shiny-interface
icon("question")
)
)
}
helpText.server = c( helpText.server = c(
alDataFormat = paste0("<p>Switch between long and wide formats of input data. ", alDataFormat = paste0("<p>Switch between long and wide formats of input data. ",
"TCI accepts CSV or compressed CSV files (gz or bz2).</p>", "TCI accepts CSV or compressed CSV files (gz or bz2).</p>",
...@@ -164,24 +141,30 @@ helpText.server = c( ...@@ -164,24 +141,30 @@ helpText.server = c(
"At least 3 columns shuold be present:</p>", "At least 3 columns shuold be present:</p>",
"<li>First two columns in wide format should contain grouping and track IDs</li>", "<li>First two columns in wide format should contain grouping and track IDs</li>",
"<li>A column with a time point. Headers of columns with time points need to be numeric</li>"), "<li>A column with a time point. Headers of columns with time points need to be numeric</li>"),
inDataGen1 = 'Generate 60 random synthetic time series distributed evenly among 6 groups. Every time series has 60 time points.', inDataGen1 = paste0("Generate 3 groups with 20 random synthetic time series. ",
chBtrajRem = 'Load CSV file with a column of track IDs for removal. IDs should correspond to those used for plotting.', "Every time series contains 101 time points. ",
chBstim = 'Load CSV file with stimulation pattern. Should contain 5 columns: grouping, start and end time points of stimulation, start and end of y-position, dummy column with ID.', "Track IDs are unique across entire dataset."),
chBtrajInter = 'Interpolate missing measurements indicated with NAs in the data file. In addition, interpolate a row that is completely missing from the data. The interval of the time column must be provided to know which rows are missing.', #6 chBtrajRem = paste0("Load CSV file with a column of track IDs for removal. ",
chBtrackUni = 'If the track ID is unique only within a group, make it unique globally by combining with grouping columns.', "IDs should correspond to those used for plotting."),
'If the track ID is not globally unique, try to make it unique by prepending another column to the track ID (typically the group column).', chBstim = paste0("Load CSV file with stimulation pattern. Should contain 5 columns: ",
'Select columns to group data according to treatment, condition, etc.', #8 "grouping, start and end time points of stimulation, start and end of y-position, dummy column with ID."),
'Select math operation to perform on a single or two columns,', #9 chBtrajInter = paste0("Interpolate missing measurements indicated with NAs in the data file. ",
'Select range of time for further processing.', #10 "In addition, interpolate a row that is completely missing from the data. ",
'Divide measurements by the mean/median or calculate z-score with respect to selected time span.', #11 "The interval of the time column must be provided to know which rows are missing."),
'Fold-change or z-score with respect to selected time span.', #12 chBtrackUni = paste0("If the track ID in the uploaded dataset is unique only within a group (e.g. an experimental condition), ",
'Normalise with respect to this time span.', #13 "make it unique by prepending other columns to the track ID (typically a grouping column)."),
'Calculate fold-change and z-score using the median and Median Absolute Deviation, instead of the mean and standard deviation.', #14 chBgroup = "Select columns to group data according to treatment, condition, etc.",
'Normalise to mean/median of selected time calculated globally, per group, or for individual time series.', #15 inSelMath = "Select math operation to perform on a single or two measurement columns,",
'Download time series after modification in this section.', #16 chBtimeTrim = "Trim time for further processing.",
alertNAsPresent = "NAs present in the measurement column. Consider interpolation.", chBnorm = "Divide measurements by the mean/median or calculate z-score with respect to selected time span.",
rBnormMeth = "Fold-change or z-score with respect to selected time span.",
slNormRtMinMax = "Normalise with respect to this time span.",
chBnormRobust = "Calculate fold-change and z-score using the median and Median Absolute Deviation, instead of the mean and standard deviation.",
chBnormGroup = "Normalise to mean/median of selected time calculated globally, per group, or for individual time series.",
downloadDataClean = "Download all time series after modifications in this panel.",
alertNAsPresent = "NAs present in the measurement column. Consider interpolation.",
alertWideMissesNumericTime = "Non-numeric headers of time columns. Data in wide format should have numeric column headers corresponding to time points.", alertWideMissesNumericTime = "Non-numeric headers of time columns. Data in wide format should have numeric column headers corresponding to time points.",
alertWideTooFewColumns = "Insufficient columns. Data in wide format should contain at least 3 columns: grouping, track ID, and a single time point." alertWideTooFewColumns = "Insufficient columns. Data in wide format should contain at least 3 columns: grouping, track ID, and a single time point."
) )
# Functions for data processing ---- # Functions for data processing ----
...@@ -345,11 +328,11 @@ LOCgenTraj2 <- function(n_perGroup = 20, sd_noise = 0.01, sampleFreq = 0.2, endT ...@@ -345,11 +328,11 @@ LOCgenTraj2 <- function(n_perGroup = 20, sd_noise = 0.01, sampleFreq = 0.2, endT
interval.stim = 5, interval.stim = 5,
lambda = 0.2, lambda = 0.2,
freq = 0.2, freq = 0.2,
end = 50) end = 40)
{ {
require(data.table) require(data.table)
tvec <- seq(0, end - 1, by = freq) tvec <- seq(0, end, by = freq)
stim_time <- seq(interval.stim, end - 1, interval.stim) stim_time <- seq(interval.stim, end, interval.stim)
stim_time_matrix <- stim_time_matrix <-
matrix(stim_time, nrow = length(stim_time), matrix(stim_time, nrow = length(stim_time),
ncol = n) ncol = n)
...@@ -375,7 +358,7 @@ LOCgenTraj2 <- function(n_perGroup = 20, sd_noise = 0.01, sampleFreq = 0.2, endT ...@@ -375,7 +358,7 @@ LOCgenTraj2 <- function(n_perGroup = 20, sd_noise = 0.01, sampleFreq = 0.2, endT
} }
} }
trajs <- as.data.table(trajs) trajs <- as.data.table(trajs)
trajs <- cbind(seq(0, end - 1, by = freq), trajs) trajs <- cbind(seq(0, end, by = freq), trajs)
colnames(trajs)[1] <- "Time" colnames(trajs)[1] <- "Time"
trajs <- melt(trajs, id.vars = "Time") trajs <- melt(trajs, id.vars = "Time")
return(trajs) return(trajs)
...@@ -417,11 +400,11 @@ LOCgenTraj2 <- function(n_perGroup = 20, sd_noise = 0.01, sampleFreq = 0.2, endT ...@@ -417,11 +400,11 @@ LOCgenTraj2 <- function(n_perGroup = 20, sd_noise = 0.01, sampleFreq = 0.2, endT
dt3[, Group := "lowAmplitude"] dt3[, Group := "lowAmplitude"]
dt <- rbindlist(list(dt1, dt2, dt3)) dt <- rbindlist(list(dt1, dt2, dt3))
dt[, ID := paste(Group, variable, sep = "_")] dt[, ID := sprintf("%s_%02d", Group, as.integer(gsub('[A-Z]', '', variable)))]
dt[, variable := NULL] dt[, variable := NULL]
dt[, Group := as.factor(Group)] dt[, Group := as.factor(Group)]
dt[, value := value + runif(1, -0.1, 0.1), by = ID] dt[, value := value + runif(1, -0.1, 0.1), by = .(Group, ID)]
noise_vec <- rnorm(n = nrow(dt), mean = 0, sd = sd_noise) noise_vec <- rnorm(n = nrow(dt), mean = 0, sd = sd_noise)
dt[, value := value + noise_vec] dt[, value := value + noise_vec]
......
...@@ -16,7 +16,7 @@ modClDistPlotUI = function(id, label = "Plot distribution of clusters per group ...@@ -16,7 +16,7 @@ modClDistPlotUI = function(id, label = "Plot distribution of clusters per group
"90 deg" = 90), inline = T), "90 deg" = 90), inline = T),
actionButton(ns('butPlotClDist'), 'Plot!'), actionButton(ns('butPlotClDist'), 'Plot!'),
plotOutput(ns('outPlotClDist'), height = PLOTBOXHEIGHT, width = 'auto'), plotOutput(ns('outPlotClDist'), height = PLOTBOXHEIGHT, width = 'auto'),
downPlotUI(ns('downPlotClDist'), "Download PDF") downPlotUI(ns('downPlotClDist'), "Download Plot")
) )
} }
......
...@@ -53,7 +53,7 @@ modTrackStats = function(input, output, session, ...@@ -53,7 +53,7 @@ modTrackStats = function(input, output, session,
if (is.null(loc.dt)) if (is.null(loc.dt))
return(NULL) return(NULL)
sprintf('<b>Total number of time-series: %d <br>Average length: %.2f time units</b>', sprintf('<b>Total number of time series: %d <br>Average length: %.2f time points</b>',
length(unique(loc.dt[[COLID]])), length(unique(loc.dt[[COLID]])),
loc.dt[, .(trackLength = .N), by = COLID][, mean(trackLength)]) loc.dt[, .(trackLength = .N), by = COLID][, mean(trackLength)])
...@@ -78,7 +78,7 @@ modTrackStats = function(input, output, session, ...@@ -78,7 +78,7 @@ modTrackStats = function(input, output, session,
'measIQR' = IQR(x, na.rm = T), 'measIQR' = IQR(x, na.rm = T),
'meas_rCV_IQR' = IQR(x, na.rm = T)/median(x, na.rm = T))), .SDcols = COLY, by = c(in.bycols)] 'meas_rCV_IQR' = IQR(x, na.rm = T)/median(x, na.rm = T))), .SDcols = COLY, by = c(in.bycols)]
setnames(loc.dt.aggr, c(in.bycols, '#NAs', 'Min', 'Max', 'Mean', 'SD', 'CV', 'Median', 'IQR', 'rCV')) setnames(loc.dt.aggr, c(in.bycols, '#NAs', 'Min Y', 'Max Y', 'Mean Y', 'SD', 'CV', 'Median Y', 'IQR', 'rCV'))
return(loc.dt.aggr) return(loc.dt.aggr)
}) })
...@@ -99,7 +99,7 @@ modTrackStats = function(input, output, session, ...@@ -99,7 +99,7 @@ modTrackStats = function(input, output, session,
tracksLenMedian = median(as.double(nTpts)), tracksLenMedian = median(as.double(nTpts)),
tracksLenIQR = IQR(nTpts)), by = c(in.bycols)] tracksLenIQR = IQR(nTpts)), by = c(in.bycols)]
setnames(loc.dt.aggr, c(in.bycols, 'nTracks', 'Mean', 'SD', 'Median', 'IQR')) setnames(loc.dt.aggr, c(in.bycols, 'nTracks', 'Mean Length', 'SD', 'Median Length', 'IQR'))
return(loc.dt.aggr) return(loc.dt.aggr)
}) })
...@@ -114,7 +114,9 @@ modTrackStats = function(input, output, session, ...@@ -114,7 +114,9 @@ modTrackStats = function(input, output, session,
if (nrow(loc.dt)) if (nrow(loc.dt))
datatable(loc.dt, datatable(loc.dt,
caption = 'Statistics of time series: number of time series, mean/median and the spread of track lengths, SD - standard deviation, IQR - interquartile range.', caption = paste0("Statistics of time series: number of time series, ",
"mean/median track length, ",
"SD - standard deviation, IQR - interquartile range."),
rownames = TRUE, rownames = TRUE,
extensions = 'Buttons', extensions = 'Buttons',
options = list( options = list(
...@@ -144,7 +146,11 @@ modTrackStats = function(input, output, session, ...@@ -144,7 +146,11 @@ modTrackStats = function(input, output, session,
if (nrow(loc.dt)) if (nrow(loc.dt))
datatable(loc.dt, datatable(loc.dt,
caption = 'Statistics of measurements: number of NA time points, min/max/mean/median and the spread of the y-axis value. SD - standard deviation, CV - coefficient of variation, SD/mean; IQR - interquartile range, rCV - robust CV, IQR/median.', caption = paste0("Statistics of measurements: number of NA time points, ",
"min/max/mean/median of the measurmeent selected for the Y-axis. ",
"SD - standard deviation; CV - coefficient of variation; ",
"SD/mean; IQR - interquartile range; ",
"rCV - robust CV, IQR/median."),
rownames = TRUE, rownames = TRUE,
extensions = 'Buttons', extensions = 'Buttons',
options = list( options = list(
...@@ -178,7 +184,9 @@ modTrackStats = function(input, output, session, ...@@ -178,7 +184,9 @@ modTrackStats = function(input, output, session,
if (nrow(loc.duptracks)) if (nrow(loc.duptracks))
datatable(loc.duptracks, datatable(loc.duptracks,
caption = 'Track IDs with duplicated objects in a group. To avoid, create a data-wide unique track ID in the panel on the left or in your input data.', caption = paste0("Track IDs with duplicated objects in a group. ",
"To avoid, create a data-wide unique track ID in ",
"the panel on the left or in your input data."),
rownames = TRUE, rownames = TRUE,
extensions = 'Buttons', extensions = 'Buttons',
options = list( options = list(
......
...@@ -72,7 +72,7 @@ modDistPlotUI = function(id, label = "Plot distributions") { ...@@ -72,7 +72,7 @@ modDistPlotUI = function(id, label = "Plot distributions") {
), ),
uiOutput(ns('uiPlotBox')), uiOutput(ns('uiPlotBox')),
downPlotUI(ns('downPlotBox'), "Download PDF") downPlotUI(ns('downPlotBox'), "Download Plot")
) )
} }
......
...@@ -19,28 +19,41 @@ downPlotUI <- function(id, label = "Download Plot") { ...@@ -19,28 +19,41 @@ downPlotUI <- function(id, label = "Download Plot") {
h4(label), h4(label),
fluidRow( fluidRow(
# CSS to make label next to text input
# From: https://stackoverflow.com/a/45299050/1898713
tags$head(
tags$style(type="text/css",
"#inline label{ display: table-cell; text-align: center; vertical-align: middle; } #inline .form-group { display: table-row;}")
),
column(3,
uiOutput(ns('uiDownButton'))
),
column( column(
3, 3,
numericInput( tags$div(id = "inline",
ns('inPlotWidth'), numericInput(
"Width (in)", ns('inPlotWidth'),
8.5, "Width [in]",
min = 1, 8.5,
width = 100 min = 1,
width = 100
)
) )
), ),
column( column(
3, 3,
numericInput( tags$div(id = "inline",
ns('inPlotHeight'), numericInput(
"Height (in)", ns('inPlotHeight'),
11, "Height [in]",
min = 1, 11,
width = 100 min = 1,
width = 100
)
) )
), )
column(6,
uiOutput(ns('uiDownButton')))
) )
) )
} }
......
...@@ -168,7 +168,7 @@ clustHierUI <- function(id, label = "Hierarchical Clustering") { ...@@ -168,7 +168,7 @@ clustHierUI <- function(id, label = "Hierarchical Clustering") {
), ),
actionButton(ns('butPlotHierHeatMap'), 'Plot!'), actionButton(ns('butPlotHierHeatMap'), 'Plot!'),
downPlotUI(ns('downPlotHier'), "Download PNG"), downPlotUI(ns('downPlotHier'), "Download Plot"),
withSpinner(plotOutput(ns('outPlotHier'))) withSpinner(plotOutput(ns('outPlotHier')))
), ),
......
...@@ -169,8 +169,8 @@ clustHierSparUI <- function(id, label = "Sparse Hierarchical Clustering") { ...@@ -169,8 +169,8 @@ clustHierSparUI <- function(id, label = "Sparse Hierarchical Clustering") {
), ),
br(), br(),
downPlotUI(ns('downPlotHierSparHM'), "Download PNG"),
actionButton(ns('butPlotHierSparHeatMap'), 'Plot!'), actionButton(ns('butPlotHierSparHeatMap'), 'Plot!'),
downPlotUI(ns('downPlotHierSparHM'), "Download Plot"),
withSpinner(plotOutput(ns('outPlotHierSpar'))) withSpinner(plotOutput(ns('outPlotHierSpar')))
), ),
......
...@@ -35,7 +35,7 @@ helpText.clValid = c(alertNAsPresentDTW = paste0("NAs present. DTW cannot calcul ...@@ -35,7 +35,7 @@ helpText.clValid = c(alertNAsPresentDTW = paste0("NAs present. DTW cannot calcul
"<p><b>Stability validation</b>, is a special version of internal validation. ", "<p><b>Stability validation</b>, is a special version of internal validation. ",
"It evaluates the consistency of a clustering result by comparing it with the clusters obtained ", "It evaluates the consistency of a clustering result by comparing it with the clusters obtained ",
"after each column is removed, one at a time.</p>"), "after each column is removed, one at a time.</p>"),
outPlotWss = "Weighted squared sum...", outPlotWss = "Within squared sum...",
outPlotSilhAvg = "Average...", outPlotSilhAvg = "Average...",
outPlotTree = "Dendrogram...", outPlotTree = "Dendrogram...",
outPlotSilhForCut = "Silhouette plot at dendrogram cut...") outPlotSilhForCut = "Silhouette plot at dendrogram cut...")
...@@ -51,6 +51,7 @@ clustValidUI <- function(id, label = "Validation") { ...@@ -51,6 +51,7 @@ clustValidUI <- function(id, label = "Validation") {
br(), br(),
br(), br(),
fluidRow( fluidRow(
column(3, column(3,
selectInput( selectInput(
ns("selectDiss"), ns("selectDiss"),
......
...@@ -84,7 +84,7 @@ tabScatterPlotUI <- function(id, label = "Comparing measurements at time points" ...@@ -84,7 +84,7 @@ tabScatterPlotUI <- function(id, label = "Comparing measurements at time points"
value = FALSE), value = FALSE),
actionButton(ns('butGoScatter'), 'Plot!'), actionButton(ns('butGoScatter'), 'Plot!'),
uiOutput(ns("plotInt_ui")), uiOutput(ns("plotInt_ui")),
downPlotUI(ns('downPlotScatter'), "Download PDF") downPlotUI(ns('downPlotScatter'), "Download Plot")
) )
} }
......
...@@ -14,7 +14,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") { ...@@ -14,7 +14,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") {
tagList( tagList(
fluidRow( fluidRow(
column( column(
2, 3,
numericInput( numericInput(
ns('inPlotTrajFacetNcol'), ns('inPlotTrajFacetNcol'),
'#columns', '#columns',
...@@ -37,7 +37,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") { ...@@ -37,7 +37,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") {
sliderInput(ns('sliPlotTrajSkip'), 'Plot every n-th point', sliderInput(ns('sliPlotTrajSkip'), 'Plot every n-th point',
min = 1, max = 10, value = 1, step = 1), min = 1, max = 10, value = 1, step = 1),
checkboxInput(ns('chBsetXbounds'), 'Set bounds for x-axis', FALSE), checkboxInput(ns('chBsetXbounds'), 'Bounds for X', FALSE),
fluidRow( fluidRow(
column(6, column(6,
uiOutput(ns('uiSetXboundsLow')) uiOutput(ns('uiSetXboundsLow'))
...@@ -46,7 +46,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") { ...@@ -46,7 +46,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") {
uiOutput(ns('uiSetXboundsHigh')) uiOutput(ns('uiSetXboundsHigh'))
)), )),
checkboxInput(ns('chBsetYbounds'), 'Set bounds for y-axis', FALSE), checkboxInput(ns('chBsetYbounds'), 'Bounds for Y', FALSE),
fluidRow( fluidRow(
column(6, column(6,
uiOutput(ns('uiSetYboundsLow')) uiOutput(ns('uiSetYboundsLow'))
...@@ -79,7 +79,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") { ...@@ -79,7 +79,7 @@ modTrajPlotUI = function(id, label = "Plot Individual Time Series") {
uiOutput(ns('uiPlotTraj')), uiOutput(ns('uiPlotTraj')),
br(), br(),
modTrackStatsUI(ns('dispTrackStats')), modTrackStatsUI(ns('dispTrackStats')),
downPlotUI(ns('downPlotTraj'), "Download PDF") downPlotUI(ns('downPlotTraj'), "Download Plot")
) )
} }
......
...@@ -12,24 +12,24 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") { ...@@ -12,24 +12,24 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") {
tagList( tagList(
fluidRow( fluidRow(
column( column(
2, 3,
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(
2, 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(
2, 2,
selectInput(ns('inPSDtransXtype'), 'Transform X-axis:', list('none' = 'none', selectInput(ns('inPSDtransXtype'), 'Transform X', list('none' = 'none',
'1/x'='inverse_trans', '1/x'='inverse_trans',
'log2'= 'log2', 'log2'= 'log2',
'log10'= 'log10', 'log10'= 'log10',
'ln'= 'log')), 'ln'= 'log')),
selectInput(ns('inPSDtransYtype'), 'Transform Y-axis:', list('none' = 'none', selectInput(ns('inPSDtransYtype'), 'Transform Y', list('none' = 'none',
'1/y'='inverse_trans', '1/y'='inverse_trans',
'log2'= 'log2', 'log2'= 'log2',
'log10'= 'log10', 'log10'= 'log10',
...@@ -39,7 +39,7 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") { ...@@ -39,7 +39,7 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") {
2, 2,
numericInput( numericInput(
ns('inPlotTrajWidth'), ns('inPlotTrajWidth'),
'Width [%]:', 'Width [%]',
value = 100, value = 100,
min = 10, min = 10,
width = '100px', width = '100px',
...@@ -47,7 +47,7 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") { ...@@ -47,7 +47,7 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") {
), ),
numericInput( numericInput(
ns('inPlotTrajHeight'), ns('inPlotTrajHeight'),
'Height [px]:', 'Height [px]',
value = PLOTPSDHEIGHT, value = PLOTPSDHEIGHT,
min = 100, min = 100,
width = '100px', width = '100px',
...@@ -56,7 +56,7 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") { ...@@ -56,7 +56,7 @@ modPSDPlotUI = function(id, label = "Plot PSD of average trajectory.") {
) )
), ),
uiOutput(ns('uiPlotTraj')), uiOutput(ns('uiPlotTraj')),
downPlotUI(ns('downPlotTraj'), "Download PDF") downPlotUI(ns('downPlotTraj'), "Download Plot")
) )
} }
......
...@@ -12,22 +12,22 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") { ...@@ -12,22 +12,22 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") {
tagList( tagList(
fluidRow( fluidRow(
column( column(
2, 3,
radioButtons(ns('rBlegendPos'), 'Legend:', list('top' = 'top', 'right' = 'right')), radioButtons(ns('rBlegendPos'), 'Legend', list('top' = 'top', 'right' = 'right')),
checkboxInput(ns('chBplotTrajInt'), 'Interactive Plot'), checkboxInput(ns('chBplotTrajInt'), 'Interactive Plot'),
actionButton(ns('butPlotTraj'), 'Plot!') actionButton(ns('butPlotTraj'), 'Plot!')
), ),
column( column(
2, 2,
radioButtons(ns('rBPlotTrajStat'), 'Display:', list('Mean only' = 'Mean', radioButtons(ns('rBPlotTrajStat'), 'Display', list('Mean only' = 'Mean',
'Add 95% CI' = 'CI', 'Add 95% CI' = 'CI',
'Add SE' = 'SE')) 'Add SE' = 'SE'))
), ),
column( column(
3, 3,
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),
checkboxInput(ns('chBsetXbounds'), 'Set bounds for x-axis', FALSE), checkboxInput(ns('chBsetXbounds'), 'Bounds for X', FALSE),
fluidRow( fluidRow(
column(6, column(6,
uiOutput(ns('uiSetXboundsLow')) uiOutput(ns('uiSetXboundsLow'))
...@@ -36,7 +36,7 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") { ...@@ -36,7 +36,7 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") {
uiOutput(ns('uiSetXboundsHigh')) uiOutput(ns('uiSetXboundsHigh'))
)), )),
checkboxInput(ns('chBsetYbounds'), 'Set bounds for y-axis', FALSE), checkboxInput(ns('chBsetYbounds'), 'Bounds for Y', FALSE),
fluidRow( fluidRow(
column(6, column(6,
uiOutput(ns('uiSetYboundsLow')) uiOutput(ns('uiSetYboundsLow'))
...@@ -49,7 +49,7 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") { ...@@ -49,7 +49,7 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") {
2, 2,
numericInput( numericInput(
ns('inPlotTrajWidth'), ns('inPlotTrajWidth'),
'Width [%]:', 'Width [%]',
value = PLOTWIDTH, value = PLOTWIDTH,
min = 10, min = 10,
width = '100px', width = '100px',
...@@ -57,7 +57,7 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") { ...@@ -57,7 +57,7 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") {
), ),
numericInput( numericInput(
ns('inPlotTrajHeight'), ns('inPlotTrajHeight'),
'Height [px]:', 'Height [px]',
value = PLOTRIBBONHEIGHT, value = PLOTRIBBONHEIGHT,
min = 100, min = 100,
width = '100px', width = '100px',
...@@ -69,7 +69,7 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") { ...@@ -69,7 +69,7 @@ modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") {
br(), br(),
modTrackStatsUI(ns('dispTrackStats')), modTrackStatsUI(ns('dispTrackStats')),
downPlotUI(ns('downPlotTraj'), "Download PDF") downPlotUI(ns('downPlotTraj'), "Download Plot")
) )
} }
......
...@@ -74,7 +74,7 @@ shinyServer(function(input, output, session) { ...@@ -74,7 +74,7 @@ shinyServer(function(input, output, session) {
if (DEB) if (DEB)
cat("server:dataGen1\n") cat("server:dataGen1\n")
return(LOCgenTraj2()) return(LOCgenTraj2(n_perGroup = 20, sd_noise = 0.01, sampleFreq = 0.4, endTime = 40))
}) })
# Load main data file # Load main data file
...@@ -139,7 +139,7 @@ shinyServer(function(input, output, session) { ...@@ -139,7 +139,7 @@ shinyServer(function(input, output, session) {
if(input$chBtrajRem) if(input$chBtrajRem)
fileInput( fileInput(
'inFileLoadTrajRem', 'inFileLoadTrajRem',