FOR ANALYSTS FOR BI PROS FOR EVERYONE LEARN Tableau
Tableau Chess: Interactive Chess game using Tableau JS API
July 22, 2016
2
, , , , ,

Tableau Chess GameNo doubt that chess is one of my favourite game. It’s more than 15 centuries old but still fresh and enjoyable. Also no doubt that my favourite data visualization tool is Tableau so why not mix these two together? That’s the motivation of my new Tableau game, the Tableau Chess that is running entirely in a Tableau Public workbook using some javascript coffeescript magic.

How can I play it?

Just go to the game’s github.io page: https://tfoldi.github.io/tableau-chess/ . After the board is loaded you can select your figure and select where it should step. That’s it. You can also select what do you need in exchange of a pawn when it goes beyond the table.

Gameplay experience of Tableau Chess

Gameplay experience of Tableau Chess

It has no checkmate detection yet, that’s your part, you should know when you win or lose.

The Chess Engine

First of all, the chess engine is not written by me. I’m smart, but not half as smart as Oscar Toledo who wrote his first 1K engine in C. 1K means 1024 bytes here that includes the entire chess engine and rendering. Later he made javascript version of the game and published here: http://nanochess.org/chess4.html. The complete source code of the chess engine (that handles moves, pawn promotion and everything) can fit on your screen. Let me show sources here:

Yes. That’s all. It has the UI, re-rendering and computer AI.  You can try out the original game here, try to beat it then don’t forget to check the page’s source code again. Yes, it’s amazing.

To help myself using the engine I used Raymond Hulha’s deobfuscated code from here: https://github.com/rhulha/nanochess.

Tableau Chess – Using the Tableau JS API

I wrote a dedicated post on how can you build interactive vizes like this from scratch using yeoman, grunt, bower, coffeescript and Tableau JavaScript API. You can read it here.

If you like it or it’s not working, just leave a comment.

Tamás Földi

Tamás Földi

Director of IT Development at Starschema
Decades of experience with data processing and state of the art programming. From nuclear bomb explosion simulation to distributed file systems. ethical hacking, real time stream processing practically I always had a great fun with those geeky ones and zeros.
Tamás Földi
  • acotgreave

    Nice work Tamas. I got beat. I also tried to cheat and undo a move – but the moves get out of sync if you click undo. The white moves were undoing correctly, but black’s weren’t.

    • realdataboss

      Yes, I don’t handle undo events simply because I don’t know how can I catch undo events from Javascript API (maybe with filter change?). That undo button comes from tableau public but not from my source. I just disabled the toolbar to avoid confusion.

      Other problem what I am going to solve somehow is the viz timeout. Tableau does not notify the JS app when it’s invalidates the session so I need to find some other clever ways.

      Thanks for the feedback!

Related items

/ You may check this items as well

Tableau Docker

HOWTO: Tableau Server Linux in Docker Container

No doubt that chess is one of my favourite game. I...

Read more
Tableau Consistency Checker

Tableau Filestore Consistency Checker – How Repository Maps to Filestore

No doubt that chess is one of my favourite game. I...

Read more
TCOT

Pushing the Limits of Tableau Server – Practical Lessons from a Zen Master

No doubt that chess is one of my favourite game. I...

Read more