Skip to main content

Crate benday_core

Crate benday_core 

Source
Expand description

benday-core: terminal charts from a Vega-Lite-style JSON spec.

Pure spec-in, string-out — no I/O, no TTY detection, no environment sniffing — so it can sit under a CLI, an MCP server, or another Rust program unchanged.

Re-exports§

pub use error::Error;

Modules§

compile
The compiler: resolve a spec against its data into a Scene — every data- and layout-dependent decision made, geometry normalized to the plot rect. All colors are resolved here; the rasterizer never sees a Theme.
error
ingest
Data ingestion: resolve the spec’s inline data and/or a piped data document into a normalized Table. Pure — the CLI does the I/O.
scene
The Scene: benday’s intermediate representation. compile() resolves a spec against its data into a Scene — every data- and layout-dependent decision made, geometry normalized to the plot rect — and rasterize() turns a Scene into glyphs. The serialized form is the golden-corpus snapshot and the --dump-scene output; it is explicitly unstable.
spec
The chart specification: a strict subset of Vega-Lite’s JSON grammar.
theme
Color themes, named after print processes. Gradients and palettes are generated in OKLCH so ramps are perceptually uniform (no brightness wobble mid-gradient like naive HSV interpolation).

Structs§

RenderOptions
Rendered
Rgb

Enums§

BarStyle
How bar marks are filled. Dots (the house style) rasterize bars through the pixel canvas at 4 vertical levels per cell; blocks give a solid silhouette with finer 8-levels-per-cell caps.
Marker

Functions§

render