Two years ago, I built a chess game in Plotly Dash just to see how far I could push a framework that most people associate with dashboards.
At the time, I remember chatting with Dave Gibbon from Plotly about what I wanted to build and some of the possibilities I was exploring.
Then, as often happens with side projects, life got busy, other ideas took over, and Plotly Chess sat gathering digital dust for two years. ![]()
Well, I’ve finally decided to tear back into it, and things have changed quite a bit! ![]()
What started as an experiment with Plotly traces, Unicode chess pieces and a fairly basic opponent has evolved into something much more interesting.
Here’s what’s new:
Completely rebuilt interface - Responsive chessboard with SVG pieces, drag-and-drop, touch support, keyboard controls, legal move highlighting and move history.
Neural Probabilistic Circuit AI - I’ve adapted my research into conditional expert routing to chess. Three probabilistic circuit experts evaluate board concepts including material balance, mobility, check status and game phase, with a neural gate learning how to combine their predictions.
14,025 real chess games prepared for training - A curated PGN dataset featuring games from Magnus Carlsen, Garry Kasparov and Viswanathan Anand, with a training and evaluation pipeline for the new AI architecture.
Improved opponent logic - Replaced the original capture-biased random opponent with a two-ply search, which can incorporate predictions from a trained probabilistic model.
Local multiplayer - Two people can now play on the same device, with independent browser sessions keeping games separate.
Proper engineering underneath - Modular Python architecture, session persistence, automated tests, browser interaction testing and Plotly Cloud deployment support.
The neural architecture is still experimental, and I’ve yet to establish whether it improves playing strength. That’s part of the fun!
But here’s what I find particularly interesting…
Dash was never something I looked at as just a dashboard framework.
I saw it as a way to build genuinely interactive Python applications without having to reinvent the entire web stack.
And combining that with experimental AI architectures opens up some interesting possibilities.
Big shout-out to Dave Gibbon and the Plotly team. Two years later, I’m still finding new ways to push Dash beyond conventional data visualisation! ![]()
The project is open source, and I’ve put it up on Plotly Cloud for people to explore.
Play: https://plotly-chess.plotly.app/
Source code: GitHub - Arkay92/PlotlyChess: A chess game using python, plotly and dash · GitHub
Give it a go, have a look under the hood, and let me know what you think!
Next up? Seeing whether those probabilistic experts can actually learn to play a decent game of chess. ![]()