Skip to content
v0.2.1

Table

TableDataType = Literal['string', 'number', 'boolean', 'date', 'datetime']
class TableColumn(BaseModel):

Column definition for a Table visualization.

Attributes:

  • id str — Column id (used as key in each row dict).
  • label Optional[str] — Optional human-readable column label.
  • data_type TableDataType — Column data type (for example "string" or "number").
  • sortable bool — Whether the column can be sorted in the frontend.
  • visible bool — Whether the column is visible by default.
Source
class TableColumn(BaseModel):
"""Column definition for a `Table` visualization.
Attributes:
id: Column id (used as key in each row dict).
label: Optional human-readable column label.
data_type: Column data type (for example `"string"` or `"number"`).
sortable: Whether the column can be sorted in the frontend.
visible: Whether the column is visible by default.
"""
id: str
label: Optional[str] = None
data_type: TableDataType = "string"
sortable: bool = True
visible: bool = True
class Table(Visualization):

Tabular visualization with typed columns and row data.

Rows are dictionaries keyed by TableColumn.id.

Attributes:

  • type Literal['table'] — Fixed discriminator "table".
  • columns List[TableColumn] — Column definitions.
  • rows List[dict[str, Any]] — List of row dicts.
Source
class Table(Visualization):
"""Tabular visualization with typed columns and row data.
Rows are dictionaries keyed by `TableColumn.id`.
Attributes:
type: Fixed discriminator `"table"`.
columns: Column definitions.
rows: List of row dicts.
"""
type: Literal["table"] = "table"
columns: List[TableColumn]
rows: List[dict[str, Any]]