mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-18 18:38:11 +08:00
rename to createVarDimension
This commit is contained in:
5
client/src/reducers/controls.js
vendored
5
client/src/reducers/controls.js
vendored
@@ -121,11 +121,9 @@ const Controls = (
|
||||
universe,
|
||||
crossfilter,
|
||||
dimensionMap,
|
||||
dimensionMapVar
|
||||
} = state;
|
||||
let universeVarDataCache = universe.varDataCache;
|
||||
let worldVarDataCache = world.varDataCache;
|
||||
let _dimensionMapVar = dimensionMapVar;
|
||||
_.forEach(action.expressionData, (val, key) => {
|
||||
universeVarDataCache = kvCache.set(universeVarDataCache, key, val);
|
||||
if (kvCache.get(worldVarDataCache, key) === undefined) {
|
||||
@@ -138,7 +136,7 @@ const Controls = (
|
||||
});
|
||||
|
||||
_.forEach(action.expressionData, (val, key) => {
|
||||
dimensionMap[key] = World.createVarDimensionsMap(
|
||||
dimensionMap[key] = World.createVarDimension(
|
||||
world,
|
||||
worldVarDataCache,
|
||||
crossfilter,
|
||||
@@ -148,7 +146,6 @@ const Controls = (
|
||||
|
||||
return {
|
||||
...state,
|
||||
dimensionMapVar,
|
||||
universe: {
|
||||
...universe,
|
||||
varDataCache: universeVarDataCache
|
||||
|
||||
@@ -290,7 +290,7 @@ function deduceDimensionType(attributes, fieldName) {
|
||||
(it will not be garbage collected without this call)
|
||||
*/
|
||||
|
||||
export function createVarDimensionsMap(
|
||||
export function createVarDimension(
|
||||
world,
|
||||
_worldVarDataCache,
|
||||
crossfilter,
|
||||
@@ -298,10 +298,10 @@ export function createVarDimensionsMap(
|
||||
) {
|
||||
const { varDataCache, worldObsIndex } = world;
|
||||
const varData = _worldVarDataCache[geneName];
|
||||
const worldIndex = worldObsIndex ? idx => worldObsIndex[idx] : idx => idx; /* this results in NaN when implemented below as it was in the test code */
|
||||
const worldIndex = worldObsIndex ? idx => worldObsIndex[idx] : idx => idx;
|
||||
|
||||
return crossfilter.dimension(r => {
|
||||
return varData[r.__obsIndex__];
|
||||
return varData[worldIndex(r.__obsIndex__)];
|
||||
}, Float32Array);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user