Fork of Baseball Hitting Metrics Dashboard
This interactive dashboard visualizes relationships between baseball hitting metrics, including bat speed, exit velocity, attack angle, and hand speed. Users select metrics for the X and Y axes from dropdown menus, and the scatter plot updates with animated transitions using d3.transition. The React application loads CSV data with d3.csv and renders the chart as SVG, with hover tooltips displaying individual swing details such as session number and metric values. A ResizeObserver handles responsive sizing.
AI-generated descriptionBaseball Hitting Metrics Dashboard
An interactive data visualization dashboard for analyzing baseball hitting performance metrics using React and D3.js.
Overview
This dashboard provides an interactive scatter plot visualization that allows analysts and coaches to explore relationships between different hitting metrics from baseball swing data. Users can dynamically select which metrics to compare on the X and Y axes to identify patterns and correlations in hitting performance.
Features
- Interactive Scatter Plot: Visualize relationships between any two hitting metrics
- Dynamic Metric Selection: Choose from multiple batting metrics using dropdown selectors
- Responsive Design: Chart automatically adapts to different screen sizes
- Hover Tooltips: Get detailed information about individual data points
- Smooth Animations: Animated transitions when switching between metrics
- Session Tracking: Data points are organized by practice sessions and individual swings
Available Metrics
- Bat Speed (mph): Speed of the bat at contact with the ball
- Exit Velocity (mph): Speed of the ball immediately after leaving the bat
- Attack Angle (°): Angle of the bat at the moment of contact
- Hand Speed (mph): Maximum speed of the player's hands during the swing
Data Structure
The dashboard uses CSV data with the following key fields:
session_swing: Unique identifier for each swing (session_swingNumber)session: Practice session numberexit_velo_mph_x: Exit velocity measurementbat_speed_mph_contact_x: Bat speed at contactattack_angle_contact_x: Attack angle measurementhand_speed_mag_max_x: Maximum hand speed
Technology Stack
- React 19: Modern UI framework with hooks
- D3.js v7: Data visualization and DOM manipulation
- CSS3: Responsive styling with flexbox and grid
- ES6 Modules: Modern JavaScript module system
Key Components
- HittingMetricsChart: Main orchestrator component
- ScatterPlot: Reusable D3 chart implementation
- MetricSelector: Interactive dropdown controls
- Tooltip: Hover information display
- Custom Hooks: Data loading and responsive dimensions
Usage
- Select your desired X-axis metric from the first dropdown
- Select your desired Y-axis metric from the second dropdown
- The chart will automatically update with smooth animations
- Hover over data points to see detailed information
- Each point represents one swing, colored consistently across sessions
Insights
This visualization helps identify:
- Correlations between different hitting mechanics
- Performance consistency across sessions
- Optimal ranges for different metrics
- Outliers and exceptional performances
- Training progress over time
The dashboard is designed for baseball coaches, analysts, and players to make data-driven decisions about hitting technique and training focus areas.