nuevas metricas agregadas

This commit is contained in:
2025-08-27 23:05:02 -06:00
parent 293f407820
commit ffd97646ab
2 changed files with 173 additions and 8 deletions

View File

@@ -160,6 +160,17 @@ const ratioGroups = [
name: 'Denuncias',
actions: ['p1_report', 'p1_no_report'],
labels: ['Denunciar', 'No Denunciar']
},
{
name: 'Puntuaciones',
actions: ['score_p1', 'score_p2'],
labels: ['P1', 'P2']
},
{
name: 'Jugadores',
actions: ['players_with_shame', 'players_seated'],
labels: ['Con vergüenza', 'Sin vergüenza'],
isCustomRatio: true // Special handling needed
}
];
@@ -170,7 +181,16 @@ const ratioData = computed(() => {
? props.playerEventCounts
: props.globalEventCounts;
const values = group.actions.map(action => counts[action] || 0);
let values = group.actions.map(action => counts[action] || 0);
// Special handling for players ratio (shame vs no shame)
if (group.isCustomRatio && group.name === 'Jugadores') {
const playersWithShame = counts['players_with_shame'] || 0;
const totalPlayersSeated = counts['players_seated'] || 0;
const playersWithoutShame = Math.max(0, totalPlayersSeated - playersWithShame);
values = [playersWithShame, playersWithoutShame];
}
const total = values.reduce((sum, val) => sum + val, 0);
return {