commit
0deb7038e6
@ -7,12 +7,12 @@
|
|||||||
# note: returns meta information... mainly for use with automatic labeling from DataFrames for now
|
# note: returns meta information... mainly for use with automatic labeling from DataFrames for now
|
||||||
|
|
||||||
const FuncOrFuncs{F} = Union{F, Vector{F}, Matrix{F}}
|
const FuncOrFuncs{F} = Union{F, Vector{F}, Matrix{F}}
|
||||||
const DataPoint = Union{Number, AbstractString, Missing}
|
const DataPoint = Union{Number, AbstractString, AbstractChar, Missing}
|
||||||
const SeriesData = Union{AVec{<:DataPoint}, Function, Surface, Volume}
|
const SeriesData = Union{AVec{<:DataPoint}, Function, Surface, Volume}
|
||||||
|
|
||||||
prepareSeriesData(x) = error("Cannot convert $(typeof(x)) to series data for plotting")
|
prepareSeriesData(x) = error("Cannot convert $(typeof(x)) to series data for plotting")
|
||||||
prepareSeriesData(::Nothing) = nothing
|
prepareSeriesData(::Nothing) = nothing
|
||||||
prepareSeriesData(s::SeriesData) = handlemissings(s)
|
prepareSeriesData(s::SeriesData) = handlemissings(handlechars(s))
|
||||||
|
|
||||||
handlemissings(v) = v
|
handlemissings(v) = v
|
||||||
handlemissings(v::AbstractArray{Union{T,Missing}}) where T <: Number = replace(v, missing => NaN)
|
handlemissings(v::AbstractArray{Union{T,Missing}}) where T <: Number = replace(v, missing => NaN)
|
||||||
@ -20,6 +20,9 @@ handlemissings(v::AbstractArray{Union{T,Missing}}) where T <: AbstractString = r
|
|||||||
handlemissings(s::Surface) = Surface(handlemissings(s.surf))
|
handlemissings(s::Surface) = Surface(handlemissings(s.surf))
|
||||||
handlemissings(v::Volume) = Volume(handlemissings(v.v), v.x_extents, v.y_extents, v.z_extents)
|
handlemissings(v::Volume) = Volume(handlemissings(v.v), v.x_extents, v.y_extents, v.z_extents)
|
||||||
|
|
||||||
|
handlechars(x) = x
|
||||||
|
handlechars(c::AVec{<:AbstractChar}) = string.(c)
|
||||||
|
|
||||||
# default: assume x represents a single series
|
# default: assume x represents a single series
|
||||||
convertToAnyVector(x) = Any[prepareSeriesData(x)]
|
convertToAnyVector(x) = Any[prepareSeriesData(x)]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user