enable.tools.viewport_zoom_tool module¶
Defines the SimpleZoom class.
-
class
enable.tools.viewport_zoom_tool.
ViewportZoomTool
(component=None, *args, **kw)[source]¶ Bases:
enable.abstract_overlay.AbstractOverlay
,enable.tools.tool_history_mixin.ToolHistoryMixin
,enable.tools.base_zoom_tool.BaseZoomTool
Selects a range along the index or value axis.
The user left-click-drags to select a region to zoom in. Certain keyboard keys are mapped to performing zoom actions as well.
Implements a basic “zoom stack” so the user move go backwards and forwards through previous zoom regions.
-
disable
(event=None)[source]¶ Provides a programmatic way to enable this tool, if always_on is False.
Calling this method has the same effect as if the user pressed the exit_zoom_key.
-
enable
(event=None)[source]¶ Provides a programmatic way to enable this tool, if always_on is False.
Calling this method has the same effect as if the user pressed the enter_zoom_key.
-
normal_left_down
(event)[source]¶ Handles the left mouse button being pressed while the tool is in the ‘normal’ state.
If the tool is enabled or always on, it starts selecting.
-
normal_mouse_wheel
(event)[source]¶ Handles the mouse wheel being used when the tool is in the ‘normal’ state.
Scrolling the wheel “up” zooms in; scrolling it “down” zooms out. self.component is the viewport self.component.component is the canvas
-