Changeset 203
- Timestamp:
- 08/24/08 10:12:00 (10 months ago)
- Location:
- trunk/shakespeare
- Files:
-
- 3 modified
-
controllers/stats.py (modified) (1 diff)
-
templates/stats/text.html (modified) (1 diff)
-
templates/stats/word.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/shakespeare/controllers/stats.py
r199 r203 44 44 c.stats = stats.word_stats(word) 45 45 # will not have that many texts so do not need to limit c.stats 46 data = [ (s.text.title , s.freq) for s in c.stats ]46 data = [ (s.text.title[:min(len(s.text.title), 10)], s.freq) for s in c.stats ] 47 47 c.img_url = self.vertical_bar_chart(data) 48 48 return render('stats/word') 49 49 50 50 # TODO: factor this out to its module (?) 51 def vertical_bar_chart(self, data, width= 500):51 def vertical_bar_chart(self, data, width=300): 52 52 if not data: 53 53 return '' -
trunk/shakespeare/templates/stats/text.html
r199 r203 12 12 Sorry, no statistics are available for ${c.text.title} (name: ${c.text.name}) 13 13 </p> 14 <table style="margin-left: 550px;">14 <table> 15 15 <thead> 16 16 <tr> -
trunk/shakespeare/templates/stats/word.html
r199 r203 10 10 11 11 <p py:if="not c.stats"> 12 Sorry, no statistics are available for ${c. text.title} (name: ${c.text.name})12 Sorry, no statistics are available for ${c.word} (NB: words are stemmed for stats purposes, so loved becomes love, bloody becomes blood etc). 13 13 </p> 14 <table style="margin-left: 550px;">14 <table> 15 15 <thead> 16 16 <tr>
