diff ext/DiffinitiveMakieExt.jl @ 1801:2b5f81e288f1 feature/grids/manifolds

Merge feature/grids/curvilinear
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 02 Oct 2024 08:51:37 +0200
parents 4d55ac2892a2
children
line wrap: on
line diff
--- a/ext/DiffinitiveMakieExt.jl	Mon Sep 16 09:53:29 2024 +0200
+++ b/ext/DiffinitiveMakieExt.jl	Wed Oct 02 08:51:37 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