This grid layout code used to work in 2D and 3D:
using Meshes, MeshViz
import CairoMakie as Mke
# define a cube in R^3
points = Point3[(0,0,0),(1,0,0),(1,1,0),(0,1,0),(0,0,1),(1,0,1),(1,1,1),(0,1,1)]
connec = connect.([(1,4,3,2),(5,6,7,8),(1,2,6,5),(3,4,8,7),(1,5,8,4),(2,3,7,6)])
mesh = SimpleMesh(points, connec)
# refine three times
ref1 = refine(mesh, CatmullClark())
ref2 = refine(ref1, CatmullClark())
ref3 = refine(ref2, CatmullClark())
fig = Mke.Figure(resolution = (800, 800))
viz(fig[1,1], mesh, showfacets = true, axis = (title = "original",))
viz(fig[1,2], ref1, showfacets = true, axis = (title = "refine 1",))
viz(fig[2,1], ref2, showfacets = true, axis = (title = "refine 2",))
viz(fig[2,2], ref3, showfacets = true, axis = (title = "refine 3",))
fig
Now it breaks with the following error message:
ERROR: MethodError: no method matching initialize_block!(::Makie.MakieLayout.LScene; title="original")
Closest candidates are:
initialize_block!(::Makie.MakieLayout.LScene; scenekw) at ~/.julia/packages/Makie/fEZv2/src/makielayout/blocks/scene.jl:17 got unsupported keyword argument "title"
initialize_block!(::Makie.MakieLayout.Axis3) at ~/.julia/packages/Makie/fEZv2/src/makielayout/blocks/axis3d.jl:3 got unsupported keyword argument "title"
initialize_block!(::Makie.MakieLayout.Label) at ~/.julia/packages/Makie/fEZv2/src/makielayout/blocks/label.jl:3 got unsupported keyword argument "title"
...
Stacktrace:
[1] kwerr(::NamedTuple{(:title,), Tuple{String}}, ::Function, ::Makie.MakieLayout.LScene)
@ Base ./error.jl:163
[2] _block(::Type{Makie.MakieLayout.LScene}, ::Makie.Figure; bbox::Nothing, kwargs::Base.Pairs{Symbol, String, Tuple{Symbol}, NamedTuple{(:title,), Tuple{String}}})
@ Makie.MakieLayout ~/.julia/packages/Makie/fEZv2/src/makielayout/blocks.jl:395
[3] #_#38
@ ~/.julia/packages/Makie/fEZv2/src/makielayout/blocks.jl:269 [inlined]
[4] plot(P::Type{MakieCore.Combined{MeshViz.viz}}, gp::GridLayoutBase.GridPosition, args::SimpleMesh{3, Float64, Vector{Point3}, FullTopology{Connectivity{Quadrangle{Dim, T} where {Dim, T}, 4}}}; axis::NamedTuple{(:title,), Tuple{String}}, kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:showfacets,), Tuple{Bool}}})
@ Makie ~/.julia/packages/Makie/fEZv2/src/figureplotting.jl:77
[5] viz(::GridLayoutBase.GridPosition, ::Vararg{Any}; attributes::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:showfacets, :axis), Tuple{Bool, NamedTuple{(:title,), Tuple{String}}}}})
@ MeshViz ~/.julia/packages/MakieCore/oBlaS/src/recipes.jl:33
I understand it has to do with the creation of the grid layout in place. How to update this code to make it work with latest Makie?
This is the offending line where the error is thrown:
viz(fig[1,1], mesh, showfacets = true, axis = (title = "original",))
Notice that it works fine when the recipe produces a 2D Axis.