Package rdkit :: Package Chem :: Package Draw :: Module spingCanvas :: Class Canvas
[hide private]
[frames] | no frames]

Class Canvas

source code

canvasbase.CanvasBase --+
                        |
                       Canvas

Instance Methods [hide private]
 
__init__(self, size, name, imageType='png') source code
 
addCanvasLine(self, p1, p2, color=(0, 0, 0), color2=None, **kwargs)
Draw a single line on the canvas
source code
 
addCanvasText(self, text, pos, font, color=(0, 0, 0), **kwargs)
Draw some text
source code
 
addCanvasPolygon(self, ps, color=(0, 0, 0), fill=True, stroke=False, **kwargs)
Draw a polygon
source code
 
addCanvasDashedWedge(self, p1, p2, p3, dash=(2, 2), color=(0, 0, 0), color2=None, **kwargs)
Draw a dashed wedge
source code
 
flush(self)
Complete any remaining draw operation
source code
 
save(self) source code

Inherited from canvasbase.CanvasBase (private): _getLinePoints

Method Details [hide private]

addCanvasLine(self, p1, p2, color=(0, 0, 0), color2=None, **kwargs)

source code 
Draw a single line on the canvas

This function will draw a line between `p1` and `p2` with the
given `color`.
If `color2` is specified, it will be used to draw the second half
of the segment

Overrides: canvasbase.CanvasBase.addCanvasLine
(inherited documentation)

addCanvasText(self, text, pos, font, color=(0, 0, 0), **kwargs)

source code 
Draw some text

The provided `text` is drawn at position `pos` using the given
`font` and the chosen `color`.

Overrides: canvasbase.CanvasBase.addCanvasText
(inherited documentation)

addCanvasPolygon(self, ps, color=(0, 0, 0), fill=True, stroke=False, **kwargs)

source code 
Draw a polygon

Draw a polygon identified by vertexes given in `ps` using
the given `color` 

Overrides: canvasbase.CanvasBase.addCanvasPolygon
(inherited documentation)

addCanvasDashedWedge(self, p1, p2, p3, dash=(2, 2), color=(0, 0, 0), color2=None, **kwargs)

source code 
Draw a dashed wedge

The wedge is identified by the three points `p1`, `p2`, and `p3`. 
It will be drawn using the given `color`; if `color2` is specified
it will be used for the second half of the wedge 

TODO: fix comment, I'm not sure what `dash` does

Overrides: canvasbase.CanvasBase.addCanvasDashedWedge
(inherited documentation)

flush(self)

source code 
Complete any remaining draw operation

This is supposed to be the last operation on the canvas before
saving it

Overrides: canvasbase.CanvasBase.flush
(inherited documentation)