Skip to content

Commit 3847d32

Browse files
committed
Updated stats and formula for SLG corrected.
1 parent 48fea9f commit 3847d32

3 files changed

Lines changed: 54 additions & 53 deletions

File tree

public/data/2025/matches.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@
120120
"stats": true
121121
},
122122
{
123-
"outcome": "FIXTURE",
123+
"outcome": "WIN",
124124
"place": "HOME",
125125
"date": "2025-07-23",
126126
"opposition": "Speeders",
127-
"result": "",
128-
"mvp": "",
127+
"result": "13 - 18",
128+
"mvp": "Ella & Millsy",
129129
"pitch": "G",
130-
"stats": false
130+
"stats": true
131131
},
132132
{
133133
"outcome": "FIXTURE",

public/data/2025/players.json

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"team": "Hackers",
2121
"gender": "male",
2222
"stats": {
23-
"atBat": 26,
24-
"walks": 1,
25-
"runsBattedIn": 19,
23+
"atBat": 30,
24+
"walks": 2,
25+
"runsBattedIn": 24,
2626
"firstBase": 9,
27-
"secondBase": 6,
27+
"secondBase": 7,
2828
"thirdBase": 4,
29-
"homeRuns": 4,
29+
"homeRuns": 6,
3030
"catches": 12,
3131
"mvp": 4
3232
}
@@ -36,14 +36,14 @@
3636
"team": "Hackers",
3737
"gender": "female",
3838
"stats": {
39-
"atBat": 49,
39+
"atBat": 53,
4040
"walks": 2,
41-
"runsBattedIn": 13,
42-
"firstBase": 18,
41+
"runsBattedIn": 14,
42+
"firstBase": 19,
4343
"secondBase": 4,
4444
"thirdBase": 1,
4545
"homeRuns": 0,
46-
"catches": 4,
46+
"catches": 5,
4747
"mvp": 4
4848
}
4949
},
@@ -52,11 +52,11 @@
5252
"team": "Hackers",
5353
"gender": "male",
5454
"stats": {
55-
"atBat": 40,
55+
"atBat": 41,
5656
"walks": 0,
5757
"runsBattedIn": 19,
5858
"firstBase": 14,
59-
"secondBase": 7,
59+
"secondBase": 8,
6060
"thirdBase": 2,
6161
"homeRuns": 4,
6262
"catches": 6,
@@ -68,14 +68,14 @@
6868
"team": "Hackers",
6969
"gender": "male",
7070
"stats": {
71-
"atBat": 20,
71+
"atBat": 24,
7272
"walks": 0,
73-
"runsBattedIn": 14,
73+
"runsBattedIn": 15,
7474
"firstBase": 7,
7575
"secondBase": 2,
7676
"thirdBase": 0,
77-
"homeRuns": 3,
78-
"catches": 2,
77+
"homeRuns": 4,
78+
"catches": 5,
7979
"mvp": 2
8080
}
8181
},
@@ -84,15 +84,15 @@
8484
"team": "Hackers",
8585
"gender": "female",
8686
"stats": {
87-
"atBat": 40,
87+
"atBat": 45,
8888
"walks": 0,
89-
"runsBattedIn": 16,
90-
"firstBase": 21,
89+
"runsBattedIn": 19,
90+
"firstBase": 24,
9191
"secondBase": 3,
92-
"thirdBase": 1,
92+
"thirdBase": 2,
9393
"homeRuns": 0,
94-
"catches": 5,
95-
"mvp": 3
94+
"catches": 7,
95+
"mvp": 4
9696
}
9797
},
9898
{
@@ -116,14 +116,14 @@
116116
"team": "Hackers",
117117
"gender": "female",
118118
"stats": {
119-
"atBat": 45,
119+
"atBat": 50,
120120
"walks": 1,
121-
"runsBattedIn": 12,
122-
"firstBase": 10,
121+
"runsBattedIn": 13,
122+
"firstBase": 13,
123123
"secondBase": 8,
124124
"thirdBase": 0,
125125
"homeRuns": 2,
126-
"catches": 19,
126+
"catches": 21,
127127
"mvp": 3
128128
}
129129
},
@@ -148,30 +148,30 @@
148148
"team": "Hackers",
149149
"gender": "male",
150150
"stats": {
151-
"atBat": 17,
151+
"atBat": 20,
152152
"walks": 0,
153-
"runsBattedIn": 4,
154-
"firstBase": 5,
155-
"secondBase": 4,
156-
"thirdBase": 1,
153+
"runsBattedIn": 6,
154+
"firstBase": 6,
155+
"secondBase": 5,
156+
"thirdBase": 2,
157157
"homeRuns": 0,
158-
"catches": 2,
159-
"mvp": 0
158+
"catches": 3,
159+
"mvp": 1
160160
}
161161
},
162162
{
163163
"name": "Jack",
164164
"team": "Hackers",
165165
"gender": "male",
166166
"stats": {
167-
"atBat": 51,
167+
"atBat": 56,
168168
"walks": 0,
169-
"runsBattedIn": 25,
170-
"firstBase": 22,
171-
"secondBase": 9,
169+
"runsBattedIn": 29,
170+
"firstBase": 24,
171+
"secondBase": 10,
172172
"thirdBase": 1,
173-
"homeRuns": 2,
174-
"catches": 16,
173+
"homeRuns": 3,
174+
"catches": 18,
175175
"mvp": 2
176176
}
177177
},
@@ -180,14 +180,14 @@
180180
"team": "Hackers",
181181
"gender": "male",
182182
"stats": {
183-
"atBat": 26,
184-
"walks": 2,
185-
"runsBattedIn": 3,
186-
"firstBase": 10,
183+
"atBat": 30,
184+
"walks": 3,
185+
"runsBattedIn": 4,
186+
"firstBase": 12,
187187
"secondBase": 2,
188188
"thirdBase": 0,
189189
"homeRuns": 0,
190-
"catches": 2,
190+
"catches": 3,
191191
"mvp": 0
192192
}
193193
},
@@ -212,10 +212,10 @@
212212
"team": "Hackers",
213213
"gender": "female",
214214
"stats": {
215-
"atBat": 30,
215+
"atBat": 34,
216216
"walks": 0,
217-
"runsBattedIn": 5,
218-
"firstBase": 14,
217+
"runsBattedIn": 6,
218+
"firstBase": 15,
219219
"secondBase": 2,
220220
"thirdBase": 0,
221221
"homeRuns": 0,
@@ -228,8 +228,8 @@
228228
"team": "Hackers",
229229
"gender": "female",
230230
"stats": {
231-
"atBat": 41,
232-
"walks": 0,
231+
"atBat": 45,
232+
"walks": 1,
233233
"runsBattedIn": 9,
234234
"firstBase": 9,
235235
"secondBase": 2,

src/components/Statistics.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,14 @@ const playerStats = computed(() => {
177177
const hits = value.stats.walks + value.stats.firstBase + value.stats.secondBase + value.stats.thirdBase + value.stats.homeRuns;
178178
const slugPoints = value.stats.firstBase + (value.stats.secondBase * 2) + (value.stats.thirdBase * 3) + (value.stats.homeRuns * 4);
179179
const atBat = value.stats.atBat;
180+
const atBatNoWalks = value.stats.atBat - value.stats.walks;
180181
181182
return {
182183
...value,
183184
stats: {
184185
...value.stats,
185186
hits,
186-
slg: atBat === 0 ? 0 : (slugPoints / atBat).toFixed(3),
187+
slg: atBat === 0 ? 0 : (slugPoints / atBatNoWalks).toFixed(3),
187188
avg: atBat === 0 ? 0 : (hits / atBat).toFixed(3)
188189
}
189190
}

0 commit comments

Comments
 (0)