Skip to content

API reference

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

cy.wheelSensitivity — Core › Interaction controls

Preview · Core › Interaction controls

Read in the complete API reference · All API members

#cy.wheelSensitivity()

// Wheel-zoom sensitivity: a multiplier on the zoom-per-wheel-tick exponent (default 1)
cy.wheelSensitivity(): number

Wheel-zoom sensitivity: a multiplier on the zoom-per-wheel-tick exponent (default 1). Non-default values warn once per instance — a custom sensitivity tuned on one mouse/OS zooms unnaturally on others.

Returns number

the current wheelSensitivity value

Example

console.log(cy.wheelSensitivity()); // 1

Example graph and handle setup

#cy.wheelSensitivity(mult)

// Wheel-zoom sensitivity: a multiplier on the zoom-per-wheel-tick exponent (default 1)
cy.wheelSensitivity(mult: number): this

Wheel-zoom sensitivity: a multiplier on the zoom-per-wheel-tick exponent (default 1). Non-default values warn once per instance — a custom sensitivity tuned on one mouse/OS zooms unnaturally on others.

Parameters
NameDescription
mult: number

the multiplier to set

Returns this

this core, for chaining

Example

const result = cy.wheelSensitivity(1);
console.log(result === cy); // true

Example graph and handle setup

Throws

if mult is not a finite positive number (0 would freeze the zoom, so the bound is strict where the threshold setters allow 0)