panel.GTIPane
An interactive table in a Panel app or notebook, whose view and selection are parameters.
Usage
panel.GTIPane(
table,
**params,
)The table (a GTI table, or a GT table with opt_interactive()) is shown as a Panel component, and its state is in its parameters: query, search and sort (its view), rows (the rows the view keeps) and selection (the rows selected). Each change the reader makes to them sets them, so that they can be watched (with pn.bind(), param.depends() or .param.watch()) like any other Panel parameter; and setting query, search, sort or selection changes the table, as if the reader had.
A GTI table with more rows than the browser is quick with keeps them in Python instead (see i_scale()), and sends the browser a page at a time. Then rows is found in Python (without linked tables’ selections).
Parameters
table: GT-
The table to show: a GTI table, or a GT table with opt_interactive().
**params: Any-
Panel’s parameters of a component (e.g.,
margin=,visible=).
Examples
import panel as pn
from great_tables import GTI, exibble
from great_tables.panel import GTIPane
pn.extension()
table = GTIPane(
GTI(exibble).i_cols_filter(columns="fctr", type="facet").i_selection("multiple")
)
def selected(selection):
return exibble.iloc[selection]
pn.Column(table, pn.bind(selected, table.param.selection)).servable()Methods
| Name | Description |
|---|---|
| data() | The table’s data, with the rows its view keeps, in the order shown (see rows), or with |
data()
The table’s data, with the rows its view keeps, in the order shown (see rows), or with
Usage
data(selected=False)selected=True, the rows selected (in data order): a DataFrame of the data’s library, with all of its columns.