pub mod colorbar;
pub mod correlation_heatmap;
pub mod missingness_heatmap;
pub mod pair_plot;
pub use correlation_heatmap::CorrelationHeatmap;
pub use missingness_heatmap::MissingnessHeatmap;
pub use pair_plot::{Diagonal, PairPlot};
use plotters::prelude::*;
use plotters::style::text_anchor::{HPos, Pos, VPos};
pub(crate) fn text_style<'a>(h: HPos, v: VPos, size: i32, color: &'a RGBColor) -> TextStyle<'a> {
TextStyle::from(("sans-serif", size).into_font())
.color(color)
.pos(Pos::new(h, v))
}
pub(crate) fn contrast_text(bg: RGBColor) -> RGBColor {
let l = 0.299 * bg.0 as f64 + 0.587 * bg.1 as f64 + 0.114 * bg.2 as f64;
if l > 140.0 {
RGBColor(0, 0, 0)
} else {
RGBColor(255, 255, 255)
}
}