Single-point or empty trace is not updated with slider
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
I'm trying to create a plot with a slider that will change all the traces. I have started with the example on the plotly page here and I have created a code pen to show a few problems I have noticed:
- If I don't have originally the same number of traces (that is, if line 10 is commented), then new traces are not added on the other steps/frames - even though I'm adding them to the "data" object, which I believe should be completely updated.
- Even when I have now the same number of traces, if one of them has a single point (lines 90/91) or is empty, then the trace is not updated completely: in the code pen example, moving to green will add the second line trace, then going back to red will move the point but the green line is stuck there. For graphs with at least 2 points (for example, changing the lines 90/91 to at least 2 points (e.g.
x:[2,3], y:[1,1],)) the issue is not present.
I believe the data object is not being updated completely, which is something I'd have expected it to do.
PS: I have noticed similar problems with sliders without the "animate", although the objects seem - strangely - to be different (for example, in this codepen I have to pass arguments as x: [[1, 2, 3]], y: [[2, 1, 3]], in args to update more than one trace, but the issue of having to have at least one trace and traces not updating are also there.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the slider and animation cases in the linked Plotly example and CodePens, including differing trace counts and single-point or empty traces. Trace how slider updates and animated frames apply the data object; done means all traces, including added, single-point, and empty traces, correctly reflect each selected step.
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
- 45/100