0.5.4 • Published 8 years ago

podyum-stats-converter v0.5.4

Weekly downloads
2
License
ISC
Repository
gitlab
Last release
8 years ago

podyum-stats-converter

Converting game stats that are event-centric into the player centric format.

Usage

var statisticsConverter = require('podyum-stats-converter');

var actions; // event-centric json
var fieldLength; // field length in meters (integer)

var playerCentricJson = statisticsConverter.convert(actions, fieldLength);

event-centric vs. player-centric formats

Event-centric game statistics json format:

"actions": [
    {
        "defensive_team_id": <def_team_id>,
        "quarter": <quarter>,
        "offensive_team_id": <off_team_id>,
        "events": [
            {
                "ball_start_position": {
                    "on_offensive_side": true,
                   "yard": 50
                },
                "down_number": 1,
                "type": "Scrimmage",
                "distance": 10
            },
            {
                "type": "Pass",
                "ball_position": {
                    "on_offensive_side": fakse,
                    "yard": 50
                },
                "player_id": <player_id>
            }
        ]
    }
]

Player-centric game statistics json format:

{
    "player_id_1": { 
        "fumble_recovered": 3, 
        "rushing_yards": 21, 
        "tackles": 2, 
        "fumbles": 1 
    },
    "player_id_2": { 
        "kickoff_attempts": 2, 
        "kickoff_touchbacks": 2 
    }
}
0.5.4

8 years ago

0.5.3

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago