Hacks to get stripped version running under Julia v0.7-alpha

This commit is contained in:
Ralph A. Smith 2018-06-14 22:12:10 -04:00
parent c6e1a55082
commit 4c34a1df15
5 changed files with 10 additions and 16 deletions

View File

@ -7,6 +7,7 @@ Reexport
StaticArrays 0.5 StaticArrays 0.5
FixedPointNumbers 0.3 FixedPointNumbers 0.3
Measures Measures
Dates
Showoff Showoff
StatsBase 0.14.0 StatsBase 0.14.0
JSON JSON

View File

@ -12,6 +12,8 @@ import RecipesBase: plot, plot!, animate
using Base.Meta using Base.Meta
@reexport using PlotUtils @reexport using PlotUtils
@reexport using PlotThemes @reexport using PlotThemes
import Dates
import Dates.Date
import Showoff import Showoff
import StatsBase import StatsBase
import JSON import JSON

View File

@ -409,15 +409,6 @@ function _hdf5plot_gwrite(grp, k::String, v::Surface)
_hdf5plot_gwrite(grp, "data2d", v.surf) _hdf5plot_gwrite(grp, "data2d", v.surf)
_hdf5plot_writetype(grp, Surface) _hdf5plot_writetype(grp, Surface)
end 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) function _hdf5plot_gwrite(grp, k::String, v::SeriesAnnotations)
#Currently no support for SeriesAnnotations #Currently no support for SeriesAnnotations

View File

@ -438,16 +438,16 @@ end
mutable struct SeriesAnnotations mutable struct SeriesAnnotations
strs::AbstractVector # the labels/names strs::AbstractVector # the labels/names
font::Font font::Font
baseshape::Nullable baseshape::Union{Any, Nothing}
scalefactor::Tuple scalefactor::Tuple
end end
function series_annotations(strs::AbstractVector, args...) function series_annotations(strs::AbstractVector, args...)
fnt = font() fnt = font()
shp = Nullable{Any}() shp = Union{Any, Nothing}()
scalefactor = (1,1) scalefactor = (1,1)
for arg in args for arg in args
if isa(arg, Shape) || (isa(arg, AbstractVector) && eltype(arg) == Shape) if isa(arg, Shape) || (isa(arg, AbstractVector) && eltype(arg) == Shape)
shp = Nullable(arg) shp = Union{Any, Nothing}()
elseif isa(arg, Font) elseif isa(arg, Font)
fnt = arg fnt = arg
elseif isa(arg, Symbol) && haskey(_shapes, arg) elseif isa(arg, Symbol) && haskey(_shapes, arg)

View File

@ -1,10 +1,10 @@
mutable struct CurrentPlot mutable struct CurrentPlot
nullableplot::Nullable{AbstractPlot} nullableplot::Union{AbstractPlot, Nothing}
end end
const CURRENT_PLOT = CurrentPlot(Nullable{AbstractPlot}()) const CURRENT_PLOT = CurrentPlot(nothing)
isplotnull() = isnull(CURRENT_PLOT.nullableplot) isplotnull() = CURRENT_PLOT.nullableplot == nothing
""" """
current() current()
@ -16,7 +16,7 @@ function current()
end end
get(CURRENT_PLOT.nullableplot) get(CURRENT_PLOT.nullableplot)
end end
current(plot::AbstractPlot) = (CURRENT_PLOT.nullableplot = Nullable(plot)) current(plot::AbstractPlot) = (CURRENT_PLOT.nullableplot == nothing)
# --------------------------------------------------------- # ---------------------------------------------------------