Skip to main content
Public

Share visualization

Loading preview…

Hello Vega Lite API

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

Hello Vega Lite API

0
Hhotdoujiang
Last edited Sep 12, 2019
Created on Sep 12, 2019

This example maps zip code locations across the United States as an interactive canvas visualization. It uses the Vega-Lite API (vl) to define a circle mark with longitude and latitude encodings, projecting the data with the Albers USA projection. The D3 library supplies a categorical color scale generated from hue, chroma, and lightness (hcl) values, assigning a distinct color per first two digits of each zip code. The final Vega view is rendered to a HiDPI canvas with a scale factor of three for retina displays. The underlying data is loaded from a remote CSV of zip codes.

AI-generated description

An example starting point for working with vega-lite-api. Derived from Observable: vega-lite-api.

Implements HiDPI Canvas.

Comments

Sign in to join the discussion.

MIT Licensed