Climate Change Risk Assessment for Investments

Climate Change Risk Assessment for Investments

Define Investment Characteristics

Sector influences exposure to transition risks.

Physical risks vary by location.

Emissions from owned or controlled sources.

Emissions from purchased electricity, heat, etc.

Risk from upstream/downstream emissions (Scope 3).

Risk from current and future climate policies.

How critical is water for direct operations?

Efforts to reduce or respond to climate risks.

Adaptation & Mitigation Measures: ${results.inputs.adaptationMeasures}

Overall Climate Risk Score: ${results.scores.overallClimateRisk.toFixed(1)} / 100

Risk Level: ${overallRiskLevel}

Risk Category Score (0-100) Description
Physical Risk: ${results.scores.physicalRisk.toFixed(1)} Exposure to direct impacts of climate change (e.g., extreme weather, water scarcity).
Transition Risk: ${results.scores.transitionRisk.toFixed(1)} Exposure to risks from transitioning to a low-carbon economy (e.g., policy, technology).

Disclaimer: This tool provides *simulated* climate risk assessments for educational and illustrative purposes only. It does not use real-time data, complex climate models, or specific financial projections. It should not be used for actual investment decisions.

`; resultsOutput.innerHTML = tableHtml; } /** * Renders the climate risk breakdown chart. * @param {Object} results - Results from assessClimateRisk. */ function renderClimateRiskChart(results) { if (!results || !results.scores) { chartPlaceholder.classList.remove('hidden'); if (climateRiskChartInstance) { climateRiskChartInstance.destroy(); climateRiskChartInstance = null; } return; } chartPlaceholder.classList.add('hidden'); // Hide placeholder if chart can be rendered const ctx = document.getElementById('climateRiskChart').getContext('2d'); // Destroy existing chart instance if it exists to prevent overlap if (climateRiskChartInstance) { climateRiskChartInstance.destroy(); } const chartLabels = ['Physical Risk', 'Transition Risk']; const chartData = [ results.scores.physicalRisk, results.scores.transitionRisk ]; const chartColors = ['#F59E0B', '#3B82F6']; // Amber, Blue climateRiskChartInstance = new Chart(ctx, { type: 'bar', data: { labels: chartLabels, datasets: [{ label: 'Risk Score (0-100)', data: chartData, backgroundColor: chartColors, borderColor: chartColors.map(color => color.replace('0.2', '1')), borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false }, title: { display: true, text: 'Climate Risk Breakdown by Category', font: { size: 18, family: 'Inter', weight: 'bold' }, color: '#1F2937' }, tooltip: { callbacks: { label: function(context) { return `${context.label}: ${context.parsed.y.toFixed(1)} / 100`; } } } }, scales: { y: { beginAtZero: true, max: 100, title: { display: true, text: 'Risk Score (0-100)', font: { size: 14, family: 'Inter' }, color: '#333' }, ticks: { font: { family: 'Inter' } } }, x: { ticks: { font: { family: 'Inter' } } } } } }); } /** * Handles the PDF download functionality. * Captures the results output and chart canvases to generate a PDF report. */ window.downloadPdf = async function() { if (typeof html2canvas === 'undefined' || typeof jspdf === 'undefined' || typeof jspdf.jsPDF === 'undefined') { displayMessage('PDF generation libraries not loaded. Please try again or refresh.'); return; } hideMessage(); const { jsPDF } = jspdf; const doc = new jsPDF('p', 'pt', 'a4'); // Temporarily show the charts tab to ensure they render on canvas before capturing const chartsTabWasHidden = chartsTab.classList.contains('hidden'); if (chartsTabWasHidden) { chartsTab.classList.remove('hidden'); } // Elements to capture for PDF: results table and then each chart canvas const elementsToCapture = [ document.getElementById('resultsOutput'), document.getElementById('climateRiskChart') ]; let yPos = 40; doc.setFontSize(22); doc.setTextColor(51, 51, 51); doc.text('Climate Change Risk Assessment Report', doc.internal.pageSize.getWidth() / 2, yPos, { align: 'center' }); yPos += 30; doc.setFontSize(12); doc.setTextColor(100, 100, 100); doc.text(`Generated on: ${new Date().toLocaleDateString()}`, doc.internal.pageSize.getWidth() / 2, yPos, { align: 'center' }); yPos += 40; for (const element of elementsToCapture) { try { // For chart canvases, ensure they are rendered. For other elements, ensure visibility if needed. let elementToRender = element; if (element.tagName.toLowerCase() === 'canvas') { if (element.id === 'climateRiskChart' && climateRiskChartInstance === null) { console.warn(`Chart ${element.id} not yet rendered for PDF capture. Skipping.`); continue; } } else { // For non-canvas elements, ensure they are visible for html2canvas const wasHidden = element.classList.contains('hidden'); if (wasHidden) { element.classList.remove('hidden'); } // Capture the element as a canvas elementToRender = await html2canvas(element, { scale: 2, // Increase scale for better resolution in PDF useCORS: true, // Required for images/fonts loaded from other origins if any backgroundColor: '#ffffff' }); if (wasHidden) { element.classList.add('hidden'); // Restore hidden state } } const imgData = elementToRender.toDataURL('image/png'); const imgWidth = 550; // Desired width for image in PDF const imgHeight = (elementToRender.height * imgWidth) / elementToRender.width; if (yPos + imgHeight > doc.internal.pageSize.getHeight() - 40) { doc.addPage(); yPos = 40; } doc.addImage(imgData, 'PNG', (doc.internal.pageSize.getWidth() - imgWidth) / 2, yPos, imgWidth, imgHeight); yPos += imgHeight + 30; } catch (error) { console.error('Error capturing element for PDF:', error); displayMessage('Failed to generate part of the PDF. Please ensure all data is loaded and visible before downloading.'); } } // Restore charts tab hidden state if it was temporarily shown if (chartsTabWasHidden) { chartsTab.classList.add('hidden'); } doc.save('Climate_Change_Risk_Assessment_Report.pdf'); }; // Initial setup: Show the input tab when the DOM is ready showTab('input'); });
Scroll to Top