Skip to main content
100%

Fork of Vega-Lite API Template

✓ Published0🌍 Public
Ttim10133222
Last edited Jan 2, 2023
Created on Jan 2, 2023

This example uses the Vega-Lite API to render an interactive scatter plot of the Auto MPG dataset from the UCI Machine Learning Repository. The visualization encodes miles per gallon on the x-axis, horsepower on the y-axis, with color representing the origin of the car, and point size mapped to vehicle weight. Tooltips display the car model name on hover. The code explicitly registers Vega, Vega-Lite, and Vega-Tooltip, then asynchronously loads CSV data via `d3.csv`, applies a custom `config` for axis labels and styling, and renders a full-window SVG using `vl.mar` with size and opacity encodings.

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