{ "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "data": { "sequence": { "as": "theta", "start": 0, "step": 0.1, "stop": 6.28 } }, "transform": [ { "as": "y", "calculate": "cos(datum.theta)" } ], "vconcat": [ { "encoding": { "x": { "axis": null, "field": "theta", "type": "quantitative" }, "y": { "axis": null, "field": "y", "type": "quantitative" } }, "mark": "line", "selection": { "brush": { "encodings": [ "x", "y" ], "init": { "x": [ 0.2, 6 ], "y": [ -0.8, 0.8 ] }, "type": "interval" } } }, { "encoding": { "x": { "field": "theta", "scale": { "domain": { "field": "theta", "selection": "brush" } }, "type": "quantitative" }, "y": { "field": "y", "scale": { "domain": { "encoding": "y", "selection": "brush" } }, "type": "quantitative" } }, "mark": "circle" } ] }