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

Improve scroll consistency on diff devices #259

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

ghsteff
Copy link
Contributor

@ghsteff ghsteff commented Jul 9, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[x] Other... Please describe: Improvement

What is the current behavior?

Charts tend to zoom much faster on trackpads than mouse wheels (when using panType=drag)

What is the new behavior?

Chart zooming feels consistent across input devices

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

This determines zoom strength based off the amount of pixels in the scroll event delta's instead of the amount of scroll events sent (trackpads send alot of little scrolls, mouse wheels send fewer larger scrolls)

Copy link

vercel bot commented Jul 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
reaflow ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 6:21pm

Copy link

netlify bot commented Jul 9, 2024

Deploy Preview for reaflow ready!

Name Link
🔨 Latest commit e448827
🔍 Latest deploy log https://app.netlify.com/sites/reaflow/deploys/668ed10b7d36d40008953e30
😎 Deploy Preview https://deploy-preview-259--reaflow.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -86,11 +86,11 @@ export interface CanvasRef {
/**
* Zoom in on the canvas.
*/
zoomIn?: () => void;
zoomIn?: (zoomFactor: number) => void;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requiring a zoomFactor makes this a breaking change. could we default it to something so we don't have to break existing apis ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops yea that should be optional

@ghsteff ghsteff requested a review from amcdnl July 10, 2024 18:21
@amcdnl amcdnl merged commit 43e8616 into master Jul 11, 2024
7 checks passed
@amcdnl amcdnl deleted the Improve-scroll-on-all-devices branch July 11, 2024 11:11
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 this pull request may close these issues.

2 participants