Skip to main content
100%

Brush & Zoom

✓ Published0🌍 Public
Aandressarg
Last edited Aug 29, 2018
Created on Aug 29, 2018

This example combines d3-brush and d3-zoom to create a focus + context visualization of S&P 500 monthly closing prices from 2000 to 2013. The main chart displays the full time series as a filled area plot with axes, while a smaller context chart below includes a brush that lets users select a time range. Brushing the context or zooming (via mouse wheel or drag) on the focus area updates the other interactively, with the x-scale of the focus view rescaling accordingly. The zoom behavior is constrained to the horizontal axis, and the two interactions are synchronized so that neither overrides the other. The visualization uses an SVG renderer with D3 v4.

AI-generated description

Brush & Zoom

Combining d3-brush and d3-zoom to implement Focus + Context. Another approach is to zoom to the brushed region.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/34f08d5e11952a80609169b7917d4172'>Brush & Zoom</a>

forked from <a href='http://bl.ocks.org/AlainRo/'>AlainRo</a>'s block: <a href='http://bl.ocks.org/AlainRo/542b063a12524a2f17d1005c1d4beb6e'>Brush & Zoom</a>

mit Licensed

Similar vizzes