pub use crate::render::color::Color;
pub use crate::render::style::{LineStyle, MarkerStyle};
pub use crate::render::theme::Theme;
pub use crate::core::grid_style::GridStyle;
pub use crate::core::style::PlotStyle;
pub use crate::core::style_utils::{StyleResolver, defaults};
pub use crate::render::text::{FontFamily, FontWeight};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_color_reexport() {
let color = Color::new(255, 128, 64);
assert_eq!(color.r, 255);
assert_eq!(color.g, 128);
assert_eq!(color.b, 64);
}
#[test]
fn test_theme_reexport() {
let light = Theme::light();
let dark = Theme::dark();
assert_ne!(light.background, dark.background);
}
#[test]
fn test_line_style_reexport() {
let solid = LineStyle::Solid;
let dashed = LineStyle::Dashed;
assert!(solid.to_dash_array().is_none());
assert!(dashed.to_dash_array().is_some());
}
#[test]
fn test_marker_style_reexport() {
let circle = MarkerStyle::Circle;
let square = MarkerStyle::Square;
assert_ne!(format!("{:?}", circle), format!("{:?}", square));
}
#[test]
fn test_grid_style_reexport() {
let grid = GridStyle::default();
assert!(grid.visible);
let hidden = GridStyle::hidden();
assert!(!hidden.visible);
}
#[test]
fn test_plot_style_reexport() {
let default = PlotStyle::Default;
let publication = PlotStyle::Publication;
assert_ne!(default.config().figure.dpi, publication.config().figure.dpi);
}
#[test]
fn test_style_resolver_reexport() {
let theme = Theme::light();
let resolver = StyleResolver::new(&theme);
assert_eq!(resolver.line_width(None), theme.line_width);
}
#[test]
fn test_defaults_reexport() {
let violin_alpha = std::hint::black_box(defaults::VIOLIN_FILL_ALPHA);
let boxplot_alpha = std::hint::black_box(defaults::BOXPLOT_FILL_ALPHA);
assert!(violin_alpha > 0.0);
assert!(boxplot_alpha > 0.0);
}
}