Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Vega-Lite API Template

Public visualization

Viewing a saved revision (read-only)

d06a22c23cb9478f99b9d0b5d6bcdca3

Vega-Lite API Template

0 stars0🌍 Public
NNelson M
Last edited Nov 18, 2023
Created on Nov 18, 2023

This example visualizes the relationship between fuel efficiency (mpg), horsepower, weight, and country of origin for automobiles from the UCI Machine Learning Repository Auto MPG dataset. It displays a scatter plot where each circle’s position encodes mpg and horsepower, color encodes origin, and size encodes weight. The code uses the Vega-Lite API to build the chart declaratively, with the `vl.markCircle`, `vl.x()`, `vl.y()`, and `vl.color()` methods. It loads CSV data via D3’s `csv` function, registers Vega-Lite components, and renders an interactive SVG with tooltips.

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.