Skip to main content
100%

Vega-Lite API Example

✓ Published0🌍 Public
DDaniel Lauzon
Last edited Mar 12, 2021
Created on Mar 12, 2021

This example demonstrates a line chart visualizing numerical values over time, with data sourced from an Auto MPG dataset and individual time-stamped observations. The visualization is constructed programmatically using the `vega-lite-api`, which provides a fluent JavaScript interface for defining Vega-Lite specifications. After fetching data using the `json` function from `d3`, the chart is rendered as an SVG through the `vega` and `vega-lite` libraries, with a custom tooltip handler integrated for interactive exploration. The chart is configured to fit the window size, and styling is adjusted for readability.

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.

MIT Licensed

Similar vizzes