Defines the LegendTool class.

class, **traits)


A tool for interacting with legends.

Attach this tool to a legend by setting the tool’s component to the legend.

auto_align = Bool(True)

Whether to change the legend’s align property in accord with the quadrant into which it is dropped.

drag_button = Enum("left", "right")

The mouse button that initiates the drag.


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

Implements DragTool.


Called when the drag operation starts.

Implements DragTool.


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

Implements DragTool. Moves the legend by aligning it to a corner of its overlay component.

is_draggable(x, y)

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

Overrides DragTool.