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.kittyrasterises the same spec to PNG and emits a kitty graphics APC escape sequence viakitty::encode_png_apc. 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.
- 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.
Constants§
- DEFAULT_
TEXT_ PX - The rendered height, in pixels, of label text at the sizes the layout was designed for.
plotters draws a font of size
nabout four fifths ofntall, so the designed size 11 is 9 px of glyph.