• Stars
    star
    137
  • Rank 257,741 (Top 6 %)
  • Language
    Go
  • Created over 2 years ago
  • Updated 10 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🍬 Pretty Treemaps

🍬 Pretty Treemaps

Looking to run this for Go coverage? Check https://github.com/nikolaydubina/go-cover-treemap

Go Reference codecov Go Report Card

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

example

Adjusting size

$ ... | treemap -w 1080 -h 360 > out.svg

example-narrow

$ ... | treemap -w 1080 -h 1080 > out.svg

example-square

Imputing heat

$ ... | treemap -impute-heat > out.svg

example-narrow

Different colorscheme

$ ... | treemap -color RdYlGn > out.svg

example-RdYlGn

Tree-Hue coloring when there is no heat

$ ... | treemap -color balanced > out.svg

example-balanced

Without color

$ ... | treemap -color none > out.svg

example-no-color

Format

Size and heat is optional.

</ delimitered path>,<size>,<heat>

Algorithms

  • 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, 2000
  • Tree-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

Contributions

Welcomed!

References

Appendix A: Long Roots

When roots have one child multiple times it takes extra vertical space, which is very useful for narrow final dimensions.

example-long-roots

Can collapse them into one node example-long-roots-collapse

Long roots without collapsing somewhere deep inside

Long roots with collapsing somewhere deep inside

Appendix B: Less Illustrative Examples

Large dimensions and large tree (e.g. github.com/golang/go)

$ ... | treemap -w 4096 -h 4096 > out.svg

example-large

More Repositories

1

go-recipes

🦩 Tools for Go projects
Go
3,831
star
2

go-binsize-treemap

🔍 Go binary size SVG treemap
Go
442
star
3

calendarheatmap

📅 Calendar heatmap inspired by GitHub contribution activity
Go
388
star
4

go-cover-treemap

🎄 Go code coverage to SVG treemap
Go
280
star
5

llama2.go

LLaMA-2 in native Go
Go
183
star
6

go-instrument

⚡️ Automatically add Trace Spans to Go methods and functions
Go
141
star
7

go-featureprocessing

🔥 Fast, simple sklearn-like feature processing for Go
Go
115
star
8

go-graph-layout

🔮 Graph Layout Algorithms in Go
Go
83
star
9

go-cover-treemap-web

Go
78
star
10

jsonl-graph

🏝 JSONL Graph Tools
Go
71
star
11

import-graph

Collect data about your dependencies
Go
39
star
12

watchhttp

🌺 Run command periodically and expose latest STDOUT as HTTP endpoint
Go
30
star
13

go-ml-benchmarks

⏱ Benchmarks of machine learning inference for Go
Go
30
star
14

fpdecimal

🛫 Fixed-Point Decimals
Go
29
star
15

twitter-remover

Remove twitter likes, posts, retweets, replies, followers
25
star
16

fpmoney

🧧 Fixed-Point Decimal Money
Go
24
star
17

validate

🥬 validate. simply.
Go
20
star
18

hq

🐁 happy little queue
Go
16
star
19

neuroscience-landscape

🌌 Resources on Neuroscience
12
star
20

vertfn

Go linter for Vertical Function Ordering
Go
12
star
21

smrcptr

detect mixing pointer and value method receivers
Go
11
star
22

go-enum-encoding

Generate Go enum encoding
Go
8
star
23

htmljson

🫐 Rich rendering of JSON as HTML in Go
Go
7
star
24

go-enum-example

Go Enum: benchmarks, examples, analysis
Go
6
star
25

multiline-jsonl

Read and write multiline JSONL in Go
Go
6
star
26

openapi-inline-examples

🌏 Inline OpenAPI JSON examples from filenames
Go
6
star
27

htmlyaml

🐹 render YAML as HTML in Go
Go
4
star
28

rchan

Go channel through Redis List
Go
4
star
29

mini-awesome-cv

📝 LaTeX Awesome-CV under 200LOC
TeX
4
star
30

go-commentage

How far Go comments drifting behind?
Go
3
star
31

svgpan

Pan and Zoom of SVG in your Go front-end app in browser.
Go
3
star
32

go-bench-errors

Benchmarking Go errors
Go
3
star
33

consistentimports

Detect inconsistent import aliases
Go
2
star
34

go-instrument-example

Go
2
star
35

go-callsite-stats

analyse function callsites
Go
2
star
36

mdpage

one-pager Markdown list from YAML
Go
2
star
37

go-bench-stream

🌊 Go Benchmarks for Stream Processing
Go
2
star
38

go-bitset-example

Go Bitset: benchmarks, examples, analysis
Go
1
star
39

aws-s3-reader

Efficient Go Reader for large AWS S3 Objects
Go
1
star
40

read-seek-peeker

Go Reader that can Seek() and Peek()
Go
1
star
41

go-bench-receiver

Which is more efficient value or pointer method receivers in Go?
Go
1
star
42

totp

TOTP (RFC-6238) and HOTP (RFC-4226)
Go
1
star
43

dotfiles

macOS, Linux
Vim Script
1
star
44

presentations

1
star
45

PINTOS

C
1
star
46

ARIA

C++
1
star
47

mini-blog

JavaScript
1
star
48

graph-tools-gallery

Inspiration gallery of graph tools
1
star