https://github.com/lillo42/cassowary-csharp
A C#implementation of the Cassowary constraint solving algorithm
https://github.com/lillo42/cassowary-csharp
cassowary cassowary-algorithm constraint-solver csharp layout linear-programming
Last synced: 3 days ago
JSON representation
A C#implementation of the Cassowary constraint solving algorithm
- Host: GitHub
- URL: https://github.com/lillo42/cassowary-csharp
- Owner: lillo42
- License: gpl-3.0
- Created: 2023-03-13T21:43:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T16:07:44.000Z (about 1 year ago)
- Last Synced: 2025-05-15T18:51:53.495Z (about 1 month ago)
- Topics: cassowary, cassowary-algorithm, constraint-solver, csharp, layout, linear-programming
- Language: C#
- Homepage:
- Size: 95.7 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cassowary-csharp

This is a C# implementation of the Cassowary constraint solving algorithm
([Badros et. al 2001](https://constraints.cs.washington.edu/solvers/cassowary-tochi.pdf)).
It is based heavily on the implementation for Rust at
[dylanede/cassowary-rs](https://github.com/dylanede/cassowary-rs). The implementation does
however differ in some details.Cassowary is designed for solving constraints to lay out user interfaces.
Constraints typically take the form "this button must line up with this
text box", or "this box should try to be 3 times the size of this other box".
Its most popular incarnation by far is in Apple's Autolayout
system for Mac OS X and iOS user interfaces. UI libraries using the Cassowary
algorithm manage to achieve a much more natural approach to specifying UI
layouts than traditional approaches like those found in HTML.This library is a low level interface to the solving algorithm, though it
tries to be as convenient as possible. As a result it does not have any
intrinsic knowledge of common user interface conventions like rectangular
regions or even two dimensions. These abstractions belong in a higher level
crate.## Getting Started
Add the following to your csproj file:
```bash
dotnet add package cassowary-csharp
```## License
Cassowary is licensed under the [GNU GENERAL PUBLIC LICENSE](LICENSE) license.