Fork of Vega-Lite API Template
This example visualizes the Auto MPG dataset from the UCI Machine Learning Repository, plotting each car’s miles per gallon against its horsepower. Points are colored by country of origin and sized by vehicle weight, with tooltips revealing the car model. The visualization is built programmatically using the Vega-Lite API, where `vl.markCircle` and `vl.encode` define the marks, while `vl.x().fieldQ` and `vl.y().fieldQ` map quantitative fields. Data is loaded asynchronously via `d3.csv`, and the script’s `index.js` renders the chart into an SVG using the `vega` and `vega-lite` engines.
AI-generated descriptionA visualization constructed using the vega-lite-api.
The data shown here comes from the UCI Machine Learning Repository: Auto MPG Data Set, via Gist: Scatter Plot with Menus.