mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-03 15:48:11 +08:00
fix color-by regression in toggle (#705)
* fix color-by regression in toggle * fix incorrect field reference
This commit is contained in:
@@ -55,11 +55,11 @@ const ColorsReducer = (
|
|||||||
const { world } = prevSharedState;
|
const { world } = prevSharedState;
|
||||||
|
|
||||||
/* toggle between this mode and reset */
|
/* toggle between this mode and reset */
|
||||||
const colorMode = action.type !== state.colorMode ? action.type : null;
|
const resetCurrent =
|
||||||
const colorAccessor =
|
action.type === state.colorMode &&
|
||||||
action.colorAccessor !== state.colorAccessor && colorMode !== null
|
action.colorAccessor === state.colorAccessor;
|
||||||
? action.colorAccessor
|
const colorMode = !resetCurrent ? action.type : null;
|
||||||
: null;
|
const colorAccessor = !resetCurrent ? action.colorAccessor : null;
|
||||||
|
|
||||||
const { rgb, scale } = createColors(world, colorMode, colorAccessor);
|
const { rgb, scale } = createColors(world, colorMode, colorAccessor);
|
||||||
return {
|
return {
|
||||||
@@ -75,11 +75,10 @@ const ColorsReducer = (
|
|||||||
const { world } = prevSharedState;
|
const { world } = prevSharedState;
|
||||||
|
|
||||||
/* toggle between this mode and reset */
|
/* toggle between this mode and reset */
|
||||||
const colorMode = action.type !== state.colorMode ? action.type : null;
|
const resetCurrent =
|
||||||
const colorAccessor =
|
action.type === state.colorMode && action.gene === state.colorAccessor;
|
||||||
action.gene !== state.colorAccessor && coorMode !== null
|
const colorMode = !resetCurrent ? action.type : null;
|
||||||
? action.gene
|
const colorAccessor = !resetCurrent ? action.gene : null;
|
||||||
: null;
|
|
||||||
|
|
||||||
const { rgb, scale } = createColors(world, colorMode, colorAccessor);
|
const { rgb, scale } = createColors(world, colorMode, colorAccessor);
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user