예제 #1
0
def _stat_development(player_timeline):
	html = "<h2>Stat Development</h2>\n"
	data = [
		[p.kill_count for p in player_timeline],
		[p.death_count for p in player_timeline],
		[p.flag_caps *10 for p in player_timeline]]
	url = googlechart_url(data=data, legend=['frags','deaths','caps*10'])
	html += '<img src="%s" />\n' % url
	return html
예제 #2
0
def _hitrate_comparison(weapon, timelines):
	nicks = list()
	hitrates = list()
	for line in timelines:
		d = [getattr(x, weapon)['hitrate'] for x in line][-30:]
		if sum(d) == 0:
			continue
		_average_weapon_row(d)
		nicks.append( line[0].nick )
		hitrates.append( d )
	url = googlechart_url(data=hitrates, legend=nicks)
	html = '<h3>Hitrate with %s</h3>' % (_WEAPON_NAMES[weapon])
	html += '<img src="%s" alt="hitrates with %s" />' % (url, weapon)
	return html
예제 #3
0
def _player_elos(timelines):
	elos = [[int(p.elo*1000) for p in line] for line in timelines]
	max_elo = max(max(row) for row in elos)
	nicks = [p[0].nick for p in timelines]
	url = googlechart_url(data=elos, legend=nicks)
	return '<img src="%s" alt="player ELO ratings" />\n' % url