Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scattergl hover error with nulls #4212

Closed
bhogan-mitre opened this issue Sep 23, 2019 · 5 comments · Fixed by #4213
Closed

scattergl hover error with nulls #4212

bhogan-mitre opened this issue Sep 23, 2019 · 5 comments · Fixed by #4213
Assignees
Labels
bug something broken regression this used to work

Comments

@bhogan-mitre
Copy link
Contributor

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.

@etpinard
Copy link
Contributor

Thanks very much for reporting!

@etpinard etpinard added the bug something broken label Sep 23, 2019
@etpinard etpinard self-assigned this Sep 23, 2019
@etpinard
Copy link
Contributor

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

@antoinerg
Copy link
Contributor

antoinerg commented Sep 23, 2019

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

@archmoj archmoj added the regression this used to work label Sep 23, 2019
@etpinard
Copy link
Contributor

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

@antoinerg
Copy link
Contributor

Oh, I'm sorry, disregard #4212 (comment)

etpinard added a commit that referenced this issue Sep 23, 2019
... so that we don't mutate pointData.cd and propagate 'fake'
    `gd.calcdata[i][j]` to subsequent _module.hoverPoints calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken regression this used to work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants