Skip to content

Commit

Permalink
MAINT: Make updateSampleDroppedDiv take in lists
Browse files Browse the repository at this point in the history
i.e. lists of dropped sample IDs instead of just the count of
dropped sample IDs. Will make finishing up #92 easier
  • Loading branch information
fedarko committed Jun 8, 2019
1 parent 6f50c2d commit 627e31c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions qurro/support_files/js/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ define(["./feature_computation", "./dom_utils", "vega", "vega-embed"], function(
changeSamplePlot(updateBalanceFunc, updateRankColorFunc) {
var dataName = this.samplePlotJSON.data.name;
var parentDisplay = this;
var numSamplesWithNullBalance = 0;
var nullBalanceSampleIDs = [];
this.samplePlotView
.change(
dataName,
Expand All @@ -369,15 +369,17 @@ define(["./feature_computation", "./dom_utils", "vega", "vega-embed"], function(
sampleRow
);
if (sampleBalance === null) {
numSamplesWithNullBalance++;
nullBalanceSampleIDs.push(
sampleRow["Sample ID"]
);
}
return sampleBalance;
}
)
)
.run();
dom_utils.updateSampleDroppedDiv(
numSamplesWithNullBalance,
nullBalanceSampleIDs,
this.sampleCount,
"balanceSamplesDroppedDiv",
"balance"
Expand Down
3 changes: 2 additions & 1 deletion qurro/support_files/js/dom_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ define(function() {
* is.)
*/
function updateSampleDroppedDiv(
numDroppedSamples,
droppedSampleIDList,
totalSampleCount,
divID,
dropType,
field
) {
var numDroppedSamples = droppedSampleIDList.length;
// Only bother updating the <div>'s text if we're actually going to be
// dropping samples for this "reason" -- i.e. numDroppedSamples > 0.
if (numDroppedSamples > 0) {
Expand Down

0 comments on commit 627e31c

Please sign in to comment.