From 2605d44db63c5b7bc3ba9e0a39676103ca02db3a Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 12 Sep 2024 15:10:32 -0700 Subject: [PATCH] feat: Add different colors for 'whole' and 'diff' edit formats in leaderboard graph --- aider/website/_includes/leaderboard_graph.html | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/aider/website/_includes/leaderboard_graph.html b/aider/website/_includes/leaderboard_graph.html index a6137b5ef..9e202a093 100644 --- a/aider/website/_includes/leaderboard_graph.html +++ b/aider/website/_includes/leaderboard_graph.html @@ -7,8 +7,8 @@ datasets: [{ label: 'Percent completed correctly', data: [], - backgroundColor: 'rgba(54, 162, 235, 0.2)', - borderColor: 'rgba(54, 162, 235, 1)', + backgroundColor: [], + borderColor: [], borderWidth: 1 }] }; @@ -18,7 +18,8 @@ allData.push({ model: '{{ row.model }}', pass_rate: {{ row[include.pass_rate_key] }}, - percent_cases_well_formed: {{ row.percent_cases_well_formed }} + percent_cases_well_formed: {{ row.percent_cases_well_formed }}, + edit_format: '{{ row.edit_format }}' }); {% endfor %} @@ -28,6 +29,8 @@ leaderboardData.labels = []; leaderboardData.datasets[0].data = []; + leaderboardData.datasets[0].backgroundColor = []; + leaderboardData.datasets[0].borderColor = []; allData.forEach(function(row, index) { var rowElement = document.getElementById('{{ include.row_prefix }}-' + index); @@ -37,6 +40,14 @@ if (showAll || rowElement.classList.contains('selected')) { leaderboardData.labels.push(row.model); leaderboardData.datasets[0].data.push(row.pass_rate); + + if (row.edit_format === 'whole') { + leaderboardData.datasets[0].backgroundColor.push('rgba(255, 99, 132, 0.2)'); + leaderboardData.datasets[0].borderColor.push('rgba(255, 99, 132, 1)'); + } else { + leaderboardData.datasets[0].backgroundColor.push('rgba(54, 162, 235, 0.2)'); + leaderboardData.datasets[0].borderColor.push('rgba(54, 162, 235, 1)'); + } } });