Public Member Functions | |
def | __init__ |
def | __repr__ |
def | SVG |
Public Attributes | |
attr | |
d | |
height | |
symbol | |
width | |
Static Public Attributes | |
dictionary | defaults = {} |
Dots draws SVG symbols at a set of points. d required list of (x,y) points symbol default=None SVG symbol or a new identifier to label an auto-generated symbol; if None, use pre-defined _circular_dot width, height default=1, 1 width and height of the symbols in SVG coordinates attribute=value pairs keyword list SVG attributes
def svgfig::Dots::__init__ | ( | self, | |
d = [] , |
|||
symbol = None , |
|||
width = 1. , |
|||
height = 1. , |
|||
attr | |||
) |
Definition at line 1923 of file svgfig.py.
01924 : 01925 self.d = list(d) 01926 self.width = width 01927 self.height = height 01928 01929 self.attr = dict(self.defaults) 01930 self.attr.update(attr) 01931 01932 if symbol == None: 01933 self.symbol = _circular_dot 01934 elif isinstance(symbol, SVG): 01935 self.symbol = symbol 01936 else: 01937 self.symbol = make_symbol(symbol)
def svgfig::Dots::__repr__ | ( | self | ) |
def svgfig::Dots::SVG | ( | self, | |
trans = None |
|||
) |
Apply the transformation "trans" and return an SVG object.
Definition at line 1938 of file svgfig.py.
01939 : 01940 """Apply the transformation "trans" and return an SVG object.""" 01941 if isinstance(trans, basestring): trans = totrans(trans) 01942 01943 output = SVG("g", SVG("defs", self.symbol)) 01944 id = "#%s" % self.symbol["id"] 01945 01946 for p in self.d: 01947 x, y = p[0], p[1] 01948 01949 if trans == None: X, Y = x, y 01950 else: X, Y = trans(x, y) 01951 01952 item = SVG("use", x=X, y=Y, xlink__href=id) 01953 if self.width != None: item["width"] = self.width 01954 if self.height != None: item["height"] = self.height 01955 output.append(item) 01956 01957 return output
dictionary svgfig::Dots::defaults = {} [static] |