densa_grid/lib.rs
1//! A data grid over your own data, drawn onto a `densa_draw::Canvas`.
2//!
3//! Domain-agnostic: an application describes its [`Column`]s and implements [`GridSource`]
4//! (one call per visible cell, formatting into a stack buffer); [`GridPainter`] lays the
5//! columns out from font metrics, aligns text, fills overflowing numbers with `#` like a
6//! spreadsheet, and draws cell styles and glyphs. No GPU dependency: hand the canvas's
7//! instances to `densa-render` (or any other backend) to show them.
8//!
9//! A widget showing a grid asks its data through [`GridModel`] instead: the same cells, plus
10//! the rows to scroll through and sorting by column.
11//!
12//! Painting allocates nothing once the frame's characters are cached.
13
14mod grid;
15mod layout;
16mod model;
17mod palette;
18
19pub use densa_core::{Color, Point, Rect};
20pub use grid::{CellStyle, CellText, GridPainter, GridSource, CELL_BYTES};
21pub use layout::{Align, Column, GridLayout};
22pub use model::{GridModel, SortOrder};
23pub use palette::Palette;