Compare commits

..

No commits in common. "main" and "main" have entirely different histories.
main ... main

2 changed files with 11 additions and 13 deletions

20
main.py
View file

@ -3,18 +3,17 @@ from flask import Flask, jsonify, render_template
users = { users = {
"local_klink": "Francis", "local_klink": "Francis",
"naive_persian": "Vincent", "awful_lickilicky": "geen-zeuser",
"punctual_pyroar": "Seppe", "decisive_grookey": "geen",
"unmotivated_tentacruel": "Tybo", "sweet_munna": "geen",
"outgoing_torchic": "Mathieu", "lazy_pichu": "geen",
"mercurial_celebi": "Rune", "stupid_magikarp": "geen",
"sloppy_golem": "Elias", "superficial_gigalith": "geen",
"excellent_wishiwashi": "Xander", "ugly_kingdra": "geen",
"dainty_snubbull": "Saturn",
} }
def get_game_data(): def get_game_data():
res = requests.get("https://botbattle.be/api/games?num=5000") res = requests.get("https://botbattle.be/api/games")
return sorted(res.json(), key=lambda x: x['gid']) return sorted(res.json(), key=lambda x: x['gid'])
def get_data(): def get_data():
@ -50,8 +49,7 @@ def process_game_data(game_data):
'bots': bots, 'bots': bots,
'min_elo': min_elo, 'min_elo': min_elo,
'max_elo': max_elo, 'max_elo': max_elo,
'min_game': game_data[0]['gid'], 'game': game_data[-1]['gid'],
'max_game': game_data[-1]['gid'],
} }
def filter_date(data): def filter_date(data):

View file

@ -99,9 +99,9 @@
ctx.lineWidth = 4 ctx.lineWidth = 4
ctx.strokeStyle = bot.color_ring ctx.strokeStyle = bot.color_ring
ctx.beginPath() ctx.beginPath()
ctx.moveTo(getX(width, margin, graph_data.min_game, graph_data.max_game, bot.x[0]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[0])) ctx.moveTo(getX(width, margin, 0, graph_data.game, bot.x[0]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[0]))
for (let i = 1; i < bot.x.length; i++) { for (let i = 1; i < bot.x.length; i++) {
ctx.lineTo(getX(width, margin, graph_data.min_game, graph_data.max_game, bot.x[i]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[i])) ctx.lineTo(getX(width, margin, 0, graph_data.game, bot.x[i]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[i]))
} }
ctx.stroke() ctx.stroke()
} }