Giter Club home page Giter Club logo

chess-canvas's Introduction

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/

chess-canvas's People

Contributors

tomgp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.