How do I calculate the camera state to zoom to a selection of nodes in the graph #1461
Answered
by
jacomyal
benny-noumena
asked this question in
Q&A
|
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 |
Answered by
jacomyal
Sep 23, 2024
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 |
1 reply
|
Hi @benny-noumena, You can now use the |
5 replies
Answer selected by
jacomyal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @benny-noumena,
You can now use the
fitViewportToNodeshelper from the new @sigma/utils package.You can try it in this story.