You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to set the same maximum size for the nodes when zooming in using nodeReducer, but updating the size isn't working. Here is a sample of the code.
Sigma.js version : 3.0.0-beta.32
Graphology version : 0.25.4
Operating system: max os sonoma 14.6.1
Web browser: safari
Steps to reproduce
render topology
zoom in
Expected behavior : max size of node should be fixed as 4
Actual behavior : actual node size is keep growing as zooming in
Thanks for that report. There is one misunderstanding in your code: The node and edge reducers are not re-executed on camera updates. It is on purpose, though: Recalling the reducers means that sigma needs to reindex (or process, as we use internally, see the lifecycle doc) the data , which is expensive. Instead, when the camera is updated, sigma only needs to give to the WebGL programs the new camera position, and it remains quite efficient.
So, using the camera state in the reducers will not work as you expect.
I think the zoomToSizeRatioFunction setting might help you, though:
You can set zoomToSizeRatioFunction to () => 1, to get nodes and edges sizes remain unchanged when the user zooms in or out
You can set zoomToSizeRatioFunction to (x) => Math.max(1, x) to allow nodes and edges to shrink when the user zooms out, but they will not exceed their initial size when the user zooms in too much
I tried to set the same maximum size for the nodes when zooming in using nodeReducer, but updating the size isn't working. Here is a sample of the code.
Expected behavior : max size of node should be fixed as 4
Actual behavior : actual node size is keep growing as zooming in
sample code
The text was updated successfully, but these errors were encountered: