Vega-Lite API Template for practise
This example demonstrates how to build interactive scatter plots using the Vega-Lite API in a D3.js context. The visualization displays automobile data from the UCI Machine Learning Repository’s Auto MPG dataset, plotting horsepower against the car’s origin with tooltips showing vehicle names. The code uses the `vega-lite-api` library to construct the chart programmatically, registering it with Vega and Vega-Lite, and applies a custom configuration for axis styling and fonts. Data loading relies on `d3.csv` to fetch the dataset, while Vega Tooltip handles interactive hover information.
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.