Skip to main content
100%

Fork of Baseball Hitting Metrics Dashboard

✓ Published1🌍 Public
NNita
Last edited Jul 22, 2025
Created on Jul 22, 2025

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 description

Baseball 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 number
  • exit_velo_mph_x: Exit velocity measurement
  • bat_speed_mph_contact_x: Bat speed at contact
  • attack_angle_contact_x: Attack angle measurement
  • hand_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

  1. Select your desired X-axis metric from the first dropdown
  2. Select your desired Y-axis metric from the second dropdown
  3. The chart will automatically update with smooth animations
  4. Hover over data points to see detailed information
  5. 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.

MIT Licensed

Similar vizzes