Last week, I tasked myself with creating a Guess the Chess Rating dashboard, allowing users to view a chess game and guess the rating of the players based on their moves. This idea was inspired by GothamChess' Guess the Elo series, and I aimed to recreate it as a game in Tableau. The majority of my time was dedicated to developing the chessboard aspect of the dashboard, which I will focus on discussing.
How It Works:
The Board: The chessboard is constructed on a coordinate plane, mirroring the standard 8 by 8 grid of a chessboard. Each square on the board corresponds to a point on this grid. For example, the white king might be positioned at space (1,5) on the coordinate plane. The visual representation of the spaces on the board is achieved using polygon marks, dual-axis aligned with the coordinate plane.

The Pieces: The pieces are represented as shapes details on the coordinate plane. Putting the pieces on the board proved straightforward; however, assigning the pieces moves in Tableau was challenging. The only information available was chess notation (e.g., Nf2, Qa7, or Rxe5). In this notation, the first letter indicates the type of piece moved, 'x' denotes a capture, and the last two characters represent the destination space. For instance, 'e5' corresponds to the point (5,5) on my coordinate plane. Thus, for 'Nf2', I deduce that a knight moved to space (6,2) on my board. The challenge was discerning which knight the notation referred to, requiring the setup of a table calculation in Tableau Prep.

Differentiating between each piece involved grouping each type of piece by game and ordering the moves by move-number. I then tracked the previous row and column values to determine the legal moves for each piece. For instance, pawns could move one space, rooks moved on one plane, and knights moved in an L shape. If a move was legal, the piece remained with that rook; otherwise, it switched to the other rook. This process continued until all moves were appropriately assigned to a piece.

Captures: Capturing pieces presented the greatest challenge. I partially addressed this by removing pieces from the board when they ran out of moves and were on a space marked for capture. If a move involved a capture ('x' in the notation), the associated space was added to a set. If a piece landed on one of these spaces and ran out of moves, it was removed from the board. This was achieved using a LOD to track each piece's final move and whether it was captured.
Problems: Despite progress, there are still flaws in the dashboard calculations. For example, pieces may disappear if they land on a square marked for capture and then run out of moves. Additionally, the algorithm for assigning moves to pieces does not account for pieces already captured or obstacles in the way, resulting in pieces moving inappropriately.
Overall, while the dashboard is functional, further refinement is needed to address these issues and enhance the user experience.
That's how the dashboard functions behind the scenes, I put a lot of work into this and am proud of what I've done. There are still bugs, but I'm sure I will find solutions to those in the coming weeks.