Export makie figure object to file

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 ?

I tried using JLD2 but with no success so far …

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.