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

Add isZoomingOrPanning method #823

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joshkel
Copy link
Contributor

@joshkel joshkel commented Jul 29, 2024

I'd like to ensure that browser click events don't trigger if the user is zooming or panning (similar to how Chart.js prevents its own click events from triggering if the user is zooming or panning). Adding a new isZoomingOrPanning method seems like the easiest solution.

@@ -225,3 +225,8 @@ export function isZoomedOrPanned(chart) {

return false;
}

export function isZoomingOrPanning(chart) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be called IsPanningOrDragging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thinking was, "zoom or pan" describes the plugin's two main pieces of functionality; its isZoomedOrPanned method therefore means, roughly, "has the plugin been activated"; so I called the new method isZoomingOrPanning to check "is the plugin currently being activated / manipulated."

I'm happy with isPanningOrDragging too - whatever makes the most sense for users of the library.

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