{ "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "data": { "url": "https://vega.github.io/vega-lite/data/countries.json" }, "description": "A ranged dot plot that uses 'layer' to convey changing life expectancy for the five most populous countries (between 1955 and 2000).", "encoding": { "y": { "axis": { "domain": false, "minExtent": 70, "offset": 5, "ticks": false, "title": "Country" }, "field": "country", "type": "nominal" } }, "layer": [ { "encoding": { "color": { "value": "#db646f" }, "detail": { "field": "country", "type": "nominal" }, "x": { "field": "life_expect", "type": "quantitative" } }, "mark": "line" }, { "encoding": { "color": { "field": "year", "legend": { "title": "Year" }, "scale": { "domain": [ 1955, 2000 ], "range": [ "#e6959c", "#911a24" ] }, "type": "ordinal" }, "opacity": { "value": 1 }, "size": { "value": 100 }, "x": { "axis": { "title": "Life Expectancy (years)" }, "field": "life_expect", "type": "quantitative" } }, "mark": { "filled": true, "type": "point" } } ], "transform": [ { "filter": { "field": "country", "oneOf": [ "China", "India", "United States", "Indonesia", "Brazil" ] } }, { "filter": { "field": "year", "oneOf": [ 1955, 2000 ] } } ] }