Skip to content

selectedpoints doesn't work from Plotly.update for scattergl #2348

Closed
@kevinoe

Description

@kevinoe

If you do a box select (and lasso?) in a scatter plot, you can no longer update the selected points via update. Also, if the dragmode STARTS as select, selectedpoints fails entirely.

For this example:
https://codepen.io/ks_openeye/pen/gvLrxR

  1. Notice the second point is already selected
  2. Switch to box select.
  3. Select the last point
  4. Click the button - notice it fails to select the point with index 1

For this example (dragmode == 'select' to start)
https://codepen.io/ks_openeye/pen/bLBpKM

  1. Notice no points render
  2. The console throws an error (scene.unselectBatch is null):
plotly-latest.js:180868 Uncaught (in promise) TypeError: Cannot read property '0' of null
    at plotly-latest.js:180868
    at Array.map (<anonymous>)
    at Object.plot (plotly-latest.js:180820)
    at plotOne (plotly-latest.js:135422)
    at Object.exports.plot (plotly-latest.js:135394)
    at drawData (plotly-latest.js:125636)
    at Object.lib.syncOrAsync (plotly-latest.js:120901)
    at Plotly.plot (plotly-latest.js:125691)
    at Object.lib.syncOrAsync (plotly-latest.js:120901)
    at Object.update (plotly-latest.js:127454)
(anonymous) @ plotly-latest.js:180868
plot @ plotly-latest.js:180820
plotOne @ plotly-latest.js:135422
exports.plot @ plotly-latest.js:135394
drawData @ plotly-latest.js:125636
lib.syncOrAsync @ plotly-latest.js:120901
Plotly.plot @ plotly-latest.js:125691
lib.syncOrAsync @ plotly-latest.js:120901
update @ plotly-latest.js:127454
updateSelected @ pen.js:25
(anonymous) @ pen.js:30
Promise resolved (async)
(anonymous) @ pen.js:29

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions