-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[BUG] ClickData callback not triggering when clicking the same segment of pie chart #1300
Comments
It affects bar charts as well as pie charts. From Dash v1.11.0 release notes:
Are there any workarounds to trigger a callback when clicking on the same section of a graph again? |
I've got the same problem in dash 1.13.4. Any updates regarding a fix or a workaround would be very much appreciated. |
Same issue here in environment:
|
still broken in: |
We've been discussing internally whether there's a better way to handle this, but as a workaround in dash 1.19, due to #1525, you should be able to set @app.callback(
Output('clickDataDisplay', 'children'),
Output('pie', 'clickData'),
Input('pie', 'clickData')
)
def display_click_data(clickData):
print("Processing click data.")
return json.dumps(clickData, indent=2), None |
Adding an Output with clickData, and returning None does indeed avoid the problem. Thanks so much! |
When I try this I get a an error in the browser.
The same solution was proposed for this issue, but the same problem happened. Is there a way to prevent those errors? They cause the entire dashboard to not render. Using dash 1.18. Is that possibly the problem? EDIT: Yes that was the problem, upgrading to 1.19 fixed it. |
It works on dash:2.7.1 |
Clicking the same figure section in a pie chart or bar graph multiple times in a row doesn't fire the callback. So if a section was clicked, then the reset button was clicked, then the same section was clicked again, nothing would happen. The workaround is to reset the figure's clickData property to None after each callback. This may cause problems in future if we need to increment clickData, e.g. to keep track of how many times something has been selected. The bug and workaround are described here: plotly/dash#1300
Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are most important to our community. If this issue is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. (Please note that we will give priority to reports that include a short reproducible example.) If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson |
This is still a problem in dash 2.15.0. |
Describe your context
Please provide us your environment so we can easily reproduce the issue.
if frontend related, tell us your Browser, Version and OS
Describe the bug
When using pie chart clickData as an input for a callback, it does not trigger when clicking the same segment twice (or multiple times) in a row.
Expected behavior
I would expect the callback to trigger again with the same clickData.
Simple app
A simple app to help reproduce the bug.
The text was updated successfully, but these errors were encountered: