Skip to content

scattergl hover error with nulls #4212

Description

@bhogan-mitre

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugsomething brokenregressionthis used to work

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions