Scaling to all visible plots after click on legend

I want to rescale a plot to the range of all selected plots. By hiding a high-amplitude plot, the user should be able to see the details of the smaller plots.

If I listen to the plotly_legendclick event, the layout data does not yet havehiddenlabels:

If I listen to plotly_relayout (as suggested in the link), however, the event is not triggered by clicks on the legend.

Is there any other event or way how to get the list of visible plots while redrawing? Thanks!

Thank you, that works! visible is an array with either the string "legendonly" or boolean true as first element.