Skip to content

Error using scattergl when plot has text and non-text data #3559

Closed
@Jeffrey72

Description

@Jeffrey72

https://codepen.io/anon/pen/JxVZeR?editors=1111

Reproduction:
In the codepen select some points using the lasso tool, and then click a zoom button.

Notable features of the codepen are that both data traces have the type 'scattergl' and only one of the two traces has a mode that contains 'text'.
(I used Chrome to reproduce)

Bug:
The traces disappear, and there is an error in the dev-tools console:
Uncaught TypeError: Cannot read property 'color' of undefined
at styleTextSelection (plotly-latest.js:173530)
at plotly-latest.js:173210
at Array.forEach ()
at Object.plot (plotly-latest.js:173208)
at plotOne (plotly-latest.js:117826)
at Object.exports.plot (plotly-latest.js:117750)
at exports.drawData (plotly-latest.js:110083)
at Object.lib.syncOrAsync (plotly-latest.js:99315)
at relayout (plotly-latest.js:106232)
at wrappedEdit (plotly-latest.js:106760)

Note:
A naive solution may just be to check if the textOptions at the current index is undefined before continuing.

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions