How ihsangan/mpl-calculator works
MPL Calculator is a browser app for exploring league standings and playoff odds. Users select a league, edit or sync its schedule, then view calculated standings and run standard or ELO-weighted playoff simulations; results include match countdowns and can be exported as images. The app also supports theme and league selection. The graph follows documented capabilities and visible imports/calls; some UI wiring and unsampled implementations are represented only where the README or source index supports them.
Main entry points: App.tsx App state and routing · schedule-editor.tsx Schedule editor · simulation.ts Monte Carlo engine · use-liquipedia-sync.ts Live sync hook
Components 23
Application
- App state and routing
src/App.tsx - League configuration
src/leagues.ts - League and theme controls
src/components/header.tsx - Theme provider
src/components/theme-provider.tsx - Attribution footer
src/components/footer.tsx
League Schedule
- Schedule editor
src/components/schedule/schedule-editor.tsx - Match card
src/components/schedule/match-card.tsx - Next match countdown
src/components/schedule/next-match-card.tsx
Standings and Odds
- Standings table
src/components/standings/standings-table.tsx - Playoff probabilities
src/components/probabilities/probabilities-card.tsx - Rank scenarios
src/components/probabilities/rank-scenarios-card.tsx - Standings and tiebreakers
src/lib/standings.ts - Simulation hook
src/hooks/use-simulation.ts - Simulation worker
src/workers/simulation.worker.ts - Monte Carlo engine
src/lib/simulation.ts - ELO engine
src/lib/elo.ts
Schedule Sync
- Live sync hook
src/hooks/use-liquipedia-sync.ts - Browser MediaWiki client
src/lib/mediawiki.ts - Liquipedia sync CLI
liquipedia.ts
Shared Services
- Image export hook
src/hooks/use-save-as-image.ts - Date and countdown utilities
src/lib/date-utils.ts
Other components
- League user
- Liquipedia API
Connections 28
- League user → App state and routing: selects league
- App state and routing → League configuration: loads league
src/App.tsx - App state and routing → League and theme controls: renders
src/App.tsx - App state and routing → Theme provider: uses provider
src/App.tsx - App state and routing → Attribution footer: renders
src/App.tsx - App state and routing → Schedule editor: renders
src/App.tsx - App state and routing → Next match countdown: renders
src/App.tsx - App state and routing → Standings table: renders
src/App.tsx - App state and routing → Playoff probabilities: renders
src/App.tsx - App state and routing → Rank scenarios: renders
src/App.tsx - App state and routing → Live sync hook: starts sync
src/App.tsx - League configuration → Schedule editor: provides matches
- Schedule editor → Match card: renders
src/components/schedule/schedule-editor.tsx - App state and routing → Simulation hook: requests simulations
src/App.tsx - Simulation hook → Simulation worker: dispatches jobs
src/hooks/use-simulation.ts - Simulation worker → Monte Carlo engine: runs simulation
src/workers/simulation.worker.ts - Monte Carlo engine → Standings and tiebreakers: calculates standings
src/lib/simulation.ts - Monte Carlo engine → ELO engine: loads ELO engine
src/lib/simulation.ts - App state and routing → Standings and tiebreakers: calculates standings
src/App.tsx - Standings table → Image export hook: exports image
src/components/standings/standings-table.tsx - Playoff probabilities → Image export hook: exports image
src/components/probabilities/probabilities-card.tsx - Rank scenarios → Image export hook: exports image
src/components/probabilities/rank-scenarios-card.tsx - Live sync hook → Browser MediaWiki client: uses client
src/hooks/use-liquipedia-sync.ts - Browser MediaWiki client → Liquipedia API: fetches MediaWiki API
- Liquipedia sync CLI → Liquipedia API: fetches OpenAPI data
- Schedule editor → Live sync hook: offers live sync
- Match card → Date and countdown utilities: formats match dates
src/components/schedule/match-card.tsx - Next match countdown → Date and countdown utilities: formats countdown
src/components/schedule/next-match-card.tsx