forward showable call to _show instead of show since all backends return true otherwise

This commit is contained in:
Fredrik Ekre 2018-06-04 10:13:53 +02:00
parent afe4817150
commit 2d280edf0c
2 changed files with 4 additions and 12 deletions

View File

@ -922,15 +922,6 @@ end
# ----------------------------------------------------------------
function _show(io::IO, ::MIME"image/png", plt::Plot{PlotlyBackend})
# show_png_from_html(io, plt)
error("png output from the plotly backend is not supported. Please use plotlyjs instead.")
end
function _show(io::IO, ::MIME"image/svg+xml", plt::Plot{PlotlyBackend})
error("svg output from the plotly backend is not supported. Please use plotlyjs instead.")
end
function Base.show(io::IO, ::MIME"text/html", plt::Plot{PlotlyBackend})
prepare_output(plt)
write(io, html_head(plt) * html_body(plt))

View File

@ -195,10 +195,11 @@ function Base.show(io::IO, ::MIME"text/html", plt::Plot)
end
end
function _show(io::IO, m, plt::Plot{B}) where B
# Base.show_backtrace(STDOUT, backtrace())
warn("_show is not defined for this backend. m=", string(m))
# delegate mimewritable (showable on julia 0.7) to _show instead
function Base.mimewritable(m::M, plt::P) where {M<:MIME, P<:Plot}
return method_exists(_show, Tuple{IO, M, P})
end
function _display(plt::Plot)
warn("_display is not defined for this backend.")
end