{ "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "config": { "view": { "stroke": null } }, "data": { "url": "https://vega.github.io/vega-lite/data/cars.json" }, "description": "Drag a rectangular brush to show (first 20) selected points in a table.", "hconcat": [ { "encoding": { "color": { "condition": { "field": "Cylinders", "selection": "brush", "type": "ordinal" }, "value": "grey" }, "x": { "field": "Horsepower", "type": "quantitative" }, "y": { "field": "Miles_per_Gallon", "type": "quantitative" } }, "mark": "point", "selection": { "brush": { "type": "interval" } } }, { "encoding": { "text": { "field": "Horsepower", "type": "nominal" }, "y": { "axis": null, "field": "rowNumber", "type": "ordinal" } }, "mark": "text", "title": "Engine power", "transform": [ { "filter": { "selection": "brush" } }, { "window": [ { "as": "rank", "op": "rank" } ] }, { "filter": { "field": "rank", "lt": 20 } } ] }, { "encoding": { "text": { "field": "Miles_per_Gallon", "type": "nominal" }, "y": { "axis": null, "field": "rowNumber", "type": "ordinal" } }, "mark": "text", "title": "Efficiency (mpg)", "transform": [ { "filter": { "selection": "brush" } }, { "window": [ { "as": "rank", "op": "rank" } ] }, { "filter": { "field": "rank", "lt": 20 } } ] }, { "encoding": { "text": { "field": "Origin", "type": "nominal" }, "y": { "axis": null, "field": "rowNumber", "type": "ordinal" } }, "mark": "text", "title": "Country of origin", "transform": [ { "filter": { "selection": "brush" } }, { "window": [ { "as": "rank", "op": "rank" } ] }, { "filter": { "field": "rank", "lt": 20 } } ] } ], "resolve": { "legend": { "color": "independent" } }, "transform": [ { "window": [ { "as": "rowNumber", "op": "row_number" } ] } ] }