lichtung_plot_ndarray/lib.rs
1//! Plot logical ndarray vectors, selected table columns and rectangular grids.
2//!
3//! The complete native renderer API is re-exported unchanged. Additional family
4//! constructors bind foreign inputs eagerly; only `from_data` retains a read-only
5//! source context for later logical-column lookup. `.into()` hands off an owned
6//! native plot and releases that context. Validity pairs use **true = present**.
7//! [`PlotAdapter::into_parts`] preserves source-free [`binding::BindingMetadata`] alongside
8//! the native Plot; restore the matching pair with [`PlotAdapter::from_parts`] or
9//! [`PlotAdapter::from_parts_with_data`] without reconstructing its configuration.
10//! [`binding::ColumnProjection`] associates borrowed one-column sources with their original
11//! logical coordinates; optional raw identities remain separate from display labels.
12//!
13//! Strided, transposed, reversed, Fortran and broadcast views follow logical index
14//! order. Nulls and present NaNs stay distinct; numeric primitives round to f64.
15//!
16//! Native capability bounds also apply to adapter receivers:
17//! ```compile_fail
18//! use lichtung_plot_ndarray::{scales::AlphaEncoding, Scatter};
19//! fn unsupported(plot: Scatter<'_>) {
20//! plot.line_alpha(AlphaEncoding::theme()); // Scatter has no line target.
21//! }
22//! ```
23
24#![allow(
25 clippy::needless_pass_by_value,
26 reason = "ndarray views are lightweight borrowed descriptors conventionally accepted by value"
27)]
28
29mod alpha;
30/// External data and source-binding policies.
31pub mod binding;
32mod capture;
33mod element;
34/// Native element declarations and local data-binding constructors.
35pub mod elements;
36mod error;
37mod frontend;
38mod input;
39mod layers;
40mod projection;
41mod significance;
42mod snapshot;
43mod source;
44
45pub use error::AdapterError;
46pub use frontend::{
47 Bar, Beeswarm, Boxplot, Coefficient, Density, Dumbbell, Forest, Heatmap, Histogram,
48 HorizontalBar, Interaction, Line, LinePath, Marginal, Matrix, PlotAdapter, PointInterval, Qq,
49 Raincloud, Regression, Scatter, StackedBar, StackedHorizontalBar, Trajectory, Violin,
50 Waterfall,
51};
52pub use lichtung_plot::{
53 coordinates, data, errors, formatting, guides, kind, layout, operation, output, plots, scales,
54 stats, style, text, theme, BooleanValues, Canvas, CategoryValues, Color, Error, Layer,
55 NumericFormat, NumericValues, Output, Plot, Result, Text, Theme,
56};
57
58#[cfg(test)]
59mod tests;