remove dependency on discontinued GeometryTypes
This commit is contained in:
parent
8ce603d3eb
commit
5660ea9501
@ -11,7 +11,6 @@ FFMPEG = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
|
|||||||
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
|
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
|
||||||
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
|
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
|
||||||
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
|
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
|
||||||
GeometryTypes = "4d00f742-c7ba-57c2-abde-4428a4b178cb"
|
|
||||||
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
||||||
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
|
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
|
||||||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
||||||
@ -39,12 +38,10 @@ FFMPEG = "0.2, 0.3, 0.4"
|
|||||||
FixedPointNumbers = "0.6, 0.7, 0.8"
|
FixedPointNumbers = "0.6, 0.7, 0.8"
|
||||||
GR = "0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52"
|
GR = "0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52"
|
||||||
GeometryBasics = "0.2, 0.3.1"
|
GeometryBasics = "0.2, 0.3.1"
|
||||||
GeometryTypes = "0.7, 0.8"
|
|
||||||
JSON = "0.21, 1"
|
JSON = "0.21, 1"
|
||||||
Latexify = "0.14"
|
Latexify = "0.14"
|
||||||
Measures = "0.3"
|
Measures = "0.3"
|
||||||
NaNMath = "0.3"
|
NaNMath = "0.3"
|
||||||
PGFPlotsX = "1.2.0"
|
|
||||||
PlotThemes = "2"
|
PlotThemes = "2"
|
||||||
PlotUtils = "1"
|
PlotUtils = "1"
|
||||||
RecipesBase = "1"
|
RecipesBase = "1"
|
||||||
|
|||||||
@ -8,7 +8,7 @@ const _current_plots_version = VersionNumber(split(first(filter(line -> occursin
|
|||||||
|
|
||||||
using Reexport
|
using Reexport
|
||||||
|
|
||||||
import GeometryTypes, GeometryBasics
|
import GeometryBasics
|
||||||
using Dates, Printf, Statistics, Base64, LinearAlgebra, Random
|
using Dates, Printf, Statistics, Base64, LinearAlgebra, Random
|
||||||
using SparseArrays
|
using SparseArrays
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
const P2 = GeometryTypes.Point2{Float64}
|
const P2 = GeometryBasics.Point2{Float64}
|
||||||
const P3 = GeometryTypes.Point3{Float64}
|
const P3 = GeometryBasics.Point3{Float64}
|
||||||
|
|
||||||
nanpush!(a::AbstractVector{P2}, b) = (push!(a, P2(NaN,NaN)); push!(a, b))
|
nanpush!(a::AbstractVector{P2}, b) = (push!(a, P2(NaN,NaN)); push!(a, b))
|
||||||
nanappend!(a::AbstractVector{P2}, b) = (push!(a, P2(NaN,NaN)); append!(a, b))
|
nanappend!(a::AbstractVector{P2}, b) = (push!(a, P2(NaN,NaN)); append!(a, b))
|
||||||
@ -729,7 +729,7 @@ end
|
|||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
"create a BezierCurve for plotting"
|
"create a BezierCurve for plotting"
|
||||||
mutable struct BezierCurve{T <: GeometryTypes.Point}
|
mutable struct BezierCurve{T <: GeometryBasics.Point}
|
||||||
control_points::Vector{T}
|
control_points::Vector{T}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1369,8 +1369,8 @@ end
|
|||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Lists of tuples and GeometryBasics.Points
|
# Lists of tuples and GeometryBasics.Points
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
@recipe f(v::AVec{<:_Point}) = RecipesPipeline.unzip(v)
|
@recipe f(v::AVec{<:GeometryBasics.Point}) = RecipesPipeline.unzip(v)
|
||||||
@recipe f(p::_Point) = [p]
|
@recipe f(p::GeometryBasics.Point) = [p]
|
||||||
|
|
||||||
# Special case for 4-tuples in :ohlc series
|
# Special case for 4-tuples in :ohlc series
|
||||||
@recipe f(xyuv::AVec{<:Tuple{R1, R2, R3, R4}}) where {R1, R2, R3, R4} =
|
@recipe f(xyuv::AVec{<:Tuple{R1, R2, R3, R4}}) where {R1, R2, R3, R4} =
|
||||||
|
|||||||
16
src/utils.jl
16
src/utils.jl
@ -149,18 +149,20 @@ makevec(v::T) where {T} = T[v]
|
|||||||
maketuple(x::Real) = (x,x)
|
maketuple(x::Real) = (x,x)
|
||||||
maketuple(x::Tuple{T,S}) where {T,S} = x
|
maketuple(x::Tuple{T,S}) where {T,S} = x
|
||||||
|
|
||||||
const _Point{N,T} = Union{GeometryTypes.Point{N,T}, GeometryBasics.Point{N,T}}
|
|
||||||
for i in 2:4
|
for i in 2:4
|
||||||
@eval begin
|
@eval begin
|
||||||
RecipesPipeline.unzip(v::Union{AVec{<:Tuple{Vararg{T,$i} where T}},
|
RecipesPipeline.unzip(
|
||||||
AVec{<:_Point{$i}}}) = $(Expr(:tuple, (:([t[$j] for t in v]) for j=1:i)...))
|
v::Union{AVec{<:Tuple{Vararg{T,$i} where T}}, AVec{<:GeometryBasics.Point{$i}}},
|
||||||
|
) = $(Expr(:tuple, (:([t[$j] for t in v]) for j=1:i)...))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
RecipesPipeline.unzip(v::Union{AVec{<:_Point{N}},
|
RecipesPipeline.unzip(
|
||||||
AVec{<:Tuple{Vararg{T,N} where T}}}) where N = error("$N-dimensional unzip not implemented.")
|
::Union{AVec{<:GeometryBasics.Point{N}}, AVec{<:Tuple{Vararg{T,N} where T}}}
|
||||||
RecipesPipeline.unzip(v::Union{AVec{<:_Point},
|
) where N = error("$N-dimensional unzip not implemented.")
|
||||||
AVec{<:Tuple}}) = error("Can't unzip points of different dimensions.")
|
RecipesPipeline.unzip(::Union{AVec{<:GeometryBasics.Point}, AVec{<:Tuple}}) = error(
|
||||||
|
"Can't unzip points of different dimensions."
|
||||||
|
)
|
||||||
|
|
||||||
# given 2-element lims and a vector of data x, widen lims to account for the extrema of x
|
# given 2-element lims and a vector of data x, widen lims to account for the extrema of x
|
||||||
function _expand_limits(lims, x)
|
function _expand_limits(lims, x)
|
||||||
|
|||||||
@ -7,7 +7,7 @@ using Test
|
|||||||
using FileIO
|
using FileIO
|
||||||
using Gtk
|
using Gtk
|
||||||
using LibGit2
|
using LibGit2
|
||||||
import GeometryTypes, GeometryBasics
|
import GeometryBasics
|
||||||
using Dates
|
using Dates
|
||||||
using RecipesBase
|
using RecipesBase
|
||||||
|
|
||||||
@ -199,7 +199,6 @@ end
|
|||||||
[(missing,missing)], [(missing,missing,missing),("a","b","c")])
|
[(missing,missing)], [(missing,missing,missing),("a","b","c")])
|
||||||
for z in zipped
|
for z in zipped
|
||||||
@test isequal(collect(zip(Plots.unzip(z)...)), z)
|
@test isequal(collect(zip(Plots.unzip(z)...)), z)
|
||||||
@test isequal(collect(zip(Plots.unzip(GeometryTypes.Point.(z))...)), z)
|
|
||||||
@test isequal(collect(zip(Plots.unzip(GeometryBasics.Point.(z))...)), z)
|
@test isequal(collect(zip(Plots.unzip(GeometryBasics.Point.(z))...)), z)
|
||||||
end
|
end
|
||||||
op1 = Plots.process_clims((1.0, 2.0))
|
op1 = Plots.process_clims((1.0, 2.0))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user