Is pickable: false the correct approach for locking nodes/links during real-time collaboration?

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!

Yes, I would set all the “…able” properties to false, rather than rely on pickable. Pickable would work for many tools, but probably not all. If something was already selected and copied, for instance, and then it was “locked” and a user tried to paste, pickable would not stop the paste.

We do have a GoJS with Yjs demo, which may be interesting for you to study, that we could publish soon.