Is it possible to export a makie figure to a file, so later i can just load the file to recreate the figure and do not need to import my data, make all the computation required and finally plot it again ?
I don’t want to export a png/jpg but really the figure variable as I have 3d plots using meshscatter.
I want to recreate the plot using a code similar to this.
using GLMakie, FileIO
f = load("figure.xxx")
display(f)
If this is possible for a basic plots, is it possible with custom recipes and data structure ?
Not yet, no. You wouldn’t succeed just naively serializing all the internal observables that link to anonymous functions etc. We need a new method to serialize those parts of plot objects etc that can be recreated, or convert them to a suitable representation first.
Ok ! Do you plan to work on this subject ?
Because by serializing those plot objects you could easily share a plot file without the need to share the data and the plot construction (custom recipes, custom style cycle, …)
Would think it would be possible to share a datainspector as well ?
Yes that would definitely be a nice feature to have. I personally don’t have time right now to work on this feature but would try to support anyone who wanted to contribute.
Are there any news on that ? It would have many nice use cases. It seems to work with Serialization.serialize with very small scatter examples but when I try something more complex it fails.
There are at least three reasons why Makie can benefit from a declarative API:
…
3. Nested Dicts will work well for package independent serialization of plots. We could think of serializing complete complex figures to JSON and share them like that. Or we could update figures from within Javascript, making it easier to create animations in plots exported to HTML.
The above JSON export isn’t implemented yet, but with this update we’re getting a step closer to it.