only show plotly plots as html in Juno

This commit is contained in:
Sebastian Pfitzner 2020-02-05 11:49:54 +01:00
parent 3bad6e9b4c
commit 4a7ea82862
3 changed files with 5 additions and 1 deletions

View File

@ -860,6 +860,8 @@ end
# ----------------------------------------------------------------
Base.showable(::MIME"application/prs.juno.plotpane+html", plt::Plot{PlotlyBackend}) = true
function _show(io::IO, ::MIME"application/vnd.plotly.v1+json", plot::Plot{PlotlyBackend})
plotly_show_js(io, plot)
end

View File

@ -52,3 +52,5 @@ function closeall(::PlotlyJSBackend)
close(current().o)
end
end
Base.showable(::MIME"application/prs.juno.plotpane+html", plt::Plot{PlotlyJSBackend}) = true

View File

@ -262,6 +262,6 @@ function _showjuno(io::IO, m::MIME"image/svg+xml", plt)
end
end
Base.showable(::MIME"application/prs.juno.plotpane+html", plt::Plot) = showable(MIME"text/html"(), plt)
Base.showable(::MIME"application/prs.juno.plotpane+html", plt::Plot) = false
_showjuno(io::IO, m, plt) = _show(io, m, plt)