Skip to content

X-coordinates are duplicated in plotly_click points #6747

Description

@Erhanjinn

Hello plotly.js team,

when a plotly.js graph fires a plotly_click event over a timeline plot, the bbox given in click event.points contains incorrect x coordinate data. Both x coordinates are the same.

I am using the latest plotly-2.26.2.min.js.

Code snippet to reproduce the issue (see full code at https://jsfiddle.net/3Ljv1ek5/)

const data = [{...}]
const layout = {...}
const m_plot_div = document.createElement("div")
const m_plot = document.body.appendChild(m_plot_div)

Plotly.newPlot(
  m_plot,
  data,
  layout
)

m_plot.on('plotly_click', function(e) {
  console.log(e.points[0].bbox)
})

Example console output

{
  x0: 539.25,
  x1: 539.25,
  y0: 99,
  y1: 347
}

Please see the full example at https://jsfiddle.net/3Ljv1ek5/.

I would like to use the bbox data to know what is the exact click position over the timeline element.

Could someone take a look at this, please?

Thanks!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions