def render_edge_graphviz (self, graph):
'''
Render an edge suitable for use in a Pydot graph using the set internal attributes.
@type graph: pgraph.graph
@param graph: Top level graph object containing the current edge
@rtype: pydot.Edge()
@return: Pydot object representing edge
'''
import pydot
# no need to validate if nodes exist for src/dst. graphviz takes care of that for us transparently.
dot_edge = pydot.Edge(self.src, self.dst)
if self.label:
dot_edge.label = self.label
dot_edge.color = "#%06x" % self.color
return dot_edge
####################################################################################################################
评论列表
文章目录