Mercurial > repos > public > sbplib_julia
diff ext/DiffinitiveMakieExt.jl @ 1822:189e69d44056 feature/grids/tensor_grid/spacing
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 20 Oct 2024 20:38:39 +0200 |
parents | 4d55ac2892a2 |
children |
line wrap: on
line diff
--- a/ext/DiffinitiveMakieExt.jl Wed Oct 02 11:11:33 2024 -0700 +++ b/ext/DiffinitiveMakieExt.jl Sun Oct 20 20:38:39 2024 +0200 @@ -33,12 +33,12 @@ ## Grids -Makie.convert_arguments(::Type{<:Scatter}, g::Grid) = (reshape(map(Point,g),:),) # (map(Point,collect(g)[:]),) -function Makie.convert_arguments(::Type{<:Lines}, g::Grid{<:Any,2}) +Makie.convert_arguments(::Type{<:Scatter}, g::Grid) = (reshape(map(Point,g),:),) +function Makie.convert_arguments(::Type{<:Lines}, g::Grid{<:AbstractVector}) M = collect(g) function cat_with_NaN(a,b) - vcat(a,[@SVector[NaN,NaN]],b) + vcat(a,[@SVector fill(NaN, coordinate_size(g))],b) end xlines = reduce(cat_with_NaN, eachrow(M)) @@ -47,7 +47,7 @@ return (cat_with_NaN(xlines,ylines),) end -Makie.plot!(plot::Plot(Grid{<:Any,2})) = lines!(plot, plot.attributes, plot[1]) +Makie.plot!(plot::Plot(Grid)) = lines!(plot, plot.attributes, plot[1]) ## Grid functions