block by hwangmoretime 06aa7e108b77745f1f24

Point Tracking for Non-Linear Lines: II

Full Screen

What This Shows

Using data from the US Census, this visualization displays popular names that have historically been androgynous.

Technical

Control points are not intersected by the path for several non-linear interpolations for lines (“basis” in this case). Because of this, point tracking for non-linear lines should be calculated from the svg-path rather than from the d3-scales. Mike Bostock has two examples showing how to do this with a single path. This gist shows one approach for point tracking with multiple paths. Other approaches are shown here and here.

This approach uses on-the-fly closestPoint to select both the line and point to highlight. Each move the mouse requires computing the distance to each point on the chart, thus the noted performance difference for differing number of lines shown.

index.html

steady_andro.csv