lichtung-plot 0.3.0

Strongly typed scientific plotting with deterministic SVG and PNG output
Documentation
//! A strongly typed scientific plotting and SVG rendering library.
//!
//! Complete immutable theme values and their built-in constructors are available
//! from the crate root:
//! ```
//! let _ = lichtung_plot::Theme::publication();
//! ```
//!
//! Canvas selects a complete root theme from its explicit or construction-default
//! slot. Child Plots without an explicit theme inherit that effective value:
//! ```
//! use lichtung_plot::{Canvas, NumericValues, Plot, Theme};
//!
//! let canvas = Canvas::grid(1, 2)?
//!     .theme(Theme::nature())
//!     .panel(0, 0, Plot::scatter(
//!         NumericValues::new("x", [1.0, 2.0]),
//!         NumericValues::new("y", [1.0, 2.0]),
//!     ))?
//!     .panel(0, 1, Plot::scatter(
//!         NumericValues::new("x", [1.0, 2.0]),
//!         NumericValues::new("y", [2.0, 1.0]),
//!     ).theme(Theme::science()))?;
//! # let _ = canvas;
//! # Ok::<(), lichtung_plot::Error>(())
//! ```
//!
//! Specialized values live in their functional modules. The complete root
//! Theme and Color types have one public path:
//! ```compile_fail
//! use lichtung_plot::theme::Theme;
//! ```
//!
//! The plot module exposes configuration, not implementation routines:
//! ```compile_fail
//! use lichtung_plot::plots::line;
//! ```
//! ```compile_fail
//! use lichtung_plot::AlphaEncoding;
//! ```
//!
//! Common line patterns can be used in complete theme strokes and reference
//! guides without converting between types:
//! ```
//! use lichtung_plot::{Color, elements::GuideStyle, style::LinePattern, theme::StrokeTheme};
//! let pattern = LinePattern::MediumDash;
//! let stroke = StrokeTheme::new(Color::rgb(80, 120, 140), 1.5, pattern)?;
//! let guide = GuideStyle::new(stroke.get_color(), stroke.get_width(), stroke.get_pattern())?;
//! assert_eq!(guide.get_pattern(), pattern);
//! # Ok::<(), lichtung_plot::Error>(())
//! ```
//!
//! Public scale identities may grow in later releases:
//! ```compile_fail
//! use lichtung_plot::scales::ContinuousScaleKind;
//! fn name(kind: ContinuousScaleKind) -> &'static str {
//!     match kind {
//!         ContinuousScaleKind::Sequential => "sequential",
//!         ContinuousScaleKind::Diverging => "diverging",
//!     }
//! }
//! ```
//!
//! Decoration rendering is also private:
//! ```compile_fail
//! use lichtung_plot::decorations::title_block::TitleBlock;
//! ```
//!
//! ```compile_fail
//! use lichtung_plot::layout::Layout;
//! ```
//!
//! Alpha inputs are exported through scales; internal preparation stays private:
//! ```compile_fail
//! use lichtung_plot::alpha::AlphaTarget;
//! ```

#![deny(missing_docs)]

mod alpha;
mod builder;
mod canvas;
/// Fixed local image resources and native composition.
pub mod composition;
/// Scientific input values and raw source identities.
pub mod data;
mod decorations;
mod error;
/// Typed failure reasons and operation effects.
pub mod errors;
mod font;
mod geometry;
mod input;
/// Plot-family markers and sealed configuration capabilities.
pub mod kind;
mod labels;
mod layers;
/// Layout and absolute publication-size configuration.
pub mod layout;
mod numeric;
/// Cancellation and resource options for a single native operation.
pub mod operation;
mod orchestrator;
/// Publication options.
pub mod output;
/// Plot-family identities, scientific inputs and plot-specific configuration.
pub mod plots;
/// Portable native plotting declarations.
pub mod recipe;
mod render;
mod scene;
mod significance;
mod spec;
/// Display-only statistics (KDE, CI, OLS for fit lines).
pub mod stats;
/// Font configuration, text layout and positioning.
pub mod text;
/// Complete theme components and immutable theme construction.
pub mod theme;
mod values;

/// Coordinate axes, positions, domains and tick policies.
pub mod coordinates;
/// Additional plot layers, annotations and significance declarations.
pub mod elements;
/// Scientific labels, number presentation and formatter contexts.
pub mod formatting;
/// Legend and guide configuration.
pub mod guides;
/// Scientific color and opacity encodings.
pub mod scales;
/// Shared mark styles and paint values.
pub mod style;

pub use builder::Plot;
pub use canvas::Canvas;
pub use elements::Layer;
pub use error::{Error, Result};
pub use numeric::format::NumericFormat;
pub use output::value::Output;
pub use text::value::Text;
pub use theme::paint::Color;
pub use theme::value::Theme;
pub use values::{BooleanValues, CategoryValues, NumericValues};