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