Table#

class jdaviz.core.template_mixin.Table(*args: t.Any, **kwargs: t.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 a table_widget Unicode traitlet, and set plugin.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

api_hints_enabled

A boolean (True, False) trait.

api_hints_obj

A trait for unicode strings.

clear_btn_lbl

A trait for unicode strings.

enable_clear

A boolean (True, False) trait.

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.

loader_items

An instance of a Python list.

loader_panel_ind

A trait which allows any value.

loader_selected

A trait for unicode strings.

loaders

Access loaders for loading the table into the app.

multiselect

A boolean (True, False) trait.

selected_rows

An instance of a Python list.

server_items_length

An int trait.

server_pagination

A boolean (True, False) trait.

show_if_empty

A boolean (True, False) trait.

show_rowselect

A boolean (True, False) trait.

table_options

An instance of a Python dict.

template_file

user_api

Methods Summary

add_item(item)

Add an item/row to the table.

clear_table()

Clear all entries/markers from the current table.

default_value_for_column([colname, value])

export_table([filename])

Export the Astropy Table representation of the table.

select_all()

Select all rows in table.

select_none()

Deselect all rows in table.

select_rows(rows)

Select rows from the current table by index, indices, or slice.

set_all_items(all_items)

Populate the table with server-side pagination.

set_all_items_from_table(table)

Populate the table from an astropy QTable/Table using server-side pagination.

vue_clear_table([data])

Attributes Documentation

api_hints_enabled#

A boolean (True, False) trait.

api_hints_obj#

A trait for unicode strings.

clear_btn_lbl#

A trait for unicode strings.

enable_clear#

A boolean (True, False) trait.

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.

loader_items#

An instance of a Python list.

loader_panel_ind#

A trait which allows any value.

loader_selected#

A trait for unicode strings.

loaders#

Access loaders for loading the table into the app.

multiselect#

A boolean (True, False) trait.

selected_rows#

An instance of a Python list.

server_items_length#

An int trait.

server_pagination#

A boolean (True, False) trait.

show_if_empty#

A boolean (True, False) trait.

show_rowselect#

A boolean (True, False) trait.

table_options#

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

template_file = ('/home/docs/checkouts/readthedocs.org/user_builds/jdaviz/envs/latest/lib/python3.13/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
clear_table()[source]#

Clear all entries/markers from the current table.

default_value_for_column(colname=None, value=None)[source]#
export_table(filename=None, **write_kwargs)[source]#

Export the Astropy Table representation of the table.

Parameters:
filenamestr, optional

If provided, will write to the file, otherwise will just return the Table object.

formatstr, optional

The format to write the table in. If not provided, will be inferred from the filename extension. See astropy.table.Table.write for supported formats.

overwritebool, optional

If filename already exists, should it be overwritten.

Returns:
out_tblastropy.table.Table

The table object that was written to file or the current table if no filename was provided.

select_all()[source]#

Select all rows in table.

select_none()[source]#

Deselect all rows in table.

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)

set_all_items(all_items)[source]#

Populate the table with server-side pagination. Stores all items in cache and pushes only the current page.

set_all_items_from_table(table)[source]#

Populate the table from an astropy QTable/Table using server-side pagination. Handles QTable caching, header updates, JSON conversion, and pagination.

vue_clear_table(data=None)[source]#