xyflow / react-flow-docs-v9

Archived documentation of React Flow version 9. Powered by Gatsby.
https://v9.reactflow.dev
MIT License
31 stars 68 forks source link

Add smooth transition example #10

Closed hs0shin closed 3 years ago

hs0shin commented 3 years ago

Hey @moklick

I just made some example as I mentioned in #825

Code for zoom in and zoom out is seem to be clean enough

Can you make 'getTransformForBounds' as an API? Then I can make fit-view example as well.

This PR only includes smooth transition example for zoom-in/out

moklick commented 3 years ago

This is really cool thanks! Could you add another button like "pan to center (0,0,1)" for example? It would be cool to show a x/y transition, too. You could use rfInstance. setTransform for that

hs0shin commented 3 years ago

I added pan to center button :)

moklick commented 3 years ago

Thanks! I really like this example :) It's now live: https://reactflow.dev/examples/smooth-transition

If you find the time it would be cool if you could use another tween library since the Github page says: "This project development suspended due of no support from community and no financial support to author"