chore(monorepo): move everything into subdirectory for easy diffing

This commit is contained in:
Elian Doran
2025-04-18 01:28:32 +03:00
parent 3b69eadbf6
commit 318808f9ec
2646 changed files with 654 additions and 654 deletions

View File

@@ -0,0 +1,46 @@
async function getChartData() {
const days = await api.runOnBackend(() => {
const notes = api.getNotesWithLabel('weight');
const days = [];
for (const note of notes) {
const date = note.getLabelValue('dateNote');
const weight = parseFloat(note.getLabelValue('weight'));
if (date && weight) {
days.push({ date, weight });
}
}
days.sort((a, b) => a.date > b.date ? 1 : -1);
return days;
});
const datasets = [
{
label: "Weight (kg)",
backgroundColor: 'red',
borderColor: 'red',
data: days.map(day => day.weight),
fill: false,
spanGaps: true,
datalabels: {
display: false
},
tension: 0.3
}
];
return {
datasets: datasets,
labels: days.map(day => day.date)
};
}
const ctx = api.$container.find("canvas")[0].getContext("2d");
new chartjs.Chart(ctx, {
type: 'line',
data: await getChartData()
});