https://github.com/tomgp/chess-canvas
https://github.com/tomgp/chess-canvas
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tomgp/chess-canvas
- Owner: tomgp
- Created: 2012-11-22T12:34:13.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-03-21T06:47:09.000Z (about 13 years ago)
- Last Synced: 2025-03-24T11:13:21.976Z (about 1 year ago)
- Language: JavaScript
- Size: 28.7 MB
- Stars: 9
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
___Chess data investigation & visualisation prototyping___
__Aim:__
To investigate ways to display large amounts of chess data.
__Process:__
Read a set of PGN files, parse and analyse the data therein. Create a set of json files to power various visualisations.
The important scripts are:
_node/generate_d3_tree_extended.js_
This takes a list of ECO openings and steps through each move by move building up a move tree in the standard d3 format
{
"name":"_e4_c5_Bc4", //the node name is a string of moves joined by underscores
"move":"Bc4", //the 'move' property is a convenience navigate the tree
"children":[
{...},
{...},
{...}
]
}
a lookup containing meta_data is created where meta data for agiven position is stored using the same move string as the tree node's name
over the 2500~ openings this takes between 5s and 10s to run
_node/add_player_data_to_tree.js_
This script takes the tree created by the previous script and adds real game data from lists of PGNs, this data includes infomation such as which players have played which moves at each point in the tree, whether those games were won and lost etc.
to save space and normalise things the game meta data is stored in a secondary look up table
this script takes about 50 seconds to add 3000 games
__Results:__
current visualisation at: http://chess.pointlineplane.co.uk/pages/openings_vis_d3_players_filtered.html
___Data sources___
pgn files are originally from
http://www.pgnmentor.com/files.html
some of them have been tweaked to fix formatting problems
___Dependencies___
jhlya's chess-js is used extensively
https://github.com/jhlywa/chess.js
d3 is used for processing CSV's in node and for laying out SVG's in the browser
https://github.com/mbostock/d3
easel js is used for some of the earlier board state visualisations
https://github.com/CreateJS/EaselJS/