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.
How to control the zoom in/out accuracy in Cytoscape.js
Asked Answered
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).
Thx, @tangevin, it seems that i haven't read the doc carefully. –
Pare
WARNING: You can modify this value, but be advised the default has been tested to work well and consistently across OSes and browsers. Probably your mouse has poor scroll resolution, so any scroll experience on the web will not be good with it. If you adjust the sensitivity to work well on your particular mouse, you will make zooming painfully slow for users with average mice. A better solution is to use the panzoom extension. You can just use the (+) and (-) buttons so users with bad scroll resolution can control zoom finely by holding the mouse button. –
Spinode
@Spinode default shows different results on different machines using chrome. On one computer it was increasing by one . On another machine it zoomed all at once –
Tourneur
Your machines must have vastly different scroll wheel sensitivities in your OS settings. The default value works well on lots of different (mainstream) mice on Mac, Linux (openSUSE and Ubuntu definitely), and Windows when the default system setting value is used. –
Spinode
@Spinode is there a way to arrange this with Javascript? For example, cy.style().width() is arrangable but I don't know how to do it with wheel sensitvity. –
Firebug
© 2022 - 2024 — McMap. All rights reserved.