Run data transformer on other types of inputs
See original GitHub issueRight now, AFAIK, the data transformers are only run when a pandas dataframe is passed in: https://github.com/altair-viz/altair/blob/ee69e62c55847432178c2e52657b9cdcd98d8f43/altair/vegalite/v2/api.py#L26
However, I would like to be able to run a transformer when I pass in an ibis expression to a Chart. The transformer will take that ibis object and return a valid vega lite data dictionary.
The goal is for a user to easily compose visualizations from mapd expressions built with ibis, that are rendered with mapd’s vega renderer.
If Altair called the data transformer when it gets a recognized class, then I could get this to work. Another solution would be to expose a registry where users could register special transformations associated with difference classes. Then _prepare_data
could use this registry.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (8 by maintainers)
Top GitHub Comments
I can imagine that it would be helpful to run the data transformation on all data types. One way we might want to design that is using multiple dispatch:
https://github.com/mrocklin/multipledispatch
Then it becomes much easier to write different combinations of transformers that have different implementations for different data types. Much better than different data transformers each having a bunch if/case logic switching on the types. Thoughts?
OK – let me know if a use-case for this comes up and we can think about how to make the plugin more configurable.