plotly / plotly/react-plotly.js

Plotly.restyle breaks onClick handlers

Open
#330 0 comments 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

Issue: After calling Plotly.restyle on a rendered chart, onClick callback fail to be called.

Reproduction: https://codesandbox.io/s/youthful-ganguly-kt5pq7?file=/src/chart.tsx Using this example, you are able to click the line points or the bar and see the selection updated at the bottom. this works indefinitely, and as expected. By clicking the restyle button, the bars will change color from orange to blue. After this, click events cease to work on both the bar and the line plots.

Base Plotly: this DOES work as expected in base plotly using the same data and same reproduction steps https://codepen.io/swalsh81/pen/gOqaxeP

Expected functionality: Click events should continue to work after a Plotly.restyle event is called and function like the base plotly does as demonstrated

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 by reproducing the behavior in the linked CodeSandbox, focusing on chart.tsx and the Plotly.restyle button flow. Compare the React component's behavior with the linked base Plotly CodePen, then verify that click callbacks still fire for both bar and line plots after restyling.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.