Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Vega-Lite API Template

Public visualization

Vega-Lite API Template

0 stars0🌍 Public
Zzhangwbhi
Last edited Aug 2, 2021
Created on Aug 2, 2021

This example visualizes the relationship between fuel efficiency (mpg), horsepower, weight, and country of origin for cars from the UCI Machine Learning Repository’s Auto MPG dataset. It uses the Vega-Lite API to compose a scatter plot with colored points by origin, sized by weight, and includes tooltips showing car names. The code registers the API with Vega and Vega-Lite, then fetches CSV data via D3’s `csv` method, applying a custom dark theme for readability. The view renders to SVG and fits the window dimensions.

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.

Comments

Sign in to join the discussion.

MIT Licensed