parent
2d280edf0c
commit
ccb5194bb5
@ -922,8 +922,7 @@ end
|
|||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
function Base.show(io::IO, ::MIME"text/html", plt::Plot{PlotlyBackend})
|
function _show(io::IO, ::MIME"text/html", plt::Plot{PlotlyBackend})
|
||||||
prepare_output(plt)
|
|
||||||
write(io, html_head(plt) * html_body(plt))
|
write(io, html_head(plt) * html_body(plt))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
@require Revise begin
|
@require Revise begin
|
||||||
Revise.track(Plots, joinpath(Pkg.dir("Plots"), "src", "backends", "plotlyjs.jl"))
|
Revise.track(Plots, joinpath(Pkg.dir("Plots"), "src", "backends", "plotlyjs.jl"))
|
||||||
end
|
end
|
||||||
|
|
||||||
# https://github.com/spencerlyon2/PlotlyJS.jl
|
# https://github.com/spencerlyon2/PlotlyJS.jl
|
||||||
@ -88,8 +88,7 @@ end
|
|||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
|
|
||||||
function Base.show(io::IO, ::MIME"text/html", plt::Plot{PlotlyJSBackend})
|
function _show(io::IO, ::MIME"text/html", plt::Plot{PlotlyJSBackend})
|
||||||
prepare_output(plt)
|
|
||||||
if isijulia() && !_use_remote[]
|
if isijulia() && !_use_remote[]
|
||||||
write(io, PlotlyJS.html_body(PlotlyJS.JupyterPlot(plt.o)))
|
write(io, PlotlyJS.html_body(PlotlyJS.JupyterPlot(plt.o)))
|
||||||
else
|
else
|
||||||
|
|||||||
@ -177,7 +177,7 @@ const _best_html_output_type = KW(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# a backup for html... passes to svg or png depending on the html_output_format arg
|
# a backup for html... passes to svg or png depending on the html_output_format arg
|
||||||
function Base.show(io::IO, ::MIME"text/html", plt::Plot)
|
function _show(io::IO, ::MIME"text/html", plt::Plot)
|
||||||
output_type = Symbol(plt.attr[:html_output_format])
|
output_type = Symbol(plt.attr[:html_output_format])
|
||||||
if output_type == :auto
|
if output_type == :auto
|
||||||
output_type = get(_best_html_output_type, backend_name(plt.backend), :svg)
|
output_type = get(_best_html_output_type, backend_name(plt.backend), :svg)
|
||||||
@ -191,7 +191,7 @@ function Base.show(io::IO, ::MIME"text/html", plt::Plot)
|
|||||||
elseif output_type == :txt
|
elseif output_type == :txt
|
||||||
show(io, MIME("text/plain"), plt)
|
show(io, MIME("text/plain"), plt)
|
||||||
else
|
else
|
||||||
error("only png or svg allowed. got: $output_type")
|
error("only png or svg allowed. got: $(repr(output_type))")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -309,11 +309,6 @@ end
|
|||||||
out
|
out
|
||||||
end
|
end
|
||||||
|
|
||||||
# default text/plain passes to html... handles Interact issues
|
|
||||||
function Base.show(io::IO, m::MIME"text/plain", plt::Plot)
|
|
||||||
show(io, MIME("text/html"), plt)
|
|
||||||
end
|
|
||||||
|
|
||||||
ENV["MPLBACKEND"] = "Agg"
|
ENV["MPLBACKEND"] = "Agg"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user