Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide data for running tally and shift charts #7

Open
kevkan opened this issue Oct 21, 2015 · 1 comment
Open

Provide data for running tally and shift charts #7

kevkan opened this issue Oct 21, 2015 · 1 comment

Comments

@kevkan
Copy link

kevkan commented Oct 21, 2015

Here's a sample of the json I'm currently using for the running tally and shift charts. There's several "types" of objects within it:

  • type: "period" (stores the duration of each period)
  • type: "player" (stores each player's name, total toi, etc.)
  • type: "shift" (stores the player id, time, length, etc. of each shift)
  • type: "teammates" (stores the toi shared by every combination of 2 teammates -- used to estimate lines)
  • type: "opponents" (stores the toi shared by every combination of 2 opponents -- used for the matchup chart, so you can ignore it for the tally and shift charts)
  • type: "powerplay" (stores the team, time, length) of each powerplay
  • type: "event" (stores corsi events)
  • type: "teams" (stores the team names and home/away status)

I'm not sure combining all this data into a single json file is the best way to serve the data, so I'm completely open to you providing this data in a different way, and I can change the d3.js code to use it.

Sample data
corsi-and-shift-chart-data.txt

Sample chart
charts

@pacefalm
Copy link

So, mocking this up in my head:

Jumping to the page should call be woi.com/individual_game//shift_chart

I think it makes the most sense to populate the page with json data in the flask view, since it seems like this is a one call and done kinda page.

Thinking through the logic in pseudo sql:

select * from individual game as game
join teams on team.id in game.teams
join players on players.id in teams.id
join shifts on shifts.player_id = player.id and shifts.game_id = game.id
join events on ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants