Package logilab :: Package common :: Module graph :: Class DotBackend

[frames] | no frames]

# Class DotBackend

source code

    Dot File backend.

Instance Methods

__init__(self, graphname, rankdir=None, size=None, ratio=None, charset='utf-8', renderer='dot', additionnal_param={}) | source code

get_source(self) returns self._source | source code

source(self) returns self._source | source code

generate(self, outputfile=None, dotfile=None, mapfile=None) Generates a graph file. | source code

emit(self, line) Adds <line> to final output. | source code

emit_edge(self, name1, name2, **props) emit an edge from <name1> to <name2>. | source code

emit_node(self, name, **props) emit a node with given properties. | source code

Method Details

### generate(self, outputfile=None, dotfile=None, mapfile=None)

source code

    Generates a graph file.

    :param outputfile: filename and path [defaults to graphname.png]
    :param dotfile: filename and path [defaults to graphname.dot]

    :rtype: str
    :return: a path to the generated file

### emit_edge(self, name1, name2, **props)

source code

    emit an edge from <name1> to <name2>.
    edge properties: see http://www.graphviz.org/doc/info/attrs.html

### emit_node(self, name, **props)

source code

    emit a node with given properties.
    node properties: see http://www.graphviz.org/doc/info/attrs.html