diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2018-07-20 17:09:23 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2018-12-13 17:09:32 +0100 |
| commit | a9a468bd18f56924affe51188a857c5595fc858d (patch) | |
| tree | fc6908227c37be9a3a3cfc34768d614e30c6e795 /src | |
| parent | baf2f9ee1ff66783c39b510c8ab3ac3f4a80a3f9 (diff) | |
| download | brokentalents-a9a468bd18f56924affe51188a857c5595fc858d.tar.gz brokentalents-a9a468bd18f56924affe51188a857c5595fc858d.zip | |
Fix Wrong pick/win rates being calculated in different places
Diffstat (limited to 'src')
| -rw-r--r-- | src/HeroTalentTable.vue | 10 | ||||
| -rw-r--r-- | src/Highlights.vue | 4 | ||||
| -rw-r--r-- | src/TopTalentsBox.vue | 4 |
3 files changed, 9 insertions, 9 deletions
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 @@ <div class="column is-one-quarter"> <hero-image :actor="selectedActor" class="is-64x64"></hero-image> </div> - <div class="column has-text-centered">{{ (100 * totalHeroReport.Winner / totalHeroReport.Count).toFixed(0) }}% Win Rate</div> - <div class="column has-text-centered">{{ (100 * totalHeroReport.Count / totalPicks * playersPerMatch).toFixed(0) }}% Pick Rate</div> + <div class="column has-text-centered">{{ (100 * totalHeroReport.TotalWinner / totalHeroReport.TotalPicks).toFixed(0) }}% Win Rate</div> + <div class="column has-text-centered">{{ (100 * totalHeroReport.TotalPicks / totalPicks * playersPerMatch).toFixed(0) }}% Pick Rate</div> </div> <b-table v-show="hasTalents" @@ -74,10 +74,10 @@ export default Vue.component('hero-talent-table', { }, totalHeroReport: function() { return this.heroReport - .map((entry) => ({ '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" /> </div> @@ -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" /> </div> 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 @@ <span>{{ Math.round(100 * playersPerMatch * props.row.Count / totalPicks) }}%</span> </b-table-column> - <b-table-column field="Winner" label="Win Rate" sortable numeric> - <span>{{ Math.round(100 * props.row.Winner) }}%</span> + <b-table-column field="TotalWinner" label="Win Rate" sortable numeric> + <span>{{ Math.round(100 * props.row.TotalWinner) }}%</span> </b-table-column> </template> </b-table> |
