From dd25893a70146efb553ad4b22c52e5dabc15c5af Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Sun, 15 Mar 2020 21:22:59 +0100 Subject: [PATCH] move Surface and trueOrAllTrue --- src/Plots.jl | 3 ++- src/components.jl | 17 ----------------- src/utils.jl | 3 --- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index c9bb7af3..080707bf 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -24,7 +24,8 @@ import RecipePipeline: _process_userrecipe, _process_plotrecipe, finalize_subplot!, recipe_pipeline!, _recipe_init!, _recipe_after_user!, _recipe_after_plot!, _recipe_before_series!, - _recipe_finish!, is_st_supported, Formatted, SliceIt, FuncOrFuncs, MaybeNumber, MaybeString, DataPoint + _recipe_finish!, is_st_supported, Formatted, SliceIt, FuncOrFuncs, MaybeNumber, MaybeString, DataPoint, trueOrAllTrue, + Surface, AbstractSurface using Requires diff --git a/src/components.jl b/src/components.jl index 02abd8b8..ecc81d61 100644 --- a/src/components.jl +++ b/src/components.jl @@ -650,23 +650,6 @@ end # ----------------------------------------------------------------------- -abstract type AbstractSurface end - -"represents a contour or surface mesh" -struct Surface{M<:AMat} <: AbstractSurface - surf::M -end - -Surface(f::Function, x, y) = Surface(Float64[f(xi,yi) for yi in y, xi in x]) - -Base.Array(surf::Surface) = surf.surf - -for f in (:length, :size) - @eval Base.$f(surf::Surface, args...) = $f(surf.surf, args...) -end -Base.copy(surf::Surface) = Surface(copy(surf.surf)) -Base.eltype(surf::Surface{T}) where {T} = eltype(T) - function expand_extrema!(a::Axis, surf::Surface) ex = a[:extrema] for vi in surf.surf diff --git a/src/utils.jl b/src/utils.jl index ef15b8b5..08244500 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -717,9 +717,6 @@ makekw(; kw...) = KW(kw) wraptuple(x::Tuple) = x wraptuple(x) = (x,) -trueOrAllTrue(f::Function, x::AbstractArray) = all(f, x) -trueOrAllTrue(f::Function, x) = f(x) - allLineTypes(arg) = trueOrAllTrue(a -> get(_typeAliases, a, a) in _allTypes, arg) allStyles(arg) = trueOrAllTrue(a -> get(_styleAliases, a, a) in _allStyles, arg) allShapes(arg) = trueOrAllTrue(a -> is_marker_supported(get(_markerAliases, a, a)), arg) ||