lib/zen/src/diagram/model.zig
daab053ee43316e1809a84551d573ddd1e5bf3d2
1 const std = @import("std");
2
3 const root = @import("root.zig");
4
5 const spec = root.spec;
6
7 pub const Bounds = struct {
8 x_min: f64 = 0,
9 x_max: f64 = 1,
10 y_min: f64 = 0,
11 y_max: f64 = 1,
12 x_kind: spec.ScaleKind = .linear,
13 y_kind: spec.ScaleKind = .linear,
14 x_base: f64 = 10,
15 y_base: f64 = 10,
16 categorical: bool = false,
17 categories: std.ArrayList([]const u8) = .empty,
18 category_slots_owned: bool = true,
19
20 pub fn deinit(self: *Bounds, allocator: std.mem.Allocator) void {
21 if (self.category_slots_owned) self.categories.deinit(allocator);
22 }
23 };