Purge old steam data

I have a stream time plot with plotly.js.
In my plot, there are 20 traces, and each of them has 200 samples per second, I want to keep only 5 min data and purge older.
Is there any solution for purging old data from the plot? It’s cumbersome and made my browser slow.

Using extendTraces, you can specify the number of points to keep on the graph. For example:

Plotly.extendTraces(graphDiv, {y: [[rand()], [rand()]]}, [0, 1], 10)

keeps 10 points.

From https://plot.ly/javascript/plotlyjs-function-reference/#plotlyextendtraces