Skip to main content
100%

Vega-Lite API test

✓ Published0🌍 Public
HHalcyonWjr
Last edited Jun 1, 2022
Created on Jun 1, 2022

This example visualizes the relationship between fuel efficiency (mpg), horsepower, weight, and origin using the Auto MPG dataset from the UCI Machine Learning Repository. A scatter plot displays each car as a circle, with position encoding mpg and horsepower, color indicating origin, and size mapping to weight. Hovering reveals the car name via tooltip. Built with the Vega-Lite API, the code registers vega and vega-lite, configures SVG rendering, and customizes axis and label styling through a configuration object. Data is loaded asynchronously via d3.csv from a Gist, with the visualization sized to fit the viewport.

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