Callback origin and reset clickdata on Python Dash

I had set a callback that receives the value of a dropdown and a clickdata on a graph. If dropdown value changes, the graph was recolored and table values were updated. If I click on the graph, the same thing happens with the colors and the table Data. But there’s this situation: When I already clicked on the graph the clickdata haven’t been cleaned. So, how can I know the origin of the callback or how can i clean the clickdata on the end of the current callback?

Thanks

Checkout dash.callback_context.triggered
https://dash.plot.ly/faqs >> Q: How do I determine which Input has changed?

I think this needs to be moved to a more prominent position in the docs. I’ve been using Dash for over a year and didn’t know about this!

1 Like

You’re absolutely right -> https://github.com/plotly/dash-docs/issues/668
We’ll get to it eventually, but if anyone is motivated to contribute, this would be a great one to take on :slight_smile:

Thank you, it works!

three reasons why you should buy plotly pro: support open source, get great support, host your plots and dashboards online