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 = {
"local_klink": "Francis",
"naive_persian": "Vincent",
"punctual_pyroar": "Seppe",
"unmotivated_tentacruel": "Tybo",
"outgoing_torchic": "Mathieu",
"mercurial_celebi": "Rune",
"sloppy_golem": "Elias",
"excellent_wishiwashi": "Xander",
"dainty_snubbull": "Saturn",
"awful_lickilicky": "geen-zeuser",
"decisive_grookey": "geen",
"sweet_munna": "geen",
"lazy_pichu": "geen",
"stupid_magikarp": "geen",
"superficial_gigalith": "geen",
"ugly_kingdra": "geen",
}
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'])
def get_data():
@ -50,8 +49,7 @@ def process_game_data(game_data):
'bots': bots,
'min_elo': min_elo,
'max_elo': max_elo,
'min_game': game_data[0]['gid'],
'max_game': game_data[-1]['gid'],
'game': game_data[-1]['gid'],
}
def filter_date(data):

View file

@ -99,9 +99,9 @@
ctx.lineWidth = 4
ctx.strokeStyle = bot.color_ring
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++) {
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()
}