shape

Module: shape

Inheritance diagram for pysvg.shape:

(C) 2008, 2009 Kerim Mansour For licensing information please refer to license.txt

Classes

circle

class pysvg.shape.circle(cx=None, cy=None, r=None, **kwargs)

Bases: pysvg.core.BaseShape

Class representing the circle element of an svg doc.

__init__(cx=None, cy=None, r=None, **kwargs)
addElement(element)
appendTextContent(text)
getAttribute(attribute_name)
getBottomLeft()
Retrieves a tuple with the x,y coordinates of the lower left point of the circle. Requires the radius and the coordinates to be numbers
getBottomRight()
Retrieves a tuple with the x,y coordinates of the lower right point of the circle. Requires the radius and the coordinates to be numbers
getDiameter()
Retrieves the diameter of the circle. Requires the radius to be a number
getElementAt(pos)
getHeight()
Retrieves the height of the circle. Requires the radius to be a number
getTopLeft()
Retrieves a tuple with the x,y coordinates of the upper left point of the circle. Requires the radius and the coordinates to be numbers
getTopRight()
Retrieves a tuple with the x,y coordinates of the upper right point of the circle. Requires the radius and the coordinates to be numbers
getWidth()
Retrieves the width of the circle. Requires the radius to be a number
getXML()

Return a XML representation of the current element. This function can be used for debugging purposes. It is also used by getXML in SVG

@return: the representation of the current element as an xml string

get_class()
get_clip_path()
get_clip_rule()
get_color()
get_color_interpolation()
get_color_rendering()
get_cursor()
get_cx()
get_cy()
get_display()
get_fill()
get_fill_opacity()
get_fill_rule()
get_filter()
get_id()
get_image_rendering()
get_mask()
get_onactivate()
get_onclick()
get_onfocusin()
get_onfocusout()
get_onload()
get_onmousedown()
get_onmousemove()
get_onmouseout()
get_onmouseover()
get_onmouseup()
get_opacity()
get_pointer_events()
get_r()
get_requiredExtensions()
get_requiredFeatures()
get_shape_rendering()
get_stroke()
get_stroke_dasharray()
get_stroke_dashoffset()
get_stroke_linecap()
get_stroke_linejoin()
get_stroke_miterlimit()
get_stroke_opacity()
get_stroke_width()
get_style()
get_systemLanguage()
get_text_rendering()
get_transform()
get_visibility()
get_xml_base()
get_xml_lang()
get_xml_space()
insertElementAt(element, pos)
moveToPoint((x, y))
Moves the circle to the point x,y
quote_attrib(inStr)
Transforms characters between xml notation and python notation.
save(filename, encoding='ISO-8859-1', standalone='no')
Stores any element in a svg file (including header). Calling this method only makes sense if the root element is an svg elemnt
setAttribute(attribute_name, attribute_value)
setKWARGS(**kwargs)
Used to set all attributes given in a **kwargs parameter. Might throw an Exception if attribute was not found. #TODO: check if we should fix this using “setAttribute”
set_class(aClass)
set_clip_path(clip_path)
set_clip_rule(clip_rule)
set_color(color)
set_color_interpolation(color_interpolation)
set_color_rendering(color_rendering)
set_cursor(cursor)
set_cx(cx)
set_cy(cy)
set_display(display)
set_fill(fill)
set_fill_opacity(fill_opacity)
set_fill_rule(fill_rule)
set_filter(filter)
set_id(id)
set_image_rendering(image_rendering)
set_mask(mask)
set_onactivate(onactivate)
set_onclick(onclick)
set_onfocusin(onfocusin)
set_onfocusout(onfocusout)
set_onload(onload)
set_onmousedown(onmousedown)
set_onmousemove(onmousemove)
set_onmouseout(onmouseout)
set_onmouseover(onmouseover)
set_onmouseup(onmouseup)
set_opacity(opacity)
set_pointer_events(pointer_events)
set_r(r)
set_requiredExtensions(requiredExtensions)
set_requiredFeatures(requiredFeatures)
set_shape_rendering(shape_rendering)
set_stroke(stroke)
set_stroke_dasharray(stroke_dasharray)
set_stroke_dashoffset(stroke_dashoffset)
set_stroke_linecap(stroke_linecap)
set_stroke_linejoin(stroke_linejoin)
set_stroke_miterlimit(stroke_miterlimit)
set_stroke_opacity(stroke_opacity)
set_stroke_width(stroke_width)
set_style(style)
set_systemLanguage(language_code)
set_text_rendering(text_rendering)
set_transform(transform)
set_visibility(visibility)
set_xml_base(xml_base)
set_xml_lang(language_code)
set_xml_space(xml_space)
wrap_xml(xml, encoding='ISO-8859-1', standalone='no')
Method that provides a standard svg header string for a file

ellipse

class pysvg.shape.ellipse(cx=None, cy=None, rx=None, ry=None, **kwargs)

Bases: pysvg.core.BaseShape

Class representing the ellipse element of an svg doc.

__init__(cx=None, cy=None, rx=None, ry=None, **kwargs)
addElement(element)
appendTextContent(text)
getAttribute(attribute_name)
getBottomLeft()
Retrieves a tuple with the x,y coordinates of the lower left point of the ellipse. Requires the radius and the coordinates to be numbers
getBottomRight()
Retrieves a tuple with the x,y coordinates of the lower right point of the ellipse. Requires the radius and the coordinates to be numbers
getElementAt(pos)
getHeight()
getTopLeft()
Retrieves a tuple with the x,y coordinates of the upper left point of the ellipse. Requires the radius and the coordinates to be numbers
getTopRight()
Retrieves a tuple with the x,y coordinates of the upper right point of the ellipse. Requires the radius and the coordinates to be numbers
getWidth()
getXML()

Return a XML representation of the current element. This function can be used for debugging purposes. It is also used by getXML in SVG

@return: the representation of the current element as an xml string

get_class()
get_clip_path()
get_clip_rule()
get_color()
get_color_interpolation()
get_color_rendering()
get_cursor()
get_cx()
get_cy()
get_display()
get_fill()
get_fill_opacity()
get_fill_rule()
get_filter()
get_id()
get_image_rendering()
get_mask()
get_onactivate()
get_onclick()
get_onfocusin()
get_onfocusout()
get_onload()
get_onmousedown()
get_onmousemove()
get_onmouseout()
get_onmouseover()
get_onmouseup()
get_opacity()
get_pointer_events()
get_requiredExtensions()
get_requiredFeatures()
get_rx()
get_ry()
get_shape_rendering()
get_stroke()
get_stroke_dasharray()
get_stroke_dashoffset()
get_stroke_linecap()
get_stroke_linejoin()
get_stroke_miterlimit()
get_stroke_opacity()
get_stroke_width()
get_style()
get_systemLanguage()
get_text_rendering()
get_transform()
get_visibility()
get_xml_base()
get_xml_lang()
get_xml_space()
insertElementAt(element, pos)
quote_attrib(inStr)
Transforms characters between xml notation and python notation.
save(filename, encoding='ISO-8859-1', standalone='no')
Stores any element in a svg file (including header). Calling this method only makes sense if the root element is an svg elemnt
setAttribute(attribute_name, attribute_value)
setKWARGS(**kwargs)
Used to set all attributes given in a **kwargs parameter. Might throw an Exception if attribute was not found. #TODO: check if we should fix this using “setAttribute”
set_class(aClass)
set_clip_path(clip_path)
set_clip_rule(clip_rule)
set_color(color)
set_color_interpolation(color_interpolation)
set_color_rendering(color_rendering)
set_cursor(cursor)
set_cx(cx)
set_cy(cy)
set_display(display)
set_fill(fill)
set_fill_opacity(fill_opacity)
set_fill_rule(fill_rule)
set_filter(filter)
set_id(id)
set_image_rendering(image_rendering)
set_mask(mask)
set_onactivate(onactivate)
set_onclick(onclick)
set_onfocusin(onfocusin)
set_onfocusout(onfocusout)
set_onload(onload)
set_onmousedown(onmousedown)
set_onmousemove(onmousemove)
set_onmouseout(onmouseout)
set_onmouseover(onmouseover)
set_onmouseup(onmouseup)
set_opacity(opacity)
set_pointer_events(pointer_events)
set_requiredExtensions(requiredExtensions)
set_requiredFeatures(requiredFeatures)
set_rx(rx)
set_ry(ry)
set_shape_rendering(shape_rendering)
set_stroke(stroke)
set_stroke_dasharray(stroke_dasharray)
set_stroke_dashoffset(stroke_dashoffset)
set_stroke_linecap(stroke_linecap)
set_stroke_linejoin(stroke_linejoin)
set_stroke_miterlimit(stroke_miterlimit)
set_stroke_opacity(stroke_opacity)
set_stroke_width(stroke_width)
set_style(style)
set_systemLanguage(language_code)
set_text_rendering(text_rendering)
set_transform(transform)
set_visibility(visibility)
set_xml_base(xml_base)
set_xml_lang(language_code)
set_xml_space(xml_space)
wrap_xml(xml, encoding='ISO-8859-1', standalone='no')
Method that provides a standard svg header string for a file

