comparison svgsitemap/middleware.py @ 17:94d9eccce1d7

prevent edge width breaking when new edges are added
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 02 Jan 2011 20:25:44 -0800
parents f50b4e4ad764
children 2aeac6508dc3
comparison
equal deleted inserted replaced
16:f50b4e4ad764 17:94d9eccce1d7
166 self.max = count 166 self.max = count
167 self.edges[(from_url, to_url)] = count 167 self.edges[(from_url, to_url)] = count
168 edge = self.graph.get_edge(from_url, to_url) 168 edge = self.graph.get_edge(from_url, to_url)
169 self.label(edge, count) 169 self.label(edge, count)
170 else: 170 else:
171 count = 1
171 self.edges[(from_url, to_url)] = 1 172 self.edges[(from_url, to_url)] = 1
172 self.max = 1
173 labeltooltip = '1: %s -> %s' % (from_url, to_url) 173 labeltooltip = '1: %s -> %s' % (from_url, to_url)
174 self.graph.add_edge(from_url, to_url, label='', tooltip=labeltooltip, href='#') 174 self.graph.add_edge(from_url, to_url, label='', tooltip=labeltooltip, href='#')
175
176 if count > self.max:
177 self.max = count
175 178
176 if self.maxwidth: 179 if self.maxwidth:
177 self.set_widths() 180 self.set_widths()
178 181
179 for url in from_url, to_url: 182 for url in from_url, to_url: