The docs explain how to write “type recipes”. Can you please provide a MWE with a completely new type? As you can see below, just following the instructions in the docs leads to errors:
import Makie
# custom type
struct Foo end
# type recipe definitions
Makie.plottype(::Foo) = Makie.Scatter
Makie.convert_arguments(::Foo) = (rand(100),)
# test plot
import GLMakie as Mke
Mke.plot(Foo()) # error
ERROR: `Makie.convert_arguments` for the plot type MakieCore.Scatter{Tuple{Foo}} and its conversion trait MakieCore.PointBased() was unsuccessful.
The signature that could not be converted was:
::Foo
Makie needs to convert all plot input arguments to types that can be consumed by the backends (typically Arrays with Float32 elements).
You can define a method for `Makie.convert_arguments` (a type recipe) for these types or their supertypes to make this set of arguments convertible (See http://docs.makie.org/stable/documentation/recipes/index.html).
Alternatively, you can define `Makie.convert_single_argument` for single arguments which have types that are unknown to Makie but which can be converted to known types and fed back to the conversion pipeline.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] convert_arguments(T::Type{MakieCore.Scatter{Tuple{Foo}}}, args::Foo; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Makie ~/.julia/packages/Makie/uAmck/src/conversions.jl:17
[3] convert_arguments(T::Type{MakieCore.Scatter{Tuple{Foo}}}, args::Foo)
@ Makie ~/.julia/packages/Makie/uAmck/src/conversions.jl:7
[4] plot!(scene::Makie.Scene, P::Type{Any}, attributes::MakieCore.Attributes, args::Foo; kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Makie ~/.julia/packages/Makie/uAmck/src/interfaces.jl:292
[5] plot!(scene::Makie.Scene, P::Type{Any}, attributes::MakieCore.Attributes, args::Foo)
@ Makie ~/.julia/packages/Makie/uAmck/src/interfaces.jl:275
[6] plot(P::Type{Any}, args::Foo; axis::NamedTuple{(), Tuple{}}, figure::NamedTuple{(), Tuple{}}, kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Makie ~/.julia/packages/Makie/uAmck/src/figureplotting.jl:48
[7] plot(P::Type{Any}, args::Foo)
@ Makie ~/.julia/packages/Makie/uAmck/src/figureplotting.jl:31
[8] plot(args::Foo; attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ MakieCore ~/.julia/packages/MakieCore/bttjb/src/recipes.jl:34
[9] plot(args::Foo)
@ MakieCore ~/.julia/packages/MakieCore/bttjb/src/recipes.jl:33
[10] top-level scope
@ REPL[9]:1
caused by: MethodError: no method matching convert_arguments(::Type{MakieCore.Scatter{Tuple{Foo}}}, ::Foo)
Closest candidates are:
convert_arguments(::Union{Type{Any}, Type{<:MakieCore.AbstractPlot}}, ::Any...; kw...)
@ Makie ~/.julia/packages/Makie/uAmck/src/conversions.jl:7
convert_arguments(::Union{Type{Any}, Type{<:MakieCore.AbstractPlot}}, ::Distributions.Distribution)
@ Makie ~/.julia/packages/Makie/uAmck/src/stats/distributions.jl:19
convert_arguments(::Union{Type{Any}, Type{<:MakieCore.AbstractPlot}}, ::IntervalSets.AbstractInterval, ::StatsBase.ECDF)
@ Makie ~/.julia/packages/Makie/uAmck/src/stats/ecdf.jl:27
...
Stacktrace:
[1] convert_arguments_individually(T::Type{MakieCore.Scatter{Tuple{Foo}}}, args::Foo)
@ Makie ~/.julia/packages/Makie/uAmck/src/conversions.jl:47
[2] convert_arguments(T::Type{MakieCore.Scatter{Tuple{Foo}}}, args::Foo; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Makie ~/.julia/packages/Makie/uAmck/src/conversions.jl:14
[3] convert_arguments(T::Type{MakieCore.Scatter{Tuple{Foo}}}, args::Foo)
@ Makie ~/.julia/packages/Makie/uAmck/src/conversions.jl:7
Notice that I can already define what the documentation calls “full recipes”, but I am now interested in simple “type recipes” to forward types to existing recipes.