@tanstack/charts
Version:
<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/api/readme/charts.png?theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/
13 lines (12 loc) • 373 B
JavaScript
function quantileSortedValues(values, probability) {
if (!values.length) return Number.NaN;
const position = (values.length - 1) * probability;
const lower = Math.floor(position);
const upper = Math.ceil(position);
const start = values[lower];
const end = values[upper];
return start + (end - start) * (position - lower);
}
export {
quantileSortedValues
};