-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support extension/addon mechanism for creating custom marks #3187
Comments
Thanks for writing this up @joelostblom. Yeah, I agree it would be great to figure out a Python extension point. Something I'm not sure of yet is what API a custom mark has to work with. Should a custom mark simply produce a combination of regular Vega-Lite marks (maybe in a "layer" container)? We could allow registration of custom If we figure out an extension point that allows altair_tiles to remain a standalone package but feel built into Altair, then I would guess we would find other uses for it. I wonder if we could implement some of the gridded data support we've talked about using a custom |
I would imagine that something like pandas "official" version of monkey patching or pandas_flavor would be best with the current API. This is an area where the |
Really cool ideas! I'm having trouble making up my mind about the API for altair_tiles so I definitely appreciate the brainstorming here (see also vega/altair_tiles#8). So far I thought that
Of course a But maybe I'm trying too hard to keep the Altair API in line with Vega-Lite. |
I think it would be really helpful if it was possible to create custom marks outside altair/vega-lite that would be accessible through separate packages.
ggplot
has a similar mechanism where anyone can create ageom
that is compatible with the baseggplot
canvas, e.g. https://ggforce.data-imaginist.com/reference/geom_sina.html.This could either happen at the vega-lite or altair level. An advantage with having it on the vega-lite level is that it becomes available in all languages that has a VL wrapper, not just python. An advantage with having it on the altair level is that it lower the barrier of entry for contributions significantly and provides access to a more powerful (scientific) ecosystem of other packages that could be used to create the marks (e.g. it would be easy to implement something like this vega/vega-lite#8067, in fact I already have a python implementation for that but I have a poor knowledge of what would be required to implement that directly in VL). This would also allow something like altair_tiles to integrate directly with altair as its own mark
In contrast to ggplot where each geom is a separate global function, this will be trickier in altair since marks are method on the base Chart class. I am not sure what an implementation would look like, maybe some monkey patching like this or using a library like mock or wrapt?
I believe we discussed this sometime in the past, but I couldn't find a dedicated issue for it. I also remember talking to @nicolaskruchten about something like this in the past
The text was updated successfully, but these errors were encountered: