Skip to content

Commit

Permalink
CLN: silence warning about overriding method when IJulia display loads
Browse files Browse the repository at this point in the history
  • Loading branch information
sglyon committed Jan 20, 2018
1 parent 599dafb commit 507e1af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ include("displays/electron.jl")
include("displays/ijulia.jl")

# default to electron display (will get over-written when Requires.jl picks up IJulia code)
SyncPlot(p::Plot) = SyncPlot(p, ElectronDisplay(p))
const DEFAULT_DISPLAY = Ref{Type{<:AbstractPlotlyDisplay}}(ElectronDisplay)

function set_display!(x::Type{T}) where T <: AbstractPlotlyDisplay
DEFAULT_DISPLAY[] = x
end
SyncPlot(p::Plot) = SyncPlot(p, DEFAULT_DISPLAY[](p))

# methods to convert from one frontend to another
let
Expand Down
3 changes: 1 addition & 2 deletions src/displays/ijulia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ prependtraces!(jd::JupyterDisplay, update::Associative=Dict(),
"application/vnd.plotly.v1+json" => JSON.lower(p))
end
end

SyncPlot(p::Plot) = SyncPlot(p, JupyterDisplay(p))
set_display!(JupyterDisplay)

IJulia.display_dict(p::Plot) =
Dict("text/plain" => sprint(show, "text/plain", p))
Expand Down

0 comments on commit 507e1af

Please sign in to comment.