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

Allow separate zoom speeds for wheel and trackpad #1882

Open
TedDriggs opened this issue Oct 10, 2022 · 1 comment · May be fixed by #1972
Open

Allow separate zoom speeds for wheel and trackpad #1882

TedDriggs opened this issue Oct 10, 2022 · 1 comment · May be fixed by #1972

Comments

@TedDriggs
Copy link

Prior to this commit, vis-network worked well for our trackpad users and mousewheel users - zoom speed felt appropriate for both. Now, however, we're getting feedback that the speed is either too fast (from trackpad users) or too slow (from mousewheel users).

We could add a setting to our app for zoom speed, but we'd rather have the relationship between wheel speed and trackpad speed be fixed upstream. Two options appear to be:

  1. Detect which one is being used for scrolling and then adjust the zoom by some fixed coefficient
  2. Allow separate zoomSpeed settings for the two different scroll types.
@dannybloe
Copy link

dannybloe commented Jul 12, 2023

I think you should look at the y-delta in the mouse event and use that value. It is already directional. The value is much smaller on touchpads. We use this for our own application which does a similar thing. Works like a charm for both mouse and touchpad. No. need for separate speeds. The browser already took care of that.

Current code is just wrong.

TedDriggs pushed a commit to TedDriggs/vis-network that referenced this issue Jul 13, 2023
The current code ignores magnitude differences in deltaY, resulting in an experience that is either too fast on trackpad or too slow with a mousewheel.

This change allows those to differ within a clamped range, so that one zoomSpeed value works well for both input devices.

Fixes visjs#1882
@TedDriggs TedDriggs linked a pull request Jul 13, 2023 that will close this issue
TedDriggs pushed a commit to TedDriggs/vis-network that referenced this issue Mar 12, 2024
The current code ignores magnitude differences in deltaY, resulting in an experience that is either too fast on trackpad or too slow with a mousewheel.

This change allows those to differ within a clamped range, so that one zoomSpeed value works well for both input devices.

Fixes visjs#1882
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

Successfully merging a pull request may close this issue.

2 participants