Skip to main content
100%

Baseball Scatter Plot, Hits and Homeruns, Brushing Added

✓ Published0🌍 Public
RRobert Johnson
Last edited Oct 19, 2021
Created on Oct 17, 2021
Forked from Brushing

This scatter plot visualizes the relationship between hits and home runs for baseball players, colored by league (red for AL, blue for NL, gold for FL). Viewers can brush horizontally along the x-axis to zoom into specific ranges of hits, triggering smooth transitions that rescale the axis and reposition circles. Built with D3 v4, the example uses `d3.brushX`, `d3.scaleLinear`, and `d3.axisBottom` to implement interactive zooming over the CSV dataset. The SVG rendering includes clipping to contain brushed selections within the plot area.

AI-generated description

This scatter plot shows hits and homeruns using the baseball dataset. For this iteration, I added brshing to the plot in the form of zooming in. I figured that with data like this, this sort of feauture would be a useful addition and a good way to incorporate brushing.

MIT Licensed

Similar vizzes