line

class pysvg.shape.line(X1=None, Y1=None, X2=None, Y2=None, **kwargs)

Bases: pysvg.core.BaseShape, pysvg.core.PointToAttrib

Class representing the line element of an svg doc. Note that this element is NOT painted VISIBLY by default UNLESS you provide a style including STROKE and STROKE-WIDTH

__init__(X1=None, Y1=None, X2=None, Y2=None, **kwargs)
Creates a line @type X1: string or int @param X1: starting x-coordinate @type Y1: string or int @param Y1: starting y-coordinate @type X2: string or int @param X2: ending x-coordinate @type Y2: string or int @param Y2: ending y-coordinate
addElement(element)
appendTextContent(text)
getAttribute(attribute_name)
getBottomLeft()
Retrieves the the bottom left coordinate of the line as tuple. Coordinates must be numbers.
getBottomRight()
Retrieves the the bottom right coordinate of the line as tuple. Coordinates must be numbers.
getElementAt(pos)
getHeight()
Retrieves the height of the line. This is always a positive number. Coordinates must be numbers.
getTopLeft()
Retrieves the the top left coordinate of the line as tuple. Coordinates must be numbers.
getTopRight()
Retrieves the the top right coordinate of the line as tuple. Coordinates must be numbers.
getWidth()
Retrieves the width of the line. This is always a positive number. Coordinates must be numbers.
getXML()

Return a XML representation of the current element. This function can be used for debugging purposes. It is also used by getXML in SVG

@return: the representation of the current element as an xml string

