Skip to main content
100%

Fork of Vega-Lite API Template

✓ Published0🌍 Public
AAnomatomato
Last edited Dec 27, 2024
Created on Dec 27, 2024

This example visualizes the Auto MPG dataset from the UCI Machine Learning Repository, showing the relationship between miles per gallon, horsepower, and vehicle weight, with color distinguishing the origin of each car. It uses the Vega-Lite API to construct a scatter plot with circle marks, encoding quantitative fields for x and y positions and weight for size, while tooltips display the vehicle name on hover. The code registers Vega, Vega-Lite, and the Vega-Lite API, loads data via d3.csv, and configures axis and label styling for readability. Rendered as an SVG that fills the window, the visualization supports interactive tooltips via Vega Tooltip.

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