You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe/explain the bug
When using event handlers like onMouseMove, onMouseEnter and so on with for example the <ResponsiveLine>, the return type of the callback parameters is (point: Point, event: React.MouseEvent) => void in TypeScript. But these types are wrong, since in runtime, the actual type you get is (slice: Slice, event: React.MouseEvent) => void. So instead of getting just one point, you get the whole slice object, including the points: Point[] array.
Not sure if it's only for the line chart or others also.
I also discovered that onTouchMove always returns the same slice, no matter where the finger is touching the chart. onMouseMove works perfectly fine and returns the exact slice the user hovers over. Is this by design?
Describe/explain the bug
When using event handlers like
onMouseMove
,onMouseEnter
and so on with for example the<ResponsiveLine>
, the return type of the callback parameters is(point: Point, event: React.MouseEvent) => void
in TypeScript. But these types are wrong, since in runtime, the actual type you get is(slice: Slice, event: React.MouseEvent) => void
. So instead of getting just one point, you get the wholeslice
object, including thepoints: Point[]
array.Not sure if it's only for the line chart or others also.
To Reproduce
Steps to reproduce the behavior:
<ResponsiveLine data={...} onMouseMove={(...params) => { console.log(params) }} />
Expected behavior
Types match
The text was updated successfully, but these errors were encountered: