SVG rendering (experimental)¶
This module renders SVGs (mostly for IPython integration). Pieces images are copyright Colin M.L. Burnett and licensed under GFDL & BSD & GPL.
Renders the given
chess.Pieceas an SVG.
board(board=None, squares=None, flipped=False, coordinates=True, style=None, pre='', post='')¶
Renders a board with pieces and/or selected squares as an SVG.
Custom verbatim XML can be added before (pre) and after (post) all elements.
>>> board = chess.Board("8/8/8/8/4N3/8/8/8 w - - 0 1") >>> squares = board.attacks(chess.E4) >>> chess.svg.board(board=board, squares=squares)