1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*!

Manage how elements should be drawn

*/

pub trait Line {
    fn colour<T>(&mut self, value: T) -> &mut Self
    where
        T: Into<String>;

    fn get_colour(&self) -> &Option<String>;

    fn width<T>(&mut self, value: T) -> &mut Self
    where
        T: Into<f32>;

    fn get_width(&self) -> &Option<f32>;
}

/**
The marker that should be used for the points of the scatter plot
*/
#[derive(Debug, Clone)]
pub enum Marker {
    Circle,
    Square,
    Cross,
}

pub trait Point {
    fn marker<T>(&mut self, value: T) -> &mut Self
    where
        T: Into<Marker>;

    fn get_marker(&self) -> &Option<Marker>;

    fn colour<T>(&mut self, value: T) -> &mut Self
    where
        T: Into<String>;

    fn get_colour(&self) -> &Option<String>;

    fn size<T>(&mut self, value: T) -> &mut Self
    where
        T: Into<f32>;

    fn get_size(&self) -> &Option<f32>;
}

pub trait Bar {
    fn fill<T>(&mut self, value: T) -> &mut Self
    where
        T: Into<String>;

    fn get_fill(&self) -> &Option<String>;
}

pub trait BoxPlot {
    fn fill<T>(&mut self, value: T) -> &mut Self
    where
        T: Into<String>;

    fn get_fill(&self) -> &Option<String>;
}

pub trait BarChart {
    fn fill<T>(&mut self, value: T) -> &mut Self
    where
        T: Into<String>;

    fn get_fill(&self) -> &Option<String>;
}