Public Member Functions | |
def | __init__ |
def | __repr__ |
def | parse |
def | parse_boolean |
def | parse_command |
def | parse_number |
def | parse_whitespace |
def | SVG |
Public Attributes | |
attr | |
d | |
Static Public Attributes | |
dictionary | defaults = {} |
Path represents an SVG path, an arbitrary set of curves and straight segments. Unlike SVG("path", d="..."), Path stores coordinates as a list of numbers, rather than a string, so that it is transformable in a Fig. Path(d, attribute=value) d required path data attribute=value pairs keyword list SVG attributes See http://www.w3.org/TR/SVG/paths.html for specification of paths from text. Internally, Path data is a list of tuples with these definitions: * ("Z/z",): close the current path * ("H/h", x) or ("V/v", y): a horizontal or vertical line segment to x or y * ("M/m/L/l/T/t", x, y, global): moveto, lineto, or smooth quadratic curveto point (x, y). If global=True, (x, y) should not be transformed. * ("S/sQ/q", cx, cy, cglobal, x, y, global): polybezier or smooth quadratic curveto point (x, y) using (cx, cy) as a control point. If cglobal or global=True, (cx, cy) or (x, y) should not be transformed. * ("C/c", c1x, c1y, c1global, c2x, c2y, c2global, x, y, global): cubic curveto point (x, y) using (c1x, c1y) and (c2x, c2y) as control points. If c1global, c2global, or global=True, (c1x, c1y), (c2x, c2y), or (x, y) should not be transformed. * ("A/a", rx, ry, rglobal, x-axis-rotation, angle, large-arc-flag, sweep-flag, x, y, global): arcto point (x, y) using the aforementioned parameters. * (",/.", rx, ry, rglobal, angle, x, y, global): an ellipse at point (x, y) with radii (rx, ry). If angle is 0, the whole ellipse is drawn; otherwise, a partial ellipse is drawn.
def svgfig.Path.__repr__ | ( | self | ) |
Definition at line 1060 of file svgfig.py.
References svgfig.SVG.attr, svgfig.Path.attr, svgfig.Fig.d, svgfig.Plot.d, svgfig.Frame.d, and svgfig.Path.d.
Referenced by data_sources.json_file.__str__().
def svgfig.Path.parse | ( | self, | |
pathdata | |||
) |
Parses text-commands, converting them into a list of tuples. Called by the constructor.
Definition at line 1118 of file svgfig.py.
References svgfig.Path.parse_boolean(), svgfig.Path.parse_command(), svgfig.Path.parse_number(), and svgfig.Path.parse_whitespace().
def svgfig.Path.parse_boolean | ( | self, | |
index, | |||
pathdata | |||
) |
Part of Path's text-command parsing algorithm; used internally.
Definition at line 1105 of file svgfig.py.
References svgfig.Path.parse_whitespace().
Referenced by svgfig.Path.parse().
def svgfig.Path.parse_command | ( | self, | |
index, | |||
pathdata | |||
) |
Part of Path's text-command parsing algorithm; used internally.
Definition at line 1075 of file svgfig.py.
References svgfig.Path.parse_whitespace().
Referenced by svgfig.Path.parse().
def svgfig.Path.parse_number | ( | self, | |
index, | |||
pathdata | |||
) |
Part of Path's text-command parsing algorithm; used internally.
Definition at line 1087 of file svgfig.py.
References svgfig.Path.parse_whitespace().
Referenced by svgfig.Path.parse().
def svgfig.Path.parse_whitespace | ( | self, | |
index, | |||
pathdata | |||
) |
Part of Path's text-command parsing algorithm; used internally.
Definition at line 1070 of file svgfig.py.
Referenced by svgfig.Path.parse(), svgfig.Path.parse_boolean(), svgfig.Path.parse_command(), and svgfig.Path.parse_number().
def svgfig.Path.SVG | ( | self, | |
trans = None |
|||
) |
Apply the transformation "trans" and return an SVG object.
Definition at line 1227 of file svgfig.py.
References svgfig.SVG.attr, svgfig.Path.attr, svgfig.Fig.d, svgfig.Plot.d, svgfig.Frame.d, svgfig.Path.d, join(), and svgfig.totrans().
svgfig.Path.attr |
Definition at line 1067 of file svgfig.py.
Referenced by svgfig.Path.__repr__(), svgfig.Curve.__repr__(), svgfig.Poly.__repr__(), svgfig.Text.__repr__(), svgfig.TextGlobal.__repr__(), svgfig.Dots.__repr__(), svgfig.Line.__repr__(), svgfig.LineGlobal.__repr__(), svgfig.VLine.__repr__(), svgfig.HLine.__repr__(), svgfig.Rect.__repr__(), svgfig.Ellipse.__repr__(), svgfig.Ticks.__repr__(), svgfig.CurveAxis.__repr__(), svgfig.LineAxis.__repr__(), svgfig.XAxis.__repr__(), svgfig.YAxis.__repr__(), svgfig.Axes.__repr__(), svgfig.HGrid.__repr__(), svgfig.VGrid.__repr__(), svgfig.Grid.__repr__(), svgfig.Curve.Path(), svgfig.Poly.Path(), svgfig.Rect.Path(), svgfig.Path.SVG(), svgfig.Text.SVG(), svgfig.TextGlobal.SVG(), svgfig.LineGlobal.SVG(), svgfig.Axes.SVG(), svgfig.XErrorBars.SVG(), and svgfig.YErrorBars.SVG().
svgfig.Path.d |
Definition at line 1064 of file svgfig.py.
Referenced by svgfig.Path.__repr__(), svgfig.Poly.__repr__(), svgfig.Text.__repr__(), svgfig.TextGlobal.__repr__(), svgfig.Dots.__repr__(), svgfig.XErrorBars.__repr__(), svgfig.YErrorBars.__repr__(), svgfig.Poly.Path(), svgfig.Path.SVG(), svgfig.Text.SVG(), svgfig.TextGlobal.SVG(), svgfig.Dots.SVG(), svgfig.XErrorBars.SVG(), and svgfig.YErrorBars.SVG().
|
static |
Definition at line 1058 of file svgfig.py.
Referenced by tree.Tree.reset(), and tree.Tree.var().