diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Summaries.vue | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/Summaries.vue b/src/Summaries.vue new file mode 100644 index 0000000..cc20fb8 --- /dev/null +++ b/src/Summaries.vue @@ -0,0 +1,58 @@ +<template> + <b-table :data="talentSummaries" + :mobile-cards="false"> + <template slot-scope="props"> + <template slot-scope="props" slot="header"> + <b-tooltip :active="!!props.column.meta" :label="props.column.meta || ''" position="is-bottom" dashed> + {{ props.column.label }} + </b-tooltip> + </template> + + <b-table-column field="Rarity" label="Rarity"> + {{ props.row.Rarity }} + </b-table-column> + + <b-table-column field="TotalWinner" label="Win Rate" sortable numeric> + {{ (100 * props.row.TotalWinner / props.row._Count).toFixed(2) }}% + </b-table-column> + + <b-table-column field="TalentWinrateBase" label="Level 1 Win Rate" meta="Estimated." sortable numeric> + {{ (100 * props.row.TalentWinrateBase / props.row._Count).toFixed(2) }}% + </b-table-column> + + <b-table-column field="TalentWinrateMax" label="Max Level Win Rate" meta="Estimated." sortable numeric> + {{ (100 * props.row.TalentWinrateMax / props.row._Count).toFixed(2) }}% + </b-table-column> + + <b-table-column field="TotalPicks" label="Pick Rate" sortable numeric> + {{ (100 * props.row.TotalPicks / totalPicks).toFixed(2) }}% + </b-table-column> + </template> + </b-table> +</template> + +<script> +import Vue from 'vue'; +import RouterParamMixin from './RouterParamMixin'; +import ReportService from './ReportService'; +import * as maps from './maps/maps'; + +export default Vue.component('summaries', { + mixins: [ RouterParamMixin ], + data: function() { + return { + }; + }, + computed: { + talentSummaries: function() { + return [...ReportService.getSummaryTalents(this.selectedMode).values()] + .sort((entry1, entry2) => maps.getTalentRarityIndex(entry1.Talent) - maps.getTalentRarityIndex(entry2.Talent)); + }, + totalPicks: function() { + return this.talentSummaries.map((entry) => entry.TotalPicks).reduce((agg, cur) => agg + cur, 0); + }, + }, + components: { + }, +}); +</script> |
