{ "transform": [ { "as": "Year", "calculate": "year(datum.Year)" } ], "data": { "url": "https://vega.github.io/vega-lite/data/cars.json" }, "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "layer": [ { "mark": "circle", "selection": { "CylYr": { "init": { "Cylinders": 4, "Year": 1977 }, "bind": { "Cylinders": { "max": 8, "input": "range", "name": "Cylinders ", "step": 1, "min": 3 }, "Year": { "max": 1981, "input": "range", "name": "Year ", "step": 1, "min": 1969 } }, "type": "single", "fields": [ "Cylinders", "Year" ] } }, "encoding": { "color": { "value": "grey", "condition": { "field": "Origin", "selection": "CylYr", "type": "nominal" } } } }, { "transform": [ { "filter": { "selection": "CylYr" } } ], "mark": "circle", "encoding": { "color": { "field": "Origin", "type": "nominal" }, "size": { "value": 100 } } } ], "encoding": { "x": { "field": "Horsepower", "type": "quantitative" }, "y": { "field": "Miles_per_Gallon", "type": "quantitative" } }, "description": "Drag the sliders to highlight points" }