ggplot_rs/guide/
config.rs1#[derive(Clone, Debug, Default)]
4pub struct GuideLegend {
5 pub title: Option<String>,
7 pub ncol: Option<usize>,
9 pub nrow: Option<usize>,
11 pub reverse: bool,
13}
14
15impl GuideLegend {
16 pub fn new() -> Self {
17 Self::default()
18 }
19
20 pub fn with_title(mut self, title: &str) -> Self {
21 self.title = Some(title.to_string());
22 self
23 }
24
25 pub fn with_ncol(mut self, ncol: usize) -> Self {
26 self.ncol = Some(ncol);
27 self
28 }
29
30 pub fn with_nrow(mut self, nrow: usize) -> Self {
31 self.nrow = Some(nrow);
32 self
33 }
34
35 pub fn reverse(mut self) -> Self {
36 self.reverse = true;
37 self
38 }
39}