Skip to content

[charts-pro] Zoom pointer improvements #17480

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

Draft
wants to merge 85 commits into
base: master
Choose a base branch
from

Conversation

JCQuintas
Copy link
Member

@JCQuintas JCQuintas commented Apr 21, 2025

Resolves #16205
Fixes #16549
Fixes #16660
Supersedes #17000

Difference from the other PR

This uses @web-gestures/core to recognise the gestures. I've made the lib from scratch, thinking about extensibility and using the native event emitter api.

It should be much lighter and extensible than anything else, though it is new. So bugs might be preset 😆

As I mentioned in one of our previous meeting. It would be nice to have it as part of MUI offering if we deem it a good to have. For now it stays as a separate project.

Main change (same as last PR)

Create a interaction listener plugin. This allows us to register events directly in the SVG.

The current implementation migrates most of the interactions to the schema below.

Screenshot 2025-03-19 at 22 40 10

Other changes

  • Divided the zoom behaviours into hooks implementing the usePanOnDrag, useZoomOnPinch and useZoomOnWheel hooks
  • Make the zoom panning a bit smarter by allowing users to scroll to the edge, and once the zoom can't change anymore, it allows scrolling the page instead.

@JCQuintas JCQuintas self-assigned this Apr 21, 2025
Copy link

github-actions bot commented Apr 21, 2025

Thanks for adding a type label to the PR! 👍

@JCQuintas JCQuintas added enhancement This is not a bug, nor a new feature component: charts This is the name of the generic UI component, not the React module! labels Apr 21, 2025
@mui-bot
Copy link

mui-bot commented Apr 21, 2025

Deploy preview: https://deploy-preview-17480--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 23c86ec

@JCQuintas JCQuintas changed the title Pointer events manual [charts-pro] Zoom pointer improvements Apr 21, 2025
Copy link

codspeed-hq bot commented Apr 21, 2025

CodSpeed Performance Report

Merging #17480 will not alter performance

Comparing JCQuintas:pointer-events-manual (23c86ec) with master (e9621d6)

Summary

✅ 8 untouched benchmarks

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 22, 2025
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature
Projects
None yet
2 participants