@@ -13,16 +13,18 @@ Status
1313Branches and Pull requests
1414==========================
1515
16- Previous work
17- * https://github.com/matplotlib/matplotlib/pull/1849
18- * https://github.com/matplotlib/matplotlib/pull/2557
19- * https://github.com/matplotlib/matplotlib/pull/2465
16+ Previous work:
17+
18+ * https://github.com/matplotlib/matplotlib/pull/1849
19+ * https://github.com/matplotlib/matplotlib/pull/2557
20+ * https://github.com/matplotlib/matplotlib/pull/2465
2021
2122Pull Requests:
22- * Removing the NavigationToolbar classes
23- https://github.com/matplotlib/matplotlib/pull/2740 **CLOSED **
24- * Keeping the NavigationToolbar classes https://github.com/matplotlib/matplotlib/pull/2759 **CLOSED **
25- * Navigation by events: https://github.com/matplotlib/matplotlib/pull/3652
23+
24+ * Removing the NavigationToolbar classes
25+ https://github.com/matplotlib/matplotlib/pull/2740 **CLOSED **
26+ * Keeping the NavigationToolbar classes https://github.com/matplotlib/matplotlib/pull/2759 **CLOSED **
27+ * Navigation by events: https://github.com/matplotlib/matplotlib/pull/3652
2628
2729Abstract
2830========
@@ -39,7 +41,7 @@ reconfiguration.
3941
4042This approach will make easier to create and share tools among
4143users. In the far future, we can even foresee a kind of Marketplace
42- for ``Tool ``\ s where the most popular can be added into the main
44+ for ``Tool ``\s where the most popular can be added into the main
4345distribution.
4446
4547Detailed description
@@ -55,18 +57,18 @@ https://github.com/matplotlib/matplotlib/issues/2699
5557
5658The proposed solution is to take the actions out of the ``Toolbar `` and the
5759shortcuts out of the ``Canvas ``. The actions and shortcuts will be in the form
58- of ``Tool ``\ s.
60+ of ``Tool ``\s .
5961
6062A new class ``Navigation `` will be the bridge between the events from the
6163``Canvas `` and ``Toolbar `` and redirect them to the appropriate ``Tool ``.
6264
6365At the end the user interaction will be divided into three classes:
6466
65- * NavigationBase: This class is instantiated for each FigureManager
66- and connect the all user interactions with the Tools
67- * ToolbarBase: This existing class is relegated only as a GUI access
68- to Tools.
69- * ToolBase: Is the basic definition of Tools.
67+ * NavigationBase: This class is instantiated for each FigureManager
68+ and connect the all user interactions with the Tools
69+ * ToolbarBase: This existing class is relegated only as a GUI access
70+ to Tools.
71+ * ToolBase: Is the basic definition of Tools.
7072
7173
7274Implementation
@@ -80,96 +82,108 @@ present in the Toolbar as ``Quit``.
8082
8183The `.ToolBase ` has the following class attributes for configuration at definition time
8284
83- * keymap = None: Key(s) to be used to trigger the tool
84- * description = '': Small description of the tool
85- * image = None: Image that is used in the toolbar
85+ * keymap = None: Key(s) to be used to trigger the tool
86+ * description = '': Small description of the tool
87+ * image = None: Image that is used in the toolbar
8688
8789The following instance attributes are set at instantiation:
88- * name
89- * navigation
90-
91- **Methods **
92- * trigger(self, event): This is the main method of the Tool, it is called when the Tool is triggered by:
93- * Toolbar button click
94- * keypress associated with the Tool Keymap
95- * Call to navigation.trigger_tool(name)
96- * set_figure(self, figure): Set the figure and navigation attributes
97- * ``destroy(self, *args) ``: Destroy the ``Tool `` graphical interface (if
98- exists)
99-
100- **Available Tools **
101- * ToolQuit
102- * ToolEnableAllNavigation
103- * ToolEnableNavigation
104- * ToolToggleGrid
105- * ToolToggleFullScreen
106- * ToolToggleYScale
107- * ToolToggleXScale
108- * ToolHome
109- * ToolBack
110- * ToolForward
111- * SaveFigureBase
112- * ConfigureSubplotsBase
11390
91+ * name
92+ * navigation
93+
94+ Methods
95+ ~~~~~~~
96+
97+ * ``trigger(self, event) ``: This is the main method of the Tool, it is called
98+ when the Tool is triggered by:
99+
100+ * Toolbar button click
101+ * keypress associated with the Tool Keymap
102+ * Call to navigation.trigger_tool(name)
103+
104+ * ``set_figure(self, figure) ``: Set the figure and navigation attributes
105+ * ``destroy(self, *args) ``: Destroy the ``Tool `` graphical interface (if
106+ exists)
107+
108+ Available Tools
109+ ~~~~~~~~~~~~~~~
110+
111+ * ToolQuit
112+ * ToolEnableAllNavigation
113+ * ToolEnableNavigation
114+ * ToolToggleGrid
115+ * ToolToggleFullScreen
116+ * ToolToggleYScale
117+ * ToolToggleXScale
118+ * ToolHome
119+ * ToolBack
120+ * ToolForward
121+ * SaveFigureBase
122+ * ConfigureSubplotsBase
114123
115124ToolToggleBase(ToolBase)
116125------------------------
117126
118127The `.ToolToggleBase ` has the following class attributes for
119128configuration at definition time
120129
121- * radio_group = None: Attribute to group 'radio' like tools (mutually
122- exclusive)
123- * cursor = None: Cursor to use when the tool is active
130+ * radio_group = None: Attribute to group 'radio' like tools (mutually
131+ exclusive)
132+ * cursor = None: Cursor to use when the tool is active
124133
125134The **Toggleable ** Tools, can capture keypress, mouse moves, and mouse
126135button press
127136
128- It defines the following methods
129- * enable(self, event): Called by `.ToolToggleBase.trigger ` method
130- * disable(self, event): Called when the tool is untoggled
131- * toggled : **Property ** True or False
137+ Methods
138+ ~~~~~~~
132139
133- ** Available Tools **
134- * ToolZoom
135- * ToolPan
140+ * `` enable(self, event) ``: Called by ` .ToolToggleBase.trigger ` method
141+ * `` disable(self, event) ``: Called when the tool is untoggled
142+ * `` toggled ``: ** Property ** True or False
136143
137- NavigationBase
138- --------------
144+ Available Tools
145+ ~~~~~~~~~~~~~~~
139146
140- Defines the following attributes
141- * canvas:
142- * keypresslock: Lock to know if the ``canvas `` ``key_press_event `` is
143- available and process it
144- * messagelock: Lock to know if the message is available to write
145-
146- Public methods for **User use **:
147- * nav_connect(self, s, func): Connect to navigation for events
148- * nav_disconnect(self, cid): Disconnect from navigation event
149- * message_event(self, message, sender=None): Emit a
150- tool_message_event event
151- * active_toggle(self): **Property ** The currently toggled tools or
152- None
153- * get_tool_keymap(self, name): Return a list of keys that are
154- associated with the tool
155- * set_tool_keymap(self, name, ``*keys ``): Set the keys for the given tool
156- * remove_tool(self, name): Removes tool from the navigation control.
157- * add_tools(self, tools): Add multiple tools to ``Navigation ``
158- * add_tool(self, name, tool, group=None, position=None): Add a tool
159- to the ``Navigation ``
160- * tool_trigger_event(self, name, sender=None, canvasevent=None,
161- data=None): Trigger a tool and fire the event
162-
163- * tools(self) **Property **: Return a dict with available tools with
164- corresponding keymaps, descriptions and objects
165- * get_tool(self, name): Return the tool object
147+ * ToolZoom
148+ * ToolPan
166149
150+ NavigationBase
151+ --------------
167152
153+ Defines the following attributes:
154+
155+ * canvas:
156+ * keypresslock: Lock to know if the ``canvas `` ``key_press_event `` is
157+ available and process it
158+ * messagelock: Lock to know if the message is available to write
159+
160+ Methods (intended for the end user)
161+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162+
163+ * ``nav_connect(self, s, func) ``: Connect to navigation for events
164+ * ``nav_disconnect(self, cid) ``: Disconnect from navigation event
165+ * ``message_event(self, message, sender=None) ``: Emit a
166+ tool_message_event event
167+ * ``active_toggle(self) ``: **Property ** The currently toggled tools or
168+ None
169+ * ``get_tool_keymap(self, name) ``: Return a list of keys that are
170+ associated with the tool
171+ * ``set_tool_keymap(self, name, ``*keys ``)``: Set the keys for the given tool
172+ * ``remove_tool(self, name) ``: Removes tool from the navigation control.
173+ * ``add_tools(self, tools) ``: Add multiple tools to ``Navigation ``
174+ * ``add_tool(self, name, tool, group=None, position=None) ``: Add a tool
175+ to the ``Navigation ``
176+ * ``tool_trigger_event(self, name, sender=None, canvasevent=None,
177+ data=None) ``: Trigger a tool and fire the event
178+ * ``tools ``: **Property ** A dict with available tools with
179+ corresponding keymaps, descriptions and objects
180+ * ``get_tool(self, name) ``: Return the tool object
168181
169182ToolbarBase
170183-----------
171184
172- Methods for **Backend implementation **
185+ Methods (for backend implementation)
186+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173187
174188* ``add_toolitem(self, name, group, position, image, description, toggle) ``:
175189 Add a toolitem to the toolbar. This method is a callback from
0 commit comments