mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-25 05:58:13 +08:00
Dataframe (#576)
* initial dataframe commit * initial dataframe port of core app * rename variables for clarity * remove unused import * comment out unused code * fix array handling bug in crossfilter dimension creation * allow creation of empty dataframes * handle non-existent columns * handle non-existent columns * revise tests for new dataframe * comments for clarity * comments for clarity * generate bulk add placeholder with real gene names * fix bug in gene name adding * more dataframe unit tests * fix bug - subset from current world, not universe * put cut and pasted code into a single function * improve caching of crossfilter * remove cascading update bug from graph * more performance work * improve state handling for scatterplot * performance optimization of critical path * add column summarization * dataframe utils * add callOnceLazy * fix tests * minor updates found during review * fix misspelling * remove RESTv02 from function names * comment cleanup * cut/icut col parameter defaults to null * break up large test * improve tests and comments on dataframe at/has functions
This commit is contained in:
@@ -41,13 +41,13 @@ const updateCellColorsMiddleware = store => next => action => {
|
||||
action.type === "color by continuous metadata" ||
|
||||
action.type === "color by categorical metadata";
|
||||
|
||||
if (!filterJustChanged || !s.controls.world.obsAnnotations) {
|
||||
const obsAnnotations = _.get(s.controls, "world.obsAnnotations", null);
|
||||
if (!filterJustChanged || !obsAnnotations) {
|
||||
return next(
|
||||
action
|
||||
); /* if the cells haven't loaded or the action wasn't a color change, bail */
|
||||
}
|
||||
|
||||
const { obsAnnotations } = s.controls.world;
|
||||
let colorScale;
|
||||
const colorsByRGB = new Array(obsAnnotations.length);
|
||||
|
||||
@@ -73,9 +73,9 @@ const updateCellColorsMiddleware = store => next => action => {
|
||||
});
|
||||
|
||||
const key = action.colorAccessor;
|
||||
const col = obsAnnotations.col(key).asArray();
|
||||
for (let i = 0, len = obsAnnotations.length; i < len; i += 1) {
|
||||
const obs = obsAnnotations[i];
|
||||
const cat = obs[key];
|
||||
const cat = col[i];
|
||||
colorsByRGB[i] = colors[cat];
|
||||
}
|
||||
}
|
||||
@@ -96,8 +96,9 @@ const updateCellColorsMiddleware = store => next => action => {
|
||||
|
||||
const key = action.colorAccessor;
|
||||
const nonFiniteColor = parseRGB(globals.nonFiniteCellColor);
|
||||
const col = obsAnnotations.col(key).asArray();
|
||||
for (let i = 0, len = obsAnnotations.length; i < len; i += 1) {
|
||||
const val = obsAnnotations[i][key];
|
||||
const val = col[i];
|
||||
if (Number.isFinite(val)) {
|
||||
const c = colorScale(val);
|
||||
colorsByRGB[i] = colors[c];
|
||||
|
||||
Reference in New Issue
Block a user