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:

TransformMethodExamples
Aggregatetransform_aggregate()Locations of airports, Connections among U.S. Airports, Ridgeline plot
Bintransform_bin()Ridgeline plot
Calculatetransform_calculate()Line chart, Scatterplot with links, Isotype with emoji, Percent of total, Earthquakes, Encoding channels binding, Waterfall chart, ...
Densitytransform_density()Violin plot, Stacked density estimates
ExtentNot implemented yet
Filtertransform_filter()Population pyramid, Interactive average, Interactive Input Binding (dropdown, range, checkbox, radio widgets), Earthquakes, Connections among U.S. Airports, ...
FlattenNot implemented yet
Foldtransform_fold()Comet chart, Parallel coordinates, Scatterplot with polynomial fit
Imputetransform_impute()Ridgeline plot
Join Aggregatetransform_joinaggregate()Ridgeline plot, Percent of total
Loesstransform_loess()Scatterplot with loess lines
Lookuptransform_lookup()Choropleth map, Connections among U.S. Airports
Pivottransform_pivot()Comet chart
QuantileNot implemented yet
Regressiontransform_regression()Scatterplot with polynomial fit
SampleNot implemented yet
StackNot implemented yet
Time Unittransform_timeunit()Ridgeline plot
Windowtransform_window()Scatterplot with rolling mean, Waterfall chart, Cumulative frequency distribution, Parallel coordinates, Isotype with emoji