Skip to content
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

Infer quantitative and temporal types for encoding fields #8081

Open
joelostblom opened this issue Mar 30, 2022 · 1 comment
Open

Infer quantitative and temporal types for encoding fields #8081

joelostblom opened this issue Mar 30, 2022 · 1 comment

Comments

@joelostblom
Copy link
Contributor

I noticed that when using datum in an encoding field, the type is inferred automatically:

image

When using a column/field name instead of datum the default is nominal regardless of the type of values in the data. I am guessing this is because the data values are not necessarily directly present in the VegaLite spec (could be a URL e.g.). I wonder if it would be possible to do a lookup similar to the transform_calculate + datum[column_name] approach demonstrated in #7365 (comment) to inspect at the first value of each field/column in the data, and then infer the type of that value using the same rules as datum is currently using and apply it as the default type for that encoding field?

@domoritz
Copy link
Member

Yes, I had this idea before and what we need is infrastructure for tracking data through transforms and to encodings. It would need someone to dig into the compiler a bit deeper but it should be totally doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants