From 4c34a1df150d6e85bc8fb36fa84c617021cbf0ed Mon Sep 17 00:00:00 2001 From: "Ralph A. Smith" Date: Thu, 14 Jun 2018 22:12:10 -0400 Subject: [PATCH] Hacks to get stripped version running under Julia v0.7-alpha --- REQUIRE | 1 + src/Plots.jl | 2 ++ src/backends/hdf5.jl | 9 --------- src/components.jl | 6 +++--- src/plot.jl | 8 ++++---- 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/REQUIRE b/REQUIRE index 26a3ae70..0a637421 100644 --- a/REQUIRE +++ b/REQUIRE @@ -7,6 +7,7 @@ Reexport StaticArrays 0.5 FixedPointNumbers 0.3 Measures +Dates Showoff StatsBase 0.14.0 JSON diff --git a/src/Plots.jl b/src/Plots.jl index ea7ff92d..8c4a4d97 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -12,6 +12,8 @@ import RecipesBase: plot, plot!, animate using Base.Meta @reexport using PlotUtils @reexport using PlotThemes +import Dates +import Dates.Date import Showoff import StatsBase import JSON diff --git a/src/backends/hdf5.jl b/src/backends/hdf5.jl index a82a277f..fe8e26e7 100644 --- a/src/backends/hdf5.jl +++ b/src/backends/hdf5.jl @@ -409,15 +409,6 @@ function _hdf5plot_gwrite(grp, k::String, v::Surface) _hdf5plot_gwrite(grp, "data2d", v.surf) _hdf5plot_writetype(grp, Surface) end -#TODO: "Properly" support Nullable using _hdf5plot_writetype? -function _hdf5plot_gwrite(grp, k::String, v::Nullable) - if isnull(v) - _hdf5plot_gwrite(grp, k, nothing) - else - _hdf5plot_gwrite(grp, k, v.value) - end - return -end function _hdf5plot_gwrite(grp, k::String, v::SeriesAnnotations) #Currently no support for SeriesAnnotations diff --git a/src/components.jl b/src/components.jl index 2b1284ce..ceb87e32 100644 --- a/src/components.jl +++ b/src/components.jl @@ -438,16 +438,16 @@ end mutable struct SeriesAnnotations strs::AbstractVector # the labels/names font::Font - baseshape::Nullable + baseshape::Union{Any, Nothing} scalefactor::Tuple end function series_annotations(strs::AbstractVector, args...) fnt = font() - shp = Nullable{Any}() + shp = Union{Any, Nothing}() scalefactor = (1,1) for arg in args if isa(arg, Shape) || (isa(arg, AbstractVector) && eltype(arg) == Shape) - shp = Nullable(arg) + shp = Union{Any, Nothing}() elseif isa(arg, Font) fnt = arg elseif isa(arg, Symbol) && haskey(_shapes, arg) diff --git a/src/plot.jl b/src/plot.jl index 2b7ab389..0507a57b 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -1,10 +1,10 @@ mutable struct CurrentPlot - nullableplot::Nullable{AbstractPlot} + nullableplot::Union{AbstractPlot, Nothing} end -const CURRENT_PLOT = CurrentPlot(Nullable{AbstractPlot}()) +const CURRENT_PLOT = CurrentPlot(nothing) -isplotnull() = isnull(CURRENT_PLOT.nullableplot) +isplotnull() = CURRENT_PLOT.nullableplot == nothing """ current() @@ -16,7 +16,7 @@ function current() end get(CURRENT_PLOT.nullableplot) end -current(plot::AbstractPlot) = (CURRENT_PLOT.nullableplot = Nullable(plot)) +current(plot::AbstractPlot) = (CURRENT_PLOT.nullableplot == nothing) # ---------------------------------------------------------