Just a D3 chessboard
d3-Chessboard is a chessboard a la D3. No CSS, no images, no (chess) validations. Just a chessboard using the spirit of reusable charts.
You can see how it looks here.
d3chessboard()
elementvar sel = d3.select("#chess-container");
var board = d3chessboard();
sel.call(board);
You can use a FEN string to plot a specific position.
var fenstring = "rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2";
var sel2 = d3.select("#chess-container2");
var board2 = d3chessboard()
.fen(fenstring)
.size(600)
.textopacity(0.5)
.whitecellcolor("#FAFAFA")
.blackcellcolor("#CCC");
sel2.call(board2);
This plugin needs jhlywa' chessjs. Check index.html
.
Aps! Obviously you need d3js too!
picefontsize
and textfontsize
parameters (2015-06-28).picefontsize
, textfontsize
, textopacity
parameters (2015-06-26).width
and heigth
replaced with size
(2015-06-24).