summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2018-07-24 21:47:50 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2018-12-13 17:09:33 +0100
commitb3bfa59817505347148c11f6d96ad0d492d6df1c (patch)
treec3ac72da37f9400f004c254adcf499cb88837ae4 /src
parentb4841a1a73be0735d1395c4539506cb58d8ba285 (diff)
downloadbrokentalents-b3bfa59817505347148c11f6d96ad0d492d6df1c.tar.gz
brokentalents-b3bfa59817505347148c11f6d96ad0d492d6df1c.zip
Add Summaries card for Talents (ctd.)
automatic build
Diffstat (limited to 'src')
-rw-r--r--src/Summaries.vue58
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>