Takes a YAML-formatted data file and produces a Scalable Vector Graphics (SVG 2.0) file, containing a treemap chart.
The following commands are supposed to be executed in Linux shell in the repository's root.
Building and running on other systems (Windows, OSX, BSD) may differ.
Install Rust and Cargo (Linux/general, Windows)
cargo build
You can run either through Cargo:
cargo run -- -i <input_yaml> -o <output_svg>
... or run directly as an executable:
target/debug/treemap-svg -i <input_yaml> -o <output_svg>
cargo install --path .
Currently, the program is installed for your user in ~/.cargo/bin
. Verify you have ~/.cargo/bin
included in your $PATH
.
cargo uninstall treemap-svg
The following YAML file:
# Population of the Top-30 cities in Lithuania
# Grouped by counties (apskritys)
# Source: https://en.wikipedia.org/wiki/List_of_cities_in_Lithuania
Lietuva:
Vilniaus apskr.:
Vilnius: 554866
Ukmergė: 20154
Elektrėnai: 14197
Lentvaris: 11105
Grigiškės: 10867
Kauno apskr.:
Kaunas: 292789
Jonava: 26423
Kėdainiai: 22677
Garliava: 13423
Raseiniai: 11203
Prienai: 9867
Kaišiadorys: 9729
Klaipėdos apskr.:
Klaipėda: 149431
Kretinga: 16583
Palanga: 16038
Šilutė: 14980
Šiaulių apskr.:
Šiauliai: 101854
Radviliškis: 15161
Naujoji Akmenė: 7206
Kuršėnai: 14197
Joniškis: 10881
Kelmė: 10302
Panevėžio apskr.:
Panevėžys: 85318
Biržai: 15262
Rokiškis: 14351
Pasvalys: 8296
Alytaus apskr.:
Alytus: 49551
Druskininkai: 14172
Varėna: 10296
Marijampolės apskr.:
Marijampolė: 34879
Vilkaviškis: 11117
Utenos apskr.:
Utena: 25397
Visaginas: 18024
Anykščiai: 10575
Telšių apskr.:
Mažeikiai: 32470
Telšiai: 21287
Plungė: 16755
Tauragės apskr.:
Tauragė: 21520
Jurbarkas: 12972
... generates such treemap chart on default:
At the time of writing, this program is in an alpha stage. Feel free to contribute.
The list may be incomplete.
- Rust: treemap
- R/ggplot2: Treemap Treemapify, Plotly
- Python: Plotly
- Javascript: Plotly
- Web: [https://github.com/evmar/webtreemap]