An SVG writer.
TODO: Add a float format to reduce the size of the SVG file.
Exception class for SVGWriter.
Defaults format for points that are specified in inches or such like
Defaults format for points that are specified in pixels
Converts a Coord.Dim() object to text for SVG units.
A group element in SVG.
Initialise the group with a stream.
See: http://www.w3.org/TR/2003/REC-SVG11-20030114/struct.html#GElement
Sadly we can’t use **kwargs because of Python restrictions on keyword names. stroke-width is not a valid keyword argument (although stroke_width would be). So instead we pass in an optional dictionary {string : string, ...}
A rectangle in SVG. Initialise the rectangle with a stream, a Coord.Pt() and a Coord.Box() objects.
See: http://www.w3.org/TR/2003/REC-SVG11-20030114/shapes.html#RectElement
Typical attributes:
{'fill' : "blue", 'stroke' : "black", 'stroke-width' : "2", }
Initialise the rectangle with a stream, a Coord.Pt() and a Coord.Box() objects.
See: http://www.w3.org/TR/2003/REC-SVG11-20030114/shapes.html#RectElement
Typical attributes:
{'fill' : "blue", 'stroke' : "black", 'stroke-width' : "2", }
A circle in SVG.Initialise the circle with a stream, a Coord.Pt() and a Coord.Dim() objects.
See: http://www.w3.org/TR/2003/REC-SVG11-20030114/shapes.html#CircleElement
Initialise the circle with a stream, a Coord.Pt() and a Coord.Dim() objects.
An elipse in SVG.Initialise the circle with a stream, a Coord.Pt() and a Coord.Dim() objects.
See: http://www.w3.org/TR/2003/REC-SVG11-20030114/shapes.html#EllipseElement
Initialise the circle with a stream, a Coord.Pt() and a Coord.Dim() objects.
A rectangle in SVG. Initialise the line with a stream, and two Coord.Pt() objects.
See: http://www.w3.org/TR/2003/REC-SVG11-20030114/shapes.html#LineElement
Initialise the line with a stream, and two Coord.Pt() objects.
An abstract class that takes a list of points, derived by polyline and polygon.
Initialise the element with a stream, a name, and a list of Coord.Pt() objects.
NOTE: The units of the points are ignored, it is up to the caller to convert them to the User Coordinate System.
TODO: Make the caller supply points as numbers not Coord.Pt as this may be faster??? e.g.:
FMT_PAIR_STR = FMT_STR + ',' + FMT_STR
' '.join([self.FMT_PAIR_STR.format(x, y) for x,y in pointS])
Initialise the element with a stream, a name, and a list of Coord.Pt() objects. NOTE: The units of the points are ignored, it is up to the caller to convert them to the User Coordinate System. TODO: Make the caller supply points as numbers not Coord.Pt as this may be faster??? e.g. FMT_PAIR_STR = FMT_STR + ‘,’ + FMT_STR ‘ ‘.join([self.FMT_PAIR_STR.format(x, y) for x,y in pointS])
A polyline in SVG. Initialise the polyline with a stream, and a list of Coord.Pt() objects.
NOTE: The units of the points are ignored, it is up to the caller to convert them to the User Coordinate System.
See: http://www.w3.org/TR/2003/REC-SVG11-20030114/shapes.html#PolylineElement
Initialise the polyline with a stream, and a list of Coord.Pt() objects. NOTE: The units of the points are ignored, it is up to the caller to convert them to the User Coordinate System.
A polygon in SVG. Initialise the polygon with a stream, and a list of Coord.Pt() objects.
NOTE: The units of the points are ignored, it is up to the caller to convert them to the User Coordinate System.
See: http://www.w3.org/TR/2003/REC-SVG11-20030114/shapes.html#PolygonElement
Initialise the polygon with a stream, and a list of Coord.Pt() objects. NOTE: The units of the points are ignored, it is up to the caller to convert them to the User Coordinate System.
Text in SVG. Initialise the text with a stream, a Coord.Pt() and font as a string and size as an integer. If thePoint is None then no location will be specified (for example for use inside a <defs> element).
See: http://www.w3.org/TR/2003/REC-SVG11-20030114/text.html#TextElement
Initialise the text with a stream, a Coord.Pt() and font as a string and size as an integer. If thePoint is None then no location will be specified (for example for use inside a <defs> element.