def __str__(self):
graph_as_table = len(self.hopNodes) > <NUM_LIT:0> and len(self.root) == <NUM_LIT:1><EOL>if len(self.added) <= <NUM_LIT:1> and not graph_as_table:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>if len(self.added) > self.max_nodes:<EOL><INDENT>if self.warn:<EOL><INDENT>print('<STR_LIT>'<EOL>.format(self.ident,self.max_nodes))<EOL>self.warn = False<EOL><DEDENT>return '<STR_LIT>'<EOL><DEDENT>if len(self.added) < len(self.root):<EOL><INDENT>if self.warn:<EOL><INDENT>print('<STR_LIT>'.format(self.ident))<EOL>self.warn = False<EOL><DEDENT>return '<STR_LIT>'<EOL><DEDENT>if self.warn and self.truncated > <NUM_LIT:0>:<EOL><INDENT>print('<STR_LIT>'.format(self.ident,self.truncated))<EOL>self.warn = False<EOL><DEDENT>zoomName = '<STR_LIT>'<EOL>svgGraph = '<STR_LIT>'<EOL>rettext = '<STR_LIT>'<EOL>if graph_as_table:<EOL><INDENT>root = '<STR_LIT>'.format(<EOL>len(self.hopNodes) * <NUM_LIT:2> + <NUM_LIT:1>, self.root[<NUM_LIT:0>].attribs['<STR_LIT:label>'])<EOL>if self.hopEdges[<NUM_LIT:0>][<NUM_LIT:0>].ident == self.root[<NUM_LIT:0>].ident:<EOL><INDENT>key = <NUM_LIT:1><EOL>root_on_left = (self.RANKDIR == '<STR_LIT>')<EOL>if root_on_left:<EOL><INDENT>arrowtemp = ('<STR_LIT>'<EOL>+ '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>arrowtemp = ('<STR_LIT>'<EOL>+ '<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>key = <NUM_LIT:0><EOL>root_on_left = (self.RANKDIR == '<STR_LIT>')<EOL>if root_on_left:<EOL><INDENT>arrowtemp = ('<STR_LIT>'<EOL>+ '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>arrowtemp = ('<STR_LIT>'<EOL>+ '<STR_LIT>')<EOL><DEDENT><DEDENT>self.hopEdges.sort(key=lambda x: x[key].attribs['<STR_LIT:label>'].lower())<EOL>rows = '<STR_LIT>'<EOL>for i in range(len(self.hopEdges)):<EOL><INDENT>e = self.hopEdges[i]<EOL>n = e[key]<EOL>if len(e) == <NUM_LIT:5>:<EOL><INDENT>arrow = arrowtemp.format(e[<NUM_LIT:2>], '<STR_LIT>', e[<NUM_LIT:4>])<EOL><DEDENT>else:<EOL><INDENT>arrow = arrowtemp.format(e[<NUM_LIT:2>], '<STR_LIT>', '<STR_LIT:w>')<EOL><DEDENT>node = '<STR_LIT>'.format(<EOL>n.attribs['<STR_LIT>'])<EOL>try:<EOL><INDENT>node += '<STR_LIT>'.format(<EOL>n.attribs['<STR_LIT>'], n.attribs['<STR_LIT:label>'])<EOL><DEDENT>except:<EOL><INDENT>node += n.attribs['<STR_LIT:label>'] + '<STR_LIT>'<EOL><DEDENT>if root_on_left:<EOL><INDENT>rows += '<STR_LIT>' + root + arrow + node + '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>rows += '<STR_LIT>' + node + arrow + root + '<STR_LIT>'<EOL><DEDENT>rows += '<STR_LIT>'.format(e[<NUM_LIT:2>])<EOL>root = '<STR_LIT>'<EOL><DEDENT>rettext += '<STR_LIT>' + rows + '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>rettext += '<STR_LIT>'<EOL>svgGraph = self.svg_src<EOL>if self.scaled:<EOL><INDENT>zoomName = re.sub('<STR_LIT>', '<STR_LIT>', self.ident)<EOL>rettext += ('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>rettext += ('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>return rettext.format(svgGraph, zoomName, self.get_key())<EOL>
The string of the graph is its HTML representation.
It will only be created if it is not too large.
If the graph is overly large but can represented by a single node
with many dependencies it will be shown as a table instead to ease
the rendering in browsers.