Is there a facility to export trace datapoints from plotly.js?
The user case is to export the current chart data and save it to a persistent context. Then if there is a power failure, or system reboot, then the data can be fed back into the chart to redraw it (at the point in which it was last saved).
I can export the data when using ‘bulk data’ (ie, arrays of data & corresponding timestamps) are being used, but when for example; a single value is being input every 10 seconds, and plotted against a timestamp, so I have a trace of 100 points. How do I retrieve those 100 datapoints & timestamps?
There is the following function Plotly.Plots.graphjson that returns in json format all the information of the graph (data, layout, config) which you can save in a file or database to recover it later, the information can also be accessed from a reference to the containing layer, layer._fullData to obtain the stroke data, layer._fullLayout for the layer configuration and in layer._context the rest of the configuration then you could use the json stringify function and save it in some file