GDP Growth: ${gdp}% – ${gdp > 2 ? "Strong growth" : gdp > 0 ? "Moderate growth" : "Contraction"}.

`; analysis += `

Inflation: ${inflation}% – ${inflation > 3 ? "High inflation pressure" : inflation > 1 ? "Stable inflation" : "Low inflation risk"}.

`; analysis += `

Unemployment: ${unemployment}% – ${unemployment < 5 ? "Healthy job market" : "Elevated unemployment"}

`; analysis += `

Interest Rate: ${interest}% – ${interest > 4 ? "Tight monetary policy" : interest < 1 ? "Accommodative policy" : "Neutral stance"}

`; document.getElementById("analysisOutput").innerHTML = analysis; document.getElementById("reportContent").innerHTML = analysis; showTab(2); }; window.resetSimulator = function () { document.getElementById("gdp").value = ''; document.getElementById("inflation").value = ''; document.getElementById("unemployment").value = ''; document.getElementById("interest").value = ''; document.getElementById("analysisOutput").innerHTML = ''; document.getElementById("reportContent").innerHTML = ''; showTab(0); }; document.getElementById("downloadBtn").addEventListener("click", function () { const resultText = document.getElementById("reportContent").innerText; if (!resultText.trim()) { alert("Nothing to export."); return; } const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(14); doc.text("Macro-Economic Data Interpretation Report", 20, 20); doc.setFontSize(11); const lines = doc.splitTextToSize(resultText, 180); doc.text(lines, 20, 40); doc.save("macro_economic_analysis.pdf"); }); });
Scroll to Top