Skip to main content
100%

treemap2

✓ Published0🌍 Public
WWeikerWT
Last edited Jun 22, 2018
Created on Jun 22, 2018

This animated treemap prototype uses cell area and color to double-encode data values. The layout is created by extending `d3.layout.treemap` into `d3.layout.treemap2`, which computes the maximum area among sibling nodes at the same depth. Each cell’s color is scaled from orange to light gray based on the ratio of its area to the max area of its sibling group, while the cell area itself encodes the raw value. A custom sort orders cells by ascending value, placing the largest area cell in the top-right corner of each group. The visualization animates as the treemap layout updates, using the flare.json dataset.

AI-generated description

a treemap prototype where the

  • area of the cell
  • the maxArea of all the cells that share the same depth and same parent with that cell

is used to scale the color on an orange to lightgray colorscale.

the size variable is double-encoded as cell area and cell color.

I extend d3.layout.treemap to calculate the maxArea across a set of sibling nodes and call the extended layout d3.layout.treemap2

the sort property of the treemap2 layout positions the largest area cell in the top-right of the group.

.sort(function(a, b){ return a.value - b.value })

an iteration on http://mbostock.github.io/d3/talk/20111018/treemap.html

and this StackOverflow Answer

forked from <a href='http://bl.ocks.org/micahstubbs/'>micahstubbs</a>'s block: <a href='http://bl.ocks.org/micahstubbs/6eed3b92121facaf489f'>treemap2</a>

cc0-1.0 Licensed

Similar vizzes