pyxley.charts.datatables package¶
Submodules¶
pyxley.charts.datatables.datatable module¶
-
class
pyxley.charts.datatables.datatable.
DataTable
(table_id, url, df, columns={}, init_params={}, paging=False, searching=False, sortable=False, classname='display', route_func=None, **kwargs)¶ Bases:
pyxley.charts.charts.Chart
Wrapper for jquery DataTables.
This class provides a wrapper for the JQuery DataTables component within PyxleyJS. Datatables options can be passed through the kwargs.
Parameters: - table_id (str) – html element id.
- url (str) – name of the endpoint to be created.
- df (dataframe) – tabular data to be rendered.
- columns (OrderedDict) – columns to display. order is preserved by the OrderedDict.
- init_params (dict) – parameters used to initialize the table.
- paging (bool) – enable paging.
- searching (bool) – enable searching.
- sortable (bool) – enable sorting.
- classname (str) – html classname for css.
- route_func (function) – endpoint function. Default is None.
-
static
format_row
(row, bounds, columns)¶ Formats a single row of the dataframe
-
static
to_json
(df, columns, confidence={})¶ Transforms dataframe to properly formatted json response