Merge pull request #2189 from pfitzseb/sp/htmlinjuno

allow html output in Juno
This commit is contained in:
Daniel Schwabeneder 2019-09-18 10:43:32 +02:00 committed by GitHub
commit 767b8b245a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,6 +202,8 @@ for mime in ("text/plain", "text/html", "image/png", "image/eps", "image/svg+xml
end end
end end
Base.show(io::IO, m::MIME"application/prs.juno.plotpane+html", plt::Plot) = showjuno(io, MIME("text/html"), plt)
# default text/plain for all backends # default text/plain for all backends
_show(io::IO, ::MIME{Symbol("text/plain")}, plt::Plot) = show(io, plt) _show(io::IO, ::MIME{Symbol("text/plain")}, plt::Plot) = show(io, plt)
@ -230,7 +232,7 @@ closeall() = closeall(backend())
# Atom PlotPane # Atom PlotPane
# --------------------------------------------------------- # ---------------------------------------------------------
function showjuno(io::IO, m, plt) function showjuno(io::IO, m, plt)
sz = plt[:size] sz = collect(plt[:size])
dpi = plt[:dpi] dpi = plt[:dpi]
thickness_scaling = plt[:thickness_scaling] thickness_scaling = plt[:thickness_scaling]
@ -259,4 +261,6 @@ function _showjuno(io::IO, m::MIME"image/svg+xml", plt)
end end
end end
Base.showable(::MIME"application/prs.juno.plotpane+html", plt::Plot) = showable(MIME"text/html"(), plt)
_showjuno(io::IO, m, plt) = _show(io, m, plt) _showjuno(io::IO, m, plt) = _show(io, m, plt)