stevenpetryk / mafs

React components for interactive math
https://mafs.dev
MIT License
3.23k stars 87 forks source link

Zooming #98

Closed stevenpetryk closed 1 year ago

stevenpetryk commented 1 year ago

Let's let people pinch that canvas!

Technologeek commented 1 year ago

Hey @stevenpetryk Thanks for this great lib! Can we create this feature using something like this package? Or should we roll out our own gestures logic?

stevenpetryk commented 1 year ago

@Technologeek you can definitely roll your own with that! (I personally would use @use-gesture/react as that's what Mafs already uses internally, but you do you). To adjust "zoom" you can change the Mafs viewBox options (make sure to also "zoom" the padding).

However, worth pointing out that I am planning on building this today during Hacky Hour on the Mafs Discord (feel free to join 😄)

Technologeek commented 1 year ago

Haha alright! I guess I will pick some other issue for the weekend duties. I will join indeed thanks!

stevenpetryk commented 1 year ago

@Technologeek v0.15.1 now has zooming (docs). Enjoy!