Skip to content
Permalink
Browse files

hide irrelevant colors when filled

  • Loading branch information...
Manuel-777 committed Feb 10, 2019
1 parent 9a70c34 commit 5c5f7dbd8641eea1cc1e335e0cf90b3453854df3
Showing with 1 addition and 2 deletions.
  1. +1 −2 window_main/deck_details.js
@@ -90,7 +90,6 @@ function colorPieChart(colorCounts, title) {
}

function deckWinrateCurve(deck) {

// getDeckWinrate returns
// {total: winrate, wins: wins, losses: loss, lastEdit: winrateLastEdit, colors: colorsWinrates};
// or 0 if there is no data
@@ -111,7 +110,7 @@ function deckWinrateCurve(deck) {
let numbers = $('<div class="mana_curve_costs"></div>');

colorsWinrates.forEach(cwr => {
if (cwr.wins + cwr.losses > 1) {
if ((colorsWinrates.length < 15) || (cwr.wins + cwr.losses > 1 && colorsWinrates.length > 15)) {
curve.append($(`<div class="mana_curve_column back_green" style="height: ${(cwr.wins/curveMax*100)}%"></div>`));
curve.append($(`<div class="mana_curve_column back_red" style="height: ${(cwr.losses/curveMax*100)}%"></div>`));

0 comments on commit 5c5f7db

Please sign in to comment.
You can’t perform that action at this time.