From 881622183dcf5f0b780a8b1b491ac7405d16bb64 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sat, 10 Mar 2018 22:31:03 +0100 Subject: Improved the tag cloud generation. --- src/lib/misc_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/misc_utils.py b/src/lib/misc_utils.py index 7d9f55fd..0757f224 100755 --- a/src/lib/misc_utils.py +++ b/src/lib/misc_utils.py @@ -180,6 +180,6 @@ def tag_cloud(tags): Generates a tags cloud. """ tags.sort(key=operator.itemgetter(0)) + max_tag = max([tag[1] for tag in tags]) return '\n'.join([('%s' % \ - (min(1 + count * 7 / max([tag[1] for tag in tags]), 7), word)) \ - for (word, count) in tags]) + (min(1 + count * 7 / max_tag, 7), word)) for (word, count) in tags]) -- cgit