Merge pull request #2381 from pfitzseb/sp/htmlplots

only show plotly plots as html in Juno
This commit is contained in:
Michael Krabbe Borregaard 2020-02-05 11:53:17 +01:00 committed by GitHub
commit c99fcc3dcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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}) function _show(io::IO, ::MIME"application/vnd.plotly.v1+json", plot::Plot{PlotlyBackend})
plotly_show_js(io, plot) plotly_show_js(io, plot)
end end

View File

@ -52,3 +52,5 @@ function closeall(::PlotlyJSBackend)
close(current().o) close(current().o)
end end
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
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) _showjuno(io::IO, m, plt) = _show(io, m, plt)