Tree Map
✓ Published1🌍 Public
This tree map visualizes hierarchical sales data for US states and cities using a treemap layout. The visualization encodes each leaf node as a rectangle, with area proportional to sales values and color assigned by parent state via an ordinal scale with the Tableau 10 scheme. The code loads data from a JSON file using `d3.json`, builds a hierarchy with `d3.hierarchy` and `sum`, then applies `d3.treemap` to compute positions. Rectangles and white labels are rendered as SVG elements within a container group.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed