diff --git a/REQUIRE b/REQUIRE index 26a3ae70..b64b796b 100644 --- a/REQUIRE +++ b/REQUIRE @@ -14,3 +14,4 @@ NaNMath Requires Contour GR 0.31.0 +Dates diff --git a/src/Plots.jl b/src/Plots.jl index ea7ff92d..d3b71cea 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -6,6 +6,7 @@ using Reexport import StaticArrays using StaticArrays.FixedSizeArrays +using Dates @reexport using RecipesBase import RecipesBase: plot, plot!, animate diff --git a/src/backends/hdf5.jl b/src/backends/hdf5.jl index 2cbe7a76..44a72d59 100644 --- a/src/backends/hdf5.jl +++ b/src/backends/hdf5.jl @@ -413,15 +413,15 @@ 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 +# #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..7b6d8b6b 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{Shape, AbstractVector{Shape}, Nothing} scalefactor::Tuple end function series_annotations(strs::AbstractVector, args...) fnt = font() - shp = Nullable{Any}() + shp = nothing scalefactor = (1,1) for arg in args if isa(arg, Shape) || (isa(arg, AbstractVector) && eltype(arg) == Shape) - shp = Nullable(arg) + shp = arg 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..b9b655d2 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 = plot) # ---------------------------------------------------------