Plotly plot layout.uirevision has not effect on content resetting

What I’m trying to do:

  1. Update an editable plotly plot every minute so that it will be always showing the latest hour-long period worth of data
  2. I’d like to preserve the uirevision state of the editable plot. If the user has disabled via the interactive plot the visualization of certain curves for example, they should not show up again after a data refresh

What I’ve tried and what’s not working:

  1. Loading data from backend - works; setting up a timer to update the plot - works; the plot being editable - works;
  2. Trying different configurations with the plot.layout.uirevision property has resulted in zero change of plot’s behavior after update. The below example resets any curve/bar selection on data update and/or any zoom level selection despite “layout.uirevision” being True.

Code Sample (a bit simplified):

# code snippet
  def build_plot(self):
      self.data = anvil.server.call("get_data")
      
      time = self.data["time"]
      data_series = self.data["data_series"]
      
      lines_list = []
      for key in list(data_series.keys()):
        if key in ["Bar1", "Bar2", "Bar3"]:
          line_item = go.Bar(x = time,
                                y = data_series[key],
                                name = key)
        else:
          line_item = go.Scatter(x = time,
                                y = data_series[key],
                                mode="lines",
                                name = key)
        lines_list.append(line_item)
      
      self.style_plot(self.my_plot) #general setup as per the dashboard app example
      self.my_plot.layout.title = "MINUTE LEVEL DATA"
      self.my_plot.layout.yaxis.title = "Value"
      self.my_plot.layout.uirevision = True
      
      self.my_plot.data = lines_list