Skip to main content
100%

vega-lite API example: cross-filter

✓ Published0🌍 Public
EEE2dev
Last edited Aug 18, 2020
Created on Aug 18, 2020

This example shows three linked histograms for interactive cross-filtering of flight delay, distance, and time data from the flights-5k dataset. Each histogram supports a brush selection on its x-axis, and selecting a range in one chart filters the other two to show only matching records. The visualization uses the vega-lite-api to programmatically build the specification, composing transparent base layers with filtered bar layers, then renders the result via vegaEmbed. The code also calculates a time field from the date using the `calculate` transform, and applies `vl.selectInterval` for brush definitions.

AI-generated description

Converted from : https://observablehq.com/@vega/vega-lite-cross-filter-example?collection=@vega/vega-lite-api

A very simple example of how to run the wonderful JavaScript API for vega-lite directly in the browser. This one uses vegaEmbed to render the chart. The key is to use the api to generate the spec, and then vegaEmbed to render it.

Built with blockbuilder.org

forked from <a href='http://bl.ocks.org/john-guerra/'>john-guerra</a>'s block: <a href='http://bl.ocks.org/john-guerra/d6f1c4fc6473f78dd1b900145f8b63df'>vega-lite JavaScript API browser example</a>

forked from <a href='http://bl.ocks.org/john-guerra/'>john-guerra</a>'s block: <a href='http://bl.ocks.org/john-guerra/a90b26fc3c99a925b05d51a479c16af2'>vega-lite JavaScript API browser example with vegaEmbed</a>

forked from <a href='http://bl.ocks.org/EE2dev/'>EE2dev</a>'s block: <a href='http://bl.ocks.org/EE2dev/93076c6db5ed91ba2275767ba6809476'>vega-lite JavaScript API browser example with vegaEmbed</a>

forked from <a href='http://bl.ocks.org/EE2dev/'>EE2dev</a>'s block: <a href='http://bl.ocks.org/EE2dev/9e9bf25ead1d3d71fae033ca177ce9a9'>vega-lite JavaScript API browser example with vegaEmbed</a>

forked from <a href='http://bl.ocks.org/EE2dev/'>EE2dev</a>'s block: <a href='http://bl.ocks.org/EE2dev/d3f04f7cd9f33f4753080177fda33b2d'>vega-lite API example: cross-filter</a>

mit Licensed

Similar vizzes