-
-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fit to node canvas util #258
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for reaflow ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
return [scrollX, scrollY]; | ||
}; | ||
|
||
export const getNodesBoundingBox = (nodes: LayoutNodeData[]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add some comments here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great - one minor tweak to api and its good to go
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
There's no way to fit / focus the view on a specific node, only on the entire canvas
What is the new behavior?
use
fitToNode()
fromCanvasRef
to zoom and center the viewport on a specific nodeDoes this PR introduce a breaking change?
Other information
Screen.Recording.2024-07-08.at.4.18.39.PM.mov
Screen.Recording.2024-07-08.at.4.13.22.PM.mov