Skip to content

Commit

Permalink
update plotly show methods for PlotlyKaleido v2
Browse files Browse the repository at this point in the history
  • Loading branch information
BeastyBlacksmith committed Aug 27, 2024
1 parent c54e532 commit 8098902
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ PlotThemes = "2, 3"
PlotUtils = "1"
PlotlyBase = "0.7 - 0.8"
PlotlyJS = "0.18"
PlotlyKaleido = "1"
PlotlyKaleido = "1,2"
PrecompileTools = "1"
PyPlot = "2"
PythonPlot = "1"
Expand Down
6 changes: 5 additions & 1 deletion src/backends/plotlybase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ for (mime, fmt) in (
"image/svg+xml" => "svg",
"image/eps" => "eps",
)
@eval _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{PlotlyBackend}) =
@eval function _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{PlotlyBackend})
if !PlotlyKaleido.is_running()
PlotlyKaleido.restart()
end
PlotlyKaleido.savefig(io, plotlybase_syncplot(plt), format = $fmt)
end
end

0 comments on commit 8098902

Please sign in to comment.