Data transformations
Vega-Lite provides several data transformations using the transform property. Any arbitrary data transformation supported by Vega-Lite can be created in Deneb.jl using Transform, e.g.:
using Deneb
Transform(
aggregate=[(field=:Acceleration, op=:mean, as=:mean_acc)],
groupby=[:Cylinders],
)Deneb.TransformSpec:
[
{
"aggregate": [
{
"field": "Acceleration",
"op": "mean",
"as": "mean_acc"
}
],
"groupby": [
"Cylinders"
]
}
]
creates a Deneb.TransformSpec that contains the subspec for the transform property of an aggregate transformation.
The method above is rather verbose, Deneb.jl provides a number of convenient transform_* methods that facilitate the creation of data transformation subspecs. The previous aggregate transformation example could more conveniently be created using the transform_aggregate method.
transform_aggregate(mean_acc="mean(Acceleration)", groupby=:Cylinders)Deneb.TransformSpec:
[
{
"aggregate": [
{
"field": "Acceleration",
"op": "mean",
"as": "mean_acc"
}
],
"groupby": [
"Cylinders"
]
}
]
Currently Deneb.jl supports the following Vega-Lite data transformation via transform_* convenient methods: