Open madebyfabian opened 2 months ago
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?
And is there a better way to get the current slice/points that is being hovered/touched over?
Not sure if this could be related with the type mismatch, if not, I can open a seperate issue.
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