IJulia and REPL plotting seems to work again, however from REPL plot! creates a new empty window in addition to updating existing window, but only if run on a seperate line, running plot(rand(10));plot!(rand(5)) doesn't create the extra window

This commit is contained in:
Leon Wabeke 2019-01-02 12:10:03 +02:00
parent eaad735d22
commit 01742cffa6

View File

@ -12,7 +12,9 @@ const _plotlyjs_scale = _plotly_scale
function _create_backend_figure(plt::Plot{PlotlyJSBackend}) function _create_backend_figure(plt::Plot{PlotlyJSBackend})
if !isplotnull() && plt[:overwrite_figure] && isa(current().o, PlotlyJS.SyncPlot) if !isplotnull() && plt[:overwrite_figure] && isa(current().o, PlotlyJS.SyncPlot)
PlotlyJS.SyncPlot(PlotlyJS.Plot(), current().o.view) p = PlotlyJS.plot()
p.window = current().o.window
p
else else
PlotlyJS.plot() PlotlyJS.plot()
end end
@ -57,12 +59,8 @@ end
# ---------------------------------------------------------------- # ----------------------------------------------------------------
function _show(io::IO, ::MIME"text/html", plt::Plot{PlotlyJSBackend}) function _show(io::IO, ::MIME"text/html", plt::Plot{PlotlyJSBackend})
if isijulia() && !_use_remote[]
write(io, PlotlyJS.html_body(PlotlyJS.JupyterPlot(plt.o)))
else
show(io, MIME("text/html"), plt.o) show(io, MIME("text/html"), plt.o)
end end
end
function plotlyjs_save_hack(io::IO, plt::Plot{PlotlyJSBackend}, ext::String) function plotlyjs_save_hack(io::IO, plt::Plot{PlotlyJSBackend}, ext::String)
tmpfn = tempname() * "." * ext tmpfn = tempname() * "." * ext