DEV Community

Cover image for Streamlit Dashboard: Let's analyse how Virat Kohli performs!
Dhanush D
Dhanush D

Posted on

Streamlit Dashboard: Let's analyse how Virat Kohli performs!

๐Ÿ Player Analytics: An Interactive Dashboard for Cricket Lovers

Hi, I'm Dhanush Devadiga โ€” a front-end developer and passionate analyst. But at the same time, Iโ€™m also a cricket enthusiast and a fan of Virat Kohli, arguably the best batsman in the world today.

So, I thought, why not combine my love for cricket and data? Thatโ€™s how I built Player Analytics, an interactive dashboard to analyze player performance, provide insights, and even predict future outcomes.


GitHub repo: https://github.com/dhanushd1998/streamlit-cricket-performance-dashboard.git
Live Demo: https://dhanushd1998-cricket-performance-dashboard-main-ejl7hp.streamlit.app/
Data Set on Kaggle: https://www.kaggle.com/code/dhanush1998/virat-kohli-performance-dashboard-analytics
youTube: https://lnkd.in/gBy-rdXq

๐ŸŽจ UI & Design Highlights

  • Page Title: Set to โ€œPlayer Analyticsโ€ for easy tab identification.
  • Favicon: A cricket themed logo serves as a visual identifier.
  • Layout: Wide mode enabled for better screen utilization.
  • Theme: Customized using config.toml to reflect Indiaโ€™s blue jersey and a dark mode aesthetic.
  • Sidebar: Starts collapsed by default and is reserved strictly for navigation via radio buttons.

๐Ÿ“Š Understanding the Dashboard

On initial load, the Cricket Performance Dashboard is visible. If youโ€™re not a cricket follower, hereโ€™s some context:

Cricket has three primary formats:

  • ODI (One Day Internationals) โ€“ the most popular
  • Test Matches โ€“ the longest format
  • T20 (Twenty20) โ€“ the shortest and most fast-paced

Virat Kohli is a three-format player, so his data spans across all these formats.


๐Ÿ” Dynamic Tabs & Metrics

The dashboard allows users to:

  • Switch between formats (ODI, Test, T20) using tabs.
  • Automatically update plots and metrics according to the selected format.

Key Metrics Displayed:

  • Total Runs
  • Matches Played
  • Average Strike Rate
  • Best Score
  • Number of Hundreds (100s)
  • Number of Fifties (50s)

๐Ÿ‘ค About Tab

This page gives a short introduction of the cricketer being analyzed โ€” essential to establish context for the user.


๐Ÿ”ฎ Score Predictor

This page showcases cascading filter criteria to introduce predictive analytics.

How it works:

  • Select Match Type, Opposition, and Ground.
  • Based on historical data, the model predicts a potential score.

The filter values are dependent:

  • For example, choosing ODI and England shows Indian or English grounds.
  • Choosing T20 and Ireland filters the ground to Malahide in Ireland.

๐Ÿ“‹ Interactive Data Table

Features include:

  • Filtering by match type
  • Sorting by date (newest/oldest)
  • Filtering by opposition
  • Year range selection using a slider
  • Download filtered data as CSV

๐Ÿงช Example:

Filter for all T20 matches against England and Australia between 2010โ€“2020 โ€” and easily download the results.


๐Ÿ“ˆ Visualizations

1. Area Plot โ€” Runs Scored vs Year

  • Configuration hidden inside a Streamlit expander for a cleaner UI.
  • Allows selection of a year range to analyze performance trends.

2. Spider Plot โ€” Matches by Country

  • Visualize the number of matches played against top N countries.
  • Default is top 6 countries.
  • Helps identify dominant matchups.

3. Bar Plot โ€” Top 5 Scoring Grounds

  • Test: Highest runs at Adelaide
  • ODI: Highest runs at Mirpur

4. Vertical Bar Plot โ€” Runs by Batting Position

  • T20: Highest runs at No. 3 position
  • Test: Highest at No. 4
  • Helps understand role evolution and effectiveness by position.

5. Line Chart โ€” Total Runs Over Time

  • Select a year range to view trends.
  • From 2010โ€“2020: Notable 56.68% dip (possibly due to COVID-19).
  • From 2008โ€“2010: Positive upward trend.

๐Ÿง  Why Cricket Analytics Matters

In a billion-dollar sport where every run counts, data-driven insights are crucial. This dashboard transforms raw match data into actionable intelligence.

Cricketlytics (Cricket + Analytics) is on the rise โ€” used by analysts, broadcasters, coaches, and fans alike.


โš ๏ธ Current Drawbacks

  • Data is preloaded from a static CSV
  • No real-time data or API integration
  • Lacks light/dark mode switching
  • Best viewed on desktop, not optimized for mobile yet

๐Ÿš€ Future Enhancements

  • API Integration for live stats
  • Advanced AI Models for score predictions
  • Add more visualizations (wagon wheels, dismissals, partnerships)
  • Player Comparison Tool
  • Mobile responsiveness / Progressive Web App (PWA)
  • Light/Dark mode toggle
  • Integration with platforms like Paddy Power or BoyleSports for monetization

๐Ÿ Final Thoughts

This project represents the fusion of data, design, and cricket fandom. Whether youโ€™re an analyst, developer, or just a cricket fan โ€” this dashboard has something insightful for you.

โ€œIn cricket, your bat talks louder than words. But now, so can your data.โ€

Feel free to explore the dashboard, offer feedback, or suggest collaborations!


๐Ÿ“Œ Built using Python, Streamlit, Pandas, and Plotly โ€” powered by a love for cricket and clean UI.

Top comments (4)

Collapse
 
contractorx profile image
Collins Dada

very cool.

Collapse
 
dotallio profile image
Dotallio

Love the mix of cricket fandom and real analytics here! For those advanced AI predictions - are you looking more at classic ML models or planning to try deep learning too?

Collapse
 
mohithraj_kulal_2c9341755 profile image
Mohithraj Kulal

Nice information

Collapse
 
gitkit13 profile image
gitkit13

solid๐Ÿ’ฏ