Skip to content

Commit

Permalink
add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
tknopp committed Oct 10, 2023
1 parent 7a1774a commit e8fd5a7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Optional/CairoMakie.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import .CairoMakie: Figure

function Base.convert(t::Type{PngImage}, plot::CairoMakie.Figure)
pb = PipeBuffer()
show(pb, MIME("image/png"), plot)
return PngImage(pb)
end

preprocess(name, plot::CairoMakie.Figure, data) = preprocess(name, convert(PngImage, plot), data)
preprocess(name, plots::AbstractArray{<:CairoMakie.Figure}, data) = begin
for (i, plot)=enumerate(plots)
preprocess(name*"/$i", plot, data)
end
return data
end

0 comments on commit e8fd5a7

Please sign in to comment.