diff --git a/Project.toml b/Project.toml index 4c5b98717..27f4f5ac8 100644 --- a/Project.toml +++ b/Project.toml @@ -11,7 +11,6 @@ FFMPEG = "c87230d0-a227-11e9-1b43-d7ebe4e7570a" FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326" -GeometryTypes = "4d00f742-c7ba-57c2-abde-4428a4b178cb" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -39,12 +38,10 @@ FFMPEG = "0.2, 0.3, 0.4" FixedPointNumbers = "0.6, 0.7, 0.8" GR = "0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52" GeometryBasics = "0.2, 0.3.1" -GeometryTypes = "0.7, 0.8" JSON = "0.21, 1" Latexify = "0.14" Measures = "0.3" NaNMath = "0.3" -PGFPlotsX = "1.2.0" PlotThemes = "2" PlotUtils = "1" RecipesBase = "1" diff --git a/src/Plots.jl b/src/Plots.jl index 8be711c6c..1ce8bf65a 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -8,7 +8,7 @@ const _current_plots_version = VersionNumber(split(first(filter(line -> occursin using Reexport -import GeometryTypes, GeometryBasics +import GeometryBasics using Dates, Printf, Statistics, Base64, LinearAlgebra, Random using SparseArrays diff --git a/src/components.jl b/src/components.jl index 6281f7bf5..00ca51e6d 100644 --- a/src/components.jl +++ b/src/components.jl @@ -1,5 +1,5 @@ -const P2 = GeometryTypes.Point2{Float64} -const P3 = GeometryTypes.Point3{Float64} +const P2 = GeometryBasics.Point2{Float64} +const P3 = GeometryBasics.Point3{Float64} 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)) @@ -729,7 +729,7 @@ end # ----------------------------------------------------------------------- "create a BezierCurve for plotting" -mutable struct BezierCurve{T <: GeometryTypes.Point} +mutable struct BezierCurve{T <: GeometryBasics.Point} control_points::Vector{T} end diff --git a/src/recipes.jl b/src/recipes.jl index e805fa493..09bb3a61c 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -1369,8 +1369,8 @@ end # -------------------------------------------------------------------- # Lists of tuples and GeometryBasics.Points # -------------------------------------------------------------------- -@recipe f(v::AVec{<:_Point}) = RecipesPipeline.unzip(v) -@recipe f(p::_Point) = [p] +@recipe f(v::AVec{<:GeometryBasics.Point}) = RecipesPipeline.unzip(v) +@recipe f(p::GeometryBasics.Point) = [p] # Special case for 4-tuples in :ohlc series @recipe f(xyuv::AVec{<:Tuple{R1, R2, R3, R4}}) where {R1, R2, R3, R4} = diff --git a/src/utils.jl b/src/utils.jl index 81779dd3c..7cfc7b3ae 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -149,18 +149,20 @@ makevec(v::T) where {T} = T[v] maketuple(x::Real) = (x,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 @eval begin - RecipesPipeline.unzip(v::Union{AVec{<:Tuple{Vararg{T,$i} where T}}, - AVec{<:_Point{$i}}}) = $(Expr(:tuple, (:([t[$j] for t in v]) for j=1:i)...)) + RecipesPipeline.unzip( + 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 -RecipesPipeline.unzip(v::Union{AVec{<:_Point{N}}, - AVec{<:Tuple{Vararg{T,N} where T}}}) where N = error("$N-dimensional unzip not implemented.") -RecipesPipeline.unzip(v::Union{AVec{<:_Point}, - AVec{<:Tuple}}) = error("Can't unzip points of different dimensions.") +RecipesPipeline.unzip( + ::Union{AVec{<:GeometryBasics.Point{N}}, AVec{<:Tuple{Vararg{T,N} where T}}} +) where N = error("$N-dimensional unzip not implemented.") +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 function _expand_limits(lims, x) diff --git a/test/runtests.jl b/test/runtests.jl index be680676a..5cd843ecc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,7 +7,7 @@ using Test using FileIO using Gtk using LibGit2 -import GeometryTypes, GeometryBasics +import GeometryBasics using Dates using RecipesBase @@ -199,7 +199,6 @@ end [(missing,missing)], [(missing,missing,missing),("a","b","c")]) for z in zipped @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) end op1 = Plots.process_clims((1.0, 2.0))