1pub mod backend;
2pub mod layout;
3#[cfg(feature = "canvas")]
5pub mod pixel_backend;
6#[cfg(not(target_arch = "wasm32"))]
9pub mod plotters_backend;
10pub mod renderer;
11pub mod svg_backend;
12
13#[derive(Clone, Debug)]
15pub struct Rect {
16 pub x: f64,
17 pub y: f64,
18 pub width: f64,
19 pub height: f64,
20}
21
22#[derive(Debug)]
24pub enum RenderError {
25 MissingAesthetic(String),
26 BackendError(String),
27 IoError(std::io::Error),
28}
29
30impl std::fmt::Display for RenderError {
31 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32 match self {
33 RenderError::MissingAesthetic(a) => write!(f, "Missing required aesthetic: {a}"),
34 RenderError::BackendError(e) => write!(f, "Backend error: {e}"),
35 RenderError::IoError(e) => write!(f, "IO error: {e}"),
36 }
37 }
38}
39
40impl std::error::Error for RenderError {}
41
42impl From<std::io::Error> for RenderError {
43 fn from(e: std::io::Error) -> Self {
44 RenderError::IoError(e)
45 }
46}