Skip to content

API reference

cy.autolock — Core > Interaction controls. Cytoscape.js signatures, parameters and return contract.

cy.autolock — Core › Interaction controls

Preview · Core › Interaction controls

Read in the complete API reference · All API members

#cy.autolock()

// Read whether every node is locked (immovable) regardless of its own locked flag — the graph-wide override
cy.autolock(): boolean

Read whether every node is locked (immovable) regardless of its own locked flag — the graph-wide override. Turned on mid-tween, every running position tween holds where it got to, as a node locked mid-tween does.

Returns boolean

the current autolock value

Example

console.log(cy.autolock()); // false

Example graph and handle setup

#cy.autolock(bool)

// Set whether every node is locked (immovable) regardless of its own locked flag — the graph-wide override
cy.autolock(bool: boolean): this

Set whether every node is locked (immovable) regardless of its own locked flag — the graph-wide override. Turned on mid-tween, every running position tween holds where it got to, as a node locked mid-tween does.

Parameters
NameDescription
bool: boolean

the new setting

Returns this

this core, for chaining

Example

const result = cy.autolock(false);
console.log(result === cy); // true

Example graph and handle setup

Also spelled cy.autolockNodes.