Dynamically bind callbacks to Graphs(dynamically generated)

Hi,

Welcome to the community!

I have a few suggestions regarding your app and the callbacks:

  1. I would discourage you to define callbacks in a loop like this. You can instead use a Pattern-Matching Callback with the wildcard ALL and update all figures at once.

  2. If all you want in the callback is to update the points in dcc.Graph, then I would recommenf you to take a look on extendData. It allows you to just “append” points to the trace without rewriting the entire figure. There are some threads around discussing how to use it (like this one) and it is not trivial in your case where multiple graphs are updated, but this is the fastest way to accomplish what you want.

I can find you an example of what I just mentioned if you need (I am not on my laptop right now unfortunately).

Hope this helps!