actually use __init__
This commit is contained in:
parent
ac73798b9d
commit
6593e3cfe6
15
src/Plots.jl
15
src/Plots.jl
@ -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
|
||||||
|
|||||||
10
src/init.jl
10
src/init.jl
@ -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"))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user