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
Additional context
I spotted where the issue is coming from : basically the findNode method in Mesh hooks relies on d3-delaunay and specifically on delaunay.find method. With no data points given, the .find returns NaN and it isn't a case checked in the code so we try to access the node related to the index and it crashes because it's undefined.
I've already opened an issue on d3-delaunay side because I don't think NaN is really an expected behavior 😅 You can find the issue opened here : d3/d3-delaunay#144
On our side, I've patched Nivo to return null when nodes.length === 0. So I have a fix ready if you want me to handle it, but I'm not sure that's how you want to handle it 😄
The text was updated successfully, but these errors were encountered:
Describe/explain the bug
When hovering a Line Chart with empty data, the chart crashes.
To Reproduce
Here is the link to a Codesandbox showing the issue : https://codesandbox.io/p/sandbox/charming-mendel-3wsx4v?file=%2Fsrc%2Fcomponents%2FLineChart.js%3A110%2C25
Steps to reproduce the behavior:
Expected behavior
No crash 😅
Additional context
I spotted where the issue is coming from : basically the
findNode
method in Mesh hooks relies ond3-delaunay
and specifically ondelaunay.find
method. With no data points given, the.find
returns NaN and it isn't a case checked in the code so we try to access thenode
related to theindex
and it crashes because it'sundefined
.nivo/packages/voronoi/src/hooks.ts
Lines 172 to 179 in da6d6b7
I've already opened an issue on
d3-delaunay
side because I don't thinkNaN
is really an expected behavior 😅 You can find the issue opened here : d3/d3-delaunay#144On our side, I've patched Nivo to return
null
whennodes.length === 0
. So I have a fix ready if you want me to handle it, but I'm not sure that's how you want to handle it 😄The text was updated successfully, but these errors were encountered: