Base class for tools that handle some level of click-to-select interaction. Handles the logic of different kinds of selection modes. Subclasses only need to implement a few concrete methods to handle actual selection/deselection.
multiselect_modifier= Instance( …¶
The modifier key to use to multi-select points. Only used in toggle and multi selection modes.
Handles the left mouse button being pressed when the tool is in the ‘normal’ state.
If selecting is enabled and the cursor is within threshold of a data point, the method calls the subclass’s _select” or _deselect methods to perform the appropriate action, given the current selection_mode.
selection_mode= Enum("toggle", "multi", "single", "off")¶
How selections are handled:
The user clicks on points (while optionally holding down a modifier key) to select or deselect them. If the point is already selected, clicking it again deselects it. The modifier key to use is set by multiselect_modifier. The only way to deselect points is by clicking on them; clicking on a screen space outside of the plot does not deselect points.
Like toggle mode, except that the user can deselect all points at once by clicking on the plot area away from a point.
The user can only select a single point at a time.
The user cannot select points via clicking.
The threshold, in pixels, around the cursor location to search for points.