plotly / plotly/plotly.js

Plotly does not correctly redraw text items when updated through Plotly.react()

Open
#5,360 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

  1. Open https://codepen.io/rtwfroody/pen/OJRxdMy, and you'll see a graph with the points labeled "one", "two", and "three".
  2. Hit the toggle checkbox, and the graph contents will change. Now only the first point is labeled. This is expected.
  3. Hit the toggle checkbox again. The code returns the graph to the exact same data as it started with, but the 2nd and 3rd points have no labels.
  4. No matter how many times you hit the checkbox, the original labels are never drawn.

This is a simple example of the issue I have in https://casualhacker.net/covid19-wealth. In that link, you can see that when you change the scale (see log checkboxes), then the labels are redrawn correctly.

Using layout.datarevision doesn't make things better.

Contributor guide

Open the contributing guide

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

Reproduce the behavior from the linked CodePen using Plotly.react(), toggling the checkbox to remove and restore the labels. Start by tracing the Plotly.react() redraw path for text items and check whether layout.datarevision affects it. Done means the second and third labels return after restoring the original data, matching the initial graph.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.