Baseball Scatter Plot, Hits and Homeruns, Brushing Added
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 descriptionThis 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.