How to dynamically show legend labels using plotly JSON chart

It looks from this post (see below), that the list of legends is not exposed (as of 2022).

You could track the currently selected series in a variable outside of Plotly and rerender the axis labels using a transformer to achieve this functionality. I could provide some instructions on how to do that if required.

Thanks