@@ -12,8 +12,6 @@ import {getClosestPoints} from '../../utils/chart/get-closest-data';
1212
1313import type { useChartInnerState } from './useChartInnerState' ;
1414
15- const THROTTLE_DELAY = 50 ;
16-
1715type ChartInnerState = ReturnType < typeof useChartInnerState > ;
1816
1917type Props = {
@@ -29,6 +27,7 @@ type Props = {
2927 unpinTooltip : ChartInnerState [ 'unpinTooltip' ] ;
3028 xAxis : PreparedAxis ;
3129 yAxis : PreparedAxis [ ] ;
30+ tooltipThrottle : number ;
3231} ;
3332
3433export function useChartInnerHandlers ( props : Props ) {
@@ -45,6 +44,7 @@ export function useChartInnerHandlers(props: Props) {
4544 unpinTooltip,
4645 xAxis,
4746 yAxis,
47+ tooltipThrottle,
4848 } = props ;
4949
5050 const isOutsideBounds = React . useCallback (
@@ -96,7 +96,7 @@ export function useChartInnerHandlers(props: Props) {
9696
9797 const throttledHandleMouseMove = IS_TOUCH_ENABLED
9898 ? undefined
99- : throttle ( handleMouseMove , THROTTLE_DELAY ) ;
99+ : throttle ( handleMouseMove , tooltipThrottle ) ;
100100
101101 const handleMouseLeave : React . MouseEventHandler < SVGSVGElement > = ( event ) => {
102102 if ( tooltipPinned ) {
@@ -115,7 +115,7 @@ export function useChartInnerHandlers(props: Props) {
115115 } ;
116116
117117 const throttledHandleTouchMove = IS_TOUCH_ENABLED
118- ? throttle ( handleTouchMove , THROTTLE_DELAY )
118+ ? throttle ( handleTouchMove , tooltipThrottle )
119119 : undefined ;
120120
121121 const handleChartClick = ( event : React . MouseEvent < SVGSVGElement > ) => {
0 commit comments