actually use __init__

This commit is contained in:
Sebastian Pfitzner 2018-08-16 12:23:23 +02:00
parent ac73798b9d
commit 6593e3cfe6
2 changed files with 10 additions and 15 deletions

View File

@ -294,19 +294,4 @@ end
const CURRENT_BACKEND = CurrentBackend(:none) const CURRENT_BACKEND = CurrentBackend(:none)
# for compatibility with Requires.jl:
@init begin
if isdefined(Main, :PLOTS_DEFAULTS)
if haskey(Main.PLOTS_DEFAULTS, :theme)
theme(Main.PLOTS_DEFAULTS[:theme])
end
for (k,v) in Main.PLOTS_DEFAULTS
k == :theme || default(k, v)
end
end
pushdisplay(PlotsDisplay())
end
# ---------------------------------------------------------
end # module end # module

View File

@ -1,4 +1,14 @@
function __init__() function __init__()
if isdefined(Main, :PLOTS_DEFAULTS)
if haskey(Main.PLOTS_DEFAULTS, :theme)
theme(Main.PLOTS_DEFAULTS[:theme])
end
for (k,v) in Main.PLOTS_DEFAULTS
k == :theme || default(k, v)
end
end
pushdisplay(PlotsDisplay())
include(joinpath(@__DIR__, "backends", "plotly.jl")) include(joinpath(@__DIR__, "backends", "plotly.jl"))
include(joinpath(@__DIR__, "backends", "gr.jl")) include(joinpath(@__DIR__, "backends", "gr.jl"))
include(joinpath(@__DIR__, "backends", "web.jl")) include(joinpath(@__DIR__, "backends", "web.jl"))