I’m wondering if the performance of the relayout function is dependent of the number of points plotted on the graph.
I’m working on a plot with roughly 6000 points. I’m adding and removing annotations via click events on the points or on the background (with help of an awful hack but without altering the plotly code mind you). I’ve noticed that adding and removing the annotation seems somewhat dependent of the number of points on the plot:
- for instance, when I zoom in to ~ 100 points, the annotation is displayed is about 1ms.
- yet for my whole sample, it takes well 1000ms to display said annotation.
I’ve timed a bit the function which puts the annotation, and the bottleneck seems to be the plotly.relayout function… which is a bit worrying since I thought relayout updated … well… the layout, so it shouldn’t depend on the number of points.
I’ve a little fiddle to illustrate this:
Any ideas on the why or how to optimize this?