{ "transform": [ { "as": "OriginInitial", "calculate": "datum.Origin[0]" } ], "mark": "text", "data": { "url": "https://vega.github.io/vega-lite/data/cars.json" }, "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "encoding": { "color": { "field": "Origin", "type": "nominal" }, "text": { "field": "OriginInitial", "type": "nominal" }, "x": { "field": "Horsepower", "type": "quantitative" }, "y": { "field": "Miles_per_Gallon", "type": "quantitative" } }, "description": "A scatterplot showing horsepower and miles per gallon with country of origin double encoded by colour and text symbol." }