Skip to content

Commit

Permalink
Add a separate Sample Count plot at the bottom.
Browse files Browse the repository at this point in the history
Also added sampleCount() to Evolution.
  • Loading branch information
adrian17 committed Oct 2, 2017
1 parent db90552 commit a7123b2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions new-pipeline/evo.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ <h2 id="submissions-title" style="font-size: 18px; margin-bottom: 0"></h2>
<figure class="col-md-12">
<div class="col-md-12" id="submissions"></div>
</figure>
<h2 id="sample-counts-title" style="font-size: 18px; margin-bottom: 0"></h2>
<figure class="col-md-12">
<div class="col-md-12" id="sample-counts"></div>
</figure>
</div>
</div>
<div class="row">
Expand Down
8 changes: 5 additions & 3 deletions new-pipeline/src/evo.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ var gMetaAggregates = [
["submissions", "Submissions", function (evolution) {
return evolution.submissions();
}, "#submissions"],
["sample-count", "Sample count", function (evolution) {
return evolution.sampleCounts();
}, "#sample-counts"],
];
var gAvailablaAggregates = gDefaultAggregates.concat(gMetaAggregates);

Expand Down Expand Up @@ -331,9 +334,8 @@ $(function () {
.show();
}

$("#submissions-title")
.text($("#measure")
.val() + " submissions");
$("#submissions-title").text($("#measure").val() + " submissions");
$("#sample-counts-title").text($("#measure").val() + " sample counts");
$("#measure-description")
.text(evolutionDescription === null ? $(
"#measure")
Expand Down
6 changes: 6 additions & 0 deletions v2/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ Returns a list of submission counts for each histogram in `someEvolutionInstance

This is provided as a convenience method to make it easy to plot summary statistics for histogram evolutions.

### `someEvolutionInstance.sampleCounts()`

Returns a list of sample counts for each histogram in `someEvolutionInstance`, sorted by date (oldest to newest).

This is provided as a convenience method to make it easy to plot summary statistics for histogram evolutions.

### `Telemetry.Histogram`

Class used to represent a histogram. Instances of this class can be obtained from `someEvolutionInstance.histogram()`. This class should not be instantiated directly.
Expand Down
4 changes: 4 additions & 0 deletions v2/telemetry.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@
});
};

Evolution.prototype.sampleCounts = function () {
return this.map(histogram => histogram.count);
};

return Evolution;
})();

Expand Down

0 comments on commit a7123b2

Please sign in to comment.