Expand description
oxiui-table — Virtualized table widget for OxiUI.
Provides a Table<S> widget backed by a RowSource trait, with viewport-based
virtualization: only rows visible in the current scroll window (plus a small
overscan) are materialized per frame. This keeps memory and CPU usage constant
regardless of the total row count.
§Features
egui-table— eguiScrollArea::show_rowsrendering backend.iced-table— icedscrollable+ windowedcolumnrendering backend.
§Example
use oxiui_table::{Table, RowSource, Cell, ColumnDef};
struct MyData;
impl RowSource for MyData {
fn row_count(&self) -> usize { 1000 }
fn row(&self, i: usize) -> Vec<Cell> {
vec![Cell::Int(i as i64), Cell::Text(format!("row-{i}"))]
}
fn column_defs(&self) -> &[ColumnDef] {
&[]
}
}
let table = Table::new(MyData).with_row_height(24.0);
let visible = table.materialize_visible(240.0, 0.0);
assert!(visible.len() <= 20);Re-exports§
pub use async_source::AsyncRowSource;pub use async_source::BoxFuture;pub use async_source::PrefetchBuffer;pub use clipboard::selection_to_tsv;pub use clipboard::CaptureClipboard;pub use clipboard::ClipboardSink;pub use clipboard::NullClipboard;pub use format::CellFormatter;pub use format::DateFormatter;pub use format::DefaultFormatter;pub use format::NumberFormatter;pub use header::handle_row_click;pub use header::move_column;pub use header::HeaderSortState;pub use header::TableIndex;pub use height::CumulativeHeights;pub use height_cache::CumulativeHeightCache;pub use height_cache::RowCache;pub use pagination::PaginationState;
Modules§
- accessibility
oxiui-accessibilityintegration foroxiui-table.- async_
source - Async data source support for OxiUI table.
- clipboard
- Clipboard integration for the table widget.
- format
- Cell formatting: convert a
Cellto a display string with configurable number formatting, date formatting, or a custom closure. - header
- Header-level UI state: sort indicator, column reordering, and memoised index computation.
- height
- Prefix-sum cache for variable-height row scroll lookup.
- height_
cache - Prefix-sum cumulative height cache with O(log n) binary search for row-by-offset lookup. Row caching: bounded LRU cache for last-N materialized rows.
- nav
- Keyboard navigation state for the table widget.
- pagination
- Pagination state: page-size, current page, and row-range computation.
- persistence
- COOLJAPAN ecosystem integration — table state persistence via
oxicode. - text_
integration oxiui-textintegration foroxiui-table.- theme_
integration oxiui-themeintegration foroxiui-table.
Structs§
- Column
Def - Column definition: name, preferred display width, and optional per-column configuration.
- Column
DefBuilder - Fluent builder for
ColumnDef. - Column
Filter - A case-insensitive substring filter applied to a single column.
- Rendered
Cell - A single positioned header cell produced by
Table::render_header. - Selection
Model - Tracks the set of selected row indices and an anchor for range selection.
- Sort
State - The active sort: which column and in which direction.
- Table
- A virtualized table widget backed by a
RowSource. - Table
Builder - Fluent builder for creating a
Tablewith a concrete data source.
Enums§
- Cell
- A single table cell value.
- Cell
Align - Horizontal alignment of a cell’s content within its column.
- Selection
Mode - The selection mode of a table.
- Sort
Direction - The sort direction for a column.
- Table
Error - Errors returned by
RowSourcemutating operations. - Table
Event - Events emitted by the table widget in response to user interaction.
Constants§
- DEFAULT_
ROW_ HEIGHT - The default row height in logical pixels, used by
RowSource::row_heightwhen no per-row override is provided.
Traits§
- Cell
Renderer - Trait for custom cell rendering.
- RowSource
- Trait that provides rows to the table widget.
Functions§
- aggregate_
avg - Compute the arithmetic average of all numeric cells in
cells. - aggregate_
count - Count non-empty cells in
cells.Cell::Emptycells are excluded. - aggregate_
sum - Sum all numeric cells in
cells, treatingCell::IntandCell::Floatasf64. Non-numeric andCell::Emptycells are skipped. - apply_
all - Combine multiple
ColumnFilters with AND semantics, returning matching row indices. A row matches only if it satisfies every active filter. - filter_
indices - Compute the indices of rows in
sourcefor whichpredicatereturnstrue. - sort_
indices - Compute the row-index permutation that sorts
sourceby a single column. - to_csv
- Serialize
sourceto a CSV string.