eunoia 0.7.0

A library for creating area-proportional Euler and Venn diagrams
Documentation
//! # Eunoia
//!
//! A Rust library for creating area-proportional Euler and Venn diagrams.
//!
//! Eunoia generates optimal layouts for set visualizations using various geometric shapes
//! (circles, ellipses, rectangles, triangles). The library uses a two-phase optimization
//! approach:
//!
//! 1. **Initial layout**: Multi-dimensional scaling (MDS) to place fixed-size shapes
//! 2. **Refinement**: Comprehensive optimization to minimize loss functions (RegionError or stress)
//!
//! ## Example
//!
//! ```rust
//! use eunoia::{DiagramSpecBuilder, Fitter, InputType};
//! use eunoia::geometry::shapes::Circle;
//!
//! // Build specification (shape-agnostic)
//! let spec = DiagramSpecBuilder::new()
//!     .set("A", 5.0)
//!     .set("B", 2.0)
//!     .intersection(&["A", "B"], 1.0)
//!     .input_type(InputType::Exclusive)
//!     .build()
//!     .expect("Failed to build diagram specification");
//!
//! // Choose shape type when fitting
//! let layout = Fitter::<Circle>::new(&spec).fit().unwrap();
//! ```

pub mod error;
pub mod fitter;
pub mod geometry;
pub mod loss;
pub mod math;
pub mod spec;

pub mod constants;
pub mod venn;

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

// Internal test utilities. Also reachable from example binaries when the
// `corpus` feature is enabled — only the `corpus` submodule is publicly
// usable in that mode; everything else stays gated on `cfg(test)`.
#[cfg(any(test, feature = "corpus"))]
pub mod test_utils;

// Re-export main API types
pub use error::DiagramError;
pub use fitter::{Fitter, InitialSampler, Layout, MdsSolver, Optimizer};
pub use spec::{Combination, DiagramSpecBuilder, InputType};
pub use venn::VennDiagram;