Commit 7ea6e2c0 authored by dmattek's avatar dmattek

Added: colour trajectories according to their filteirng status, if mid.in...

Added: colour trajectories according to their filteirng status, if mid.in column available in the dataset.
parent 1998d2ac
...@@ -184,12 +184,24 @@ shinyServer(function(input, output, session) { ...@@ -184,12 +184,24 @@ shinyServer(function(input, output, session) {
loc.s.rt = input$inSelTime loc.s.rt = input$inSelTime
loc.out = loc.dt[, .( # if dataset contains column mid.in with trajectory filtering status,
y = eval(parse(text = loc.s.y)), # then, include it in plotting
id = trackObjectsLabelUni, if (sum(names(loc.dt) %in% 'mid.in') > 0) {
group = eval(parse(text = loc.s.gr)), loc.out = loc.dt[, .(
realtime = eval(parse(text = loc.s.rt)) y = eval(parse(text = loc.s.y)),
)] id = trackObjectsLabelUni,
group = eval(parse(text = loc.s.gr)),
realtime = eval(parse(text = loc.s.rt)),
mid.in = mid.in
)]
} else {
loc.out = loc.dt[, .(
y = eval(parse(text = loc.s.y)),
id = trackObjectsLabelUni,
group = eval(parse(text = loc.s.gr)),
realtime = eval(parse(text = loc.s.rt))
)]
}
# remove rows with NA # remove rows with NA
return(loc.out[complete.cases(loc.out)]) return(loc.out[complete.cases(loc.out)])
...@@ -333,6 +345,12 @@ shinyServer(function(input, output, session) { ...@@ -333,6 +345,12 @@ shinyServer(function(input, output, session) {
cat(file=stderr(), 'plotTraj:dt not NULL\n') cat(file=stderr(), 'plotTraj:dt not NULL\n')
# colour trajectories, if dataset contains mi.din column
# with filtering status of trajectory
if(sum(names(loc.dt) %in% 'mid.in') > 0)
loc.line.col.arg = 'mid.in'
else
loc.line.col.arg = NULL
p.out = myGgplotTraj( p.out = myGgplotTraj(
dt.arg = loc.dt, dt.arg = loc.dt,
...@@ -341,8 +359,10 @@ shinyServer(function(input, output, session) { ...@@ -341,8 +359,10 @@ shinyServer(function(input, output, session) {
group.arg = "id", group.arg = "id",
facet.arg = 'group', facet.arg = 'group',
facet.ncol.arg = input$inPlotTrajFacetNcol, facet.ncol.arg = input$inPlotTrajFacetNcol,
xlab.arg = 'Time (min)' xlab.arg = 'Time (min)',
line.col.arg = loc.line.col.arg
) )
# This is required to avoid # This is required to avoid
# "Warning: Error in <Anonymous>: cannot open file 'Rplots.pdf'" # "Warning: Error in <Anonymous>: cannot open file 'Rplots.pdf'"
......
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