Crate rat_ftable

Source
Expand description

semver stable crates.io Documentation License License

This crate is a part of rat-salsa.

For examples see rat-ftable GitHub.

§Table widget for ratatui

Can be used as a drop-in replacement for the ratatui table. But that’s not the point of this widget.

This widget uses the TableData trait instead of rendering all the table-cells and putting them into a Vec. This way rendering time only depends on the screen-size not on the size of your data.

There is a second trait TableDataIter that works better if you only have an Iterator over your data.

Caveat: If the Iterator doesn’t have an efficient skip() or if you can’t give the number of rows this will iterate all your data for the necessary information. This might slow down everything a bit.

image

More bullet points:

  • Row and Column scrolling.
  • Pluggable selection with TableSelection
    • Allows row/column/cell selection.
    • Row/column/cell selection + Header/Footer selection each with its own style.
  • Key/mouse handling present.

Eventhandling is currently crossterm only.

Modules§

edit
Extra widgets for inline editing in a table.
event
Eventhandling.
selection
Different selection models for Table.
textdata
Implements a Row and a Cell struct that are compatible to ratatui. You only need these if you use preformatted data.

Structs§

Table
Table widget.
TableContext
Render-context for rendering a table-cell.
TableState
Table state.
TableStyle
Combined style.

Traits§

TableData
Trait for accessing the table-data by the Table.
TableDataIter
Trait for accessing the table-data by the Table.
TableSelection
Trait for the different selection models used by Table.

Functions§

handle_doubleclick_events
Handle all events for recognizing double-clicks.