pub mod dpi {
pub const WEB: f64 = 72.0;
pub const SCREEN: f64 = 100.0;
pub const PRINT: f64 = 150.0;
pub const HIGH_PRINT: f64 = 300.0;
pub const MAX: f64 = 2400.0;
pub const MIN: f64 = 72.0;
pub const DEFAULT: f64 = 100.0;
}
pub mod dimensions {
pub const WIDTH: f64 = 6.4;
pub const HEIGHT: f64 = 4.8;
pub const IEEE_SINGLE_COLUMN: f64 = 3.5;
pub const IEEE_DOUBLE_COLUMN: f64 = 7.16;
pub const NATURE_WIDTH: f64 = 3.5;
pub const PRESENTATION_WIDTH: f64 = 10.0;
pub const PRESENTATION_HEIGHT: f64 = 7.5;
pub const POSTER_WIDTH: f64 = 12.0;
pub const POSTER_HEIGHT: f64 = 9.0;
}
pub mod font_scales {
pub const TITLE: f64 = 1.2;
pub const TITLE_LARGE: f64 = 1.4;
pub const TITLE_COMPACT: f64 = 1.125;
pub const LABEL: f64 = 1.0;
pub const TICK: f64 = 0.9;
pub const TICK_COMPACT: f64 = 0.875;
pub const LEGEND: f64 = 0.9;
pub const LEGEND_COMPACT: f64 = 0.75;
}
pub mod line_widths {
pub const THIN: f32 = 0.5;
pub const NORMAL: f32 = 1.0;
pub const MEDIUM: f32 = 1.5;
pub const THICK: f32 = 2.0;
pub const EXTRA_THICK: f32 = 3.0;
pub const AXIS: f32 = 0.8;
pub const GRID: f32 = 0.4;
pub const TICK: f32 = 0.5;
pub const PUBLICATION: f32 = 0.75;
pub const PRESENTATION: f32 = 2.5;
}
pub mod font_sizes {
pub const DEFAULT: f32 = 10.0;
pub const MINIMAL: f32 = 9.0;
pub const PUBLICATION: f32 = 8.0;
pub const NATURE: f32 = 7.0;
pub const PRESENTATION: f32 = 14.0;
pub const HIGH_CONTRAST: f32 = 12.0;
pub const WEB: f32 = 11.0;
pub const POSTER: f32 = 18.0;
}
pub mod spacing {
pub const TITLE_PAD: f32 = 12.0;
pub const TITLE_PAD_COMPACT: f32 = 6.0;
pub const TITLE_PAD_LARGE: f32 = 18.0;
pub const LABEL_PAD: f32 = 6.0;
pub const TICK_PAD: f32 = 4.0;
pub const LEGEND_PAD: f32 = 8.0;
pub const TICK_LENGTH: f32 = 4.0;
}
pub mod margins {
pub const AUTO_MIN: f32 = 0.5;
pub const AUTO_MAX: f32 = 1.2;
pub const COMPACT_MIN: f32 = 0.25;
pub const COMPACT_MAX: f32 = 0.6;
pub const LARGE_MIN: f32 = 0.6;
pub const LARGE_MAX: f32 = 1.5;
}
const _: () = {
assert!(dpi::WEB < dpi::SCREEN);
assert!(dpi::SCREEN < dpi::PRINT);
assert!(dpi::PRINT < dpi::HIGH_PRINT);
assert!(dpi::HIGH_PRINT < dpi::MAX);
assert!(font_scales::TICK < font_scales::LABEL);
assert!(font_scales::LABEL < font_scales::TITLE);
assert!(line_widths::THIN < line_widths::NORMAL);
assert!(line_widths::NORMAL < line_widths::MEDIUM);
assert!(line_widths::MEDIUM < line_widths::THICK);
};
#[cfg(test)]
mod tests {
#[test]
fn constants_compile_with_expected_relationships() {
let max_dpi = super::dpi::MAX;
let web_dpi = super::dpi::WEB;
let thick = super::line_widths::THICK;
let thin = super::line_widths::THIN;
assert!(max_dpi > web_dpi);
assert!(thick > thin);
}
}