Skip to content
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

Option to pan on trackpad 2-finger scroll, zoom on pinch #453

Open
sam-btrt opened this issue Apr 3, 2023 · 1 comment
Open

Option to pan on trackpad 2-finger scroll, zoom on pinch #453

sam-btrt opened this issue Apr 3, 2023 · 1 comment

Comments

@sam-btrt
Copy link

sam-btrt commented Apr 3, 2023

Thank you for taking the time to report an issue with react-d3-tree!

Feel free to delete any questions that do not apply.

Are you reporting a bug, or opening a feature request?

Feature request
I'd be happy to contribute a PR if the requirements and outline implementation are agreed.

What is the actual behavior/output?

If zooming is enabled, it's triggered by scrolling. On a trackpad a 2-finger vertical scroll gesture triggers zoom in/out. 2-finger horizontal scroll does nothing. Pinch gesture also controls zoom. The only way to pan is with click and drag.

What is the behavior/output you expect?

It would be great to be able to emulate the behavior of popular whiteboard canvas tools like figma, miro etc. where 2-finger gesture pans and pinch zooms. Perhaps in this mode click and drag would no longer pan, and instead e.g. could be used to select multiple nodes within a selection rectangle, or whatever custom behavior was desired.

Perhaps this could be a simple boolean or enum prop field to toggle between different preset behaviors, or perhaps it would be better implemented as callback functions to optionally override parts of the zoom handler with arbitrary logic?

What version of react-d3-tree are you using?

3.5.1

@jp1357
Copy link

jp1357 commented Jun 9, 2023

On my trackpad this is already working like that. I think this is more a trackpad related thing - on my old laptop it's not working like that, but my newest laptop it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants