chart_js_wrapper/
lib.rs

1mod options;
2
3pub mod render;
4pub mod common;
5
6pub use options::*;
7
8#[cfg(feature = "time_axis")]
9pub mod time_axis;
10
11
12#[cfg(feature = "chrono_axis")]
13pub mod chrono_axis;
14mod serde;
15
16#[cfg(test)]
17mod tests {
18    use super::*;
19    
20
21    #[test]
22    fn colour_test(){
23        let color = common::Rgb(255, 0, 0);
24        let json = serde_json::to_string(&color).unwrap();
25        assert_eq!(json, "\"rgb(255, 0, 0)\"");
26        println!("Serialized: {}", json);
27        let deserialized: common::Rgb = serde_json::from_str(&json).unwrap();
28        assert_eq!(deserialized, color);
29        println!("Deserialized: {:?}", deserialized);
30    }
31}