How do I calculate the camera state to zoom to a selection of nodes in the graph #1461
-
Hi I would like to select a couple of nodes and then provide a method to zoom the camera so that the selected nodes are centered and all visible. In the end I think I need to set the cameras state So far I can calculate Thanks for any help! Ben |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
This is indeed a bit hard to do, so I'm planning to release it as a function exported from a new upcoming |
Beta Was this translation helpful? Give feedback.
-
Hi @benny-noumena, You can now use the |
Beta Was this translation helpful? Give feedback.
Hi @benny-noumena,
You can now use the
fitViewportToNodes
helper from the new @sigma/utils package.You can try it in this story.