get_class()
get_clip_path()
get_clip_rule()
get_color()
get_color_interpolation()
get_color_rendering()
get_cursor()
get_display()
get_fill()
get_fill_opacity()
get_fill_rule()
get_filter()
get_id()
get_image_rendering()
get_mask()
get_onactivate()
get_onclick()
get_onfocusin()
get_onfocusout()
get_onload()
get_onmousedown()
get_onmousemove()
get_onmouseout()
get_onmouseover()
get_onmouseup()
get_opacity()
get_pointer_events()
get_requiredExtensions()
get_requiredFeatures()
get_shape_rendering()
get_stroke()
get_stroke_dasharray()
get_stroke_dashoffset()
get_stroke_linecap()
get_stroke_linejoin()
get_stroke_miterlimit()
get_stroke_opacity()
get_stroke_width()
get_style()
get_systemLanguage()
get_text_rendering()
get_transform()
get_visibility()
get_x1()
get_x2()
get_xml_base()
get_xml_lang()
get_xml_space()
get_y1()
get_y2()
insertElementAt(element, pos)
moveToPoint((x, y))
Moves the line to the point x,y
quote_attrib(inStr)
Transforms characters between xml notation and python notation.
save(filename, encoding='ISO-8859-1', standalone='no')
Stores any element in a svg file (including header). Calling this method only makes sense if the root element is an svg elemnt
setAttribute(attribute_name, attribute_value)
setKWARGS(**kwargs)
Used to set all attributes given in a **kwargs parameter. Might throw an Exception if attribute was not found. #TODO: check if we should fix this using “setAttribute”
set_class(aClass)
set_clip_path(clip_path)
set_clip_rule(clip_rule)
set_color(color)
set_color_interpolation(color_interpolation)
set_color_rendering(color_rendering)
set_cursor(cursor)
set_display(display)
set_fill(fill)
set_fill_opacity(fill_opacity)
set_fill_rule(fill_rule)
set_filter(filter)
set_id(id)
set_image_rendering(image_rendering)
set_mask(mask)
set_onactivate(onactivate)
set_onclick(onclick)
set_onfocusin(onfocusin)
set_onfocusout(onfocusout)
set_onload(onload)
set_onmousedown(onmousedown)
set_onmousemove(onmousemove)
set_onmouseout(onmouseout)
set_onmouseover(onmouseover)
set_onmouseup(onmouseup)
set_opacity(opacity)
set_pointer_events(pointer_events)
set_requiredExtensions(requiredExtensions)
set_requiredFeatures(requiredFeatures)
set_shape_rendering(shape_rendering)
set_stroke(stroke)
set_stroke_dasharray(stroke_dasharray)
set_stroke_dashoffset(stroke_dashoffset)
set_stroke_linecap(stroke_linecap)
set_stroke_linejoin(stroke_linejoin)
set_stroke_miterlimit(stroke_miterlimit)
set_stroke_opacity(stroke_opacity)
set_stroke_width(stroke_width)
set_style(style)
set_systemLanguage(language_code)
set_text_rendering(text_rendering)
set_transform(transform)
set_visibility(visibility)
set_x1(x1)
set_x2(x2)
set_xml_base(xml_base)
set_xml_lang(language_code)
set_xml_space(xml_space)
set_y1(y1)
set_y2(y2)
wrap_xml(xml, encoding='ISO-8859-1', standalone='no')
Method that provides a standard svg header string for a file

path

class pysvg.shape.path(pathData='', pathLength=None, style=None, focusable=None, **kwargs)

Bases: pysvg.core.BaseShape, pysvg.attributes.ExternalAttrib, pysvg.attributes.MarkerAttrib

Class representing the path element of an svg doc.

__init__(pathData='', pathLength=None, style=None, focusable=None, **kwargs)
addElement(element)
appendArcToPath(rx, ry, x, y, x_axis_rotation=0, large_arc_flag=0, sweep_flag=1, relative=True)
appendCloseCurve()
appendCubicCurveToPath(controlstartx, controlstarty, controlendx, controlendy, endx, endy, relative=True)
appendCubicShorthandCurveToPath(controlendx, controlendy, endx, endy, relative=True)
appendHorizontalLineToPath(endx, relative=True)
appendLineToPath(endx, endy, relative=True)
appendMoveToPath(endx, endy, relative=True)
appendQuadraticCurveToPath(controlx, controly, endx, endy, relative=True)
appendQuadraticShorthandCurveToPath(endx, endy, relative=True)
appendTextContent(text)
appendVerticalLineToPath(endy, relative=True)
getAttribute(attribute_name)
getElementAt(pos)
getXML()

Return a XML representation of the current element. This function can be used for debugging purposes. It is also used by getXML in SVG

@return: the representation of the current element as an xml string

