We’ve been unable to get plotly-dash to smoothly display a constant stream of data.
A few examples we’ve been following so far all use Interval to update the graph:
- https://pythonprogramming.net/live-graphs-data-visualization-application-dash-python-tutorial/
- https://stackoverflow.com/questions/63589249/plotly-dash-display-real-time-data-in-smooth-animation
- Prevent re-entrant callbacks
But in our experience with higher data rates the interval callback can take too long to process. When the interval timer comes due it then re-enters the callback for a second time (while the first callback is processing), and when this happens plotly basically crashes, nothing renders. Using print statements, we can see that the callbacks get backed up and don’t run at smooth intervals.
I made an attempt to work around the re-entrant callback problem using an interval callback which either triggers the graphing callback using a dcc.Store update or raises PreventUpdate depending on whether the last update ran. But I got quirky results where the dcc.Store values, which I used to indicate that the graphing callback completed, weren’t getting updated or weren’t visible to the interval callback.
That approach seems like a hack anyway.
I’m looking for ideas on what to try next. Is there hope for Plotly/Dash to be able to stream 100+ data points per second smoothly? Or perhaps plotly just isn’t made for this use case?
9 posts - 3 participants





