mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-02 15:44:11 +01:00
9 lines
239 B
JavaScript
9 lines
239 B
JavaScript
// R-7 per <http://en.wikipedia.org/wiki/Quantile>
|
|
d3.quantile = function(values, p) {
|
|
var H = (values.length - 1) * p + 1,
|
|
h = Math.floor(H),
|
|
v = +values[h - 1],
|
|
e = H - h;
|
|
return e ? v + e * (values[h] - v) : v;
|
|
};
|