Reputation: 1749
How can I disable some nodes/edges in a cytoscape.js graph to be selected? the 'unselectable: true' option doesn't work. Can anyone link a working example?
Thanks
Upvotes: 4
Views: 2984
Reputation: 6074
You can prevent the user from grabbing or moving a node or lock the nodes position:
If you want to lock the node, use this: nodes.lock()
If you want to make the node ungrabbable, use this: nodes.ungrabify()
If your goal is to make the nodes not selectable, you can always use the function provided by Cytoscape:
Enable:
cy.autounselectify( true );
Disable:
cy.autounselectify( false );
I really can't find anything about unselectable: true
, did you confuse it with the :unselectable
state from here?
Upvotes: 2