Skip to content

Representing user interfaces using a rectangle tree.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

voxell-tech/rectree

Repository files navigation

Rectree

License Crates.io Downloads Docs CI Discord

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.

Core Concepts

  • 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.

Layout Rules

  1. The only data that can flow down the tree is Constraint.
  2. The only data that can flow up the tree is Size.
  3. Each child, no matter the order, will recieve the same Constraint from the parent.
  4. Given the same Constraint, an unmodified node must always produce the same Size.

Join the community!

You can join us on the Voxell discord server.

License

rectree is dual-licensed under either:

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.

About

Representing user interfaces using a rectangle tree.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •  

Languages