Skip to content

scatter3d always selects point 0 on mouse hover #3258

Closed
@DirkToewe

Description

@DirkToewe

From version 1.34.0 and onward, mouse hover on scatter3d always picks point number 0. Version 1.33.1 works fine. The problem exists in both Chrome and Firefox on Ubuntu 16.04 and Ubuntu 18.04. Here is a small example:

'use strict';
{
  async function main(){
    const data = [
      {
        type: 'scatter3d',
        mode: 'markers',
        x: Array.from( { length: 25 }, () => Math.random() ),
        y: Array.from( { length: 25 }, () => Math.random() ),
        z: Array.from( { length: 25 }, () => Math.random() )
      }
    ];
    const layout = {};

    const plot = document.createElement('div')
    plot.style = 'width: 90vw; height: 90vh'
    document.body.appendChild(plot)

    await Plotly.plot(plot, data, layout)
    plot.on('plotly_hover', event => console.log(event) )
  }
  main()
}

And here is a screenshot of the bug (notice where the mouse is pointing):
plotly_scatter3d_hover_bug

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