Crates.io | reingold-tilford |
lib.rs | reingold-tilford |
version | 1.0.0 |
source | src |
created_at | 2019-02-03 16:46:18.900763 |
updated_at | 2019-02-03 16:46:18.900763 |
description | A Rust library for laying out aesthetically pleasing trees (the data structure, not the plant). |
homepage | |
repository | https://gitlab.com/seamsay/reingold-tilford.git |
max_upload_size | |
id | 112400 |
size | 5,825,691 |
A Rust library for laying out aesthetically pleasing trees (the data structure, not the plant).
Here is an example of the layout this algorithm produces, rendered onto a terminal grid:
0
|
+---------------------+-----------------------------------+-----------------+---------------------------+
| | | | |
1 2 3 4 5
| | |
+-------+ +-----------------+-----------------------------+ |
| | | | | |
6 7 8 9 10 11
| | | | |
| | +-------------------+ | |
| | | | | |
12 13 14 15 16 17
| | | | |
+-------+-------+-------+-------+ | +-------+-------+-------+ | |
| | | | | | | | | | | |
18 19 20 21 22 23 24 25 26 27 28 29
| |
+-------+ |
| | |
30 31 32
| |
+-------+-------+ +-------+-------+
| | | | | |
33 34 35 36 37 38
Feel free to open issues on the gitlab repo for any bugs you find or features you want. I will try to get bugs fixed relatively quickly (emphasis on try), but I can't guarantee that I'll ever work on feature requests (that shouldn't stop you from opening them though).
If you want to do the work for me then that's great, just make sure to use rustfmt
and follow
conventional commit guidelines as closely
as possible.
Please see the API documentation for basic examples, or the examples folder for more in-depth examples.
Most of the algorithm was shamelessly stolen from this blog post and the accompanying code by Rachel Lim.
This other blog post by Bill Mill is also worth a read.