Open nvaytet opened 1 year ago
Sunyoung and I discussed the possibility of using something like this to send the data to the dashboard for the live view. Let plopp interpet the data array and make a figure, and then send it as a dict or json to the dashboard, which can then use matplotlib or plotly or something else to re-create the figure.
The idea was to not have to re-create the logic we already have in plopp (what to do if data you receive is 1d or 2d etc..) in the dashboard if we use a library that is not Matplotlib (e.g. plotly).
It may be useful to have the ability to convert plots to a dict that would fully specify the figure. Just like Scipp has
.to_dict()
, we could have something that would convert the plot to adict
which would be interpretable and plotted using any plotting library, not just Matplotlib.The dict would contain all the info needed to build the figure (non-exhaustive list):
A python dict is easily convertible to JSON, making sending the data somewhere else more easy.