We are implementing real-time collaboration in our diagramming application. As part of this, When User A selects and starts editing a node or link, we need to lock that graph object for all other users so they cannot interact with it until User A releases it. For those locked parts, we want them to become completely non-interactive for other users.
Our expected behavior for a locked node/link is:
-
The node/link should not be clickable/selectable.
-
Mouse enter/hover behavior should not trigger on the locked object.
-
The user should not be able to move/drag the locked node.
-
The user should not be able to delete the locked node/link using keyboard delete.
-
The user should not be able to draw a link from a locked node’s port.
-
The user should not be able to draw a link to a locked node’s port.
-
Custom actions such as replacing a node from the palette or dropping another node onto the locked node/link should also be avoided where possible.
We tried setting pickable: false on the locked node/GraphObjects, and it appears to work for many of our scenarios. The node becomes non-interactive, mouse enter does not fire, and keyboard delete is also blocked because the part cannot be selected.
I wanted to confirm whether pickable: false is the right approach for this use case, or whether there are any side effects we should be aware of.
Is pickable: false recommended when we want a locked node/link to be completely ignored by mouse/keyboard interactions? Or should we instead use a combination of properties like selectable, movable, deletable, copyable, fromLinkable, toLinkable, etc.?
Any guidance on the correct GoJS pattern for making RTC-locked parts read-only/non-interactive would be helpful.
Thanks!