Rectree proposes a simple concept towards user interfaces, that everything can be represented as a tree of axis-aligned bounding boxes (AABB). In Rectree, these are represented as rectangles, hence the name "rect-tree".
Rectree is designed to be:
- Deterministic: identical inputs always produce identical layouts.
- Incremental: only affected subtrees are recomputed.
- Policy-free: layout behavior is defined by user-provided algorithms.
Rectree: a hierarchical tree of rectangular nodes.Constraint: size limitations flowing from parent to child.Size: resolved dimensions flowing from child to parent.LayoutSolver: user-defined logic that computes constraints, sizes, and relative translations.
Rectree itself does not impose a specific layout style (e.g. flexbox, grid). Instead, it provides a strict data-flow model on top of which layout algorithms can be built.
- The only data that can flow down the tree is
Constraint. - The only data that can flow up the tree is
Size. - Each child, no matter the order, will recieve the same
Constraintfrom the parent. - Given the same
Constraint, an unmodified node must always produce the sameSize.
You can join us on the Voxell discord server.
rectree is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.