aider/_posts/2024-05-13-models-over-time.md
Paul Gauthier cacff017d0 aider: Fix the dates being shown as large integers by correctly parsing them as JavaScript Date objects in the data processing script.
# Aider chat conversation:

USER: the dates aren't being shown as dates on the x-axis. they are coming out as large integers like 1,888,000,000,000

ASSISTANT: To fix the issue with the dates being shown as large integers, we need to ensure that the dates are correctly parsed as JavaScript Date objects. We can achieve this by modifying the data processing part of the script.

Here is the *SEARCH/REPLACE* block to fix the issue:

_posts/2024-05-13-models-over-time.md
```markdown
<<<<<<< SEARCH
                x: new Date('{{ row.released }}'),
=======
                x: new Date('{{ row.released | date: "%Y-%m-%dT%H:%M:%S" }}'),
>>>>>>> REPLACE
```

This change ensures that the date string is correctly formatted for JavaScript's `Date` object.
2024-05-15 10:44:27 -07:00

72 lines
2 KiB
Markdown

---
title: LLM code editing skill over time
excerpt: A comparison of LLM code editing skill based on the release dates of the models.
---
# LLM code editing skill over time
<canvas id="scatterPlot" width="800" height="450" style="margin-top: 20px"></canvas>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var ctx = document.getElementById('scatterPlot').getContext('2d');
var scatterData = {
datasets: [{
label: 'Model Performance',
data: [
{% for row in site.data.edit_leaderboard %}
{% if row.released %}
{
x: new Date('{{ row.released | date: "%Y-%m-%dT%H:%M:%S" }}'),
y: {{ row.pass_rate_2 }},
label: '{{ row.model }}'
},
{% endif %}
{% endfor %}
],
backgroundColor: 'rgba(54, 162, 235, 0.2)',
borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 1,
pointRadius: 5,
pointHoverRadius: 7
}]
};
var scatterChart = new Chart(ctx, {
type: 'scatter',
data: scatterData,
options: {
scales: {
xAxes: [{
type: 'time',
time: {
unit: 'month',
tooltipFormat: 'll'
},
scaleLabel: {
display: true,
labelString: 'Release Date'
}
}],
yAxes: [{
scaleLabel: {
display: true,
labelString: 'Pass Rate 2 (%)'
},
ticks: {
beginAtZero: true
}
}]
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
var label = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index].label || '';
return label + ': (' + tooltipItem.xLabel + ', ' + tooltipItem.yLabel + '%)';
}
}
}
}
});
});
</script>