plotly / plotly/plotly.js

bug with selectedpoints when using multiple histogram

Open
#6,031 0 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

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:
image

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.