North Shore Navigators Offensive Shiny App
At the end of the 2024 season, I created a Shiny App utilizing Trackman data to generate extensive reports featuring spray charts (with batted ball type denoted by color), a rolling wOBA chart, pitch-based statistics, and dexterity-based statistics. The interface allows the user to sort by specific plate appearance ranges and by player.
I created this app for the purpose of providing a central location for information and reports on all Navigators’ position players throughout the season, acting as a singular consolidated information system for the entire group of position players.
Example spray chart, which is one of 5 tabs of the app. I created the plot using ggplot — batted ball types are color coded. Users can sort by specific plate appearance ranges, if they wish to sort by a specific period of time.
The spray charts can help the user visualize batted ball trends over time, and, generally, the quality of the batted ball, helping to determine if a hitter was getting “lucky” or “unlucky” without immediately looking at expected stats or ball flight metrics.
The app includes a rolling wOBA chart, going chronologically by plate appearance number. My wOBA weights were calculated through a run expectancy matrix for the NECBL, assigning weights based on the league offensive environment.
The code first filters and arranges the data in ascending order by plate appearance number, ensuring the chronological sequence for accurate calculations.
To prevent errors, I included a conditional check to handle cases where the data is either empty or lacks valid values.
A rolling wOBA chart works well at highlighting short-term shifts that a cumulative total can obscure—emphasizing recent changes and making it easier to identify hot streaks, slumps, and volatility.
On the left is a dexterity-based statistics tab, allowing the user to sort by the batter’s splits versus lefties and righties in a data table. Again, the rate statistics are color-coded in a similar fashion based on league-wide offensive rates.
Looking at overall dexterity-based splits can offer insights into player development, identifying areas for improvement and training methods, and determining what to work on.
To the left is a data table containing a variety of statistics sorted by pitch type. The rate statistics, at the end of the table, were color-coded by green (great), yellow (average), and red (poor), which were done in accordance with league-wide offensive rates.
Similarly to the pitch-based statistics and dexterity-based statistics, there is also a tab that separates both further, displaying data tables showing statistics against each pitch type, further broken down by dexterity (e.g. slider from lefties, slider from righties). The rate statistics are color-coded based on league-wide offensive rates.
Looking at the pitch types separated by dexterity allows for a more detailed understanding of what pitches a batter sees well out of the hand, revealing how a batter handles not only certain pitch types but also variations in spin and release point that may differ from lefties and righties.