mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-25 09:38:11 +08:00
Clean up max-category front-end limit (#2347)
* remove topN category truncation from component rendering layer * clean up category item limit implementation * name change for clarity * fix snapshot * comments
This commit is contained in:
@@ -76,10 +76,13 @@ export function summarizeCategorical(col: any) {
|
||||
categoryCounts.set(val, curCount + 1);
|
||||
}
|
||||
}
|
||||
const sortedCategoryByCounts = new Map(
|
||||
[...categoryCounts.entries()].sort((a, b) => b[1] - a[1])
|
||||
);
|
||||
return {
|
||||
categorical: true,
|
||||
categories: [...categoryCounts.keys()],
|
||||
categoryCounts,
|
||||
numCategories: categoryCounts.size,
|
||||
categories: [...sortedCategoryByCounts.keys()],
|
||||
categoryCounts: sortedCategoryByCounts,
|
||||
numCategories: sortedCategoryByCounts.size,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user