{ "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "data": { "url": "https://vega.github.io/vega-lite/data/population.json" }, "description": "A vertical 2D box plot showing median, min, and max in the US population distribution of age groups in 2000.", "encoding": { "x": { "field": "age", "type": "ordinal" } }, "layer": [ { "encoding": { "y": { "axis": { "title": "Population" }, "field": "lowerWhisker", "type": "quantitative" }, "y2": { "field": "lowerBox" } }, "mark": { "style": "boxWhisker", "type": "rule" } }, { "encoding": { "y": { "field": "upperBox", "type": "quantitative" }, "y2": { "field": "upperWhisker" } }, "mark": { "style": "boxWhisker", "type": "rule" } }, { "encoding": { "size": { "value": 5 }, "y": { "field": "lowerBox", "type": "quantitative" }, "y2": { "field": "upperBox" } }, "mark": { "style": "box", "type": "bar" } }, { "encoding": { "color": { "value": "white" }, "size": { "value": 5 }, "y": { "field": "midBox", "type": "quantitative" } }, "mark": { "style": "boxMid", "type": "tick" } } ], "transform": [ { "aggregate": [ { "as": "lowerWhisker", "field": "people", "op": "min" }, { "as": "lowerBox", "field": "people", "op": "q1" }, { "as": "midBox", "field": "people", "op": "median" }, { "as": "upperBox", "field": "people", "op": "q3" }, { "as": "upperWhisker", "field": "people", "op": "max" } ], "groupby": [ "age" ] } ] }