Behavioral Pattern & Motivation Insights

Behavioral Pattern & Motivation Insights

Log your actions to uncover patterns and understand your motivations.

Your insights will appear here. Go to 'Log Configuration' to add entries.

Log Your Behaviors

Your insights will appear here. Go to 'Log Configuration' to add entries.

`; return; } const insights = analyzeData(data); let dashboardHTML = `

Key Insights

`; for (const behavior in insights) { const insight = insights[behavior]; dashboardHTML += `

${behavior} (${insight.count} times)

Most Common Trigger:
${insight.mostCommonTrigger}

Most Common Outcome:
${insight.mostCommonOutcome}

`; } dashboardHTML += `

Full Log

`; data.forEach(item => { dashboardHTML += ``; }); dashboardHTML += `
Behavior Trigger Outcome
${item.behavior} ${item.trigger} ${item.outcome}
`; dashboardOutput.innerHTML = dashboardHTML; } function downloadPDF() { const data = getLogData(); if (data.length === 0) { console.warn("No data to export."); return; } const { jsPDF } = window.jspdf; const doc = new jsPDF(); const tableData = data.map(item => [item.behavior, item.trigger, item.outcome]); doc.setFontSize(18); doc.text('Behavioral Insights Report', 14, 22); doc.setFontSize(11); doc.setTextColor(100); doc.text(`Report as of: ${new Date().toLocaleDateString()}`, 14, 30); doc.autoTable({ head: [['Behavior', 'Trigger', 'Outcome']], body: tableData, startY: 35, theme: 'grid', headStyles: { fillColor: [147, 51, 234] }, // Purple-600 }); doc.save('Behavioral-Insights-Report.pdf'); } // --- Event Listeners --- addLogBtn.addEventListener('click', addLogForm); downloadPdfBtn.addEventListener('click', downloadPDF); // --- Initial Setup --- updateNavButtons(); generateDashboard(); });
Scroll to Top