D3 Scatter Plot - Baseball
This D3 scatter plot visualizes the relationship between pitches faced (PA) and hit-by-pitches (HBP) for MLB players from the 2017 Standard Hitting Dataset, aiming to identify players frequently hit despite limited at-bats. The SVG rendering uses d3.csv to load remote data, d3.scaleLinear for axes, and d3.axisLeft/axisBottom for ticks, with circle marks positioned by mapping PA and HBP values to pixel coordinates. The plot filters out players with fewer than 100 at-bats and covers the full browser window, using window.innerWidth and window.innerHeight for sizing.
AI-generated descriptionA vanilla HTML implementation of a D3 scatter plot. Shows the 2017 Standard Hitting Dataset.
This scatterplot shows the HBP stats and Pitches against of players. Identifying players that get hit more in fewer at bats is fun because I hypothesize they will see some benefit to OBP since a HBP is on base. It also shows controversial players or players teams just do not like by looking at leaders in HBP.