lib/zen/src/diagram/ascii/model.zig
daab053ee43316e1809a84551d573ddd1e5bf3d2
1 /// Requested terminal canvas dimensions.
2 pub const Options = struct {
3 /// Requested columns, clamped to 24...200.
4 width: usize = 72,
5 /// Requested rows, clamped to 8...80.
6 height: usize = 22,
7 };
8
9 /// Rejections produced before ASCII render storage changes.
10 pub const Exhaustion = error{
11 /// Categorical values exceed the admitted bound slots.
12 AsciiCategoryCapacityExceeded,
13 /// Stacked series exceed the admitted total slots.
14 AsciiStackTotalCapacityExceeded,
15 /// The clamped canvas needs more bytes than admitted.
16 AsciiCanvasByteCapacityExceeded,
17 /// The compacted rows need more output bytes than admitted.
18 AsciiOutputByteCapacityExceeded,
19 /// A prior output still borrows storage; reset after its last use.
20 AsciiRenderStorageInUse,
21 };
22
23 /// ASCII exhaustion, checked-capacity overflow, or an invalid scale.
24 pub const Error = Exhaustion || error{
25 CapacityOverflow,
26 InvalidScale,
27 };