chaco.examples.demo.edit_line module

Allows editing of a line plot.

Left-dragging a point will move its position.

Right-drag pans the plot.

Mousewheel up and down zooms the plot in and out.

Pressing “z” brings up the Zoom Box, and you can click-drag a rectangular region to zoom. If you use a sequence of zoom boxes, pressing control-y and control-z (use Meta-y and Meta-z on Mac) moves you forwards and backwards through the “zoom history”.

class chaco.examples.demo.edit_line.Demo

Bases: traits.has_traits.HasTraits

class chaco.examples.demo.edit_line.PointDraggingTool(component=None, **traits)

Bases: enable.tools.drag_tool.DragTool

drag_cancel(event)

Called when the drag is cancelled.

A drag is usually cancelled by receiving a mouse_leave event when end_drag_on_leave is True, or on_drag_leave is ‘cancel’, or by the user pressing any of the cancel_keys.

drag_end(event)

Called when a mouse event causes the drag operation to end.

A drag is ended when a user releases the mouse, or by receiving a mouse_leave event when on_drag_leave is ‘end’.

drag_start(event)

Called when the drag operation starts.

The event parameter is the mouse event that established the drag operation; its x and y attributes correspond to the current location of the mouse, and not to the position of the mouse when the initial left_down or right_down event happened.

dragging(event)

This method is called for every mouse_move event that the tool receives while the user is dragging the mouse.

It is recommended that subclasses do most of their work in this method.

is_draggable(x, y)

Returns whether the (x,y) position is in a region that is OK to drag.

Used by the tool to determine when to start a drag.

normal_mouse_move(event)