get_class()
get_clip_path()
get_clip_rule()
get_color()
get_color_interpolation()
get_color_rendering()
get_cursor()
get_d()
get_display()
get_externalResourcesRequired()
get_fill()
get_fill_opacity()
get_fill_rule()
get_filter()
get_id()
get_image_rendering()
get_marker_end()
get_marker_mid()
get_marker_start()
get_mask()
get_onactivate()
get_onclick()
get_onfocusin()
get_onfocusout()
get_onload()
get_onmousedown()
get_onmousemove()
get_onmouseout()
get_onmouseover()
get_onmouseup()
get_opacity()
get_pathLength()
get_pointer_events()
get_requiredExtensions()
get_requiredFeatures()
get_shape_rendering()
get_stroke()
get_stroke_dasharray()
get_stroke_dashoffset()
get_stroke_linecap()
get_stroke_linejoin()
get_stroke_miterlimit()
get_stroke_opacity()
get_stroke_width()
get_style()
get_systemLanguage()
get_text_rendering()
get_transform()
get_visibility()
get_xml_base()
get_xml_lang()
get_xml_space()
insertElementAt(element, pos)
quote_attrib(inStr)
Transforms characters between xml notation and python notation.
save(filename, encoding='ISO-8859-1', standalone='no')
Stores any element in a svg file (including header). Calling this method only makes sense if the root element is an svg elemnt
setAttribute(attribute_name, attribute_value)
setKWARGS(**kwargs)
Used to set all attributes given in a **kwargs parameter. Might throw an Exception if attribute was not found. #TODO: check if we should fix this using “setAttribute”
set_class(aClass)
set_clip_path(clip_path)
set_clip_rule(clip_rule)
set_color(color)
set_color_interpolation(color_interpolation)
set_color_rendering(color_rendering)
set_cursor(cursor)
set_d(d)
set_display(display)
set_externalResourcesRequired(externalResourcesRequired)
set_fill(fill)
set_fill_opacity(fill_opacity)
set_fill_rule(fill_rule)
set_filter(filter)
set_id(id)
set_image_rendering(image_rendering)
set_marker_end(marker_end)
set_marker_mid(marker_mid)
set_marker_start(marker_start)
set_mask(mask)
set_onactivate(onactivate)
set_onclick(onclick)
set_onfocusin(onfocusin)
set_onfocusout(onfocusout)
set_onload(onload)
set_onmousedown(onmousedown)
set_onmousemove(onmousemove)
set_onmouseout(onmouseout)
set_onmouseover(onmouseover)
set_onmouseup(onmouseup)
set_opacity(opacity)
set_pathLength(pathLength)
set_pointer_events(pointer_events)
set_requiredExtensions(requiredExtensions)
set_requiredFeatures(requiredFeatures)
set_shape_rendering(shape_rendering)
set_stroke(stroke)
set_stroke_dasharray(stroke_dasharray)
set_stroke_dashoffset(stroke_dashoffset)
set_stroke_linecap(stroke_linecap)
set_stroke_linejoin(stroke_linejoin)
set_stroke_miterlimit(stroke_miterlimit)
set_stroke_opacity(stroke_opacity)
set_stroke_width(stroke_width)
set_style(style)
set_systemLanguage(language_code)
set_text_rendering(text_rendering)
set_transform(transform)
set_visibility(visibility)
set_xml_base(xml_base)
set_xml_lang(language_code)
set_xml_space(xml_space)
wrap_xml(xml, encoding='ISO-8859-1', standalone='no')
Method that provides a standard svg header string for a file

polygon

class pysvg.shape.polygon(points=None, **kwargs)

Bases: pysvg.shape.polyline

Class representing the polygon element of an svg doc.

__init__(points=None, **kwargs)
addElement(element)
appendTextContent(text)
getAttribute(attribute_name)
getElementAt(pos)
getXML()

Return a XML representation of the current element. This function can be used for debugging purposes. It is also used by getXML in SVG

@return: the representation of the current element as an xml string

