Brush Slider Test
This example demonstrates a brush-style slider for selecting a numeric range from 0 to 100, displaying the current selection as two numbers above the axis. Built with D3 v4, it uses a `d3.brushX` brush on an SVG element with a `d3.axisBottom` scale. The brush’s extent is initialized to [20, 50] via `brush.move`, and the `brushed` event handler retrieves the selection using `d3.brushSelection`, then maps it back to the scale with `x.invert` to update the displayed values. The rendered output is an SVG axis with a movable brush handle, serving as a filter for downstream charts.
AI-generated descriptionUpdate 1/27/2017
This has been updated to d3.js v4 with comments explaining some of the changes. Brushes have been one of the more difficult aspects of moving from v3 to v4, but updating this block has clarified a lot for me.
Testing a brush-style slider, loosely based on Mike Bostock's <a href="https://bl.ocks.org/mbostock/4349545">Brush Handles example.</a>
The number feedback at the top can be sent to a chart as a filter.