Vega-Lite include a number of useful basic transforms. However, there are a number of transforms in Vega that can be migrated to the Vega-Lite level.
For each of this transform, we need to design syntax for the transform in Vega-Lite, which would not have type like in Vega, but always contains the transform name as one property of the transform (e.g., aggregate, filter, etc.)
[x] [flatten](https://vega.github.io/vega/docs/transforms/flatten/)
[x] impute
encoding -- https://github.com/vega/vega-lite/issues/3311[ ] pivot?
[ ] project ??
[ ] density & contour -- may need different syntax
[ ] countpattern
[ ] https://vega.github.io/vega/docs/transforms/identifier/~~
[ ] Collect (https://github.com/vega/vega-lite/issues/7017)
Sequence would be amazing for creating examples of mathematical functions. However, we have to decide whether it should go in data or transforms.
To me, sequence feels more natural as a special type of data source.
Yes, I think so too. It's just that Vega has it as a transform and I wanted to point out that it's not the most natural place and we can change that in Vega-Lite. Yet another reason to not just support all Vega transforms.
Sequence is covered in https://github.com/vega/vega-lite/issues/3864
Graticule is in https://github.com/vega/vega-lite/issues/3337
I don't think we need pivot in Vega-Lite, do we?
It's actually very useful. For example, with pivot, we can create "Multi Series Line Chart with Tooltip" with the stocks data (as the stocks data has a long format, but we need a pivoted format for "Multi Series Line Chart with Tooltip".
@kanitw I'm interested in submitting a PR to add pivot, but from a quick look at the code I'm not sure how to implement producedFields since they're generated from the data values. Should it just return an empty set, or would that cause issues?
@pjsier Thanks for looking into this. Figuring out the correct producedFields is super tricky here. I think we can only return null or {} in this case but we need to update the checks that use this field so that when we check for intersections and we have a pivot transform, we need to always say that there is an intersection. This will make it difficult to optimize the dataflow when there is a pivot transform.
@domoritz sounds good, thanks! I鈥檒l try to put together a PR with that setup
null or {} would seems like "nothing". I wonder if we should use a specific string literal "unknown" to make it explicit that we don't know at compile time.
Most helpful comment
It's actually very useful. For example, with
pivot, we can create "Multi Series Line Chart with Tooltip" with the stocks data (as the stocks data has a long format, but we need a pivoted format for "Multi Series Line Chart with Tooltip".