Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix selection behaviour of histograms #2711

Merged
merged 5 commits into from
Sep 3, 2020

Conversation

meffmadd
Copy link
Contributor

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:
histogram selection

Fixes #2698.

@nicolaskruchten
Copy link
Contributor

Thanks for this pull request! @alexcjohnson and/or @jonmmease can you take a look please?

@jonmmease
Copy link
Contributor

Hi @meffmadd, thanks for the PR. I'll look it over soon. Sorry it slipped through cracks initially!

@jonmmease
Copy link
Contributor

Looks and works great @meffmadd, thanks!

@jonmmease jonmmease merged commit f5bff69 into plotly:master Sep 3, 2020
@jonmmease
Copy link
Contributor

BTW, https://github.com/meffmadd/pandas-visual-analysis looks really cool!

@meffmadd
Copy link
Contributor Author

meffmadd commented Sep 3, 2020

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!

@iadjali
Copy link

iadjali commented Sep 25, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The selectedpoints attribute for Histogram plots is being set incorrectly
4 participants