mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-08 18:48:12 +08:00
show all categorical options filter button
This commit is contained in:
@@ -16,6 +16,12 @@ class Category extends React.Component {
|
|||||||
colorAccessor: this.props.metadataField
|
colorAccessor: this.props.metadataField
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
toggleAll() {
|
||||||
|
this.props.dispatch({
|
||||||
|
type: "categorical metadata filter all of these",
|
||||||
|
metadataField: this.props.metadataField
|
||||||
|
})
|
||||||
|
}
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div style={{
|
<div style={{
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ const updateCellSelectionMiddleware = (store) => {
|
|||||||
action.type === "graph brush deselect" ||
|
action.type === "graph brush deselect" ||
|
||||||
action.type === "categorical metadata filter deselect" ||
|
action.type === "categorical metadata filter deselect" ||
|
||||||
action.type === "categorical metadata filter select" ||
|
action.type === "categorical metadata filter select" ||
|
||||||
action.type === "categorical metadata filter only this"
|
action.type === "categorical metadata filter only this" ||
|
||||||
|
action.type === "categorical metadata filter all of these"
|
||||||
;
|
;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -158,8 +159,19 @@ const updateCellSelectionMiddleware = (store) => {
|
|||||||
...s.controls.categoricalAsBooleansMap,
|
...s.controls.categoricalAsBooleansMap,
|
||||||
[action.metadataField]: metadataFieldWithOnlyThisValueSelected
|
[action.metadataField]: metadataFieldWithOnlyThisValueSelected
|
||||||
}
|
}
|
||||||
console.log('within', metadataFieldWithOnlyThisValueSelected)
|
|
||||||
|
|
||||||
|
} else if (action.type === "categorical metadata filter all of these") {
|
||||||
|
const metadataFieldWithAllOfTheseValueSelected = {};
|
||||||
|
|
||||||
|
/* set EVERYTHING to false in this intermediate object */
|
||||||
|
_.each(s.controls.categoricalAsBooleansMap[action.metadataField], (isActive, option) => {
|
||||||
|
metadataFieldWithAllOfTheseValueSelected[option] = true;
|
||||||
|
})
|
||||||
|
|
||||||
|
newCategoricalAsBooleansMap = {
|
||||||
|
...s.controls.categoricalAsBooleansMap,
|
||||||
|
[action.metadataField]: metadataFieldWithAllOfTheseValueSelected
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const inactiveCategories = [];
|
const inactiveCategories = [];
|
||||||
|
|||||||
Vendored
+5
@@ -94,6 +94,11 @@ const Controls = (state = {
|
|||||||
categoricalAsBooleansMap: action.newCategoricalAsBooleansMap, /* this comes from middleware */
|
categoricalAsBooleansMap: action.newCategoricalAsBooleansMap, /* this comes from middleware */
|
||||||
currentCellSelection: action.newSelection /* this comes from middleware */
|
currentCellSelection: action.newSelection /* this comes from middleware */
|
||||||
})
|
})
|
||||||
|
case "categorical metadata filter all of these":
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
categoricalAsBooleansMap: action.newCategoricalAsBooleansMap, /* this comes from middleware */
|
||||||
|
currentCellSelection: action.newSelection /* this comes from middleware */
|
||||||
|
})
|
||||||
/*******************************
|
/*******************************
|
||||||
Color Scale
|
Color Scale
|
||||||
*******************************/
|
*******************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user