equal
deleted
inserted
replaced
|
1 // R-7 per <http://en.wikipedia.org/wiki/Quantile> |
|
2 d3.quantile = function(values, p) { |
|
3 var H = (values.length - 1) * p + 1, |
|
4 h = Math.floor(H), |
|
5 v = values[h - 1], |
|
6 e = H - h; |
|
7 return e ? v + e * (values[h] - v) : v; |
|
8 }; |