plotting/lib.rs
1//! Chart intermediate representation plus renderers for the three report
2//! kinds (Balance, Activity, Category Breakdown).
3//!
4//! Consumers select a renderer through features:
5//!
6//! - `svg` pulls `plotters::SVGBackend` and exposes [`svg::render_svg`].
7//! Implies `adapters`.
8//! - `canvas` pulls `plotters-canvas` and exposes
9//! [`canvas::render_canvas`] for `wasm32` targets. Does **not** imply
10//! `adapters` — canvas consumers receive a pre-built [`ChartSpec`]
11//! over JSON.
12//! - `ratatui` exposes [`ratatui::render_ratatui`] for the TUI.
13//! Implies `adapters`.
14//! - `kitty` rasterises the same spec to PNG and emits a kitty
15//! graphics APC escape sequence via [`kitty::render_kitty`]. Implies
16//! `adapters`.
17//!
18//! Everything shares the [`spec::ChartSpec`] intermediate representation.
19//! When `adapters` is enabled, [`adapters`] builds specs from server
20//! view projections; otherwise consumers construct specs directly (the
21//! WASM client does this by deserialising JSON from the server).
22
23#[cfg(feature = "adapters")]
24pub mod adapters;
25pub mod spec;
26
27#[cfg(any(feature = "svg", feature = "canvas", feature = "kitty"))]
28pub(crate) mod draw;
29
30#[cfg(feature = "svg")]
31pub mod svg;
32
33#[cfg(feature = "canvas")]
34pub mod canvas;
35
36#[cfg(feature = "ratatui")]
37pub mod ratatui;
38
39#[cfg(feature = "text")]
40pub mod text;
41
42#[cfg(feature = "kitty")]
43pub mod kitty;
44
45pub use spec::{ChartKind, ChartSpec, Series, SeriesPoint};