PSVG.Draw package

Submodules

PSVG.Draw.Base module

class PSVG.Draw.Base.Base(name, fill=None, fill_opacity=None, stroke=None, stroke_width=None, stroke_opacity=None, stroke_dasharray=None, active=True)

Bases: Node

Abstract Class

Sets the parameters shared by all drawn objects.

Currently, these are as follows: - fill: an (r, g, b) tuple that sets the fill color of the object - fill_opacity: a float value between 0 and 1 that sets the opacity of the object - stroke: an (r, g, b) tuple that sets the color of the object border - stroke_opacity: a float value between 0 and 1 that sets the opacity of the object border - stroke_width: a float that sets the width of the object border - stroke_dasharray: a list of integers that sets the design of the object border dashes if desired

Any parameter not set will be absent from the svg definition.

construct(depth)

Constructs the svg definition :param depth: current depth of this node in the svg tree :return: String containing the svg definition for this object

copy(item: Base = None)

Creates a copy of this node either by creating a new object or by adjusting the values of the object referenced by item

Parameters:

item – reference to an existing node

Returns:

a node with the same attributes as this node

PSVG.Draw.Circle module

class PSVG.Draw.Circle.Circle(cx=0, cy=0, r=0, **kwargs)

Bases: Base

copy(item: Circle = None)

Creates a copy of this node either by creating a new object or by adjusting the values of the object referenced by item

Parameters:

item – reference to an existing node

Returns:

a node with the same attributes as this node

PSVG.Draw.Path module

class PSVG.Draw.Path.Path(points=None, **kwargs)

Bases: Base

Concrete Implementation of Draw.Base

Represents a generic version of the path element of an SVG.

Path elements are used to draw curves and shapes freely based on defined curve behavior and coordinates on which to draw.

copy(item: Path = None)

Creates a copy of this node either by creating a new object or by adjusting the values of the object referenced by item

Parameters:

item – reference to an existing node

Returns:

a node with the same attributes as this node

PSVG.Draw.Rectangle module

class PSVG.Draw.Rectangle.Rect(x=0, y=0, w='100%', h='100%', rx=None, ry=None, **kwargs)

Bases: Base

Concrete Implementation of Draw.Base

Represents a rectangle SVG element.

copy(item: Rect = None)

Creates a copy of this node either by creating a new object or by adjusting the values of the object referenced by item

Parameters:

item – reference to an existing node

Returns:

a node with the same attributes as this node

Module contents