element module
Functions for constructing SVG elements to be added to a document
See SVG specifications for more information how nodes are structured, including the optional attributes and styles.
See lxml documentation for clarification on etree usage
-
element.buildCircle(point, radius, elementAttrs={'style': 'fill:none;stroke:black;stroke-width:1'})[source]
create an lxml circle element centered at point with given radius and optional elementAttrs dictionary defining node attributes
-
element.buildLine(pointA, pointB, elementAttrs={'style': 'fill:none;stroke:black;stroke-width:1'})[source]
create an lxml line element from pointA to pointB with optional elementAttrs dictionary defining node attributes
-
element.buildPath(pathData, elementAttrs={'style': 'fill:none;stroke:black;stroke-width:1'})[source]
create an lxml path using a PathData object and optional elementAttrs dictionary defining node attributes
-
element.buildRect(pointA, height, width, elementAttrs={'style': 'fill:none;stroke:black;stroke-width:1'})[source]
create an lxml rectangle element with bottom left corner pointA, and given width/height, with optional elementAttrs dictionary defining node attributes
-
element.buildText(text, elementAttrs={'style': 'fill:black;stroke:none;font-size:24;'})[source]
create a text node with given text and optional elementAttrs dictionary defining node attributes
-
element.buildUse(id, elementAttrs={})[source]
create a use node (for cloning) with id of node to be cloned (set in its elementAttrs). Use elementAttrs to set transform of object.