Vega-lite: Include other useful transforms from Vega

Created on 15 Jan 2018  路  11Comments  路  Source: vega/vega-lite

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.)

Definitely useful

Data source

  • Graticule (#3337)
  • Sequence -- not sure if it should be a transform though -- perhaps more like a different kind of data source (#3864)

Probably useful?

Area - Data & Transform Help Wanted P3

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".

All 11 comments

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.

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.

Was this page helpful?
0 / 5 - 0 ratings