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
SSunny
Last edited Aug 17, 2022
Created on Aug 17, 2022

This visualization displays automobile performance data from the UCI Machine Learning Repository’s Auto MPG dataset, plotting fuel efficiency (mpg) against horsepower with points colored by origin and sized by weight. Built with the Vega-Lite API, it uses `vl.markCircle`, `vl.x().fieldQ()`, and `vl.y().fieldQ()` to encode fields, while `vl.color().fieldN()` and `vl.size().fieldQ()` map additional variables. The code registers Vega-Lite with `vl.register` and configures a custom dark theme via `config.js`. Data is loaded asynchronously using D3’s `csv` function, and tooltips display car names through the vega-tooltip `Handler`. The chart renders responsively to 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