user1403546
user1403546

Reputation: 1749

cytoscape : how to disable node and edge selection?

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

Answers (1)

Stephan T.
Stephan T.

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

Related Questions