get_selected_index#

LinearSelector.get_selected_index(graphic=None)[source]#

Data index the selector is currently at w.r.t. the Graphic data.

With LineGraphic data, the geometry x or y position is not always the data position, for example if plotting data using np.linspace. Use this to get the data index of the selector.

Parameters:

graphic (Graphic, optional) – Graphic to get the selected data index from. Default is the parent graphic associated to the selector.

Returns:

data index the selector is currently at, list of int if a Collection

Return type:

int or List[int]

Examples#

Linear Selectors

Linear Selectors