Plotly.js: scattergl hover error with nulls

Created on 23 Sep 2019  路  5Comments  路  Source: plotly/plotly.js

It appears that null values are not handled well by scattergl. The data that is present is displayed as expected, for example 3 of 4 points are shown in the screenshot below. However mousing around the plot area throws a lot of errors from the hoverPoints function. For example, Uncaught TypeError: Cannot read property 't' of undefined.

Screen Shot 2019-09-23 at 1 00 49 PM

Reproducible example:
https://jsfiddle.net/bhogan_mitre/u41pn9eo/

I believe this is the underlying function at fault: https://github.com/plotly/plotly.js/blob/master/src/traces/scattergl/hover.js#L15

Would it be appropriate to add some checks in that function on cd before trying to access cd[0]? I have also seen errors further down where it makes it past this line:

var stash = cd[0].t;

but fails here:

var x = stash.x;

I will note that this is only an issue with scattergl and not the normal SVG scatter.

bug regression

All 5 comments

Thanks very much for reporting!

Looks like this is regression from 1.45.0.

Things were working ok in 1.44.4: https://codepen.io/etpinard/pen/VwZgjom?editors=1010

It looks like it was working in 1.46.1: https://codepen.io/antoinerg/pen/mdbvrBx?editors=1010
and that the regression was introduced in 1.47.0: https://codepen.io/antoinerg/pen/BaBMLmq?editors=1010

Interesting. It's failing in 1.45.0 though: https://codepen.io/etpinard/pen/NWKoRMJ?editors=1010

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pynklu picture pynklu  路  3Comments

maxwell8888 picture maxwell8888  路  3Comments

boleslawmaliszewski picture boleslawmaliszewski  路  3Comments

hashimmoosavi picture hashimmoosavi  路  3Comments

deecay picture deecay  路  3Comments