Plotly trace update slow with a custom property

I’m trying to figure out why is trace.update so slow with a custom property in plotly. Here below is a result of profiling of a function that updates the property “hovertemplate” of a figure created with plotly.subplots.make_subplots().

enter image description here

I’m calling twice trace.update. First time, I’m adding a new property “text” that contains a list of titles to be applied on each point of the trace. Second call, I apply a hovertemplate. As you can see, first call lasts more than 10 seconds, while second one takes 0.3s… Why? And how can i Improve that?

Leave a Comment