Legend visible after click event

Hi everyone! I’m currently tyring to rich visibility of legen in “plotly_legendclick” event. My code for now looking like this:

    function (eventData: Plotly.LegendClickEvent) {
      if (eventData.curveNumber || eventData.curveNumber === 0) {
        const trace: any = eventData.data[eventData.curveNumber];
        console.log("curveNumber", trace, typeof trace, trace.visible);

      return true;

and for now i see in dev tools that visible is “legendonly”, but i couldnot get this value in code, this not supported? or maybe there another way to understand that i hide one of trace and do some stuff with this information. Thanx guys!