Skip to content

Commit ee3e78b

Browse files
Change onPan and onZoom delta and amounts to be { x: number, y: number } objects, because they are never numbers.
1 parent 078c5bc commit ee3e78b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/options.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { Chart, Color, Point } from 'chart.js'
2-
import type { PanAmount, ZoomAmount } from './types'
32

43
export type Mode = 'x' | 'y' | 'xy'
54
export type ModeFn = (context: { chart: Chart }) => Mode
@@ -122,7 +121,7 @@ export interface ZoomOptions {
122121
/**
123122
* Function called while the user is zooming
124123
*/
125-
onZoom?: (context: { chart: Chart; trigger: ZoomTrigger; amount?: ZoomAmount }) => void
124+
onZoom?: (context: { chart: Chart; trigger: ZoomTrigger; amount?: { x: number, y: number } }) => void
126125

127126
/**
128127
* Function called once zooming is completed
@@ -174,7 +173,7 @@ export interface PanOptions {
174173
/**
175174
* Function called while the user is panning
176175
*/
177-
onPan?: (context: { chart: Chart; trigger: PanTrigger; delta: PanAmount }) => void
176+
onPan?: (context: { chart: Chart; trigger: PanTrigger; delta: { x: number, y: number } }) => void
178177

179178
/**
180179
* Function called once panning is completed

0 commit comments

Comments
 (0)