Browse Source

flake 8

pull/329/head
Nicolas Bonfante 8 years ago
parent
commit
91a6ac2324
  1. 7
      pygal/graph/gauge.py
  2. 3
      pygal/util.py

7
pygal/graph/gauge.py

@ -46,7 +46,7 @@ class Gauge(Graph):
self._box)
def clockwiser(self, point):
x_0, _ = self.view((0,90))
x_0, _ = self.view((0, 90))
new_x = 2*x_0 - point[0]
return (new_x, point[1])
@ -111,15 +111,13 @@ class Gauge(Graph):
"""Override y axis to plot a polar axis"""
axis = self.svg.node(self.nodes['plot'], class_="axis x gauge")
liste_y_labels = self._y_labels
if self.clockwise:
for i in range(int(len(self._y_labels)/2)):
(label_1, theta_1) = self._y_labels[i]
(label_2, theta_2) = self._y_labels[len(self._y_labels)-i-1]
temp_theta = theta_2
self._y_labels[len(self._y_labels)-i-1] = (label_2, theta_1)
self._y_labels[i] = (label_1, temp_theta)
self._y_labels[i] = (label_1, temp_theta)
for i, (label, theta) in enumerate(self._y_labels):
guides = self.svg.node(axis, class_='guides')
@ -198,7 +196,6 @@ class Gauge(Graph):
else:
self._y_labels = list(zip(map(self._y_format, y_pos), y_pos))
def _plot(self):
"""Plot all needles"""
for serie in self.series:

3
pygal/util.py

@ -383,6 +383,3 @@ def merge(dict1, dict2):
dict1[key] = mergextend(val, dict1.get(key, ()))
else:
dict1[key] = val
def compose(f, g):
return lambda x: f(g(x))

Loading…
Cancel
Save