From 8a66930f8985452e9f69bc2102cb78003f22e0dc Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Wed, 16 Jan 2019 10:41:32 +0100 Subject: [PATCH] changed behaviour of Vector{<:SVector} as input argument --- NEWS.md | 1 + src/series.jl | 13 +------------ src/utils.jl | 9 --------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/NEWS.md b/NEWS.md index 15d2aaa2..8dc206eb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,7 @@ --- ## (current master) +- changed behaviour of Vectors of length-2 and length-3 StaticVectors ## 0.22.1 - push PlotsDisplay just after REPLDisplay diff --git a/src/series.jl b/src/series.jl index 33861bd6..9ebb0d8d 100644 --- a/src/series.jl +++ b/src/series.jl @@ -547,7 +547,7 @@ end # # # # -------------------------------------------------------------------- -# # Lists of tuples and StaticArrays +# # Lists of tuples # # -------------------------------------------------------------------- # # # if we get an unhandled tuple, just splat it in @@ -567,17 +567,6 @@ end @recipe f(xyuv::AVec{Tuple{R1,R2,R3,R4}}) where {R1<:Number,R2<:Number,R3<:Number,R4<:Number} = get(plotattributes,:seriestype,:path)==:ohlc ? OHLC[OHLC(t...) for t in xyuv] : unzip(xyuv) @recipe f(xyuv::Tuple{R1,R2,R3,R4}) where {R1<:Number,R2<:Number,R3<:Number,R4<:Number} = [xyuv[1]], [xyuv[2]], [xyuv[3]], [xyuv[4]] - -# -# # 2D StaticArrays -@recipe f(xy::AVec{StaticArrays.SVector{2,T}}) where {T<:Number} = unzip(xy) -@recipe f(xy::StaticArrays.SVector{2,T}) where {T<:Number} = [xy[1]], [xy[2]] - -# -# # 3D StaticArrays -@recipe f(xyz::AVec{StaticArrays.SVector{3,T}}) where {T<:Number} = unzip(xyz) -@recipe f(xyz::StaticArrays.SVector{3,T}) where {T<:Number} = [xyz[1]], [xyz[2]], [xyz[3]] - # # # -------------------------------------------------------------------- # # handle grouping diff --git a/src/utils.jl b/src/utils.jl index 7f582e81..3c42783a 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -287,15 +287,6 @@ unzip(xy::AVec{Tuple{X,Y}}) where {X,Y} = [t[1] for t in xy], [t[2] unzip(xyz::AVec{Tuple{X,Y,Z}}) where {X,Y,Z} = [t[1] for t in xyz], [t[2] for t in xyz], [t[3] for t in xyz] unzip(xyuv::AVec{Tuple{X,Y,U,V}}) where {X,Y,U,V} = [t[1] for t in xyuv], [t[2] for t in xyuv], [t[3] for t in xyuv], [t[4] for t in xyuv] -unzip(xy::AVec{StaticArrays.SVector{2,T}}) where {T} = T[t[1] for t in xy], T[t[2] for t in xy] -unzip(xy::StaticArrays.SVector{2,T}) where {T} = T[xy[1]], T[xy[2]] - -unzip(xyz::AVec{StaticArrays.SVector{3,T}}) where {T} = T[t[1] for t in xyz], T[t[2] for t in xyz], T[t[3] for t in xyz] -unzip(xyz::StaticArrays.SVector{3,T}) where {T} = T[xyz[1]], T[xyz[2]], T[xyz[3]] - -unzip(xyuv::AVec{StaticArrays.SVector{4,T}}) where {T} = T[t[1] for t in xyuv], T[t[2] for t in xyuv], T[t[3] for t in xyuv], T[t[4] for t in xyuv] -unzip(xyuv::StaticArrays.SVector{4,T}) where {T} = T[xyuv[1]], T[xyuv[2]], T[xyuv[3]], T[xyuv[4]] - # given 2-element lims and a vector of data x, widen lims to account for the extrema of x function _expand_limits(lims, x) try