mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
fix: Use $10 increments for cost ticks in leaderboard table
This commit is contained in:
parent
8b917d5716
commit
24805ff85d
1 changed files with 5 additions and 9 deletions
|
@ -315,15 +315,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
// Generate appropriate tick values based on current max
|
||||
let tickValues = [];
|
||||
|
||||
if (currentMaxDisplayCost === 50) {
|
||||
// Fixed ticks at $0, $10, $20, $30, $40, $50 when we're at the cap
|
||||
tickValues = [0, 10, 20, 30, 40, 50];
|
||||
} else {
|
||||
// Dynamic ticks based on actual max
|
||||
const tickCount = 5; // Create 5 segments (6 ticks including 0)
|
||||
for (let i = 0; i <= tickCount; i++) {
|
||||
tickValues.push(Math.round((i / tickCount) * currentMaxDisplayCost * 100) / 100);
|
||||
}
|
||||
// Always use $10 increments, regardless of the max
|
||||
const maxTickValue = Math.ceil(currentMaxDisplayCost / 10) * 10; // Round up to nearest $10
|
||||
|
||||
for (let i = 0; i <= maxTickValue; i += 10) {
|
||||
tickValues.push(i);
|
||||
}
|
||||
|
||||
// Calculate percentage positions for each tick
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue