update lookup for default backend and PlotUtils dependency

This commit is contained in:
Ralph A. Smith 2018-06-29 08:45:04 -04:00
parent 91e326695c
commit 48bfe523b8
2 changed files with 4 additions and 5 deletions

View File

@ -1,6 +1,6 @@
julia 0.7 julia 0.7
RecipesBase 0.2.3 RecipesBase 0.2.3
PlotUtils 0.4.1 PlotUtils 0.5
PlotThemes 0.1.3 PlotThemes 0.1.3
Reexport Reexport
StaticArrays 0.5 StaticArrays 0.5

View File

@ -148,8 +148,7 @@ CurrentBackend(sym::Symbol) = CurrentBackend(sym, _backend_instance(sym))
function pickDefaultBackend() function pickDefaultBackend()
env_default = get(ENV, "PLOTS_DEFAULT_BACKEND", "") env_default = get(ENV, "PLOTS_DEFAULT_BACKEND", "")
if env_default != "" if env_default != ""
try if Base.find_package(env_default) != nothing
Pkg.installed(env_default) # this will error if not installed
sym = Symbol(lowercase(env_default)) sym = Symbol(lowercase(env_default))
if haskey(_backendType, sym) if haskey(_backendType, sym)
return backend(sym) return backend(sym)
@ -157,7 +156,7 @@ function pickDefaultBackend()
warn("You have set PLOTS_DEFAULT_BACKEND=$env_default but it is not a valid backend package. Choose from:\n\t", warn("You have set PLOTS_DEFAULT_BACKEND=$env_default but it is not a valid backend package. Choose from:\n\t",
join(sort(_backends), "\n\t")) join(sort(_backends), "\n\t"))
end end
catch else
warn("You have set PLOTS_DEFAULT_BACKEND=$env_default but it is not installed.") warn("You have set PLOTS_DEFAULT_BACKEND=$env_default but it is not installed.")
end end
end end
@ -166,7 +165,7 @@ function pickDefaultBackend()
# which one someone will want to use if they have the package installed...accounting for # which one someone will want to use if they have the package installed...accounting for
# features, speed, and robustness # features, speed, and robustness
for pkgstr in ("GR", "PyPlot", "PlotlyJS", "PGFPlots", "UnicodePlots", "InspectDR", "GLVisualize") for pkgstr in ("GR", "PyPlot", "PlotlyJS", "PGFPlots", "UnicodePlots", "InspectDR", "GLVisualize")
if Pkg.installed(pkgstr) != nothing if Base.find_package(pkgstr) != nothing
return backend(Symbol(lowercase(pkgstr))) return backend(Symbol(lowercase(pkgstr)))
end end
end end