Skip to main content
Public

Share visualization

Loading preview…

Fork of Vega-Lite API Template

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Fork of Vega-Lite API Template

0
PPeter Williams
Last edited Oct 28, 2021
Created on Oct 28, 2021

This example visualizes the relationship between vehicle displacement, horsepower, weight, and model year in the classic Auto MPG dataset. A scatter plot of displacement against horsepower uses circle size to encode weight and color to distinguish model years, with hovering revealing each car’s name. Built with the Vega-Lite API, it composes marks and encodings programmatically via `vl.markCircle` and `vl.encode`, then renders through Vega and Vega-Lite with a custom tooltip handler. The data loads asynchronously from a gist CSV using d3’s `csv` function, and the chart fills the browser window with a customized dark-on-light theme.

AI-generated description

A visualization constructed using the vega-lite-api.

Comments

Sign in to join the discussion.

MIT Licensed