From 82059bb454cf7bf1349326891dfebe837c8dfec8 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 3 Dec 2024 16:32:11 -0800 Subject: [PATCH] feat: add color-coded legend to chart for model types --- aider/website/_includes/qwq-chart.js | 45 +++++++++++++++++----------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/aider/website/_includes/qwq-chart.js b/aider/website/_includes/qwq-chart.js index 7737c1bc5..97c2bb3b0 100644 --- a/aider/website/_includes/qwq-chart.js +++ b/aider/website/_includes/qwq-chart.js @@ -20,23 +20,26 @@ document.addEventListener('DOMContentLoaded', function () { var chartData = { labels: filteredData.map(row => row.model), - datasets: [{ - label: 'Percent completed correctly', - data: filteredData.map(row => row.pass_rate_2), - backgroundColor: filteredData.map(row => { - if (row.model === 'Qwen2.5 Coder 32B Instruct' || row.model === 'Sonnet (SOTA)') { - return 'rgba(75, 192, 192, 0.2)'; // Green color for both - } - return 'rgba(54, 162, 235, 0.2)'; // Default blue - }), - borderColor: filteredData.map(row => { - if (row.model === 'Qwen2.5 Coder 32B Instruct' || row.model === 'Sonnet (SOTA)') { - return 'rgba(75, 192, 192, 1)'; // Green border for both - } - return 'rgba(54, 162, 235, 1)'; // Default blue border - }), - borderWidth: 1 - }] + datasets: [ + { + label: 'Solo model', + data: filteredData.map(row => + (row.model === 'Qwen2.5 Coder 32B Instruct' || row.model === 'Sonnet (SOTA)') ? row.pass_rate_2 : null + ), + backgroundColor: 'rgba(75, 192, 192, 0.2)', // Green + borderColor: 'rgba(75, 192, 192, 1)', + borderWidth: 1 + }, + { + label: 'Architect + Editor', + data: filteredData.map(row => + (row.model !== 'Qwen2.5 Coder 32B Instruct' && row.model !== 'Sonnet (SOTA)') ? row.pass_rate_2 : null + ), + backgroundColor: 'rgba(54, 162, 235, 0.2)', // Blue + borderColor: 'rgba(54, 162, 235, 1)', + borderWidth: 1 + } + ] }; if (chart) { @@ -49,7 +52,13 @@ document.addEventListener('DOMContentLoaded', function () { options: { plugins: { legend: { - display: false + display: true, + position: 'top', + labels: { + font: { + size: 14 + } + } }, title: { display: true,