Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Vega-Lite API Template Practice

Public visualization

Viewing a saved revision (read-only)

91ba4d2878e74a56ae0a0374944e380f

Vega-Lite API Template Practice

0 stars1🌍 Public
JJames Rhodes
Last edited Feb 13, 2022
Created on Feb 13, 2022

This example demonstrates how to use the Vega-Lite API to create an interactive scatter plot of automotive data, mapping origin, horsepower, weight, and acceleration to visual channels. The visualization renders as an SVG. The code imports data from a CSV file via `d3.csv` and constructs the chart using `vega-lite-api` methods such as `markCircle` and `encode`, with `vega` and `vega-lite` registered for chart compilation. Tooltips are added through the `vega-tooltip` library, and the chart is configured to fit the browser window.

AI-generated description

A visualization constructed using the vega-lite-api.