Skip to main content
100%

Fork of Vega-Lite API Template

✓ Published0🌍 Public
MMuhammadAaqib137
Last edited Apr 4, 2021
Created on Apr 4, 2021

This example displays a scatter plot of auto-mpg data, where each point represents a car, with engine displacement on the x-axis, horsepower on the y-axis, and color encoding the country of origin. The point size is also encoded by the vehicle’s weight, with tooltips revealing the car’s name on hover. The visualization is built using the Vega-Lite API, which constructs a Vega-Lite specification programmatically, and is rendered with Vega’s SVG renderer. Data is loaded asynchronously from the UCI Machine Learning Repository via D3’s `csv` function, and the tooltip interaction is handled through `vega-tooltip`’s `Handler`.

AI-generated description

A 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.

MIT Licensed

Similar vizzes