Command manager: is it possible to undo specific command? #2617
-
IntroductionI need to undo changes made to a graph when errors are received from the backend (BE). Here's my scenario:
In response to these errors, I need to first undo the changes made by the first connection and then address the second one. Is it possible to do something like that? Steps to reproduceNo response Restrictions & ConstraintsNo response Does your question relate to JointJS or JointJS+. Select both if applicable.JointJS, JointJS+ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, you cannot use the command manager this way. It's not possible to undo a specific command because one operation can affect subsequent operations. For instance, consider an This scenario highlights the complexity that can be addressed by operational transformation (OT) techniques. Although OT provides a general solution, if your specific requirement is limited to undoing link reconnection operations, a simpler solution may suffice. |
Beta Was this translation helpful? Give feedback.
No, you cannot use the command manager this way. It's not possible to undo a specific command because one operation can affect subsequent operations.
For instance, consider an
add
operation followed by achange:color
operation. If you undo theadd
operation, it removes the associated node. However, thechange:color
operation remains in the undo stack, referencing a node that no longer exists.This scenario highlights the complexity that can be addressed by operational transformation (OT) techniques. Although OT provides a general solution, if your specific requirement is limited to undoing link reconnection operations, a simpler solution may suffice.