From 24805ff85d85537e33402dcef0c3f4db3270df78 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 14 Apr 2025 22:02:11 -0700 Subject: [PATCH] fix: Use $10 increments for cost ticks in leaderboard table --- aider/website/_includes/leaderboard_table.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/aider/website/_includes/leaderboard_table.js b/aider/website/_includes/leaderboard_table.js index 665ee7d69..ff7b13f0f 100644 --- a/aider/website/_includes/leaderboard_table.js +++ b/aider/website/_includes/leaderboard_table.js @@ -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