blame

document.addEventListener('DOMContentLoaded', function () { var blameCtx = document.getElementById('blameChart').getContext('2d'); var linesCtx = document.getElementById('linesChart').getContext('2d'); var labels = [<div data-gb-custom-block data-tag="for">'{{ row.end_tag }}',</div>]; var blameData = { labels: labels, datasets: [{ label: 'Aider\'s percent of new code by release', data: [<div data-gb-custom-block data-tag="for">{ x: '{{ row.end_tag }}', y: {{ row.aider_percentage }}, lines: {{ row.aider_total }} },</div>], backgroundColor: 'rgba(54, 162, 235, 0.8)', borderColor: 'rgba(54, 162, 235, 1)', borderWidth: 1 }] }; var linesData = { labels: labels, datasets: [{ label: 'Aider\'s lines of new code', data: [<div data-gb-custom-block data-tag="for">{ x: '{{ row.end_tag }}', y: {{ row.aider_total }} },</div>], backgroundColor: 'rgba(255, 99, 132, 0.8)', borderColor: 'rgba(255, 99, 132, 1)', borderWidth: 1 }] }; var blameChart = new Chart(blameCtx, { type: 'bar', data: blameData, options: { scales: { x: { type: 'category', title: { display: true, text: 'Version' }, ticks: { maxRotation: 45, minRotation: 45 } }, y: { title: { display: true, text: 'Percent of new code' }, beginAtZero: true } }, plugins: { legend: { display: false }, tooltip: { callbacks: { label: function(context) { var label = 'Aider\'s contribution'; var value = context.parsed.y || 0; var lines = context.raw.lines || 0; return `${label}: ${Math.round(value)}% (${lines} lines)`; } } }, title: { display: true, text: 'Percent of new code written by aider, by release', font: { size: 16 } } } } }); var linesChart = new Chart(linesCtx, { type: 'bar', data: linesData, options: { scales: { x: { type: 'category', title: { display: true, text: 'Version' }, ticks: { maxRotation: 45, minRotation: 45 } }, y: { title: { display: true, text: 'Lines of new code' }, beginAtZero: true } }, plugins: { legend: { display: false }, tooltip: { callbacks: { label: function(context) { var label = 'New lines of code by aider'; var value = context.parsed.y || 0; return `${label}: ${value}`; } } }, title: { display: true, text: 'Lines of new code written by aider, by release', font: { size: 16 } } } } }); });

Last updated