-
-
Performance Charts
-
- Rating trends, map performance, favorite weapons, and more visualization coming soon.
-
-
Coming in Future Update
+
+ {#if playerStats.length > 0}
+
+
Performance Analysis
+
+
+
+
+
+
+ Performance Trend (Last {playerStats.length} Matches)
+
+
+
+
+
+
+ Shows K/D ratio and KAST percentage across recent matches. Higher is better.
+
+
+
+
+
+
+
+
+ Map Win Rate
+
+
+
+
+
+
+ Win rate percentage by map. Green = strong (≥60%), Blue = average (40-60%), Red = weak
+ (<40%).
+
+
+
-
+
+
+
+
Utility Effectiveness
+
+
+
+
+ Flash Assists
+
+ {utilityStats.flashAssists}
+
+ {(utilityStats.flashAssists / utilityStats.totalMatches).toFixed(1)} per match
+
+
+
+
+
+
+ Enemies Blinded
+
+ {utilityStats.enemiesBlinded}
+
+ {(utilityStats.enemiesBlinded / utilityStats.totalMatches).toFixed(1)} per match
+
+
+
+
+
+
+ HE Damage
+
+
+ {Math.round(utilityStats.heDamage)}
+
+
+ {Math.round(utilityStats.heDamage / utilityStats.totalMatches)} per match
+
+
+
+
+
+
+ Flame Damage
+
+
+ {Math.round(utilityStats.flameDamage)}
+
+
+ {Math.round(utilityStats.flameDamage / utilityStats.totalMatches)} per match
+
+
+
+
+ {/if}
diff --git a/src/routes/player/[id]/+page.ts b/src/routes/player/[id]/+page.ts
index 0da27b8..d863f72 100644
--- a/src/routes/player/[id]/+page.ts
+++ b/src/routes/player/[id]/+page.ts
@@ -13,19 +13,50 @@ export const load: PageLoad = async ({ params }) => {
// Fetch player profile and recent matches in parallel
const [profile, matchesData] = await Promise.all([
api.players.getPlayerMeta(playerId),
- api.matches.getMatches({ player_id: playerId, limit: 10 })
+ api.matches.getMatches({ player_id: playerId, limit: 20 })
]);
+ // Fetch full match details with player stats for performance charts
+ // Limit to first 15 matches to avoid too many API calls
+ const matchDetailsPromises = matchesData.matches
+ .slice(0, 15)
+ .map((match) => api.matches.getMatch(match.match_id));
+
+ const matchesWithDetails = await Promise.all(matchDetailsPromises);
+
+ // Extract player stats from each match
+ const playerStats = matchesWithDetails
+ .map((match) => {
+ const playerData = match.players?.find((p) => p.id === playerId);
+ if (!playerData) return null;
+
+ return {
+ match_id: match.match_id,
+ map: match.map,
+ date: match.date,
+ ...playerData,
+ // Add match result (did player win?)
+ won:
+ (playerData.team_id === 2 && match.score_team_a > match.score_team_b) ||
+ (playerData.team_id === 3 && match.score_team_b > match.score_team_a)
+ };
+ })
+ .filter((stat): stat is NonNullable