Expand description
Chart intermediate representation plus renderers for the three report kinds (Balance, Activity, Category Breakdown).
Consumers select a renderer through features:
svgpullsplotters::SVGBackendand exposessvg::render_svg. Impliesadapters.canvaspullsplotters-canvasand exposescanvas::render_canvasforwasm32targets. Does not implyadapters— canvas consumers receive a pre-builtChartSpecover JSON.ratatuiexposesratatui::render_ratatuifor the TUI. Impliesadapters.kittyrasterises the same spec to PNG and emits a kitty graphics APC escape sequence viakitty::render_kitty. Impliesadapters.
Everything shares the spec::ChartSpec intermediate representation.
When adapters is enabled, adapters builds specs from server
view projections; otherwise consumers construct specs directly (the
WASM client does this by deserialising JSON from the server).
Re-exports§
pub use spec::ChartKind;pub use spec::ChartSpec;pub use spec::Series;pub use spec::SeriesPoint;
Modules§
- adapters
- Turn view projections into chart specs. Adapters are pure functions that handle top-N clipping, multi-currency scaling decisions, and layout choices (x-axis assignment, series arrangement) so renderers only have to draw.
- canvas
- Canvas renderer for the browser. Uses
plotters-canvas::CanvasBackendand the shareddraw_ondispatch incrate::draw, so a chart rendered into a<canvas>looks identical to its SVG twin. - kitty
- Kitty terminal graphics renderer.
- ratatui
- Ratatui renderer. Returns a
RatatuiChartwrapper that owns the axis strings and f64 datasets thatratatui::widgets::{Chart, BarChart}borrow. The CLI draws it by callingRatatuiChart::draw(&mut frame, area)on its report screen. - spec
- Chart intermediate representation.
- svg
- SVG renderer. Uses plotters’
SVGBackendand the shareddrawdispatch indraw.rsso the canvas renderer produces identical layouts. - text
- Plain-text chart renderer. Draws
ChartSpecas a block of text suitable for the CLI’s log region, terminal stdout, or any context where SVG/canvas/ratatui widgets aren’t available.