From a9a468bd18f56924affe51188a857c5595fc858d Mon Sep 17 00:00:00 2001 From: schneefux Date: Fri, 20 Jul 2018 17:09:23 +0200 Subject: Fix Wrong pick/win rates being calculated in different places --- src/HeroTalentTable.vue | 10 +++++----- src/Highlights.vue | 4 ++-- src/TopTalentsBox.vue | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/HeroTalentTable.vue b/src/HeroTalentTable.vue index ec0a7be..77d868c 100644 --- a/src/HeroTalentTable.vue +++ b/src/HeroTalentTable.vue @@ -4,8 +4,8 @@
-
{{ (100 * totalHeroReport.Winner / totalHeroReport.Count).toFixed(0) }}% Win Rate
-
{{ (100 * totalHeroReport.Count / totalPicks * playersPerMatch).toFixed(0) }}% Pick Rate
+
{{ (100 * totalHeroReport.TotalWinner / totalHeroReport.TotalPicks).toFixed(0) }}% Win Rate
+
{{ (100 * totalHeroReport.TotalPicks / totalPicks * playersPerMatch).toFixed(0) }}% Pick Rate
({ 'Winner': entry.Count * entry.Winner, 'Count': entry.Count })) + .map((entry) => ({ 'TotalWinner': entry.TotalPicks * entry.TotalWinner, 'TotalPicks': entry.TotalPicks })) .reduce((agg, cur) => - ({ 'Winner': agg.Winner + cur.Winner, 'Count': agg.Count + cur.Count }), - { 'Winner': 0, 'Count': 0 }); + ({ 'TotalWinner': agg.TotalWinner + cur.TotalWinner, 'TotalPicks': agg.TotalPicks + cur.TotalPicks }), + { 'TotalWinner': 0, 'TotalPicks': 0 }); }, playersPerMatch: function() { return maps.playersPerMatch(this.selectedMode); diff --git a/src/Highlights.vue b/src/Highlights.vue index 7b2c375..0b3be87 100644 --- a/src/Highlights.vue +++ b/src/Highlights.vue @@ -14,7 +14,7 @@ title="Trending" type="Total Pick Rate" label="%" - :value="(100 * playersPerMatch * stats.topPick.Count / stats.totalPicks).toFixed(2)" + :value="(100 * playersPerMatch * stats.topPick.TotalPicks / stats.totalPicks).toFixed(2)" :entry="stats.topPick" /> @@ -23,7 +23,7 @@ title="Beginner" type="Level 1 Win Rate" label="%" - :value="Math.round(100 * stats.topLowLevel.Winner)" + :value="Math.round(100 * stats.topLowLevel.TalentWinrateBase)" :entry="stats.topLowLevel" /> diff --git a/src/TopTalentsBox.vue b/src/TopTalentsBox.vue index 88d5fb7..fdda6c3 100644 --- a/src/TopTalentsBox.vue +++ b/src/TopTalentsBox.vue @@ -18,8 +18,8 @@ {{ Math.round(100 * playersPerMatch * props.row.Count / totalPicks) }}% - - {{ Math.round(100 * props.row.Winner) }}% + + {{ Math.round(100 * props.row.TotalWinner) }}% -- cgit v1.3.1