Fork of Vega-Lite API Template
This example demonstrates a scatter plot of U.S. city fuel efficiency data from the UCI Machine Learning Repository's Auto MPG dataset, encoding vehicle weight as point size and color by country of origin against highway miles per gallon and horsepower. The visualization uses the Vega-Lite grammar via the vega-lite-api JavaScript library, which wraps Vega-Lite specifications for programmatic chart construction. The code pulls CSV data using d3.csv, then renders the interactive SVG chart with tooltip support through vega-tooltip, customizing axis and label styling through a configuration object. The visualization is built with Vega 5 and Vega-Lite 4, running in a browser with automatic width and height fitting to the viewport.