summaryrefslogtreecommitdiff
path: root/src/Highlights.vue
blob: 022c23d707061e51536b3cc8d3d04530e17d9998 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<template>
  <div class="columns is-multiline">
    <div class="column">
      <talent-box class="is-dark notification"
                  title="Overpowered"
                  type="Win Rate"
                  label="%"
                  :value="Math.round(100 * stats.topWin.Winner)"
                  :entry="stats.topWin" />
    </div>

    <div class="column">
      <talent-box class="is-dark notification"
                  title="Trending"
                  type="Total Pick Rate"
                  label="%"
                  :value="(100 * 6 * stats.topPick.Count / stats.totalPicks).toFixed(2)"
                  :entry="stats.topPick" />
    </div>

    <div class="column">
      <talent-box class="is-dark notification"
                  title="Highest Level"
                  type="Average Level"
                  :value="stats.highestLevelAvg.Level.toFixed(2)"
                  :entry="stats.highestLevelAvg" />
    </div>

    <div class="column">
      <talent-box class="is-dark notification"
                  title="Lowest Level"
                  type="Average Level"
                  :value="stats.lowestLevelAvg.Level.toFixed(2)"
                  :entry="stats.lowestLevelAvg" />
    </div>
  </div>
</template>

<script>
import Vue from 'vue';
import TalentBox from './TalentBox.vue';

export default Vue.component('highlights', {
  props: [ 'reportService' ],
  computed: {
    selectedMode: {
      get: function() {
        return this.$route.query.mode;
      },
    },
    stats: function() {
      return {
        topWin: this.reportService.getTopWin(this.selectedMode),
        topPick: this.reportService.getTopPick(this.selectedMode),
        totalPicks: this.reportService.getTotalPicks(this.selectedMode),
        highestLevelAvg: this.reportService.getHighestLevelAvg(this.selectedMode),
        lowestLevelAvg: this.reportService.getLowestLevelAvg(this.selectedMode),
      };
    },
  },
  components: {
    TalentBox,
  },
});
</script>