question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scattergl hover error with nulls

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
antoinergcommented, Sep 23, 2019
1reaction
etpinardcommented, Sep 23, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Figure Reference: scattergl Traces - Plotly
Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is...
Read more >
Force Plotly hover tag - Stack Overflow
I am using plotly and Shiny and have two plots on a single page. The points on the two plots have the same...
Read more >
plotly.js-dist | Yarn - Package Manager
... Fix scattergl hover over nulls (bug introduced in 1.45.0) [#4213] ... Error bar spans on bar traces with null coordinates are now...
Read more >
Source - GitHub
... and `\n` in `scattermapbox` on-graph text [[#4176](https://github.com/plotly/plotly.js/pull/4176)] - Fix `scattergl` hover over nulls (bug introduced in ...
Read more >
CHANGELOG.md · v1.41.0 · mirrors / plotly / plotly.js · GitCode
Fix scattergl selection after resize relayouts [#2801]; Fix scattergl layout ... Fx.hover acting on multiple subplots (bug introduced in 1.32.0 ) [#2379] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found