CMS 3D CMS Logo

Public Member Functions | Public Attributes | Static Public Attributes

svgfig::Dots Class Reference

List of all members.

Public Member Functions

def __init__
def __repr__
def SVG

Public Attributes

 attr
 d
 height
 symbol
 width

Static Public Attributes

dictionary defaults = {}

Detailed Description

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

Definition at line 1907 of file svgfig.py.


Constructor & Destructor Documentation

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)


Member Function Documentation

def svgfig::Dots::__repr__ (   self)

Definition at line 1920 of file svgfig.py.

01921                     :
01922     return "<Dots (%d nodes) %s>" % (len(self.d), self.attr)

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


Member Data Documentation

Definition at line 1923 of file svgfig.py.

Definition at line 1923 of file svgfig.py.

dictionary svgfig::Dots::defaults = {} [static]

Definition at line 1918 of file svgfig.py.

Definition at line 1923 of file svgfig.py.

Definition at line 1923 of file svgfig.py.

Definition at line 1923 of file svgfig.py.