-
Moved to new discussion. See here for more context: #1461 (reply in thread) Ah ok. I thought that was the case and this is actually helpful because it means I'm doing something to make the camera not bring all the nodes into view. Also, I'm happy to move this to a new discussion if that's helpful but I'll explain what I'm doing here. I have a graph that initially loads from the database and displays as expected with a forceAtlas2 worker running. I'm using react-sigma camera controls and specifically the reset function that calls I then implemented an expand function that is similar to the linkcurious expand shown here: https://doc.linkurious.com/user-manual/latest/expand/ The way I implemented expand is when I click on a node it executes a query and merges the results with the existing graph. Here's a simplified snippet of the code below:
After the expand or even dragging a node a node outside of the view what I was hoping to have is a button that would zoom in or out to fit the entire graph in the view. How would I go about doing that? I'm still new to sigma so my apologies if this is obvious. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Is it possible for you to send us a reproducible use case, using the CodeSandbox template? Also, I have an idea about what could explain your issue: Do you call |
Beta Was this translation helpful? Give feedback.
-
OK, I get it, that's where your issue comes from: When you call Unfortunately, the Good catch! I'll create a new bug ticket about that specific bug. Until I find time to address it, you can try to reset the custom bounding box before calling Thanks for the report! |
Beta Was this translation helpful? Give feedback.
Hi, glad to see you've made progress!
Meanwhile, I've found some time to solve #1472 (there was indeed some issues to solve), so you can probably upgrade
@sigma/utils
version to3.0.0-beta.4
, and usefitViewportToNodes
without resetting the custom bounding box. I hope it will work as you expect it.