chaco.tools.scatter_inspector module

Defines the ScatterInspector tool class.

class chaco.tools.scatter_inspector.ScatterInspector(component=None, **traits)

Bases: chaco.tools.select_tool.SelectTool

A tool for inspecting scatter plots.

It writes the index of the point under the cursor to the metadata of the index and value data sources, and allows clicking to select the point. Other components can listen for metadata updates on the data sources.

By default, it writes the index of the point under the cursor to the “hover” key in metadata, and the index of a clicked point to “selection”.

draw_mode = "none"

This tool does not have a visual representation

hover_metadata_name = Str("hover")

The names of the data source metadata for hover events.

inspector_event = Event(ScatterInspectorEvent)

This tool emits events when hover or selection changes

normal_mouse_move(event)

Handles the mouse moving when the tool is in the ‘normal’ state.

If the cursor is within threshold of a data point, the method writes the index to the plot’s data sources’ “hover” metadata.

This method emits a ScatterInspectorEvent when a new scatter point is hovered over and when the mouse leaves that point.

persistent_hover = Bool(False)

If persistent_hover is False, then a point will be de-hovered as soon as the mouse leaves its hit-testing area. If persistent_hover is True, then a point does no de-hover until another point get hover focus.

selection_metadata_name = Str("selections")

The names of the data source metadata for selection events.

visible = False

This tool is not visible

class chaco.tools.scatter_inspector.ScatterInspectorEvent

Bases: traits.has_traits.HasStrictTraits

event_index = Any

What index was involved?

event_type = Enum([HOVER_EVENT, SELECT_EVENT, DESELECT_EVENT])

Is it a hover event or a selection event?