mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-25 03:18:11 +08:00
run prettier(2.0.5) (#1438)
This commit is contained in:
@@ -15,15 +15,15 @@ Arguments:
|
||||
import { sortArray } from "./typedCrossfilter/sort";
|
||||
|
||||
export default function quantile(quantArr, tarr, sorted = false) {
|
||||
/*
|
||||
/*
|
||||
start with the naive (sort) implementation. Later, use a faster partition
|
||||
*/
|
||||
const arr = sorted ? tarr : sortArray(new tarr.constructor(tarr)); // copy
|
||||
const len = arr.length;
|
||||
return quantArr.map(q => {
|
||||
if (q === 1) {
|
||||
return arr[len - 1];
|
||||
}
|
||||
return arr[Math.floor(q * len)];
|
||||
});
|
||||
const arr = sorted ? tarr : sortArray(new tarr.constructor(tarr)); // copy
|
||||
const len = arr.length;
|
||||
return quantArr.map((q) => {
|
||||
if (q === 1) {
|
||||
return arr[len - 1];
|
||||
}
|
||||
return arr[Math.floor(q * len)];
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user