Hello guys,
I using plotly to stream some data acquired from sensors. The application basically works as follows:
I have 4 channels from which I’m getting data. The application gets 4 traces from the server roughly every second. Each trace, contains more or less 80 samples with their respective timestamp.
On the client side I put the data in a buffer asI get it. Since the data is streamed as an array of raw bytes, each time I gets a trace I have to organize the data in a more useful way.
When I have collected all the 4 traces, I update the graph, but in order to do so, I have to take the data and organize it according to its x and y ranges and perform some calculations on the data to gets the size of the window on the buffer (This part is necessary because the user can place a time margin on the x axis values, so for instance he can select a window of as big as 3seconds).
Once I finish with the calculations, and I have my data ready and I update the graph using this style: Plotly.newPlot(‘sine-graph’, data, layout, {modeBarButtonsToRemove: buttons_load, displaylogo: false});
Everything seem to work quite fine for slow data gathering, but when I speed up the acquisition, the refreshing gets very slow or the browser gets stuck. The CPU however, never gets very high, it stays around 20/30%.Nevertheless, the browser does not support the load. Is this a good style to use the library or should I consider another way to update the graph?
Thank you.