get_class()
get_clip_path()
get_clip_rule()
get_color()
get_color_interpolation()
get_color_rendering()
get_cursor()
get_display()
get_fill()
get_fill_opacity()
get_fill_rule()
get_filter()
get_id()
get_image_rendering()
get_mask()
get_onactivate()
get_onclick()
get_onfocusin()
get_onfocusout()
get_onload()
get_onmousedown()
get_onmousemove()
get_onmouseout()
get_onmouseover()
get_onmouseup()
get_opacity()
get_pointer_events()
get_points()
get_requiredExtensions()
get_requiredFeatures()
get_shape_rendering()
get_stroke()
get_stroke_dasharray()
get_stroke_dashoffset()
get_stroke_linecap()
get_stroke_linejoin()
get_stroke_miterlimit()
get_stroke_opacity()
get_stroke_width()
get_style()
get_systemLanguage()
get_text_rendering()
get_transform()
get_visibility()
get_xml_base()
get_xml_lang()
get_xml_space()
insertElementAt(element, pos)
quote_attrib(inStr)
Transforms characters between xml notation and python notation.
save(filename, encoding='ISO-8859-1', standalone='no')
Stores any element in a svg file (including header). Calling this method only makes sense if the root element is an svg elemnt
setAttribute(attribute_name, attribute_value)
setKWARGS(**kwargs)
Used to set all attributes given in a **kwargs parameter. Might throw an Exception if attribute was not found. #TODO: check if we should fix this using “setAttribute”
set_class(aClass)
set_clip_path(clip_path)
set_clip_rule(clip_rule)
set_color(color)
set_color_interpolation(color_interpolation)
set_color_rendering(color_rendering)
set_cursor(cursor)
set_display(display)
set_fill(fill)
set_fill_opacity(fill_opacity)
set_fill_rule(fill_rule)
set_filter(filter)
set_id(id)
set_image_rendering(image_rendering)
set_mask(mask)
set_onactivate(onactivate)
set_onclick(onclick)
set_onfocusin(onfocusin)
set_onfocusout(onfocusout)
set_onload(onload)
set_onmousedown(onmousedown)
set_onmousemove(onmousemove)
set_onmouseout(onmouseout)
set_onmouseover(onmouseover)
set_onmouseup(onmouseup)
set_opacity(opacity)
set_pointer_events(pointer_events)
set_points(points)
set_requiredExtensions(requiredExtensions)
set_requiredFeatures(requiredFeatures)
set_shape_rendering(shape_rendering)
set_stroke(stroke)
set_stroke_dasharray(stroke_dasharray)
set_stroke_dashoffset(stroke_dashoffset)
set_stroke_linecap(stroke_linecap)
set_stroke_linejoin(stroke_linejoin)
set_stroke_miterlimit(stroke_miterlimit)
set_stroke_opacity(stroke_opacity)
set_stroke_width(stroke_width)
set_style(style)
set_systemLanguage(language_code)
set_text_rendering(text_rendering)
set_transform(transform)
set_visibility(visibility)
set_xml_base(xml_base)
set_xml_lang(language_code)
set_xml_space(xml_space)
wrap_xml(xml, encoding='ISO-8859-1', standalone='no')
Method that provides a standard svg header string for a file

polyline

class pysvg.shape.polyline(points=None, **kwargs)

Bases: pysvg.core.BaseShape

Class representing the polyline element of an svg doc.

__init__(points=None, **kwargs)
addElement(element)
appendTextContent(text)
getAttribute(attribute_name)
getElementAt(pos)
getXML()

Return a XML representation of the current element. This function can be used for debugging purposes. It is also used by getXML in SVG

@return: the representation of the current element as an xml string

