Skip to content
This repository was archived by the owner on Jul 6, 2020. It is now read-only.

Option to change Leaderboard precision value added #290

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,37 @@
class="fw-regular result-wrn">No phase selected.</div>
<div *ngIf="leaderboard.length > 0 && selectedPhaseSplit"
class="result-wrn content">
<mat-chip-list>
<table>
<tbody>
<tr>
<td id="submissionHeader">
<mat-chip>B</mat-chip> - Baseline submission
</td>
<td>
<div id = "precision_value">
Precision value:
<input type="text" [(ngModel)]="leaderbord_decimal_precision_value"/>
</div>
</td>

<td id = "leaderboard_button">
<div (click)="showLeaderboardByLatestOrBest()" class="btn-switch sort-leaderboard-switch" [ngClass]="{'btn-switch--on':showLeaderboardByLatest}"
[(ngModel)]="showLeaderboardByLatest" ngDefaultControl>
<!-- <mat-chip-list>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove the commented lines from here?

<mat-chip>B</mat-chip> - Baseline submission
</mat-chip-list>
<mat-chip-list class="pull-right" *ngIf="isChallengeHost">
<div (click)="showLeaderboardByLatestOrBest()" class="btn-switch sort-leaderboard-switch" [ngClass]="{'btn-switch--on':showLeaderboardByLatest}"
[(ngModel)]="showLeaderboardByLatest" ngDefaultControl>
[(ngModel)]="showLeaderboardByLatest" ngDefaultControl> -->
<div class="btn-switch-circle" [ngClass]="{'btn-switch--on':showLeaderboardByLatest}"
[(ngModel)]="showLeaderboardByLatest" ngDefaultControl></div>
</div>
<span class="w-400"> {{sortLeaderboardTextOption}}</span>
</mat-chip-list>
<!-- </mat-chip-list> -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here also

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Copy link
Member

@Kajol-Kumari Kajol-Kumari Feb 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Abhi58 Now you need to change here https://github.com/Cloud-CV/EvalAI-ngx/blob/master/src/app/components/challenge/challengeleaderboard/challengeleaderboard.component.html#L114 and that value that is currently hardcoded should be changed according to the value selected via the slider.

</td>
</tr>
</tbody>
</table>
</div>

<table *ngIf="leaderboard.length > 0 && selectedPhaseSplit" class="centered highlight">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,17 @@
vertical-align: middle;
display: inline-block;
}

#submissionHeader {
float: left;
}

#precision_value {
white-space: nowrap;
padding-left: 54%;
padding-right: 39%;
}

#leaderboard_button {
float: right;
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ export class ChallengeleaderboardComponent implements OnInit, AfterViewInit {
*/
leaderboard = [];

/**
* Leaderboard precision value
*/
leaderbord_decimal_precision_value = 2;

/**
* Show leaderboard updates
*/
Expand Down Expand Up @@ -454,4 +459,15 @@ export class ChallengeleaderboardComponent implements OnInit, AfterViewInit {
() => {}
);
}

/**
* getPrecisionValue
*/
public getPrecisionValue(num) {
if (num === '') {
return '1.2-2';
} else {
return '1.' + num + '-' + num;
}
}
}