Skip to main content
100%

Vega-Lite API Template testing

✓ Published0🌍 Public
AAndy Maes
Last edited Mar 3, 2021
Created on Mar 3, 2021

This visualization displays the Auto MPG dataset from the UCI Machine Learning Repository, plotting each car as a circle positioned by miles per gallon on the x-axis and country of origin on the y-axis, with color encoding horsepower. Built with the Vega-Lite API, the example demonstrates a programmatic approach to declarative chart construction, where the visualization specification is defined using the `vl` object's methods like `markCircle` and `encode`. The code registers Vega, Vega-Lite, and the API with `vl.register`, loads CSV data via `d3.csv`, and renders an SVG that fits the full window. Custom axis styling and tooltips via `vega-tooltip` enhance readability.

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