Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,8 @@ public enum Scale
LINEAR("Linear"),
LOG("Log"),
PERCENT_OF_MEAN("Percent of Mean"),
STANDARD_DEVIATIONS("Standard Deviations");
STANDARD_DEVIATIONS("Standard Deviations"),
DELTA_FROM_MEAN("Delta from Mean");

private final String _text;

Expand All @@ -773,7 +774,7 @@ public String toString()
{
return _text;
}
}
}

public enum DateRangeOffset
{
Expand Down
11 changes: 11 additions & 0 deletions test/src/org/labkey/test/tests/targetedms/TargetedMSQCTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ public void testQCPlotInputs()
assertTrue(initialSVGText.equals(qcPlotsWebPart.getSVGPlotText("precursorPlot0_plotType_1")));
qcPlotsWebPart.setScale(QCPlotsWebPart.Scale.STANDARD_DEVIATIONS);
assertTrue(initialSVGText.equals(qcPlotsWebPart.getSVGPlotText("precursorPlot0_plotType_1")));
qcPlotsWebPart.setScale(QCPlotsWebPart.Scale.DELTA_FROM_MEAN);
assertTrue(initialSVGText.equals(qcPlotsWebPart.getSVGPlotText("precursorPlot0_plotType_1")));

qcPlotsWebPart.setScale(QCPlotsWebPart.Scale.LINEAR);

Expand Down Expand Up @@ -927,6 +929,15 @@ public void testYAxisOptionsMovingRangePlot()
//Expected y axis values are 90 95 100 105 110 115
log("SVG text " + svgPlotText);
assertTrue("New plot is not as expected for percent of mean (y-axis) values", svgPlotText.contains("9095100105110115"));

log("Verifying delta from mean plots");
qcPlotsWebPart.setScale(QCPlotsWebPart.Scale.DELTA_FROM_MEAN);
svgPlotText = qcPlotsWebPart.getSVGPlotText("precursorPlot0");
assertFalse("Plot with delta from mean option is blank", svgPlotText.isEmpty());
//Expected y axis values are -3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
log("SVG text " + svgPlotText);
assertTrue("New plot is not as expected for percent of mean (y-axis) values", svgPlotText.contains("-3-2.5-2-1.5-1-0.500.511.522.5"));

}

/*
Expand Down
8 changes: 6 additions & 2 deletions webapp/TargetedMS/js/QCPlotHelperBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,9 @@ Ext4.define("LABKEY.targetedms.QCPlotHelperBase", {
shape: shapeProp,
combined: true,
yAxisScale: (showLogInvalid ? 'linear' : (this.yAxisScale !== 'log' ? 'linear' : 'log')),
valueConversion: (this.yAxisScale === 'percentDeviation' || this.yAxisScale === 'standardDeviation' ? this.yAxisScale : undefined),
valueConversion: (this.yAxisScale === LABKEY.vis.PlotProperties.ValueConversion.PercentDeviation ||
this.yAxisScale === LABKEY.vis.PlotProperties.ValueConversion.StandardDeviation ||
this.yAxisScale === LABKEY.vis.PlotProperties.ValueConversion.DeltaFromMean ? this.yAxisScale : undefined),
groupBy: 'fragment',
color: 'fragment',
defaultGuideSetLabel: 'fragment',
Expand Down Expand Up @@ -873,7 +875,9 @@ Ext4.define("LABKEY.targetedms.QCPlotHelperBase", {
xTick: this.groupedX ? 'groupedXTick' : 'fullDate',
xTickLabel: 'date',
yAxisScale: (precursorInfo.showLogInvalid ? 'linear' : (this.yAxisScale !== 'log' ? 'linear' : 'log')),
valueConversion: (this.yAxisScale === 'percentDeviation' || this.yAxisScale === 'standardDeviation' ? this.yAxisScale : undefined),
valueConversion: (this.yAxisScale === LABKEY.vis.PlotProperties.ValueConversion.PercentDeviation ||
this.yAxisScale === LABKEY.vis.PlotProperties.ValueConversion.StandardDeviation ||
this.yAxisScale === LABKEY.vis.PlotProperties.ValueConversion.DeltaFromMean ? this.yAxisScale : undefined),
shape: shapeProp,
combined: false,
pointSize: 2,
Expand Down
4 changes: 4 additions & 0 deletions webapp/TargetedMS/js/QCPlotHoverPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ Ext4.define('LABKEY.targetedms.QCPlotHoverPanel', {
this.add(this.getPlotPointDetailField('Value', LABKEY.targetedms.PlotSettingsUtil.formatNumeric(this.pointData.rawValue)));
this.add(this.getPlotPointDetailField('Std Devs', this.valueName ? this.pointData[this.valueName] : this.pointData['value']))
}
else if (this.pointData.conversion === 'deltaFromMean') {
this.add(this.getPlotPointDetailField('Value', LABKEY.targetedms.PlotSettingsUtil.formatNumeric(this.pointData.rawValue)));
this.add(this.getPlotPointDetailField('Delta From Mean', LABKEY.targetedms.PlotSettingsUtil.formatNumeric(this.valueName ? this.pointData[this.valueName] : this.pointData['value'])))
}
else {
this.add(this.getPlotPointDetailField('Value', LABKEY.targetedms.PlotSettingsUtil.formatNumeric(this.valueName ? this.pointData[this.valueName] : this.pointData['value'])));
}
Expand Down
2 changes: 1 addition & 1 deletion webapp/TargetedMS/js/QCTrendPlotPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
getYAxisOptions: function () {
return {
fields: ['value', 'display'],
data: [['linear', 'Linear'], ['log', 'Log'], ['percentDeviation', 'Percent of Mean'], ['standardDeviation', 'Standard Deviations']]
data: [['linear', 'Linear'], ['log', 'Log'], ['percentDeviation', 'Percent of Mean'], ['standardDeviation', 'Standard Deviations'], ['deltaFromMean', 'Delta from Mean']]
}
},

Expand Down