Make module cloud sizes relative to the smallest number that's present, not 0.

This commit is contained in:
Georg Brandl 2007-07-30 19:47:15 +00:00
parent fa844c2634
commit d8718232f2

View File

@ -339,11 +339,13 @@ class DocumentationApplication(object):
""" """
most_frequent = heapq.nlargest(30, self.freqmodules.iteritems(), most_frequent = heapq.nlargest(30, self.freqmodules.iteritems(),
lambda x: x[1]) lambda x: x[1])
most_frequent = [{ if most_frequent:
'name': x[0], base_count = most_frequent[0][1]
'size': 100 + math.log(x[1] or 1) * 20, most_frequent = [{
'count': x[1] 'name': x[0],
} for x in sorted(most_frequent)] 'size': 100 + math.log((x[1] - base_count) + 1) * 20,
'count': x[1]
} for x in sorted(most_frequent)]
showpf = None showpf = None
newpf = req.args.get('pf') newpf = req.args.get('pf')