changeset 19:60baa5252aa4

hopefully fix formatting a bit
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 02 Jan 2011 20:35:59 -0800
parents 2aeac6508dc3
children f9cf249dd512
files svgsitemap/middleware.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/svgsitemap/middleware.py	Sun Jan 02 20:29:43 2011 -0800
+++ b/svgsitemap/middleware.py	Sun Jan 02 20:35:59 2011 -0800
@@ -93,10 +93,13 @@
                     label = edge.attr['label']
                     count = int(label)
                     self.label(edge, count)
+                edge.attr['fontsize'] = self.fontsize
                 self.edges[(edge[0], edge[1])] = count
                 if count > self.max:
                     self.max = count
             self.remove_orphans()
+            for node in self.graph.nodes():
+                node.attr['fontsize'] = self.fontsize
             self.set_widths()
         else:
             self.graph = AGraph(name=self.name, splines=False, directed=True)
@@ -107,7 +110,7 @@
         self.graph.graph_attr['fontname'] = self.fontname
         self.graph.graph_attr['fontcolor'] = self.fontcolor
         self.graph.graph_attr['bgcolor'] = self.bgcolor
-        self.graph.graph_attr['overlap'] = 'false'
+        self.graph.graph_attr['overlap'] = 'compact'
         self.graph.graph_attr['sep'] = '0'
         self.graph.node_attr['color'] = self.nodecolor
         self.graph.node_attr['fontcolor'] = self.fontcolor
@@ -171,7 +174,7 @@
             count = 1
             self.edges[(from_url, to_url)] = 1
             labeltooltip = '1: %s -> %s' % (from_url, to_url)
-            self.graph.add_edge(from_url, to_url, label='', tooltip=labeltooltip, href='#')
+            self.graph.add_edge(from_url, to_url, label='', tooltip=labeltooltip, href='#', fontsize=self.fontsize)
 
         if count > self.max:
             self.max = count
@@ -183,11 +186,13 @@
             node = self.graph.get_node(url)
             node.attr['label'] = url
             node.attr['href'] = url
+            node.attr['fontsize'] = self.fontsize
 
         self.save()
 
     def label(self, edge, count):
         edge.attr['label'] = ''
+        edge.attr['fontsize'] = self.fontsize
         edge.attr['tooltip'] = '%d: %s -> %s' % (count, edge[0], edge[1])
         edge.attr['labeltooltip'] = edge.attr['tooltip']
         edge.attr['href'] = '#'