API¶
¶
Render dwo dimensional iterable into customized SVG image.
debug
class-attribute
¶
Raise an exception if any element fails to provide color or text.
default_color
class-attribute
¶
Color to be used when color(e, x, y) raises or returns None.
default_text
class-attribute
¶
Text to be used when text(e, x, y) raises.
flip_x
class-attribute
¶
Whether or not to flip X axis.
flip_y
class-attribute
¶
Whether or not to flip Y axis.
legend
class-attribute
¶
Whether or not to display legend. If legend is empty, it will be hidden anyway.
transpose
class-attribute
¶
Whether or not to transpose entire data set.
__init__(self, target)
special
¶
If target iterable target is mutable, it can be modified after creating instance of this class.
Source code in gridview/gridview.py
42 43 44 |
|
color(self, e, x, y)
¶
Abstract method that returns color assigned to element e. Coordinates are provided as x and y. Color should be HTML compatible, (e.g. '#ff0000' or 'red'). Optionally color can be suffixed with label that builds up legend, e.g. '#ff0000:foobar'. If raises or returns None, default_color will be used.
Source code in gridview/gridview.py
64 65 66 67 |
|
save(self, path)
¶
Save SVG image into path.
Source code in gridview/gridview.py
46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
text(self, e, x, y)
¶
Abstract method that returns stringified version of element e. Coordinates are provided as x and y. If raises, default_text will be used. If returns None, str(e) will be used.
Source code in gridview/gridview.py
60 61 62 |
|