Customization of bush handler
This example shows an interactive scatterplot of 800 random data points, where a brush control selects a range along the x-axis and highlights the corresponding circles in red. The brush’s resize handles are customized with triangular SVG paths, generated by a `triangleData` function that computes relative path coordinates for the `d` attribute, using D3 v3’s `d3.svg.brush`, `d3.scale.linear`, and `d3.svg.axis`. The static SVG rendering relies on a fixed viewport with margins and translucent styling for the brush extent and selected circles.
AI-generated descriptionBuilt with blockbuilder.org
Just as all of you know that the magic come from paht's d attribute. Using function triangleData to generate a string which contain the d's value, such as:
m 0,0 -10.717967697244909,40 21.435935394489817,0 z
that is: pt1=(0,0), pt2=(-10.717967697244909,40) and pt3=(21.435935394489817,0)
then an erect triangle-path is generated.
Lowercase commond indicates that sibling points' coordinates of d-value is relative coordinate. So point pt2 is based on pt1, and pt3 is based on pt2, then on and on.