logo
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/// Represent the available style of a point.
#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
pub struct PointStyle {
    /// Represent the size of a point, default size is 1.0, see more in [`PointSize`].
    #[serde(skip_serializing_if = "Option::is_none")]
    pub point_size: Option<PointSize>,
    /// Represent the color of a point, default color is black, see more in [`PointColor`].
    #[serde(skip_serializing_if = "Option::is_none")]
    pub point_color: Option<PointColor>,
}

/// Represent the size of a point, default size is 1.0
///
/// The shape of the point is always round.
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
#[serde(into = "f32", from = "f32")]
pub struct PointSize {
    /// Actual value for [`StyleResolver::point_size`]
    pub value: f32,
}

/// Represent the color of a point, default color is black
#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
#[serde(into = "RGBA", from = "RGBA")]
pub struct PointColor {
    /// Actual value for [`StyleResolver::point_color`]
    pub value: RGBA,
}

///
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct CircleStyle {
    /// Represent the width of a circle, default width is 1.0, see more in [`CircleWidth`].
    #[serde(skip_serializing_if = "Option::is_none")]
    pub circle_width: Option<CircleWidth>,
    /// Represent the color of a point, default color is black, see more in [`CircleColor`].
    #[serde(skip_serializing_if = "Option::is_none")]
    pub circle_color: Option<CircleColor>,
}

/// Represent the width of a circle, default width is 1.0
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
#[serde(into = "f32", from = "f32")]
pub struct CircleWidth {
    /// Actual value for [`StyleResolver::circle_width`]
    pub value: f32,
}

/// Represent the color of a point, default color is black
#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
#[serde(into = "RGBA", from = "RGBA")]
pub struct CircleColor {
    /// Actual value for [`StyleResolver::circle_color`]
    pub value: RGBA,
}

///
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct DiskStyle {
    /// Represent the color of a disk, default color is black, see more in [`DiskFillColor`].
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disk_fill_color: Option<DiskFillColor>,
    /// Represent the edge width of a disk, default width is 1.0, see more in [`DiskEdgeWidth`].
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disk_edge_width: Option<DiskEdgeWidth>,
    /// Represent the edge color of a disk, default is transparent, see more in [`DiskEdgeColor`].
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disk_edge_color: Option<DiskEdgeColor>,
}

/// Represent the color of a disk, default color is black
#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
#[serde(into = "RGBA", from = "RGBA")]
pub struct DiskFillColor {
    /// Actual value for [`StyleResolver::disk_fill_color`]
    pub value: RGBA,
}

/// Represent the edge width of a disk, default width is 1.0
#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
#[serde(into = "f32", from = "f32")]
pub struct DiskEdgeWidth {
    /// Actual value for [`StyleResolver::disk_edge_width`]
    pub value: f32,
}

/// Represent the edge color of a disk, default is transparent
#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
#[serde(into = "RGBA", from = "RGBA")]
pub struct DiskEdgeColor {
    /// Actual value for [`StyleResolver::disk_edge_color`]
    pub value: RGBA,
}

///
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct LineStyle {
    /// Represent the with of a line, default width is 1.0, see more in [`LineWidth`].
    #[serde(skip_serializing_if = "Option::is_none")]
    pub line_width: Option<LineWidth>,
    /// Represent the color of a line, default color is black, see more in [`LineColor`].
    #[serde(skip_serializing_if = "Option::is_none")]
    pub line_color: Option<LineColor>,
}

/// Represent the with of a line, default width is 1.0
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
#[serde(into = "f32", from = "f32")]
pub struct LineWidth {
    /// Actual value for [`StyleResolver::line_width`]
    pub value: f32,
}

/// Represent the color of a line, default color is black
#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
#[serde(into = "RGBA", from = "RGBA")]
pub struct LineColor {
    /// Actual value for [`StyleResolver::line_color`]
    pub value: RGBA,
}