Open fatteneder opened 2 years ago
This has been the case for a while, I think, since GLMakie wants to convert any existing attribute to an OpenGL-compatible form. The function you're referencing essentially calls lift(gl_convert, s)
, and AFAIK there is no method to directly convert Symbols.
I ran into this issue back when I wrote MakieRecipes, and there should be some filtering code in there. I think the best way forward might just be to filter out all unused attributes at the GLMakie level.
I mean, you should really not add attributes to a plot it doesn't support ;)
But, there are still two problems here:
1) Plots should always error nicely for unsupported attributes
2) There should be an easy way to forward attributes in recipes, e.g. something like text!(plot, text_attrs, plot.text)
that then filters out applicable attributes.
GLMakie shouldn't filter out any attributes and it should also not throw weird internal errors. Ideally, it will only get plot objects which are already fully checked to only contain the correct attributes.
I mean, you should really not add attributes to a plot it doesn't support ;)
Agreed.
I guess we just need left/right joins on Attributes :D
This now errors due to attribute validation. Maybe this could be a useful example for what recipe/attribute tooling should handle for you
MWE
The above throws
The problem is that
maxwidth
is of type Symbol and it complains aboutgl_convert(::Symbol)
not being defined, althoughmethods(GLMakie.GLAbstraction.gl_convert)
shows an overload of typeWhy is this not enough?
No error is thrown if
CairoMakie
instead ofGLMakie
,Symbol
, e.g.maxwidth = 0.0
is fine,Symbol
andtext
consumes it, e.g. addingspace = :data
does not throw.Temporary workaround
Don't forward attriubtes of type
Symbol
that are not consumed by other plotting commands, e.g.Version