Repository navigation
feat: show pitch locations on a strike zone diagram - #75
Open
alex-monroe wants to merge 1 commit into
Open
alex-monroe wants to merge 1 commit into
alex-monroe wants to merge 1 commit into
Conversation
Renders the current at-bat's pitches as numbered, color-coded markers plotted against the per-pitch strike zone bounds from MLB Stats API (pitchData.coordinates.pX/pZ + strikeZoneTop/Bottom). Sits between the matchup and at-bat panes in the live game view. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Owner
|
Hey thanks for the contribution. I like the compactness of this display a bit better than the previous attempt in the draft #54. A few comments and questions:
|
tnoff
added a commit
to tnoff/playball
that referenced
this pull request
Aug 14, 2026
… the pitch list Answers the review on paaatrick#75. Pitches further out than the plot goes were being clamped to its edge with nothing to say so, which is about one pitch in six: over 787 pitches from three games, 15% land outside. Surround the plot with a one cell ring that holds an arrow pointing the way the pitch carried on, so the number still says which pitch it was. Squeezing the ring inside the current footprint instead would have pushed 28% of pitches out to arrows, and trimming the plot back to nine rows tall would have doubled the vertical ones, so the ring is added around the outside and the view grows by two rows. Mark each pitch in the at-bat list with the same character and colour it carries in the plot, so the two can be read against each other. Number pitches by the API's pitchNumber rather than by their position in the plotted pitches, so that a pitch the API didn't locate doesn't shift every number after it and leave the list and the plot disagreeing. The plotting is now in src/strikeZone.js, next to the other game logic, where the tests can reach it. What went wrong in #54 is that the zone was drawn on hardcoded rows while pitches were mapped independently, so the two disagreed about where the edge of the zone was; the test that pins an edge pitch onto the drawn edge, for several batters' zones, is there to keep that from coming back. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renders the current at-bat's pitches as numbered, color-coded markers plotted against the per-pitch strike zone bounds from MLB Stats API (pitchData.coordinates.pX/pZ + strikeZoneTop/Bottom). Sits between the matchup and at-bat panes in the live game view.
