Skip to content

Add Streamlit dashboard for scouting data analysis - #4

Closed
thaliawebb with Copilot wants to merge 4 commits into
mainfrom
copilot/create-dashboard-file
Closed

Add Streamlit dashboard for scouting data analysis#4
thaliawebb with Copilot wants to merge 4 commits into
mainfrom
copilot/create-dashboard-file

Conversation

Copilot AI commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Implements interactive Streamlit dashboard with three analysis interfaces: team performance metrics, match outcome prediction, and raw data export.

Implementation

Team Analysis Tab

  • Sidebar team selector with cached queries
  • Metric cards: avg auto/teleop scores, climb percentage
  • Plotly line chart for score progression across matches
  • Alliance distribution viz (placeholder for position heatmap - schema lacks x/y coords)

Match Predictor Tab

  • Multi-select alliance inputs (3v3)
  • Aggregate average scoring prediction
  • Horizontal stacked bar chart for win probability
  • Expandable team breakdown

Raw Data Tab

  • Sortable/searchable dataframe with native Streamlit controls
  • CSV export via download button
  • Summary stats (matches/teams/records)

Zero-Match Safety

All queries use defensive COUNT check pattern:

check_query = "SELECT COUNT(*) as count FROM scouting_data WHERE team_number = ?"
count_df = pd.read_sql_query(check_query, conn, params=(team_number,))

if count_df['count'].iloc[0] == 0:
    return None  # Handled gracefully in UI

Prevents crashes on non-existent teams or empty database states.

Code Organization

  • Extracted CLIMB_LEVELS constant to eliminate duplication across queries
  • @st.cache_data decorators on all database operations
  • Separate tab functions for maintainability

Screenshots

Team Analysis
Team Analysis

Match Predictor
Match Predictor

Raw Data
Raw Data

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkip.amazonaws.com
    • Triggering command: /home/REDACTED/.local/bin/streamlit streamlit run dashboard.py --server.headless=true --server.port=8501 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Create a dashboard.py file using the Streamlit library. Connect it to the scouting_data.db SQLite database. Create the following three tabs:

'Team Analysis': A sidebar dropdown to select a Team Number. Display their statistics:

    Metric Cards: 'Avg Auto Score', 'Avg Teleop Score', 'Climb %'.

    Line Chart: Score evolution over match numbers.

    Heatmap Placeholder: A scatter plot of their starting positions (if available).

'Match Predictor': Two multi-select inputs: 'Red Alliance' (select 3 teams) and 'Blue Alliance' (select 3 teams).

    Calculate the sum of the averages for both alliances.

    Display a 'Predicted Winner' and 'Win Probability' bar chart.

'Raw Data': A sortable dataframe view of the entire database with a 'Download CSV' button.

Constraint: Ensure the SQL query handles cases where a team has zero matches played without crashing."


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 15, 2025 04:58
Co-authored-by: Thalia-the-nerd <178524167+Thalia-the-nerd@users.noreply.github.com>
Co-authored-by: Thalia-the-nerd <178524167+Thalia-the-nerd@users.noreply.github.com>
Co-authored-by: Thalia-the-nerd <178524167+Thalia-the-nerd@users.noreply.github.com>
@thaliawebb
thaliawebb marked this pull request as ready for review December 15, 2025 05:03
@thaliawebb

Copy link
Copy Markdown
Collaborator

@copilot fix the merge errors

Copilot AI changed the title [WIP] Create a dashboard using Streamlit connected to SQLite database Add Streamlit dashboard for scouting data analysis Dec 15, 2025
Copilot AI requested a review from thaliawebb December 15, 2025 05:04
@thaliawebb thaliawebb closed this Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants