plotly / react-plotly.js

A plotly.js React component from Plotly 📈
MIT License
1.01k stars 136 forks source link

OnBeforeHover returns just an event rather than datapoints and an event #259

Open TheLogan opened 3 years ago

TheLogan commented 3 years ago

The title really says it all. I've attempted to set up an example in codePen (taking my code and boiling it down), however, the older versions didn't even call OnBeforeHover so I tried updating the versions, but I'm not at all familiar with the way in which scripts are loaded in via HTML tags, I think I've done it correctly, however, I have access to neither createPlotlyComponent nor plotComponentFactory in my code.

https://codepen.io/tim-logan/pen/NWgbBvr?editors=1010

I'm attempting to get enough data to make the hover only be active near the line rather than the entire fill, but it's a lot harder if I only have the mouse event.

Oh, and just for clarity, what I get out is NOT

{
  event: mouseEvent,
  points: [] /undefined etc
  ...
}

What I get out is just

event: mouseEvent

(The type definitions claims I should get the first out though)