plotting/format.rs
1use derive_builder::Builder;
2
3/// Figure format.
4///
5/// # Examples
6///
7/// ## Default format
8///
9/// ```
10/// use plotting::Format;
11///
12/// let format = Format::default();
13/// ```
14///
15/// ## Custom formatting
16///
17/// ```
18/// use plotting::{Format, FormatBuilder};
19///
20/// let format: Format = FormatBuilder::default()
21/// .title("y vs. x")
22/// .x_label("x")
23/// .y_label("y")
24/// .width(800)
25/// .height(600)
26/// .build()
27/// .unwrap();
28/// ```
29#[derive(Builder, Clone, Default)]
30pub struct Format {
31 /// Title.
32 #[builder(setter(into, strip_option), default)]
33 pub(crate) title: Option<String>,
34
35 /// x-axis label.
36 #[builder(setter(into, strip_option), default)]
37 pub(crate) x_label: Option<String>,
38
39 /// y-axis label.
40 #[builder(setter(into, strip_option), default)]
41 pub(crate) y_label: Option<String>,
42
43 /// z-axis label.
44 #[builder(setter(into, strip_option), default)]
45 pub(crate) z_label: Option<String>,
46
47 /// Width (in pixels).
48 #[builder(setter(strip_option), default)]
49 pub(crate) width: Option<usize>,
50
51 /// Height (in pixels).
52 #[builder(setter(strip_option), default)]
53 pub(crate) height: Option<usize>,
54}