Table#
- class jdaviz.core.template_mixin.Table(**kwargs: Any)[source]#
Bases:
PluginSubcomponent
Table subcomponent. For most cases where a plugin only requires a single table, use the mixin instead.
To use in a plugin, define
plugin.table = Table(plugin)
, create atable_widget
Unicode traitlet, and setplugin.table_widget = 'IPY_MODEL_'+self.table.model_id
.To render in the plugin’s vue file:
<jupyter-widget :widget="table_widget"></jupyter-widget>
Public constructor
Attributes Summary
An instance of a Python list.
An instance of a Python list.
A trait for unicode strings.
An instance of a Python list.
An instance of a Python list.
A boolean (True, False) trait.
Methods Summary
add_item
(item)Add an item/row to the table.
Clear all entries/markers from the current table.
default_value_for_column
([colname, value])export_table
([filename, overwrite])Export the QTable representation of the table.
Select all rows in table.
Deselect all rows in table.
select_rows
(rows)Select rows from the current table by index, indices, or slice.
vue_clear_table
([data])Attributes Documentation
- headers_avail#
An instance of a Python list.
- headers_visible#
An instance of a Python list.
- item_key#
A trait for unicode strings.
- items#
An instance of a Python list.
- selected_rows#
An instance of a Python list.
- show_rowselect#
A boolean (True, False) trait.
- template_file = ('/home/docs/checkouts/readthedocs.org/user_builds/jdaviz/envs/latest/lib/python3.11/site-packages/jdaviz/core/template_mixin.py', '../components/plugin_table.vue')#
- user_api#
Methods Documentation
- add_item(item)[source]#
Add an item/row to the table.
- Parameters:
- itemQTable, QTableRow, or dictionary of row-name, value pairs
- export_table(filename=None, overwrite=False)[source]#
Export the QTable representation of the table.
- Parameters:
- filenamestr, optional
If provided, will write to the file, otherwise will just return the QTable object.
- overwritebool, optional
If
filename
already exists, should it be overwritten.
- select_rows(rows)[source]#
Select rows from the current table by index, indices, or slice.
- Parameters:
- rowsint, list of int, slice, or tuple of slice
The rows to select. This can be: - An integer specifying a single row index. - A list of integers specifying multiple row indices. - A slice object specifying a range of rows. - A tuple of slices (e.g using numpy slice)