pub mod colors;
pub mod day;
pub mod histogram;
pub mod legend;
pub mod pie;
pub mod pie_data;
pub mod tag_percent;
pub type ColorIter<'a> = colors::ColorIter<'a>;
pub type Percent = tag_percent::Percent;
pub type TagPercent = tag_percent::TagPercent;
pub type PieData = pie_data::PieData;
pub type Legend<'a> = legend::Legend<'a>;
pub type PieChart<'a> = pie::PieChart<'a>;
pub type Percentages = Vec<TagPercent>;
pub type BarGraph = histogram::BarGraph;
pub type DayHours = day::DayHours;
pub(crate) mod utils {
pub(crate) fn format_coord(coord: f32) -> String {
let s = format!("{coord:.3}");
s.trim_end_matches('0').trim_end_matches('.').to_string()
}
}
#[cfg(test)]
mod tests {
use spectral::prelude::*;
use super::utils::*;
#[test]
fn test_format_coord() {
assert_that!(format_coord(0.0).as_str()).is_equal_to("0");
assert_that!(format_coord(1.2345678).as_str()).is_equal_to("1.235");
assert_that!(format_coord(10.5).as_str()).is_equal_to("10.5");
assert_that!(format_coord(10.25).as_str()).is_equal_to("10.25");
}
}