Skip to content

Fit graph function #1466

Answered by jacomyal
mdre asked this question in Q&A
Sep 16, 2024 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

OK, it's more clear now, thanks.

In your case, if you delete the custom bounding box, sigma will go back to its default behavior, which is "fit the graph to the viewport". So you could try something like this in your code:

function resetView() {
  sigma.setCustomBBox(null);
  sigma.getCamera().setState({ x: 0.5, y: 0.5, ratio: 1 });
  sigma.refresh();
}

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@mdre
Comment options

@jacomyal
Comment options

Answer selected by jacomyal
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants