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
8 changes: 8 additions & 0 deletions src/org/labkey/targetedms/TargetedMSController.java
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ public static class LeveyJenningsPlotOptions
private String _metric2;
private String _yAxisScale;
private Boolean _groupedX;
private Boolean _calendarX;
private Boolean _singlePlot;
private Boolean _showExcluded;
private Boolean _showExcludedPrecursors;
Expand All @@ -842,6 +843,8 @@ public Map<String, String> getAsMapOfStrings()
valueMap.put("yAxisScale", _yAxisScale);
if (_groupedX != null)
valueMap.put("groupedX", Boolean.toString(_groupedX));
if (_calendarX != null)
valueMap.put("calendarX", Boolean.toString(_calendarX));
if (_singlePlot != null)
valueMap.put("singlePlot", Boolean.toString(_singlePlot));
if (_showExcluded != null)
Expand Down Expand Up @@ -888,6 +891,11 @@ public void setGroupedX(Boolean groupedX)
_groupedX = groupedX;
}

public void setCalendarX(Boolean calendarX)
{
_calendarX = calendarX;
}

public void setSinglePlot(Boolean singlePlot)
{
_singlePlot = singlePlot;
Expand Down
25 changes: 25 additions & 0 deletions test/src/org/labkey/test/components/targetedms/QCPlotsWebPart.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,30 @@ public boolean isGroupXAxisValuesByDateChecked()
}
}

public void setGroupXAxisValuesByCalendar(boolean check)
{
if (isGroupXAxisValuesByCalendarChecked() != check)
{
if (check)
doAndWaitForUpdate(() -> elementCache().xAxisGroupingCalendarRadio.check());
else
doAndWaitForUpdate(() -> elementCache().xAxisGroupingReplicateRadio.check());
}
}

public boolean isGroupXAxisValuesByCalendarChecked()
{
try
{
return elementCache().xAxisGroupingCalendarRadio.isSelected();
}
catch (NoSuchElementException | StaleElementReferenceException e)
{
// Fallback: if radios are not present yet, assume unchecked
return false;
}
}

public void setShowAllPeptidesInSinglePlot(boolean check)
{
// 'check' means show all series combined in a single plot
Expand Down Expand Up @@ -918,6 +942,7 @@ public class Elements extends BodyWebPart<?>.ElementCache

RadioButton xAxisGroupingReplicateRadio = new RadioButton.RadioButtonFinder().withLabel("per replicate").findWhenNeeded(getDriver());
RadioButton xAxisGroupingDateRadio = new RadioButton.RadioButtonFinder().withLabel("per date").findWhenNeeded(getDriver());
RadioButton xAxisGroupingCalendarRadio = new RadioButton.RadioButtonFinder().withLabel("calendar").findWhenNeeded(getDriver());

RadioButton plotsCombinedRadio = new RadioButton.RadioButtonFinder().withLabel("combined").findWhenNeeded(getDriver());
RadioButton plotsPerPrecursorRadio = new RadioButton.RadioButtonFinder().withLabel("per precursor").findWhenNeeded(getDriver());
Expand Down
13 changes: 13 additions & 0 deletions test/src/org/labkey/test/tests/targetedms/TargetedMSQCTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ public void testQCPlotInputs()
assertNotEquals(initialSVGText, qcPlotsWebPart.getSVGPlotText("precursorPlot0"));
qcPlotsWebPart.setGroupXAxisValuesByDate(false);

// test option to group X-Axis values by Calendar (time-scaled date axis)
initialSVGText = qcPlotsWebPart.getSVGPlotText("precursorPlot0");
qcPlotsWebPart.setGroupXAxisValuesByCalendar(true);
assertNotEquals(initialSVGText, qcPlotsWebPart.getSVGPlotText("precursorPlot0"));
qcPlotsWebPart.setGroupXAxisValuesByCalendar(false);

// test that plot0 changes based on scale
for (QCPlotsWebPart.Scale scale : QCPlotsWebPart.Scale.values())
{
Expand Down Expand Up @@ -410,6 +416,13 @@ public void testQCPlotInputsPersistence()
goToProjectHome();
qcPlotsWebPart = qcDashboard.getQcPlotsWebPart();

// verify the Calendar X-axis grouping option also round-trips on refresh
qcPlotsWebPart.setGroupXAxisValuesByCalendar(true);
refresh();
qcPlotsWebPart = qcDashboard.getQcPlotsWebPart();
qcPlotsWebPart.waitForPlots(2);
assertTrue("Calendar X-Axis grouping not round tripped as expected", qcPlotsWebPart.isGroupXAxisValuesByCalendarChecked());

// reset plot type selection
qcPlotsWebPart.resetInitialQCPlotFields();
}
Expand Down
2 changes: 2 additions & 0 deletions webapp/TargetedMS/js/QCPlotHelperBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ Ext4.define("LABKEY.targetedms.QCPlotHelperBase", {
mouseOutFn: this.plotPointMouseOut,
mouseOutFnScope: this,
position: this.groupedX ? 'sequential' : undefined,
timeBasedXTick: this.calendarX === true,
legendMouseOverFn: this.legendMouseOver,
legendMouseOverFnScope: this,
legendMouseOutFn: this.plotPointMouseOut,
Expand Down Expand Up @@ -931,6 +932,7 @@ Ext4.define("LABKEY.targetedms.QCPlotHelperBase", {
mouseOverFn: this.plotPointMouseOver,
mouseOverFnScope: this,
position: this.groupedX ? 'sequential' : undefined,
timeBasedXTick: this.calendarX === true,
disableRangeDisplay: this.isMultiSeries(),
hoverTextFn: !showDataPoints ? function() { return 'Narrow the date range to show individual data points.' } : undefined,
hideSDLines: true,
Expand Down
Loading
Loading