Skip to content

Commit

Permalink
[histograms] Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcavallaro committed Jul 2, 2020
1 parent a9fa7d0 commit a63d641
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions histograms.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,6 @@

const percentileFormatter = d3.format(".2f");

const calculatePercentileX = function(p) {
return function(data) {
const sum = data.reduce(function(acc, val) {
return acc + val.y;
}, 0);
const goal = p * sum;
var cur = 0;
for (i = 0; i < data.length; i++) {
cur += data[i].y;
if (cur >= goal) return data[i].x;
}
return data[data.length-1].x;
}
}

const calculateCumulativePercentiles = function(data) {
const sum = data.reduce(function(acc, val) {
return acc + val.y;
Expand All @@ -137,7 +122,6 @@
return cumulative;
}


const InitialDrawing = function(selector, xMax) {
var x = d3.scale.linear()
.domain([0, xMax])
Expand Down

0 comments on commit a63d641

Please sign in to comment.