war-on-ice / woi-web

WAR On Ice - Web
10 stars 10 forks source link

Create chart for in-game running tallies #3

Open amandrycky opened 9 years ago

amandrycky commented 9 years ago

Here is an example of one, via the game summary (http://war-on-ice.com/game1.html?seasongcode=2014201530416) app. Should accept data and output chart that looks like this. image

Data sample to come.

Sample data: For game states:

[{"secondStart":704,"secondEnd":741,"state":"Away Empty Net"},{"secondStart":741,"secondEnd":897,"state":"Away PP"},{"secondStart":1065,"secondEnd":1065,"state":"Home Empty Net"},{"secondStart":1065,"secondEnd":1162,"state":"Home PP"},{"secondStart":1699,"secondEnd":1836,"state":"Away PP"},{"secondStart":2223,"secondEnd":2530,"state":"Home PP"},{"secondStart":3577,"secondEnd":3600,"state":"Home Empty Net"}] 

For events:

[{"team":"MTL","seconds":19,"event":"MISS"},{"team":"TOR","seconds":36,"event":"BLOCK"},{"team":"TOR","seconds":47,"event":"SHOT"},{"team":"TOR","seconds":74,"event":"BLOCK"},{"team":"TOR","seconds":85,"event":"SHOT"},{"team":"TOR","seconds":93,"event":"MISS"},{"team":"MTL","seconds":132,"event":"MISS"},{"team":"TOR","seconds":150,"event":"SHOT"},{"team":"TOR","seconds":191,"event":"SHOT"},{"team":"TOR","seconds":205,"event":"SHOT"},{"team":"TOR","seconds":256,"event":"BLOCK"},{"team":"MTL","seconds":266,"event":"MISS"},{"team":"MTL","seconds":282,"event":"GOAL"},{"team":"MTL","seconds":297,"event":"MISS"},{"team":"MTL","seconds":352,"event":"SHOT"},{"team":"MTL","seconds":458,"event":"SHOT"},{"team":"TOR","seconds":484,"event":"GOAL"},{"team":"TOR","seconds":504,"event":"SHOT"},{"team":"MTL","seconds":520,"event":"BLOCK"},{"team":"MTL","seconds":530,"event":"BLOCK"},{"team":"TOR","seconds":540,"event":"BLOCK"},{"team":"TOR","seconds":553,"event":"BLOCK"},{"team":"MTL","seconds":579,"event":"MISS"},{"team":"TOR","seconds":606,"event":"MISS"},{"team":"TOR","seconds":642,"event":"SHOT"},{"team":"TOR","seconds":648,"event":"MISS"},{"team":"MTL","seconds":674,"event":"SHOT"},{"team":"MTL","seconds":704,"event":"SHOT"},{"team":"MTL","seconds":735,"event":"MISS"},{"team":"MTL","seconds":851,"event":"MISS"},{"team":"MTL","seconds":1001,"event":"SHOT"},{"team":"MTL","seconds":1033,"event":"BLOCK"},{"team":"TOR","seconds":1105,"event":"SHOT"},{"team":"TOR","seconds":1142,"event":"BLOCK"},{"team":"TOR","seconds":1162,"event":"GOAL"},{"team":"TOR","seconds":1199,"event":"SHOT"},{"team":"MTL","seconds":1218,"event":"SHOT"},{"team":"TOR","seconds":1318,"event":"BLOCK"},{"team":"TOR","seconds":1334,"event":"MISS"},{"team":"MTL","seconds":1343,"event":"BLOCK"},{"team":"MTL","seconds":1474,"event":"GOAL"},{"team":"TOR","seconds":1512,"event":"BLOCK"},{"team":"TOR","seconds":1549,"event":"MISS"},{"team":"TOR","seconds":1555,"event":"SHOT"},{"team":"TOR","seconds":1576,"event":"SHOT"},{"team":"MTL","seconds":1588,"event":"SHOT"},{"team":"TOR","seconds":1599,"event":"BLOCK"},{"team":"TOR","seconds":1626,"event":"SHOT"},{"team":"TOR","seconds":1648,"event":"SHOT"},{"team":"MTL","seconds":1687,"event":"BLOCK"},{"team":"MTL","seconds":1713,"event":"BLOCK"},{"team":"MTL","seconds":1749,"event":"SHOT"},{"team":"TOR","seconds":1758,"event":"SHOT"},{"team":"MTL","seconds":1789,"event":"SHOT"},{"team":"MTL","seconds":1843,"event":"SHOT"},{"team":"MTL","seconds":1849,"event":"SHOT"},{"team":"MTL","seconds":1909,"event":"SHOT"},{"team":"TOR","seconds":1940,"event":"SHOT"},{"team":"MTL","seconds":1958,"event":"SHOT"},{"team":"MTL","seconds":1959,"event":"SHOT"},{"team":"MTL","seconds":1968,"event":"MISS"},{"team":"MTL","seconds":1983,"event":"SHOT"},{"team":"TOR","seconds":2035,"event":"BLOCK"},{"team":"MTL","seconds":2041,"event":"SHOT"},{"team":"MTL","seconds":2101,"event":"MISS"},{"team":"MTL","seconds":2107,"event":"MISS"},{"team":"MTL","seconds":2133,"event":"MISS"},{"team":"TOR","seconds":2228,"event":"BLOCK"},{"team":"TOR","seconds":2299,"event":"SHOT"},{"team":"TOR","seconds":2317,"event":"MISS"},{"team":"TOR","seconds":2327,"event":"BLOCK"},{"team":"TOR","seconds":2370,"event":"BLOCK"},{"team":"MTL","seconds":2396,"event":"SHOT"},{"team":"TOR","seconds":2438,"event":"BLOCK"},{"team":"TOR","seconds":2445,"event":"BLOCK"},{"team":"TOR","seconds":2453,"event":"SHOT"},{"team":"MTL","seconds":2530,"event":"BLOCK"},{"team":"MTL","seconds":2622,"event":"SHOT"},{"team":"MTL","seconds":2663,"event":"MISS"},{"team":"MTL","seconds":2671,"event":"MISS"},{"team":"MTL","seconds":2708,"event":"SHOT"},{"team":"MTL","seconds":2719,"event":"SHOT"},{"team":"MTL","seconds":2720,"event":"SHOT"},{"team":"TOR","seconds":2753,"event":"SHOT"},{"team":"TOR","seconds":2779,"event":"SHOT"},{"team":"MTL","seconds":2884,"event":"BLOCK"},{"team":"MTL","seconds":2885,"event":"MISS"},{"team":"MTL","seconds":2921,"event":"GOAL"},{"team":"TOR","seconds":2982,"event":"SHOT"},{"team":"TOR","seconds":2984,"event":"BLOCK"},{"team":"TOR","seconds":2988,"event":"BLOCK"},{"team":"TOR","seconds":3115,"event":"BLOCK"},{"team":"TOR","seconds":3139,"event":"BLOCK"},{"team":"TOR","seconds":3168,"event":"SHOT"},{"team":"MTL","seconds":3216,"event":"SHOT"},{"team":"MTL","seconds":3218,"event":"SHOT"},{"team":"MTL","seconds":3235,"event":"SHOT"},{"team":"MTL","seconds":3239,"event":"MISS"},{"team":"TOR","seconds":3278,"event":"BLOCK"},{"team":"TOR","seconds":3298,"event":"SHOT"},{"team":"MTL","seconds":3333,"event":"SHOT"},{"team":"TOR","seconds":3346,"event":"MISS"},{"team":"TOR","seconds":3355,"event":"SHOT"},{"team":"TOR","seconds":3357,"event":"MISS"},{"team":"MTL","seconds":3371,"event":"BLOCK"},{"team":"TOR","seconds":3421,"event":"MISS"},{"team":"MTL","seconds":3439,"event":"SHOT"},{"team":"TOR","seconds":3457,"event":"MISS"},{"team":"TOR","seconds":3461,"event":"GOAL"},{"team":"MTL","seconds":3467,"event":"SHOT"},{"team":"MTL","seconds":3476,"event":"SHOT"},{"team":"MTL","seconds":3557,"event":"BLOCK"},{"team":"MTL","seconds":3557,"event":"GOAL"},{"team":"TOR","seconds":3581,"event":"SHOT"},{"team":"MTL","seconds":3591,"event":"BLOCK"}] 
kevkan commented 8 years ago

The d3.js for the running tally chart (using data from my own database) is here: https://github.com/kevkan/woi-game-report-charts/blob/master/woi-game-report.html

Some updates will probably need to be made when the new WOI backend is used