NAFTA treemap
This treemap visualizes NAFTA trade data, with each rectangle representing a product category and its area proportional to trade value. Color encodes the parent country (Mexico, Canada, or the United States), using a faded categorical color scheme. Built with D3 v4 and rendered in SVG, the view includes radio buttons to switch the treemap's value metric between size (trade value) and count. The rectangles are labeled with product names and values, and the layout uses the squarified treemap algorithm with animated transitions when switching modes.
AI-generated descriptionA treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk. Data courtesy Jeff Heer.
forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/4063582'>Treemap</a>