How mplshassan/polarity works
Polarity is a Streamlit app for exploring NBA player game performance. Users choose Single or Flux mode, enter one or two players, optionally select a date, and pull stats; the app resolves names and obtains game data, then presents team-colored radar charts and stat details normalized against game highs. The graph separates player lookup, game retrieval, high-stat calculation, transformation, chart construction, and UI orchestration. The app’s game-fetch helper is not shown, so its retrieval link is marked unverified; other links follow shown calls or README capabilities.
Main entry points: app.py Streamlit App · charts.py Radar Charts · data.py Game Lookup · processing.py Stat Processing
Components 9
User Interface
- Streamlit App
app.py
NBA Data
- Player Lookup
data.py - Game Lookup
data.py - Game Highs
data.py
Analytics
- Stat Processing
processing.py
Presentation
- Visual Configuration
config.py - Radar Charts
charts.py
Other components
- Player / Fan
- NBA API
Connections 13
- Player / Fan → Streamlit App: enters search
README.md - Streamlit App → Player Lookup: resolves names
app.py - Streamlit App → Game Lookup: requests game
app.py - Game Lookup → NBA API: fetches game data
data.py - Player Lookup → NBA API: loads players
data.py - Streamlit App → Game Highs: loads game highs
app.py - Game Highs → NBA API: fetches box score
data.py - Streamlit App → Stat Processing: validates and normalizes
app.py - Stat Processing → Game Lookup: calculates true shooting
processing.py - Streamlit App → Radar Charts: builds radar
app.py - Radar Charts → Stat Processing: normalizes stats
charts.py - Streamlit App → Visual Configuration: uses team colors
app.py - Radar Charts → Visual Configuration: uses chart colors
charts.py