mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-04 06:58:12 +08:00
reset all cells on graph reset
This commit is contained in:
+12
-3
@@ -1,9 +1,11 @@
|
|||||||
// jshint esversion: 6
|
// jshint esversion: 6
|
||||||
const Cells = (
|
const Cells = (
|
||||||
state = {
|
state = {
|
||||||
cells: null,
|
cells: null /* world */,
|
||||||
loading: null,
|
loading: null,
|
||||||
error: null
|
error: null,
|
||||||
|
|
||||||
|
allCells: null /* this comes from cells endpoint, this is universe */
|
||||||
},
|
},
|
||||||
action
|
action
|
||||||
) => {
|
) => {
|
||||||
@@ -17,13 +19,20 @@ const Cells = (
|
|||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
error: null,
|
error: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
cells: action.data
|
cells: action.data, // most recently loaded cells
|
||||||
|
|
||||||
|
/* Universe - initialize once */
|
||||||
|
allCells: state.allCells ? state.allCells : action.data
|
||||||
});
|
});
|
||||||
case "request cells error":
|
case "request cells error":
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
loading: false,
|
loading: false,
|
||||||
error: action.data
|
error: action.data
|
||||||
});
|
});
|
||||||
|
case "reset graph":
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
cells: state.allCells
|
||||||
|
});
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -103,6 +103,7 @@ const Controls = (
|
|||||||
allGeneNames: null,
|
allGeneNames: null,
|
||||||
allCells: null /* this comes from cells endpoint, this is universe */,
|
allCells: null /* this comes from cells endpoint, this is universe */,
|
||||||
allCellsMetadata: null /* this comes from cells endpoint, and is just the metadata for universe */,
|
allCellsMetadata: null /* this comes from cells endpoint, and is just the metadata for universe */,
|
||||||
|
allCellsMetadataMap: null,
|
||||||
|
|
||||||
/* View / World - all cells currently being displayed. May be a subset of Universe. */
|
/* View / World - all cells currently being displayed. May be a subset of Universe. */
|
||||||
cellsMetadata: null,
|
cellsMetadata: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user