Black Lives Matter. Please consider donating to Black Girls Code today.

FigureWidget with multiple traces: updates are very slow

Hello everyone,

I just started using plotly few days ago and I am not too familiar with it yet. I am currently facing some performance issues, so I am wondering what can be done to improve that.

I have a plot that consists of multiple layers (Surface and Scatter3d), can be more than 100 and each layer may consist of up to hundred points. I added those layers via add_traces to a FigureWidget. I added an IntSlider and in each step I want to adjust the color for each layer. Setting and rendering the new color is extremely slow. Here is some pseudocode:

import plotly.offline as py

self.fig = go.FigureWidget(layout=go.Layout(autosize=False))
slider = IntSlider(min=0, max=self.steps, continuous_update=False)
slider.observe(self.update_z, names="value")
self.plot = VBox([self.fig, slider])

def update_z(self, change):
  step = change['new']   
  for i in range(len([i].surfacecolor = self.new_color[step][i]

Is[i].surfacecolor = self.new_color[step][i] internally copying arrays? Or is the problem here just the slow rendering in the browser?