controls/DebugVariablePanel/DebugVariableGraphicViewer.py
changeset 1737 a39c2918c015
parent 1736 7e61baa047f0
child 1740 b789b695b5c6
--- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py	Mon Aug 14 23:27:15 2017 +0300
+++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py	Mon Aug 14 23:34:22 2017 +0300
@@ -53,10 +53,10 @@
 # Canvas height
 [SIZE_MINI, SIZE_MIDDLE, SIZE_MAXI] = [0, 100, 200]
 
-CANVAS_BORDER = (20., 10.) # Border height on at bottom and top of graph
-CANVAS_PADDING = 8.5       # Border inside graph where no label is drawn
-VALUE_LABEL_HEIGHT = 17.   # Height of variable label in graph
-AXES_LABEL_HEIGHT = 12.75  # Height of variable value in graph
+CANVAS_BORDER = (20., 10.)  # Border height on at bottom and top of graph
+CANVAS_PADDING = 8.5        # Border inside graph where no label is drawn
+VALUE_LABEL_HEIGHT = 17.    # Height of variable label in graph
+AXES_LABEL_HEIGHT = 12.75   # Height of variable value in graph
 
 # Colors used cyclically for graph curves
 COLOR_CYCLE = ['r', 'b', 'g', 'm', 'y', 'k']
@@ -646,8 +646,8 @@
                 xw, yw = self.GetPosition()
                 self.ParentWindow.StartDragNDrop(self,
                     self.ItemsDict.values()[item_idx],
-                    x + xw, y + yw, # Current mouse position
-                    x + xw, y + yw) # Mouse position when button was clicked
+                    x + xw, y + yw,  # Current mouse position
+                    x + xw, y + yw)  # Mouse position when button was clicked
 
             # Don't handle mouse button if canvas is 3D and let matplotlib do
             # the default behavior (rotate 3D axes)
@@ -722,13 +722,13 @@
         # highlight
         elif event.button is None:
             # Compute direction for items label according graph type
-            if self.GraphType == GRAPH_PARALLEL: # Graph is parallel
+            if self.GraphType == GRAPH_PARALLEL:  # Graph is parallel
                 directions = [wx.RIGHT] * len(self.AxesLabels) + \
                              [wx.LEFT] * len(self.Labels)
-            elif len(self.AxesLabels) > 0: # Graph is orthogonal in 2D
-                directions = [wx.RIGHT, wx.TOP,  # Directions for AxesLabels
-                             wx.LEFT, wx.BOTTOM] # Directions for Labels
-            else: # Graph is orthogonal in 3D
+            elif len(self.AxesLabels) > 0:        # Graph is orthogonal in 2D
+                directions = [wx.RIGHT, wx.TOP,   # Directions for AxesLabels
+                             wx.LEFT, wx.BOTTOM]  # Directions for Labels
+            else:  # Graph is orthogonal in 3D
                 directions = [wx.LEFT] * len(self.Labels)
 
             # Find if mouse is over an item label
@@ -1022,11 +1022,11 @@
         self.Axes.tick_params(axis='y', labelsize='small')
 
         # Init variables storing graphical elements added to figure
-        self.Plots = []      # List of curves
-        self.VLine = None    # Vertical line for cursor
-        self.HLine = None    # Horizontal line for cursor (only orthogonal 2D)
-        self.AxesLabels = [] # List of items variable path text label
-        self.Labels = []     # List of items text label
+        self.Plots = []       # List of curves
+        self.VLine = None     # Vertical line for cursor
+        self.HLine = None     # Horizontal line for cursor (only orthogonal 2D)
+        self.AxesLabels = []  # List of items variable path text label
+        self.Labels = []      # List of items text label
 
         # Get function to add a text in figure according to graph type
         add_text_func = self.GetAddTextFunction()
@@ -1084,7 +1084,7 @@
         # expressed border and text position in pixel on screen and apply the
         # ratio calculated hereafter to get border and text position in
         # matplotlib coordinate
-        canvas_ratio = 1. / height # Divide by canvas height in pixel
+        canvas_ratio = 1. / height  # Divide by canvas height in pixel
         graph_ratio = 1. / (
             (1.0 - (CANVAS_BORDER[0] + CANVAS_BORDER[1]) * canvas_ratio)
              * height)             # Divide by figure height in pixel