Gist 5475820
✓ Published0🌍 Public
11wheel
Last edited Apr 28, 2013
Created on Apr 28, 2013
This example shows a small grid of colored cells tracking how country rankings change over time. The visualization uses a dataset with six countries and seven years (2003–2009), where each cell’s color encodes a rank value from 1 to 6. The code reshapes the data into a flat array of year–country–value triples, then draws SVG rectangles with `d3.select` and `.enter()`. It uses `d3.scale.quantize` for the color scale and `d3.scale.ordinal` for positioning. Hovering turns a cell white, and clicking logs the selected element to the console.
AI-generated description