treemap

🍬 Pretty Treemaps

https://github.com/nikolaydubina/treemap

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.2%) to scientific vocabulary

Keywords

command-line-tool data-visualization graph heatmap tree
Last synced: 6 months ago · JSON representation ·

Repository

🍬 Pretty Treemaps

Basic Info
  • Host: GitHub
  • Owner: nikolaydubina
  • Language: Go
  • Default Branch: main
  • Homepage:
  • Size: 5.88 MB
Statistics
  • Stars: 167
  • Watchers: 6
  • Forks: 2
  • Open Issues: 11
  • Releases: 11
Topics
command-line-tool data-visualization graph heatmap tree
Created about 4 years ago · Last pushed 12 months ago
Metadata Files
Readme Funding License Citation Codeowners Security

README.md

🍬 Pretty Treemaps

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

Go Reference codecov Go Report Card OpenSSF Scorecard

Uses "Squarified Treemaps" (Mark Bruls, Kees Huizing, and Jarke J. van Wijk., 2000) algorithm.

bash $ 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 bash $ ... | treemap -w 1080 -h 360 > out.svg example-narrow

bash $ ... | treemap -w 1080 -h 1080 > out.svg example-square

Imputing heat bash $ ... | treemap -impute-heat > out.svg example-narrow

Different colorscheme bash $ ... | treemap -color RdYlGn > out.svg example-RdYlGn

Tree-Hue coloring when there is no heat $ ... | treemap -color balanced > out.svg example-balanced

Without color bash $ ... | 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

  • 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/plotlyutils/colors/colorbrewer.py
  • Colorbrewer project, that is used in Plotly: http://colorbrewer2.org

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) bash $ ... | treemap -w 4096 -h 4096 > out.svg example-large

Appendix C: Known Issues

The entire treemap is a black box when viewed from Jenkins

It's convenient to create treemap svg reports in a Jenkins jobs, because you can browse the job's "artifacts" from your browser. However, out of the box, Jenkin's Content Security Policy prevents inline styles from being applied. Instead of your treemap, you'll see a giant black rectangle.

If you look at the javascript console in the developer tools, you will see: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'".

You can relax Jenkin's CSP rules by following the examples at: * Jenkins error - Blocked script execution in . because the document's frame is sandboxed and the 'allow-scripts' permission is not set * https://stackoverflow.com/questions/35783964/jenkins-html-publisher-plugin-no-css-is-displayed-when-report-is-viewed-in-j

Owner

  • Name: Nikolay Dubina
  • Login: nikolaydubina
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: If you reference this library in publication, please cite it as below.
title: Treemap Visualization in Go
abstract: Implementation of treemap visualization in Go
authors:
- family-names: Dubina
  given-names: Nikolay
version: 2.1
date-released: 2021-12-05
license: MIT
repository-code: https://github.com/nikolaydubina/treemap
url: https://github.com/nikolaydubina/treemap

GitHub Events

Total
  • Issues event: 2
  • Watch event: 14
  • Issue comment event: 3
  • Push event: 1
  • Pull request review event: 1
  • Pull request event: 2
  • Fork event: 2
Last Year
  • Issues event: 2
  • Watch event: 14
  • Issue comment event: 3
  • Push event: 1
  • Pull request review event: 1
  • Pull request event: 2
  • Fork event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 86
  • Total Committers: 3
  • Avg Commits per committer: 28.667
  • Development Distribution Score (DDS): 0.116
Past Year
  • Commits: 2
  • Committers: 2
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Nikolay n****b@g****m 76
mlange-42 m****_@g****t 9
Gilbert Ramirez g****m@a****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 21
  • Total pull requests: 12
  • Average time to close issues: 1 day
  • Average time to close pull requests: about 10 hours
  • Total issue authors: 5
  • Total pull request authors: 3
  • Average comments per issue: 0.9
  • Average comments per pull request: 1.42
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: 2 days
  • Average time to close pull requests: 11 minutes
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • nikolaydubina (14)
  • mlange-42 (4)
  • michaelsanford (1)
  • gilramir (1)
  • keith6014 (1)
Pull Request Authors
  • nikolaydubina (7)
  • mlange-42 (5)
  • gilramir (2)
Top Labels
Issue Labels
enhancement (8) bug (3) refactoring (1) good first issue (1) documentation (1) performance (1)
Pull Request Labels
enhancement (2)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 7
  • Total dependent repositories: 5
  • Total versions: 11
proxy.golang.org: github.com/nikolaydubina/treemap
  • Versions: 11
  • Dependent Packages: 7
  • Dependent Repositories: 5
Rankings
Dependent packages count: 2.0%
Dependent repos count: 2.3%
Stargazers count: 4.4%
Average: 5.0%
Forks count: 11.1%
Last synced: 6 months ago

Dependencies

go.mod go
  • github.com/lucasb-eyer/go-colorful v1.2.0
go.sum go
  • github.com/lucasb-eyer/go-colorful v1.2.0
.github/workflows/tests.yml actions
  • actions/checkout v2 composite
  • actions/setup-go v2 composite
  • codecov/codecov-action v2 composite