Modify chart to display percentage on y-axis and use lines of code for bubble radius

This commit is contained in:
Paul Gauthier (aider) 2024-07-29 12:04:45 -03:00
parent 148078ecac
commit af92e71932

View file

@ -12,8 +12,8 @@ document.addEventListener('DOMContentLoaded', function () {
{% for row in site.data.blame %} {% for row in site.data.blame %}
{ {
x: '{{ row.end_date }}', x: '{{ row.end_date }}',
y: {{ row.aider_lines }}, y: {{ row.aider_percentage }},
r: {{ row.aider_percentage }}, r: Math.sqrt({{ row.aider_lines }}),
label: '{{ row.end_tag }}', label: '{{ row.end_tag }}',
percentage: {{ row.aider_percentage }} percentage: {{ row.aider_percentage }}
}, },
@ -52,7 +52,7 @@ document.addEventListener('DOMContentLoaded', function () {
y: { y: {
title: { title: {
display: true, display: true,
text: 'Aider Contribution (lines of code)' text: 'Aider Contribution (%)'
}, },
beginAtZero: true, beginAtZero: true,
} }
@ -61,7 +61,7 @@ document.addEventListener('DOMContentLoaded', function () {
tooltip: { tooltip: {
callbacks: { callbacks: {
label: function(context) { label: function(context) {
return `${context.raw.label}: ${context.raw.y} lines (${context.raw.percentage.toFixed(2)}%)`; return `${context.raw.label}: ${context.raw.percentage.toFixed(2)}% (${context.raw.y} lines)`;
} }
} }
}, },