plotly / react-plotly.js

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

onLegendClick gives wrong state #297

Open Manubi opened 1 year ago

Manubi commented 1 year ago

Hi, I've some wired problems when trying to work with the data from onLegendClick. First example: The two data sources (Beningn, Others) don't have the same properties as the visible is missing in Benign. CleanShot 2022-10-12 at 11 54 54 Only if the Benign property got clicked once the visible property get's added.

Second example: When I click the legend I always get the data from the second last render. Meaning if I've just clicked on the legend I'll get the data from the second last render instead of the actual current render data.

Thanks for the help!