chaco.examples.demo.xray_plot module

Implementation of a plot using a custom overlay and tool

class chaco.examples.demo.xray_plot.BoxSelectTool(component=None, **traits)

Bases: enable.base_tool.BaseTool

Tool for selecting all points within a box

There are 2 states for this tool, normal and selecting. While the left mouse button is down the metadata on the datasources will be updated with the current selected bounds.

Note that the tool does not actually store the selected point, but the bounds of the box.

map_to_data(x, y)

Returns the data space coordinates of the given x and y.

Takes into account orientation of the plot and the axis setting.

normal_left_down(event)
selecting_left_up(event)
selecting_mouse_move(event)
class chaco.examples.demo.xray_plot.PlotExample

Bases: traits.has_traits.HasTraits

class chaco.examples.demo.xray_plot.XRayOverlay(component=None, *args, **kw)

Bases: chaco.abstract_overlay.AbstractOverlay

Overlay which draws scatter markers on top of plot data points.

This overlay should be combined with a tool which updates the datasources metadata with selection bounds.

marker = <enable.markers.DotMarker object>
overlay(component, gc, view_bounds=None, mode='normal')

Draws this component overlaid on another component.