Skip to content

Commit

Permalink
Insert PlotlyJSDisplay just after REPL instead of pushing. (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
EricForgy authored and sglyon committed Dec 29, 2018
1 parent c54b847 commit 86c6839
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/PlotlyJS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ function __init__()
@info("plotly.js javascript libary not found -- downloading now")
include(joinpath(_pkg_root, "deps", "build.jl"))
end
pushdisplay(PlotlyJSDisplay())

insert!(Base.Multimedia.displays, findlast(x -> x isa Base.TextDisplay || x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotlyJSDisplay())

atreplinit(i -> begin
while PlotlyJSDisplay() in Base.Multimedia.displays
popdisplay(PlotlyJSDisplay())
end
insert!(Base.Multimedia.displays, findlast(x -> x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotlyJSDisplay())
end)
end

end # module

0 comments on commit 86c6839

Please sign in to comment.