Skip to main content

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 recipe_input;
42#[doc(hidden)]
43pub use recipe_input::NdarrayBinding;
44mod significance;
45mod snapshot;
46mod source;
47
48pub use error::AdapterError;
49pub use frontend::{
50    Bar, Beeswarm, Boxplot, Coefficient, Density, Dumbbell, Forest, Heatmap, Histogram,
51    HorizontalBar, Interaction, Line, LinePath, Marginal, Matrix, PlotAdapter, PointInterval, Qq,
52    Raincloud, Regression, Scatter, StackedBar, StackedHorizontalBar, Trajectory, Violin,
53    Waterfall,
54};
55pub use lichtung_plot::{
56    composition, coordinates, data, errors, formatting, guides, kind, layout, operation, output,
57    plots, recipe, scales, stats, style, text, theme, BooleanValues, Canvas, CategoryValues, Color,
58    Error, Layer, NumericFormat, NumericValues, Output, Plot, Result, Text, Theme,
59};
60
61#[cfg(test)]
62mod tests;