Plotly_legendclick and plotly_legenddoubleclick events not updating Python object

Hi guys,

I would like to

  1. give the user the opportunity to change the visibility of traces within a plot
  2. also keep the chosen visibility in case the underlying trace data has changed.

Whereas the first point is trivial as the user can just click or double-click on the legend entry for a particular trace, I have difficulties implementing the second point as it seems the events

  • plotly_legendclick
  • plotly_legenddoubleclick
    do not update the underlying Python object. I mean that after one of the above click-events occurredc,
self.plot_1.data[number_of_trace_clicked].visible

has still the old value.

Is this

  1. on purpose?
  2. a bug?
    and how can I achieve the envisaged functionality?