hvega-0.5.0.0: tests/specs/windowtransform/window4.vl
{
"transform": [
{
"filter": "datum.IMDB_Rating != null"
},
{
"filter": {
"field": "Release_Date",
"range": [
null,
{
"year": 2019
}
]
}
},
{
"window": [
{
"op": "mean",
"as": "AverageRating",
"field": "IMDB_Rating"
}
],
"frame": [
null,
null
]
},
{
"as": "RatingDelta",
"calculate": "datum.IMDB_Rating - datum.AverageRating"
}
],
"mark": {
"strokeWidth": 0.3,
"opacity": 0.3,
"type": "point"
},
"data": {
"url": "https://vega.github.io/vega-lite/data/movies.json",
"format": {
"parse": {
"Release_Date": "date:'%d-%b-%y'"
}
}
},
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"encoding": {
"x": {
"field": "Release_Date",
"type": "temporal"
},
"y": {
"field": "RatingDelta",
"type": "quantitative",
"axis": {
"title": "Residual"
}
}
}
}