bug with selectedpoints when using multiple histogram
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
Hi,
I found a bug while trying to select a bar in a diagram with multiple histograms. I reproduce the issue on this codepen: https://codepen.io/martin-alfonsi/pen/ZEJwxNz
It seems that if all the values from an histogram are before all the values from the other histogram, then trying to select a bar on the furthest histogram using selectedpoints will deselect all instead.
Here the blue 1.5 bar should be select but all bars are unselected:

And if I move the orange bar (line 7 from the JS) between or after the blue, then there is no issue:


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 with the linked CodePen reproduction and trace plotly.js histogram selection handling for multiple histograms and selectedpoints. Reproduce the case where one histogram’s values all precede the other’s, then compare it with the working reordered cases. Done means selecting the furthest histogram bar keeps that bar selected instead of deselecting all bars, with regression coverage for the reported arrangement.
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