mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-25 01:38:12 +08:00
* brush interactions with underlying dataframe updates improved * improve comment * reset selection state upon clip
36 lines
924 B
JavaScript
36 lines
924 B
JavaScript
import { makeContinuousDimensionName } from "../util/nameCreators";
|
|
|
|
const ContinuousSelection = (state = {}, action) => {
|
|
switch (action.type) {
|
|
case "reset World to eq Universe":
|
|
case "set clip quantiles": {
|
|
return {};
|
|
}
|
|
case "continuous metadata histogram start":
|
|
case "continuous metadata histogram brush":
|
|
case "continuous metadata histogram end": {
|
|
const name = makeContinuousDimensionName(
|
|
action.continuousNamespace,
|
|
action.selection
|
|
);
|
|
return {
|
|
...state,
|
|
[name]: action.range
|
|
};
|
|
}
|
|
case "continuous metadata histogram cancel": {
|
|
const name = makeContinuousDimensionName(
|
|
action.continuousNamespace,
|
|
action.selection
|
|
);
|
|
const { [name]: deletedField, ...newState } = state;
|
|
return newState;
|
|
}
|
|
default: {
|
|
return state;
|
|
}
|
|
}
|
|
};
|
|
|
|
export default ContinuousSelection;
|