How to Use the xG Calculator
Place players on the pitch, select a shooter, and calculate expected goals from multiple models.
Controls
Mouse
- Left click to place attackers; click an attacker again to make them the shooter
- Right click to place defenders
Keyboard
- G: next click places the goalkeeper
- S: select shooter (nearest attacker to cursor)
- A: toggle shot angle visualization
- R: reset the pitch
Toolbar
The toolbar above the pitch (at the bottom of the screen on phones) sets what a click or tap does:
- Attacker / ATK (red): click or tap the pitch to place attackers
- Defender / DEF (blue): click or tap the pitch to place defenders
- Keeper / GK (gray): click or tap the pitch to place the goalkeeper
- Shooter / SEL (yellow): click or tap an attacker to select them as the shooter
- Angle / ANG: toggle the shot angle visualization
- Undo: remove the last player placed
- Reset: clear the pitch
Step-by-Step Workflow
- Place attackers by clicking or tapping the pitch with the Attacker tool selected (the default).
- Place defenders with the Defender tool, or right-click on desktop.
- Place the goalkeeper with the Keeper tool, or press G and click on desktop.
- Select the shooter by clicking an attacker again, with the Shooter tool, or by pressing S near an attacker. A yellow ring marks the shooter.
- Choose shot details such as technique (Normal, Volley, etc.) and body part (Left Foot, Right Foot, Head, Other).
- Click "Calculate xG" to see results from multiple models.
Import Real Shots
Use the import panel to paste a JSON shot definition or fetch real shots from the database. After importing, you can edit the player positions on the pitch.