Skip to main content
100%

10.-Vega-Lite API Template

✓ Published1🌍 Public
JJorge MataH
Last edited Oct 14, 2021
Created on Oct 14, 2021

This example shows the relationship between car origin and horsepower using a scatter plot of the auto-mpg dataset, with vehicle names displayed as tooltips. The visualization is built entirely through the Vega-Lite API, which constructs a specification programmatically via `vl.markCircle`, `vl.x().fieldN`, `vl.y().fieldQ`, and `vl.tooltip()`. The code registers Vega, Vega-Lite, and Vega-Lite API, then renders the chart as an SVG with `vl.register` and `marks.render()`, using custom axis and label styling from the config object. Data is loaded asynchronously with `d3.csv` from a GitHub gist.

AI-generated description

A visualization constructed using the vega-lite-api.

MIT Licensed

Similar vizzes