-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undo/Redo #17
Labels
Comments
We can use Vis.export() to help here. Likely a lot of code sharing between the representations for this and #7. |
arvind
added a commit
that referenced
this issue
Jan 28, 2014
Closed
kadamwhite
added a commit
that referenced
this issue
Mar 22, 2016
For #17, we need a history queue. Redux provides a [standard convention for tracking history](https://github.com/reactjs/redux/blob/master/docs/recipes/ImplementingUndoHistory.md), which we leverage via the [redux-undo](https://github.com/omnidan/redux-undo) library. Changes to `getIn` make the history state invisible to components if all they need to do is get the present value of a given property. To test, apply this diff or replicate these lines in the `store/index.js` file: ```diff diff --git a/src/js/store/index.js b/src/js/store/index.js index d2458e2..ae356cd 100644 --- a/src/js/store/index.js +++ b/src/js/store/index.js @@ -8,3 +8,7 @@ var configureStore = require('./configureStore'); * @type {Store} */ module.exports = configureStore(require('./defaultState')); + +window.undo = require('redux-undo').ActionCreators.undo; +window.redo = require('redux-undo').ActionCreators.redo; +window.store = module.exports; ``` You can then make a change (such as toggling open several layers), then run `store.dispatch(undo())` in the console several times to step backwards through time. **Remaining Issue:** This is what is happening at present when I toggle open the topmost group: ![image](https://cloud.githubusercontent.com/assets/442115/13963380/815299e8-f03b-11e5-80f9-39e6c09d082b.png) Events are stacking up, and we need to step through to identify why multiple actions are firing at once. This is why you need to undo() many times to see any change in the UI. Once this is resolved, each action should be granularly undoable and we can build a better interface for the history. LYRA-267
kadamwhite
added a commit
that referenced
this issue
Mar 28, 2016
For #17, we need a history queue. Redux provides a [standard convention for tracking history](https://github.com/reactjs/redux/blob/master/docs/recipes/ImplementingUndoHistory.md), which we leverage via the [redux-undo](https://github.com/omnidan/redux-undo) library. Changes to `getIn` make the history state invisible to components if all they need to do is get the present value of a given property. To test, apply this diff or replicate these lines in the `store/index.js` file: ```diff diff --git a/src/js/store/index.js b/src/js/store/index.js index d2458e2..ae356cd 100644 --- a/src/js/store/index.js +++ b/src/js/store/index.js @@ -8,3 +8,7 @@ var configureStore = require('./configureStore'); * @type {Store} */ module.exports = configureStore(require('./defaultState')); + +window.undo = require('redux-undo').ActionCreators.undo; +window.redo = require('redux-undo').ActionCreators.redo; +window.store = module.exports; ``` You can then make a change (such as toggling open several layers), then run `store.dispatch(undo())` in the console several times to step backwards through time. **Remaining Issue:** This is what is happening at present when I toggle open the topmost group: ![image](https://cloud.githubusercontent.com/assets/442115/13963380/815299e8-f03b-11e5-80f9-39e6c09d082b.png) Events are stacking up, and we need to step through to identify why multiple actions are firing at once. This is why you need to undo() many times to see any change in the UI. Once this is resolved, each action should be granularly undoable and we can build a better interface for the history. LYRA-267
kadamwhite
added a commit
that referenced
this issue
Mar 28, 2016
For #17, we need a history queue. Redux provides a [standard convention for tracking history](https://github.com/reactjs/redux/blob/master/docs/recipes/ImplementingUndoHistory.md), which we leverage via the [redux-undo](https://github.com/omnidan/redux-undo) library. Changes to `getIn` make the history state invisible to components if all they need to do is get the present value of a given property. To test, apply this diff or replicate these lines in the `store/index.js` file: ```diff diff --git a/src/js/store/index.js b/src/js/store/index.js index d2458e2..ae356cd 100644 --- a/src/js/store/index.js +++ b/src/js/store/index.js @@ -8,3 +8,7 @@ var configureStore = require('./configureStore'); * @type {Store} */ module.exports = configureStore(require('./defaultState')); + +window.undo = require('redux-undo').ActionCreators.undo; +window.redo = require('redux-undo').ActionCreators.redo; +window.store = module.exports; ``` You can then make a change (such as toggling open several layers), then run `store.dispatch(undo())` in the console several times to step backwards through time. **Remaining Issue:** This is what is happening at present when I toggle open the topmost group: ![image](https://cloud.githubusercontent.com/assets/442115/13963380/815299e8-f03b-11e5-80f9-39e6c09d082b.png) Events are stacking up, and we need to step through to identify why multiple actions are firing at once. This is why you need to undo() many times to see any change in the UI. Once this is resolved, each action should be granularly undoable and we can build a better interface for the history. LYRA-267
kadamwhite
added a commit
that referenced
this issue
Mar 31, 2016
For #17, we need a history queue. Redux provides a [standard convention for tracking history](https://github.com/reactjs/redux/blob/master/docs/recipes/ImplementingUndoHistory.md), which we leverage via the [redux-undo](https://github.com/omnidan/redux-undo) library. Changes to `getIn` make the history state invisible to components if all they need to do is get the present value of a given property. To test, apply this diff or replicate these lines in the `store/index.js` file: ```diff diff --git a/src/js/store/index.js b/src/js/store/index.js index d2458e2..ae356cd 100644 --- a/src/js/store/index.js +++ b/src/js/store/index.js @@ -8,3 +8,7 @@ var configureStore = require('./configureStore'); * @type {Store} */ module.exports = configureStore(require('./defaultState')); + +window.undo = require('redux-undo').ActionCreators.undo; +window.redo = require('redux-undo').ActionCreators.redo; +window.store = module.exports; ``` You can then make a change (such as toggling open several layers), then run `store.dispatch(undo())` in the console several times to step backwards through time. **Remaining Issue:** This is what is happening at present when I toggle open the topmost group: ![image](https://cloud.githubusercontent.com/assets/442115/13963380/815299e8-f03b-11e5-80f9-39e6c09d082b.png) Events are stacking up, and we need to step through to identify why multiple actions are firing at once. This is why you need to undo() many times to see any change in the UI. Once this is resolved, each action should be granularly undoable and we can build a better interface for the history. LYRA-267
kadamwhite
added a commit
that referenced
this issue
Apr 13, 2016
For #17, we need a history queue. Redux provides a [standard convention for tracking history](https://github.com/reactjs/redux/blob/master/docs/recipes/ImplementingUndoHistory.md), which we leverage via the [redux-undo](https://github.com/omnidan/redux-undo) library. Changes to `getIn` make the history state invisible to components if all they need to do is get the present value of a given property. To test, apply this diff or replicate these lines in the `store/index.js` file: ```diff diff --git a/src/js/store/index.js b/src/js/store/index.js index d2458e2..ae356cd 100644 --- a/src/js/store/index.js +++ b/src/js/store/index.js @@ -8,3 +8,7 @@ var configureStore = require('./configureStore'); * @type {Store} */ module.exports = configureStore(require('./defaultState')); + +window.undo = require('redux-undo').ActionCreators.undo; +window.redo = require('redux-undo').ActionCreators.redo; +window.store = module.exports; ``` You can then make a change (such as toggling open several layers), then run `store.dispatch(undo())` in the console several times to step backwards through time. **Remaining Issue:** This is what is happening at present when I toggle open the topmost group: ![image](https://cloud.githubusercontent.com/assets/442115/13963380/815299e8-f03b-11e5-80f9-39e6c09d082b.png) Events are stacking up, and we need to step through to identify why multiple actions are firing at once. This is why you need to undo() many times to see any change in the UI. Once this is resolved, each action should be granularly undoable and we can build a better interface for the history. LYRA-267
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: