Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control the zoom in/out accuracy in Cytoscape.js

I find that when zoom is enabled, each time I scroll the mouse wheel, the graph becomes too large or too small. Is it possible to control the zoom level, in order to get a proper graph size as we need? The zoom parameter seems not to work.

like image 423
yetisun Avatar asked Aug 24 '15 06:08

yetisun


Video Answer


1 Answers

You can use the wheelSensitivity parameter when initializing the graph.

From the "Rendering Options" section if this part of the docs:

wheelSensitivity : Changes the scroll wheel sensitivity when zooming. This is a multiplicative modifier. So, a value between 0 and 1 reduces the sensitivity (zooms slower), and a value greater than 1 increases the sensitivity (zooms faster).

like image 121
trangevi Avatar answered Oct 09 '22 23:10

trangevi