bland 0.2.1

Pure-Rust library for paper-ready, monochrome, hatch-patterned technical plots in the visual tradition of 1960s-80s engineering reports.
Documentation
// Embedded SVG content can contain bracketed text (e.g. axis labels
// like "t [s]") that rustdoc mis-parses as intra-doc links. The
// embeds are checked-in HTML, not docstrings — silence the lint.
#![allow(rustdoc::broken_intra_doc_links)]

//! BLAND — pure-Rust technical drawing.
//!
//! A library for paper-ready, monochrome, hatch-patterned plots in the
//! visual tradition of 1960s-80s engineering reports. Output is SVG —
//! resolution-independent, prints clean on any printer, embeds cleanly
//! into LaTeX, PDF pipelines, and HTML documents.
#![doc = include_str!("../docs/hero/hero_oscillation.html")]
//!
//! # Quick start
//!
//! ```no_run
//! use bland::{Figure, PaperSize, Stroke};
//!
//! let xs: Vec<f64> = (0..=100).map(|i| i as f64 / 10.0).collect();
//! let ys: Vec<f64> = xs.iter().map(|t| (-t / 4.0).exp() * t.cos()).collect();
//! let env: Vec<f64> = xs.iter().map(|t| (-t / 4.0).exp()).collect();
//!
//! let fig = Figure::new()
//!     .size(PaperSize::A5Landscape)
//!     .title("Damped oscillation")
//!     .xlabel("t [s]")
//!     .ylabel("x(t)")
//!     .line(&xs, &ys, |s| s.label("response"))
//!     .line(&xs, &env, |s| s.label("envelope").stroke(Stroke::Dashed))
//!     .hline(0.0, |s| s.stroke(Stroke::Dotted))
//!     .legend_top_right();
//!
//! std::fs::write("oscillation.svg", fig.to_svg()).unwrap();
//! ```
//!
//! # Why monochrome?
//!
//! - **Prints clean.** Plots look the same on a laser printer, a color
//!   printer, and a photocopy. No "figure unreadable in proceedings"
//!   surprises.
//! - **Accessible by default.** Hatching, stroke dashing, and marker
//!   shape distinguish series — so plots survive grayscale rendering and
//!   are legible to readers with color vision deficiency.
//!
//! # Plot gallery
//!
//! ## Histograms with hatched fills
#![doc = include_str!("../docs/hero/hero_histogram.html")]
//!
//! ## Grouped bar charts
#![doc = include_str!("../docs/hero/hero_bar.html")]
//!
//! ## Heatmaps with monochrome ramps
#![doc = include_str!("../docs/hero/hero_heatmap.html")]
//!
//! ## Iso-line contours
#![doc = include_str!("../docs/hero/hero_contour.html")]
//!
//! ## Box plots with computed Tukey fences
#![doc = include_str!("../docs/hero/hero_boxplot.html")]
//!
//! ## Vector fields
#![doc = include_str!("../docs/hero/hero_quiver.html")]
//!
//! ## Polar coordinates
#![doc = include_str!("../docs/hero/hero_polar.html")]
//!
//! ## Smith chart
#![doc = include_str!("../docs/hero/hero_smith.html")]
//!
//! ## Geographic basemaps
#![doc = include_str!("../docs/hero/hero_world.html")]
//!
//! ## Lunar maria
#![doc = include_str!("../docs/hero/hero_moon.html")]
//!
//! # Features
//!
//! - **Series**: line, scatter, bar (grouped), area, histogram, heatmap,
//!   polygon, error bars, box plots, stem plots, quiver / vector fields,
//!   contour iso-lines, reference rules.
//! - **Hatch patterns**: 15 presets — diagonals, crosshatch, dots, brick,
//!   zigzag, checker. Build your own via [`Hatch::DEFAULT_RAMP`] for
//!   heatmap shading.
//! - **Markers**: 12 presets, alternating open / filled / cross variants.
//! - **Stroke dashes**: solid, dashed, dotted, dash-dot, long-dash, fine.
//! - **Paper presets**: A4, A5, Letter, Legal, Square — portrait & landscape.
//! - **Themes**: [`Theme::report_1972`] (serif), [`Theme::blueprint`]
//!   (monospace), [`Theme::gazette`] (newspaper).
//! - **Engineering [`TitleBlock`]** with project / drawn-by / date / scale
//!   / sheet / revision.
//! - **Annotations**: in-data text and arrows with anti-overlap halos.
//! - **Linear and log axes** with nice-rounded tick placement.
//! - **Projections**: polar, Smith, Mercator, equirectangular.
//! - **Built-in basemaps**: Earth coastlines & borders (Natural Earth
//!   1:110m, optional 1:50m via the `high-res-basemaps` feature),
//!   reference parallels, lunar maria.
//! - **Multi-panel layouts** via [`multi_panel`].
//! - **Composite helpers**: [`bode`], [`qq_plot`].
//! - **Pure Rust, zero dependencies.**

pub mod basemaps;
mod contour;
mod figure;
mod geo;
mod grid;
mod hatch;
mod helpers;
mod markers;
mod polar;
mod renderer;
mod scale;
mod series;
mod smith;
mod stats;
mod strokes;
mod svg;
mod theme;
mod ticks;
mod title_block;

#[cfg(feature = "gui")]
pub mod gui;

#[cfg(feature = "raster")]
mod raster;

pub use basemaps::{Basemap, BasemapOpts, Resolution};
pub use figure::{
    AxesStyle, Clip, ColorbarPosition, Figure, GridStyle, HeatmapOpts, LegendPosition, PaperSize,
    PolarGridOpts, Projection, SmithGridOpts, TextAnchor,
};
pub use geo::{equirect, format_lat, format_lon, graticule, mercator, GraticuleOpts};
pub use grid::{multi_panel, PanelGridOpts};
pub use hatch::Hatch;
pub use helpers::{bode, qq_plot, BodeOpts, QqOpts};
pub use markers::Marker;
pub use polar::{circle as polar_circle, from_xy as polar_from_xy, project as polar_project};
pub use series::{
    AreaOpts, BarOpts, BinStrategy, BoxPlotOpts, ContourOpts, Err, ErrorBarOpts, HistogramOpts,
    HlineOpts, LineOpts, Normalize, Origin, PolygonOpts, QuiverOpts, ScatterOpts, StemOpts,
    VlineOpts,
};
pub use smith::{gamma_from_z, r_circle as smith_r_circle, x_arc as smith_x_arc, z_from_gamma};
pub use stats::{boxplot_stats, normal_quantile, quantile, BoxStats};
pub use strokes::Stroke;
pub use theme::{Theme, TickDirection, TitleCase};
pub use title_block::{TitleBlock, TitleBlockPosition};