resetting interface spinner but locked interface (#555)

This commit is contained in:
Colin Megill
2019-01-16 03:36:35 -05:00
committed by GitHub
parent 394da40bea
commit a42c9aca1c
2 changed files with 22 additions and 3 deletions
+13 -2
View File
@@ -22,7 +22,8 @@ import scaleLinear from "../../util/scaleLinear";
responsive: state.responsive, responsive: state.responsive,
colorRGB: _.get(state.controls, "colorRGB", null), colorRGB: _.get(state.controls, "colorRGB", null),
opacityForDeselectedCells: state.controls.opacityForDeselectedCells, opacityForDeselectedCells: state.controls.opacityForDeselectedCells,
selectionUpdate: _.get(state.controls, "crossfilter.updateTime", null) selectionUpdate: _.get(state.controls, "crossfilter.updateTime", null),
resettingInterface: state.controls.resettingInterface
})) }))
class Graph extends React.Component { class Graph extends React.Component {
constructor(props) { constructor(props) {
@@ -339,11 +340,20 @@ class Graph extends React.Component {
resetInterface() { resetInterface() {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({
type: "interface reset started"
});
dispatch(actions.resetInterface()); dispatch(actions.resetInterface());
} }
render() { render() {
const { dispatch, responsive, crossfilter } = this.props; const {
dispatch,
responsive,
crossfilter,
resettingInterface
} = this.props;
const { mode } = this.state; const { mode } = this.state;
return ( return (
<div id="graphWrapper"> <div id="graphWrapper">
@@ -392,6 +402,7 @@ class Graph extends React.Component {
/* world && universe ? worldEqUniverse(world, universe) : false */ /* world && universe ? worldEqUniverse(world, universe) : false */
} }
type="button" type="button"
loading={resettingInterface}
intent="warning" intent="warning"
style={{ marginRight: 10 }} style={{ marginRight: 10 }}
onClick={this.resetInterface.bind(this)} onClick={this.resetInterface.bind(this)}
+9 -1
View File
@@ -122,6 +122,7 @@ const Controls = (
colorAccessor: null, colorAccessor: null,
colorScale: null, colorScale: null,
resettingInterface: false,
opacityForDeselectedCells: 0.2, opacityForDeselectedCells: 0.2,
graphBrushSelection: null, graphBrushSelection: null,
@@ -228,7 +229,8 @@ const Controls = (
categoricalSelectionState, categoricalSelectionState,
crossfilter, crossfilter,
dimensionMap, dimensionMap,
colorAccessor: null colorAccessor: null,
resettingInterface: false
}; };
} }
case "set World to current selection": { case "set World to current selection": {
@@ -525,6 +527,12 @@ const Controls = (
graphRenderCounter: c graphRenderCounter: c
}; };
} }
case "interface reset started": {
return {
...state,
resettingInterface: true
};
}
/******************************* /*******************************
Categorical metadata Categorical metadata
*******************************/ *******************************/