- Racheal Dylewski
- COSC 594 Lab 2 Jgraph
- September 28, 2021
Heatmap is a tool that creates a density map of passes made in a given match of the 2018 FIFA World Cup. Given 2 teams, the program will create a JPEG heatmap of where the passes occured on the field. The program can visualize passes between both teams over the entire game, as well as for a particular player provided by the user.
Heatmap relies on several outside projects to make its magic possible and uses curl to download zip files for data and dependancies. To set up, run
sh setup.sh
To build, run
make
To build and generate 5 beautiful images, run
make run
Heatmap takes 3 command line arguments:
./heatmap HOME_TEAM AWAY_TEAM PLAYER_CHOICE(Y/N)
HOME_TEAM
is the home team
AWAY_TEAM
is the away team
PLAYER_CHOICE
is a simple 'y' or 'n'. If the user provides 'n', then the program will generate a heatmap based on all players passes for both teams. If 'y' is provided, then the program will provide the starting lineups for the teams, and will prompt the user for the exact name of a player. The program will generate the heatmap based only on passes completed by the specified player.
Home team and away team must be capitalized and in specific order. A list of all games in the competition can be found in matches.txt. The program takes country spellings exactly as they appear in the file. Player input must be spelled exactly as it appears on program output. If there are accents or special character in a player's name, it is recommended to copy & paste.
All JPEG images will be sent to the folder output_graphs once generated.
Here are some interesting examples of Heatmap at work.
Croatia vs England, Luka Modric - Midfielder (Croatia)
./heatmap Croatia England y
Input: Luka Modrić
Spain vs Morocco, Munir Mohamedi - Goalkeeper (Spain)
./heatmap Spain Morocco y
Input: Munir Mohand Mohamedi
Brazil vs Mexico, Neymar Jr. - Forward (Brazil)
./heatmap Brazil Mexico y
Input: Neymar da Silva Santos Junior
Morocco vs Iran (All Players)
./heatmap Morocco "Iran, Islamic Republic of"
- nlohmann/json
- StatsBomb Open Data
- Dr. Plank's Jgraph