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 onPanStart and onZoomStart callbacks #487

Merged
merged 4 commits into from
May 1, 2021
Merged

Conversation

kurkle
Copy link
Member

@kurkle kurkle commented May 1, 2021

Closes: #373
Closes: #276

  • add onPanStart / onZoomStart handlers, that can return false to cancel the action
  • add sample for limiting pan start to middle of chart
  • add tests
  • fix bug when delta is undefined
  • fix callback typings

@@ -45,6 +45,7 @@ const chart = new Chart('id', {
| `onPan` | `{chart}` | Called while the chart is being panned
| `onPanComplete` | `{chart}` | Called once panning is completed
| `onPanRejected` | `{chart,event}` | Called when panning is rejected due to missing modifier key. `event` is the a [hammer event](https://hammerjs.github.io/api#event-object) that failed
| `onPanStart` | `{chart,event,point}` | Called when panning is about to start. If this callback returns true, panning is aborted and `onPanRejected` is invoked
Copy link
Member

Choose a reason for hiding this comment

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

In the core we use return false to abort, should we be consistent here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point

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