Open matthijscox-asml opened 1 year ago
I believe that Plots.jl defines the Plot
type in RecipesBase.jl, which is a very lightweight package. Makie does not define its top-level type in MakieCore, its equivalent of RecipesBase, so I'm not 100% sure what you could do there, but will have a look.
Another consideration is that the dimensions of the plot could be determined by PPTX.jl, the user, or some combination of both. One would also want higher resolution figures so that they look good in a presentation or on a projector. Some sort of feedback mechanism might be required.
Cool, thanks for the suggestions!
Is the savefig function also defined inside RecipesBase.jl? I don't think so. And what would be a good way to include the savefig functionality then?
I suspect not. Neither is Makie's saving functionality (using FileIO) defined in MakieCore.
You could use https://github.com/JuliaPackaging/Requires.jl to add some code which will load only when the respective library (Plots/Makie) is loaded, which overrides the Picture
method with Plots.Plot
or Makie.FigureLike
.
Out of curiosity, what's your end goal for this package?
Thanks, I'll look into Requires.jl. I'd prefer to not use such trickery, but it might be the only way.
The end goal of the package is to make fancy PowerPoints easily with a few Julia commands. In the corporate world, at least at my employer, PowerPoints are often used as a kind of static portable dashboards, automatically generated by analysis scripts. People have been complaining they cannot do this from Julia.
Personally, I think if we can make tables, plots and text boxes we have a good foundation. And layout those easily on slides, maybe with a relative grid layout (I like the Makie grid layout approach). If you have ideas for other functionality, feel free to open an issue.
Aha! I thought it was something like that. Yes, Makie has some good stuff - grid layouts are made using https://github.com/jkrumbiegel/GridLayoutBase.jl which is not too well documented but shouldn't be too hard to dive into, and basically uses the same layout syntax as Makie does. You'd just have to hook up the PowerPoint object types you currently have into the layout using something like this:
Another interesting approach is https://github.com/fatteneder/MakieSlides.jl which is basically rendering presentations in Makie - either as PDFs or display them using Makie's interactive backends. This allows you to also add animations, interactive features, etc as desired which can interact with your actual data on demand.
I think it would be the easiest to do this via package extensions, since the user has to load the plotting library anyways
I think it would be the easiest to do this via package extensions, since the user has to load the plotting library anyways
True, this would be a good solution, except we will break compatibility with older Julia version. Decisions, decisions...
We're still thinking about easier figure support.
Right now you'd have to
savefig()
function of your favorite plotting package.Picture()
type and add it to aSlide
.Ideally this is simplified into:
Or even just push the figure into a
Slide
directly.Most difficult technical challenge is that we ideally want to avoid including Plots and Makie as a dependency. These are rather large dependencies that we do not want to force onto the user, as some will not want to include figures into their generated slide decks.