get_class()
get_clip_path()
get_clip_rule()
get_color()
get_color_interpolation()
get_color_rendering()
get_cursor()
get_display()
get_fill()
get_fill_opacity()
get_fill_rule()
get_filter()
get_id()
get_image_rendering()
get_mask()
get_onactivate()
get_onclick()
get_onfocusin()
get_onfocusout()
get_onload()
get_onmousedown()
get_onmousemove()
get_onmouseout()
get_onmouseover()
get_onmouseup()
get_opacity()
get_pointer_events()
get_points()
get_requiredExtensions()
get_requiredFeatures()
get_shape_rendering()
get_stroke()
get_stroke_dasharray()
get_stroke_dashoffset()
get_stroke_linecap()
get_stroke_linejoin()
get_stroke_miterlimit()
get_stroke_opacity()
get_stroke_width()
get_style()
get_systemLanguage()
get_text_rendering()
get_transform()
get_visibility()
get_xml_base()
get_xml_lang()
get_xml_space()
insertElementAt(element, pos)
quote_attrib(inStr)
Transforms characters between xml notation and python notation.
save(filename, encoding='ISO-8859-1', standalone='no')
Stores any element in a svg file (including header). Calling this method only makes sense if the root element is an svg elemnt
setAttribute(attribute_name, attribute_value)
setKWARGS(**kwargs)
Used to set all attributes given in a **kwargs parameter. Might throw an Exception if attribute was not found. #TODO: check if we should fix this using “setAttribute”
set_class(aClass)
set_clip_path(clip_path)
set_clip_rule(clip_rule)
set_color(color)
set_color_interpolation(color_interpolation)
set_color_rendering(color_rendering)
set_cursor(cursor)
set_display(display)
set_fill(fill)
set_fill_opacity(fill_opacity)
set_fill_rule(fill_rule)
set_filter(filter)
set_id(id)
set_image_rendering(image_rendering)
set_mask(mask)
set_onactivate(onactivate)
set_onclick(onclick)
set_onfocusin(onfocusin)
set_onfocusout(onfocusout)
set_onload(onload)
set_onmousedown(onmousedown)
set_onmousemove(onmousemove)
set_onmouseout(onmouseout)
set_onmouseover(onmouseover)
set_onmouseup(onmouseup)
set_opacity(opacity)
set_pointer_events(pointer_events)
set_points(points)
set_requiredExtensions(requiredExtensions)
set_requiredFeatures(requiredFeatures)
set_shape_rendering(shape_rendering)
set_stroke(stroke)
set_stroke_dasharray(stroke_dasharray)
set_stroke_dashoffset(stroke_dashoffset)
set_stroke_linecap(stroke_linecap)
set_stroke_linejoin(stroke_linejoin)
set_stroke_miterlimit(stroke_miterlimit)
set_stroke_opacity(stroke_opacity)
set_stroke_width(stroke_width)
set_style(style)
set_systemLanguage(language_code)
set_text_rendering(text_rendering)
set_transform(transform)
set_visibility(visibility)
set_xml_base(xml_base)
set_xml_lang(language_code)
set_xml_space(xml_space)
wrap_xml(xml, encoding='ISO-8859-1', standalone='no')
Method that provides a standard svg header string for a file

rect

class pysvg.shape.rect(x=None, y=None, width=None, height=None, rx=None, ry=None, **kwargs)

Bases: pysvg.core.BaseShape, pysvg.core.PointAttrib, pysvg.core.DimensionAttrib

Class representing the rect element of an svg doc.

__init__(x=None, y=None, width=None, height=None, rx=None, ry=None, **kwargs)
addElement(element)
appendTextContent(text)
getAttribute(attribute_name)
getBottomLeft()
Retrieves a tuple with the x,y coordinates of the lower left point of the rect. Requires the coordinates, width, height to be numbers
getBottomRight()
Retrieves a tuple with the x,y coordinates of the lower right point of the rect. Requires the coordinates, width, height to be numbers
getEdgePoints()
Returns a list with the coordinates of the points at the edge of the rectangle as tuples. e.g.[(x1,y1),(x2,y2)] The sorting is counterclockwise starting with the lower left corner. Coordinates must be numbers or an exception will be thrown.
getElementAt(pos)
getInnerEdgePoints()
Returns a list with the coordinates of the points at the inner edge of a rounded rectangle as tuples. e.g.[(x1,y1),(x2,y2)] The sorting is counterclockwise starting with the lower left corner. Coordinates must be numbers or an exception will be thrown.
getTopLeft()
Retrieves a tuple with the x,y coordinates of the upper left point of the rect. Requires the coordinates, width, height to be numbers
getTopRight()
Retrieves a tuple with the x,y coordinates of the upper right point of the rect. Requires the coordinates, width, height to be numbers
getXML()

