chaco.tools.image_inspector_tool module

Defines the ImageInspectorTool, ImageInspectorOverlay, and ImageInspectorColorbarOverlay classes.

class chaco.tools.image_inspector_tool.ImageInspectorColorbarOverlay(component=None, *args, **kw)

Bases: chaco.abstract_overlay.AbstractOverlay

class chaco.tools.image_inspector_tool.ImageInspectorOverlay(component=None, *args, **kw)

Bases: chaco.overlays.text_box_overlay.TextBoxOverlay

An overlay that displays a box containing values from an ImageInspectorTool instance.

image_inspector = Any

An instance of ImageInspectorTool; this overlay listens to the tool for changes, and updates its displayed text accordingly.

tooltip_mode = Bool(False)

Anchor the text to the mouse? (If False, then the text is in one of the corners.) Use the align trait to determine which corner.

visibility = Enum("auto", True, False)

Whether the overlay should auto-hide and auto-show based on the tool’s location, or whether it should be forced to be hidden or visible.

visible = False

The default state of the overlay is invisible (overrides PlotComponent).

class chaco.tools.image_inspector_tool.ImageInspectorTool(component=None, **traits)

Bases: enable.base_tool.BaseTool

A tool that captures the color and underlying values of an image plot.

inspector_key = <enable.base_tool.KeySpec object>

This key will show and hide any ImageInspectorOverlays associated with this tool.

last_mouse_position = Tuple

Stores the last mouse position. This can be used by overlays to position themselves around the mouse.

new_value = Event

This event fires whenever the mouse moves over a new image point. Its value is a dict with a key “color_value”, and possibly a key “data_value” if the plot is a color-mapped image plot.

normal_key_pressed(event)
normal_mouse_enter(event)
normal_mouse_leave(event)
normal_mouse_move(event)

Handles the mouse being moved.

Fires the new_value event with the data (if any) from the event’s position.

visible = Bool(True)

Indicates whether overlays listening to this tool should be visible.