Dash update app in a for loop

This question may have been asked several times, but I am slightly confused so asking the question here again.

I am trying to make a Dash app that is connected to a measuring instrument, that measures new data in a loop, kind of like this,

vr, cr = [], []
for v in range_of_voltage:
    icr = measure_current(v)
    # Now plot vr-cr

This range_of_voltage is taken from user. Now, as I understand a graph update can only be triggered when a component callback is called. So, how do I trigger the graph update when a new data is generated in this loop?

You can use a dcc.Interval - Interval | Dash for Python Documentation | Plotly

It can fire a callback on some given time interval.

I think you could also use this: