[Python-modules-commits] [python-mplexporter] 59/135: properties->props in renderers
Wolfgang Borgert
debacle at moszumanska.debian.org
Tue Sep 23 21:19:04 UTC 2014
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to branch master
in repository python-mplexporter.
commit 6786d94f11428703e07c744fb1ddcc20da7cb309
Author: Jake Vanderplas <vanderplas at astro.washington.edu>
Date: Wed Feb 26 12:24:35 2014 -0800
properties->props in renderers
---
mplexporter/renderers/example_renderer.py | 4 ++--
mplexporter/renderers/plotly/plotly_renderer.py | 26 ++++++++++++-------------
mplexporter/renderers/vega_renderer.py | 18 ++++++++---------
mplexporter/renderers/vincent_renderer.py | 6 +++---
4 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/mplexporter/renderers/example_renderer.py b/mplexporter/renderers/example_renderer.py
index a8834c5..92549cf 100644
--- a/mplexporter/renderers/example_renderer.py
+++ b/mplexporter/renderers/example_renderer.py
@@ -10,13 +10,13 @@ class ExampleRenderer(Renderer):
def __init__(self):
self.output = ""
- def open_figure(self, fig, properties):
+ def open_figure(self, fig, props):
self.output += "opening figure\n"
def close_figure(self, fig):
self.output += "closing figure\n"
- def open_axes(self, ax, properties):
+ def open_axes(self, ax, props):
self.output += " opening axes\n"
def close_axes(self, ax):
diff --git a/mplexporter/renderers/plotly/plotly_renderer.py b/mplexporter/renderers/plotly/plotly_renderer.py
index 80b8292..1f76248 100644
--- a/mplexporter/renderers/plotly/plotly_renderer.py
+++ b/mplexporter/renderers/plotly/plotly_renderer.py
@@ -19,33 +19,33 @@ class PlotlyRenderer(Renderer):
self.layout = {}
self.axis_ct = 0
- def open_figure(self, fig, properties):
+ def open_figure(self, fig, props):
self.output += "opening figure\n"
- self.layout['width'] = int(properties['figwidth']*properties['dpi'])
- self.layout['height'] = int(properties['figheight']*properties['dpi'])
+ self.layout['width'] = int(props['figwidth']*props['dpi'])
+ self.layout['height'] = int(props['figheight']*props['dpi'])
def close_figure(self, fig):
self.output += "closing figure\n"
self.configure_primary_axes() # changes 'y1', 'xaxis1', etc. to 'y', 'xaxis', etc.
self.layout['showlegend'] = False
- def open_axes(self, ax, properties):
+ def open_axes(self, ax, props):
self.axis_ct += 1
self.output += " opening axis {}\n".format(self.axis_ct)
layout = {
- 'title': properties['title'],
+ 'title': props['title'],
'xaxis{}'.format(self.axis_ct): {
- 'range': properties['xlim'],
- 'title': properties['xlabel'],
- 'showgrid': properties['xgrid'],
- 'domain': plotly_utils.get_x_domain(properties['bounds']),
+ 'range': props['xlim'],
+ 'title': props['xlabel'],
+ 'showgrid': props['xgrid'],
+ 'domain': plotly_utils.get_x_domain(props['bounds']),
'anchor': 'y{}'.format(self.axis_ct)
},
'yaxis{}'.format(self.axis_ct): {
- 'range': properties['ylim'],
- 'title': properties['ylabel'],
- 'showgrid': properties['ygrid'],
- 'domain': plotly_utils.get_y_domain(properties['bounds']),
+ 'range': props['ylim'],
+ 'title': props['ylabel'],
+ 'showgrid': props['ygrid'],
+ 'domain': plotly_utils.get_y_domain(props['bounds']),
'anchor': 'x{}'.format(self.axis_ct)
}
}
diff --git a/mplexporter/renderers/vega_renderer.py b/mplexporter/renderers/vega_renderer.py
index 1680f8b..0ba4677 100644
--- a/mplexporter/renderers/vega_renderer.py
+++ b/mplexporter/renderers/vega_renderer.py
@@ -6,29 +6,29 @@ from ..exporter import Exporter
class VegaRenderer(Renderer):
- def open_figure(self, fig, properties):
- self.properties = properties
- self.figwidth = int(properties['figwidth'] * properties['dpi'])
- self.figheight = int(properties['figheight'] * properties['dpi'])
+ def open_figure(self, fig, props):
+ self.props = props
+ self.figwidth = int(props['figwidth'] * props['dpi'])
+ self.figheight = int(props['figheight'] * props['dpi'])
self.data = []
self.scales = []
self.axes = []
self.marks = []
- def open_axes(self, ax, properties):
+ def open_axes(self, ax, props):
if len(self.axes) > 0:
warnings.warn("multiple axes not yet supported")
self.axes = [dict(type="x", scale="x", ticks=10,
- title=properties['xlabel']),
+ title=props['xlabel']),
dict(type="y", scale="y", ticks=10,
- title=properties['ylabel'])]
+ title=props['ylabel'])]
self.scales = [dict(name="x",
- domain=properties['xlim'],
+ domain=props['xlim'],
type="linear",
range="width",
),
dict(name="y",
- domain=properties['ylim'],
+ domain=props['ylim'],
type="linear",
range="height",
),]
diff --git a/mplexporter/renderers/vincent_renderer.py b/mplexporter/renderers/vincent_renderer.py
index a6a7a6b..6ca2eab 100644
--- a/mplexporter/renderers/vincent_renderer.py
+++ b/mplexporter/renderers/vincent_renderer.py
@@ -4,10 +4,10 @@ from ..exporter import Exporter
class VincentRenderer(Renderer):
- def open_figure(self, fig, properties):
+ def open_figure(self, fig, props):
self.chart = None
- self.figwidth = int(properties['figwidth'] * properties['dpi'])
- self.figheight = int(properties['figheight'] * properties['dpi'])
+ self.figwidth = int(props['figwidth'] * props['dpi'])
+ self.figheight = int(props['figheight'] * props['dpi'])
def draw_line(self, data, coordinates, style, mplobj=None):
import vincent # only import if VincentRenderer is used
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-mplexporter.git
More information about the Python-modules-commits
mailing list