Closed thomvet closed 2 months ago
@asinghvi17
I don't know how to do this well, so yeah one of the Makie devs would need to chime in.
In
https://github.com/SciML/SciMLBase.jl/blob/master/ext%2FSciMLBaseMakieExt.jl#L59
the function checks and returns an error if the plot is not point-based.
In this case you could define Makie.conversion_trait(::Type{<: MyPlot}) = Makie.PointBased()
to get it to work.
It would probably be useful to add some text to the error message about this...
I am closing this; decided to go another route with a wrapper type internal to my package. Like that I was able to dispatch on that type.
Describe the bug π
The SciMLBaseMakieExt causes Makie recipes using SciML types to fail miserably if not safe guarding against it.
Expected behavior
I would have expected that I am allowed to define my own plot type that takes a SciML type as input without further actions.
Minimal Reproducible Example π
Without MRE, we would only be able to help you to a limited extent, and attention to the issue would be limited. to know more about MRE refer to wikipedia and stackoverflow.
Error & Stacktrace β οΈ
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
The problem likely has to do with being a little, ahem..., liberal with dispatching
Makie.convert_arguments(...)
on to every plot type known to Makie: https://github.com/SciML/SciMLBase.jl/blob/master/ext/SciMLBaseMakieExt.jl#L38Dispatching like this also includes custom plot types (e.g., from recipes) to be included. Indeed, continuing the above MWE with:
It can be brought back to work. However, in my opinion, it doesn't really fell nice to impose this kind of "hack" on someone defining their own plot type with a recipe. Can the dispatch in SciMLBase maybe be narrowed down?