summaryrefslogtreecommitdiff
path: root/src/HeroTalentTable.vue
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2018-06-16 20:47:59 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2018-12-13 17:09:20 +0100
commita8135ad40cbeb6c0c464d57010032dc033993439 (patch)
treee9bf2c11e277b7b60bb58ab37818c0eb1c998574 /src/HeroTalentTable.vue
parent37fda8b8f9d7a6cf812478cdcfb46a32b8e9d259 (diff)
downloadbrokentalents-a8135ad40cbeb6c0c464d57010032dc033993439.tar.gz
brokentalents-a8135ad40cbeb6c0c464d57010032dc033993439.zip
Calculate and show level scaling
Diffstat (limited to 'src/HeroTalentTable.vue')
-rw-r--r--src/HeroTalentTable.vue29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/HeroTalentTable.vue b/src/HeroTalentTable.vue
index 0e4509b..5c3545b 100644
--- a/src/HeroTalentTable.vue
+++ b/src/HeroTalentTable.vue
@@ -8,18 +8,27 @@
:mobile-cards="false">
<template slot-scope="props">
<b-table-column field="Talent" label="Talent">
- <div style="display: flex; align-items: center; justify-content: space-between;">
- <span>{{ getTalentName(props.row.Talent) }}</span>
- <talent-image :entry="props.row" :size="48"></talent-image>
- </div>
+ <talent-image :entry="props.row" :size="48"></talent-image>
</b-table-column>
- <b-table-column field="Winner" label="Win Rate" sortable numeric>
- <span class="tag is-warning mdi mdi-gauge-empty mdi-18px"
- title="Very low pick rate"
- v-if="100 * playersPerMatch * props.row.Count / totalPicks < 0.5"></span>
- {{ Math.round(100 * props.row.Winner) }}%
+ <b-table-column field="Winner" label="Level 1 Win Rate" sortable numeric>
+ <template v-if="isNaN(props.row.TalentWinrateBase)">
+ {{ (100 * props.row.Winner).toFixed(2) }}%
+ </template>
+ <template v-else>
+ {{ (100 * props.row.TalentWinrateBase).toFixed(2) }}%
+ </template>
</b-table-column>
+
+ <b-table-column field="TalentWinrateScaling" label="Win Rate Advantage" sortable numeric>
+ <template v-if="isNaN(props.row.TalentWinrateScaling) || props.row.SampleTooSmall">
+ <span class="mdi mdi-gauge-empty mdi-18px" title="Not enough data"></span>
+ </template>
+ <template v-else>
+ {{ (props.row.TalentWinrateScaling > 0? '+' : '') + (100 * props.row.TalentWinrateScaling / getLevelBuckets()).toFixed(2) }}% <small>for {{ getLevelsPerBucket(props.row) + (getLevelsPerBucket(props.row) > 1? ' Levels' : ' Level') }}</small>
+ </template>
+ </b-table-column>
+
</template>
</b-table>
</div>
@@ -38,6 +47,8 @@ export default Vue.component('hero-talent-table', {
data: function() {
return {
getTalentName: maps.getTalentName,
+ getLevelBuckets: ReportService.getLevelBuckets,
+ getLevelsPerBucket: (entry) => maps.getMaxLevel(entry) / this.getLevelBuckets(),
};
},
computed: {