Looking to run this for Go coverage? Check https://github.com/nikolaydubina/go-cover-treemap
Uses "Squarified Treemaps" (Mark Bruls, Kees Huizing, and Jarke J. van Wijk., 2000) algorithm.
$ go install github.com/nikolaydubina/treemap/cmd/treemap@latest
$ echo '
Africa/Algeria,33333216,72
Africa/Angola,12420476,42
Africa/Benin,8078314,56
...
' | treemap > out.svg
Adjusting size
$ ... | treemap -w 1080 -h 360 > out.svg
$ ... | treemap -w 1080 -h 1080 > out.svg
Imputing heat
$ ... | treemap -impute-heat > out.svg
Different colorscheme
$ ... | treemap -color RdYlGn > out.svg
Tree-Hue coloring when there is no heat
$ ... | treemap -color balanced > out.svg
Without color
$ ... | treemap -color none > out.svg
Size and heat is optional.
</ delimitered path>,<size>,<heat>
Squarified
algorithm for treemap layout problem. This is very common algorithm used in Plotly and most of visualization packages. "Squarified Treemaps", Mark Bruls, Kees Huizing, and Jarke J. van Wijk, 2000Tree-Hue Color
algorithm for generating colors for nodes in treemap. The idea is to represent hierarchical structure by recursively painting similar hue to subtrees. Nikolay Dubina, 2021
Welcomed!
- Plotly treemaps: https://plotly.com/python/treemaps/
- go-colorful: https://github.com/lucasb-eyer/go-colorful
- D3 treemap is using Squerified: https://github.com/d3/d3-hierarchy
- Interactive treemap: https://github.com/vasturiano/treemap-chart
- Squerified in Rust: https://github.com/bacongobbler/treemap-rs
- Squerified in JavaScript: https://github.com/clementbat/treemap
- Squerified in Python: https://github.com/laserson/squarify
- Treemap Go tool: https://github.com/willpoint/treemap
- Plotly color scales: https://plotly.com/python/builtin-colorscales
- Plotly color scales source: https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/_plotly_utils/colors/colorbrewer.py
- Colorbrewer project, that is used in Plotly: http://colorbrewer2.org
When roots have one child multiple times it takes extra vertical space, which is very useful for narrow final dimensions.
Can collapse them into one node
Long roots without collapsing somewhere deep inside
Long roots with collapsing somewhere deep inside
Large dimensions and large tree (e.g. github.com/golang/go
)
$ ... | treemap -w 4096 -h 4096 > out.svg