sim_lib_view_math/lib.rs
1//! Math, plotting, tensor, and symbolic lenses for SIM Web.
2//!
3//! This lens family makes graphical math first-class: `scene/plot` series and
4//! function plots, `scene/matrix` editable tensor/matrix slices, a
5//! symbolic-expression tree lens, and slider/knob-driven parameter sweeps
6//! (`intent/set-param`) with snapshot and compare. Numbers are read from the
7//! existing `sim-lib-numbers-*` domains for display; the runtime value stays the
8//! authoritative number.
9//!
10//! # Example
11//!
12//! A numeric series opens in a plot lens as a Scene value:
13//!
14//! ```
15//! let scene = sim_lib_view_math::plot_view("y = x", &[(0.0, 0.0), (1.0, 1.0)]);
16//! assert!(sim_lib_scene::validate_scene(&scene).is_ok());
17//! ```
18
19#![forbid(unsafe_code)]
20#![deny(missing_docs)]
21
22pub mod cookbook;
23pub mod matrix;
24pub mod num;
25pub mod plot;
26pub mod sweep;
27pub mod symbolic;
28
29pub use cookbook::plot_series_demo;
30pub use matrix::{MATRIX_LENS, cell, matrix, matrix_view, set_cell};
31pub use num::{as_f64, number, point};
32pub use plot::{PLOT_LENS, multi_plot_view, plot_view, series};
33pub use sweep::Sweep;
34pub use symbolic::{SYMBOLIC_LENS, call, symbolic_tree};
35
36/// Embedded cookbook recipe books shipped with this library.
37pub static RECIPES: sim_cookbook::EmbeddedDir =
38 include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
39
40#[cfg(test)]
41mod tests;