Trigger callback when legend is clicked

Hi. How to activate callback when legends on Plotly graph in a Dash app is clicked? I want to re-draw the figure once a legend is clicked. That is, when legend for a given trace is clicked I need to know the corresponding name, legendgroup or id in the callback in order to re-draw the figure.