All examples By author By category About

timelyportfolio

d3 treemap (forked to add brush)

forked from mbostock's block: D3 Source Treemap


Purpose

I wanted to demonstrate how to add a brush for each cell in a treemap with d3v4, since today I used a similar but slightly more robust method for a win at work as mentioned in this tweet.

I hope it helps someone along the way. For reference, I also added click on the cell that would add or delete a brush for each cell. With just a click, the cell would highlight and be 100%. The added brush allows partial selection. Unclick deletes the brush and sets to 0%.

Thoughts

The treemap I used had far fewer cells than this one from the d3 source code. Regardless, I think a bar chart with brushes (see example) might be a better UI for this assuming a limited number of bars.

Thanks so much to Mike Bostock for his amazing generous contribution that does not get nearly enough recognition or money.


Original README.md

This treemap shows the file size in bytes of D3 4.4.0’s source code. Click on any cell to view the corresponding source.

forked from timelyportfolio's block: D3 Source Treemap (forked for split algo)