Return a XML representation of the current element. This function can be used for debugging purposes. It is also used by getXML in SVG

@return: the representation of the current element as an xml string

get_class()
get_clip_path()
get_clip_rule()
get_color()
get_color_interpolation()
get_color_rendering()
get_cursor()
get_display()
get_fill()
get_fill_opacity()
get_fill_rule()
get_filter()
get_height()
get_id()
get_image_rendering()
get_mask()
get_onactivate()
get_onclick()
get_onfocusin()
get_onfocusout()
get_onload()
get_onmousedown()
get_onmousemove()
get_onmouseout()
get_onmouseover()
get_onmouseup()
get_opacity()
get_pointer_events()
get_requiredExtensions()
get_requiredFeatures()
get_rx()
get_ry()
get_shape_rendering()
get_stroke()
get_stroke_dasharray()
get_stroke_dashoffset()
get_stroke_linecap()
get_stroke_linejoin()
get_stroke_miterlimit()
get_stroke_opacity()
get_stroke_width()
get_style()
get_systemLanguage()
get_text_rendering()
get_transform()
get_visibility()
get_width()
get_x()
get_xml_base()
get_xml_lang()
get_xml_space()
get_y()
insertElementAt(element, pos)
moveToPoint((x, y))
Moves the rect to the point x,y
quote_attrib(inStr)
Transforms characters between xml notation and python notation.
save(filename, encoding='ISO-8859-1', standalone='no')
Stores any element in a svg file (including header). Calling this method only makes sense if the root element is an svg elemnt
setAttribute(attribute_name, attribute_value)
setKWARGS(**kwargs)
Used to set all attributes given in a **kwargs parameter. Might throw an Exception if attribute was not found. #TODO: check if we should fix this using “setAttribute”
set_class(aClass)
set_clip_path(clip_path)
set_clip_rule(clip_rule)
set_color(color)
set_color_interpolation(color_interpolation)
set_color_rendering(color_rendering)
set_cursor(cursor)
set_display(display)
set_fill(fill)
set_fill_opacity(fill_opacity)
set_fill_rule(fill_rule)
set_filter(filter)
set_height(height)
set_id(id)
set_image_rendering(image_rendering)
set_mask(mask)
set_onactivate(onactivate)
set_onclick(onclick)
set_onfocusin(onfocusin)
set_onfocusout(onfocusout)
set_onload(onload)
set_onmousedown(onmousedown)
set_onmousemove(onmousemove)
set_onmouseout(onmouseout)
set_onmouseover(onmouseover)
set_onmouseup(onmouseup)
set_opacity(opacity)
set_pointer_events(pointer_events)
set_requiredExtensions(requiredExtensions)
set_requiredFeatures(requiredFeatures)
set_rx(rx)
set_ry(ry)
set_shape_rendering(shape_rendering)
set_stroke(stroke)
set_stroke_dasharray(stroke_dasharray)
set_stroke_dashoffset(stroke_dashoffset)
set_stroke_linecap(stroke_linecap)
set_stroke_linejoin(stroke_linejoin)
set_stroke_miterlimit(stroke_miterlimit)
set_stroke_opacity(stroke_opacity)
set_stroke_width(stroke_width)
set_style(style)
set_systemLanguage(language_code)
set_text_rendering(text_rendering)
set_transform(transform)
set_visibility(visibility)
set_width(width)
set_x(x)
set_xml_base(xml_base)
set_xml_lang(language_code)
set_xml_space(xml_space)
set_y(y)
wrap_xml(xml, encoding='ISO-8859-1', standalone='no')
Method that provides a standard svg header string for a file

Table Of Contents

This Page