5 ms·
We use a cassowary based constraint solver within Ratatui [1]. It's kind of neat once you understand the algorithm and add your own UI rules system on top of it
by joshka 2y ago
We use a cassowary based constraint solver within Ratatui [1]. It's kind of neat once you understand the algorithm and add your own UI rules system on top of it. Unfortunately the library[2] that we use for the actual solving is unmaintained for many years now. I've been meaning to rewrite[3] a bunch of things in the lib to be more ergonomic, but it hasn't bubbled to the top of my todo list yet.
[1]: https://github.com/ratatui/ratatui/blob/main/ratatui-core/src/layout/layout.rs https://github.com/ratatui/ratatui/blob/main/ratatui-core/sr...
[2]: https://crates.io/crates/cassowary/ https://crates.io/crates/cassowary/
[3]: https://crates.io/crates/kasuari https://crates.io/crates/kasuari