thechiselgroup / biomixer

BioMixer
http://bio-mixer.appspot.com/
16 stars 13 forks source link

Node Refocus and Undo System Not Working #400

Closed everbeek closed 10 years ago

everbeek commented 10 years ago

The node refocus feature (found in each node menu) doesn't work with the undo system. Try it and see.

I may need to re-implement the refocus to use a deletion set for all nodes other than the selected, followed by the existing code for re-doing the initial expansion from the new central node. This, plus using a Node Refocus breadcrumb, should do the trick.

everbeek commented 10 years ago

I am contemplating whether node refocusing should be undoable. I could make it easy for myself and trigger a whole page load. But I do imagine users wanting to refocus, then go back to where they were.

I have to think about the following: -node whitelisting -edge and node cached data (via REST caching and edge registry) [good] -global variable business (URL args, result of a refresh)

How do graph type changes behave currently? Oh, horribly! This is actually fixing both refocus and graph type changes.

everbeek commented 10 years ago

I have refactored and added classes to facilitate fixing refocus and allowing it to undo/redo. The term neighbourhood is fine, but the paths to root and mappings are disrupted. I have to fix those to continue.

Ok, that was due to typo during this work, plus an argument swap from earlier. Added stronger typing to the node data coming from REST. I will do this over time for other data too. It is a case where Typescript duck typing hits the spot!

Undoing the re-initializations does not work, but redoing does. Inspecting...

Swapped from full re-initialize to fetch method. Now I am having problems with removed edge source and target, which I also had before. manifestEdgesForNewNode() has a single edge being added with no target in the node id map...

Ok, made #410 to really fix this, but I am hacking it with the simple undefined check for the source and target nodes so I can finish this issue.

everbeek commented 10 years ago

Ok, back on topic. Fixed lack of undeleting action when we undo a re-init expansion. Ignore missing edges on redo, that's #410. Notably, do mapping->term->mapping, and all our edges are back.

The re-init expansions seem to be working, now to check if the refocus triggering of those is cool too.

Oh, central node gets special treatment from layouts...I will make that a separate bug (#411).

Looks like I have this as fixed as it can be given #410 is outstanding. So, clean up, commit, fix #410, then come back here for a second shot at it.

everbeek commented 10 years ago

The node refocus plays nicely with undo/redo now. Great!