## Copyright (c) 2016-2025 Deephaven Data Labs and Patent Pending#"""This module defines the SelectableDateSet which is used to provides a view of a selectable subset of a table.For example, in some selectable data sets, a GUI click can be used to select a portion of a table."""fromtypingimportOptionalimportjpyfromdeephavenimportDHErrorfromdeephaven._wrapperimportJObjectWrapperfromdeephaven.tableimportPartitionedTable,Table_JSelectableDataSet=jpy.get_type("io.deephaven.plot.filters.SelectableDataSet")_JSelectables=jpy.get_type("io.deephaven.plot.filters.Selectables")
[docs]classSelectableDataSet(JObjectWrapper):"""A SelectableDataSet provides a view of a selectable subset of a table. For example, in some selectable data sets, a GUI click can be used to select a portion of a table."""j_object_type=_JSelectableDataSetdef__init__(self,j_sds:jpy.JType):self.j_sds=j_sds@propertydefj_object(self)->jpy.JType:returnself.j_sds
[docs]defone_click(t:Table,by:Optional[list[str]]=None,require_all_filters:bool=False)->SelectableDataSet:"""Creates a SelectableDataSet with the specified columns from a table. Args: t (Table): the source table by (Optional[list[str]]): the selected columns, defaults to None require_all_filters (bool): false to display data when not all oneclicks are selected; true to only display data when appropriate oneclicks are selected Returns: a SelectableDataSet Raises: DHError """ifnotby:by=[]try:returnSelectableDataSet(j_sds=_JSelectables.oneClick(t.j_table,require_all_filters,*by))exceptExceptionase:raiseDHError(e,"failed in one_click.")frome
[docs]defone_click_partitioned_table(pt:PartitionedTable,require_all_filters:bool=False)->SelectableDataSet:"""Creates a SelectableDataSet with the specified columns from the table map. Args: pt (PartitionedTable): the source partitioned table require_all_filters (bool): false to display data when not all oneclicks are selected; true to only display data when appropriate oneclicks are selected Returns: a SelectableDataSet Raises: DHError """try:returnSelectableDataSet(j_sds=_JSelectables.oneClick(pt.j_partitioned_table,require_all_filters))exceptExceptionase:raiseDHError(e,"failed in one_click.")frome