diff --git a/src/reducers/cells.js b/src/reducers/cells.js index c17ee6d4..57c79044 100644 --- a/src/reducers/cells.js +++ b/src/reducers/cells.js @@ -1,9 +1,11 @@ // jshint esversion: 6 const Cells = ( state = { - cells: null, + cells: null /* world */, loading: null, - error: null + error: null, + + allCells: null /* this comes from cells endpoint, this is universe */ }, action ) => { @@ -17,13 +19,20 @@ const Cells = ( return Object.assign({}, state, { error: null, 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": return Object.assign({}, state, { loading: false, error: action.data }); + case "reset graph": + return Object.assign({}, state, { + cells: state.allCells + }); default: return state; } diff --git a/src/reducers/controls.js b/src/reducers/controls.js index b6796f54..c328e622 100644 --- a/src/reducers/controls.js +++ b/src/reducers/controls.js @@ -103,6 +103,7 @@ const Controls = ( allGeneNames: null, allCells: null /* this comes from cells endpoint, this is 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. */ cellsMetadata: null,