Meditation & Breathwork Progress Tracker
Log a New Session
Record your practice to track your progress.
Your Progress Dashboard
Log a session to see your dashboard!
'; return; } chartCanvas.style.display = 'block'; const labels = sessionData.map(d => d.date); if (progressChart) { progressChart.destroy(); } const meditationData = sessionData.map(d => d.type === 'Meditation' ? { x: d.date, y: d.duration } : { x: d.date, y: null }); const breathworkData = sessionData.map(d => d.type === 'Breathwork' ? { x: d.date, y: d.duration } : { x: d.date, y: null }); const ctx = chartCanvas.getContext('2d'); progressChart = new Chart(ctx, { type: 'line', data: { labels: labels, datasets: [ { label: 'Meditation (mins)', data: meditationData, borderColor: '#38bdf8', backgroundColor: 'rgba(56, 189, 248, 0.1)', tension: 0.1, fill: true }, { label: 'Breathwork (mins)', data: breathworkData, borderColor: '#34d399', backgroundColor: 'rgba(52, 211, 153, 0.1)', tension: 0.1, fill: true } ] }, options: { responsive: true, maintainAspectRatio: false, scales: { x: { type: 'time', time: { unit: 'day', tooltipFormat: 'MMM d, yyyy' } }, y: { beginAtZero: true, title: { display: true, text: 'Duration (minutes)' } } } } }); renderSummaryStats(); }; const renderSummaryStats = () => { const totalMinutes = sessionData.reduce((acc, d) => acc + d.duration, 0); const totalSessions = sessionData.length; const avgDuration = totalSessions > 0 ? totalMinutes / totalSessions : 0; const meditationMinutes = sessionData.filter(d => d.type === 'Meditation').reduce((acc, d) => acc + d.duration, 0); const breathworkMinutes = sessionData.filter(d => d.type === 'Breathwork').reduce((acc, d) => acc + d.duration, 0); summaryStatsContainer.innerHTML = `Total Minutes
${totalMinutes}
Total Sessions
${totalSessions}
Meditation Mins
${meditationMinutes}
Breathwork Mins
${breathworkMinutes}
