Skip to content
maxkfranz edited this page Nov 30, 2011 · 1 revision

nodes.lock()

Lock the nodes in place so they can not be moved.

nodes.lock()

Locks the nodes

Details

A node that is locked can not be grabbed by the user to be moved, nor can a locked node be moved programmatically or by running a layout.

To make a graph that is static, you can lock all nodes as they are added:

cy.add( someArrayOfNodes );
cy.nodes().lock();

Alternatively, you could use the locked initialisation field in the element object.

Examples

cy.nodes().lock(); // lock all nodes

Clone this wiki locally