Fix selection behaviour of histograms#2711
Conversation
|
Thanks for this pull request! @alexcjohnson and/or @jonmmease can you take a look please? |
|
Hi @meffmadd, thanks for the PR. I'll look it over soon. Sorry it slipped through cracks initially! |
|
Looks and works great @meffmadd, thanks! |
|
BTW, https://github.com/meffmadd/pandas-visual-analysis looks really cool! |
Thank you so much! 😊 I'm happy I could contribute to this awesome project! |
|
According to the plotly.py documentation clickmode='select' should also set selectedpoints with the points indices in the clicked bin of the histogram. However this is not working for me with FigureWidget (go.Histogram) in a Jupyter notebook; the only way to get the points in a specific bin is to use dragmode='select' (which is not ideal if there are lots of bins and you only want the data in one), clickmode doesn't seem to do anything to the points argument in the callback function. Am I missing something? |
This change addresses the selection behaviour in histograms.
A selection now returns the point indices in a single list like scatter plots or others. In the past, the selection was just a list of empty objects due to histograms having a different structure of the selected points. More information can be found in my comment on the original issue.
Now the indices of the selection are passed correctly:

Fixes #2698.