Package obitools :: Module SVGdraw :: Class SVGelement
[hide private]
[frames] | no frames]

Class SVGelement

source code


SVGelement(type,attributes,elements,text,namespace,**args) Creates a arbitrary svg element and is intended to be subclassed not used on its own. This element is the base of every svg element it defines a class which resembles a xml-element. The main advantage of this kind of implementation is that you don't have to create a toXML method for every different graph object. Every element consists of a type, attribute, optional subelements, optional text and an optional namespace. Note the elements==None, if elements = None:self.elements=[] construction. This is done because if you default to elements=[] every object has a reference to the same empty list.

Instance Methods [hide private]
 
__init__(type, attributes='', elements=None, text=None, namespace='', **args) source code
 
addElement(self, SVGelement)
adds an element to a SVGelement
source code
 
toXml(self, level, f, **kwargs) source code
Method Details [hide private]

addElement(self, SVGelement)

source code 

adds an element to a SVGelement

SVGelement.addElement(SVGelement)