hvega-0.12.0.7: tests/specs/windowtransform/window2.vl
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"url": "https://vega.github.io/vega-lite/data/movies.json"
},
"layer": [
{
"encoding": {
"x": {
"axis": {
"title": "IMDB Rating"
},
"field": "IMDB_Rating",
"type": "quantitative"
},
"y": {
"field": "Title",
"type": "ordinal"
}
},
"mark": "bar"
},
{
"encoding": {
"x": {
"aggregate": "mean",
"field": "AverageRating",
"type": "quantitative"
}
},
"mark": {
"color": "red",
"type": "rule"
}
}
],
"transform": [
{
"filter": "datum.IMDB_Rating != null"
},
{
"frame": [
null,
null
],
"window": [
{
"as": "AverageRating",
"field": "IMDB_Rating",
"op": "mean"
}
]
},
{
"filter": "(datum.IMDB_Rating - datum.AverageRating) > 2.5"
}
]
}