-
Notifications
You must be signed in to change notification settings - Fork 29
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
More precise encoding types #506
Comments
We definitely need to use precise types (i.e., Your second idea on merging x: { field: "start", axis: "top" },
xe: { field: "end", axis: "none" },
// we should pick only one of two axis properties internally This uncertain and wrong spec can be prevented by using your idea, i.e., x: { start: "start", end: "end", axis: "top" } // axis can be defined only once We use at most four different field names for a single axis— x: { start: "start", end: "end", start2: "start2", end2: "end" } Users can still specify only one field as is: x: { field: "position", ... } I also like how it could end up in gos (i.e., I don't see any downside of this approach from the end-users point of view for now and can think about it more while supporting the explicit channel types. Vega-Lite uses separate channels as we currently do (i.e., |
I had this example in mind as well!
I'm curious if this is related to the multiple data-types that |
Right now all the track encoding fields (
x
,y
,color
, etc) reuse theChannel
definition; however, not all possible Channel definitions are supported for each encoding field.Some examples of definitions that are completely valid by the schema but have no meaning and aren't supported.
Right now we implicitly rely on convention to ensure that users don't make these mistakes. But we could could make unique types for each encoding field that capture the boundaries of what is allowed.
For example, if "x" and "xe" only allow for
"type": "genomic"
then there is no point in forcing users to specify a type: it can only be genomic. Similar for "y": a user just needs to specify the field name if only one "type" is supported.This also lends itself to being more expressive per definition, and refining types for the domain use case. e.g.
in gos this would end up looking something like:
and we could even make shorthand parsing that turns this into:
The text was updated successfully, but these errors were encountered: