Skip to content

Commit

Permalink
render a unique tagCloud order when values are equal
Browse files Browse the repository at this point in the history
  • Loading branch information
Coeur committed Nov 4, 2018
1 parent 0890eee commit 7c8b8ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions codecloud.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@
var tagCloud = new TagCloud(canvas.width,
canvas.height, ctx);
tagCloud.render([ ["bar", 2],
["foo", 1],
["switch", 1],
["0", 1],
["1", 1],
["2", 1],
["3", 1],
["foo", 1],
["switch", 1],

]);
}
Expand Down
3 changes: 2 additions & 1 deletion lizard_ext/lizardwordcount.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def print_result(self):
var tagCloud = new TagCloud(canvas.width,
canvas.height, ctx);
tagCloud.render([''')
tags = sorted(self.result, key=self.result.get, reverse=True)[:400]
tags = sorted(self.result)
tags = sorted(tags, key=self.result.get, reverse=True)[:400]
for k in tags:
html_file.write(
' ' * 40 + '["%s", %d],\n' % (
Expand Down

0 comments on commit 7c8b8ce

Please sign in to comment.