{ "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "repeat": { "column": [ "distance", "delay", "time" ] }, "spec": { "data": { "format": { "parse": { "date": "date" } }, "url": "https://vega.github.io/vega-lite/data/flights-2k.json" }, "description": "Cross-filter.", "encoding": { "x": { "bin": { "maxbins": 20 }, "field": { "repeat": "column" }, "type": "quantitative" }, "y": { "aggregate": "count", "type": "quantitative" } }, "layer": [ { "mark": "bar", "selection": { "myBrush": { "encodings": [ "x" ], "type": "interval" } } }, { "encoding": { "color": { "value": "goldenrod" } }, "mark": "bar", "transform": [ { "filter": { "selection": "myBrush" } } ] } ], "transform": [ { "as": "time", "calculate": "hours(datum.date)" } ] } }