plotly / plotly/react-plotly.js

onClick event is not being called.

Open
#195 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
138
Avg merge
3d 2h
Merged PRs (30d)
4

Description

When both onSelected and onClick event is provided to the plot, even if the click event happens on the plot, that is going to onSelected event itself. I want to use both onSelected as well as onClick event. How to achieve this?
<Plot data={chartData} layout={chartLayout} onSelected={ this.onPointSelected.bind(this)} onClick={(data, e) => { let selectedPoint = data.points[0].text; }} />


onPointSelected = (data) => { console.log('point selection') }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the shown Plot component and reproduce the interaction using both onSelected and onClick, then inspect how those callbacks are dispatched. Done means the intended click behavior is clearly defined and both callbacks work as expected, with the behavior covered by a regression test if an appropriate test entry point is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.