1#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
8pub struct SeriesId(pub u64);
9
10#[derive(Clone, Debug)]
12pub struct AxesConfig {
13 pub x: AxisConfig,
14 pub y: AxisConfig,
15}
16
17#[derive(Clone, Debug)]
19pub struct AxisConfig {
20 pub label: String,
21 pub label_font_size: u32,
22 pub scale: ScaleType,
23 pub range: RangePolicy,
24 pub ticks: TickConfig,
25}
26
27#[derive(Clone, Copy, Debug, PartialEq, Eq)]
29pub enum ScaleType {
30 Linear,
31 Log10,
32 LogE,
33}
34
35#[derive(Clone, Debug)]
37pub enum RangePolicy {
38 Auto,
39 Manual { min: f64, max: f64 },
40}
41
42#[derive(Clone, Debug)]
44pub struct TickConfig {
45 pub major_step: Option<f64>,
46 pub minor_per_major: u16,
47}
48
49#[derive(Clone, Debug)]
51pub struct LegendConfig {
52 pub visible: bool,
53 pub title: Option<String>,
54 pub position: LegendPosition,
55 pub font_size: u32,
56 pub font_color: Color,
57}
58
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
61pub enum LegendPosition {
62 TopLeft,
63 TopRight,
64 BottomLeft,
65 BottomRight,
66}
67
68#[derive(Clone, Debug)]
70pub struct LayoutConfig {
71 pub title: String,
72 pub x_label_area_size: u32,
73 pub y_label_area_size: u32,
74 pub margin: u32,
75 pub title_font_size: u32,
76 pub title_font_color: Color,
77}
78
79#[derive(Clone, Copy, Debug)]
81pub struct Color {
82 pub r: u8,
83 pub g: u8,
84 pub b: u8,
85 pub a: u8,
86}
87
88#[derive(Clone, Debug)]
90pub struct SeriesStyle {
91 pub color: Color,
92 pub line_width: f32,
93 pub line_style: LineStyle,
94 pub marker: Option<MarkerStyle>,
95}
96
97#[derive(Clone, Copy, Debug, PartialEq, Eq)]
99pub enum LineStyle {
100 Solid,
101 Dashed,
102 Dotted,
103}
104
105#[derive(Clone, Debug)]
107pub struct MarkerStyle {
108 pub shape: MarkerShape,
109 pub size: f32,
110}
111
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
114pub enum MarkerShape {
115 Circle,
116 Square,
117 Triangle,
118 Cross,
119}
120
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
123pub enum AxisKind {
124 X,
125 Y,
126}
127
128#[derive(Clone, Copy, Debug)]
130pub enum ImageFormat {
131 Png,
132 Svg,
133}
134
135#[derive(Clone, Copy, Debug)]
137pub struct ImageSize {
138 pub width: u32,
139 pub height: u32,
140}