Skip to content

Commit

Permalink
add method to Base.show for plot pane output (StepTree)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrodium committed Aug 14, 2023
1 parent e0b75e0 commit 353edd4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/_io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,14 @@ function export_pinned_steps(
end
return paths_output
end

function Base.show(io::IO, mime::MIME"image/png", steptree::StepTree)
dir = mktempdir()
index = length(steptree.steps)
M = steptree.steps[index].manifold
export_one_step(dir, M, index)
img = RGB.(load(joinpath(dir, "combined", "combined-$(index).png")))
Base.show(io, mime, img)
end

Base.showable(::MIME"image/png", steptree::StepTree) = !iszero(length(steptree.steps))

0 comments on commit 353edd4

Please sign in to comment.