allow html output in Juno
e.g. for the PlotlyJS backend
This commit is contained in:
parent
236aaed2a3
commit
1da4b2eda9
@ -201,6 +201,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)
|
||||||
|
|
||||||
@ -229,7 +231,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]
|
||||||
|
|
||||||
@ -258,4 +260,8 @@ function _showjuno(io::IO, m::MIME"image/svg+xml", plt)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Base.showable(m::MIME"application/prs.juno.plotpane+html", plt::P) where P <: Plot
|
||||||
|
return showable(MIME("text/html"), plt)
|
||||||
|
end
|
||||||
|
|
||||||
_showjuno(io::IO, m, plt) = _show(io, m, plt)
|
_showjuno(io::IO, m, plt) = _show(io, m, plt)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user