✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Clear Dropdown while resetting graph

I have two dropdowns (month, year) which when set result in the corresponding graph. However, when I click the reset button, I need the graph to be reset to a default graph along with the dropdowns being reset to display no value. How do I achieve the clearing of current dropdown values. I have the callback for resetting the graph using year, month and n_clicks as input.

I would have the button n_clicks as the input of the callback and the Dropdowns’ value as the two outputs of the callback.
Then, the function could be something like:

Def update (n_clicks):
If n_clicks > 0:
return None
else:
Return something else

1 Like

Thank you! That worked :slight_smile: