Пример #1
0
def player(playerID):

	player = Player(playerID)
	shotChart = player.getShotData()
	headers = shotChart['resultSets'][0]['headers']
	shots = shotChart['resultSets'][0]['rowSet']

	# print(shots)
	# print('---')

	grapher = Grapher(shots)
	x,y,shotStatus = grapher.getShotCoordinates()

	# split shot coordinates into made and miss
	madeX = []
	madeY = []
	missedX = []
	missedY = []
	for i in range(len(x)):
		if shotStatus[i] == 'Made Shot':
			madeX.append(x[i])
			madeY.append(y[i])
		else:
			missedX.append(x[i])
			missedY.append(y[i])

	file = grapher.makeGraph(x,y, madeX, madeY, missedX, missedY)

	return render_template('player.html', playerID=playerID, shotChart=file)