xyflow / xyflow

React Flow | Svelte Flow - Powerful open source libraries for building node-based UIs with React (https://reactflow.dev) or Svelte (https://svelteflow.dev). Ready out-of-the-box and infinitely customizable.
https://xyflow.com
MIT License
21.54k stars 1.43k forks source link

Add "Reset zoom to 1" button as part of `Controls` #4225

Closed mcmxcdev closed 2 weeks ago

mcmxcdev commented 2 weeks ago

Please describe the feature that you want to propose

Currently when doing updates on a canvas, inspected elements show scaled dimensions based on zoom level rather than their intrinsic ones. Being able to reset the view quickly would be very helpful.

Browsers also allow zooming in and out and reset the zoom level with e.g. Strg+0 keyboard shortcut.

This functionality could be easily added disabled by default and configurable same like e.g. showFitView is currently.

moklick commented 2 weeks ago

Hey @mcmxcdev

we had a lot of question about additional buttons for the controls. We decided to keep it simple but export a ControlButton component and the possibility to add buttons to the existing controls via slots.