When using plot.ly, it is possible to set up a listener for legend click events. I am wondering how to determine which trace in the legend was clicked on. To provide a more specific example, let's say there are two traces (trace0, trace1) in a line graph. If the user clicks on trace0 in the legend, I would like to show an alert that says "trace0". Similarly, when the user clicks on trace1 in the legend, I want a different message to appear. While I am able to create alerts successfully, I have not been able to find any documentation on how plot.ly distinguishes between the traces clicked on in the legend. Any guidance would be appreciated!