Expand description
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()))?;Specialized values live in their functional modules. The complete root Theme and Color types have one public path:
use lichtung_plot::theme::Theme;The plot module exposes configuration, not implementation routines:
use lichtung_plot::plots::line;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);Public scale identities may grow in later releases:
use lichtung_plot::scales::ContinuousScaleKind;
fn name(kind: ContinuousScaleKind) -> &'static str {
match kind {
ContinuousScaleKind::Sequential => "sequential",
ContinuousScaleKind::Diverging => "diverging",
}
}Decoration rendering is also private:
use lichtung_plot::decorations::title_block::TitleBlock;use lichtung_plot::layout::Layout;Alpha inputs are exported through scales; internal preparation stays private:
use lichtung_plot::alpha::AlphaTarget;Re-exports§
pub use elements::Layer;
Modules§
- coordinates
- Coordinate axes, positions, domains and tick policies. Coordinate axes, positions, domains and tick policies.
- data
- Scientific input values and raw source identities. Private semantic value access shared by plot renderers.
- elements
- Additional plot layers, annotations and significance declarations. Additional plot layers, annotations and significance declarations.
- errors
- Typed failure reasons and operation effects. Structured diagnostics from actual binding, preparation and publication.
- formatting
- Scientific labels, number presentation and formatter contexts. Scientific labels, number presentation and formatter contexts.
- guides
- Legend and guide configuration. Legend and guide configuration.
- kind
- Plot-family markers and sealed configuration capabilities. Plot-family markers and sealed configuration capabilities.
- layout
- Layout and absolute publication-size configuration. Private plot and canvas layout modules.
- operation
- Cancellation and resource options for a single native operation. Per-call cancellation and native resource admission.
- output
- Publication options. Publication options.
- plots
- Plot-family identities, scientific inputs and plot-specific configuration. Plot-family identities, scientific inputs and plot-specific configuration.
- scales
- Scientific color and opacity encodings. Scientific color and opacity encodings.
- stats
- Display-only statistics (KDE, CI, OLS for fit lines). Scientific computations, policies and owning results.
- style
- Shared mark styles and paint values. Shared mark styles and paint values.
- text
- Font configuration, text layout and positioning. Shared source syntax for authored and prepared display text.
- theme
- Complete theme components and immutable theme construction. Built-in publication themes and private appearance resolution.
Structs§
- Boolean
Values - Named nullable Boolean values.
- Canvas
- A typed grid of independently configured charts rendered on one canvas.
- Category
Values - Named nullable categorical values stored with stable dictionary encoding.
- Color
- Complete RGBA paint with one opaque RGB identity and one opacity coefficient.
- Numeric
Format - Immutable scientific numeric presentation with explicitly selected locale.
- Numeric
Values - Named nullable numeric values stored as immutable native
f64data. - Output
- Opaque handle to one scene that has already been rendered.
- Plot
- One configured semantic plot backed by immutable Rust-native values.
- Text
- Authored display text with optional complete appearance and layout instructions.
- Theme
- Complete immutable appearance, independent of fonts discovered during rendering.
Enums§
- Error
- Error returned by plotting operations.
Type Aliases§
- Result
- Result returned by plotting operations.