Closed touretzkyds closed 3 years ago
The current implementation actually does not have a vector arithmetic mode. The vector arithmetic pseudo-words are mixed in with vocab words. The arrows are only drawn if a valid "vector arithmetic words struct" (more precisely an Object) exists. I can add a mode in, although probably the transition between modes is more important than the actual mode state.
Yeah, maybe we don't need a "mode", but we need a way of making the arrows and node highlighting go away so the user can get back to doing the kind of things they were doing before they opened the vector arithmetic panel. I thought an easy way to do that was to respond to the user closing the panel, but I'm open to other solutions.
My implementation does the simple logic of just removing all analogy words stored in the demo and clearing the vector display when the tab is closed. The words added to the analogy input area are distinct from scatter words and are no longer available for use, so the words in the vector display (which overwrote whatever was there previously with vector arithmetic pseudo-words) should be erased too. Let me know if this logic sounds reasonable.
I tried it out, and it seems fine.
If we're in vector arithmetic mode we get these nice arrows between the A/B/C/D terms.
But what if we want to go back to regular mode? There doesn't seem to be any way of getting rid of the arrows once they're drawn.
I suggest that closing/collapsing the vector arithmetic section should clear the special color markings on A/B/C/D, delete the A+B and A+B-C nodes, and delete the arrows. We can leave the A/B/C/D vectors in the vector display and just zero out the vectors for A-B and A-B+C.